dbf-halloween2015

changeset 1:c3f5c32cb210

barfed all the libraries in the source tree to make porting easier
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 01 Nov 2015 00:36:56 +0200
parents 50683c78264e
children 5ae5fd3626fa
files .hgignore Makefile libs/imago/conv.c libs/imago/file_jpeg.c libs/imago/file_png.c libs/imago/file_ppm.c libs/imago/file_rgbe.c libs/imago/ftype_module.c libs/imago/ftype_module.h libs/imago/imago2.c libs/imago/imago2.h libs/imago/imago_gl.c libs/imago/modules.c libs/libjpeg/README libs/libjpeg/cderror.h libs/libjpeg/jcapimin.c libs/libjpeg/jcapistd.c libs/libjpeg/jccoefct.c libs/libjpeg/jccolor.c libs/libjpeg/jcdctmgr.c libs/libjpeg/jchuff.c libs/libjpeg/jchuff.h libs/libjpeg/jcinit.c libs/libjpeg/jcmainct.c libs/libjpeg/jcmarker.c libs/libjpeg/jcmaster.c libs/libjpeg/jcomapi.c libs/libjpeg/jconfig.h libs/libjpeg/jcparam.c libs/libjpeg/jcphuff.c libs/libjpeg/jcprepct.c libs/libjpeg/jcsample.c libs/libjpeg/jctrans.c libs/libjpeg/jdapimin.c libs/libjpeg/jdapistd.c libs/libjpeg/jdatadst.c libs/libjpeg/jdatasrc.c libs/libjpeg/jdcoefct.c libs/libjpeg/jdcolor.c libs/libjpeg/jdct.h libs/libjpeg/jddctmgr.c libs/libjpeg/jdhuff.c libs/libjpeg/jdhuff.h libs/libjpeg/jdinput.c libs/libjpeg/jdmainct.c libs/libjpeg/jdmarker.c libs/libjpeg/jdmaster.c libs/libjpeg/jdmerge.c libs/libjpeg/jdphuff.c libs/libjpeg/jdpostct.c libs/libjpeg/jdsample.c libs/libjpeg/jdtrans.c libs/libjpeg/jerror.c libs/libjpeg/jerror.h libs/libjpeg/jfdctflt.c libs/libjpeg/jfdctfst.c libs/libjpeg/jfdctint.c libs/libjpeg/jidctflt.c libs/libjpeg/jidctfst.c libs/libjpeg/jidctint.c libs/libjpeg/jidctred.c libs/libjpeg/jinclude.h libs/libjpeg/jmemmgr.c libs/libjpeg/jmemnobs.c libs/libjpeg/jmemsys.h libs/libjpeg/jmorecfg.h libs/libjpeg/jpegint.h libs/libjpeg/jpeglib.h libs/libjpeg/jquant1.c libs/libjpeg/jquant2.c libs/libjpeg/jutils.c libs/libjpeg/jversion.h libs/libpng/LICENSE libs/libpng/png.c libs/libpng/png.h libs/libpng/pngconf.h libs/libpng/pngerror.c libs/libpng/pnggccrd.c libs/libpng/pngget.c libs/libpng/pngmem.c libs/libpng/pngpread.c libs/libpng/pngread.c libs/libpng/pngrio.c libs/libpng/pngrtran.c libs/libpng/pngrutil.c libs/libpng/pngset.c libs/libpng/pngtrans.c libs/libpng/pngvcrd.c libs/libpng/pngwio.c libs/libpng/pngwrite.c libs/libpng/pngwtran.c libs/libpng/pngwutil.c libs/ogg/AUTHORS libs/ogg/COPYING libs/ogg/bitwise.c libs/ogg/config_types.h libs/ogg/framing.c libs/ogg/ogg.h libs/ogg/os_types.h libs/vmath/basis.cc libs/vmath/basis.h libs/vmath/basis_c.c libs/vmath/geom.c libs/vmath/geom.h libs/vmath/matrix.cc libs/vmath/matrix.h libs/vmath/matrix.inl libs/vmath/matrix_c.c libs/vmath/quat.cc libs/vmath/quat.h libs/vmath/quat.inl libs/vmath/quat_c.c libs/vmath/ray.cc libs/vmath/ray.h libs/vmath/ray.inl libs/vmath/ray_c.c libs/vmath/sphvec.cc libs/vmath/sphvec.h libs/vmath/vector.cc libs/vmath/vector.h libs/vmath/vector.inl libs/vmath/vmath.c libs/vmath/vmath.h libs/vmath/vmath.inl libs/vmath/vmath_config.h libs/vmath/vmath_types.h libs/vorbis/AUTHORS libs/vorbis/COPYING libs/vorbis/analysis.c libs/vorbis/backends.h libs/vorbis/bitrate.c libs/vorbis/bitrate.h libs/vorbis/block.c libs/vorbis/books/coupled/res_books_51.h libs/vorbis/books/coupled/res_books_stereo.h libs/vorbis/books/floor/floor_books.h libs/vorbis/books/uncoupled/res_books_uncoupled.h libs/vorbis/codebook.c libs/vorbis/codebook.h libs/vorbis/codec.h libs/vorbis/codec_internal.h libs/vorbis/envelope.c libs/vorbis/envelope.h libs/vorbis/floor0.c libs/vorbis/floor1.c libs/vorbis/highlevel.h libs/vorbis/info.c libs/vorbis/lookup.c libs/vorbis/lookup.h libs/vorbis/lookup_data.h libs/vorbis/lpc.c libs/vorbis/lpc.h libs/vorbis/lsp.c libs/vorbis/lsp.h libs/vorbis/mapping0.c libs/vorbis/masking.h libs/vorbis/mdct.c libs/vorbis/mdct.h libs/vorbis/misc.h libs/vorbis/modes/floor_all.h libs/vorbis/modes/psych_11.h libs/vorbis/modes/psych_16.h libs/vorbis/modes/psych_44.h libs/vorbis/modes/psych_8.h libs/vorbis/modes/residue_16.h libs/vorbis/modes/residue_44.h libs/vorbis/modes/residue_44p51.h libs/vorbis/modes/residue_44u.h libs/vorbis/modes/residue_8.h libs/vorbis/modes/setup_11.h libs/vorbis/modes/setup_16.h libs/vorbis/modes/setup_22.h libs/vorbis/modes/setup_32.h libs/vorbis/modes/setup_44.h libs/vorbis/modes/setup_44p51.h libs/vorbis/modes/setup_44u.h libs/vorbis/modes/setup_8.h libs/vorbis/modes/setup_X.h libs/vorbis/os.h libs/vorbis/psy.c libs/vorbis/psy.h libs/vorbis/registry.c libs/vorbis/registry.h libs/vorbis/res0.c libs/vorbis/scales.h libs/vorbis/sharedbook.c libs/vorbis/smallft.c libs/vorbis/smallft.h libs/vorbis/synthesis.c libs/vorbis/vorbisenc.c libs/vorbis/vorbisenc.h libs/vorbis/vorbisfile.c libs/vorbis/vorbisfile.h libs/vorbis/window.c libs/vorbis/window.h libs/zlib/LICENSE libs/zlib/adler32.c libs/zlib/compress.c libs/zlib/crc32.c libs/zlib/crc32.h libs/zlib/deflate.c libs/zlib/deflate.h libs/zlib/gzio.c libs/zlib/infback.c libs/zlib/inffast.c libs/zlib/inffast.h libs/zlib/inffixed.h libs/zlib/inflate.c libs/zlib/inflate.h libs/zlib/inftrees.c libs/zlib/inftrees.h libs/zlib/trees.c libs/zlib/trees.h libs/zlib/uncompr.c libs/zlib/zconf.h libs/zlib/zlib.h libs/zlib/zutil.c libs/zlib/zutil.h
diffstat 218 files changed, 132171 insertions(+), 8 deletions(-) [+]
line diff
     1.1 --- a/.hgignore	Sun Nov 01 00:09:12 2015 +0200
     1.2 +++ b/.hgignore	Sun Nov 01 00:36:56 2015 +0200
     1.3 @@ -3,6 +3,7 @@
     1.4  \.d$
     1.5  \.jpg$
     1.6  \.png$
     1.7 -^data/
     1.8 +^data
     1.9  ^bin/
    1.10  ^lib/
    1.11 +^halloween$
     2.1 --- a/Makefile	Sun Nov 01 00:09:12 2015 +0200
     2.2 +++ b/Makefile	Sun Nov 01 00:36:56 2015 +0200
     2.3 @@ -1,17 +1,39 @@
     2.4 -src = $(wildcard src/*.cc) $(wildcard src/audio/*.cc)
     2.5 -csrc = $(wildcard src/*.c) $(wildcard src/dsys/*.c)
     2.6 +src = $(wildcard src/*.cc) \
     2.7 +	  $(wildcard src/audio/*.cc) \
     2.8 +	  $(wildcard libs/vmath/*.cc)
     2.9 +csrc = $(wildcard src/*.c) \
    2.10 +	   $(wildcard src/dsys/*.c) \
    2.11 +	   $(wildcard libs/vmath/*.c) \
    2.12 +	   $(wildcard libs/imago/*.c) \
    2.13 +	   $(wildcard libs/libjpeg/*.c) \
    2.14 +	   $(wildcard libs/libpng/*.c) \
    2.15 +	   $(wildcard libs/zlib/*.c) \
    2.16 +	   $(wildcard libs/ogg/*.c) \
    2.17 +	   $(wildcard libs/vorbis/*.c)
    2.18 +
    2.19  obj = $(src:.cc=.o) $(csrc:.c=.o)
    2.20  dep = $(obj:.o=.d)
    2.21  bin = halloween
    2.22  
    2.23  opt = -O2
    2.24  
    2.25 -CFLAGS = -pedantic -Wall -g $(opt) -Isrc
    2.26 -CXXFLAGS = -pedantic -Wall -g $(opt) -Isrc
    2.27 -LDFLAGS = -lGL -lGLU -lglut -lGLEW -lvmath -limago -lm -ldl -lpthread \
    2.28 -		  -lvorbisfile -logg -lpthread -lopenal
    2.29 +inc = -Isrc -Ilibs/libjpeg -Ilibs/zlib -Ilibs/libpng -Ilibs/imago \
    2.30 +	  -Ilibs/ogg -Ilibs/vorbis
    2.31  
    2.32 -$(bin): $(obj)
    2.33 +CFLAGS = -pedantic -Wall -g $(opt) $(inc)
    2.34 +CXXFLAGS = -pedantic -Wall -g $(opt) $(inc)
    2.35 +LDFLAGS = $(libgl) $(libal) -lm -ldl -lpthread
    2.36 +
    2.37 +sys = $(shell uname -s)
    2.38 +ifeq ($(sys), Darwin)
    2.39 +	libgl = -lGL -lGLU -lglut -lGLEW
    2.40 +	libal = -lopenal
    2.41 +else
    2.42 +	libgl = -framework OpenGL -framework GLUT -lGLEW
    2.43 +	libal = -framework OpenAL
    2.44 +endif
    2.45 +
    2.46 +$(bin): $(obj) Makefile
    2.47  	$(CXX) -o $@ $(obj) $(LDFLAGS)
    2.48  
    2.49  -include $(dep)
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/libs/imago/conv.c	Sun Nov 01 00:36:56 2015 +0200
     3.3 @@ -0,0 +1,260 @@
     3.4 +/*
     3.5 +libimago - a multi-format image file input/output library.
     3.6 +Copyright (C) 2010 John Tsiombikas <nuclear@member.fsf.org>
     3.7 +
     3.8 +This program is free software: you can redistribute it and/or modify
     3.9 +it under the terms of the GNU Lesser General Public License as published
    3.10 +by the Free Software Foundation, either version 3 of the License, or
    3.11 +(at your option) any later version.
    3.12 +
    3.13 +This program is distributed in the hope that it will be useful,
    3.14 +but WITHOUT ANY WARRANTY; without even the implied warranty of
    3.15 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    3.16 +GNU Lesser General Public License for more details.
    3.17 +
    3.18 +You should have received a copy of the GNU Lesser General Public License
    3.19 +along with this program.  If not, see <http://www.gnu.org/licenses/>.
    3.20 +*/
    3.21 +#include <string.h>
    3.22 +#include "imago2.h"
    3.23 +
    3.24 +/* pixel-format conversions are sub-optimal at the moment to avoid
    3.25 + * writing a lot of code. optimize at some point ?
    3.26 + */
    3.27 +
    3.28 +#define CLAMP(x, a, b)	((x) < (a) ? (a) : ((x) > (b) ? (b) : (x)))
    3.29 +
    3.30 +struct pixel {
    3.31 +	float r, g, b, a;
    3.32 +};
    3.33 +
    3.34 +static void unpack_grey8(struct pixel *unp, void *pptr, int count);
    3.35 +static void unpack_rgb24(struct pixel *unp, void *pptr, int count);
    3.36 +static void unpack_rgba32(struct pixel *unp, void *pptr, int count);
    3.37 +static void unpack_greyf(struct pixel *unp, void *pptr, int count);
    3.38 +static void unpack_rgbf(struct pixel *unp, void *pptr, int count);
    3.39 +static void unpack_rgbaf(struct pixel *unp, void *pptr, int count);
    3.40 +
    3.41 +static void pack_grey8(void *pptr, struct pixel *unp, int count);
    3.42 +static void pack_rgb24(void *pptr, struct pixel *unp, int count);
    3.43 +static void pack_rgba32(void *pptr, struct pixel *unp, int count);
    3.44 +static void pack_greyf(void *pptr, struct pixel *unp, int count);
    3.45 +static void pack_rgbf(void *pptr, struct pixel *unp, int count);
    3.46 +static void pack_rgbaf(void *pptr, struct pixel *unp, int count);
    3.47 +
    3.48 +/* XXX keep in sync with enum img_fmt at imago2.h */
    3.49 +static void (*unpack[])(struct pixel*, void*, int) = {
    3.50 +	unpack_grey8,
    3.51 +	unpack_rgb24,
    3.52 +	unpack_rgba32,
    3.53 +	unpack_greyf,
    3.54 +	unpack_rgbf,
    3.55 +	unpack_rgbaf
    3.56 +};
    3.57 +
    3.58 +/* XXX keep in sync with enum img_fmt at imago2.h */
    3.59 +static void (*pack[])(void*, struct pixel*, int) = {
    3.60 +	pack_grey8,
    3.61 +	pack_rgb24,
    3.62 +	pack_rgba32,
    3.63 +	pack_greyf,
    3.64 +	pack_rgbf,
    3.65 +	pack_rgbaf
    3.66 +};
    3.67 +
    3.68 +
    3.69 +int img_convert(struct img_pixmap *img, enum img_fmt tofmt)
    3.70 +{
    3.71 +	struct pixel pbuf[8];
    3.72 +	int bufsz = (img->width & 7) == 0 ? 8 : ((img->width & 3) == 0 ? 4 : 1);
    3.73 +	int i, num_pix = img->width * img->height;
    3.74 +	int num_iter = num_pix / bufsz;
    3.75 +	char *sptr, *dptr;
    3.76 +	struct img_pixmap nimg;
    3.77 +
    3.78 +	if(img->fmt == tofmt) {
    3.79 +		return 0;	/* nothing to do */
    3.80 +	}
    3.81 +
    3.82 +	img_init(&nimg);
    3.83 +	if(img_set_pixels(&nimg, img->width, img->height, tofmt, 0) == -1) {
    3.84 +		img_destroy(&nimg);
    3.85 +		return -1;
    3.86 +	}
    3.87 +
    3.88 +	sptr = img->pixels;
    3.89 +	dptr = nimg.pixels;
    3.90 +
    3.91 +	for(i=0; i<num_iter; i++) {
    3.92 +		unpack[img->fmt](pbuf, sptr, bufsz);
    3.93 +		pack[tofmt](dptr, pbuf, bufsz);
    3.94 +
    3.95 +		sptr += bufsz * img->pixelsz;
    3.96 +		dptr += bufsz * nimg.pixelsz;
    3.97 +	}
    3.98 +
    3.99 +	img_copy(img, &nimg);
   3.100 +	img_destroy(&nimg);
   3.101 +	return 0;
   3.102 +}
   3.103 +
   3.104 +/* the following functions *could* benefit from SIMD */
   3.105 +
   3.106 +static void unpack_grey8(struct pixel *unp, void *pptr, int count)
   3.107 +{
   3.108 +	int i;
   3.109 +	unsigned char *pix = pptr;
   3.110 +
   3.111 +	for(i=0; i<count; i++) {
   3.112 +		unp->r = unp->g = unp->b = (float)*pix++ / 255.0;
   3.113 +		unp->a = 1.0;
   3.114 +		unp++;
   3.115 +	}
   3.116 +}
   3.117 +
   3.118 +static void unpack_rgb24(struct pixel *unp, void *pptr, int count)
   3.119 +{
   3.120 +	int i;
   3.121 +	unsigned char *pix = pptr;
   3.122 +
   3.123 +	for(i=0; i<count; i++) {
   3.124 +		unp->r = (float)*pix++ / 255.0;
   3.125 +		unp->g = (float)*pix++ / 255.0;
   3.126 +		unp->b = (float)*pix++ / 255.0;
   3.127 +		unp->a = 1.0;
   3.128 +		unp++;
   3.129 +	}
   3.130 +}
   3.131 +
   3.132 +static void unpack_rgba32(struct pixel *unp, void *pptr, int count)
   3.133 +{
   3.134 +	int i;
   3.135 +	unsigned char *pix = pptr;
   3.136 +
   3.137 +	for(i=0; i<count; i++) {
   3.138 +		unp->r = (float)*pix++ / 255.0;
   3.139 +		unp->g = (float)*pix++ / 255.0;
   3.140 +		unp->b = (float)*pix++ / 255.0;
   3.141 +		unp->a = (float)*pix++ / 255.0;
   3.142 +		unp++;
   3.143 +	}
   3.144 +}
   3.145 +
   3.146 +static void unpack_greyf(struct pixel *unp, void *pptr, int count)
   3.147 +{
   3.148 +	int i;
   3.149 +	float *pix = pptr;
   3.150 +
   3.151 +	for(i=0; i<count; i++) {
   3.152 +		unp->r = unp->g = unp->b = *pix++;
   3.153 +		unp->a = 1.0;
   3.154 +		unp++;
   3.155 +	}
   3.156 +}
   3.157 +
   3.158 +static void unpack_rgbf(struct pixel *unp, void *pptr, int count)
   3.159 +{
   3.160 +	int i;
   3.161 +	float *pix = pptr;
   3.162 +
   3.163 +	for(i=0; i<count; i++) {
   3.164 +		unp->r = *pix++;
   3.165 +		unp->g = *pix++;
   3.166 +		unp->b = *pix++;
   3.167 +		unp->a = 1.0;
   3.168 +		unp++;
   3.169 +	}
   3.170 +}
   3.171 +
   3.172 +static void unpack_rgbaf(struct pixel *unp, void *pptr, int count)
   3.173 +{
   3.174 +	int i;
   3.175 +	float *pix = pptr;
   3.176 +
   3.177 +	for(i=0; i<count; i++) {
   3.178 +		unp->r = *pix++;
   3.179 +		unp->g = *pix++;
   3.180 +		unp->b = *pix++;
   3.181 +		unp->a = *pix++;
   3.182 +		unp++;
   3.183 +	}
   3.184 +}
   3.185 +
   3.186 +
   3.187 +static void pack_grey8(void *pptr, struct pixel *unp, int count)
   3.188 +{
   3.189 +	int i;
   3.190 +	unsigned char *pix = pptr;
   3.191 +
   3.192 +	for(i=0; i<count; i++) {
   3.193 +		int lum = (int)(255.0 * (unp->r + unp->g + unp->b) / 3.0);
   3.194 +		*pix++ = CLAMP(lum, 0, 255);
   3.195 +		unp++;
   3.196 +	}
   3.197 +}
   3.198 +
   3.199 +static void pack_rgb24(void *pptr, struct pixel *unp, int count)
   3.200 +{
   3.201 +	int i;
   3.202 +	unsigned char *pix = pptr;
   3.203 +
   3.204 +	for(i=0; i<count; i++) {
   3.205 +		int r = (int)(unp->r * 255.0);
   3.206 +		int g = (int)(unp->g * 255.0);
   3.207 +		int b = (int)(unp->b * 255.0);
   3.208 +
   3.209 +		*pix++ = CLAMP(r, 0, 255);
   3.210 +		*pix++ = CLAMP(g, 0, 255);
   3.211 +		*pix++ = CLAMP(b, 0, 255);
   3.212 +		unp++;
   3.213 +	}
   3.214 +}
   3.215 +
   3.216 +static void pack_rgba32(void *pptr, struct pixel *unp, int count)
   3.217 +{
   3.218 +	int i;
   3.219 +	unsigned char *pix = pptr;
   3.220 +
   3.221 +	for(i=0; i<count; i++) {
   3.222 +		int r = (int)(unp->r * 255.0);
   3.223 +		int g = (int)(unp->g * 255.0);
   3.224 +		int b = (int)(unp->b * 255.0);
   3.225 +		int a = (int)(unp->a * 255.0);
   3.226 +
   3.227 +		*pix++ = CLAMP(r, 0, 255);
   3.228 +		*pix++ = CLAMP(g, 0, 255);
   3.229 +		*pix++ = CLAMP(b, 0, 255);
   3.230 +		*pix++ = CLAMP(a, 0, 255);
   3.231 +		unp++;
   3.232 +	}
   3.233 +}
   3.234 +
   3.235 +static void pack_greyf(void *pptr, struct pixel *unp, int count)
   3.236 +{
   3.237 +	int i;
   3.238 +	float *pix = pptr;
   3.239 +
   3.240 +	for(i=0; i<count; i++) {
   3.241 +		*pix++ = (unp->r + unp->g + unp->b) / 3.0;
   3.242 +		unp++;
   3.243 +	}
   3.244 +}
   3.245 +
   3.246 +static void pack_rgbf(void *pptr, struct pixel *unp, int count)
   3.247 +{
   3.248 +	int i;
   3.249 +	float *pix = pptr;
   3.250 +
   3.251 +	for(i=0; i<count; i++) {
   3.252 +		*pix++ = unp->r;
   3.253 +		*pix++ = unp->g;
   3.254 +		*pix++ = unp->b;
   3.255 +		unp++;
   3.256 +	}
   3.257 +}
   3.258 +
   3.259 +static void pack_rgbaf(void *pptr, struct pixel *unp, int count)
   3.260 +{
   3.261 +	memcpy(pptr, unp, count * sizeof *unp);
   3.262 +}
   3.263 +
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/libs/imago/file_jpeg.c	Sun Nov 01 00:36:56 2015 +0200
     4.3 @@ -0,0 +1,294 @@
     4.4 +/*
     4.5 +libimago - a multi-format image file input/output library.
     4.6 +Copyright (C) 2010 John Tsiombikas <nuclear@member.fsf.org>
     4.7 +
     4.8 +This program is free software: you can redistribute it and/or modify
     4.9 +it under the terms of the GNU Lesser General Public License as published
    4.10 +by the Free Software Foundation, either version 3 of the License, or
    4.11 +(at your option) any later version.
    4.12 +
    4.13 +This program is distributed in the hope that it will be useful,
    4.14 +but WITHOUT ANY WARRANTY; without even the implied warranty of
    4.15 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    4.16 +GNU Lesser General Public License for more details.
    4.17 +
    4.18 +You should have received a copy of the GNU Lesser General Public License
    4.19 +along with this program.  If not, see <http://www.gnu.org/licenses/>.
    4.20 +*/
    4.21 +
    4.22 +/* -- JPEG module -- */
    4.23 +
    4.24 +#include <stdio.h>
    4.25 +#include <stdlib.h>
    4.26 +#include <string.h>
    4.27 +
    4.28 +#ifdef WIN32
    4.29 +#include <windows.h>
    4.30 +#define HAVE_BOOLEAN
    4.31 +#endif
    4.32 +
    4.33 +#include <jpeglib.h>
    4.34 +#include "imago2.h"
    4.35 +#include "ftype_module.h"
    4.36 +
    4.37 +#define INPUT_BUF_SIZE	512
    4.38 +#define OUTPUT_BUF_SIZE	512
    4.39 +
    4.40 +/* data source manager: adapted from jdatasrc.c */
    4.41 +struct src_mgr {
    4.42 +	struct jpeg_source_mgr pub;
    4.43 +
    4.44 +	struct img_io *io;
    4.45 +	unsigned char buffer[INPUT_BUF_SIZE];
    4.46 +	int start_of_file;
    4.47 +};
    4.48 +
    4.49 +/* data destination manager: adapted from jdatadst.c */
    4.50 +struct dst_mgr {
    4.51 +	struct jpeg_destination_mgr pub;
    4.52 +
    4.53 +	struct img_io *io;
    4.54 +	unsigned char buffer[OUTPUT_BUF_SIZE];
    4.55 +};
    4.56 +
    4.57 +static int check(struct img_io *io);
    4.58 +static int readbuf(struct img_pixmap *img, struct img_io *io);
    4.59 +static int writebuf(struct img_pixmap *img, struct img_io *io);
    4.60 +
    4.61 +/* read source functions */
    4.62 +static void init_source(j_decompress_ptr jd);
    4.63 +static boolean fill_input_buffer(j_decompress_ptr jd);
    4.64 +static void skip_input_data(j_decompress_ptr jd, long num_bytes);
    4.65 +static void term_source(j_decompress_ptr jd);
    4.66 +
    4.67 +/* write destination functions */
    4.68 +static void init_destination(j_compress_ptr jc);
    4.69 +static boolean empty_output_buffer(j_compress_ptr jc);
    4.70 +static void term_destination(j_compress_ptr jc);
    4.71 +
    4.72 +int img_register_jpeg(void)
    4.73 +{
    4.74 +	static struct ftype_module mod = {".jpg", check, readbuf, writebuf};
    4.75 +	return img_register_module(&mod);
    4.76 +}
    4.77 +
    4.78 +
    4.79 +static int check(struct img_io *io)
    4.80 +{
    4.81 +	unsigned char sig[10];
    4.82 +
    4.83 +	long pos = io->seek(0, SEEK_CUR, io->uptr);
    4.84 +
    4.85 +	if(io->read(sig, 10, io->uptr) < 10) {
    4.86 +		io->seek(pos, SEEK_SET, io->uptr);
    4.87 +		return -1;
    4.88 +	}
    4.89 +
    4.90 +	if(memcmp(sig, "\xff\xd8\xff\xe0", 4) != 0 && memcmp(sig, "\xff\xd8\xff\xe1", 4) != 0
    4.91 +			&& memcmp(sig + 6, "JFIF", 4) != 0) {
    4.92 +		io->seek(pos, SEEK_SET, io->uptr);
    4.93 +		return -1;
    4.94 +	}
    4.95 +	io->seek(pos, SEEK_SET, io->uptr);
    4.96 +	return 0;
    4.97 +}
    4.98 +
    4.99 +static int readbuf(struct img_pixmap *img, struct img_io *io)
   4.100 +{
   4.101 +	int i, nlines = 0;
   4.102 +	struct jpeg_decompress_struct cinfo;
   4.103 +	struct jpeg_error_mgr jerr;
   4.104 +	struct src_mgr src;
   4.105 +	unsigned char **scanlines;
   4.106 +
   4.107 +	io->seek(0, SEEK_CUR, io->uptr);
   4.108 +
   4.109 +	cinfo.err = jpeg_std_error(&jerr);	/* XXX change... */
   4.110 +	jpeg_create_decompress(&cinfo);
   4.111 +
   4.112 +	src.pub.init_source = init_source;
   4.113 +	src.pub.fill_input_buffer = fill_input_buffer;
   4.114 +	src.pub.skip_input_data = skip_input_data;
   4.115 +	src.pub.resync_to_restart = jpeg_resync_to_restart;
   4.116 +	src.pub.term_source = term_source;
   4.117 +	src.pub.next_input_byte = 0;
   4.118 +	src.pub.bytes_in_buffer = 0;
   4.119 +	src.io = io;
   4.120 +	cinfo.src = (struct jpeg_source_mgr*)&src;
   4.121 +
   4.122 +	jpeg_read_header(&cinfo, 1);
   4.123 +	cinfo.out_color_space = JCS_RGB;
   4.124 +
   4.125 +	if(img_set_pixels(img, cinfo.image_width, cinfo.image_height, IMG_FMT_RGB24, 0) == -1) {
   4.126 +		jpeg_destroy_decompress(&cinfo);
   4.127 +		return -1;
   4.128 +	}
   4.129 +
   4.130 +	if(!(scanlines = malloc(img->height * sizeof *scanlines))) {
   4.131 +		jpeg_destroy_decompress(&cinfo);
   4.132 +		return -1;
   4.133 +	}
   4.134 +	scanlines[0] = img->pixels;
   4.135 +	for(i=1; i<img->height; i++) {
   4.136 +		scanlines[i] = scanlines[i - 1] + img->width * img->pixelsz;
   4.137 +	}
   4.138 +
   4.139 +	jpeg_start_decompress(&cinfo);
   4.140 +	while(nlines < img->height) {
   4.141 +		int res = jpeg_read_scanlines(&cinfo, scanlines + nlines, img->height - nlines);
   4.142 +		nlines += res;
   4.143 +	}
   4.144 +	jpeg_finish_decompress(&cinfo);
   4.145 +	jpeg_destroy_decompress(&cinfo);
   4.146 +
   4.147 +	free(scanlines);
   4.148 +	return 0;
   4.149 +}
   4.150 +
   4.151 +static int writebuf(struct img_pixmap *img, struct img_io *io)
   4.152 +{
   4.153 +	int i, nlines = 0;
   4.154 +	struct jpeg_compress_struct cinfo;
   4.155 +	struct jpeg_error_mgr jerr;
   4.156 +	struct dst_mgr dest;
   4.157 +	struct img_pixmap tmpimg;
   4.158 +	unsigned char **scanlines;
   4.159 +
   4.160 +	img_init(&tmpimg);
   4.161 +
   4.162 +	if(img->fmt != IMG_FMT_RGB24) {
   4.163 +		if(img_copy(&tmpimg, img) == -1) {
   4.164 +			return -1;
   4.165 +		}
   4.166 +		if(img_convert(&tmpimg, IMG_FMT_RGB24) == -1) {
   4.167 +			img_destroy(&tmpimg);
   4.168 +			return -1;
   4.169 +		}
   4.170 +		img = &tmpimg;
   4.171 +	}
   4.172 +
   4.173 +	if(!(scanlines = malloc(img->height * sizeof *scanlines))) {
   4.174 +		img_destroy(&tmpimg);
   4.175 +		return -1;
   4.176 +	}
   4.177 +	scanlines[0] = img->pixels;
   4.178 +	for(i=1; i<img->height; i++) {
   4.179 +		scanlines[i] = scanlines[i - 1] + img->width * img->pixelsz;
   4.180 +	}
   4.181 +
   4.182 +	cinfo.err = jpeg_std_error(&jerr);	/* XXX */
   4.183 +	jpeg_create_compress(&cinfo);
   4.184 +
   4.185 +	dest.pub.init_destination = init_destination;
   4.186 +	dest.pub.empty_output_buffer = empty_output_buffer;
   4.187 +	dest.pub.term_destination = term_destination;
   4.188 +	dest.io = io;
   4.189 +	cinfo.dest = (struct jpeg_destination_mgr*)&dest;
   4.190 +
   4.191 +	cinfo.image_width = img->width;
   4.192 +	cinfo.image_height = img->height;
   4.193 +	cinfo.input_components = 3;
   4.194 +	cinfo.in_color_space = JCS_RGB;
   4.195 +
   4.196 +	jpeg_set_defaults(&cinfo);
   4.197 +
   4.198 +	jpeg_start_compress(&cinfo, 1);
   4.199 +	while(nlines < img->height) {
   4.200 +		int res = jpeg_write_scanlines(&cinfo, scanlines + nlines, img->height - nlines);
   4.201 +		nlines += res;
   4.202 +	}
   4.203 +	jpeg_finish_compress(&cinfo);
   4.204 +	jpeg_destroy_compress(&cinfo);
   4.205 +
   4.206 +	free(scanlines);
   4.207 +	img_destroy(&tmpimg);
   4.208 +	return 0;
   4.209 +}
   4.210 +
   4.211 +/* -- read source functions --
   4.212 + * the following functions are adapted from jdatasrc.c in jpeglib
   4.213 + */
   4.214 +static void init_source(j_decompress_ptr jd)
   4.215 +{
   4.216 +	struct src_mgr *src = (struct src_mgr*)jd->src;
   4.217 +	src->start_of_file = 1;
   4.218 +}
   4.219 +
   4.220 +static boolean fill_input_buffer(j_decompress_ptr jd)
   4.221 +{
   4.222 +	struct src_mgr *src = (struct src_mgr*)jd->src;
   4.223 +	size_t nbytes;
   4.224 +
   4.225 +	nbytes = src->io->read(src->buffer, INPUT_BUF_SIZE, src->io->uptr);
   4.226 +
   4.227 +	if(nbytes <= 0) {
   4.228 +		if(src->start_of_file) {
   4.229 +			return 0;
   4.230 +		}
   4.231 +		/* insert a fake EOI marker */
   4.232 +		src->buffer[0] = 0xff;
   4.233 +		src->buffer[1] = JPEG_EOI;
   4.234 +		nbytes = 2;
   4.235 +	}
   4.236 +
   4.237 +	src->pub.next_input_byte = src->buffer;
   4.238 +	src->pub.bytes_in_buffer = nbytes;
   4.239 +	src->start_of_file = 0;
   4.240 +	return 1;
   4.241 +}
   4.242 +
   4.243 +static void skip_input_data(j_decompress_ptr jd, long num_bytes)
   4.244 +{
   4.245 +	struct src_mgr *src = (struct src_mgr*)jd->src;
   4.246 +
   4.247 +	if(num_bytes > 0) {
   4.248 +		while(num_bytes > (long)src->pub.bytes_in_buffer) {
   4.249 +			num_bytes -= (long)src->pub.bytes_in_buffer;
   4.250 +			fill_input_buffer(jd);
   4.251 +		}
   4.252 +		src->pub.next_input_byte += (size_t)num_bytes;
   4.253 +		src->pub.bytes_in_buffer -= (size_t)num_bytes;
   4.254 +	}
   4.255 +}
   4.256 +
   4.257 +static void term_source(j_decompress_ptr jd)
   4.258 +{
   4.259 +	/* nothing to see here, move along */
   4.260 +}
   4.261 +
   4.262 +
   4.263 +/* -- write destination functions --
   4.264 + * the following functions are adapted from jdatadst.c in jpeglib
   4.265 + */
   4.266 +static void init_destination(j_compress_ptr jc)
   4.267 +{
   4.268 +	struct dst_mgr *dest = (struct dst_mgr*)jc->dest;
   4.269 +
   4.270 +	dest->pub.next_output_byte = dest->buffer;
   4.271 +	dest->pub.free_in_buffer = OUTPUT_BUF_SIZE;
   4.272 +}
   4.273 +
   4.274 +static boolean empty_output_buffer(j_compress_ptr jc)
   4.275 +{
   4.276 +	struct dst_mgr *dest = (struct dst_mgr*)jc->dest;
   4.277 +
   4.278 +	if(dest->io->write(dest->buffer, OUTPUT_BUF_SIZE, dest->io->uptr) != OUTPUT_BUF_SIZE) {
   4.279 +		return 0;
   4.280 +	}
   4.281 +
   4.282 +	dest->pub.next_output_byte = dest->buffer;
   4.283 +	dest->pub.free_in_buffer = OUTPUT_BUF_SIZE;
   4.284 +	return 1;
   4.285 +}
   4.286 +
   4.287 +static void term_destination(j_compress_ptr jc)
   4.288 +{
   4.289 +	struct dst_mgr *dest = (struct dst_mgr*)jc->dest;
   4.290 +	size_t datacount = OUTPUT_BUF_SIZE - dest->pub.free_in_buffer;
   4.291 +
   4.292 +	/* write any remaining data in the buffer */
   4.293 +	if(datacount > 0) {
   4.294 +		dest->io->write(dest->buffer, datacount, dest->io->uptr);
   4.295 +	}
   4.296 +	/* XXX flush? ... */
   4.297 +}
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/libs/imago/file_png.c	Sun Nov 01 00:36:56 2015 +0200
     5.3 @@ -0,0 +1,261 @@
     5.4 +/*
     5.5 +libimago - a multi-format image file input/output library.
     5.6 +Copyright (C) 2010 John Tsiombikas <nuclear@member.fsf.org>
     5.7 +
     5.8 +This program is free software: you can redistribute it and/or modify
     5.9 +it under the terms of the GNU Lesser General Public License as published
    5.10 +by the Free Software Foundation, either version 3 of the License, or
    5.11 +(at your option) any later version.
    5.12 +
    5.13 +This program is distributed in the hope that it will be useful,
    5.14 +but WITHOUT ANY WARRANTY; without even the implied warranty of
    5.15 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    5.16 +GNU Lesser General Public License for more details.
    5.17 +
    5.18 +You should have received a copy of the GNU Lesser General Public License
    5.19 +along with this program.  If not, see <http://www.gnu.org/licenses/>.
    5.20 +*/
    5.21 +
    5.22 +/* -- PNG module -- */
    5.23 +
    5.24 +#include <stdlib.h>
    5.25 +#include "png.h"
    5.26 +#include "imago2.h"
    5.27 +#include "ftype_module.h"
    5.28 +
    5.29 +static int check_file(struct img_io *io);
    5.30 +static int read_file(struct img_pixmap *img, struct img_io *io);
    5.31 +static int write_file(struct img_pixmap *img, struct img_io *io);
    5.32 +
    5.33 +static void read_func(png_struct *png, unsigned char *data, size_t len);
    5.34 +static void write_func(png_struct *png, unsigned char *data, size_t len);
    5.35 +static void flush_func(png_struct *png);
    5.36 +
    5.37 +static int png_type_to_fmt(int color_type, int channel_bits);
    5.38 +static int fmt_to_png_type(enum img_fmt fmt);
    5.39 +
    5.40 +
    5.41 +int img_register_png(void)
    5.42 +{
    5.43 +	static struct ftype_module mod = {".png", check_file, read_file, write_file};
    5.44 +	return img_register_module(&mod);
    5.45 +}
    5.46 +
    5.47 +static int check_file(struct img_io *io)
    5.48 +{
    5.49 +	unsigned char sig[8];
    5.50 +	int res;
    5.51 +	long pos = io->seek(0, SEEK_CUR, io->uptr);
    5.52 +
    5.53 +	if(io->read(sig, 8, io->uptr) < 8) {
    5.54 +		io->seek(pos, SEEK_SET, io->uptr);
    5.55 +		return -1;
    5.56 +	}
    5.57 +
    5.58 +	res = png_sig_cmp(sig, 0, 8) == 0 ? 0 : -1;
    5.59 +	io->seek(pos, SEEK_SET, io->uptr);
    5.60 +	return res;
    5.61 +}
    5.62 +
    5.63 +static int read_file(struct img_pixmap *img, struct img_io *io)
    5.64 +{
    5.65 +	png_struct *png;
    5.66 +	png_info *info;
    5.67 +	int channel_bits, color_type, ilace_type, compression, filtering, fmt;
    5.68 +	png_uint_32 xsz, ysz;
    5.69 +
    5.70 +	if(!(png = png_create_read_struct(PNG_LIBPNG_VER_STRING, 0, 0, 0))) {
    5.71 +		return -1;
    5.72 +	}
    5.73 +
    5.74 +	if(!(info = png_create_info_struct(png))) {
    5.75 +		png_destroy_read_struct(&png, 0, 0);
    5.76 +		return -1;
    5.77 +	}
    5.78 +
    5.79 +	if(setjmp(png_jmpbuf(png))) {
    5.80 +		png_destroy_read_struct(&png, &info, 0);
    5.81 +		return -1;
    5.82 +	}
    5.83 +
    5.84 +	png_set_read_fn(png, io, read_func);
    5.85 +	png_set_sig_bytes(png, 0);
    5.86 +	png_read_png(png, info, 0, 0);
    5.87 +
    5.88 +	png_get_IHDR(png, info, &xsz, &ysz, &channel_bits, &color_type, &ilace_type,
    5.89 +			&compression, &filtering);
    5.90 +	if((fmt = png_type_to_fmt(color_type, channel_bits)) == -1) {
    5.91 +		png_destroy_read_struct(&png, &info, 0);
    5.92 +		return -1;
    5.93 +	}
    5.94 +
    5.95 +	if(img_set_pixels(img, xsz, ysz, fmt, 0) == -1) {
    5.96 +		png_destroy_read_struct(&png, &info, 0);
    5.97 +		return -1;
    5.98 +	}
    5.99 +
   5.100 +
   5.101 +	if(channel_bits == 8) {
   5.102 +		unsigned int i;
   5.103 +		unsigned char **lineptr = (unsigned char**)png_get_rows(png, info);
   5.104 +		unsigned char *dest = img->pixels;
   5.105 +
   5.106 +		for(i=0; i<ysz; i++) {
   5.107 +			memcpy(dest, lineptr[i], xsz * img->pixelsz);
   5.108 +			dest += xsz * img->pixelsz;
   5.109 +		}
   5.110 +	} else {
   5.111 +		unsigned int i, j, num_elem;
   5.112 +		unsigned char **lineptr = (unsigned char**)png_get_rows(png, info);
   5.113 +		float *dest = img->pixels;
   5.114 +
   5.115 +		num_elem = img->pixelsz / sizeof(float);
   5.116 +		for(i=0; i<ysz; i++) {
   5.117 +			for(j=0; j<xsz * num_elem; j++) {
   5.118 +				unsigned short val = (lineptr[i][j * 2] << 8) | lineptr[i][j * 2 + 1];
   5.119 +				*dest++ = (float)val / 65535.0;
   5.120 +			}
   5.121 +		}
   5.122 +	}
   5.123 +
   5.124 +
   5.125 +	png_destroy_read_struct(&png, &info, 0);
   5.126 +	return 0;
   5.127 +}
   5.128 +
   5.129 +
   5.130 +static int write_file(struct img_pixmap *img, struct img_io *io)
   5.131 +{
   5.132 +	png_struct *png;
   5.133 +	png_info *info;
   5.134 +	png_text txt;
   5.135 +	struct img_pixmap tmpimg;
   5.136 +	unsigned char **rows;
   5.137 +	unsigned char *pixptr;
   5.138 +	int i, coltype;
   5.139 +
   5.140 +	img_init(&tmpimg);
   5.141 +
   5.142 +	if(!(png = png_create_write_struct(PNG_LIBPNG_VER_STRING, 0, 0, 0))) {
   5.143 +		return -1;
   5.144 +	}
   5.145 +	if(!(info = png_create_info_struct(png))) {
   5.146 +		png_destroy_write_struct(&png, 0);
   5.147 +		return -1;
   5.148 +	}
   5.149 +
   5.150 +	/* if the input image is floating-point, we need to convert it to integer */
   5.151 +	if(img_is_float(img)) {
   5.152 +		if(img_copy(&tmpimg, img) == -1) {
   5.153 +			return -1;
   5.154 +		}
   5.155 +		if(img_to_integer(&tmpimg) == -1) {
   5.156 +			img_destroy(&tmpimg);
   5.157 +			return -1;
   5.158 +		}
   5.159 +		img = &tmpimg;
   5.160 +	}
   5.161 +
   5.162 +	txt.compression = PNG_TEXT_COMPRESSION_NONE;
   5.163 +	txt.key = "Software";
   5.164 +	txt.text = "libimago2";
   5.165 +	txt.text_length = 0;
   5.166 +
   5.167 +	if(setjmp(png_jmpbuf(png))) {
   5.168 +		png_destroy_write_struct(&png, &info);
   5.169 +		img_destroy(&tmpimg);
   5.170 +		return -1;
   5.171 +	}
   5.172 +	png_set_write_fn(png, io, write_func, flush_func);
   5.173 +
   5.174 +	coltype = fmt_to_png_type(img->fmt);
   5.175 +	png_set_IHDR(png, info, img->width, img->height, 8, coltype, PNG_INTERLACE_NONE,
   5.176 +			PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
   5.177 +	png_set_text(png, info, &txt, 1);
   5.178 +
   5.179 +	if(!(rows = malloc(img->height * sizeof *rows))) {
   5.180 +		png_destroy_write_struct(&png, &info);
   5.181 +		img_destroy(&tmpimg);
   5.182 +		return -1;
   5.183 +	}
   5.184 +
   5.185 +	pixptr = img->pixels;
   5.186 +	for(i=0; i<img->height; i++) {
   5.187 +		rows[i] = pixptr;
   5.188 +		pixptr += img->width * img->pixelsz;
   5.189 +	}
   5.190 +	png_set_rows(png, info, rows);
   5.191 +
   5.192 +	png_write_png(png, info, 0, 0);
   5.193 +	png_write_end(png, info);
   5.194 +	png_destroy_write_struct(&png, &info);
   5.195 +
   5.196 +	free(rows);
   5.197 +
   5.198 +	img_destroy(&tmpimg);
   5.199 +	return 0;
   5.200 +}
   5.201 +
   5.202 +static void read_func(png_struct *png, unsigned char *data, size_t len)
   5.203 +{
   5.204 +	struct img_io *io = (struct img_io*)png_get_io_ptr(png);
   5.205 +
   5.206 +	if(io->read(data, len, io->uptr) == -1) {
   5.207 +		longjmp(png_jmpbuf(png), 1);
   5.208 +	}
   5.209 +}
   5.210 +
   5.211 +static void write_func(png_struct *png, unsigned char *data, size_t len)
   5.212 +{
   5.213 +	struct img_io *io = (struct img_io*)png_get_io_ptr(png);
   5.214 +
   5.215 +	if(io->write(data, len, io->uptr) == -1) {
   5.216 +		longjmp(png_jmpbuf(png), 1);
   5.217 +	}
   5.218 +}
   5.219 +
   5.220 +static void flush_func(png_struct *png)
   5.221 +{
   5.222 +	/* XXX does it matter that we can't flush? */
   5.223 +}
   5.224 +
   5.225 +static int png_type_to_fmt(int color_type, int channel_bits)
   5.226 +{
   5.227 +	/* only 8 and 16 bits per channel ar supported at the moment */
   5.228 +	if(channel_bits != 8 && channel_bits != 16) {
   5.229 +		return -1;
   5.230 +	}
   5.231 +
   5.232 +	switch(color_type) {
   5.233 +	case PNG_COLOR_TYPE_RGB:
   5.234 +		return channel_bits == 16 ? IMG_FMT_RGBF : IMG_FMT_RGB24;
   5.235 +
   5.236 +	case PNG_COLOR_TYPE_RGB_ALPHA:
   5.237 +		return channel_bits == 16 ? IMG_FMT_RGBAF : IMG_FMT_RGBA32;
   5.238 +
   5.239 +	case PNG_COLOR_TYPE_GRAY:
   5.240 +		return channel_bits == 16 ? IMG_FMT_GREYF : IMG_FMT_GREY8;
   5.241 +
   5.242 +	default:
   5.243 +		break;
   5.244 +	}
   5.245 +	return -1;
   5.246 +}
   5.247 +
   5.248 +static int fmt_to_png_type(enum img_fmt fmt)
   5.249 +{
   5.250 +	switch(fmt) {
   5.251 +	case IMG_FMT_GREY8:
   5.252 +		return PNG_COLOR_TYPE_GRAY;
   5.253 +
   5.254 +	case IMG_FMT_RGB24:
   5.255 +		return PNG_COLOR_TYPE_RGB;
   5.256 +
   5.257 +	case IMG_FMT_RGBA32:
   5.258 +		return PNG_COLOR_TYPE_RGBA;
   5.259 +
   5.260 +	default:
   5.261 +		break;
   5.262 +	}
   5.263 +	return -1;
   5.264 +}
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/libs/imago/file_ppm.c	Sun Nov 01 00:36:56 2015 +0200
     6.3 @@ -0,0 +1,155 @@
     6.4 +/*
     6.5 +libimago - a multi-format image file input/output library.
     6.6 +Copyright (C) 2010 John Tsiombikas <nuclear@member.fsf.org>
     6.7 +
     6.8 +This program is free software: you can redistribute it and/or modify
     6.9 +it under the terms of the GNU Lesser General Public License as published
    6.10 +by the Free Software Foundation, either version 3 of the License, or
    6.11 +(at your option) any later version.
    6.12 +
    6.13 +This program is distributed in the hope that it will be useful,
    6.14 +but WITHOUT ANY WARRANTY; without even the implied warranty of
    6.15 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    6.16 +GNU Lesser General Public License for more details.
    6.17 +
    6.18 +You should have received a copy of the GNU Lesser General Public License
    6.19 +along with this program.  If not, see <http://www.gnu.org/licenses/>.
    6.20 +*/
    6.21 +
    6.22 +/* -- Portable Pixmap (PPM) module -- */
    6.23 +
    6.24 +#include <string.h>
    6.25 +#include "imago2.h"
    6.26 +#include "ftype_module.h"
    6.27 +
    6.28 +static int check(struct img_io *io);
    6.29 +static int readbuf(struct img_pixmap *img, struct img_io *io);
    6.30 +/*static int writebuf(struct img_pixmap *img, struct img_io *io);*/
    6.31 +
    6.32 +int img_register_ppm(void)
    6.33 +{
    6.34 +	static struct ftype_module mod = {".ppm", check, readbuf, 0};
    6.35 +	return img_register_module(&mod);
    6.36 +}
    6.37 +
    6.38 +
    6.39 +static int check(struct img_io *io)
    6.40 +{
    6.41 +	char id[2];
    6.42 +	int res = -1;
    6.43 +	long pos = io->seek(0, SEEK_CUR, io->uptr);
    6.44 +
    6.45 +	if(io->read(id, 2, io->uptr) < 2) {
    6.46 +		io->seek(pos, SEEK_SET, io->uptr);
    6.47 +		return -1;
    6.48 +	}
    6.49 +
    6.50 +	if(id[0] == 'P' && (id[1] == '6' || id[1] == '3')) {
    6.51 +		res = 0;
    6.52 +	}
    6.53 +	io->seek(pos, SEEK_SET, io->uptr);
    6.54 +	return res;
    6.55 +}
    6.56 +
    6.57 +static int iofgetc(struct img_io *io)
    6.58 +{
    6.59 +	char c;
    6.60 +	return io->read(&c, 1, io->uptr) < 1 ? -1 : c;
    6.61 +}
    6.62 +
    6.63 +static char *iofgets(char *buf, int size, struct img_io *io)
    6.64 +{
    6.65 +	int c;
    6.66 +	char *ptr = buf;
    6.67 +
    6.68 +	while(--size > 0 && (c = iofgetc(io)) != -1) {
    6.69 +		*ptr++ = c;
    6.70 +		if(c == '\n') break;
    6.71 +	}
    6.72 +	*ptr = 0;
    6.73 +
    6.74 +	return ptr == buf ? 0 : buf;
    6.75 +}
    6.76 +
    6.77 +/* TODO: implement P3 reading */
    6.78 +static int readbuf(struct img_pixmap *img, struct img_io *io)
    6.79 +{
    6.80 +	char buf[256];
    6.81 +	int xsz = 0, ysz = 0, maxval = 0, got_hdrlines = 1;
    6.82 +
    6.83 +	if(!iofgets(buf, sizeof buf, io)) {
    6.84 +		return -1;
    6.85 +	}
    6.86 +	if(!(buf[0] == 'P' && (buf[1] == '6' || buf[1] == '3'))) {
    6.87 +		return -1;
    6.88 +	}
    6.89 +
    6.90 +	while(got_hdrlines < 3 && iofgets(buf, sizeof buf, io)) {
    6.91 +		if(buf[0] == '#') continue;
    6.92 +
    6.93 +		switch(got_hdrlines) {
    6.94 +		case 1:
    6.95 +			if(sscanf(buf, "%d %d\n", &xsz, &ysz) < 2) {
    6.96 +				return -1;
    6.97 +			}
    6.98 +			break;
    6.99 +
   6.100 +		case 2:
   6.101 +			if(sscanf(buf, "%d\n", &maxval) < 1) {
   6.102 +				return -1;
   6.103 +			}
   6.104 +		default:
   6.105 +			break;
   6.106 +		}
   6.107 +		got_hdrlines++;
   6.108 +	}
   6.109 +
   6.110 +	if(xsz < 1 || ysz < 1 || maxval != 255) {
   6.111 +		return -1;
   6.112 +	}
   6.113 +
   6.114 +	if(img_set_pixels(img, xsz, ysz, IMG_FMT_RGB24, 0) == -1) {
   6.115 +		return -1;
   6.116 +	}
   6.117 +
   6.118 +	if((int)io->read(img->pixels, xsz * ysz * 3, io->uptr) < xsz * ysz * 3) {
   6.119 +		return -1;
   6.120 +	}
   6.121 +	return 0;
   6.122 +}
   6.123 +
   6.124 +/*
   6.125 +static int writebuf(struct img_pixmap *img, struct img_io *io)
   6.126 +{
   6.127 +	int sz;
   6.128 +	char buf[256];
   6.129 +	struct img_pixmap tmpimg;
   6.130 +
   6.131 +	img_init(&tmpimg);
   6.132 +
   6.133 +	if(img->fmt != IMG_FMT_RGB24) {
   6.134 +		if(img_copy(&tmpimg, img) == -1) {
   6.135 +			return -1;
   6.136 +		}
   6.137 +		if(img_convert(&tmpimg, IMG_FMT_RGB24) == -1) {
   6.138 +			return -1;
   6.139 +		}
   6.140 +		img = &tmpimg;
   6.141 +	}
   6.142 +
   6.143 +	sprintf(buf, "P6\n#written by libimago2\n%d %d\n255\n", img->width, img->height);
   6.144 +	if(io->write(buf, strlen(buf), io->uptr) < strlen(buf)) {
   6.145 +		img_destroy(&tmpimg);
   6.146 +		return -1;
   6.147 +	}
   6.148 +
   6.149 +	sz = img->width * img->height * 3;
   6.150 +	if((int)io->write(img->pixels, sz, io->uptr) < sz) {
   6.151 +		img_destroy(&tmpimg);
   6.152 +		return -1;
   6.153 +	}
   6.154 +
   6.155 +	img_destroy(&tmpimg);
   6.156 +	return 0;
   6.157 +}
   6.158 +*/
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/libs/imago/file_rgbe.c	Sun Nov 01 00:36:56 2015 +0200
     7.3 @@ -0,0 +1,501 @@
     7.4 +/* This file contains code to read and write four byte rgbe file format
     7.5 + * developed by Greg Ward.  It handles the conversions between rgbe and
     7.6 + * pixels consisting of floats.  The data is assumed to be an array of floats.
     7.7 + * By default there are three floats per pixel in the order red, green, blue.
     7.8 + * (RGBE_DATA_??? values control this.)
     7.9 + *
    7.10 + * written by Bruce Walter  (bjw@graphics.cornell.edu)  5/26/95
    7.11 + * based on code written by Greg Ward
    7.12 + * minor modifications by John Tsiombikas (nuclear@member.fsf.org) apr.9 2007
    7.13 + */
    7.14 +
    7.15 +#include <stdio.h>
    7.16 +#include <stdlib.h>
    7.17 +#include <string.h>
    7.18 +#include <math.h>
    7.19 +#include <ctype.h>
    7.20 +#include <errno.h>
    7.21 +#include "imago2.h"
    7.22 +#include "ftype_module.h"
    7.23 +
    7.24 +
    7.25 +typedef struct {
    7.26 +	int valid;				/* indicate which fields are valid */
    7.27 +	char programtype[16];	/* listed at beginning of file to identify it
    7.28 +							 * after "#?".  defaults to "RGBE" */
    7.29 +	float gamma;			/* image has already been gamma corrected with
    7.30 +							 * given gamma.  defaults to 1.0 (no correction) */
    7.31 +	float exposure;			/* a value of 1.0 in an image corresponds to
    7.32 +							 * <exposure> watts/steradian/m^2.
    7.33 +							 * defaults to 1.0 */
    7.34 +} rgbe_header_info;
    7.35 +
    7.36 +
    7.37 +static int check(struct img_io *io);
    7.38 +static int readbuf(struct img_pixmap *img, struct img_io *io);
    7.39 +static int writebuf(struct img_pixmap *img, struct img_io *io);
    7.40 +
    7.41 +static int rgbe_read_header(struct img_io *io, int *width, int *height, rgbe_header_info * info);
    7.42 +static int rgbe_read_pixels_rle(struct img_io *io, float *data, int scanline_width, int num_scanlines);
    7.43 +
    7.44 +
    7.45 +int img_register_rgbe(void)
    7.46 +{
    7.47 +	static struct ftype_module mod = {".rgbe", check, readbuf, writebuf};
    7.48 +	return img_register_module(&mod);
    7.49 +}
    7.50 +
    7.51 +
    7.52 +static int check(struct img_io *io)
    7.53 +{
    7.54 +	int xsz, ysz, res;
    7.55 +	long pos = io->seek(0, SEEK_CUR, io->uptr);
    7.56 +
    7.57 +	rgbe_header_info hdr;
    7.58 +	res = rgbe_read_header(io, &xsz, &ysz, &hdr);
    7.59 +
    7.60 +	io->seek(pos, SEEK_SET, io->uptr);
    7.61 +	return res;
    7.62 +}
    7.63 +
    7.64 +static int readbuf(struct img_pixmap *img, struct img_io *io)
    7.65 +{
    7.66 +	int xsz, ysz;
    7.67 +	rgbe_header_info hdr;
    7.68 +
    7.69 +	if(rgbe_read_header(io, &xsz, &ysz, &hdr) == -1) {
    7.70 +		return -1;
    7.71 +	}
    7.72 +
    7.73 +	if(img_set_pixels(img, xsz, ysz, IMG_FMT_RGBF, 0) == -1) {
    7.74 +		return -1;
    7.75 +	}
    7.76 +	if(rgbe_read_pixels_rle(io, img->pixels, xsz, ysz) == -1) {
    7.77 +		return -1;
    7.78 +	}
    7.79 +	return 0;
    7.80 +}
    7.81 +
    7.82 +static int writebuf(struct img_pixmap *img, struct img_io *io)
    7.83 +{
    7.84 +	return -1;	/* TODO */
    7.85 +}
    7.86 +
    7.87 +
    7.88 +static int iofgetc(struct img_io *io)
    7.89 +{
    7.90 +	char c;
    7.91 +	return io->read(&c, 1, io->uptr) < 1 ? -1 : c;
    7.92 +}
    7.93 +
    7.94 +static char *iofgets(char *buf, int size, struct img_io *io)
    7.95 +{
    7.96 +	int c;
    7.97 +	char *ptr = buf;
    7.98 +
    7.99 +	while(--size > 0 && (c = iofgetc(io)) != -1) {
   7.100 +		*ptr++ = c;
   7.101 +		if(c == '\n') break;
   7.102 +	}
   7.103 +	*ptr = 0;
   7.104 +
   7.105 +	return ptr == buf ? 0 : buf;
   7.106 +}
   7.107 +
   7.108 +
   7.109 +/* flags indicating which fields in an rgbe_header_info are valid */
   7.110 +#define RGBE_VALID_PROGRAMTYPE 0x01
   7.111 +#define RGBE_VALID_GAMMA       0x02
   7.112 +#define RGBE_VALID_EXPOSURE    0x04
   7.113 +
   7.114 +/* return codes for rgbe routines */
   7.115 +#define RGBE_RETURN_SUCCESS 0
   7.116 +#define RGBE_RETURN_FAILURE -1
   7.117 +
   7.118 +
   7.119 +#if defined(__cplusplus) || defined(GNUC) || __STDC_VERSION >= 199901L
   7.120 +#define INLINE inline
   7.121 +#else
   7.122 +#define INLINE
   7.123 +#endif
   7.124 +
   7.125 +/* offsets to red, green, and blue components in a data (float) pixel */
   7.126 +#define RGBE_DATA_RED	0
   7.127 +#define RGBE_DATA_GREEN  1
   7.128 +#define RGBE_DATA_BLUE   2
   7.129 +
   7.130 +/* number of floats per pixel */
   7.131 +#define RGBE_DATA_SIZE   3
   7.132 +
   7.133 +enum rgbe_error_codes {
   7.134 +	rgbe_read_error,
   7.135 +	rgbe_write_error,
   7.136 +	rgbe_format_error,
   7.137 +	rgbe_memory_error
   7.138 +};
   7.139 +
   7.140 +
   7.141 +/* default error routine.  change this to change error handling */
   7.142 +static int rgbe_error(int rgbe_error_code, char *msg)
   7.143 +{
   7.144 +	switch (rgbe_error_code) {
   7.145 +	case rgbe_read_error:
   7.146 +		fprintf(stderr, "RGBE read error: %s\n", strerror(errno));
   7.147 +		break;
   7.148 +
   7.149 +	case rgbe_write_error:
   7.150 +		fprintf(stderr, "RGBE write error: %s\n", strerror(errno));
   7.151 +		break;
   7.152 +
   7.153 +	case rgbe_format_error:
   7.154 +		fprintf(stderr, "RGBE bad file format: %s\n", msg);
   7.155 +		break;
   7.156 +
   7.157 +	default:
   7.158 +	case rgbe_memory_error:
   7.159 +		fprintf(stderr, "RGBE error: %s\n", msg);
   7.160 +	}
   7.161 +	return RGBE_RETURN_FAILURE;
   7.162 +}
   7.163 +
   7.164 +/* standard conversion from float pixels to rgbe pixels */
   7.165 +/*static INLINE void float2rgbe(unsigned char rgbe[4], float red, float green, float blue)
   7.166 +{
   7.167 +	float v;
   7.168 +	int e;
   7.169 +
   7.170 +	v = red;
   7.171 +	if(green > v)
   7.172 +		v = green;
   7.173 +	if(blue > v)
   7.174 +		v = blue;
   7.175 +	if(v < 1e-32) {
   7.176 +		rgbe[0] = rgbe[1] = rgbe[2] = rgbe[3] = 0;
   7.177 +	} else {
   7.178 +		v = frexp(v, &e) * 256.0 / v;
   7.179 +		rgbe[0] = (unsigned char)(red * v);
   7.180 +		rgbe[1] = (unsigned char)(green * v);
   7.181 +		rgbe[2] = (unsigned char)(blue * v);
   7.182 +		rgbe[3] = (unsigned char)(e + 128);
   7.183 +	}
   7.184 +}*/
   7.185 +
   7.186 +/* standard conversion from rgbe to float pixels */
   7.187 +/* note: Ward uses ldexp(col+0.5,exp-(128+8)). However we wanted pixels */
   7.188 +/*       in the range [0,1] to map back into the range [0,1]. */
   7.189 +static INLINE void rgbe2float(float *red, float *green, float *blue, unsigned char rgbe[4])
   7.190 +{
   7.191 +	float f;
   7.192 +
   7.193 +	if(rgbe[3]) {				/*nonzero pixel */
   7.194 +		f = ldexp(1.0, rgbe[3] - (int)(128 + 8));
   7.195 +		*red = rgbe[0] * f;
   7.196 +		*green = rgbe[1] * f;
   7.197 +		*blue = rgbe[2] * f;
   7.198 +	} else
   7.199 +		*red = *green = *blue = 0.0;
   7.200 +}
   7.201 +
   7.202 +#if 0
   7.203 +/* default minimal header. modify if you want more information in header */
   7.204 +static int rgbe_write_header(FILE * fp, int width, int height, rgbe_header_info * info)
   7.205 +{
   7.206 +	char *programtype = "RGBE";
   7.207 +
   7.208 +	if(info && (info->valid & RGBE_VALID_PROGRAMTYPE))
   7.209 +		programtype = info->programtype;
   7.210 +	if(fprintf(fp, "#?%s\n", programtype) < 0)
   7.211 +		return rgbe_error(rgbe_write_error, NULL);
   7.212 +	/* The #? is to identify file type, the programtype is optional. */
   7.213 +	if(info && (info->valid & RGBE_VALID_GAMMA)) {
   7.214 +		if(fprintf(fp, "GAMMA=%g\n", info->gamma) < 0)
   7.215 +			return rgbe_error(rgbe_write_error, NULL);
   7.216 +	}
   7.217 +	if(info && (info->valid & RGBE_VALID_EXPOSURE)) {
   7.218 +		if(fprintf(fp, "EXPOSURE=%g\n", info->exposure) < 0)
   7.219 +			return rgbe_error(rgbe_write_error, NULL);
   7.220 +	}
   7.221 +	if(fprintf(fp, "FORMAT=32-bit_rle_rgbe\n\n") < 0)
   7.222 +		return rgbe_error(rgbe_write_error, NULL);
   7.223 +	if(fprintf(fp, "-Y %d +X %d\n", height, width) < 0)
   7.224 +		return rgbe_error(rgbe_write_error, NULL);
   7.225 +	return RGBE_RETURN_SUCCESS;
   7.226 +}
   7.227 +#endif
   7.228 +
   7.229 +/* minimal header reading.  modify if you want to parse more information */
   7.230 +static int rgbe_read_header(struct img_io *io, int *width, int *height, rgbe_header_info * info)
   7.231 +{
   7.232 +	char buf[128];
   7.233 +	float tempf;
   7.234 +	int i;
   7.235 +
   7.236 +	if(info) {
   7.237 +		info->valid = 0;
   7.238 +		info->programtype[0] = 0;
   7.239 +		info->gamma = info->exposure = 1.0;
   7.240 +	}
   7.241 +	if(iofgets(buf, sizeof(buf) / sizeof(buf[0]), io) == NULL)
   7.242 +		return RGBE_RETURN_FAILURE;/*rgbe_error(rgbe_read_error, NULL);*/
   7.243 +	if((buf[0] != '#') || (buf[1] != '?')) {
   7.244 +		/* if you want to require the magic token then uncomment the next line */
   7.245 +		/*return rgbe_error(rgbe_format_error,"bad initial token"); */
   7.246 +	} else if(info) {
   7.247 +		info->valid |= RGBE_VALID_PROGRAMTYPE;
   7.248 +		for(i = 0; i < sizeof(info->programtype) - 1; i++) {
   7.249 +			if((buf[i + 2] == 0) || isspace(buf[i + 2]))
   7.250 +				break;
   7.251 +			info->programtype[i] = buf[i + 2];
   7.252 +		}
   7.253 +		info->programtype[i] = 0;
   7.254 +		if(iofgets(buf, sizeof(buf) / sizeof(buf[0]), io) == 0)
   7.255 +			return rgbe_error(rgbe_read_error, NULL);
   7.256 +	}
   7.257 +	for(;;) {
   7.258 +		if((buf[0] == 0) || (buf[0] == '\n'))
   7.259 +			return RGBE_RETURN_FAILURE;/*rgbe_error(rgbe_format_error, "no FORMAT specifier found");*/
   7.260 +		else if(strcmp(buf, "FORMAT=32-bit_rle_rgbe\n") == 0)
   7.261 +			break;				/* format found so break out of loop */
   7.262 +		else if(info && (sscanf(buf, "GAMMA=%g", &tempf) == 1)) {
   7.263 +			info->gamma = tempf;
   7.264 +			info->valid |= RGBE_VALID_GAMMA;
   7.265 +		} else if(info && (sscanf(buf, "EXPOSURE=%g", &tempf) == 1)) {
   7.266 +			info->exposure = tempf;
   7.267 +			info->valid |= RGBE_VALID_EXPOSURE;
   7.268 +		}
   7.269 +		if(iofgets(buf, sizeof(buf) / sizeof(buf[0]), io) == 0)
   7.270 +			return RGBE_RETURN_FAILURE;/*rgbe_error(rgbe_read_error, NULL);*/
   7.271 +	}
   7.272 +	if(iofgets(buf, sizeof(buf) / sizeof(buf[0]), io) == 0)
   7.273 +		return RGBE_RETURN_FAILURE;/*rgbe_error(rgbe_read_error, NULL);*/
   7.274 +	if(strcmp(buf, "\n") != 0)
   7.275 +		return RGBE_RETURN_FAILURE;/*rgbe_error(rgbe_format_error, "missing blank line after FORMAT specifier");*/
   7.276 +	if(iofgets(buf, sizeof(buf) / sizeof(buf[0]), io) == 0)
   7.277 +		return RGBE_RETURN_FAILURE;/*rgbe_error(rgbe_read_error, NULL);*/
   7.278 +	if(sscanf(buf, "-Y %d +X %d", height, width) < 2)
   7.279 +		return RGBE_RETURN_FAILURE;/*rgbe_error(rgbe_format_error, "missing image size specifier");*/
   7.280 +	return RGBE_RETURN_SUCCESS;
   7.281 +}
   7.282 +
   7.283 +#if 0
   7.284 +/* simple write routine that does not use run length encoding */
   7.285 +
   7.286 +/* These routines can be made faster by allocating a larger buffer and
   7.287 +   fread-ing and fwrite-ing the data in larger chunks */
   7.288 +static int rgbe_write_pixels(FILE * fp, float *data, int numpixels)
   7.289 +{
   7.290 +	unsigned char rgbe[4];
   7.291 +
   7.292 +	while(numpixels-- > 0) {
   7.293 +		float2rgbe(rgbe, data[RGBE_DATA_RED], data[RGBE_DATA_GREEN], data[RGBE_DATA_BLUE]);
   7.294 +		data += RGBE_DATA_SIZE;
   7.295 +		if(fwrite(rgbe, sizeof(rgbe), 1, fp) < 1)
   7.296 +			return rgbe_error(rgbe_write_error, NULL);
   7.297 +	}
   7.298 +	return RGBE_RETURN_SUCCESS;
   7.299 +}
   7.300 +#endif
   7.301 +
   7.302 +/* simple read routine.  will not correctly handle run length encoding */
   7.303 +static int rgbe_read_pixels(struct img_io *io, float *data, int numpixels)
   7.304 +{
   7.305 +	unsigned char rgbe[4];
   7.306 +
   7.307 +	while(numpixels-- > 0) {
   7.308 +		if(io->read(rgbe, sizeof(rgbe), io->uptr) < 1)
   7.309 +			return rgbe_error(rgbe_read_error, NULL);
   7.310 +		rgbe2float(&data[RGBE_DATA_RED], &data[RGBE_DATA_GREEN], &data[RGBE_DATA_BLUE], rgbe);
   7.311 +		data += RGBE_DATA_SIZE;
   7.312 +	}
   7.313 +	return RGBE_RETURN_SUCCESS;
   7.314 +}
   7.315 +
   7.316 +#if 0
   7.317 +/* The code below is only needed for the run-length encoded files. */
   7.318 +
   7.319 +/* Run length encoding adds considerable complexity but does */
   7.320 +
   7.321 +/* save some space.  For each scanline, each channel (r,g,b,e) is */
   7.322 +
   7.323 +/* encoded separately for better compression. */
   7.324 +
   7.325 +static int rgbe_write_bytes_rle(struct img_io *io, unsigned char *data, int numbytes)
   7.326 +{
   7.327 +#define MINRUNLENGTH 4
   7.328 +	int cur, beg_run, run_count, old_run_count, nonrun_count;
   7.329 +	unsigned char buf[2];
   7.330 +
   7.331 +	cur = 0;
   7.332 +	while(cur < numbytes) {
   7.333 +		beg_run = cur;
   7.334 +		/* find next run of length at least 4 if one exists */
   7.335 +		run_count = old_run_count = 0;
   7.336 +		while((run_count < MINRUNLENGTH) && (beg_run < numbytes)) {
   7.337 +			beg_run += run_count;
   7.338 +			old_run_count = run_count;
   7.339 +			run_count = 1;
   7.340 +			while((beg_run + run_count < numbytes) && (run_count < 127)
   7.341 +				  && (data[beg_run] == data[beg_run + run_count]))
   7.342 +				run_count++;
   7.343 +		}
   7.344 +		/* if data before next big run is a short run then write it as such */
   7.345 +		if((old_run_count > 1) && (old_run_count == beg_run - cur)) {
   7.346 +			buf[0] = 128 + old_run_count;	/*write short run */
   7.347 +			buf[1] = data[cur];
   7.348 +			if(fwrite(buf, sizeof(buf[0]) * 2, 1, fp) < 1)
   7.349 +				return rgbe_error(rgbe_write_error, NULL);
   7.350 +			cur = beg_run;
   7.351 +		}
   7.352 +		/* write out bytes until we reach the start of the next run */
   7.353 +		while(cur < beg_run) {
   7.354 +			nonrun_count = beg_run - cur;
   7.355 +			if(nonrun_count > 128)
   7.356 +				nonrun_count = 128;
   7.357 +			buf[0] = nonrun_count;
   7.358 +			if(fwrite(buf, sizeof(buf[0]), 1, fp) < 1)
   7.359 +				return rgbe_error(rgbe_write_error, NULL);
   7.360 +			if(fwrite(&data[cur], sizeof(data[0]) * nonrun_count, 1, fp) < 1)
   7.361 +				return rgbe_error(rgbe_write_error, NULL);
   7.362 +			cur += nonrun_count;
   7.363 +		}
   7.364 +		/* write out next run if one was found */
   7.365 +		if(run_count >= MINRUNLENGTH) {
   7.366 +			buf[0] = 128 + run_count;
   7.367 +			buf[1] = data[beg_run];
   7.368 +			if(fwrite(buf, sizeof(buf[0]) * 2, 1, fp) < 1)
   7.369 +				return rgbe_error(rgbe_write_error, NULL);
   7.370 +			cur += run_count;
   7.371 +		}
   7.372 +	}
   7.373 +	return RGBE_RETURN_SUCCESS;
   7.374 +#undef MINRUNLENGTH
   7.375 +}
   7.376 +
   7.377 +static int rgbe_write_pixels_rle(struct img_io *io, float *data, int scanline_width, int num_scanlines)
   7.378 +{
   7.379 +	unsigned char rgbe[4];
   7.380 +	unsigned char *buffer;
   7.381 +	int i, err;
   7.382 +
   7.383 +	if((scanline_width < 8) || (scanline_width > 0x7fff))
   7.384 +		/* run length encoding is not allowed so write flat */
   7.385 +		return rgbe_write_pixels(io, data, scanline_width * num_scanlines);
   7.386 +	buffer = (unsigned char *)malloc(sizeof(unsigned char) * 4 * scanline_width);
   7.387 +	if(buffer == NULL)
   7.388 +		/* no buffer space so write flat */
   7.389 +		return rgbe_write_pixels(fp, data, scanline_width * num_scanlines);
   7.390 +	while(num_scanlines-- > 0) {
   7.391 +		rgbe[0] = 2;
   7.392 +		rgbe[1] = 2;
   7.393 +		rgbe[2] = scanline_width >> 8;
   7.394 +		rgbe[3] = scanline_width & 0xFF;
   7.395 +		if(fwrite(rgbe, sizeof(rgbe), 1, fp) < 1) {
   7.396 +			free(buffer);
   7.397 +			return rgbe_error(rgbe_write_error, NULL);
   7.398 +		}
   7.399 +		for(i = 0; i < scanline_width; i++) {
   7.400 +			float2rgbe(rgbe, data[RGBE_DATA_RED], data[RGBE_DATA_GREEN], data[RGBE_DATA_BLUE]);
   7.401 +			buffer[i] = rgbe[0];
   7.402 +			buffer[i + scanline_width] = rgbe[1];
   7.403 +			buffer[i + 2 * scanline_width] = rgbe[2];
   7.404 +			buffer[i + 3 * scanline_width] = rgbe[3];
   7.405 +			data += RGBE_DATA_SIZE;
   7.406 +		}
   7.407 +		/* write out each of the four channels separately run length encoded */
   7.408 +		/* first red, then green, then blue, then exponent */
   7.409 +		for(i = 0; i < 4; i++) {
   7.410 +			if((err = rgbe_write_bytes_rle(fp, &buffer[i * scanline_width],
   7.411 +										  scanline_width)) != RGBE_RETURN_SUCCESS) {
   7.412 +				free(buffer);
   7.413 +				return err;
   7.414 +			}
   7.415 +		}
   7.416 +	}
   7.417 +	free(buffer);
   7.418 +	return RGBE_RETURN_SUCCESS;
   7.419 +}
   7.420 +#endif
   7.421 +
   7.422 +static int rgbe_read_pixels_rle(struct img_io *io, float *data, int scanline_width, int num_scanlines)
   7.423 +{
   7.424 +	unsigned char rgbe[4], *scanline_buffer, *ptr, *ptr_end;
   7.425 +	int i, count;
   7.426 +	unsigned char buf[2];
   7.427 +
   7.428 +	if((scanline_width < 8) || (scanline_width > 0x7fff))
   7.429 +		/* run length encoding is not allowed so read flat */
   7.430 +		return rgbe_read_pixels(io, data, scanline_width * num_scanlines);
   7.431 +	scanline_buffer = NULL;
   7.432 +	/* read in each successive scanline */
   7.433 +	while(num_scanlines > 0) {
   7.434 +		if(io->read(rgbe, sizeof(rgbe), io->uptr) < 1) {
   7.435 +			free(scanline_buffer);
   7.436 +			return rgbe_error(rgbe_read_error, NULL);
   7.437 +		}
   7.438 +		if((rgbe[0] != 2) || (rgbe[1] != 2) || (rgbe[2] & 0x80)) {
   7.439 +			/* this file is not run length encoded */
   7.440 +			rgbe2float(&data[0], &data[1], &data[2], rgbe);
   7.441 +			data += RGBE_DATA_SIZE;
   7.442 +			free(scanline_buffer);
   7.443 +			return rgbe_read_pixels(io, data, scanline_width * num_scanlines - 1);
   7.444 +		}
   7.445 +		if((((int)rgbe[2]) << 8 | rgbe[3]) != scanline_width) {
   7.446 +			free(scanline_buffer);
   7.447 +			return rgbe_error(rgbe_format_error, "wrong scanline width");
   7.448 +		}
   7.449 +		if(scanline_buffer == NULL)
   7.450 +			scanline_buffer = (unsigned char *)
   7.451 +				malloc(sizeof(unsigned char) * 4 * scanline_width);
   7.452 +		if(scanline_buffer == NULL)
   7.453 +			return rgbe_error(rgbe_memory_error, "unable to allocate buffer space");
   7.454 +
   7.455 +		ptr = &scanline_buffer[0];
   7.456 +		/* read each of the four channels for the scanline into the buffer */
   7.457 +		for(i = 0; i < 4; i++) {
   7.458 +			ptr_end = &scanline_buffer[(i + 1) * scanline_width];
   7.459 +			while(ptr < ptr_end) {
   7.460 +				if(io->read(buf, sizeof(buf[0]) * 2, io->uptr) < 1) {
   7.461 +					free(scanline_buffer);
   7.462 +					return rgbe_error(rgbe_read_error, NULL);
   7.463 +				}
   7.464 +				if(buf[0] > 128) {
   7.465 +					/* a run of the same value */
   7.466 +					count = buf[0] - 128;
   7.467 +					if((count == 0) || (count > ptr_end - ptr)) {
   7.468 +						free(scanline_buffer);
   7.469 +						return rgbe_error(rgbe_format_error, "bad scanline data");
   7.470 +					}
   7.471 +					while(count-- > 0)
   7.472 +						*ptr++ = buf[1];
   7.473 +				} else {
   7.474 +					/* a non-run */
   7.475 +					count = buf[0];
   7.476 +					if((count == 0) || (count > ptr_end - ptr)) {
   7.477 +						free(scanline_buffer);
   7.478 +						return rgbe_error(rgbe_format_error, "bad scanline data");
   7.479 +					}
   7.480 +					*ptr++ = buf[1];
   7.481 +					if(--count > 0) {
   7.482 +						if(io->read(ptr, sizeof(*ptr) * count, io->uptr) < 1) {
   7.483 +							free(scanline_buffer);
   7.484 +							return rgbe_error(rgbe_read_error, NULL);
   7.485 +						}
   7.486 +						ptr += count;
   7.487 +					}
   7.488 +				}
   7.489 +			}
   7.490 +		}
   7.491 +		/* now convert data from buffer into floats */
   7.492 +		for(i = 0; i < scanline_width; i++) {
   7.493 +			rgbe[0] = scanline_buffer[i];
   7.494 +			rgbe[1] = scanline_buffer[i + scanline_width];
   7.495 +			rgbe[2] = scanline_buffer[i + 2 * scanline_width];
   7.496 +			rgbe[3] = scanline_buffer[i + 3 * scanline_width];
   7.497 +			rgbe2float(&data[RGBE_DATA_RED], &data[RGBE_DATA_GREEN], &data[RGBE_DATA_BLUE], rgbe);
   7.498 +			data += RGBE_DATA_SIZE;
   7.499 +		}
   7.500 +		num_scanlines--;
   7.501 +	}
   7.502 +	free(scanline_buffer);
   7.503 +	return RGBE_RETURN_SUCCESS;
   7.504 +}
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/libs/imago/ftype_module.c	Sun Nov 01 00:36:56 2015 +0200
     8.3 @@ -0,0 +1,118 @@
     8.4 +/*
     8.5 +libimago - a multi-format image file input/output library.
     8.6 +Copyright (C) 2010 John Tsiombikas <nuclear@member.fsf.org>
     8.7 +
     8.8 +This program is free software: you can redistribute it and/or modify
     8.9 +it under the terms of the GNU Lesser General Public License as published
    8.10 +by the Free Software Foundation, either version 3 of the License, or
    8.11 +(at your option) any later version.
    8.12 +
    8.13 +This program is distributed in the hope that it will be useful,
    8.14 +but WITHOUT ANY WARRANTY; without even the implied warranty of
    8.15 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    8.16 +GNU Lesser General Public License for more details.
    8.17 +
    8.18 +You should have received a copy of the GNU Lesser General Public License
    8.19 +along with this program.  If not, see <http://www.gnu.org/licenses/>.
    8.20 +*/
    8.21 +
    8.22 +#include <stdlib.h>
    8.23 +#include <string.h>
    8.24 +#include "ftype_module.h"
    8.25 +
    8.26 +static struct list_node {
    8.27 +	struct ftype_module *module;
    8.28 +	struct list_node *next;
    8.29 +} *modules;
    8.30 +
    8.31 +/* defined in modules.c which is generated by configure */
    8.32 +void img_modules_init();
    8.33 +
    8.34 +static int done_init;
    8.35 +
    8.36 +int img_register_module(struct ftype_module *mod)
    8.37 +{
    8.38 +	struct list_node *node;
    8.39 +
    8.40 +	if(!(node = malloc(sizeof *node))) {
    8.41 +		return -1;
    8.42 +	}
    8.43 +
    8.44 +	node->module = mod;
    8.45 +	node->next = modules;
    8.46 +	modules = node;
    8.47 +	return 0;
    8.48 +}
    8.49 +
    8.50 +struct ftype_module *img_find_format_module(struct img_io *io)
    8.51 +{
    8.52 +	struct list_node *node;
    8.53 +
    8.54 +	if(!done_init) {
    8.55 +		img_modules_init();
    8.56 +		done_init = 1;
    8.57 +	}
    8.58 +
    8.59 +	node = modules;
    8.60 +	while(node) {
    8.61 +		if(node->module->check(io) != -1) {
    8.62 +			return node->module;
    8.63 +		}
    8.64 +		node = node->next;
    8.65 +	}
    8.66 +	return 0;
    8.67 +}
    8.68 +
    8.69 +struct ftype_module *img_guess_format(const char *fname)
    8.70 +{
    8.71 +	struct list_node *node;
    8.72 +	char *suffix;
    8.73 +	int suffix_len;
    8.74 +
    8.75 +	if(!done_init) {
    8.76 +		img_modules_init();
    8.77 +		done_init = 1;
    8.78 +	}
    8.79 +
    8.80 +	if(!(suffix = strrchr(fname, '.'))) {
    8.81 +		return 0;	/* no suffix, can't guess ... */
    8.82 +	}
    8.83 +	suffix_len = strlen(suffix);
    8.84 +
    8.85 +	node = modules;
    8.86 +	while(node) {
    8.87 +		char *suflist = node->module->suffix;
    8.88 +		char *start, *end;
    8.89 +
    8.90 +		while(*suflist) {
    8.91 +			if(!(start = strstr(suflist, suffix))) {
    8.92 +				break;
    8.93 +			}
    8.94 +			end = start + suffix_len;
    8.95 +
    8.96 +			if(*end == ':' || *end == 0) {
    8.97 +				return node->module;	/* found it */
    8.98 +			}
    8.99 +			suflist = end;
   8.100 +		}
   8.101 +
   8.102 +		node = node->next;
   8.103 +	}
   8.104 +	return 0;
   8.105 +}
   8.106 +
   8.107 +struct ftype_module *img_get_module(int idx)
   8.108 +{
   8.109 +	struct list_node *node;
   8.110 +
   8.111 +	if(!done_init) {
   8.112 +		img_modules_init();
   8.113 +		done_init = 1;
   8.114 +	}
   8.115 +
   8.116 +	node = modules;
   8.117 +	while(node && idx--) {
   8.118 +		node = node->next;
   8.119 +	}
   8.120 +	return node ? node->module : 0;
   8.121 +}
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/libs/imago/ftype_module.h	Sun Nov 01 00:36:56 2015 +0200
     9.3 @@ -0,0 +1,39 @@
     9.4 +/*
     9.5 +libimago - a multi-format image file input/output library.
     9.6 +Copyright (C) 2010 John Tsiombikas <nuclear@member.fsf.org>
     9.7 +
     9.8 +This program is free software: you can redistribute it and/or modify
     9.9 +it under the terms of the GNU Lesser General Public License as published
    9.10 +by the Free Software Foundation, either version 3 of the License, or
    9.11 +(at your option) any later version.
    9.12 +
    9.13 +This program is distributed in the hope that it will be useful,
    9.14 +but WITHOUT ANY WARRANTY; without even the implied warranty of
    9.15 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    9.16 +GNU Lesser General Public License for more details.
    9.17 +
    9.18 +You should have received a copy of the GNU Lesser General Public License
    9.19 +along with this program.  If not, see <http://www.gnu.org/licenses/>.
    9.20 +*/
    9.21 +
    9.22 +#ifndef FTYPE_MODULE_H_
    9.23 +#define FTYPE_MODULE_H_
    9.24 +
    9.25 +#include "imago2.h"
    9.26 +
    9.27 +struct ftype_module {
    9.28 +	char *suffix;	/* used for format autodetection during saving only */
    9.29 +
    9.30 +	int (*check)(struct img_io *io);
    9.31 +	int (*read)(struct img_pixmap *img, struct img_io *io);
    9.32 +	int (*write)(struct img_pixmap *img, struct img_io *io);
    9.33 +};
    9.34 +
    9.35 +int img_register_module(struct ftype_module *mod);
    9.36 +
    9.37 +struct ftype_module *img_find_format_module(struct img_io *io);
    9.38 +struct ftype_module *img_guess_format(const char *fname);
    9.39 +struct ftype_module *img_get_module(int idx);
    9.40 +
    9.41 +
    9.42 +#endif	/* FTYPE_MODULE_H_ */
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/libs/imago/imago2.c	Sun Nov 01 00:36:56 2015 +0200
    10.3 @@ -0,0 +1,449 @@
    10.4 +/*
    10.5 +libimago - a multi-format image file input/output library.
    10.6 +Copyright (C) 2010 John Tsiombikas <nuclear@member.fsf.org>
    10.7 +
    10.8 +This program is free software: you can redistribute it and/or modify
    10.9 +it under the terms of the GNU Lesser General Public License as published
   10.10 +by the Free Software Foundation, either version 3 of the License, or
   10.11 +(at your option) any later version.
   10.12 +
   10.13 +This program is distributed in the hope that it will be useful,
   10.14 +but WITHOUT ANY WARRANTY; without even the implied warranty of
   10.15 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   10.16 +GNU Lesser General Public License for more details.
   10.17 +
   10.18 +You should have received a copy of the GNU Lesser General Public License
   10.19 +along with this program.  If not, see <http://www.gnu.org/licenses/>.
   10.20 +*/
   10.21 +
   10.22 +#include <stdio.h>
   10.23 +#include <stdlib.h>
   10.24 +#include <string.h>
   10.25 +#include "imago2.h"
   10.26 +#include "ftype_module.h"
   10.27 +
   10.28 +static int pixel_size(enum img_fmt fmt);
   10.29 +static size_t def_read(void *buf, size_t bytes, void *uptr);
   10.30 +static size_t def_write(void *buf, size_t bytes, void *uptr);
   10.31 +static long def_seek(long offset, int whence, void *uptr);
   10.32 +
   10.33 +
   10.34 +void img_init(struct img_pixmap *img)
   10.35 +{
   10.36 +	img->pixels = 0;
   10.37 +	img->width = img->height = 0;
   10.38 +	img->fmt = IMG_FMT_RGBA32;
   10.39 +	img->pixelsz = pixel_size(img->fmt);
   10.40 +	img->name = 0;
   10.41 +}
   10.42 +
   10.43 +
   10.44 +void img_destroy(struct img_pixmap *img)
   10.45 +{
   10.46 +	free(img->pixels);
   10.47 +	img->pixels = 0;	/* just in case... */
   10.48 +	img->width = img->height = 0xbadbeef;
   10.49 +	free(img->name);
   10.50 +}
   10.51 +
   10.52 +struct img_pixmap *img_create(void)
   10.53 +{
   10.54 +	struct img_pixmap *p;
   10.55 +
   10.56 +	if(!(p = malloc(sizeof *p))) {
   10.57 +		return 0;
   10.58 +	}
   10.59 +	img_init(p);
   10.60 +	return p;
   10.61 +}
   10.62 +
   10.63 +void img_free(struct img_pixmap *img)
   10.64 +{
   10.65 +	img_destroy(img);
   10.66 +	free(img);
   10.67 +}
   10.68 +
   10.69 +int img_set_name(struct img_pixmap *img, const char *name)
   10.70 +{
   10.71 +	char *tmp;
   10.72 +
   10.73 +	if(!(tmp = malloc(strlen(name) + 1))) {
   10.74 +		return -1;
   10.75 +	}
   10.76 +	strcpy(tmp, name);
   10.77 +	img->name = tmp;
   10.78 +	return 0;
   10.79 +}
   10.80 +
   10.81 +int img_set_format(struct img_pixmap *img, enum img_fmt fmt)
   10.82 +{
   10.83 +	if(img->pixels) {
   10.84 +		return img_convert(img, fmt);
   10.85 +	}
   10.86 +	img->fmt = fmt;
   10.87 +	return 0;
   10.88 +}
   10.89 +
   10.90 +int img_copy(struct img_pixmap *dest, struct img_pixmap *src)
   10.91 +{
   10.92 +	return img_set_pixels(dest, src->width, src->height, src->fmt, src->pixels);
   10.93 +}
   10.94 +
   10.95 +int img_set_pixels(struct img_pixmap *img, int w, int h, enum img_fmt fmt, void *pix)
   10.96 +{
   10.97 +	void *newpix;
   10.98 +	int pixsz = pixel_size(fmt);
   10.99 +
  10.100 +	if(!(newpix = malloc(w * h * pixsz))) {
  10.101 +		return -1;
  10.102 +	}
  10.103 +
  10.104 +	if(pix) {
  10.105 +		memcpy(newpix, pix, w * h * pixsz);
  10.106 +	} else {
  10.107 +		memset(newpix, 0, w * h * pixsz);
  10.108 +	}
  10.109 +
  10.110 +	free(img->pixels);
  10.111 +	img->pixels = newpix;
  10.112 +	img->width = w;
  10.113 +	img->height = h;
  10.114 +	img->pixelsz = pixsz;
  10.115 +	img->fmt = fmt;
  10.116 +	return 0;
  10.117 +}
  10.118 +
  10.119 +void *img_load_pixels(const char *fname, int *xsz, int *ysz, enum img_fmt fmt)
  10.120 +{
  10.121 +	struct img_pixmap img;
  10.122 +
  10.123 +	img_init(&img);
  10.124 +
  10.125 +	if(img_load(&img, fname) == -1) {
  10.126 +		return 0;
  10.127 +	}
  10.128 +	if(img.fmt != fmt) {
  10.129 +		if(img_convert(&img, fmt) == -1) {
  10.130 +			img_destroy(&img);
  10.131 +			return 0;
  10.132 +		}
  10.133 +	}
  10.134 +
  10.135 +	*xsz = img.width;
  10.136 +	*ysz = img.height;
  10.137 +	return img.pixels;
  10.138 +}
  10.139 +
  10.140 +int img_save_pixels(const char *fname, void *pix, int xsz, int ysz, enum img_fmt fmt)
  10.141 +{
  10.142 +	struct img_pixmap img;
  10.143 +
  10.144 +	img_init(&img);
  10.145 +	img.fmt = fmt;
  10.146 +	img.name = (char*)fname;
  10.147 +	img.width = xsz;
  10.148 +	img.height = ysz;
  10.149 +	img.pixels = pix;
  10.150 +
  10.151 +	return img_save(&img, fname);
  10.152 +}
  10.153 +
  10.154 +void img_free_pixels(void *pix)
  10.155 +{
  10.156 +	free(pix);
  10.157 +}
  10.158 +
  10.159 +int img_load(struct img_pixmap *img, const char *fname)
  10.160 +{
  10.161 +	int res;
  10.162 +	FILE *fp;
  10.163 +
  10.164 +	if(!(fp = fopen(fname, "rb"))) {
  10.165 +		return -1;
  10.166 +	}
  10.167 +	res = img_read_file(img, fp);
  10.168 +	fclose(fp);
  10.169 +	return res;
  10.170 +}
  10.171 +
  10.172 +/* TODO implement filetype selection */
  10.173 +int img_save(struct img_pixmap *img, const char *fname)
  10.174 +{
  10.175 +	int res;
  10.176 +	FILE *fp;
  10.177 +
  10.178 +	img_set_name(img, fname);
  10.179 +
  10.180 +	if(!(fp = fopen(fname, "wb"))) {
  10.181 +		return -1;
  10.182 +	}
  10.183 +	res = img_write_file(img, fp);
  10.184 +	fclose(fp);
  10.185 +	return res;
  10.186 +}
  10.187 +
  10.188 +int img_read_file(struct img_pixmap *img, FILE *fp)
  10.189 +{
  10.190 +	struct img_io io = {0, def_read, def_write, def_seek};
  10.191 +
  10.192 +	io.uptr = fp;
  10.193 +	return img_read(img, &io);
  10.194 +}
  10.195 +
  10.196 +int img_write_file(struct img_pixmap *img, FILE *fp)
  10.197 +{
  10.198 +	struct img_io io = {0, def_read, def_write, def_seek};
  10.199 +
  10.200 +	io.uptr = fp;
  10.201 +	return img_write(img, &io);
  10.202 +}
  10.203 +
  10.204 +int img_read(struct img_pixmap *img, struct img_io *io)
  10.205 +{
  10.206 +	struct ftype_module *mod;
  10.207 +
  10.208 +	if((mod = img_find_format_module(io))) {
  10.209 +		return mod->read(img, io);
  10.210 +	}
  10.211 +	return -1;
  10.212 +}
  10.213 +
  10.214 +int img_write(struct img_pixmap *img, struct img_io *io)
  10.215 +{
  10.216 +	struct ftype_module *mod;
  10.217 +
  10.218 +	if(!img->name || !(mod = img_guess_format(img->name))) {
  10.219 +		/* TODO throw some sort of warning? */
  10.220 +		/* TODO implement some sort of module priority or let the user specify? */
  10.221 +		if(!(mod = img_get_module(0))) {
  10.222 +			return -1;
  10.223 +		}
  10.224 +	}
  10.225 +
  10.226 +	return mod->write(img, io);
  10.227 +}
  10.228 +
  10.229 +int img_to_float(struct img_pixmap *img)
  10.230 +{
  10.231 +	enum img_fmt targ_fmt;
  10.232 +
  10.233 +	switch(img->fmt) {
  10.234 +	case IMG_FMT_GREY8:
  10.235 +		targ_fmt = IMG_FMT_GREYF;
  10.236 +		break;
  10.237 +
  10.238 +	case IMG_FMT_RGB24:
  10.239 +		targ_fmt = IMG_FMT_RGBF;
  10.240 +		break;
  10.241 +
  10.242 +	case IMG_FMT_RGBA32:
  10.243 +		targ_fmt = IMG_FMT_RGBAF;
  10.244 +		break;
  10.245 +
  10.246 +	default:
  10.247 +		return 0;	/* already float */
  10.248 +	}
  10.249 +
  10.250 +	return img_convert(img, targ_fmt);
  10.251 +}
  10.252 +
  10.253 +int img_to_integer(struct img_pixmap *img)
  10.254 +{
  10.255 +	enum img_fmt targ_fmt;
  10.256 +
  10.257 +	switch(img->fmt) {
  10.258 +	case IMG_FMT_GREYF:
  10.259 +		targ_fmt = IMG_FMT_GREY8;
  10.260 +		break;
  10.261 +
  10.262 +	case IMG_FMT_RGBF:
  10.263 +		targ_fmt = IMG_FMT_RGB24;
  10.264 +		break;
  10.265 +
  10.266 +	case IMG_FMT_RGBAF:
  10.267 +		targ_fmt = IMG_FMT_RGBA32;
  10.268 +		break;
  10.269 +
  10.270 +	default:
  10.271 +		return 0;	/* already integer */
  10.272 +	}
  10.273 +
  10.274 +	return img_convert(img, targ_fmt);
  10.275 +}
  10.276 +
  10.277 +int img_is_float(struct img_pixmap *img)
  10.278 +{
  10.279 +	return img->fmt >= IMG_FMT_GREYF && img->fmt <= IMG_FMT_RGBAF;
  10.280 +}
  10.281 +
  10.282 +int img_has_alpha(struct img_pixmap *img)
  10.283 +{
  10.284 +	if(img->fmt == IMG_FMT_RGBA32 || img->fmt == IMG_FMT_RGBAF) {
  10.285 +		return 1;
  10.286 +	}
  10.287 +	return 0;
  10.288 +}
  10.289 +
  10.290 +
  10.291 +void img_setpixel(struct img_pixmap *img, int x, int y, void *pixel)
  10.292 +{
  10.293 +	char *dest = (char*)img->pixels + (y * img->width + x) * img->pixelsz;
  10.294 +	memcpy(dest, pixel, img->pixelsz);
  10.295 +}
  10.296 +
  10.297 +void img_getpixel(struct img_pixmap *img, int x, int y, void *pixel)
  10.298 +{
  10.299 +	char *dest = (char*)img->pixels + (y * img->width + x) * img->pixelsz;
  10.300 +	memcpy(pixel, dest, img->pixelsz);
  10.301 +}
  10.302 +
  10.303 +void img_setpixel1i(struct img_pixmap *img, int x, int y, int pix)
  10.304 +{
  10.305 +	img_setpixel4i(img, x, y, pix, pix, pix, pix);
  10.306 +}
  10.307 +
  10.308 +void img_setpixel1f(struct img_pixmap *img, int x, int y, float pix)
  10.309 +{
  10.310 +	img_setpixel4f(img, x, y, pix, pix, pix, pix);
  10.311 +}
  10.312 +
  10.313 +void img_setpixel4i(struct img_pixmap *img, int x, int y, int r, int g, int b, int a)
  10.314 +{
  10.315 +	if(img_is_float(img)) {
  10.316 +		img_setpixel4f(img, x, y, r / 255.0, g / 255.0, b / 255.0, a / 255.0);
  10.317 +	} else {
  10.318 +		unsigned char pixel[4];
  10.319 +		pixel[0] = r;
  10.320 +		pixel[1] = g;
  10.321 +		pixel[2] = b;
  10.322 +		pixel[3] = a;
  10.323 +
  10.324 +		img_setpixel(img, x, y, pixel);
  10.325 +	}
  10.326 +}
  10.327 +
  10.328 +void img_setpixel4f(struct img_pixmap *img, int x, int y, float r, float g, float b, float a)
  10.329 +{
  10.330 +	if(img_is_float(img)) {
  10.331 +		float pixel[4];
  10.332 +		pixel[0] = r;
  10.333 +		pixel[1] = g;
  10.334 +		pixel[2] = b;
  10.335 +		pixel[3] = a;
  10.336 +
  10.337 +		img_setpixel(img, x, y, pixel);
  10.338 +	} else {
  10.339 +		img_setpixel4i(img, x, y, (int)(r * 255.0), (int)(g * 255.0), (int)(b * 255.0), (int)(a * 255.0));
  10.340 +	}
  10.341 +}
  10.342 +
  10.343 +void img_getpixel1i(struct img_pixmap *img, int x, int y, int *pix)
  10.344 +{
  10.345 +	int junk[3];
  10.346 +	img_getpixel4i(img, x, y, pix, junk, junk + 1, junk + 2);
  10.347 +}
  10.348 +
  10.349 +void img_getpixel1f(struct img_pixmap *img, int x, int y, float *pix)
  10.350 +{
  10.351 +	float junk[3];
  10.352 +	img_getpixel4f(img, x, y, pix, junk, junk + 1, junk + 2);
  10.353 +}
  10.354 +
  10.355 +void img_getpixel4i(struct img_pixmap *img, int x, int y, int *r, int *g, int *b, int *a)
  10.356 +{
  10.357 +	if(img_is_float(img)) {
  10.358 +		float pixel[4] = {0, 0, 0, 0};
  10.359 +		img_getpixel(img, x, y, pixel);
  10.360 +		*r = pixel[0] * 255.0;
  10.361 +		*g = pixel[1] * 255.0;
  10.362 +		*b = pixel[2] * 255.0;
  10.363 +		*a = pixel[3] * 255.0;
  10.364 +	} else {
  10.365 +		unsigned char pixel[4];
  10.366 +		img_getpixel(img, x, y, pixel);
  10.367 +		*r = pixel[0];
  10.368 +		*g = pixel[1];
  10.369 +		*b = pixel[2];
  10.370 +		*a = pixel[3];
  10.371 +	}
  10.372 +}
  10.373 +
  10.374 +void img_getpixel4f(struct img_pixmap *img, int x, int y, float *r, float *g, float *b, float *a)
  10.375 +{
  10.376 +	if(img_is_float(img)) {
  10.377 +		float pixel[4] = {0, 0, 0, 0};
  10.378 +		img_getpixel(img, x, y, pixel);
  10.379 +		*r = pixel[0];
  10.380 +		*g = pixel[1];
  10.381 +		*b = pixel[2];
  10.382 +		*a = pixel[3];
  10.383 +	} else {
  10.384 +		unsigned char pixel[4];
  10.385 +		img_getpixel(img, x, y, pixel);
  10.386 +		*r = pixel[0] / 255.0;
  10.387 +		*g = pixel[1] / 255.0;
  10.388 +		*b = pixel[2] / 255.0;
  10.389 +		*a = pixel[3] / 255.0;
  10.390 +	}
  10.391 +}
  10.392 +
  10.393 +void img_io_set_user_data(struct img_io *io, void *uptr)
  10.394 +{
  10.395 +	io->uptr = uptr;
  10.396 +}
  10.397 +
  10.398 +void img_io_set_read_func(struct img_io *io, size_t (*read)(void*, size_t, void*))
  10.399 +{
  10.400 +	io->read = read;
  10.401 +}
  10.402 +
  10.403 +void img_io_set_write_func(struct img_io *io, size_t (*write)(void*, size_t, void*))
  10.404 +{
  10.405 +	io->write = write;
  10.406 +}
  10.407 +
  10.408 +void img_io_set_seek_func(struct img_io *io, long (*seek)(long, int, void*))
  10.409 +{
  10.410 +	io->seek = seek;
  10.411 +}
  10.412 +
  10.413 +
  10.414 +static int pixel_size(enum img_fmt fmt)
  10.415 +{
  10.416 +	switch(fmt) {
  10.417 +	case IMG_FMT_GREY8:
  10.418 +		return 1;
  10.419 +	case IMG_FMT_RGB24:
  10.420 +		return 3;
  10.421 +	case IMG_FMT_RGBA32:
  10.422 +		return 4;
  10.423 +	case IMG_FMT_GREYF:
  10.424 +		return sizeof(float);
  10.425 +	case IMG_FMT_RGBF:
  10.426 +		return 3 * sizeof(float);
  10.427 +	case IMG_FMT_RGBAF:
  10.428 +		return 4 * sizeof(float);
  10.429 +	default:
  10.430 +		break;
  10.431 +	}
  10.432 +	return 0;
  10.433 +}
  10.434 +
  10.435 +static size_t def_read(void *buf, size_t bytes, void *uptr)
  10.436 +{
  10.437 +	return uptr ? fread(buf, 1, bytes, uptr) : 0;
  10.438 +}
  10.439 +
  10.440 +static size_t def_write(void *buf, size_t bytes, void *uptr)
  10.441 +{
  10.442 +	return uptr ? fwrite(buf, 1, bytes, uptr) : 0;
  10.443 +}
  10.444 +
  10.445 +static long def_seek(long offset, int whence, void *uptr)
  10.446 +{
  10.447 +	if(!uptr || fseek(uptr, offset, whence) == -1) {
  10.448 +		return -1;
  10.449 +	}
  10.450 +	return ftell(uptr);
  10.451 +}
  10.452 +
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/libs/imago/imago2.h	Sun Nov 01 00:36:56 2015 +0200
    11.3 @@ -0,0 +1,222 @@
    11.4 +/*
    11.5 +libimago - a multi-format image file input/output library.
    11.6 +Copyright (C) 2010-2012 John Tsiombikas <nuclear@member.fsf.org>
    11.7 +
    11.8 +This program is free software: you can redistribute it and/or modify
    11.9 +it under the terms of the GNU Lesser General Public License as published
   11.10 +by the Free Software Foundation, either version 3 of the License, or
   11.11 +(at your option) any later version.
   11.12 +
   11.13 +This program is distributed in the hope that it will be useful,
   11.14 +but WITHOUT ANY WARRANTY; without even the implied warranty of
   11.15 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   11.16 +GNU Lesser General Public License for more details.
   11.17 +
   11.18 +You should have received a copy of the GNU Lesser General Public License
   11.19 +along with this program.  If not, see <http://www.gnu.org/licenses/>.
   11.20 +*/
   11.21 +
   11.22 +#ifndef IMAGO2_H_
   11.23 +#define IMAGO2_H_
   11.24 +
   11.25 +#include <stdio.h>
   11.26 +
   11.27 +#ifdef __cplusplus
   11.28 +#define IMG_OPTARG(arg, val)	arg = val
   11.29 +#else
   11.30 +#define IMG_OPTARG(arg, val)	arg
   11.31 +#endif
   11.32 +
   11.33 +/* XXX if you change this make sure to also change pack/unpack arrays in conv.c */
   11.34 +enum img_fmt {
   11.35 +	IMG_FMT_GREY8,
   11.36 +	IMG_FMT_RGB24,
   11.37 +	IMG_FMT_RGBA32,
   11.38 +	IMG_FMT_GREYF,
   11.39 +	IMG_FMT_RGBF,
   11.40 +	IMG_FMT_RGBAF,
   11.41 +
   11.42 +	NUM_IMG_FMT
   11.43 +};
   11.44 +
   11.45 +struct img_pixmap {
   11.46 +	void *pixels;
   11.47 +	int width, height;
   11.48 +	enum img_fmt fmt;
   11.49 +	int pixelsz;
   11.50 +	char *name;
   11.51 +};
   11.52 +
   11.53 +struct img_io {
   11.54 +	void *uptr;	/* user-data */
   11.55 +
   11.56 +	size_t (*read)(void *buf, size_t bytes, void *uptr);
   11.57 +	size_t (*write)(void *buf, size_t bytes, void *uptr);
   11.58 +	long (*seek)(long offs, int whence, void *uptr);
   11.59 +};
   11.60 +
   11.61 +#ifdef __cplusplus
   11.62 +extern "C" {
   11.63 +#endif
   11.64 +
   11.65 +/* initialize the img_pixmap structure */
   11.66 +void img_init(struct img_pixmap *img);
   11.67 +/* destroys the img_pixmap structure, freeing the pixel buffer (if available)
   11.68 + * and any other memory held by the pixmap.
   11.69 + */
   11.70 +void img_destroy(struct img_pixmap *img);
   11.71 +
   11.72 +/* convenience function that allocates an img_pixmap struct and then initializes it.
   11.73 + * returns null if the malloc fails.
   11.74 + */
   11.75 +struct img_pixmap *img_create(void);
   11.76 +/* frees a pixmap previously allocated with img_create (free followed by img_destroy) */
   11.77 +void img_free(struct img_pixmap *img);
   11.78 +
   11.79 +int img_set_name(struct img_pixmap *img, const char *name);
   11.80 +
   11.81 +/* set the image pixel format */
   11.82 +int img_set_format(struct img_pixmap *img, enum img_fmt fmt);
   11.83 +
   11.84 +/* copies one pixmap to another.
   11.85 + * equivalent to: img_set_pixels(dest, src->width, src->height, src->fmt, src->pixels)
   11.86 + */
   11.87 +int img_copy(struct img_pixmap *dest, struct img_pixmap *src);
   11.88 +
   11.89 +/* allocates a pixel buffer of the specified dimensions and format, and copies the
   11.90 + * pixels given through the pix pointer into it.
   11.91 + * the pix pointer can be null, in which case there's no copy, just allocation.
   11.92 + *
   11.93 + * C++: fmt and pix have default parameters IMG_FMT_RGBA32 and null respectively.
   11.94 + */
   11.95 +int img_set_pixels(struct img_pixmap *img, int w, int h, IMG_OPTARG(enum img_fmt fmt, IMG_FMT_RGBA32), IMG_OPTARG(void *pix, 0));
   11.96 +
   11.97 +/* Simplified image loading
   11.98 + * Loads the specified file, and returns a pointer to an array of pixels of the
   11.99 + * requested pixel format. The width and height of the image are returned through
  11.100 + * the xsz and ysz pointers.
  11.101 + * If the image cannot be loaded, the function returns null.
  11.102 + *
  11.103 + * C++: the format argument is optional and defaults to IMG_FMT_RGBA32
  11.104 + */
  11.105 +void *img_load_pixels(const char *fname, int *xsz, int *ysz, IMG_OPTARG(enum img_fmt fmt, IMG_FMT_RGBA32));
  11.106 +
  11.107 +/* Simplified image saving
  11.108 + * Reads an array of pixels supplied through the pix pointer, of dimensions xsz
  11.109 + * and ysz, and pixel-format fmt, and saves it to a file.
  11.110 + * The output filetype is guessed by the filename suffix.
  11.111 + *
  11.112 + * C++: the format argument is optional and defaults to IMG_FMT_RGBA32
  11.113 + */
  11.114 +int img_save_pixels(const char *fname, void *pix, int xsz, int ysz, IMG_OPTARG(enum img_fmt fmt, IMG_FMT_RGBA32));
  11.115 +
  11.116 +/* Frees the memory allocated by img_load_pixels */
  11.117 +void img_free_pixels(void *pix);
  11.118 +
  11.119 +/* Loads an image file into the supplied pixmap */
  11.120 +int img_load(struct img_pixmap *img, const char *fname);
  11.121 +/* Saves the supplied pixmap to a file. The output filetype is guessed by the filename suffix */
  11.122 +int img_save(struct img_pixmap *img, const char *fname);
  11.123 +
  11.124 +/* Reads an image from an open FILE* into the supplied pixmap */
  11.125 +int img_read_file(struct img_pixmap *img, FILE *fp);
  11.126 +/* Writes the supplied pixmap to an open FILE* */
  11.127 +int img_write_file(struct img_pixmap *img, FILE *fp);
  11.128 +
  11.129 +/* Reads an image using user-defined file-i/o functions (see img_io_set_*) */
  11.130 +int img_read(struct img_pixmap *img, struct img_io *io);
  11.131 +/* Writes an image using user-defined file-i/o functions (see img_io_set_*) */
  11.132 +int img_write(struct img_pixmap *img, struct img_io *io);
  11.133 +
  11.134 +/* Converts an image to the specified pixel format */
  11.135 +int img_convert(struct img_pixmap *img, enum img_fmt tofmt);
  11.136 +
  11.137 +/* Converts an image from an integer pixel format to the corresponding floating point one */
  11.138 +int img_to_float(struct img_pixmap *img);
  11.139 +/* Converts an image from a floating point pixel format to the corresponding integer one */
  11.140 +int img_to_integer(struct img_pixmap *img);
  11.141 +
  11.142 +/* Returns non-zero (true) if the supplied image is in a floating point pixel format */
  11.143 +int img_is_float(struct img_pixmap *img);
  11.144 +/* Returns non-zero (true) if the supplied image has an alpha channel */
  11.145 +int img_has_alpha(struct img_pixmap *img);
  11.146 +
  11.147 +
  11.148 +/* don't use these for anything performance-critical */
  11.149 +void img_setpixel(struct img_pixmap *img, int x, int y, void *pixel);
  11.150 +void img_getpixel(struct img_pixmap *img, int x, int y, void *pixel);
  11.151 +
  11.152 +void img_setpixel1i(struct img_pixmap *img, int x, int y, int pix);
  11.153 +void img_setpixel1f(struct img_pixmap *img, int x, int y, float pix);
  11.154 +void img_setpixel4i(struct img_pixmap *img, int x, int y, int r, int g, int b, int a);
  11.155 +void img_setpixel4f(struct img_pixmap *img, int x, int y, float r, float g, float b, float a);
  11.156 +
  11.157 +void img_getpixel1i(struct img_pixmap *img, int x, int y, int *pix);
  11.158 +void img_getpixel1f(struct img_pixmap *img, int x, int y, float *pix);
  11.159 +void img_getpixel4i(struct img_pixmap *img, int x, int y, int *r, int *g, int *b, int *a);
  11.160 +void img_getpixel4f(struct img_pixmap *img, int x, int y, float *r, float *g, float *b, float *a);
  11.161 +
  11.162 +
  11.163 +/* OpenGL helper functions */
  11.164 +
  11.165 +/* Returns the equivalent OpenGL "format" as expected by the 7th argument of glTexImage2D */
  11.166 +unsigned int img_fmt_glfmt(enum img_fmt fmt);
  11.167 +/* Returns the equivalent OpenGL "type" as expected by the 8th argument of glTexImage2D */
  11.168 +unsigned int img_fmt_gltype(enum img_fmt fmt);
  11.169 +/* Returns the equivalent OpenGL "internal format" as expected by the 3rd argument of glTexImage2D */
  11.170 +unsigned int img_fmt_glintfmt(enum img_fmt fmt);
  11.171 +
  11.172 +/* Same as above, based on the pixel format of the supplied image */
  11.173 +unsigned int img_glfmt(struct img_pixmap *img);
  11.174 +unsigned int img_gltype(struct img_pixmap *img);
  11.175 +unsigned int img_glintfmt(struct img_pixmap *img);
  11.176 +
  11.177 +/* Creates an OpenGL texture from the image, and returns the texture id, or 0 for failure */
  11.178 +unsigned int img_gltexture(struct img_pixmap *img);
  11.179 +
  11.180 +/* Load an image and create an OpenGL texture out of it */
  11.181 +unsigned int img_gltexture_load(const char *fname);
  11.182 +unsigned int img_gltexture_read_file(FILE *fp);
  11.183 +unsigned int img_gltexture_read(struct img_io *io);
  11.184 +
  11.185 +/* These functions can be used to fill an img_io struct before it's passed to
  11.186 + * one of the user-defined i/o image reading/writing functions (img_read/img_write).
  11.187 + *
  11.188 + * User-defined i/o functions:
  11.189 + *
  11.190 + * - size_t read_func(void *buffer, size_t bytes, void *user_ptr)
  11.191 + * Must try to fill the buffer with the specified number of bytes, and return
  11.192 + * the number of bytes actually read.
  11.193 + *
  11.194 + * - size_t write_func(void *buffer, size_t bytes, void *user_ptr)
  11.195 + * Must write the specified number of bytes from the supplied buffer and return
  11.196 + * the number of bytes actually written.
  11.197 + *
  11.198 + * - long seek_func(long offset, int whence, void *user_ptr)
  11.199 + * Must seek offset bytes from: the beginning of the file if whence is SEEK_SET,
  11.200 + * the current position if whence is SEEK_CUR, or the end of the file if whence is
  11.201 + * SEEK_END, and return the resulting file offset from the beginning of the file.
  11.202 + * (i.e. seek_func(0, SEEK_CUR, user_ptr); must be equivalent to an ftell).
  11.203 + *
  11.204 + * All three functions get the user-data pointer set through img_io_set_user_data
  11.205 + * as their last argument.
  11.206 + *
  11.207 + * Note: obviously you don't need to set a write function if you're only going
  11.208 + * to call img_read, or the read and seek function if you're only going to call
  11.209 + * img_write.
  11.210 + *
  11.211 + * Note: if the user-supplied write function is buffered, make sure to flush
  11.212 + * (or close the file) after img_write returns.
  11.213 + */
  11.214 +void img_io_set_user_data(struct img_io *io, void *uptr);
  11.215 +void img_io_set_read_func(struct img_io *io, size_t (*read)(void*, size_t, void*));
  11.216 +void img_io_set_write_func(struct img_io *io, size_t (*write)(void*, size_t, void*));
  11.217 +void img_io_set_seek_func(struct img_io *io, long (*seek)(long, int, void*));
  11.218 +
  11.219 +
  11.220 +#ifdef __cplusplus
  11.221 +}
  11.222 +#endif
  11.223 +
  11.224 +
  11.225 +#endif	/* IMAGO_H_ */
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/libs/imago/imago_gl.c	Sun Nov 01 00:36:56 2015 +0200
    12.3 @@ -0,0 +1,223 @@
    12.4 +#include "imago2.h"
    12.5 +
    12.6 +
    12.7 +/* to avoid dependency to OpenGL, I'll define all the relevant GL macros manually */
    12.8 +#define GL_UNSIGNED_BYTE		0x1401
    12.9 +#define GL_FLOAT				0x1406
   12.10 +
   12.11 +#define GL_LUMINANCE			0x1909
   12.12 +#define GL_RGB					0x1907
   12.13 +#define GL_RGBA					0x1908
   12.14 +
   12.15 +#define GL_RGBA32F				0x8814
   12.16 +#define GL_RGB32F				0x8815
   12.17 +#define GL_LUMINANCE32F			0x8818
   12.18 +
   12.19 +#define GL_TEXTURE_2D			0x0de1
   12.20 +#define GL_TEXTURE_WRAP_S		0x2802
   12.21 +#define GL_TEXTURE_WRAP_T		0x2803
   12.22 +#define GL_TEXTURE_MAG_FILTER	0x2800
   12.23 +#define GL_TEXTURE_MIN_FILTER	0x2801
   12.24 +#define GL_LINEAR				0x2601
   12.25 +#define GL_REPEAT				0x2901
   12.26 +
   12.27 +
   12.28 +typedef unsigned int GLenum;
   12.29 +typedef unsigned int GLuint;
   12.30 +typedef int GLint;
   12.31 +typedef int GLsizei;
   12.32 +typedef void GLvoid;
   12.33 +
   12.34 +/* for the same reason I'll load GL functions dynamically */
   12.35 +typedef void (*gl_gen_textures_func)(GLsizei, GLuint*);
   12.36 +typedef void (*gl_bind_texture_func)(GLenum, GLuint);
   12.37 +typedef void (*gl_tex_parameteri_func)(GLenum, GLenum, GLint);
   12.38 +typedef void (*gl_tex_image2d_func)(GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid*);
   12.39 +
   12.40 +static gl_gen_textures_func gl_gen_textures;
   12.41 +static gl_bind_texture_func gl_bind_texture;
   12.42 +static gl_tex_parameteri_func gl_tex_parameteri;
   12.43 +static gl_tex_image2d_func gl_tex_image2d;
   12.44 +
   12.45 +static int load_glfunc(void);
   12.46 +
   12.47 +unsigned int img_fmt_glfmt(enum img_fmt fmt)
   12.48 +{
   12.49 +	switch(fmt) {
   12.50 +	case IMG_FMT_GREY8:
   12.51 +	case IMG_FMT_GREYF:
   12.52 +		return GL_LUMINANCE;
   12.53 +
   12.54 +	case IMG_FMT_RGB24:
   12.55 +	case IMG_FMT_RGBF:
   12.56 +		return GL_RGB;
   12.57 +
   12.58 +	case IMG_FMT_RGBA32:
   12.59 +	case IMG_FMT_RGBAF:
   12.60 +		return GL_RGBA;
   12.61 +
   12.62 +	default:
   12.63 +		break;
   12.64 +	}
   12.65 +	return 0;
   12.66 +}
   12.67 +
   12.68 +unsigned int img_fmt_gltype(enum img_fmt fmt)
   12.69 +{
   12.70 +	switch(fmt) {
   12.71 +	case IMG_FMT_GREY8:
   12.72 +	case IMG_FMT_RGB24:
   12.73 +	case IMG_FMT_RGBA32:
   12.74 +		return GL_UNSIGNED_BYTE;
   12.75 +
   12.76 +	case IMG_FMT_GREYF:
   12.77 +	case IMG_FMT_RGBF:
   12.78 +	case IMG_FMT_RGBAF:
   12.79 +		return GL_FLOAT;
   12.80 +
   12.81 +	default:
   12.82 +		break;
   12.83 +	}
   12.84 +	return 0;
   12.85 +}
   12.86 +
   12.87 +unsigned int img_fmt_glintfmt(enum img_fmt fmt)
   12.88 +{
   12.89 +	switch(fmt) {
   12.90 +	case IMG_FMT_GREY8:
   12.91 +		return GL_LUMINANCE;
   12.92 +	case IMG_FMT_RGB24:
   12.93 +		return GL_RGB;
   12.94 +	case IMG_FMT_RGBA32:
   12.95 +		return GL_RGBA;
   12.96 +	case IMG_FMT_GREYF:
   12.97 +		return GL_LUMINANCE32F;
   12.98 +	case IMG_FMT_RGBF:
   12.99 +		return GL_RGB32F;
  12.100 +	case IMG_FMT_RGBAF:
  12.101 +		return GL_RGBA32F;
  12.102 +	default:
  12.103 +		break;
  12.104 +	}
  12.105 +	return 0;
  12.106 +}
  12.107 +
  12.108 +unsigned int img_glfmt(struct img_pixmap *img)
  12.109 +{
  12.110 +	return img_fmt_glfmt(img->fmt);
  12.111 +}
  12.112 +
  12.113 +unsigned int img_gltype(struct img_pixmap *img)
  12.114 +{
  12.115 +	return img_fmt_gltype(img->fmt);
  12.116 +}
  12.117 +
  12.118 +unsigned int img_glintfmt(struct img_pixmap *img)
  12.119 +{
  12.120 +	return img_fmt_glintfmt(img->fmt);
  12.121 +}
  12.122 +
  12.123 +unsigned int img_gltexture(struct img_pixmap *img)
  12.124 +{
  12.125 +	unsigned int tex;
  12.126 +	unsigned int intfmt, fmt, type;
  12.127 +
  12.128 +	if(!gl_gen_textures) {
  12.129 +		if(load_glfunc() == -1) {
  12.130 +			fprintf(stderr, "imago: failed to initialize the OpenGL helpers\n");
  12.131 +			return 0;
  12.132 +		}
  12.133 +	}
  12.134 +
  12.135 +	intfmt = img_glintfmt(img);
  12.136 +	fmt = img_glfmt(img);
  12.137 +	type = img_gltype(img);
  12.138 +
  12.139 +	gl_gen_textures(1, &tex);
  12.140 +	gl_bind_texture(GL_TEXTURE_2D, tex);
  12.141 +	gl_tex_parameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
  12.142 +	gl_tex_parameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
  12.143 +	gl_tex_parameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
  12.144 +	gl_tex_parameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
  12.145 +	gl_tex_image2d(GL_TEXTURE_2D, 0, intfmt, img->width, img->height, 0, fmt, type, img->pixels);
  12.146 +	return tex;
  12.147 +}
  12.148 +
  12.149 +unsigned int img_gltexture_load(const char *fname)
  12.150 +{
  12.151 +	struct img_pixmap img;
  12.152 +	unsigned int tex;
  12.153 +
  12.154 +	img_init(&img);
  12.155 +	if(img_load(&img, fname) == -1) {
  12.156 +		img_destroy(&img);
  12.157 +		return 0;
  12.158 +	}
  12.159 +
  12.160 +	tex = img_gltexture(&img);
  12.161 +	img_destroy(&img);
  12.162 +	return tex;
  12.163 +}
  12.164 +
  12.165 +unsigned int img_gltexture_read_file(FILE *fp)
  12.166 +{
  12.167 +	struct img_pixmap img;
  12.168 +	unsigned int tex;
  12.169 +
  12.170 +	img_init(&img);
  12.171 +	if(img_read_file(&img, fp) == -1) {
  12.172 +		img_destroy(&img);
  12.173 +		return 0;
  12.174 +	}
  12.175 +
  12.176 +	tex = img_gltexture(&img);
  12.177 +	img_destroy(&img);
  12.178 +	return tex;
  12.179 +}
  12.180 +
  12.181 +unsigned int img_gltexture_read(struct img_io *io)
  12.182 +{
  12.183 +	struct img_pixmap img;
  12.184 +	unsigned int tex;
  12.185 +
  12.186 +	img_init(&img);
  12.187 +	if(img_read(&img, io) == -1) {
  12.188 +		img_destroy(&img);
  12.189 +		return 0;
  12.190 +	}
  12.191 +
  12.192 +	tex = img_gltexture(&img);
  12.193 +	img_destroy(&img);
  12.194 +	return tex;
  12.195 +}
  12.196 +
  12.197 +#if defined(__unix__) || defined(__APPLE__)
  12.198 +#ifndef __USE_GNU
  12.199 +#define __USE_GNU
  12.200 +#endif
  12.201 +
  12.202 +#include <dlfcn.h>
  12.203 +#endif
  12.204 +#ifdef WIN32
  12.205 +#include <windows.h>
  12.206 +#endif
  12.207 +
  12.208 +static int load_glfunc(void)
  12.209 +{
  12.210 +#if defined(__unix__) || defined(__APPLE__)
  12.211 +	gl_gen_textures = (gl_gen_textures_func)dlsym(RTLD_DEFAULT, "glGenTextures");
  12.212 +	gl_bind_texture = (gl_bind_texture_func)dlsym(RTLD_DEFAULT, "glBindTexture");
  12.213 +	gl_tex_parameteri = (gl_tex_parameteri_func)dlsym(RTLD_DEFAULT, "glTexParameteri");
  12.214 +	gl_tex_image2d = (gl_tex_image2d_func)dlsym(RTLD_DEFAULT, "glTexImage2D");
  12.215 +#endif
  12.216 +
  12.217 +#ifdef WIN32
  12.218 +	HMODULE handle = GetModuleHandle(0);
  12.219 +	gl_gen_textures = (gl_gen_textures_func)GetProcAddress(handle, "glGenTextures");
  12.220 +	gl_bind_texture = (gl_bind_texture_func)GetProcAddress(handle, "glBindTexture");
  12.221 +	gl_tex_parameteri = (gl_tex_parameteri_func)GetProcAddress(handle, "glTexParameteri");
  12.222 +	gl_tex_image2d = (gl_tex_image2d_func)GetProcAddress(handle, "glTexImage2D");
  12.223 +#endif
  12.224 +
  12.225 +	return (gl_gen_textures && gl_bind_texture && gl_tex_parameteri && gl_tex_image2d) ? 0 : -1;
  12.226 +}
    13.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.2 +++ b/libs/imago/modules.c	Sun Nov 01 00:36:56 2015 +0200
    13.3 @@ -0,0 +1,13 @@
    13.4 +/* this file is generated by ./configure, do not edit */
    13.5 +int img_register_jpeg();
    13.6 +int img_register_png();
    13.7 +int img_register_ppm();
    13.8 +int img_register_rgbe();
    13.9 +
   13.10 +void img_modules_init(void)
   13.11 +{
   13.12 +	img_register_jpeg();
   13.13 +	img_register_png();
   13.14 +	img_register_ppm();
   13.15 +	img_register_rgbe();
   13.16 +}
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/libs/libjpeg/README	Sun Nov 01 00:36:56 2015 +0200
    14.3 @@ -0,0 +1,326 @@
    14.4 +The Independent JPEG Group's JPEG software
    14.5 +==========================================
    14.6 +
    14.7 +README for release 8c of 16-Jan-2011
    14.8 +====================================
    14.9 +
   14.10 +This distribution contains the eighth public release of the Independent JPEG
   14.11 +Group's free JPEG software.  You are welcome to redistribute this software and
   14.12 +to use it for any purpose, subject to the conditions under LEGAL ISSUES, below.
   14.13 +
   14.14 +This software is the work of Tom Lane, Guido Vollbeding, Philip Gladstone,
   14.15 +Bill Allombert, Jim Boucher, Lee Crocker, Bob Friesenhahn, Ben Jackson,
   14.16 +Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi, Ge' Weijers,
   14.17 +and other members of the Independent JPEG Group.
   14.18 +
   14.19 +IJG is not affiliated with the official ISO JPEG standards committee.
   14.20 +
   14.21 +
   14.22 +DOCUMENTATION ROADMAP
   14.23 +=====================
   14.24 +
   14.25 +This file contains the following sections:
   14.26 +
   14.27 +OVERVIEW            General description of JPEG and the IJG software.
   14.28 +LEGAL ISSUES        Copyright, lack of warranty, terms of distribution.
   14.29 +REFERENCES          Where to learn more about JPEG.
   14.30 +ARCHIVE LOCATIONS   Where to find newer versions of this software.
   14.31 +ACKNOWLEDGMENTS     Special thanks.
   14.32 +FILE FORMAT WARS    Software *not* to get.
   14.33 +TO DO               Plans for future IJG releases.
   14.34 +
   14.35 +Other documentation files in the distribution are:
   14.36 +
   14.37 +User documentation:
   14.38 +  install.txt       How to configure and install the IJG software.
   14.39 +  usage.txt         Usage instructions for cjpeg, djpeg, jpegtran,
   14.40 +                    rdjpgcom, and wrjpgcom.
   14.41 +  *.1               Unix-style man pages for programs (same info as usage.txt).
   14.42 +  wizard.txt        Advanced usage instructions for JPEG wizards only.
   14.43 +  change.log        Version-to-version change highlights.
   14.44 +Programmer and internal documentation:
   14.45 +  libjpeg.txt       How to use the JPEG library in your own programs.
   14.46 +  example.c         Sample code for calling the JPEG library.
   14.47 +  structure.txt     Overview of the JPEG library's internal structure.
   14.48 +  filelist.txt      Road map of IJG files.
   14.49 +  coderules.txt     Coding style rules --- please read if you contribute code.
   14.50 +
   14.51 +Please read at least the files install.txt and usage.txt.  Some information
   14.52 +can also be found in the JPEG FAQ (Frequently Asked Questions) article.  See
   14.53 +ARCHIVE LOCATIONS below to find out where to obtain the FAQ article.
   14.54 +
   14.55 +If you want to understand how the JPEG code works, we suggest reading one or
   14.56 +more of the REFERENCES, then looking at the documentation files (in roughly
   14.57 +the order listed) before diving into the code.
   14.58 +
   14.59 +
   14.60 +OVERVIEW
   14.61 +========
   14.62 +
   14.63 +This package contains C software to implement JPEG image encoding, decoding,
   14.64 +and transcoding.  JPEG (pronounced "jay-peg") is a standardized compression
   14.65 +method for full-color and gray-scale images.
   14.66 +
   14.67 +This software implements JPEG baseline, extended-sequential, and progressive
   14.68 +compression processes.  Provision is made for supporting all variants of these
   14.69 +processes, although some uncommon parameter settings aren't implemented yet.
   14.70 +We have made no provision for supporting the hierarchical or lossless
   14.71 +processes defined in the standard.
   14.72 +
   14.73 +We provide a set of library routines for reading and writing JPEG image files,
   14.74 +plus two sample applications "cjpeg" and "djpeg", which use the library to
   14.75 +perform conversion between JPEG and some other popular image file formats.
   14.76 +The library is intended to be reused in other applications.
   14.77 +
   14.78 +In order to support file conversion and viewing software, we have included
   14.79 +considerable functionality beyond the bare JPEG coding/decoding capability;
   14.80 +for example, the color quantization modules are not strictly part of JPEG
   14.81 +decoding, but they are essential for output to colormapped file formats or
   14.82 +colormapped displays.  These extra functions can be compiled out of the
   14.83 +library if not required for a particular application.
   14.84 +
   14.85 +We have also included "jpegtran", a utility for lossless transcoding between
   14.86 +different JPEG processes, and "rdjpgcom" and "wrjpgcom", two simple
   14.87 +applications for inserting and extracting textual comments in JFIF files.
   14.88 +
   14.89 +The emphasis in designing this software has been on achieving portability and
   14.90 +flexibility, while also making it fast enough to be useful.  In particular,
   14.91 +the software is not intended to be read as a tutorial on JPEG.  (See the
   14.92 +REFERENCES section for introductory material.)  Rather, it is intended to
   14.93 +be reliable, portable, industrial-strength code.  We do not claim to have
   14.94 +achieved that goal in every aspect of the software, but we strive for it.
   14.95 +
   14.96 +We welcome the use of this software as a component of commercial products.
   14.97 +No royalty is required, but we do ask for an acknowledgement in product
   14.98 +documentation, as described under LEGAL ISSUES.
   14.99 +
  14.100 +
  14.101 +LEGAL ISSUES
  14.102 +============
  14.103 +
  14.104 +In plain English:
  14.105 +
  14.106 +1. We don't promise that this software works.  (But if you find any bugs,
  14.107 +   please let us know!)
  14.108 +2. You can use this software for whatever you want.  You don't have to pay us.
  14.109 +3. You may not pretend that you wrote this software.  If you use it in a
  14.110 +   program, you must acknowledge somewhere in your documentation that
  14.111 +   you've used the IJG code.
  14.112 +
  14.113 +In legalese:
  14.114 +
  14.115 +The authors make NO WARRANTY or representation, either express or implied,
  14.116 +with respect to this software, its quality, accuracy, merchantability, or
  14.117 +fitness for a particular purpose.  This software is provided "AS IS", and you,
  14.118 +its user, assume the entire risk as to its quality and accuracy.
  14.119 +
  14.120 +This software is copyright (C) 1991-2011, Thomas G. Lane, Guido Vollbeding.
  14.121 +All Rights Reserved except as specified below.
  14.122 +
  14.123 +Permission is hereby granted to use, copy, modify, and distribute this
  14.124 +software (or portions thereof) for any purpose, without fee, subject to these
  14.125 +conditions:
  14.126 +(1) If any part of the source code for this software is distributed, then this
  14.127 +README file must be included, with this copyright and no-warranty notice
  14.128 +unaltered; and any additions, deletions, or changes to the original files
  14.129 +must be clearly indicated in accompanying documentation.
  14.130 +(2) If only executable code is distributed, then the accompanying
  14.131 +documentation must state that "this software is based in part on the work of
  14.132 +the Independent JPEG Group".
  14.133 +(3) Permission for use of this software is granted only if the user accepts
  14.134 +full responsibility for any undesirable consequences; the authors accept
  14.135 +NO LIABILITY for damages of any kind.
  14.136 +
  14.137 +These conditions apply to any software derived from or based on the IJG code,
  14.138 +not just to the unmodified library.  If you use our work, you ought to
  14.139 +acknowledge us.
  14.140 +
  14.141 +Permission is NOT granted for the use of any IJG author's name or company name
  14.142 +in advertising or publicity relating to this software or products derived from
  14.143 +it.  This software may be referred to only as "the Independent JPEG Group's
  14.144 +software".
  14.145 +
  14.146 +We specifically permit and encourage the use of this software as the basis of
  14.147 +commercial products, provided that all warranty or liability claims are
  14.148 +assumed by the product vendor.
  14.149 +
  14.150 +
  14.151 +ansi2knr.c is included in this distribution by permission of L. Peter Deutsch,
  14.152 +sole proprietor of its copyright holder, Aladdin Enterprises of Menlo Park, CA.
  14.153 +ansi2knr.c is NOT covered by the above copyright and conditions, but instead
  14.154 +by the usual distribution terms of the Free Software Foundation; principally,
  14.155 +that you must include source code if you redistribute it.  (See the file
  14.156 +ansi2knr.c for full details.)  However, since ansi2knr.c is not needed as part
  14.157 +of any program generated from the IJG code, this does not limit you more than
  14.158 +the foregoing paragraphs do.
  14.159 +
  14.160 +The Unix configuration script "configure" was produced with GNU Autoconf.
  14.161 +It is copyright by the Free Software Foundation but is freely distributable.
  14.162 +The same holds for its supporting scripts (config.guess, config.sub,
  14.163 +ltmain.sh).  Another support script, install-sh, is copyright by X Consortium
  14.164 +but is also freely distributable.
  14.165 +
  14.166 +The IJG distribution formerly included code to read and write GIF files.
  14.167 +To avoid entanglement with the Unisys LZW patent, GIF reading support has
  14.168 +been removed altogether, and the GIF writer has been simplified to produce
  14.169 +"uncompressed GIFs".  This technique does not use the LZW algorithm; the
  14.170 +resulting GIF files are larger than usual, but are readable by all standard
  14.171 +GIF decoders.
  14.172 +
  14.173 +We are required to state that
  14.174 +    "The Graphics Interchange Format(c) is the Copyright property of
  14.175 +    CompuServe Incorporated.  GIF(sm) is a Service Mark property of
  14.176 +    CompuServe Incorporated."
  14.177 +
  14.178 +
  14.179 +REFERENCES
  14.180 +==========
  14.181 +
  14.182 +We recommend reading one or more of these references before trying to
  14.183 +understand the innards of the JPEG software.
  14.184 +
  14.185 +The best short technical introduction to the JPEG compression algorithm is
  14.186 +	Wallace, Gregory K.  "The JPEG Still Picture Compression Standard",
  14.187 +	Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44.
  14.188 +(Adjacent articles in that issue discuss MPEG motion picture compression,
  14.189 +applications of JPEG, and related topics.)  If you don't have the CACM issue
  14.190 +handy, a PostScript file containing a revised version of Wallace's article is
  14.191 +available at http://www.ijg.org/files/wallace.ps.gz.  The file (actually
  14.192 +a preprint for an article that appeared in IEEE Trans. Consumer Electronics)
  14.193 +omits the sample images that appeared in CACM, but it includes corrections
  14.194 +and some added material.  Note: the Wallace article is copyright ACM and IEEE,
  14.195 +and it may not be used for commercial purposes.
  14.196 +
  14.197 +A somewhat less technical, more leisurely introduction to JPEG can be found in
  14.198 +"The Data Compression Book" by Mark Nelson and Jean-loup Gailly, published by
  14.199 +M&T Books (New York), 2nd ed. 1996, ISBN 1-55851-434-1.  This book provides
  14.200 +good explanations and example C code for a multitude of compression methods
  14.201 +including JPEG.  It is an excellent source if you are comfortable reading C
  14.202 +code but don't know much about data compression in general.  The book's JPEG
  14.203 +sample code is far from industrial-strength, but when you are ready to look
  14.204 +at a full implementation, you've got one here...
  14.205 +
  14.206 +The best currently available description of JPEG is the textbook "JPEG Still
  14.207 +Image Data Compression Standard" by William B. Pennebaker and Joan L.
  14.208 +Mitchell, published by Van Nostrand Reinhold, 1993, ISBN 0-442-01272-1.
  14.209 +Price US$59.95, 638 pp.  The book includes the complete text of the ISO JPEG
  14.210 +standards (DIS 10918-1 and draft DIS 10918-2).
  14.211 +Although this is by far the most detailed and comprehensive exposition of
  14.212 +JPEG publicly available, we point out that it is still missing an explanation
  14.213 +of the most essential properties and algorithms of the underlying DCT
  14.214 +technology.
  14.215 +If you think that you know about DCT-based JPEG after reading this book,
  14.216 +then you are in delusion.  The real fundamentals and corresponding potential
  14.217 +of DCT-based JPEG are not publicly known so far, and that is the reason for
  14.218 +all the mistaken developments taking place in the image coding domain.
  14.219 +
  14.220 +The original JPEG standard is divided into two parts, Part 1 being the actual
  14.221 +specification, while Part 2 covers compliance testing methods.  Part 1 is
  14.222 +titled "Digital Compression and Coding of Continuous-tone Still Images,
  14.223 +Part 1: Requirements and guidelines" and has document numbers ISO/IEC IS
  14.224 +10918-1, ITU-T T.81.  Part 2 is titled "Digital Compression and Coding of
  14.225 +Continuous-tone Still Images, Part 2: Compliance testing" and has document
  14.226 +numbers ISO/IEC IS 10918-2, ITU-T T.83.
  14.227 +IJG JPEG 8 introduces an implementation of the JPEG SmartScale extension
  14.228 +which is specified in a contributed document at ITU and ISO with title "ITU-T
  14.229 +JPEG-Plus Proposal for Extending ITU-T T.81 for Advanced Image Coding", April
  14.230 +2006, Geneva, Switzerland.  The latest version of the document is Revision 3.
  14.231 +
  14.232 +The JPEG standard does not specify all details of an interchangeable file
  14.233 +format.  For the omitted details we follow the "JFIF" conventions, revision
  14.234 +1.02.  JFIF 1.02 has been adopted as an Ecma International Technical Report
  14.235 +and thus received a formal publication status.  It is available as a free
  14.236 +download in PDF format from
  14.237 +http://www.ecma-international.org/publications/techreports/E-TR-098.htm.
  14.238 +A PostScript version of the JFIF document is available at
  14.239 +http://www.ijg.org/files/jfif.ps.gz.  There is also a plain text version at
  14.240 +http://www.ijg.org/files/jfif.txt.gz, but it is missing the figures.
  14.241 +
  14.242 +The TIFF 6.0 file format specification can be obtained by FTP from
  14.243 +ftp://ftp.sgi.com/graphics/tiff/TIFF6.ps.gz.  The JPEG incorporation scheme
  14.244 +found in the TIFF 6.0 spec of 3-June-92 has a number of serious problems.
  14.245 +IJG does not recommend use of the TIFF 6.0 design (TIFF Compression tag 6).
  14.246 +Instead, we recommend the JPEG design proposed by TIFF Technical Note #2
  14.247 +(Compression tag 7).  Copies of this Note can be obtained from
  14.248 +http://www.ijg.org/files/.  It is expected that the next revision
  14.249 +of the TIFF spec will replace the 6.0 JPEG design with the Note's design.
  14.250 +Although IJG's own code does not support TIFF/JPEG, the free libtiff library
  14.251 +uses our library to implement TIFF/JPEG per the Note.
  14.252 +
  14.253 +
  14.254 +ARCHIVE LOCATIONS
  14.255 +=================
  14.256 +
  14.257 +The "official" archive site for this software is www.ijg.org.
  14.258 +The most recent released version can always be found there in
  14.259 +directory "files".  This particular version will be archived as
  14.260 +http://www.ijg.org/files/jpegsrc.v8c.tar.gz, and in Windows-compatible
  14.261 +"zip" archive format as http://www.ijg.org/files/jpegsr8c.zip.
  14.262 +
  14.263 +The JPEG FAQ (Frequently Asked Questions) article is a source of some
  14.264 +general information about JPEG.
  14.265 +It is available on the World Wide Web at http://www.faqs.org/faqs/jpeg-faq/
  14.266 +and other news.answers archive sites, including the official news.answers
  14.267 +archive at rtfm.mit.edu: ftp://rtfm.mit.edu/pub/usenet/news.answers/jpeg-faq/.
  14.268 +If you don't have Web or FTP access, send e-mail to mail-server@rtfm.mit.edu
  14.269 +with body
  14.270 +	send usenet/news.answers/jpeg-faq/part1
  14.271 +	send usenet/news.answers/jpeg-faq/part2
  14.272 +
  14.273 +
  14.274 +ACKNOWLEDGMENTS
  14.275 +===============
  14.276 +
  14.277 +Thank to Juergen Bruder for providing me with a copy of the common DCT
  14.278 +algorithm article, only to find out that I had come to the same result
  14.279 +in a more direct and comprehensible way with a more generative approach.
  14.280 +
  14.281 +Thank to Istvan Sebestyen and Joan L. Mitchell for inviting me to the
  14.282 +ITU JPEG (Study Group 16) meeting in Geneva, Switzerland.
  14.283 +
  14.284 +Thank to Thomas Wiegand and Gary Sullivan for inviting me to the
  14.285 +Joint Video Team (MPEG & ITU) meeting in Geneva, Switzerland.
  14.286 +
  14.287 +Thank to John Korejwa and Massimo Ballerini for inviting me to
  14.288 +fruitful consultations in Boston, MA and Milan, Italy.
  14.289 +
  14.290 +Thank to Hendrik Elstner, Roland Fassauer, Simone Zuck, Guenther
  14.291 +Maier-Gerber, Walter Stoeber, Fred Schmitz, and Norbert Braunagel
  14.292 +for corresponding business development.
  14.293 +
  14.294 +Thank to Nico Zschach and Dirk Stelling of the technical support team
  14.295 +at the Digital Images company in Halle for providing me with extra
  14.296 +equipment for configuration tests.
  14.297 +
  14.298 +Thank to Richard F. Lyon (then of Foveon Inc.) for fruitful
  14.299 +communication about JPEG configuration in Sigma Photo Pro software.
  14.300 +
  14.301 +Thank to Andrew Finkenstadt for hosting the ijg.org site.
  14.302 +
  14.303 +Last but not least special thank to Thomas G. Lane for the original
  14.304 +design and development of this singular software package.
  14.305 +
  14.306 +
  14.307 +FILE FORMAT WARS
  14.308 +================
  14.309 +
  14.310 +The ISO JPEG standards committee actually promotes different formats like
  14.311 +"JPEG 2000" or "JPEG XR" which are incompatible with original DCT-based
  14.312 +JPEG and which are based on faulty technologies.  IJG therefore does not
  14.313 +and will not support such momentary mistakes (see REFERENCES).
  14.314 +We have little or no sympathy for the promotion of these formats.  Indeed,
  14.315 +one of the original reasons for developing this free software was to help
  14.316 +force convergence on common, interoperable format standards for JPEG files.
  14.317 +Don't use an incompatible file format!
  14.318 +(In any case, our decoder will remain capable of reading existing JPEG
  14.319 +image files indefinitely.)
  14.320 +
  14.321 +
  14.322 +TO DO
  14.323 +=====
  14.324 +
  14.325 +Version 8 is the first release of a new generation JPEG standard
  14.326 +to overcome the limitations of the original JPEG specification.
  14.327 +More features are being prepared for coming releases...
  14.328 +
  14.329 +Please send bug reports, offers of help, etc. to jpeg-info@uc.ag.
    15.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.2 +++ b/libs/libjpeg/cderror.h	Sun Nov 01 00:36:56 2015 +0200
    15.3 @@ -0,0 +1,132 @@
    15.4 +/*
    15.5 + * cderror.h
    15.6 + *
    15.7 + * Copyright (C) 1994-1997, Thomas G. Lane.
    15.8 + * This file is part of the Independent JPEG Group's software.
    15.9 + * For conditions of distribution and use, see the accompanying README file.
   15.10 + *
   15.11 + * This file defines the error and message codes for the cjpeg/djpeg
   15.12 + * applications.  These strings are not needed as part of the JPEG library
   15.13 + * proper.
   15.14 + * Edit this file to add new codes, or to translate the message strings to
   15.15 + * some other language.
   15.16 + */
   15.17 +
   15.18 +/*
   15.19 + * To define the enum list of message codes, include this file without
   15.20 + * defining macro JMESSAGE.  To create a message string table, include it
   15.21 + * again with a suitable JMESSAGE definition (see jerror.c for an example).
   15.22 + */
   15.23 +#ifndef JMESSAGE
   15.24 +#ifndef CDERROR_H
   15.25 +#define CDERROR_H
   15.26 +/* First time through, define the enum list */
   15.27 +#define JMAKE_ENUM_LIST
   15.28 +#else
   15.29 +/* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */
   15.30 +#define JMESSAGE(code,string)
   15.31 +#endif /* CDERROR_H */
   15.32 +#endif /* JMESSAGE */
   15.33 +
   15.34 +#ifdef JMAKE_ENUM_LIST
   15.35 +
   15.36 +typedef enum {
   15.37 +
   15.38 +#define JMESSAGE(code,string)	code ,
   15.39 +
   15.40 +#endif /* JMAKE_ENUM_LIST */
   15.41 +
   15.42 +JMESSAGE(JMSG_FIRSTADDONCODE=1000, NULL) /* Must be first entry! */
   15.43 +
   15.44 +#ifdef BMP_SUPPORTED
   15.45 +JMESSAGE(JERR_BMP_BADCMAP, "Unsupported BMP colormap format")
   15.46 +JMESSAGE(JERR_BMP_BADDEPTH, "Only 8- and 24-bit BMP files are supported")
   15.47 +JMESSAGE(JERR_BMP_BADHEADER, "Invalid BMP file: bad header length")
   15.48 +JMESSAGE(JERR_BMP_BADPLANES, "Invalid BMP file: biPlanes not equal to 1")
   15.49 +JMESSAGE(JERR_BMP_COLORSPACE, "BMP output must be grayscale or RGB")
   15.50 +JMESSAGE(JERR_BMP_COMPRESSED, "Sorry, compressed BMPs not yet supported")
   15.51 +JMESSAGE(JERR_BMP_NOT, "Not a BMP file - does not start with BM")
   15.52 +JMESSAGE(JTRC_BMP, "%ux%u 24-bit BMP image")
   15.53 +JMESSAGE(JTRC_BMP_MAPPED, "%ux%u 8-bit colormapped BMP image")
   15.54 +JMESSAGE(JTRC_BMP_OS2, "%ux%u 24-bit OS2 BMP image")
   15.55 +JMESSAGE(JTRC_BMP_OS2_MAPPED, "%ux%u 8-bit colormapped OS2 BMP image")
   15.56 +#endif /* BMP_SUPPORTED */
   15.57 +
   15.58 +#ifdef GIF_SUPPORTED
   15.59 +JMESSAGE(JERR_GIF_BUG, "GIF output got confused")
   15.60 +JMESSAGE(JERR_GIF_CODESIZE, "Bogus GIF codesize %d")
   15.61 +JMESSAGE(JERR_GIF_COLORSPACE, "GIF output must be grayscale or RGB")
   15.62 +JMESSAGE(JERR_GIF_IMAGENOTFOUND, "Too few images in GIF file")
   15.63 +JMESSAGE(JERR_GIF_NOT, "Not a GIF file")
   15.64 +JMESSAGE(JTRC_GIF, "%ux%ux%d GIF image")
   15.65 +JMESSAGE(JTRC_GIF_BADVERSION,
   15.66 +	 "Warning: unexpected GIF version number '%c%c%c'")
   15.67 +JMESSAGE(JTRC_GIF_EXTENSION, "Ignoring GIF extension block of type 0x%02x")
   15.68 +JMESSAGE(JTRC_GIF_NONSQUARE, "Caution: nonsquare pixels in input")
   15.69 +JMESSAGE(JWRN_GIF_BADDATA, "Corrupt data in GIF file")
   15.70 +JMESSAGE(JWRN_GIF_CHAR, "Bogus char 0x%02x in GIF file, ignoring")
   15.71 +JMESSAGE(JWRN_GIF_ENDCODE, "Premature end of GIF image")
   15.72 +JMESSAGE(JWRN_GIF_NOMOREDATA, "Ran out of GIF bits")
   15.73 +#endif /* GIF_SUPPORTED */
   15.74 +
   15.75 +#ifdef PPM_SUPPORTED
   15.76 +JMESSAGE(JERR_PPM_COLORSPACE, "PPM output must be grayscale or RGB")
   15.77 +JMESSAGE(JERR_PPM_NONNUMERIC, "Nonnumeric data in PPM file")
   15.78 +JMESSAGE(JERR_PPM_NOT, "Not a PPM/PGM file")
   15.79 +JMESSAGE(JTRC_PGM, "%ux%u PGM image")
   15.80 +JMESSAGE(JTRC_PGM_TEXT, "%ux%u text PGM image")
   15.81 +JMESSAGE(JTRC_PPM, "%ux%u PPM image")
   15.82 +JMESSAGE(JTRC_PPM_TEXT, "%ux%u text PPM image")
   15.83 +#endif /* PPM_SUPPORTED */
   15.84 +
   15.85 +#ifdef RLE_SUPPORTED
   15.86 +JMESSAGE(JERR_RLE_BADERROR, "Bogus error code from RLE library")
   15.87 +JMESSAGE(JERR_RLE_COLORSPACE, "RLE output must be grayscale or RGB")
   15.88 +JMESSAGE(JERR_RLE_DIMENSIONS, "Image dimensions (%ux%u) too large for RLE")
   15.89 +JMESSAGE(JERR_RLE_EMPTY, "Empty RLE file")
   15.90 +JMESSAGE(JERR_RLE_EOF, "Premature EOF in RLE header")
   15.91 +JMESSAGE(JERR_RLE_MEM, "Insufficient memory for RLE header")
   15.92 +JMESSAGE(JERR_RLE_NOT, "Not an RLE file")
   15.93 +JMESSAGE(JERR_RLE_TOOMANYCHANNELS, "Cannot handle %d output channels for RLE")
   15.94 +JMESSAGE(JERR_RLE_UNSUPPORTED, "Cannot handle this RLE setup")
   15.95 +JMESSAGE(JTRC_RLE, "%ux%u full-color RLE file")
   15.96 +JMESSAGE(JTRC_RLE_FULLMAP, "%ux%u full-color RLE file with map of length %d")
   15.97 +JMESSAGE(JTRC_RLE_GRAY, "%ux%u grayscale RLE file")
   15.98 +JMESSAGE(JTRC_RLE_MAPGRAY, "%ux%u grayscale RLE file with map of length %d")
   15.99 +JMESSAGE(JTRC_RLE_MAPPED, "%ux%u colormapped RLE file with map of length %d")
  15.100 +#endif /* RLE_SUPPORTED */
  15.101 +
  15.102 +#ifdef TARGA_SUPPORTED
  15.103 +JMESSAGE(JERR_TGA_BADCMAP, "Unsupported Targa colormap format")
  15.104 +JMESSAGE(JERR_TGA_BADPARMS, "Invalid or unsupported Targa file")
  15.105 +JMESSAGE(JERR_TGA_COLORSPACE, "Targa output must be grayscale or RGB")
  15.106 +JMESSAGE(JTRC_TGA, "%ux%u RGB Targa image")
  15.107 +JMESSAGE(JTRC_TGA_GRAY, "%ux%u grayscale Targa image")
  15.108 +JMESSAGE(JTRC_TGA_MAPPED, "%ux%u colormapped Targa image")
  15.109 +#else
  15.110 +JMESSAGE(JERR_TGA_NOTCOMP, "Targa support was not compiled")
  15.111 +#endif /* TARGA_SUPPORTED */
  15.112 +
  15.113 +JMESSAGE(JERR_BAD_CMAP_FILE,
  15.114 +	 "Color map file is invalid or of unsupported format")
  15.115 +JMESSAGE(JERR_TOO_MANY_COLORS,
  15.116 +	 "Output file format cannot handle %d colormap entries")
  15.117 +JMESSAGE(JERR_UNGETC_FAILED, "ungetc failed")
  15.118 +#ifdef TARGA_SUPPORTED
  15.119 +JMESSAGE(JERR_UNKNOWN_FORMAT,
  15.120 +	 "Unrecognized input file format --- perhaps you need -targa")
  15.121 +#else
  15.122 +JMESSAGE(JERR_UNKNOWN_FORMAT, "Unrecognized input file format")
  15.123 +#endif
  15.124 +JMESSAGE(JERR_UNSUPPORTED_FORMAT, "Unsupported output file format")
  15.125 +
  15.126 +#ifdef JMAKE_ENUM_LIST
  15.127 +
  15.128 +  JMSG_LASTADDONCODE
  15.129 +} ADDON_MESSAGE_CODE;
  15.130 +
  15.131 +#undef JMAKE_ENUM_LIST
  15.132 +#endif /* JMAKE_ENUM_LIST */
  15.133 +
  15.134 +/* Zap JMESSAGE macro so that future re-inclusions do nothing by default */
  15.135 +#undef JMESSAGE
    16.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.2 +++ b/libs/libjpeg/jcapimin.c	Sun Nov 01 00:36:56 2015 +0200
    16.3 @@ -0,0 +1,280 @@
    16.4 +/*
    16.5 + * jcapimin.c
    16.6 + *
    16.7 + * Copyright (C) 1994-1998, Thomas G. Lane.
    16.8 + * This file is part of the Independent JPEG Group's software.
    16.9 + * For conditions of distribution and use, see the accompanying README file.
   16.10 + *
   16.11 + * This file contains application interface code for the compression half
   16.12 + * of the JPEG library.  These are the "minimum" API routines that may be
   16.13 + * needed in either the normal full-compression case or the transcoding-only
   16.14 + * case.
   16.15 + *
   16.16 + * Most of the routines intended to be called directly by an application
   16.17 + * are in this file or in jcapistd.c.  But also see jcparam.c for
   16.18 + * parameter-setup helper routines, jcomapi.c for routines shared by
   16.19 + * compression and decompression, and jctrans.c for the transcoding case.
   16.20 + */
   16.21 +
   16.22 +#define JPEG_INTERNALS
   16.23 +#include "jinclude.h"
   16.24 +#include "jpeglib.h"
   16.25 +
   16.26 +
   16.27 +/*
   16.28 + * Initialization of a JPEG compression object.
   16.29 + * The error manager must already be set up (in case memory manager fails).
   16.30 + */
   16.31 +
   16.32 +GLOBAL(void)
   16.33 +jpeg_CreateCompress (j_compress_ptr cinfo, int version, size_t structsize)
   16.34 +{
   16.35 +  int i;
   16.36 +
   16.37 +  /* Guard against version mismatches between library and caller. */
   16.38 +  cinfo->mem = NULL;		/* so jpeg_destroy knows mem mgr not called */
   16.39 +  if (version != JPEG_LIB_VERSION)
   16.40 +    ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version);
   16.41 +  if (structsize != SIZEOF(struct jpeg_compress_struct))
   16.42 +    ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE, 
   16.43 +	     (int) SIZEOF(struct jpeg_compress_struct), (int) structsize);
   16.44 +
   16.45 +  /* For debugging purposes, we zero the whole master structure.
   16.46 +   * But the application has already set the err pointer, and may have set
   16.47 +   * client_data, so we have to save and restore those fields.
   16.48 +   * Note: if application hasn't set client_data, tools like Purify may
   16.49 +   * complain here.
   16.50 +   */
   16.51 +  {
   16.52 +    struct jpeg_error_mgr * err = cinfo->err;
   16.53 +    void * client_data = cinfo->client_data; /* ignore Purify complaint here */
   16.54 +    MEMZERO(cinfo, SIZEOF(struct jpeg_compress_struct));
   16.55 +    cinfo->err = err;
   16.56 +    cinfo->client_data = client_data;
   16.57 +  }
   16.58 +  cinfo->is_decompressor = FALSE;
   16.59 +
   16.60 +  /* Initialize a memory manager instance for this object */
   16.61 +  jinit_memory_mgr((j_common_ptr) cinfo);
   16.62 +
   16.63 +  /* Zero out pointers to permanent structures. */
   16.64 +  cinfo->progress = NULL;
   16.65 +  cinfo->dest = NULL;
   16.66 +
   16.67 +  cinfo->comp_info = NULL;
   16.68 +
   16.69 +  for (i = 0; i < NUM_QUANT_TBLS; i++)
   16.70 +    cinfo->quant_tbl_ptrs[i] = NULL;
   16.71 +
   16.72 +  for (i = 0; i < NUM_HUFF_TBLS; i++) {
   16.73 +    cinfo->dc_huff_tbl_ptrs[i] = NULL;
   16.74 +    cinfo->ac_huff_tbl_ptrs[i] = NULL;
   16.75 +  }
   16.76 +
   16.77 +  cinfo->script_space = NULL;
   16.78 +
   16.79 +  cinfo->input_gamma = 1.0;	/* in case application forgets */
   16.80 +
   16.81 +  /* OK, I'm ready */
   16.82 +  cinfo->global_state = CSTATE_START;
   16.83 +}
   16.84 +
   16.85 +
   16.86 +/*
   16.87 + * Destruction of a JPEG compression object
   16.88 + */
   16.89 +
   16.90 +GLOBAL(void)
   16.91 +jpeg_destroy_compress (j_compress_ptr cinfo)
   16.92 +{
   16.93 +  jpeg_destroy((j_common_ptr) cinfo); /* use common routine */
   16.94 +}
   16.95 +
   16.96 +
   16.97 +/*
   16.98 + * Abort processing of a JPEG compression operation,
   16.99 + * but don't destroy the object itself.
  16.100 + */
  16.101 +
  16.102 +GLOBAL(void)
  16.103 +jpeg_abort_compress (j_compress_ptr cinfo)
  16.104 +{
  16.105 +  jpeg_abort((j_common_ptr) cinfo); /* use common routine */
  16.106 +}
  16.107 +
  16.108 +
  16.109 +/*
  16.110 + * Forcibly suppress or un-suppress all quantization and Huffman tables.
  16.111 + * Marks all currently defined tables as already written (if suppress)
  16.112 + * or not written (if !suppress).  This will control whether they get emitted
  16.113 + * by a subsequent jpeg_start_compress call.
  16.114 + *
  16.115 + * This routine is exported for use by applications that want to produce
  16.116 + * abbreviated JPEG datastreams.  It logically belongs in jcparam.c, but
  16.117 + * since it is called by jpeg_start_compress, we put it here --- otherwise
  16.118 + * jcparam.o would be linked whether the application used it or not.
  16.119 + */
  16.120 +
  16.121 +GLOBAL(void)
  16.122 +jpeg_suppress_tables (j_compress_ptr cinfo, boolean suppress)
  16.123 +{
  16.124 +  int i;
  16.125 +  JQUANT_TBL * qtbl;
  16.126 +  JHUFF_TBL * htbl;
  16.127 +
  16.128 +  for (i = 0; i < NUM_QUANT_TBLS; i++) {
  16.129 +    if ((qtbl = cinfo->quant_tbl_ptrs[i]) != NULL)
  16.130 +      qtbl->sent_table = suppress;
  16.131 +  }
  16.132 +
  16.133 +  for (i = 0; i < NUM_HUFF_TBLS; i++) {
  16.134 +    if ((htbl = cinfo->dc_huff_tbl_ptrs[i]) != NULL)
  16.135 +      htbl->sent_table = suppress;
  16.136 +    if ((htbl = cinfo->ac_huff_tbl_ptrs[i]) != NULL)
  16.137 +      htbl->sent_table = suppress;
  16.138 +  }
  16.139 +}
  16.140 +
  16.141 +
  16.142 +/*
  16.143 + * Finish JPEG compression.
  16.144 + *
  16.145 + * If a multipass operating mode was selected, this may do a great deal of
  16.146 + * work including most of the actual output.
  16.147 + */
  16.148 +
  16.149 +GLOBAL(void)
  16.150 +jpeg_finish_compress (j_compress_ptr cinfo)
  16.151 +{
  16.152 +  JDIMENSION iMCU_row;
  16.153 +
  16.154 +  if (cinfo->global_state == CSTATE_SCANNING ||
  16.155 +      cinfo->global_state == CSTATE_RAW_OK) {
  16.156 +    /* Terminate first pass */
  16.157 +    if (cinfo->next_scanline < cinfo->image_height)
  16.158 +      ERREXIT(cinfo, JERR_TOO_LITTLE_DATA);
  16.159 +    (*cinfo->master->finish_pass) (cinfo);
  16.160 +  } else if (cinfo->global_state != CSTATE_WRCOEFS)
  16.161 +    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
  16.162 +  /* Perform any remaining passes */
  16.163 +  while (! cinfo->master->is_last_pass) {
  16.164 +    (*cinfo->master->prepare_for_pass) (cinfo);
  16.165 +    for (iMCU_row = 0; iMCU_row < cinfo->total_iMCU_rows; iMCU_row++) {
  16.166 +      if (cinfo->progress != NULL) {
  16.167 +	cinfo->progress->pass_counter = (long) iMCU_row;
  16.168 +	cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows;
  16.169 +	(*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
  16.170 +      }
  16.171 +      /* We bypass the main controller and invoke coef controller directly;
  16.172 +       * all work is being done from the coefficient buffer.
  16.173 +       */
  16.174 +      if (! (*cinfo->coef->compress_data) (cinfo, (JSAMPIMAGE) NULL))
  16.175 +	ERREXIT(cinfo, JERR_CANT_SUSPEND);
  16.176 +    }
  16.177 +    (*cinfo->master->finish_pass) (cinfo);
  16.178 +  }
  16.179 +  /* Write EOI, do final cleanup */
  16.180 +  (*cinfo->marker->write_file_trailer) (cinfo);
  16.181 +  (*cinfo->dest->term_destination) (cinfo);
  16.182 +  /* We can use jpeg_abort to release memory and reset global_state */
  16.183 +  jpeg_abort((j_common_ptr) cinfo);
  16.184 +}
  16.185 +
  16.186 +
  16.187 +/*
  16.188 + * Write a special marker.
  16.189 + * This is only recommended for writing COM or APPn markers.
  16.190 + * Must be called after jpeg_start_compress() and before
  16.191 + * first call to jpeg_write_scanlines() or jpeg_write_raw_data().
  16.192 + */
  16.193 +
  16.194 +GLOBAL(void)
  16.195 +jpeg_write_marker (j_compress_ptr cinfo, int marker,
  16.196 +		   const JOCTET *dataptr, unsigned int datalen)
  16.197 +{
  16.198 +  JMETHOD(void, write_marker_byte, (j_compress_ptr info, int val));
  16.199 +
  16.200 +  if (cinfo->next_scanline != 0 ||
  16.201 +      (cinfo->global_state != CSTATE_SCANNING &&
  16.202 +       cinfo->global_state != CSTATE_RAW_OK &&
  16.203 +       cinfo->global_state != CSTATE_WRCOEFS))
  16.204 +    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
  16.205 +
  16.206 +  (*cinfo->marker->write_marker_header) (cinfo, marker, datalen);
  16.207 +  write_marker_byte = cinfo->marker->write_marker_byte;	/* copy for speed */
  16.208 +  while (datalen--) {
  16.209 +    (*write_marker_byte) (cinfo, *dataptr);
  16.210 +    dataptr++;
  16.211 +  }
  16.212 +}
  16.213 +
  16.214 +/* Same, but piecemeal. */
  16.215 +
  16.216 +GLOBAL(void)
  16.217 +jpeg_write_m_header (j_compress_ptr cinfo, int marker, unsigned int datalen)
  16.218 +{
  16.219 +  if (cinfo->next_scanline != 0 ||
  16.220 +      (cinfo->global_state != CSTATE_SCANNING &&
  16.221 +       cinfo->global_state != CSTATE_RAW_OK &&
  16.222 +       cinfo->global_state != CSTATE_WRCOEFS))
  16.223 +    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
  16.224 +
  16.225 +  (*cinfo->marker->write_marker_header) (cinfo, marker, datalen);
  16.226 +}
  16.227 +
  16.228 +GLOBAL(void)
  16.229 +jpeg_write_m_byte (j_compress_ptr cinfo, int val)
  16.230 +{
  16.231 +  (*cinfo->marker->write_marker_byte) (cinfo, val);
  16.232 +}
  16.233 +
  16.234 +
  16.235 +/*
  16.236 + * Alternate compression function: just write an abbreviated table file.
  16.237 + * Before calling this, all parameters and a data destination must be set up.
  16.238 + *
  16.239 + * To produce a pair of files containing abbreviated tables and abbreviated
  16.240 + * image data, one would proceed as follows:
  16.241 + *
  16.242 + *		initialize JPEG object
  16.243 + *		set JPEG parameters
  16.244 + *		set destination to table file
  16.245 + *		jpeg_write_tables(cinfo);
  16.246 + *		set destination to image file
  16.247 + *		jpeg_start_compress(cinfo, FALSE);
  16.248 + *		write data...
  16.249 + *		jpeg_finish_compress(cinfo);
  16.250 + *
  16.251 + * jpeg_write_tables has the side effect of marking all tables written
  16.252 + * (same as jpeg_suppress_tables(..., TRUE)).  Thus a subsequent start_compress
  16.253 + * will not re-emit the tables unless it is passed write_all_tables=TRUE.
  16.254 + */
  16.255 +
  16.256 +GLOBAL(void)
  16.257 +jpeg_write_tables (j_compress_ptr cinfo)
  16.258 +{
  16.259 +  if (cinfo->global_state != CSTATE_START)
  16.260 +    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
  16.261 +
  16.262 +  /* (Re)initialize error mgr and destination modules */
  16.263 +  (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo);
  16.264 +  (*cinfo->dest->init_destination) (cinfo);
  16.265 +  /* Initialize the marker writer ... bit of a crock to do it here. */
  16.266 +  jinit_marker_writer(cinfo);
  16.267 +  /* Write them tables! */
  16.268 +  (*cinfo->marker->write_tables_only) (cinfo);
  16.269 +  /* And clean up. */
  16.270 +  (*cinfo->dest->term_destination) (cinfo);
  16.271 +  /*
  16.272 +   * In library releases up through v6a, we called jpeg_abort() here to free
  16.273 +   * any working memory allocated by the destination manager and marker
  16.274 +   * writer.  Some applications had a problem with that: they allocated space
  16.275 +   * of their own from the library memory manager, and didn't want it to go
  16.276 +   * away during write_tables.  So now we do nothing.  This will cause a
  16.277 +   * memory leak if an app calls write_tables repeatedly without doing a full
  16.278 +   * compression cycle or otherwise resetting the JPEG object.  However, that
  16.279 +   * seems less bad than unexpectedly freeing memory in the normal case.
  16.280 +   * An app that prefers the old behavior can call jpeg_abort for itself after
  16.281 +   * each call to jpeg_write_tables().
  16.282 +   */
  16.283 +}
    17.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.2 +++ b/libs/libjpeg/jcapistd.c	Sun Nov 01 00:36:56 2015 +0200
    17.3 @@ -0,0 +1,161 @@
    17.4 +/*
    17.5 + * jcapistd.c
    17.6 + *
    17.7 + * Copyright (C) 1994-1996, Thomas G. Lane.
    17.8 + * This file is part of the Independent JPEG Group's software.
    17.9 + * For conditions of distribution and use, see the accompanying README file.
   17.10 + *
   17.11 + * This file contains application interface code for the compression half
   17.12 + * of the JPEG library.  These are the "standard" API routines that are
   17.13 + * used in the normal full-compression case.  They are not used by a
   17.14 + * transcoding-only application.  Note that if an application links in
   17.15 + * jpeg_start_compress, it will end up linking in the entire compressor.
   17.16 + * We thus must separate this file from jcapimin.c to avoid linking the
   17.17 + * whole compression library into a transcoder.
   17.18 + */
   17.19 +
   17.20 +#define JPEG_INTERNALS
   17.21 +#include "jinclude.h"
   17.22 +#include "jpeglib.h"
   17.23 +
   17.24 +
   17.25 +/*
   17.26 + * Compression initialization.
   17.27 + * Before calling this, all parameters and a data destination must be set up.
   17.28 + *
   17.29 + * We require a write_all_tables parameter as a failsafe check when writing
   17.30 + * multiple datastreams from the same compression object.  Since prior runs
   17.31 + * will have left all the tables marked sent_table=TRUE, a subsequent run
   17.32 + * would emit an abbreviated stream (no tables) by default.  This may be what
   17.33 + * is wanted, but for safety's sake it should not be the default behavior:
   17.34 + * programmers should have to make a deliberate choice to emit abbreviated
   17.35 + * images.  Therefore the documentation and examples should encourage people
   17.36 + * to pass write_all_tables=TRUE; then it will take active thought to do the
   17.37 + * wrong thing.
   17.38 + */
   17.39 +
   17.40 +GLOBAL(void)
   17.41 +jpeg_start_compress (j_compress_ptr cinfo, boolean write_all_tables)
   17.42 +{
   17.43 +  if (cinfo->global_state != CSTATE_START)
   17.44 +    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
   17.45 +
   17.46 +  if (write_all_tables)
   17.47 +    jpeg_suppress_tables(cinfo, FALSE);	/* mark all tables to be written */
   17.48 +
   17.49 +  /* (Re)initialize error mgr and destination modules */
   17.50 +  (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo);
   17.51 +  (*cinfo->dest->init_destination) (cinfo);
   17.52 +  /* Perform master selection of active modules */
   17.53 +  jinit_compress_master(cinfo);
   17.54 +  /* Set up for the first pass */
   17.55 +  (*cinfo->master->prepare_for_pass) (cinfo);
   17.56 +  /* Ready for application to drive first pass through jpeg_write_scanlines
   17.57 +   * or jpeg_write_raw_data.
   17.58 +   */
   17.59 +  cinfo->next_scanline = 0;
   17.60 +  cinfo->global_state = (cinfo->raw_data_in ? CSTATE_RAW_OK : CSTATE_SCANNING);
   17.61 +}
   17.62 +
   17.63 +
   17.64 +/*
   17.65 + * Write some scanlines of data to the JPEG compressor.
   17.66 + *
   17.67 + * The return value will be the number of lines actually written.
   17.68 + * This should be less than the supplied num_lines only in case that
   17.69 + * the data destination module has requested suspension of the compressor,
   17.70 + * or if more than image_height scanlines are passed in.
   17.71 + *
   17.72 + * Note: we warn about excess calls to jpeg_write_scanlines() since
   17.73 + * this likely signals an application programmer error.  However,
   17.74 + * excess scanlines passed in the last valid call are *silently* ignored,
   17.75 + * so that the application need not adjust num_lines for end-of-image
   17.76 + * when using a multiple-scanline buffer.
   17.77 + */
   17.78 +
   17.79 +GLOBAL(JDIMENSION)
   17.80 +jpeg_write_scanlines (j_compress_ptr cinfo, JSAMPARRAY scanlines,
   17.81 +		      JDIMENSION num_lines)
   17.82 +{
   17.83 +  JDIMENSION row_ctr, rows_left;
   17.84 +
   17.85 +  if (cinfo->global_state != CSTATE_SCANNING)
   17.86 +    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
   17.87 +  if (cinfo->next_scanline >= cinfo->image_height)
   17.88 +    WARNMS(cinfo, JWRN_TOO_MUCH_DATA);
   17.89 +
   17.90 +  /* Call progress monitor hook if present */
   17.91 +  if (cinfo->progress != NULL) {
   17.92 +    cinfo->progress->pass_counter = (long) cinfo->next_scanline;
   17.93 +    cinfo->progress->pass_limit = (long) cinfo->image_height;
   17.94 +    (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
   17.95 +  }
   17.96 +
   17.97 +  /* Give master control module another chance if this is first call to
   17.98 +   * jpeg_write_scanlines.  This lets output of the frame/scan headers be
   17.99 +   * delayed so that application can write COM, etc, markers between
  17.100 +   * jpeg_start_compress and jpeg_write_scanlines.
  17.101 +   */
  17.102 +  if (cinfo->master->call_pass_startup)
  17.103 +    (*cinfo->master->pass_startup) (cinfo);
  17.104 +
  17.105 +  /* Ignore any extra scanlines at bottom of image. */
  17.106 +  rows_left = cinfo->image_height - cinfo->next_scanline;
  17.107 +  if (num_lines > rows_left)
  17.108 +    num_lines = rows_left;
  17.109 +
  17.110 +  row_ctr = 0;
  17.111 +  (*cinfo->main->process_data) (cinfo, scanlines, &row_ctr, num_lines);
  17.112 +  cinfo->next_scanline += row_ctr;
  17.113 +  return row_ctr;
  17.114 +}
  17.115 +
  17.116 +
  17.117 +/*
  17.118 + * Alternate entry point to write raw data.
  17.119 + * Processes exactly one iMCU row per call, unless suspended.
  17.120 + */
  17.121 +
  17.122 +GLOBAL(JDIMENSION)
  17.123 +jpeg_write_raw_data (j_compress_ptr cinfo, JSAMPIMAGE data,
  17.124 +		     JDIMENSION num_lines)
  17.125 +{
  17.126 +  JDIMENSION lines_per_iMCU_row;
  17.127 +
  17.128 +  if (cinfo->global_state != CSTATE_RAW_OK)
  17.129 +    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
  17.130 +  if (cinfo->next_scanline >= cinfo->image_height) {
  17.131 +    WARNMS(cinfo, JWRN_TOO_MUCH_DATA);
  17.132 +    return 0;
  17.133 +  }
  17.134 +
  17.135 +  /* Call progress monitor hook if present */
  17.136 +  if (cinfo->progress != NULL) {
  17.137 +    cinfo->progress->pass_counter = (long) cinfo->next_scanline;
  17.138 +    cinfo->progress->pass_limit = (long) cinfo->image_height;
  17.139 +    (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
  17.140 +  }
  17.141 +
  17.142 +  /* Give master control module another chance if this is first call to
  17.143 +   * jpeg_write_raw_data.  This lets output of the frame/scan headers be
  17.144 +   * delayed so that application can write COM, etc, markers between
  17.145 +   * jpeg_start_compress and jpeg_write_raw_data.
  17.146 +   */
  17.147 +  if (cinfo->master->call_pass_startup)
  17.148 +    (*cinfo->master->pass_startup) (cinfo);
  17.149 +
  17.150 +  /* Verify that at least one iMCU row has been passed. */
  17.151 +  lines_per_iMCU_row = cinfo->max_v_samp_factor * DCTSIZE;
  17.152 +  if (num_lines < lines_per_iMCU_row)
  17.153 +    ERREXIT(cinfo, JERR_BUFFER_SIZE);
  17.154 +
  17.155 +  /* Directly compress the row. */
  17.156 +  if (! (*cinfo->coef->compress_data) (cinfo, data)) {
  17.157 +    /* If compressor did not consume the whole row, suspend processing. */
  17.158 +    return 0;
  17.159 +  }
  17.160 +
  17.161 +  /* OK, we processed one iMCU row. */
  17.162 +  cinfo->next_scanline += lines_per_iMCU_row;
  17.163 +  return lines_per_iMCU_row;
  17.164 +}
    18.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.2 +++ b/libs/libjpeg/jccoefct.c	Sun Nov 01 00:36:56 2015 +0200
    18.3 @@ -0,0 +1,449 @@
    18.4 +/*
    18.5 + * jccoefct.c
    18.6 + *
    18.7 + * Copyright (C) 1994-1997, Thomas G. Lane.
    18.8 + * This file is part of the Independent JPEG Group's software.
    18.9 + * For conditions of distribution and use, see the accompanying README file.
   18.10 + *
   18.11 + * This file contains the coefficient buffer controller for compression.
   18.12 + * This controller is the top level of the JPEG compressor proper.
   18.13 + * The coefficient buffer lies between forward-DCT and entropy encoding steps.
   18.14 + */
   18.15 +
   18.16 +#define JPEG_INTERNALS
   18.17 +#include "jinclude.h"
   18.18 +#include "jpeglib.h"
   18.19 +
   18.20 +
   18.21 +/* We use a full-image coefficient buffer when doing Huffman optimization,
   18.22 + * and also for writing multiple-scan JPEG files.  In all cases, the DCT
   18.23 + * step is run during the first pass, and subsequent passes need only read
   18.24 + * the buffered coefficients.
   18.25 + */
   18.26 +#ifdef ENTROPY_OPT_SUPPORTED
   18.27 +#define FULL_COEF_BUFFER_SUPPORTED
   18.28 +#else
   18.29 +#ifdef C_MULTISCAN_FILES_SUPPORTED
   18.30 +#define FULL_COEF_BUFFER_SUPPORTED
   18.31 +#endif
   18.32 +#endif
   18.33 +
   18.34 +
   18.35 +/* Private buffer controller object */
   18.36 +
   18.37 +typedef struct {
   18.38 +  struct jpeg_c_coef_controller pub; /* public fields */
   18.39 +
   18.40 +  JDIMENSION iMCU_row_num;	/* iMCU row # within image */
   18.41 +  JDIMENSION mcu_ctr;		/* counts MCUs processed in current row */
   18.42 +  int MCU_vert_offset;		/* counts MCU rows within iMCU row */
   18.43 +  int MCU_rows_per_iMCU_row;	/* number of such rows needed */
   18.44 +
   18.45 +  /* For single-pass compression, it's sufficient to buffer just one MCU
   18.46 +   * (although this may prove a bit slow in practice).  We allocate a
   18.47 +   * workspace of C_MAX_BLOCKS_IN_MCU coefficient blocks, and reuse it for each
   18.48 +   * MCU constructed and sent.  (On 80x86, the workspace is FAR even though
   18.49 +   * it's not really very big; this is to keep the module interfaces unchanged
   18.50 +   * when a large coefficient buffer is necessary.)
   18.51 +   * In multi-pass modes, this array points to the current MCU's blocks
   18.52 +   * within the virtual arrays.
   18.53 +   */
   18.54 +  JBLOCKROW MCU_buffer[C_MAX_BLOCKS_IN_MCU];
   18.55 +
   18.56 +  /* In multi-pass modes, we need a virtual block array for each component. */
   18.57 +  jvirt_barray_ptr whole_image[MAX_COMPONENTS];
   18.58 +} my_coef_controller;
   18.59 +
   18.60 +typedef my_coef_controller * my_coef_ptr;
   18.61 +
   18.62 +
   18.63 +/* Forward declarations */
   18.64 +METHODDEF(boolean) compress_data
   18.65 +    JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf));
   18.66 +#ifdef FULL_COEF_BUFFER_SUPPORTED
   18.67 +METHODDEF(boolean) compress_first_pass
   18.68 +    JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf));
   18.69 +METHODDEF(boolean) compress_output
   18.70 +    JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf));
   18.71 +#endif
   18.72 +
   18.73 +
   18.74 +LOCAL(void)
   18.75 +start_iMCU_row (j_compress_ptr cinfo)
   18.76 +/* Reset within-iMCU-row counters for a new row */
   18.77 +{
   18.78 +  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
   18.79 +
   18.80 +  /* In an interleaved scan, an MCU row is the same as an iMCU row.
   18.81 +   * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows.
   18.82 +   * But at the bottom of the image, process only what's left.
   18.83 +   */
   18.84 +  if (cinfo->comps_in_scan > 1) {
   18.85 +    coef->MCU_rows_per_iMCU_row = 1;
   18.86 +  } else {
   18.87 +    if (coef->iMCU_row_num < (cinfo->total_iMCU_rows-1))
   18.88 +      coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor;
   18.89 +    else
   18.90 +      coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height;
   18.91 +  }
   18.92 +
   18.93 +  coef->mcu_ctr = 0;
   18.94 +  coef->MCU_vert_offset = 0;
   18.95 +}
   18.96 +
   18.97 +
   18.98 +/*
   18.99 + * Initialize for a processing pass.
  18.100 + */
  18.101 +
  18.102 +METHODDEF(void)
  18.103 +start_pass_coef (j_compress_ptr cinfo, J_BUF_MODE pass_mode)
  18.104 +{
  18.105 +  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
  18.106 +
  18.107 +  coef->iMCU_row_num = 0;
  18.108 +  start_iMCU_row(cinfo);
  18.109 +
  18.110 +  switch (pass_mode) {
  18.111 +  case JBUF_PASS_THRU:
  18.112 +    if (coef->whole_image[0] != NULL)
  18.113 +      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
  18.114 +    coef->pub.compress_data = compress_data;
  18.115 +    break;
  18.116 +#ifdef FULL_COEF_BUFFER_SUPPORTED
  18.117 +  case JBUF_SAVE_AND_PASS:
  18.118 +    if (coef->whole_image[0] == NULL)
  18.119 +      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
  18.120 +    coef->pub.compress_data = compress_first_pass;
  18.121 +    break;
  18.122 +  case JBUF_CRANK_DEST:
  18.123 +    if (coef->whole_image[0] == NULL)
  18.124 +      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
  18.125 +    coef->pub.compress_data = compress_output;
  18.126 +    break;
  18.127 +#endif
  18.128 +  default:
  18.129 +    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
  18.130 +    break;
  18.131 +  }
  18.132 +}
  18.133 +
  18.134 +
  18.135 +/*
  18.136 + * Process some data in the single-pass case.
  18.137 + * We process the equivalent of one fully interleaved MCU row ("iMCU" row)
  18.138 + * per call, ie, v_samp_factor block rows for each component in the image.
  18.139 + * Returns TRUE if the iMCU row is completed, FALSE if suspended.
  18.140 + *
  18.141 + * NB: input_buf contains a plane for each component in image,
  18.142 + * which we index according to the component's SOF position.
  18.143 + */
  18.144 +
  18.145 +METHODDEF(boolean)
  18.146 +compress_data (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
  18.147 +{
  18.148 +  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
  18.149 +  JDIMENSION MCU_col_num;	/* index of current MCU within row */
  18.150 +  JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1;
  18.151 +  JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
  18.152 +  int blkn, bi, ci, yindex, yoffset, blockcnt;
  18.153 +  JDIMENSION ypos, xpos;
  18.154 +  jpeg_component_info *compptr;
  18.155 +
  18.156 +  /* Loop to write as much as one whole iMCU row */
  18.157 +  for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
  18.158 +       yoffset++) {
  18.159 +    for (MCU_col_num = coef->mcu_ctr; MCU_col_num <= last_MCU_col;
  18.160 +	 MCU_col_num++) {
  18.161 +      /* Determine where data comes from in input_buf and do the DCT thing.
  18.162 +       * Each call on forward_DCT processes a horizontal row of DCT blocks
  18.163 +       * as wide as an MCU; we rely on having allocated the MCU_buffer[] blocks
  18.164 +       * sequentially.  Dummy blocks at the right or bottom edge are filled in
  18.165 +       * specially.  The data in them does not matter for image reconstruction,
  18.166 +       * so we fill them with values that will encode to the smallest amount of
  18.167 +       * data, viz: all zeroes in the AC entries, DC entries equal to previous
  18.168 +       * block's DC value.  (Thanks to Thomas Kinsman for this idea.)
  18.169 +       */
  18.170 +      blkn = 0;
  18.171 +      for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
  18.172 +	compptr = cinfo->cur_comp_info[ci];
  18.173 +	blockcnt = (MCU_col_num < last_MCU_col) ? compptr->MCU_width
  18.174 +						: compptr->last_col_width;
  18.175 +	xpos = MCU_col_num * compptr->MCU_sample_width;
  18.176 +	ypos = yoffset * DCTSIZE; /* ypos == (yoffset+yindex) * DCTSIZE */
  18.177 +	for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
  18.178 +	  if (coef->iMCU_row_num < last_iMCU_row ||
  18.179 +	      yoffset+yindex < compptr->last_row_height) {
  18.180 +	    (*cinfo->fdct->forward_DCT) (cinfo, compptr,
  18.181 +					 input_buf[compptr->component_index],
  18.182 +					 coef->MCU_buffer[blkn],
  18.183 +					 ypos, xpos, (JDIMENSION) blockcnt);
  18.184 +	    if (blockcnt < compptr->MCU_width) {
  18.185 +	      /* Create some dummy blocks at the right edge of the image. */
  18.186 +	      jzero_far((void FAR *) coef->MCU_buffer[blkn + blockcnt],
  18.187 +			(compptr->MCU_width - blockcnt) * SIZEOF(JBLOCK));
  18.188 +	      for (bi = blockcnt; bi < compptr->MCU_width; bi++) {
  18.189 +		coef->MCU_buffer[blkn+bi][0][0] = coef->MCU_buffer[blkn+bi-1][0][0];
  18.190 +	      }
  18.191 +	    }
  18.192 +	  } else {
  18.193 +	    /* Create a row of dummy blocks at the bottom of the image. */
  18.194 +	    jzero_far((void FAR *) coef->MCU_buffer[blkn],
  18.195 +		      compptr->MCU_width * SIZEOF(JBLOCK));
  18.196 +	    for (bi = 0; bi < compptr->MCU_width; bi++) {
  18.197 +	      coef->MCU_buffer[blkn+bi][0][0] = coef->MCU_buffer[blkn-1][0][0];
  18.198 +	    }
  18.199 +	  }
  18.200 +	  blkn += compptr->MCU_width;
  18.201 +	  ypos += DCTSIZE;
  18.202 +	}
  18.203 +      }
  18.204 +      /* Try to write the MCU.  In event of a suspension failure, we will
  18.205 +       * re-DCT the MCU on restart (a bit inefficient, could be fixed...)
  18.206 +       */
  18.207 +      if (! (*cinfo->entropy->encode_mcu) (cinfo, coef->MCU_buffer)) {
  18.208 +	/* Suspension forced; update state counters and exit */
  18.209 +	coef->MCU_vert_offset = yoffset;
  18.210 +	coef->mcu_ctr = MCU_col_num;
  18.211 +	return FALSE;
  18.212 +      }
  18.213 +    }
  18.214 +    /* Completed an MCU row, but perhaps not an iMCU row */
  18.215 +    coef->mcu_ctr = 0;
  18.216 +  }
  18.217 +  /* Completed the iMCU row, advance counters for next one */
  18.218 +  coef->iMCU_row_num++;
  18.219 +  start_iMCU_row(cinfo);
  18.220 +  return TRUE;
  18.221 +}
  18.222 +
  18.223 +
  18.224 +#ifdef FULL_COEF_BUFFER_SUPPORTED
  18.225 +
  18.226 +/*
  18.227 + * Process some data in the first pass of a multi-pass case.
  18.228 + * We process the equivalent of one fully interleaved MCU row ("iMCU" row)
  18.229 + * per call, ie, v_samp_factor block rows for each component in the image.
  18.230 + * This amount of data is read from the source buffer, DCT'd and quantized,
  18.231 + * and saved into the virtual arrays.  We also generate suitable dummy blocks
  18.232 + * as needed at the right and lower edges.  (The dummy blocks are constructed
  18.233 + * in the virtual arrays, which have been padded appropriately.)  This makes
  18.234 + * it possible for subsequent passes not to worry about real vs. dummy blocks.
  18.235 + *
  18.236 + * We must also emit the data to the entropy encoder.  This is conveniently
  18.237 + * done by calling compress_output() after we've loaded the current strip
  18.238 + * of the virtual arrays.
  18.239 + *
  18.240 + * NB: input_buf contains a plane for each component in image.  All
  18.241 + * components are DCT'd and loaded into the virtual arrays in this pass.
  18.242 + * However, it may be that only a subset of the components are emitted to
  18.243 + * the entropy encoder during this first pass; be careful about looking
  18.244 + * at the scan-dependent variables (MCU dimensions, etc).
  18.245 + */
  18.246 +
  18.247 +METHODDEF(boolean)
  18.248 +compress_first_pass (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
  18.249 +{
  18.250 +  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
  18.251 +  JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
  18.252 +  JDIMENSION blocks_across, MCUs_across, MCUindex;
  18.253 +  int bi, ci, h_samp_factor, block_row, block_rows, ndummy;
  18.254 +  JCOEF lastDC;
  18.255 +  jpeg_component_info *compptr;
  18.256 +  JBLOCKARRAY buffer;
  18.257 +  JBLOCKROW thisblockrow, lastblockrow;
  18.258 +
  18.259 +  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  18.260 +       ci++, compptr++) {
  18.261 +    /* Align the virtual buffer for this component. */
  18.262 +    buffer = (*cinfo->mem->access_virt_barray)
  18.263 +      ((j_common_ptr) cinfo, coef->whole_image[ci],
  18.264 +       coef->iMCU_row_num * compptr->v_samp_factor,
  18.265 +       (JDIMENSION) compptr->v_samp_factor, TRUE);
  18.266 +    /* Count non-dummy DCT block rows in this iMCU row. */
  18.267 +    if (coef->iMCU_row_num < last_iMCU_row)
  18.268 +      block_rows = compptr->v_samp_factor;
  18.269 +    else {
  18.270 +      /* NB: can't use last_row_height here, since may not be set! */
  18.271 +      block_rows = (int) (compptr->height_in_blocks % compptr->v_samp_factor);
  18.272 +      if (block_rows == 0) block_rows = compptr->v_samp_factor;
  18.273 +    }
  18.274 +    blocks_across = compptr->width_in_blocks;
  18.275 +    h_samp_factor = compptr->h_samp_factor;
  18.276 +    /* Count number of dummy blocks to be added at the right margin. */
  18.277 +    ndummy = (int) (blocks_across % h_samp_factor);
  18.278 +    if (ndummy > 0)
  18.279 +      ndummy = h_samp_factor - ndummy;
  18.280 +    /* Perform DCT for all non-dummy blocks in this iMCU row.  Each call
  18.281 +     * on forward_DCT processes a complete horizontal row of DCT blocks.
  18.282 +     */
  18.283 +    for (block_row = 0; block_row < block_rows; block_row++) {
  18.284 +      thisblockrow = buffer[block_row];
  18.285 +      (*cinfo->fdct->forward_DCT) (cinfo, compptr,
  18.286 +				   input_buf[ci], thisblockrow,
  18.287 +				   (JDIMENSION) (block_row * DCTSIZE),
  18.288 +				   (JDIMENSION) 0, blocks_across);
  18.289 +      if (ndummy > 0) {
  18.290 +	/* Create dummy blocks at the right edge of the image. */
  18.291 +	thisblockrow += blocks_across; /* => first dummy block */
  18.292 +	jzero_far((void FAR *) thisblockrow, ndummy * SIZEOF(JBLOCK));
  18.293 +	lastDC = thisblockrow[-1][0];
  18.294 +	for (bi = 0; bi < ndummy; bi++) {
  18.295 +	  thisblockrow[bi][0] = lastDC;
  18.296 +	}
  18.297 +      }
  18.298 +    }
  18.299 +    /* If at end of image, create dummy block rows as needed.
  18.300 +     * The tricky part here is that within each MCU, we want the DC values
  18.301 +     * of the dummy blocks to match the last real block's DC value.
  18.302 +     * This squeezes a few more bytes out of the resulting file...
  18.303 +     */
  18.304 +    if (coef->iMCU_row_num == last_iMCU_row) {
  18.305 +      blocks_across += ndummy;	/* include lower right corner */
  18.306 +      MCUs_across = blocks_across / h_samp_factor;
  18.307 +      for (block_row = block_rows; block_row < compptr->v_samp_factor;
  18.308 +	   block_row++) {
  18.309 +	thisblockrow = buffer[block_row];
  18.310 +	lastblockrow = buffer[block_row-1];
  18.311 +	jzero_far((void FAR *) thisblockrow,
  18.312 +		  (size_t) (blocks_across * SIZEOF(JBLOCK)));
  18.313 +	for (MCUindex = 0; MCUindex < MCUs_across; MCUindex++) {
  18.314 +	  lastDC = lastblockrow[h_samp_factor-1][0];
  18.315 +	  for (bi = 0; bi < h_samp_factor; bi++) {
  18.316 +	    thisblockrow[bi][0] = lastDC;
  18.317 +	  }
  18.318 +	  thisblockrow += h_samp_factor; /* advance to next MCU in row */
  18.319 +	  lastblockrow += h_samp_factor;
  18.320 +	}
  18.321 +      }
  18.322 +    }
  18.323 +  }
  18.324 +  /* NB: compress_output will increment iMCU_row_num if successful.
  18.325 +   * A suspension return will result in redoing all the work above next time.
  18.326 +   */
  18.327 +
  18.328 +  /* Emit data to the entropy encoder, sharing code with subsequent passes */
  18.329 +  return compress_output(cinfo, input_buf);
  18.330 +}
  18.331 +
  18.332 +
  18.333 +/*
  18.334 + * Process some data in subsequent passes of a multi-pass case.
  18.335 + * We process the equivalent of one fully interleaved MCU row ("iMCU" row)
  18.336 + * per call, ie, v_samp_factor block rows for each component in the scan.
  18.337 + * The data is obtained from the virtual arrays and fed to the entropy coder.
  18.338 + * Returns TRUE if the iMCU row is completed, FALSE if suspended.
  18.339 + *
  18.340 + * NB: input_buf is ignored; it is likely to be a NULL pointer.
  18.341 + */
  18.342 +
  18.343 +METHODDEF(boolean)
  18.344 +compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
  18.345 +{
  18.346 +  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
  18.347 +  JDIMENSION MCU_col_num;	/* index of current MCU within row */
  18.348 +  int blkn, ci, xindex, yindex, yoffset;
  18.349 +  JDIMENSION start_col;
  18.350 +  JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN];
  18.351 +  JBLOCKROW buffer_ptr;
  18.352 +  jpeg_component_info *compptr;
  18.353 +
  18.354 +  /* Align the virtual buffers for the components used in this scan.
  18.355 +   * NB: during first pass, this is safe only because the buffers will
  18.356 +   * already be aligned properly, so jmemmgr.c won't need to do any I/O.
  18.357 +   */
  18.358 +  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
  18.359 +    compptr = cinfo->cur_comp_info[ci];
  18.360 +    buffer[ci] = (*cinfo->mem->access_virt_barray)
  18.361 +      ((j_common_ptr) cinfo, coef->whole_image[compptr->component_index],
  18.362 +       coef->iMCU_row_num * compptr->v_samp_factor,
  18.363 +       (JDIMENSION) compptr->v_samp_factor, FALSE);
  18.364 +  }
  18.365 +
  18.366 +  /* Loop to process one whole iMCU row */
  18.367 +  for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
  18.368 +       yoffset++) {
  18.369 +    for (MCU_col_num = coef->mcu_ctr; MCU_col_num < cinfo->MCUs_per_row;
  18.370 +	 MCU_col_num++) {
  18.371 +      /* Construct list of pointers to DCT blocks belonging to this MCU */
  18.372 +      blkn = 0;			/* index of current DCT block within MCU */
  18.373 +      for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
  18.374 +	compptr = cinfo->cur_comp_info[ci];
  18.375 +	start_col = MCU_col_num * compptr->MCU_width;
  18.376 +	for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
  18.377 +	  buffer_ptr = buffer[ci][yindex+yoffset] + start_col;
  18.378 +	  for (xindex = 0; xindex < compptr->MCU_width; xindex++) {
  18.379 +	    coef->MCU_buffer[blkn++] = buffer_ptr++;
  18.380 +	  }
  18.381 +	}
  18.382 +      }
  18.383 +      /* Try to write the MCU. */
  18.384 +      if (! (*cinfo->entropy->encode_mcu) (cinfo, coef->MCU_buffer)) {
  18.385 +	/* Suspension forced; update state counters and exit */
  18.386 +	coef->MCU_vert_offset = yoffset;
  18.387 +	coef->mcu_ctr = MCU_col_num;
  18.388 +	return FALSE;
  18.389 +      }
  18.390 +    }
  18.391 +    /* Completed an MCU row, but perhaps not an iMCU row */
  18.392 +    coef->mcu_ctr = 0;
  18.393 +  }
  18.394 +  /* Completed the iMCU row, advance counters for next one */
  18.395 +  coef->iMCU_row_num++;
  18.396 +  start_iMCU_row(cinfo);
  18.397 +  return TRUE;
  18.398 +}
  18.399 +
  18.400 +#endif /* FULL_COEF_BUFFER_SUPPORTED */
  18.401 +
  18.402 +
  18.403 +/*
  18.404 + * Initialize coefficient buffer controller.
  18.405 + */
  18.406 +
  18.407 +GLOBAL(void)
  18.408 +jinit_c_coef_controller (j_compress_ptr cinfo, boolean need_full_buffer)
  18.409 +{
  18.410 +  my_coef_ptr coef;
  18.411 +
  18.412 +  coef = (my_coef_ptr)
  18.413 +    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
  18.414 +				SIZEOF(my_coef_controller));
  18.415 +  cinfo->coef = (struct jpeg_c_coef_controller *) coef;
  18.416 +  coef->pub.start_pass = start_pass_coef;
  18.417 +
  18.418 +  /* Create the coefficient buffer. */
  18.419 +  if (need_full_buffer) {
  18.420 +#ifdef FULL_COEF_BUFFER_SUPPORTED
  18.421 +    /* Allocate a full-image virtual array for each component, */
  18.422 +    /* padded to a multiple of samp_factor DCT blocks in each direction. */
  18.423 +    int ci;
  18.424 +    jpeg_component_info *compptr;
  18.425 +
  18.426 +    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  18.427 +	 ci++, compptr++) {
  18.428 +      coef->whole_image[ci] = (*cinfo->mem->request_virt_barray)
  18.429 +	((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,
  18.430 +	 (JDIMENSION) jround_up((long) compptr->width_in_blocks,
  18.431 +				(long) compptr->h_samp_factor),
  18.432 +	 (JDIMENSION) jround_up((long) compptr->height_in_blocks,
  18.433 +				(long) compptr->v_samp_factor),
  18.434 +	 (JDIMENSION) compptr->v_samp_factor);
  18.435 +    }
  18.436 +#else
  18.437 +    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
  18.438 +#endif
  18.439 +  } else {
  18.440 +    /* We only need a single-MCU buffer. */
  18.441 +    JBLOCKROW buffer;
  18.442 +    int i;
  18.443 +
  18.444 +    buffer = (JBLOCKROW)
  18.445 +      (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,
  18.446 +				  C_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK));
  18.447 +    for (i = 0; i < C_MAX_BLOCKS_IN_MCU; i++) {
  18.448 +      coef->MCU_buffer[i] = buffer + i;
  18.449 +    }
  18.450 +    coef->whole_image[0] = NULL; /* flag for no virtual arrays */
  18.451 +  }
  18.452 +}
    19.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.2 +++ b/libs/libjpeg/jccolor.c	Sun Nov 01 00:36:56 2015 +0200
    19.3 @@ -0,0 +1,459 @@
    19.4 +/*
    19.5 + * jccolor.c
    19.6 + *
    19.7 + * Copyright (C) 1991-1996, Thomas G. Lane.
    19.8 + * This file is part of the Independent JPEG Group's software.
    19.9 + * For conditions of distribution and use, see the accompanying README file.
   19.10 + *
   19.11 + * This file contains input colorspace conversion routines.
   19.12 + */
   19.13 +
   19.14 +#define JPEG_INTERNALS
   19.15 +#include "jinclude.h"
   19.16 +#include "jpeglib.h"
   19.17 +
   19.18 +
   19.19 +/* Private subobject */
   19.20 +
   19.21 +typedef struct {
   19.22 +  struct jpeg_color_converter pub; /* public fields */
   19.23 +
   19.24 +  /* Private state for RGB->YCC conversion */
   19.25 +  INT32 * rgb_ycc_tab;		/* => table for RGB to YCbCr conversion */
   19.26 +} my_color_converter;
   19.27 +
   19.28 +typedef my_color_converter * my_cconvert_ptr;
   19.29 +
   19.30 +
   19.31 +/**************** RGB -> YCbCr conversion: most common case **************/
   19.32 +
   19.33 +/*
   19.34 + * YCbCr is defined per CCIR 601-1, except that Cb and Cr are
   19.35 + * normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5.
   19.36 + * The conversion equations to be implemented are therefore
   19.37 + *	Y  =  0.29900 * R + 0.58700 * G + 0.11400 * B
   19.38 + *	Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B  + CENTERJSAMPLE
   19.39 + *	Cr =  0.50000 * R - 0.41869 * G - 0.08131 * B  + CENTERJSAMPLE
   19.40 + * (These numbers are derived from TIFF 6.0 section 21, dated 3-June-92.)
   19.41 + * Note: older versions of the IJG code used a zero offset of MAXJSAMPLE/2,
   19.42 + * rather than CENTERJSAMPLE, for Cb and Cr.  This gave equal positive and
   19.43 + * negative swings for Cb/Cr, but meant that grayscale values (Cb=Cr=0)
   19.44 + * were not represented exactly.  Now we sacrifice exact representation of
   19.45 + * maximum red and maximum blue in order to get exact grayscales.
   19.46 + *
   19.47 + * To avoid floating-point arithmetic, we represent the fractional constants
   19.48 + * as integers scaled up by 2^16 (about 4 digits precision); we have to divide
   19.49 + * the products by 2^16, with appropriate rounding, to get the correct answer.
   19.50 + *
   19.51 + * For even more speed, we avoid doing any multiplications in the inner loop
   19.52 + * by precalculating the constants times R,G,B for all possible values.
   19.53 + * For 8-bit JSAMPLEs this is very reasonable (only 256 entries per table);
   19.54 + * for 12-bit samples it is still acceptable.  It's not very reasonable for
   19.55 + * 16-bit samples, but if you want lossless storage you shouldn't be changing
   19.56 + * colorspace anyway.
   19.57 + * The CENTERJSAMPLE offsets and the rounding fudge-factor of 0.5 are included
   19.58 + * in the tables to save adding them separately in the inner loop.
   19.59 + */
   19.60 +
   19.61 +#define SCALEBITS	16	/* speediest right-shift on some machines */
   19.62 +#define CBCR_OFFSET	((INT32) CENTERJSAMPLE << SCALEBITS)
   19.63 +#define ONE_HALF	((INT32) 1 << (SCALEBITS-1))
   19.64 +#define FIX(x)		((INT32) ((x) * (1L<<SCALEBITS) + 0.5))
   19.65 +
   19.66 +/* We allocate one big table and divide it up into eight parts, instead of
   19.67 + * doing eight alloc_small requests.  This lets us use a single table base
   19.68 + * address, which can be held in a register in the inner loops on many
   19.69 + * machines (more than can hold all eight addresses, anyway).
   19.70 + */
   19.71 +
   19.72 +#define R_Y_OFF		0			/* offset to R => Y section */
   19.73 +#define G_Y_OFF		(1*(MAXJSAMPLE+1))	/* offset to G => Y section */
   19.74 +#define B_Y_OFF		(2*(MAXJSAMPLE+1))	/* etc. */
   19.75 +#define R_CB_OFF	(3*(MAXJSAMPLE+1))
   19.76 +#define G_CB_OFF	(4*(MAXJSAMPLE+1))
   19.77 +#define B_CB_OFF	(5*(MAXJSAMPLE+1))
   19.78 +#define R_CR_OFF	B_CB_OFF		/* B=>Cb, R=>Cr are the same */
   19.79 +#define G_CR_OFF	(6*(MAXJSAMPLE+1))
   19.80 +#define B_CR_OFF	(7*(MAXJSAMPLE+1))
   19.81 +#define TABLE_SIZE	(8*(MAXJSAMPLE+1))
   19.82 +
   19.83 +
   19.84 +/*
   19.85 + * Initialize for RGB->YCC colorspace conversion.
   19.86 + */
   19.87 +
   19.88 +METHODDEF(void)
   19.89 +rgb_ycc_start (j_compress_ptr cinfo)
   19.90 +{
   19.91 +  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
   19.92 +  INT32 * rgb_ycc_tab;
   19.93 +  INT32 i;
   19.94 +
   19.95 +  /* Allocate and fill in the conversion tables. */
   19.96 +  cconvert->rgb_ycc_tab = rgb_ycc_tab = (INT32 *)
   19.97 +    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
   19.98 +				(TABLE_SIZE * SIZEOF(INT32)));
   19.99 +
  19.100 +  for (i = 0; i <= MAXJSAMPLE; i++) {
  19.101 +    rgb_ycc_tab[i+R_Y_OFF] = FIX(0.29900) * i;
  19.102 +    rgb_ycc_tab[i+G_Y_OFF] = FIX(0.58700) * i;
  19.103 +    rgb_ycc_tab[i+B_Y_OFF] = FIX(0.11400) * i     + ONE_HALF;
  19.104 +    rgb_ycc_tab[i+R_CB_OFF] = (-FIX(0.16874)) * i;
  19.105 +    rgb_ycc_tab[i+G_CB_OFF] = (-FIX(0.33126)) * i;
  19.106 +    /* We use a rounding fudge-factor of 0.5-epsilon for Cb and Cr.
  19.107 +     * This ensures that the maximum output will round to MAXJSAMPLE
  19.108 +     * not MAXJSAMPLE+1, and thus that we don't have to range-limit.
  19.109 +     */
  19.110 +    rgb_ycc_tab[i+B_CB_OFF] = FIX(0.50000) * i    + CBCR_OFFSET + ONE_HALF-1;
  19.111 +/*  B=>Cb and R=>Cr tables are the same
  19.112 +    rgb_ycc_tab[i+R_CR_OFF] = FIX(0.50000) * i    + CBCR_OFFSET + ONE_HALF-1;
  19.113 +*/
  19.114 +    rgb_ycc_tab[i+G_CR_OFF] = (-FIX(0.41869)) * i;
  19.115 +    rgb_ycc_tab[i+B_CR_OFF] = (-FIX(0.08131)) * i;
  19.116 +  }
  19.117 +}
  19.118 +
  19.119 +
  19.120 +/*
  19.121 + * Convert some rows of samples to the JPEG colorspace.
  19.122 + *
  19.123 + * Note that we change from the application's interleaved-pixel format
  19.124 + * to our internal noninterleaved, one-plane-per-component format.
  19.125 + * The input buffer is therefore three times as wide as the output buffer.
  19.126 + *
  19.127 + * A starting row offset is provided only for the output buffer.  The caller
  19.128 + * can easily adjust the passed input_buf value to accommodate any row
  19.129 + * offset required on that side.
  19.130 + */
  19.131 +
  19.132 +METHODDEF(void)
  19.133 +rgb_ycc_convert (j_compress_ptr cinfo,
  19.134 +		 JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
  19.135 +		 JDIMENSION output_row, int num_rows)
  19.136 +{
  19.137 +  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
  19.138 +  register int r, g, b;
  19.139 +  register INT32 * ctab = cconvert->rgb_ycc_tab;
  19.140 +  register JSAMPROW inptr;
  19.141 +  register JSAMPROW outptr0, outptr1, outptr2;
  19.142 +  register JDIMENSION col;
  19.143 +  JDIMENSION num_cols = cinfo->image_width;
  19.144 +
  19.145 +  while (--num_rows >= 0) {
  19.146 +    inptr = *input_buf++;
  19.147 +    outptr0 = output_buf[0][output_row];
  19.148 +    outptr1 = output_buf[1][output_row];
  19.149 +    outptr2 = output_buf[2][output_row];
  19.150 +    output_row++;
  19.151 +    for (col = 0; col < num_cols; col++) {
  19.152 +      r = GETJSAMPLE(inptr[RGB_RED]);
  19.153 +      g = GETJSAMPLE(inptr[RGB_GREEN]);
  19.154 +      b = GETJSAMPLE(inptr[RGB_BLUE]);
  19.155 +      inptr += RGB_PIXELSIZE;
  19.156 +      /* If the inputs are 0..MAXJSAMPLE, the outputs of these equations
  19.157 +       * must be too; we do not need an explicit range-limiting operation.
  19.158 +       * Hence the value being shifted is never negative, and we don't
  19.159 +       * need the general RIGHT_SHIFT macro.
  19.160 +       */
  19.161 +      /* Y */
  19.162 +      outptr0[col] = (JSAMPLE)
  19.163 +		((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
  19.164 +		 >> SCALEBITS);
  19.165 +      /* Cb */
  19.166 +      outptr1[col] = (JSAMPLE)
  19.167 +		((ctab[r+R_CB_OFF] + ctab[g+G_CB_OFF] + ctab[b+B_CB_OFF])
  19.168 +		 >> SCALEBITS);
  19.169 +      /* Cr */
  19.170 +      outptr2[col] = (JSAMPLE)
  19.171 +		((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF])
  19.172 +		 >> SCALEBITS);
  19.173 +    }
  19.174 +  }
  19.175 +}
  19.176 +
  19.177 +
  19.178 +/**************** Cases other than RGB -> YCbCr **************/
  19.179 +
  19.180 +
  19.181 +/*
  19.182 + * Convert some rows of samples to the JPEG colorspace.
  19.183 + * This version handles RGB->grayscale conversion, which is the same
  19.184 + * as the RGB->Y portion of RGB->YCbCr.
  19.185 + * We assume rgb_ycc_start has been called (we only use the Y tables).
  19.186 + */
  19.187 +
  19.188 +METHODDEF(void)
  19.189 +rgb_gray_convert (j_compress_ptr cinfo,
  19.190 +		  JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
  19.191 +		  JDIMENSION output_row, int num_rows)
  19.192 +{
  19.193 +  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
  19.194 +  register int r, g, b;
  19.195 +  register INT32 * ctab = cconvert->rgb_ycc_tab;
  19.196 +  register JSAMPROW inptr;
  19.197 +  register JSAMPROW outptr;
  19.198 +  register JDIMENSION col;
  19.199 +  JDIMENSION num_cols = cinfo->image_width;
  19.200 +
  19.201 +  while (--num_rows >= 0) {
  19.202 +    inptr = *input_buf++;
  19.203 +    outptr = output_buf[0][output_row];
  19.204 +    output_row++;
  19.205 +    for (col = 0; col < num_cols; col++) {
  19.206 +      r = GETJSAMPLE(inptr[RGB_RED]);
  19.207 +      g = GETJSAMPLE(inptr[RGB_GREEN]);
  19.208 +      b = GETJSAMPLE(inptr[RGB_BLUE]);
  19.209 +      inptr += RGB_PIXELSIZE;
  19.210 +      /* Y */
  19.211 +      outptr[col] = (JSAMPLE)
  19.212 +		((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
  19.213 +		 >> SCALEBITS);
  19.214 +    }
  19.215 +  }
  19.216 +}
  19.217 +
  19.218 +
  19.219 +/*
  19.220 + * Convert some rows of samples to the JPEG colorspace.
  19.221 + * This version handles Adobe-style CMYK->YCCK conversion,
  19.222 + * where we convert R=1-C, G=1-M, and B=1-Y to YCbCr using the same
  19.223 + * conversion as above, while passing K (black) unchanged.
  19.224 + * We assume rgb_ycc_start has been called.
  19.225 + */
  19.226 +
  19.227 +METHODDEF(void)
  19.228 +cmyk_ycck_convert (j_compress_ptr cinfo,
  19.229 +		   JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
  19.230 +		   JDIMENSION output_row, int num_rows)
  19.231 +{
  19.232 +  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
  19.233 +  register int r, g, b;
  19.234 +  register INT32 * ctab = cconvert->rgb_ycc_tab;
  19.235 +  register JSAMPROW inptr;
  19.236 +  register JSAMPROW outptr0, outptr1, outptr2, outptr3;
  19.237 +  register JDIMENSION col;
  19.238 +  JDIMENSION num_cols = cinfo->image_width;
  19.239 +
  19.240 +  while (--num_rows >= 0) {
  19.241 +    inptr = *input_buf++;
  19.242 +    outptr0 = output_buf[0][output_row];
  19.243 +    outptr1 = output_buf[1][output_row];
  19.244 +    outptr2 = output_buf[2][output_row];
  19.245 +    outptr3 = output_buf[3][output_row];
  19.246 +    output_row++;
  19.247 +    for (col = 0; col < num_cols; col++) {
  19.248 +      r = MAXJSAMPLE - GETJSAMPLE(inptr[0]);
  19.249 +      g = MAXJSAMPLE - GETJSAMPLE(inptr[1]);
  19.250 +      b = MAXJSAMPLE - GETJSAMPLE(inptr[2]);
  19.251 +      /* K passes through as-is */
  19.252 +      outptr3[col] = inptr[3];	/* don't need GETJSAMPLE here */
  19.253 +      inptr += 4;
  19.254 +      /* If the inputs are 0..MAXJSAMPLE, the outputs of these equations
  19.255 +       * must be too; we do not need an explicit range-limiting operation.
  19.256 +       * Hence the value being shifted is never negative, and we don't
  19.257 +       * need the general RIGHT_SHIFT macro.
  19.258 +       */
  19.259 +      /* Y */
  19.260 +      outptr0[col] = (JSAMPLE)
  19.261 +		((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
  19.262 +		 >> SCALEBITS);
  19.263 +      /* Cb */
  19.264 +      outptr1[col] = (JSAMPLE)
  19.265 +		((ctab[r+R_CB_OFF] + ctab[g+G_CB_OFF] + ctab[b+B_CB_OFF])
  19.266 +		 >> SCALEBITS);
  19.267 +      /* Cr */
  19.268 +      outptr2[col] = (JSAMPLE)
  19.269 +		((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF])
  19.270 +		 >> SCALEBITS);
  19.271 +    }
  19.272 +  }
  19.273 +}
  19.274 +
  19.275 +
  19.276 +/*
  19.277 + * Convert some rows of samples to the JPEG colorspace.
  19.278 + * This version handles grayscale output with no conversion.
  19.279 + * The source can be either plain grayscale or YCbCr (since Y == gray).
  19.280 + */
  19.281 +
  19.282 +METHODDEF(void)
  19.283 +grayscale_convert (j_compress_ptr cinfo,
  19.284 +		   JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
  19.285 +		   JDIMENSION output_row, int num_rows)
  19.286 +{
  19.287 +  register JSAMPROW inptr;
  19.288 +  register JSAMPROW outptr;
  19.289 +  register JDIMENSION col;
  19.290 +  JDIMENSION num_cols = cinfo->image_width;
  19.291 +  int instride = cinfo->input_components;
  19.292 +
  19.293 +  while (--num_rows >= 0) {
  19.294 +    inptr = *input_buf++;
  19.295 +    outptr = output_buf[0][output_row];
  19.296 +    output_row++;
  19.297 +    for (col = 0; col < num_cols; col++) {
  19.298 +      outptr[col] = inptr[0];	/* don't need GETJSAMPLE() here */
  19.299 +      inptr += instride;
  19.300 +    }
  19.301 +  }
  19.302 +}
  19.303 +
  19.304 +
  19.305 +/*
  19.306 + * Convert some rows of samples to the JPEG colorspace.
  19.307 + * This version handles multi-component colorspaces without conversion.
  19.308 + * We assume input_components == num_components.
  19.309 + */
  19.310 +
  19.311 +METHODDEF(void)
  19.312 +null_convert (j_compress_ptr cinfo,
  19.313 +	      JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
  19.314 +	      JDIMENSION output_row, int num_rows)
  19.315 +{
  19.316 +  register JSAMPROW inptr;
  19.317 +  register JSAMPROW outptr;
  19.318 +  register JDIMENSION col;
  19.319 +  register int ci;
  19.320 +  int nc = cinfo->num_components;
  19.321 +  JDIMENSION num_cols = cinfo->image_width;
  19.322 +
  19.323 +  while (--num_rows >= 0) {
  19.324 +    /* It seems fastest to make a separate pass for each component. */
  19.325 +    for (ci = 0; ci < nc; ci++) {
  19.326 +      inptr = *input_buf;
  19.327 +      outptr = output_buf[ci][output_row];
  19.328 +      for (col = 0; col < num_cols; col++) {
  19.329 +	outptr[col] = inptr[ci]; /* don't need GETJSAMPLE() here */
  19.330 +	inptr += nc;
  19.331 +      }
  19.332 +    }
  19.333 +    input_buf++;
  19.334 +    output_row++;
  19.335 +  }
  19.336 +}
  19.337 +
  19.338 +
  19.339 +/*
  19.340 + * Empty method for start_pass.
  19.341 + */
  19.342 +
  19.343 +METHODDEF(void)
  19.344 +null_method (j_compress_ptr cinfo)
  19.345 +{
  19.346 +  /* no work needed */
  19.347 +}
  19.348 +
  19.349 +
  19.350 +/*
  19.351 + * Module initialization routine for input colorspace conversion.
  19.352 + */
  19.353 +
  19.354 +GLOBAL(void)
  19.355 +jinit_color_converter (j_compress_ptr cinfo)
  19.356 +{
  19.357 +  my_cconvert_ptr cconvert;
  19.358 +
  19.359 +  cconvert = (my_cconvert_ptr)
  19.360 +    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
  19.361 +				SIZEOF(my_color_converter));
  19.362 +  cinfo->cconvert = (struct jpeg_color_converter *) cconvert;
  19.363 +  /* set start_pass to null method until we find out differently */
  19.364 +  cconvert->pub.start_pass = null_method;
  19.365 +
  19.366 +  /* Make sure input_components agrees with in_color_space */
  19.367 +  switch (cinfo->in_color_space) {
  19.368 +  case JCS_GRAYSCALE:
  19.369 +    if (cinfo->input_components != 1)
  19.370 +      ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
  19.371 +    break;
  19.372 +
  19.373 +  case JCS_RGB:
  19.374 +#if RGB_PIXELSIZE != 3
  19.375 +    if (cinfo->input_components != RGB_PIXELSIZE)
  19.376 +      ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
  19.377 +    break;
  19.378 +#endif /* else share code with YCbCr */
  19.379 +
  19.380 +  case JCS_YCbCr:
  19.381 +    if (cinfo->input_components != 3)
  19.382 +      ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
  19.383 +    break;
  19.384 +
  19.385 +  case JCS_CMYK:
  19.386 +  case JCS_YCCK:
  19.387 +    if (cinfo->input_components != 4)
  19.388 +      ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
  19.389 +    break;
  19.390 +
  19.391 +  default:			/* JCS_UNKNOWN can be anything */
  19.392 +    if (cinfo->input_components < 1)
  19.393 +      ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
  19.394 +    break;
  19.395 +  }
  19.396 +
  19.397 +  /* Check num_components, set conversion method based on requested space */
  19.398 +  switch (cinfo->jpeg_color_space) {
  19.399 +  case JCS_GRAYSCALE:
  19.400 +    if (cinfo->num_components != 1)
  19.401 +      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
  19.402 +    if (cinfo->in_color_space == JCS_GRAYSCALE)
  19.403 +      cconvert->pub.color_convert = grayscale_convert;
  19.404 +    else if (cinfo->in_color_space == JCS_RGB) {
  19.405 +      cconvert->pub.start_pass = rgb_ycc_start;
  19.406 +      cconvert->pub.color_convert = rgb_gray_convert;
  19.407 +    } else if (cinfo->in_color_space == JCS_YCbCr)
  19.408 +      cconvert->pub.color_convert = grayscale_convert;
  19.409 +    else
  19.410 +      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
  19.411 +    break;
  19.412 +
  19.413 +  case JCS_RGB:
  19.414 +    if (cinfo->num_components != 3)
  19.415 +      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
  19.416 +    if (cinfo->in_color_space == JCS_RGB && RGB_PIXELSIZE == 3)
  19.417 +      cconvert->pub.color_convert = null_convert;
  19.418 +    else
  19.419 +      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
  19.420 +    break;
  19.421 +
  19.422 +  case JCS_YCbCr:
  19.423 +    if (cinfo->num_components != 3)
  19.424 +      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
  19.425 +    if (cinfo->in_color_space == JCS_RGB) {
  19.426 +      cconvert->pub.start_pass = rgb_ycc_start;
  19.427 +      cconvert->pub.color_convert = rgb_ycc_convert;
  19.428 +    } else if (cinfo->in_color_space == JCS_YCbCr)
  19.429 +      cconvert->pub.color_convert = null_convert;
  19.430 +    else
  19.431 +      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
  19.432 +    break;
  19.433 +
  19.434 +  case JCS_CMYK:
  19.435 +    if (cinfo->num_components != 4)
  19.436 +      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
  19.437 +    if (cinfo->in_color_space == JCS_CMYK)
  19.438 +      cconvert->pub.color_convert = null_convert;
  19.439 +    else
  19.440 +      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
  19.441 +    break;
  19.442 +
  19.443 +  case JCS_YCCK:
  19.444 +    if (cinfo->num_components != 4)
  19.445 +      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
  19.446 +    if (cinfo->in_color_space == JCS_CMYK) {
  19.447 +      cconvert->pub.start_pass = rgb_ycc_start;
  19.448 +      cconvert->pub.color_convert = cmyk_ycck_convert;
  19.449 +    } else if (cinfo->in_color_space == JCS_YCCK)
  19.450 +      cconvert->pub.color_convert = null_convert;
  19.451 +    else
  19.452 +      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
  19.453 +    break;
  19.454 +
  19.455 +  default:			/* allow null conversion of JCS_UNKNOWN */
  19.456 +    if (cinfo->jpeg_color_space != cinfo->in_color_space ||
  19.457 +	cinfo->num_components != cinfo->input_components)
  19.458 +      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
  19.459 +    cconvert->pub.color_convert = null_convert;
  19.460 +    break;
  19.461 +  }
  19.462 +}
    20.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.2 +++ b/libs/libjpeg/jcdctmgr.c	Sun Nov 01 00:36:56 2015 +0200
    20.3 @@ -0,0 +1,387 @@
    20.4 +/*
    20.5 + * jcdctmgr.c
    20.6 + *
    20.7 + * Copyright (C) 1994-1996, Thomas G. Lane.
    20.8 + * This file is part of the Independent JPEG Group's software.
    20.9 + * For conditions of distribution and use, see the accompanying README file.
   20.10 + *
   20.11 + * This file contains the forward-DCT management logic.
   20.12 + * This code selects a particular DCT implementation to be used,
   20.13 + * and it performs related housekeeping chores including coefficient
   20.14 + * quantization.
   20.15 + */
   20.16 +
   20.17 +#define JPEG_INTERNALS
   20.18 +#include "jinclude.h"
   20.19 +#include "jpeglib.h"
   20.20 +#include "jdct.h"		/* Private declarations for DCT subsystem */
   20.21 +
   20.22 +
   20.23 +/* Private subobject for this module */
   20.24 +
   20.25 +typedef struct {
   20.26 +  struct jpeg_forward_dct pub;	/* public fields */
   20.27 +
   20.28 +  /* Pointer to the DCT routine actually in use */
   20.29 +  forward_DCT_method_ptr do_dct;
   20.30 +
   20.31 +  /* The actual post-DCT divisors --- not identical to the quant table
   20.32 +   * entries, because of scaling (especially for an unnormalized DCT).
   20.33 +   * Each table is given in normal array order.
   20.34 +   */
   20.35 +  DCTELEM * divisors[NUM_QUANT_TBLS];
   20.36 +
   20.37 +#ifdef DCT_FLOAT_SUPPORTED
   20.38 +  /* Same as above for the floating-point case. */
   20.39 +  float_DCT_method_ptr do_float_dct;
   20.40 +  FAST_FLOAT * float_divisors[NUM_QUANT_TBLS];
   20.41 +#endif
   20.42 +} my_fdct_controller;
   20.43 +
   20.44 +typedef my_fdct_controller * my_fdct_ptr;
   20.45 +
   20.46 +
   20.47 +/*
   20.48 + * Initialize for a processing pass.
   20.49 + * Verify that all referenced Q-tables are present, and set up
   20.50 + * the divisor table for each one.
   20.51 + * In the current implementation, DCT of all components is done during
   20.52 + * the first pass, even if only some components will be output in the
   20.53 + * first scan.  Hence all components should be examined here.
   20.54 + */
   20.55 +
   20.56 +METHODDEF(void)
   20.57 +start_pass_fdctmgr (j_compress_ptr cinfo)
   20.58 +{
   20.59 +  my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct;
   20.60 +  int ci, qtblno, i;
   20.61 +  jpeg_component_info *compptr;
   20.62 +  JQUANT_TBL * qtbl;
   20.63 +  DCTELEM * dtbl;
   20.64 +
   20.65 +  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
   20.66 +       ci++, compptr++) {
   20.67 +    qtblno = compptr->quant_tbl_no;
   20.68 +    /* Make sure specified quantization table is present */
   20.69 +    if (qtblno < 0 || qtblno >= NUM_QUANT_TBLS ||
   20.70 +	cinfo->quant_tbl_ptrs[qtblno] == NULL)
   20.71 +      ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, qtblno);
   20.72 +    qtbl = cinfo->quant_tbl_ptrs[qtblno];
   20.73 +    /* Compute divisors for this quant table */
   20.74 +    /* We may do this more than once for same table, but it's not a big deal */
   20.75 +    switch (cinfo->dct_method) {
   20.76 +#ifdef DCT_ISLOW_SUPPORTED
   20.77 +    case JDCT_ISLOW:
   20.78 +      /* For LL&M IDCT method, divisors are equal to raw quantization
   20.79 +       * coefficients multiplied by 8 (to counteract scaling).
   20.80 +       */
   20.81 +      if (fdct->divisors[qtblno] == NULL) {
   20.82 +	fdct->divisors[qtblno] = (DCTELEM *)
   20.83 +	  (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
   20.84 +				      DCTSIZE2 * SIZEOF(DCTELEM));
   20.85 +      }
   20.86 +      dtbl = fdct->divisors[qtblno];
   20.87 +      for (i = 0; i < DCTSIZE2; i++) {
   20.88 +	dtbl[i] = ((DCTELEM) qtbl->quantval[i]) << 3;
   20.89 +      }
   20.90 +      break;
   20.91 +#endif
   20.92 +#ifdef DCT_IFAST_SUPPORTED
   20.93 +    case JDCT_IFAST:
   20.94 +      {
   20.95 +	/* For AA&N IDCT method, divisors are equal to quantization
   20.96 +	 * coefficients scaled by scalefactor[row]*scalefactor[col], where
   20.97 +	 *   scalefactor[0] = 1
   20.98 +	 *   scalefactor[k] = cos(k*PI/16) * sqrt(2)    for k=1..7
   20.99 +	 * We apply a further scale factor of 8.
  20.100 +	 */
  20.101 +#define CONST_BITS 14
  20.102 +	static const INT16 aanscales[DCTSIZE2] = {
  20.103 +	  /* precomputed values scaled up by 14 bits */
  20.104 +	  16384, 22725, 21407, 19266, 16384, 12873,  8867,  4520,
  20.105 +	  22725, 31521, 29692, 26722, 22725, 17855, 12299,  6270,
  20.106 +	  21407, 29692, 27969, 25172, 21407, 16819, 11585,  5906,
  20.107 +	  19266, 26722, 25172, 22654, 19266, 15137, 10426,  5315,
  20.108 +	  16384, 22725, 21407, 19266, 16384, 12873,  8867,  4520,
  20.109 +	  12873, 17855, 16819, 15137, 12873, 10114,  6967,  3552,
  20.110 +	   8867, 12299, 11585, 10426,  8867,  6967,  4799,  2446,
  20.111 +	   4520,  6270,  5906,  5315,  4520,  3552,  2446,  1247
  20.112 +	};
  20.113 +	SHIFT_TEMPS
  20.114 +
  20.115 +	if (fdct->divisors[qtblno] == NULL) {
  20.116 +	  fdct->divisors[qtblno] = (DCTELEM *)
  20.117 +	    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
  20.118 +					DCTSIZE2 * SIZEOF(DCTELEM));
  20.119 +	}
  20.120 +	dtbl = fdct->divisors[qtblno];
  20.121 +	for (i = 0; i < DCTSIZE2; i++) {
  20.122 +	  dtbl[i] = (DCTELEM)
  20.123 +	    DESCALE(MULTIPLY16V16((INT32) qtbl->quantval[i],
  20.124 +				  (INT32) aanscales[i]),
  20.125 +		    CONST_BITS-3);
  20.126 +	}
  20.127 +      }
  20.128 +      break;
  20.129 +#endif
  20.130 +#ifdef DCT_FLOAT_SUPPORTED
  20.131 +    case JDCT_FLOAT:
  20.132 +      {
  20.133 +	/* For float AA&N IDCT method, divisors are equal to quantization
  20.134 +	 * coefficients scaled by scalefactor[row]*scalefactor[col], where
  20.135 +	 *   scalefactor[0] = 1
  20.136 +	 *   scalefactor[k] = cos(k*PI/16) * sqrt(2)    for k=1..7
  20.137 +	 * We apply a further scale factor of 8.
  20.138 +	 * What's actually stored is 1/divisor so that the inner loop can
  20.139 +	 * use a multiplication rather than a division.
  20.140 +	 */
  20.141 +	FAST_FLOAT * fdtbl;
  20.142 +	int row, col;
  20.143 +	static const double aanscalefactor[DCTSIZE] = {
  20.144 +	  1.0, 1.387039845, 1.306562965, 1.175875602,
  20.145 +	  1.0, 0.785694958, 0.541196100, 0.275899379
  20.146 +	};
  20.147 +
  20.148 +	if (fdct->float_divisors[qtblno] == NULL) {
  20.149 +	  fdct->float_divisors[qtblno] = (FAST_FLOAT *)
  20.150 +	    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
  20.151 +					DCTSIZE2 * SIZEOF(FAST_FLOAT));
  20.152 +	}
  20.153 +	fdtbl = fdct->float_divisors[qtblno];
  20.154 +	i = 0;
  20.155 +	for (row = 0; row < DCTSIZE; row++) {
  20.156 +	  for (col = 0; col < DCTSIZE; col++) {
  20.157 +	    fdtbl[i] = (FAST_FLOAT)
  20.158 +	      (1.0 / (((double) qtbl->quantval[i] *
  20.159 +		       aanscalefactor[row] * aanscalefactor[col] * 8.0)));
  20.160 +	    i++;
  20.161 +	  }
  20.162 +	}
  20.163 +      }
  20.164 +      break;
  20.165 +#endif
  20.166 +    default:
  20.167 +      ERREXIT(cinfo, JERR_NOT_COMPILED);
  20.168 +      break;
  20.169 +    }
  20.170 +  }
  20.171 +}
  20.172 +
  20.173 +
  20.174 +/*
  20.175 + * Perform forward DCT on one or more blocks of a component.
  20.176 + *
  20.177 + * The input samples are taken from the sample_data[] array starting at
  20.178 + * position start_row/start_col, and moving to the right for any additional
  20.179 + * blocks. The quantized coefficients are returned in coef_blocks[].
  20.180 + */
  20.181 +
  20.182 +METHODDEF(void)
  20.183 +forward_DCT (j_compress_ptr cinfo, jpeg_component_info * compptr,
  20.184 +	     JSAMPARRAY sample_data, JBLOCKROW coef_blocks,
  20.185 +	     JDIMENSION start_row, JDIMENSION start_col,
  20.186 +	     JDIMENSION num_blocks)
  20.187 +/* This version is used for integer DCT implementations. */
  20.188 +{
  20.189 +  /* This routine is heavily used, so it's worth coding it tightly. */
  20.190 +  my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct;
  20.191 +  forward_DCT_method_ptr do_dct = fdct->do_dct;
  20.192 +  DCTELEM * divisors = fdct->divisors[compptr->quant_tbl_no];
  20.193 +  DCTELEM workspace[DCTSIZE2];	/* work area for FDCT subroutine */
  20.194 +  JDIMENSION bi;
  20.195 +
  20.196 +  sample_data += start_row;	/* fold in the vertical offset once */
  20.197 +
  20.198 +  for (bi = 0; bi < num_blocks; bi++, start_col += DCTSIZE) {
  20.199 +    /* Load data into workspace, applying unsigned->signed conversion */
  20.200 +    { register DCTELEM *workspaceptr;
  20.201 +      register JSAMPROW elemptr;
  20.202 +      register int elemr;
  20.203 +
  20.204 +      workspaceptr = workspace;
  20.205 +      for (elemr = 0; elemr < DCTSIZE; elemr++) {
  20.206 +	elemptr = sample_data[elemr] + start_col;
  20.207 +#if DCTSIZE == 8		/* unroll the inner loop */
  20.208 +	*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
  20.209 +	*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
  20.210 +	*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
  20.211 +	*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
  20.212 +	*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
  20.213 +	*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
  20.214 +	*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
  20.215 +	*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
  20.216 +#else
  20.217 +	{ register int elemc;
  20.218 +	  for (elemc = DCTSIZE; elemc > 0; elemc--) {
  20.219 +	    *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
  20.220 +	  }
  20.221 +	}
  20.222 +#endif
  20.223 +      }
  20.224 +    }
  20.225 +
  20.226 +    /* Perform the DCT */
  20.227 +    (*do_dct) (workspace);
  20.228 +
  20.229 +    /* Quantize/descale the coefficients, and store into coef_blocks[] */
  20.230 +    { register DCTELEM temp, qval;
  20.231 +      register int i;
  20.232 +      register JCOEFPTR output_ptr = coef_blocks[bi];
  20.233 +
  20.234 +      for (i = 0; i < DCTSIZE2; i++) {
  20.235 +	qval = divisors[i];
  20.236 +	temp = workspace[i];
  20.237 +	/* Divide the coefficient value by qval, ensuring proper rounding.
  20.238 +	 * Since C does not specify the direction of rounding for negative
  20.239 +	 * quotients, we have to force the dividend positive for portability.
  20.240 +	 *
  20.241 +	 * In most files, at least half of the output values will be zero
  20.242 +	 * (at default quantization settings, more like three-quarters...)
  20.243 +	 * so we should ensure that this case is fast.  On many machines,
  20.244 +	 * a comparison is enough cheaper than a divide to make a special test
  20.245 +	 * a win.  Since both inputs will be nonnegative, we need only test
  20.246 +	 * for a < b to discover whether a/b is 0.
  20.247 +	 * If your machine's division is fast enough, define FAST_DIVIDE.
  20.248 +	 */
  20.249 +#ifdef FAST_DIVIDE
  20.250 +#define DIVIDE_BY(a,b)	a /= b
  20.251 +#else
  20.252 +#define DIVIDE_BY(a,b)	if (a >= b) a /= b; else a = 0
  20.253 +#endif
  20.254 +	if (temp < 0) {
  20.255 +	  temp = -temp;
  20.256 +	  temp += qval>>1;	/* for rounding */
  20.257 +	  DIVIDE_BY(temp, qval);
  20.258 +	  temp = -temp;
  20.259 +	} else {
  20.260 +	  temp += qval>>1;	/* for rounding */
  20.261 +	  DIVIDE_BY(temp, qval);
  20.262 +	}
  20.263 +	output_ptr[i] = (JCOEF) temp;
  20.264 +      }
  20.265 +    }
  20.266 +  }
  20.267 +}
  20.268 +
  20.269 +
  20.270 +#ifdef DCT_FLOAT_SUPPORTED
  20.271 +
  20.272 +METHODDEF(void)
  20.273 +forward_DCT_float (j_compress_ptr cinfo, jpeg_component_info * compptr,
  20.274 +		   JSAMPARRAY sample_data, JBLOCKROW coef_blocks,
  20.275 +		   JDIMENSION start_row, JDIMENSION start_col,
  20.276 +		   JDIMENSION num_blocks)
  20.277 +/* This version is used for floating-point DCT implementations. */
  20.278 +{
  20.279 +  /* This routine is heavily used, so it's worth coding it tightly. */
  20.280 +  my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct;
  20.281 +  float_DCT_method_ptr do_dct = fdct->do_float_dct;
  20.282 +  FAST_FLOAT * divisors = fdct->float_divisors[compptr->quant_tbl_no];
  20.283 +  FAST_FLOAT workspace[DCTSIZE2]; /* work area for FDCT subroutine */
  20.284 +  JDIMENSION bi;
  20.285 +
  20.286 +  sample_data += start_row;	/* fold in the vertical offset once */
  20.287 +
  20.288 +  for (bi = 0; bi < num_blocks; bi++, start_col += DCTSIZE) {
  20.289 +    /* Load data into workspace, applying unsigned->signed conversion */
  20.290 +    { register FAST_FLOAT *workspaceptr;
  20.291 +      register JSAMPROW elemptr;
  20.292 +      register int elemr;
  20.293 +
  20.294 +      workspaceptr = workspace;
  20.295 +      for (elemr = 0; elemr < DCTSIZE; elemr++) {
  20.296 +	elemptr = sample_data[elemr] + start_col;
  20.297 +#if DCTSIZE == 8		/* unroll the inner loop */
  20.298 +	*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
  20.299 +	*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
  20.300 +	*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
  20.301 +	*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
  20.302 +	*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
  20.303 +	*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
  20.304 +	*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
  20.305 +	*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
  20.306 +#else
  20.307 +	{ register int elemc;
  20.308 +	  for (elemc = DCTSIZE; elemc > 0; elemc--) {
  20.309 +	    *workspaceptr++ = (FAST_FLOAT)
  20.310 +	      (GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
  20.311 +	  }
  20.312 +	}
  20.313 +#endif
  20.314 +      }
  20.315 +    }
  20.316 +
  20.317 +    /* Perform the DCT */
  20.318 +    (*do_dct) (workspace);
  20.319 +
  20.320 +    /* Quantize/descale the coefficients, and store into coef_blocks[] */
  20.321 +    { register FAST_FLOAT temp;
  20.322 +      register int i;
  20.323 +      register JCOEFPTR output_ptr = coef_blocks[bi];
  20.324 +
  20.325 +      for (i = 0; i < DCTSIZE2; i++) {
  20.326 +	/* Apply the quantization and scaling factor */
  20.327 +	temp = workspace[i] * divisors[i];
  20.328 +	/* Round to nearest integer.
  20.329 +	 * Since C does not specify the direction of rounding for negative
  20.330 +	 * quotients, we have to force the dividend positive for portability.
  20.331 +	 * The maximum coefficient size is +-16K (for 12-bit data), so this
  20.332 +	 * code should work for either 16-bit or 32-bit ints.
  20.333 +	 */
  20.334 +	output_ptr[i] = (JCOEF) ((int) (temp + (FAST_FLOAT) 16384.5) - 16384);
  20.335 +      }
  20.336 +    }
  20.337 +  }
  20.338 +}
  20.339 +
  20.340 +#endif /* DCT_FLOAT_SUPPORTED */
  20.341 +
  20.342 +
  20.343 +/*
  20.344 + * Initialize FDCT manager.
  20.345 + */
  20.346 +
  20.347 +GLOBAL(void)
  20.348 +jinit_forward_dct (j_compress_ptr cinfo)
  20.349 +{
  20.350 +  my_fdct_ptr fdct;
  20.351 +  int i;
  20.352 +
  20.353 +  fdct = (my_fdct_ptr)
  20.354 +    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
  20.355 +				SIZEOF(my_fdct_controller));
  20.356 +  cinfo->fdct = (struct jpeg_forward_dct *) fdct;
  20.357 +  fdct->pub.start_pass = start_pass_fdctmgr;
  20.358 +
  20.359 +  switch (cinfo->dct_method) {
  20.360 +#ifdef DCT_ISLOW_SUPPORTED
  20.361 +  case JDCT_ISLOW:
  20.362 +    fdct->pub.forward_DCT = forward_DCT;
  20.363 +    fdct->do_dct = jpeg_fdct_islow;
  20.364 +    break;
  20.365 +#endif
  20.366 +#ifdef DCT_IFAST_SUPPORTED
  20.367 +  case JDCT_IFAST:
  20.368 +    fdct->pub.forward_DCT = forward_DCT;
  20.369 +    fdct->do_dct = jpeg_fdct_ifast;
  20.370 +    break;
  20.371 +#endif
  20.372 +#ifdef DCT_FLOAT_SUPPORTED
  20.373 +  case JDCT_FLOAT:
  20.374 +    fdct->pub.forward_DCT = forward_DCT_float;
  20.375 +    fdct->do_float_dct = jpeg_fdct_float;
  20.376 +    break;
  20.377 +#endif
  20.378 +  default:
  20.379 +    ERREXIT(cinfo, JERR_NOT_COMPILED);
  20.380 +    break;
  20.381 +  }
  20.382 +
  20.383 +  /* Mark divisor tables unallocated */
  20.384 +  for (i = 0; i < NUM_QUANT_TBLS; i++) {
  20.385 +    fdct->divisors[i] = NULL;
  20.386 +#ifdef DCT_FLOAT_SUPPORTED
  20.387 +    fdct->float_divisors[i] = NULL;
  20.388 +#endif
  20.389 +  }
  20.390 +}
    21.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.2 +++ b/libs/libjpeg/jchuff.c	Sun Nov 01 00:36:56 2015 +0200
    21.3 @@ -0,0 +1,909 @@
    21.4 +/*
    21.5 + * jchuff.c
    21.6 + *
    21.7 + * Copyright (C) 1991-1997, Thomas G. Lane.
    21.8 + * This file is part of the Independent JPEG Group's software.
    21.9 + * For conditions of distribution and use, see the accompanying README file.
   21.10 + *
   21.11 + * This file contains Huffman entropy encoding routines.
   21.12 + *
   21.13 + * Much of the complexity here has to do with supporting output suspension.
   21.14 + * If the data destination module demands suspension, we want to be able to
   21.15 + * back up to the start of the current MCU.  To do this, we copy state
   21.16 + * variables into local working storage, and update them back to the
   21.17 + * permanent JPEG objects only upon successful completion of an MCU.
   21.18 + */
   21.19 +
   21.20 +#define JPEG_INTERNALS
   21.21 +#include "jinclude.h"
   21.22 +#include "jpeglib.h"
   21.23 +#include "jchuff.h"		/* Declarations shared with jcphuff.c */
   21.24 +
   21.25 +
   21.26 +/* Expanded entropy encoder object for Huffman encoding.
   21.27 + *
   21.28 + * The savable_state subrecord contains fields that change within an MCU,
   21.29 + * but must not be updated permanently until we complete the MCU.
   21.30 + */
   21.31 +
   21.32 +typedef struct {
   21.33 +  INT32 put_buffer;		/* current bit-accumulation buffer */
   21.34 +  int put_bits;			/* # of bits now in it */
   21.35 +  int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */
   21.36 +} savable_state;
   21.37 +
   21.38 +/* This macro is to work around compilers with missing or broken
   21.39 + * structure assignment.  You'll need to fix this code if you have
   21.40 + * such a compiler and you change MAX_COMPS_IN_SCAN.
   21.41 + */
   21.42 +
   21.43 +#ifndef NO_STRUCT_ASSIGN
   21.44 +#define ASSIGN_STATE(dest,src)  ((dest) = (src))
   21.45 +#else
   21.46 +#if MAX_COMPS_IN_SCAN == 4
   21.47 +#define ASSIGN_STATE(dest,src)  \
   21.48 +	((dest).put_buffer = (src).put_buffer, \
   21.49 +	 (dest).put_bits = (src).put_bits, \
   21.50 +	 (dest).last_dc_val[0] = (src).last_dc_val[0], \
   21.51 +	 (dest).last_dc_val[1] = (src).last_dc_val[1], \
   21.52 +	 (dest).last_dc_val[2] = (src).last_dc_val[2], \
   21.53 +	 (dest).last_dc_val[3] = (src).last_dc_val[3])
   21.54 +#endif
   21.55 +#endif
   21.56 +
   21.57 +
   21.58 +typedef struct {
   21.59 +  struct jpeg_entropy_encoder pub; /* public fields */
   21.60 +
   21.61 +  savable_state saved;		/* Bit buffer & DC state at start of MCU */
   21.62 +
   21.63 +  /* These fields are NOT loaded into local working state. */
   21.64 +  unsigned int restarts_to_go;	/* MCUs left in this restart interval */
   21.65 +  int next_restart_num;		/* next restart number to write (0-7) */
   21.66 +
   21.67 +  /* Pointers to derived tables (these workspaces have image lifespan) */
   21.68 +  c_derived_tbl * dc_derived_tbls[NUM_HUFF_TBLS];
   21.69 +  c_derived_tbl * ac_derived_tbls[NUM_HUFF_TBLS];
   21.70 +
   21.71 +#ifdef ENTROPY_OPT_SUPPORTED	/* Statistics tables for optimization */
   21.72 +  long * dc_count_ptrs[NUM_HUFF_TBLS];
   21.73 +  long * ac_count_ptrs[NUM_HUFF_TBLS];
   21.74 +#endif
   21.75 +} huff_entropy_encoder;
   21.76 +
   21.77 +typedef huff_entropy_encoder * huff_entropy_ptr;
   21.78 +
   21.79 +/* Working state while writing an MCU.
   21.80 + * This struct contains all the fields that are needed by subroutines.
   21.81 + */
   21.82 +
   21.83 +typedef struct {
   21.84 +  JOCTET * next_output_byte;	/* => next byte to write in buffer */
   21.85 +  size_t free_in_buffer;	/* # of byte spaces remaining in buffer */
   21.86 +  savable_state cur;		/* Current bit buffer & DC state */
   21.87 +  j_compress_ptr cinfo;		/* dump_buffer needs access to this */
   21.88 +} working_state;
   21.89 +
   21.90 +
   21.91 +/* Forward declarations */
   21.92 +METHODDEF(boolean) encode_mcu_huff JPP((j_compress_ptr cinfo,
   21.93 +					JBLOCKROW *MCU_data));
   21.94 +METHODDEF(void) finish_pass_huff JPP((j_compress_ptr cinfo));
   21.95 +#ifdef ENTROPY_OPT_SUPPORTED
   21.96 +METHODDEF(boolean) encode_mcu_gather JPP((j_compress_ptr cinfo,
   21.97 +					  JBLOCKROW *MCU_data));
   21.98 +METHODDEF(void) finish_pass_gather JPP((j_compress_ptr cinfo));
   21.99 +#endif
  21.100 +
  21.101 +
  21.102 +/*
  21.103 + * Initialize for a Huffman-compressed scan.
  21.104 + * If gather_statistics is TRUE, we do not output anything during the scan,
  21.105 + * just count the Huffman symbols used and generate Huffman code tables.
  21.106 + */
  21.107 +
  21.108 +METHODDEF(void)
  21.109 +start_pass_huff (j_compress_ptr cinfo, boolean gather_statistics)
  21.110 +{
  21.111 +  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
  21.112 +  int ci, dctbl, actbl;
  21.113 +  jpeg_component_info * compptr;
  21.114 +
  21.115 +  if (gather_statistics) {
  21.116 +#ifdef ENTROPY_OPT_SUPPORTED
  21.117 +    entropy->pub.encode_mcu = encode_mcu_gather;
  21.118 +    entropy->pub.finish_pass = finish_pass_gather;
  21.119 +#else
  21.120 +    ERREXIT(cinfo, JERR_NOT_COMPILED);
  21.121 +#endif
  21.122 +  } else {
  21.123 +    entropy->pub.encode_mcu = encode_mcu_huff;
  21.124 +    entropy->pub.finish_pass = finish_pass_huff;
  21.125 +  }
  21.126 +
  21.127 +  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
  21.128 +    compptr = cinfo->cur_comp_info[ci];
  21.129 +    dctbl = compptr->dc_tbl_no;
  21.130 +    actbl = compptr->ac_tbl_no;
  21.131 +    if (gather_statistics) {
  21.132 +#ifdef ENTROPY_OPT_SUPPORTED
  21.133 +      /* Check for invalid table indexes */
  21.134 +      /* (make_c_derived_tbl does this in the other path) */
  21.135 +      if (dctbl < 0 || dctbl >= NUM_HUFF_TBLS)
  21.136 +	ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, dctbl);
  21.137 +      if (actbl < 0 || actbl >= NUM_HUFF_TBLS)
  21.138 +	ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, actbl);
  21.139 +      /* Allocate and zero the statistics tables */
  21.140 +      /* Note that jpeg_gen_optimal_table expects 257 entries in each table! */
  21.141 +      if (entropy->dc_count_ptrs[dctbl] == NULL)
  21.142 +	entropy->dc_count_ptrs[dctbl] = (long *)
  21.143 +	  (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
  21.144 +				      257 * SIZEOF(long));
  21.145 +      MEMZERO(entropy->dc_count_ptrs[dctbl], 257 * SIZEOF(long));
  21.146 +      if (entropy->ac_count_ptrs[actbl] == NULL)
  21.147 +	entropy->ac_count_ptrs[actbl] = (long *)
  21.148 +	  (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
  21.149 +				      257 * SIZEOF(long));
  21.150 +      MEMZERO(entropy->ac_count_ptrs[actbl], 257 * SIZEOF(long));
  21.151 +#endif
  21.152 +    } else {
  21.153 +      /* Compute derived values for Huffman tables */
  21.154 +      /* We may do this more than once for a table, but it's not expensive */
  21.155 +      jpeg_make_c_derived_tbl(cinfo, TRUE, dctbl,
  21.156 +			      & entropy->dc_derived_tbls[dctbl]);
  21.157 +      jpeg_make_c_derived_tbl(cinfo, FALSE, actbl,
  21.158 +			      & entropy->ac_derived_tbls[actbl]);
  21.159 +    }
  21.160 +    /* Initialize DC predictions to 0 */
  21.161 +    entropy->saved.last_dc_val[ci] = 0;
  21.162 +  }
  21.163 +
  21.164 +  /* Initialize bit buffer to empty */
  21.165 +  entropy->saved.put_buffer = 0;
  21.166 +  entropy->saved.put_bits = 0;
  21.167 +
  21.168 +  /* Initialize restart stuff */
  21.169 +  entropy->restarts_to_go = cinfo->restart_interval;
  21.170 +  entropy->next_restart_num = 0;
  21.171 +}
  21.172 +
  21.173 +
  21.174 +/*
  21.175 + * Compute the derived values for a Huffman table.
  21.176 + * This routine also performs some validation checks on the table.
  21.177 + *
  21.178 + * Note this is also used by jcphuff.c.
  21.179 + */
  21.180 +
  21.181 +GLOBAL(void)
  21.182 +jpeg_make_c_derived_tbl (j_compress_ptr cinfo, boolean isDC, int tblno,
  21.183 +			 c_derived_tbl ** pdtbl)
  21.184 +{
  21.185 +  JHUFF_TBL *htbl;
  21.186 +  c_derived_tbl *dtbl;
  21.187 +  int p, i, l, lastp, si, maxsymbol;
  21.188 +  char huffsize[257];
  21.189 +  unsigned int huffcode[257];
  21.190 +  unsigned int code;
  21.191 +
  21.192 +  /* Note that huffsize[] and huffcode[] are filled in code-length order,
  21.193 +   * paralleling the order of the symbols themselves in htbl->huffval[].
  21.194 +   */
  21.195 +
  21.196 +  /* Find the input Huffman table */
  21.197 +  if (tblno < 0 || tblno >= NUM_HUFF_TBLS)
  21.198 +    ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);
  21.199 +  htbl =
  21.200 +    isDC ? cinfo->dc_huff_tbl_ptrs[tblno] : cinfo->ac_huff_tbl_ptrs[tblno];
  21.201 +  if (htbl == NULL)
  21.202 +    ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);
  21.203 +
  21.204 +  /* Allocate a workspace if we haven't already done so. */
  21.205 +  if (*pdtbl == NULL)
  21.206 +    *pdtbl = (c_derived_tbl *)
  21.207 +      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
  21.208 +				  SIZEOF(c_derived_tbl));
  21.209 +  dtbl = *pdtbl;
  21.210 +  
  21.211 +  /* Figure C.1: make table of Huffman code length for each symbol */
  21.212 +
  21.213 +  p = 0;
  21.214 +  for (l = 1; l <= 16; l++) {
  21.215 +    i = (int) htbl->bits[l];
  21.216 +    if (i < 0 || p + i > 256)	/* protect against table overrun */
  21.217 +      ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
  21.218 +    while (i--)
  21.219 +      huffsize[p++] = (char) l;
  21.220 +  }
  21.221 +  huffsize[p] = 0;
  21.222 +  lastp = p;
  21.223 +  
  21.224 +  /* Figure C.2: generate the codes themselves */
  21.225 +  /* We also validate that the counts represent a legal Huffman code tree. */
  21.226 +
  21.227 +  code = 0;
  21.228 +  si = huffsize[0];
  21.229 +  p = 0;
  21.230 +  while (huffsize[p]) {
  21.231 +    while (((int) huffsize[p]) == si) {
  21.232 +      huffcode[p++] = code;
  21.233 +      code++;
  21.234 +    }
  21.235 +    /* code is now 1 more than the last code used for codelength si; but
  21.236 +     * it must still fit in si bits, since no code is allowed to be all ones.
  21.237 +     */
  21.238 +    if (((INT32) code) >= (((INT32) 1) << si))
  21.239 +      ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
  21.240 +    code <<= 1;
  21.241 +    si++;
  21.242 +  }
  21.243 +  
  21.244 +  /* Figure C.3: generate encoding tables */
  21.245 +  /* These are code and size indexed by symbol value */
  21.246 +
  21.247 +  /* Set all codeless symbols to have code length 0;
  21.248 +   * this lets us detect duplicate VAL entries here, and later
  21.249 +   * allows emit_bits to detect any attempt to emit such symbols.
  21.250 +   */
  21.251 +  MEMZERO(dtbl->ehufsi, SIZEOF(dtbl->ehufsi));
  21.252 +
  21.253 +  /* This is also a convenient place to check for out-of-range
  21.254 +   * and duplicated VAL entries.  We allow 0..255 for AC symbols
  21.255 +   * but only 0..15 for DC.  (We could constrain them further
  21.256 +   * based on data depth and mode, but this seems enough.)
  21.257 +   */
  21.258 +  maxsymbol = isDC ? 15 : 255;
  21.259 +
  21.260 +  for (p = 0; p < lastp; p++) {
  21.261 +    i = htbl->huffval[p];
  21.262 +    if (i < 0 || i > maxsymbol || dtbl->ehufsi[i])
  21.263 +      ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
  21.264 +    dtbl->ehufco[i] = huffcode[p];
  21.265 +    dtbl->ehufsi[i] = huffsize[p];
  21.266 +  }
  21.267 +}
  21.268 +
  21.269 +
  21.270 +/* Outputting bytes to the file */
  21.271 +
  21.272 +/* Emit a byte, taking 'action' if must suspend. */
  21.273 +#define emit_byte(state,val,action)  \
  21.274 +	{ *(state)->next_output_byte++ = (JOCTET) (val);  \
  21.275 +	  if (--(state)->free_in_buffer == 0)  \
  21.276 +	    if (! dump_buffer(state))  \
  21.277 +	      { action; } }
  21.278 +
  21.279 +
  21.280 +LOCAL(boolean)
  21.281 +dump_buffer (working_state * state)
  21.282 +/* Empty the output buffer; return TRUE if successful, FALSE if must suspend */
  21.283 +{
  21.284 +  struct jpeg_destination_mgr * dest = state->cinfo->dest;
  21.285 +
  21.286 +  if (! (*dest->empty_output_buffer) (state->cinfo))
  21.287 +    return FALSE;
  21.288 +  /* After a successful buffer dump, must reset buffer pointers */
  21.289 +  state->next_output_byte = dest->next_output_byte;
  21.290 +  state->free_in_buffer = dest->free_in_buffer;
  21.291 +  return TRUE;
  21.292 +}
  21.293 +
  21.294 +
  21.295 +/* Outputting bits to the file */
  21.296 +
  21.297 +/* Only the right 24 bits of put_buffer are used; the valid bits are
  21.298 + * left-justified in this part.  At most 16 bits can be passed to emit_bits
  21.299 + * in one call, and we never retain more than 7 bits in put_buffer
  21.300 + * between calls, so 24 bits are sufficient.
  21.301 + */
  21.302 +
  21.303 +INLINE
  21.304 +LOCAL(boolean)
  21.305 +emit_bits (working_state * state, unsigned int code, int size)
  21.306 +/* Emit some bits; return TRUE if successful, FALSE if must suspend */
  21.307 +{
  21.308 +  /* This routine is heavily used, so it's worth coding tightly. */
  21.309 +  register INT32 put_buffer = (INT32) code;
  21.310 +  register int put_bits = state->cur.put_bits;
  21.311 +
  21.312 +  /* if size is 0, caller used an invalid Huffman table entry */
  21.313 +  if (size == 0)
  21.314 +    ERREXIT(state->cinfo, JERR_HUFF_MISSING_CODE);
  21.315 +
  21.316 +  put_buffer &= (((INT32) 1)<<size) - 1; /* mask off any extra bits in code */
  21.317 +  
  21.318 +  put_bits += size;		/* new number of bits in buffer */
  21.319 +  
  21.320 +  put_buffer <<= 24 - put_bits; /* align incoming bits */
  21.321 +
  21.322 +  put_buffer |= state->cur.put_buffer; /* and merge with old buffer contents */
  21.323 +  
  21.324 +  while (put_bits >= 8) {
  21.325 +    int c = (int) ((put_buffer >> 16) & 0xFF);
  21.326 +    
  21.327 +    emit_byte(state, c, return FALSE);
  21.328 +    if (c == 0xFF) {		/* need to stuff a zero byte? */
  21.329 +      emit_byte(state, 0, return FALSE);
  21.330 +    }
  21.331 +    put_buffer <<= 8;
  21.332 +    put_bits -= 8;
  21.333 +  }
  21.334 +
  21.335 +  state->cur.put_buffer = put_buffer; /* update state variables */
  21.336 +  state->cur.put_bits = put_bits;
  21.337 +
  21.338 +  return TRUE;
  21.339 +}
  21.340 +
  21.341 +
  21.342 +LOCAL(boolean)
  21.343 +flush_bits (working_state * state)
  21.344 +{
  21.345 +  if (! emit_bits(state, 0x7F, 7)) /* fill any partial byte with ones */
  21.346 +    return FALSE;
  21.347 +  state->cur.put_buffer = 0;	/* and reset bit-buffer to empty */
  21.348 +  state->cur.put_bits = 0;
  21.349 +  return TRUE;
  21.350 +}
  21.351 +
  21.352 +
  21.353 +/* Encode a single block's worth of coefficients */
  21.354 +
  21.355 +LOCAL(boolean)
  21.356 +encode_one_block (working_state * state, JCOEFPTR block, int last_dc_val,
  21.357 +		  c_derived_tbl *dctbl, c_derived_tbl *actbl)
  21.358 +{
  21.359 +  register int temp, temp2;
  21.360 +  register int nbits;
  21.361 +  register int k, r, i;
  21.362 +  
  21.363 +  /* Encode the DC coefficient difference per section F.1.2.1 */
  21.364 +  
  21.365 +  temp = temp2 = block[0] - last_dc_val;
  21.366 +
  21.367 +  if (temp < 0) {
  21.368 +    temp = -temp;		/* temp is abs value of input */
  21.369 +    /* For a negative input, want temp2 = bitwise complement of abs(input) */
  21.370 +    /* This code assumes we are on a two's complement machine */
  21.371 +    temp2--;
  21.372 +  }
  21.373 +  
  21.374 +  /* Find the number of bits needed for the magnitude of the coefficient */
  21.375 +  nbits = 0;
  21.376 +  while (temp) {
  21.377 +    nbits++;
  21.378 +    temp >>= 1;
  21.379 +  }
  21.380 +  /* Check for out-of-range coefficient values.
  21.381 +   * Since we're encoding a difference, the range limit is twice as much.
  21.382 +   */
  21.383 +  if (nbits > MAX_COEF_BITS+1)
  21.384 +    ERREXIT(state->cinfo, JERR_BAD_DCT_COEF);
  21.385 +  
  21.386 +  /* Emit the Huffman-coded symbol for the number of bits */
  21.387 +  if (! emit_bits(state, dctbl->ehufco[nbits], dctbl->ehufsi[nbits]))
  21.388 +    return FALSE;
  21.389 +
  21.390 +  /* Emit that number of bits of the value, if positive, */
  21.391 +  /* or the complement of its magnitude, if negative. */
  21.392 +  if (nbits)			/* emit_bits rejects calls with size 0 */
  21.393 +    if (! emit_bits(state, (unsigned int) temp2, nbits))
  21.394 +      return FALSE;
  21.395 +
  21.396 +  /* Encode the AC coefficients per section F.1.2.2 */
  21.397 +  
  21.398 +  r = 0;			/* r = run length of zeros */
  21.399 +  
  21.400 +  for (k = 1; k < DCTSIZE2; k++) {
  21.401 +    if ((temp = block[jpeg_natural_order[k]]) == 0) {
  21.402 +      r++;
  21.403 +    } else {
  21.404 +      /* if run length > 15, must emit special run-length-16 codes (0xF0) */
  21.405 +      while (r > 15) {
  21.406 +	if (! emit_bits(state, actbl->ehufco[0xF0], actbl->ehufsi[0xF0]))
  21.407 +	  return FALSE;
  21.408 +	r -= 16;
  21.409 +      }
  21.410 +
  21.411 +      temp2 = temp;
  21.412 +      if (temp < 0) {
  21.413 +	temp = -temp;		/* temp is abs value of input */
  21.414 +	/* This code assumes we are on a two's complement machine */
  21.415 +	temp2--;
  21.416 +      }
  21.417 +      
  21.418 +      /* Find the number of bits needed for the magnitude of the coefficient */
  21.419 +      nbits = 1;		/* there must be at least one 1 bit */
  21.420 +      while ((temp >>= 1))
  21.421 +	nbits++;
  21.422 +      /* Check for out-of-range coefficient values */
  21.423 +      if (nbits > MAX_COEF_BITS)
  21.424 +	ERREXIT(state->cinfo, JERR_BAD_DCT_COEF);
  21.425 +      
  21.426 +      /* Emit Huffman symbol for run length / number of bits */
  21.427 +      i = (r << 4) + nbits;
  21.428 +      if (! emit_bits(state, actbl->ehufco[i], actbl->ehufsi[i]))
  21.429 +	return FALSE;
  21.430 +
  21.431 +      /* Emit that number of bits of the value, if positive, */
  21.432 +      /* or the complement of its magnitude, if negative. */
  21.433 +      if (! emit_bits(state, (unsigned int) temp2, nbits))
  21.434 +	return FALSE;
  21.435 +      
  21.436 +      r = 0;
  21.437 +    }
  21.438 +  }
  21.439 +
  21.440 +  /* If the last coef(s) were zero, emit an end-of-block code */
  21.441 +  if (r > 0)
  21.442 +    if (! emit_bits(state, actbl->ehufco[0], actbl->ehufsi[0]))
  21.443 +      return FALSE;
  21.444 +
  21.445 +  return TRUE;
  21.446 +}
  21.447 +
  21.448 +
  21.449 +/*
  21.450 + * Emit a restart marker & resynchronize predictions.
  21.451 + */
  21.452 +
  21.453 +LOCAL(boolean)
  21.454 +emit_restart (working_state * state, int restart_num)
  21.455 +{
  21.456 +  int ci;
  21.457 +
  21.458 +  if (! flush_bits(state))
  21.459 +    return FALSE;
  21.460 +
  21.461 +  emit_byte(state, 0xFF, return FALSE);
  21.462 +  emit_byte(state, JPEG_RST0 + restart_num, return FALSE);
  21.463 +
  21.464 +  /* Re-initialize DC predictions to 0 */
  21.465 +  for (ci = 0; ci < state->cinfo->comps_in_scan; ci++)
  21.466 +    state->cur.last_dc_val[ci] = 0;
  21.467 +
  21.468 +  /* The restart counter is not updated until we successfully write the MCU. */
  21.469 +
  21.470 +  return TRUE;
  21.471 +}
  21.472 +
  21.473 +
  21.474 +/*
  21.475 + * Encode and output one MCU's worth of Huffman-compressed coefficients.
  21.476 + */
  21.477 +
  21.478 +METHODDEF(boolean)
  21.479 +encode_mcu_huff (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
  21.480 +{
  21.481 +  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
  21.482 +  working_state state;
  21.483 +  int blkn, ci;
  21.484 +  jpeg_component_info * compptr;
  21.485 +
  21.486 +  /* Load up working state */
  21.487 +  state.next_output_byte = cinfo->dest->next_output_byte;
  21.488 +  state.free_in_buffer = cinfo->dest->free_in_buffer;
  21.489 +  ASSIGN_STATE(state.cur, entropy->saved);
  21.490 +  state.cinfo = cinfo;
  21.491 +
  21.492 +  /* Emit restart marker if needed */
  21.493 +  if (cinfo->restart_interval) {
  21.494 +    if (entropy->restarts_to_go == 0)
  21.495 +      if (! emit_restart(&state, entropy->next_restart_num))
  21.496 +	return FALSE;
  21.497 +  }
  21.498 +
  21.499 +  /* Encode the MCU data blocks */
  21.500 +  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
  21.501 +    ci = cinfo->MCU_membership[blkn];
  21.502 +    compptr = cinfo->cur_comp_info[ci];
  21.503 +    if (! encode_one_block(&state,
  21.504 +			   MCU_data[blkn][0], state.cur.last_dc_val[ci],
  21.505 +			   entropy->dc_derived_tbls[compptr->dc_tbl_no],
  21.506 +			   entropy->ac_derived_tbls[compptr->ac_tbl_no]))
  21.507 +      return FALSE;
  21.508 +    /* Update last_dc_val */
  21.509 +    state.cur.last_dc_val[ci] = MCU_data[blkn][0][0];
  21.510 +  }
  21.511 +
  21.512 +  /* Completed MCU, so update state */
  21.513 +  cinfo->dest->next_output_byte = state.next_output_byte;
  21.514 +  cinfo->dest->free_in_buffer = state.free_in_buffer;
  21.515 +  ASSIGN_STATE(entropy->saved, state.cur);
  21.516 +
  21.517 +  /* Update restart-interval state too */
  21.518 +  if (cinfo->restart_interval) {
  21.519 +    if (entropy->restarts_to_go == 0) {
  21.520 +      entropy->restarts_to_go = cinfo->restart_interval;
  21.521 +      entropy->next_restart_num++;
  21.522 +      entropy->next_restart_num &= 7;
  21.523 +    }
  21.524 +    entropy->restarts_to_go--;
  21.525 +  }
  21.526 +
  21.527 +  return TRUE;
  21.528 +}
  21.529 +
  21.530 +
  21.531 +/*
  21.532 + * Finish up at the end of a Huffman-compressed scan.
  21.533 + */
  21.534 +
  21.535 +METHODDEF(void)
  21.536 +finish_pass_huff (j_compress_ptr cinfo)
  21.537 +{
  21.538 +  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
  21.539 +  working_state state;
  21.540 +
  21.541 +  /* Load up working state ... flush_bits needs it */
  21.542 +  state.next_output_byte = cinfo->dest->next_output_byte;
  21.543 +  state.free_in_buffer = cinfo->dest->free_in_buffer;
  21.544 +  ASSIGN_STATE(state.cur, entropy->saved);
  21.545 +  state.cinfo = cinfo;
  21.546 +
  21.547 +  /* Flush out the last data */
  21.548 +  if (! flush_bits(&state))
  21.549 +    ERREXIT(cinfo, JERR_CANT_SUSPEND);
  21.550 +
  21.551 +  /* Update state */
  21.552 +  cinfo->dest->next_output_byte = state.next_output_byte;
  21.553 +  cinfo->dest->free_in_buffer = state.free_in_buffer;
  21.554 +  ASSIGN_STATE(entropy->saved, state.cur);
  21.555 +}
  21.556 +
  21.557 +
  21.558 +/*
  21.559 + * Huffman coding optimization.
  21.560 + *
  21.561 + * We first scan the supplied data and count the number of uses of each symbol
  21.562 + * that is to be Huffman-coded. (This process MUST agree with the code above.)
  21.563 + * Then we build a Huffman coding tree for the observed counts.
  21.564 + * Symbols which are not needed at all for the particular image are not
  21.565 + * assigned any code, which saves space in the DHT marker as well as in
  21.566 + * the compressed data.
  21.567 + */
  21.568 +
  21.569 +#ifdef ENTROPY_OPT_SUPPORTED
  21.570 +
  21.571 +
  21.572 +/* Process a single block's worth of coefficients */
  21.573 +
  21.574 +LOCAL(void)
  21.575 +htest_one_block (j_compress_ptr cinfo, JCOEFPTR block, int last_dc_val,
  21.576 +		 long dc_counts[], long ac_counts[])
  21.577 +{
  21.578 +  register int temp;
  21.579 +  register int nbits;
  21.580 +  register int k, r;
  21.581 +  
  21.582 +  /* Encode the DC coefficient difference per section F.1.2.1 */
  21.583 +  
  21.584 +  temp = block[0] - last_dc_val;
  21.585 +  if (temp < 0)
  21.586 +    temp = -temp;
  21.587 +  
  21.588 +  /* Find the number of bits needed for the magnitude of the coefficient */
  21.589 +  nbits = 0;
  21.590 +  while (temp) {
  21.591 +    nbits++;
  21.592 +    temp >>= 1;
  21.593 +  }
  21.594 +  /* Check for out-of-range coefficient values.
  21.595 +   * Since we're encoding a difference, the range limit is twice as much.
  21.596 +   */
  21.597 +  if (nbits > MAX_COEF_BITS+1)
  21.598 +    ERREXIT(cinfo, JERR_BAD_DCT_COEF);
  21.599 +
  21.600 +  /* Count the Huffman symbol for the number of bits */
  21.601 +  dc_counts[nbits]++;
  21.602 +  
  21.603 +  /* Encode the AC coefficients per section F.1.2.2 */
  21.604 +  
  21.605 +  r = 0;			/* r = run length of zeros */
  21.606 +  
  21.607 +  for (k = 1; k < DCTSIZE2; k++) {
  21.608 +    if ((temp = block[jpeg_natural_order[k]]) == 0) {
  21.609 +      r++;
  21.610 +    } else {
  21.611 +      /* if run length > 15, must emit special run-length-16 codes (0xF0) */
  21.612 +      while (r > 15) {
  21.613 +	ac_counts[0xF0]++;
  21.614 +	r -= 16;
  21.615 +      }
  21.616 +      
  21.617 +      /* Find the number of bits needed for the magnitude of the coefficient */
  21.618 +      if (temp < 0)
  21.619 +	temp = -temp;
  21.620 +      
  21.621 +      /* Find the number of bits needed for the magnitude of the coefficient */
  21.622 +      nbits = 1;		/* there must be at least one 1 bit */
  21.623 +      while ((temp >>= 1))
  21.624 +	nbits++;
  21.625 +      /* Check for out-of-range coefficient values */
  21.626 +      if (nbits > MAX_COEF_BITS)
  21.627 +	ERREXIT(cinfo, JERR_BAD_DCT_COEF);
  21.628 +      
  21.629 +      /* Count Huffman symbol for run length / number of bits */
  21.630 +      ac_counts[(r << 4) + nbits]++;
  21.631 +      
  21.632 +      r = 0;
  21.633 +    }
  21.634 +  }
  21.635 +
  21.636 +  /* If the last coef(s) were zero, emit an end-of-block code */
  21.637 +  if (r > 0)
  21.638 +    ac_counts[0]++;
  21.639 +}
  21.640 +
  21.641 +
  21.642 +/*
  21.643 + * Trial-encode one MCU's worth of Huffman-compressed coefficients.
  21.644 + * No data is actually output, so no suspension return is possible.
  21.645 + */
  21.646 +
  21.647 +METHODDEF(boolean)
  21.648 +encode_mcu_gather (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
  21.649 +{
  21.650 +  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
  21.651 +  int blkn, ci;
  21.652 +  jpeg_component_info * compptr;
  21.653 +
  21.654 +  /* Take care of restart intervals if needed */
  21.655 +  if (cinfo->restart_interval) {
  21.656 +    if (entropy->restarts_to_go == 0) {
  21.657 +      /* Re-initialize DC predictions to 0 */
  21.658 +      for (ci = 0; ci < cinfo->comps_in_scan; ci++)
  21.659 +	entropy->saved.last_dc_val[ci] = 0;
  21.660 +      /* Update restart state */
  21.661 +      entropy->restarts_to_go = cinfo->restart_interval;
  21.662 +    }
  21.663 +    entropy->restarts_to_go--;
  21.664 +  }
  21.665 +
  21.666 +  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
  21.667 +    ci = cinfo->MCU_membership[blkn];
  21.668 +    compptr = cinfo->cur_comp_info[ci];
  21.669 +    htest_one_block(cinfo, MCU_data[blkn][0], entropy->saved.last_dc_val[ci],
  21.670 +		    entropy->dc_count_ptrs[compptr->dc_tbl_no],
  21.671 +		    entropy->ac_count_ptrs[compptr->ac_tbl_no]);
  21.672 +    entropy->saved.last_dc_val[ci] = MCU_data[blkn][0][0];
  21.673 +  }
  21.674 +
  21.675 +  return TRUE;
  21.676 +}
  21.677 +
  21.678 +
  21.679 +/*
  21.680 + * Generate the best Huffman code table for the given counts, fill htbl.
  21.681 + * Note this is also used by jcphuff.c.
  21.682 + *
  21.683 + * The JPEG standard requires that no symbol be assigned a codeword of all
  21.684 + * one bits (so that padding bits added at the end of a compressed segment
  21.685 + * can't look like a valid code).  Because of the canonical ordering of
  21.686 + * codewords, this just means that there must be an unused slot in the
  21.687 + * longest codeword length category.  Section K.2 of the JPEG spec suggests
  21.688 + * reserving such a slot by pretending that symbol 256 is a valid symbol
  21.689 + * with count 1.  In theory that's not optimal; giving it count zero but
  21.690 + * including it in the symbol set anyway should give a better Huffman code.
  21.691 + * But the theoretically better code actually seems to come out worse in
  21.692 + * practice, because it produces more all-ones bytes (which incur stuffed
  21.693 + * zero bytes in the final file).  In any case the difference is tiny.
  21.694 + *
  21.695 + * The JPEG standard requires Huffman codes to be no more than 16 bits long.
  21.696 + * If some symbols have a very small but nonzero probability, the Huffman tree
  21.697 + * must be adjusted to meet the code length restriction.  We currently use
  21.698 + * the adjustment method suggested in JPEG section K.2.  This method is *not*
  21.699 + * optimal; it may not choose the best possible limited-length code.  But
  21.700 + * typically only very-low-frequency symbols will be given less-than-optimal
  21.701 + * lengths, so the code is almost optimal.  Experimental comparisons against
  21.702 + * an optimal limited-length-code algorithm indicate that the difference is
  21.703 + * microscopic --- usually less than a hundredth of a percent of total size.
  21.704 + * So the extra complexity of an optimal algorithm doesn't seem worthwhile.
  21.705 + */
  21.706 +
  21.707 +GLOBAL(void)
  21.708 +jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[])
  21.709 +{
  21.710 +#define MAX_CLEN 32		/* assumed maximum initial code length */
  21.711 +  UINT8 bits[MAX_CLEN+1];	/* bits[k] = # of symbols with code length k */
  21.712 +  int codesize[257];		/* codesize[k] = code length of symbol k */
  21.713 +  int others[257];		/* next symbol in current branch of tree */
  21.714 +  int c1, c2;
  21.715 +  int p, i, j;
  21.716 +  long v;
  21.717 +
  21.718 +  /* This algorithm is explained in section K.2 of the JPEG standard */
  21.719 +
  21.720 +  MEMZERO(bits, SIZEOF(bits));
  21.721 +  MEMZERO(codesize, SIZEOF(codesize));
  21.722 +  for (i = 0; i < 257; i++)
  21.723 +    others[i] = -1;		/* init links to empty */
  21.724 +  
  21.725 +  freq[256] = 1;		/* make sure 256 has a nonzero count */
  21.726 +  /* Including the pseudo-symbol 256 in the Huffman procedure guarantees
  21.727 +   * that no real symbol is given code-value of all ones, because 256
  21.728 +   * will be placed last in the largest codeword category.
  21.729 +   */
  21.730 +
  21.731 +  /* Huffman's basic algorithm to assign optimal code lengths to symbols */
  21.732 +
  21.733 +  for (;;) {
  21.734 +    /* Find the smallest nonzero frequency, set c1 = its symbol */
  21.735 +    /* In case of ties, take the larger symbol number */
  21.736 +    c1 = -1;
  21.737 +    v = 1000000000L;
  21.738 +    for (i = 0; i <= 256; i++) {
  21.739 +      if (freq[i] && freq[i] <= v) {
  21.740 +	v = freq[i];
  21.741 +	c1 = i;
  21.742 +      }
  21.743 +    }
  21.744 +
  21.745 +    /* Find the next smallest nonzero frequency, set c2 = its symbol */
  21.746 +    /* In case of ties, take the larger symbol number */
  21.747 +    c2 = -1;
  21.748 +    v = 1000000000L;
  21.749 +    for (i = 0; i <= 256; i++) {
  21.750 +      if (freq[i] && freq[i] <= v && i != c1) {
  21.751 +	v = freq[i];
  21.752 +	c2 = i;
  21.753 +      }
  21.754 +    }
  21.755 +
  21.756 +    /* Done if we've merged everything into one frequency */
  21.757 +    if (c2 < 0)
  21.758 +      break;
  21.759 +    
  21.760 +    /* Else merge the two counts/trees */
  21.761 +    freq[c1] += freq[c2];
  21.762 +    freq[c2] = 0;
  21.763 +
  21.764 +    /* Increment the codesize of everything in c1's tree branch */
  21.765 +    codesize[c1]++;
  21.766 +    while (others[c1] >= 0) {
  21.767 +      c1 = others[c1];
  21.768 +      codesize[c1]++;
  21.769 +    }
  21.770 +    
  21.771 +    others[c1] = c2;		/* chain c2 onto c1's tree branch */
  21.772 +    
  21.773 +    /* Increment the codesize of everything in c2's tree branch */
  21.774 +    codesize[c2]++;
  21.775 +    while (others[c2] >= 0) {
  21.776 +      c2 = others[c2];
  21.777 +      codesize[c2]++;
  21.778 +    }
  21.779 +  }
  21.780 +
  21.781 +  /* Now count the number of symbols of each code length */
  21.782 +  for (i = 0; i <= 256; i++) {
  21.783 +    if (codesize[i]) {
  21.784 +      /* The JPEG standard seems to think that this can't happen, */
  21.785 +      /* but I'm paranoid... */
  21.786 +      if (codesize[i] > MAX_CLEN)
  21.787 +	ERREXIT(cinfo, JERR_HUFF_CLEN_OVERFLOW);
  21.788 +
  21.789 +      bits[codesize[i]]++;
  21.790 +    }
  21.791 +  }
  21.792 +
  21.793 +  /* JPEG doesn't allow symbols with code lengths over 16 bits, so if the pure
  21.794 +   * Huffman procedure assigned any such lengths, we must adjust the coding.
  21.795 +   * Here is what the JPEG spec says about how this next bit works:
  21.796 +   * Since symbols are paired for the longest Huffman code, the symbols are
  21.797 +   * removed from this length category two at a time.  The prefix for the pair
  21.798 +   * (which is one bit shorter) is allocated to one of the pair; then,
  21.799 +   * skipping the BITS entry for that prefix length, a code word from the next
  21.800 +   * shortest nonzero BITS entry is converted into a prefix for two code words
  21.801 +   * one bit longer.
  21.802 +   */
  21.803 +  
  21.804 +  for (i = MAX_CLEN; i > 16; i--) {
  21.805 +    while (bits[i] > 0) {
  21.806 +      j = i - 2;		/* find length of new prefix to be used */
  21.807 +      while (bits[j] == 0)
  21.808 +	j--;
  21.809 +      
  21.810 +      bits[i] -= 2;		/* remove two symbols */
  21.811 +      bits[i-1]++;		/* one goes in this length */
  21.812 +      bits[j+1] += 2;		/* two new symbols in this length */
  21.813 +      bits[j]--;		/* symbol of this length is now a prefix */
  21.814 +    }
  21.815 +  }
  21.816 +
  21.817 +  /* Remove the count for the pseudo-symbol 256 from the largest codelength */
  21.818 +  while (bits[i] == 0)		/* find largest codelength still in use */
  21.819 +    i--;
  21.820 +  bits[i]--;
  21.821 +  
  21.822 +  /* Return final symbol counts (only for lengths 0..16) */
  21.823 +  MEMCOPY(htbl->bits, bits, SIZEOF(htbl->bits));
  21.824 +  
  21.825 +  /* Return a list of the symbols sorted by code length */
  21.826 +  /* It's not real clear to me why we don't need to consider the codelength
  21.827 +   * changes made above, but the JPEG spec seems to think this works.
  21.828 +   */
  21.829 +  p = 0;
  21.830 +  for (i = 1; i <= MAX_CLEN; i++) {
  21.831 +    for (j = 0; j <= 255; j++) {
  21.832 +      if (codesize[j] == i) {
  21.833 +	htbl->huffval[p] = (UINT8) j;
  21.834 +	p++;
  21.835 +      }
  21.836 +    }
  21.837 +  }
  21.838 +
  21.839 +  /* Set sent_table FALSE so updated table will be written to JPEG file. */
  21.840 +  htbl->sent_table = FALSE;
  21.841 +}
  21.842 +
  21.843 +
  21.844 +/*
  21.845 + * Finish up a statistics-gathering pass and create the new Huffman tables.
  21.846 + */
  21.847 +
  21.848 +METHODDEF(void)
  21.849 +finish_pass_gather (j_compress_ptr cinfo)
  21.850 +{
  21.851 +  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
  21.852 +  int ci, dctbl, actbl;
  21.853 +  jpeg_component_info * compptr;
  21.854 +  JHUFF_TBL **htblptr;
  21.855 +  boolean did_dc[NUM_HUFF_TBLS];
  21.856 +  boolean did_ac[NUM_HUFF_TBLS];
  21.857 +
  21.858 +  /* It's important not to apply jpeg_gen_optimal_table more than once
  21.859 +   * per table, because it clobbers the input frequency counts!
  21.860 +   */
  21.861 +  MEMZERO(did_dc, SIZEOF(did_dc));
  21.862 +  MEMZERO(did_ac, SIZEOF(did_ac));
  21.863 +
  21.864 +  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
  21.865 +    compptr = cinfo->cur_comp_info[ci];
  21.866 +    dctbl = compptr->dc_tbl_no;
  21.867 +    actbl = compptr->ac_tbl_no;
  21.868 +    if (! did_dc[dctbl]) {
  21.869 +      htblptr = & cinfo->dc_huff_tbl_ptrs[dctbl];
  21.870 +      if (*htblptr == NULL)
  21.871 +	*htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);
  21.872 +      jpeg_gen_optimal_table(cinfo, *htblptr, entropy->dc_count_ptrs[dctbl]);
  21.873 +      did_dc[dctbl] = TRUE;
  21.874 +    }
  21.875 +    if (! did_ac[actbl]) {
  21.876 +      htblptr = & cinfo->ac_huff_tbl_ptrs[actbl];
  21.877 +      if (*htblptr == NULL)
  21.878 +	*htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);
  21.879 +      jpeg_gen_optimal_table(cinfo, *htblptr, entropy->ac_count_ptrs[actbl]);
  21.880 +      did_ac[actbl] = TRUE;
  21.881 +    }
  21.882 +  }
  21.883 +}
  21.884 +
  21.885 +
  21.886 +#endif /* ENTROPY_OPT_SUPPORTED */
  21.887 +
  21.888 +
  21.889 +/*
  21.890 + * Module initialization routine for Huffman entropy encoding.
  21.891 + */
  21.892 +
  21.893 +GLOBAL(void)
  21.894 +jinit_huff_encoder (j_compress_ptr cinfo)
  21.895 +{
  21.896 +  huff_entropy_ptr entropy;
  21.897 +  int i;
  21.898 +
  21.899 +  entropy = (huff_entropy_ptr)
  21.900 +    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
  21.901 +				SIZEOF(huff_entropy_encoder));
  21.902 +  cinfo->entropy = (struct jpeg_entropy_encoder *) entropy;
  21.903 +  entropy->pub.start_pass = start_pass_huff;
  21.904 +
  21.905 +  /* Mark tables unallocated */
  21.906 +  for (i = 0; i < NUM_HUFF_TBLS; i++) {
  21.907 +    entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL;
  21.908 +#ifdef ENTROPY_OPT_SUPPORTED
  21.909 +    entropy->dc_count_ptrs[i] = entropy->ac_count_ptrs[i] = NULL;
  21.910 +#endif
  21.911 +  }
  21.912 +}
    22.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.2 +++ b/libs/libjpeg/jchuff.h	Sun Nov 01 00:36:56 2015 +0200
    22.3 @@ -0,0 +1,47 @@
    22.4 +/*
    22.5 + * jchuff.h
    22.6 + *
    22.7 + * Copyright (C) 1991-1997, Thomas G. Lane.
    22.8 + * This file is part of the Independent JPEG Group's software.
    22.9 + * For conditions of distribution and use, see the accompanying README file.
   22.10 + *
   22.11 + * This file contains declarations for Huffman entropy encoding routines
   22.12 + * that are shared between the sequential encoder (jchuff.c) and the
   22.13 + * progressive encoder (jcphuff.c).  No other modules need to see these.
   22.14 + */
   22.15 +
   22.16 +/* The legal range of a DCT coefficient is
   22.17 + *  -1024 .. +1023  for 8-bit data;
   22.18 + * -16384 .. +16383 for 12-bit data.
   22.19 + * Hence the magnitude should always fit in 10 or 14 bits respectively.
   22.20 + */
   22.21 +
   22.22 +#if BITS_IN_JSAMPLE == 8
   22.23 +#define MAX_COEF_BITS 10
   22.24 +#else
   22.25 +#define MAX_COEF_BITS 14
   22.26 +#endif
   22.27 +
   22.28 +/* Derived data constructed for each Huffman table */
   22.29 +
   22.30 +typedef struct {
   22.31 +  unsigned int ehufco[256];	/* code for each symbol */
   22.32 +  char ehufsi[256];		/* length of code for each symbol */
   22.33 +  /* If no code has been allocated for a symbol S, ehufsi[S] contains 0 */
   22.34 +} c_derived_tbl;
   22.35 +
   22.36 +/* Short forms of external names for systems with brain-damaged linkers. */
   22.37 +
   22.38 +#ifdef NEED_SHORT_EXTERNAL_NAMES
   22.39 +#define jpeg_make_c_derived_tbl	jMkCDerived
   22.40 +#define jpeg_gen_optimal_table	jGenOptTbl
   22.41 +#endif /* NEED_SHORT_EXTERNAL_NAMES */
   22.42 +
   22.43 +/* Expand a Huffman table definition into the derived format */
   22.44 +EXTERN(void) jpeg_make_c_derived_tbl
   22.45 +	JPP((j_compress_ptr cinfo, boolean isDC, int tblno,
   22.46 +	     c_derived_tbl ** pdtbl));
   22.47 +
   22.48 +/* Generate an optimal table definition given the specified counts */
   22.49 +EXTERN(void) jpeg_gen_optimal_table
   22.50 +	JPP((j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[]));
    23.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.2 +++ b/libs/libjpeg/jcinit.c	Sun Nov 01 00:36:56 2015 +0200
    23.3 @@ -0,0 +1,72 @@
    23.4 +/*
    23.5 + * jcinit.c
    23.6 + *
    23.7 + * Copyright (C) 1991-1997, Thomas G. Lane.
    23.8 + * This file is part of the Independent JPEG Group's software.
    23.9 + * For conditions of distribution and use, see the accompanying README file.
   23.10 + *
   23.11 + * This file contains initialization logic for the JPEG compressor.
   23.12 + * This routine is in charge of selecting the modules to be executed and
   23.13 + * making an initialization call to each one.
   23.14 + *
   23.15 + * Logically, this code belongs in jcmaster.c.  It's split out because
   23.16 + * linking this routine implies linking the entire compression library.
   23.17 + * For a transcoding-only application, we want to be able to use jcmaster.c
   23.18 + * without linking in the whole library.
   23.19 + */
   23.20 +
   23.21 +#define JPEG_INTERNALS
   23.22 +#include "jinclude.h"
   23.23 +#include "jpeglib.h"
   23.24 +
   23.25 +
   23.26 +/*
   23.27 + * Master selection of compression modules.
   23.28 + * This is done once at the start of processing an image.  We determine
   23.29 + * which modules will be used and give them appropriate initialization calls.
   23.30 + */
   23.31 +
   23.32 +GLOBAL(void)
   23.33 +jinit_compress_master (j_compress_ptr cinfo)
   23.34 +{
   23.35 +  /* Initialize master control (includes parameter checking/processing) */
   23.36 +  jinit_c_master_control(cinfo, FALSE /* full compression */);
   23.37 +
   23.38 +  /* Preprocessing */
   23.39 +  if (! cinfo->raw_data_in) {
   23.40 +    jinit_color_converter(cinfo);
   23.41 +    jinit_downsampler(cinfo);
   23.42 +    jinit_c_prep_controller(cinfo, FALSE /* never need full buffer here */);
   23.43 +  }
   23.44 +  /* Forward DCT */
   23.45 +  jinit_forward_dct(cinfo);
   23.46 +  /* Entropy encoding: either Huffman or arithmetic coding. */
   23.47 +  if (cinfo->arith_code) {
   23.48 +    ERREXIT(cinfo, JERR_ARITH_NOTIMPL);
   23.49 +  } else {
   23.50 +    if (cinfo->progressive_mode) {
   23.51 +#ifdef C_PROGRESSIVE_SUPPORTED
   23.52 +      jinit_phuff_encoder(cinfo);
   23.53 +#else
   23.54 +      ERREXIT(cinfo, JERR_NOT_COMPILED);
   23.55 +#endif
   23.56 +    } else
   23.57 +      jinit_huff_encoder(cinfo);
   23.58 +  }
   23.59 +
   23.60 +  /* Need a full-image coefficient buffer in any multi-pass mode. */
   23.61 +  jinit_c_coef_controller(cinfo,
   23.62 +		(boolean) (cinfo->num_scans > 1 || cinfo->optimize_coding));
   23.63 +  jinit_c_main_controller(cinfo, FALSE /* never need full buffer here */);
   23.64 +
   23.65 +  jinit_marker_writer(cinfo);
   23.66 +
   23.67 +  /* We can now tell the memory manager to allocate virtual arrays. */
   23.68 +  (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo);
   23.69 +
   23.70 +  /* Write the datastream header (SOI) immediately.
   23.71 +   * Frame and scan headers are postponed till later.
   23.72 +   * This lets application insert special markers after the SOI.
   23.73 +   */
   23.74 +  (*cinfo->marker->write_file_header) (cinfo);
   23.75 +}
    24.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.2 +++ b/libs/libjpeg/jcmainct.c	Sun Nov 01 00:36:56 2015 +0200
    24.3 @@ -0,0 +1,293 @@
    24.4 +/*
    24.5 + * jcmainct.c
    24.6 + *
    24.7 + * Copyright (C) 1994-1996, Thomas G. Lane.
    24.8 + * This file is part of the Independent JPEG Group's software.
    24.9 + * For conditions of distribution and use, see the accompanying README file.
   24.10 + *
   24.11 + * This file contains the main buffer controller for compression.
   24.12 + * The main buffer lies between the pre-processor and the JPEG
   24.13 + * compressor proper; it holds downsampled data in the JPEG colorspace.
   24.14 + */
   24.15 +
   24.16 +#define JPEG_INTERNALS
   24.17 +#include "jinclude.h"
   24.18 +#include "jpeglib.h"
   24.19 +
   24.20 +
   24.21 +/* Note: currently, there is no operating mode in which a full-image buffer
   24.22 + * is needed at this step.  If there were, that mode could not be used with
   24.23 + * "raw data" input, since this module is bypassed in that case.  However,
   24.24 + * we've left the code here for possible use in special applications.
   24.25 + */
   24.26 +#undef FULL_MAIN_BUFFER_SUPPORTED
   24.27 +
   24.28 +
   24.29 +/* Private buffer controller object */
   24.30 +
   24.31 +typedef struct {
   24.32 +  struct jpeg_c_main_controller pub; /* public fields */
   24.33 +
   24.34 +  JDIMENSION cur_iMCU_row;	/* number of current iMCU row */
   24.35 +  JDIMENSION rowgroup_ctr;	/* counts row groups received in iMCU row */
   24.36 +  boolean suspended;		/* remember if we suspended output */
   24.37 +  J_BUF_MODE pass_mode;		/* current operating mode */
   24.38 +
   24.39 +  /* If using just a strip buffer, this points to the entire set of buffers
   24.40 +   * (we allocate one for each component).  In the full-image case, this
   24.41 +   * points to the currently accessible strips of the virtual arrays.
   24.42 +   */
   24.43 +  JSAMPARRAY buffer[MAX_COMPONENTS];
   24.44 +
   24.45 +#ifdef FULL_MAIN_BUFFER_SUPPORTED
   24.46 +  /* If using full-image storage, this array holds pointers to virtual-array
   24.47 +   * control blocks for each component.  Unused if not full-image storage.
   24.48 +   */
   24.49 +  jvirt_sarray_ptr whole_image[MAX_COMPONENTS];
   24.50 +#endif
   24.51 +} my_main_controller;
   24.52 +
   24.53 +typedef my_main_controller * my_main_ptr;
   24.54 +
   24.55 +
   24.56 +/* Forward declarations */
   24.57 +METHODDEF(void) process_data_simple_main
   24.58 +	JPP((j_compress_ptr cinfo, JSAMPARRAY input_buf,
   24.59 +	     JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail));
   24.60 +#ifdef FULL_MAIN_BUFFER_SUPPORTED
   24.61 +METHODDEF(void) process_data_buffer_main
   24.62 +	JPP((j_compress_ptr cinfo, JSAMPARRAY input_buf,
   24.63 +	     JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail));
   24.64 +#endif
   24.65 +
   24.66 +
   24.67 +/*
   24.68 + * Initialize for a processing pass.
   24.69 + */
   24.70 +
   24.71 +METHODDEF(void)
   24.72 +start_pass_main (j_compress_ptr cinfo, J_BUF_MODE pass_mode)
   24.73 +{
   24.74 +  my_main_ptr main = (my_main_ptr) cinfo->main;
   24.75 +
   24.76 +  /* Do nothing in raw-data mode. */
   24.77 +  if (cinfo->raw_data_in)
   24.78 +    return;
   24.79 +
   24.80 +  main->cur_iMCU_row = 0;	/* initialize counters */
   24.81 +  main->rowgroup_ctr = 0;
   24.82 +  main->suspended = FALSE;
   24.83 +  main->pass_mode = pass_mode;	/* save mode for use by process_data */
   24.84 +
   24.85 +  switch (pass_mode) {
   24.86 +  case JBUF_PASS_THRU:
   24.87 +#ifdef FULL_MAIN_BUFFER_SUPPORTED
   24.88 +    if (main->whole_image[0] != NULL)
   24.89 +      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
   24.90 +#endif
   24.91 +    main->pub.process_data = process_data_simple_main;
   24.92 +    break;
   24.93 +#ifdef FULL_MAIN_BUFFER_SUPPORTED
   24.94 +  case JBUF_SAVE_SOURCE:
   24.95 +  case JBUF_CRANK_DEST:
   24.96 +  case JBUF_SAVE_AND_PASS:
   24.97 +    if (main->whole_image[0] == NULL)
   24.98 +      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
   24.99 +    main->pub.process_data = process_data_buffer_main;
  24.100 +    break;
  24.101 +#endif
  24.102 +  default:
  24.103 +    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
  24.104 +    break;
  24.105 +  }
  24.106 +}
  24.107 +
  24.108 +
  24.109 +/*
  24.110 + * Process some data.
  24.111 + * This routine handles the simple pass-through mode,
  24.112 + * where we have only a strip buffer.
  24.113 + */
  24.114 +
  24.115 +METHODDEF(void)
  24.116 +process_data_simple_main (j_compress_ptr cinfo,
  24.117 +			  JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
  24.118 +			  JDIMENSION in_rows_avail)
  24.119 +{
  24.120 +  my_main_ptr main = (my_main_ptr) cinfo->main;
  24.121 +
  24.122 +  while (main->cur_iMCU_row < cinfo->total_iMCU_rows) {
  24.123 +    /* Read input data if we haven't filled the main buffer yet */
  24.124 +    if (main->rowgroup_ctr < DCTSIZE)
  24.125 +      (*cinfo->prep->pre_process_data) (cinfo,
  24.126 +					input_buf, in_row_ctr, in_rows_avail,
  24.127 +					main->buffer, &main->rowgroup_ctr,
  24.128 +					(JDIMENSION) DCTSIZE);
  24.129 +
  24.130 +    /* If we don't have a full iMCU row buffered, return to application for
  24.131 +     * more data.  Note that preprocessor will always pad to fill the iMCU row
  24.132 +     * at the bottom of the image.
  24.133 +     */
  24.134 +    if (main->rowgroup_ctr != DCTSIZE)
  24.135 +      return;
  24.136 +
  24.137 +    /* Send the completed row to the compressor */
  24.138 +    if (! (*cinfo->coef->compress_data) (cinfo, main->buffer)) {
  24.139 +      /* If compressor did not consume the whole row, then we must need to
  24.140 +       * suspend processing and return to the application.  In this situation
  24.141 +       * we pretend we didn't yet consume the last input row; otherwise, if
  24.142 +       * it happened to be the last row of the image, the application would
  24.143 +       * think we were done.
  24.144 +       */
  24.145 +      if (! main->suspended) {
  24.146 +	(*in_row_ctr)--;
  24.147 +	main->suspended = TRUE;
  24.148 +      }
  24.149 +      return;
  24.150 +    }
  24.151 +    /* We did finish the row.  Undo our little suspension hack if a previous
  24.152 +     * call suspended; then mark the main buffer empty.
  24.153 +     */
  24.154 +    if (main->suspended) {
  24.155 +      (*in_row_ctr)++;
  24.156 +      main->suspended = FALSE;
  24.157 +    }
  24.158 +    main->rowgroup_ctr = 0;
  24.159 +    main->cur_iMCU_row++;
  24.160 +  }
  24.161 +}
  24.162 +
  24.163 +
  24.164 +#ifdef FULL_MAIN_BUFFER_SUPPORTED
  24.165 +
  24.166 +/*
  24.167 + * Process some data.
  24.168 + * This routine handles all of the modes that use a full-size buffer.
  24.169 + */
  24.170 +
  24.171 +METHODDEF(void)
  24.172 +process_data_buffer_main (j_compress_ptr cinfo,
  24.173 +			  JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
  24.174 +			  JDIMENSION in_rows_avail)
  24.175 +{
  24.176 +  my_main_ptr main = (my_main_ptr) cinfo->main;
  24.177 +  int ci;
  24.178 +  jpeg_component_info *compptr;
  24.179 +  boolean writing = (main->pass_mode != JBUF_CRANK_DEST);
  24.180 +
  24.181 +  while (main->cur_iMCU_row < cinfo->total_iMCU_rows) {
  24.182 +    /* Realign the virtual buffers if at the start of an iMCU row. */
  24.183 +    if (main->rowgroup_ctr == 0) {
  24.184 +      for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  24.185 +	   ci++, compptr++) {
  24.186 +	main->buffer[ci] = (*cinfo->mem->access_virt_sarray)
  24.187 +	  ((j_common_ptr) cinfo, main->whole_image[ci],
  24.188 +	   main->cur_iMCU_row * (compptr->v_samp_factor * DCTSIZE),
  24.189 +	   (JDIMENSION) (compptr->v_samp_factor * DCTSIZE), writing);
  24.190 +      }
  24.191 +      /* In a read pass, pretend we just read some source data. */
  24.192 +      if (! writing) {
  24.193 +	*in_row_ctr += cinfo->max_v_samp_factor * DCTSIZE;
  24.194 +	main->rowgroup_ctr = DCTSIZE;
  24.195 +      }
  24.196 +    }
  24.197 +
  24.198 +    /* If a write pass, read input data until the current iMCU row is full. */
  24.199 +    /* Note: preprocessor will pad if necessary to fill the last iMCU row. */
  24.200 +    if (writing) {
  24.201 +      (*cinfo->prep->pre_process_data) (cinfo,
  24.202 +					input_buf, in_row_ctr, in_rows_avail,
  24.203 +					main->buffer, &main->rowgroup_ctr,
  24.204 +					(JDIMENSION) DCTSIZE);
  24.205 +      /* Return to application if we need more data to fill the iMCU row. */
  24.206 +      if (main->rowgroup_ctr < DCTSIZE)
  24.207 +	return;
  24.208 +    }
  24.209 +
  24.210 +    /* Emit data, unless this is a sink-only pass. */
  24.211 +    if (main->pass_mode != JBUF_SAVE_SOURCE) {
  24.212 +      if (! (*cinfo->coef->compress_data) (cinfo, main->buffer)) {
  24.213 +	/* If compressor did not consume the whole row, then we must need to
  24.214 +	 * suspend processing and return to the application.  In this situation
  24.215 +	 * we pretend we didn't yet consume the last input row; otherwise, if
  24.216 +	 * it happened to be the last row of the image, the application would
  24.217 +	 * think we were done.
  24.218 +	 */
  24.219 +	if (! main->suspended) {
  24.220 +	  (*in_row_ctr)--;
  24.221 +	  main->suspended = TRUE;
  24.222 +	}
  24.223 +	return;
  24.224 +      }
  24.225 +      /* We did finish the row.  Undo our little suspension hack if a previous
  24.226 +       * call suspended; then mark the main buffer empty.
  24.227 +       */
  24.228 +      if (main->suspended) {
  24.229 +	(*in_row_ctr)++;
  24.230 +	main->suspended = FALSE;
  24.231 +      }
  24.232 +    }
  24.233 +
  24.234 +    /* If get here, we are done with this iMCU row.  Mark buffer empty. */
  24.235 +    main->rowgroup_ctr = 0;
  24.236 +    main->cur_iMCU_row++;
  24.237 +  }
  24.238 +}
  24.239 +
  24.240 +#endif /* FULL_MAIN_BUFFER_SUPPORTED */
  24.241 +
  24.242 +
  24.243 +/*
  24.244 + * Initialize main buffer controller.
  24.245 + */
  24.246 +
  24.247 +GLOBAL(void)
  24.248 +jinit_c_main_controller (j_compress_ptr cinfo, boolean need_full_buffer)
  24.249 +{
  24.250 +  my_main_ptr main;
  24.251 +  int ci;
  24.252 +  jpeg_component_info *compptr;
  24.253 +
  24.254 +  main = (my_main_ptr)
  24.255 +    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
  24.256 +				SIZEOF(my_main_controller));
  24.257 +  cinfo->main = (struct jpeg_c_main_controller *) main;
  24.258 +  main->pub.start_pass = start_pass_main;
  24.259 +
  24.260 +  /* We don't need to create a buffer in raw-data mode. */
  24.261 +  if (cinfo->raw_data_in)
  24.262 +    return;
  24.263 +
  24.264 +  /* Create the buffer.  It holds downsampled data, so each component
  24.265 +   * may be of a different size.
  24.266 +   */
  24.267 +  if (need_full_buffer) {
  24.268 +#ifdef FULL_MAIN_BUFFER_SUPPORTED
  24.269 +    /* Allocate a full-image virtual array for each component */
  24.270 +    /* Note we pad the bottom to a multiple of the iMCU height */
  24.271 +    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  24.272 +	 ci++, compptr++) {
  24.273 +      main->whole_image[ci] = (*cinfo->mem->request_virt_sarray)
  24.274 +	((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,
  24.275 +	 compptr->width_in_blocks * DCTSIZE,
  24.276 +	 (JDIMENSION) jround_up((long) compptr->height_in_blocks,
  24.277 +				(long) compptr->v_samp_factor) * DCTSIZE,
  24.278 +	 (JDIMENSION) (compptr->v_samp_factor * DCTSIZE));
  24.279 +    }
  24.280 +#else
  24.281 +    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
  24.282 +#endif
  24.283 +  } else {
  24.284 +#ifdef FULL_MAIN_BUFFER_SUPPORTED
  24.285 +    main->whole_image[0] = NULL; /* flag for no virtual arrays */
  24.286 +#endif
  24.287 +    /* Allocate a strip buffer for each component */
  24.288 +    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  24.289 +	 ci++, compptr++) {
  24.290 +      main->buffer[ci] = (*cinfo->mem->alloc_sarray)
  24.291 +	((j_common_ptr) cinfo, JPOOL_IMAGE,
  24.292 +	 compptr->width_in_blocks * DCTSIZE,
  24.293 +	 (JDIMENSION) (compptr->v_samp_factor * DCTSIZE));
  24.294 +    }
  24.295 +  }
  24.296 +}
    25.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    25.2 +++ b/libs/libjpeg/jcmarker.c	Sun Nov 01 00:36:56 2015 +0200
    25.3 @@ -0,0 +1,664 @@
    25.4 +/*
    25.5 + * jcmarker.c
    25.6 + *
    25.7 + * Copyright (C) 1991-1998, Thomas G. Lane.
    25.8 + * This file is part of the Independent JPEG Group's software.
    25.9 + * For conditions of distribution and use, see the accompanying README file.
   25.10 + *
   25.11 + * This file contains routines to write JPEG datastream markers.
   25.12 + */
   25.13 +
   25.14 +#define JPEG_INTERNALS
   25.15 +#include "jinclude.h"
   25.16 +#include "jpeglib.h"
   25.17 +
   25.18 +
   25.19 +typedef enum {			/* JPEG marker codes */
   25.20 +  M_SOF0  = 0xc0,
   25.21 +  M_SOF1  = 0xc1,
   25.22 +  M_SOF2  = 0xc2,
   25.23 +  M_SOF3  = 0xc3,
   25.24 +  
   25.25 +  M_SOF5  = 0xc5,
   25.26 +  M_SOF6  = 0xc6,
   25.27 +  M_SOF7  = 0xc7,
   25.28 +  
   25.29 +  M_JPG   = 0xc8,
   25.30 +  M_SOF9  = 0xc9,
   25.31 +  M_SOF10 = 0xca,
   25.32 +  M_SOF11 = 0xcb,
   25.33 +  
   25.34 +  M_SOF13 = 0xcd,
   25.35 +  M_SOF14 = 0xce,
   25.36 +  M_SOF15 = 0xcf,
   25.37 +  
   25.38 +  M_DHT   = 0xc4,
   25.39 +  
   25.40 +  M_DAC   = 0xcc,
   25.41 +  
   25.42 +  M_RST0  = 0xd0,
   25.43 +  M_RST1  = 0xd1,
   25.44 +  M_RST2  = 0xd2,
   25.45 +  M_RST3  = 0xd3,
   25.46 +  M_RST4  = 0xd4,
   25.47 +  M_RST5  = 0xd5,
   25.48 +  M_RST6  = 0xd6,
   25.49 +  M_RST7  = 0xd7,
   25.50 +  
   25.51 +  M_SOI   = 0xd8,
   25.52 +  M_EOI   = 0xd9,
   25.53 +  M_SOS   = 0xda,
   25.54 +  M_DQT   = 0xdb,
   25.55 +  M_DNL   = 0xdc,
   25.56 +  M_DRI   = 0xdd,
   25.57 +  M_DHP   = 0xde,
   25.58 +  M_EXP   = 0xdf,
   25.59 +  
   25.60 +  M_APP0  = 0xe0,
   25.61 +  M_APP1  = 0xe1,
   25.62 +  M_APP2  = 0xe2,
   25.63 +  M_APP3  = 0xe3,
   25.64 +  M_APP4  = 0xe4,
   25.65 +  M_APP5  = 0xe5,
   25.66 +  M_APP6  = 0xe6,
   25.67 +  M_APP7  = 0xe7,
   25.68 +  M_APP8  = 0xe8,
   25.69 +  M_APP9  = 0xe9,
   25.70 +  M_APP10 = 0xea,
   25.71 +  M_APP11 = 0xeb,
   25.72 +  M_APP12 = 0xec,
   25.73 +  M_APP13 = 0xed,
   25.74 +  M_APP14 = 0xee,
   25.75 +  M_APP15 = 0xef,
   25.76 +  
   25.77 +  M_JPG0  = 0xf0,
   25.78 +  M_JPG13 = 0xfd,
   25.79 +  M_COM   = 0xfe,
   25.80 +  
   25.81 +  M_TEM   = 0x01,
   25.82 +  
   25.83 +  M_ERROR = 0x100
   25.84 +} JPEG_MARKER;
   25.85 +
   25.86 +
   25.87 +/* Private state */
   25.88 +
   25.89 +typedef struct {
   25.90 +  struct jpeg_marker_writer pub; /* public fields */
   25.91 +
   25.92 +  unsigned int last_restart_interval; /* last DRI value emitted; 0 after SOI */
   25.93 +} my_marker_writer;
   25.94 +
   25.95 +typedef my_marker_writer * my_marker_ptr;
   25.96 +
   25.97 +
   25.98 +/*
   25.99 + * Basic output routines.
  25.100 + *
  25.101 + * Note that we do not support suspension while writing a marker.
  25.102 + * Therefore, an application using suspension must ensure that there is
  25.103 + * enough buffer space for the initial markers (typ. 600-700 bytes) before
  25.104 + * calling jpeg_start_compress, and enough space to write the trailing EOI
  25.105 + * (a few bytes) before calling jpeg_finish_compress.  Multipass compression
  25.106 + * modes are not supported at all with suspension, so those two are the only
  25.107 + * points where markers will be written.
  25.108 + */
  25.109 +
  25.110 +LOCAL(void)
  25.111 +emit_byte (j_compress_ptr cinfo, int val)
  25.112 +/* Emit a byte */
  25.113 +{
  25.114 +  struct jpeg_destination_mgr * dest = cinfo->dest;
  25.115 +
  25.116 +  *(dest->next_output_byte)++ = (JOCTET) val;
  25.117 +  if (--dest->free_in_buffer == 0) {
  25.118 +    if (! (*dest->empty_output_buffer) (cinfo))
  25.119 +      ERREXIT(cinfo, JERR_CANT_SUSPEND);
  25.120 +  }
  25.121 +}
  25.122 +
  25.123 +
  25.124 +LOCAL(void)
  25.125 +emit_marker (j_compress_ptr cinfo, JPEG_MARKER mark)
  25.126 +/* Emit a marker code */
  25.127 +{
  25.128 +  emit_byte(cinfo, 0xFF);
  25.129 +  emit_byte(cinfo, (int) mark);
  25.130 +}
  25.131 +
  25.132 +
  25.133 +LOCAL(void)
  25.134 +emit_2bytes (j_compress_ptr cinfo, int value)
  25.135 +/* Emit a 2-byte integer; these are always MSB first in JPEG files */
  25.136 +{
  25.137 +  emit_byte(cinfo, (value >> 8) & 0xFF);
  25.138 +  emit_byte(cinfo, value & 0xFF);
  25.139 +}
  25.140 +
  25.141 +
  25.142 +/*
  25.143 + * Routines to write specific marker types.
  25.144 + */
  25.145 +
  25.146 +LOCAL(int)
  25.147 +emit_dqt (j_compress_ptr cinfo, int index)
  25.148 +/* Emit a DQT marker */
  25.149 +/* Returns the precision used (0 = 8bits, 1 = 16bits) for baseline checking */
  25.150 +{
  25.151 +  JQUANT_TBL * qtbl = cinfo->quant_tbl_ptrs[index];
  25.152 +  int prec;
  25.153 +  int i;
  25.154 +
  25.155 +  if (qtbl == NULL)
  25.156 +    ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, index);
  25.157 +
  25.158 +  prec = 0;
  25.159 +  for (i = 0; i < DCTSIZE2; i++) {
  25.160 +    if (qtbl->quantval[i] > 255)
  25.161 +      prec = 1;
  25.162 +  }
  25.163 +
  25.164 +  if (! qtbl->sent_table) {
  25.165 +    emit_marker(cinfo, M_DQT);
  25.166 +
  25.167 +    emit_2bytes(cinfo, prec ? DCTSIZE2*2 + 1 + 2 : DCTSIZE2 + 1 + 2);
  25.168 +
  25.169 +    emit_byte(cinfo, index + (prec<<4));
  25.170 +
  25.171 +    for (i = 0; i < DCTSIZE2; i++) {
  25.172 +      /* The table entries must be emitted in zigzag order. */
  25.173 +      unsigned int qval = qtbl->quantval[jpeg_natural_order[i]];
  25.174 +      if (prec)
  25.175 +	emit_byte(cinfo, (int) (qval >> 8));
  25.176 +      emit_byte(cinfo, (int) (qval & 0xFF));
  25.177 +    }
  25.178 +
  25.179 +    qtbl->sent_table = TRUE;
  25.180 +  }
  25.181 +
  25.182 +  return prec;
  25.183 +}
  25.184 +
  25.185 +
  25.186 +LOCAL(void)
  25.187 +emit_dht (j_compress_ptr cinfo, int index, boolean is_ac)
  25.188 +/* Emit a DHT marker */
  25.189 +{
  25.190 +  JHUFF_TBL * htbl;
  25.191 +  int length, i;
  25.192 +  
  25.193 +  if (is_ac) {
  25.194 +    htbl = cinfo->ac_huff_tbl_ptrs[index];
  25.195 +    index += 0x10;		/* output index has AC bit set */
  25.196 +  } else {
  25.197 +    htbl = cinfo->dc_huff_tbl_ptrs[index];
  25.198 +  }
  25.199 +
  25.200 +  if (htbl == NULL)
  25.201 +    ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, index);
  25.202 +  
  25.203 +  if (! htbl->sent_table) {
  25.204 +    emit_marker(cinfo, M_DHT);
  25.205 +    
  25.206 +    length = 0;
  25.207 +    for (i = 1; i <= 16; i++)
  25.208 +      length += htbl->bits[i];
  25.209 +    
  25.210 +    emit_2bytes(cinfo, length + 2 + 1 + 16);
  25.211 +    emit_byte(cinfo, index);
  25.212 +    
  25.213 +    for (i = 1; i <= 16; i++)
  25.214 +      emit_byte(cinfo, htbl->bits[i]);
  25.215 +    
  25.216 +    for (i = 0; i < length; i++)
  25.217 +      emit_byte(cinfo, htbl->huffval[i]);
  25.218 +    
  25.219 +    htbl->sent_table = TRUE;
  25.220 +  }
  25.221 +}
  25.222 +
  25.223 +
  25.224 +LOCAL(void)
  25.225 +emit_dac (j_compress_ptr cinfo)
  25.226 +/* Emit a DAC marker */
  25.227 +/* Since the useful info is so small, we want to emit all the tables in */
  25.228 +/* one DAC marker.  Therefore this routine does its own scan of the table. */
  25.229 +{
  25.230 +#ifdef C_ARITH_CODING_SUPPORTED
  25.231 +  char dc_in_use[NUM_ARITH_TBLS];
  25.232 +  char ac_in_use[NUM_ARITH_TBLS];
  25.233 +  int length, i;
  25.234 +  jpeg_component_info *compptr;
  25.235 +  
  25.236 +  for (i = 0; i < NUM_ARITH_TBLS; i++)
  25.237 +    dc_in_use[i] = ac_in_use[i] = 0;
  25.238 +  
  25.239 +  for (i = 0; i < cinfo->comps_in_scan; i++) {
  25.240 +    compptr = cinfo->cur_comp_info[i];
  25.241 +    dc_in_use[compptr->dc_tbl_no] = 1;
  25.242 +    ac_in_use[compptr->ac_tbl_no] = 1;
  25.243 +  }
  25.244 +  
  25.245 +  length = 0;
  25.246 +  for (i = 0; i < NUM_ARITH_TBLS; i++)
  25.247 +    length += dc_in_use[i] + ac_in_use[i];
  25.248 +  
  25.249 +  emit_marker(cinfo, M_DAC);
  25.250 +  
  25.251 +  emit_2bytes(cinfo, length*2 + 2);
  25.252 +  
  25.253 +  for (i = 0; i < NUM_ARITH_TBLS; i++) {
  25.254 +    if (dc_in_use[i]) {
  25.255 +      emit_byte(cinfo, i);
  25.256 +      emit_byte(cinfo, cinfo->arith_dc_L[i] + (cinfo->arith_dc_U[i]<<4));
  25.257 +    }
  25.258 +    if (ac_in_use[i]) {
  25.259 +      emit_byte(cinfo, i + 0x10);
  25.260 +      emit_byte(cinfo, cinfo->arith_ac_K[i]);
  25.261 +    }
  25.262 +  }
  25.263 +#endif /* C_ARITH_CODING_SUPPORTED */
  25.264 +}
  25.265 +
  25.266 +
  25.267 +LOCAL(void)
  25.268 +emit_dri (j_compress_ptr cinfo)
  25.269 +/* Emit a DRI marker */
  25.270 +{
  25.271 +  emit_marker(cinfo, M_DRI);
  25.272 +  
  25.273 +  emit_2bytes(cinfo, 4);	/* fixed length */
  25.274 +
  25.275 +  emit_2bytes(cinfo, (int) cinfo->restart_interval);
  25.276 +}
  25.277 +
  25.278 +
  25.279 +LOCAL(void)
  25.280 +emit_sof (j_compress_ptr cinfo, JPEG_MARKER code)
  25.281 +/* Emit a SOF marker */
  25.282 +{
  25.283 +  int ci;
  25.284 +  jpeg_component_info *compptr;
  25.285 +  
  25.286 +  emit_marker(cinfo, code);
  25.287 +  
  25.288 +  emit_2bytes(cinfo, 3 * cinfo->num_components + 2 + 5 + 1); /* length */
  25.289 +
  25.290 +  /* Make sure image isn't bigger than SOF field can handle */
  25.291 +  if ((long) cinfo->image_height > 65535L ||
  25.292 +      (long) cinfo->image_width > 65535L)
  25.293 +    ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) 65535);
  25.294 +
  25.295 +  emit_byte(cinfo, cinfo->data_precision);
  25.296 +  emit_2bytes(cinfo, (int) cinfo->image_height);
  25.297 +  emit_2bytes(cinfo, (int) cinfo->image_width);
  25.298 +
  25.299 +  emit_byte(cinfo, cinfo->num_components);
  25.300 +
  25.301 +  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  25.302 +       ci++, compptr++) {
  25.303 +    emit_byte(cinfo, compptr->component_id);
  25.304 +    emit_byte(cinfo, (compptr->h_samp_factor << 4) + compptr->v_samp_factor);
  25.305 +    emit_byte(cinfo, compptr->quant_tbl_no);
  25.306 +  }
  25.307 +}
  25.308 +
  25.309 +
  25.310 +LOCAL(void)
  25.311 +emit_sos (j_compress_ptr cinfo)
  25.312 +/* Emit a SOS marker */
  25.313 +{
  25.314 +  int i, td, ta;
  25.315 +  jpeg_component_info *compptr;
  25.316 +  
  25.317 +  emit_marker(cinfo, M_SOS);
  25.318 +  
  25.319 +  emit_2bytes(cinfo, 2 * cinfo->comps_in_scan + 2 + 1 + 3); /* length */
  25.320 +  
  25.321 +  emit_byte(cinfo, cinfo->comps_in_scan);
  25.322 +  
  25.323 +  for (i = 0; i < cinfo->comps_in_scan; i++) {
  25.324 +    compptr = cinfo->cur_comp_info[i];
  25.325 +    emit_byte(cinfo, compptr->component_id);
  25.326 +    td = compptr->dc_tbl_no;
  25.327 +    ta = compptr->ac_tbl_no;
  25.328 +    if (cinfo->progressive_mode) {
  25.329 +      /* Progressive mode: only DC or only AC tables are used in one scan;
  25.330 +       * furthermore, Huffman coding of DC refinement uses no table at all.
  25.331 +       * We emit 0 for unused field(s); this is recommended by the P&M text
  25.332 +       * but does not seem to be specified in the standard.
  25.333 +       */
  25.334 +      if (cinfo->Ss == 0) {
  25.335 +	ta = 0;			/* DC scan */
  25.336 +	if (cinfo->Ah != 0 && !cinfo->arith_code)
  25.337 +	  td = 0;		/* no DC table either */
  25.338 +      } else {
  25.339 +	td = 0;			/* AC scan */
  25.340 +      }
  25.341 +    }
  25.342 +    emit_byte(cinfo, (td << 4) + ta);
  25.343 +  }
  25.344 +
  25.345 +  emit_byte(cinfo, cinfo->Ss);
  25.346 +  emit_byte(cinfo, cinfo->Se);
  25.347 +  emit_byte(cinfo, (cinfo->Ah << 4) + cinfo->Al);
  25.348 +}
  25.349 +
  25.350 +
  25.351 +LOCAL(void)
  25.352 +emit_jfif_app0 (j_compress_ptr cinfo)
  25.353 +/* Emit a JFIF-compliant APP0 marker */
  25.354 +{
  25.355 +  /*
  25.356 +   * Length of APP0 block	(2 bytes)
  25.357 +   * Block ID			(4 bytes - ASCII "JFIF")
  25.358 +   * Zero byte			(1 byte to terminate the ID string)
  25.359 +   * Version Major, Minor	(2 bytes - major first)
  25.360 +   * Units			(1 byte - 0x00 = none, 0x01 = inch, 0x02 = cm)
  25.361 +   * Xdpu			(2 bytes - dots per unit horizontal)
  25.362 +   * Ydpu			(2 bytes - dots per unit vertical)
  25.363 +   * Thumbnail X size		(1 byte)
  25.364 +   * Thumbnail Y size		(1 byte)
  25.365 +   */
  25.366 +  
  25.367 +  emit_marker(cinfo, M_APP0);
  25.368 +  
  25.369 +  emit_2bytes(cinfo, 2 + 4 + 1 + 2 + 1 + 2 + 2 + 1 + 1); /* length */
  25.370 +
  25.371 +  emit_byte(cinfo, 0x4A);	/* Identifier: ASCII "JFIF" */
  25.372 +  emit_byte(cinfo, 0x46);
  25.373 +  emit_byte(cinfo, 0x49);
  25.374 +  emit_byte(cinfo, 0x46);
  25.375 +  emit_byte(cinfo, 0);
  25.376 +  emit_byte(cinfo, cinfo->JFIF_major_version); /* Version fields */
  25.377 +  emit_byte(cinfo, cinfo->JFIF_minor_version);
  25.378 +  emit_byte(cinfo, cinfo->density_unit); /* Pixel size information */
  25.379 +  emit_2bytes(cinfo, (int) cinfo->X_density);
  25.380 +  emit_2bytes(cinfo, (int) cinfo->Y_density);
  25.381 +  emit_byte(cinfo, 0);		/* No thumbnail image */
  25.382 +  emit_byte(cinfo, 0);
  25.383 +}
  25.384 +
  25.385 +
  25.386 +LOCAL(void)
  25.387 +emit_adobe_app14 (j_compress_ptr cinfo)
  25.388 +/* Emit an Adobe APP14 marker */
  25.389 +{
  25.390 +  /*
  25.391 +   * Length of APP14 block	(2 bytes)
  25.392 +   * Block ID			(5 bytes - ASCII "Adobe")
  25.393 +   * Version Number		(2 bytes - currently 100)
  25.394 +   * Flags0			(2 bytes - currently 0)
  25.395 +   * Flags1			(2 bytes - currently 0)
  25.396 +   * Color transform		(1 byte)
  25.397 +   *
  25.398 +   * Although Adobe TN 5116 mentions Version = 101, all the Adobe files
  25.399 +   * now in circulation seem to use Version = 100, so that's what we write.
  25.400 +   *
  25.401 +   * We write the color transform byte as 1 if the JPEG color space is
  25.402 +   * YCbCr, 2 if it's YCCK, 0 otherwise.  Adobe's definition has to do with
  25.403 +   * whether the encoder performed a transformation, which is pretty useless.
  25.404 +   */
  25.405 +  
  25.406 +  emit_marker(cinfo, M_APP14);
  25.407 +  
  25.408 +  emit_2bytes(cinfo, 2 + 5 + 2 + 2 + 2 + 1); /* length */
  25.409 +
  25.410 +  emit_byte(cinfo, 0x41);	/* Identifier: ASCII "Adobe" */
  25.411 +  emit_byte(cinfo, 0x64);
  25.412 +  emit_byte(cinfo, 0x6F);
  25.413 +  emit_byte(cinfo, 0x62);
  25.414 +  emit_byte(cinfo, 0x65);
  25.415 +  emit_2bytes(cinfo, 100);	/* Version */
  25.416 +  emit_2bytes(cinfo, 0);	/* Flags0 */
  25.417 +  emit_2bytes(cinfo, 0);	/* Flags1 */
  25.418 +  switch (cinfo->jpeg_color_space) {
  25.419 +  case JCS_YCbCr:
  25.420 +    emit_byte(cinfo, 1);	/* Color transform = 1 */
  25.421 +    break;
  25.422 +  case JCS_YCCK:
  25.423 +    emit_byte(cinfo, 2);	/* Color transform = 2 */
  25.424 +    break;
  25.425 +  default:
  25.426 +    emit_byte(cinfo, 0);	/* Color transform = 0 */
  25.427 +    break;
  25.428 +  }
  25.429 +}
  25.430 +
  25.431 +
  25.432 +/*
  25.433 + * These routines allow writing an arbitrary marker with parameters.
  25.434 + * The only intended use is to emit COM or APPn markers after calling
  25.435 + * write_file_header and before calling write_frame_header.
  25.436 + * Other uses are not guaranteed to produce desirable results.
  25.437 + * Counting the parameter bytes properly is the caller's responsibility.
  25.438 + */
  25.439 +
  25.440 +METHODDEF(void)
  25.441 +write_marker_header (j_compress_ptr cinfo, int marker, unsigned int datalen)
  25.442 +/* Emit an arbitrary marker header */
  25.443 +{
  25.444 +  if (datalen > (unsigned int) 65533)		/* safety check */
  25.445 +    ERREXIT(cinfo, JERR_BAD_LENGTH);
  25.446 +
  25.447 +  emit_marker(cinfo, (JPEG_MARKER) marker);
  25.448 +
  25.449 +  emit_2bytes(cinfo, (int) (datalen + 2));	/* total length */
  25.450 +}
  25.451 +
  25.452 +METHODDEF(void)
  25.453 +write_marker_byte (j_compress_ptr cinfo, int val)
  25.454 +/* Emit one byte of marker parameters following write_marker_header */
  25.455 +{
  25.456 +  emit_byte(cinfo, val);
  25.457 +}
  25.458 +
  25.459 +
  25.460 +/*
  25.461 + * Write datastream header.
  25.462 + * This consists of an SOI and optional APPn markers.
  25.463 + * We recommend use of the JFIF marker, but not the Adobe marker,
  25.464 + * when using YCbCr or grayscale data.  The JFIF marker should NOT
  25.465 + * be used for any other JPEG colorspace.  The Adobe marker is helpful
  25.466 + * to distinguish RGB, CMYK, and YCCK colorspaces.
  25.467 + * Note that an application can write additional header markers after
  25.468 + * jpeg_start_compress returns.
  25.469 + */
  25.470 +
  25.471 +METHODDEF(void)
  25.472 +write_file_header (j_compress_ptr cinfo)
  25.473 +{
  25.474 +  my_marker_ptr marker = (my_marker_ptr) cinfo->marker;
  25.475 +
  25.476 +  emit_marker(cinfo, M_SOI);	/* first the SOI */
  25.477 +
  25.478 +  /* SOI is defined to reset restart interval to 0 */
  25.479 +  marker->last_restart_interval = 0;
  25.480 +
  25.481 +  if (cinfo->write_JFIF_header)	/* next an optional JFIF APP0 */
  25.482 +    emit_jfif_app0(cinfo);
  25.483 +  if (cinfo->write_Adobe_marker) /* next an optional Adobe APP14 */
  25.484 +    emit_adobe_app14(cinfo);
  25.485 +}
  25.486 +
  25.487 +
  25.488 +/*
  25.489 + * Write frame header.
  25.490 + * This consists of DQT and SOFn markers.
  25.491 + * Note that we do not emit the SOF until we have emitted the DQT(s).
  25.492 + * This avoids compatibility problems with incorrect implementations that
  25.493 + * try to error-check the quant table numbers as soon as they see the SOF.
  25.494 + */
  25.495 +
  25.496 +METHODDEF(void)
  25.497 +write_frame_header (j_compress_ptr cinfo)
  25.498 +{
  25.499 +  int ci, prec;
  25.500 +  boolean is_baseline;
  25.501 +  jpeg_component_info *compptr;
  25.502 +  
  25.503 +  /* Emit DQT for each quantization table.
  25.504 +   * Note that emit_dqt() suppresses any duplicate tables.
  25.505 +   */
  25.506 +  prec = 0;
  25.507 +  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  25.508 +       ci++, compptr++) {
  25.509 +    prec += emit_dqt(cinfo, compptr->quant_tbl_no);
  25.510 +  }
  25.511 +  /* now prec is nonzero iff there are any 16-bit quant tables. */
  25.512 +
  25.513 +  /* Check for a non-baseline specification.
  25.514 +   * Note we assume that Huffman table numbers won't be changed later.
  25.515 +   */
  25.516 +  if (cinfo->arith_code || cinfo->progressive_mode ||
  25.517 +      cinfo->data_precision != 8) {
  25.518 +    is_baseline = FALSE;
  25.519 +  } else {
  25.520 +    is_baseline = TRUE;
  25.521 +    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  25.522 +	 ci++, compptr++) {
  25.523 +      if (compptr->dc_tbl_no > 1 || compptr->ac_tbl_no > 1)
  25.524 +	is_baseline = FALSE;
  25.525 +    }
  25.526 +    if (prec && is_baseline) {
  25.527 +      is_baseline = FALSE;
  25.528 +      /* If it's baseline except for quantizer size, warn the user */
  25.529 +      TRACEMS(cinfo, 0, JTRC_16BIT_TABLES);
  25.530 +    }
  25.531 +  }
  25.532 +
  25.533 +  /* Emit the proper SOF marker */
  25.534 +  if (cinfo->arith_code) {
  25.535 +    emit_sof(cinfo, M_SOF9);	/* SOF code for arithmetic coding */
  25.536 +  } else {
  25.537 +    if (cinfo->progressive_mode)
  25.538 +      emit_sof(cinfo, M_SOF2);	/* SOF code for progressive Huffman */
  25.539 +    else if (is_baseline)
  25.540 +      emit_sof(cinfo, M_SOF0);	/* SOF code for baseline implementation */
  25.541 +    else
  25.542 +      emit_sof(cinfo, M_SOF1);	/* SOF code for non-baseline Huffman file */
  25.543 +  }
  25.544 +}
  25.545 +
  25.546 +
  25.547 +/*
  25.548 + * Write scan header.
  25.549 + * This consists of DHT or DAC markers, optional DRI, and SOS.
  25.550 + * Compressed data will be written following the SOS.
  25.551 + */
  25.552 +
  25.553 +METHODDEF(void)
  25.554 +write_scan_header (j_compress_ptr cinfo)
  25.555 +{
  25.556 +  my_marker_ptr marker = (my_marker_ptr) cinfo->marker;
  25.557 +  int i;
  25.558 +  jpeg_component_info *compptr;
  25.559 +
  25.560 +  if (cinfo->arith_code) {
  25.561 +    /* Emit arith conditioning info.  We may have some duplication
  25.562 +     * if the file has multiple scans, but it's so small it's hardly
  25.563 +     * worth worrying about.
  25.564 +     */
  25.565 +    emit_dac(cinfo);
  25.566 +  } else {
  25.567 +    /* Emit Huffman tables.
  25.568 +     * Note that emit_dht() suppresses any duplicate tables.
  25.569 +     */
  25.570 +    for (i = 0; i < cinfo->comps_in_scan; i++) {
  25.571 +      compptr = cinfo->cur_comp_info[i];
  25.572 +      if (cinfo->progressive_mode) {
  25.573 +	/* Progressive mode: only DC or only AC tables are used in one scan */
  25.574 +	if (cinfo->Ss == 0) {
  25.575 +	  if (cinfo->Ah == 0)	/* DC needs no table for refinement scan */
  25.576 +	    emit_dht(cinfo, compptr->dc_tbl_no, FALSE);
  25.577 +	} else {
  25.578 +	  emit_dht(cinfo, compptr->ac_tbl_no, TRUE);
  25.579 +	}
  25.580 +      } else {
  25.581 +	/* Sequential mode: need both DC and AC tables */
  25.582 +	emit_dht(cinfo, compptr->dc_tbl_no, FALSE);
  25.583 +	emit_dht(cinfo, compptr->ac_tbl_no, TRUE);
  25.584 +      }
  25.585 +    }
  25.586 +  }
  25.587 +
  25.588 +  /* Emit DRI if required --- note that DRI value could change for each scan.
  25.589 +   * We avoid wasting space with unnecessary DRIs, however.
  25.590 +   */
  25.591 +  if (cinfo->restart_interval != marker->last_restart_interval) {
  25.592 +    emit_dri(cinfo);
  25.593 +    marker->last_restart_interval = cinfo->restart_interval;
  25.594 +  }
  25.595 +
  25.596 +  emit_sos(cinfo);
  25.597 +}
  25.598 +
  25.599 +
  25.600 +/*
  25.601 + * Write datastream trailer.
  25.602 + */
  25.603 +
  25.604 +METHODDEF(void)
  25.605 +write_file_trailer (j_compress_ptr cinfo)
  25.606 +{
  25.607 +  emit_marker(cinfo, M_EOI);
  25.608 +}
  25.609 +
  25.610 +
  25.611 +/*
  25.612 + * Write an abbreviated table-specification datastream.
  25.613 + * This consists of SOI, DQT and DHT tables, and EOI.
  25.614 + * Any table that is defined and not marked sent_table = TRUE will be
  25.615 + * emitted.  Note that all tables will be marked sent_table = TRUE at exit.
  25.616 + */
  25.617 +
  25.618 +METHODDEF(void)
  25.619 +write_tables_only (j_compress_ptr cinfo)
  25.620 +{
  25.621 +  int i;
  25.622 +
  25.623 +  emit_marker(cinfo, M_SOI);
  25.624 +
  25.625 +  for (i = 0; i < NUM_QUANT_TBLS; i++) {
  25.626 +    if (cinfo->quant_tbl_ptrs[i] != NULL)
  25.627 +      (void) emit_dqt(cinfo, i);
  25.628 +  }
  25.629 +
  25.630 +  if (! cinfo->arith_code) {
  25.631 +    for (i = 0; i < NUM_HUFF_TBLS; i++) {
  25.632 +      if (cinfo->dc_huff_tbl_ptrs[i] != NULL)
  25.633 +	emit_dht(cinfo, i, FALSE);
  25.634 +      if (cinfo->ac_huff_tbl_ptrs[i] != NULL)
  25.635 +	emit_dht(cinfo, i, TRUE);
  25.636 +    }
  25.637 +  }
  25.638 +
  25.639 +  emit_marker(cinfo, M_EOI);
  25.640 +}
  25.641 +
  25.642 +
  25.643 +/*
  25.644 + * Initialize the marker writer module.
  25.645 + */
  25.646 +
  25.647 +GLOBAL(void)
  25.648 +jinit_marker_writer (j_compress_ptr cinfo)
  25.649 +{
  25.650 +  my_marker_ptr marker;
  25.651 +
  25.652 +  /* Create the subobject */
  25.653 +  marker = (my_marker_ptr)
  25.654 +    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
  25.655 +				SIZEOF(my_marker_writer));
  25.656 +  cinfo->marker = (struct jpeg_marker_writer *) marker;
  25.657 +  /* Initialize method pointers */
  25.658 +  marker->pub.write_file_header = write_file_header;
  25.659 +  marker->pub.write_frame_header = write_frame_header;
  25.660 +  marker->pub.write_scan_header = write_scan_header;
  25.661 +  marker->pub.write_file_trailer = write_file_trailer;
  25.662 +  marker->pub.write_tables_only = write_tables_only;
  25.663 +  marker->pub.write_marker_header = write_marker_header;
  25.664 +  marker->pub.write_marker_byte = write_marker_byte;
  25.665 +  /* Initialize private state */
  25.666 +  marker->last_restart_interval = 0;
  25.667 +}
    26.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    26.2 +++ b/libs/libjpeg/jcmaster.c	Sun Nov 01 00:36:56 2015 +0200
    26.3 @@ -0,0 +1,590 @@
    26.4 +/*
    26.5 + * jcmaster.c
    26.6 + *
    26.7 + * Copyright (C) 1991-1997, Thomas G. Lane.
    26.8 + * This file is part of the Independent JPEG Group's software.
    26.9 + * For conditions of distribution and use, see the accompanying README file.
   26.10 + *
   26.11 + * This file contains master control logic for the JPEG compressor.
   26.12 + * These routines are concerned with parameter validation, initial setup,
   26.13 + * and inter-pass control (determining the number of passes and the work 
   26.14 + * to be done in each pass).
   26.15 + */
   26.16 +
   26.17 +#define JPEG_INTERNALS
   26.18 +#include "jinclude.h"
   26.19 +#include "jpeglib.h"
   26.20 +
   26.21 +
   26.22 +/* Private state */
   26.23 +
   26.24 +typedef enum {
   26.25 +	main_pass,		/* input data, also do first output step */
   26.26 +	huff_opt_pass,		/* Huffman code optimization pass */
   26.27 +	output_pass		/* data output pass */
   26.28 +} c_pass_type;
   26.29 +
   26.30 +typedef struct {
   26.31 +  struct jpeg_comp_master pub;	/* public fields */
   26.32 +
   26.33 +  c_pass_type pass_type;	/* the type of the current pass */
   26.34 +
   26.35 +  int pass_number;		/* # of passes completed */
   26.36 +  int total_passes;		/* total # of passes needed */
   26.37 +
   26.38 +  int scan_number;		/* current index in scan_info[] */
   26.39 +} my_comp_master;
   26.40 +
   26.41 +typedef my_comp_master * my_master_ptr;
   26.42 +
   26.43 +
   26.44 +/*
   26.45 + * Support routines that do various essential calculations.
   26.46 + */
   26.47 +
   26.48 +LOCAL(void)
   26.49 +initial_setup (j_compress_ptr cinfo)
   26.50 +/* Do computations that are needed before master selection phase */
   26.51 +{
   26.52 +  int ci;
   26.53 +  jpeg_component_info *compptr;
   26.54 +  long samplesperrow;
   26.55 +  JDIMENSION jd_samplesperrow;
   26.56 +
   26.57 +  /* Sanity check on image dimensions */
   26.58 +  if (cinfo->image_height <= 0 || cinfo->image_width <= 0
   26.59 +      || cinfo->num_components <= 0 || cinfo->input_components <= 0)
   26.60 +    ERREXIT(cinfo, JERR_EMPTY_IMAGE);
   26.61 +
   26.62 +  /* Make sure image isn't bigger than I can handle */
   26.63 +  if ((long) cinfo->image_height > (long) JPEG_MAX_DIMENSION ||
   26.64 +      (long) cinfo->image_width > (long) JPEG_MAX_DIMENSION)
   26.65 +    ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION);
   26.66 +
   26.67 +  /* Width of an input scanline must be representable as JDIMENSION. */
   26.68 +  samplesperrow = (long) cinfo->image_width * (long) cinfo->input_components;
   26.69 +  jd_samplesperrow = (JDIMENSION) samplesperrow;
   26.70 +  if ((long) jd_samplesperrow != samplesperrow)
   26.71 +    ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
   26.72 +
   26.73 +  /* For now, precision must match compiled-in value... */
   26.74 +  if (cinfo->data_precision != BITS_IN_JSAMPLE)
   26.75 +    ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);
   26.76 +
   26.77 +  /* Check that number of components won't exceed internal array sizes */
   26.78 +  if (cinfo->num_components > MAX_COMPONENTS)
   26.79 +    ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,
   26.80 +	     MAX_COMPONENTS);
   26.81 +
   26.82 +  /* Compute maximum sampling factors; check factor validity */
   26.83 +  cinfo->max_h_samp_factor = 1;
   26.84 +  cinfo->max_v_samp_factor = 1;
   26.85 +  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
   26.86 +       ci++, compptr++) {
   26.87 +    if (compptr->h_samp_factor<=0 || compptr->h_samp_factor>MAX_SAMP_FACTOR ||
   26.88 +	compptr->v_samp_factor<=0 || compptr->v_samp_factor>MAX_SAMP_FACTOR)
   26.89 +      ERREXIT(cinfo, JERR_BAD_SAMPLING);
   26.90 +    cinfo->max_h_samp_factor = MAX(cinfo->max_h_samp_factor,
   26.91 +				   compptr->h_samp_factor);
   26.92 +    cinfo->max_v_samp_factor = MAX(cinfo->max_v_samp_factor,
   26.93 +				   compptr->v_samp_factor);
   26.94 +  }
   26.95 +
   26.96 +  /* Compute dimensions of components */
   26.97 +  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
   26.98 +       ci++, compptr++) {
   26.99 +    /* Fill in the correct component_index value; don't rely on application */
  26.100 +    compptr->component_index = ci;
  26.101 +    /* For compression, we never do DCT scaling. */
  26.102 +    compptr->DCT_scaled_size = DCTSIZE;
  26.103 +    /* Size in DCT blocks */
  26.104 +    compptr->width_in_blocks = (JDIMENSION)
  26.105 +      jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor,
  26.106 +		    (long) (cinfo->max_h_samp_factor * DCTSIZE));
  26.107 +    compptr->height_in_blocks = (JDIMENSION)
  26.108 +      jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor,
  26.109 +		    (long) (cinfo->max_v_samp_factor * DCTSIZE));
  26.110 +    /* Size in samples */
  26.111 +    compptr->downsampled_width = (JDIMENSION)
  26.112 +      jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor,
  26.113 +		    (long) cinfo->max_h_samp_factor);
  26.114 +    compptr->downsampled_height = (JDIMENSION)
  26.115 +      jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor,
  26.116 +		    (long) cinfo->max_v_samp_factor);
  26.117 +    /* Mark component needed (this flag isn't actually used for compression) */
  26.118 +    compptr->component_needed = TRUE;
  26.119 +  }
  26.120 +
  26.121 +  /* Compute number of fully interleaved MCU rows (number of times that
  26.122 +   * main controller will call coefficient controller).
  26.123 +   */
  26.124 +  cinfo->total_iMCU_rows = (JDIMENSION)
  26.125 +    jdiv_round_up((long) cinfo->image_height,
  26.126 +		  (long) (cinfo->max_v_samp_factor*DCTSIZE));
  26.127 +}
  26.128 +
  26.129 +
  26.130 +#ifdef C_MULTISCAN_FILES_SUPPORTED
  26.131 +
  26.132 +LOCAL(void)
  26.133 +validate_script (j_compress_ptr cinfo)
  26.134 +/* Verify that the scan script in cinfo->scan_info[] is valid; also
  26.135 + * determine whether it uses progressive JPEG, and set cinfo->progressive_mode.
  26.136 + */
  26.137 +{
  26.138 +  const jpeg_scan_info * scanptr;
  26.139 +  int scanno, ncomps, ci, coefi, thisi;
  26.140 +  int Ss, Se, Ah, Al;
  26.141 +  boolean component_sent[MAX_COMPONENTS];
  26.142 +#ifdef C_PROGRESSIVE_SUPPORTED
  26.143 +  int * last_bitpos_ptr;
  26.144 +  int last_bitpos[MAX_COMPONENTS][DCTSIZE2];
  26.145 +  /* -1 until that coefficient has been seen; then last Al for it */
  26.146 +#endif
  26.147 +
  26.148 +  if (cinfo->num_scans <= 0)
  26.149 +    ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, 0);
  26.150 +
  26.151 +  /* For sequential JPEG, all scans must have Ss=0, Se=DCTSIZE2-1;
  26.152 +   * for progressive JPEG, no scan can have this.
  26.153 +   */
  26.154 +  scanptr = cinfo->scan_info;
  26.155 +  if (scanptr->Ss != 0 || scanptr->Se != DCTSIZE2-1) {
  26.156 +#ifdef C_PROGRESSIVE_SUPPORTED
  26.157 +    cinfo->progressive_mode = TRUE;
  26.158 +    last_bitpos_ptr = & last_bitpos[0][0];
  26.159 +    for (ci = 0; ci < cinfo->num_components; ci++) 
  26.160 +      for (coefi = 0; coefi < DCTSIZE2; coefi++)
  26.161 +	*last_bitpos_ptr++ = -1;
  26.162 +#else
  26.163 +    ERREXIT(cinfo, JERR_NOT_COMPILED);
  26.164 +#endif
  26.165 +  } else {
  26.166 +    cinfo->progressive_mode = FALSE;
  26.167 +    for (ci = 0; ci < cinfo->num_components; ci++) 
  26.168 +      component_sent[ci] = FALSE;
  26.169 +  }
  26.170 +
  26.171 +  for (scanno = 1; scanno <= cinfo->num_scans; scanptr++, scanno++) {
  26.172 +    /* Validate component indexes */
  26.173 +    ncomps = scanptr->comps_in_scan;
  26.174 +    if (ncomps <= 0 || ncomps > MAX_COMPS_IN_SCAN)
  26.175 +      ERREXIT2(cinfo, JERR_COMPONENT_COUNT, ncomps, MAX_COMPS_IN_SCAN);
  26.176 +    for (ci = 0; ci < ncomps; ci++) {
  26.177 +      thisi = scanptr->component_index[ci];
  26.178 +      if (thisi < 0 || thisi >= cinfo->num_components)
  26.179 +	ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno);
  26.180 +      /* Components must appear in SOF order within each scan */
  26.181 +      if (ci > 0 && thisi <= scanptr->component_index[ci-1])
  26.182 +	ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno);
  26.183 +    }
  26.184 +    /* Validate progression parameters */
  26.185 +    Ss = scanptr->Ss;
  26.186 +    Se = scanptr->Se;
  26.187 +    Ah = scanptr->Ah;
  26.188 +    Al = scanptr->Al;
  26.189 +    if (cinfo->progressive_mode) {
  26.190 +#ifdef C_PROGRESSIVE_SUPPORTED
  26.191 +      /* The JPEG spec simply gives the ranges 0..13 for Ah and Al, but that
  26.192 +       * seems wrong: the upper bound ought to depend on data precision.
  26.193 +       * Perhaps they really meant 0..N+1 for N-bit precision.
  26.194 +       * Here we allow 0..10 for 8-bit data; Al larger than 10 results in
  26.195 +       * out-of-range reconstructed DC values during the first DC scan,
  26.196 +       * which might cause problems for some decoders.
  26.197 +       */
  26.198 +#if BITS_IN_JSAMPLE == 8
  26.199 +#define MAX_AH_AL 10
  26.200 +#else
  26.201 +#define MAX_AH_AL 13
  26.202 +#endif
  26.203 +      if (Ss < 0 || Ss >= DCTSIZE2 || Se < Ss || Se >= DCTSIZE2 ||
  26.204 +	  Ah < 0 || Ah > MAX_AH_AL || Al < 0 || Al > MAX_AH_AL)
  26.205 +	ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
  26.206 +      if (Ss == 0) {
  26.207 +	if (Se != 0)		/* DC and AC together not OK */
  26.208 +	  ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
  26.209 +      } else {
  26.210 +	if (ncomps != 1)	/* AC scans must be for only one component */
  26.211 +	  ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
  26.212 +      }
  26.213 +      for (ci = 0; ci < ncomps; ci++) {
  26.214 +	last_bitpos_ptr = & last_bitpos[scanptr->component_index[ci]][0];
  26.215 +	if (Ss != 0 && last_bitpos_ptr[0] < 0) /* AC without prior DC scan */
  26.216 +	  ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
  26.217 +	for (coefi = Ss; coefi <= Se; coefi++) {
  26.218 +	  if (last_bitpos_ptr[coefi] < 0) {
  26.219 +	    /* first scan of this coefficient */
  26.220 +	    if (Ah != 0)
  26.221 +	      ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
  26.222 +	  } else {
  26.223 +	    /* not first scan */
  26.224 +	    if (Ah != last_bitpos_ptr[coefi] || Al != Ah-1)
  26.225 +	      ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
  26.226 +	  }
  26.227 +	  last_bitpos_ptr[coefi] = Al;
  26.228 +	}
  26.229 +      }
  26.230 +#endif
  26.231 +    } else {
  26.232 +      /* For sequential JPEG, all progression parameters must be these: */
  26.233 +      if (Ss != 0 || Se != DCTSIZE2-1 || Ah != 0 || Al != 0)
  26.234 +	ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
  26.235 +      /* Make sure components are not sent twice */
  26.236 +      for (ci = 0; ci < ncomps; ci++) {
  26.237 +	thisi = scanptr->component_index[ci];
  26.238 +	if (component_sent[thisi])
  26.239 +	  ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno);
  26.240 +	component_sent[thisi] = TRUE;
  26.241 +      }
  26.242 +    }
  26.243 +  }
  26.244 +
  26.245 +  /* Now verify that everything got sent. */
  26.246 +  if (cinfo->progressive_mode) {
  26.247 +#ifdef C_PROGRESSIVE_SUPPORTED
  26.248 +    /* For progressive mode, we only check that at least some DC data
  26.249 +     * got sent for each component; the spec does not require that all bits
  26.250 +     * of all coefficients be transmitted.  Would it be wiser to enforce
  26.251 +     * transmission of all coefficient bits??
  26.252 +     */
  26.253 +    for (ci = 0; ci < cinfo->num_components; ci++) {
  26.254 +      if (last_bitpos[ci][0] < 0)
  26.255 +	ERREXIT(cinfo, JERR_MISSING_DATA);
  26.256 +    }
  26.257 +#endif
  26.258 +  } else {
  26.259 +    for (ci = 0; ci < cinfo->num_components; ci++) {
  26.260 +      if (! component_sent[ci])
  26.261 +	ERREXIT(cinfo, JERR_MISSING_DATA);
  26.262 +    }
  26.263 +  }
  26.264 +}
  26.265 +
  26.266 +#endif /* C_MULTISCAN_FILES_SUPPORTED */
  26.267 +
  26.268 +
  26.269 +LOCAL(void)
  26.270 +select_scan_parameters (j_compress_ptr cinfo)
  26.271 +/* Set up the scan parameters for the current scan */
  26.272 +{
  26.273 +  int ci;
  26.274 +
  26.275 +#ifdef C_MULTISCAN_FILES_SUPPORTED
  26.276 +  if (cinfo->scan_info != NULL) {
  26.277 +    /* Prepare for current scan --- the script is already validated */
  26.278 +    my_master_ptr master = (my_master_ptr) cinfo->master;
  26.279 +    const jpeg_scan_info * scanptr = cinfo->scan_info + master->scan_number;
  26.280 +
  26.281 +    cinfo->comps_in_scan = scanptr->comps_in_scan;
  26.282 +    for (ci = 0; ci < scanptr->comps_in_scan; ci++) {
  26.283 +      cinfo->cur_comp_info[ci] =
  26.284 +	&cinfo->comp_info[scanptr->component_index[ci]];
  26.285 +    }
  26.286 +    cinfo->Ss = scanptr->Ss;
  26.287 +    cinfo->Se = scanptr->Se;
  26.288 +    cinfo->Ah = scanptr->Ah;
  26.289 +    cinfo->Al = scanptr->Al;
  26.290 +  }
  26.291 +  else
  26.292 +#endif
  26.293 +  {
  26.294 +    /* Prepare for single sequential-JPEG scan containing all components */
  26.295 +    if (cinfo->num_components > MAX_COMPS_IN_SCAN)
  26.296 +      ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,
  26.297 +	       MAX_COMPS_IN_SCAN);
  26.298 +    cinfo->comps_in_scan = cinfo->num_components;
  26.299 +    for (ci = 0; ci < cinfo->num_components; ci++) {
  26.300 +      cinfo->cur_comp_info[ci] = &cinfo->comp_info[ci];
  26.301 +    }
  26.302 +    cinfo->Ss = 0;
  26.303 +    cinfo->Se = DCTSIZE2-1;
  26.304 +    cinfo->Ah = 0;
  26.305 +    cinfo->Al = 0;
  26.306 +  }
  26.307 +}
  26.308 +
  26.309 +
  26.310 +LOCAL(void)
  26.311 +per_scan_setup (j_compress_ptr cinfo)
  26.312 +/* Do computations that are needed before processing a JPEG scan */
  26.313 +/* cinfo->comps_in_scan and cinfo->cur_comp_info[] are already set */
  26.314 +{
  26.315 +  int ci, mcublks, tmp;
  26.316 +  jpeg_component_info *compptr;
  26.317 +  
  26.318 +  if (cinfo->comps_in_scan == 1) {
  26.319 +    
  26.320 +    /* Noninterleaved (single-component) scan */
  26.321 +    compptr = cinfo->cur_comp_info[0];
  26.322 +    
  26.323 +    /* Overall image size in MCUs */
  26.324 +    cinfo->MCUs_per_row = compptr->width_in_blocks;
  26.325 +    cinfo->MCU_rows_in_scan = compptr->height_in_blocks;
  26.326 +    
  26.327 +    /* For noninterleaved scan, always one block per MCU */
  26.328 +    compptr->MCU_width = 1;
  26.329 +    compptr->MCU_height = 1;
  26.330 +    compptr->MCU_blocks = 1;
  26.331 +    compptr->MCU_sample_width = DCTSIZE;
  26.332 +    compptr->last_col_width = 1;
  26.333 +    /* For noninterleaved scans, it is convenient to define last_row_height
  26.334 +     * as the number of block rows present in the last iMCU row.
  26.335 +     */
  26.336 +    tmp = (int) (compptr->height_in_blocks % compptr->v_samp_factor);
  26.337 +    if (tmp == 0) tmp = compptr->v_samp_factor;
  26.338 +    compptr->last_row_height = tmp;
  26.339 +    
  26.340 +    /* Prepare array describing MCU composition */
  26.341 +    cinfo->blocks_in_MCU = 1;
  26.342 +    cinfo->MCU_membership[0] = 0;
  26.343 +    
  26.344 +  } else {
  26.345 +    
  26.346 +    /* Interleaved (multi-component) scan */
  26.347 +    if (cinfo->comps_in_scan <= 0 || cinfo->comps_in_scan > MAX_COMPS_IN_SCAN)
  26.348 +      ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->comps_in_scan,
  26.349 +	       MAX_COMPS_IN_SCAN);
  26.350 +    
  26.351 +    /* Overall image size in MCUs */
  26.352 +    cinfo->MCUs_per_row = (JDIMENSION)
  26.353 +      jdiv_round_up((long) cinfo->image_width,
  26.354 +		    (long) (cinfo->max_h_samp_factor*DCTSIZE));
  26.355 +    cinfo->MCU_rows_in_scan = (JDIMENSION)
  26.356 +      jdiv_round_up((long) cinfo->image_height,
  26.357 +		    (long) (cinfo->max_v_samp_factor*DCTSIZE));
  26.358 +    
  26.359 +    cinfo->blocks_in_MCU = 0;
  26.360 +    
  26.361 +    for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
  26.362 +      compptr = cinfo->cur_comp_info[ci];
  26.363 +      /* Sampling factors give # of blocks of component in each MCU */
  26.364 +      compptr->MCU_width = compptr->h_samp_factor;
  26.365 +      compptr->MCU_height = compptr->v_samp_factor;
  26.366 +      compptr->MCU_blocks = compptr->MCU_width * compptr->MCU_height;
  26.367 +      compptr->MCU_sample_width = compptr->MCU_width * DCTSIZE;
  26.368 +      /* Figure number of non-dummy blocks in last MCU column & row */
  26.369 +      tmp = (int) (compptr->width_in_blocks % compptr->MCU_width);
  26.370 +      if (tmp == 0) tmp = compptr->MCU_width;
  26.371 +      compptr->last_col_width = tmp;
  26.372 +      tmp = (int) (compptr->height_in_blocks % compptr->MCU_height);
  26.373 +      if (tmp == 0) tmp = compptr->MCU_height;
  26.374 +      compptr->last_row_height = tmp;
  26.375 +      /* Prepare array describing MCU composition */
  26.376 +      mcublks = compptr->MCU_blocks;
  26.377 +      if (cinfo->blocks_in_MCU + mcublks > C_MAX_BLOCKS_IN_MCU)
  26.378 +	ERREXIT(cinfo, JERR_BAD_MCU_SIZE);
  26.379 +      while (mcublks-- > 0) {
  26.380 +	cinfo->MCU_membership[cinfo->blocks_in_MCU++] = ci;
  26.381 +      }
  26.382 +    }
  26.383 +    
  26.384 +  }
  26.385 +
  26.386 +  /* Convert restart specified in rows to actual MCU count. */
  26.387 +  /* Note that count must fit in 16 bits, so we provide limiting. */
  26.388 +  if (cinfo->restart_in_rows > 0) {
  26.389 +    long nominal = (long) cinfo->restart_in_rows * (long) cinfo->MCUs_per_row;
  26.390 +    cinfo->restart_interval = (unsigned int) MIN(nominal, 65535L);
  26.391 +  }
  26.392 +}
  26.393 +
  26.394 +
  26.395 +/*
  26.396 + * Per-pass setup.
  26.397 + * This is called at the beginning of each pass.  We determine which modules
  26.398 + * will be active during this pass and give them appropriate start_pass calls.
  26.399 + * We also set is_last_pass to indicate whether any more passes will be
  26.400 + * required.
  26.401 + */
  26.402 +
  26.403 +METHODDEF(void)
  26.404 +prepare_for_pass (j_compress_ptr cinfo)
  26.405 +{
  26.406 +  my_master_ptr master = (my_master_ptr) cinfo->master;
  26.407 +
  26.408 +  switch (master->pass_type) {
  26.409 +  case main_pass:
  26.410 +    /* Initial pass: will collect input data, and do either Huffman
  26.411 +     * optimization or data output for the first scan.
  26.412 +     */
  26.413 +    select_scan_parameters(cinfo);
  26.414 +    per_scan_setup(cinfo);
  26.415 +    if (! cinfo->raw_data_in) {
  26.416 +      (*cinfo->cconvert->start_pass) (cinfo);
  26.417 +      (*cinfo->downsample->start_pass) (cinfo);
  26.418 +      (*cinfo->prep->start_pass) (cinfo, JBUF_PASS_THRU);
  26.419 +    }
  26.420 +    (*cinfo->fdct->start_pass) (cinfo);
  26.421 +    (*cinfo->entropy->start_pass) (cinfo, cinfo->optimize_coding);
  26.422 +    (*cinfo->coef->start_pass) (cinfo,
  26.423 +				(master->total_passes > 1 ?
  26.424 +				 JBUF_SAVE_AND_PASS : JBUF_PASS_THRU));
  26.425 +    (*cinfo->main->start_pass) (cinfo, JBUF_PASS_THRU);
  26.426 +    if (cinfo->optimize_coding) {
  26.427 +      /* No immediate data output; postpone writing frame/scan headers */
  26.428 +      master->pub.call_pass_startup = FALSE;
  26.429 +    } else {
  26.430 +      /* Will write frame/scan headers at first jpeg_write_scanlines call */
  26.431 +      master->pub.call_pass_startup = TRUE;
  26.432 +    }
  26.433 +    break;
  26.434 +#ifdef ENTROPY_OPT_SUPPORTED
  26.435 +  case huff_opt_pass:
  26.436 +    /* Do Huffman optimization for a scan after the first one. */
  26.437 +    select_scan_parameters(cinfo);
  26.438 +    per_scan_setup(cinfo);
  26.439 +    if (cinfo->Ss != 0 || cinfo->Ah == 0 || cinfo->arith_code) {
  26.440 +      (*cinfo->entropy->start_pass) (cinfo, TRUE);
  26.441 +      (*cinfo->coef->start_pass) (cinfo, JBUF_CRANK_DEST);
  26.442 +      master->pub.call_pass_startup = FALSE;
  26.443 +      break;
  26.444 +    }
  26.445 +    /* Special case: Huffman DC refinement scans need no Huffman table
  26.446 +     * and therefore we can skip the optimization pass for them.
  26.447 +     */
  26.448 +    master->pass_type = output_pass;
  26.449 +    master->pass_number++;
  26.450 +    /*FALLTHROUGH*/
  26.451 +#endif
  26.452 +  case output_pass:
  26.453 +    /* Do a data-output pass. */
  26.454 +    /* We need not repeat per-scan setup if prior optimization pass did it. */
  26.455 +    if (! cinfo->optimize_coding) {
  26.456 +      select_scan_parameters(cinfo);
  26.457 +      per_scan_setup(cinfo);
  26.458 +    }
  26.459 +    (*cinfo->entropy->start_pass) (cinfo, FALSE);
  26.460 +    (*cinfo->coef->start_pass) (cinfo, JBUF_CRANK_DEST);
  26.461 +    /* We emit frame/scan headers now */
  26.462 +    if (master->scan_number == 0)
  26.463 +      (*cinfo->marker->write_frame_header) (cinfo);
  26.464 +    (*cinfo->marker->write_scan_header) (cinfo);
  26.465 +    master->pub.call_pass_startup = FALSE;
  26.466 +    break;
  26.467 +  default:
  26.468 +    ERREXIT(cinfo, JERR_NOT_COMPILED);
  26.469 +  }
  26.470 +
  26.471 +  master->pub.is_last_pass = (master->pass_number == master->total_passes-1);
  26.472 +
  26.473 +  /* Set up progress monitor's pass info if present */
  26.474 +  if (cinfo->progress != NULL) {
  26.475 +    cinfo->progress->completed_passes = master->pass_number;
  26.476 +    cinfo->progress->total_passes = master->total_passes;
  26.477 +  }
  26.478 +}
  26.479 +
  26.480 +
  26.481 +/*
  26.482 + * Special start-of-pass hook.
  26.483 + * This is called by jpeg_write_scanlines if call_pass_startup is TRUE.
  26.484 + * In single-pass processing, we need this hook because we don't want to
  26.485 + * write frame/scan headers during jpeg_start_compress; we want to let the
  26.486 + * application write COM markers etc. between jpeg_start_compress and the
  26.487 + * jpeg_write_scanlines loop.
  26.488 + * In multi-pass processing, this routine is not used.
  26.489 + */
  26.490 +
  26.491 +METHODDEF(void)
  26.492 +pass_startup (j_compress_ptr cinfo)
  26.493 +{
  26.494 +  cinfo->master->call_pass_startup = FALSE; /* reset flag so call only once */
  26.495 +
  26.496 +  (*cinfo->marker->write_frame_header) (cinfo);
  26.497 +  (*cinfo->marker->write_scan_header) (cinfo);
  26.498 +}
  26.499 +
  26.500 +
  26.501 +/*
  26.502 + * Finish up at end of pass.
  26.503 + */
  26.504 +
  26.505 +METHODDEF(void)
  26.506 +finish_pass_master (j_compress_ptr cinfo)
  26.507 +{
  26.508 +  my_master_ptr master = (my_master_ptr) cinfo->master;
  26.509 +
  26.510 +  /* The entropy coder always needs an end-of-pass call,
  26.511 +   * either to analyze statistics or to flush its output buffer.
  26.512 +   */
  26.513 +  (*cinfo->entropy->finish_pass) (cinfo);
  26.514 +
  26.515 +  /* Update state for next pass */
  26.516 +  switch (master->pass_type) {
  26.517 +  case main_pass:
  26.518 +    /* next pass is either output of scan 0 (after optimization)
  26.519 +     * or output of scan 1 (if no optimization).
  26.520 +     */
  26.521 +    master->pass_type = output_pass;
  26.522 +    if (! cinfo->optimize_coding)
  26.523 +      master->scan_number++;
  26.524 +    break;
  26.525 +  case huff_opt_pass:
  26.526 +    /* next pass is always output of current scan */
  26.527 +    master->pass_type = output_pass;
  26.528 +    break;
  26.529 +  case output_pass:
  26.530 +    /* next pass is either optimization or output of next scan */
  26.531 +    if (cinfo->optimize_coding)
  26.532 +      master->pass_type = huff_opt_pass;
  26.533 +    master->scan_number++;
  26.534 +    break;
  26.535 +  }
  26.536 +
  26.537 +  master->pass_number++;
  26.538 +}
  26.539 +
  26.540 +
  26.541 +/*
  26.542 + * Initialize master compression control.
  26.543 + */
  26.544 +
  26.545 +GLOBAL(void)
  26.546 +jinit_c_master_control (j_compress_ptr cinfo, boolean transcode_only)
  26.547 +{
  26.548 +  my_master_ptr master;
  26.549 +
  26.550 +  master = (my_master_ptr)
  26.551 +      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
  26.552 +				  SIZEOF(my_comp_master));
  26.553 +  cinfo->master = (struct jpeg_comp_master *) master;
  26.554 +  master->pub.prepare_for_pass = prepare_for_pass;
  26.555 +  master->pub.pass_startup = pass_startup;
  26.556 +  master->pub.finish_pass = finish_pass_master;
  26.557 +  master->pub.is_last_pass = FALSE;
  26.558 +
  26.559 +  /* Validate parameters, determine derived values */
  26.560 +  initial_setup(cinfo);
  26.561 +
  26.562 +  if (cinfo->scan_info != NULL) {
  26.563 +#ifdef C_MULTISCAN_FILES_SUPPORTED
  26.564 +    validate_script(cinfo);
  26.565 +#else
  26.566 +    ERREXIT(cinfo, JERR_NOT_COMPILED);
  26.567 +#endif
  26.568 +  } else {
  26.569 +    cinfo->progressive_mode = FALSE;
  26.570 +    cinfo->num_scans = 1;
  26.571 +  }
  26.572 +
  26.573 +  if (cinfo->progressive_mode)	/*  TEMPORARY HACK ??? */
  26.574 +    cinfo->optimize_coding = TRUE; /* assume default tables no good for progressive mode */
  26.575 +
  26.576 +  /* Initialize my private state */
  26.577 +  if (transcode_only) {
  26.578 +    /* no main pass in transcoding */
  26.579 +    if (cinfo->optimize_coding)
  26.580 +      master->pass_type = huff_opt_pass;
  26.581 +    else
  26.582 +      master->pass_type = output_pass;
  26.583 +  } else {
  26.584 +    /* for normal compression, first pass is always this type: */
  26.585 +    master->pass_type = main_pass;
  26.586 +  }
  26.587 +  master->scan_number = 0;
  26.588 +  master->pass_number = 0;
  26.589 +  if (cinfo->optimize_coding)
  26.590 +    master->total_passes = cinfo->num_scans * 2;
  26.591 +  else
  26.592 +    master->total_passes = cinfo->num_scans;
  26.593 +}
    27.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    27.2 +++ b/libs/libjpeg/jcomapi.c	Sun Nov 01 00:36:56 2015 +0200
    27.3 @@ -0,0 +1,106 @@
    27.4 +/*
    27.5 + * jcomapi.c
    27.6 + *
    27.7 + * Copyright (C) 1994-1997, Thomas G. Lane.
    27.8 + * This file is part of the Independent JPEG Group's software.
    27.9 + * For conditions of distribution and use, see the accompanying README file.
   27.10 + *
   27.11 + * This file contains application interface routines that are used for both
   27.12 + * compression and decompression.
   27.13 + */
   27.14 +
   27.15 +#define JPEG_INTERNALS
   27.16 +#include "jinclude.h"
   27.17 +#include "jpeglib.h"
   27.18 +
   27.19 +
   27.20 +/*
   27.21 + * Abort processing of a JPEG compression or decompression operation,
   27.22 + * but don't destroy the object itself.
   27.23 + *
   27.24 + * For this, we merely clean up all the nonpermanent memory pools.
   27.25 + * Note that temp files (virtual arrays) are not allowed to belong to
   27.26 + * the permanent pool, so we will be able to close all temp files here.
   27.27 + * Closing a data source or destination, if necessary, is the application's
   27.28 + * responsibility.
   27.29 + */
   27.30 +
   27.31 +GLOBAL(void)
   27.32 +jpeg_abort (j_common_ptr cinfo)
   27.33 +{
   27.34 +  int pool;
   27.35 +
   27.36 +  /* Do nothing if called on a not-initialized or destroyed JPEG object. */
   27.37 +  if (cinfo->mem == NULL)
   27.38 +    return;
   27.39 +
   27.40 +  /* Releasing pools in reverse order might help avoid fragmentation
   27.41 +   * with some (brain-damaged) malloc libraries.
   27.42 +   */
   27.43 +  for (pool = JPOOL_NUMPOOLS-1; pool > JPOOL_PERMANENT; pool--) {
   27.44 +    (*cinfo->mem->free_pool) (cinfo, pool);
   27.45 +  }
   27.46 +
   27.47 +  /* Reset overall state for possible reuse of object */
   27.48 +  if (cinfo->is_decompressor) {
   27.49 +    cinfo->global_state = DSTATE_START;
   27.50 +    /* Try to keep application from accessing now-deleted marker list.
   27.51 +     * A bit kludgy to do it here, but this is the most central place.
   27.52 +     */
   27.53 +    ((j_decompress_ptr) cinfo)->marker_list = NULL;
   27.54 +  } else {
   27.55 +    cinfo->global_state = CSTATE_START;
   27.56 +  }
   27.57 +}
   27.58 +
   27.59 +
   27.60 +/*
   27.61 + * Destruction of a JPEG object.
   27.62 + *
   27.63 + * Everything gets deallocated except the master jpeg_compress_struct itself
   27.64 + * and the error manager struct.  Both of these are supplied by the application
   27.65 + * and must be freed, if necessary, by the application.  (Often they are on
   27.66 + * the stack and so don't need to be freed anyway.)
   27.67 + * Closing a data source or destination, if necessary, is the application's
   27.68 + * responsibility.
   27.69 + */
   27.70 +
   27.71 +GLOBAL(void)
   27.72 +jpeg_destroy (j_common_ptr cinfo)
   27.73 +{
   27.74 +  /* We need only tell the memory manager to release everything. */
   27.75 +  /* NB: mem pointer is NULL if memory mgr failed to initialize. */
   27.76 +  if (cinfo->mem != NULL)
   27.77 +    (*cinfo->mem->self_destruct) (cinfo);
   27.78 +  cinfo->mem = NULL;		/* be safe if jpeg_destroy is called twice */
   27.79 +  cinfo->global_state = 0;	/* mark it destroyed */
   27.80 +}
   27.81 +
   27.82 +
   27.83 +/*
   27.84 + * Convenience routines for allocating quantization and Huffman tables.
   27.85 + * (Would jutils.c be a more reasonable place to put these?)
   27.86 + */
   27.87 +
   27.88 +GLOBAL(JQUANT_TBL *)
   27.89 +jpeg_alloc_quant_table (j_common_ptr cinfo)
   27.90 +{
   27.91 +  JQUANT_TBL *tbl;
   27.92 +
   27.93 +  tbl = (JQUANT_TBL *)
   27.94 +    (*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, SIZEOF(JQUANT_TBL));
   27.95 +  tbl->sent_table = FALSE;	/* make sure this is false in any new table */
   27.96 +  return tbl;
   27.97 +}
   27.98 +
   27.99 +
  27.100 +GLOBAL(JHUFF_TBL *)
  27.101 +jpeg_alloc_huff_table (j_common_ptr cinfo)
  27.102 +{
  27.103 +  JHUFF_TBL *tbl;
  27.104 +
  27.105 +  tbl = (JHUFF_TBL *)
  27.106 +    (*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, SIZEOF(JHUFF_TBL));
  27.107 +  tbl->sent_table = FALSE;	/* make sure this is false in any new table */
  27.108 +  return tbl;
  27.109 +}
    28.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    28.2 +++ b/libs/libjpeg/jconfig.h	Sun Nov 01 00:36:56 2015 +0200
    28.3 @@ -0,0 +1,45 @@
    28.4 +/* jconfig.vc --- jconfig.h for Microsoft Visual C++ on Windows 95 or NT. */
    28.5 +/* see jconfig.doc for explanations */
    28.6 +
    28.7 +#define HAVE_PROTOTYPES
    28.8 +#define HAVE_UNSIGNED_CHAR
    28.9 +#define HAVE_UNSIGNED_SHORT
   28.10 +/* #define void char */
   28.11 +/* #define const */
   28.12 +#undef CHAR_IS_UNSIGNED
   28.13 +#define HAVE_STDDEF_H
   28.14 +#define HAVE_STDLIB_H
   28.15 +#undef NEED_BSD_STRINGS
   28.16 +#undef NEED_SYS_TYPES_H
   28.17 +#undef NEED_FAR_POINTERS	/* we presume a 32-bit flat memory model */
   28.18 +#undef NEED_SHORT_EXTERNAL_NAMES
   28.19 +#undef INCOMPLETE_TYPES_BROKEN
   28.20 +
   28.21 +/* Define "boolean" as unsigned char, not int, per Windows custom */
   28.22 +#ifndef __RPCNDR_H__		/* don't conflict if rpcndr.h already read */
   28.23 +typedef unsigned char boolean;
   28.24 +#endif
   28.25 +#define HAVE_BOOLEAN		/* prevent jmorecfg.h from redefining it */
   28.26 +
   28.27 +
   28.28 +#ifdef JPEG_INTERNALS
   28.29 +
   28.30 +#undef RIGHT_SHIFT_IS_UNSIGNED
   28.31 +
   28.32 +#endif /* JPEG_INTERNALS */
   28.33 +
   28.34 +#ifdef JPEG_CJPEG_DJPEG
   28.35 +
   28.36 +#define BMP_SUPPORTED		/* BMP image file format */
   28.37 +#define GIF_SUPPORTED		/* GIF image file format */
   28.38 +#define PPM_SUPPORTED		/* PBMPLUS PPM/PGM image file format */
   28.39 +#undef RLE_SUPPORTED		/* Utah RLE image file format */
   28.40 +#define TARGA_SUPPORTED		/* Targa image file format */
   28.41 +
   28.42 +#define TWO_FILE_COMMANDLINE	/* optional */
   28.43 +#define USE_SETMODE		/* Microsoft has setmode() */
   28.44 +#undef NEED_SIGNAL_CATCHER
   28.45 +#undef DONT_USE_B_MODE
   28.46 +#undef PROGRESS_REPORT		/* optional */
   28.47 +
   28.48 +#endif /* JPEG_CJPEG_DJPEG */
    29.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    29.2 +++ b/libs/libjpeg/jcparam.c	Sun Nov 01 00:36:56 2015 +0200
    29.3 @@ -0,0 +1,610 @@
    29.4 +/*
    29.5 + * jcparam.c
    29.6 + *
    29.7 + * Copyright (C) 1991-1998, Thomas G. Lane.
    29.8 + * This file is part of the Independent JPEG Group's software.
    29.9 + * For conditions of distribution and use, see the accompanying README file.
   29.10 + *
   29.11 + * This file contains optional default-setting code for the JPEG compressor.
   29.12 + * Applications do not have to use this file, but those that don't use it
   29.13 + * must know a lot more about the innards of the JPEG code.
   29.14 + */
   29.15 +
   29.16 +#define JPEG_INTERNALS
   29.17 +#include "jinclude.h"
   29.18 +#include "jpeglib.h"
   29.19 +
   29.20 +
   29.21 +/*
   29.22 + * Quantization table setup routines
   29.23 + */
   29.24 +
   29.25 +GLOBAL(void)
   29.26 +jpeg_add_quant_table (j_compress_ptr cinfo, int which_tbl,
   29.27 +		      const unsigned int *basic_table,
   29.28 +		      int scale_factor, boolean force_baseline)
   29.29 +/* Define a quantization table equal to the basic_table times
   29.30 + * a scale factor (given as a percentage).
   29.31 + * If force_baseline is TRUE, the computed quantization table entries
   29.32 + * are limited to 1..255 for JPEG baseline compatibility.
   29.33 + */
   29.34 +{
   29.35 +  JQUANT_TBL ** qtblptr;
   29.36 +  int i;
   29.37 +  long temp;
   29.38 +
   29.39 +  /* Safety check to ensure start_compress not called yet. */
   29.40 +  if (cinfo->global_state != CSTATE_START)
   29.41 +    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
   29.42 +
   29.43 +  if (which_tbl < 0 || which_tbl >= NUM_QUANT_TBLS)
   29.44 +    ERREXIT1(cinfo, JERR_DQT_INDEX, which_tbl);
   29.45 +
   29.46 +  qtblptr = & cinfo->quant_tbl_ptrs[which_tbl];
   29.47 +
   29.48 +  if (*qtblptr == NULL)
   29.49 +    *qtblptr = jpeg_alloc_quant_table((j_common_ptr) cinfo);
   29.50 +
   29.51 +  for (i = 0; i < DCTSIZE2; i++) {
   29.52 +    temp = ((long) basic_table[i] * scale_factor + 50L) / 100L;
   29.53 +    /* limit the values to the valid range */
   29.54 +    if (temp <= 0L) temp = 1L;
   29.55 +    if (temp > 32767L) temp = 32767L; /* max quantizer needed for 12 bits */
   29.56 +    if (force_baseline && temp > 255L)
   29.57 +      temp = 255L;		/* limit to baseline range if requested */
   29.58 +    (*qtblptr)->quantval[i] = (UINT16) temp;
   29.59 +  }
   29.60 +
   29.61 +  /* Initialize sent_table FALSE so table will be written to JPEG file. */
   29.62 +  (*qtblptr)->sent_table = FALSE;
   29.63 +}
   29.64 +
   29.65 +
   29.66 +GLOBAL(void)
   29.67 +jpeg_set_linear_quality (j_compress_ptr cinfo, int scale_factor,
   29.68 +			 boolean force_baseline)
   29.69 +/* Set or change the 'quality' (quantization) setting, using default tables
   29.70 + * and a straight percentage-scaling quality scale.  In most cases it's better
   29.71 + * to use jpeg_set_quality (below); this entry point is provided for
   29.72 + * applications that insist on a linear percentage scaling.
   29.73 + */
   29.74 +{
   29.75 +  /* These are the sample quantization tables given in JPEG spec section K.1.
   29.76 +   * The spec says that the values given produce "good" quality, and
   29.77 +   * when divided by 2, "very good" quality.
   29.78 +   */
   29.79 +  static const unsigned int std_luminance_quant_tbl[DCTSIZE2] = {
   29.80 +    16,  11,  10,  16,  24,  40,  51,  61,
   29.81 +    12,  12,  14,  19,  26,  58,  60,  55,
   29.82 +    14,  13,  16,  24,  40,  57,  69,  56,
   29.83 +    14,  17,  22,  29,  51,  87,  80,  62,
   29.84 +    18,  22,  37,  56,  68, 109, 103,  77,
   29.85 +    24,  35,  55,  64,  81, 104, 113,  92,
   29.86 +    49,  64,  78,  87, 103, 121, 120, 101,
   29.87 +    72,  92,  95,  98, 112, 100, 103,  99
   29.88 +  };
   29.89 +  static const unsigned int std_chrominance_quant_tbl[DCTSIZE2] = {
   29.90 +    17,  18,  24,  47,  99,  99,  99,  99,
   29.91 +    18,  21,  26,  66,  99,  99,  99,  99,
   29.92 +    24,  26,  56,  99,  99,  99,  99,  99,
   29.93 +    47,  66,  99,  99,  99,  99,  99,  99,
   29.94 +    99,  99,  99,  99,  99,  99,  99,  99,
   29.95 +    99,  99,  99,  99,  99,  99,  99,  99,
   29.96 +    99,  99,  99,  99,  99,  99,  99,  99,
   29.97 +    99,  99,  99,  99,  99,  99,  99,  99
   29.98 +  };
   29.99 +
  29.100 +  /* Set up two quantization tables using the specified scaling */
  29.101 +  jpeg_add_quant_table(cinfo, 0, std_luminance_quant_tbl,
  29.102 +		       scale_factor, force_baseline);
  29.103 +  jpeg_add_quant_table(cinfo, 1, std_chrominance_quant_tbl,
  29.104 +		       scale_factor, force_baseline);
  29.105 +}
  29.106 +
  29.107 +
  29.108 +GLOBAL(int)
  29.109 +jpeg_quality_scaling (int quality)
  29.110 +/* Convert a user-specified quality rating to a percentage scaling factor
  29.111 + * for an underlying quantization table, using our recommended scaling curve.
  29.112 + * The input 'quality' factor should be 0 (terrible) to 100 (very good).
  29.113 + */
  29.114 +{
  29.115 +  /* Safety limit on quality factor.  Convert 0 to 1 to avoid zero divide. */
  29.116 +  if (quality <= 0) quality = 1;
  29.117 +  if (quality > 100) quality = 100;
  29.118 +
  29.119 +  /* The basic table is used as-is (scaling 100) for a quality of 50.
  29.120 +   * Qualities 50..100 are converted to scaling percentage 200 - 2*Q;
  29.121 +   * note that at Q=100 the scaling is 0, which will cause jpeg_add_quant_table
  29.122 +   * to make all the table entries 1 (hence, minimum quantization loss).
  29.123 +   * Qualities 1..50 are converted to scaling percentage 5000/Q.
  29.124 +   */
  29.125 +  if (quality < 50)
  29.126 +    quality = 5000 / quality;
  29.127 +  else
  29.128 +    quality = 200 - quality*2;
  29.129 +
  29.130 +  return quality;
  29.131 +}
  29.132 +
  29.133 +
  29.134 +GLOBAL(void)
  29.135 +jpeg_set_quality (j_compress_ptr cinfo, int quality, boolean force_baseline)
  29.136 +/* Set or change the 'quality' (quantization) setting, using default tables.
  29.137 + * This is the standard quality-adjusting entry point for typical user
  29.138 + * interfaces; only those who want detailed control over quantization tables
  29.139 + * would use the preceding three routines directly.
  29.140 + */
  29.141 +{
  29.142 +  /* Convert user 0-100 rating to percentage scaling */
  29.143 +  quality = jpeg_quality_scaling(quality);
  29.144 +
  29.145 +  /* Set up standard quality tables */
  29.146 +  jpeg_set_linear_quality(cinfo, quality, force_baseline);
  29.147 +}
  29.148 +
  29.149 +
  29.150 +/*
  29.151 + * Huffman table setup routines
  29.152 + */
  29.153 +
  29.154 +LOCAL(void)
  29.155 +add_huff_table (j_compress_ptr cinfo,
  29.156 +		JHUFF_TBL **htblptr, const UINT8 *bits, const UINT8 *val)
  29.157 +/* Define a Huffman table */
  29.158 +{
  29.159 +  int nsymbols, len;
  29.160 +
  29.161 +  if (*htblptr == NULL)
  29.162 +    *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);
  29.163 +
  29.164 +  /* Copy the number-of-symbols-of-each-code-length counts */
  29.165 +  MEMCOPY((*htblptr)->bits, bits, SIZEOF((*htblptr)->bits));
  29.166 +
  29.167 +  /* Validate the counts.  We do this here mainly so we can copy the right
  29.168 +   * number of symbols from the val[] array, without risking marching off
  29.169 +   * the end of memory.  jchuff.c will do a more thorough test later.
  29.170 +   */
  29.171 +  nsymbols = 0;
  29.172 +  for (len = 1; len <= 16; len++)
  29.173 +    nsymbols += bits[len];
  29.174 +  if (nsymbols < 1 || nsymbols > 256)
  29.175 +    ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
  29.176 +
  29.177 +  MEMCOPY((*htblptr)->huffval, val, nsymbols * SIZEOF(UINT8));
  29.178 +
  29.179 +  /* Initialize sent_table FALSE so table will be written to JPEG file. */
  29.180 +  (*htblptr)->sent_table = FALSE;
  29.181 +}
  29.182 +
  29.183 +
  29.184 +LOCAL(void)
  29.185 +std_huff_tables (j_compress_ptr cinfo)
  29.186 +/* Set up the standard Huffman tables (cf. JPEG standard section K.3) */
  29.187 +/* IMPORTANT: these are only valid for 8-bit data precision! */
  29.188 +{
  29.189 +  static const UINT8 bits_dc_luminance[17] =
  29.190 +    { /* 0-base */ 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };
  29.191 +  static const UINT8 val_dc_luminance[] =
  29.192 +    { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
  29.193 +  
  29.194 +  static const UINT8 bits_dc_chrominance[17] =
  29.195 +    { /* 0-base */ 0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 };
  29.196 +  static const UINT8 val_dc_chrominance[] =
  29.197 +    { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
  29.198 +  
  29.199 +  static const UINT8 bits_ac_luminance[17] =
  29.200 +    { /* 0-base */ 0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d };
  29.201 +  static const UINT8 val_ac_luminance[] =
  29.202 +    { 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12,
  29.203 +      0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07,
  29.204 +      0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08,
  29.205 +      0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0,
  29.206 +      0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16,
  29.207 +      0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28,
  29.208 +      0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
  29.209 +      0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49,
  29.210 +      0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59,
  29.211 +      0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
  29.212 +      0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79,
  29.213 +      0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89,
  29.214 +      0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,
  29.215 +      0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
  29.216 +      0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6,
  29.217 +      0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5,
  29.218 +      0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4,
  29.219 +      0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2,
  29.220 +      0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea,
  29.221 +      0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
  29.222 +      0xf9, 0xfa };
  29.223 +  
  29.224 +  static const UINT8 bits_ac_chrominance[17] =
  29.225 +    { /* 0-base */ 0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77 };
  29.226 +  static const UINT8 val_ac_chrominance[] =
  29.227 +    { 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21,
  29.228 +      0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71,
  29.229 +      0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91,
  29.230 +      0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0,
  29.231 +      0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34,
  29.232 +      0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26,
  29.233 +      0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38,
  29.234 +      0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,
  29.235 +      0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
  29.236 +      0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,
  29.237 +      0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
  29.238 +      0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
  29.239 +      0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96,
  29.240 +      0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5,
  29.241 +      0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4,
  29.242 +      0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3,
  29.243 +      0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2,
  29.244 +      0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda,
  29.245 +      0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9,
  29.246 +      0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
  29.247 +      0xf9, 0xfa };
  29.248 +  
  29.249 +  add_huff_table(cinfo, &cinfo->dc_huff_tbl_ptrs[0],
  29.250 +		 bits_dc_luminance, val_dc_luminance);
  29.251 +  add_huff_table(cinfo, &cinfo->ac_huff_tbl_ptrs[0],
  29.252 +		 bits_ac_luminance, val_ac_luminance);
  29.253 +  add_huff_table(cinfo, &cinfo->dc_huff_tbl_ptrs[1],
  29.254 +		 bits_dc_chrominance, val_dc_chrominance);
  29.255 +  add_huff_table(cinfo, &cinfo->ac_huff_tbl_ptrs[1],
  29.256 +		 bits_ac_chrominance, val_ac_chrominance);
  29.257 +}
  29.258 +
  29.259 +
  29.260 +/*
  29.261 + * Default parameter setup for compression.
  29.262 + *
  29.263 + * Applications that don't choose to use this routine must do their
  29.264 + * own setup of all these parameters.  Alternately, you can call this
  29.265 + * to establish defaults and then alter parameters selectively.  This
  29.266 + * is the recommended approach since, if we add any new parameters,
  29.267 + * your code will still work (they'll be set to reasonable defaults).
  29.268 + */
  29.269 +
  29.270 +GLOBAL(void)
  29.271 +jpeg_set_defaults (j_compress_ptr cinfo)
  29.272 +{
  29.273 +  int i;
  29.274 +
  29.275 +  /* Safety check to ensure start_compress not called yet. */
  29.276 +  if (cinfo->global_state != CSTATE_START)
  29.277 +    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
  29.278 +
  29.279 +  /* Allocate comp_info array large enough for maximum component count.
  29.280 +   * Array is made permanent in case application wants to compress
  29.281 +   * multiple images at same param settings.
  29.282 +   */
  29.283 +  if (cinfo->comp_info == NULL)
  29.284 +    cinfo->comp_info = (jpeg_component_info *)
  29.285 +      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
  29.286 +				  MAX_COMPONENTS * SIZEOF(jpeg_component_info));
  29.287 +
  29.288 +  /* Initialize everything not dependent on the color space */
  29.289 +
  29.290 +  cinfo->data_precision = BITS_IN_JSAMPLE;
  29.291 +  /* Set up two quantization tables using default quality of 75 */
  29.292 +  jpeg_set_quality(cinfo, 75, TRUE);
  29.293 +  /* Set up two Huffman tables */
  29.294 +  std_huff_tables(cinfo);
  29.295 +
  29.296 +  /* Initialize default arithmetic coding conditioning */
  29.297 +  for (i = 0; i < NUM_ARITH_TBLS; i++) {
  29.298 +    cinfo->arith_dc_L[i] = 0;
  29.299 +    cinfo->arith_dc_U[i] = 1;
  29.300 +    cinfo->arith_ac_K[i] = 5;
  29.301 +  }
  29.302 +
  29.303 +  /* Default is no multiple-scan output */
  29.304 +  cinfo->scan_info = NULL;
  29.305 +  cinfo->num_scans = 0;
  29.306 +
  29.307 +  /* Expect normal source image, not raw downsampled data */
  29.308 +  cinfo->raw_data_in = FALSE;
  29.309 +
  29.310 +  /* Use Huffman coding, not arithmetic coding, by default */
  29.311 +  cinfo->arith_code = FALSE;
  29.312 +
  29.313 +  /* By default, don't do extra passes to optimize entropy coding */
  29.314 +  cinfo->optimize_coding = FALSE;
  29.315 +  /* The standard Huffman tables are only valid for 8-bit data precision.
  29.316 +   * If the precision is higher, force optimization on so that usable
  29.317 +   * tables will be computed.  This test can be removed if default tables
  29.318 +   * are supplied that are valid for the desired precision.
  29.319 +   */
  29.320 +  if (cinfo->data_precision > 8)
  29.321 +    cinfo->optimize_coding = TRUE;
  29.322 +
  29.323 +  /* By default, use the simpler non-cosited sampling alignment */
  29.324 +  cinfo->CCIR601_sampling = FALSE;
  29.325 +
  29.326 +  /* No input smoothing */
  29.327 +  cinfo->smoothing_factor = 0;
  29.328 +
  29.329 +  /* DCT algorithm preference */
  29.330 +  cinfo->dct_method = JDCT_DEFAULT;
  29.331 +
  29.332 +  /* No restart markers */
  29.333 +  cinfo->restart_interval = 0;
  29.334 +  cinfo->restart_in_rows = 0;
  29.335 +
  29.336 +  /* Fill in default JFIF marker parameters.  Note that whether the marker
  29.337 +   * will actually be written is determined by jpeg_set_colorspace.
  29.338 +   *
  29.339 +   * By default, the library emits JFIF version code 1.01.
  29.340 +   * An application that wants to emit JFIF 1.02 extension markers should set
  29.341 +   * JFIF_minor_version to 2.  We could probably get away with just defaulting
  29.342 +   * to 1.02, but there may still be some decoders in use that will complain
  29.343 +   * about that; saying 1.01 should minimize compatibility problems.
  29.344 +   */
  29.345 +  cinfo->JFIF_major_version = 1; /* Default JFIF version = 1.01 */
  29.346 +  cinfo->JFIF_minor_version = 1;
  29.347 +  cinfo->density_unit = 0;	/* Pixel size is unknown by default */
  29.348 +  cinfo->X_density = 1;		/* Pixel aspect ratio is square by default */
  29.349 +  cinfo->Y_density = 1;
  29.350 +
  29.351 +  /* Choose JPEG colorspace based on input space, set defaults accordingly */
  29.352 +
  29.353 +  jpeg_default_colorspace(cinfo);
  29.354 +}
  29.355 +
  29.356 +
  29.357 +/*
  29.358 + * Select an appropriate JPEG colorspace for in_color_space.
  29.359 + */
  29.360 +
  29.361 +GLOBAL(void)
  29.362 +jpeg_default_colorspace (j_compress_ptr cinfo)
  29.363 +{
  29.364 +  switch (cinfo->in_color_space) {
  29.365 +  case JCS_GRAYSCALE:
  29.366 +    jpeg_set_colorspace(cinfo, JCS_GRAYSCALE);
  29.367 +    break;
  29.368 +  case JCS_RGB:
  29.369 +    jpeg_set_colorspace(cinfo, JCS_YCbCr);
  29.370 +    break;
  29.371 +  case JCS_YCbCr:
  29.372 +    jpeg_set_colorspace(cinfo, JCS_YCbCr);
  29.373 +    break;
  29.374 +  case JCS_CMYK:
  29.375 +    jpeg_set_colorspace(cinfo, JCS_CMYK); /* By default, no translation */
  29.376 +    break;
  29.377 +  case JCS_YCCK:
  29.378 +    jpeg_set_colorspace(cinfo, JCS_YCCK);
  29.379 +    break;
  29.380 +  case JCS_UNKNOWN:
  29.381 +    jpeg_set_colorspace(cinfo, JCS_UNKNOWN);
  29.382 +    break;
  29.383 +  default:
  29.384 +    ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
  29.385 +  }
  29.386 +}
  29.387 +
  29.388 +
  29.389 +/*
  29.390 + * Set the JPEG colorspace, and choose colorspace-dependent default values.
  29.391 + */
  29.392 +
  29.393 +GLOBAL(void)
  29.394 +jpeg_set_colorspace (j_compress_ptr cinfo, J_COLOR_SPACE colorspace)
  29.395 +{
  29.396 +  jpeg_component_info * compptr;
  29.397 +  int ci;
  29.398 +
  29.399 +#define SET_COMP(index,id,hsamp,vsamp,quant,dctbl,actbl)  \
  29.400 +  (compptr = &cinfo->comp_info[index], \
  29.401 +   compptr->component_id = (id), \
  29.402 +   compptr->h_samp_factor = (hsamp), \
  29.403 +   compptr->v_samp_factor = (vsamp), \
  29.404 +   compptr->quant_tbl_no = (quant), \
  29.405 +   compptr->dc_tbl_no = (dctbl), \
  29.406 +   compptr->ac_tbl_no = (actbl) )
  29.407 +
  29.408 +  /* Safety check to ensure start_compress not called yet. */
  29.409 +  if (cinfo->global_state != CSTATE_START)
  29.410 +    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
  29.411 +
  29.412 +  /* For all colorspaces, we use Q and Huff tables 0 for luminance components,
  29.413 +   * tables 1 for chrominance components.
  29.414 +   */
  29.415 +
  29.416 +  cinfo->jpeg_color_space = colorspace;
  29.417 +
  29.418 +  cinfo->write_JFIF_header = FALSE; /* No marker for non-JFIF colorspaces */
  29.419 +  cinfo->write_Adobe_marker = FALSE; /* write no Adobe marker by default */
  29.420 +
  29.421 +  switch (colorspace) {
  29.422 +  case JCS_GRAYSCALE:
  29.423 +    cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */
  29.424 +    cinfo->num_components = 1;
  29.425 +    /* JFIF specifies component ID 1 */
  29.426 +    SET_COMP(0, 1, 1,1, 0, 0,0);
  29.427 +    break;
  29.428 +  case JCS_RGB:
  29.429 +    cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag RGB */
  29.430 +    cinfo->num_components = 3;
  29.431 +    SET_COMP(0, 0x52 /* 'R' */, 1,1, 0, 0,0);
  29.432 +    SET_COMP(1, 0x47 /* 'G' */, 1,1, 0, 0,0);
  29.433 +    SET_COMP(2, 0x42 /* 'B' */, 1,1, 0, 0,0);
  29.434 +    break;
  29.435 +  case JCS_YCbCr:
  29.436 +    cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */
  29.437 +    cinfo->num_components = 3;
  29.438 +    /* JFIF specifies component IDs 1,2,3 */
  29.439 +    /* We default to 2x2 subsamples of chrominance */
  29.440 +    SET_COMP(0, 1, 2,2, 0, 0,0);
  29.441 +    SET_COMP(1, 2, 1,1, 1, 1,1);
  29.442 +    SET_COMP(2, 3, 1,1, 1, 1,1);
  29.443 +    break;
  29.444 +  case JCS_CMYK:
  29.445 +    cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag CMYK */
  29.446 +    cinfo->num_components = 4;
  29.447 +    SET_COMP(0, 0x43 /* 'C' */, 1,1, 0, 0,0);
  29.448 +    SET_COMP(1, 0x4D /* 'M' */, 1,1, 0, 0,0);
  29.449 +    SET_COMP(2, 0x59 /* 'Y' */, 1,1, 0, 0,0);
  29.450 +    SET_COMP(3, 0x4B /* 'K' */, 1,1, 0, 0,0);
  29.451 +    break;
  29.452 +  case JCS_YCCK:
  29.453 +    cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag YCCK */
  29.454 +    cinfo->num_components = 4;
  29.455 +    SET_COMP(0, 1, 2,2, 0, 0,0);
  29.456 +    SET_COMP(1, 2, 1,1, 1, 1,1);
  29.457 +    SET_COMP(2, 3, 1,1, 1, 1,1);
  29.458 +    SET_COMP(3, 4, 2,2, 0, 0,0);
  29.459 +    break;
  29.460 +  case JCS_UNKNOWN:
  29.461 +    cinfo->num_components = cinfo->input_components;
  29.462 +    if (cinfo->num_components < 1 || cinfo->num_components > MAX_COMPONENTS)
  29.463 +      ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,
  29.464 +	       MAX_COMPONENTS);
  29.465 +    for (ci = 0; ci < cinfo->num_components; ci++) {
  29.466 +      SET_COMP(ci, ci, 1,1, 0, 0,0);
  29.467 +    }
  29.468 +    break;
  29.469 +  default:
  29.470 +    ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
  29.471 +  }
  29.472 +}
  29.473 +
  29.474 +
  29.475 +#ifdef C_PROGRESSIVE_SUPPORTED
  29.476 +
  29.477 +LOCAL(jpeg_scan_info *)
  29.478 +fill_a_scan (jpeg_scan_info * scanptr, int ci,
  29.479 +	     int Ss, int Se, int Ah, int Al)
  29.480 +/* Support routine: generate one scan for specified component */
  29.481 +{
  29.482 +  scanptr->comps_in_scan = 1;
  29.483 +  scanptr->component_index[0] = ci;
  29.484 +  scanptr->Ss = Ss;
  29.485 +  scanptr->Se = Se;
  29.486 +  scanptr->Ah = Ah;
  29.487 +  scanptr->Al = Al;
  29.488 +  scanptr++;
  29.489 +  return scanptr;
  29.490 +}
  29.491 +
  29.492 +LOCAL(jpeg_scan_info *)
  29.493 +fill_scans (jpeg_scan_info * scanptr, int ncomps,
  29.494 +	    int Ss, int Se, int Ah, int Al)
  29.495 +/* Support routine: generate one scan for each component */
  29.496 +{
  29.497 +  int ci;
  29.498 +
  29.499 +  for (ci = 0; ci < ncomps; ci++) {
  29.500 +    scanptr->comps_in_scan = 1;
  29.501 +    scanptr->component_index[0] = ci;
  29.502 +    scanptr->Ss = Ss;
  29.503 +    scanptr->Se = Se;
  29.504 +    scanptr->Ah = Ah;
  29.505 +    scanptr->Al = Al;
  29.506 +    scanptr++;
  29.507 +  }
  29.508 +  return scanptr;
  29.509 +}
  29.510 +
  29.511 +LOCAL(jpeg_scan_info *)
  29.512 +fill_dc_scans (jpeg_scan_info * scanptr, int ncomps, int Ah, int Al)
  29.513 +/* Support routine: generate interleaved DC scan if possible, else N scans */
  29.514 +{
  29.515 +  int ci;
  29.516 +
  29.517 +  if (ncomps <= MAX_COMPS_IN_SCAN) {
  29.518 +    /* Single interleaved DC scan */
  29.519 +    scanptr->comps_in_scan = ncomps;
  29.520 +    for (ci = 0; ci < ncomps; ci++)
  29.521 +      scanptr->component_index[ci] = ci;
  29.522 +    scanptr->Ss = scanptr->Se = 0;
  29.523 +    scanptr->Ah = Ah;
  29.524 +    scanptr->Al = Al;
  29.525 +    scanptr++;
  29.526 +  } else {
  29.527 +    /* Noninterleaved DC scan for each component */
  29.528 +    scanptr = fill_scans(scanptr, ncomps, 0, 0, Ah, Al);
  29.529 +  }
  29.530 +  return scanptr;
  29.531 +}
  29.532 +
  29.533 +
  29.534 +/*
  29.535 + * Create a recommended progressive-JPEG script.
  29.536 + * cinfo->num_components and cinfo->jpeg_color_space must be correct.
  29.537 + */
  29.538 +
  29.539 +GLOBAL(void)
  29.540 +jpeg_simple_progression (j_compress_ptr cinfo)
  29.541 +{
  29.542 +  int ncomps = cinfo->num_components;
  29.543 +  int nscans;
  29.544 +  jpeg_scan_info * scanptr;
  29.545 +
  29.546 +  /* Safety check to ensure start_compress not called yet. */
  29.547 +  if (cinfo->global_state != CSTATE_START)
  29.548 +    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
  29.549 +
  29.550 +  /* Figure space needed for script.  Calculation must match code below! */
  29.551 +  if (ncomps == 3 && cinfo->jpeg_color_space == JCS_YCbCr) {
  29.552 +    /* Custom script for YCbCr color images. */
  29.553 +    nscans = 10;
  29.554 +  } else {
  29.555 +    /* All-purpose script for other color spaces. */
  29.556 +    if (ncomps > MAX_COMPS_IN_SCAN)
  29.557 +      nscans = 6 * ncomps;	/* 2 DC + 4 AC scans per component */
  29.558 +    else
  29.559 +      nscans = 2 + 4 * ncomps;	/* 2 DC scans; 4 AC scans per component */
  29.560 +  }
  29.561 +
  29.562 +  /* Allocate space for script.
  29.563 +   * We need to put it in the permanent pool in case the application performs
  29.564 +   * multiple compressions without changing the settings.  To avoid a memory
  29.565 +   * leak if jpeg_simple_progression is called repeatedly for the same JPEG
  29.566 +   * object, we try to re-use previously allocated space, and we allocate
  29.567 +   * enough space to handle YCbCr even if initially asked for grayscale.
  29.568 +   */
  29.569 +  if (cinfo->script_space == NULL || cinfo->script_space_size < nscans) {
  29.570 +    cinfo->script_space_size = MAX(nscans, 10);
  29.571 +    cinfo->script_space = (jpeg_scan_info *)
  29.572 +      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
  29.573 +			cinfo->script_space_size * SIZEOF(jpeg_scan_info));
  29.574 +  }
  29.575 +  scanptr = cinfo->script_space;
  29.576 +  cinfo->scan_info = scanptr;
  29.577 +  cinfo->num_scans = nscans;
  29.578 +
  29.579 +  if (ncomps == 3 && cinfo->jpeg_color_space == JCS_YCbCr) {
  29.580 +    /* Custom script for YCbCr color images. */
  29.581 +    /* Initial DC scan */
  29.582 +    scanptr = fill_dc_scans(scanptr, ncomps, 0, 1);
  29.583 +    /* Initial AC scan: get some luma data out in a hurry */
  29.584 +    scanptr = fill_a_scan(scanptr, 0, 1, 5, 0, 2);
  29.585 +    /* Chroma data is too small to be worth expending many scans on */
  29.586 +    scanptr = fill_a_scan(scanptr, 2, 1, 63, 0, 1);
  29.587 +    scanptr = fill_a_scan(scanptr, 1, 1, 63, 0, 1);
  29.588 +    /* Complete spectral selection for luma AC */
  29.589 +    scanptr = fill_a_scan(scanptr, 0, 6, 63, 0, 2);
  29.590 +    /* Refine next bit of luma AC */
  29.591 +    scanptr = fill_a_scan(scanptr, 0, 1, 63, 2, 1);
  29.592 +    /* Finish DC successive approximation */
  29.593 +    scanptr = fill_dc_scans(scanptr, ncomps, 1, 0);
  29.594 +    /* Finish AC successive approximation */
  29.595 +    scanptr = fill_a_scan(scanptr, 2, 1, 63, 1, 0);
  29.596 +    scanptr = fill_a_scan(scanptr, 1, 1, 63, 1, 0);
  29.597 +    /* Luma bottom bit comes last since it's usually largest scan */
  29.598 +    scanptr = fill_a_scan(scanptr, 0, 1, 63, 1, 0);
  29.599 +  } else {
  29.600 +    /* All-purpose script for other color spaces. */
  29.601 +    /* Successive approximation first pass */
  29.602 +    scanptr = fill_dc_scans(scanptr, ncomps, 0, 1);
  29.603 +    scanptr = fill_scans(scanptr, ncomps, 1, 5, 0, 2);
  29.604 +    scanptr = fill_scans(scanptr, ncomps, 6, 63, 0, 2);
  29.605 +    /* Successive approximation second pass */
  29.606 +    scanptr = fill_scans(scanptr, ncomps, 1, 63, 2, 1);
  29.607 +    /* Successive approximation final pass */
  29.608 +    scanptr = fill_dc_scans(scanptr, ncomps, 1, 0);
  29.609 +    scanptr = fill_scans(scanptr, ncomps, 1, 63, 1, 0);
  29.610 +  }
  29.611 +}
  29.612 +
  29.613 +#endif /* C_PROGRESSIVE_SUPPORTED */
    30.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    30.2 +++ b/libs/libjpeg/jcphuff.c	Sun Nov 01 00:36:56 2015 +0200
    30.3 @@ -0,0 +1,833 @@
    30.4 +/*
    30.5 + * jcphuff.c
    30.6 + *
    30.7 + * Copyright (C) 1995-1997, Thomas G. Lane.
    30.8 + * This file is part of the Independent JPEG Group's software.
    30.9 + * For conditions of distribution and use, see the accompanying README file.
   30.10 + *
   30.11 + * This file contains Huffman entropy encoding routines for progressive JPEG.
   30.12 + *
   30.13 + * We do not support output suspension in this module, since the library
   30.14 + * currently does not allow multiple-scan files to be written with output
   30.15 + * suspension.
   30.16 + */
   30.17 +
   30.18 +#define JPEG_INTERNALS
   30.19 +#include "jinclude.h"
   30.20 +#include "jpeglib.h"
   30.21 +#include "jchuff.h"		/* Declarations shared with jchuff.c */
   30.22 +
   30.23 +#ifdef C_PROGRESSIVE_SUPPORTED
   30.24 +
   30.25 +/* Expanded entropy encoder object for progressive Huffman encoding. */
   30.26 +
   30.27 +typedef struct {
   30.28 +  struct jpeg_entropy_encoder pub; /* public fields */
   30.29 +
   30.30 +  /* Mode flag: TRUE for optimization, FALSE for actual data output */
   30.31 +  boolean gather_statistics;
   30.32 +
   30.33 +  /* Bit-level coding status.
   30.34 +   * next_output_byte/free_in_buffer are local copies of cinfo->dest fields.
   30.35 +   */
   30.36 +  JOCTET * next_output_byte;	/* => next byte to write in buffer */
   30.37 +  size_t free_in_buffer;	/* # of byte spaces remaining in buffer */
   30.38 +  INT32 put_buffer;		/* current bit-accumulation buffer */
   30.39 +  int put_bits;			/* # of bits now in it */
   30.40 +  j_compress_ptr cinfo;		/* link to cinfo (needed for dump_buffer) */
   30.41 +
   30.42 +  /* Coding status for DC components */
   30.43 +  int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */
   30.44 +
   30.45 +  /* Coding status for AC components */
   30.46 +  int ac_tbl_no;		/* the table number of the single component */
   30.47 +  unsigned int EOBRUN;		/* run length of EOBs */
   30.48 +  unsigned int BE;		/* # of buffered correction bits before MCU */
   30.49 +  char * bit_buffer;		/* buffer for correction bits (1 per char) */
   30.50 +  /* packing correction bits tightly would save some space but cost time... */
   30.51 +
   30.52 +  unsigned int restarts_to_go;	/* MCUs left in this restart interval */
   30.53 +  int next_restart_num;		/* next restart number to write (0-7) */
   30.54 +
   30.55 +  /* Pointers to derived tables (these workspaces have image lifespan).
   30.56 +   * Since any one scan codes only DC or only AC, we only need one set
   30.57 +   * of tables, not one for DC and one for AC.
   30.58 +   */
   30.59 +  c_derived_tbl * derived_tbls[NUM_HUFF_TBLS];
   30.60 +
   30.61 +  /* Statistics tables for optimization; again, one set is enough */
   30.62 +  long * count_ptrs[NUM_HUFF_TBLS];
   30.63 +} phuff_entropy_encoder;
   30.64 +
   30.65 +typedef phuff_entropy_encoder * phuff_entropy_ptr;
   30.66 +
   30.67 +/* MAX_CORR_BITS is the number of bits the AC refinement correction-bit
   30.68 + * buffer can hold.  Larger sizes may slightly improve compression, but
   30.69 + * 1000 is already well into the realm of overkill.
   30.70 + * The minimum safe size is 64 bits.
   30.71 + */
   30.72 +
   30.73 +#define MAX_CORR_BITS  1000	/* Max # of correction bits I can buffer */
   30.74 +
   30.75 +/* IRIGHT_SHIFT is like RIGHT_SHIFT, but works on int rather than INT32.
   30.76 + * We assume that int right shift is unsigned if INT32 right shift is,
   30.77 + * which should be safe.
   30.78 + */
   30.79 +
   30.80 +#ifdef RIGHT_SHIFT_IS_UNSIGNED
   30.81 +#define ISHIFT_TEMPS	int ishift_temp;
   30.82 +#define IRIGHT_SHIFT(x,shft)  \
   30.83 +	((ishift_temp = (x)) < 0 ? \
   30.84 +	 (ishift_temp >> (shft)) | ((~0) << (16-(shft))) : \
   30.85 +	 (ishift_temp >> (shft)))
   30.86 +#else
   30.87 +#define ISHIFT_TEMPS
   30.88 +#define IRIGHT_SHIFT(x,shft)	((x) >> (shft))
   30.89 +#endif
   30.90 +
   30.91 +/* Forward declarations */
   30.92 +METHODDEF(boolean) encode_mcu_DC_first JPP((j_compress_ptr cinfo,
   30.93 +					    JBLOCKROW *MCU_data));
   30.94 +METHODDEF(boolean) encode_mcu_AC_first JPP((j_compress_ptr cinfo,
   30.95 +					    JBLOCKROW *MCU_data));
   30.96 +METHODDEF(boolean) encode_mcu_DC_refine JPP((j_compress_ptr cinfo,
   30.97 +					     JBLOCKROW *MCU_data));
   30.98 +METHODDEF(boolean) encode_mcu_AC_refine JPP((j_compress_ptr cinfo,
   30.99 +					     JBLOCKROW *MCU_data));
  30.100 +METHODDEF(void) finish_pass_phuff JPP((j_compress_ptr cinfo));
  30.101 +METHODDEF(void) finish_pass_gather_phuff JPP((j_compress_ptr cinfo));
  30.102 +
  30.103 +
  30.104 +/*
  30.105 + * Initialize for a Huffman-compressed scan using progressive JPEG.
  30.106 + */
  30.107 +
  30.108 +METHODDEF(void)
  30.109 +start_pass_phuff (j_compress_ptr cinfo, boolean gather_statistics)
  30.110 +{  
  30.111 +  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
  30.112 +  boolean is_DC_band;
  30.113 +  int ci, tbl;
  30.114 +  jpeg_component_info * compptr;
  30.115 +
  30.116 +  entropy->cinfo = cinfo;
  30.117 +  entropy->gather_statistics = gather_statistics;
  30.118 +
  30.119 +  is_DC_band = (cinfo->Ss == 0);
  30.120 +
  30.121 +  /* We assume jcmaster.c already validated the scan parameters. */
  30.122 +
  30.123 +  /* Select execution routines */
  30.124 +  if (cinfo->Ah == 0) {
  30.125 +    if (is_DC_band)
  30.126 +      entropy->pub.encode_mcu = encode_mcu_DC_first;
  30.127 +    else
  30.128 +      entropy->pub.encode_mcu = encode_mcu_AC_first;
  30.129 +  } else {
  30.130 +    if (is_DC_band)
  30.131 +      entropy->pub.encode_mcu = encode_mcu_DC_refine;
  30.132 +    else {
  30.133 +      entropy->pub.encode_mcu = encode_mcu_AC_refine;
  30.134 +      /* AC refinement needs a correction bit buffer */
  30.135 +      if (entropy->bit_buffer == NULL)
  30.136 +	entropy->bit_buffer = (char *)
  30.137 +	  (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
  30.138 +				      MAX_CORR_BITS * SIZEOF(char));
  30.139 +    }
  30.140 +  }
  30.141 +  if (gather_statistics)
  30.142 +    entropy->pub.finish_pass = finish_pass_gather_phuff;
  30.143 +  else
  30.144 +    entropy->pub.finish_pass = finish_pass_phuff;
  30.145 +
  30.146 +  /* Only DC coefficients may be interleaved, so cinfo->comps_in_scan = 1
  30.147 +   * for AC coefficients.
  30.148 +   */
  30.149 +  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
  30.150 +    compptr = cinfo->cur_comp_info[ci];
  30.151 +    /* Initialize DC predictions to 0 */
  30.152 +    entropy->last_dc_val[ci] = 0;
  30.153 +    /* Get table index */
  30.154 +    if (is_DC_band) {
  30.155 +      if (cinfo->Ah != 0)	/* DC refinement needs no table */
  30.156 +	continue;
  30.157 +      tbl = compptr->dc_tbl_no;
  30.158 +    } else {
  30.159 +      entropy->ac_tbl_no = tbl = compptr->ac_tbl_no;
  30.160 +    }
  30.161 +    if (gather_statistics) {
  30.162 +      /* Check for invalid table index */
  30.163 +      /* (make_c_derived_tbl does this in the other path) */
  30.164 +      if (tbl < 0 || tbl >= NUM_HUFF_TBLS)
  30.165 +        ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tbl);
  30.166 +      /* Allocate and zero the statistics tables */
  30.167 +      /* Note that jpeg_gen_optimal_table expects 257 entries in each table! */
  30.168 +      if (entropy->count_ptrs[tbl] == NULL)
  30.169 +	entropy->count_ptrs[tbl] = (long *)
  30.170 +	  (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
  30.171 +				      257 * SIZEOF(long));
  30.172 +      MEMZERO(entropy->count_ptrs[tbl], 257 * SIZEOF(long));
  30.173 +    } else {
  30.174 +      /* Compute derived values for Huffman table */
  30.175 +      /* We may do this more than once for a table, but it's not expensive */
  30.176 +      jpeg_make_c_derived_tbl(cinfo, is_DC_band, tbl,
  30.177 +			      & entropy->derived_tbls[tbl]);
  30.178 +    }
  30.179 +  }
  30.180 +
  30.181 +  /* Initialize AC stuff */
  30.182 +  entropy->EOBRUN = 0;
  30.183 +  entropy->BE = 0;
  30.184 +
  30.185 +  /* Initialize bit buffer to empty */
  30.186 +  entropy->put_buffer = 0;
  30.187 +  entropy->put_bits = 0;
  30.188 +
  30.189 +  /* Initialize restart stuff */
  30.190 +  entropy->restarts_to_go = cinfo->restart_interval;
  30.191 +  entropy->next_restart_num = 0;
  30.192 +}
  30.193 +
  30.194 +
  30.195 +/* Outputting bytes to the file.
  30.196 + * NB: these must be called only when actually outputting,
  30.197 + * that is, entropy->gather_statistics == FALSE.
  30.198 + */
  30.199 +
  30.200 +/* Emit a byte */
  30.201 +#define emit_byte(entropy,val)  \
  30.202 +	{ *(entropy)->next_output_byte++ = (JOCTET) (val);  \
  30.203 +	  if (--(entropy)->free_in_buffer == 0)  \
  30.204 +	    dump_buffer(entropy); }
  30.205 +
  30.206 +
  30.207 +LOCAL(void)
  30.208 +dump_buffer (phuff_entropy_ptr entropy)
  30.209 +/* Empty the output buffer; we do not support suspension in this module. */
  30.210 +{
  30.211 +  struct jpeg_destination_mgr * dest = entropy->cinfo->dest;
  30.212 +
  30.213 +  if (! (*dest->empty_output_buffer) (entropy->cinfo))
  30.214 +    ERREXIT(entropy->cinfo, JERR_CANT_SUSPEND);
  30.215 +  /* After a successful buffer dump, must reset buffer pointers */
  30.216 +  entropy->next_output_byte = dest->next_output_byte;
  30.217 +  entropy->free_in_buffer = dest->free_in_buffer;
  30.218 +}
  30.219 +
  30.220 +
  30.221 +/* Outputting bits to the file */
  30.222 +
  30.223 +/* Only the right 24 bits of put_buffer are used; the valid bits are
  30.224 + * left-justified in this part.  At most 16 bits can be passed to emit_bits
  30.225 + * in one call, and we never retain more than 7 bits in put_buffer
  30.226 + * between calls, so 24 bits are sufficient.
  30.227 + */
  30.228 +
  30.229 +INLINE
  30.230 +LOCAL(void)
  30.231 +emit_bits (phuff_entropy_ptr entropy, unsigned int code, int size)
  30.232 +/* Emit some bits, unless we are in gather mode */
  30.233 +{
  30.234 +  /* This routine is heavily used, so it's worth coding tightly. */
  30.235 +  register INT32 put_buffer = (INT32) code;
  30.236 +  register int put_bits = entropy->put_bits;
  30.237 +
  30.238 +  /* if size is 0, caller used an invalid Huffman table entry */
  30.239 +  if (size == 0)
  30.240 +    ERREXIT(entropy->cinfo, JERR_HUFF_MISSING_CODE);
  30.241 +
  30.242 +  if (entropy->gather_statistics)
  30.243 +    return;			/* do nothing if we're only getting stats */
  30.244 +
  30.245 +  put_buffer &= (((INT32) 1)<<size) - 1; /* mask off any extra bits in code */
  30.246 +  
  30.247 +  put_bits += size;		/* new number of bits in buffer */
  30.248 +  
  30.249 +  put_buffer <<= 24 - put_bits; /* align incoming bits */
  30.250 +
  30.251 +  put_buffer |= entropy->put_buffer; /* and merge with old buffer contents */
  30.252 +
  30.253 +  while (put_bits >= 8) {
  30.254 +    int c = (int) ((put_buffer >> 16) & 0xFF);
  30.255 +    
  30.256 +    emit_byte(entropy, c);
  30.257 +    if (c == 0xFF) {		/* need to stuff a zero byte? */
  30.258 +      emit_byte(entropy, 0);
  30.259 +    }
  30.260 +    put_buffer <<= 8;
  30.261 +    put_bits -= 8;
  30.262 +  }
  30.263 +
  30.264 +  entropy->put_buffer = put_buffer; /* update variables */
  30.265 +  entropy->put_bits = put_bits;
  30.266 +}
  30.267 +
  30.268 +
  30.269 +LOCAL(void)
  30.270 +flush_bits (phuff_entropy_ptr entropy)
  30.271 +{
  30.272 +  emit_bits(entropy, 0x7F, 7); /* fill any partial byte with ones */
  30.273 +  entropy->put_buffer = 0;     /* and reset bit-buffer to empty */
  30.274 +  entropy->put_bits = 0;
  30.275 +}
  30.276 +
  30.277 +
  30.278 +/*
  30.279 + * Emit (or just count) a Huffman symbol.
  30.280 + */
  30.281 +
  30.282 +INLINE
  30.283 +LOCAL(void)
  30.284 +emit_symbol (phuff_entropy_ptr entropy, int tbl_no, int symbol)
  30.285 +{
  30.286 +  if (entropy->gather_statistics)
  30.287 +    entropy->count_ptrs[tbl_no][symbol]++;
  30.288 +  else {
  30.289 +    c_derived_tbl * tbl = entropy->derived_tbls[tbl_no];
  30.290 +    emit_bits(entropy, tbl->ehufco[symbol], tbl->ehufsi[symbol]);
  30.291 +  }
  30.292 +}
  30.293 +
  30.294 +
  30.295 +/*
  30.296 + * Emit bits from a correction bit buffer.
  30.297 + */
  30.298 +
  30.299 +LOCAL(void)
  30.300 +emit_buffered_bits (phuff_entropy_ptr entropy, char * bufstart,
  30.301 +		    unsigned int nbits)
  30.302 +{
  30.303 +  if (entropy->gather_statistics)
  30.304 +    return;			/* no real work */
  30.305 +
  30.306 +  while (nbits > 0) {
  30.307 +    emit_bits(entropy, (unsigned int) (*bufstart), 1);
  30.308 +    bufstart++;
  30.309 +    nbits--;
  30.310 +  }
  30.311 +}
  30.312 +
  30.313 +
  30.314 +/*
  30.315 + * Emit any pending EOBRUN symbol.
  30.316 + */
  30.317 +
  30.318 +LOCAL(void)
  30.319 +emit_eobrun (phuff_entropy_ptr entropy)
  30.320 +{
  30.321 +  register int temp, nbits;
  30.322 +
  30.323 +  if (entropy->EOBRUN > 0) {	/* if there is any pending EOBRUN */
  30.324 +    temp = entropy->EOBRUN;
  30.325 +    nbits = 0;
  30.326 +    while ((temp >>= 1))
  30.327 +      nbits++;
  30.328 +    /* safety check: shouldn't happen given limited correction-bit buffer */
  30.329 +    if (nbits > 14)
  30.330 +      ERREXIT(entropy->cinfo, JERR_HUFF_MISSING_CODE);
  30.331 +
  30.332 +    emit_symbol(entropy, entropy->ac_tbl_no, nbits << 4);
  30.333 +    if (nbits)
  30.334 +      emit_bits(entropy, entropy->EOBRUN, nbits);
  30.335 +
  30.336 +    entropy->EOBRUN = 0;
  30.337 +
  30.338 +    /* Emit any buffered correction bits */
  30.339 +    emit_buffered_bits(entropy, entropy->bit_buffer, entropy->BE);
  30.340 +    entropy->BE = 0;
  30.341 +  }
  30.342 +}
  30.343 +
  30.344 +
  30.345 +/*
  30.346 + * Emit a restart marker & resynchronize predictions.
  30.347 + */
  30.348 +
  30.349 +LOCAL(void)
  30.350 +emit_restart (phuff_entropy_ptr entropy, int restart_num)
  30.351 +{
  30.352 +  int ci;
  30.353 +
  30.354 +  emit_eobrun(entropy);
  30.355 +
  30.356 +  if (! entropy->gather_statistics) {
  30.357 +    flush_bits(entropy);
  30.358 +    emit_byte(entropy, 0xFF);
  30.359 +    emit_byte(entropy, JPEG_RST0 + restart_num);
  30.360 +  }
  30.361 +
  30.362 +  if (entropy->cinfo->Ss == 0) {
  30.363 +    /* Re-initialize DC predictions to 0 */
  30.364 +    for (ci = 0; ci < entropy->cinfo->comps_in_scan; ci++)
  30.365 +      entropy->last_dc_val[ci] = 0;
  30.366 +  } else {
  30.367 +    /* Re-initialize all AC-related fields to 0 */
  30.368 +    entropy->EOBRUN = 0;
  30.369 +    entropy->BE = 0;
  30.370 +  }
  30.371 +}
  30.372 +
  30.373 +
  30.374 +/*
  30.375 + * MCU encoding for DC initial scan (either spectral selection,
  30.376 + * or first pass of successive approximation).
  30.377 + */
  30.378 +
  30.379 +METHODDEF(boolean)
  30.380 +encode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
  30.381 +{
  30.382 +  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
  30.383 +  register int temp, temp2;
  30.384 +  register int nbits;
  30.385 +  int blkn, ci;
  30.386 +  int Al = cinfo->Al;
  30.387 +  JBLOCKROW block;
  30.388 +  jpeg_component_info * compptr;
  30.389 +  ISHIFT_TEMPS
  30.390 +
  30.391 +  entropy->next_output_byte = cinfo->dest->next_output_byte;
  30.392 +  entropy->free_in_buffer = cinfo->dest->free_in_buffer;
  30.393 +
  30.394 +  /* Emit restart marker if needed */
  30.395 +  if (cinfo->restart_interval)
  30.396 +    if (entropy->restarts_to_go == 0)
  30.397 +      emit_restart(entropy, entropy->next_restart_num);
  30.398 +
  30.399 +  /* Encode the MCU data blocks */
  30.400 +  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
  30.401 +    block = MCU_data[blkn];
  30.402 +    ci = cinfo->MCU_membership[blkn];
  30.403 +    compptr = cinfo->cur_comp_info[ci];
  30.404 +
  30.405 +    /* Compute the DC value after the required point transform by Al.
  30.406 +     * This is simply an arithmetic right shift.
  30.407 +     */
  30.408 +    temp2 = IRIGHT_SHIFT((int) ((*block)[0]), Al);
  30.409 +
  30.410 +    /* DC differences are figured on the point-transformed values. */
  30.411 +    temp = temp2 - entropy->last_dc_val[ci];
  30.412 +    entropy->last_dc_val[ci] = temp2;
  30.413 +
  30.414 +    /* Encode the DC coefficient difference per section G.1.2.1 */
  30.415 +    temp2 = temp;
  30.416 +    if (temp < 0) {
  30.417 +      temp = -temp;		/* temp is abs value of input */
  30.418 +      /* For a negative input, want temp2 = bitwise complement of abs(input) */
  30.419 +      /* This code assumes we are on a two's complement machine */
  30.420 +      temp2--;
  30.421 +    }
  30.422 +    
  30.423 +    /* Find the number of bits needed for the magnitude of the coefficient */
  30.424 +    nbits = 0;
  30.425 +    while (temp) {
  30.426 +      nbits++;
  30.427 +      temp >>= 1;
  30.428 +    }
  30.429 +    /* Check for out-of-range coefficient values.
  30.430 +     * Since we're encoding a difference, the range limit is twice as much.
  30.431 +     */
  30.432 +    if (nbits > MAX_COEF_BITS+1)
  30.433 +      ERREXIT(cinfo, JERR_BAD_DCT_COEF);
  30.434 +    
  30.435 +    /* Count/emit the Huffman-coded symbol for the number of bits */
  30.436 +    emit_symbol(entropy, compptr->dc_tbl_no, nbits);
  30.437 +    
  30.438 +    /* Emit that number of bits of the value, if positive, */
  30.439 +    /* or the complement of its magnitude, if negative. */
  30.440 +    if (nbits)			/* emit_bits rejects calls with size 0 */
  30.441 +      emit_bits(entropy, (unsigned int) temp2, nbits);
  30.442 +  }
  30.443 +
  30.444 +  cinfo->dest->next_output_byte = entropy->next_output_byte;
  30.445 +  cinfo->dest->free_in_buffer = entropy->free_in_buffer;
  30.446 +
  30.447 +  /* Update restart-interval state too */
  30.448 +  if (cinfo->restart_interval) {
  30.449 +    if (entropy->restarts_to_go == 0) {
  30.450 +      entropy->restarts_to_go = cinfo->restart_interval;
  30.451 +      entropy->next_restart_num++;
  30.452 +      entropy->next_restart_num &= 7;
  30.453 +    }
  30.454 +    entropy->restarts_to_go--;
  30.455 +  }
  30.456 +
  30.457 +  return TRUE;
  30.458 +}
  30.459 +
  30.460 +
  30.461 +/*
  30.462 + * MCU encoding for AC initial scan (either spectral selection,
  30.463 + * or first pass of successive approximation).
  30.464 + */
  30.465 +
  30.466 +METHODDEF(boolean)
  30.467 +encode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
  30.468 +{
  30.469 +  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
  30.470 +  register int temp, temp2;
  30.471 +  register int nbits;
  30.472 +  register int r, k;
  30.473 +  int Se = cinfo->Se;
  30.474 +  int Al = cinfo->Al;
  30.475 +  JBLOCKROW block;
  30.476 +
  30.477 +  entropy->next_output_byte = cinfo->dest->next_output_byte;
  30.478 +  entropy->free_in_buffer = cinfo->dest->free_in_buffer;
  30.479 +
  30.480 +  /* Emit restart marker if needed */
  30.481 +  if (cinfo->restart_interval)
  30.482 +    if (entropy->restarts_to_go == 0)
  30.483 +      emit_restart(entropy, entropy->next_restart_num);
  30.484 +
  30.485 +  /* Encode the MCU data block */
  30.486 +  block = MCU_data[0];
  30.487 +
  30.488 +  /* Encode the AC coefficients per section G.1.2.2, fig. G.3 */
  30.489 +  
  30.490 +  r = 0;			/* r = run length of zeros */
  30.491 +   
  30.492 +  for (k = cinfo->Ss; k <= Se; k++) {
  30.493 +    if ((temp = (*block)[jpeg_natural_order[k]]) == 0) {
  30.494 +      r++;
  30.495 +      continue;
  30.496 +    }
  30.497 +    /* We must apply the point transform by Al.  For AC coefficients this
  30.498 +     * is an integer division with rounding towards 0.  To do this portably
  30.499 +     * in C, we shift after obtaining the absolute value; so the code is
  30.500 +     * interwoven with finding the abs value (temp) and output bits (temp2).
  30.501 +     */
  30.502 +    if (temp < 0) {
  30.503 +      temp = -temp;		/* temp is abs value of input */
  30.504 +      temp >>= Al;		/* apply the point transform */
  30.505 +      /* For a negative coef, want temp2 = bitwise complement of abs(coef) */
  30.506 +      temp2 = ~temp;
  30.507 +    } else {
  30.508 +      temp >>= Al;		/* apply the point transform */
  30.509 +      temp2 = temp;
  30.510 +    }
  30.511 +    /* Watch out for case that nonzero coef is zero after point transform */
  30.512 +    if (temp == 0) {
  30.513 +      r++;
  30.514 +      continue;
  30.515 +    }
  30.516 +
  30.517 +    /* Emit any pending EOBRUN */
  30.518 +    if (entropy->EOBRUN > 0)
  30.519 +      emit_eobrun(entropy);
  30.520 +    /* if run length > 15, must emit special run-length-16 codes (0xF0) */
  30.521 +    while (r > 15) {
  30.522 +      emit_symbol(entropy, entropy->ac_tbl_no, 0xF0);
  30.523 +      r -= 16;
  30.524 +    }
  30.525 +
  30.526 +    /* Find the number of bits needed for the magnitude of the coefficient */
  30.527 +    nbits = 1;			/* there must be at least one 1 bit */
  30.528 +    while ((temp >>= 1))
  30.529 +      nbits++;
  30.530 +    /* Check for out-of-range coefficient values */
  30.531 +    if (nbits > MAX_COEF_BITS)
  30.532 +      ERREXIT(cinfo, JERR_BAD_DCT_COEF);
  30.533 +
  30.534 +    /* Count/emit Huffman symbol for run length / number of bits */
  30.535 +    emit_symbol(entropy, entropy->ac_tbl_no, (r << 4) + nbits);
  30.536 +
  30.537 +    /* Emit that number of bits of the value, if positive, */
  30.538 +    /* or the complement of its magnitude, if negative. */
  30.539 +    emit_bits(entropy, (unsigned int) temp2, nbits);
  30.540 +
  30.541 +    r = 0;			/* reset zero run length */
  30.542 +  }
  30.543 +
  30.544 +  if (r > 0) {			/* If there are trailing zeroes, */
  30.545 +    entropy->EOBRUN++;		/* count an EOB */
  30.546 +    if (entropy->EOBRUN == 0x7FFF)
  30.547 +      emit_eobrun(entropy);	/* force it out to avoid overflow */
  30.548 +  }
  30.549 +
  30.550 +  cinfo->dest->next_output_byte = entropy->next_output_byte;
  30.551 +  cinfo->dest->free_in_buffer = entropy->free_in_buffer;
  30.552 +
  30.553 +  /* Update restart-interval state too */
  30.554 +  if (cinfo->restart_interval) {
  30.555 +    if (entropy->restarts_to_go == 0) {
  30.556 +      entropy->restarts_to_go = cinfo->restart_interval;
  30.557 +      entropy->next_restart_num++;
  30.558 +      entropy->next_restart_num &= 7;
  30.559 +    }
  30.560 +    entropy->restarts_to_go--;
  30.561 +  }
  30.562 +
  30.563 +  return TRUE;
  30.564 +}
  30.565 +
  30.566 +
  30.567 +/*
  30.568 + * MCU encoding for DC successive approximation refinement scan.
  30.569 + * Note: we assume such scans can be multi-component, although the spec
  30.570 + * is not very clear on the point.
  30.571 + */
  30.572 +
  30.573 +METHODDEF(boolean)
  30.574 +encode_mcu_DC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
  30.575 +{
  30.576 +  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
  30.577 +  register int temp;
  30.578 +  int blkn;
  30.579 +  int Al = cinfo->Al;
  30.580 +  JBLOCKROW block;
  30.581 +
  30.582 +  entropy->next_output_byte = cinfo->dest->next_output_byte;
  30.583 +  entropy->free_in_buffer = cinfo->dest->free_in_buffer;
  30.584 +
  30.585 +  /* Emit restart marker if needed */
  30.586 +  if (cinfo->restart_interval)
  30.587 +    if (entropy->restarts_to_go == 0)
  30.588 +      emit_restart(entropy, entropy->next_restart_num);
  30.589 +
  30.590 +  /* Encode the MCU data blocks */
  30.591 +  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
  30.592 +    block = MCU_data[blkn];
  30.593 +
  30.594 +    /* We simply emit the Al'th bit of the DC coefficient value. */
  30.595 +    temp = (*block)[0];
  30.596 +    emit_bits(entropy, (unsigned int) (temp >> Al), 1);
  30.597 +  }
  30.598 +
  30.599 +  cinfo->dest->next_output_byte = entropy->next_output_byte;
  30.600 +  cinfo->dest->free_in_buffer = entropy->free_in_buffer;
  30.601 +
  30.602 +  /* Update restart-interval state too */
  30.603 +  if (cinfo->restart_interval) {
  30.604 +    if (entropy->restarts_to_go == 0) {
  30.605 +      entropy->restarts_to_go = cinfo->restart_interval;
  30.606 +      entropy->next_restart_num++;
  30.607 +      entropy->next_restart_num &= 7;
  30.608 +    }
  30.609 +    entropy->restarts_to_go--;
  30.610 +  }
  30.611 +
  30.612 +  return TRUE;
  30.613 +}
  30.614 +
  30.615 +
  30.616 +/*
  30.617 + * MCU encoding for AC successive approximation refinement scan.
  30.618 + */
  30.619 +
  30.620 +METHODDEF(boolean)
  30.621 +encode_mcu_AC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
  30.622 +{
  30.623 +  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
  30.624 +  register int temp;
  30.625 +  register int r, k;
  30.626 +  int EOB;
  30.627 +  char *BR_buffer;
  30.628 +  unsigned int BR;
  30.629 +  int Se = cinfo->Se;
  30.630 +  int Al = cinfo->Al;
  30.631 +  JBLOCKROW block;
  30.632 +  int absvalues[DCTSIZE2];
  30.633 +
  30.634 +  entropy->next_output_byte = cinfo->dest->next_output_byte;
  30.635 +  entropy->free_in_buffer = cinfo->dest->free_in_buffer;
  30.636 +
  30.637 +  /* Emit restart marker if needed */
  30.638 +  if (cinfo->restart_interval)
  30.639 +    if (entropy->restarts_to_go == 0)
  30.640 +      emit_restart(entropy, entropy->next_restart_num);
  30.641 +
  30.642 +  /* Encode the MCU data block */
  30.643 +  block = MCU_data[0];
  30.644 +
  30.645 +  /* It is convenient to make a pre-pass to determine the transformed
  30.646 +   * coefficients' absolute values and the EOB position.
  30.647 +   */
  30.648 +  EOB = 0;
  30.649 +  for (k = cinfo->Ss; k <= Se; k++) {
  30.650 +    temp = (*block)[jpeg_natural_order[k]];
  30.651 +    /* We must apply the point transform by Al.  For AC coefficients this
  30.652 +     * is an integer division with rounding towards 0.  To do this portably
  30.653 +     * in C, we shift after obtaining the absolute value.
  30.654 +     */
  30.655 +    if (temp < 0)
  30.656 +      temp = -temp;		/* temp is abs value of input */
  30.657 +    temp >>= Al;		/* apply the point transform */
  30.658 +    absvalues[k] = temp;	/* save abs value for main pass */
  30.659 +    if (temp == 1)
  30.660 +      EOB = k;			/* EOB = index of last newly-nonzero coef */
  30.661 +  }
  30.662 +
  30.663 +  /* Encode the AC coefficients per section G.1.2.3, fig. G.7 */
  30.664 +  
  30.665 +  r = 0;			/* r = run length of zeros */
  30.666 +  BR = 0;			/* BR = count of buffered bits added now */
  30.667 +  BR_buffer = entropy->bit_buffer + entropy->BE; /* Append bits to buffer */
  30.668 +
  30.669 +  for (k = cinfo->Ss; k <= Se; k++) {
  30.670 +    if ((temp = absvalues[k]) == 0) {
  30.671 +      r++;
  30.672 +      continue;
  30.673 +    }
  30.674 +
  30.675 +    /* Emit any required ZRLs, but not if they can be folded into EOB */
  30.676 +    while (r > 15 && k <= EOB) {
  30.677 +      /* emit any pending EOBRUN and the BE correction bits */
  30.678 +      emit_eobrun(entropy);
  30.679 +      /* Emit ZRL */
  30.680 +      emit_symbol(entropy, entropy->ac_tbl_no, 0xF0);
  30.681 +      r -= 16;
  30.682 +      /* Emit buffered correction bits that must be associated with ZRL */
  30.683 +      emit_buffered_bits(entropy, BR_buffer, BR);
  30.684 +      BR_buffer = entropy->bit_buffer; /* BE bits are gone now */
  30.685 +      BR = 0;
  30.686 +    }
  30.687 +
  30.688 +    /* If the coef was previously nonzero, it only needs a correction bit.
  30.689 +     * NOTE: a straight translation of the spec's figure G.7 would suggest
  30.690 +     * that we also need to test r > 15.  But if r > 15, we can only get here
  30.691 +     * if k > EOB, which implies that this coefficient is not 1.
  30.692 +     */
  30.693 +    if (temp > 1) {
  30.694 +      /* The correction bit is the next bit of the absolute value. */
  30.695 +      BR_buffer[BR++] = (char) (temp & 1);
  30.696 +      continue;
  30.697 +    }
  30.698 +
  30.699 +    /* Emit any pending EOBRUN and the BE correction bits */
  30.700 +    emit_eobrun(entropy);
  30.701 +
  30.702 +    /* Count/emit Huffman symbol for run length / number of bits */
  30.703 +    emit_symbol(entropy, entropy->ac_tbl_no, (r << 4) + 1);
  30.704 +
  30.705 +    /* Emit output bit for newly-nonzero coef */
  30.706 +    temp = ((*block)[jpeg_natural_order[k]] < 0) ? 0 : 1;
  30.707 +    emit_bits(entropy, (unsigned int) temp, 1);
  30.708 +
  30.709 +    /* Emit buffered correction bits that must be associated with this code */
  30.710 +    emit_buffered_bits(entropy, BR_buffer, BR);
  30.711 +    BR_buffer = entropy->bit_buffer; /* BE bits are gone now */
  30.712 +    BR = 0;
  30.713 +    r = 0;			/* reset zero run length */
  30.714 +  }
  30.715 +
  30.716 +  if (r > 0 || BR > 0) {	/* If there are trailing zeroes, */
  30.717 +    entropy->EOBRUN++;		/* count an EOB */
  30.718 +    entropy->BE += BR;		/* concat my correction bits to older ones */
  30.719 +    /* We force out the EOB if we risk either:
  30.720 +     * 1. overflow of the EOB counter;
  30.721 +     * 2. overflow of the correction bit buffer during the next MCU.
  30.722 +     */
  30.723 +    if (entropy->EOBRUN == 0x7FFF || entropy->BE > (MAX_CORR_BITS-DCTSIZE2+1))
  30.724 +      emit_eobrun(entropy);
  30.725 +  }
  30.726 +
  30.727 +  cinfo->dest->next_output_byte = entropy->next_output_byte;
  30.728 +  cinfo->dest->free_in_buffer = entropy->free_in_buffer;
  30.729 +
  30.730 +  /* Update restart-interval state too */
  30.731 +  if (cinfo->restart_interval) {
  30.732 +    if (entropy->restarts_to_go == 0) {
  30.733 +      entropy->restarts_to_go = cinfo->restart_interval;
  30.734 +      entropy->next_restart_num++;
  30.735 +      entropy->next_restart_num &= 7;
  30.736 +    }
  30.737 +    entropy->restarts_to_go--;
  30.738 +  }
  30.739 +
  30.740 +  return TRUE;
  30.741 +}
  30.742 +
  30.743 +
  30.744 +/*
  30.745 + * Finish up at the end of a Huffman-compressed progressive scan.
  30.746 + */
  30.747 +
  30.748 +METHODDEF(void)
  30.749 +finish_pass_phuff (j_compress_ptr cinfo)
  30.750 +{   
  30.751 +  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
  30.752 +
  30.753 +  entropy->next_output_byte = cinfo->dest->next_output_byte;
  30.754 +  entropy->free_in_buffer = cinfo->dest->free_in_buffer;
  30.755 +
  30.756 +  /* Flush out any buffered data */
  30.757 +  emit_eobrun(entropy);
  30.758 +  flush_bits(entropy);
  30.759 +
  30.760 +  cinfo->dest->next_output_byte = entropy->next_output_byte;
  30.761 +  cinfo->dest->free_in_buffer = entropy->free_in_buffer;
  30.762 +}
  30.763 +
  30.764 +
  30.765 +/*
  30.766 + * Finish up a statistics-gathering pass and create the new Huffman tables.
  30.767 + */
  30.768 +
  30.769 +METHODDEF(void)
  30.770 +finish_pass_gather_phuff (j_compress_ptr cinfo)
  30.771 +{
  30.772 +  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
  30.773 +  boolean is_DC_band;
  30.774 +  int ci, tbl;
  30.775 +  jpeg_component_info * compptr;
  30.776 +  JHUFF_TBL **htblptr;
  30.777 +  boolean did[NUM_HUFF_TBLS];
  30.778 +
  30.779 +  /* Flush out buffered data (all we care about is counting the EOB symbol) */
  30.780 +  emit_eobrun(entropy);
  30.781 +
  30.782 +  is_DC_band = (cinfo->Ss == 0);
  30.783 +
  30.784 +  /* It's important not to apply jpeg_gen_optimal_table more than once
  30.785 +   * per table, because it clobbers the input frequency counts!
  30.786 +   */
  30.787 +  MEMZERO(did, SIZEOF(did));
  30.788 +
  30.789 +  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
  30.790 +    compptr = cinfo->cur_comp_info[ci];
  30.791 +    if (is_DC_band) {
  30.792 +      if (cinfo->Ah != 0)	/* DC refinement needs no table */
  30.793 +	continue;
  30.794 +      tbl = compptr->dc_tbl_no;
  30.795 +    } else {
  30.796 +      tbl = compptr->ac_tbl_no;
  30.797 +    }
  30.798 +    if (! did[tbl]) {
  30.799 +      if (is_DC_band)
  30.800 +        htblptr = & cinfo->dc_huff_tbl_ptrs[tbl];
  30.801 +      else
  30.802 +        htblptr = & cinfo->ac_huff_tbl_ptrs[tbl];
  30.803 +      if (*htblptr == NULL)
  30.804 +        *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);
  30.805 +      jpeg_gen_optimal_table(cinfo, *htblptr, entropy->count_ptrs[tbl]);
  30.806 +      did[tbl] = TRUE;
  30.807 +    }
  30.808 +  }
  30.809 +}
  30.810 +
  30.811 +
  30.812 +/*
  30.813 + * Module initialization routine for progressive Huffman entropy encoding.
  30.814 + */
  30.815 +
  30.816 +GLOBAL(void)
  30.817 +jinit_phuff_encoder (j_compress_ptr cinfo)
  30.818 +{
  30.819 +  phuff_entropy_ptr entropy;
  30.820 +  int i;
  30.821 +
  30.822 +  entropy = (phuff_entropy_ptr)
  30.823 +    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
  30.824 +				SIZEOF(phuff_entropy_encoder));
  30.825 +  cinfo->entropy = (struct jpeg_entropy_encoder *) entropy;
  30.826 +  entropy->pub.start_pass = start_pass_phuff;
  30.827 +
  30.828 +  /* Mark tables unallocated */
  30.829 +  for (i = 0; i < NUM_HUFF_TBLS; i++) {
  30.830 +    entropy->derived_tbls[i] = NULL;
  30.831 +    entropy->count_ptrs[i] = NULL;
  30.832 +  }
  30.833 +  entropy->bit_buffer = NULL;	/* needed only in AC refinement scan */
  30.834 +}
  30.835 +
  30.836 +#endif /* C_PROGRESSIVE_SUPPORTED */
    31.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    31.2 +++ b/libs/libjpeg/jcprepct.c	Sun Nov 01 00:36:56 2015 +0200
    31.3 @@ -0,0 +1,354 @@
    31.4 +/*
    31.5 + * jcprepct.c
    31.6 + *
    31.7 + * Copyright (C) 1994-1996, Thomas G. Lane.
    31.8 + * This file is part of the Independent JPEG Group's software.
    31.9 + * For conditions of distribution and use, see the accompanying README file.
   31.10 + *
   31.11 + * This file contains the compression preprocessing controller.
   31.12 + * This controller manages the color conversion, downsampling,
   31.13 + * and edge expansion steps.
   31.14 + *
   31.15 + * Most of the complexity here is associated with buffering input rows
   31.16 + * as required by the downsampler.  See the comments at the head of
   31.17 + * jcsample.c for the downsampler's needs.
   31.18 + */
   31.19 +
   31.20 +#define JPEG_INTERNALS
   31.21 +#include "jinclude.h"
   31.22 +#include "jpeglib.h"
   31.23 +
   31.24 +
   31.25 +/* At present, jcsample.c can request context rows only for smoothing.
   31.26 + * In the future, we might also need context rows for CCIR601 sampling
   31.27 + * or other more-complex downsampling procedures.  The code to support
   31.28 + * context rows should be compiled only if needed.
   31.29 + */
   31.30 +#ifdef INPUT_SMOOTHING_SUPPORTED
   31.31 +#define CONTEXT_ROWS_SUPPORTED
   31.32 +#endif
   31.33 +
   31.34 +
   31.35 +/*
   31.36 + * For the simple (no-context-row) case, we just need to buffer one
   31.37 + * row group's worth of pixels for the downsampling step.  At the bottom of
   31.38 + * the image, we pad to a full row group by replicating the last pixel row.
   31.39 + * The downsampler's last output row is then replicated if needed to pad
   31.40 + * out to a full iMCU row.
   31.41 + *
   31.42 + * When providing context rows, we must buffer three row groups' worth of
   31.43 + * pixels.  Three row groups are physically allocated, but the row pointer
   31.44 + * arrays are made five row groups high, with the extra pointers above and
   31.45 + * below "wrapping around" to point to the last and first real row groups.
   31.46 + * This allows the downsampler to access the proper context rows.
   31.47 + * At the top and bottom of the image, we create dummy context rows by
   31.48 + * copying the first or last real pixel row.  This copying could be avoided
   31.49 + * by pointer hacking as is done in jdmainct.c, but it doesn't seem worth the
   31.50 + * trouble on the compression side.
   31.51 + */
   31.52 +
   31.53 +
   31.54 +/* Private buffer controller object */
   31.55 +
   31.56 +typedef struct {
   31.57 +  struct jpeg_c_prep_controller pub; /* public fields */
   31.58 +
   31.59 +  /* Downsampling input buffer.  This buffer holds color-converted data
   31.60 +   * until we have enough to do a downsample step.
   31.61 +   */
   31.62 +  JSAMPARRAY color_buf[MAX_COMPONENTS];
   31.63 +
   31.64 +  JDIMENSION rows_to_go;	/* counts rows remaining in source image */
   31.65 +  int next_buf_row;		/* index of next row to store in color_buf */
   31.66 +
   31.67 +#ifdef CONTEXT_ROWS_SUPPORTED	/* only needed for context case */
   31.68 +  int this_row_group;		/* starting row index of group to process */
   31.69 +  int next_buf_stop;		/* downsample when we reach this index */
   31.70 +#endif
   31.71 +} my_prep_controller;
   31.72 +
   31.73 +typedef my_prep_controller * my_prep_ptr;
   31.74 +
   31.75 +
   31.76 +/*
   31.77 + * Initialize for a processing pass.
   31.78 + */
   31.79 +
   31.80 +METHODDEF(void)
   31.81 +start_pass_prep (j_compress_ptr cinfo, J_BUF_MODE pass_mode)
   31.82 +{
   31.83 +  my_prep_ptr prep = (my_prep_ptr) cinfo->prep;
   31.84 +
   31.85 +  if (pass_mode != JBUF_PASS_THRU)
   31.86 +    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
   31.87 +
   31.88 +  /* Initialize total-height counter for detecting bottom of image */
   31.89 +  prep->rows_to_go = cinfo->image_height;
   31.90 +  /* Mark the conversion buffer empty */
   31.91 +  prep->next_buf_row = 0;
   31.92 +#ifdef CONTEXT_ROWS_SUPPORTED
   31.93 +  /* Preset additional state variables for context mode.
   31.94 +   * These aren't used in non-context mode, so we needn't test which mode.
   31.95 +   */
   31.96 +  prep->this_row_group = 0;
   31.97 +  /* Set next_buf_stop to stop after two row groups have been read in. */
   31.98 +  prep->next_buf_stop = 2 * cinfo->max_v_samp_factor;
   31.99 +#endif
  31.100 +}
  31.101 +
  31.102 +
  31.103 +/*
  31.104 + * Expand an image vertically from height input_rows to height output_rows,
  31.105 + * by duplicating the bottom row.
  31.106 + */
  31.107 +
  31.108 +LOCAL(void)
  31.109 +expand_bottom_edge (JSAMPARRAY image_data, JDIMENSION num_cols,
  31.110 +		    int input_rows, int output_rows)
  31.111 +{
  31.112 +  register int row;
  31.113 +
  31.114 +  for (row = input_rows; row < output_rows; row++) {
  31.115 +    jcopy_sample_rows(image_data, input_rows-1, image_data, row,
  31.116 +		      1, num_cols);
  31.117 +  }
  31.118 +}
  31.119 +
  31.120 +
  31.121 +/*
  31.122 + * Process some data in the simple no-context case.
  31.123 + *
  31.124 + * Preprocessor output data is counted in "row groups".  A row group
  31.125 + * is defined to be v_samp_factor sample rows of each component.
  31.126 + * Downsampling will produce this much data from each max_v_samp_factor
  31.127 + * input rows.
  31.128 + */
  31.129 +
  31.130 +METHODDEF(void)
  31.131 +pre_process_data (j_compress_ptr cinfo,
  31.132 +		  JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
  31.133 +		  JDIMENSION in_rows_avail,
  31.134 +		  JSAMPIMAGE output_buf, JDIMENSION *out_row_group_ctr,
  31.135 +		  JDIMENSION out_row_groups_avail)
  31.136 +{
  31.137 +  my_prep_ptr prep = (my_prep_ptr) cinfo->prep;
  31.138 +  int numrows, ci;
  31.139 +  JDIMENSION inrows;
  31.140 +  jpeg_component_info * compptr;
  31.141 +
  31.142 +  while (*in_row_ctr < in_rows_avail &&
  31.143 +	 *out_row_group_ctr < out_row_groups_avail) {
  31.144 +    /* Do color conversion to fill the conversion buffer. */
  31.145 +    inrows = in_rows_avail - *in_row_ctr;
  31.146 +    numrows = cinfo->max_v_samp_factor - prep->next_buf_row;
  31.147 +    numrows = (int) MIN((JDIMENSION) numrows, inrows);
  31.148 +    (*cinfo->cconvert->color_convert) (cinfo, input_buf + *in_row_ctr,
  31.149 +				       prep->color_buf,
  31.150 +				       (JDIMENSION) prep->next_buf_row,
  31.151 +				       numrows);
  31.152 +    *in_row_ctr += numrows;
  31.153 +    prep->next_buf_row += numrows;
  31.154 +    prep->rows_to_go -= numrows;
  31.155 +    /* If at bottom of image, pad to fill the conversion buffer. */
  31.156 +    if (prep->rows_to_go == 0 &&
  31.157 +	prep->next_buf_row < cinfo->max_v_samp_factor) {
  31.158 +      for (ci = 0; ci < cinfo->num_components; ci++) {
  31.159 +	expand_bottom_edge(prep->color_buf[ci], cinfo->image_width,
  31.160 +			   prep->next_buf_row, cinfo->max_v_samp_factor);
  31.161 +      }
  31.162 +      prep->next_buf_row = cinfo->max_v_samp_factor;
  31.163 +    }
  31.164 +    /* If we've filled the conversion buffer, empty it. */
  31.165 +    if (prep->next_buf_row == cinfo->max_v_samp_factor) {
  31.166 +      (*cinfo->downsample->downsample) (cinfo,
  31.167 +					prep->color_buf, (JDIMENSION) 0,
  31.168 +					output_buf, *out_row_group_ctr);
  31.169 +      prep->next_buf_row = 0;
  31.170 +      (*out_row_group_ctr)++;
  31.171 +    }
  31.172 +    /* If at bottom of image, pad the output to a full iMCU height.
  31.173 +     * Note we assume the caller is providing a one-iMCU-height output buffer!
  31.174 +     */
  31.175 +    if (prep->rows_to_go == 0 &&
  31.176 +	*out_row_group_ctr < out_row_groups_avail) {
  31.177 +      for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  31.178 +	   ci++, compptr++) {
  31.179 +	expand_bottom_edge(output_buf[ci],
  31.180 +			   compptr->width_in_blocks * DCTSIZE,
  31.181 +			   (int) (*out_row_group_ctr * compptr->v_samp_factor),
  31.182 +			   (int) (out_row_groups_avail * compptr->v_samp_factor));
  31.183 +      }
  31.184 +      *out_row_group_ctr = out_row_groups_avail;
  31.185 +      break;			/* can exit outer loop without test */
  31.186 +    }
  31.187 +  }
  31.188 +}
  31.189 +
  31.190 +
  31.191 +#ifdef CONTEXT_ROWS_SUPPORTED
  31.192 +
  31.193 +/*
  31.194 + * Process some data in the context case.
  31.195 + */
  31.196 +
  31.197 +METHODDEF(void)
  31.198 +pre_process_context (j_compress_ptr cinfo,
  31.199 +		     JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
  31.200 +		     JDIMENSION in_rows_avail,
  31.201 +		     JSAMPIMAGE output_buf, JDIMENSION *out_row_group_ctr,
  31.202 +		     JDIMENSION out_row_groups_avail)
  31.203 +{
  31.204 +  my_prep_ptr prep = (my_prep_ptr) cinfo->prep;
  31.205 +  int numrows, ci;
  31.206 +  int buf_height = cinfo->max_v_samp_factor * 3;
  31.207 +  JDIMENSION inrows;
  31.208 +
  31.209 +  while (*out_row_group_ctr < out_row_groups_avail) {
  31.210 +    if (*in_row_ctr < in_rows_avail) {
  31.211 +      /* Do color conversion to fill the conversion buffer. */
  31.212 +      inrows = in_rows_avail - *in_row_ctr;
  31.213 +      numrows = prep->next_buf_stop - prep->next_buf_row;
  31.214 +      numrows = (int) MIN((JDIMENSION) numrows, inrows);
  31.215 +      (*cinfo->cconvert->color_convert) (cinfo, input_buf + *in_row_ctr,
  31.216 +					 prep->color_buf,
  31.217 +					 (JDIMENSION) prep->next_buf_row,
  31.218 +					 numrows);
  31.219 +      /* Pad at top of image, if first time through */
  31.220 +      if (prep->rows_to_go == cinfo->image_height) {
  31.221 +	for (ci = 0; ci < cinfo->num_components; ci++) {
  31.222 +	  int row;
  31.223 +	  for (row = 1; row <= cinfo->max_v_samp_factor; row++) {
  31.224 +	    jcopy_sample_rows(prep->color_buf[ci], 0,
  31.225 +			      prep->color_buf[ci], -row,
  31.226 +			      1, cinfo->image_width);
  31.227 +	  }
  31.228 +	}
  31.229 +      }
  31.230 +      *in_row_ctr += numrows;
  31.231 +      prep->next_buf_row += numrows;
  31.232 +      prep->rows_to_go -= numrows;
  31.233 +    } else {
  31.234 +      /* Return for more data, unless we are at the bottom of the image. */
  31.235 +      if (prep->rows_to_go != 0)
  31.236 +	break;
  31.237 +      /* When at bottom of image, pad to fill the conversion buffer. */
  31.238 +      if (prep->next_buf_row < prep->next_buf_stop) {
  31.239 +	for (ci = 0; ci < cinfo->num_components; ci++) {
  31.240 +	  expand_bottom_edge(prep->color_buf[ci], cinfo->image_width,
  31.241 +			     prep->next_buf_row, prep->next_buf_stop);
  31.242 +	}
  31.243 +	prep->next_buf_row = prep->next_buf_stop;
  31.244 +      }
  31.245 +    }
  31.246 +    /* If we've gotten enough data, downsample a row group. */
  31.247 +    if (prep->next_buf_row == prep->next_buf_stop) {
  31.248 +      (*cinfo->downsample->downsample) (cinfo,
  31.249 +					prep->color_buf,
  31.250 +					(JDIMENSION) prep->this_row_group,
  31.251 +					output_buf, *out_row_group_ctr);
  31.252 +      (*out_row_group_ctr)++;
  31.253 +      /* Advance pointers with wraparound as necessary. */
  31.254 +      prep->this_row_group += cinfo->max_v_samp_factor;
  31.255 +      if (prep->this_row_group >= buf_height)
  31.256 +	prep->this_row_group = 0;
  31.257 +      if (prep->next_buf_row >= buf_height)
  31.258 +	prep->next_buf_row = 0;
  31.259 +      prep->next_buf_stop = prep->next_buf_row + cinfo->max_v_samp_factor;
  31.260 +    }
  31.261 +  }
  31.262 +}
  31.263 +
  31.264 +
  31.265 +/*
  31.266 + * Create the wrapped-around downsampling input buffer needed for context mode.
  31.267 + */
  31.268 +
  31.269 +LOCAL(void)
  31.270 +create_context_buffer (j_compress_ptr cinfo)
  31.271 +{
  31.272 +  my_prep_ptr prep = (my_prep_ptr) cinfo->prep;
  31.273 +  int rgroup_height = cinfo->max_v_samp_factor;
  31.274 +  int ci, i;
  31.275 +  jpeg_component_info * compptr;
  31.276 +  JSAMPARRAY true_buffer, fake_buffer;
  31.277 +
  31.278 +  /* Grab enough space for fake row pointers for all the components;
  31.279 +   * we need five row groups' worth of pointers for each component.
  31.280 +   */
  31.281 +  fake_buffer = (JSAMPARRAY)
  31.282 +    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
  31.283 +				(cinfo->num_components * 5 * rgroup_height) *
  31.284 +				SIZEOF(JSAMPROW));
  31.285 +
  31.286 +  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  31.287 +       ci++, compptr++) {
  31.288 +    /* Allocate the actual buffer space (3 row groups) for this component.
  31.289 +     * We make the buffer wide enough to allow the downsampler to edge-expand
  31.290 +     * horizontally within the buffer, if it so chooses.
  31.291 +     */
  31.292 +    true_buffer = (*cinfo->mem->alloc_sarray)
  31.293 +      ((j_common_ptr) cinfo, JPOOL_IMAGE,
  31.294 +       (JDIMENSION) (((long) compptr->width_in_blocks * DCTSIZE *
  31.295 +		      cinfo->max_h_samp_factor) / compptr->h_samp_factor),
  31.296 +       (JDIMENSION) (3 * rgroup_height));
  31.297 +    /* Copy true buffer row pointers into the middle of the fake row array */
  31.298 +    MEMCOPY(fake_buffer + rgroup_height, true_buffer,
  31.299 +	    3 * rgroup_height * SIZEOF(JSAMPROW));
  31.300 +    /* Fill in the above and below wraparound pointers */
  31.301 +    for (i = 0; i < rgroup_height; i++) {
  31.302 +      fake_buffer[i] = true_buffer[2 * rgroup_height + i];
  31.303 +      fake_buffer[4 * rgroup_height + i] = true_buffer[i];
  31.304 +    }
  31.305 +    prep->color_buf[ci] = fake_buffer + rgroup_height;
  31.306 +    fake_buffer += 5 * rgroup_height; /* point to space for next component */
  31.307 +  }
  31.308 +}
  31.309 +
  31.310 +#endif /* CONTEXT_ROWS_SUPPORTED */
  31.311 +
  31.312 +
  31.313 +/*
  31.314 + * Initialize preprocessing controller.
  31.315 + */
  31.316 +
  31.317 +GLOBAL(void)
  31.318 +jinit_c_prep_controller (j_compress_ptr cinfo, boolean need_full_buffer)
  31.319 +{
  31.320 +  my_prep_ptr prep;
  31.321 +  int ci;
  31.322 +  jpeg_component_info * compptr;
  31.323 +
  31.324 +  if (need_full_buffer)		/* safety check */
  31.325 +    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
  31.326 +
  31.327 +  prep = (my_prep_ptr)
  31.328 +    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
  31.329 +				SIZEOF(my_prep_controller));
  31.330 +  cinfo->prep = (struct jpeg_c_prep_controller *) prep;
  31.331 +  prep->pub.start_pass = start_pass_prep;
  31.332 +
  31.333 +  /* Allocate the color conversion buffer.
  31.334 +   * We make the buffer wide enough to allow the downsampler to edge-expand
  31.335 +   * horizontally within the buffer, if it so chooses.
  31.336 +   */
  31.337 +  if (cinfo->downsample->need_context_rows) {
  31.338 +    /* Set up to provide context rows */
  31.339 +#ifdef CONTEXT_ROWS_SUPPORTED
  31.340 +    prep->pub.pre_process_data = pre_process_context;
  31.341 +    create_context_buffer(cinfo);
  31.342 +#else
  31.343 +    ERREXIT(cinfo, JERR_NOT_COMPILED);
  31.344 +#endif
  31.345 +  } else {
  31.346 +    /* No context, just make it tall enough for one row group */
  31.347 +    prep->pub.pre_process_data = pre_process_data;
  31.348 +    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  31.349 +	 ci++, compptr++) {
  31.350 +      prep->color_buf[ci] = (*cinfo->mem->alloc_sarray)
  31.351 +	((j_common_ptr) cinfo, JPOOL_IMAGE,
  31.352 +	 (JDIMENSION) (((long) compptr->width_in_blocks * DCTSIZE *
  31.353 +			cinfo->max_h_samp_factor) / compptr->h_samp_factor),
  31.354 +	 (JDIMENSION) cinfo->max_v_samp_factor);
  31.355 +    }
  31.356 +  }
  31.357 +}
    32.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    32.2 +++ b/libs/libjpeg/jcsample.c	Sun Nov 01 00:36:56 2015 +0200
    32.3 @@ -0,0 +1,519 @@
    32.4 +/*
    32.5 + * jcsample.c
    32.6 + *
    32.7 + * Copyright (C) 1991-1996, Thomas G. Lane.
    32.8 + * This file is part of the Independent JPEG Group's software.
    32.9 + * For conditions of distribution and use, see the accompanying README file.
   32.10 + *
   32.11 + * This file contains downsampling routines.
   32.12 + *
   32.13 + * Downsampling input data is counted in "row groups".  A row group
   32.14 + * is defined to be max_v_samp_factor pixel rows of each component,
   32.15 + * from which the downsampler produces v_samp_factor sample rows.
   32.16 + * A single row group is processed in each call to the downsampler module.
   32.17 + *
   32.18 + * The downsampler is responsible for edge-expansion of its output data
   32.19 + * to fill an integral number of DCT blocks horizontally.  The source buffer
   32.20 + * may be modified if it is helpful for this purpose (the source buffer is
   32.21 + * allocated wide enough to correspond to the desired output width).
   32.22 + * The caller (the prep controller) is responsible for vertical padding.
   32.23 + *
   32.24 + * The downsampler may request "context rows" by setting need_context_rows
   32.25 + * during startup.  In this case, the input arrays will contain at least
   32.26 + * one row group's worth of pixels above and below the passed-in data;
   32.27 + * the caller will create dummy rows at image top and bottom by replicating
   32.28 + * the first or last real pixel row.
   32.29 + *
   32.30 + * An excellent reference for image resampling is
   32.31 + *   Digital Image Warping, George Wolberg, 1990.
   32.32 + *   Pub. by IEEE Computer Society Press, Los Alamitos, CA. ISBN 0-8186-8944-7.
   32.33 + *
   32.34 + * The downsampling algorithm used here is a simple average of the source
   32.35 + * pixels covered by the output pixel.  The hi-falutin sampling literature
   32.36 + * refers to this as a "box filter".  In general the characteristics of a box
   32.37 + * filter are not very good, but for the specific cases we normally use (1:1
   32.38 + * and 2:1 ratios) the box is equivalent to a "triangle filter" which is not
   32.39 + * nearly so bad.  If you intend to use other sampling ratios, you'd be well
   32.40 + * advised to improve this code.
   32.41 + *
   32.42 + * A simple input-smoothing capability is provided.  This is mainly intended
   32.43 + * for cleaning up color-dithered GIF input files (if you find it inadequate,
   32.44 + * we suggest using an external filtering program such as pnmconvol).  When
   32.45 + * enabled, each input pixel P is replaced by a weighted sum of itself and its
   32.46 + * eight neighbors.  P's weight is 1-8*SF and each neighbor's weight is SF,
   32.47 + * where SF = (smoothing_factor / 1024).
   32.48 + * Currently, smoothing is only supported for 2h2v sampling factors.
   32.49 + */
   32.50 +
   32.51 +#define JPEG_INTERNALS
   32.52 +#include "jinclude.h"
   32.53 +#include "jpeglib.h"
   32.54 +
   32.55 +
   32.56 +/* Pointer to routine to downsample a single component */
   32.57 +typedef JMETHOD(void, downsample1_ptr,
   32.58 +		(j_compress_ptr cinfo, jpeg_component_info * compptr,
   32.59 +		 JSAMPARRAY input_data, JSAMPARRAY output_data));
   32.60 +
   32.61 +/* Private subobject */
   32.62 +
   32.63 +typedef struct {
   32.64 +  struct jpeg_downsampler pub;	/* public fields */
   32.65 +
   32.66 +  /* Downsampling method pointers, one per component */
   32.67 +  downsample1_ptr methods[MAX_COMPONENTS];
   32.68 +} my_downsampler;
   32.69 +
   32.70 +typedef my_downsampler * my_downsample_ptr;
   32.71 +
   32.72 +
   32.73 +/*
   32.74 + * Initialize for a downsampling pass.
   32.75 + */
   32.76 +
   32.77 +METHODDEF(void)
   32.78 +start_pass_downsample (j_compress_ptr cinfo)
   32.79 +{
   32.80 +  /* no work for now */
   32.81 +}
   32.82 +
   32.83 +
   32.84 +/*
   32.85 + * Expand a component horizontally from width input_cols to width output_cols,
   32.86 + * by duplicating the rightmost samples.
   32.87 + */
   32.88 +
   32.89 +LOCAL(void)
   32.90 +expand_right_edge (JSAMPARRAY image_data, int num_rows,
   32.91 +		   JDIMENSION input_cols, JDIMENSION output_cols)
   32.92 +{
   32.93 +  register JSAMPROW ptr;
   32.94 +  register JSAMPLE pixval;
   32.95 +  register int count;
   32.96 +  int row;
   32.97 +  int numcols = (int) (output_cols - input_cols);
   32.98 +
   32.99 +  if (numcols > 0) {
  32.100 +    for (row = 0; row < num_rows; row++) {
  32.101 +      ptr = image_data[row] + input_cols;
  32.102 +      pixval = ptr[-1];		/* don't need GETJSAMPLE() here */
  32.103 +      for (count = numcols; count > 0; count--)
  32.104 +	*ptr++ = pixval;
  32.105 +    }
  32.106 +  }
  32.107 +}
  32.108 +
  32.109 +
  32.110 +/*
  32.111 + * Do downsampling for a whole row group (all components).
  32.112 + *
  32.113 + * In this version we simply downsample each component independently.
  32.114 + */
  32.115 +
  32.116 +METHODDEF(void)
  32.117 +sep_downsample (j_compress_ptr cinfo,
  32.118 +		JSAMPIMAGE input_buf, JDIMENSION in_row_index,
  32.119 +		JSAMPIMAGE output_buf, JDIMENSION out_row_group_index)
  32.120 +{
  32.121 +  my_downsample_ptr downsample = (my_downsample_ptr) cinfo->downsample;
  32.122 +  int ci;
  32.123 +  jpeg_component_info * compptr;
  32.124 +  JSAMPARRAY in_ptr, out_ptr;
  32.125 +
  32.126 +  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  32.127 +       ci++, compptr++) {
  32.128 +    in_ptr = input_buf[ci] + in_row_index;
  32.129 +    out_ptr = output_buf[ci] + (out_row_group_index * compptr->v_samp_factor);
  32.130 +    (*downsample->methods[ci]) (cinfo, compptr, in_ptr, out_ptr);
  32.131 +  }
  32.132 +}
  32.133 +
  32.134 +
  32.135 +/*
  32.136 + * Downsample pixel values of a single component.
  32.137 + * One row group is processed per call.
  32.138 + * This version handles arbitrary integral sampling ratios, without smoothing.
  32.139 + * Note that this version is not actually used for customary sampling ratios.
  32.140 + */
  32.141 +
  32.142 +METHODDEF(void)
  32.143 +int_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
  32.144 +		JSAMPARRAY input_data, JSAMPARRAY output_data)
  32.145 +{
  32.146 +  int inrow, outrow, h_expand, v_expand, numpix, numpix2, h, v;
  32.147 +  JDIMENSION outcol, outcol_h;	/* outcol_h == outcol*h_expand */
  32.148 +  JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;
  32.149 +  JSAMPROW inptr, outptr;
  32.150 +  INT32 outvalue;
  32.151 +
  32.152 +  h_expand = cinfo->max_h_samp_factor / compptr->h_samp_factor;
  32.153 +  v_expand = cinfo->max_v_samp_factor / compptr->v_samp_factor;
  32.154 +  numpix = h_expand * v_expand;
  32.155 +  numpix2 = numpix/2;
  32.156 +
  32.157 +  /* Expand input data enough to let all the output samples be generated
  32.158 +   * by the standard loop.  Special-casing padded output would be more
  32.159 +   * efficient.
  32.160 +   */
  32.161 +  expand_right_edge(input_data, cinfo->max_v_samp_factor,
  32.162 +		    cinfo->image_width, output_cols * h_expand);
  32.163 +
  32.164 +  inrow = 0;
  32.165 +  for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {
  32.166 +    outptr = output_data[outrow];
  32.167 +    for (outcol = 0, outcol_h = 0; outcol < output_cols;
  32.168 +	 outcol++, outcol_h += h_expand) {
  32.169 +      outvalue = 0;
  32.170 +      for (v = 0; v < v_expand; v++) {
  32.171 +	inptr = input_data[inrow+v] + outcol_h;
  32.172 +	for (h = 0; h < h_expand; h++) {
  32.173 +	  outvalue += (INT32) GETJSAMPLE(*inptr++);
  32.174 +	}
  32.175 +      }
  32.176 +      *outptr++ = (JSAMPLE) ((outvalue + numpix2) / numpix);
  32.177 +    }
  32.178 +    inrow += v_expand;
  32.179 +  }
  32.180 +}
  32.181 +
  32.182 +
  32.183 +/*
  32.184 + * Downsample pixel values of a single component.
  32.185 + * This version handles the special case of a full-size component,
  32.186 + * without smoothing.
  32.187 + */
  32.188 +
  32.189 +METHODDEF(void)
  32.190 +fullsize_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
  32.191 +		     JSAMPARRAY input_data, JSAMPARRAY output_data)
  32.192 +{
  32.193 +  /* Copy the data */
  32.194 +  jcopy_sample_rows(input_data, 0, output_data, 0,
  32.195 +		    cinfo->max_v_samp_factor, cinfo->image_width);
  32.196 +  /* Edge-expand */
  32.197 +  expand_right_edge(output_data, cinfo->max_v_samp_factor,
  32.198 +		    cinfo->image_width, compptr->width_in_blocks * DCTSIZE);
  32.199 +}
  32.200 +
  32.201 +
  32.202 +/*
  32.203 + * Downsample pixel values of a single component.
  32.204 + * This version handles the common case of 2:1 horizontal and 1:1 vertical,
  32.205 + * without smoothing.
  32.206 + *
  32.207 + * A note about the "bias" calculations: when rounding fractional values to
  32.208 + * integer, we do not want to always round 0.5 up to the next integer.
  32.209 + * If we did that, we'd introduce a noticeable bias towards larger values.
  32.210 + * Instead, this code is arranged so that 0.5 will be rounded up or down at
  32.211 + * alternate pixel locations (a simple ordered dither pattern).
  32.212 + */
  32.213 +
  32.214 +METHODDEF(void)
  32.215 +h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
  32.216 +		 JSAMPARRAY input_data, JSAMPARRAY output_data)
  32.217 +{
  32.218 +  int outrow;
  32.219 +  JDIMENSION outcol;
  32.220 +  JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;
  32.221 +  register JSAMPROW inptr, outptr;
  32.222 +  register int bias;
  32.223 +
  32.224 +  /* Expand input data enough to let all the output samples be generated
  32.225 +   * by the standard loop.  Special-casing padded output would be more
  32.226 +   * efficient.
  32.227 +   */
  32.228 +  expand_right_edge(input_data, cinfo->max_v_samp_factor,
  32.229 +		    cinfo->image_width, output_cols * 2);
  32.230 +
  32.231 +  for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {
  32.232 +    outptr = output_data[outrow];
  32.233 +    inptr = input_data[outrow];
  32.234 +    bias = 0;			/* bias = 0,1,0,1,... for successive samples */
  32.235 +    for (outcol = 0; outcol < output_cols; outcol++) {
  32.236 +      *outptr++ = (JSAMPLE) ((GETJSAMPLE(*inptr) + GETJSAMPLE(inptr[1])
  32.237 +			      + bias) >> 1);
  32.238 +      bias ^= 1;		/* 0=>1, 1=>0 */
  32.239 +      inptr += 2;
  32.240 +    }
  32.241 +  }
  32.242 +}
  32.243 +
  32.244 +
  32.245 +/*
  32.246 + * Downsample pixel values of a single component.
  32.247 + * This version handles the standard case of 2:1 horizontal and 2:1 vertical,
  32.248 + * without smoothing.
  32.249 + */
  32.250 +
  32.251 +METHODDEF(void)
  32.252 +h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
  32.253 +		 JSAMPARRAY input_data, JSAMPARRAY output_data)
  32.254 +{
  32.255 +  int inrow, outrow;
  32.256 +  JDIMENSION outcol;
  32.257 +  JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;
  32.258 +  register JSAMPROW inptr0, inptr1, outptr;
  32.259 +  register int bias;
  32.260 +
  32.261 +  /* Expand input data enough to let all the output samples be generated
  32.262 +   * by the standard loop.  Special-casing padded output would be more
  32.263 +   * efficient.
  32.264 +   */
  32.265 +  expand_right_edge(input_data, cinfo->max_v_samp_factor,
  32.266 +		    cinfo->image_width, output_cols * 2);
  32.267 +
  32.268 +  inrow = 0;
  32.269 +  for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {
  32.270 +    outptr = output_data[outrow];
  32.271 +    inptr0 = input_data[inrow];
  32.272 +    inptr1 = input_data[inrow+1];
  32.273 +    bias = 1;			/* bias = 1,2,1,2,... for successive samples */
  32.274 +    for (outcol = 0; outcol < output_cols; outcol++) {
  32.275 +      *outptr++ = (JSAMPLE) ((GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +
  32.276 +			      GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1])
  32.277 +			      + bias) >> 2);
  32.278 +      bias ^= 3;		/* 1=>2, 2=>1 */
  32.279 +      inptr0 += 2; inptr1 += 2;
  32.280 +    }
  32.281 +    inrow += 2;
  32.282 +  }
  32.283 +}
  32.284 +
  32.285 +
  32.286 +#ifdef INPUT_SMOOTHING_SUPPORTED
  32.287 +
  32.288 +/*
  32.289 + * Downsample pixel values of a single component.
  32.290 + * This version handles the standard case of 2:1 horizontal and 2:1 vertical,
  32.291 + * with smoothing.  One row of context is required.
  32.292 + */
  32.293 +
  32.294 +METHODDEF(void)
  32.295 +h2v2_smooth_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
  32.296 +			JSAMPARRAY input_data, JSAMPARRAY output_data)
  32.297 +{
  32.298 +  int inrow, outrow;
  32.299 +  JDIMENSION colctr;
  32.300 +  JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;
  32.301 +  register JSAMPROW inptr0, inptr1, above_ptr, below_ptr, outptr;
  32.302 +  INT32 membersum, neighsum, memberscale, neighscale;
  32.303 +
  32.304 +  /* Expand input data enough to let all the output samples be generated
  32.305 +   * by the standard loop.  Special-casing padded output would be more
  32.306 +   * efficient.
  32.307 +   */
  32.308 +  expand_right_edge(input_data - 1, cinfo->max_v_samp_factor + 2,
  32.309 +		    cinfo->image_width, output_cols * 2);
  32.310 +
  32.311 +  /* We don't bother to form the individual "smoothed" input pixel values;
  32.312 +   * we can directly compute the output which is the average of the four
  32.313 +   * smoothed values.  Each of the four member pixels contributes a fraction
  32.314 +   * (1-8*SF) to its own smoothed image and a fraction SF to each of the three
  32.315 +   * other smoothed pixels, therefore a total fraction (1-5*SF)/4 to the final
  32.316 +   * output.  The four corner-adjacent neighbor pixels contribute a fraction
  32.317 +   * SF to just one smoothed pixel, or SF/4 to the final output; while the
  32.318 +   * eight edge-adjacent neighbors contribute SF to each of two smoothed
  32.319 +   * pixels, or SF/2 overall.  In order to use integer arithmetic, these
  32.320 +   * factors are scaled by 2^16 = 65536.
  32.321 +   * Also recall that SF = smoothing_factor / 1024.
  32.322 +   */
  32.323 +
  32.324 +  memberscale = 16384 - cinfo->smoothing_factor * 80; /* scaled (1-5*SF)/4 */
  32.325 +  neighscale = cinfo->smoothing_factor * 16; /* scaled SF/4 */
  32.326 +
  32.327 +  inrow = 0;
  32.328 +  for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {
  32.329 +    outptr = output_data[outrow];
  32.330 +    inptr0 = input_data[inrow];
  32.331 +    inptr1 = input_data[inrow+1];
  32.332 +    above_ptr = input_data[inrow-1];
  32.333 +    below_ptr = input_data[inrow+2];
  32.334 +
  32.335 +    /* Special case for first column: pretend column -1 is same as column 0 */
  32.336 +    membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +
  32.337 +		GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]);
  32.338 +    neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) +
  32.339 +	       GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) +
  32.340 +	       GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[2]) +
  32.341 +	       GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[2]);
  32.342 +    neighsum += neighsum;
  32.343 +    neighsum += GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[2]) +
  32.344 +		GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[2]);
  32.345 +    membersum = membersum * memberscale + neighsum * neighscale;
  32.346 +    *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16);
  32.347 +    inptr0 += 2; inptr1 += 2; above_ptr += 2; below_ptr += 2;
  32.348 +
  32.349 +    for (colctr = output_cols - 2; colctr > 0; colctr--) {
  32.350 +      /* sum of pixels directly mapped to this output element */
  32.351 +      membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +
  32.352 +		  GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]);
  32.353 +      /* sum of edge-neighbor pixels */
  32.354 +      neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) +
  32.355 +		 GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) +
  32.356 +		 GETJSAMPLE(inptr0[-1]) + GETJSAMPLE(inptr0[2]) +
  32.357 +		 GETJSAMPLE(inptr1[-1]) + GETJSAMPLE(inptr1[2]);
  32.358 +      /* The edge-neighbors count twice as much as corner-neighbors */
  32.359 +      neighsum += neighsum;
  32.360 +      /* Add in the corner-neighbors */
  32.361 +      neighsum += GETJSAMPLE(above_ptr[-1]) + GETJSAMPLE(above_ptr[2]) +
  32.362 +		  GETJSAMPLE(below_ptr[-1]) + GETJSAMPLE(below_ptr[2]);
  32.363 +      /* form final output scaled up by 2^16 */
  32.364 +      membersum = membersum * memberscale + neighsum * neighscale;
  32.365 +      /* round, descale and output it */
  32.366 +      *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16);
  32.367 +      inptr0 += 2; inptr1 += 2; above_ptr += 2; below_ptr += 2;
  32.368 +    }
  32.369 +
  32.370 +    /* Special case for last column */
  32.371 +    membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +
  32.372 +		GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]);
  32.373 +    neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) +
  32.374 +	       GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) +
  32.375 +	       GETJSAMPLE(inptr0[-1]) + GETJSAMPLE(inptr0[1]) +
  32.376 +	       GETJSAMPLE(inptr1[-1]) + GETJSAMPLE(inptr1[1]);
  32.377 +    neighsum += neighsum;
  32.378 +    neighsum += GETJSAMPLE(above_ptr[-1]) + GETJSAMPLE(above_ptr[1]) +
  32.379 +		GETJSAMPLE(below_ptr[-1]) + GETJSAMPLE(below_ptr[1]);
  32.380 +    membersum = membersum * memberscale + neighsum * neighscale;
  32.381 +    *outptr = (JSAMPLE) ((membersum + 32768) >> 16);
  32.382 +
  32.383 +    inrow += 2;
  32.384 +  }
  32.385 +}
  32.386 +
  32.387 +
  32.388 +/*
  32.389 + * Downsample pixel values of a single component.
  32.390 + * This version handles the special case of a full-size component,
  32.391 + * with smoothing.  One row of context is required.
  32.392 + */
  32.393 +
  32.394 +METHODDEF(void)
  32.395 +fullsize_smooth_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr,
  32.396 +			    JSAMPARRAY input_data, JSAMPARRAY output_data)
  32.397 +{
  32.398 +  int outrow;
  32.399 +  JDIMENSION colctr;
  32.400 +  JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;
  32.401 +  register JSAMPROW inptr, above_ptr, below_ptr, outptr;
  32.402 +  INT32 membersum, neighsum, memberscale, neighscale;
  32.403 +  int colsum, lastcolsum, nextcolsum;
  32.404 +
  32.405 +  /* Expand input data enough to let all the output samples be generated
  32.406 +   * by the standard loop.  Special-casing padded output would be more
  32.407 +   * efficient.
  32.408 +   */
  32.409 +  expand_right_edge(input_data - 1, cinfo->max_v_samp_factor + 2,
  32.410 +		    cinfo->image_width, output_cols);
  32.411 +
  32.412 +  /* Each of the eight neighbor pixels contributes a fraction SF to the
  32.413 +   * smoothed pixel, while the main pixel contributes (1-8*SF).  In order
  32.414 +   * to use integer arithmetic, these factors are multiplied by 2^16 = 65536.
  32.415 +   * Also recall that SF = smoothing_factor / 1024.
  32.416 +   */
  32.417 +
  32.418 +  memberscale = 65536L - cinfo->smoothing_factor * 512L; /* scaled 1-8*SF */
  32.419 +  neighscale = cinfo->smoothing_factor * 64; /* scaled SF */
  32.420 +
  32.421 +  for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {
  32.422 +    outptr = output_data[outrow];
  32.423 +    inptr = input_data[outrow];
  32.424 +    above_ptr = input_data[outrow-1];
  32.425 +    below_ptr = input_data[outrow+1];
  32.426 +
  32.427 +    /* Special case for first column */
  32.428 +    colsum = GETJSAMPLE(*above_ptr++) + GETJSAMPLE(*below_ptr++) +
  32.429 +	     GETJSAMPLE(*inptr);
  32.430 +    membersum = GETJSAMPLE(*inptr++);
  32.431 +    nextcolsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(*below_ptr) +
  32.432 +		 GETJSAMPLE(*inptr);
  32.433 +    neighsum = colsum + (colsum - membersum) + nextcolsum;
  32.434 +    membersum = membersum * memberscale + neighsum * neighscale;
  32.435 +    *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16);
  32.436 +    lastcolsum = colsum; colsum = nextcolsum;
  32.437 +
  32.438 +    for (colctr = output_cols - 2; colctr > 0; colctr--) {
  32.439 +      membersum = GETJSAMPLE(*inptr++);
  32.440 +      above_ptr++; below_ptr++;
  32.441 +      nextcolsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(*below_ptr) +
  32.442 +		   GETJSAMPLE(*inptr);
  32.443 +      neighsum = lastcolsum + (colsum - membersum) + nextcolsum;
  32.444 +      membersum = membersum * memberscale + neighsum * neighscale;
  32.445 +      *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16);
  32.446 +      lastcolsum = colsum; colsum = nextcolsum;
  32.447 +    }
  32.448 +
  32.449 +    /* Special case for last column */
  32.450 +    membersum = GETJSAMPLE(*inptr);
  32.451 +    neighsum = lastcolsum + (colsum - membersum) + colsum;
  32.452 +    membersum = membersum * memberscale + neighsum * neighscale;
  32.453 +    *outptr = (JSAMPLE) ((membersum + 32768) >> 16);
  32.454 +
  32.455 +  }
  32.456 +}
  32.457 +
  32.458 +#endif /* INPUT_SMOOTHING_SUPPORTED */
  32.459 +
  32.460 +
  32.461 +/*
  32.462 + * Module initialization routine for downsampling.
  32.463 + * Note that we must select a routine for each component.
  32.464 + */
  32.465 +
  32.466 +GLOBAL(void)
  32.467 +jinit_downsampler (j_compress_ptr cinfo)
  32.468 +{
  32.469 +  my_downsample_ptr downsample;
  32.470 +  int ci;
  32.471 +  jpeg_component_info * compptr;
  32.472 +  boolean smoothok = TRUE;
  32.473 +
  32.474 +  downsample = (my_downsample_ptr)
  32.475 +    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
  32.476 +				SIZEOF(my_downsampler));
  32.477 +  cinfo->downsample = (struct jpeg_downsampler *) downsample;
  32.478 +  downsample->pub.start_pass = start_pass_downsample;
  32.479 +  downsample->pub.downsample = sep_downsample;
  32.480 +  downsample->pub.need_context_rows = FALSE;
  32.481 +
  32.482 +  if (cinfo->CCIR601_sampling)
  32.483 +    ERREXIT(cinfo, JERR_CCIR601_NOTIMPL);
  32.484 +
  32.485 +  /* Verify we can handle the sampling factors, and set up method pointers */
  32.486 +  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  32.487 +       ci++, compptr++) {
  32.488 +    if (compptr->h_samp_factor == cinfo->max_h_samp_factor &&
  32.489 +	compptr->v_samp_factor == cinfo->max_v_samp_factor) {
  32.490 +#ifdef INPUT_SMOOTHING_SUPPORTED
  32.491 +      if (cinfo->smoothing_factor) {
  32.492 +	downsample->methods[ci] = fullsize_smooth_downsample;
  32.493 +	downsample->pub.need_context_rows = TRUE;
  32.494 +      } else
  32.495 +#endif
  32.496 +	downsample->methods[ci] = fullsize_downsample;
  32.497 +    } else if (compptr->h_samp_factor * 2 == cinfo->max_h_samp_factor &&
  32.498 +	       compptr->v_samp_factor == cinfo->max_v_samp_factor) {
  32.499 +      smoothok = FALSE;
  32.500 +      downsample->methods[ci] = h2v1_downsample;
  32.501 +    } else if (compptr->h_samp_factor * 2 == cinfo->max_h_samp_factor &&
  32.502 +	       compptr->v_samp_factor * 2 == cinfo->max_v_samp_factor) {
  32.503 +#ifdef INPUT_SMOOTHING_SUPPORTED
  32.504 +      if (cinfo->smoothing_factor) {
  32.505 +	downsample->methods[ci] = h2v2_smooth_downsample;
  32.506 +	downsample->pub.need_context_rows = TRUE;
  32.507 +      } else
  32.508 +#endif
  32.509 +	downsample->methods[ci] = h2v2_downsample;
  32.510 +    } else if ((cinfo->max_h_samp_factor % compptr->h_samp_factor) == 0 &&
  32.511 +	       (cinfo->max_v_samp_factor % compptr->v_samp_factor) == 0) {
  32.512 +      smoothok = FALSE;
  32.513 +      downsample->methods[ci] = int_downsample;
  32.514 +    } else
  32.515 +      ERREXIT(cinfo, JERR_FRACT_SAMPLE_NOTIMPL);
  32.516 +  }
  32.517 +
  32.518 +#ifdef INPUT_SMOOTHING_SUPPORTED
  32.519 +  if (cinfo->smoothing_factor && !smoothok)
  32.520 +    TRACEMS(cinfo, 0, JTRC_SMOOTH_NOTIMPL);
  32.521 +#endif
  32.522 +}
    33.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    33.2 +++ b/libs/libjpeg/jctrans.c	Sun Nov 01 00:36:56 2015 +0200
    33.3 @@ -0,0 +1,388 @@
    33.4 +/*
    33.5 + * jctrans.c
    33.6 + *
    33.7 + * Copyright (C) 1995-1998, Thomas G. Lane.
    33.8 + * This file is part of the Independent JPEG Group's software.
    33.9 + * For conditions of distribution and use, see the accompanying README file.
   33.10 + *
   33.11 + * This file contains library routines for transcoding compression,
   33.12 + * that is, writing raw DCT coefficient arrays to an output JPEG file.
   33.13 + * The routines in jcapimin.c will also be needed by a transcoder.
   33.14 + */
   33.15 +
   33.16 +#define JPEG_INTERNALS
   33.17 +#include "jinclude.h"
   33.18 +#include "jpeglib.h"
   33.19 +
   33.20 +
   33.21 +/* Forward declarations */
   33.22 +LOCAL(void) transencode_master_selection
   33.23 +	JPP((j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays));
   33.24 +LOCAL(void) transencode_coef_controller
   33.25 +	JPP((j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays));
   33.26 +
   33.27 +
   33.28 +/*
   33.29 + * Compression initialization for writing raw-coefficient data.
   33.30 + * Before calling this, all parameters and a data destination must be set up.
   33.31 + * Call jpeg_finish_compress() to actually write the data.
   33.32 + *
   33.33 + * The number of passed virtual arrays must match cinfo->num_components.
   33.34 + * Note that the virtual arrays need not be filled or even realized at
   33.35 + * the time write_coefficients is called; indeed, if the virtual arrays
   33.36 + * were requested from this compression object's memory manager, they
   33.37 + * typically will be realized during this routine and filled afterwards.
   33.38 + */
   33.39 +
   33.40 +GLOBAL(void)
   33.41 +jpeg_write_coefficients (j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays)
   33.42 +{
   33.43 +  if (cinfo->global_state != CSTATE_START)
   33.44 +    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
   33.45 +  /* Mark all tables to be written */
   33.46 +  jpeg_suppress_tables(cinfo, FALSE);
   33.47 +  /* (Re)initialize error mgr and destination modules */
   33.48 +  (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo);
   33.49 +  (*cinfo->dest->init_destination) (cinfo);
   33.50 +  /* Perform master selection of active modules */
   33.51 +  transencode_master_selection(cinfo, coef_arrays);
   33.52 +  /* Wait for jpeg_finish_compress() call */
   33.53 +  cinfo->next_scanline = 0;	/* so jpeg_write_marker works */
   33.54 +  cinfo->global_state = CSTATE_WRCOEFS;
   33.55 +}
   33.56 +
   33.57 +
   33.58 +/*
   33.59 + * Initialize the compression object with default parameters,
   33.60 + * then copy from the source object all parameters needed for lossless
   33.61 + * transcoding.  Parameters that can be varied without loss (such as
   33.62 + * scan script and Huffman optimization) are left in their default states.
   33.63 + */
   33.64 +
   33.65 +GLOBAL(void)
   33.66 +jpeg_copy_critical_parameters (j_decompress_ptr srcinfo,
   33.67 +			       j_compress_ptr dstinfo)
   33.68 +{
   33.69 +  JQUANT_TBL ** qtblptr;
   33.70 +  jpeg_component_info *incomp, *outcomp;
   33.71 +  JQUANT_TBL *c_quant, *slot_quant;
   33.72 +  int tblno, ci, coefi;
   33.73 +
   33.74 +  /* Safety check to ensure start_compress not called yet. */
   33.75 +  if (dstinfo->global_state != CSTATE_START)
   33.76 +    ERREXIT1(dstinfo, JERR_BAD_STATE, dstinfo->global_state);
   33.77 +  /* Copy fundamental image dimensions */
   33.78 +  dstinfo->image_width = srcinfo->image_width;
   33.79 +  dstinfo->image_height = srcinfo->image_height;
   33.80 +  dstinfo->input_components = srcinfo->num_components;
   33.81 +  dstinfo->in_color_space = srcinfo->jpeg_color_space;
   33.82 +  /* Initialize all parameters to default values */
   33.83 +  jpeg_set_defaults(dstinfo);
   33.84 +  /* jpeg_set_defaults may choose wrong colorspace, eg YCbCr if input is RGB.
   33.85 +   * Fix it to get the right header markers for the image colorspace.
   33.86 +   */
   33.87 +  jpeg_set_colorspace(dstinfo, srcinfo->jpeg_color_space);
   33.88 +  dstinfo->data_precision = srcinfo->data_precision;
   33.89 +  dstinfo->CCIR601_sampling = srcinfo->CCIR601_sampling;
   33.90 +  /* Copy the source's quantization tables. */
   33.91 +  for (tblno = 0; tblno < NUM_QUANT_TBLS; tblno++) {
   33.92 +    if (srcinfo->quant_tbl_ptrs[tblno] != NULL) {
   33.93 +      qtblptr = & dstinfo->quant_tbl_ptrs[tblno];
   33.94 +      if (*qtblptr == NULL)
   33.95 +	*qtblptr = jpeg_alloc_quant_table((j_common_ptr) dstinfo);
   33.96 +      MEMCOPY((*qtblptr)->quantval,
   33.97 +	      srcinfo->quant_tbl_ptrs[tblno]->quantval,
   33.98 +	      SIZEOF((*qtblptr)->quantval));
   33.99 +      (*qtblptr)->sent_table = FALSE;
  33.100 +    }
  33.101 +  }
  33.102 +  /* Copy the source's per-component info.
  33.103 +   * Note we assume jpeg_set_defaults has allocated the dest comp_info array.
  33.104 +   */
  33.105 +  dstinfo->num_components = srcinfo->num_components;
  33.106 +  if (dstinfo->num_components < 1 || dstinfo->num_components > MAX_COMPONENTS)
  33.107 +    ERREXIT2(dstinfo, JERR_COMPONENT_COUNT, dstinfo->num_components,
  33.108 +	     MAX_COMPONENTS);
  33.109 +  for (ci = 0, incomp = srcinfo->comp_info, outcomp = dstinfo->comp_info;
  33.110 +       ci < dstinfo->num_components; ci++, incomp++, outcomp++) {
  33.111 +    outcomp->component_id = incomp->component_id;
  33.112 +    outcomp->h_samp_factor = incomp->h_samp_factor;
  33.113 +    outcomp->v_samp_factor = incomp->v_samp_factor;
  33.114 +    outcomp->quant_tbl_no = incomp->quant_tbl_no;
  33.115 +    /* Make sure saved quantization table for component matches the qtable
  33.116 +     * slot.  If not, the input file re-used this qtable slot.
  33.117 +     * IJG encoder currently cannot duplicate this.
  33.118 +     */
  33.119 +    tblno = outcomp->quant_tbl_no;
  33.120 +    if (tblno < 0 || tblno >= NUM_QUANT_TBLS ||
  33.121 +	srcinfo->quant_tbl_ptrs[tblno] == NULL)
  33.122 +      ERREXIT1(dstinfo, JERR_NO_QUANT_TABLE, tblno);
  33.123 +    slot_quant = srcinfo->quant_tbl_ptrs[tblno];
  33.124 +    c_quant = incomp->quant_table;
  33.125 +    if (c_quant != NULL) {
  33.126 +      for (coefi = 0; coefi < DCTSIZE2; coefi++) {
  33.127 +	if (c_quant->quantval[coefi] != slot_quant->quantval[coefi])
  33.128 +	  ERREXIT1(dstinfo, JERR_MISMATCHED_QUANT_TABLE, tblno);
  33.129 +      }
  33.130 +    }
  33.131 +    /* Note: we do not copy the source's Huffman table assignments;
  33.132 +     * instead we rely on jpeg_set_colorspace to have made a suitable choice.
  33.133 +     */
  33.134 +  }
  33.135 +  /* Also copy JFIF version and resolution information, if available.
  33.136 +   * Strictly speaking this isn't "critical" info, but it's nearly
  33.137 +   * always appropriate to copy it if available.  In particular,
  33.138 +   * if the application chooses to copy JFIF 1.02 extension markers from
  33.139 +   * the source file, we need to copy the version to make sure we don't
  33.140 +   * emit a file that has 1.02 extensions but a claimed version of 1.01.
  33.141 +   * We will *not*, however, copy version info from mislabeled "2.01" files.
  33.142 +   */
  33.143 +  if (srcinfo->saw_JFIF_marker) {
  33.144 +    if (srcinfo->JFIF_major_version == 1) {
  33.145 +      dstinfo->JFIF_major_version = srcinfo->JFIF_major_version;
  33.146 +      dstinfo->JFIF_minor_version = srcinfo->JFIF_minor_version;
  33.147 +    }
  33.148 +    dstinfo->density_unit = srcinfo->density_unit;
  33.149 +    dstinfo->X_density = srcinfo->X_density;
  33.150 +    dstinfo->Y_density = srcinfo->Y_density;
  33.151 +  }
  33.152 +}
  33.153 +
  33.154 +
  33.155 +/*
  33.156 + * Master selection of compression modules for transcoding.
  33.157 + * This substitutes for jcinit.c's initialization of the full compressor.
  33.158 + */
  33.159 +
  33.160 +LOCAL(void)
  33.161 +transencode_master_selection (j_compress_ptr cinfo,
  33.162 +			      jvirt_barray_ptr * coef_arrays)
  33.163 +{
  33.164 +  /* Although we don't actually use input_components for transcoding,
  33.165 +   * jcmaster.c's initial_setup will complain if input_components is 0.
  33.166 +   */
  33.167 +  cinfo->input_components = 1;
  33.168 +  /* Initialize master control (includes parameter checking/processing) */
  33.169 +  jinit_c_master_control(cinfo, TRUE /* transcode only */);
  33.170 +
  33.171 +  /* Entropy encoding: either Huffman or arithmetic coding. */
  33.172 +  if (cinfo->arith_code) {
  33.173 +    ERREXIT(cinfo, JERR_ARITH_NOTIMPL);
  33.174 +  } else {
  33.175 +    if (cinfo->progressive_mode) {
  33.176 +#ifdef C_PROGRESSIVE_SUPPORTED
  33.177 +      jinit_phuff_encoder(cinfo);
  33.178 +#else
  33.179 +      ERREXIT(cinfo, JERR_NOT_COMPILED);
  33.180 +#endif
  33.181 +    } else
  33.182 +      jinit_huff_encoder(cinfo);
  33.183 +  }
  33.184 +
  33.185 +  /* We need a special coefficient buffer controller. */
  33.186 +  transencode_coef_controller(cinfo, coef_arrays);
  33.187 +
  33.188 +  jinit_marker_writer(cinfo);
  33.189 +
  33.190 +  /* We can now tell the memory manager to allocate virtual arrays. */
  33.191 +  (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo);
  33.192 +
  33.193 +  /* Write the datastream header (SOI, JFIF) immediately.
  33.194 +   * Frame and scan headers are postponed till later.
  33.195 +   * This lets application insert special markers after the SOI.
  33.196 +   */
  33.197 +  (*cinfo->marker->write_file_header) (cinfo);
  33.198 +}
  33.199 +
  33.200 +
  33.201 +/*
  33.202 + * The rest of this file is a special implementation of the coefficient
  33.203 + * buffer controller.  This is similar to jccoefct.c, but it handles only
  33.204 + * output from presupplied virtual arrays.  Furthermore, we generate any
  33.205 + * dummy padding blocks on-the-fly rather than expecting them to be present
  33.206 + * in the arrays.
  33.207 + */
  33.208 +
  33.209 +/* Private buffer controller object */
  33.210 +
  33.211 +typedef struct {
  33.212 +  struct jpeg_c_coef_controller pub; /* public fields */
  33.213 +
  33.214 +  JDIMENSION iMCU_row_num;	/* iMCU row # within image */
  33.215 +  JDIMENSION mcu_ctr;		/* counts MCUs processed in current row */
  33.216 +  int MCU_vert_offset;		/* counts MCU rows within iMCU row */
  33.217 +  int MCU_rows_per_iMCU_row;	/* number of such rows needed */
  33.218 +
  33.219 +  /* Virtual block array for each component. */
  33.220 +  jvirt_barray_ptr * whole_image;
  33.221 +
  33.222 +  /* Workspace for constructing dummy blocks at right/bottom edges. */
  33.223 +  JBLOCKROW dummy_buffer[C_MAX_BLOCKS_IN_MCU];
  33.224 +} my_coef_controller;
  33.225 +
  33.226 +typedef my_coef_controller * my_coef_ptr;
  33.227 +
  33.228 +
  33.229 +LOCAL(void)
  33.230 +start_iMCU_row (j_compress_ptr cinfo)
  33.231 +/* Reset within-iMCU-row counters for a new row */
  33.232 +{
  33.233 +  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
  33.234 +
  33.235 +  /* In an interleaved scan, an MCU row is the same as an iMCU row.
  33.236 +   * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows.
  33.237 +   * But at the bottom of the image, process only what's left.
  33.238 +   */
  33.239 +  if (cinfo->comps_in_scan > 1) {
  33.240 +    coef->MCU_rows_per_iMCU_row = 1;
  33.241 +  } else {
  33.242 +    if (coef->iMCU_row_num < (cinfo->total_iMCU_rows-1))
  33.243 +      coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor;
  33.244 +    else
  33.245 +      coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height;
  33.246 +  }
  33.247 +
  33.248 +  coef->mcu_ctr = 0;
  33.249 +  coef->MCU_vert_offset = 0;
  33.250 +}
  33.251 +
  33.252 +
  33.253 +/*
  33.254 + * Initialize for a processing pass.
  33.255 + */
  33.256 +
  33.257 +METHODDEF(void)
  33.258 +start_pass_coef (j_compress_ptr cinfo, J_BUF_MODE pass_mode)
  33.259 +{
  33.260 +  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
  33.261 +
  33.262 +  if (pass_mode != JBUF_CRANK_DEST)
  33.263 +    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
  33.264 +
  33.265 +  coef->iMCU_row_num = 0;
  33.266 +  start_iMCU_row(cinfo);
  33.267 +}
  33.268 +
  33.269 +
  33.270 +/*
  33.271 + * Process some data.
  33.272 + * We process the equivalent of one fully interleaved MCU row ("iMCU" row)
  33.273 + * per call, ie, v_samp_factor block rows for each component in the scan.
  33.274 + * The data is obtained from the virtual arrays and fed to the entropy coder.
  33.275 + * Returns TRUE if the iMCU row is completed, FALSE if suspended.
  33.276 + *
  33.277 + * NB: input_buf is ignored; it is likely to be a NULL pointer.
  33.278 + */
  33.279 +
  33.280 +METHODDEF(boolean)
  33.281 +compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
  33.282 +{
  33.283 +  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
  33.284 +  JDIMENSION MCU_col_num;	/* index of current MCU within row */
  33.285 +  JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1;
  33.286 +  JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
  33.287 +  int blkn, ci, xindex, yindex, yoffset, blockcnt;
  33.288 +  JDIMENSION start_col;
  33.289 +  JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN];
  33.290 +  JBLOCKROW MCU_buffer[C_MAX_BLOCKS_IN_MCU];
  33.291 +  JBLOCKROW buffer_ptr;
  33.292 +  jpeg_component_info *compptr;
  33.293 +
  33.294 +  /* Align the virtual buffers for the components used in this scan. */
  33.295 +  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
  33.296 +    compptr = cinfo->cur_comp_info[ci];
  33.297 +    buffer[ci] = (*cinfo->mem->access_virt_barray)
  33.298 +      ((j_common_ptr) cinfo, coef->whole_image[compptr->component_index],
  33.299 +       coef->iMCU_row_num * compptr->v_samp_factor,
  33.300 +       (JDIMENSION) compptr->v_samp_factor, FALSE);
  33.301 +  }
  33.302 +
  33.303 +  /* Loop to process one whole iMCU row */
  33.304 +  for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
  33.305 +       yoffset++) {
  33.306 +    for (MCU_col_num = coef->mcu_ctr; MCU_col_num < cinfo->MCUs_per_row;
  33.307 +	 MCU_col_num++) {
  33.308 +      /* Construct list of pointers to DCT blocks belonging to this MCU */
  33.309 +      blkn = 0;			/* index of current DCT block within MCU */
  33.310 +      for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
  33.311 +	compptr = cinfo->cur_comp_info[ci];
  33.312 +	start_col = MCU_col_num * compptr->MCU_width;
  33.313 +	blockcnt = (MCU_col_num < last_MCU_col) ? compptr->MCU_width
  33.314 +						: compptr->last_col_width;
  33.315 +	for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
  33.316 +	  if (coef->iMCU_row_num < last_iMCU_row ||
  33.317 +	      yindex+yoffset < compptr->last_row_height) {
  33.318 +	    /* Fill in pointers to real blocks in this row */
  33.319 +	    buffer_ptr = buffer[ci][yindex+yoffset] + start_col;
  33.320 +	    for (xindex = 0; xindex < blockcnt; xindex++)
  33.321 +	      MCU_buffer[blkn++] = buffer_ptr++;
  33.322 +	  } else {
  33.323 +	    /* At bottom of image, need a whole row of dummy blocks */
  33.324 +	    xindex = 0;
  33.325 +	  }
  33.326 +	  /* Fill in any dummy blocks needed in this row.
  33.327 +	   * Dummy blocks are filled in the same way as in jccoefct.c:
  33.328 +	   * all zeroes in the AC entries, DC entries equal to previous
  33.329 +	   * block's DC value.  The init routine has already zeroed the
  33.330 +	   * AC entries, so we need only set the DC entries correctly.
  33.331 +	   */
  33.332 +	  for (; xindex < compptr->MCU_width; xindex++) {
  33.333 +	    MCU_buffer[blkn] = coef->dummy_buffer[blkn];
  33.334 +	    MCU_buffer[blkn][0][0] = MCU_buffer[blkn-1][0][0];
  33.335 +	    blkn++;
  33.336 +	  }
  33.337 +	}
  33.338 +      }
  33.339 +      /* Try to write the MCU. */
  33.340 +      if (! (*cinfo->entropy->encode_mcu) (cinfo, MCU_buffer)) {
  33.341 +	/* Suspension forced; update state counters and exit */
  33.342 +	coef->MCU_vert_offset = yoffset;
  33.343 +	coef->mcu_ctr = MCU_col_num;
  33.344 +	return FALSE;
  33.345 +      }
  33.346 +    }
  33.347 +    /* Completed an MCU row, but perhaps not an iMCU row */
  33.348 +    coef->mcu_ctr = 0;
  33.349 +  }
  33.350 +  /* Completed the iMCU row, advance counters for next one */
  33.351 +  coef->iMCU_row_num++;
  33.352 +  start_iMCU_row(cinfo);
  33.353 +  return TRUE;
  33.354 +}
  33.355 +
  33.356 +
  33.357 +/*
  33.358 + * Initialize coefficient buffer controller.
  33.359 + *
  33.360 + * Each passed coefficient array must be the right size for that
  33.361 + * coefficient: width_in_blocks wide and height_in_blocks high,
  33.362 + * with unitheight at least v_samp_factor.
  33.363 + */
  33.364 +
  33.365 +LOCAL(void)
  33.366 +transencode_coef_controller (j_compress_ptr cinfo,
  33.367 +			     jvirt_barray_ptr * coef_arrays)
  33.368 +{
  33.369 +  my_coef_ptr coef;
  33.370 +  JBLOCKROW buffer;
  33.371 +  int i;
  33.372 +
  33.373 +  coef = (my_coef_ptr)
  33.374 +    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
  33.375 +				SIZEOF(my_coef_controller));
  33.376 +  cinfo->coef = (struct jpeg_c_coef_controller *) coef;
  33.377 +  coef->pub.start_pass = start_pass_coef;
  33.378 +  coef->pub.compress_data = compress_output;
  33.379 +
  33.380 +  /* Save pointer to virtual arrays */
  33.381 +  coef->whole_image = coef_arrays;
  33.382 +
  33.383 +  /* Allocate and pre-zero space for dummy DCT blocks. */
  33.384 +  buffer = (JBLOCKROW)
  33.385 +    (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,
  33.386 +				C_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK));
  33.387 +  jzero_far((void FAR *) buffer, C_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK));
  33.388 +  for (i = 0; i < C_MAX_BLOCKS_IN_MCU; i++) {
  33.389 +    coef->dummy_buffer[i] = buffer + i;
  33.390 +  }
  33.391 +}
    34.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    34.2 +++ b/libs/libjpeg/jdapimin.c	Sun Nov 01 00:36:56 2015 +0200
    34.3 @@ -0,0 +1,395 @@
    34.4 +/*
    34.5 + * jdapimin.c
    34.6 + *
    34.7 + * Copyright (C) 1994-1998, Thomas G. Lane.
    34.8 + * This file is part of the Independent JPEG Group's software.
    34.9 + * For conditions of distribution and use, see the accompanying README file.
   34.10 + *
   34.11 + * This file contains application interface code for the decompression half
   34.12 + * of the JPEG library.  These are the "minimum" API routines that may be
   34.13 + * needed in either the normal full-decompression case or the
   34.14 + * transcoding-only case.
   34.15 + *
   34.16 + * Most of the routines intended to be called directly by an application
   34.17 + * are in this file or in jdapistd.c.  But also see jcomapi.c for routines
   34.18 + * shared by compression and decompression, and jdtrans.c for the transcoding
   34.19 + * case.
   34.20 + */
   34.21 +
   34.22 +#define JPEG_INTERNALS
   34.23 +#include "jinclude.h"
   34.24 +#include "jpeglib.h"
   34.25 +
   34.26 +
   34.27 +/*
   34.28 + * Initialization of a JPEG decompression object.
   34.29 + * The error manager must already be set up (in case memory manager fails).
   34.30 + */
   34.31 +
   34.32 +GLOBAL(void)
   34.33 +jpeg_CreateDecompress (j_decompress_ptr cinfo, int version, size_t structsize)
   34.34 +{
   34.35 +  int i;
   34.36 +
   34.37 +  /* Guard against version mismatches between library and caller. */
   34.38 +  cinfo->mem = NULL;		/* so jpeg_destroy knows mem mgr not called */
   34.39 +  if (version != JPEG_LIB_VERSION)
   34.40 +    ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version);
   34.41 +  if (structsize != SIZEOF(struct jpeg_decompress_struct))
   34.42 +    ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE, 
   34.43 +	     (int) SIZEOF(struct jpeg_decompress_struct), (int) structsize);
   34.44 +
   34.45 +  /* For debugging purposes, we zero the whole master structure.
   34.46 +   * But the application has already set the err pointer, and may have set
   34.47 +   * client_data, so we have to save and restore those fields.
   34.48 +   * Note: if application hasn't set client_data, tools like Purify may
   34.49 +   * complain here.
   34.50 +   */
   34.51 +  {
   34.52 +    struct jpeg_error_mgr * err = cinfo->err;
   34.53 +    void * client_data = cinfo->client_data; /* ignore Purify complaint here */
   34.54 +    MEMZERO(cinfo, SIZEOF(struct jpeg_decompress_struct));
   34.55 +    cinfo->err = err;
   34.56 +    cinfo->client_data = client_data;
   34.57 +  }
   34.58 +  cinfo->is_decompressor = TRUE;
   34.59 +
   34.60 +  /* Initialize a memory manager instance for this object */
   34.61 +  jinit_memory_mgr((j_common_ptr) cinfo);
   34.62 +
   34.63 +  /* Zero out pointers to permanent structures. */
   34.64 +  cinfo->progress = NULL;
   34.65 +  cinfo->src = NULL;
   34.66 +
   34.67 +  for (i = 0; i < NUM_QUANT_TBLS; i++)
   34.68 +    cinfo->quant_tbl_ptrs[i] = NULL;
   34.69 +
   34.70 +  for (i = 0; i < NUM_HUFF_TBLS; i++) {
   34.71 +    cinfo->dc_huff_tbl_ptrs[i] = NULL;
   34.72 +    cinfo->ac_huff_tbl_ptrs[i] = NULL;
   34.73 +  }
   34.74 +
   34.75 +  /* Initialize marker processor so application can override methods
   34.76 +   * for COM, APPn markers before calling jpeg_read_header.
   34.77 +   */
   34.78 +  cinfo->marker_list = NULL;
   34.79 +  jinit_marker_reader(cinfo);
   34.80 +
   34.81 +  /* And initialize the overall input controller. */
   34.82 +  jinit_input_controller(cinfo);
   34.83 +
   34.84 +  /* OK, I'm ready */
   34.85 +  cinfo->global_state = DSTATE_START;
   34.86 +}
   34.87 +
   34.88 +
   34.89 +/*
   34.90 + * Destruction of a JPEG decompression object
   34.91 + */
   34.92 +
   34.93 +GLOBAL(void)
   34.94 +jpeg_destroy_decompress (j_decompress_ptr cinfo)
   34.95 +{
   34.96 +  jpeg_destroy((j_common_ptr) cinfo); /* use common routine */
   34.97 +}
   34.98 +
   34.99 +
  34.100 +/*
  34.101 + * Abort processing of a JPEG decompression operation,
  34.102 + * but don't destroy the object itself.
  34.103 + */
  34.104 +
  34.105 +GLOBAL(void)
  34.106 +jpeg_abort_decompress (j_decompress_ptr cinfo)
  34.107 +{
  34.108 +  jpeg_abort((j_common_ptr) cinfo); /* use common routine */
  34.109 +}
  34.110 +
  34.111 +
  34.112 +/*
  34.113 + * Set default decompression parameters.
  34.114 + */
  34.115 +
  34.116 +LOCAL(void)
  34.117 +default_decompress_parms (j_decompress_ptr cinfo)
  34.118 +{
  34.119 +  /* Guess the input colorspace, and set output colorspace accordingly. */
  34.120 +  /* (Wish JPEG committee had provided a real way to specify this...) */
  34.121 +  /* Note application may override our guesses. */
  34.122 +  switch (cinfo->num_components) {
  34.123 +  case 1:
  34.124 +    cinfo->jpeg_color_space = JCS_GRAYSCALE;
  34.125 +    cinfo->out_color_space = JCS_GRAYSCALE;
  34.126 +    break;
  34.127 +    
  34.128 +  case 3:
  34.129 +    if (cinfo->saw_JFIF_marker) {
  34.130 +      cinfo->jpeg_color_space = JCS_YCbCr; /* JFIF implies YCbCr */
  34.131 +    } else if (cinfo->saw_Adobe_marker) {
  34.132 +      switch (cinfo->Adobe_transform) {
  34.133 +      case 0:
  34.134 +	cinfo->jpeg_color_space = JCS_RGB;
  34.135 +	break;
  34.136 +      case 1:
  34.137 +	cinfo->jpeg_color_space = JCS_YCbCr;
  34.138 +	break;
  34.139 +      default:
  34.140 +	WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform);
  34.141 +	cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */
  34.142 +	break;
  34.143 +      }
  34.144 +    } else {
  34.145 +      /* Saw no special markers, try to guess from the component IDs */
  34.146 +      int cid0 = cinfo->comp_info[0].component_id;
  34.147 +      int cid1 = cinfo->comp_info[1].component_id;
  34.148 +      int cid2 = cinfo->comp_info[2].component_id;
  34.149 +
  34.150 +      if (cid0 == 1 && cid1 == 2 && cid2 == 3)
  34.151 +	cinfo->jpeg_color_space = JCS_YCbCr; /* assume JFIF w/out marker */
  34.152 +      else if (cid0 == 82 && cid1 == 71 && cid2 == 66)
  34.153 +	cinfo->jpeg_color_space = JCS_RGB; /* ASCII 'R', 'G', 'B' */
  34.154 +      else {
  34.155 +	TRACEMS3(cinfo, 1, JTRC_UNKNOWN_IDS, cid0, cid1, cid2);
  34.156 +	cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */
  34.157 +      }
  34.158 +    }
  34.159 +    /* Always guess RGB is proper output colorspace. */
  34.160 +    cinfo->out_color_space = JCS_RGB;
  34.161 +    break;
  34.162 +    
  34.163 +  case 4:
  34.164 +    if (cinfo->saw_Adobe_marker) {
  34.165 +      switch (cinfo->Adobe_transform) {
  34.166 +      case 0:
  34.167 +	cinfo->jpeg_color_space = JCS_CMYK;
  34.168 +	break;
  34.169 +      case 2:
  34.170 +	cinfo->jpeg_color_space = JCS_YCCK;
  34.171 +	break;
  34.172 +      default:
  34.173 +	WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform);
  34.174 +	cinfo->jpeg_color_space = JCS_YCCK; /* assume it's YCCK */
  34.175 +	break;
  34.176 +      }
  34.177 +    } else {
  34.178 +      /* No special markers, assume straight CMYK. */
  34.179 +      cinfo->jpeg_color_space = JCS_CMYK;
  34.180 +    }
  34.181 +    cinfo->out_color_space = JCS_CMYK;
  34.182 +    break;
  34.183 +    
  34.184 +  default:
  34.185 +    cinfo->jpeg_color_space = JCS_UNKNOWN;
  34.186 +    cinfo->out_color_space = JCS_UNKNOWN;
  34.187 +    break;
  34.188 +  }
  34.189 +
  34.190 +  /* Set defaults for other decompression parameters. */
  34.191 +  cinfo->scale_num = 1;		/* 1:1 scaling */
  34.192 +  cinfo->scale_denom = 1;
  34.193 +  cinfo->output_gamma = 1.0;
  34.194 +  cinfo->buffered_image = FALSE;
  34.195 +  cinfo->raw_data_out = FALSE;
  34.196 +  cinfo->dct_method = JDCT_DEFAULT;
  34.197 +  cinfo->do_fancy_upsampling = TRUE;
  34.198 +  cinfo->do_block_smoothing = TRUE;
  34.199 +  cinfo->quantize_colors = FALSE;
  34.200 +  /* We set these in case application only sets quantize_colors. */
  34.201 +  cinfo->dither_mode = JDITHER_FS;
  34.202 +#ifdef QUANT_2PASS_SUPPORTED
  34.203 +  cinfo->two_pass_quantize = TRUE;
  34.204 +#else
  34.205 +  cinfo->two_pass_quantize = FALSE;
  34.206 +#endif
  34.207 +  cinfo->desired_number_of_colors = 256;
  34.208 +  cinfo->colormap = NULL;
  34.209 +  /* Initialize for no mode change in buffered-image mode. */
  34.210 +  cinfo->enable_1pass_quant = FALSE;
  34.211 +  cinfo->enable_external_quant = FALSE;
  34.212 +  cinfo->enable_2pass_quant = FALSE;
  34.213 +}
  34.214 +
  34.215 +
  34.216 +/*
  34.217 + * Decompression startup: read start of JPEG datastream to see what's there.
  34.218 + * Need only initialize JPEG object and supply a data source before calling.
  34.219 + *
  34.220 + * This routine will read as far as the first SOS marker (ie, actual start of
  34.221 + * compressed data), and will save all tables and parameters in the JPEG
  34.222 + * object.  It will also initialize the decompression parameters to default
  34.223 + * values, and finally return JPEG_HEADER_OK.  On return, the application may
  34.224 + * adjust the decompression parameters and then call jpeg_start_decompress.
  34.225 + * (Or, if the application only wanted to determine the image parameters,
  34.226 + * the data need not be decompressed.  In that case, call jpeg_abort or
  34.227 + * jpeg_destroy to release any temporary space.)
  34.228 + * If an abbreviated (tables only) datastream is presented, the routine will
  34.229 + * return JPEG_HEADER_TABLES_ONLY upon reaching EOI.  The application may then
  34.230 + * re-use the JPEG object to read the abbreviated image datastream(s).
  34.231 + * It is unnecessary (but OK) to call jpeg_abort in this case.
  34.232 + * The JPEG_SUSPENDED return code only occurs if the data source module
  34.233 + * requests suspension of the decompressor.  In this case the application
  34.234 + * should load more source data and then re-call jpeg_read_header to resume
  34.235 + * processing.
  34.236 + * If a non-suspending data source is used and require_image is TRUE, then the
  34.237 + * return code need not be inspected since only JPEG_HEADER_OK is possible.
  34.238 + *
  34.239 + * This routine is now just a front end to jpeg_consume_input, with some
  34.240 + * extra error checking.
  34.241 + */
  34.242 +
  34.243 +GLOBAL(int)
  34.244 +jpeg_read_header (j_decompress_ptr cinfo, boolean require_image)
  34.245 +{
  34.246 +  int retcode;
  34.247 +
  34.248 +  if (cinfo->global_state != DSTATE_START &&
  34.249 +      cinfo->global_state != DSTATE_INHEADER)
  34.250 +    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
  34.251 +
  34.252 +  retcode = jpeg_consume_input(cinfo);
  34.253 +
  34.254 +  switch (retcode) {
  34.255 +  case JPEG_REACHED_SOS:
  34.256 +    retcode = JPEG_HEADER_OK;
  34.257 +    break;
  34.258 +  case JPEG_REACHED_EOI:
  34.259 +    if (require_image)		/* Complain if application wanted an image */
  34.260 +      ERREXIT(cinfo, JERR_NO_IMAGE);
  34.261 +    /* Reset to start state; it would be safer to require the application to
  34.262 +     * call jpeg_abort, but we can't change it now for compatibility reasons.
  34.263 +     * A side effect is to free any temporary memory (there shouldn't be any).
  34.264 +     */
  34.265 +    jpeg_abort((j_common_ptr) cinfo); /* sets state = DSTATE_START */
  34.266 +    retcode = JPEG_HEADER_TABLES_ONLY;
  34.267 +    break;
  34.268 +  case JPEG_SUSPENDED:
  34.269 +    /* no work */
  34.270 +    break;
  34.271 +  }
  34.272 +
  34.273 +  return retcode;
  34.274 +}
  34.275 +
  34.276 +
  34.277 +/*
  34.278 + * Consume data in advance of what the decompressor requires.
  34.279 + * This can be called at any time once the decompressor object has
  34.280 + * been created and a data source has been set up.
  34.281 + *
  34.282 + * This routine is essentially a state machine that handles a couple
  34.283 + * of critical state-transition actions, namely initial setup and
  34.284 + * transition from header scanning to ready-for-start_decompress.
  34.285 + * All the actual input is done via the input controller's consume_input
  34.286 + * method.
  34.287 + */
  34.288 +
  34.289 +GLOBAL(int)
  34.290 +jpeg_consume_input (j_decompress_ptr cinfo)
  34.291 +{
  34.292 +  int retcode = JPEG_SUSPENDED;
  34.293 +
  34.294 +  /* NB: every possible DSTATE value should be listed in this switch */
  34.295 +  switch (cinfo->global_state) {
  34.296 +  case DSTATE_START:
  34.297 +    /* Start-of-datastream actions: reset appropriate modules */
  34.298 +    (*cinfo->inputctl->reset_input_controller) (cinfo);
  34.299 +    /* Initialize application's data source module */
  34.300 +    (*cinfo->src->init_source) (cinfo);
  34.301 +    cinfo->global_state = DSTATE_INHEADER;
  34.302 +    /*FALLTHROUGH*/
  34.303 +  case DSTATE_INHEADER:
  34.304 +    retcode = (*cinfo->inputctl->consume_input) (cinfo);
  34.305 +    if (retcode == JPEG_REACHED_SOS) { /* Found SOS, prepare to decompress */
  34.306 +      /* Set up default parameters based on header data */
  34.307 +      default_decompress_parms(cinfo);
  34.308 +      /* Set global state: ready for start_decompress */
  34.309 +      cinfo->global_state = DSTATE_READY;
  34.310 +    }
  34.311 +    break;
  34.312 +  case DSTATE_READY:
  34.313 +    /* Can't advance past first SOS until start_decompress is called */
  34.314 +    retcode = JPEG_REACHED_SOS;
  34.315 +    break;
  34.316 +  case DSTATE_PRELOAD:
  34.317 +  case DSTATE_PRESCAN:
  34.318 +  case DSTATE_SCANNING:
  34.319 +  case DSTATE_RAW_OK:
  34.320 +  case DSTATE_BUFIMAGE:
  34.321 +  case DSTATE_BUFPOST:
  34.322 +  case DSTATE_STOPPING:
  34.323 +    retcode = (*cinfo->inputctl->consume_input) (cinfo);
  34.324 +    break;
  34.325 +  default:
  34.326 +    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
  34.327 +  }
  34.328 +  return retcode;
  34.329 +}
  34.330 +
  34.331 +
  34.332 +/*
  34.333 + * Have we finished reading the input file?
  34.334 + */
  34.335 +
  34.336 +GLOBAL(boolean)
  34.337 +jpeg_input_complete (j_decompress_ptr cinfo)
  34.338 +{
  34.339 +  /* Check for valid jpeg object */
  34.340 +  if (cinfo->global_state < DSTATE_START ||
  34.341 +      cinfo->global_state > DSTATE_STOPPING)
  34.342 +    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
  34.343 +  return cinfo->inputctl->eoi_reached;
  34.344 +}
  34.345 +
  34.346 +
  34.347 +/*
  34.348 + * Is there more than one scan?
  34.349 + */
  34.350 +
  34.351 +GLOBAL(boolean)
  34.352 +jpeg_has_multiple_scans (j_decompress_ptr cinfo)
  34.353 +{
  34.354 +  /* Only valid after jpeg_read_header completes */
  34.355 +  if (cinfo->global_state < DSTATE_READY ||
  34.356 +      cinfo->global_state > DSTATE_STOPPING)
  34.357 +    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
  34.358 +  return cinfo->inputctl->has_multiple_scans;
  34.359 +}
  34.360 +
  34.361 +
  34.362 +/*
  34.363 + * Finish JPEG decompression.
  34.364 + *
  34.365 + * This will normally just verify the file trailer and release temp storage.
  34.366 + *
  34.367 + * Returns FALSE if suspended.  The return value need be inspected only if
  34.368 + * a suspending data source is used.
  34.369 + */
  34.370 +
  34.371 +GLOBAL(boolean)
  34.372 +jpeg_finish_decompress (j_decompress_ptr cinfo)
  34.373 +{
  34.374 +  if ((cinfo->global_state == DSTATE_SCANNING ||
  34.375 +       cinfo->global_state == DSTATE_RAW_OK) && ! cinfo->buffered_image) {
  34.376 +    /* Terminate final pass of non-buffered mode */
  34.377 +    if (cinfo->output_scanline < cinfo->output_height)
  34.378 +      ERREXIT(cinfo, JERR_TOO_LITTLE_DATA);
  34.379 +    (*cinfo->master->finish_output_pass) (cinfo);
  34.380 +    cinfo->global_state = DSTATE_STOPPING;
  34.381 +  } else if (cinfo->global_state == DSTATE_BUFIMAGE) {
  34.382 +    /* Finishing after a buffered-image operation */
  34.383 +    cinfo->global_state = DSTATE_STOPPING;
  34.384 +  } else if (cinfo->global_state != DSTATE_STOPPING) {
  34.385 +    /* STOPPING = repeat call after a suspension, anything else is error */
  34.386 +    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
  34.387 +  }
  34.388 +  /* Read until EOI */
  34.389 +  while (! cinfo->inputctl->eoi_reached) {
  34.390 +    if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED)
  34.391 +      return FALSE;		/* Suspend, come back later */
  34.392 +  }
  34.393 +  /* Do final cleanup */
  34.394 +  (*cinfo->src->term_source) (cinfo);
  34.395 +  /* We can use jpeg_abort to release memory and reset global_state */
  34.396 +  jpeg_abort((j_common_ptr) cinfo);
  34.397 +  return TRUE;
  34.398 +}
    35.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    35.2 +++ b/libs/libjpeg/jdapistd.c	Sun Nov 01 00:36:56 2015 +0200
    35.3 @@ -0,0 +1,275 @@
    35.4 +/*
    35.5 + * jdapistd.c
    35.6 + *
    35.7 + * Copyright (C) 1994-1996, Thomas G. Lane.
    35.8 + * This file is part of the Independent JPEG Group's software.
    35.9 + * For conditions of distribution and use, see the accompanying README file.
   35.10 + *
   35.11 + * This file contains application interface code for the decompression half
   35.12 + * of the JPEG library.  These are the "standard" API routines that are
   35.13 + * used in the normal full-decompression case.  They are not used by a
   35.14 + * transcoding-only application.  Note that if an application links in
   35.15 + * jpeg_start_decompress, it will end up linking in the entire decompressor.
   35.16 + * We thus must separate this file from jdapimin.c to avoid linking the
   35.17 + * whole decompression library into a transcoder.
   35.18 + */
   35.19 +
   35.20 +#define JPEG_INTERNALS
   35.21 +#include "jinclude.h"
   35.22 +#include "jpeglib.h"
   35.23 +
   35.24 +
   35.25 +/* Forward declarations */
   35.26 +LOCAL(boolean) output_pass_setup JPP((j_decompress_ptr cinfo));
   35.27 +
   35.28 +
   35.29 +/*
   35.30 + * Decompression initialization.
   35.31 + * jpeg_read_header must be completed before calling this.
   35.32 + *
   35.33 + * If a multipass operating mode was selected, this will do all but the
   35.34 + * last pass, and thus may take a great deal of time.
   35.35 + *
   35.36 + * Returns FALSE if suspended.  The return value need be inspected only if
   35.37 + * a suspending data source is used.
   35.38 + */
   35.39 +
   35.40 +GLOBAL(boolean)
   35.41 +jpeg_start_decompress (j_decompress_ptr cinfo)
   35.42 +{
   35.43 +  if (cinfo->global_state == DSTATE_READY) {
   35.44 +    /* First call: initialize master control, select active modules */
   35.45 +    jinit_master_decompress(cinfo);
   35.46 +    if (cinfo->buffered_image) {
   35.47 +      /* No more work here; expecting jpeg_start_output next */
   35.48 +      cinfo->global_state = DSTATE_BUFIMAGE;
   35.49 +      return TRUE;
   35.50 +    }
   35.51 +    cinfo->global_state = DSTATE_PRELOAD;
   35.52 +  }
   35.53 +  if (cinfo->global_state == DSTATE_PRELOAD) {
   35.54 +    /* If file has multiple scans, absorb them all into the coef buffer */
   35.55 +    if (cinfo->inputctl->has_multiple_scans) {
   35.56 +#ifdef D_MULTISCAN_FILES_SUPPORTED
   35.57 +      for (;;) {
   35.58 +	int retcode;
   35.59 +	/* Call progress monitor hook if present */
   35.60 +	if (cinfo->progress != NULL)
   35.61 +	  (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
   35.62 +	/* Absorb some more input */
   35.63 +	retcode = (*cinfo->inputctl->consume_input) (cinfo);
   35.64 +	if (retcode == JPEG_SUSPENDED)
   35.65 +	  return FALSE;
   35.66 +	if (retcode == JPEG_REACHED_EOI)
   35.67 +	  break;
   35.68 +	/* Advance progress counter if appropriate */
   35.69 +	if (cinfo->progress != NULL &&
   35.70 +	    (retcode == JPEG_ROW_COMPLETED || retcode == JPEG_REACHED_SOS)) {
   35.71 +	  if (++cinfo->progress->pass_counter >= cinfo->progress->pass_limit) {
   35.72 +	    /* jdmaster underestimated number of scans; ratchet up one scan */
   35.73 +	    cinfo->progress->pass_limit += (long) cinfo->total_iMCU_rows;
   35.74 +	  }
   35.75 +	}
   35.76 +      }
   35.77 +#else
   35.78 +      ERREXIT(cinfo, JERR_NOT_COMPILED);
   35.79 +#endif /* D_MULTISCAN_FILES_SUPPORTED */
   35.80 +    }
   35.81 +    cinfo->output_scan_number = cinfo->input_scan_number;
   35.82 +  } else if (cinfo->global_state != DSTATE_PRESCAN)
   35.83 +    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
   35.84 +  /* Perform any dummy output passes, and set up for the final pass */
   35.85 +  return output_pass_setup(cinfo);
   35.86 +}
   35.87 +
   35.88 +
   35.89 +/*
   35.90 + * Set up for an output pass, and perform any dummy pass(es) needed.
   35.91 + * Common subroutine for jpeg_start_decompress and jpeg_start_output.
   35.92 + * Entry: global_state = DSTATE_PRESCAN only if previously suspended.
   35.93 + * Exit: If done, returns TRUE and sets global_state for proper output mode.
   35.94 + *       If suspended, returns FALSE and sets global_state = DSTATE_PRESCAN.
   35.95 + */
   35.96 +
   35.97 +LOCAL(boolean)
   35.98 +output_pass_setup (j_decompress_ptr cinfo)
   35.99 +{
  35.100 +  if (cinfo->global_state != DSTATE_PRESCAN) {
  35.101 +    /* First call: do pass setup */
  35.102 +    (*cinfo->master->prepare_for_output_pass) (cinfo);
  35.103 +    cinfo->output_scanline = 0;
  35.104 +    cinfo->global_state = DSTATE_PRESCAN;
  35.105 +  }
  35.106 +  /* Loop over any required dummy passes */
  35.107 +  while (cinfo->master->is_dummy_pass) {
  35.108 +#ifdef QUANT_2PASS_SUPPORTED
  35.109 +    /* Crank through the dummy pass */
  35.110 +    while (cinfo->output_scanline < cinfo->output_height) {
  35.111 +      JDIMENSION last_scanline;
  35.112 +      /* Call progress monitor hook if present */
  35.113 +      if (cinfo->progress != NULL) {
  35.114 +	cinfo->progress->pass_counter = (long) cinfo->output_scanline;
  35.115 +	cinfo->progress->pass_limit = (long) cinfo->output_height;
  35.116 +	(*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
  35.117 +      }
  35.118 +      /* Process some data */
  35.119 +      last_scanline = cinfo->output_scanline;
  35.120 +      (*cinfo->main->process_data) (cinfo, (JSAMPARRAY) NULL,
  35.121 +				    &cinfo->output_scanline, (JDIMENSION) 0);
  35.122 +      if (cinfo->output_scanline == last_scanline)
  35.123 +	return FALSE;		/* No progress made, must suspend */
  35.124 +    }
  35.125 +    /* Finish up dummy pass, and set up for another one */
  35.126 +    (*cinfo->master->finish_output_pass) (cinfo);
  35.127 +    (*cinfo->master->prepare_for_output_pass) (cinfo);
  35.128 +    cinfo->output_scanline = 0;
  35.129 +#else
  35.130 +    ERREXIT(cinfo, JERR_NOT_COMPILED);
  35.131 +#endif /* QUANT_2PASS_SUPPORTED */
  35.132 +  }
  35.133 +  /* Ready for application to drive output pass through
  35.134 +   * jpeg_read_scanlines or jpeg_read_raw_data.
  35.135 +   */
  35.136 +  cinfo->global_state = cinfo->raw_data_out ? DSTATE_RAW_OK : DSTATE_SCANNING;
  35.137 +  return TRUE;
  35.138 +}
  35.139 +
  35.140 +
  35.141 +/*
  35.142 + * Read some scanlines of data from the JPEG decompressor.
  35.143 + *
  35.144 + * The return value will be the number of lines actually read.
  35.145 + * This may be less than the number requested in several cases,
  35.146 + * including bottom of image, data source suspension, and operating
  35.147 + * modes that emit multiple scanlines at a time.
  35.148 + *
  35.149 + * Note: we warn about excess calls to jpeg_read_scanlines() since
  35.150 + * this likely signals an application programmer error.  However,
  35.151 + * an oversize buffer (max_lines > scanlines remaining) is not an error.
  35.152 + */
  35.153 +
  35.154 +GLOBAL(JDIMENSION)
  35.155 +jpeg_read_scanlines (j_decompress_ptr cinfo, JSAMPARRAY scanlines,
  35.156 +		     JDIMENSION max_lines)
  35.157 +{
  35.158 +  JDIMENSION row_ctr;
  35.159 +
  35.160 +  if (cinfo->global_state != DSTATE_SCANNING)
  35.161 +    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
  35.162 +  if (cinfo->output_scanline >= cinfo->output_height) {
  35.163 +    WARNMS(cinfo, JWRN_TOO_MUCH_DATA);
  35.164 +    return 0;
  35.165 +  }
  35.166 +
  35.167 +  /* Call progress monitor hook if present */
  35.168 +  if (cinfo->progress != NULL) {
  35.169 +    cinfo->progress->pass_counter = (long) cinfo->output_scanline;
  35.170 +    cinfo->progress->pass_limit = (long) cinfo->output_height;
  35.171 +    (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
  35.172 +  }
  35.173 +
  35.174 +  /* Process some data */
  35.175 +  row_ctr = 0;
  35.176 +  (*cinfo->main->process_data) (cinfo, scanlines, &row_ctr, max_lines);
  35.177 +  cinfo->output_scanline += row_ctr;
  35.178 +  return row_ctr;
  35.179 +}
  35.180 +
  35.181 +
  35.182 +/*
  35.183 + * Alternate entry point to read raw data.
  35.184 + * Processes exactly one iMCU row per call, unless suspended.
  35.185 + */
  35.186 +
  35.187 +GLOBAL(JDIMENSION)
  35.188 +jpeg_read_raw_data (j_decompress_ptr cinfo, JSAMPIMAGE data,
  35.189 +		    JDIMENSION max_lines)
  35.190 +{
  35.191 +  JDIMENSION lines_per_iMCU_row;
  35.192 +
  35.193 +  if (cinfo->global_state != DSTATE_RAW_OK)
  35.194 +    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
  35.195 +  if (cinfo->output_scanline >= cinfo->output_height) {
  35.196 +    WARNMS(cinfo, JWRN_TOO_MUCH_DATA);
  35.197 +    return 0;
  35.198 +  }
  35.199 +
  35.200 +  /* Call progress monitor hook if present */
  35.201 +  if (cinfo->progress != NULL) {
  35.202 +    cinfo->progress->pass_counter = (long) cinfo->output_scanline;
  35.203 +    cinfo->progress->pass_limit = (long) cinfo->output_height;
  35.204 +    (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
  35.205 +  }
  35.206 +
  35.207 +  /* Verify that at least one iMCU row can be returned. */
  35.208 +  lines_per_iMCU_row = cinfo->max_v_samp_factor * cinfo->min_DCT_scaled_size;
  35.209 +  if (max_lines < lines_per_iMCU_row)
  35.210 +    ERREXIT(cinfo, JERR_BUFFER_SIZE);
  35.211 +
  35.212 +  /* Decompress directly into user's buffer. */
  35.213 +  if (! (*cinfo->coef->decompress_data) (cinfo, data))
  35.214 +    return 0;			/* suspension forced, can do nothing more */
  35.215 +
  35.216 +  /* OK, we processed one iMCU row. */
  35.217 +  cinfo->output_scanline += lines_per_iMCU_row;
  35.218 +  return lines_per_iMCU_row;
  35.219 +}
  35.220 +
  35.221 +
  35.222 +/* Additional entry points for buffered-image mode. */
  35.223 +
  35.224 +#ifdef D_MULTISCAN_FILES_SUPPORTED
  35.225 +
  35.226 +/*
  35.227 + * Initialize for an output pass in buffered-image mode.
  35.228 + */
  35.229 +
  35.230 +GLOBAL(boolean)
  35.231 +jpeg_start_output (j_decompress_ptr cinfo, int scan_number)
  35.232 +{
  35.233 +  if (cinfo->global_state != DSTATE_BUFIMAGE &&
  35.234 +      cinfo->global_state != DSTATE_PRESCAN)
  35.235 +    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
  35.236 +  /* Limit scan number to valid range */
  35.237 +  if (scan_number <= 0)
  35.238 +    scan_number = 1;
  35.239 +  if (cinfo->inputctl->eoi_reached &&
  35.240 +      scan_number > cinfo->input_scan_number)
  35.241 +    scan_number = cinfo->input_scan_number;
  35.242 +  cinfo->output_scan_number = scan_number;
  35.243 +  /* Perform any dummy output passes, and set up for the real pass */
  35.244 +  return output_pass_setup(cinfo);
  35.245 +}
  35.246 +
  35.247 +
  35.248 +/*
  35.249 + * Finish up after an output pass in buffered-image mode.
  35.250 + *
  35.251 + * Returns FALSE if suspended.  The return value need be inspected only if
  35.252 + * a suspending data source is used.
  35.253 + */
  35.254 +
  35.255 +GLOBAL(boolean)
  35.256 +jpeg_finish_output (j_decompress_ptr cinfo)
  35.257 +{
  35.258 +  if ((cinfo->global_state == DSTATE_SCANNING ||
  35.259 +       cinfo->global_state == DSTATE_RAW_OK) && cinfo->buffered_image) {
  35.260 +    /* Terminate this pass. */
  35.261 +    /* We do not require the whole pass to have been completed. */
  35.262 +    (*cinfo->master->finish_output_pass) (cinfo);
  35.263 +    cinfo->global_state = DSTATE_BUFPOST;
  35.264 +  } else if (cinfo->global_state != DSTATE_BUFPOST) {
  35.265 +    /* BUFPOST = repeat call after a suspension, anything else is error */
  35.266 +    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
  35.267 +  }
  35.268 +  /* Read markers looking for SOS or EOI */
  35.269 +  while (cinfo->input_scan_number <= cinfo->output_scan_number &&
  35.270 +	 ! cinfo->inputctl->eoi_reached) {
  35.271 +    if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED)
  35.272 +      return FALSE;		/* Suspend, come back later */
  35.273 +  }
  35.274 +  cinfo->global_state = DSTATE_BUFIMAGE;
  35.275 +  return TRUE;
  35.276 +}
  35.277 +
  35.278 +#endif /* D_MULTISCAN_FILES_SUPPORTED */
    36.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    36.2 +++ b/libs/libjpeg/jdatadst.c	Sun Nov 01 00:36:56 2015 +0200
    36.3 @@ -0,0 +1,151 @@
    36.4 +/*
    36.5 + * jdatadst.c
    36.6 + *
    36.7 + * Copyright (C) 1994-1996, Thomas G. Lane.
    36.8 + * This file is part of the Independent JPEG Group's software.
    36.9 + * For conditions of distribution and use, see the accompanying README file.
   36.10 + *
   36.11 + * This file contains compression data destination routines for the case of
   36.12 + * emitting JPEG data to a file (or any stdio stream).  While these routines
   36.13 + * are sufficient for most applications, some will want to use a different
   36.14 + * destination manager.
   36.15 + * IMPORTANT: we assume that fwrite() will correctly transcribe an array of
   36.16 + * JOCTETs into 8-bit-wide elements on external storage.  If char is wider
   36.17 + * than 8 bits on your machine, you may need to do some tweaking.
   36.18 + */
   36.19 +
   36.20 +/* this is not a core library module, so it doesn't define JPEG_INTERNALS */
   36.21 +#include "jinclude.h"
   36.22 +#include "jpeglib.h"
   36.23 +#include "jerror.h"
   36.24 +
   36.25 +
   36.26 +/* Expanded data destination object for stdio output */
   36.27 +
   36.28 +typedef struct {
   36.29 +  struct jpeg_destination_mgr pub; /* public fields */
   36.30 +
   36.31 +  FILE * outfile;		/* target stream */
   36.32 +  JOCTET * buffer;		/* start of buffer */
   36.33 +} my_destination_mgr;
   36.34 +
   36.35 +typedef my_destination_mgr * my_dest_ptr;
   36.36 +
   36.37 +#define OUTPUT_BUF_SIZE  4096	/* choose an efficiently fwrite'able size */
   36.38 +
   36.39 +
   36.40 +/*
   36.41 + * Initialize destination --- called by jpeg_start_compress
   36.42 + * before any data is actually written.
   36.43 + */
   36.44 +
   36.45 +METHODDEF(void)
   36.46 +init_destination (j_compress_ptr cinfo)
   36.47 +{
   36.48 +  my_dest_ptr dest = (my_dest_ptr) cinfo->dest;
   36.49 +
   36.50 +  /* Allocate the output buffer --- it will be released when done with image */
   36.51 +  dest->buffer = (JOCTET *)
   36.52 +      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
   36.53 +				  OUTPUT_BUF_SIZE * SIZEOF(JOCTET));
   36.54 +
   36.55 +  dest->pub.next_output_byte = dest->buffer;
   36.56 +  dest->pub.free_in_buffer = OUTPUT_BUF_SIZE;
   36.57 +}
   36.58 +
   36.59 +
   36.60 +/*
   36.61 + * Empty the output buffer --- called whenever buffer fills up.
   36.62 + *
   36.63 + * In typical applications, this should write the entire output buffer
   36.64 + * (ignoring the current state of next_output_byte & free_in_buffer),
   36.65 + * reset the pointer & count to the start of the buffer, and return TRUE
   36.66 + * indicating that the buffer has been dumped.
   36.67 + *
   36.68 + * In applications that need to be able to suspend compression due to output
   36.69 + * overrun, a FALSE return indicates that the buffer cannot be emptied now.
   36.70 + * In this situation, the compressor will return to its caller (possibly with
   36.71 + * an indication that it has not accepted all the supplied scanlines).  The
   36.72 + * application should resume compression after it has made more room in the
   36.73 + * output buffer.  Note that there are substantial restrictions on the use of
   36.74 + * suspension --- see the documentation.
   36.75 + *
   36.76 + * When suspending, the compressor will back up to a convenient restart point
   36.77 + * (typically the start of the current MCU). next_output_byte & free_in_buffer
   36.78 + * indicate where the restart point will be if the current call returns FALSE.
   36.79 + * Data beyond this point will be regenerated after resumption, so do not
   36.80 + * write it out when emptying the buffer externally.
   36.81 + */
   36.82 +
   36.83 +METHODDEF(boolean)
   36.84 +empty_output_buffer (j_compress_ptr cinfo)
   36.85 +{
   36.86 +  my_dest_ptr dest = (my_dest_ptr) cinfo->dest;
   36.87 +
   36.88 +  if (JFWRITE(dest->outfile, dest->buffer, OUTPUT_BUF_SIZE) !=
   36.89 +      (size_t) OUTPUT_BUF_SIZE)
   36.90 +    ERREXIT(cinfo, JERR_FILE_WRITE);
   36.91 +
   36.92 +  dest->pub.next_output_byte = dest->buffer;
   36.93 +  dest->pub.free_in_buffer = OUTPUT_BUF_SIZE;
   36.94 +
   36.95 +  return TRUE;
   36.96 +}
   36.97 +
   36.98 +
   36.99 +/*
  36.100 + * Terminate destination --- called by jpeg_finish_compress
  36.101 + * after all data has been written.  Usually needs to flush buffer.
  36.102 + *
  36.103 + * NB: *not* called by jpeg_abort or jpeg_destroy; surrounding
  36.104 + * application must deal with any cleanup that should happen even
  36.105 + * for error exit.
  36.106 + */
  36.107 +
  36.108 +METHODDEF(void)
  36.109 +term_destination (j_compress_ptr cinfo)
  36.110 +{
  36.111 +  my_dest_ptr dest = (my_dest_ptr) cinfo->dest;
  36.112 +  size_t datacount = OUTPUT_BUF_SIZE - dest->pub.free_in_buffer;
  36.113 +
  36.114 +  /* Write any data remaining in the buffer */
  36.115 +  if (datacount > 0) {
  36.116 +    if (JFWRITE(dest->outfile, dest->buffer, datacount) != datacount)
  36.117 +      ERREXIT(cinfo, JERR_FILE_WRITE);
  36.118 +  }
  36.119 +  fflush(dest->outfile);
  36.120 +  /* Make sure we wrote the output file OK */
  36.121 +  if (ferror(dest->outfile))
  36.122 +    ERREXIT(cinfo, JERR_FILE_WRITE);
  36.123 +}
  36.124 +
  36.125 +
  36.126 +/*
  36.127 + * Prepare for output to a stdio stream.
  36.128 + * The caller must have already opened the stream, and is responsible
  36.129 + * for closing it after finishing compression.
  36.130 + */
  36.131 +
  36.132 +GLOBAL(void)
  36.133 +jpeg_stdio_dest (j_compress_ptr cinfo, FILE * outfile)
  36.134 +{
  36.135 +  my_dest_ptr dest;
  36.136 +
  36.137 +  /* The destination object is made permanent so that multiple JPEG images
  36.138 +   * can be written to the same file without re-executing jpeg_stdio_dest.
  36.139 +   * This makes it dangerous to use this manager and a different destination
  36.140 +   * manager serially with the same JPEG object, because their private object
  36.141 +   * sizes may be different.  Caveat programmer.
  36.142 +   */
  36.143 +  if (cinfo->dest == NULL) {	/* first time for this JPEG object? */
  36.144 +    cinfo->dest = (struct jpeg_destination_mgr *)
  36.145 +      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
  36.146 +				  SIZEOF(my_destination_mgr));
  36.147 +  }
  36.148 +
  36.149 +  dest = (my_dest_ptr) cinfo->dest;
  36.150 +  dest->pub.init_destination = init_destination;
  36.151 +  dest->pub.empty_output_buffer = empty_output_buffer;
  36.152 +  dest->pub.term_destination = term_destination;
  36.153 +  dest->outfile = outfile;
  36.154 +}
    37.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    37.2 +++ b/libs/libjpeg/jdatasrc.c	Sun Nov 01 00:36:56 2015 +0200
    37.3 @@ -0,0 +1,212 @@
    37.4 +/*
    37.5 + * jdatasrc.c
    37.6 + *
    37.7 + * Copyright (C) 1994-1996, Thomas G. Lane.
    37.8 + * This file is part of the Independent JPEG Group's software.
    37.9 + * For conditions of distribution and use, see the accompanying README file.
   37.10 + *
   37.11 + * This file contains decompression data source routines for the case of
   37.12 + * reading JPEG data from a file (or any stdio stream).  While these routines
   37.13 + * are sufficient for most applications, some will want to use a different
   37.14 + * source manager.
   37.15 + * IMPORTANT: we assume that fread() will correctly transcribe an array of
   37.16 + * JOCTETs from 8-bit-wide elements on external storage.  If char is wider
   37.17 + * than 8 bits on your machine, you may need to do some tweaking.
   37.18 + */
   37.19 +
   37.20 +/* this is not a core library module, so it doesn't define JPEG_INTERNALS */
   37.21 +#include "jinclude.h"
   37.22 +#include "jpeglib.h"
   37.23 +#include "jerror.h"
   37.24 +
   37.25 +
   37.26 +/* Expanded data source object for stdio input */
   37.27 +
   37.28 +typedef struct {
   37.29 +  struct jpeg_source_mgr pub;	/* public fields */
   37.30 +
   37.31 +  FILE * infile;		/* source stream */
   37.32 +  JOCTET * buffer;		/* start of buffer */
   37.33 +  boolean start_of_file;	/* have we gotten any data yet? */
   37.34 +} my_source_mgr;
   37.35 +
   37.36 +typedef my_source_mgr * my_src_ptr;
   37.37 +
   37.38 +#define INPUT_BUF_SIZE  4096	/* choose an efficiently fread'able size */
   37.39 +
   37.40 +
   37.41 +/*
   37.42 + * Initialize source --- called by jpeg_read_header
   37.43 + * before any data is actually read.
   37.44 + */
   37.45 +
   37.46 +METHODDEF(void)
   37.47 +init_source (j_decompress_ptr cinfo)
   37.48 +{
   37.49 +  my_src_ptr src = (my_src_ptr) cinfo->src;
   37.50 +
   37.51 +  /* We reset the empty-input-file flag for each image,
   37.52 +   * but we don't clear the input buffer.
   37.53 +   * This is correct behavior for reading a series of images from one source.
   37.54 +   */
   37.55 +  src->start_of_file = TRUE;
   37.56 +}
   37.57 +
   37.58 +
   37.59 +/*
   37.60 + * Fill the input buffer --- called whenever buffer is emptied.
   37.61 + *
   37.62 + * In typical applications, this should read fresh data into the buffer
   37.63 + * (ignoring the current state of next_input_byte & bytes_in_buffer),
   37.64 + * reset the pointer & count to the start of the buffer, and return TRUE
   37.65 + * indicating that the buffer has been reloaded.  It is not necessary to
   37.66 + * fill the buffer entirely, only to obtain at least one more byte.
   37.67 + *
   37.68 + * There is no such thing as an EOF return.  If the end of the file has been
   37.69 + * reached, the routine has a choice of ERREXIT() or inserting fake data into
   37.70 + * the buffer.  In most cases, generating a warning message and inserting a
   37.71 + * fake EOI marker is the best course of action --- this will allow the
   37.72 + * decompressor to output however much of the image is there.  However,
   37.73 + * the resulting error message is misleading if the real problem is an empty
   37.74 + * input file, so we handle that case specially.
   37.75 + *
   37.76 + * In applications that need to be able to suspend compression due to input
   37.77 + * not being available yet, a FALSE return indicates that no more data can be
   37.78 + * obtained right now, but more may be forthcoming later.  In this situation,
   37.79 + * the decompressor will return to its caller (with an indication of the
   37.80 + * number of scanlines it has read, if any).  The application should resume
   37.81 + * decompression after it has loaded more data into the input buffer.  Note
   37.82 + * that there are substantial restrictions on the use of suspension --- see
   37.83 + * the documentation.
   37.84 + *
   37.85 + * When suspending, the decompressor will back up to a convenient restart point
   37.86 + * (typically the start of the current MCU). next_input_byte & bytes_in_buffer
   37.87 + * indicate where the restart point will be if the current call returns FALSE.
   37.88 + * Data beyond this point must be rescanned after resumption, so move it to
   37.89 + * the front of the buffer rather than discarding it.
   37.90 + */
   37.91 +
   37.92 +METHODDEF(boolean)
   37.93 +fill_input_buffer (j_decompress_ptr cinfo)
   37.94 +{
   37.95 +  my_src_ptr src = (my_src_ptr) cinfo->src;
   37.96 +  size_t nbytes;
   37.97 +
   37.98 +  nbytes = JFREAD(src->infile, src->buffer, INPUT_BUF_SIZE);
   37.99 +
  37.100 +  if (nbytes <= 0) {
  37.101 +    if (src->start_of_file)	/* Treat empty input file as fatal error */
  37.102 +      ERREXIT(cinfo, JERR_INPUT_EMPTY);
  37.103 +    WARNMS(cinfo, JWRN_JPEG_EOF);
  37.104 +    /* Insert a fake EOI marker */
  37.105 +    src->buffer[0] = (JOCTET) 0xFF;
  37.106 +    src->buffer[1] = (JOCTET) JPEG_EOI;
  37.107 +    nbytes = 2;
  37.108 +  }
  37.109 +
  37.110 +  src->pub.next_input_byte = src->buffer;
  37.111 +  src->pub.bytes_in_buffer = nbytes;
  37.112 +  src->start_of_file = FALSE;
  37.113 +
  37.114 +  return TRUE;
  37.115 +}
  37.116 +
  37.117 +
  37.118 +/*
  37.119 + * Skip data --- used to skip over a potentially large amount of
  37.120 + * uninteresting data (such as an APPn marker).
  37.121 + *
  37.122 + * Writers of suspendable-input applications must note that skip_input_data
  37.123 + * is not granted the right to give a suspension return.  If the skip extends
  37.124 + * beyond the data currently in the buffer, the buffer can be marked empty so
  37.125 + * that the next read will cause a fill_input_buffer call that can suspend.
  37.126 + * Arranging for additional bytes to be discarded before reloading the input
  37.127 + * buffer is the application writer's problem.
  37.128 + */
  37.129 +
  37.130 +METHODDEF(void)
  37.131 +skip_input_data (j_decompress_ptr cinfo, long num_bytes)
  37.132 +{
  37.133 +  my_src_ptr src = (my_src_ptr) cinfo->src;
  37.134 +
  37.135 +  /* Just a dumb implementation for now.  Could use fseek() except
  37.136 +   * it doesn't work on pipes.  Not clear that being smart is worth
  37.137 +   * any trouble anyway --- large skips are infrequent.
  37.138 +   */
  37.139 +  if (num_bytes > 0) {
  37.140 +    while (num_bytes > (long) src->pub.bytes_in_buffer) {
  37.141 +      num_bytes -= (long) src->pub.bytes_in_buffer;
  37.142 +      (void) fill_input_buffer(cinfo);
  37.143 +      /* note we assume that fill_input_buffer will never return FALSE,
  37.144 +       * so suspension need not be handled.
  37.145 +       */
  37.146 +    }
  37.147 +    src->pub.next_input_byte += (size_t) num_bytes;
  37.148 +    src->pub.bytes_in_buffer -= (size_t) num_bytes;
  37.149 +  }
  37.150 +}
  37.151 +
  37.152 +
  37.153 +/*
  37.154 + * An additional method that can be provided by data source modules is the
  37.155 + * resync_to_restart method for error recovery in the presence of RST markers.
  37.156 + * For the moment, this source module just uses the default resync method
  37.157 + * provided by the JPEG library.  That method assumes that no backtracking
  37.158 + * is possible.
  37.159 + */
  37.160 +
  37.161 +
  37.162 +/*
  37.163 + * Terminate source --- called by jpeg_finish_decompress
  37.164 + * after all data has been read.  Often a no-op.
  37.165 + *
  37.166 + * NB: *not* called by jpeg_abort or jpeg_destroy; surrounding
  37.167 + * application must deal with any cleanup that should happen even
  37.168 + * for error exit.
  37.169 + */
  37.170 +
  37.171 +METHODDEF(void)
  37.172 +term_source (j_decompress_ptr cinfo)
  37.173 +{
  37.174 +  /* no work necessary here */
  37.175 +}
  37.176 +
  37.177 +
  37.178 +/*
  37.179 + * Prepare for input from a stdio stream.
  37.180 + * The caller must have already opened the stream, and is responsible
  37.181 + * for closing it after finishing decompression.
  37.182 + */
  37.183 +
  37.184 +GLOBAL(void)
  37.185 +jpeg_stdio_src (j_decompress_ptr cinfo, FILE * infile)
  37.186 +{
  37.187 +  my_src_ptr src;
  37.188 +
  37.189 +  /* The source object and input buffer are made permanent so that a series
  37.190 +   * of JPEG images can be read from the same file by calling jpeg_stdio_src
  37.191 +   * only before the first one.  (If we discarded the buffer at the end of
  37.192 +   * one image, we'd likely lose the start of the next one.)
  37.193 +   * This makes it unsafe to use this manager and a different source
  37.194 +   * manager serially with the same JPEG object.  Caveat programmer.
  37.195 +   */
  37.196 +  if (cinfo->src == NULL) {	/* first time for this JPEG object? */
  37.197 +    cinfo->src = (struct jpeg_source_mgr *)
  37.198 +      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
  37.199 +				  SIZEOF(my_source_mgr));
  37.200 +    src = (my_src_ptr) cinfo->src;
  37.201 +    src->buffer = (JOCTET *)
  37.202 +      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
  37.203 +				  INPUT_BUF_SIZE * SIZEOF(JOCTET));
  37.204 +  }
  37.205 +
  37.206 +  src = (my_src_ptr) cinfo->src;
  37.207 +  src->pub.init_source = init_source;
  37.208 +  src->pub.fill_input_buffer = fill_input_buffer;
  37.209 +  src->pub.skip_input_data = skip_input_data;
  37.210 +  src->pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */
  37.211 +  src->pub.term_source = term_source;
  37.212 +  src->infile = infile;
  37.213 +  src->pub.bytes_in_buffer = 0; /* forces fill_input_buffer on first read */
  37.214 +  src->pub.next_input_byte = NULL; /* until buffer loaded */
  37.215 +}
    38.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    38.2 +++ b/libs/libjpeg/jdcoefct.c	Sun Nov 01 00:36:56 2015 +0200
    38.3 @@ -0,0 +1,736 @@
    38.4 +/*
    38.5 + * jdcoefct.c
    38.6 + *
    38.7 + * Copyright (C) 1994-1997, Thomas G. Lane.
    38.8 + * This file is part of the Independent JPEG Group's software.
    38.9 + * For conditions of distribution and use, see the accompanying README file.
   38.10 + *
   38.11 + * This file contains the coefficient buffer controller for decompression.
   38.12 + * This controller is the top level of the JPEG decompressor proper.
   38.13 + * The coefficient buffer lies between entropy decoding and inverse-DCT steps.
   38.14 + *
   38.15 + * In buffered-image mode, this controller is the interface between
   38.16 + * input-oriented processing and output-oriented processing.
   38.17 + * Also, the input side (only) is used when reading a file for transcoding.
   38.18 + */
   38.19 +
   38.20 +#define JPEG_INTERNALS
   38.21 +#include "jinclude.h"
   38.22 +#include "jpeglib.h"
   38.23 +
   38.24 +/* Block smoothing is only applicable for progressive JPEG, so: */
   38.25 +#ifndef D_PROGRESSIVE_SUPPORTED
   38.26 +#undef BLOCK_SMOOTHING_SUPPORTED
   38.27 +#endif
   38.28 +
   38.29 +/* Private buffer controller object */
   38.30 +
   38.31 +typedef struct {
   38.32 +  struct jpeg_d_coef_controller pub; /* public fields */
   38.33 +
   38.34 +  /* These variables keep track of the current location of the input side. */
   38.35 +  /* cinfo->input_iMCU_row is also used for this. */
   38.36 +  JDIMENSION MCU_ctr;		/* counts MCUs processed in current row */
   38.37 +  int MCU_vert_offset;		/* counts MCU rows within iMCU row */
   38.38 +  int MCU_rows_per_iMCU_row;	/* number of such rows needed */
   38.39 +
   38.40 +  /* The output side's location is represented by cinfo->output_iMCU_row. */
   38.41 +
   38.42 +  /* In single-pass modes, it's sufficient to buffer just one MCU.
   38.43 +   * We allocate a workspace of D_MAX_BLOCKS_IN_MCU coefficient blocks,
   38.44 +   * and let the entropy decoder write into that workspace each time.
   38.45 +   * (On 80x86, the workspace is FAR even though it's not really very big;
   38.46 +   * this is to keep the module interfaces unchanged when a large coefficient
   38.47 +   * buffer is necessary.)
   38.48 +   * In multi-pass modes, this array points to the current MCU's blocks
   38.49 +   * within the virtual arrays; it is used only by the input side.
   38.50 +   */
   38.51 +  JBLOCKROW MCU_buffer[D_MAX_BLOCKS_IN_MCU];
   38.52 +
   38.53 +#ifdef D_MULTISCAN_FILES_SUPPORTED
   38.54 +  /* In multi-pass modes, we need a virtual block array for each component. */
   38.55 +  jvirt_barray_ptr whole_image[MAX_COMPONENTS];
   38.56 +#endif
   38.57 +
   38.58 +#ifdef BLOCK_SMOOTHING_SUPPORTED
   38.59 +  /* When doing block smoothing, we latch coefficient Al values here */
   38.60 +  int * coef_bits_latch;
   38.61 +#define SAVED_COEFS  6		/* we save coef_bits[0..5] */
   38.62 +#endif
   38.63 +} my_coef_controller;
   38.64 +
   38.65 +typedef my_coef_controller * my_coef_ptr;
   38.66 +
   38.67 +/* Forward declarations */
   38.68 +METHODDEF(int) decompress_onepass
   38.69 +	JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf));
   38.70 +#ifdef D_MULTISCAN_FILES_SUPPORTED
   38.71 +METHODDEF(int) decompress_data
   38.72 +	JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf));
   38.73 +#endif
   38.74 +#ifdef BLOCK_SMOOTHING_SUPPORTED
   38.75 +LOCAL(boolean) smoothing_ok JPP((j_decompress_ptr cinfo));
   38.76 +METHODDEF(int) decompress_smooth_data
   38.77 +	JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf));
   38.78 +#endif
   38.79 +
   38.80 +
   38.81 +LOCAL(void)
   38.82 +start_iMCU_row (j_decompress_ptr cinfo)
   38.83 +/* Reset within-iMCU-row counters for a new row (input side) */
   38.84 +{
   38.85 +  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
   38.86 +
   38.87 +  /* In an interleaved scan, an MCU row is the same as an iMCU row.
   38.88 +   * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows.
   38.89 +   * But at the bottom of the image, process only what's left.
   38.90 +   */
   38.91 +  if (cinfo->comps_in_scan > 1) {
   38.92 +    coef->MCU_rows_per_iMCU_row = 1;
   38.93 +  } else {
   38.94 +    if (cinfo->input_iMCU_row < (cinfo->total_iMCU_rows-1))
   38.95 +      coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor;
   38.96 +    else
   38.97 +      coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height;
   38.98 +  }
   38.99 +
  38.100 +  coef->MCU_ctr = 0;
  38.101 +  coef->MCU_vert_offset = 0;
  38.102 +}
  38.103 +
  38.104 +
  38.105 +/*
  38.106 + * Initialize for an input processing pass.
  38.107 + */
  38.108 +
  38.109 +METHODDEF(void)
  38.110 +start_input_pass (j_decompress_ptr cinfo)
  38.111 +{
  38.112 +  cinfo->input_iMCU_row = 0;
  38.113 +  start_iMCU_row(cinfo);
  38.114 +}
  38.115 +
  38.116 +
  38.117 +/*
  38.118 + * Initialize for an output processing pass.
  38.119 + */
  38.120 +
  38.121 +METHODDEF(void)
  38.122 +start_output_pass (j_decompress_ptr cinfo)
  38.123 +{
  38.124 +#ifdef BLOCK_SMOOTHING_SUPPORTED
  38.125 +  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
  38.126 +
  38.127 +  /* If multipass, check to see whether to use block smoothing on this pass */
  38.128 +  if (coef->pub.coef_arrays != NULL) {
  38.129 +    if (cinfo->do_block_smoothing && smoothing_ok(cinfo))
  38.130 +      coef->pub.decompress_data = decompress_smooth_data;
  38.131 +    else
  38.132 +      coef->pub.decompress_data = decompress_data;
  38.133 +  }
  38.134 +#endif
  38.135 +  cinfo->output_iMCU_row = 0;
  38.136 +}
  38.137 +
  38.138 +
  38.139 +/*
  38.140 + * Decompress and return some data in the single-pass case.
  38.141 + * Always attempts to emit one fully interleaved MCU row ("iMCU" row).
  38.142 + * Input and output must run in lockstep since we have only a one-MCU buffer.
  38.143 + * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED.
  38.144 + *
  38.145 + * NB: output_buf contains a plane for each component in image,
  38.146 + * which we index according to the component's SOF position.
  38.147 + */
  38.148 +
  38.149 +METHODDEF(int)
  38.150 +decompress_onepass (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
  38.151 +{
  38.152 +  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
  38.153 +  JDIMENSION MCU_col_num;	/* index of current MCU within row */
  38.154 +  JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1;
  38.155 +  JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
  38.156 +  int blkn, ci, xindex, yindex, yoffset, useful_width;
  38.157 +  JSAMPARRAY output_ptr;
  38.158 +  JDIMENSION start_col, output_col;
  38.159 +  jpeg_component_info *compptr;
  38.160 +  inverse_DCT_method_ptr inverse_DCT;
  38.161 +
  38.162 +  /* Loop to process as much as one whole iMCU row */
  38.163 +  for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
  38.164 +       yoffset++) {
  38.165 +    for (MCU_col_num = coef->MCU_ctr; MCU_col_num <= last_MCU_col;
  38.166 +	 MCU_col_num++) {
  38.167 +      /* Try to fetch an MCU.  Entropy decoder expects buffer to be zeroed. */
  38.168 +      jzero_far((void FAR *) coef->MCU_buffer[0],
  38.169 +		(size_t) (cinfo->blocks_in_MCU * SIZEOF(JBLOCK)));
  38.170 +      if (! (*cinfo->entropy->decode_mcu) (cinfo, coef->MCU_buffer)) {
  38.171 +	/* Suspension forced; update state counters and exit */
  38.172 +	coef->MCU_vert_offset = yoffset;
  38.173 +	coef->MCU_ctr = MCU_col_num;
  38.174 +	return JPEG_SUSPENDED;
  38.175 +      }
  38.176 +      /* Determine where data should go in output_buf and do the IDCT thing.
  38.177 +       * We skip dummy blocks at the right and bottom edges (but blkn gets
  38.178 +       * incremented past them!).  Note the inner loop relies on having
  38.179 +       * allocated the MCU_buffer[] blocks sequentially.
  38.180 +       */
  38.181 +      blkn = 0;			/* index of current DCT block within MCU */
  38.182 +      for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
  38.183 +	compptr = cinfo->cur_comp_info[ci];
  38.184 +	/* Don't bother to IDCT an uninteresting component. */
  38.185 +	if (! compptr->component_needed) {
  38.186 +	  blkn += compptr->MCU_blocks;
  38.187 +	  continue;
  38.188 +	}
  38.189 +	inverse_DCT = cinfo->idct->inverse_DCT[compptr->component_index];
  38.190 +	useful_width = (MCU_col_num < last_MCU_col) ? compptr->MCU_width
  38.191 +						    : compptr->last_col_width;
  38.192 +	output_ptr = output_buf[compptr->component_index] +
  38.193 +	  yoffset * compptr->DCT_scaled_size;
  38.194 +	start_col = MCU_col_num * compptr->MCU_sample_width;
  38.195 +	for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
  38.196 +	  if (cinfo->input_iMCU_row < last_iMCU_row ||
  38.197 +	      yoffset+yindex < compptr->last_row_height) {
  38.198 +	    output_col = start_col;
  38.199 +	    for (xindex = 0; xindex < useful_width; xindex++) {
  38.200 +	      (*inverse_DCT) (cinfo, compptr,
  38.201 +			      (JCOEFPTR) coef->MCU_buffer[blkn+xindex],
  38.202 +			      output_ptr, output_col);
  38.203 +	      output_col += compptr->DCT_scaled_size;
  38.204 +	    }
  38.205 +	  }
  38.206 +	  blkn += compptr->MCU_width;
  38.207 +	  output_ptr += compptr->DCT_scaled_size;
  38.208 +	}
  38.209 +      }
  38.210 +    }
  38.211 +    /* Completed an MCU row, but perhaps not an iMCU row */
  38.212 +    coef->MCU_ctr = 0;
  38.213 +  }
  38.214 +  /* Completed the iMCU row, advance counters for next one */
  38.215 +  cinfo->output_iMCU_row++;
  38.216 +  if (++(cinfo->input_iMCU_row) < cinfo->total_iMCU_rows) {
  38.217 +    start_iMCU_row(cinfo);
  38.218 +    return JPEG_ROW_COMPLETED;
  38.219 +  }
  38.220 +  /* Completed the scan */
  38.221 +  (*cinfo->inputctl->finish_input_pass) (cinfo);
  38.222 +  return JPEG_SCAN_COMPLETED;
  38.223 +}
  38.224 +
  38.225 +
  38.226 +/*
  38.227 + * Dummy consume-input routine for single-pass operation.
  38.228 + */
  38.229 +
  38.230 +METHODDEF(int)
  38.231 +dummy_consume_data (j_decompress_ptr cinfo)
  38.232 +{
  38.233 +  return JPEG_SUSPENDED;	/* Always indicate nothing was done */
  38.234 +}
  38.235 +
  38.236 +
  38.237 +#ifdef D_MULTISCAN_FILES_SUPPORTED
  38.238 +
  38.239 +/*
  38.240 + * Consume input data and store it in the full-image coefficient buffer.
  38.241 + * We read as much as one fully interleaved MCU row ("iMCU" row) per call,
  38.242 + * ie, v_samp_factor block rows for each component in the scan.
  38.243 + * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED.
  38.244 + */
  38.245 +
  38.246 +METHODDEF(int)
  38.247 +consume_data (j_decompress_ptr cinfo)
  38.248 +{
  38.249 +  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
  38.250 +  JDIMENSION MCU_col_num;	/* index of current MCU within row */
  38.251 +  int blkn, ci, xindex, yindex, yoffset;
  38.252 +  JDIMENSION start_col;
  38.253 +  JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN];
  38.254 +  JBLOCKROW buffer_ptr;
  38.255 +  jpeg_component_info *compptr;
  38.256 +
  38.257 +  /* Align the virtual buffers for the components used in this scan. */
  38.258 +  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
  38.259 +    compptr = cinfo->cur_comp_info[ci];
  38.260 +    buffer[ci] = (*cinfo->mem->access_virt_barray)
  38.261 +      ((j_common_ptr) cinfo, coef->whole_image[compptr->component_index],
  38.262 +       cinfo->input_iMCU_row * compptr->v_samp_factor,
  38.263 +       (JDIMENSION) compptr->v_samp_factor, TRUE);
  38.264 +    /* Note: entropy decoder expects buffer to be zeroed,
  38.265 +     * but this is handled automatically by the memory manager
  38.266 +     * because we requested a pre-zeroed array.
  38.267 +     */
  38.268 +  }
  38.269 +
  38.270 +  /* Loop to process one whole iMCU row */
  38.271 +  for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
  38.272 +       yoffset++) {
  38.273 +    for (MCU_col_num = coef->MCU_ctr; MCU_col_num < cinfo->MCUs_per_row;
  38.274 +	 MCU_col_num++) {
  38.275 +      /* Construct list of pointers to DCT blocks belonging to this MCU */
  38.276 +      blkn = 0;			/* index of current DCT block within MCU */
  38.277 +      for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
  38.278 +	compptr = cinfo->cur_comp_info[ci];
  38.279 +	start_col = MCU_col_num * compptr->MCU_width;
  38.280 +	for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
  38.281 +	  buffer_ptr = buffer[ci][yindex+yoffset] + start_col;
  38.282 +	  for (xindex = 0; xindex < compptr->MCU_width; xindex++) {
  38.283 +	    coef->MCU_buffer[blkn++] = buffer_ptr++;
  38.284 +	  }
  38.285 +	}
  38.286 +      }
  38.287 +      /* Try to fetch the MCU. */
  38.288 +      if (! (*cinfo->entropy->decode_mcu) (cinfo, coef->MCU_buffer)) {
  38.289 +	/* Suspension forced; update state counters and exit */
  38.290 +	coef->MCU_vert_offset = yoffset;
  38.291 +	coef->MCU_ctr = MCU_col_num;
  38.292 +	return JPEG_SUSPENDED;
  38.293 +      }
  38.294 +    }
  38.295 +    /* Completed an MCU row, but perhaps not an iMCU row */
  38.296 +    coef->MCU_ctr = 0;
  38.297 +  }
  38.298 +  /* Completed the iMCU row, advance counters for next one */
  38.299 +  if (++(cinfo->input_iMCU_row) < cinfo->total_iMCU_rows) {
  38.300 +    start_iMCU_row(cinfo);
  38.301 +    return JPEG_ROW_COMPLETED;
  38.302 +  }
  38.303 +  /* Completed the scan */
  38.304 +  (*cinfo->inputctl->finish_input_pass) (cinfo);
  38.305 +  return JPEG_SCAN_COMPLETED;
  38.306 +}
  38.307 +
  38.308 +
  38.309 +/*
  38.310 + * Decompress and return some data in the multi-pass case.
  38.311 + * Always attempts to emit one fully interleaved MCU row ("iMCU" row).
  38.312 + * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED.
  38.313 + *
  38.314 + * NB: output_buf contains a plane for each component in image.
  38.315 + */
  38.316 +
  38.317 +METHODDEF(int)
  38.318 +decompress_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
  38.319 +{
  38.320 +  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
  38.321 +  JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
  38.322 +  JDIMENSION block_num;
  38.323 +  int ci, block_row, block_rows;
  38.324 +  JBLOCKARRAY buffer;
  38.325 +  JBLOCKROW buffer_ptr;
  38.326 +  JSAMPARRAY output_ptr;
  38.327 +  JDIMENSION output_col;
  38.328 +  jpeg_component_info *compptr;
  38.329 +  inverse_DCT_method_ptr inverse_DCT;
  38.330 +
  38.331 +  /* Force some input to be done if we are getting ahead of the input. */
  38.332 +  while (cinfo->input_scan_number < cinfo->output_scan_number ||
  38.333 +	 (cinfo->input_scan_number == cinfo->output_scan_number &&
  38.334 +	  cinfo->input_iMCU_row <= cinfo->output_iMCU_row)) {
  38.335 +    if ((*cinfo->inputctl->consume_input)(cinfo) == JPEG_SUSPENDED)
  38.336 +      return JPEG_SUSPENDED;
  38.337 +  }
  38.338 +
  38.339 +  /* OK, output from the virtual arrays. */
  38.340 +  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  38.341 +       ci++, compptr++) {
  38.342 +    /* Don't bother to IDCT an uninteresting component. */
  38.343 +    if (! compptr->component_needed)
  38.344 +      continue;
  38.345 +    /* Align the virtual buffer for this component. */
  38.346 +    buffer = (*cinfo->mem->access_virt_barray)
  38.347 +      ((j_common_ptr) cinfo, coef->whole_image[ci],
  38.348 +       cinfo->output_iMCU_row * compptr->v_samp_factor,
  38.349 +       (JDIMENSION) compptr->v_samp_factor, FALSE);
  38.350 +    /* Count non-dummy DCT block rows in this iMCU row. */
  38.351 +    if (cinfo->output_iMCU_row < last_iMCU_row)
  38.352 +      block_rows = compptr->v_samp_factor;
  38.353 +    else {
  38.354 +      /* NB: can't use last_row_height here; it is input-side-dependent! */
  38.355 +      block_rows = (int) (compptr->height_in_blocks % compptr->v_samp_factor);
  38.356 +      if (block_rows == 0) block_rows = compptr->v_samp_factor;
  38.357 +    }
  38.358 +    inverse_DCT = cinfo->idct->inverse_DCT[ci];
  38.359 +    output_ptr = output_buf[ci];
  38.360 +    /* Loop over all DCT blocks to be processed. */
  38.361 +    for (block_row = 0; block_row < block_rows; block_row++) {
  38.362 +      buffer_ptr = buffer[block_row];
  38.363 +      output_col = 0;
  38.364 +      for (block_num = 0; block_num < compptr->width_in_blocks; block_num++) {
  38.365 +	(*inverse_DCT) (cinfo, compptr, (JCOEFPTR) buffer_ptr,
  38.366 +			output_ptr, output_col);
  38.367 +	buffer_ptr++;
  38.368 +	output_col += compptr->DCT_scaled_size;
  38.369 +      }
  38.370 +      output_ptr += compptr->DCT_scaled_size;
  38.371 +    }
  38.372 +  }
  38.373 +
  38.374 +  if (++(cinfo->output_iMCU_row) < cinfo->total_iMCU_rows)
  38.375 +    return JPEG_ROW_COMPLETED;
  38.376 +  return JPEG_SCAN_COMPLETED;
  38.377 +}
  38.378 +
  38.379 +#endif /* D_MULTISCAN_FILES_SUPPORTED */
  38.380 +
  38.381 +
  38.382 +#ifdef BLOCK_SMOOTHING_SUPPORTED
  38.383 +
  38.384 +/*
  38.385 + * This code applies interblock smoothing as described by section K.8
  38.386 + * of the JPEG standard: the first 5 AC coefficients are estimated from
  38.387 + * the DC values of a DCT block and its 8 neighboring blocks.
  38.388 + * We apply smoothing only for progressive JPEG decoding, and only if
  38.389 + * the coefficients it can estimate are not yet known to full precision.
  38.390 + */
  38.391 +
  38.392 +/* Natural-order array positions of the first 5 zigzag-order coefficients */
  38.393 +#define Q01_POS  1
  38.394 +#define Q10_POS  8
  38.395 +#define Q20_POS  16
  38.396 +#define Q11_POS  9
  38.397 +#define Q02_POS  2
  38.398 +
  38.399 +/*
  38.400 + * Determine whether block smoothing is applicable and safe.
  38.401 + * We also latch the current states of the coef_bits[] entries for the
  38.402 + * AC coefficients; otherwise, if the input side of the decompressor
  38.403 + * advances into a new scan, we might think the coefficients are known
  38.404 + * more accurately than they really are.
  38.405 + */
  38.406 +
  38.407 +LOCAL(boolean)
  38.408 +smoothing_ok (j_decompress_ptr cinfo)
  38.409 +{
  38.410 +  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
  38.411 +  boolean smoothing_useful = FALSE;
  38.412 +  int ci, coefi;
  38.413 +  jpeg_component_info *compptr;
  38.414 +  JQUANT_TBL * qtable;
  38.415 +  int * coef_bits;
  38.416 +  int * coef_bits_latch;
  38.417 +
  38.418 +  if (! cinfo->progressive_mode || cinfo->coef_bits == NULL)
  38.419 +    return FALSE;
  38.420 +
  38.421 +  /* Allocate latch area if not already done */
  38.422 +  if (coef->coef_bits_latch == NULL)
  38.423 +    coef->coef_bits_latch = (int *)
  38.424 +      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
  38.425 +				  cinfo->num_components *
  38.426 +				  (SAVED_COEFS * SIZEOF(int)));
  38.427 +  coef_bits_latch = coef->coef_bits_latch;
  38.428 +
  38.429 +  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  38.430 +       ci++, compptr++) {
  38.431 +    /* All components' quantization values must already be latched. */
  38.432 +    if ((qtable = compptr->quant_table) == NULL)
  38.433 +      return FALSE;
  38.434 +    /* Verify DC & first 5 AC quantizers are nonzero to avoid zero-divide. */
  38.435 +    if (qtable->quantval[0] == 0 ||
  38.436 +	qtable->quantval[Q01_POS] == 0 ||
  38.437 +	qtable->quantval[Q10_POS] == 0 ||
  38.438 +	qtable->quantval[Q20_POS] == 0 ||
  38.439 +	qtable->quantval[Q11_POS] == 0 ||
  38.440 +	qtable->quantval[Q02_POS] == 0)
  38.441 +      return FALSE;
  38.442 +    /* DC values must be at least partly known for all components. */
  38.443 +    coef_bits = cinfo->coef_bits[ci];
  38.444 +    if (coef_bits[0] < 0)
  38.445 +      return FALSE;
  38.446 +    /* Block smoothing is helpful if some AC coefficients remain inaccurate. */
  38.447 +    for (coefi = 1; coefi <= 5; coefi++) {
  38.448 +      coef_bits_latch[coefi] = coef_bits[coefi];
  38.449 +      if (coef_bits[coefi] != 0)
  38.450 +	smoothing_useful = TRUE;
  38.451 +    }
  38.452 +    coef_bits_latch += SAVED_COEFS;
  38.453 +  }
  38.454 +
  38.455 +  return smoothing_useful;
  38.456 +}
  38.457 +
  38.458 +
  38.459 +/*
  38.460 + * Variant of decompress_data for use when doing block smoothing.
  38.461 + */
  38.462 +
  38.463 +METHODDEF(int)
  38.464 +decompress_smooth_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
  38.465 +{
  38.466 +  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
  38.467 +  JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
  38.468 +  JDIMENSION block_num, last_block_column;
  38.469 +  int ci, block_row, block_rows, access_rows;
  38.470 +  JBLOCKARRAY buffer;
  38.471 +  JBLOCKROW buffer_ptr, prev_block_row, next_block_row;
  38.472 +  JSAMPARRAY output_ptr;
  38.473 +  JDIMENSION output_col;
  38.474 +  jpeg_component_info *compptr;
  38.475 +  inverse_DCT_method_ptr inverse_DCT;
  38.476 +  boolean first_row, last_row;
  38.477 +  JBLOCK workspace;
  38.478 +  int *coef_bits;
  38.479 +  JQUANT_TBL *quanttbl;
  38.480 +  INT32 Q00,Q01,Q02,Q10,Q11,Q20, num;
  38.481 +  int DC1,DC2,DC3,DC4,DC5,DC6,DC7,DC8,DC9;
  38.482 +  int Al, pred;
  38.483 +
  38.484 +  /* Force some input to be done if we are getting ahead of the input. */
  38.485 +  while (cinfo->input_scan_number <= cinfo->output_scan_number &&
  38.486 +	 ! cinfo->inputctl->eoi_reached) {
  38.487 +    if (cinfo->input_scan_number == cinfo->output_scan_number) {
  38.488 +      /* If input is working on current scan, we ordinarily want it to
  38.489 +       * have completed the current row.  But if input scan is DC,
  38.490 +       * we want it to keep one row ahead so that next block row's DC
  38.491 +       * values are up to date.
  38.492 +       */
  38.493 +      JDIMENSION delta = (cinfo->Ss == 0) ? 1 : 0;
  38.494 +      if (cinfo->input_iMCU_row > cinfo->output_iMCU_row+delta)
  38.495 +	break;
  38.496 +    }
  38.497 +    if ((*cinfo->inputctl->consume_input)(cinfo) == JPEG_SUSPENDED)
  38.498 +      return JPEG_SUSPENDED;
  38.499 +  }
  38.500 +
  38.501 +  /* OK, output from the virtual arrays. */
  38.502 +  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  38.503 +       ci++, compptr++) {
  38.504 +    /* Don't bother to IDCT an uninteresting component. */
  38.505 +    if (! compptr->component_needed)
  38.506 +      continue;
  38.507 +    /* Count non-dummy DCT block rows in this iMCU row. */
  38.508 +    if (cinfo->output_iMCU_row < last_iMCU_row) {
  38.509 +      block_rows = compptr->v_samp_factor;
  38.510 +      access_rows = block_rows * 2; /* this and next iMCU row */
  38.511 +      last_row = FALSE;
  38.512 +    } else {
  38.513 +      /* NB: can't use last_row_height here; it is input-side-dependent! */
  38.514 +      block_rows = (int) (compptr->height_in_blocks % compptr->v_samp_factor);
  38.515 +      if (block_rows == 0) block_rows = compptr->v_samp_factor;
  38.516 +      access_rows = block_rows; /* this iMCU row only */
  38.517 +      last_row = TRUE;
  38.518 +    }
  38.519 +    /* Align the virtual buffer for this component. */
  38.520 +    if (cinfo->output_iMCU_row > 0) {
  38.521 +      access_rows += compptr->v_samp_factor; /* prior iMCU row too */
  38.522 +      buffer = (*cinfo->mem->access_virt_barray)
  38.523 +	((j_common_ptr) cinfo, coef->whole_image[ci],
  38.524 +	 (cinfo->output_iMCU_row - 1) * compptr->v_samp_factor,
  38.525 +	 (JDIMENSION) access_rows, FALSE);
  38.526 +      buffer += compptr->v_samp_factor;	/* point to current iMCU row */
  38.527 +      first_row = FALSE;
  38.528 +    } else {
  38.529 +      buffer = (*cinfo->mem->access_virt_barray)
  38.530 +	((j_common_ptr) cinfo, coef->whole_image[ci],
  38.531 +	 (JDIMENSION) 0, (JDIMENSION) access_rows, FALSE);
  38.532 +      first_row = TRUE;
  38.533 +    }
  38.534 +    /* Fetch component-dependent info */
  38.535 +    coef_bits = coef->coef_bits_latch + (ci * SAVED_COEFS);
  38.536 +    quanttbl = compptr->quant_table;
  38.537 +    Q00 = quanttbl->quantval[0];
  38.538 +    Q01 = quanttbl->quantval[Q01_POS];
  38.539 +    Q10 = quanttbl->quantval[Q10_POS];
  38.540 +    Q20 = quanttbl->quantval[Q20_POS];
  38.541 +    Q11 = quanttbl->quantval[Q11_POS];
  38.542 +    Q02 = quanttbl->quantval[Q02_POS];
  38.543 +    inverse_DCT = cinfo->idct->inverse_DCT[ci];
  38.544 +    output_ptr = output_buf[ci];
  38.545 +    /* Loop over all DCT blocks to be processed. */
  38.546 +    for (block_row = 0; block_row < block_rows; block_row++) {
  38.547 +      buffer_ptr = buffer[block_row];
  38.548 +      if (first_row && block_row == 0)
  38.549 +	prev_block_row = buffer_ptr;
  38.550 +      else
  38.551 +	prev_block_row = buffer[block_row-1];
  38.552 +      if (last_row && block_row == block_rows-1)
  38.553 +	next_block_row = buffer_ptr;
  38.554 +      else
  38.555 +	next_block_row = buffer[block_row+1];
  38.556 +      /* We fetch the surrounding DC values using a sliding-register approach.
  38.557 +       * Initialize all nine here so as to do the right thing on narrow pics.
  38.558 +       */
  38.559 +      DC1 = DC2 = DC3 = (int) prev_block_row[0][0];
  38.560 +      DC4 = DC5 = DC6 = (int) buffer_ptr[0][0];
  38.561 +      DC7 = DC8 = DC9 = (int) next_block_row[0][0];
  38.562 +      output_col = 0;
  38.563 +      last_block_column = compptr->width_in_blocks - 1;
  38.564 +      for (block_num = 0; block_num <= last_block_column; block_num++) {
  38.565 +	/* Fetch current DCT block into workspace so we can modify it. */
  38.566 +	jcopy_block_row(buffer_ptr, (JBLOCKROW) workspace, (JDIMENSION) 1);
  38.567 +	/* Update DC values */
  38.568 +	if (block_num < last_block_column) {
  38.569 +	  DC3 = (int) prev_block_row[1][0];
  38.570 +	  DC6 = (int) buffer_ptr[1][0];
  38.571 +	  DC9 = (int) next_block_row[1][0];
  38.572 +	}
  38.573 +	/* Compute coefficient estimates per K.8.
  38.574 +	 * An estimate is applied only if coefficient is still zero,
  38.575 +	 * and is not known to be fully accurate.
  38.576 +	 */
  38.577 +	/* AC01 */
  38.578 +	if ((Al=coef_bits[1]) != 0 && workspace[1] == 0) {
  38.579 +	  num = 36 * Q00 * (DC4 - DC6);
  38.580 +	  if (num >= 0) {
  38.581 +	    pred = (int) (((Q01<<7) + num) / (Q01<<8));
  38.582 +	    if (Al > 0 && pred >= (1<<Al))
  38.583 +	      pred = (1<<Al)-1;
  38.584 +	  } else {
  38.585 +	    pred = (int) (((Q01<<7) - num) / (Q01<<8));
  38.586 +	    if (Al > 0 && pred >= (1<<Al))
  38.587 +	      pred = (1<<Al)-1;
  38.588 +	    pred = -pred;
  38.589 +	  }
  38.590 +	  workspace[1] = (JCOEF) pred;
  38.591 +	}
  38.592 +	/* AC10 */
  38.593 +	if ((Al=coef_bits[2]) != 0 && workspace[8] == 0) {
  38.594 +	  num = 36 * Q00 * (DC2 - DC8);
  38.595 +	  if (num >= 0) {
  38.596 +	    pred = (int) (((Q10<<7) + num) / (Q10<<8));
  38.597 +	    if (Al > 0 && pred >= (1<<Al))
  38.598 +	      pred = (1<<Al)-1;
  38.599 +	  } else {
  38.600 +	    pred = (int) (((Q10<<7) - num) / (Q10<<8));
  38.601 +	    if (Al > 0 && pred >= (1<<Al))
  38.602 +	      pred = (1<<Al)-1;
  38.603 +	    pred = -pred;
  38.604 +	  }
  38.605 +	  workspace[8] = (JCOEF) pred;
  38.606 +	}
  38.607 +	/* AC20 */
  38.608 +	if ((Al=coef_bits[3]) != 0 && workspace[16] == 0) {
  38.609 +	  num = 9 * Q00 * (DC2 + DC8 - 2*DC5);
  38.610 +	  if (num >= 0) {
  38.611 +	    pred = (int) (((Q20<<7) + num) / (Q20<<8));
  38.612 +	    if (Al > 0 && pred >= (1<<Al))
  38.613 +	      pred = (1<<Al)-1;
  38.614 +	  } else {
  38.615 +	    pred = (int) (((Q20<<7) - num) / (Q20<<8));
  38.616 +	    if (Al > 0 && pred >= (1<<Al))
  38.617 +	      pred = (1<<Al)-1;
  38.618 +	    pred = -pred;
  38.619 +	  }
  38.620 +	  workspace[16] = (JCOEF) pred;
  38.621 +	}
  38.622 +	/* AC11 */
  38.623 +	if ((Al=coef_bits[4]) != 0 && workspace[9] == 0) {
  38.624 +	  num = 5 * Q00 * (DC1 - DC3 - DC7 + DC9);
  38.625 +	  if (num >= 0) {
  38.626 +	    pred = (int) (((Q11<<7) + num) / (Q11<<8));
  38.627 +	    if (Al > 0 && pred >= (1<<Al))
  38.628 +	      pred = (1<<Al)-1;
  38.629 +	  } else {
  38.630 +	    pred = (int) (((Q11<<7) - num) / (Q11<<8));
  38.631 +	    if (Al > 0 && pred >= (1<<Al))
  38.632 +	      pred = (1<<Al)-1;
  38.633 +	    pred = -pred;
  38.634 +	  }
  38.635 +	  workspace[9] = (JCOEF) pred;
  38.636 +	}
  38.637 +	/* AC02 */
  38.638 +	if ((Al=coef_bits[5]) != 0 && workspace[2] == 0) {
  38.639 +	  num = 9 * Q00 * (DC4 + DC6 - 2*DC5);
  38.640 +	  if (num >= 0) {
  38.641 +	    pred = (int) (((Q02<<7) + num) / (Q02<<8));
  38.642 +	    if (Al > 0 && pred >= (1<<Al))
  38.643 +	      pred = (1<<Al)-1;
  38.644 +	  } else {
  38.645 +	    pred = (int) (((Q02<<7) - num) / (Q02<<8));
  38.646 +	    if (Al > 0 && pred >= (1<<Al))
  38.647 +	      pred = (1<<Al)-1;
  38.648 +	    pred = -pred;
  38.649 +	  }
  38.650 +	  workspace[2] = (JCOEF) pred;
  38.651 +	}
  38.652 +	/* OK, do the IDCT */
  38.653 +	(*inverse_DCT) (cinfo, compptr, (JCOEFPTR) workspace,
  38.654 +			output_ptr, output_col);
  38.655 +	/* Advance for next column */
  38.656 +	DC1 = DC2; DC2 = DC3;
  38.657 +	DC4 = DC5; DC5 = DC6;
  38.658 +	DC7 = DC8; DC8 = DC9;
  38.659 +	buffer_ptr++, prev_block_row++, next_block_row++;
  38.660 +	output_col += compptr->DCT_scaled_size;
  38.661 +      }
  38.662 +      output_ptr += compptr->DCT_scaled_size;
  38.663 +    }
  38.664 +  }
  38.665 +
  38.666 +  if (++(cinfo->output_iMCU_row) < cinfo->total_iMCU_rows)
  38.667 +    return JPEG_ROW_COMPLETED;
  38.668 +  return JPEG_SCAN_COMPLETED;
  38.669 +}
  38.670 +
  38.671 +#endif /* BLOCK_SMOOTHING_SUPPORTED */
  38.672 +
  38.673 +
  38.674 +/*
  38.675 + * Initialize coefficient buffer controller.
  38.676 + */
  38.677 +
  38.678 +GLOBAL(void)
  38.679 +jinit_d_coef_controller (j_decompress_ptr cinfo, boolean need_full_buffer)
  38.680 +{
  38.681 +  my_coef_ptr coef;
  38.682 +
  38.683 +  coef = (my_coef_ptr)
  38.684 +    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
  38.685 +				SIZEOF(my_coef_controller));
  38.686 +  cinfo->coef = (struct jpeg_d_coef_controller *) coef;
  38.687 +  coef->pub.start_input_pass = start_input_pass;
  38.688 +  coef->pub.start_output_pass = start_output_pass;
  38.689 +#ifdef BLOCK_SMOOTHING_SUPPORTED
  38.690 +  coef->coef_bits_latch = NULL;
  38.691 +#endif
  38.692 +
  38.693 +  /* Create the coefficient buffer. */
  38.694 +  if (need_full_buffer) {
  38.695 +#ifdef D_MULTISCAN_FILES_SUPPORTED
  38.696 +    /* Allocate a full-image virtual array for each component, */
  38.697 +    /* padded to a multiple of samp_factor DCT blocks in each direction. */
  38.698 +    /* Note we ask for a pre-zeroed array. */
  38.699 +    int ci, access_rows;
  38.700 +    jpeg_component_info *compptr;
  38.701 +
  38.702 +    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  38.703 +	 ci++, compptr++) {
  38.704 +      access_rows = compptr->v_samp_factor;
  38.705 +#ifdef BLOCK_SMOOTHING_SUPPORTED
  38.706 +      /* If block smoothing could be used, need a bigger window */
  38.707 +      if (cinfo->progressive_mode)
  38.708 +	access_rows *= 3;
  38.709 +#endif
  38.710 +      coef->whole_image[ci] = (*cinfo->mem->request_virt_barray)
  38.711 +	((j_common_ptr) cinfo, JPOOL_IMAGE, TRUE,
  38.712 +	 (JDIMENSION) jround_up((long) compptr->width_in_blocks,
  38.713 +				(long) compptr->h_samp_factor),
  38.714 +	 (JDIMENSION) jround_up((long) compptr->height_in_blocks,
  38.715 +				(long) compptr->v_samp_factor),
  38.716 +	 (JDIMENSION) access_rows);
  38.717 +    }
  38.718 +    coef->pub.consume_data = consume_data;
  38.719 +    coef->pub.decompress_data = decompress_data;
  38.720 +    coef->pub.coef_arrays = coef->whole_image; /* link to virtual arrays */
  38.721 +#else
  38.722 +    ERREXIT(cinfo, JERR_NOT_COMPILED);
  38.723 +#endif
  38.724 +  } else {
  38.725 +    /* We only need a single-MCU buffer. */
  38.726 +    JBLOCKROW buffer;
  38.727 +    int i;
  38.728 +
  38.729 +    buffer = (JBLOCKROW)
  38.730 +      (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,
  38.731 +				  D_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK));
  38.732 +    for (i = 0; i < D_MAX_BLOCKS_IN_MCU; i++) {
  38.733 +      coef->MCU_buffer[i] = buffer + i;
  38.734 +    }
  38.735 +    coef->pub.consume_data = dummy_consume_data;
  38.736 +    coef->pub.decompress_data = decompress_onepass;
  38.737 +    coef->pub.coef_arrays = NULL; /* flag for no virtual arrays */
  38.738 +  }
  38.739 +}
    39.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    39.2 +++ b/libs/libjpeg/jdcolor.c	Sun Nov 01 00:36:56 2015 +0200
    39.3 @@ -0,0 +1,396 @@
    39.4 +/*
    39.5 + * jdcolor.c
    39.6 + *
    39.7 + * Copyright (C) 1991-1997, Thomas G. Lane.
    39.8 + * This file is part of the Independent JPEG Group's software.
    39.9 + * For conditions of distribution and use, see the accompanying README file.
   39.10 + *
   39.11 + * This file contains output colorspace conversion routines.
   39.12 + */
   39.13 +
   39.14 +#define JPEG_INTERNALS
   39.15 +#include "jinclude.h"
   39.16 +#include "jpeglib.h"
   39.17 +
   39.18 +
   39.19 +/* Private subobject */
   39.20 +
   39.21 +typedef struct {
   39.22 +  struct jpeg_color_deconverter pub; /* public fields */
   39.23 +
   39.24 +  /* Private state for YCC->RGB conversion */
   39.25 +  int * Cr_r_tab;		/* => table for Cr to R conversion */
   39.26 +  int * Cb_b_tab;		/* => table for Cb to B conversion */
   39.27 +  INT32 * Cr_g_tab;		/* => table for Cr to G conversion */
   39.28 +  INT32 * Cb_g_tab;		/* => table for Cb to G conversion */
   39.29 +} my_color_deconverter;
   39.30 +
   39.31 +typedef my_color_deconverter * my_cconvert_ptr;
   39.32 +
   39.33 +
   39.34 +/**************** YCbCr -> RGB conversion: most common case **************/
   39.35 +
   39.36 +/*
   39.37 + * YCbCr is defined per CCIR 601-1, except that Cb and Cr are
   39.38 + * normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5.
   39.39 + * The conversion equations to be implemented are therefore
   39.40 + *	R = Y                + 1.40200 * Cr
   39.41 + *	G = Y - 0.34414 * Cb - 0.71414 * Cr
   39.42 + *	B = Y + 1.77200 * Cb
   39.43 + * where Cb and Cr represent the incoming values less CENTERJSAMPLE.
   39.44 + * (These numbers are derived from TIFF 6.0 section 21, dated 3-June-92.)
   39.45 + *
   39.46 + * To avoid floating-point arithmetic, we represent the fractional constants
   39.47 + * as integers scaled up by 2^16 (about 4 digits precision); we have to divide
   39.48 + * the products by 2^16, with appropriate rounding, to get the correct answer.
   39.49 + * Notice that Y, being an integral input, does not contribute any fraction
   39.50 + * so it need not participate in the rounding.
   39.51 + *
   39.52 + * For even more speed, we avoid doing any multiplications in the inner loop
   39.53 + * by precalculating the constants times Cb and Cr for all possible values.
   39.54 + * For 8-bit JSAMPLEs this is very reasonable (only 256 entries per table);
   39.55 + * for 12-bit samples it is still acceptable.  It's not very reasonable for
   39.56 + * 16-bit samples, but if you want lossless storage you shouldn't be changing
   39.57 + * colorspace anyway.
   39.58 + * The Cr=>R and Cb=>B values can be rounded to integers in advance; the
   39.59 + * values for the G calculation are left scaled up, since we must add them
   39.60 + * together before rounding.
   39.61 + */
   39.62 +
   39.63 +#define SCALEBITS	16	/* speediest right-shift on some machines */
   39.64 +#define ONE_HALF	((INT32) 1 << (SCALEBITS-1))
   39.65 +#define FIX(x)		((INT32) ((x) * (1L<<SCALEBITS) + 0.5))
   39.66 +
   39.67 +
   39.68 +/*
   39.69 + * Initialize tables for YCC->RGB colorspace conversion.
   39.70 + */
   39.71 +
   39.72 +LOCAL(void)
   39.73 +build_ycc_rgb_table (j_decompress_ptr cinfo)
   39.74 +{
   39.75 +  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
   39.76 +  int i;
   39.77 +  INT32 x;
   39.78 +  SHIFT_TEMPS
   39.79 +
   39.80 +  cconvert->Cr_r_tab = (int *)
   39.81 +    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
   39.82 +				(MAXJSAMPLE+1) * SIZEOF(int));
   39.83 +  cconvert->Cb_b_tab = (int *)
   39.84 +    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
   39.85 +				(MAXJSAMPLE+1) * SIZEOF(int));
   39.86 +  cconvert->Cr_g_tab = (INT32 *)
   39.87 +    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
   39.88 +				(MAXJSAMPLE+1) * SIZEOF(INT32));
   39.89 +  cconvert->Cb_g_tab = (INT32 *)
   39.90 +    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
   39.91 +				(MAXJSAMPLE+1) * SIZEOF(INT32));
   39.92 +
   39.93 +  for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {
   39.94 +    /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */
   39.95 +    /* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */
   39.96 +    /* Cr=>R value is nearest int to 1.40200 * x */
   39.97 +    cconvert->Cr_r_tab[i] = (int)
   39.98 +		    RIGHT_SHIFT(FIX(1.40200) * x + ONE_HALF, SCALEBITS);
   39.99 +    /* Cb=>B value is nearest int to 1.77200 * x */
  39.100 +    cconvert->Cb_b_tab[i] = (int)
  39.101 +		    RIGHT_SHIFT(FIX(1.77200) * x + ONE_HALF, SCALEBITS);
  39.102 +    /* Cr=>G value is scaled-up -0.71414 * x */
  39.103 +    cconvert->Cr_g_tab[i] = (- FIX(0.71414)) * x;
  39.104 +    /* Cb=>G value is scaled-up -0.34414 * x */
  39.105 +    /* We also add in ONE_HALF so that need not do it in inner loop */
  39.106 +    cconvert->Cb_g_tab[i] = (- FIX(0.34414)) * x + ONE_HALF;
  39.107 +  }
  39.108 +}
  39.109 +
  39.110 +
  39.111 +/*
  39.112 + * Convert some rows of samples to the output colorspace.
  39.113 + *
  39.114 + * Note that we change from noninterleaved, one-plane-per-component format
  39.115 + * to interleaved-pixel format.  The output buffer is therefore three times
  39.116 + * as wide as the input buffer.
  39.117 + * A starting row offset is provided only for the input buffer.  The caller
  39.118 + * can easily adjust the passed output_buf value to accommodate any row
  39.119 + * offset required on that side.
  39.120 + */
  39.121 +
  39.122 +METHODDEF(void)
  39.123 +ycc_rgb_convert (j_decompress_ptr cinfo,
  39.124 +		 JSAMPIMAGE input_buf, JDIMENSION input_row,
  39.125 +		 JSAMPARRAY output_buf, int num_rows)
  39.126 +{
  39.127 +  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
  39.128 +  register int y, cb, cr;
  39.129 +  register JSAMPROW outptr;
  39.130 +  register JSAMPROW inptr0, inptr1, inptr2;
  39.131 +  register JDIMENSION col;
  39.132 +  JDIMENSION num_cols = cinfo->output_width;
  39.133 +  /* copy these pointers into registers if possible */
  39.134 +  register JSAMPLE * range_limit = cinfo->sample_range_limit;
  39.135 +  register int * Crrtab = cconvert->Cr_r_tab;
  39.136 +  register int * Cbbtab = cconvert->Cb_b_tab;
  39.137 +  register INT32 * Crgtab = cconvert->Cr_g_tab;
  39.138 +  register INT32 * Cbgtab = cconvert->Cb_g_tab;
  39.139 +  SHIFT_TEMPS
  39.140 +
  39.141 +  while (--num_rows >= 0) {
  39.142 +    inptr0 = input_buf[0][input_row];
  39.143 +    inptr1 = input_buf[1][input_row];
  39.144 +    inptr2 = input_buf[2][input_row];
  39.145 +    input_row++;
  39.146 +    outptr = *output_buf++;
  39.147 +    for (col = 0; col < num_cols; col++) {
  39.148 +      y  = GETJSAMPLE(inptr0[col]);
  39.149 +      cb = GETJSAMPLE(inptr1[col]);
  39.150 +      cr = GETJSAMPLE(inptr2[col]);
  39.151 +      /* Range-limiting is essential due to noise introduced by DCT losses. */
  39.152 +      outptr[RGB_RED] =   range_limit[y + Crrtab[cr]];
  39.153 +      outptr[RGB_GREEN] = range_limit[y +
  39.154 +			      ((int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
  39.155 +						 SCALEBITS))];
  39.156 +      outptr[RGB_BLUE] =  range_limit[y + Cbbtab[cb]];
  39.157 +      outptr += RGB_PIXELSIZE;
  39.158 +    }
  39.159 +  }
  39.160 +}
  39.161 +
  39.162 +
  39.163 +/**************** Cases other than YCbCr -> RGB **************/
  39.164 +
  39.165 +
  39.166 +/*
  39.167 + * Color conversion for no colorspace change: just copy the data,
  39.168 + * converting from separate-planes to interleaved representation.
  39.169 + */
  39.170 +
  39.171 +METHODDEF(void)
  39.172 +null_convert (j_decompress_ptr cinfo,
  39.173 +	      JSAMPIMAGE input_buf, JDIMENSION input_row,
  39.174 +	      JSAMPARRAY output_buf, int num_rows)
  39.175 +{
  39.176 +  register JSAMPROW inptr, outptr;
  39.177 +  register JDIMENSION count;
  39.178 +  register int num_components = cinfo->num_components;
  39.179 +  JDIMENSION num_cols = cinfo->output_width;
  39.180 +  int ci;
  39.181 +
  39.182 +  while (--num_rows >= 0) {
  39.183 +    for (ci = 0; ci < num_components; ci++) {
  39.184 +      inptr = input_buf[ci][input_row];
  39.185 +      outptr = output_buf[0] + ci;
  39.186 +      for (count = num_cols; count > 0; count--) {
  39.187 +	*outptr = *inptr++;	/* needn't bother with GETJSAMPLE() here */
  39.188 +	outptr += num_components;
  39.189 +      }
  39.190 +    }
  39.191 +    input_row++;
  39.192 +    output_buf++;
  39.193 +  }
  39.194 +}
  39.195 +
  39.196 +
  39.197 +/*
  39.198 + * Color conversion for grayscale: just copy the data.
  39.199 + * This also works for YCbCr -> grayscale conversion, in which
  39.200 + * we just copy the Y (luminance) component and ignore chrominance.
  39.201 + */
  39.202 +
  39.203 +METHODDEF(void)
  39.204 +grayscale_convert (j_decompress_ptr cinfo,
  39.205 +		   JSAMPIMAGE input_buf, JDIMENSION input_row,
  39.206 +		   JSAMPARRAY output_buf, int num_rows)
  39.207 +{
  39.208 +  jcopy_sample_rows(input_buf[0], (int) input_row, output_buf, 0,
  39.209 +		    num_rows, cinfo->output_width);
  39.210 +}
  39.211 +
  39.212 +
  39.213 +/*
  39.214 + * Convert grayscale to RGB: just duplicate the graylevel three times.
  39.215 + * This is provided to support applications that don't want to cope
  39.216 + * with grayscale as a separate case.
  39.217 + */
  39.218 +
  39.219 +METHODDEF(void)
  39.220 +gray_rgb_convert (j_decompress_ptr cinfo,
  39.221 +		  JSAMPIMAGE input_buf, JDIMENSION input_row,
  39.222 +		  JSAMPARRAY output_buf, int num_rows)
  39.223 +{
  39.224 +  register JSAMPROW inptr, outptr;
  39.225 +  register JDIMENSION col;
  39.226 +  JDIMENSION num_cols = cinfo->output_width;
  39.227 +
  39.228 +  while (--num_rows >= 0) {
  39.229 +    inptr = input_buf[0][input_row++];
  39.230 +    outptr = *output_buf++;
  39.231 +    for (col = 0; col < num_cols; col++) {
  39.232 +      /* We can dispense with GETJSAMPLE() here */
  39.233 +      outptr[RGB_RED] = outptr[RGB_GREEN] = outptr[RGB_BLUE] = inptr[col];
  39.234 +      outptr += RGB_PIXELSIZE;
  39.235 +    }
  39.236 +  }
  39.237 +}
  39.238 +
  39.239 +
  39.240 +/*
  39.241 + * Adobe-style YCCK->CMYK conversion.
  39.242 + * We convert YCbCr to R=1-C, G=1-M, and B=1-Y using the same
  39.243 + * conversion as above, while passing K (black) unchanged.
  39.244 + * We assume build_ycc_rgb_table has been called.
  39.245 + */
  39.246 +
  39.247 +METHODDEF(void)
  39.248 +ycck_cmyk_convert (j_decompress_ptr cinfo,
  39.249 +		   JSAMPIMAGE input_buf, JDIMENSION input_row,
  39.250 +		   JSAMPARRAY output_buf, int num_rows)
  39.251 +{
  39.252 +  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
  39.253 +  register int y, cb, cr;
  39.254 +  register JSAMPROW outptr;
  39.255 +  register JSAMPROW inptr0, inptr1, inptr2, inptr3;
  39.256 +  register JDIMENSION col;
  39.257 +  JDIMENSION num_cols = cinfo->output_width;
  39.258 +  /* copy these pointers into registers if possible */
  39.259 +  register JSAMPLE * range_limit = cinfo->sample_range_limit;
  39.260 +  register int * Crrtab = cconvert->Cr_r_tab;
  39.261 +  register int * Cbbtab = cconvert->Cb_b_tab;
  39.262 +  register INT32 * Crgtab = cconvert->Cr_g_tab;
  39.263 +  register INT32 * Cbgtab = cconvert->Cb_g_tab;
  39.264 +  SHIFT_TEMPS
  39.265 +
  39.266 +  while (--num_rows >= 0) {
  39.267 +    inptr0 = input_buf[0][input_row];
  39.268 +    inptr1 = input_buf[1][input_row];
  39.269 +    inptr2 = input_buf[2][input_row];
  39.270 +    inptr3 = input_buf[3][input_row];
  39.271 +    input_row++;
  39.272 +    outptr = *output_buf++;
  39.273 +    for (col = 0; col < num_cols; col++) {
  39.274 +      y  = GETJSAMPLE(inptr0[col]);
  39.275 +      cb = GETJSAMPLE(inptr1[col]);
  39.276 +      cr = GETJSAMPLE(inptr2[col]);
  39.277 +      /* Range-limiting is essential due to noise introduced by DCT losses. */
  39.278 +      outptr[0] = range_limit[MAXJSAMPLE - (y + Crrtab[cr])];	/* red */
  39.279 +      outptr[1] = range_limit[MAXJSAMPLE - (y +			/* green */
  39.280 +			      ((int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
  39.281 +						 SCALEBITS)))];
  39.282 +      outptr[2] = range_limit[MAXJSAMPLE - (y + Cbbtab[cb])];	/* blue */
  39.283 +      /* K passes through unchanged */
  39.284 +      outptr[3] = inptr3[col];	/* don't need GETJSAMPLE here */
  39.285 +      outptr += 4;
  39.286 +    }
  39.287 +  }
  39.288 +}
  39.289 +
  39.290 +
  39.291 +/*
  39.292 + * Empty method for start_pass.
  39.293 + */
  39.294 +
  39.295 +METHODDEF(void)
  39.296 +start_pass_dcolor (j_decompress_ptr cinfo)
  39.297 +{
  39.298 +  /* no work needed */
  39.299 +}
  39.300 +
  39.301 +
  39.302 +/*
  39.303 + * Module initialization routine for output colorspace conversion.
  39.304 + */
  39.305 +
  39.306 +GLOBAL(void)
  39.307 +jinit_color_deconverter (j_decompress_ptr cinfo)
  39.308 +{
  39.309 +  my_cconvert_ptr cconvert;
  39.310 +  int ci;
  39.311 +
  39.312 +  cconvert = (my_cconvert_ptr)
  39.313 +    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
  39.314 +				SIZEOF(my_color_deconverter));
  39.315 +  cinfo->cconvert = (struct jpeg_color_deconverter *) cconvert;
  39.316 +  cconvert->pub.start_pass = start_pass_dcolor;
  39.317 +
  39.318 +  /* Make sure num_components agrees with jpeg_color_space */
  39.319 +  switch (cinfo->jpeg_color_space) {
  39.320 +  case JCS_GRAYSCALE:
  39.321 +    if (cinfo->num_components != 1)
  39.322 +      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
  39.323 +    break;
  39.324 +
  39.325 +  case JCS_RGB:
  39.326 +  case JCS_YCbCr:
  39.327 +    if (cinfo->num_components != 3)
  39.328 +      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
  39.329 +    break;
  39.330 +
  39.331 +  case JCS_CMYK:
  39.332 +  case JCS_YCCK:
  39.333 +    if (cinfo->num_components != 4)
  39.334 +      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
  39.335 +    break;
  39.336 +
  39.337 +  default:			/* JCS_UNKNOWN can be anything */
  39.338 +    if (cinfo->num_components < 1)
  39.339 +      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
  39.340 +    break;
  39.341 +  }
  39.342 +
  39.343 +  /* Set out_color_components and conversion method based on requested space.
  39.344 +   * Also clear the component_needed flags for any unused components,
  39.345 +   * so that earlier pipeline stages can avoid useless computation.
  39.346 +   */
  39.347 +
  39.348 +  switch (cinfo->out_color_space) {
  39.349 +  case JCS_GRAYSCALE:
  39.350 +    cinfo->out_color_components = 1;
  39.351 +    if (cinfo->jpeg_color_space == JCS_GRAYSCALE ||
  39.352 +	cinfo->jpeg_color_space == JCS_YCbCr) {
  39.353 +      cconvert->pub.color_convert = grayscale_convert;
  39.354 +      /* For color->grayscale conversion, only the Y (0) component is needed */
  39.355 +      for (ci = 1; ci < cinfo->num_components; ci++)
  39.356 +	cinfo->comp_info[ci].component_needed = FALSE;
  39.357 +    } else
  39.358 +      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
  39.359 +    break;
  39.360 +
  39.361 +  case JCS_RGB:
  39.362 +    cinfo->out_color_components = RGB_PIXELSIZE;
  39.363 +    if (cinfo->jpeg_color_space == JCS_YCbCr) {
  39.364 +      cconvert->pub.color_convert = ycc_rgb_convert;
  39.365 +      build_ycc_rgb_table(cinfo);
  39.366 +    } else if (cinfo->jpeg_color_space == JCS_GRAYSCALE) {
  39.367 +      cconvert->pub.color_convert = gray_rgb_convert;
  39.368 +    } else if (cinfo->jpeg_color_space == JCS_RGB && RGB_PIXELSIZE == 3) {
  39.369 +      cconvert->pub.color_convert = null_convert;
  39.370 +    } else
  39.371 +      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
  39.372 +    break;
  39.373 +
  39.374 +  case JCS_CMYK:
  39.375 +    cinfo->out_color_components = 4;
  39.376 +    if (cinfo->jpeg_color_space == JCS_YCCK) {
  39.377 +      cconvert->pub.color_convert = ycck_cmyk_convert;
  39.378 +      build_ycc_rgb_table(cinfo);
  39.379 +    } else if (cinfo->jpeg_color_space == JCS_CMYK) {
  39.380 +      cconvert->pub.color_convert = null_convert;
  39.381 +    } else
  39.382 +      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
  39.383 +    break;
  39.384 +
  39.385 +  default:
  39.386 +    /* Permit null conversion to same output space */
  39.387 +    if (cinfo->out_color_space == cinfo->jpeg_color_space) {
  39.388 +      cinfo->out_color_components = cinfo->num_components;
  39.389 +      cconvert->pub.color_convert = null_convert;
  39.390 +    } else			/* unsupported non-null conversion */
  39.391 +      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
  39.392 +    break;
  39.393 +  }
  39.394 +
  39.395 +  if (cinfo->quantize_colors)
  39.396 +    cinfo->output_components = 1; /* single colormapped output component */
  39.397 +  else
  39.398 +    cinfo->output_components = cinfo->out_color_components;
  39.399 +}
    40.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    40.2 +++ b/libs/libjpeg/jdct.h	Sun Nov 01 00:36:56 2015 +0200
    40.3 @@ -0,0 +1,176 @@
    40.4 +/*
    40.5 + * jdct.h
    40.6 + *
    40.7 + * Copyright (C) 1994-1996, Thomas G. Lane.
    40.8 + * This file is part of the Independent JPEG Group's software.
    40.9 + * For conditions of distribution and use, see the accompanying README file.
   40.10 + *
   40.11 + * This include file contains common declarations for the forward and
   40.12 + * inverse DCT modules.  These declarations are private to the DCT managers
   40.13 + * (jcdctmgr.c, jddctmgr.c) and the individual DCT algorithms.
   40.14 + * The individual DCT algorithms are kept in separate files to ease 
   40.15 + * machine-dependent tuning (e.g., assembly coding).
   40.16 + */
   40.17 +
   40.18 +
   40.19 +/*
   40.20 + * A forward DCT routine is given a pointer to a work area of type DCTELEM[];
   40.21 + * the DCT is to be performed in-place in that buffer.  Type DCTELEM is int
   40.22 + * for 8-bit samples, INT32 for 12-bit samples.  (NOTE: Floating-point DCT
   40.23 + * implementations use an array of type FAST_FLOAT, instead.)
   40.24 + * The DCT inputs are expected to be signed (range +-CENTERJSAMPLE).
   40.25 + * The DCT outputs are returned scaled up by a factor of 8; they therefore
   40.26 + * have a range of +-8K for 8-bit data, +-128K for 12-bit data.  This
   40.27 + * convention improves accuracy in integer implementations and saves some
   40.28 + * work in floating-point ones.
   40.29 + * Quantization of the output coefficients is done by jcdctmgr.c.
   40.30 + */
   40.31 +
   40.32 +#if BITS_IN_JSAMPLE == 8
   40.33 +typedef int DCTELEM;		/* 16 or 32 bits is fine */
   40.34 +#else
   40.35 +typedef INT32 DCTELEM;		/* must have 32 bits */
   40.36 +#endif
   40.37 +
   40.38 +typedef JMETHOD(void, forward_DCT_method_ptr, (DCTELEM * data));
   40.39 +typedef JMETHOD(void, float_DCT_method_ptr, (FAST_FLOAT * data));
   40.40 +
   40.41 +
   40.42 +/*
   40.43 + * An inverse DCT routine is given a pointer to the input JBLOCK and a pointer
   40.44 + * to an output sample array.  The routine must dequantize the input data as
   40.45 + * well as perform the IDCT; for dequantization, it uses the multiplier table
   40.46 + * pointed to by compptr->dct_table.  The output data is to be placed into the
   40.47 + * sample array starting at a specified column.  (Any row offset needed will
   40.48 + * be applied to the array pointer before it is passed to the IDCT code.)
   40.49 + * Note that the number of samples emitted by the IDCT routine is
   40.50 + * DCT_scaled_size * DCT_scaled_size.
   40.51 + */
   40.52 +
   40.53 +/* typedef inverse_DCT_method_ptr is declared in jpegint.h */
   40.54 +
   40.55 +/*
   40.56 + * Each IDCT routine has its own ideas about the best dct_table element type.
   40.57 + */
   40.58 +
   40.59 +typedef MULTIPLIER ISLOW_MULT_TYPE; /* short or int, whichever is faster */
   40.60 +#if BITS_IN_JSAMPLE == 8
   40.61 +typedef MULTIPLIER IFAST_MULT_TYPE; /* 16 bits is OK, use short if faster */
   40.62 +#define IFAST_SCALE_BITS  2	/* fractional bits in scale factors */
   40.63 +#else
   40.64 +typedef INT32 IFAST_MULT_TYPE;	/* need 32 bits for scaled quantizers */
   40.65 +#define IFAST_SCALE_BITS  13	/* fractional bits in scale factors */
   40.66 +#endif
   40.67 +typedef FAST_FLOAT FLOAT_MULT_TYPE; /* preferred floating type */
   40.68 +
   40.69 +
   40.70 +/*
   40.71 + * Each IDCT routine is responsible for range-limiting its results and
   40.72 + * converting them to unsigned form (0..MAXJSAMPLE).  The raw outputs could
   40.73 + * be quite far out of range if the input data is corrupt, so a bulletproof
   40.74 + * range-limiting step is required.  We use a mask-and-table-lookup method
   40.75 + * to do the combined operations quickly.  See the comments with
   40.76 + * prepare_range_limit_table (in jdmaster.c) for more info.
   40.77 + */
   40.78 +
   40.79 +#define IDCT_range_limit(cinfo)  ((cinfo)->sample_range_limit + CENTERJSAMPLE)
   40.80 +
   40.81 +#define RANGE_MASK  (MAXJSAMPLE * 4 + 3) /* 2 bits wider than legal samples */
   40.82 +
   40.83 +
   40.84 +/* Short forms of external names for systems with brain-damaged linkers. */
   40.85 +
   40.86 +#ifdef NEED_SHORT_EXTERNAL_NAMES
   40.87 +#define jpeg_fdct_islow		jFDislow
   40.88 +#define jpeg_fdct_ifast		jFDifast
   40.89 +#define jpeg_fdct_float		jFDfloat
   40.90 +#define jpeg_idct_islow		jRDislow
   40.91 +#define jpeg_idct_ifast		jRDifast
   40.92 +#define jpeg_idct_float		jRDfloat
   40.93 +#define jpeg_idct_4x4		jRD4x4
   40.94 +#define jpeg_idct_2x2		jRD2x2
   40.95 +#define jpeg_idct_1x1		jRD1x1
   40.96 +#endif /* NEED_SHORT_EXTERNAL_NAMES */
   40.97 +
   40.98 +/* Extern declarations for the forward and inverse DCT routines. */
   40.99 +
  40.100 +EXTERN(void) jpeg_fdct_islow JPP((DCTELEM * data));
  40.101 +EXTERN(void) jpeg_fdct_ifast JPP((DCTELEM * data));
  40.102 +EXTERN(void) jpeg_fdct_float JPP((FAST_FLOAT * data));
  40.103 +
  40.104 +EXTERN(void) jpeg_idct_islow
  40.105 +    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
  40.106 +	 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
  40.107 +EXTERN(void) jpeg_idct_ifast
  40.108 +    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
  40.109 +	 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
  40.110 +EXTERN(void) jpeg_idct_float
  40.111 +    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
  40.112 +	 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
  40.113 +EXTERN(void) jpeg_idct_4x4
  40.114 +    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
  40.115 +	 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
  40.116 +EXTERN(void) jpeg_idct_2x2
  40.117 +    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
  40.118 +	 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
  40.119 +EXTERN(void) jpeg_idct_1x1
  40.120 +    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
  40.121 +	 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
  40.122 +
  40.123 +
  40.124 +/*
  40.125 + * Macros for handling fixed-point arithmetic; these are used by many
  40.126 + * but not all of the DCT/IDCT modules.
  40.127 + *
  40.128 + * All values are expected to be of type INT32.
  40.129 + * Fractional constants are scaled left by CONST_BITS bits.
  40.130 + * CONST_BITS is defined within each module using these macros,
  40.131 + * and may differ from one module to the next.
  40.132 + */
  40.133 +
  40.134 +#define ONE	((INT32) 1)
  40.135 +#define CONST_SCALE (ONE << CONST_BITS)
  40.136 +
  40.137 +/* Convert a positive real constant to an integer scaled by CONST_SCALE.
  40.138 + * Caution: some C compilers fail to reduce "FIX(constant)" at compile time,
  40.139 + * thus causing a lot of useless floating-point operations at run time.
  40.140 + */
  40.141 +
  40.142 +#define FIX(x)	((INT32) ((x) * CONST_SCALE + 0.5))
  40.143 +
  40.144 +/* Descale and correctly round an INT32 value that's scaled by N bits.
  40.145 + * We assume RIGHT_SHIFT rounds towards minus infinity, so adding
  40.146 + * the fudge factor is correct for either sign of X.
  40.147 + */
  40.148 +
  40.149 +#define DESCALE(x,n)  RIGHT_SHIFT((x) + (ONE << ((n)-1)), n)
  40.150 +
  40.151 +/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result.
  40.152 + * This macro is used only when the two inputs will actually be no more than
  40.153 + * 16 bits wide, so that a 16x16->32 bit multiply can be used instead of a
  40.154 + * full 32x32 multiply.  This provides a useful speedup on many machines.
  40.155 + * Unfortunately there is no way to specify a 16x16->32 multiply portably
  40.156 + * in C, but some C compilers will do the right thing if you provide the
  40.157 + * correct combination of casts.
  40.158 + */
  40.159 +
  40.160 +#ifdef SHORTxSHORT_32		/* may work if 'int' is 32 bits */
  40.161 +#define MULTIPLY16C16(var,const)  (((INT16) (var)) * ((INT16) (const)))
  40.162 +#endif
  40.163 +#ifdef SHORTxLCONST_32		/* known to work with Microsoft C 6.0 */
  40.164 +#define MULTIPLY16C16(var,const)  (((INT16) (var)) * ((INT32) (const)))
  40.165 +#endif
  40.166 +
  40.167 +#ifndef MULTIPLY16C16		/* default definition */
  40.168 +#define MULTIPLY16C16(var,const)  ((var) * (const))
  40.169 +#endif
  40.170 +
  40.171 +/* Same except both inputs are variables. */
  40.172 +
  40.173 +#ifdef SHORTxSHORT_32		/* may work if 'int' is 32 bits */
  40.174 +#define MULTIPLY16V16(var1,var2)  (((INT16) (var1)) * ((INT16) (var2)))
  40.175 +#endif
  40.176 +
  40.177 +#ifndef MULTIPLY16V16		/* default definition */
  40.178 +#define MULTIPLY16V16(var1,var2)  ((var1) * (var2))
  40.179 +#endif
    41.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    41.2 +++ b/libs/libjpeg/jddctmgr.c	Sun Nov 01 00:36:56 2015 +0200
    41.3 @@ -0,0 +1,269 @@
    41.4 +/*
    41.5 + * jddctmgr.c
    41.6 + *
    41.7 + * Copyright (C) 1994-1996, Thomas G. Lane.
    41.8 + * This file is part of the Independent JPEG Group's software.
    41.9 + * For conditions of distribution and use, see the accompanying README file.
   41.10 + *
   41.11 + * This file contains the inverse-DCT management logic.
   41.12 + * This code selects a particular IDCT implementation to be used,
   41.13 + * and it performs related housekeeping chores.  No code in this file
   41.14 + * is executed per IDCT step, only during output pass setup.
   41.15 + *
   41.16 + * Note that the IDCT routines are responsible for performing coefficient
   41.17 + * dequantization as well as the IDCT proper.  This module sets up the
   41.18 + * dequantization multiplier table needed by the IDCT routine.
   41.19 + */
   41.20 +
   41.21 +#define JPEG_INTERNALS
   41.22 +#include "jinclude.h"
   41.23 +#include "jpeglib.h"
   41.24 +#include "jdct.h"		/* Private declarations for DCT subsystem */
   41.25 +
   41.26 +
   41.27 +/*
   41.28 + * The decompressor input side (jdinput.c) saves away the appropriate
   41.29 + * quantization table for each component at the start of the first scan
   41.30 + * involving that component.  (This is necessary in order to correctly
   41.31 + * decode files that reuse Q-table slots.)
   41.32 + * When we are ready to make an output pass, the saved Q-table is converted
   41.33 + * to a multiplier table that will actually be used by the IDCT routine.
   41.34 + * The multiplier table contents are IDCT-method-dependent.  To support
   41.35 + * application changes in IDCT method between scans, we can remake the
   41.36 + * multiplier tables if necessary.
   41.37 + * In buffered-image mode, the first output pass may occur before any data
   41.38 + * has been seen for some components, and thus before their Q-tables have
   41.39 + * been saved away.  To handle this case, multiplier tables are preset
   41.40 + * to zeroes; the result of the IDCT will be a neutral gray level.
   41.41 + */
   41.42 +
   41.43 +
   41.44 +/* Private subobject for this module */
   41.45 +
   41.46 +typedef struct {
   41.47 +  struct jpeg_inverse_dct pub;	/* public fields */
   41.48 +
   41.49 +  /* This array contains the IDCT method code that each multiplier table
   41.50 +   * is currently set up for, or -1 if it's not yet set up.
   41.51 +   * The actual multiplier tables are pointed to by dct_table in the
   41.52 +   * per-component comp_info structures.
   41.53 +   */
   41.54 +  int cur_method[MAX_COMPONENTS];
   41.55 +} my_idct_controller;
   41.56 +
   41.57 +typedef my_idct_controller * my_idct_ptr;
   41.58 +
   41.59 +
   41.60 +/* Allocated multiplier tables: big enough for any supported variant */
   41.61 +
   41.62 +typedef union {
   41.63 +  ISLOW_MULT_TYPE islow_array[DCTSIZE2];
   41.64 +#ifdef DCT_IFAST_SUPPORTED
   41.65 +  IFAST_MULT_TYPE ifast_array[DCTSIZE2];
   41.66 +#endif
   41.67 +#ifdef DCT_FLOAT_SUPPORTED
   41.68 +  FLOAT_MULT_TYPE float_array[DCTSIZE2];
   41.69 +#endif
   41.70 +} multiplier_table;
   41.71 +
   41.72 +
   41.73 +/* The current scaled-IDCT routines require ISLOW-style multiplier tables,
   41.74 + * so be sure to compile that code if either ISLOW or SCALING is requested.
   41.75 + */
   41.76 +#ifdef DCT_ISLOW_SUPPORTED
   41.77 +#define PROVIDE_ISLOW_TABLES
   41.78 +#else
   41.79 +#ifdef IDCT_SCALING_SUPPORTED
   41.80 +#define PROVIDE_ISLOW_TABLES
   41.81 +#endif
   41.82 +#endif
   41.83 +
   41.84 +
   41.85 +/*
   41.86 + * Prepare for an output pass.
   41.87 + * Here we select the proper IDCT routine for each component and build
   41.88 + * a matching multiplier table.
   41.89 + */
   41.90 +
   41.91 +METHODDEF(void)
   41.92 +start_pass (j_decompress_ptr cinfo)
   41.93 +{
   41.94 +  my_idct_ptr idct = (my_idct_ptr) cinfo->idct;
   41.95 +  int ci, i;
   41.96 +  jpeg_component_info *compptr;
   41.97 +  int method = 0;
   41.98 +  inverse_DCT_method_ptr method_ptr = NULL;
   41.99 +  JQUANT_TBL * qtbl;
  41.100 +
  41.101 +  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  41.102 +       ci++, compptr++) {
  41.103 +    /* Select the proper IDCT routine for this component's scaling */
  41.104 +    switch (compptr->DCT_scaled_size) {
  41.105 +#ifdef IDCT_SCALING_SUPPORTED
  41.106 +    case 1:
  41.107 +      method_ptr = jpeg_idct_1x1;
  41.108 +      method = JDCT_ISLOW;	/* jidctred uses islow-style table */
  41.109 +      break;
  41.110 +    case 2:
  41.111 +      method_ptr = jpeg_idct_2x2;
  41.112 +      method = JDCT_ISLOW;	/* jidctred uses islow-style table */
  41.113 +      break;
  41.114 +    case 4:
  41.115 +      method_ptr = jpeg_idct_4x4;
  41.116 +      method = JDCT_ISLOW;	/* jidctred uses islow-style table */
  41.117 +      break;
  41.118 +#endif
  41.119 +    case DCTSIZE:
  41.120 +      switch (cinfo->dct_method) {
  41.121 +#ifdef DCT_ISLOW_SUPPORTED
  41.122 +      case JDCT_ISLOW:
  41.123 +	method_ptr = jpeg_idct_islow;
  41.124 +	method = JDCT_ISLOW;
  41.125 +	break;
  41.126 +#endif
  41.127 +#ifdef DCT_IFAST_SUPPORTED
  41.128 +      case JDCT_IFAST:
  41.129 +	method_ptr = jpeg_idct_ifast;
  41.130 +	method = JDCT_IFAST;
  41.131 +	break;
  41.132 +#endif
  41.133 +#ifdef DCT_FLOAT_SUPPORTED
  41.134 +      case JDCT_FLOAT:
  41.135 +	method_ptr = jpeg_idct_float;
  41.136 +	method = JDCT_FLOAT;
  41.137 +	break;
  41.138 +#endif
  41.139 +      default:
  41.140 +	ERREXIT(cinfo, JERR_NOT_COMPILED);
  41.141 +	break;
  41.142 +      }
  41.143 +      break;
  41.144 +    default:
  41.145 +      ERREXIT1(cinfo, JERR_BAD_DCTSIZE, compptr->DCT_scaled_size);
  41.146 +      break;
  41.147 +    }
  41.148 +    idct->pub.inverse_DCT[ci] = method_ptr;
  41.149 +    /* Create multiplier table from quant table.
  41.150 +     * However, we can skip this if the component is uninteresting
  41.151 +     * or if we already built the table.  Also, if no quant table
  41.152 +     * has yet been saved for the component, we leave the
  41.153 +     * multiplier table all-zero; we'll be reading zeroes from the
  41.154 +     * coefficient controller's buffer anyway.
  41.155 +     */
  41.156 +    if (! compptr->component_needed || idct->cur_method[ci] == method)
  41.157 +      continue;
  41.158 +    qtbl = compptr->quant_table;
  41.159 +    if (qtbl == NULL)		/* happens if no data yet for component */
  41.160 +      continue;
  41.161 +    idct->cur_method[ci] = method;
  41.162 +    switch (method) {
  41.163 +#ifdef PROVIDE_ISLOW_TABLES
  41.164 +    case JDCT_ISLOW:
  41.165 +      {
  41.166 +	/* For LL&M IDCT method, multipliers are equal to raw quantization
  41.167 +	 * coefficients, but are stored as ints to ensure access efficiency.
  41.168 +	 */
  41.169 +	ISLOW_MULT_TYPE * ismtbl = (ISLOW_MULT_TYPE *) compptr->dct_table;
  41.170 +	for (i = 0; i < DCTSIZE2; i++) {
  41.171 +	  ismtbl[i] = (ISLOW_MULT_TYPE) qtbl->quantval[i];
  41.172 +	}
  41.173 +      }
  41.174 +      break;
  41.175 +#endif
  41.176 +#ifdef DCT_IFAST_SUPPORTED
  41.177 +    case JDCT_IFAST:
  41.178 +      {
  41.179 +	/* For AA&N IDCT method, multipliers are equal to quantization
  41.180 +	 * coefficients scaled by scalefactor[row]*scalefactor[col], where
  41.181 +	 *   scalefactor[0] = 1
  41.182 +	 *   scalefactor[k] = cos(k*PI/16) * sqrt(2)    for k=1..7
  41.183 +	 * For integer operation, the multiplier table is to be scaled by
  41.184 +	 * IFAST_SCALE_BITS.
  41.185 +	 */
  41.186 +	IFAST_MULT_TYPE * ifmtbl = (IFAST_MULT_TYPE *) compptr->dct_table;
  41.187 +#define CONST_BITS 14
  41.188 +	static const INT16 aanscales[DCTSIZE2] = {
  41.189 +	  /* precomputed values scaled up by 14 bits */
  41.190 +	  16384, 22725, 21407, 19266, 16384, 12873,  8867,  4520,
  41.191 +	  22725, 31521, 29692, 26722, 22725, 17855, 12299,  6270,
  41.192 +	  21407, 29692, 27969, 25172, 21407, 16819, 11585,  5906,
  41.193 +	  19266, 26722, 25172, 22654, 19266, 15137, 10426,  5315,
  41.194 +	  16384, 22725, 21407, 19266, 16384, 12873,  8867,  4520,
  41.195 +	  12873, 17855, 16819, 15137, 12873, 10114,  6967,  3552,
  41.196 +	   8867, 12299, 11585, 10426,  8867,  6967,  4799,  2446,
  41.197 +	   4520,  6270,  5906,  5315,  4520,  3552,  2446,  1247
  41.198 +	};
  41.199 +	SHIFT_TEMPS
  41.200 +
  41.201 +	for (i = 0; i < DCTSIZE2; i++) {
  41.202 +	  ifmtbl[i] = (IFAST_MULT_TYPE)
  41.203 +	    DESCALE(MULTIPLY16V16((INT32) qtbl->quantval[i],
  41.204 +				  (INT32) aanscales[i]),
  41.205 +		    CONST_BITS-IFAST_SCALE_BITS);
  41.206 +	}
  41.207 +      }
  41.208 +      break;
  41.209 +#endif
  41.210 +#ifdef DCT_FLOAT_SUPPORTED
  41.211 +    case JDCT_FLOAT:
  41.212 +      {
  41.213 +	/* For float AA&N IDCT method, multipliers are equal to quantization
  41.214 +	 * coefficients scaled by scalefactor[row]*scalefactor[col], where
  41.215 +	 *   scalefactor[0] = 1
  41.216 +	 *   scalefactor[k] = cos(k*PI/16) * sqrt(2)    for k=1..7
  41.217 +	 */
  41.218 +	FLOAT_MULT_TYPE * fmtbl = (FLOAT_MULT_TYPE *) compptr->dct_table;
  41.219 +	int row, col;
  41.220 +	static const double aanscalefactor[DCTSIZE] = {
  41.221 +	  1.0, 1.387039845, 1.306562965, 1.175875602,
  41.222 +	  1.0, 0.785694958, 0.541196100, 0.275899379
  41.223 +	};
  41.224 +
  41.225 +	i = 0;
  41.226 +	for (row = 0; row < DCTSIZE; row++) {
  41.227 +	  for (col = 0; col < DCTSIZE; col++) {
  41.228 +	    fmtbl[i] = (FLOAT_MULT_TYPE)
  41.229 +	      ((double) qtbl->quantval[i] *
  41.230 +	       aanscalefactor[row] * aanscalefactor[col]);
  41.231 +	    i++;
  41.232 +	  }
  41.233 +	}
  41.234 +      }
  41.235 +      break;
  41.236 +#endif
  41.237 +    default:
  41.238 +      ERREXIT(cinfo, JERR_NOT_COMPILED);
  41.239 +      break;
  41.240 +    }
  41.241 +  }
  41.242 +}
  41.243 +
  41.244 +
  41.245 +/*
  41.246 + * Initialize IDCT manager.
  41.247 + */
  41.248 +
  41.249 +GLOBAL(void)
  41.250 +jinit_inverse_dct (j_decompress_ptr cinfo)
  41.251 +{
  41.252 +  my_idct_ptr idct;
  41.253 +  int ci;
  41.254 +  jpeg_component_info *compptr;
  41.255 +
  41.256 +  idct = (my_idct_ptr)
  41.257 +    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
  41.258 +				SIZEOF(my_idct_controller));
  41.259 +  cinfo->idct = (struct jpeg_inverse_dct *) idct;
  41.260 +  idct->pub.start_pass = start_pass;
  41.261 +
  41.262 +  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  41.263 +       ci++, compptr++) {
  41.264 +    /* Allocate and pre-zero a multiplier table for each component */
  41.265 +    compptr->dct_table =
  41.266 +      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
  41.267 +				  SIZEOF(multiplier_table));
  41.268 +    MEMZERO(compptr->dct_table, SIZEOF(multiplier_table));
  41.269 +    /* Mark multiplier table not yet set up for any method */
  41.270 +    idct->cur_method[ci] = -1;
  41.271 +  }
  41.272 +}
    42.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    42.2 +++ b/libs/libjpeg/jdhuff.c	Sun Nov 01 00:36:56 2015 +0200
    42.3 @@ -0,0 +1,651 @@
    42.4 +/*
    42.5 + * jdhuff.c
    42.6 + *
    42.7 + * Copyright (C) 1991-1997, Thomas G. Lane.
    42.8 + * This file is part of the Independent JPEG Group's software.
    42.9 + * For conditions of distribution and use, see the accompanying README file.
   42.10 + *
   42.11 + * This file contains Huffman entropy decoding routines.
   42.12 + *
   42.13 + * Much of the complexity here has to do with supporting input suspension.
   42.14 + * If the data source module demands suspension, we want to be able to back
   42.15 + * up to the start of the current MCU.  To do this, we copy state variables
   42.16 + * into local working storage, and update them back to the permanent
   42.17 + * storage only upon successful completion of an MCU.
   42.18 + */
   42.19 +
   42.20 +#define JPEG_INTERNALS
   42.21 +#include "jinclude.h"
   42.22 +#include "jpeglib.h"
   42.23 +#include "jdhuff.h"		/* Declarations shared with jdphuff.c */
   42.24 +
   42.25 +
   42.26 +/*
   42.27 + * Expanded entropy decoder object for Huffman decoding.
   42.28 + *
   42.29 + * The savable_state subrecord contains fields that change within an MCU,
   42.30 + * but must not be updated permanently until we complete the MCU.
   42.31 + */
   42.32 +
   42.33 +typedef struct {
   42.34 +  int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */
   42.35 +} savable_state;
   42.36 +
   42.37 +/* This macro is to work around compilers with missing or broken
   42.38 + * structure assignment.  You'll need to fix this code if you have
   42.39 + * such a compiler and you change MAX_COMPS_IN_SCAN.
   42.40 + */
   42.41 +
   42.42 +#ifndef NO_STRUCT_ASSIGN
   42.43 +#define ASSIGN_STATE(dest,src)  ((dest) = (src))
   42.44 +#else
   42.45 +#if MAX_COMPS_IN_SCAN == 4
   42.46 +#define ASSIGN_STATE(dest,src)  \
   42.47 +	((dest).last_dc_val[0] = (src).last_dc_val[0], \
   42.48 +	 (dest).last_dc_val[1] = (src).last_dc_val[1], \
   42.49 +	 (dest).last_dc_val[2] = (src).last_dc_val[2], \
   42.50 +	 (dest).last_dc_val[3] = (src).last_dc_val[3])
   42.51 +#endif
   42.52 +#endif
   42.53 +
   42.54 +
   42.55 +typedef struct {
   42.56 +  struct jpeg_entropy_decoder pub; /* public fields */
   42.57 +
   42.58 +  /* These fields are loaded into local variables at start of each MCU.
   42.59 +   * In case of suspension, we exit WITHOUT updating them.
   42.60 +   */
   42.61 +  bitread_perm_state bitstate;	/* Bit buffer at start of MCU */
   42.62 +  savable_state saved;		/* Other state at start of MCU */
   42.63 +
   42.64 +  /* These fields are NOT loaded into local working state. */
   42.65 +  unsigned int restarts_to_go;	/* MCUs left in this restart interval */
   42.66 +
   42.67 +  /* Pointers to derived tables (these workspaces have image lifespan) */
   42.68 +  d_derived_tbl * dc_derived_tbls[NUM_HUFF_TBLS];
   42.69 +  d_derived_tbl * ac_derived_tbls[NUM_HUFF_TBLS];
   42.70 +
   42.71 +  /* Precalculated info set up by start_pass for use in decode_mcu: */
   42.72 +
   42.73 +  /* Pointers to derived tables to be used for each block within an MCU */
   42.74 +  d_derived_tbl * dc_cur_tbls[D_MAX_BLOCKS_IN_MCU];
   42.75 +  d_derived_tbl * ac_cur_tbls[D_MAX_BLOCKS_IN_MCU];
   42.76 +  /* Whether we care about the DC and AC coefficient values for each block */
   42.77 +  boolean dc_needed[D_MAX_BLOCKS_IN_MCU];
   42.78 +  boolean ac_needed[D_MAX_BLOCKS_IN_MCU];
   42.79 +} huff_entropy_decoder;
   42.80 +
   42.81 +typedef huff_entropy_decoder * huff_entropy_ptr;
   42.82 +
   42.83 +
   42.84 +/*
   42.85 + * Initialize for a Huffman-compressed scan.
   42.86 + */
   42.87 +
   42.88 +METHODDEF(void)
   42.89 +start_pass_huff_decoder (j_decompress_ptr cinfo)
   42.90 +{
   42.91 +  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
   42.92 +  int ci, blkn, dctbl, actbl;
   42.93 +  jpeg_component_info * compptr;
   42.94 +
   42.95 +  /* Check that the scan parameters Ss, Se, Ah/Al are OK for sequential JPEG.
   42.96 +   * This ought to be an error condition, but we make it a warning because
   42.97 +   * there are some baseline files out there with all zeroes in these bytes.
   42.98 +   */
   42.99 +  if (cinfo->Ss != 0 || cinfo->Se != DCTSIZE2-1 ||
  42.100 +      cinfo->Ah != 0 || cinfo->Al != 0)
  42.101 +    WARNMS(cinfo, JWRN_NOT_SEQUENTIAL);
  42.102 +
  42.103 +  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
  42.104 +    compptr = cinfo->cur_comp_info[ci];
  42.105 +    dctbl = compptr->dc_tbl_no;
  42.106 +    actbl = compptr->ac_tbl_no;
  42.107 +    /* Compute derived values for Huffman tables */
  42.108 +    /* We may do this more than once for a table, but it's not expensive */
  42.109 +    jpeg_make_d_derived_tbl(cinfo, TRUE, dctbl,
  42.110 +			    & entropy->dc_derived_tbls[dctbl]);
  42.111 +    jpeg_make_d_derived_tbl(cinfo, FALSE, actbl,
  42.112 +			    & entropy->ac_derived_tbls[actbl]);
  42.113 +    /* Initialize DC predictions to 0 */
  42.114 +    entropy->saved.last_dc_val[ci] = 0;
  42.115 +  }
  42.116 +
  42.117 +  /* Precalculate decoding info for each block in an MCU of this scan */
  42.118 +  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
  42.119 +    ci = cinfo->MCU_membership[blkn];
  42.120 +    compptr = cinfo->cur_comp_info[ci];
  42.121 +    /* Precalculate which table to use for each block */
  42.122 +    entropy->dc_cur_tbls[blkn] = entropy->dc_derived_tbls[compptr->dc_tbl_no];
  42.123 +    entropy->ac_cur_tbls[blkn] = entropy->ac_derived_tbls[compptr->ac_tbl_no];
  42.124 +    /* Decide whether we really care about the coefficient values */
  42.125 +    if (compptr->component_needed) {
  42.126 +      entropy->dc_needed[blkn] = TRUE;
  42.127 +      /* we don't need the ACs if producing a 1/8th-size image */
  42.128 +      entropy->ac_needed[blkn] = (compptr->DCT_scaled_size > 1);
  42.129 +    } else {
  42.130 +      entropy->dc_needed[blkn] = entropy->ac_needed[blkn] = FALSE;
  42.131 +    }
  42.132 +  }
  42.133 +
  42.134 +  /* Initialize bitread state variables */
  42.135 +  entropy->bitstate.bits_left = 0;
  42.136 +  entropy->bitstate.get_buffer = 0; /* unnecessary, but keeps Purify quiet */
  42.137 +  entropy->pub.insufficient_data = FALSE;
  42.138 +
  42.139 +  /* Initialize restart counter */
  42.140 +  entropy->restarts_to_go = cinfo->restart_interval;
  42.141 +}
  42.142 +
  42.143 +
  42.144 +/*
  42.145 + * Compute the derived values for a Huffman table.
  42.146 + * This routine also performs some validation checks on the table.
  42.147 + *
  42.148 + * Note this is also used by jdphuff.c.
  42.149 + */
  42.150 +
  42.151 +GLOBAL(void)
  42.152 +jpeg_make_d_derived_tbl (j_decompress_ptr cinfo, boolean isDC, int tblno,
  42.153 +			 d_derived_tbl ** pdtbl)
  42.154 +{
  42.155 +  JHUFF_TBL *htbl;
  42.156 +  d_derived_tbl *dtbl;
  42.157 +  int p, i, l, si, numsymbols;
  42.158 +  int lookbits, ctr;
  42.159 +  char huffsize[257];
  42.160 +  unsigned int huffcode[257];
  42.161 +  unsigned int code;
  42.162 +
  42.163 +  /* Note that huffsize[] and huffcode[] are filled in code-length order,
  42.164 +   * paralleling the order of the symbols themselves in htbl->huffval[].
  42.165 +   */
  42.166 +
  42.167 +  /* Find the input Huffman table */
  42.168 +  if (tblno < 0 || tblno >= NUM_HUFF_TBLS)
  42.169 +    ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);
  42.170 +  htbl =
  42.171 +    isDC ? cinfo->dc_huff_tbl_ptrs[tblno] : cinfo->ac_huff_tbl_ptrs[tblno];
  42.172 +  if (htbl == NULL)
  42.173 +    ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);
  42.174 +
  42.175 +  /* Allocate a workspace if we haven't already done so. */
  42.176 +  if (*pdtbl == NULL)
  42.177 +    *pdtbl = (d_derived_tbl *)
  42.178 +      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
  42.179 +				  SIZEOF(d_derived_tbl));
  42.180 +  dtbl = *pdtbl;
  42.181 +  dtbl->pub = htbl;		/* fill in back link */
  42.182 +  
  42.183 +  /* Figure C.1: make table of Huffman code length for each symbol */
  42.184 +
  42.185 +  p = 0;
  42.186 +  for (l = 1; l <= 16; l++) {
  42.187 +    i = (int) htbl->bits[l];
  42.188 +    if (i < 0 || p + i > 256)	/* protect against table overrun */
  42.189 +      ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
  42.190 +    while (i--)
  42.191 +      huffsize[p++] = (char) l;
  42.192 +  }
  42.193 +  huffsize[p] = 0;
  42.194 +  numsymbols = p;
  42.195 +  
  42.196 +  /* Figure C.2: generate the codes themselves */
  42.197 +  /* We also validate that the counts represent a legal Huffman code tree. */
  42.198 +  
  42.199 +  code = 0;
  42.200 +  si = huffsize[0];
  42.201 +  p = 0;
  42.202 +  while (huffsize[p]) {
  42.203 +    while (((int) huffsize[p]) == si) {
  42.204 +      huffcode[p++] = code;
  42.205 +      code++;
  42.206 +    }
  42.207 +    /* code is now 1 more than the last code used for codelength si; but
  42.208 +     * it must still fit in si bits, since no code is allowed to be all ones.
  42.209 +     */
  42.210 +    if (((INT32) code) >= (((INT32) 1) << si))
  42.211 +      ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
  42.212 +    code <<= 1;
  42.213 +    si++;
  42.214 +  }
  42.215 +
  42.216 +  /* Figure F.15: generate decoding tables for bit-sequential decoding */
  42.217 +
  42.218 +  p = 0;
  42.219 +  for (l = 1; l <= 16; l++) {
  42.220 +    if (htbl->bits[l]) {
  42.221 +      /* valoffset[l] = huffval[] index of 1st symbol of code length l,
  42.222 +       * minus the minimum code of length l
  42.223 +       */
  42.224 +      dtbl->valoffset[l] = (INT32) p - (INT32) huffcode[p];
  42.225 +      p += htbl->bits[l];
  42.226 +      dtbl->maxcode[l] = huffcode[p-1]; /* maximum code of length l */
  42.227 +    } else {
  42.228 +      dtbl->maxcode[l] = -1;	/* -1 if no codes of this length */
  42.229 +    }
  42.230 +  }
  42.231 +  dtbl->maxcode[17] = 0xFFFFFL; /* ensures jpeg_huff_decode terminates */
  42.232 +
  42.233 +  /* Compute lookahead tables to speed up decoding.
  42.234 +   * First we set all the table entries to 0, indicating "too long";
  42.235 +   * then we iterate through the Huffman codes that are short enough and
  42.236 +   * fill in all the entries that correspond to bit sequences starting
  42.237 +   * with that code.
  42.238 +   */
  42.239 +
  42.240 +  MEMZERO(dtbl->look_nbits, SIZEOF(dtbl->look_nbits));
  42.241 +
  42.242 +  p = 0;
  42.243 +  for (l = 1; l <= HUFF_LOOKAHEAD; l++) {
  42.244 +    for (i = 1; i <= (int) htbl->bits[l]; i++, p++) {
  42.245 +      /* l = current code's length, p = its index in huffcode[] & huffval[]. */
  42.246 +      /* Generate left-justified code followed by all possible bit sequences */
  42.247 +      lookbits = huffcode[p] << (HUFF_LOOKAHEAD-l);
  42.248 +      for (ctr = 1 << (HUFF_LOOKAHEAD-l); ctr > 0; ctr--) {
  42.249 +	dtbl->look_nbits[lookbits] = l;
  42.250 +	dtbl->look_sym[lookbits] = htbl->huffval[p];
  42.251 +	lookbits++;
  42.252 +      }
  42.253 +    }
  42.254 +  }
  42.255 +
  42.256 +  /* Validate symbols as being reasonable.
  42.257 +   * For AC tables, we make no check, but accept all byte values 0..255.
  42.258 +   * For DC tables, we require the symbols to be in range 0..15.
  42.259 +   * (Tighter bounds could be applied depending on the data depth and mode,
  42.260 +   * but this is sufficient to ensure safe decoding.)
  42.261 +   */
  42.262 +  if (isDC) {
  42.263 +    for (i = 0; i < numsymbols; i++) {
  42.264 +      int sym = htbl->huffval[i];
  42.265 +      if (sym < 0 || sym > 15)
  42.266 +	ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
  42.267 +    }
  42.268 +  }
  42.269 +}
  42.270 +
  42.271 +
  42.272 +/*
  42.273 + * Out-of-line code for bit fetching (shared with jdphuff.c).
  42.274 + * See jdhuff.h for info about usage.
  42.275 + * Note: current values of get_buffer and bits_left are passed as parameters,
  42.276 + * but are returned in the corresponding fields of the state struct.
  42.277 + *
  42.278 + * On most machines MIN_GET_BITS should be 25 to allow the full 32-bit width
  42.279 + * of get_buffer to be used.  (On machines with wider words, an even larger
  42.280 + * buffer could be used.)  However, on some machines 32-bit shifts are
  42.281 + * quite slow and take time proportional to the number of places shifted.
  42.282 + * (This is true with most PC compilers, for instance.)  In this case it may
  42.283 + * be a win to set MIN_GET_BITS to the minimum value of 15.  This reduces the
  42.284 + * average shift distance at the cost of more calls to jpeg_fill_bit_buffer.
  42.285 + */
  42.286 +
  42.287 +#ifdef SLOW_SHIFT_32
  42.288 +#define MIN_GET_BITS  15	/* minimum allowable value */
  42.289 +#else
  42.290 +#define MIN_GET_BITS  (BIT_BUF_SIZE-7)
  42.291 +#endif
  42.292 +
  42.293 +
  42.294 +GLOBAL(boolean)
  42.295 +jpeg_fill_bit_buffer (bitread_working_state * state,
  42.296 +		      register bit_buf_type get_buffer, register int bits_left,
  42.297 +		      int nbits)
  42.298 +/* Load up the bit buffer to a depth of at least nbits */
  42.299 +{
  42.300 +  /* Copy heavily used state fields into locals (hopefully registers) */
  42.301 +  register const JOCTET * next_input_byte = state->next_input_byte;
  42.302 +  register size_t bytes_in_buffer = state->bytes_in_buffer;
  42.303 +  j_decompress_ptr cinfo = state->cinfo;
  42.304 +
  42.305 +  /* Attempt to load at least MIN_GET_BITS bits into get_buffer. */
  42.306 +  /* (It is assumed that no request will be for more than that many bits.) */
  42.307 +  /* We fail to do so only if we hit a marker or are forced to suspend. */
  42.308 +
  42.309 +  if (cinfo->unread_marker == 0) {	/* cannot advance past a marker */
  42.310 +    while (bits_left < MIN_GET_BITS) {
  42.311 +      register int c;
  42.312 +
  42.313 +      /* Attempt to read a byte */
  42.314 +      if (bytes_in_buffer == 0) {
  42.315 +	if (! (*cinfo->src->fill_input_buffer) (cinfo))
  42.316 +	  return FALSE;
  42.317 +	next_input_byte = cinfo->src->next_input_byte;
  42.318 +	bytes_in_buffer = cinfo->src->bytes_in_buffer;
  42.319 +      }
  42.320 +      bytes_in_buffer--;
  42.321 +      c = GETJOCTET(*next_input_byte++);
  42.322 +
  42.323 +      /* If it's 0xFF, check and discard stuffed zero byte */
  42.324 +      if (c == 0xFF) {
  42.325 +	/* Loop here to discard any padding FF's on terminating marker,
  42.326 +	 * so that we can save a valid unread_marker value.  NOTE: we will
  42.327 +	 * accept multiple FF's followed by a 0 as meaning a single FF data
  42.328 +	 * byte.  This data pattern is not valid according to the standard.
  42.329 +	 */
  42.330 +	do {
  42.331 +	  if (bytes_in_buffer == 0) {
  42.332 +	    if (! (*cinfo->src->fill_input_buffer) (cinfo))
  42.333 +	      return FALSE;
  42.334 +	    next_input_byte = cinfo->src->next_input_byte;
  42.335 +	    bytes_in_buffer = cinfo->src->bytes_in_buffer;
  42.336 +	  }
  42.337 +	  bytes_in_buffer--;
  42.338 +	  c = GETJOCTET(*next_input_byte++);
  42.339 +	} while (c == 0xFF);
  42.340 +
  42.341 +	if (c == 0) {
  42.342 +	  /* Found FF/00, which represents an FF data byte */
  42.343 +	  c = 0xFF;
  42.344 +	} else {
  42.345 +	  /* Oops, it's actually a marker indicating end of compressed data.
  42.346 +	   * Save the marker code for later use.
  42.347 +	   * Fine point: it might appear that we should save the marker into
  42.348 +	   * bitread working state, not straight into permanent state.  But
  42.349 +	   * once we have hit a marker, we cannot need to suspend within the
  42.350 +	   * current MCU, because we will read no more bytes from the data
  42.351 +	   * source.  So it is OK to update permanent state right away.
  42.352 +	   */
  42.353 +	  cinfo->unread_marker = c;
  42.354 +	  /* See if we need to insert some fake zero bits. */
  42.355 +	  goto no_more_bytes;
  42.356 +	}
  42.357 +      }
  42.358 +
  42.359 +      /* OK, load c into get_buffer */
  42.360 +      get_buffer = (get_buffer << 8) | c;
  42.361 +      bits_left += 8;
  42.362 +    } /* end while */
  42.363 +  } else {
  42.364 +  no_more_bytes:
  42.365 +    /* We get here if we've read the marker that terminates the compressed
  42.366 +     * data segment.  There should be enough bits in the buffer register
  42.367 +     * to satisfy the request; if so, no problem.
  42.368 +     */
  42.369 +    if (nbits > bits_left) {
  42.370 +      /* Uh-oh.  Report corrupted data to user and stuff zeroes into
  42.371 +       * the data stream, so that we can produce some kind of image.
  42.372 +       * We use a nonvolatile flag to ensure that only one warning message
  42.373 +       * appears per data segment.
  42.374 +       */
  42.375 +      if (! cinfo->entropy->insufficient_data) {
  42.376 +	WARNMS(cinfo, JWRN_HIT_MARKER);
  42.377 +	cinfo->entropy->insufficient_data = TRUE;
  42.378 +      }
  42.379 +      /* Fill the buffer with zero bits */
  42.380 +      get_buffer <<= MIN_GET_BITS - bits_left;
  42.381 +      bits_left = MIN_GET_BITS;
  42.382 +    }
  42.383 +  }
  42.384 +
  42.385 +  /* Unload the local registers */
  42.386 +  state->next_input_byte = next_input_byte;
  42.387 +  state->bytes_in_buffer = bytes_in_buffer;
  42.388 +  state->get_buffer = get_buffer;
  42.389 +  state->bits_left = bits_left;
  42.390 +
  42.391 +  return TRUE;
  42.392 +}
  42.393 +
  42.394 +
  42.395 +/*
  42.396 + * Out-of-line code for Huffman code decoding.
  42.397 + * See jdhuff.h for info about usage.
  42.398 + */
  42.399 +
  42.400 +GLOBAL(int)
  42.401 +jpeg_huff_decode (bitread_working_state * state,
  42.402 +		  register bit_buf_type get_buffer, register int bits_left,
  42.403 +		  d_derived_tbl * htbl, int min_bits)
  42.404 +{
  42.405 +  register int l = min_bits;
  42.406 +  register INT32 code;
  42.407 +
  42.408 +  /* HUFF_DECODE has determined that the code is at least min_bits */
  42.409 +  /* bits long, so fetch that many bits in one swoop. */
  42.410 +
  42.411 +  CHECK_BIT_BUFFER(*state, l, return -1);
  42.412 +  code = GET_BITS(l);
  42.413 +
  42.414 +  /* Collect the rest of the Huffman code one bit at a time. */
  42.415 +  /* This is per Figure F.16 in the JPEG spec. */
  42.416 +
  42.417 +  while (code > htbl->maxcode[l]) {
  42.418 +    code <<= 1;
  42.419 +    CHECK_BIT_BUFFER(*state, 1, return -1);
  42.420 +    code |= GET_BITS(1);
  42.421 +    l++;
  42.422 +  }
  42.423 +
  42.424 +  /* Unload the local registers */
  42.425 +  state->get_buffer = get_buffer;
  42.426 +  state->bits_left = bits_left;
  42.427 +
  42.428 +  /* With garbage input we may reach the sentinel value l = 17. */
  42.429 +
  42.430 +  if (l > 16) {
  42.431 +    WARNMS(state->cinfo, JWRN_HUFF_BAD_CODE);
  42.432 +    return 0;			/* fake a zero as the safest result */
  42.433 +  }
  42.434 +
  42.435 +  return htbl->pub->huffval[ (int) (code + htbl->valoffset[l]) ];
  42.436 +}
  42.437 +
  42.438 +
  42.439 +/*
  42.440 + * Figure F.12: extend sign bit.
  42.441 + * On some machines, a shift and add will be faster than a table lookup.
  42.442 + */
  42.443 +
  42.444 +#ifdef AVOID_TABLES
  42.445 +
  42.446 +#define HUFF_EXTEND(x,s)  ((x) < (1<<((s)-1)) ? (x) + (((-1)<<(s)) + 1) : (x))
  42.447 +
  42.448 +#else
  42.449 +
  42.450 +#define HUFF_EXTEND(x,s)  ((x) < extend_test[s] ? (x) + extend_offset[s] : (x))
  42.451 +
  42.452 +static const int extend_test[16] =   /* entry n is 2**(n-1) */
  42.453 +  { 0, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080,
  42.454 +    0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000 };
  42.455 +
  42.456 +static const int extend_offset[16] = /* entry n is (-1 << n) + 1 */
  42.457 +  { 0, ((-1)<<1) + 1, ((-1)<<2) + 1, ((-1)<<3) + 1, ((-1)<<4) + 1,
  42.458 +    ((-1)<<5) + 1, ((-1)<<6) + 1, ((-1)<<7) + 1, ((-1)<<8) + 1,
  42.459 +    ((-1)<<9) + 1, ((-1)<<10) + 1, ((-1)<<11) + 1, ((-1)<<12) + 1,
  42.460 +    ((-1)<<13) + 1, ((-1)<<14) + 1, ((-1)<<15) + 1 };
  42.461 +
  42.462 +#endif /* AVOID_TABLES */
  42.463 +
  42.464 +
  42.465 +/*
  42.466 + * Check for a restart marker & resynchronize decoder.
  42.467 + * Returns FALSE if must suspend.
  42.468 + */
  42.469 +
  42.470 +LOCAL(boolean)
  42.471 +process_restart (j_decompress_ptr cinfo)
  42.472 +{
  42.473 +  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
  42.474 +  int ci;
  42.475 +
  42.476 +  /* Throw away any unused bits remaining in bit buffer; */
  42.477 +  /* include any full bytes in next_marker's count of discarded bytes */
  42.478 +  cinfo->marker->discarded_bytes += entropy->bitstate.bits_left / 8;
  42.479 +  entropy->bitstate.bits_left = 0;
  42.480 +
  42.481 +  /* Advance past the RSTn marker */
  42.482 +  if (! (*cinfo->marker->read_restart_marker) (cinfo))
  42.483 +    return FALSE;
  42.484 +
  42.485 +  /* Re-initialize DC predictions to 0 */
  42.486 +  for (ci = 0; ci < cinfo->comps_in_scan; ci++)
  42.487 +    entropy->saved.last_dc_val[ci] = 0;
  42.488 +
  42.489 +  /* Reset restart counter */
  42.490 +  entropy->restarts_to_go = cinfo->restart_interval;
  42.491 +
  42.492 +  /* Reset out-of-data flag, unless read_restart_marker left us smack up
  42.493 +   * against a marker.  In that case we will end up treating the next data
  42.494 +   * segment as empty, and we can avoid producing bogus output pixels by
  42.495 +   * leaving the flag set.
  42.496 +   */
  42.497 +  if (cinfo->unread_marker == 0)
  42.498 +    entropy->pub.insufficient_data = FALSE;
  42.499 +
  42.500 +  return TRUE;
  42.501 +}
  42.502 +
  42.503 +
  42.504 +/*
  42.505 + * Decode and return one MCU's worth of Huffman-compressed coefficients.
  42.506 + * The coefficients are reordered from zigzag order into natural array order,
  42.507 + * but are not dequantized.
  42.508 + *
  42.509 + * The i'th block of the MCU is stored into the block pointed to by
  42.510 + * MCU_data[i].  WE ASSUME THIS AREA HAS BEEN ZEROED BY THE CALLER.
  42.511 + * (Wholesale zeroing is usually a little faster than retail...)
  42.512 + *
  42.513 + * Returns FALSE if data source requested suspension.  In that case no
  42.514 + * changes have been made to permanent state.  (Exception: some output
  42.515 + * coefficients may already have been assigned.  This is harmless for
  42.516 + * this module, since we'll just re-assign them on the next call.)
  42.517 + */
  42.518 +
  42.519 +METHODDEF(boolean)
  42.520 +decode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
  42.521 +{
  42.522 +  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
  42.523 +  int blkn;
  42.524 +  BITREAD_STATE_VARS;
  42.525 +  savable_state state;
  42.526 +
  42.527 +  /* Process restart marker if needed; may have to suspend */
  42.528 +  if (cinfo->restart_interval) {
  42.529 +    if (entropy->restarts_to_go == 0)
  42.530 +      if (! process_restart(cinfo))
  42.531 +	return FALSE;
  42.532 +  }
  42.533 +
  42.534 +  /* If we've run out of data, just leave the MCU set to zeroes.
  42.535 +   * This way, we return uniform gray for the remainder of the segment.
  42.536 +   */
  42.537 +  if (! entropy->pub.insufficient_data) {
  42.538 +
  42.539 +    /* Load up working state */
  42.540 +    BITREAD_LOAD_STATE(cinfo,entropy->bitstate);
  42.541 +    ASSIGN_STATE(state, entropy->saved);
  42.542 +
  42.543 +    /* Outer loop handles each block in the MCU */
  42.544 +
  42.545 +    for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
  42.546 +      JBLOCKROW block = MCU_data[blkn];
  42.547 +      d_derived_tbl * dctbl = entropy->dc_cur_tbls[blkn];
  42.548 +      d_derived_tbl * actbl = entropy->ac_cur_tbls[blkn];
  42.549 +      register int s, k, r;
  42.550 +
  42.551 +      /* Decode a single block's worth of coefficients */
  42.552 +
  42.553 +      /* Section F.2.2.1: decode the DC coefficient difference */
  42.554 +      HUFF_DECODE(s, br_state, dctbl, return FALSE, label1);
  42.555 +      if (s) {
  42.556 +	CHECK_BIT_BUFFER(br_state, s, return FALSE);
  42.557 +	r = GET_BITS(s);
  42.558 +	s = HUFF_EXTEND(r, s);
  42.559 +      }
  42.560 +
  42.561 +      if (entropy->dc_needed[blkn]) {
  42.562 +	/* Convert DC difference to actual value, update last_dc_val */
  42.563 +	int ci = cinfo->MCU_membership[blkn];
  42.564 +	s += state.last_dc_val[ci];
  42.565 +	state.last_dc_val[ci] = s;
  42.566 +	/* Output the DC coefficient (assumes jpeg_natural_order[0] = 0) */
  42.567 +	(*block)[0] = (JCOEF) s;
  42.568 +      }
  42.569 +
  42.570 +      if (entropy->ac_needed[blkn]) {
  42.571 +
  42.572 +	/* Section F.2.2.2: decode the AC coefficients */
  42.573 +	/* Since zeroes are skipped, output area must be cleared beforehand */
  42.574 +	for (k = 1; k < DCTSIZE2; k++) {
  42.575 +	  HUFF_DECODE(s, br_state, actbl, return FALSE, label2);
  42.576 +      
  42.577 +	  r = s >> 4;
  42.578 +	  s &= 15;
  42.579 +      
  42.580 +	  if (s) {
  42.581 +	    k += r;
  42.582 +	    CHECK_BIT_BUFFER(br_state, s, return FALSE);
  42.583 +	    r = GET_BITS(s);
  42.584 +	    s = HUFF_EXTEND(r, s);
  42.585 +	    /* Output coefficient in natural (dezigzagged) order.
  42.586 +	     * Note: the extra entries in jpeg_natural_order[] will save us
  42.587 +	     * if k >= DCTSIZE2, which could happen if the data is corrupted.
  42.588 +	     */
  42.589 +	    (*block)[jpeg_natural_order[k]] = (JCOEF) s;
  42.590 +	  } else {
  42.591 +	    if (r != 15)
  42.592 +	      break;
  42.593 +	    k += 15;
  42.594 +	  }
  42.595 +	}
  42.596 +
  42.597 +      } else {
  42.598 +
  42.599 +	/* Section F.2.2.2: decode the AC coefficients */
  42.600 +	/* In this path we just discard the values */
  42.601 +	for (k = 1; k < DCTSIZE2; k++) {
  42.602 +	  HUFF_DECODE(s, br_state, actbl, return FALSE, label3);
  42.603 +      
  42.604 +	  r = s >> 4;
  42.605 +	  s &= 15;
  42.606 +      
  42.607 +	  if (s) {
  42.608 +	    k += r;
  42.609 +	    CHECK_BIT_BUFFER(br_state, s, return FALSE);
  42.610 +	    DROP_BITS(s);
  42.611 +	  } else {
  42.612 +	    if (r != 15)
  42.613 +	      break;
  42.614 +	    k += 15;
  42.615 +	  }
  42.616 +	}
  42.617 +
  42.618 +      }
  42.619 +    }
  42.620 +
  42.621 +    /* Completed MCU, so update state */
  42.622 +    BITREAD_SAVE_STATE(cinfo,entropy->bitstate);
  42.623 +    ASSIGN_STATE(entropy->saved, state);
  42.624 +  }
  42.625 +
  42.626 +  /* Account for restart interval (no-op if not using restarts) */
  42.627 +  entropy->restarts_to_go--;
  42.628 +
  42.629 +  return TRUE;
  42.630 +}
  42.631 +
  42.632 +
  42.633 +/*
  42.634 + * Module initialization routine for Huffman entropy decoding.
  42.635 + */
  42.636 +
  42.637 +GLOBAL(void)
  42.638 +jinit_huff_decoder (j_decompress_ptr cinfo)
  42.639 +{
  42.640 +  huff_entropy_ptr entropy;
  42.641 +  int i;
  42.642 +
  42.643 +  entropy = (huff_entropy_ptr)
  42.644 +    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
  42.645 +				SIZEOF(huff_entropy_decoder));
  42.646 +  cinfo->entropy = (struct jpeg_entropy_decoder *) entropy;
  42.647 +  entropy->pub.start_pass = start_pass_huff_decoder;
  42.648 +  entropy->pub.decode_mcu = decode_mcu;
  42.649 +
  42.650 +  /* Mark tables unallocated */
  42.651 +  for (i = 0; i < NUM_HUFF_TBLS; i++) {
  42.652 +    entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL;
  42.653 +  }
  42.654 +}
    43.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    43.2 +++ b/libs/libjpeg/jdhuff.h	Sun Nov 01 00:36:56 2015 +0200
    43.3 @@ -0,0 +1,201 @@
    43.4 +/*
    43.5 + * jdhuff.h
    43.6 + *
    43.7 + * Copyright (C) 1991-1997, Thomas G. Lane.
    43.8 + * This file is part of the Independent JPEG Group's software.
    43.9 + * For conditions of distribution and use, see the accompanying README file.
   43.10 + *
   43.11 + * This file contains declarations for Huffman entropy decoding routines
   43.12 + * that are shared between the sequential decoder (jdhuff.c) and the
   43.13 + * progressive decoder (jdphuff.c).  No other modules need to see these.
   43.14 + */
   43.15 +
   43.16 +/* Short forms of external names for systems with brain-damaged linkers. */
   43.17 +
   43.18 +#ifdef NEED_SHORT_EXTERNAL_NAMES
   43.19 +#define jpeg_make_d_derived_tbl	jMkDDerived
   43.20 +#define jpeg_fill_bit_buffer	jFilBitBuf
   43.21 +#define jpeg_huff_decode	jHufDecode
   43.22 +#endif /* NEED_SHORT_EXTERNAL_NAMES */
   43.23 +
   43.24 +
   43.25 +/* Derived data constructed for each Huffman table */
   43.26 +
   43.27 +#define HUFF_LOOKAHEAD	8	/* # of bits of lookahead */
   43.28 +
   43.29 +typedef struct {
   43.30 +  /* Basic tables: (element [0] of each array is unused) */
   43.31 +  INT32 maxcode[18];		/* largest code of length k (-1 if none) */
   43.32 +  /* (maxcode[17] is a sentinel to ensure jpeg_huff_decode terminates) */
   43.33 +  INT32 valoffset[17];		/* huffval[] offset for codes of length k */
   43.34 +  /* valoffset[k] = huffval[] index of 1st symbol of code length k, less
   43.35 +   * the smallest code of length k; so given a code of length k, the
   43.36 +   * corresponding symbol is huffval[code + valoffset[k]]
   43.37 +   */
   43.38 +
   43.39 +  /* Link to public Huffman table (needed only in jpeg_huff_decode) */
   43.40 +  JHUFF_TBL *pub;
   43.41 +
   43.42 +  /* Lookahead tables: indexed by the next HUFF_LOOKAHEAD bits of
   43.43 +   * the input data stream.  If the next Huffman code is no more
   43.44 +   * than HUFF_LOOKAHEAD bits long, we can obtain its length and
   43.45 +   * the corresponding symbol directly from these tables.
   43.46 +   */
   43.47 +  int look_nbits[1<<HUFF_LOOKAHEAD]; /* # bits, or 0 if too long */
   43.48 +  UINT8 look_sym[1<<HUFF_LOOKAHEAD]; /* symbol, or unused */
   43.49 +} d_derived_tbl;
   43.50 +
   43.51 +/* Expand a Huffman table definition into the derived format */
   43.52 +EXTERN(void) jpeg_make_d_derived_tbl
   43.53 +	JPP((j_decompress_ptr cinfo, boolean isDC, int tblno,
   43.54 +	     d_derived_tbl ** pdtbl));
   43.55 +
   43.56 +
   43.57 +/*
   43.58 + * Fetching the next N bits from the input stream is a time-critical operation
   43.59 + * for the Huffman decoders.  We implement it with a combination of inline
   43.60 + * macros and out-of-line subroutines.  Note that N (the number of bits
   43.61 + * demanded at one time) never exceeds 15 for JPEG use.
   43.62 + *
   43.63 + * We read source bytes into get_buffer and dole out bits as needed.
   43.64 + * If get_buffer already contains enough bits, they are fetched in-line
   43.65 + * by the macros CHECK_BIT_BUFFER and GET_BITS.  When there aren't enough
   43.66 + * bits, jpeg_fill_bit_buffer is called; it will attempt to fill get_buffer
   43.67 + * as full as possible (not just to the number of bits needed; this
   43.68 + * prefetching reduces the overhead cost of calling jpeg_fill_bit_buffer).
   43.69 + * Note that jpeg_fill_bit_buffer may return FALSE to indicate suspension.
   43.70 + * On TRUE return, jpeg_fill_bit_buffer guarantees that get_buffer contains
   43.71 + * at least the requested number of bits --- dummy zeroes are inserted if
   43.72 + * necessary.
   43.73 + */
   43.74 +
   43.75 +typedef INT32 bit_buf_type;	/* type of bit-extraction buffer */
   43.76 +#define BIT_BUF_SIZE  32	/* size of buffer in bits */
   43.77 +
   43.78 +/* If long is > 32 bits on your machine, and shifting/masking longs is
   43.79 + * reasonably fast, making bit_buf_type be long and setting BIT_BUF_SIZE
   43.80 + * appropriately should be a win.  Unfortunately we can't define the size
   43.81 + * with something like  #define BIT_BUF_SIZE (sizeof(bit_buf_type)*8)
   43.82 + * because not all machines measure sizeof in 8-bit bytes.
   43.83 + */
   43.84 +
   43.85 +typedef struct {		/* Bitreading state saved across MCUs */
   43.86 +  bit_buf_type get_buffer;	/* current bit-extraction buffer */
   43.87 +  int bits_left;		/* # of unused bits in it */
   43.88 +} bitread_perm_state;
   43.89 +
   43.90 +typedef struct {		/* Bitreading working state within an MCU */
   43.91 +  /* Current data source location */
   43.92 +  /* We need a copy, rather than munging the original, in case of suspension */
   43.93 +  const JOCTET * next_input_byte; /* => next byte to read from source */
   43.94 +  size_t bytes_in_buffer;	/* # of bytes remaining in source buffer */
   43.95 +  /* Bit input buffer --- note these values are kept in register variables,
   43.96 +   * not in this struct, inside the inner loops.
   43.97 +   */
   43.98 +  bit_buf_type get_buffer;	/* current bit-extraction buffer */
   43.99 +  int bits_left;		/* # of unused bits in it */
  43.100 +  /* Pointer needed by jpeg_fill_bit_buffer. */
  43.101 +  j_decompress_ptr cinfo;	/* back link to decompress master record */
  43.102 +} bitread_working_state;
  43.103 +
  43.104 +/* Macros to declare and load/save bitread local variables. */
  43.105 +#define BITREAD_STATE_VARS  \
  43.106 +	register bit_buf_type get_buffer;  \
  43.107 +	register int bits_left;  \
  43.108 +	bitread_working_state br_state
  43.109 +
  43.110 +#define BITREAD_LOAD_STATE(cinfop,permstate)  \
  43.111 +	br_state.cinfo = cinfop; \
  43.112 +	br_state.next_input_byte = cinfop->src->next_input_byte; \
  43.113 +	br_state.bytes_in_buffer = cinfop->src->bytes_in_buffer; \
  43.114 +	get_buffer = permstate.get_buffer; \
  43.115 +	bits_left = permstate.bits_left;
  43.116 +
  43.117 +#define BITREAD_SAVE_STATE(cinfop,permstate)  \
  43.118 +	cinfop->src->next_input_byte = br_state.next_input_byte; \
  43.119 +	cinfop->src->bytes_in_buffer = br_state.bytes_in_buffer; \
  43.120 +	permstate.get_buffer = get_buffer; \
  43.121 +	permstate.bits_left = bits_left
  43.122 +
  43.123 +/*
  43.124 + * These macros provide the in-line portion of bit fetching.
  43.125 + * Use CHECK_BIT_BUFFER to ensure there are N bits in get_buffer
  43.126 + * before using GET_BITS, PEEK_BITS, or DROP_BITS.
  43.127 + * The variables get_buffer and bits_left are assumed to be locals,
  43.128 + * but the state struct might not be (jpeg_huff_decode needs this).
  43.129 + *	CHECK_BIT_BUFFER(state,n,action);
  43.130 + *		Ensure there are N bits in get_buffer; if suspend, take action.
  43.131 + *      val = GET_BITS(n);
  43.132 + *		Fetch next N bits.
  43.133 + *      val = PEEK_BITS(n);
  43.134 + *		Fetch next N bits without removing them from the buffer.
  43.135 + *	DROP_BITS(n);
  43.136 + *		Discard next N bits.
  43.137 + * The value N should be a simple variable, not an expression, because it
  43.138 + * is evaluated multiple times.
  43.139 + */
  43.140 +
  43.141 +#define CHECK_BIT_BUFFER(state,nbits,action) \
  43.142 +	{ if (bits_left < (nbits)) {  \
  43.143 +	    if (! jpeg_fill_bit_buffer(&(state),get_buffer,bits_left,nbits))  \
  43.144 +	      { action; }  \
  43.145 +	    get_buffer = (state).get_buffer; bits_left = (state).bits_left; } }
  43.146 +
  43.147 +#define GET_BITS(nbits) \
  43.148 +	(((int) (get_buffer >> (bits_left -= (nbits)))) & ((1<<(nbits))-1))
  43.149 +
  43.150 +#define PEEK_BITS(nbits) \
  43.151 +	(((int) (get_buffer >> (bits_left -  (nbits)))) & ((1<<(nbits))-1))
  43.152 +
  43.153 +#define DROP_BITS(nbits) \
  43.154 +	(bits_left -= (nbits))
  43.155 +
  43.156 +/* Load up the bit buffer to a depth of at least nbits */
  43.157 +EXTERN(boolean) jpeg_fill_bit_buffer
  43.158 +	JPP((bitread_working_state * state, register bit_buf_type get_buffer,
  43.159 +	     register int bits_left, int nbits));
  43.160 +
  43.161 +
  43.162 +/*
  43.163 + * Code for extracting next Huffman-coded symbol from input bit stream.
  43.164 + * Again, this is time-critical and we make the main paths be macros.
  43.165 + *
  43.166 + * We use a lookahead table to process codes of up to HUFF_LOOKAHEAD bits
  43.167 + * without looping.  Usually, more than 95% of the Huffman codes will be 8
  43.168 + * or fewer bits long.  The few overlength codes are handled with a loop,
  43.169 + * which need not be inline code.
  43.170 + *
  43.171 + * Notes about the HUFF_DECODE macro:
  43.172 + * 1. Near the end of the data segment, we may fail to get enough bits
  43.173 + *    for a lookahead.  In that case, we do it the hard way.
  43.174 + * 2. If the lookahead table contains no entry, the next code must be
  43.175 + *    more than HUFF_LOOKAHEAD bits long.
  43.176 + * 3. jpeg_huff_decode returns -1 if forced to suspend.
  43.177 + */
  43.178 +
  43.179 +#define HUFF_DECODE(result,state,htbl,failaction,slowlabel) \
  43.180 +{ register int nb, look; \
  43.181 +  if (bits_left < HUFF_LOOKAHEAD) { \
  43.182 +    if (! jpeg_fill_bit_buffer(&state,get_buffer,bits_left, 0)) {failaction;} \
  43.183 +    get_buffer = state.get_buffer; bits_left = state.bits_left; \
  43.184 +    if (bits_left < HUFF_LOOKAHEAD) { \
  43.185 +      nb = 1; goto slowlabel; \
  43.186 +    } \
  43.187 +  } \
  43.188 +  look = PEEK_BITS(HUFF_LOOKAHEAD); \
  43.189 +  if ((nb = htbl->look_nbits[look]) != 0) { \
  43.190 +    DROP_BITS(nb); \
  43.191 +    result = htbl->look_sym[look]; \
  43.192 +  } else { \
  43.193 +    nb = HUFF_LOOKAHEAD+1; \
  43.194 +slowlabel: \
  43.195 +    if ((result=jpeg_huff_decode(&state,get_buffer,bits_left,htbl,nb)) < 0) \
  43.196 +	{ failaction; } \
  43.197 +    get_buffer = state.get_buffer; bits_left = state.bits_left; \
  43.198 +  } \
  43.199 +}
  43.200 +
  43.201 +/* Out-of-line case for Huffman code fetching */
  43.202 +EXTERN(int) jpeg_huff_decode
  43.203 +	JPP((bitread_working_state * state, register bit_buf_type get_buffer,
  43.204 +	     register int bits_left, d_derived_tbl * htbl, int min_bits));
    44.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    44.2 +++ b/libs/libjpeg/jdinput.c	Sun Nov 01 00:36:56 2015 +0200
    44.3 @@ -0,0 +1,381 @@
    44.4 +/*
    44.5 + * jdinput.c
    44.6 + *
    44.7 + * Copyright (C) 1991-1997, Thomas G. Lane.
    44.8 + * This file is part of the Independent JPEG Group's software.
    44.9 + * For conditions of distribution and use, see the accompanying README file.
   44.10 + *
   44.11 + * This file contains input control logic for the JPEG decompressor.
   44.12 + * These routines are concerned with controlling the decompressor's input
   44.13 + * processing (marker reading and coefficient decoding).  The actual input
   44.14 + * reading is done in jdmarker.c, jdhuff.c, and jdphuff.c.
   44.15 + */
   44.16 +
   44.17 +#define JPEG_INTERNALS
   44.18 +#include "jinclude.h"
   44.19 +#include "jpeglib.h"
   44.20 +
   44.21 +
   44.22 +/* Private state */
   44.23 +
   44.24 +typedef struct {
   44.25 +  struct jpeg_input_controller pub; /* public fields */
   44.26 +
   44.27 +  boolean inheaders;		/* TRUE until first SOS is reached */
   44.28 +} my_input_controller;
   44.29 +
   44.30 +typedef my_input_controller * my_inputctl_ptr;
   44.31 +
   44.32 +
   44.33 +/* Forward declarations */
   44.34 +METHODDEF(int) consume_markers JPP((j_decompress_ptr cinfo));
   44.35 +
   44.36 +
   44.37 +/*
   44.38 + * Routines to calculate various quantities related to the size of the image.
   44.39 + */
   44.40 +
   44.41 +LOCAL(void)
   44.42 +initial_setup (j_decompress_ptr cinfo)
   44.43 +/* Called once, when first SOS marker is reached */
   44.44 +{
   44.45 +  int ci;
   44.46 +  jpeg_component_info *compptr;
   44.47 +
   44.48 +  /* Make sure image isn't bigger than I can handle */
   44.49 +  if ((long) cinfo->image_height > (long) JPEG_MAX_DIMENSION ||
   44.50 +      (long) cinfo->image_width > (long) JPEG_MAX_DIMENSION)
   44.51 +    ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION);
   44.52 +
   44.53 +  /* For now, precision must match compiled-in value... */
   44.54 +  if (cinfo->data_precision != BITS_IN_JSAMPLE)
   44.55 +    ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);
   44.56 +
   44.57 +  /* Check that number of components won't exceed internal array sizes */
   44.58 +  if (cinfo->num_components > MAX_COMPONENTS)
   44.59 +    ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,
   44.60 +	     MAX_COMPONENTS);
   44.61 +
   44.62 +  /* Compute maximum sampling factors; check factor validity */
   44.63 +  cinfo->max_h_samp_factor = 1;
   44.64 +  cinfo->max_v_samp_factor = 1;
   44.65 +  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
   44.66 +       ci++, compptr++) {
   44.67 +    if (compptr->h_samp_factor<=0 || compptr->h_samp_factor>MAX_SAMP_FACTOR ||
   44.68 +	compptr->v_samp_factor<=0 || compptr->v_samp_factor>MAX_SAMP_FACTOR)
   44.69 +      ERREXIT(cinfo, JERR_BAD_SAMPLING);
   44.70 +    cinfo->max_h_samp_factor = MAX(cinfo->max_h_samp_factor,
   44.71 +				   compptr->h_samp_factor);
   44.72 +    cinfo->max_v_samp_factor = MAX(cinfo->max_v_samp_factor,
   44.73 +				   compptr->v_samp_factor);
   44.74 +  }
   44.75 +
   44.76 +  /* We initialize DCT_scaled_size and min_DCT_scaled_size to DCTSIZE.
   44.77 +   * In the full decompressor, this will be overridden by jdmaster.c;
   44.78 +   * but in the transcoder, jdmaster.c is not used, so we must do it here.
   44.79 +   */
   44.80 +  cinfo->min_DCT_scaled_size = DCTSIZE;
   44.81 +
   44.82 +  /* Compute dimensions of components */
   44.83 +  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
   44.84 +       ci++, compptr++) {
   44.85 +    compptr->DCT_scaled_size = DCTSIZE;
   44.86 +    /* Size in DCT blocks */
   44.87 +    compptr->width_in_blocks = (JDIMENSION)
   44.88 +      jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor,
   44.89 +		    (long) (cinfo->max_h_samp_factor * DCTSIZE));
   44.90 +    compptr->height_in_blocks = (JDIMENSION)
   44.91 +      jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor,
   44.92 +		    (long) (cinfo->max_v_samp_factor * DCTSIZE));
   44.93 +    /* downsampled_width and downsampled_height will also be overridden by
   44.94 +     * jdmaster.c if we are doing full decompression.  The transcoder library
   44.95 +     * doesn't use these values, but the calling application might.
   44.96 +     */
   44.97 +    /* Size in samples */
   44.98 +    compptr->downsampled_width = (JDIMENSION)
   44.99 +      jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor,
  44.100 +		    (long) cinfo->max_h_samp_factor);
  44.101 +    compptr->downsampled_height = (JDIMENSION)
  44.102 +      jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor,
  44.103 +		    (long) cinfo->max_v_samp_factor);
  44.104 +    /* Mark component needed, until color conversion says otherwise */
  44.105 +    compptr->component_needed = TRUE;
  44.106 +    /* Mark no quantization table yet saved for component */
  44.107 +    compptr->quant_table = NULL;
  44.108 +  }
  44.109 +
  44.110 +  /* Compute number of fully interleaved MCU rows. */
  44.111 +  cinfo->total_iMCU_rows = (JDIMENSION)
  44.112 +    jdiv_round_up((long) cinfo->image_height,
  44.113 +		  (long) (cinfo->max_v_samp_factor*DCTSIZE));
  44.114 +
  44.115 +  /* Decide whether file contains multiple scans */
  44.116 +  if (cinfo->comps_in_scan < cinfo->num_components || cinfo->progressive_mode)
  44.117 +    cinfo->inputctl->has_multiple_scans = TRUE;
  44.118 +  else
  44.119 +    cinfo->inputctl->has_multiple_scans = FALSE;
  44.120 +}
  44.121 +
  44.122 +
  44.123 +LOCAL(void)
  44.124 +per_scan_setup (j_decompress_ptr cinfo)
  44.125 +/* Do computations that are needed before processing a JPEG scan */
  44.126 +/* cinfo->comps_in_scan and cinfo->cur_comp_info[] were set from SOS marker */
  44.127 +{
  44.128 +  int ci, mcublks, tmp;
  44.129 +  jpeg_component_info *compptr;
  44.130 +  
  44.131 +  if (cinfo->comps_in_scan == 1) {
  44.132 +    
  44.133 +    /* Noninterleaved (single-component) scan */
  44.134 +    compptr = cinfo->cur_comp_info[0];
  44.135 +    
  44.136 +    /* Overall image size in MCUs */
  44.137 +    cinfo->MCUs_per_row = compptr->width_in_blocks;
  44.138 +    cinfo->MCU_rows_in_scan = compptr->height_in_blocks;
  44.139 +    
  44.140 +    /* For noninterleaved scan, always one block per MCU */
  44.141 +    compptr->MCU_width = 1;
  44.142 +    compptr->MCU_height = 1;
  44.143 +    compptr->MCU_blocks = 1;
  44.144 +    compptr->MCU_sample_width = compptr->DCT_scaled_size;
  44.145 +    compptr->last_col_width = 1;
  44.146 +    /* For noninterleaved scans, it is convenient to define last_row_height
  44.147 +     * as the number of block rows present in the last iMCU row.
  44.148 +     */
  44.149 +    tmp = (int) (compptr->height_in_blocks % compptr->v_samp_factor);
  44.150 +    if (tmp == 0) tmp = compptr->v_samp_factor;
  44.151 +    compptr->last_row_height = tmp;
  44.152 +    
  44.153 +    /* Prepare array describing MCU composition */
  44.154 +    cinfo->blocks_in_MCU = 1;
  44.155 +    cinfo->MCU_membership[0] = 0;
  44.156 +    
  44.157 +  } else {
  44.158 +    
  44.159 +    /* Interleaved (multi-component) scan */
  44.160 +    if (cinfo->comps_in_scan <= 0 || cinfo->comps_in_scan > MAX_COMPS_IN_SCAN)
  44.161 +      ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->comps_in_scan,
  44.162 +	       MAX_COMPS_IN_SCAN);
  44.163 +    
  44.164 +    /* Overall image size in MCUs */
  44.165 +    cinfo->MCUs_per_row = (JDIMENSION)
  44.166 +      jdiv_round_up((long) cinfo->image_width,
  44.167 +		    (long) (cinfo->max_h_samp_factor*DCTSIZE));
  44.168 +    cinfo->MCU_rows_in_scan = (JDIMENSION)
  44.169 +      jdiv_round_up((long) cinfo->image_height,
  44.170 +		    (long) (cinfo->max_v_samp_factor*DCTSIZE));
  44.171 +    
  44.172 +    cinfo->blocks_in_MCU = 0;
  44.173 +    
  44.174 +    for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
  44.175 +      compptr = cinfo->cur_comp_info[ci];
  44.176 +      /* Sampling factors give # of blocks of component in each MCU */
  44.177 +      compptr->MCU_width = compptr->h_samp_factor;
  44.178 +      compptr->MCU_height = compptr->v_samp_factor;
  44.179 +      compptr->MCU_blocks = compptr->MCU_width * compptr->MCU_height;
  44.180 +      compptr->MCU_sample_width = compptr->MCU_width * compptr->DCT_scaled_size;
  44.181 +      /* Figure number of non-dummy blocks in last MCU column & row */
  44.182 +      tmp = (int) (compptr->width_in_blocks % compptr->MCU_width);
  44.183 +      if (tmp == 0) tmp = compptr->MCU_width;
  44.184 +      compptr->last_col_width = tmp;
  44.185 +      tmp = (int) (compptr->height_in_blocks % compptr->MCU_height);
  44.186 +      if (tmp == 0) tmp = compptr->MCU_height;
  44.187 +      compptr->last_row_height = tmp;
  44.188 +      /* Prepare array describing MCU composition */
  44.189 +      mcublks = compptr->MCU_blocks;
  44.190 +      if (cinfo->blocks_in_MCU + mcublks > D_MAX_BLOCKS_IN_MCU)
  44.191 +	ERREXIT(cinfo, JERR_BAD_MCU_SIZE);
  44.192 +      while (mcublks-- > 0) {
  44.193 +	cinfo->MCU_membership[cinfo->blocks_in_MCU++] = ci;
  44.194 +      }
  44.195 +    }
  44.196 +    
  44.197 +  }
  44.198 +}
  44.199 +
  44.200 +
  44.201 +/*
  44.202 + * Save away a copy of the Q-table referenced by each component present
  44.203 + * in the current scan, unless already saved during a prior scan.
  44.204 + *
  44.205 + * In a multiple-scan JPEG file, the encoder could assign different components
  44.206 + * the same Q-table slot number, but change table definitions between scans
  44.207 + * so that each component uses a different Q-table.  (The IJG encoder is not
  44.208 + * currently capable of doing this, but other encoders might.)  Since we want
  44.209 + * to be able to dequantize all the components at the end of the file, this
  44.210 + * means that we have to save away the table actually used for each component.
  44.211 + * We do this by copying the table at the start of the first scan containing
  44.212 + * the component.
  44.213 + * The JPEG spec prohibits the encoder from changing the contents of a Q-table
  44.214 + * slot between scans of a component using that slot.  If the encoder does so
  44.215 + * anyway, this decoder will simply use the Q-table values that were current
  44.216 + * at the start of the first scan for the component.
  44.217 + *
  44.218 + * The decompressor output side looks only at the saved quant tables,
  44.219 + * not at the current Q-table slots.
  44.220 + */
  44.221 +
  44.222 +LOCAL(void)
  44.223 +latch_quant_tables (j_decompress_ptr cinfo)
  44.224 +{
  44.225 +  int ci, qtblno;
  44.226 +  jpeg_component_info *compptr;
  44.227 +  JQUANT_TBL * qtbl;
  44.228 +
  44.229 +  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
  44.230 +    compptr = cinfo->cur_comp_info[ci];
  44.231 +    /* No work if we already saved Q-table for this component */
  44.232 +    if (compptr->quant_table != NULL)
  44.233 +      continue;
  44.234 +    /* Make sure specified quantization table is present */
  44.235 +    qtblno = compptr->quant_tbl_no;
  44.236 +    if (qtblno < 0 || qtblno >= NUM_QUANT_TBLS ||
  44.237 +	cinfo->quant_tbl_ptrs[qtblno] == NULL)
  44.238 +      ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, qtblno);
  44.239 +    /* OK, save away the quantization table */
  44.240 +    qtbl = (JQUANT_TBL *)
  44.241 +      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
  44.242 +				  SIZEOF(JQUANT_TBL));
  44.243 +    MEMCOPY(qtbl, cinfo->quant_tbl_ptrs[qtblno], SIZEOF(JQUANT_TBL));
  44.244 +    compptr->quant_table = qtbl;
  44.245 +  }
  44.246 +}
  44.247 +
  44.248 +
  44.249 +/*
  44.250 + * Initialize the input modules to read a scan of compressed data.
  44.251 + * The first call to this is done by jdmaster.c after initializing
  44.252 + * the entire decompressor (during jpeg_start_decompress).
  44.253 + * Subsequent calls come from consume_markers, below.
  44.254 + */
  44.255 +
  44.256 +METHODDEF(void)
  44.257 +start_input_pass (j_decompress_ptr cinfo)
  44.258 +{
  44.259 +  per_scan_setup(cinfo);
  44.260 +  latch_quant_tables(cinfo);
  44.261 +  (*cinfo->entropy->start_pass) (cinfo);
  44.262 +  (*cinfo->coef->start_input_pass) (cinfo);
  44.263 +  cinfo->inputctl->consume_input = cinfo->coef->consume_data;
  44.264 +}
  44.265 +
  44.266 +
  44.267 +/*
  44.268 + * Finish up after inputting a compressed-data scan.
  44.269 + * This is called by the coefficient controller after it's read all
  44.270 + * the expected data of the scan.
  44.271 + */
  44.272 +
  44.273 +METHODDEF(void)
  44.274 +finish_input_pass (j_decompress_ptr cinfo)
  44.275 +{
  44.276 +  cinfo->inputctl->consume_input = consume_markers;
  44.277 +}
  44.278 +
  44.279 +
  44.280 +/*
  44.281 + * Read JPEG markers before, between, or after compressed-data scans.
  44.282 + * Change state as necessary when a new scan is reached.
  44.283 + * Return value is JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI.
  44.284 + *
  44.285 + * The consume_input method pointer points either here or to the
  44.286 + * coefficient controller's consume_data routine, depending on whether
  44.287 + * we are reading a compressed data segment or inter-segment markers.
  44.288 + */
  44.289 +
  44.290 +METHODDEF(int)
  44.291 +consume_markers (j_decompress_ptr cinfo)
  44.292 +{
  44.293 +  my_inputctl_ptr inputctl = (my_inputctl_ptr) cinfo->inputctl;
  44.294 +  int val;
  44.295 +
  44.296 +  if (inputctl->pub.eoi_reached) /* After hitting EOI, read no further */
  44.297 +    return JPEG_REACHED_EOI;
  44.298 +
  44.299 +  val = (*cinfo->marker->read_markers) (cinfo);
  44.300 +
  44.301 +  switch (val) {
  44.302 +  case JPEG_REACHED_SOS:	/* Found SOS */
  44.303 +    if (inputctl->inheaders) {	/* 1st SOS */
  44.304 +      initial_setup(cinfo);
  44.305 +      inputctl->inheaders = FALSE;
  44.306 +      /* Note: start_input_pass must be called by jdmaster.c
  44.307 +       * before any more input can be consumed.  jdapimin.c is
  44.308 +       * responsible for enforcing this sequencing.
  44.309 +       */
  44.310 +    } else {			/* 2nd or later SOS marker */
  44.311 +      if (! inputctl->pub.has_multiple_scans)
  44.312 +	ERREXIT(cinfo, JERR_EOI_EXPECTED); /* Oops, I wasn't expecting this! */
  44.313 +      start_input_pass(cinfo);
  44.314 +    }
  44.315 +    break;
  44.316 +  case JPEG_REACHED_EOI:	/* Found EOI */
  44.317 +    inputctl->pub.eoi_reached = TRUE;
  44.318 +    if (inputctl->inheaders) {	/* Tables-only datastream, apparently */
  44.319 +      if (cinfo->marker->saw_SOF)
  44.320 +	ERREXIT(cinfo, JERR_SOF_NO_SOS);
  44.321 +    } else {
  44.322 +      /* Prevent infinite loop in coef ctlr's decompress_data routine
  44.323 +       * if user set output_scan_number larger than number of scans.
  44.324 +       */
  44.325 +      if (cinfo->output_scan_number > cinfo->input_scan_number)
  44.326 +	cinfo->output_scan_number = cinfo->input_scan_number;
  44.327 +    }
  44.328 +    break;
  44.329 +  case JPEG_SUSPENDED:
  44.330 +    break;
  44.331 +  }
  44.332 +
  44.333 +  return val;
  44.334 +}
  44.335 +
  44.336 +
  44.337 +/*
  44.338 + * Reset state to begin a fresh datastream.
  44.339 + */
  44.340 +
  44.341 +METHODDEF(void)
  44.342 +reset_input_controller (j_decompress_ptr cinfo)
  44.343 +{
  44.344 +  my_inputctl_ptr inputctl = (my_inputctl_ptr) cinfo->inputctl;
  44.345 +
  44.346 +  inputctl->pub.consume_input = consume_markers;
  44.347 +  inputctl->pub.has_multiple_scans = FALSE; /* "unknown" would be better */
  44.348 +  inputctl->pub.eoi_reached = FALSE;
  44.349 +  inputctl->inheaders = TRUE;
  44.350 +  /* Reset other modules */
  44.351 +  (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo);
  44.352 +  (*cinfo->marker->reset_marker_reader) (cinfo);
  44.353 +  /* Reset progression state -- would be cleaner if entropy decoder did this */
  44.354 +  cinfo->coef_bits = NULL;
  44.355 +}
  44.356 +
  44.357 +
  44.358 +/*
  44.359 + * Initialize the input controller module.
  44.360 + * This is called only once, when the decompression object is created.
  44.361 + */
  44.362 +
  44.363 +GLOBAL(void)
  44.364 +jinit_input_controller (j_decompress_ptr cinfo)
  44.365 +{
  44.366 +  my_inputctl_ptr inputctl;
  44.367 +
  44.368 +  /* Create subobject in permanent pool */
  44.369 +  inputctl = (my_inputctl_ptr)
  44.370 +    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
  44.371 +				SIZEOF(my_input_controller));
  44.372 +  cinfo->inputctl = (struct jpeg_input_controller *) inputctl;
  44.373 +  /* Initialize method pointers */
  44.374 +  inputctl->pub.consume_input = consume_markers;
  44.375 +  inputctl->pub.reset_input_controller = reset_input_controller;
  44.376 +  inputctl->pub.start_input_pass = start_input_pass;
  44.377 +  inputctl->pub.finish_input_pass = finish_input_pass;
  44.378 +  /* Initialize state: can't use reset_input_controller since we don't
  44.379 +   * want to try to reset other modules yet.
  44.380 +   */
  44.381 +  inputctl->pub.has_multiple_scans = FALSE; /* "unknown" would be better */
  44.382 +  inputctl->pub.eoi_reached = FALSE;
  44.383 +  inputctl->inheaders = TRUE;
  44.384 +}
    45.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    45.2 +++ b/libs/libjpeg/jdmainct.c	Sun Nov 01 00:36:56 2015 +0200
    45.3 @@ -0,0 +1,512 @@
    45.4 +/*
    45.5 + * jdmainct.c
    45.6 + *
    45.7 + * Copyright (C) 1994-1996, Thomas G. Lane.
    45.8 + * This file is part of the Independent JPEG Group's software.
    45.9 + * For conditions of distribution and use, see the accompanying README file.
   45.10 + *
   45.11 + * This file contains the main buffer controller for decompression.
   45.12 + * The main buffer lies between the JPEG decompressor proper and the
   45.13 + * post-processor; it holds downsampled data in the JPEG colorspace.
   45.14 + *
   45.15 + * Note that this code is bypassed in raw-data mode, since the application
   45.16 + * supplies the equivalent of the main buffer in that case.
   45.17 + */
   45.18 +
   45.19 +#define JPEG_INTERNALS
   45.20 +#include "jinclude.h"
   45.21 +#include "jpeglib.h"
   45.22 +
   45.23 +
   45.24 +/*
   45.25 + * In the current system design, the main buffer need never be a full-image
   45.26 + * buffer; any full-height buffers will be found inside the coefficient or
   45.27 + * postprocessing controllers.  Nonetheless, the main controller is not
   45.28 + * trivial.  Its responsibility is to provide context rows for upsampling/
   45.29 + * rescaling, and doing this in an efficient fashion is a bit tricky.
   45.30 + *
   45.31 + * Postprocessor input data is counted in "row groups".  A row group
   45.32 + * is defined to be (v_samp_factor * DCT_scaled_size / min_DCT_scaled_size)
   45.33 + * sample rows of each component.  (We require DCT_scaled_size values to be
   45.34 + * chosen such that these numbers are integers.  In practice DCT_scaled_size
   45.35 + * values will likely be powers of two, so we actually have the stronger
   45.36 + * condition that DCT_scaled_size / min_DCT_scaled_size is an integer.)
   45.37 + * Upsampling will typically produce max_v_samp_factor pixel rows from each
   45.38 + * row group (times any additional scale factor that the upsampler is
   45.39 + * applying).
   45.40 + *
   45.41 + * The coefficient controller will deliver data to us one iMCU row at a time;
   45.42 + * each iMCU row contains v_samp_factor * DCT_scaled_size sample rows, or
   45.43 + * exactly min_DCT_scaled_size row groups.  (This amount of data corresponds
   45.44 + * to one row of MCUs when the image is fully interleaved.)  Note that the
   45.45 + * number of sample rows varies across components, but the number of row
   45.46 + * groups does not.  Some garbage sample rows may be included in the last iMCU
   45.47 + * row at the bottom of the image.
   45.48 + *
   45.49 + * Depending on the vertical scaling algorithm used, the upsampler may need
   45.50 + * access to the sample row(s) above and below its current input row group.
   45.51 + * The upsampler is required to set need_context_rows TRUE at global selection
   45.52 + * time if so.  When need_context_rows is FALSE, this controller can simply
   45.53 + * obtain one iMCU row at a time from the coefficient controller and dole it
   45.54 + * out as row groups to the postprocessor.
   45.55 + *
   45.56 + * When need_context_rows is TRUE, this controller guarantees that the buffer
   45.57 + * passed to postprocessing contains at least one row group's worth of samples
   45.58 + * above and below the row group(s) being processed.  Note that the context
   45.59 + * rows "above" the first passed row group appear at negative row offsets in
   45.60 + * the passed buffer.  At the top and bottom of the image, the required
   45.61 + * context rows are manufactured by duplicating the first or last real sample
   45.62 + * row; this avoids having special cases in the upsampling inner loops.
   45.63 + *
   45.64 + * The amount of context is fixed at one row group just because that's a
   45.65 + * convenient number for this controller to work with.  The existing
   45.66 + * upsamplers really only need one sample row of context.  An upsampler
   45.67 + * supporting arbitrary output rescaling might wish for more than one row
   45.68 + * group of context when shrinking the image; tough, we don't handle that.
   45.69 + * (This is justified by the assumption that downsizing will be handled mostly
   45.70 + * by adjusting the DCT_scaled_size values, so that the actual scale factor at
   45.71 + * the upsample step needn't be much less than one.)
   45.72 + *
   45.73 + * To provide the desired context, we have to retain the last two row groups
   45.74 + * of one iMCU row while reading in the next iMCU row.  (The last row group
   45.75 + * can't be processed until we have another row group for its below-context,
   45.76 + * and so we have to save the next-to-last group too for its above-context.)
   45.77 + * We could do this most simply by copying data around in our buffer, but
   45.78 + * that'd be very slow.  We can avoid copying any data by creating a rather
   45.79 + * strange pointer structure.  Here's how it works.  We allocate a workspace
   45.80 + * consisting of M+2 row groups (where M = min_DCT_scaled_size is the number
   45.81 + * of row groups per iMCU row).  We create two sets of redundant pointers to
   45.82 + * the workspace.  Labeling the physical row groups 0 to M+1, the synthesized
   45.83 + * pointer lists look like this:
   45.84 + *                   M+1                          M-1
   45.85 + * master pointer --> 0         master pointer --> 0
   45.86 + *                    1                            1
   45.87 + *                   ...                          ...
   45.88 + *                   M-3                          M-3
   45.89 + *                   M-2                           M
   45.90 + *                   M-1                          M+1
   45.91 + *                    M                           M-2
   45.92 + *                   M+1                          M-1
   45.93 + *                    0                            0
   45.94 + * We read alternate iMCU rows using each master pointer; thus the last two
   45.95 + * row groups of the previous iMCU row remain un-overwritten in the workspace.
   45.96 + * The pointer lists are set up so that the required context rows appear to
   45.97 + * be adjacent to the proper places when we pass the pointer lists to the
   45.98 + * upsampler.
   45.99 + *
  45.100 + * The above pictures describe the normal state of the pointer lists.
  45.101 + * At top and bottom of the image, we diddle the pointer lists to duplicate
  45.102 + * the first or last sample row as necessary (this is cheaper than copying
  45.103 + * sample rows around).
  45.104 + *
  45.105 + * This scheme breaks down if M < 2, ie, min_DCT_scaled_size is 1.  In that
  45.106 + * situation each iMCU row provides only one row group so the buffering logic
  45.107 + * must be different (eg, we must read two iMCU rows before we can emit the
  45.108 + * first row group).  For now, we simply do not support providing context
  45.109 + * rows when min_DCT_scaled_size is 1.  That combination seems unlikely to
  45.110 + * be worth providing --- if someone wants a 1/8th-size preview, they probably
  45.111 + * want it quick and dirty, so a context-free upsampler is sufficient.
  45.112 + */
  45.113 +
  45.114 +
  45.115 +/* Private buffer controller object */
  45.116 +
  45.117 +typedef struct {
  45.118 +  struct jpeg_d_main_controller pub; /* public fields */
  45.119 +
  45.120 +  /* Pointer to allocated workspace (M or M+2 row groups). */
  45.121 +  JSAMPARRAY buffer[MAX_COMPONENTS];
  45.122 +
  45.123 +  boolean buffer_full;		/* Have we gotten an iMCU row from decoder? */
  45.124 +  JDIMENSION rowgroup_ctr;	/* counts row groups output to postprocessor */
  45.125 +
  45.126 +  /* Remaining fields are only used in the context case. */
  45.127 +
  45.128 +  /* These are the master pointers to the funny-order pointer lists. */
  45.129 +  JSAMPIMAGE xbuffer[2];	/* pointers to weird pointer lists */
  45.130 +
  45.131 +  int whichptr;			/* indicates which pointer set is now in use */
  45.132 +  int context_state;		/* process_data state machine status */
  45.133 +  JDIMENSION rowgroups_avail;	/* row groups available to postprocessor */
  45.134 +  JDIMENSION iMCU_row_ctr;	/* counts iMCU rows to detect image top/bot */
  45.135 +} my_main_controller;
  45.136 +
  45.137 +typedef my_main_controller * my_main_ptr;
  45.138 +
  45.139 +/* context_state values: */
  45.140 +#define CTX_PREPARE_FOR_IMCU	0	/* need to prepare for MCU row */
  45.141 +#define CTX_PROCESS_IMCU	1	/* feeding iMCU to postprocessor */
  45.142 +#define CTX_POSTPONED_ROW	2	/* feeding postponed row group */
  45.143 +
  45.144 +
  45.145 +/* Forward declarations */
  45.146 +METHODDEF(void) process_data_simple_main
  45.147 +	JPP((j_decompress_ptr cinfo, JSAMPARRAY output_buf,
  45.148 +	     JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail));
  45.149 +METHODDEF(void) process_data_context_main
  45.150 +	JPP((j_decompress_ptr cinfo, JSAMPARRAY output_buf,
  45.151 +	     JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail));
  45.152 +#ifdef QUANT_2PASS_SUPPORTED
  45.153 +METHODDEF(void) process_data_crank_post
  45.154 +	JPP((j_decompress_ptr cinfo, JSAMPARRAY output_buf,
  45.155 +	     JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail));
  45.156 +#endif
  45.157 +
  45.158 +
  45.159 +LOCAL(void)
  45.160 +alloc_funny_pointers (j_decompress_ptr cinfo)
  45.161 +/* Allocate space for the funny pointer lists.
  45.162 + * This is done only once, not once per pass.
  45.163 + */
  45.164 +{
  45.165 +  my_main_ptr main = (my_main_ptr) cinfo->main;
  45.166 +  int ci, rgroup;
  45.167 +  int M = cinfo->min_DCT_scaled_size;
  45.168 +  jpeg_component_info *compptr;
  45.169 +  JSAMPARRAY xbuf;
  45.170 +
  45.171 +  /* Get top-level space for component array pointers.
  45.172 +   * We alloc both arrays with one call to save a few cycles.
  45.173 +   */
  45.174 +  main->xbuffer[0] = (JSAMPIMAGE)
  45.175 +    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
  45.176 +				cinfo->num_components * 2 * SIZEOF(JSAMPARRAY));
  45.177 +  main->xbuffer[1] = main->xbuffer[0] + cinfo->num_components;
  45.178 +
  45.179 +  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  45.180 +       ci++, compptr++) {
  45.181 +    rgroup = (compptr->v_samp_factor * compptr->DCT_scaled_size) /
  45.182 +      cinfo->min_DCT_scaled_size; /* height of a row group of component */
  45.183 +    /* Get space for pointer lists --- M+4 row groups in each list.
  45.184 +     * We alloc both pointer lists with one call to save a few cycles.
  45.185 +     */
  45.186 +    xbuf = (JSAMPARRAY)
  45.187 +      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
  45.188 +				  2 * (rgroup * (M + 4)) * SIZEOF(JSAMPROW));
  45.189 +    xbuf += rgroup;		/* want one row group at negative offsets */
  45.190 +    main->xbuffer[0][ci] = xbuf;
  45.191 +    xbuf += rgroup * (M + 4);
  45.192 +    main->xbuffer[1][ci] = xbuf;
  45.193 +  }
  45.194 +}
  45.195 +
  45.196 +
  45.197 +LOCAL(void)
  45.198 +make_funny_pointers (j_decompress_ptr cinfo)
  45.199 +/* Create the funny pointer lists discussed in the comments above.
  45.200 + * The actual workspace is already allocated (in main->buffer),
  45.201 + * and the space for the pointer lists is allocated too.
  45.202 + * This routine just fills in the curiously ordered lists.
  45.203 + * This will be repeated at the beginning of each pass.
  45.204 + */
  45.205 +{
  45.206 +  my_main_ptr main = (my_main_ptr) cinfo->main;
  45.207 +  int ci, i, rgroup;
  45.208 +  int M = cinfo->min_DCT_scaled_size;
  45.209 +  jpeg_component_info *compptr;
  45.210 +  JSAMPARRAY buf, xbuf0, xbuf1;
  45.211 +
  45.212 +  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  45.213 +       ci++, compptr++) {
  45.214 +    rgroup = (compptr->v_samp_factor * compptr->DCT_scaled_size) /
  45.215 +      cinfo->min_DCT_scaled_size; /* height of a row group of component */
  45.216 +    xbuf0 = main->xbuffer[0][ci];
  45.217 +    xbuf1 = main->xbuffer[1][ci];
  45.218 +    /* First copy the workspace pointers as-is */
  45.219 +    buf = main->buffer[ci];
  45.220 +    for (i = 0; i < rgroup * (M + 2); i++) {
  45.221 +      xbuf0[i] = xbuf1[i] = buf[i];
  45.222 +    }
  45.223 +    /* In the second list, put the last four row groups in swapped order */
  45.224 +    for (i = 0; i < rgroup * 2; i++) {
  45.225 +      xbuf1[rgroup*(M-2) + i] = buf[rgroup*M + i];
  45.226 +      xbuf1[rgroup*M + i] = buf[rgroup*(M-2) + i];
  45.227 +    }
  45.228 +    /* The wraparound pointers at top and bottom will be filled later
  45.229 +     * (see set_wraparound_pointers, below).  Initially we want the "above"
  45.230 +     * pointers to duplicate the first actual data line.  This only needs
  45.231 +     * to happen in xbuffer[0].
  45.232 +     */
  45.233 +    for (i = 0; i < rgroup; i++) {
  45.234 +      xbuf0[i - rgroup] = xbuf0[0];
  45.235 +    }
  45.236 +  }
  45.237 +}
  45.238 +
  45.239 +
  45.240 +LOCAL(void)
  45.241 +set_wraparound_pointers (j_decompress_ptr cinfo)
  45.242 +/* Set up the "wraparound" pointers at top and bottom of the pointer lists.
  45.243 + * This changes the pointer list state from top-of-image to the normal state.
  45.244 + */
  45.245 +{
  45.246 +  my_main_ptr main = (my_main_ptr) cinfo->main;
  45.247 +  int ci, i, rgroup;
  45.248 +  int M = cinfo->min_DCT_scaled_size;
  45.249 +  jpeg_component_info *compptr;
  45.250 +  JSAMPARRAY xbuf0, xbuf1;
  45.251 +
  45.252 +  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  45.253 +       ci++, compptr++) {
  45.254 +    rgroup = (compptr->v_samp_factor * compptr->DCT_scaled_size) /
  45.255 +      cinfo->min_DCT_scaled_size; /* height of a row group of component */
  45.256 +    xbuf0 = main->xbuffer[0][ci];
  45.257 +    xbuf1 = main->xbuffer[1][ci];
  45.258 +    for (i = 0; i < rgroup; i++) {
  45.259 +      xbuf0[i - rgroup] = xbuf0[rgroup*(M+1) + i];
  45.260 +      xbuf1[i - rgroup] = xbuf1[rgroup*(M+1) + i];
  45.261 +      xbuf0[rgroup*(M+2) + i] = xbuf0[i];
  45.262 +      xbuf1[rgroup*(M+2) + i] = xbuf1[i];
  45.263 +    }
  45.264 +  }
  45.265 +}
  45.266 +
  45.267 +
  45.268 +LOCAL(void)
  45.269 +set_bottom_pointers (j_decompress_ptr cinfo)
  45.270 +/* Change the pointer lists to duplicate the last sample row at the bottom
  45.271 + * of the image.  whichptr indicates which xbuffer holds the final iMCU row.
  45.272 + * Also sets rowgroups_avail to indicate number of nondummy row groups in row.
  45.273 + */
  45.274 +{
  45.275 +  my_main_ptr main = (my_main_ptr) cinfo->main;
  45.276 +  int ci, i, rgroup, iMCUheight, rows_left;
  45.277 +  jpeg_component_info *compptr;
  45.278 +  JSAMPARRAY xbuf;
  45.279 +
  45.280 +  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  45.281 +       ci++, compptr++) {
  45.282 +    /* Count sample rows in one iMCU row and in one row group */
  45.283 +    iMCUheight = compptr->v_samp_factor * compptr->DCT_scaled_size;
  45.284 +    rgroup = iMCUheight / cinfo->min_DCT_scaled_size;
  45.285 +    /* Count nondummy sample rows remaining for this component */
  45.286 +    rows_left = (int) (compptr->downsampled_height % (JDIMENSION) iMCUheight);
  45.287 +    if (rows_left == 0) rows_left = iMCUheight;
  45.288 +    /* Count nondummy row groups.  Should get same answer for each component,
  45.289 +     * so we need only do it once.
  45.290 +     */
  45.291 +    if (ci == 0) {
  45.292 +      main->rowgroups_avail = (JDIMENSION) ((rows_left-1) / rgroup + 1);
  45.293 +    }
  45.294 +    /* Duplicate the last real sample row rgroup*2 times; this pads out the
  45.295 +     * last partial rowgroup and ensures at least one full rowgroup of context.
  45.296 +     */
  45.297 +    xbuf = main->xbuffer[main->whichptr][ci];
  45.298 +    for (i = 0; i < rgroup * 2; i++) {
  45.299 +      xbuf[rows_left + i] = xbuf[rows_left-1];
  45.300 +    }
  45.301 +  }
  45.302 +}
  45.303 +
  45.304 +
  45.305 +/*
  45.306 + * Initialize for a processing pass.
  45.307 + */
  45.308 +
  45.309 +METHODDEF(void)
  45.310 +start_pass_main (j_decompress_ptr cinfo, J_BUF_MODE pass_mode)
  45.311 +{
  45.312 +  my_main_ptr main = (my_main_ptr) cinfo->main;
  45.313 +
  45.314 +  switch (pass_mode) {
  45.315 +  case JBUF_PASS_THRU:
  45.316 +    if (cinfo->upsample->need_context_rows) {
  45.317 +      main->pub.process_data = process_data_context_main;
  45.318 +      make_funny_pointers(cinfo); /* Create the xbuffer[] lists */
  45.319 +      main->whichptr = 0;	/* Read first iMCU row into xbuffer[0] */
  45.320 +      main->context_state = CTX_PREPARE_FOR_IMCU;
  45.321 +      main->iMCU_row_ctr = 0;
  45.322 +    } else {
  45.323 +      /* Simple case with no context needed */
  45.324 +      main->pub.process_data = process_data_simple_main;
  45.325 +    }
  45.326 +    main->buffer_full = FALSE;	/* Mark buffer empty */
  45.327 +    main->rowgroup_ctr = 0;
  45.328 +    break;
  45.329 +#ifdef QUANT_2PASS_SUPPORTED
  45.330 +  case JBUF_CRANK_DEST:
  45.331 +    /* For last pass of 2-pass quantization, just crank the postprocessor */
  45.332 +    main->pub.process_data = process_data_crank_post;
  45.333 +    break;
  45.334 +#endif
  45.335 +  default:
  45.336 +    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
  45.337 +    break;
  45.338 +  }
  45.339 +}
  45.340 +
  45.341 +
  45.342 +/*
  45.343 + * Process some data.
  45.344 + * This handles the simple case where no context is required.
  45.345 + */
  45.346 +
  45.347 +METHODDEF(void)
  45.348 +process_data_simple_main (j_decompress_ptr cinfo,
  45.349 +			  JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
  45.350 +			  JDIMENSION out_rows_avail)
  45.351 +{
  45.352 +  my_main_ptr main = (my_main_ptr) cinfo->main;
  45.353 +  JDIMENSION rowgroups_avail;
  45.354 +
  45.355 +  /* Read input data if we haven't filled the main buffer yet */
  45.356 +  if (! main->buffer_full) {
  45.357 +    if (! (*cinfo->coef->decompress_data) (cinfo, main->buffer))
  45.358 +      return;			/* suspension forced, can do nothing more */
  45.359 +    main->buffer_full = TRUE;	/* OK, we have an iMCU row to work with */
  45.360 +  }
  45.361 +
  45.362 +  /* There are always min_DCT_scaled_size row groups in an iMCU row. */
  45.363 +  rowgroups_avail = (JDIMENSION) cinfo->min_DCT_scaled_size;
  45.364 +  /* Note: at the bottom of the image, we may pass extra garbage row groups
  45.365 +   * to the postprocessor.  The postprocessor has to check for bottom
  45.366 +   * of image anyway (at row resolution), so no point in us doing it too.
  45.367 +   */
  45.368 +
  45.369 +  /* Feed the postprocessor */
  45.370 +  (*cinfo->post->post_process_data) (cinfo, main->buffer,
  45.371 +				     &main->rowgroup_ctr, rowgroups_avail,
  45.372 +				     output_buf, out_row_ctr, out_rows_avail);
  45.373 +
  45.374 +  /* Has postprocessor consumed all the data yet? If so, mark buffer empty */
  45.375 +  if (main->rowgroup_ctr >= rowgroups_avail) {
  45.376 +    main->buffer_full = FALSE;
  45.377 +    main->rowgroup_ctr = 0;
  45.378 +  }
  45.379 +}
  45.380 +
  45.381 +
  45.382 +/*
  45.383 + * Process some data.
  45.384 + * This handles the case where context rows must be provided.
  45.385 + */
  45.386 +
  45.387 +METHODDEF(void)
  45.388 +process_data_context_main (j_decompress_ptr cinfo,
  45.389 +			   JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
  45.390 +			   JDIMENSION out_rows_avail)
  45.391 +{
  45.392 +  my_main_ptr main = (my_main_ptr) cinfo->main;
  45.393 +
  45.394 +  /* Read input data if we haven't filled the main buffer yet */
  45.395 +  if (! main->buffer_full) {
  45.396 +    if (! (*cinfo->coef->decompress_data) (cinfo,
  45.397 +					   main->xbuffer[main->whichptr]))
  45.398 +      return;			/* suspension forced, can do nothing more */
  45.399 +    main->buffer_full = TRUE;	/* OK, we have an iMCU row to work with */
  45.400 +    main->iMCU_row_ctr++;	/* count rows received */
  45.401 +  }
  45.402 +
  45.403 +  /* Postprocessor typically will not swallow all the input data it is handed
  45.404 +   * in one call (due to filling the output buffer first).  Must be prepared
  45.405 +   * to exit and restart.  This switch lets us keep track of how far we got.
  45.406 +   * Note that each case falls through to the next on successful completion.
  45.407 +   */
  45.408 +  switch (main->context_state) {
  45.409 +  case CTX_POSTPONED_ROW:
  45.410 +    /* Call postprocessor using previously set pointers for postponed row */
  45.411 +    (*cinfo->post->post_process_data) (cinfo, main->xbuffer[main->whichptr],
  45.412 +			&main->rowgroup_ctr, main->rowgroups_avail,
  45.413 +			output_buf, out_row_ctr, out_rows_avail);
  45.414 +    if (main->rowgroup_ctr < main->rowgroups_avail)
  45.415 +      return;			/* Need to suspend */
  45.416 +    main->context_state = CTX_PREPARE_FOR_IMCU;
  45.417 +    if (*out_row_ctr >= out_rows_avail)
  45.418 +      return;			/* Postprocessor exactly filled output buf */
  45.419 +    /*FALLTHROUGH*/
  45.420 +  case CTX_PREPARE_FOR_IMCU:
  45.421 +    /* Prepare to process first M-1 row groups of this iMCU row */
  45.422 +    main->rowgroup_ctr = 0;
  45.423 +    main->rowgroups_avail = (JDIMENSION) (cinfo->min_DCT_scaled_size - 1);
  45.424 +    /* Check for bottom of image: if so, tweak pointers to "duplicate"
  45.425 +     * the last sample row, and adjust rowgroups_avail to ignore padding rows.
  45.426 +     */
  45.427 +    if (main->iMCU_row_ctr == cinfo->total_iMCU_rows)
  45.428 +      set_bottom_pointers(cinfo);
  45.429 +    main->context_state = CTX_PROCESS_IMCU;
  45.430 +    /*FALLTHROUGH*/
  45.431 +  case CTX_PROCESS_IMCU:
  45.432 +    /* Call postprocessor using previously set pointers */
  45.433 +    (*cinfo->post->post_process_data) (cinfo, main->xbuffer[main->whichptr],
  45.434 +			&main->rowgroup_ctr, main->rowgroups_avail,
  45.435 +			output_buf, out_row_ctr, out_rows_avail);
  45.436 +    if (main->rowgroup_ctr < main->rowgroups_avail)
  45.437 +      return;			/* Need to suspend */
  45.438 +    /* After the first iMCU, change wraparound pointers to normal state */
  45.439 +    if (main->iMCU_row_ctr == 1)
  45.440 +      set_wraparound_pointers(cinfo);
  45.441 +    /* Prepare to load new iMCU row using other xbuffer list */
  45.442 +    main->whichptr ^= 1;	/* 0=>1 or 1=>0 */
  45.443 +    main->buffer_full = FALSE;
  45.444 +    /* Still need to process last row group of this iMCU row, */
  45.445 +    /* which is saved at index M+1 of the other xbuffer */
  45.446 +    main->rowgroup_ctr = (JDIMENSION) (cinfo->min_DCT_scaled_size + 1);
  45.447 +    main->rowgroups_avail = (JDIMENSION) (cinfo->min_DCT_scaled_size + 2);
  45.448 +    main->context_state = CTX_POSTPONED_ROW;
  45.449 +  }
  45.450 +}
  45.451 +
  45.452 +
  45.453 +/*
  45.454 + * Process some data.
  45.455 + * Final pass of two-pass quantization: just call the postprocessor.
  45.456 + * Source data will be the postprocessor controller's internal buffer.
  45.457 + */
  45.458 +
  45.459 +#ifdef QUANT_2PASS_SUPPORTED
  45.460 +
  45.461 +METHODDEF(void)
  45.462 +process_data_crank_post (j_decompress_ptr cinfo,
  45.463 +			 JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
  45.464 +			 JDIMENSION out_rows_avail)
  45.465 +{
  45.466 +  (*cinfo->post->post_process_data) (cinfo, (JSAMPIMAGE) NULL,
  45.467 +				     (JDIMENSION *) NULL, (JDIMENSION) 0,
  45.468 +				     output_buf, out_row_ctr, out_rows_avail);
  45.469 +}
  45.470 +
  45.471 +#endif /* QUANT_2PASS_SUPPORTED */
  45.472 +
  45.473 +
  45.474 +/*
  45.475 + * Initialize main buffer controller.
  45.476 + */
  45.477 +
  45.478 +GLOBAL(void)
  45.479 +jinit_d_main_controller (j_decompress_ptr cinfo, boolean need_full_buffer)
  45.480 +{
  45.481 +  my_main_ptr main;
  45.482 +  int ci, rgroup, ngroups;
  45.483 +  jpeg_component_info *compptr;
  45.484 +
  45.485 +  main = (my_main_ptr)
  45.486 +    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
  45.487 +				SIZEOF(my_main_controller));
  45.488 +  cinfo->main = (struct jpeg_d_main_controller *) main;
  45.489 +  main->pub.start_pass = start_pass_main;
  45.490 +
  45.491 +  if (need_full_buffer)		/* shouldn't happen */
  45.492 +    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
  45.493 +
  45.494 +  /* Allocate the workspace.
  45.495 +   * ngroups is the number of row groups we need.
  45.496 +   */
  45.497 +  if (cinfo->upsample->need_context_rows) {
  45.498 +    if (cinfo->min_DCT_scaled_size < 2) /* unsupported, see comments above */
  45.499 +      ERREXIT(cinfo, JERR_NOTIMPL);
  45.500 +    alloc_funny_pointers(cinfo); /* Alloc space for xbuffer[] lists */
  45.501 +    ngroups = cinfo->min_DCT_scaled_size + 2;
  45.502 +  } else {
  45.503 +    ngroups = cinfo->min_DCT_scaled_size;
  45.504 +  }
  45.505 +
  45.506 +  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  45.507 +       ci++, compptr++) {
  45.508 +    rgroup = (compptr->v_samp_factor * compptr->DCT_scaled_size) /
  45.509 +      cinfo->min_DCT_scaled_size; /* height of a row group of component */
  45.510 +    main->buffer[ci] = (*cinfo->mem->alloc_sarray)
  45.511 +			((j_common_ptr) cinfo, JPOOL_IMAGE,
  45.512 +			 compptr->width_in_blocks * compptr->DCT_scaled_size,
  45.513 +			 (JDIMENSION) (rgroup * ngroups));
  45.514 +  }
  45.515 +}
    46.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    46.2 +++ b/libs/libjpeg/jdmarker.c	Sun Nov 01 00:36:56 2015 +0200
    46.3 @@ -0,0 +1,1360 @@
    46.4 +/*
    46.5 + * jdmarker.c
    46.6 + *
    46.7 + * Copyright (C) 1991-1998, Thomas G. Lane.
    46.8 + * This file is part of the Independent JPEG Group's software.
    46.9 + * For conditions of distribution and use, see the accompanying README file.
   46.10 + *
   46.11 + * This file contains routines to decode JPEG datastream markers.
   46.12 + * Most of the complexity arises from our desire to support input
   46.13 + * suspension: if not all of the data for a marker is available,
   46.14 + * we must exit back to the application.  On resumption, we reprocess
   46.15 + * the marker.
   46.16 + */
   46.17 +
   46.18 +#define JPEG_INTERNALS
   46.19 +#include "jinclude.h"
   46.20 +#include "jpeglib.h"
   46.21 +
   46.22 +
   46.23 +typedef enum {			/* JPEG marker codes */
   46.24 +  M_SOF0  = 0xc0,
   46.25 +  M_SOF1  = 0xc1,
   46.26 +  M_SOF2  = 0xc2,
   46.27 +  M_SOF3  = 0xc3,
   46.28 +  
   46.29 +  M_SOF5  = 0xc5,
   46.30 +  M_SOF6  = 0xc6,
   46.31 +  M_SOF7  = 0xc7,
   46.32 +  
   46.33 +  M_JPG   = 0xc8,
   46.34 +  M_SOF9  = 0xc9,
   46.35 +  M_SOF10 = 0xca,
   46.36 +  M_SOF11 = 0xcb,
   46.37 +  
   46.38 +  M_SOF13 = 0xcd,
   46.39 +  M_SOF14 = 0xce,
   46.40 +  M_SOF15 = 0xcf,
   46.41 +  
   46.42 +  M_DHT   = 0xc4,
   46.43 +  
   46.44 +  M_DAC   = 0xcc,
   46.45 +  
   46.46 +  M_RST0  = 0xd0,
   46.47 +  M_RST1  = 0xd1,
   46.48 +  M_RST2  = 0xd2,
   46.49 +  M_RST3  = 0xd3,
   46.50 +  M_RST4  = 0xd4,
   46.51 +  M_RST5  = 0xd5,
   46.52 +  M_RST6  = 0xd6,
   46.53 +  M_RST7  = 0xd7,
   46.54 +  
   46.55 +  M_SOI   = 0xd8,
   46.56 +  M_EOI   = 0xd9,
   46.57 +  M_SOS   = 0xda,
   46.58 +  M_DQT   = 0xdb,
   46.59 +  M_DNL   = 0xdc,
   46.60 +  M_DRI   = 0xdd,
   46.61 +  M_DHP   = 0xde,
   46.62 +  M_EXP   = 0xdf,
   46.63 +  
   46.64 +  M_APP0  = 0xe0,
   46.65 +  M_APP1  = 0xe1,
   46.66 +  M_APP2  = 0xe2,
   46.67 +  M_APP3  = 0xe3,
   46.68 +  M_APP4  = 0xe4,
   46.69 +  M_APP5  = 0xe5,
   46.70 +  M_APP6  = 0xe6,
   46.71 +  M_APP7  = 0xe7,
   46.72 +  M_APP8  = 0xe8,
   46.73 +  M_APP9  = 0xe9,
   46.74 +  M_APP10 = 0xea,
   46.75 +  M_APP11 = 0xeb,
   46.76 +  M_APP12 = 0xec,
   46.77 +  M_APP13 = 0xed,
   46.78 +  M_APP14 = 0xee,
   46.79 +  M_APP15 = 0xef,
   46.80 +  
   46.81 +  M_JPG0  = 0xf0,
   46.82 +  M_JPG13 = 0xfd,
   46.83 +  M_COM   = 0xfe,
   46.84 +  
   46.85 +  M_TEM   = 0x01,
   46.86 +  
   46.87 +  M_ERROR = 0x100
   46.88 +} JPEG_MARKER;
   46.89 +
   46.90 +
   46.91 +/* Private state */
   46.92 +
   46.93 +typedef struct {
   46.94 +  struct jpeg_marker_reader pub; /* public fields */
   46.95 +
   46.96 +  /* Application-overridable marker processing methods */
   46.97 +  jpeg_marker_parser_method process_COM;
   46.98 +  jpeg_marker_parser_method process_APPn[16];
   46.99 +
  46.100 +  /* Limit on marker data length to save for each marker type */
  46.101 +  unsigned int length_limit_COM;
  46.102 +  unsigned int length_limit_APPn[16];
  46.103 +
  46.104 +  /* Status of COM/APPn marker saving */
  46.105 +  jpeg_saved_marker_ptr cur_marker;	/* NULL if not processing a marker */
  46.106 +  unsigned int bytes_read;		/* data bytes read so far in marker */
  46.107 +  /* Note: cur_marker is not linked into marker_list until it's all read. */
  46.108 +} my_marker_reader;
  46.109 +
  46.110 +typedef my_marker_reader * my_marker_ptr;
  46.111 +
  46.112 +
  46.113 +/*
  46.114 + * Macros for fetching data from the data source module.
  46.115 + *
  46.116 + * At all times, cinfo->src->next_input_byte and ->bytes_in_buffer reflect
  46.117 + * the current restart point; we update them only when we have reached a
  46.118 + * suitable place to restart if a suspension occurs.
  46.119 + */
  46.120 +
  46.121 +/* Declare and initialize local copies of input pointer/count */
  46.122 +#define INPUT_VARS(cinfo)  \
  46.123 +	struct jpeg_source_mgr * datasrc = (cinfo)->src;  \
  46.124 +	const JOCTET * next_input_byte = datasrc->next_input_byte;  \
  46.125 +	size_t bytes_in_buffer = datasrc->bytes_in_buffer
  46.126 +
  46.127 +/* Unload the local copies --- do this only at a restart boundary */
  46.128 +#define INPUT_SYNC(cinfo)  \
  46.129 +	( datasrc->next_input_byte = next_input_byte,  \
  46.130 +	  datasrc->bytes_in_buffer = bytes_in_buffer )
  46.131 +
  46.132 +/* Reload the local copies --- used only in MAKE_BYTE_AVAIL */
  46.133 +#define INPUT_RELOAD(cinfo)  \
  46.134 +	( next_input_byte = datasrc->next_input_byte,  \
  46.135 +	  bytes_in_buffer = datasrc->bytes_in_buffer )
  46.136 +
  46.137 +/* Internal macro for INPUT_BYTE and INPUT_2BYTES: make a byte available.
  46.138 + * Note we do *not* do INPUT_SYNC before calling fill_input_buffer,
  46.139 + * but we must reload the local copies after a successful fill.
  46.140 + */
  46.141 +#define MAKE_BYTE_AVAIL(cinfo,action)  \
  46.142 +	if (bytes_in_buffer == 0) {  \
  46.143 +	  if (! (*datasrc->fill_input_buffer) (cinfo))  \
  46.144 +	    { action; }  \
  46.145 +	  INPUT_RELOAD(cinfo);  \
  46.146 +	}
  46.147 +
  46.148 +/* Read a byte into variable V.
  46.149 + * If must suspend, take the specified action (typically "return FALSE").
  46.150 + */
  46.151 +#define INPUT_BYTE(cinfo,V,action)  \
  46.152 +	MAKESTMT( MAKE_BYTE_AVAIL(cinfo,action); \
  46.153 +		  bytes_in_buffer--; \
  46.154 +		  V = GETJOCTET(*next_input_byte++); )
  46.155 +
  46.156 +/* As above, but read two bytes interpreted as an unsigned 16-bit integer.
  46.157 + * V should be declared unsigned int or perhaps INT32.
  46.158 + */
  46.159 +#define INPUT_2BYTES(cinfo,V,action)  \
  46.160 +	MAKESTMT( MAKE_BYTE_AVAIL(cinfo,action); \
  46.161 +		  bytes_in_buffer--; \
  46.162 +		  V = ((unsigned int) GETJOCTET(*next_input_byte++)) << 8; \
  46.163 +		  MAKE_BYTE_AVAIL(cinfo,action); \
  46.164 +		  bytes_in_buffer--; \
  46.165 +		  V += GETJOCTET(*next_input_byte++); )
  46.166 +
  46.167 +
  46.168 +/*
  46.169 + * Routines to process JPEG markers.
  46.170 + *
  46.171 + * Entry condition: JPEG marker itself has been read and its code saved
  46.172 + *   in cinfo->unread_marker; input restart point is just after the marker.
  46.173 + *
  46.174 + * Exit: if return TRUE, have read and processed any parameters, and have
  46.175 + *   updated the restart point to point after the parameters.
  46.176 + *   If return FALSE, was forced to suspend before reaching end of
  46.177 + *   marker parameters; restart point has not been moved.  Same routine
  46.178 + *   will be called again after application supplies more input data.
  46.179 + *
  46.180 + * This approach to suspension assumes that all of a marker's parameters
  46.181 + * can fit into a single input bufferload.  This should hold for "normal"
  46.182 + * markers.  Some COM/APPn markers might have large parameter segments
  46.183 + * that might not fit.  If we are simply dropping such a marker, we use
  46.184 + * skip_input_data to get past it, and thereby put the problem on the
  46.185 + * source manager's shoulders.  If we are saving the marker's contents
  46.186 + * into memory, we use a slightly different convention: when forced to
  46.187 + * suspend, the marker processor updates the restart point to the end of
  46.188 + * what it's consumed (ie, the end of the buffer) before returning FALSE.
  46.189 + * On resumption, cinfo->unread_marker still contains the marker code,
  46.190 + * but the data source will point to the next chunk of marker data.
  46.191 + * The marker processor must retain internal state to deal with this.
  46.192 + *
  46.193 + * Note that we don't bother to avoid duplicate trace messages if a
  46.194 + * suspension occurs within marker parameters.  Other side effects
  46.195 + * require more care.
  46.196 + */
  46.197 +
  46.198 +
  46.199 +LOCAL(boolean)
  46.200 +get_soi (j_decompress_ptr cinfo)
  46.201 +/* Process an SOI marker */
  46.202 +{
  46.203 +  int i;
  46.204 +  
  46.205 +  TRACEMS(cinfo, 1, JTRC_SOI);
  46.206 +
  46.207 +  if (cinfo->marker->saw_SOI)
  46.208 +    ERREXIT(cinfo, JERR_SOI_DUPLICATE);
  46.209 +
  46.210 +  /* Reset all parameters that are defined to be reset by SOI */
  46.211 +
  46.212 +  for (i = 0; i < NUM_ARITH_TBLS; i++) {
  46.213 +    cinfo->arith_dc_L[i] = 0;
  46.214 +    cinfo->arith_dc_U[i] = 1;
  46.215 +    cinfo->arith_ac_K[i] = 5;
  46.216 +  }
  46.217 +  cinfo->restart_interval = 0;
  46.218 +
  46.219 +  /* Set initial assumptions for colorspace etc */
  46.220 +
  46.221 +  cinfo->jpeg_color_space = JCS_UNKNOWN;
  46.222 +  cinfo->CCIR601_sampling = FALSE; /* Assume non-CCIR sampling??? */
  46.223 +
  46.224 +  cinfo->saw_JFIF_marker = FALSE;
  46.225 +  cinfo->JFIF_major_version = 1; /* set default JFIF APP0 values */
  46.226 +  cinfo->JFIF_minor_version = 1;
  46.227 +  cinfo->density_unit = 0;
  46.228 +  cinfo->X_density = 1;
  46.229 +  cinfo->Y_density = 1;
  46.230 +  cinfo->saw_Adobe_marker = FALSE;
  46.231 +  cinfo->Adobe_transform = 0;
  46.232 +
  46.233 +  cinfo->marker->saw_SOI = TRUE;
  46.234 +
  46.235 +  return TRUE;
  46.236 +}
  46.237 +
  46.238 +
  46.239 +LOCAL(boolean)
  46.240 +get_sof (j_decompress_ptr cinfo, boolean is_prog, boolean is_arith)
  46.241 +/* Process a SOFn marker */
  46.242 +{
  46.243 +  INT32 length;
  46.244 +  int c, ci;
  46.245 +  jpeg_component_info * compptr;
  46.246 +  INPUT_VARS(cinfo);
  46.247 +
  46.248 +  cinfo->progressive_mode = is_prog;
  46.249 +  cinfo->arith_code = is_arith;
  46.250 +
  46.251 +  INPUT_2BYTES(cinfo, length, return FALSE);
  46.252 +
  46.253 +  INPUT_BYTE(cinfo, cinfo->data_precision, return FALSE);
  46.254 +  INPUT_2BYTES(cinfo, cinfo->image_height, return FALSE);
  46.255 +  INPUT_2BYTES(cinfo, cinfo->image_width, return FALSE);
  46.256 +  INPUT_BYTE(cinfo, cinfo->num_components, return FALSE);
  46.257 +
  46.258 +  length -= 8;
  46.259 +
  46.260 +  TRACEMS4(cinfo, 1, JTRC_SOF, cinfo->unread_marker,
  46.261 +	   (int) cinfo->image_width, (int) cinfo->image_height,
  46.262 +	   cinfo->num_components);
  46.263 +
  46.264 +  if (cinfo->marker->saw_SOF)
  46.265 +    ERREXIT(cinfo, JERR_SOF_DUPLICATE);
  46.266 +
  46.267 +  /* We don't support files in which the image height is initially specified */
  46.268 +  /* as 0 and is later redefined by DNL.  As long as we have to check that,  */
  46.269 +  /* might as well have a general sanity check. */
  46.270 +  if (cinfo->image_height <= 0 || cinfo->image_width <= 0
  46.271 +      || cinfo->num_components <= 0)
  46.272 +    ERREXIT(cinfo, JERR_EMPTY_IMAGE);
  46.273 +
  46.274 +  if (length != (cinfo->num_components * 3))
  46.275 +    ERREXIT(cinfo, JERR_BAD_LENGTH);
  46.276 +
  46.277 +  if (cinfo->comp_info == NULL)	/* do only once, even if suspend */
  46.278 +    cinfo->comp_info = (jpeg_component_info *) (*cinfo->mem->alloc_small)
  46.279 +			((j_common_ptr) cinfo, JPOOL_IMAGE,
  46.280 +			 cinfo->num_components * SIZEOF(jpeg_component_info));
  46.281 +  
  46.282 +  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  46.283 +       ci++, compptr++) {
  46.284 +    compptr->component_index = ci;
  46.285 +    INPUT_BYTE(cinfo, compptr->component_id, return FALSE);
  46.286 +    INPUT_BYTE(cinfo, c, return FALSE);
  46.287 +    compptr->h_samp_factor = (c >> 4) & 15;
  46.288 +    compptr->v_samp_factor = (c     ) & 15;
  46.289 +    INPUT_BYTE(cinfo, compptr->quant_tbl_no, return FALSE);
  46.290 +
  46.291 +    TRACEMS4(cinfo, 1, JTRC_SOF_COMPONENT,
  46.292 +	     compptr->component_id, compptr->h_samp_factor,
  46.293 +	     compptr->v_samp_factor, compptr->quant_tbl_no);
  46.294 +  }
  46.295 +
  46.296 +  cinfo->marker->saw_SOF = TRUE;
  46.297 +
  46.298 +  INPUT_SYNC(cinfo);
  46.299 +  return TRUE;
  46.300 +}
  46.301 +
  46.302 +
  46.303 +LOCAL(boolean)
  46.304 +get_sos (j_decompress_ptr cinfo)
  46.305 +/* Process a SOS marker */
  46.306 +{
  46.307 +  INT32 length;
  46.308 +  int i, ci, n, c, cc;
  46.309 +  jpeg_component_info * compptr;
  46.310 +  INPUT_VARS(cinfo);
  46.311 +
  46.312 +  if (! cinfo->marker->saw_SOF)
  46.313 +    ERREXIT(cinfo, JERR_SOS_NO_SOF);
  46.314 +
  46.315 +  INPUT_2BYTES(cinfo, length, return FALSE);
  46.316 +
  46.317 +  INPUT_BYTE(cinfo, n, return FALSE); /* Number of components */
  46.318 +
  46.319 +  TRACEMS1(cinfo, 1, JTRC_SOS, n);
  46.320 +
  46.321 +  if (length != (n * 2 + 6) || n < 1 || n > MAX_COMPS_IN_SCAN)
  46.322 +    ERREXIT(cinfo, JERR_BAD_LENGTH);
  46.323 +
  46.324 +  cinfo->comps_in_scan = n;
  46.325 +
  46.326 +  /* Collect the component-spec parameters */
  46.327 +
  46.328 +  for (i = 0; i < n; i++) {
  46.329 +    INPUT_BYTE(cinfo, cc, return FALSE);
  46.330 +    INPUT_BYTE(cinfo, c, return FALSE);
  46.331 +    
  46.332 +    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  46.333 +	 ci++, compptr++) {
  46.334 +      if (cc == compptr->component_id)
  46.335 +	goto id_found;
  46.336 +    }
  46.337 +
  46.338 +    ERREXIT1(cinfo, JERR_BAD_COMPONENT_ID, cc);
  46.339 +
  46.340 +  id_found:
  46.341 +
  46.342 +    cinfo->cur_comp_info[i] = compptr;
  46.343 +    compptr->dc_tbl_no = (c >> 4) & 15;
  46.344 +    compptr->ac_tbl_no = (c     ) & 15;
  46.345 +    
  46.346 +    TRACEMS3(cinfo, 1, JTRC_SOS_COMPONENT, cc,
  46.347 +	     compptr->dc_tbl_no, compptr->ac_tbl_no);
  46.348 +  }
  46.349 +
  46.350 +  /* Collect the additional scan parameters Ss, Se, Ah/Al. */
  46.351 +  INPUT_BYTE(cinfo, c, return FALSE);
  46.352 +  cinfo->Ss = c;
  46.353 +  INPUT_BYTE(cinfo, c, return FALSE);
  46.354 +  cinfo->Se = c;
  46.355 +  INPUT_BYTE(cinfo, c, return FALSE);
  46.356 +  cinfo->Ah = (c >> 4) & 15;
  46.357 +  cinfo->Al = (c     ) & 15;
  46.358 +
  46.359 +  TRACEMS4(cinfo, 1, JTRC_SOS_PARAMS, cinfo->Ss, cinfo->Se,
  46.360 +	   cinfo->Ah, cinfo->Al);
  46.361 +
  46.362 +  /* Prepare to scan data & restart markers */
  46.363 +  cinfo->marker->next_restart_num = 0;
  46.364 +
  46.365 +  /* Count another SOS marker */
  46.366 +  cinfo->input_scan_number++;
  46.367 +
  46.368 +  INPUT_SYNC(cinfo);
  46.369 +  return TRUE;
  46.370 +}
  46.371 +
  46.372 +
  46.373 +#ifdef D_ARITH_CODING_SUPPORTED
  46.374 +
  46.375 +LOCAL(boolean)
  46.376 +get_dac (j_decompress_ptr cinfo)
  46.377 +/* Process a DAC marker */
  46.378 +{
  46.379 +  INT32 length;
  46.380 +  int index, val;
  46.381 +  INPUT_VARS(cinfo);
  46.382 +
  46.383 +  INPUT_2BYTES(cinfo, length, return FALSE);
  46.384 +  length -= 2;
  46.385 +  
  46.386 +  while (length > 0) {
  46.387 +    INPUT_BYTE(cinfo, index, return FALSE);
  46.388 +    INPUT_BYTE(cinfo, val, return FALSE);
  46.389 +
  46.390 +    length -= 2;
  46.391 +
  46.392 +    TRACEMS2(cinfo, 1, JTRC_DAC, index, val);
  46.393 +
  46.394 +    if (index < 0 || index >= (2*NUM_ARITH_TBLS))
  46.395 +      ERREXIT1(cinfo, JERR_DAC_INDEX, index);
  46.396 +
  46.397 +    if (index >= NUM_ARITH_TBLS) { /* define AC table */
  46.398 +      cinfo->arith_ac_K[index-NUM_ARITH_TBLS] = (UINT8) val;
  46.399 +    } else {			/* define DC table */
  46.400 +      cinfo->arith_dc_L[index] = (UINT8) (val & 0x0F);
  46.401 +      cinfo->arith_dc_U[index] = (UINT8) (val >> 4);
  46.402 +      if (cinfo->arith_dc_L[index] > cinfo->arith_dc_U[index])
  46.403 +	ERREXIT1(cinfo, JERR_DAC_VALUE, val);
  46.404 +    }
  46.405 +  }
  46.406 +
  46.407 +  if (length != 0)
  46.408 +    ERREXIT(cinfo, JERR_BAD_LENGTH);
  46.409 +
  46.410 +  INPUT_SYNC(cinfo);
  46.411 +  return TRUE;
  46.412 +}
  46.413 +
  46.414 +#else /* ! D_ARITH_CODING_SUPPORTED */
  46.415 +
  46.416 +#define get_dac(cinfo)  skip_variable(cinfo)
  46.417 +
  46.418 +#endif /* D_ARITH_CODING_SUPPORTED */
  46.419 +
  46.420 +
  46.421 +LOCAL(boolean)
  46.422 +get_dht (j_decompress_ptr cinfo)
  46.423 +/* Process a DHT marker */
  46.424 +{
  46.425 +  INT32 length;
  46.426 +  UINT8 bits[17];
  46.427 +  UINT8 huffval[256];
  46.428 +  int i, index, count;
  46.429 +  JHUFF_TBL **htblptr;
  46.430 +  INPUT_VARS(cinfo);
  46.431 +
  46.432 +  INPUT_2BYTES(cinfo, length, return FALSE);
  46.433 +  length -= 2;
  46.434 +  
  46.435 +  while (length > 16) {
  46.436 +    INPUT_BYTE(cinfo, index, return FALSE);
  46.437 +
  46.438 +    TRACEMS1(cinfo, 1, JTRC_DHT, index);
  46.439 +      
  46.440 +    bits[0] = 0;
  46.441 +    count = 0;
  46.442 +    for (i = 1; i <= 16; i++) {
  46.443 +      INPUT_BYTE(cinfo, bits[i], return FALSE);
  46.444 +      count += bits[i];
  46.445 +    }
  46.446 +
  46.447 +    length -= 1 + 16;
  46.448 +
  46.449 +    TRACEMS8(cinfo, 2, JTRC_HUFFBITS,
  46.450 +	     bits[1], bits[2], bits[3], bits[4],
  46.451 +	     bits[5], bits[6], bits[7], bits[8]);
  46.452 +    TRACEMS8(cinfo, 2, JTRC_HUFFBITS,
  46.453 +	     bits[9], bits[10], bits[11], bits[12],
  46.454 +	     bits[13], bits[14], bits[15], bits[16]);
  46.455 +
  46.456 +    /* Here we just do minimal validation of the counts to avoid walking
  46.457 +     * off the end of our table space.  jdhuff.c will check more carefully.
  46.458 +     */
  46.459 +    if (count > 256 || ((INT32) count) > length)
  46.460 +      ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
  46.461 +
  46.462 +    for (i = 0; i < count; i++)
  46.463 +      INPUT_BYTE(cinfo, huffval[i], return FALSE);
  46.464 +
  46.465 +    length -= count;
  46.466 +
  46.467 +    if (index & 0x10) {		/* AC table definition */
  46.468 +      index -= 0x10;
  46.469 +      htblptr = &cinfo->ac_huff_tbl_ptrs[index];
  46.470 +    } else {			/* DC table definition */
  46.471 +      htblptr = &cinfo->dc_huff_tbl_ptrs[index];
  46.472 +    }
  46.473 +
  46.474 +    if (index < 0 || index >= NUM_HUFF_TBLS)
  46.475 +      ERREXIT1(cinfo, JERR_DHT_INDEX, index);
  46.476 +
  46.477 +    if (*htblptr == NULL)
  46.478 +      *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);
  46.479 +  
  46.480 +    MEMCOPY((*htblptr)->bits, bits, SIZEOF((*htblptr)->bits));
  46.481 +    MEMCOPY((*htblptr)->huffval, huffval, SIZEOF((*htblptr)->huffval));
  46.482 +  }
  46.483 +
  46.484 +  if (length != 0)
  46.485 +    ERREXIT(cinfo, JERR_BAD_LENGTH);
  46.486 +
  46.487 +  INPUT_SYNC(cinfo);
  46.488 +  return TRUE;
  46.489 +}
  46.490 +
  46.491 +
  46.492 +LOCAL(boolean)
  46.493 +get_dqt (j_decompress_ptr cinfo)
  46.494 +/* Process a DQT marker */
  46.495 +{
  46.496 +  INT32 length;
  46.497 +  int n, i, prec;
  46.498 +  unsigned int tmp;
  46.499 +  JQUANT_TBL *quant_ptr;
  46.500 +  INPUT_VARS(cinfo);
  46.501 +
  46.502 +  INPUT_2BYTES(cinfo, length, return FALSE);
  46.503 +  length -= 2;
  46.504 +
  46.505 +  while (length > 0) {
  46.506 +    INPUT_BYTE(cinfo, n, return FALSE);
  46.507 +    prec = n >> 4;
  46.508 +    n &= 0x0F;
  46.509 +
  46.510 +    TRACEMS2(cinfo, 1, JTRC_DQT, n, prec);
  46.511 +
  46.512 +    if (n >= NUM_QUANT_TBLS)
  46.513 +      ERREXIT1(cinfo, JERR_DQT_INDEX, n);
  46.514 +      
  46.515 +    if (cinfo->quant_tbl_ptrs[n] == NULL)
  46.516 +      cinfo->quant_tbl_ptrs[n] = jpeg_alloc_quant_table((j_common_ptr) cinfo);
  46.517 +    quant_ptr = cinfo->quant_tbl_ptrs[n];
  46.518 +
  46.519 +    for (i = 0; i < DCTSIZE2; i++) {
  46.520 +      if (prec)
  46.521 +	INPUT_2BYTES(cinfo, tmp, return FALSE);
  46.522 +      else
  46.523 +	INPUT_BYTE(cinfo, tmp, return FALSE);
  46.524 +      /* We convert the zigzag-order table to natural array order. */
  46.525 +      quant_ptr->quantval[jpeg_natural_order[i]] = (UINT16) tmp;
  46.526 +    }
  46.527 +
  46.528 +    if (cinfo->err->trace_level >= 2) {
  46.529 +      for (i = 0; i < DCTSIZE2; i += 8) {
  46.530 +	TRACEMS8(cinfo, 2, JTRC_QUANTVALS,
  46.531 +		 quant_ptr->quantval[i],   quant_ptr->quantval[i+1],
  46.532 +		 quant_ptr->quantval[i+2], quant_ptr->quantval[i+3],
  46.533 +		 quant_ptr->quantval[i+4], quant_ptr->quantval[i+5],
  46.534 +		 quant_ptr->quantval[i+6], quant_ptr->quantval[i+7]);
  46.535 +      }
  46.536 +    }
  46.537 +
  46.538 +    length -= DCTSIZE2+1;
  46.539 +    if (prec) length -= DCTSIZE2;
  46.540 +  }
  46.541 +
  46.542 +  if (length != 0)
  46.543 +    ERREXIT(cinfo, JERR_BAD_LENGTH);
  46.544 +
  46.545 +  INPUT_SYNC(cinfo);
  46.546 +  return TRUE;
  46.547 +}
  46.548 +
  46.549 +
  46.550 +LOCAL(boolean)
  46.551 +get_dri (j_decompress_ptr cinfo)
  46.552 +/* Process a DRI marker */
  46.553 +{
  46.554 +  INT32 length;
  46.555 +  unsigned int tmp;
  46.556 +  INPUT_VARS(cinfo);
  46.557 +
  46.558 +  INPUT_2BYTES(cinfo, length, return FALSE);
  46.559 +  
  46.560 +  if (length != 4)
  46.561 +    ERREXIT(cinfo, JERR_BAD_LENGTH);
  46.562 +
  46.563 +  INPUT_2BYTES(cinfo, tmp, return FALSE);
  46.564 +
  46.565 +  TRACEMS1(cinfo, 1, JTRC_DRI, tmp);
  46.566 +
  46.567 +  cinfo->restart_interval = tmp;
  46.568 +
  46.569 +  INPUT_SYNC(cinfo);
  46.570 +  return TRUE;
  46.571 +}
  46.572 +
  46.573 +
  46.574 +/*
  46.575 + * Routines for processing APPn and COM markers.
  46.576 + * These are either saved in memory or discarded, per application request.
  46.577 + * APP0 and APP14 are specially checked to see if they are
  46.578 + * JFIF and Adobe markers, respectively.
  46.579 + */
  46.580 +
  46.581 +#define APP0_DATA_LEN	14	/* Length of interesting data in APP0 */
  46.582 +#define APP14_DATA_LEN	12	/* Length of interesting data in APP14 */
  46.583 +#define APPN_DATA_LEN	14	/* Must be the largest of the above!! */
  46.584 +
  46.585 +
  46.586 +LOCAL(void)
  46.587 +examine_app0 (j_decompress_ptr cinfo, JOCTET FAR * data,
  46.588 +	      unsigned int datalen, INT32 remaining)
  46.589 +/* Examine first few bytes from an APP0.
  46.590 + * Take appropriate action if it is a JFIF marker.
  46.591 + * datalen is # of bytes at data[], remaining is length of rest of marker data.
  46.592 + */
  46.593 +{
  46.594 +  INT32 totallen = (INT32) datalen + remaining;
  46.595 +
  46.596 +  if (datalen >= APP0_DATA_LEN &&
  46.597 +      GETJOCTET(data[0]) == 0x4A &&
  46.598 +      GETJOCTET(data[1]) == 0x46 &&
  46.599 +      GETJOCTET(data[2]) == 0x49 &&
  46.600 +      GETJOCTET(data[3]) == 0x46 &&
  46.601 +      GETJOCTET(data[4]) == 0) {
  46.602 +    /* Found JFIF APP0 marker: save info */
  46.603 +    cinfo->saw_JFIF_marker = TRUE;
  46.604 +    cinfo->JFIF_major_version = GETJOCTET(data[5]);
  46.605 +    cinfo->JFIF_minor_version = GETJOCTET(data[6]);
  46.606 +    cinfo->density_unit = GETJOCTET(data[7]);
  46.607 +    cinfo->X_density = (GETJOCTET(data[8]) << 8) + GETJOCTET(data[9]);
  46.608 +    cinfo->Y_density = (GETJOCTET(data[10]) << 8) + GETJOCTET(data[11]);
  46.609 +    /* Check version.
  46.610 +     * Major version must be 1, anything else signals an incompatible change.
  46.611 +     * (We used to treat this as an error, but now it's a nonfatal warning,
  46.612 +     * because some bozo at Hijaak couldn't read the spec.)
  46.613 +     * Minor version should be 0..2, but process anyway if newer.
  46.614 +     */
  46.615 +    if (cinfo->JFIF_major_version != 1)
  46.616 +      WARNMS2(cinfo, JWRN_JFIF_MAJOR,
  46.617 +	      cinfo->JFIF_major_version, cinfo->JFIF_minor_version);
  46.618 +    /* Generate trace messages */
  46.619 +    TRACEMS5(cinfo, 1, JTRC_JFIF,
  46.620 +	     cinfo->JFIF_major_version, cinfo->JFIF_minor_version,
  46.621 +	     cinfo->X_density, cinfo->Y_density, cinfo->density_unit);
  46.622 +    /* Validate thumbnail dimensions and issue appropriate messages */
  46.623 +    if (GETJOCTET(data[12]) | GETJOCTET(data[13]))
  46.624 +      TRACEMS2(cinfo, 1, JTRC_JFIF_THUMBNAIL,
  46.625 +	       GETJOCTET(data[12]), GETJOCTET(data[13]));
  46.626 +    totallen -= APP0_DATA_LEN;
  46.627 +    if (totallen !=
  46.628 +	((INT32)GETJOCTET(data[12]) * (INT32)GETJOCTET(data[13]) * (INT32) 3))
  46.629 +      TRACEMS1(cinfo, 1, JTRC_JFIF_BADTHUMBNAILSIZE, (int) totallen);
  46.630 +  } else if (datalen >= 6 &&
  46.631 +      GETJOCTET(data[0]) == 0x4A &&
  46.632 +      GETJOCTET(data[1]) == 0x46 &&
  46.633 +      GETJOCTET(data[2]) == 0x58 &&
  46.634 +      GETJOCTET(data[3]) == 0x58 &&
  46.635 +      GETJOCTET(data[4]) == 0) {
  46.636 +    /* Found JFIF "JFXX" extension APP0 marker */
  46.637 +    /* The library doesn't actually do anything with these,
  46.638 +     * but we try to produce a helpful trace message.
  46.639 +     */
  46.640 +    switch (GETJOCTET(data[5])) {
  46.641 +    case 0x10:
  46.642 +      TRACEMS1(cinfo, 1, JTRC_THUMB_JPEG, (int) totallen);
  46.643 +      break;
  46.644 +    case 0x11:
  46.645 +      TRACEMS1(cinfo, 1, JTRC_THUMB_PALETTE, (int) totallen);
  46.646 +      break;
  46.647 +    case 0x13:
  46.648 +      TRACEMS1(cinfo, 1, JTRC_THUMB_RGB, (int) totallen);
  46.649 +      break;
  46.650 +    default:
  46.651 +      TRACEMS2(cinfo, 1, JTRC_JFIF_EXTENSION,
  46.652 +	       GETJOCTET(data[5]), (int) totallen);
  46.653 +      break;
  46.654 +    }
  46.655 +  } else {
  46.656 +    /* Start of APP0 does not match "JFIF" or "JFXX", or too short */
  46.657 +    TRACEMS1(cinfo, 1, JTRC_APP0, (int) totallen);
  46.658 +  }
  46.659 +}
  46.660 +
  46.661 +
  46.662 +LOCAL(void)
  46.663 +examine_app14 (j_decompress_ptr cinfo, JOCTET FAR * data,
  46.664 +	       unsigned int datalen, INT32 remaining)
  46.665 +/* Examine first few bytes from an APP14.
  46.666 + * Take appropriate action if it is an Adobe marker.
  46.667 + * datalen is # of bytes at data[], remaining is length of rest of marker data.
  46.668 + */
  46.669 +{
  46.670 +  unsigned int version, flags0, flags1, transform;
  46.671 +
  46.672 +  if (datalen >= APP14_DATA_LEN &&
  46.673 +      GETJOCTET(data[0]) == 0x41 &&
  46.674 +      GETJOCTET(data[1]) == 0x64 &&
  46.675 +      GETJOCTET(data[2]) == 0x6F &&
  46.676 +      GETJOCTET(data[3]) == 0x62 &&
  46.677 +      GETJOCTET(data[4]) == 0x65) {
  46.678 +    /* Found Adobe APP14 marker */
  46.679 +    version = (GETJOCTET(data[5]) << 8) + GETJOCTET(data[6]);
  46.680 +    flags0 = (GETJOCTET(data[7]) << 8) + GETJOCTET(data[8]);
  46.681 +    flags1 = (GETJOCTET(data[9]) << 8) + GETJOCTET(data[10]);
  46.682 +    transform = GETJOCTET(data[11]);
  46.683 +    TRACEMS4(cinfo, 1, JTRC_ADOBE, version, flags0, flags1, transform);
  46.684 +    cinfo->saw_Adobe_marker = TRUE;
  46.685 +    cinfo->Adobe_transform = (UINT8) transform;
  46.686 +  } else {
  46.687 +    /* Start of APP14 does not match "Adobe", or too short */
  46.688 +    TRACEMS1(cinfo, 1, JTRC_APP14, (int) (datalen + remaining));
  46.689 +  }
  46.690 +}
  46.691 +
  46.692 +
  46.693 +METHODDEF(boolean)
  46.694 +get_interesting_appn (j_decompress_ptr cinfo)
  46.695 +/* Process an APP0 or APP14 marker without saving it */
  46.696 +{
  46.697 +  INT32 length;
  46.698 +  JOCTET b[APPN_DATA_LEN];
  46.699 +  unsigned int i, numtoread;
  46.700 +  INPUT_VARS(cinfo);
  46.701 +
  46.702 +  INPUT_2BYTES(cinfo, length, return FALSE);
  46.703 +  length -= 2;
  46.704 +
  46.705 +  /* get the interesting part of the marker data */
  46.706 +  if (length >= APPN_DATA_LEN)
  46.707 +    numtoread = APPN_DATA_LEN;
  46.708 +  else if (length > 0)
  46.709 +    numtoread = (unsigned int) length;
  46.710 +  else
  46.711 +    numtoread = 0;
  46.712 +  for (i = 0; i < numtoread; i++)
  46.713 +    INPUT_BYTE(cinfo, b[i], return FALSE);
  46.714 +  length -= numtoread;
  46.715 +
  46.716 +  /* process it */
  46.717 +  switch (cinfo->unread_marker) {
  46.718 +  case M_APP0:
  46.719 +    examine_app0(cinfo, (JOCTET FAR *) b, numtoread, length);
  46.720 +    break;
  46.721 +  case M_APP14:
  46.722 +    examine_app14(cinfo, (JOCTET FAR *) b, numtoread, length);
  46.723 +    break;
  46.724 +  default:
  46.725 +    /* can't get here unless jpeg_save_markers chooses wrong processor */
  46.726 +    ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, cinfo->unread_marker);
  46.727 +    break;
  46.728 +  }
  46.729 +
  46.730 +  /* skip any remaining data -- could be lots */
  46.731 +  INPUT_SYNC(cinfo);
  46.732 +  if (length > 0)
  46.733 +    (*cinfo->src->skip_input_data) (cinfo, (long) length);
  46.734 +
  46.735 +  return TRUE;
  46.736 +}
  46.737 +
  46.738 +
  46.739 +#ifdef SAVE_MARKERS_SUPPORTED
  46.740 +
  46.741 +METHODDEF(boolean)
  46.742 +save_marker (j_decompress_ptr cinfo)
  46.743 +/* Save an APPn or COM marker into the marker list */
  46.744 +{
  46.745 +  my_marker_ptr marker = (my_marker_ptr) cinfo->marker;
  46.746 +  jpeg_saved_marker_ptr cur_marker = marker->cur_marker;
  46.747 +  unsigned int bytes_read, data_length;
  46.748 +  JOCTET FAR * data;
  46.749 +  INT32 length = 0;
  46.750 +  INPUT_VARS(cinfo);
  46.751 +
  46.752 +  if (cur_marker == NULL) {
  46.753 +    /* begin reading a marker */
  46.754 +    INPUT_2BYTES(cinfo, length, return FALSE);
  46.755 +    length -= 2;
  46.756 +    if (length >= 0) {		/* watch out for bogus length word */
  46.757 +      /* figure out how much we want to save */
  46.758 +      unsigned int limit;
  46.759 +      if (cinfo->unread_marker == (int) M_COM)
  46.760 +	limit = marker->length_limit_COM;
  46.761 +      else
  46.762 +	limit = marker->length_limit_APPn[cinfo->unread_marker - (int) M_APP0];
  46.763 +      if ((unsigned int) length < limit)
  46.764 +	limit = (unsigned int) length;
  46.765 +      /* allocate and initialize the marker item */
  46.766 +      cur_marker = (jpeg_saved_marker_ptr)
  46.767 +	(*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,
  46.768 +				    SIZEOF(struct jpeg_marker_struct) + limit);
  46.769 +      cur_marker->next = NULL;
  46.770 +      cur_marker->marker = (UINT8) cinfo->unread_marker;
  46.771 +      cur_marker->original_length = (unsigned int) length;
  46.772 +      cur_marker->data_length = limit;
  46.773 +      /* data area is just beyond the jpeg_marker_struct */
  46.774 +      data = cur_marker->data = (JOCTET FAR *) (cur_marker + 1);
  46.775 +      marker->cur_marker = cur_marker;
  46.776 +      marker->bytes_read = 0;
  46.777 +      bytes_read = 0;
  46.778 +      data_length = limit;
  46.779 +    } else {
  46.780 +      /* deal with bogus length word */
  46.781 +      bytes_read = data_length = 0;
  46.782 +      data = NULL;
  46.783 +    }
  46.784 +  } else {
  46.785 +    /* resume reading a marker */
  46.786 +    bytes_read = marker->bytes_read;
  46.787 +    data_length = cur_marker->data_length;
  46.788 +    data = cur_marker->data + bytes_read;
  46.789 +  }
  46.790 +
  46.791 +  while (bytes_read < data_length) {
  46.792 +    INPUT_SYNC(cinfo);		/* move the restart point to here */
  46.793 +    marker->bytes_read = bytes_read;
  46.794 +    /* If there's not at least one byte in buffer, suspend */
  46.795 +    MAKE_BYTE_AVAIL(cinfo, return FALSE);
  46.796 +    /* Copy bytes with reasonable rapidity */
  46.797 +    while (bytes_read < data_length && bytes_in_buffer > 0) {
  46.798 +      *data++ = *next_input_byte++;
  46.799 +      bytes_in_buffer--;
  46.800 +      bytes_read++;
  46.801 +    }
  46.802 +  }
  46.803 +
  46.804 +  /* Done reading what we want to read */
  46.805 +  if (cur_marker != NULL) {	/* will be NULL if bogus length word */
  46.806 +    /* Add new marker to end of list */
  46.807 +    if (cinfo->marker_list == NULL) {
  46.808 +      cinfo->marker_list = cur_marker;
  46.809 +    } else {
  46.810 +      jpeg_saved_marker_ptr prev = cinfo->marker_list;
  46.811 +      while (prev->next != NULL)
  46.812 +	prev = prev->next;
  46.813 +      prev->next = cur_marker;
  46.814 +    }
  46.815 +    /* Reset pointer & calc remaining data length */
  46.816 +    data = cur_marker->data;
  46.817 +    length = cur_marker->original_length - data_length;
  46.818 +  }
  46.819 +  /* Reset to initial state for next marker */
  46.820 +  marker->cur_marker = NULL;
  46.821 +
  46.822 +  /* Process the marker if interesting; else just make a generic trace msg */
  46.823 +  switch (cinfo->unread_marker) {
  46.824 +  case M_APP0:
  46.825 +    examine_app0(cinfo, data, data_length, length);
  46.826 +    break;
  46.827 +  case M_APP14:
  46.828 +    examine_app14(cinfo, data, data_length, length);
  46.829 +    break;
  46.830 +  default:
  46.831 +    TRACEMS2(cinfo, 1, JTRC_MISC_MARKER, cinfo->unread_marker,
  46.832 +	     (int) (data_length + length));
  46.833 +    break;
  46.834 +  }
  46.835 +
  46.836 +  /* skip any remaining data -- could be lots */
  46.837 +  INPUT_SYNC(cinfo);		/* do before skip_input_data */
  46.838 +  if (length > 0)
  46.839 +    (*cinfo->src->skip_input_data) (cinfo, (long) length);
  46.840 +
  46.841 +  return TRUE;
  46.842 +}
  46.843 +
  46.844 +#endif /* SAVE_MARKERS_SUPPORTED */
  46.845 +
  46.846 +
  46.847 +METHODDEF(boolean)
  46.848 +skip_variable (j_decompress_ptr cinfo)
  46.849 +/* Skip over an unknown or uninteresting variable-length marker */
  46.850 +{
  46.851 +  INT32 length;
  46.852 +  INPUT_VARS(cinfo);
  46.853 +
  46.854 +  INPUT_2BYTES(cinfo, length, return FALSE);
  46.855 +  length -= 2;
  46.856 +  
  46.857 +  TRACEMS2(cinfo, 1, JTRC_MISC_MARKER, cinfo->unread_marker, (int) length);
  46.858 +
  46.859 +  INPUT_SYNC(cinfo);		/* do before skip_input_data */
  46.860 +  if (length > 0)
  46.861 +    (*cinfo->src->skip_input_data) (cinfo, (long) length);
  46.862 +
  46.863 +  return TRUE;
  46.864 +}
  46.865 +
  46.866 +
  46.867 +/*
  46.868 + * Find the next JPEG marker, save it in cinfo->unread_marker.
  46.869 + * Returns FALSE if had to suspend before reaching a marker;
  46.870 + * in that case cinfo->unread_marker is unchanged.
  46.871 + *
  46.872 + * Note that the result might not be a valid marker code,
  46.873 + * but it will never be 0 or FF.
  46.874 + */
  46.875 +
  46.876 +LOCAL(boolean)
  46.877 +next_marker (j_decompress_ptr cinfo)
  46.878 +{
  46.879 +  int c;
  46.880 +  INPUT_VARS(cinfo);
  46.881 +
  46.882 +  for (;;) {
  46.883 +    INPUT_BYTE(cinfo, c, return FALSE);
  46.884 +    /* Skip any non-FF bytes.
  46.885 +     * This may look a bit inefficient, but it will not occur in a valid file.
  46.886 +     * We sync after each discarded byte so that a suspending data source
  46.887 +     * can discard the byte from its buffer.
  46.888 +     */
  46.889 +    while (c != 0xFF) {
  46.890 +      cinfo->marker->discarded_bytes++;
  46.891 +      INPUT_SYNC(cinfo);
  46.892 +      INPUT_BYTE(cinfo, c, return FALSE);
  46.893 +    }
  46.894 +    /* This loop swallows any duplicate FF bytes.  Extra FFs are legal as
  46.895 +     * pad bytes, so don't count them in discarded_bytes.  We assume there
  46.896 +     * will not be so many consecutive FF bytes as to overflow a suspending
  46.897 +     * data source's input buffer.
  46.898 +     */
  46.899 +    do {
  46.900 +      INPUT_BYTE(cinfo, c, return FALSE);
  46.901 +    } while (c == 0xFF);
  46.902 +    if (c != 0)
  46.903 +      break;			/* found a valid marker, exit loop */
  46.904 +    /* Reach here if we found a stuffed-zero data sequence (FF/00).
  46.905 +     * Discard it and loop back to try again.
  46.906 +     */
  46.907 +    cinfo->marker->discarded_bytes += 2;
  46.908 +    INPUT_SYNC(cinfo);
  46.909 +  }
  46.910 +
  46.911 +  if (cinfo->marker->discarded_bytes != 0) {
  46.912 +    WARNMS2(cinfo, JWRN_EXTRANEOUS_DATA, cinfo->marker->discarded_bytes, c);
  46.913 +    cinfo->marker->discarded_bytes = 0;
  46.914 +  }
  46.915 +
  46.916 +  cinfo->unread_marker = c;
  46.917 +
  46.918 +  INPUT_SYNC(cinfo);
  46.919 +  return TRUE;
  46.920 +}
  46.921 +
  46.922 +
  46.923 +LOCAL(boolean)
  46.924 +first_marker (j_decompress_ptr cinfo)
  46.925 +/* Like next_marker, but used to obtain the initial SOI marker. */
  46.926 +/* For this marker, we do not allow preceding garbage or fill; otherwise,
  46.927 + * we might well scan an entire input file before realizing it ain't JPEG.
  46.928 + * If an application wants to process non-JFIF files, it must seek to the
  46.929 + * SOI before calling the JPEG library.
  46.930 + */
  46.931 +{
  46.932 +  int c, c2;
  46.933 +  INPUT_VARS(cinfo);
  46.934 +
  46.935 +  INPUT_BYTE(cinfo, c, return FALSE);
  46.936 +  INPUT_BYTE(cinfo, c2, return FALSE);
  46.937 +  if (c != 0xFF || c2 != (int) M_SOI)
  46.938 +    ERREXIT2(cinfo, JERR_NO_SOI, c, c2);
  46.939 +
  46.940 +  cinfo->unread_marker = c2;
  46.941 +
  46.942 +  INPUT_SYNC(cinfo);
  46.943 +  return TRUE;
  46.944 +}
  46.945 +
  46.946 +
  46.947 +/*
  46.948 + * Read markers until SOS or EOI.
  46.949 + *
  46.950 + * Returns same codes as are defined for jpeg_consume_input:
  46.951 + * JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI.
  46.952 + */
  46.953 +
  46.954 +METHODDEF(int)
  46.955 +read_markers (j_decompress_ptr cinfo)
  46.956 +{
  46.957 +  /* Outer loop repeats once for each marker. */
  46.958 +  for (;;) {
  46.959 +    /* Collect the marker proper, unless we already did. */
  46.960 +    /* NB: first_marker() enforces the requirement that SOI appear first. */
  46.961 +    if (cinfo->unread_marker == 0) {
  46.962 +      if (! cinfo->marker->saw_SOI) {
  46.963 +	if (! first_marker(cinfo))
  46.964 +	  return JPEG_SUSPENDED;
  46.965 +      } else {
  46.966 +	if (! next_marker(cinfo))
  46.967 +	  return JPEG_SUSPENDED;
  46.968 +      }
  46.969 +    }
  46.970 +    /* At this point cinfo->unread_marker contains the marker code and the
  46.971 +     * input point is just past the marker proper, but before any parameters.
  46.972 +     * A suspension will cause us to return with this state still true.
  46.973 +     */
  46.974 +    switch (cinfo->unread_marker) {
  46.975 +    case M_SOI:
  46.976 +      if (! get_soi(cinfo))
  46.977 +	return JPEG_SUSPENDED;
  46.978 +      break;
  46.979 +
  46.980 +    case M_SOF0:		/* Baseline */
  46.981 +    case M_SOF1:		/* Extended sequential, Huffman */
  46.982 +      if (! get_sof(cinfo, FALSE, FALSE))
  46.983 +	return JPEG_SUSPENDED;
  46.984 +      break;
  46.985 +
  46.986 +    case M_SOF2:		/* Progressive, Huffman */
  46.987 +      if (! get_sof(cinfo, TRUE, FALSE))
  46.988 +	return JPEG_SUSPENDED;
  46.989 +      break;
  46.990 +
  46.991 +    case M_SOF9:		/* Extended sequential, arithmetic */
  46.992 +      if (! get_sof(cinfo, FALSE, TRUE))
  46.993 +	return JPEG_SUSPENDED;
  46.994 +      break;
  46.995 +
  46.996 +    case M_SOF10:		/* Progressive, arithmetic */
  46.997 +      if (! get_sof(cinfo, TRUE, TRUE))
  46.998 +	return JPEG_SUSPENDED;
  46.999 +      break;
 46.1000 +
 46.1001 +    /* Currently unsupported SOFn types */
 46.1002 +    case M_SOF3:		/* Lossless, Huffman */
 46.1003 +    case M_SOF5:		/* Differential sequential, Huffman */
 46.1004 +    case M_SOF6:		/* Differential progressive, Huffman */
 46.1005 +    case M_SOF7:		/* Differential lossless, Huffman */
 46.1006 +    case M_JPG:			/* Reserved for JPEG extensions */
 46.1007 +    case M_SOF11:		/* Lossless, arithmetic */
 46.1008 +    case M_SOF13:		/* Differential sequential, arithmetic */
 46.1009 +    case M_SOF14:		/* Differential progressive, arithmetic */
 46.1010 +    case M_SOF15:		/* Differential lossless, arithmetic */
 46.1011 +      ERREXIT1(cinfo, JERR_SOF_UNSUPPORTED, cinfo->unread_marker);
 46.1012 +      break;
 46.1013 +
 46.1014 +    case M_SOS:
 46.1015 +      if (! get_sos(cinfo))
 46.1016 +	return JPEG_SUSPENDED;
 46.1017 +      cinfo->unread_marker = 0;	/* processed the marker */
 46.1018 +      return JPEG_REACHED_SOS;
 46.1019 +    
 46.1020 +    case M_EOI:
 46.1021 +      TRACEMS(cinfo, 1, JTRC_EOI);
 46.1022 +      cinfo->unread_marker = 0;	/* processed the marker */
 46.1023 +      return JPEG_REACHED_EOI;
 46.1024 +      
 46.1025 +    case M_DAC:
 46.1026 +      if (! get_dac(cinfo))
 46.1027 +	return JPEG_SUSPENDED;
 46.1028 +      break;
 46.1029 +      
 46.1030 +    case M_DHT:
 46.1031 +      if (! get_dht(cinfo))
 46.1032 +	return JPEG_SUSPENDED;
 46.1033 +      break;
 46.1034 +      
 46.1035 +    case M_DQT:
 46.1036 +      if (! get_dqt(cinfo))
 46.1037 +	return JPEG_SUSPENDED;
 46.1038 +      break;
 46.1039 +      
 46.1040 +    case M_DRI:
 46.1041 +      if (! get_dri(cinfo))
 46.1042 +	return JPEG_SUSPENDED;
 46.1043 +      break;
 46.1044 +      
 46.1045 +    case M_APP0:
 46.1046 +    case M_APP1:
 46.1047 +    case M_APP2:
 46.1048 +    case M_APP3:
 46.1049 +    case M_APP4:
 46.1050 +    case M_APP5:
 46.1051 +    case M_APP6:
 46.1052 +    case M_APP7:
 46.1053 +    case M_APP8:
 46.1054 +    case M_APP9:
 46.1055 +    case M_APP10:
 46.1056 +    case M_APP11:
 46.1057 +    case M_APP12:
 46.1058 +    case M_APP13:
 46.1059 +    case M_APP14:
 46.1060 +    case M_APP15:
 46.1061 +      if (! (*((my_marker_ptr) cinfo->marker)->process_APPn[
 46.1062 +		cinfo->unread_marker - (int) M_APP0]) (cinfo))
 46.1063 +	return JPEG_SUSPENDED;
 46.1064 +      break;
 46.1065 +      
 46.1066 +    case M_COM:
 46.1067 +      if (! (*((my_marker_ptr) cinfo->marker)->process_COM) (cinfo))
 46.1068 +	return JPEG_SUSPENDED;
 46.1069 +      break;
 46.1070 +
 46.1071 +    case M_RST0:		/* these are all parameterless */
 46.1072 +    case M_RST1:
 46.1073 +    case M_RST2:
 46.1074 +    case M_RST3:
 46.1075 +    case M_RST4:
 46.1076 +    case M_RST5:
 46.1077 +    case M_RST6:
 46.1078 +    case M_RST7:
 46.1079 +    case M_TEM:
 46.1080 +      TRACEMS1(cinfo, 1, JTRC_PARMLESS_MARKER, cinfo->unread_marker);
 46.1081 +      break;
 46.1082 +
 46.1083 +    case M_DNL:			/* Ignore DNL ... perhaps the wrong thing */
 46.1084 +      if (! skip_variable(cinfo))
 46.1085 +	return JPEG_SUSPENDED;
 46.1086 +      break;
 46.1087 +
 46.1088 +    default:			/* must be DHP, EXP, JPGn, or RESn */
 46.1089 +      /* For now, we treat the reserved markers as fatal errors since they are
 46.1090 +       * likely to be used to signal incompatible JPEG Part 3 extensions.
 46.1091 +       * Once the JPEG 3 version-number marker is well defined, this code
 46.1092 +       * ought to change!
 46.1093 +       */
 46.1094 +      ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, cinfo->unread_marker);
 46.1095 +      break;
 46.1096 +    }
 46.1097 +    /* Successfully processed marker, so reset state variable */
 46.1098 +    cinfo->unread_marker = 0;
 46.1099 +  } /* end loop */
 46.1100 +}
 46.1101 +
 46.1102 +
 46.1103 +/*
 46.1104 + * Read a restart marker, which is expected to appear next in the datastream;
 46.1105 + * if the marker is not there, take appropriate recovery action.
 46.1106 + * Returns FALSE if suspension is required.
 46.1107 + *
 46.1108 + * This is called by the entropy decoder after it has read an appropriate
 46.1109 + * number of MCUs.  cinfo->unread_marker may be nonzero if the entropy decoder
 46.1110 + * has already read a marker from the data source.  Under normal conditions
 46.1111 + * cinfo->unread_marker will be reset to 0 before returning; if not reset,
 46.1112 + * it holds a marker which the decoder will be unable to read past.
 46.1113 + */
 46.1114 +
 46.1115 +METHODDEF(boolean)
 46.1116 +read_restart_marker (j_decompress_ptr cinfo)
 46.1117 +{
 46.1118 +  /* Obtain a marker unless we already did. */
 46.1119 +  /* Note that next_marker will complain if it skips any data. */
 46.1120 +  if (cinfo->unread_marker == 0) {
 46.1121 +    if (! next_marker(cinfo))
 46.1122 +      return FALSE;
 46.1123 +  }
 46.1124 +
 46.1125 +  if (cinfo->unread_marker ==
 46.1126 +      ((int) M_RST0 + cinfo->marker->next_restart_num)) {
 46.1127 +    /* Normal case --- swallow the marker and let entropy decoder continue */
 46.1128 +    TRACEMS1(cinfo, 3, JTRC_RST, cinfo->marker->next_restart_num);
 46.1129 +    cinfo->unread_marker = 0;
 46.1130 +  } else {
 46.1131 +    /* Uh-oh, the restart markers have been messed up. */
 46.1132 +    /* Let the data source manager determine how to resync. */
 46.1133 +    if (! (*cinfo->src->resync_to_restart) (cinfo,
 46.1134 +					    cinfo->marker->next_restart_num))
 46.1135 +      return FALSE;
 46.1136 +  }
 46.1137 +
 46.1138 +  /* Update next-restart state */
 46.1139 +  cinfo->marker->next_restart_num = (cinfo->marker->next_restart_num + 1) & 7;
 46.1140 +
 46.1141 +  return TRUE;
 46.1142 +}
 46.1143 +
 46.1144 +
 46.1145 +/*
 46.1146 + * This is the default resync_to_restart method for data source managers
 46.1147 + * to use if they don't have any better approach.  Some data source managers
 46.1148 + * may be able to back up, or may have additional knowledge about the data
 46.1149 + * which permits a more intelligent recovery strategy; such managers would
 46.1150 + * presumably supply their own resync method.
 46.1151 + *
 46.1152 + * read_restart_marker calls resync_to_restart if it finds a marker other than
 46.1153 + * the restart marker it was expecting.  (This code is *not* used unless
 46.1154 + * a nonzero restart interval has been declared.)  cinfo->unread_marker is
 46.1155 + * the marker code actually found (might be anything, except 0 or FF).
 46.1156 + * The desired restart marker number (0..7) is passed as a parameter.
 46.1157 + * This routine is supposed to apply whatever error recovery strategy seems
 46.1158 + * appropriate in order to position the input stream to the next data segment.
 46.1159 + * Note that cinfo->unread_marker is treated as a marker appearing before
 46.1160 + * the current data-source input point; usually it should be reset to zero
 46.1161 + * before returning.
 46.1162 + * Returns FALSE if suspension is required.
 46.1163 + *
 46.1164 + * This implementation is substantially constrained by wanting to treat the
 46.1165 + * input as a data stream; this means we can't back up.  Therefore, we have
 46.1166 + * only the following actions to work with:
 46.1167 + *   1. Simply discard the marker and let the entropy decoder resume at next
 46.1168 + *      byte of file.
 46.1169 + *   2. Read forward until we find another marker, discarding intervening
 46.1170 + *      data.  (In theory we could look ahead within the current bufferload,
 46.1171 + *      without having to discard data if we don't find the desired marker.
 46.1172 + *      This idea is not implemented here, in part because it makes behavior
 46.1173 + *      dependent on buffer size and chance buffer-boundary positions.)
 46.1174 + *   3. Leave the marker unread (by failing to zero cinfo->unread_marker).
 46.1175 + *      This will cause the entropy decoder to process an empty data segment,
 46.1176 + *      inserting dummy zeroes, and then we will reprocess the marker.
 46.1177 + *
 46.1178 + * #2 is appropriate if we think the desired marker lies ahead, while #3 is
 46.1179 + * appropriate if the found marker is a future restart marker (indicating
 46.1180 + * that we have missed the desired restart marker, probably because it got
 46.1181 + * corrupted).
 46.1182 + * We apply #2 or #3 if the found marker is a restart marker no more than
 46.1183 + * two counts behind or ahead of the expected one.  We also apply #2 if the
 46.1184 + * found marker is not a legal JPEG marker code (it's certainly bogus data).
 46.1185 + * If the found marker is a restart marker more than 2 counts away, we do #1
 46.1186 + * (too much risk that the marker is erroneous; with luck we will be able to
 46.1187 + * resync at some future point).
 46.1188 + * For any valid non-restart JPEG marker, we apply #3.  This keeps us from
 46.1189 + * overrunning the end of a scan.  An implementation limited to single-scan
 46.1190 + * files might find it better to apply #2 for markers other than EOI, since
 46.1191 + * any other marker would have to be bogus data in that case.
 46.1192 + */
 46.1193 +
 46.1194 +GLOBAL(boolean)
 46.1195 +jpeg_resync_to_restart (j_decompress_ptr cinfo, int desired)
 46.1196 +{
 46.1197 +  int marker = cinfo->unread_marker;
 46.1198 +  int action = 1;
 46.1199 +  
 46.1200 +  /* Always put up a warning. */
 46.1201 +  WARNMS2(cinfo, JWRN_MUST_RESYNC, marker, desired);
 46.1202 +  
 46.1203 +  /* Outer loop handles repeated decision after scanning forward. */
 46.1204 +  for (;;) {
 46.1205 +    if (marker < (int) M_SOF0)
 46.1206 +      action = 2;		/* invalid marker */
 46.1207 +    else if (marker < (int) M_RST0 || marker > (int) M_RST7)
 46.1208 +      action = 3;		/* valid non-restart marker */
 46.1209 +    else {
 46.1210 +      if (marker == ((int) M_RST0 + ((desired+1) & 7)) ||
 46.1211 +	  marker == ((int) M_RST0 + ((desired+2) & 7)))
 46.1212 +	action = 3;		/* one of the next two expected restarts */
 46.1213 +      else if (marker == ((int) M_RST0 + ((desired-1) & 7)) ||
 46.1214 +	       marker == ((int) M_RST0 + ((desired-2) & 7)))
 46.1215 +	action = 2;		/* a prior restart, so advance */
 46.1216 +      else
 46.1217 +	action = 1;		/* desired restart or too far away */
 46.1218 +    }
 46.1219 +    TRACEMS2(cinfo, 4, JTRC_RECOVERY_ACTION, marker, action);
 46.1220 +    switch (action) {
 46.1221 +    case 1:
 46.1222 +      /* Discard marker and let entropy decoder resume processing. */
 46.1223 +      cinfo->unread_marker = 0;
 46.1224 +      return TRUE;
 46.1225 +    case 2:
 46.1226 +      /* Scan to the next marker, and repeat the decision loop. */
 46.1227 +      if (! next_marker(cinfo))
 46.1228 +	return FALSE;
 46.1229 +      marker = cinfo->unread_marker;
 46.1230 +      break;
 46.1231 +    case 3:
 46.1232 +      /* Return without advancing past this marker. */
 46.1233 +      /* Entropy decoder will be forced to process an empty segment. */
 46.1234 +      return TRUE;
 46.1235 +    }
 46.1236 +  } /* end loop */
 46.1237 +}
 46.1238 +
 46.1239 +
 46.1240 +/*
 46.1241 + * Reset marker processing state to begin a fresh datastream.
 46.1242 + */
 46.1243 +
 46.1244 +METHODDEF(void)
 46.1245 +reset_marker_reader (j_decompress_ptr cinfo)
 46.1246 +{
 46.1247 +  my_marker_ptr marker = (my_marker_ptr) cinfo->marker;
 46.1248 +
 46.1249 +  cinfo->comp_info = NULL;		/* until allocated by get_sof */
 46.1250 +  cinfo->input_scan_number = 0;		/* no SOS seen yet */
 46.1251 +  cinfo->unread_marker = 0;		/* no pending marker */
 46.1252 +  marker->pub.saw_SOI = FALSE;		/* set internal state too */
 46.1253 +  marker->pub.saw_SOF = FALSE;
 46.1254 +  marker->pub.discarded_bytes = 0;
 46.1255 +  marker->cur_marker = NULL;
 46.1256 +}
 46.1257 +
 46.1258 +
 46.1259 +/*
 46.1260 + * Initialize the marker reader module.
 46.1261 + * This is called only once, when the decompression object is created.
 46.1262 + */
 46.1263 +
 46.1264 +GLOBAL(void)
 46.1265 +jinit_marker_reader (j_decompress_ptr cinfo)
 46.1266 +{
 46.1267 +  my_marker_ptr marker;
 46.1268 +  int i;
 46.1269 +
 46.1270 +  /* Create subobject in permanent pool */
 46.1271 +  marker = (my_marker_ptr)
 46.1272 +    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
 46.1273 +				SIZEOF(my_marker_reader));
 46.1274 +  cinfo->marker = (struct jpeg_marker_reader *) marker;
 46.1275 +  /* Initialize public method pointers */
 46.1276 +  marker->pub.reset_marker_reader = reset_marker_reader;
 46.1277 +  marker->pub.read_markers = read_markers;
 46.1278 +  marker->pub.read_restart_marker = read_restart_marker;
 46.1279 +  /* Initialize COM/APPn processing.
 46.1280 +   * By default, we examine and then discard APP0 and APP14,
 46.1281 +   * but simply discard COM and all other APPn.
 46.1282 +   */
 46.1283 +  marker->process_COM = skip_variable;
 46.1284 +  marker->length_limit_COM = 0;
 46.1285 +  for (i = 0; i < 16; i++) {
 46.1286 +    marker->process_APPn[i] = skip_variable;
 46.1287 +    marker->length_limit_APPn[i] = 0;
 46.1288 +  }
 46.1289 +  marker->process_APPn[0] = get_interesting_appn;
 46.1290 +  marker->process_APPn[14] = get_interesting_appn;
 46.1291 +  /* Reset marker processing state */
 46.1292 +  reset_marker_reader(cinfo);
 46.1293 +}
 46.1294 +
 46.1295 +
 46.1296 +/*
 46.1297 + * Control saving of COM and APPn markers into marker_list.
 46.1298 + */
 46.1299 +
 46.1300 +#ifdef SAVE_MARKERS_SUPPORTED
 46.1301 +
 46.1302 +GLOBAL(void)
 46.1303 +jpeg_save_markers (j_decompress_ptr cinfo, int marker_code,
 46.1304 +		   unsigned int length_limit)
 46.1305 +{
 46.1306 +  my_marker_ptr marker = (my_marker_ptr) cinfo->marker;
 46.1307 +  long maxlength;
 46.1308 +  jpeg_marker_parser_method processor;
 46.1309 +
 46.1310 +  /* Length limit mustn't be larger than what we can allocate
 46.1311 +   * (should only be a concern in a 16-bit environment).
 46.1312 +   */
 46.1313 +  maxlength = cinfo->mem->max_alloc_chunk - SIZEOF(struct jpeg_marker_struct);
 46.1314 +  if (((long) length_limit) > maxlength)
 46.1315 +    length_limit = (unsigned int) maxlength;
 46.1316 +
 46.1317 +  /* Choose processor routine to use.
 46.1318 +   * APP0/APP14 have special requirements.
 46.1319 +   */
 46.1320 +  if (length_limit) {
 46.1321 +    processor = save_marker;
 46.1322 +    /* If saving APP0/APP14, save at least enough for our internal use. */
 46.1323 +    if (marker_code == (int) M_APP0 && length_limit < APP0_DATA_LEN)
 46.1324 +      length_limit = APP0_DATA_LEN;
 46.1325 +    else if (marker_code == (int) M_APP14 && length_limit < APP14_DATA_LEN)
 46.1326 +      length_limit = APP14_DATA_LEN;
 46.1327 +  } else {
 46.1328 +    processor = skip_variable;
 46.1329 +    /* If discarding APP0/APP14, use our regular on-the-fly processor. */
 46.1330 +    if (marker_code == (int) M_APP0 || marker_code == (int) M_APP14)
 46.1331 +      processor = get_interesting_appn;
 46.1332 +  }
 46.1333 +
 46.1334 +  if (marker_code == (int) M_COM) {
 46.1335 +    marker->process_COM = processor;
 46.1336 +    marker->length_limit_COM = length_limit;
 46.1337 +  } else if (marker_code >= (int) M_APP0 && marker_code <= (int) M_APP15) {
 46.1338 +    marker->process_APPn[marker_code - (int) M_APP0] = processor;
 46.1339 +    marker->length_limit_APPn[marker_code - (int) M_APP0] = length_limit;
 46.1340 +  } else
 46.1341 +    ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, marker_code);
 46.1342 +}
 46.1343 +
 46.1344 +#endif /* SAVE_MARKERS_SUPPORTED */
 46.1345 +
 46.1346 +
 46.1347 +/*
 46.1348 + * Install a special processing method for COM or APPn markers.
 46.1349 + */
 46.1350 +
 46.1351 +GLOBAL(void)
 46.1352 +jpeg_set_marker_processor (j_decompress_ptr cinfo, int marker_code,
 46.1353 +			   jpeg_marker_parser_method routine)
 46.1354 +{
 46.1355 +  my_marker_ptr marker = (my_marker_ptr) cinfo->marker;
 46.1356 +
 46.1357 +  if (marker_code == (int) M_COM)
 46.1358 +    marker->process_COM = routine;
 46.1359 +  else if (marker_code >= (int) M_APP0 && marker_code <= (int) M_APP15)
 46.1360 +    marker->process_APPn[marker_code - (int) M_APP0] = routine;
 46.1361 +  else
 46.1362 +    ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, marker_code);
 46.1363 +}
    47.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    47.2 +++ b/libs/libjpeg/jdmaster.c	Sun Nov 01 00:36:56 2015 +0200
    47.3 @@ -0,0 +1,557 @@
    47.4 +/*
    47.5 + * jdmaster.c
    47.6 + *
    47.7 + * Copyright (C) 1991-1997, Thomas G. Lane.
    47.8 + * This file is part of the Independent JPEG Group's software.
    47.9 + * For conditions of distribution and use, see the accompanying README file.
   47.10 + *
   47.11 + * This file contains master control logic for the JPEG decompressor.
   47.12 + * These routines are concerned with selecting the modules to be executed
   47.13 + * and with determining the number of passes and the work to be done in each
   47.14 + * pass.
   47.15 + */
   47.16 +
   47.17 +#define JPEG_INTERNALS
   47.18 +#include "jinclude.h"
   47.19 +#include "jpeglib.h"
   47.20 +
   47.21 +
   47.22 +/* Private state */
   47.23 +
   47.24 +typedef struct {
   47.25 +  struct jpeg_decomp_master pub; /* public fields */
   47.26 +
   47.27 +  int pass_number;		/* # of passes completed */
   47.28 +
   47.29 +  boolean using_merged_upsample; /* TRUE if using merged upsample/cconvert */
   47.30 +
   47.31 +  /* Saved references to initialized quantizer modules,
   47.32 +   * in case we need to switch modes.
   47.33 +   */
   47.34 +  struct jpeg_color_quantizer * quantizer_1pass;
   47.35 +  struct jpeg_color_quantizer * quantizer_2pass;
   47.36 +} my_decomp_master;
   47.37 +
   47.38 +typedef my_decomp_master * my_master_ptr;
   47.39 +
   47.40 +
   47.41 +/*
   47.42 + * Determine whether merged upsample/color conversion should be used.
   47.43 + * CRUCIAL: this must match the actual capabilities of jdmerge.c!
   47.44 + */
   47.45 +
   47.46 +LOCAL(boolean)
   47.47 +use_merged_upsample (j_decompress_ptr cinfo)
   47.48 +{
   47.49 +#ifdef UPSAMPLE_MERGING_SUPPORTED
   47.50 +  /* Merging is the equivalent of plain box-filter upsampling */
   47.51 +  if (cinfo->do_fancy_upsampling || cinfo->CCIR601_sampling)
   47.52 +    return FALSE;
   47.53 +  /* jdmerge.c only supports YCC=>RGB color conversion */
   47.54 +  if (cinfo->jpeg_color_space != JCS_YCbCr || cinfo->num_components != 3 ||
   47.55 +      cinfo->out_color_space != JCS_RGB ||
   47.56 +      cinfo->out_color_components != RGB_PIXELSIZE)
   47.57 +    return FALSE;
   47.58 +  /* and it only handles 2h1v or 2h2v sampling ratios */
   47.59 +  if (cinfo->comp_info[0].h_samp_factor != 2 ||
   47.60 +      cinfo->comp_info[1].h_samp_factor != 1 ||
   47.61 +      cinfo->comp_info[2].h_samp_factor != 1 ||
   47.62 +      cinfo->comp_info[0].v_samp_factor >  2 ||
   47.63 +      cinfo->comp_info[1].v_samp_factor != 1 ||
   47.64 +      cinfo->comp_info[2].v_samp_factor != 1)
   47.65 +    return FALSE;
   47.66 +  /* furthermore, it doesn't work if we've scaled the IDCTs differently */
   47.67 +  if (cinfo->comp_info[0].DCT_scaled_size != cinfo->min_DCT_scaled_size ||
   47.68 +      cinfo->comp_info[1].DCT_scaled_size != cinfo->min_DCT_scaled_size ||
   47.69 +      cinfo->comp_info[2].DCT_scaled_size != cinfo->min_DCT_scaled_size)
   47.70 +    return FALSE;
   47.71 +  /* ??? also need to test for upsample-time rescaling, when & if supported */
   47.72 +  return TRUE;			/* by golly, it'll work... */
   47.73 +#else
   47.74 +  return FALSE;
   47.75 +#endif
   47.76 +}
   47.77 +
   47.78 +
   47.79 +/*
   47.80 + * Compute output image dimensions and related values.
   47.81 + * NOTE: this is exported for possible use by application.
   47.82 + * Hence it mustn't do anything that can't be done twice.
   47.83 + * Also note that it may be called before the master module is initialized!
   47.84 + */
   47.85 +
   47.86 +GLOBAL(void)
   47.87 +jpeg_calc_output_dimensions (j_decompress_ptr cinfo)
   47.88 +/* Do computations that are needed before master selection phase */
   47.89 +{
   47.90 +#ifdef IDCT_SCALING_SUPPORTED
   47.91 +  int ci;
   47.92 +  jpeg_component_info *compptr;
   47.93 +#endif
   47.94 +
   47.95 +  /* Prevent application from calling me at wrong times */
   47.96 +  if (cinfo->global_state != DSTATE_READY)
   47.97 +    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
   47.98 +
   47.99 +#ifdef IDCT_SCALING_SUPPORTED
  47.100 +
  47.101 +  /* Compute actual output image dimensions and DCT scaling choices. */
  47.102 +  if (cinfo->scale_num * 8 <= cinfo->scale_denom) {
  47.103 +    /* Provide 1/8 scaling */
  47.104 +    cinfo->output_width = (JDIMENSION)
  47.105 +      jdiv_round_up((long) cinfo->image_width, 8L);
  47.106 +    cinfo->output_height = (JDIMENSION)
  47.107 +      jdiv_round_up((long) cinfo->image_height, 8L);
  47.108 +    cinfo->min_DCT_scaled_size = 1;
  47.109 +  } else if (cinfo->scale_num * 4 <= cinfo->scale_denom) {
  47.110 +    /* Provide 1/4 scaling */
  47.111 +    cinfo->output_width = (JDIMENSION)
  47.112 +      jdiv_round_up((long) cinfo->image_width, 4L);
  47.113 +    cinfo->output_height = (JDIMENSION)
  47.114 +      jdiv_round_up((long) cinfo->image_height, 4L);
  47.115 +    cinfo->min_DCT_scaled_size = 2;
  47.116 +  } else if (cinfo->scale_num * 2 <= cinfo->scale_denom) {
  47.117 +    /* Provide 1/2 scaling */
  47.118 +    cinfo->output_width = (JDIMENSION)
  47.119 +      jdiv_round_up((long) cinfo->image_width, 2L);
  47.120 +    cinfo->output_height = (JDIMENSION)
  47.121 +      jdiv_round_up((long) cinfo->image_height, 2L);
  47.122 +    cinfo->min_DCT_scaled_size = 4;
  47.123 +  } else {
  47.124 +    /* Provide 1/1 scaling */
  47.125 +    cinfo->output_width = cinfo->image_width;
  47.126 +    cinfo->output_height = cinfo->image_height;
  47.127 +    cinfo->min_DCT_scaled_size = DCTSIZE;
  47.128 +  }
  47.129 +  /* In selecting the actual DCT scaling for each component, we try to
  47.130 +   * scale up the chroma components via IDCT scaling rather than upsampling.
  47.131 +   * This saves time if the upsampler gets to use 1:1 scaling.
  47.132 +   * Note this code assumes that the supported DCT scalings are powers of 2.
  47.133 +   */
  47.134 +  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  47.135 +       ci++, compptr++) {
  47.136 +    int ssize = cinfo->min_DCT_scaled_size;
  47.137 +    while (ssize < DCTSIZE &&
  47.138 +	   (compptr->h_samp_factor * ssize * 2 <=
  47.139 +	    cinfo->max_h_samp_factor * cinfo->min_DCT_scaled_size) &&
  47.140 +	   (compptr->v_samp_factor * ssize * 2 <=
  47.141 +	    cinfo->max_v_samp_factor * cinfo->min_DCT_scaled_size)) {
  47.142 +      ssize = ssize * 2;
  47.143 +    }
  47.144 +    compptr->DCT_scaled_size = ssize;
  47.145 +  }
  47.146 +
  47.147 +  /* Recompute downsampled dimensions of components;
  47.148 +   * application needs to know these if using raw downsampled data.
  47.149 +   */
  47.150 +  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  47.151 +       ci++, compptr++) {
  47.152 +    /* Size in samples, after IDCT scaling */
  47.153 +    compptr->downsampled_width = (JDIMENSION)
  47.154 +      jdiv_round_up((long) cinfo->image_width *
  47.155 +		    (long) (compptr->h_samp_factor * compptr->DCT_scaled_size),
  47.156 +		    (long) (cinfo->max_h_samp_factor * DCTSIZE));
  47.157 +    compptr->downsampled_height = (JDIMENSION)
  47.158 +      jdiv_round_up((long) cinfo->image_height *
  47.159 +		    (long) (compptr->v_samp_factor * compptr->DCT_scaled_size),
  47.160 +		    (long) (cinfo->max_v_samp_factor * DCTSIZE));
  47.161 +  }
  47.162 +
  47.163 +#else /* !IDCT_SCALING_SUPPORTED */
  47.164 +
  47.165 +  /* Hardwire it to "no scaling" */
  47.166 +  cinfo->output_width = cinfo->image_width;
  47.167 +  cinfo->output_height = cinfo->image_height;
  47.168 +  /* jdinput.c has already initialized DCT_scaled_size to DCTSIZE,
  47.169 +   * and has computed unscaled downsampled_width and downsampled_height.
  47.170 +   */
  47.171 +
  47.172 +#endif /* IDCT_SCALING_SUPPORTED */
  47.173 +
  47.174 +  /* Report number of components in selected colorspace. */
  47.175 +  /* Probably this should be in the color conversion module... */
  47.176 +  switch (cinfo->out_color_space) {
  47.177 +  case JCS_GRAYSCALE:
  47.178 +    cinfo->out_color_components = 1;
  47.179 +    break;
  47.180 +  case JCS_RGB:
  47.181 +#if RGB_PIXELSIZE != 3
  47.182 +    cinfo->out_color_components = RGB_PIXELSIZE;
  47.183 +    break;
  47.184 +#endif /* else share code with YCbCr */
  47.185 +  case JCS_YCbCr:
  47.186 +    cinfo->out_color_components = 3;
  47.187 +    break;
  47.188 +  case JCS_CMYK:
  47.189 +  case JCS_YCCK:
  47.190 +    cinfo->out_color_components = 4;
  47.191 +    break;
  47.192 +  default:			/* else must be same colorspace as in file */
  47.193 +    cinfo->out_color_components = cinfo->num_components;
  47.194 +    break;
  47.195 +  }
  47.196 +  cinfo->output_components = (cinfo->quantize_colors ? 1 :
  47.197 +			      cinfo->out_color_components);
  47.198 +
  47.199 +  /* See if upsampler will want to emit more than one row at a time */
  47.200 +  if (use_merged_upsample(cinfo))
  47.201 +    cinfo->rec_outbuf_height = cinfo->max_v_samp_factor;
  47.202 +  else
  47.203 +    cinfo->rec_outbuf_height = 1;
  47.204 +}
  47.205 +
  47.206 +
  47.207 +/*
  47.208 + * Several decompression processes need to range-limit values to the range
  47.209 + * 0..MAXJSAMPLE; the input value may fall somewhat outside this range
  47.210 + * due to noise introduced by quantization, roundoff error, etc.  These
  47.211 + * processes are inner loops and need to be as fast as possible.  On most
  47.212 + * machines, particularly CPUs with pipelines or instruction prefetch,
  47.213 + * a (subscript-check-less) C table lookup
  47.214 + *		x = sample_range_limit[x];
  47.215 + * is faster than explicit tests
  47.216 + *		if (x < 0)  x = 0;
  47.217 + *		else if (x > MAXJSAMPLE)  x = MAXJSAMPLE;
  47.218 + * These processes all use a common table prepared by the routine below.
  47.219 + *
  47.220 + * For most steps we can mathematically guarantee that the initial value
  47.221 + * of x is within MAXJSAMPLE+1 of the legal range, so a table running from
  47.222 + * -(MAXJSAMPLE+1) to 2*MAXJSAMPLE+1 is sufficient.  But for the initial
  47.223 + * limiting step (just after the IDCT), a wildly out-of-range value is 
  47.224 + * possible if the input data is corrupt.  To avoid any chance of indexing
  47.225 + * off the end of memory and getting a bad-pointer trap, we perform the
  47.226 + * post-IDCT limiting thus:
  47.227 + *		x = range_limit[x & MASK];
  47.228 + * where MASK is 2 bits wider than legal sample data, ie 10 bits for 8-bit
  47.229 + * samples.  Under normal circumstances this is more than enough range and
  47.230 + * a correct output will be generated; with bogus input data the mask will
  47.231 + * cause wraparound, and we will safely generate a bogus-but-in-range output.
  47.232 + * For the post-IDCT step, we want to convert the data from signed to unsigned
  47.233 + * representation by adding CENTERJSAMPLE at the same time that we limit it.
  47.234 + * So the post-IDCT limiting table ends up looking like this:
  47.235 + *   CENTERJSAMPLE,CENTERJSAMPLE+1,...,MAXJSAMPLE,
  47.236 + *   MAXJSAMPLE (repeat 2*(MAXJSAMPLE+1)-CENTERJSAMPLE times),
  47.237 + *   0          (repeat 2*(MAXJSAMPLE+1)-CENTERJSAMPLE times),
  47.238 + *   0,1,...,CENTERJSAMPLE-1
  47.239 + * Negative inputs select values from the upper half of the table after
  47.240 + * masking.
  47.241 + *
  47.242 + * We can save some space by overlapping the start of the post-IDCT table
  47.243 + * with the simpler range limiting table.  The post-IDCT table begins at
  47.244 + * sample_range_limit + CENTERJSAMPLE.
  47.245 + *
  47.246 + * Note that the table is allocated in near data space on PCs; it's small
  47.247 + * enough and used often enough to justify this.
  47.248 + */
  47.249 +
  47.250 +LOCAL(void)
  47.251 +prepare_range_limit_table (j_decompress_ptr cinfo)
  47.252 +/* Allocate and fill in the sample_range_limit table */
  47.253 +{
  47.254 +  JSAMPLE * table;
  47.255 +  int i;
  47.256 +
  47.257 +  table = (JSAMPLE *)
  47.258 +    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
  47.259 +		(5 * (MAXJSAMPLE+1) + CENTERJSAMPLE) * SIZEOF(JSAMPLE));
  47.260 +  table += (MAXJSAMPLE+1);	/* allow negative subscripts of simple table */
  47.261 +  cinfo->sample_range_limit = table;
  47.262 +  /* First segment of "simple" table: limit[x] = 0 for x < 0 */
  47.263 +  MEMZERO(table - (MAXJSAMPLE+1), (MAXJSAMPLE+1) * SIZEOF(JSAMPLE));
  47.264 +  /* Main part of "simple" table: limit[x] = x */
  47.265 +  for (i = 0; i <= MAXJSAMPLE; i++)
  47.266 +    table[i] = (JSAMPLE) i;
  47.267 +  table += CENTERJSAMPLE;	/* Point to where post-IDCT table starts */
  47.268 +  /* End of simple table, rest of first half of post-IDCT table */
  47.269 +  for (i = CENTERJSAMPLE; i < 2*(MAXJSAMPLE+1); i++)
  47.270 +    table[i] = MAXJSAMPLE;
  47.271 +  /* Second half of post-IDCT table */
  47.272 +  MEMZERO(table + (2 * (MAXJSAMPLE+1)),
  47.273 +	  (2 * (MAXJSAMPLE+1) - CENTERJSAMPLE) * SIZEOF(JSAMPLE));
  47.274 +  MEMCOPY(table + (4 * (MAXJSAMPLE+1) - CENTERJSAMPLE),
  47.275 +	  cinfo->sample_range_limit, CENTERJSAMPLE * SIZEOF(JSAMPLE));
  47.276 +}
  47.277 +
  47.278 +
  47.279 +/*
  47.280 + * Master selection of decompression modules.
  47.281 + * This is done once at jpeg_start_decompress time.  We determine
  47.282 + * which modules will be used and give them appropriate initialization calls.
  47.283 + * We also initialize the decompressor input side to begin consuming data.
  47.284 + *
  47.285 + * Since jpeg_read_header has finished, we know what is in the SOF
  47.286 + * and (first) SOS markers.  We also have all the application parameter
  47.287 + * settings.
  47.288 + */
  47.289 +
  47.290 +LOCAL(void)
  47.291 +master_selection (j_decompress_ptr cinfo)
  47.292 +{
  47.293 +  my_master_ptr master = (my_master_ptr) cinfo->master;
  47.294 +  boolean use_c_buffer;
  47.295 +  long samplesperrow;
  47.296 +  JDIMENSION jd_samplesperrow;
  47.297 +
  47.298 +  /* Initialize dimensions and other stuff */
  47.299 +  jpeg_calc_output_dimensions(cinfo);
  47.300 +  prepare_range_limit_table(cinfo);
  47.301 +
  47.302 +  /* Width of an output scanline must be representable as JDIMENSION. */
  47.303 +  samplesperrow = (long) cinfo->output_width * (long) cinfo->out_color_components;
  47.304 +  jd_samplesperrow = (JDIMENSION) samplesperrow;
  47.305 +  if ((long) jd_samplesperrow != samplesperrow)
  47.306 +    ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
  47.307 +
  47.308 +  /* Initialize my private state */
  47.309 +  master->pass_number = 0;
  47.310 +  master->using_merged_upsample = use_merged_upsample(cinfo);
  47.311 +
  47.312 +  /* Color quantizer selection */
  47.313 +  master->quantizer_1pass = NULL;
  47.314 +  master->quantizer_2pass = NULL;
  47.315 +  /* No mode changes if not using buffered-image mode. */
  47.316 +  if (! cinfo->quantize_colors || ! cinfo->buffered_image) {
  47.317 +    cinfo->enable_1pass_quant = FALSE;
  47.318 +    cinfo->enable_external_quant = FALSE;
  47.319 +    cinfo->enable_2pass_quant = FALSE;
  47.320 +  }
  47.321 +  if (cinfo->quantize_colors) {
  47.322 +    if (cinfo->raw_data_out)
  47.323 +      ERREXIT(cinfo, JERR_NOTIMPL);
  47.324 +    /* 2-pass quantizer only works in 3-component color space. */
  47.325 +    if (cinfo->out_color_components != 3) {
  47.326 +      cinfo->enable_1pass_quant = TRUE;
  47.327 +      cinfo->enable_external_quant = FALSE;
  47.328 +      cinfo->enable_2pass_quant = FALSE;
  47.329 +      cinfo->colormap = NULL;
  47.330 +    } else if (cinfo->colormap != NULL) {
  47.331 +      cinfo->enable_external_quant = TRUE;
  47.332 +    } else if (cinfo->two_pass_quantize) {
  47.333 +      cinfo->enable_2pass_quant = TRUE;
  47.334 +    } else {
  47.335 +      cinfo->enable_1pass_quant = TRUE;
  47.336 +    }
  47.337 +
  47.338 +    if (cinfo->enable_1pass_quant) {
  47.339 +#ifdef QUANT_1PASS_SUPPORTED
  47.340 +      jinit_1pass_quantizer(cinfo);
  47.341 +      master->quantizer_1pass = cinfo->cquantize;
  47.342 +#else
  47.343 +      ERREXIT(cinfo, JERR_NOT_COMPILED);
  47.344 +#endif
  47.345 +    }
  47.346 +
  47.347 +    /* We use the 2-pass code to map to external colormaps. */
  47.348 +    if (cinfo->enable_2pass_quant || cinfo->enable_external_quant) {
  47.349 +#ifdef QUANT_2PASS_SUPPORTED
  47.350 +      jinit_2pass_quantizer(cinfo);
  47.351 +      master->quantizer_2pass = cinfo->cquantize;
  47.352 +#else
  47.353 +      ERREXIT(cinfo, JERR_NOT_COMPILED);
  47.354 +#endif
  47.355 +    }
  47.356 +    /* If both quantizers are initialized, the 2-pass one is left active;
  47.357 +     * this is necessary for starting with quantization to an external map.
  47.358 +     */
  47.359 +  }
  47.360 +
  47.361 +  /* Post-processing: in particular, color conversion first */
  47.362 +  if (! cinfo->raw_data_out) {
  47.363 +    if (master->using_merged_upsample) {
  47.364 +#ifdef UPSAMPLE_MERGING_SUPPORTED
  47.365 +      jinit_merged_upsampler(cinfo); /* does color conversion too */
  47.366 +#else
  47.367 +      ERREXIT(cinfo, JERR_NOT_COMPILED);
  47.368 +#endif
  47.369 +    } else {
  47.370 +      jinit_color_deconverter(cinfo);
  47.371 +      jinit_upsampler(cinfo);
  47.372 +    }
  47.373 +    jinit_d_post_controller(cinfo, cinfo->enable_2pass_quant);
  47.374 +  }
  47.375 +  /* Inverse DCT */
  47.376 +  jinit_inverse_dct(cinfo);
  47.377 +  /* Entropy decoding: either Huffman or arithmetic coding. */
  47.378 +  if (cinfo->arith_code) {
  47.379 +    ERREXIT(cinfo, JERR_ARITH_NOTIMPL);
  47.380 +  } else {
  47.381 +    if (cinfo->progressive_mode) {
  47.382 +#ifdef D_PROGRESSIVE_SUPPORTED
  47.383 +      jinit_phuff_decoder(cinfo);
  47.384 +#else
  47.385 +      ERREXIT(cinfo, JERR_NOT_COMPILED);
  47.386 +#endif
  47.387 +    } else
  47.388 +      jinit_huff_decoder(cinfo);
  47.389 +  }
  47.390 +
  47.391 +  /* Initialize principal buffer controllers. */
  47.392 +  use_c_buffer = cinfo->inputctl->has_multiple_scans || cinfo->buffered_image;
  47.393 +  jinit_d_coef_controller(cinfo, use_c_buffer);
  47.394 +
  47.395 +  if (! cinfo->raw_data_out)
  47.396 +    jinit_d_main_controller(cinfo, FALSE /* never need full buffer here */);
  47.397 +
  47.398 +  /* We can now tell the memory manager to allocate virtual arrays. */
  47.399 +  (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo);
  47.400 +
  47.401 +  /* Initialize input side of decompressor to consume first scan. */
  47.402 +  (*cinfo->inputctl->start_input_pass) (cinfo);
  47.403 +
  47.404 +#ifdef D_MULTISCAN_FILES_SUPPORTED
  47.405 +  /* If jpeg_start_decompress will read the whole file, initialize
  47.406 +   * progress monitoring appropriately.  The input step is counted
  47.407 +   * as one pass.
  47.408 +   */
  47.409 +  if (cinfo->progress != NULL && ! cinfo->buffered_image &&
  47.410 +      cinfo->inputctl->has_multiple_scans) {
  47.411 +    int nscans;
  47.412 +    /* Estimate number of scans to set pass_limit. */
  47.413 +    if (cinfo->progressive_mode) {
  47.414 +      /* Arbitrarily estimate 2 interleaved DC scans + 3 AC scans/component. */
  47.415 +      nscans = 2 + 3 * cinfo->num_components;
  47.416 +    } else {
  47.417 +      /* For a nonprogressive multiscan file, estimate 1 scan per component. */
  47.418 +      nscans = cinfo->num_components;
  47.419 +    }
  47.420 +    cinfo->progress->pass_counter = 0L;
  47.421 +    cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows * nscans;
  47.422 +    cinfo->progress->completed_passes = 0;
  47.423 +    cinfo->progress->total_passes = (cinfo->enable_2pass_quant ? 3 : 2);
  47.424 +    /* Count the input pass as done */
  47.425 +    master->pass_number++;
  47.426 +  }
  47.427 +#endif /* D_MULTISCAN_FILES_SUPPORTED */
  47.428 +}
  47.429 +
  47.430 +
  47.431 +/*
  47.432 + * Per-pass setup.
  47.433 + * This is called at the beginning of each output pass.  We determine which
  47.434 + * modules will be active during this pass and give them appropriate
  47.435 + * start_pass calls.  We also set is_dummy_pass to indicate whether this
  47.436 + * is a "real" output pass or a dummy pass for color quantization.
  47.437 + * (In the latter case, jdapistd.c will crank the pass to completion.)
  47.438 + */
  47.439 +
  47.440 +METHODDEF(void)
  47.441 +prepare_for_output_pass (j_decompress_ptr cinfo)
  47.442 +{
  47.443 +  my_master_ptr master = (my_master_ptr) cinfo->master;
  47.444 +
  47.445 +  if (master->pub.is_dummy_pass) {
  47.446 +#ifdef QUANT_2PASS_SUPPORTED
  47.447 +    /* Final pass of 2-pass quantization */
  47.448 +    master->pub.is_dummy_pass = FALSE;
  47.449 +    (*cinfo->cquantize->start_pass) (cinfo, FALSE);
  47.450 +    (*cinfo->post->start_pass) (cinfo, JBUF_CRANK_DEST);
  47.451 +    (*cinfo->main->start_pass) (cinfo, JBUF_CRANK_DEST);
  47.452 +#else
  47.453 +    ERREXIT(cinfo, JERR_NOT_COMPILED);
  47.454 +#endif /* QUANT_2PASS_SUPPORTED */
  47.455 +  } else {
  47.456 +    if (cinfo->quantize_colors && cinfo->colormap == NULL) {
  47.457 +      /* Select new quantization method */
  47.458 +      if (cinfo->two_pass_quantize && cinfo->enable_2pass_quant) {
  47.459 +	cinfo->cquantize = master->quantizer_2pass;
  47.460 +	master->pub.is_dummy_pass = TRUE;
  47.461 +      } else if (cinfo->enable_1pass_quant) {
  47.462 +	cinfo->cquantize = master->quantizer_1pass;
  47.463 +      } else {
  47.464 +	ERREXIT(cinfo, JERR_MODE_CHANGE);
  47.465 +      }
  47.466 +    }
  47.467 +    (*cinfo->idct->start_pass) (cinfo);
  47.468 +    (*cinfo->coef->start_output_pass) (cinfo);
  47.469 +    if (! cinfo->raw_data_out) {
  47.470 +      if (! master->using_merged_upsample)
  47.471 +	(*cinfo->cconvert->start_pass) (cinfo);
  47.472 +      (*cinfo->upsample->start_pass) (cinfo);
  47.473 +      if (cinfo->quantize_colors)
  47.474 +	(*cinfo->cquantize->start_pass) (cinfo, master->pub.is_dummy_pass);
  47.475 +      (*cinfo->post->start_pass) (cinfo,
  47.476 +	    (master->pub.is_dummy_pass ? JBUF_SAVE_AND_PASS : JBUF_PASS_THRU));
  47.477 +      (*cinfo->main->start_pass) (cinfo, JBUF_PASS_THRU);
  47.478 +    }
  47.479 +  }
  47.480 +
  47.481 +  /* Set up progress monitor's pass info if present */
  47.482 +  if (cinfo->progress != NULL) {
  47.483 +    cinfo->progress->completed_passes = master->pass_number;
  47.484 +    cinfo->progress->total_passes = master->pass_number +
  47.485 +				    (master->pub.is_dummy_pass ? 2 : 1);
  47.486 +    /* In buffered-image mode, we assume one more output pass if EOI not
  47.487 +     * yet reached, but no more passes if EOI has been reached.
  47.488 +     */
  47.489 +    if (cinfo->buffered_image && ! cinfo->inputctl->eoi_reached) {
  47.490 +      cinfo->progress->total_passes += (cinfo->enable_2pass_quant ? 2 : 1);
  47.491 +    }
  47.492 +  }
  47.493 +}
  47.494 +
  47.495 +
  47.496 +/*
  47.497 + * Finish up at end of an output pass.
  47.498 + */
  47.499 +
  47.500 +METHODDEF(void)
  47.501 +finish_output_pass (j_decompress_ptr cinfo)
  47.502 +{
  47.503 +  my_master_ptr master = (my_master_ptr) cinfo->master;
  47.504 +
  47.505 +  if (cinfo->quantize_colors)
  47.506 +    (*cinfo->cquantize->finish_pass) (cinfo);
  47.507 +  master->pass_number++;
  47.508 +}
  47.509 +
  47.510 +
  47.511 +#ifdef D_MULTISCAN_FILES_SUPPORTED
  47.512 +
  47.513 +/*
  47.514 + * Switch to a new external colormap between output passes.
  47.515 + */
  47.516 +
  47.517 +GLOBAL(void)
  47.518 +jpeg_new_colormap (j_decompress_ptr cinfo)
  47.519 +{
  47.520 +  my_master_ptr master = (my_master_ptr) cinfo->master;
  47.521 +
  47.522 +  /* Prevent application from calling me at wrong times */
  47.523 +  if (cinfo->global_state != DSTATE_BUFIMAGE)
  47.524 +    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
  47.525 +
  47.526 +  if (cinfo->quantize_colors && cinfo->enable_external_quant &&
  47.527 +      cinfo->colormap != NULL) {
  47.528 +    /* Select 2-pass quantizer for external colormap use */
  47.529 +    cinfo->cquantize = master->quantizer_2pass;
  47.530 +    /* Notify quantizer of colormap change */
  47.531 +    (*cinfo->cquantize->new_color_map) (cinfo);
  47.532 +    master->pub.is_dummy_pass = FALSE; /* just in case */
  47.533 +  } else
  47.534 +    ERREXIT(cinfo, JERR_MODE_CHANGE);
  47.535 +}
  47.536 +
  47.537 +#endif /* D_MULTISCAN_FILES_SUPPORTED */
  47.538 +
  47.539 +
  47.540 +/*
  47.541 + * Initialize master decompression control and select active modules.
  47.542 + * This is performed at the start of jpeg_start_decompress.
  47.543 + */
  47.544 +
  47.545 +GLOBAL(void)
  47.546 +jinit_master_decompress (j_decompress_ptr cinfo)
  47.547 +{
  47.548 +  my_master_ptr master;
  47.549 +
  47.550 +  master = (my_master_ptr)
  47.551 +      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
  47.552 +				  SIZEOF(my_decomp_master));
  47.553 +  cinfo->master = (struct jpeg_decomp_master *) master;
  47.554 +  master->pub.prepare_for_output_pass = prepare_for_output_pass;
  47.555 +  master->pub.finish_output_pass = finish_output_pass;
  47.556 +
  47.557 +  master->pub.is_dummy_pass = FALSE;
  47.558 +
  47.559 +  master_selection(cinfo);
  47.560 +}
    48.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    48.2 +++ b/libs/libjpeg/jdmerge.c	Sun Nov 01 00:36:56 2015 +0200
    48.3 @@ -0,0 +1,400 @@
    48.4 +/*
    48.5 + * jdmerge.c
    48.6 + *
    48.7 + * Copyright (C) 1994-1996, Thomas G. Lane.
    48.8 + * This file is part of the Independent JPEG Group's software.
    48.9 + * For conditions of distribution and use, see the accompanying README file.
   48.10 + *
   48.11 + * This file contains code for merged upsampling/color conversion.
   48.12 + *
   48.13 + * This file combines functions from jdsample.c and jdcolor.c;
   48.14 + * read those files first to understand what's going on.
   48.15 + *
   48.16 + * When the chroma components are to be upsampled by simple replication
   48.17 + * (ie, box filtering), we can save some work in color conversion by
   48.18 + * calculating all the output pixels corresponding to a pair of chroma
   48.19 + * samples at one time.  In the conversion equations
   48.20 + *	R = Y           + K1 * Cr
   48.21 + *	G = Y + K2 * Cb + K3 * Cr
   48.22 + *	B = Y + K4 * Cb
   48.23 + * only the Y term varies among the group of pixels corresponding to a pair
   48.24 + * of chroma samples, so the rest of the terms can be calculated just once.
   48.25 + * At typical sampling ratios, this eliminates half or three-quarters of the
   48.26 + * multiplications needed for color conversion.
   48.27 + *
   48.28 + * This file currently provides implementations for the following cases:
   48.29 + *	YCbCr => RGB color conversion only.
   48.30 + *	Sampling ratios of 2h1v or 2h2v.
   48.31 + *	No scaling needed at upsample time.
   48.32 + *	Corner-aligned (non-CCIR601) sampling alignment.
   48.33 + * Other special cases could be added, but in most applications these are
   48.34 + * the only common cases.  (For uncommon cases we fall back on the more
   48.35 + * general code in jdsample.c and jdcolor.c.)
   48.36 + */
   48.37 +
   48.38 +#define JPEG_INTERNALS
   48.39 +#include "jinclude.h"
   48.40 +#include "jpeglib.h"
   48.41 +
   48.42 +#ifdef UPSAMPLE_MERGING_SUPPORTED
   48.43 +
   48.44 +
   48.45 +/* Private subobject */
   48.46 +
   48.47 +typedef struct {
   48.48 +  struct jpeg_upsampler pub;	/* public fields */
   48.49 +
   48.50 +  /* Pointer to routine to do actual upsampling/conversion of one row group */
   48.51 +  JMETHOD(void, upmethod, (j_decompress_ptr cinfo,
   48.52 +			   JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr,
   48.53 +			   JSAMPARRAY output_buf));
   48.54 +
   48.55 +  /* Private state for YCC->RGB conversion */
   48.56 +  int * Cr_r_tab;		/* => table for Cr to R conversion */
   48.57 +  int * Cb_b_tab;		/* => table for Cb to B conversion */
   48.58 +  INT32 * Cr_g_tab;		/* => table for Cr to G conversion */
   48.59 +  INT32 * Cb_g_tab;		/* => table for Cb to G conversion */
   48.60 +
   48.61 +  /* For 2:1 vertical sampling, we produce two output rows at a time.
   48.62 +   * We need a "spare" row buffer to hold the second output row if the
   48.63 +   * application provides just a one-row buffer; we also use the spare
   48.64 +   * to discard the dummy last row if the image height is odd.
   48.65 +   */
   48.66 +  JSAMPROW spare_row;
   48.67 +  boolean spare_full;		/* T if spare buffer is occupied */
   48.68 +
   48.69 +  JDIMENSION out_row_width;	/* samples per output row */
   48.70 +  JDIMENSION rows_to_go;	/* counts rows remaining in image */
   48.71 +} my_upsampler;
   48.72 +
   48.73 +typedef my_upsampler * my_upsample_ptr;
   48.74 +
   48.75 +#define SCALEBITS	16	/* speediest right-shift on some machines */
   48.76 +#define ONE_HALF	((INT32) 1 << (SCALEBITS-1))
   48.77 +#define FIX(x)		((INT32) ((x) * (1L<<SCALEBITS) + 0.5))
   48.78 +
   48.79 +
   48.80 +/*
   48.81 + * Initialize tables for YCC->RGB colorspace conversion.
   48.82 + * This is taken directly from jdcolor.c; see that file for more info.
   48.83 + */
   48.84 +
   48.85 +LOCAL(void)
   48.86 +build_ycc_rgb_table (j_decompress_ptr cinfo)
   48.87 +{
   48.88 +  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
   48.89 +  int i;
   48.90 +  INT32 x;
   48.91 +  SHIFT_TEMPS
   48.92 +
   48.93 +  upsample->Cr_r_tab = (int *)
   48.94 +    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
   48.95 +				(MAXJSAMPLE+1) * SIZEOF(int));
   48.96 +  upsample->Cb_b_tab = (int *)
   48.97 +    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
   48.98 +				(MAXJSAMPLE+1) * SIZEOF(int));
   48.99 +  upsample->Cr_g_tab = (INT32 *)
  48.100 +    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
  48.101 +				(MAXJSAMPLE+1) * SIZEOF(INT32));
  48.102 +  upsample->Cb_g_tab = (INT32 *)
  48.103 +    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
  48.104 +				(MAXJSAMPLE+1) * SIZEOF(INT32));
  48.105 +
  48.106 +  for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {
  48.107 +    /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */
  48.108 +    /* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */
  48.109 +    /* Cr=>R value is nearest int to 1.40200 * x */
  48.110 +    upsample->Cr_r_tab[i] = (int)
  48.111 +		    RIGHT_SHIFT(FIX(1.40200) * x + ONE_HALF, SCALEBITS);
  48.112 +    /* Cb=>B value is nearest int to 1.77200 * x */
  48.113 +    upsample->Cb_b_tab[i] = (int)
  48.114 +		    RIGHT_SHIFT(FIX(1.77200) * x + ONE_HALF, SCALEBITS);
  48.115 +    /* Cr=>G value is scaled-up -0.71414 * x */
  48.116 +    upsample->Cr_g_tab[i] = (- FIX(0.71414)) * x;
  48.117 +    /* Cb=>G value is scaled-up -0.34414 * x */
  48.118 +    /* We also add in ONE_HALF so that need not do it in inner loop */
  48.119 +    upsample->Cb_g_tab[i] = (- FIX(0.34414)) * x + ONE_HALF;
  48.120 +  }
  48.121 +}
  48.122 +
  48.123 +
  48.124 +/*
  48.125 + * Initialize for an upsampling pass.
  48.126 + */
  48.127 +
  48.128 +METHODDEF(void)
  48.129 +start_pass_merged_upsample (j_decompress_ptr cinfo)
  48.130 +{
  48.131 +  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
  48.132 +
  48.133 +  /* Mark the spare buffer empty */
  48.134 +  upsample->spare_full = FALSE;
  48.135 +  /* Initialize total-height counter for detecting bottom of image */
  48.136 +  upsample->rows_to_go = cinfo->output_height;
  48.137 +}
  48.138 +
  48.139 +
  48.140 +/*
  48.141 + * Control routine to do upsampling (and color conversion).
  48.142 + *
  48.143 + * The control routine just handles the row buffering considerations.
  48.144 + */
  48.145 +
  48.146 +METHODDEF(void)
  48.147 +merged_2v_upsample (j_decompress_ptr cinfo,
  48.148 +		    JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
  48.149 +		    JDIMENSION in_row_groups_avail,
  48.150 +		    JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
  48.151 +		    JDIMENSION out_rows_avail)
  48.152 +/* 2:1 vertical sampling case: may need a spare row. */
  48.153 +{
  48.154 +  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
  48.155 +  JSAMPROW work_ptrs[2];
  48.156 +  JDIMENSION num_rows;		/* number of rows returned to caller */
  48.157 +
  48.158 +  if (upsample->spare_full) {
  48.159 +    /* If we have a spare row saved from a previous cycle, just return it. */
  48.160 +    jcopy_sample_rows(& upsample->spare_row, 0, output_buf + *out_row_ctr, 0,
  48.161 +		      1, upsample->out_row_width);
  48.162 +    num_rows = 1;
  48.163 +    upsample->spare_full = FALSE;
  48.164 +  } else {
  48.165 +    /* Figure number of rows to return to caller. */
  48.166 +    num_rows = 2;
  48.167 +    /* Not more than the distance to the end of the image. */
  48.168 +    if (num_rows > upsample->rows_to_go)
  48.169 +      num_rows = upsample->rows_to_go;
  48.170 +    /* And not more than what the client can accept: */
  48.171 +    out_rows_avail -= *out_row_ctr;
  48.172 +    if (num_rows > out_rows_avail)
  48.173 +      num_rows = out_rows_avail;
  48.174 +    /* Create output pointer array for upsampler. */
  48.175 +    work_ptrs[0] = output_buf[*out_row_ctr];
  48.176 +    if (num_rows > 1) {
  48.177 +      work_ptrs[1] = output_buf[*out_row_ctr + 1];
  48.178 +    } else {
  48.179 +      work_ptrs[1] = upsample->spare_row;
  48.180 +      upsample->spare_full = TRUE;
  48.181 +    }
  48.182 +    /* Now do the upsampling. */
  48.183 +    (*upsample->upmethod) (cinfo, input_buf, *in_row_group_ctr, work_ptrs);
  48.184 +  }
  48.185 +
  48.186 +  /* Adjust counts */
  48.187 +  *out_row_ctr += num_rows;
  48.188 +  upsample->rows_to_go -= num_rows;
  48.189 +  /* When the buffer is emptied, declare this input row group consumed */
  48.190 +  if (! upsample->spare_full)
  48.191 +    (*in_row_group_ctr)++;
  48.192 +}
  48.193 +
  48.194 +
  48.195 +METHODDEF(void)
  48.196 +merged_1v_upsample (j_decompress_ptr cinfo,
  48.197 +		    JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
  48.198 +		    JDIMENSION in_row_groups_avail,
  48.199 +		    JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
  48.200 +		    JDIMENSION out_rows_avail)
  48.201 +/* 1:1 vertical sampling case: much easier, never need a spare row. */
  48.202 +{
  48.203 +  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
  48.204 +
  48.205 +  /* Just do the upsampling. */
  48.206 +  (*upsample->upmethod) (cinfo, input_buf, *in_row_group_ctr,
  48.207 +			 output_buf + *out_row_ctr);
  48.208 +  /* Adjust counts */
  48.209 +  (*out_row_ctr)++;
  48.210 +  (*in_row_group_ctr)++;
  48.211 +}
  48.212 +
  48.213 +
  48.214 +/*
  48.215 + * These are the routines invoked by the control routines to do
  48.216 + * the actual upsampling/conversion.  One row group is processed per call.
  48.217 + *
  48.218 + * Note: since we may be writing directly into application-supplied buffers,
  48.219 + * we have to be honest about the output width; we can't assume the buffer
  48.220 + * has been rounded up to an even width.
  48.221 + */
  48.222 +
  48.223 +
  48.224 +/*
  48.225 + * Upsample and color convert for the case of 2:1 horizontal and 1:1 vertical.
  48.226 + */
  48.227 +
  48.228 +METHODDEF(void)
  48.229 +h2v1_merged_upsample (j_decompress_ptr cinfo,
  48.230 +		      JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr,
  48.231 +		      JSAMPARRAY output_buf)
  48.232 +{
  48.233 +  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
  48.234 +  register int y, cred, cgreen, cblue;
  48.235 +  int cb, cr;
  48.236 +  register JSAMPROW outptr;
  48.237 +  JSAMPROW inptr0, inptr1, inptr2;
  48.238 +  JDIMENSION col;
  48.239 +  /* copy these pointers into registers if possible */
  48.240 +  register JSAMPLE * range_limit = cinfo->sample_range_limit;
  48.241 +  int * Crrtab = upsample->Cr_r_tab;
  48.242 +  int * Cbbtab = upsample->Cb_b_tab;
  48.243 +  INT32 * Crgtab = upsample->Cr_g_tab;
  48.244 +  INT32 * Cbgtab = upsample->Cb_g_tab;
  48.245 +  SHIFT_TEMPS
  48.246 +
  48.247 +  inptr0 = input_buf[0][in_row_group_ctr];
  48.248 +  inptr1 = input_buf[1][in_row_group_ctr];
  48.249 +  inptr2 = input_buf[2][in_row_group_ctr];
  48.250 +  outptr = output_buf[0];
  48.251 +  /* Loop for each pair of output pixels */
  48.252 +  for (col = cinfo->output_width >> 1; col > 0; col--) {
  48.253 +    /* Do the chroma part of the calculation */
  48.254 +    cb = GETJSAMPLE(*inptr1++);
  48.255 +    cr = GETJSAMPLE(*inptr2++);
  48.256 +    cred = Crrtab[cr];
  48.257 +    cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
  48.258 +    cblue = Cbbtab[cb];
  48.259 +    /* Fetch 2 Y values and emit 2 pixels */
  48.260 +    y  = GETJSAMPLE(*inptr0++);
  48.261 +    outptr[RGB_RED] =   range_limit[y + cred];
  48.262 +    outptr[RGB_GREEN] = range_limit[y + cgreen];
  48.263 +    outptr[RGB_BLUE] =  range_limit[y + cblue];
  48.264 +    outptr += RGB_PIXELSIZE;
  48.265 +    y  = GETJSAMPLE(*inptr0++);
  48.266 +    outptr[RGB_RED] =   range_limit[y + cred];
  48.267 +    outptr[RGB_GREEN] = range_limit[y + cgreen];
  48.268 +    outptr[RGB_BLUE] =  range_limit[y + cblue];
  48.269 +    outptr += RGB_PIXELSIZE;
  48.270 +  }
  48.271 +  /* If image width is odd, do the last output column separately */
  48.272 +  if (cinfo->output_width & 1) {
  48.273 +    cb = GETJSAMPLE(*inptr1);
  48.274 +    cr = GETJSAMPLE(*inptr2);
  48.275 +    cred = Crrtab[cr];
  48.276 +    cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
  48.277 +    cblue = Cbbtab[cb];
  48.278 +    y  = GETJSAMPLE(*inptr0);
  48.279 +    outptr[RGB_RED] =   range_limit[y + cred];
  48.280 +    outptr[RGB_GREEN] = range_limit[y + cgreen];
  48.281 +    outptr[RGB_BLUE] =  range_limit[y + cblue];
  48.282 +  }
  48.283 +}
  48.284 +
  48.285 +
  48.286 +/*
  48.287 + * Upsample and color convert for the case of 2:1 horizontal and 2:1 vertical.
  48.288 + */
  48.289 +
  48.290 +METHODDEF(void)
  48.291 +h2v2_merged_upsample (j_decompress_ptr cinfo,
  48.292 +		      JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr,
  48.293 +		      JSAMPARRAY output_buf)
  48.294 +{
  48.295 +  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
  48.296 +  register int y, cred, cgreen, cblue;
  48.297 +  int cb, cr;
  48.298 +  register JSAMPROW outptr0, outptr1;
  48.299 +  JSAMPROW inptr00, inptr01, inptr1, inptr2;
  48.300 +  JDIMENSION col;
  48.301 +  /* copy these pointers into registers if possible */
  48.302 +  register JSAMPLE * range_limit = cinfo->sample_range_limit;
  48.303 +  int * Crrtab = upsample->Cr_r_tab;
  48.304 +  int * Cbbtab = upsample->Cb_b_tab;
  48.305 +  INT32 * Crgtab = upsample->Cr_g_tab;
  48.306 +  INT32 * Cbgtab = upsample->Cb_g_tab;
  48.307 +  SHIFT_TEMPS
  48.308 +
  48.309 +  inptr00 = input_buf[0][in_row_group_ctr*2];
  48.310 +  inptr01 = input_buf[0][in_row_group_ctr*2 + 1];
  48.311 +  inptr1 = input_buf[1][in_row_group_ctr];
  48.312 +  inptr2 = input_buf[2][in_row_group_ctr];
  48.313 +  outptr0 = output_buf[0];
  48.314 +  outptr1 = output_buf[1];
  48.315 +  /* Loop for each group of output pixels */
  48.316 +  for (col = cinfo->output_width >> 1; col > 0; col--) {
  48.317 +    /* Do the chroma part of the calculation */
  48.318 +    cb = GETJSAMPLE(*inptr1++);
  48.319 +    cr = GETJSAMPLE(*inptr2++);
  48.320 +    cred = Crrtab[cr];
  48.321 +    cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
  48.322 +    cblue = Cbbtab[cb];
  48.323 +    /* Fetch 4 Y values and emit 4 pixels */
  48.324 +    y  = GETJSAMPLE(*inptr00++);
  48.325 +    outptr0[RGB_RED] =   range_limit[y + cred];
  48.326 +    outptr0[RGB_GREEN] = range_limit[y + cgreen];
  48.327 +    outptr0[RGB_BLUE] =  range_limit[y + cblue];
  48.328 +    outptr0 += RGB_PIXELSIZE;
  48.329 +    y  = GETJSAMPLE(*inptr00++);
  48.330 +    outptr0[RGB_RED] =   range_limit[y + cred];
  48.331 +    outptr0[RGB_GREEN] = range_limit[y + cgreen];
  48.332 +    outptr0[RGB_BLUE] =  range_limit[y + cblue];
  48.333 +    outptr0 += RGB_PIXELSIZE;
  48.334 +    y  = GETJSAMPLE(*inptr01++);
  48.335 +    outptr1[RGB_RED] =   range_limit[y + cred];
  48.336 +    outptr1[RGB_GREEN] = range_limit[y + cgreen];
  48.337 +    outptr1[RGB_BLUE] =  range_limit[y + cblue];
  48.338 +    outptr1 += RGB_PIXELSIZE;
  48.339 +    y  = GETJSAMPLE(*inptr01++);
  48.340 +    outptr1[RGB_RED] =   range_limit[y + cred];
  48.341 +    outptr1[RGB_GREEN] = range_limit[y + cgreen];
  48.342 +    outptr1[RGB_BLUE] =  range_limit[y + cblue];
  48.343 +    outptr1 += RGB_PIXELSIZE;
  48.344 +  }
  48.345 +  /* If image width is odd, do the last output column separately */
  48.346 +  if (cinfo->output_width & 1) {
  48.347 +    cb = GETJSAMPLE(*inptr1);
  48.348 +    cr = GETJSAMPLE(*inptr2);
  48.349 +    cred = Crrtab[cr];
  48.350 +    cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
  48.351 +    cblue = Cbbtab[cb];
  48.352 +    y  = GETJSAMPLE(*inptr00);
  48.353 +    outptr0[RGB_RED] =   range_limit[y + cred];
  48.354 +    outptr0[RGB_GREEN] = range_limit[y + cgreen];
  48.355 +    outptr0[RGB_BLUE] =  range_limit[y + cblue];
  48.356 +    y  = GETJSAMPLE(*inptr01);
  48.357 +    outptr1[RGB_RED] =   range_limit[y + cred];
  48.358 +    outptr1[RGB_GREEN] = range_limit[y + cgreen];
  48.359 +    outptr1[RGB_BLUE] =  range_limit[y + cblue];
  48.360 +  }
  48.361 +}
  48.362 +
  48.363 +
  48.364 +/*
  48.365 + * Module initialization routine for merged upsampling/color conversion.
  48.366 + *
  48.367 + * NB: this is called under the conditions determined by use_merged_upsample()
  48.368 + * in jdmaster.c.  That routine MUST correspond to the actual capabilities
  48.369 + * of this module; no safety checks are made here.
  48.370 + */
  48.371 +
  48.372 +GLOBAL(void)
  48.373 +jinit_merged_upsampler (j_decompress_ptr cinfo)
  48.374 +{
  48.375 +  my_upsample_ptr upsample;
  48.376 +
  48.377 +  upsample = (my_upsample_ptr)
  48.378 +    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
  48.379 +				SIZEOF(my_upsampler));
  48.380 +  cinfo->upsample = (struct jpeg_upsampler *) upsample;
  48.381 +  upsample->pub.start_pass = start_pass_merged_upsample;
  48.382 +  upsample->pub.need_context_rows = FALSE;
  48.383 +
  48.384 +  upsample->out_row_width = cinfo->output_width * cinfo->out_color_components;
  48.385 +
  48.386 +  if (cinfo->max_v_samp_factor == 2) {
  48.387 +    upsample->pub.upsample = merged_2v_upsample;
  48.388 +    upsample->upmethod = h2v2_merged_upsample;
  48.389 +    /* Allocate a spare row buffer */
  48.390 +    upsample->spare_row = (JSAMPROW)
  48.391 +      (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,
  48.392 +		(size_t) (upsample->out_row_width * SIZEOF(JSAMPLE)));
  48.393 +  } else {
  48.394 +    upsample->pub.upsample = merged_1v_upsample;
  48.395 +    upsample->upmethod = h2v1_merged_upsample;
  48.396 +    /* No spare row needed */
  48.397 +    upsample->spare_row = NULL;
  48.398 +  }
  48.399 +
  48.400 +  build_ycc_rgb_table(cinfo);
  48.401 +}
  48.402 +
  48.403 +#endif /* UPSAMPLE_MERGING_SUPPORTED */
    49.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    49.2 +++ b/libs/libjpeg/jdphuff.c	Sun Nov 01 00:36:56 2015 +0200
    49.3 @@ -0,0 +1,668 @@
    49.4 +/*
    49.5 + * jdphuff.c
    49.6 + *
    49.7 + * Copyright (C) 1995-1997, Thomas G. Lane.
    49.8 + * This file is part of the Independent JPEG Group's software.
    49.9 + * For conditions of distribution and use, see the accompanying README file.
   49.10 + *
   49.11 + * This file contains Huffman entropy decoding routines for progressive JPEG.
   49.12 + *
   49.13 + * Much of the complexity here has to do with supporting input suspension.
   49.14 + * If the data source module demands suspension, we want to be able to back
   49.15 + * up to the start of the current MCU.  To do this, we copy state variables
   49.16 + * into local working storage, and update them back to the permanent
   49.17 + * storage only upon successful completion of an MCU.
   49.18 + */
   49.19 +
   49.20 +#define JPEG_INTERNALS
   49.21 +#include "jinclude.h"
   49.22 +#include "jpeglib.h"
   49.23 +#include "jdhuff.h"		/* Declarations shared with jdhuff.c */
   49.24 +
   49.25 +
   49.26 +#ifdef D_PROGRESSIVE_SUPPORTED
   49.27 +
   49.28 +/*
   49.29 + * Expanded entropy decoder object for progressive Huffman decoding.
   49.30 + *
   49.31 + * The savable_state subrecord contains fields that change within an MCU,
   49.32 + * but must not be updated permanently until we complete the MCU.
   49.33 + */
   49.34 +
   49.35 +typedef struct {
   49.36 +  unsigned int EOBRUN;			/* remaining EOBs in EOBRUN */
   49.37 +  int last_dc_val[MAX_COMPS_IN_SCAN];	/* last DC coef for each component */
   49.38 +} savable_state;
   49.39 +
   49.40 +/* This macro is to work around compilers with missing or broken
   49.41 + * structure assignment.  You'll need to fix this code if you have
   49.42 + * such a compiler and you change MAX_COMPS_IN_SCAN.
   49.43 + */
   49.44 +
   49.45 +#ifndef NO_STRUCT_ASSIGN
   49.46 +#define ASSIGN_STATE(dest,src)  ((dest) = (src))
   49.47 +#else
   49.48 +#if MAX_COMPS_IN_SCAN == 4
   49.49 +#define ASSIGN_STATE(dest,src)  \
   49.50 +	((dest).EOBRUN = (src).EOBRUN, \
   49.51 +	 (dest).last_dc_val[0] = (src).last_dc_val[0], \
   49.52 +	 (dest).last_dc_val[1] = (src).last_dc_val[1], \
   49.53 +	 (dest).last_dc_val[2] = (src).last_dc_val[2], \
   49.54 +	 (dest).last_dc_val[3] = (src).last_dc_val[3])
   49.55 +#endif
   49.56 +#endif
   49.57 +
   49.58 +
   49.59 +typedef struct {
   49.60 +  struct jpeg_entropy_decoder pub; /* public fields */
   49.61 +
   49.62 +  /* These fields are loaded into local variables at start of each MCU.
   49.63 +   * In case of suspension, we exit WITHOUT updating them.
   49.64 +   */
   49.65 +  bitread_perm_state bitstate;	/* Bit buffer at start of MCU */
   49.66 +  savable_state saved;		/* Other state at start of MCU */
   49.67 +
   49.68 +  /* These fields are NOT loaded into local working state. */
   49.69 +  unsigned int restarts_to_go;	/* MCUs left in this restart interval */
   49.70 +
   49.71 +  /* Pointers to derived tables (these workspaces have image lifespan) */
   49.72 +  d_derived_tbl * derived_tbls[NUM_HUFF_TBLS];
   49.73 +
   49.74 +  d_derived_tbl * ac_derived_tbl; /* active table during an AC scan */
   49.75 +} phuff_entropy_decoder;
   49.76 +
   49.77 +typedef phuff_entropy_decoder * phuff_entropy_ptr;
   49.78 +
   49.79 +/* Forward declarations */
   49.80 +METHODDEF(boolean) decode_mcu_DC_first JPP((j_decompress_ptr cinfo,
   49.81 +					    JBLOCKROW *MCU_data));
   49.82 +METHODDEF(boolean) decode_mcu_AC_first JPP((j_decompress_ptr cinfo,
   49.83 +					    JBLOCKROW *MCU_data));
   49.84 +METHODDEF(boolean) decode_mcu_DC_refine JPP((j_decompress_ptr cinfo,
   49.85 +					     JBLOCKROW *MCU_data));
   49.86 +METHODDEF(boolean) decode_mcu_AC_refine JPP((j_decompress_ptr cinfo,
   49.87 +					     JBLOCKROW *MCU_data));
   49.88 +
   49.89 +
   49.90 +/*
   49.91 + * Initialize for a Huffman-compressed scan.
   49.92 + */
   49.93 +
   49.94 +METHODDEF(void)
   49.95 +start_pass_phuff_decoder (j_decompress_ptr cinfo)
   49.96 +{
   49.97 +  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
   49.98 +  boolean is_DC_band, bad;
   49.99 +  int ci, coefi, tbl;
  49.100 +  int *coef_bit_ptr;
  49.101 +  jpeg_component_info * compptr;
  49.102 +
  49.103 +  is_DC_band = (cinfo->Ss == 0);
  49.104 +
  49.105 +  /* Validate scan parameters */
  49.106 +  bad = FALSE;
  49.107 +  if (is_DC_band) {
  49.108 +    if (cinfo->Se != 0)
  49.109 +      bad = TRUE;
  49.110 +  } else {
  49.111 +    /* need not check Ss/Se < 0 since they came from unsigned bytes */
  49.112 +    if (cinfo->Ss > cinfo->Se || cinfo->Se >= DCTSIZE2)
  49.113 +      bad = TRUE;
  49.114 +    /* AC scans may have only one component */
  49.115 +    if (cinfo->comps_in_scan != 1)
  49.116 +      bad = TRUE;
  49.117 +  }
  49.118 +  if (cinfo->Ah != 0) {
  49.119 +    /* Successive approximation refinement scan: must have Al = Ah-1. */
  49.120 +    if (cinfo->Al != cinfo->Ah-1)
  49.121 +      bad = TRUE;
  49.122 +  }
  49.123 +  if (cinfo->Al > 13)		/* need not check for < 0 */
  49.124 +    bad = TRUE;
  49.125 +  /* Arguably the maximum Al value should be less than 13 for 8-bit precision,
  49.126 +   * but the spec doesn't say so, and we try to be liberal about what we
  49.127 +   * accept.  Note: large Al values could result in out-of-range DC
  49.128 +   * coefficients during early scans, leading to bizarre displays due to
  49.129 +   * overflows in the IDCT math.  But we won't crash.
  49.130 +   */
  49.131 +  if (bad)
  49.132 +    ERREXIT4(cinfo, JERR_BAD_PROGRESSION,
  49.133 +	     cinfo->Ss, cinfo->Se, cinfo->Ah, cinfo->Al);
  49.134 +  /* Update progression status, and verify that scan order is legal.
  49.135 +   * Note that inter-scan inconsistencies are treated as warnings
  49.136 +   * not fatal errors ... not clear if this is right way to behave.
  49.137 +   */
  49.138 +  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
  49.139 +    int cindex = cinfo->cur_comp_info[ci]->component_index;
  49.140 +    coef_bit_ptr = & cinfo->coef_bits[cindex][0];
  49.141 +    if (!is_DC_band && coef_bit_ptr[0] < 0) /* AC without prior DC scan */
  49.142 +      WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, 0);
  49.143 +    for (coefi = cinfo->Ss; coefi <= cinfo->Se; coefi++) {
  49.144 +      int expected = (coef_bit_ptr[coefi] < 0) ? 0 : coef_bit_ptr[coefi];
  49.145 +      if (cinfo->Ah != expected)
  49.146 +	WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, coefi);
  49.147 +      coef_bit_ptr[coefi] = cinfo->Al;
  49.148 +    }
  49.149 +  }
  49.150 +
  49.151 +  /* Select MCU decoding routine */
  49.152 +  if (cinfo->Ah == 0) {
  49.153 +    if (is_DC_band)
  49.154 +      entropy->pub.decode_mcu = decode_mcu_DC_first;
  49.155 +    else
  49.156 +      entropy->pub.decode_mcu = decode_mcu_AC_first;
  49.157 +  } else {
  49.158 +    if (is_DC_band)
  49.159 +      entropy->pub.decode_mcu = decode_mcu_DC_refine;
  49.160 +    else
  49.161 +      entropy->pub.decode_mcu = decode_mcu_AC_refine;
  49.162 +  }
  49.163 +
  49.164 +  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
  49.165 +    compptr = cinfo->cur_comp_info[ci];
  49.166 +    /* Make sure requested tables are present, and compute derived tables.
  49.167 +     * We may build same derived table more than once, but it's not expensive.
  49.168 +     */
  49.169 +    if (is_DC_band) {
  49.170 +      if (cinfo->Ah == 0) {	/* DC refinement needs no table */
  49.171 +	tbl = compptr->dc_tbl_no;
  49.172 +	jpeg_make_d_derived_tbl(cinfo, TRUE, tbl,
  49.173 +				& entropy->derived_tbls[tbl]);
  49.174 +      }
  49.175 +    } else {
  49.176 +      tbl = compptr->ac_tbl_no;
  49.177 +      jpeg_make_d_derived_tbl(cinfo, FALSE, tbl,
  49.178 +			      & entropy->derived_tbls[tbl]);
  49.179 +      /* remember the single active table */
  49.180 +      entropy->ac_derived_tbl = entropy->derived_tbls[tbl];
  49.181 +    }
  49.182 +    /* Initialize DC predictions to 0 */
  49.183 +    entropy->saved.last_dc_val[ci] = 0;
  49.184 +  }
  49.185 +
  49.186 +  /* Initialize bitread state variables */
  49.187 +  entropy->bitstate.bits_left = 0;
  49.188 +  entropy->bitstate.get_buffer = 0; /* unnecessary, but keeps Purify quiet */
  49.189 +  entropy->pub.insufficient_data = FALSE;
  49.190 +
  49.191 +  /* Initialize private state variables */
  49.192 +  entropy->saved.EOBRUN = 0;
  49.193 +
  49.194 +  /* Initialize restart counter */
  49.195 +  entropy->restarts_to_go = cinfo->restart_interval;
  49.196 +}
  49.197 +
  49.198 +
  49.199 +/*
  49.200 + * Figure F.12: extend sign bit.
  49.201 + * On some machines, a shift and add will be faster than a table lookup.
  49.202 + */
  49.203 +
  49.204 +#ifdef AVOID_TABLES
  49.205 +
  49.206 +#define HUFF_EXTEND(x,s)  ((x) < (1<<((s)-1)) ? (x) + (((-1)<<(s)) + 1) : (x))
  49.207 +
  49.208 +#else
  49.209 +
  49.210 +#define HUFF_EXTEND(x,s)  ((x) < extend_test[s] ? (x) + extend_offset[s] : (x))
  49.211 +
  49.212 +static const int extend_test[16] =   /* entry n is 2**(n-1) */
  49.213 +  { 0, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080,
  49.214 +    0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000 };
  49.215 +
  49.216 +static const int extend_offset[16] = /* entry n is (-1 << n) + 1 */
  49.217 +  { 0, ((-1)<<1) + 1, ((-1)<<2) + 1, ((-1)<<3) + 1, ((-1)<<4) + 1,
  49.218 +    ((-1)<<5) + 1, ((-1)<<6) + 1, ((-1)<<7) + 1, ((-1)<<8) + 1,
  49.219 +    ((-1)<<9) + 1, ((-1)<<10) + 1, ((-1)<<11) + 1, ((-1)<<12) + 1,
  49.220 +    ((-1)<<13) + 1, ((-1)<<14) + 1, ((-1)<<15) + 1 };
  49.221 +
  49.222 +#endif /* AVOID_TABLES */
  49.223 +
  49.224 +
  49.225 +/*
  49.226 + * Check for a restart marker & resynchronize decoder.
  49.227 + * Returns FALSE if must suspend.
  49.228 + */
  49.229 +
  49.230 +LOCAL(boolean)
  49.231 +process_restart (j_decompress_ptr cinfo)
  49.232 +{
  49.233 +  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
  49.234 +  int ci;
  49.235 +
  49.236 +  /* Throw away any unused bits remaining in bit buffer; */
  49.237 +  /* include any full bytes in next_marker's count of discarded bytes */
  49.238 +  cinfo->marker->discarded_bytes += entropy->bitstate.bits_left / 8;
  49.239 +  entropy->bitstate.bits_left = 0;
  49.240 +
  49.241 +  /* Advance past the RSTn marker */
  49.242 +  if (! (*cinfo->marker->read_restart_marker) (cinfo))
  49.243 +    return FALSE;
  49.244 +
  49.245 +  /* Re-initialize DC predictions to 0 */
  49.246 +  for (ci = 0; ci < cinfo->comps_in_scan; ci++)
  49.247 +    entropy->saved.last_dc_val[ci] = 0;
  49.248 +  /* Re-init EOB run count, too */
  49.249 +  entropy->saved.EOBRUN = 0;
  49.250 +
  49.251 +  /* Reset restart counter */
  49.252 +  entropy->restarts_to_go = cinfo->restart_interval;
  49.253 +
  49.254 +  /* Reset out-of-data flag, unless read_restart_marker left us smack up
  49.255 +   * against a marker.  In that case we will end up treating the next data
  49.256 +   * segment as empty, and we can avoid producing bogus output pixels by
  49.257 +   * leaving the flag set.
  49.258 +   */
  49.259 +  if (cinfo->unread_marker == 0)
  49.260 +    entropy->pub.insufficient_data = FALSE;
  49.261 +
  49.262 +  return TRUE;
  49.263 +}
  49.264 +
  49.265 +
  49.266 +/*
  49.267 + * Huffman MCU decoding.
  49.268 + * Each of these routines decodes and returns one MCU's worth of
  49.269 + * Huffman-compressed coefficients. 
  49.270 + * The coefficients are reordered from zigzag order into natural array order,
  49.271 + * but are not dequantized.
  49.272 + *
  49.273 + * The i'th block of the MCU is stored into the block pointed to by
  49.274 + * MCU_data[i].  WE ASSUME THIS AREA IS INITIALLY ZEROED BY THE CALLER.
  49.275 + *
  49.276 + * We return FALSE if data source requested suspension.  In that case no
  49.277 + * changes have been made to permanent state.  (Exception: some output
  49.278 + * coefficients may already have been assigned.  This is harmless for
  49.279 + * spectral selection, since we'll just re-assign them on the next call.
  49.280 + * Successive approximation AC refinement has to be more careful, however.)
  49.281 + */
  49.282 +
  49.283 +/*
  49.284 + * MCU decoding for DC initial scan (either spectral selection,
  49.285 + * or first pass of successive approximation).
  49.286 + */
  49.287 +
  49.288 +METHODDEF(boolean)
  49.289 +decode_mcu_DC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
  49.290 +{   
  49.291 +  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
  49.292 +  int Al = cinfo->Al;
  49.293 +  register int s, r;
  49.294 +  int blkn, ci;
  49.295 +  JBLOCKROW block;
  49.296 +  BITREAD_STATE_VARS;
  49.297 +  savable_state state;
  49.298 +  d_derived_tbl * tbl;
  49.299 +  jpeg_component_info * compptr;
  49.300 +
  49.301 +  /* Process restart marker if needed; may have to suspend */
  49.302 +  if (cinfo->restart_interval) {
  49.303 +    if (entropy->restarts_to_go == 0)
  49.304 +      if (! process_restart(cinfo))
  49.305 +	return FALSE;
  49.306 +  }
  49.307 +
  49.308 +  /* If we've run out of data, just leave the MCU set to zeroes.
  49.309 +   * This way, we return uniform gray for the remainder of the segment.
  49.310 +   */
  49.311 +  if (! entropy->pub.insufficient_data) {
  49.312 +
  49.313 +    /* Load up working state */
  49.314 +    BITREAD_LOAD_STATE(cinfo,entropy->bitstate);
  49.315 +    ASSIGN_STATE(state, entropy->saved);
  49.316 +
  49.317 +    /* Outer loop handles each block in the MCU */
  49.318 +
  49.319 +    for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
  49.320 +      block = MCU_data[blkn];
  49.321 +      ci = cinfo->MCU_membership[blkn];
  49.322 +      compptr = cinfo->cur_comp_info[ci];
  49.323 +      tbl = entropy->derived_tbls[compptr->dc_tbl_no];
  49.324 +
  49.325 +      /* Decode a single block's worth of coefficients */
  49.326 +
  49.327 +      /* Section F.2.2.1: decode the DC coefficient difference */
  49.328 +      HUFF_DECODE(s, br_state, tbl, return FALSE, label1);
  49.329 +      if (s) {
  49.330 +	CHECK_BIT_BUFFER(br_state, s, return FALSE);
  49.331 +	r = GET_BITS(s);
  49.332 +	s = HUFF_EXTEND(r, s);
  49.333 +      }
  49.334 +
  49.335 +      /* Convert DC difference to actual value, update last_dc_val */
  49.336 +      s += state.last_dc_val[ci];
  49.337 +      state.last_dc_val[ci] = s;
  49.338 +      /* Scale and output the coefficient (assumes jpeg_natural_order[0]=0) */
  49.339 +      (*block)[0] = (JCOEF) (s << Al);
  49.340 +    }
  49.341 +
  49.342 +    /* Completed MCU, so update state */
  49.343 +    BITREAD_SAVE_STATE(cinfo,entropy->bitstate);
  49.344 +    ASSIGN_STATE(entropy->saved, state);
  49.345 +  }
  49.346 +
  49.347 +  /* Account for restart interval (no-op if not using restarts) */
  49.348 +  entropy->restarts_to_go--;
  49.349 +
  49.350 +  return TRUE;
  49.351 +}
  49.352 +
  49.353 +
  49.354 +/*
  49.355 + * MCU decoding for AC initial scan (either spectral selection,
  49.356 + * or first pass of successive approximation).
  49.357 + */
  49.358 +
  49.359 +METHODDEF(boolean)
  49.360 +decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
  49.361 +{   
  49.362 +  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
  49.363 +  int Se = cinfo->Se;
  49.364 +  int Al = cinfo->Al;
  49.365 +  register int s, k, r;
  49.366 +  unsigned int EOBRUN;
  49.367 +  JBLOCKROW block;
  49.368 +  BITREAD_STATE_VARS;
  49.369 +  d_derived_tbl * tbl;
  49.370 +
  49.371 +  /* Process restart marker if needed; may have to suspend */
  49.372 +  if (cinfo->restart_interval) {
  49.373 +    if (entropy->restarts_to_go == 0)
  49.374 +      if (! process_restart(cinfo))
  49.375 +	return FALSE;
  49.376 +  }
  49.377 +
  49.378 +  /* If we've run out of data, just leave the MCU set to zeroes.
  49.379 +   * This way, we return uniform gray for the remainder of the segment.
  49.380 +   */
  49.381 +  if (! entropy->pub.insufficient_data) {
  49.382 +
  49.383 +    /* Load up working state.
  49.384 +     * We can avoid loading/saving bitread state if in an EOB run.
  49.385 +     */
  49.386 +    EOBRUN = entropy->saved.EOBRUN;	/* only part of saved state we need */
  49.387 +
  49.388 +    /* There is always only one block per MCU */
  49.389 +
  49.390 +    if (EOBRUN > 0)		/* if it's a band of zeroes... */
  49.391 +      EOBRUN--;			/* ...process it now (we do nothing) */
  49.392 +    else {
  49.393 +      BITREAD_LOAD_STATE(cinfo,entropy->bitstate);
  49.394 +      block = MCU_data[0];
  49.395 +      tbl = entropy->ac_derived_tbl;
  49.396 +
  49.397 +      for (k = cinfo->Ss; k <= Se; k++) {
  49.398 +	HUFF_DECODE(s, br_state, tbl, return FALSE, label2);
  49.399 +	r = s >> 4;
  49.400 +	s &= 15;
  49.401 +	if (s) {
  49.402 +	  k += r;
  49.403 +	  CHECK_BIT_BUFFER(br_state, s, return FALSE);
  49.404 +	  r = GET_BITS(s);
  49.405 +	  s = HUFF_EXTEND(r, s);
  49.406 +	  /* Scale and output coefficient in natural (dezigzagged) order */
  49.407 +	  (*block)[jpeg_natural_order[k]] = (JCOEF) (s << Al);
  49.408 +	} else {
  49.409 +	  if (r == 15) {	/* ZRL */
  49.410 +	    k += 15;		/* skip 15 zeroes in band */
  49.411 +	  } else {		/* EOBr, run length is 2^r + appended bits */
  49.412 +	    EOBRUN = 1 << r;
  49.413 +	    if (r) {		/* EOBr, r > 0 */
  49.414 +	      CHECK_BIT_BUFFER(br_state, r, return FALSE);
  49.415 +	      r = GET_BITS(r);
  49.416 +	      EOBRUN += r;
  49.417 +	    }
  49.418 +	    EOBRUN--;		/* this band is processed at this moment */
  49.419 +	    break;		/* force end-of-band */
  49.420 +	  }
  49.421 +	}
  49.422 +      }
  49.423 +
  49.424 +      BITREAD_SAVE_STATE(cinfo,entropy->bitstate);
  49.425 +    }
  49.426 +
  49.427 +    /* Completed MCU, so update state */
  49.428 +    entropy->saved.EOBRUN = EOBRUN;	/* only part of saved state we need */
  49.429 +  }
  49.430 +
  49.431 +  /* Account for restart interval (no-op if not using restarts) */
  49.432 +  entropy->restarts_to_go--;
  49.433 +
  49.434 +  return TRUE;
  49.435 +}
  49.436 +
  49.437 +
  49.438 +/*
  49.439 + * MCU decoding for DC successive approximation refinement scan.
  49.440 + * Note: we assume such scans can be multi-component, although the spec
  49.441 + * is not very clear on the point.
  49.442 + */
  49.443 +
  49.444 +METHODDEF(boolean)
  49.445 +decode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
  49.446 +{   
  49.447 +  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
  49.448 +  int p1 = 1 << cinfo->Al;	/* 1 in the bit position being coded */
  49.449 +  int blkn;
  49.450 +  JBLOCKROW block;
  49.451 +  BITREAD_STATE_VARS;
  49.452 +
  49.453 +  /* Process restart marker if needed; may have to suspend */
  49.454 +  if (cinfo->restart_interval) {
  49.455 +    if (entropy->restarts_to_go == 0)
  49.456 +      if (! process_restart(cinfo))
  49.457 +	return FALSE;
  49.458 +  }
  49.459 +
  49.460 +  /* Not worth the cycles to check insufficient_data here,
  49.461 +   * since we will not change the data anyway if we read zeroes.
  49.462 +   */
  49.463 +
  49.464 +  /* Load up working state */
  49.465 +  BITREAD_LOAD_STATE(cinfo,entropy->bitstate);
  49.466 +
  49.467 +  /* Outer loop handles each block in the MCU */
  49.468 +
  49.469 +  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
  49.470 +    block = MCU_data[blkn];
  49.471 +
  49.472 +    /* Encoded data is simply the next bit of the two's-complement DC value */
  49.473 +    CHECK_BIT_BUFFER(br_state, 1, return FALSE);
  49.474 +    if (GET_BITS(1))
  49.475 +      (*block)[0] |= p1;
  49.476 +    /* Note: since we use |=, repeating the assignment later is safe */
  49.477 +  }
  49.478 +
  49.479 +  /* Completed MCU, so update state */
  49.480 +  BITREAD_SAVE_STATE(cinfo,entropy->bitstate);
  49.481 +
  49.482 +  /* Account for restart interval (no-op if not using restarts) */
  49.483 +  entropy->restarts_to_go--;
  49.484 +
  49.485 +  return TRUE;
  49.486 +}
  49.487 +
  49.488 +
  49.489 +/*
  49.490 + * MCU decoding for AC successive approximation refinement scan.
  49.491 + */
  49.492 +
  49.493 +METHODDEF(boolean)
  49.494 +decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
  49.495 +{   
  49.496 +  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
  49.497 +  int Se = cinfo->Se;
  49.498 +  int p1 = 1 << cinfo->Al;	/* 1 in the bit position being coded */
  49.499 +  int m1 = (-1) << cinfo->Al;	/* -1 in the bit position being coded */
  49.500 +  register int s, k, r;
  49.501 +  unsigned int EOBRUN;
  49.502 +  JBLOCKROW block;
  49.503 +  JCOEFPTR thiscoef;
  49.504 +  BITREAD_STATE_VARS;
  49.505 +  d_derived_tbl * tbl;
  49.506 +  int num_newnz;
  49.507 +  int newnz_pos[DCTSIZE2];
  49.508 +
  49.509 +  /* Process restart marker if needed; may have to suspend */
  49.510 +  if (cinfo->restart_interval) {
  49.511 +    if (entropy->restarts_to_go == 0)
  49.512 +      if (! process_restart(cinfo))
  49.513 +	return FALSE;
  49.514 +  }
  49.515 +
  49.516 +  /* If we've run out of data, don't modify the MCU.
  49.517 +   */
  49.518 +  if (! entropy->pub.insufficient_data) {
  49.519 +
  49.520 +    /* Load up working state */
  49.521 +    BITREAD_LOAD_STATE(cinfo,entropy->bitstate);
  49.522 +    EOBRUN = entropy->saved.EOBRUN; /* only part of saved state we need */
  49.523 +
  49.524 +    /* There is always only one block per MCU */
  49.525 +    block = MCU_data[0];
  49.526 +    tbl = entropy->ac_derived_tbl;
  49.527 +
  49.528 +    /* If we are forced to suspend, we must undo the assignments to any newly
  49.529 +     * nonzero coefficients in the block, because otherwise we'd get confused
  49.530 +     * next time about which coefficients were already nonzero.
  49.531 +     * But we need not undo addition of bits to already-nonzero coefficients;
  49.532 +     * instead, we can test the current bit to see if we already did it.
  49.533 +     */
  49.534 +    num_newnz = 0;
  49.535 +
  49.536 +    /* initialize coefficient loop counter to start of band */
  49.537 +    k = cinfo->Ss;
  49.538 +
  49.539 +    if (EOBRUN == 0) {
  49.540 +      for (; k <= Se; k++) {
  49.541 +	HUFF_DECODE(s, br_state, tbl, goto undoit, label3);
  49.542 +	r = s >> 4;
  49.543 +	s &= 15;
  49.544 +	if (s) {
  49.545 +	  if (s != 1)		/* size of new coef should always be 1 */
  49.546 +	    WARNMS(cinfo, JWRN_HUFF_BAD_CODE);
  49.547 +	  CHECK_BIT_BUFFER(br_state, 1, goto undoit);
  49.548 +	  if (GET_BITS(1))
  49.549 +	    s = p1;		/* newly nonzero coef is positive */
  49.550 +	  else
  49.551 +	    s = m1;		/* newly nonzero coef is negative */
  49.552 +	} else {
  49.553 +	  if (r != 15) {
  49.554 +	    EOBRUN = 1 << r;	/* EOBr, run length is 2^r + appended bits */
  49.555 +	    if (r) {
  49.556 +	      CHECK_BIT_BUFFER(br_state, r, goto undoit);
  49.557 +	      r = GET_BITS(r);
  49.558 +	      EOBRUN += r;
  49.559 +	    }
  49.560 +	    break;		/* rest of block is handled by EOB logic */
  49.561 +	  }
  49.562 +	  /* note s = 0 for processing ZRL */
  49.563 +	}
  49.564 +	/* Advance over already-nonzero coefs and r still-zero coefs,
  49.565 +	 * appending correction bits to the nonzeroes.  A correction bit is 1
  49.566 +	 * if the absolute value of the coefficient must be increased.
  49.567 +	 */
  49.568 +	do {
  49.569 +	  thiscoef = *block + jpeg_natural_order[k];
  49.570 +	  if (*thiscoef != 0) {
  49.571 +	    CHECK_BIT_BUFFER(br_state, 1, goto undoit);
  49.572 +	    if (GET_BITS(1)) {
  49.573 +	      if ((*thiscoef & p1) == 0) { /* do nothing if already set it */
  49.574 +		if (*thiscoef >= 0)
  49.575 +		  *thiscoef += p1;
  49.576 +		else
  49.577 +		  *thiscoef += m1;
  49.578 +	      }
  49.579 +	    }
  49.580 +	  } else {
  49.581 +	    if (--r < 0)
  49.582 +	      break;		/* reached target zero coefficient */
  49.583 +	  }
  49.584 +	  k++;
  49.585 +	} while (k <= Se);
  49.586 +	if (s) {
  49.587 +	  int pos = jpeg_natural_order[k];
  49.588 +	  /* Output newly nonzero coefficient */
  49.589 +	  (*block)[pos] = (JCOEF) s;
  49.590 +	  /* Remember its position in case we have to suspend */
  49.591 +	  newnz_pos[num_newnz++] = pos;
  49.592 +	}
  49.593 +      }
  49.594 +    }
  49.595 +
  49.596 +    if (EOBRUN > 0) {
  49.597 +      /* Scan any remaining coefficient positions after the end-of-band
  49.598 +       * (the last newly nonzero coefficient, if any).  Append a correction
  49.599 +       * bit to each already-nonzero coefficient.  A correction bit is 1
  49.600 +       * if the absolute value of the coefficient must be increased.
  49.601 +       */
  49.602 +      for (; k <= Se; k++) {
  49.603 +	thiscoef = *block + jpeg_natural_order[k];
  49.604 +	if (*thiscoef != 0) {
  49.605 +	  CHECK_BIT_BUFFER(br_state, 1, goto undoit);
  49.606 +	  if (GET_BITS(1)) {
  49.607 +	    if ((*thiscoef & p1) == 0) { /* do nothing if already changed it */
  49.608 +	      if (*thiscoef >= 0)
  49.609 +		*thiscoef += p1;
  49.610 +	      else
  49.611 +		*thiscoef += m1;
  49.612 +	    }
  49.613 +	  }
  49.614 +	}
  49.615 +      }
  49.616 +      /* Count one block completed in EOB run */
  49.617 +      EOBRUN--;
  49.618 +    }
  49.619 +
  49.620 +    /* Completed MCU, so update state */
  49.621 +    BITREAD_SAVE_STATE(cinfo,entropy->bitstate);
  49.622 +    entropy->saved.EOBRUN = EOBRUN; /* only part of saved state we need */
  49.623 +  }
  49.624 +
  49.625 +  /* Account for restart interval (no-op if not using restarts) */
  49.626 +  entropy->restarts_to_go--;
  49.627 +
  49.628 +  return TRUE;
  49.629 +
  49.630 +undoit:
  49.631 +  /* Re-zero any output coefficients that we made newly nonzero */
  49.632 +  while (num_newnz > 0)
  49.633 +    (*block)[newnz_pos[--num_newnz]] = 0;
  49.634 +
  49.635 +  return FALSE;
  49.636 +}
  49.637 +
  49.638 +
  49.639 +/*
  49.640 + * Module initialization routine for progressive Huffman entropy decoding.
  49.641 + */
  49.642 +
  49.643 +GLOBAL(void)
  49.644 +jinit_phuff_decoder (j_decompress_ptr cinfo)
  49.645 +{
  49.646 +  phuff_entropy_ptr entropy;
  49.647 +  int *coef_bit_ptr;
  49.648 +  int ci, i;
  49.649 +
  49.650 +  entropy = (phuff_entropy_ptr)
  49.651 +    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
  49.652 +				SIZEOF(phuff_entropy_decoder));
  49.653 +  cinfo->entropy = (struct jpeg_entropy_decoder *) entropy;
  49.654 +  entropy->pub.start_pass = start_pass_phuff_decoder;
  49.655 +
  49.656 +  /* Mark derived tables unallocated */
  49.657 +  for (i = 0; i < NUM_HUFF_TBLS; i++) {
  49.658 +    entropy->derived_tbls[i] = NULL;
  49.659 +  }
  49.660 +
  49.661 +  /* Create progression status table */
  49.662 +  cinfo->coef_bits = (int (*)[DCTSIZE2])
  49.663 +    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
  49.664 +				cinfo->num_components*DCTSIZE2*SIZEOF(int));
  49.665 +  coef_bit_ptr = & cinfo->coef_bits[0][0];
  49.666 +  for (ci = 0; ci < cinfo->num_components; ci++) 
  49.667 +    for (i = 0; i < DCTSIZE2; i++)
  49.668 +      *coef_bit_ptr++ = -1;
  49.669 +}
  49.670 +
  49.671 +#endif /* D_PROGRESSIVE_SUPPORTED */
    50.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    50.2 +++ b/libs/libjpeg/jdpostct.c	Sun Nov 01 00:36:56 2015 +0200
    50.3 @@ -0,0 +1,290 @@
    50.4 +/*
    50.5 + * jdpostct.c
    50.6 + *
    50.7 + * Copyright (C) 1994-1996, Thomas G. Lane.
    50.8 + * This file is part of the Independent JPEG Group's software.
    50.9 + * For conditions of distribution and use, see the accompanying README file.
   50.10 + *
   50.11 + * This file contains the decompression postprocessing controller.
   50.12 + * This controller manages the upsampling, color conversion, and color
   50.13 + * quantization/reduction steps; specifically, it controls the buffering
   50.14 + * between upsample/color conversion and color quantization/reduction.
   50.15 + *
   50.16 + * If no color quantization/reduction is required, then this module has no
   50.17 + * work to do, and it just hands off to the upsample/color conversion code.
   50.18 + * An integrated upsample/convert/quantize process would replace this module
   50.19 + * entirely.
   50.20 + */
   50.21 +
   50.22 +#define JPEG_INTERNALS
   50.23 +#include "jinclude.h"
   50.24 +#include "jpeglib.h"
   50.25 +
   50.26 +
   50.27 +/* Private buffer controller object */
   50.28 +
   50.29 +typedef struct {
   50.30 +  struct jpeg_d_post_controller pub; /* public fields */
   50.31 +
   50.32 +  /* Color quantization source buffer: this holds output data from
   50.33 +   * the upsample/color conversion step to be passed to the quantizer.
   50.34 +   * For two-pass color quantization, we need a full-image buffer;
   50.35 +   * for one-pass operation, a strip buffer is sufficient.
   50.36 +   */
   50.37 +  jvirt_sarray_ptr whole_image;	/* virtual array, or NULL if one-pass */
   50.38 +  JSAMPARRAY buffer;		/* strip buffer, or current strip of virtual */
   50.39 +  JDIMENSION strip_height;	/* buffer size in rows */
   50.40 +  /* for two-pass mode only: */
   50.41 +  JDIMENSION starting_row;	/* row # of first row in current strip */
   50.42 +  JDIMENSION next_row;		/* index of next row to fill/empty in strip */
   50.43 +} my_post_controller;
   50.44 +
   50.45 +typedef my_post_controller * my_post_ptr;
   50.46 +
   50.47 +
   50.48 +/* Forward declarations */
   50.49 +METHODDEF(void) post_process_1pass
   50.50 +	JPP((j_decompress_ptr cinfo,
   50.51 +	     JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
   50.52 +	     JDIMENSION in_row_groups_avail,
   50.53 +	     JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
   50.54 +	     JDIMENSION out_rows_avail));
   50.55 +#ifdef QUANT_2PASS_SUPPORTED
   50.56 +METHODDEF(void) post_process_prepass
   50.57 +	JPP((j_decompress_ptr cinfo,
   50.58 +	     JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
   50.59 +	     JDIMENSION in_row_groups_avail,
   50.60 +	     JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
   50.61 +	     JDIMENSION out_rows_avail));
   50.62 +METHODDEF(void) post_process_2pass
   50.63 +	JPP((j_decompress_ptr cinfo,
   50.64 +	     JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
   50.65 +	     JDIMENSION in_row_groups_avail,
   50.66 +	     JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
   50.67 +	     JDIMENSION out_rows_avail));
   50.68 +#endif
   50.69 +
   50.70 +
   50.71 +/*
   50.72 + * Initialize for a processing pass.
   50.73 + */
   50.74 +
   50.75 +METHODDEF(void)
   50.76 +start_pass_dpost (j_decompress_ptr cinfo, J_BUF_MODE pass_mode)
   50.77 +{
   50.78 +  my_post_ptr post = (my_post_ptr) cinfo->post;
   50.79 +
   50.80 +  switch (pass_mode) {
   50.81 +  case JBUF_PASS_THRU:
   50.82 +    if (cinfo->quantize_colors) {
   50.83 +      /* Single-pass processing with color quantization. */
   50.84 +      post->pub.post_process_data = post_process_1pass;
   50.85 +      /* We could be doing buffered-image output before starting a 2-pass
   50.86 +       * color quantization; in that case, jinit_d_post_controller did not
   50.87 +       * allocate a strip buffer.  Use the virtual-array buffer as workspace.
   50.88 +       */
   50.89 +      if (post->buffer == NULL) {
   50.90 +	post->buffer = (*cinfo->mem->access_virt_sarray)
   50.91 +	  ((j_common_ptr) cinfo, post->whole_image,
   50.92 +	   (JDIMENSION) 0, post->strip_height, TRUE);
   50.93 +      }
   50.94 +    } else {
   50.95 +      /* For single-pass processing without color quantization,
   50.96 +       * I have no work to do; just call the upsampler directly.
   50.97 +       */
   50.98 +      post->pub.post_process_data = cinfo->upsample->upsample;
   50.99 +    }
  50.100 +    break;
  50.101 +#ifdef QUANT_2PASS_SUPPORTED
  50.102 +  case JBUF_SAVE_AND_PASS:
  50.103 +    /* First pass of 2-pass quantization */
  50.104 +    if (post->whole_image == NULL)
  50.105 +      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
  50.106 +    post->pub.post_process_data = post_process_prepass;
  50.107 +    break;
  50.108 +  case JBUF_CRANK_DEST:
  50.109 +    /* Second pass of 2-pass quantization */
  50.110 +    if (post->whole_image == NULL)
  50.111 +      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
  50.112 +    post->pub.post_process_data = post_process_2pass;
  50.113 +    break;
  50.114 +#endif /* QUANT_2PASS_SUPPORTED */
  50.115 +  default:
  50.116 +    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
  50.117 +    break;
  50.118 +  }
  50.119 +  post->starting_row = post->next_row = 0;
  50.120 +}
  50.121 +
  50.122 +
  50.123 +/*
  50.124 + * Process some data in the one-pass (strip buffer) case.
  50.125 + * This is used for color precision reduction as well as one-pass quantization.
  50.126 + */
  50.127 +
  50.128 +METHODDEF(void)
  50.129 +post_process_1pass (j_decompress_ptr cinfo,
  50.130 +		    JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
  50.131 +		    JDIMENSION in_row_groups_avail,
  50.132 +		    JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
  50.133 +		    JDIMENSION out_rows_avail)
  50.134 +{
  50.135 +  my_post_ptr post = (my_post_ptr) cinfo->post;
  50.136 +  JDIMENSION num_rows, max_rows;
  50.137 +
  50.138 +  /* Fill the buffer, but not more than what we can dump out in one go. */
  50.139 +  /* Note we rely on the upsampler to detect bottom of image. */
  50.140 +  max_rows = out_rows_avail - *out_row_ctr;
  50.141 +  if (max_rows > post->strip_height)
  50.142 +    max_rows = post->strip_height;
  50.143 +  num_rows = 0;
  50.144 +  (*cinfo->upsample->upsample) (cinfo,
  50.145 +		input_buf, in_row_group_ctr, in_row_groups_avail,
  50.146 +		post->buffer, &num_rows, max_rows);
  50.147 +  /* Quantize and emit data. */
  50.148 +  (*cinfo->cquantize->color_quantize) (cinfo,
  50.149 +		post->buffer, output_buf + *out_row_ctr, (int) num_rows);
  50.150 +  *out_row_ctr += num_rows;
  50.151 +}
  50.152 +
  50.153 +
  50.154 +#ifdef QUANT_2PASS_SUPPORTED
  50.155 +
  50.156 +/*
  50.157 + * Process some data in the first pass of 2-pass quantization.
  50.158 + */
  50.159 +
  50.160 +METHODDEF(void)
  50.161 +post_process_prepass (j_decompress_ptr cinfo,
  50.162 +		      JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
  50.163 +		      JDIMENSION in_row_groups_avail,
  50.164 +		      JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
  50.165 +		      JDIMENSION out_rows_avail)
  50.166 +{
  50.167 +  my_post_ptr post = (my_post_ptr) cinfo->post;
  50.168 +  JDIMENSION old_next_row, num_rows;
  50.169 +
  50.170 +  /* Reposition virtual buffer if at start of strip. */
  50.171 +  if (post->next_row == 0) {
  50.172 +    post->buffer = (*cinfo->mem->access_virt_sarray)
  50.173 +	((j_common_ptr) cinfo, post->whole_image,
  50.174 +	 post->starting_row, post->strip_height, TRUE);
  50.175 +  }
  50.176 +
  50.177 +  /* Upsample some data (up to a strip height's worth). */
  50.178 +  old_next_row = post->next_row;
  50.179 +  (*cinfo->upsample->upsample) (cinfo,
  50.180 +		input_buf, in_row_group_ctr, in_row_groups_avail,
  50.181 +		post->buffer, &post->next_row, post->strip_height);
  50.182 +
  50.183 +  /* Allow quantizer to scan new data.  No data is emitted, */
  50.184 +  /* but we advance out_row_ctr so outer loop can tell when we're done. */
  50.185 +  if (post->next_row > old_next_row) {
  50.186 +    num_rows = post->next_row - old_next_row;
  50.187 +    (*cinfo->cquantize->color_quantize) (cinfo, post->buffer + old_next_row,
  50.188 +					 (JSAMPARRAY) NULL, (int) num_rows);
  50.189 +    *out_row_ctr += num_rows;
  50.190 +  }
  50.191 +
  50.192 +  /* Advance if we filled the strip. */
  50.193 +  if (post->next_row >= post->strip_height) {
  50.194 +    post->starting_row += post->strip_height;
  50.195 +    post->next_row = 0;
  50.196 +  }
  50.197 +}
  50.198 +
  50.199 +
  50.200 +/*
  50.201 + * Process some data in the second pass of 2-pass quantization.
  50.202 + */
  50.203 +
  50.204 +METHODDEF(void)
  50.205 +post_process_2pass (j_decompress_ptr cinfo,
  50.206 +		    JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
  50.207 +		    JDIMENSION in_row_groups_avail,
  50.208 +		    JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
  50.209 +		    JDIMENSION out_rows_avail)
  50.210 +{
  50.211 +  my_post_ptr post = (my_post_ptr) cinfo->post;
  50.212 +  JDIMENSION num_rows, max_rows;
  50.213 +
  50.214 +  /* Reposition virtual buffer if at start of strip. */
  50.215 +  if (post->next_row == 0) {
  50.216 +    post->buffer = (*cinfo->mem->access_virt_sarray)
  50.217 +	((j_common_ptr) cinfo, post->whole_image,
  50.218 +	 post->starting_row, post->strip_height, FALSE);
  50.219 +  }
  50.220 +
  50.221 +  /* Determine number of rows to emit. */
  50.222 +  num_rows = post->strip_height - post->next_row; /* available in strip */
  50.223 +  max_rows = out_rows_avail - *out_row_ctr; /* available in output area */
  50.224 +  if (num_rows > max_rows)
  50.225 +    num_rows = max_rows;
  50.226 +  /* We have to check bottom of image here, can't depend on upsampler. */
  50.227 +  max_rows = cinfo->output_height - post->starting_row;
  50.228 +  if (num_rows > max_rows)
  50.229 +    num_rows = max_rows;
  50.230 +
  50.231 +  /* Quantize and emit data. */
  50.232 +  (*cinfo->cquantize->color_quantize) (cinfo,
  50.233 +		post->buffer + post->next_row, output_buf + *out_row_ctr,
  50.234 +		(int) num_rows);
  50.235 +  *out_row_ctr += num_rows;
  50.236 +
  50.237 +  /* Advance if we filled the strip. */
  50.238 +  post->next_row += num_rows;
  50.239 +  if (post->next_row >= post->strip_height) {
  50.240 +    post->starting_row += post->strip_height;
  50.241 +    post->next_row = 0;
  50.242 +  }
  50.243 +}
  50.244 +
  50.245 +#endif /* QUANT_2PASS_SUPPORTED */
  50.246 +
  50.247 +
  50.248 +/*
  50.249 + * Initialize postprocessing controller.
  50.250 + */
  50.251 +
  50.252 +GLOBAL(void)
  50.253 +jinit_d_post_controller (j_decompress_ptr cinfo, boolean need_full_buffer)
  50.254 +{
  50.255 +  my_post_ptr post;
  50.256 +
  50.257 +  post = (my_post_ptr)
  50.258 +    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
  50.259 +				SIZEOF(my_post_controller));
  50.260 +  cinfo->post = (struct jpeg_d_post_controller *) post;
  50.261 +  post->pub.start_pass = start_pass_dpost;
  50.262 +  post->whole_image = NULL;	/* flag for no virtual arrays */
  50.263 +  post->buffer = NULL;		/* flag for no strip buffer */
  50.264 +
  50.265 +  /* Create the quantization buffer, if needed */
  50.266 +  if (cinfo->quantize_colors) {
  50.267 +    /* The buffer strip height is max_v_samp_factor, which is typically
  50.268 +     * an efficient number of rows for upsampling to return.
  50.269 +     * (In the presence of output rescaling, we might want to be smarter?)
  50.270 +     */
  50.271 +    post->strip_height = (JDIMENSION) cinfo->max_v_samp_factor;
  50.272 +    if (need_full_buffer) {
  50.273 +      /* Two-pass color quantization: need full-image storage. */
  50.274 +      /* We round up the number of rows to a multiple of the strip height. */
  50.275 +#ifdef QUANT_2PASS_SUPPORTED
  50.276 +      post->whole_image = (*cinfo->mem->request_virt_sarray)
  50.277 +	((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,
  50.278 +	 cinfo->output_width * cinfo->out_color_components,
  50.279 +	 (JDIMENSION) jround_up((long) cinfo->output_height,
  50.280 +				(long) post->strip_height),
  50.281 +	 post->strip_height);
  50.282 +#else
  50.283 +      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
  50.284 +#endif /* QUANT_2PASS_SUPPORTED */
  50.285 +    } else {
  50.286 +      /* One-pass color quantization: just make a strip buffer. */
  50.287 +      post->buffer = (*cinfo->mem->alloc_sarray)
  50.288 +	((j_common_ptr) cinfo, JPOOL_IMAGE,
  50.289 +	 cinfo->output_width * cinfo->out_color_components,
  50.290 +	 post->strip_height);
  50.291 +    }
  50.292 +  }
  50.293 +}
    51.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    51.2 +++ b/libs/libjpeg/jdsample.c	Sun Nov 01 00:36:56 2015 +0200
    51.3 @@ -0,0 +1,478 @@
    51.4 +/*
    51.5 + * jdsample.c
    51.6 + *
    51.7 + * Copyright (C) 1991-1996, Thomas G. Lane.
    51.8 + * This file is part of the Independent JPEG Group's software.
    51.9 + * For conditions of distribution and use, see the accompanying README file.
   51.10 + *
   51.11 + * This file contains upsampling routines.
   51.12 + *
   51.13 + * Upsampling input data is counted in "row groups".  A row group
   51.14 + * is defined to be (v_samp_factor * DCT_scaled_size / min_DCT_scaled_size)
   51.15 + * sample rows of each component.  Upsampling will normally produce
   51.16 + * max_v_samp_factor pixel rows from each row group (but this could vary
   51.17 + * if the upsampler is applying a scale factor of its own).
   51.18 + *
   51.19 + * An excellent reference for image resampling is
   51.20 + *   Digital Image Warping, George Wolberg, 1990.
   51.21 + *   Pub. by IEEE Computer Society Press, Los Alamitos, CA. ISBN 0-8186-8944-7.
   51.22 + */
   51.23 +
   51.24 +#define JPEG_INTERNALS
   51.25 +#include "jinclude.h"
   51.26 +#include "jpeglib.h"
   51.27 +
   51.28 +
   51.29 +/* Pointer to routine to upsample a single component */
   51.30 +typedef JMETHOD(void, upsample1_ptr,
   51.31 +		(j_decompress_ptr cinfo, jpeg_component_info * compptr,
   51.32 +		 JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));
   51.33 +
   51.34 +/* Private subobject */
   51.35 +
   51.36 +typedef struct {
   51.37 +  struct jpeg_upsampler pub;	/* public fields */
   51.38 +
   51.39 +  /* Color conversion buffer.  When using separate upsampling and color
   51.40 +   * conversion steps, this buffer holds one upsampled row group until it
   51.41 +   * has been color converted and output.
   51.42 +   * Note: we do not allocate any storage for component(s) which are full-size,
   51.43 +   * ie do not need rescaling.  The corresponding entry of color_buf[] is
   51.44 +   * simply set to point to the input data array, thereby avoiding copying.
   51.45 +   */
   51.46 +  JSAMPARRAY color_buf[MAX_COMPONENTS];
   51.47 +
   51.48 +  /* Per-component upsampling method pointers */
   51.49 +  upsample1_ptr methods[MAX_COMPONENTS];
   51.50 +
   51.51 +  int next_row_out;		/* counts rows emitted from color_buf */
   51.52 +  JDIMENSION rows_to_go;	/* counts rows remaining in image */
   51.53 +
   51.54 +  /* Height of an input row group for each component. */
   51.55 +  int rowgroup_height[MAX_COMPONENTS];
   51.56 +
   51.57 +  /* These arrays save pixel expansion factors so that int_expand need not
   51.58 +   * recompute them each time.  They are unused for other upsampling methods.
   51.59 +   */
   51.60 +  UINT8 h_expand[MAX_COMPONENTS];
   51.61 +  UINT8 v_expand[MAX_COMPONENTS];
   51.62 +} my_upsampler;
   51.63 +
   51.64 +typedef my_upsampler * my_upsample_ptr;
   51.65 +
   51.66 +
   51.67 +/*
   51.68 + * Initialize for an upsampling pass.
   51.69 + */
   51.70 +
   51.71 +METHODDEF(void)
   51.72 +start_pass_upsample (j_decompress_ptr cinfo)
   51.73 +{
   51.74 +  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
   51.75 +
   51.76 +  /* Mark the conversion buffer empty */
   51.77 +  upsample->next_row_out = cinfo->max_v_samp_factor;
   51.78 +  /* Initialize total-height counter for detecting bottom of image */
   51.79 +  upsample->rows_to_go = cinfo->output_height;
   51.80 +}
   51.81 +
   51.82 +
   51.83 +/*
   51.84 + * Control routine to do upsampling (and color conversion).
   51.85 + *
   51.86 + * In this version we upsample each component independently.
   51.87 + * We upsample one row group into the conversion buffer, then apply
   51.88 + * color conversion a row at a time.
   51.89 + */
   51.90 +
   51.91 +METHODDEF(void)
   51.92 +sep_upsample (j_decompress_ptr cinfo,
   51.93 +	      JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
   51.94 +	      JDIMENSION in_row_groups_avail,
   51.95 +	      JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
   51.96 +	      JDIMENSION out_rows_avail)
   51.97 +{
   51.98 +  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
   51.99 +  int ci;
  51.100 +  jpeg_component_info * compptr;
  51.101 +  JDIMENSION num_rows;
  51.102 +
  51.103 +  /* Fill the conversion buffer, if it's empty */
  51.104 +  if (upsample->next_row_out >= cinfo->max_v_samp_factor) {
  51.105 +    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  51.106 +	 ci++, compptr++) {
  51.107 +      /* Invoke per-component upsample method.  Notice we pass a POINTER
  51.108 +       * to color_buf[ci], so that fullsize_upsample can change it.
  51.109 +       */
  51.110 +      (*upsample->methods[ci]) (cinfo, compptr,
  51.111 +	input_buf[ci] + (*in_row_group_ctr * upsample->rowgroup_height[ci]),
  51.112 +	upsample->color_buf + ci);
  51.113 +    }
  51.114 +    upsample->next_row_out = 0;
  51.115 +  }
  51.116 +
  51.117 +  /* Color-convert and emit rows */
  51.118 +
  51.119 +  /* How many we have in the buffer: */
  51.120 +  num_rows = (JDIMENSION) (cinfo->max_v_samp_factor - upsample->next_row_out);
  51.121 +  /* Not more than the distance to the end of the image.  Need this test
  51.122 +   * in case the image height is not a multiple of max_v_samp_factor:
  51.123 +   */
  51.124 +  if (num_rows > upsample->rows_to_go) 
  51.125 +    num_rows = upsample->rows_to_go;
  51.126 +  /* And not more than what the client can accept: */
  51.127 +  out_rows_avail -= *out_row_ctr;
  51.128 +  if (num_rows > out_rows_avail)
  51.129 +    num_rows = out_rows_avail;
  51.130 +
  51.131 +  (*cinfo->cconvert->color_convert) (cinfo, upsample->color_buf,
  51.132 +				     (JDIMENSION) upsample->next_row_out,
  51.133 +				     output_buf + *out_row_ctr,
  51.134 +				     (int) num_rows);
  51.135 +
  51.136 +  /* Adjust counts */
  51.137 +  *out_row_ctr += num_rows;
  51.138 +  upsample->rows_to_go -= num_rows;
  51.139 +  upsample->next_row_out += num_rows;
  51.140 +  /* When the buffer is emptied, declare this input row group consumed */
  51.141 +  if (upsample->next_row_out >= cinfo->max_v_samp_factor)
  51.142 +    (*in_row_group_ctr)++;
  51.143 +}
  51.144 +
  51.145 +
  51.146 +/*
  51.147 + * These are the routines invoked by sep_upsample to upsample pixel values
  51.148 + * of a single component.  One row group is processed per call.
  51.149 + */
  51.150 +
  51.151 +
  51.152 +/*
  51.153 + * For full-size components, we just make color_buf[ci] point at the
  51.154 + * input buffer, and thus avoid copying any data.  Note that this is
  51.155 + * safe only because sep_upsample doesn't declare the input row group
  51.156 + * "consumed" until we are done color converting and emitting it.
  51.157 + */
  51.158 +
  51.159 +METHODDEF(void)
  51.160 +fullsize_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
  51.161 +		   JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
  51.162 +{
  51.163 +  *output_data_ptr = input_data;
  51.164 +}
  51.165 +
  51.166 +
  51.167 +/*
  51.168 + * This is a no-op version used for "uninteresting" components.
  51.169 + * These components will not be referenced by color conversion.
  51.170 + */
  51.171 +
  51.172 +METHODDEF(void)
  51.173 +noop_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
  51.174 +	       JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
  51.175 +{
  51.176 +  *output_data_ptr = NULL;	/* safety check */
  51.177 +}
  51.178 +
  51.179 +
  51.180 +/*
  51.181 + * This version handles any integral sampling ratios.
  51.182 + * This is not used for typical JPEG files, so it need not be fast.
  51.183 + * Nor, for that matter, is it particularly accurate: the algorithm is
  51.184 + * simple replication of the input pixel onto the corresponding output
  51.185 + * pixels.  The hi-falutin sampling literature refers to this as a
  51.186 + * "box filter".  A box filter tends to introduce visible artifacts,
  51.187 + * so if you are actually going to use 3:1 or 4:1 sampling ratios
  51.188 + * you would be well advised to improve this code.
  51.189 + */
  51.190 +
  51.191 +METHODDEF(void)
  51.192 +int_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
  51.193 +	      JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
  51.194 +{
  51.195 +  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
  51.196 +  JSAMPARRAY output_data = *output_data_ptr;
  51.197 +  register JSAMPROW inptr, outptr;
  51.198 +  register JSAMPLE invalue;
  51.199 +  register int h;
  51.200 +  JSAMPROW outend;
  51.201 +  int h_expand, v_expand;
  51.202 +  int inrow, outrow;
  51.203 +
  51.204 +  h_expand = upsample->h_expand[compptr->component_index];
  51.205 +  v_expand = upsample->v_expand[compptr->component_index];
  51.206 +
  51.207 +  inrow = outrow = 0;
  51.208 +  while (outrow < cinfo->max_v_samp_factor) {
  51.209 +    /* Generate one output row with proper horizontal expansion */
  51.210 +    inptr = input_data[inrow];
  51.211 +    outptr = output_data[outrow];
  51.212 +    outend = outptr + cinfo->output_width;
  51.213 +    while (outptr < outend) {
  51.214 +      invalue = *inptr++;	/* don't need GETJSAMPLE() here */
  51.215 +      for (h = h_expand; h > 0; h--) {
  51.216 +	*outptr++ = invalue;
  51.217 +      }
  51.218 +    }
  51.219 +    /* Generate any additional output rows by duplicating the first one */
  51.220 +    if (v_expand > 1) {
  51.221 +      jcopy_sample_rows(output_data, outrow, output_data, outrow+1,
  51.222 +			v_expand-1, cinfo->output_width);
  51.223 +    }
  51.224 +    inrow++;
  51.225 +    outrow += v_expand;
  51.226 +  }
  51.227 +}
  51.228 +
  51.229 +
  51.230 +/*
  51.231 + * Fast processing for the common case of 2:1 horizontal and 1:1 vertical.
  51.232 + * It's still a box filter.
  51.233 + */
  51.234 +
  51.235 +METHODDEF(void)
  51.236 +h2v1_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
  51.237 +	       JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
  51.238 +{
  51.239 +  JSAMPARRAY output_data = *output_data_ptr;
  51.240 +  register JSAMPROW inptr, outptr;
  51.241 +  register JSAMPLE invalue;
  51.242 +  JSAMPROW outend;
  51.243 +  int inrow;
  51.244 +
  51.245 +  for (inrow = 0; inrow < cinfo->max_v_samp_factor; inrow++) {
  51.246 +    inptr = input_data[inrow];
  51.247 +    outptr = output_data[inrow];
  51.248 +    outend = outptr + cinfo->output_width;
  51.249 +    while (outptr < outend) {
  51.250 +      invalue = *inptr++;	/* don't need GETJSAMPLE() here */
  51.251 +      *outptr++ = invalue;
  51.252 +      *outptr++ = invalue;
  51.253 +    }
  51.254 +  }
  51.255 +}
  51.256 +
  51.257 +
  51.258 +/*
  51.259 + * Fast processing for the common case of 2:1 horizontal and 2:1 vertical.
  51.260 + * It's still a box filter.
  51.261 + */
  51.262 +
  51.263 +METHODDEF(void)
  51.264 +h2v2_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
  51.265 +	       JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
  51.266 +{
  51.267 +  JSAMPARRAY output_data = *output_data_ptr;
  51.268 +  register JSAMPROW inptr, outptr;
  51.269 +  register JSAMPLE invalue;
  51.270 +  JSAMPROW outend;
  51.271 +  int inrow, outrow;
  51.272 +
  51.273 +  inrow = outrow = 0;
  51.274 +  while (outrow < cinfo->max_v_samp_factor) {
  51.275 +    inptr = input_data[inrow];
  51.276 +    outptr = output_data[outrow];
  51.277 +    outend = outptr + cinfo->output_width;
  51.278 +    while (outptr < outend) {
  51.279 +      invalue = *inptr++;	/* don't need GETJSAMPLE() here */
  51.280 +      *outptr++ = invalue;
  51.281 +      *outptr++ = invalue;
  51.282 +    }
  51.283 +    jcopy_sample_rows(output_data, outrow, output_data, outrow+1,
  51.284 +		      1, cinfo->output_width);
  51.285 +    inrow++;
  51.286 +    outrow += 2;
  51.287 +  }
  51.288 +}
  51.289 +
  51.290 +
  51.291 +/*
  51.292 + * Fancy processing for the common case of 2:1 horizontal and 1:1 vertical.
  51.293 + *
  51.294 + * The upsampling algorithm is linear interpolation between pixel centers,
  51.295 + * also known as a "triangle filter".  This is a good compromise between
  51.296 + * speed and visual quality.  The centers of the output pixels are 1/4 and 3/4
  51.297 + * of the way between input pixel centers.
  51.298 + *
  51.299 + * A note about the "bias" calculations: when rounding fractional values to
  51.300 + * integer, we do not want to always round 0.5 up to the next integer.
  51.301 + * If we did that, we'd introduce a noticeable bias towards larger values.
  51.302 + * Instead, this code is arranged so that 0.5 will be rounded up or down at
  51.303 + * alternate pixel locations (a simple ordered dither pattern).
  51.304 + */
  51.305 +
  51.306 +METHODDEF(void)
  51.307 +h2v1_fancy_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
  51.308 +		     JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
  51.309 +{
  51.310 +  JSAMPARRAY output_data = *output_data_ptr;
  51.311 +  register JSAMPROW inptr, outptr;
  51.312 +  register int invalue;
  51.313 +  register JDIMENSION colctr;
  51.314 +  int inrow;
  51.315 +
  51.316 +  for (inrow = 0; inrow < cinfo->max_v_samp_factor; inrow++) {
  51.317 +    inptr = input_data[inrow];
  51.318 +    outptr = output_data[inrow];
  51.319 +    /* Special case for first column */
  51.320 +    invalue = GETJSAMPLE(*inptr++);
  51.321 +    *outptr++ = (JSAMPLE) invalue;
  51.322 +    *outptr++ = (JSAMPLE) ((invalue * 3 + GETJSAMPLE(*inptr) + 2) >> 2);
  51.323 +
  51.324 +    for (colctr = compptr->downsampled_width - 2; colctr > 0; colctr--) {
  51.325 +      /* General case: 3/4 * nearer pixel + 1/4 * further pixel */
  51.326 +      invalue = GETJSAMPLE(*inptr++) * 3;
  51.327 +      *outptr++ = (JSAMPLE) ((invalue + GETJSAMPLE(inptr[-2]) + 1) >> 2);
  51.328 +      *outptr++ = (JSAMPLE) ((invalue + GETJSAMPLE(*inptr) + 2) >> 2);
  51.329 +    }
  51.330 +
  51.331 +    /* Special case for last column */
  51.332 +    invalue = GETJSAMPLE(*inptr);
  51.333 +    *outptr++ = (JSAMPLE) ((invalue * 3 + GETJSAMPLE(inptr[-1]) + 1) >> 2);
  51.334 +    *outptr++ = (JSAMPLE) invalue;
  51.335 +  }
  51.336 +}
  51.337 +
  51.338 +
  51.339 +/*
  51.340 + * Fancy processing for the common case of 2:1 horizontal and 2:1 vertical.
  51.341 + * Again a triangle filter; see comments for h2v1 case, above.
  51.342 + *
  51.343 + * It is OK for us to reference the adjacent input rows because we demanded
  51.344 + * context from the main buffer controller (see initialization code).
  51.345 + */
  51.346 +
  51.347 +METHODDEF(void)
  51.348 +h2v2_fancy_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
  51.349 +		     JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
  51.350 +{
  51.351 +  JSAMPARRAY output_data = *output_data_ptr;
  51.352 +  register JSAMPROW inptr0, inptr1, outptr;
  51.353 +#if BITS_IN_JSAMPLE == 8
  51.354 +  register int thiscolsum, lastcolsum, nextcolsum;
  51.355 +#else
  51.356 +  register INT32 thiscolsum, lastcolsum, nextcolsum;
  51.357 +#endif
  51.358 +  register JDIMENSION colctr;
  51.359 +  int inrow, outrow, v;
  51.360 +
  51.361 +  inrow = outrow = 0;
  51.362 +  while (outrow < cinfo->max_v_samp_factor) {
  51.363 +    for (v = 0; v < 2; v++) {
  51.364 +      /* inptr0 points to nearest input row, inptr1 points to next nearest */
  51.365 +      inptr0 = input_data[inrow];
  51.366 +      if (v == 0)		/* next nearest is row above */
  51.367 +	inptr1 = input_data[inrow-1];
  51.368 +      else			/* next nearest is row below */
  51.369 +	inptr1 = input_data[inrow+1];
  51.370 +      outptr = output_data[outrow++];
  51.371 +
  51.372 +      /* Special case for first column */
  51.373 +      thiscolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++);
  51.374 +      nextcolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++);
  51.375 +      *outptr++ = (JSAMPLE) ((thiscolsum * 4 + 8) >> 4);
  51.376 +      *outptr++ = (JSAMPLE) ((thiscolsum * 3 + nextcolsum + 7) >> 4);
  51.377 +      lastcolsum = thiscolsum; thiscolsum = nextcolsum;
  51.378 +
  51.379 +      for (colctr = compptr->downsampled_width - 2; colctr > 0; colctr--) {
  51.380 +	/* General case: 3/4 * nearer pixel + 1/4 * further pixel in each */
  51.381 +	/* dimension, thus 9/16, 3/16, 3/16, 1/16 overall */
  51.382 +	nextcolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++);
  51.383 +	*outptr++ = (JSAMPLE) ((thiscolsum * 3 + lastcolsum + 8) >> 4);
  51.384 +	*outptr++ = (JSAMPLE) ((thiscolsum * 3 + nextcolsum + 7) >> 4);
  51.385 +	lastcolsum = thiscolsum; thiscolsum = nextcolsum;
  51.386 +      }
  51.387 +
  51.388 +      /* Special case for last column */
  51.389 +      *outptr++ = (JSAMPLE) ((thiscolsum * 3 + lastcolsum + 8) >> 4);
  51.390 +      *outptr++ = (JSAMPLE) ((thiscolsum * 4 + 7) >> 4);
  51.391 +    }
  51.392 +    inrow++;
  51.393 +  }
  51.394 +}
  51.395 +
  51.396 +
  51.397 +/*
  51.398 + * Module initialization routine for upsampling.
  51.399 + */
  51.400 +
  51.401 +GLOBAL(void)
  51.402 +jinit_upsampler (j_decompress_ptr cinfo)
  51.403 +{
  51.404 +  my_upsample_ptr upsample;
  51.405 +  int ci;
  51.406 +  jpeg_component_info * compptr;
  51.407 +  boolean need_buffer, do_fancy;
  51.408 +  int h_in_group, v_in_group, h_out_group, v_out_group;
  51.409 +
  51.410 +  upsample = (my_upsample_ptr)
  51.411 +    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
  51.412 +				SIZEOF(my_upsampler));
  51.413 +  cinfo->upsample = (struct jpeg_upsampler *) upsample;
  51.414 +  upsample->pub.start_pass = start_pass_upsample;
  51.415 +  upsample->pub.upsample = sep_upsample;
  51.416 +  upsample->pub.need_context_rows = FALSE; /* until we find out differently */
  51.417 +
  51.418 +  if (cinfo->CCIR601_sampling)	/* this isn't supported */
  51.419 +    ERREXIT(cinfo, JERR_CCIR601_NOTIMPL);
  51.420 +
  51.421 +  /* jdmainct.c doesn't support context rows when min_DCT_scaled_size = 1,
  51.422 +   * so don't ask for it.
  51.423 +   */
  51.424 +  do_fancy = cinfo->do_fancy_upsampling && cinfo->min_DCT_scaled_size > 1;
  51.425 +
  51.426 +  /* Verify we can handle the sampling factors, select per-component methods,
  51.427 +   * and create storage as needed.
  51.428 +   */
  51.429 +  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  51.430 +       ci++, compptr++) {
  51.431 +    /* Compute size of an "input group" after IDCT scaling.  This many samples
  51.432 +     * are to be converted to max_h_samp_factor * max_v_samp_factor pixels.
  51.433 +     */
  51.434 +    h_in_group = (compptr->h_samp_factor * compptr->DCT_scaled_size) /
  51.435 +		 cinfo->min_DCT_scaled_size;
  51.436 +    v_in_group = (compptr->v_samp_factor * compptr->DCT_scaled_size) /
  51.437 +		 cinfo->min_DCT_scaled_size;
  51.438 +    h_out_group = cinfo->max_h_samp_factor;
  51.439 +    v_out_group = cinfo->max_v_samp_factor;
  51.440 +    upsample->rowgroup_height[ci] = v_in_group; /* save for use later */
  51.441 +    need_buffer = TRUE;
  51.442 +    if (! compptr->component_needed) {
  51.443 +      /* Don't bother to upsample an uninteresting component. */
  51.444 +      upsample->methods[ci] = noop_upsample;
  51.445 +      need_buffer = FALSE;
  51.446 +    } else if (h_in_group == h_out_group && v_in_group == v_out_group) {
  51.447 +      /* Fullsize components can be processed without any work. */
  51.448 +      upsample->methods[ci] = fullsize_upsample;
  51.449 +      need_buffer = FALSE;
  51.450 +    } else if (h_in_group * 2 == h_out_group &&
  51.451 +	       v_in_group == v_out_group) {
  51.452 +      /* Special cases for 2h1v upsampling */
  51.453 +      if (do_fancy && compptr->downsampled_width > 2)
  51.454 +	upsample->methods[ci] = h2v1_fancy_upsample;
  51.455 +      else
  51.456 +	upsample->methods[ci] = h2v1_upsample;
  51.457 +    } else if (h_in_group * 2 == h_out_group &&
  51.458 +	       v_in_group * 2 == v_out_group) {
  51.459 +      /* Special cases for 2h2v upsampling */
  51.460 +      if (do_fancy && compptr->downsampled_width > 2) {
  51.461 +	upsample->methods[ci] = h2v2_fancy_upsample;
  51.462 +	upsample->pub.need_context_rows = TRUE;
  51.463 +      } else
  51.464 +	upsample->methods[ci] = h2v2_upsample;
  51.465 +    } else if ((h_out_group % h_in_group) == 0 &&
  51.466 +	       (v_out_group % v_in_group) == 0) {
  51.467 +      /* Generic integral-factors upsampling method */
  51.468 +      upsample->methods[ci] = int_upsample;
  51.469 +      upsample->h_expand[ci] = (UINT8) (h_out_group / h_in_group);
  51.470 +      upsample->v_expand[ci] = (UINT8) (v_out_group / v_in_group);
  51.471 +    } else
  51.472 +      ERREXIT(cinfo, JERR_FRACT_SAMPLE_NOTIMPL);
  51.473 +    if (need_buffer) {
  51.474 +      upsample->color_buf[ci] = (*cinfo->mem->alloc_sarray)
  51.475 +	((j_common_ptr) cinfo, JPOOL_IMAGE,
  51.476 +	 (JDIMENSION) jround_up((long) cinfo->output_width,
  51.477 +				(long) cinfo->max_h_samp_factor),
  51.478 +	 (JDIMENSION) cinfo->max_v_samp_factor);
  51.479 +    }
  51.480 +  }
  51.481 +}
    52.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    52.2 +++ b/libs/libjpeg/jdtrans.c	Sun Nov 01 00:36:56 2015 +0200
    52.3 @@ -0,0 +1,143 @@
    52.4 +/*
    52.5 + * jdtrans.c
    52.6 + *
    52.7 + * Copyright (C) 1995-1997, Thomas G. Lane.
    52.8 + * This file is part of the Independent JPEG Group's software.
    52.9 + * For conditions of distribution and use, see the accompanying README file.
   52.10 + *
   52.11 + * This file contains library routines for transcoding decompression,
   52.12 + * that is, reading raw DCT coefficient arrays from an input JPEG file.
   52.13 + * The routines in jdapimin.c will also be needed by a transcoder.
   52.14 + */
   52.15 +
   52.16 +#define JPEG_INTERNALS
   52.17 +#include "jinclude.h"
   52.18 +#include "jpeglib.h"
   52.19 +
   52.20 +
   52.21 +/* Forward declarations */
   52.22 +LOCAL(void) transdecode_master_selection JPP((j_decompress_ptr cinfo));
   52.23 +
   52.24 +
   52.25 +/*
   52.26 + * Read the coefficient arrays from a JPEG file.
   52.27 + * jpeg_read_header must be completed before calling this.
   52.28 + *
   52.29 + * The entire image is read into a set of virtual coefficient-block arrays,
   52.30 + * one per component.  The return value is a pointer to the array of
   52.31 + * virtual-array descriptors.  These can be manipulated directly via the
   52.32 + * JPEG memory manager, or handed off to jpeg_write_coefficients().
   52.33 + * To release the memory occupied by the virtual arrays, call
   52.34 + * jpeg_finish_decompress() when done with the data.
   52.35 + *
   52.36 + * An alternative usage is to simply obtain access to the coefficient arrays
   52.37 + * during a buffered-image-mode decompression operation.  This is allowed
   52.38 + * after any jpeg_finish_output() call.  The arrays can be accessed until
   52.39 + * jpeg_finish_decompress() is called.  (Note that any call to the library
   52.40 + * may reposition the arrays, so don't rely on access_virt_barray() results
   52.41 + * to stay valid across library calls.)
   52.42 + *
   52.43 + * Returns NULL if suspended.  This case need be checked only if
   52.44 + * a suspending data source is used.
   52.45 + */
   52.46 +
   52.47 +GLOBAL(jvirt_barray_ptr *)
   52.48 +jpeg_read_coefficients (j_decompress_ptr cinfo)
   52.49 +{
   52.50 +  if (cinfo->global_state == DSTATE_READY) {
   52.51 +    /* First call: initialize active modules */
   52.52 +    transdecode_master_selection(cinfo);
   52.53 +    cinfo->global_state = DSTATE_RDCOEFS;
   52.54 +  }
   52.55 +  if (cinfo->global_state == DSTATE_RDCOEFS) {
   52.56 +    /* Absorb whole file into the coef buffer */
   52.57 +    for (;;) {
   52.58 +      int retcode;
   52.59 +      /* Call progress monitor hook if present */
   52.60 +      if (cinfo->progress != NULL)
   52.61 +	(*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
   52.62 +      /* Absorb some more input */
   52.63 +      retcode = (*cinfo->inputctl->consume_input) (cinfo);
   52.64 +      if (retcode == JPEG_SUSPENDED)
   52.65 +	return NULL;
   52.66 +      if (retcode == JPEG_REACHED_EOI)
   52.67 +	break;
   52.68 +      /* Advance progress counter if appropriate */
   52.69 +      if (cinfo->progress != NULL &&
   52.70 +	  (retcode == JPEG_ROW_COMPLETED || retcode == JPEG_REACHED_SOS)) {
   52.71 +	if (++cinfo->progress->pass_counter >= cinfo->progress->pass_limit) {
   52.72 +	  /* startup underestimated number of scans; ratchet up one scan */
   52.73 +	  cinfo->progress->pass_limit += (long) cinfo->total_iMCU_rows;
   52.74 +	}
   52.75 +      }
   52.76 +    }
   52.77 +    /* Set state so that jpeg_finish_decompress does the right thing */
   52.78 +    cinfo->global_state = DSTATE_STOPPING;
   52.79 +  }
   52.80 +  /* At this point we should be in state DSTATE_STOPPING if being used
   52.81 +   * standalone, or in state DSTATE_BUFIMAGE if being invoked to get access
   52.82 +   * to the coefficients during a full buffered-image-mode decompression.
   52.83 +   */
   52.84 +  if ((cinfo->global_state == DSTATE_STOPPING ||
   52.85 +       cinfo->global_state == DSTATE_BUFIMAGE) && cinfo->buffered_image) {
   52.86 +    return cinfo->coef->coef_arrays;
   52.87 +  }
   52.88 +  /* Oops, improper usage */
   52.89 +  ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
   52.90 +  return NULL;			/* keep compiler happy */
   52.91 +}
   52.92 +
   52.93 +
   52.94 +/*
   52.95 + * Master selection of decompression modules for transcoding.
   52.96 + * This substitutes for jdmaster.c's initialization of the full decompressor.
   52.97 + */
   52.98 +
   52.99 +LOCAL(void)
  52.100 +transdecode_master_selection (j_decompress_ptr cinfo)
  52.101 +{
  52.102 +  /* This is effectively a buffered-image operation. */
  52.103 +  cinfo->buffered_image = TRUE;
  52.104 +
  52.105 +  /* Entropy decoding: either Huffman or arithmetic coding. */
  52.106 +  if (cinfo->arith_code) {
  52.107 +    ERREXIT(cinfo, JERR_ARITH_NOTIMPL);
  52.108 +  } else {
  52.109 +    if (cinfo->progressive_mode) {
  52.110 +#ifdef D_PROGRESSIVE_SUPPORTED
  52.111 +      jinit_phuff_decoder(cinfo);
  52.112 +#else
  52.113 +      ERREXIT(cinfo, JERR_NOT_COMPILED);
  52.114 +#endif
  52.115 +    } else
  52.116 +      jinit_huff_decoder(cinfo);
  52.117 +  }
  52.118 +
  52.119 +  /* Always get a full-image coefficient buffer. */
  52.120 +  jinit_d_coef_controller(cinfo, TRUE);
  52.121 +
  52.122 +  /* We can now tell the memory manager to allocate virtual arrays. */
  52.123 +  (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo);
  52.124 +
  52.125 +  /* Initialize input side of decompressor to consume first scan. */
  52.126 +  (*cinfo->inputctl->start_input_pass) (cinfo);
  52.127 +
  52.128 +  /* Initialize progress monitoring. */
  52.129 +  if (cinfo->progress != NULL) {
  52.130 +    int nscans;
  52.131 +    /* Estimate number of scans to set pass_limit. */
  52.132 +    if (cinfo->progressive_mode) {
  52.133 +      /* Arbitrarily estimate 2 interleaved DC scans + 3 AC scans/component. */
  52.134 +      nscans = 2 + 3 * cinfo->num_components;
  52.135 +    } else if (cinfo->inputctl->has_multiple_scans) {
  52.136 +      /* For a nonprogressive multiscan file, estimate 1 scan per component. */
  52.137 +      nscans = cinfo->num_components;
  52.138 +    } else {
  52.139 +      nscans = 1;
  52.140 +    }
  52.141 +    cinfo->progress->pass_counter = 0L;
  52.142 +    cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows * nscans;
  52.143 +    cinfo->progress->completed_passes = 0;
  52.144 +    cinfo->progress->total_passes = 1;
  52.145 +  }
  52.146 +}
    53.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    53.2 +++ b/libs/libjpeg/jerror.c	Sun Nov 01 00:36:56 2015 +0200
    53.3 @@ -0,0 +1,252 @@
    53.4 +/*
    53.5 + * jerror.c
    53.6 + *
    53.7 + * Copyright (C) 1991-1998, Thomas G. Lane.
    53.8 + * This file is part of the Independent JPEG Group's software.
    53.9 + * For conditions of distribution and use, see the accompanying README file.
   53.10 + *
   53.11 + * This file contains simple error-reporting and trace-message routines.
   53.12 + * These are suitable for Unix-like systems and others where writing to
   53.13 + * stderr is the right thing to do.  Many applications will want to replace
   53.14 + * some or all of these routines.
   53.15 + *
   53.16 + * If you define USE_WINDOWS_MESSAGEBOX in jconfig.h or in the makefile,
   53.17 + * you get a Windows-specific hack to display error messages in a dialog box.
   53.18 + * It ain't much, but it beats dropping error messages into the bit bucket,
   53.19 + * which is what happens to output to stderr under most Windows C compilers.
   53.20 + *
   53.21 + * These routines are used by both the compression and decompression code.
   53.22 + */
   53.23 +
   53.24 +/* this is not a core library module, so it doesn't define JPEG_INTERNALS */
   53.25 +#include "jinclude.h"
   53.26 +#include "jpeglib.h"
   53.27 +#include "jversion.h"
   53.28 +#include "jerror.h"
   53.29 +
   53.30 +#ifdef USE_WINDOWS_MESSAGEBOX
   53.31 +#include <windows.h>
   53.32 +#endif
   53.33 +
   53.34 +#ifndef EXIT_FAILURE		/* define exit() codes if not provided */
   53.35 +#define EXIT_FAILURE  1
   53.36 +#endif
   53.37 +
   53.38 +
   53.39 +/*
   53.40 + * Create the message string table.
   53.41 + * We do this from the master message list in jerror.h by re-reading
   53.42 + * jerror.h with a suitable definition for macro JMESSAGE.
   53.43 + * The message table is made an external symbol just in case any applications
   53.44 + * want to refer to it directly.
   53.45 + */
   53.46 +
   53.47 +#ifdef NEED_SHORT_EXTERNAL_NAMES
   53.48 +#define jpeg_std_message_table	jMsgTable
   53.49 +#endif
   53.50 +
   53.51 +#define JMESSAGE(code,string)	string ,
   53.52 +
   53.53 +const char * const jpeg_std_message_table[] = {
   53.54 +#include "jerror.h"
   53.55 +  NULL
   53.56 +};
   53.57 +
   53.58 +
   53.59 +/*
   53.60 + * Error exit handler: must not return to caller.
   53.61 + *
   53.62 + * Applications may override this if they want to get control back after
   53.63 + * an error.  Typically one would longjmp somewhere instead of exiting.
   53.64 + * The setjmp buffer can be made a private field within an expanded error
   53.65 + * handler object.  Note that the info needed to generate an error message
   53.66 + * is stored in the error object, so you can generate the message now or
   53.67 + * later, at your convenience.
   53.68 + * You should make sure that the JPEG object is cleaned up (with jpeg_abort
   53.69 + * or jpeg_destroy) at some point.
   53.70 + */
   53.71 +
   53.72 +METHODDEF(void)
   53.73 +error_exit (j_common_ptr cinfo)
   53.74 +{
   53.75 +  /* Always display the message */
   53.76 +  (*cinfo->err->output_message) (cinfo);
   53.77 +
   53.78 +  /* Let the memory manager delete any temp files before we die */
   53.79 +  jpeg_destroy(cinfo);
   53.80 +
   53.81 +  exit(EXIT_FAILURE);
   53.82 +}
   53.83 +
   53.84 +
   53.85 +/*
   53.86 + * Actual output of an error or trace message.
   53.87 + * Applications may override this method to send JPEG messages somewhere
   53.88 + * other than stderr.
   53.89 + *
   53.90 + * On Windows, printing to stderr is generally completely useless,
   53.91 + * so we provide optional code to produce an error-dialog popup.
   53.92 + * Most Windows applications will still prefer to override this routine,
   53.93 + * but if they don't, it'll do something at least marginally useful.
   53.94 + *
   53.95 + * NOTE: to use the library in an environment that doesn't support the
   53.96 + * C stdio library, you may have to delete the call to fprintf() entirely,
   53.97 + * not just not use this routine.
   53.98 + */
   53.99 +
  53.100 +METHODDEF(void)
  53.101 +output_message (j_common_ptr cinfo)
  53.102 +{
  53.103 +  char buffer[JMSG_LENGTH_MAX];
  53.104 +
  53.105 +  /* Create the message */
  53.106 +  (*cinfo->err->format_message) (cinfo, buffer);
  53.107 +
  53.108 +#ifdef USE_WINDOWS_MESSAGEBOX
  53.109 +  /* Display it in a message dialog box */
  53.110 +  MessageBox(GetActiveWindow(), buffer, "JPEG Library Error",
  53.111 +	     MB_OK | MB_ICONERROR);
  53.112 +#else
  53.113 +  /* Send it to stderr, adding a newline */
  53.114 +  fprintf(stderr, "%s\n", buffer);
  53.115 +#endif
  53.116 +}
  53.117 +
  53.118 +
  53.119 +/*
  53.120 + * Decide whether to emit a trace or warning message.
  53.121 + * msg_level is one of:
  53.122 + *   -1: recoverable corrupt-data warning, may want to abort.
  53.123 + *    0: important advisory messages (always display to user).
  53.124 + *    1: first level of tracing detail.
  53.125 + *    2,3,...: successively more detailed tracing messages.
  53.126 + * An application might override this method if it wanted to abort on warnings
  53.127 + * or change the policy about which messages to display.
  53.128 + */
  53.129 +
  53.130 +METHODDEF(void)
  53.131 +emit_message (j_common_ptr cinfo, int msg_level)
  53.132 +{
  53.133 +  struct jpeg_error_mgr * err = cinfo->err;
  53.134 +
  53.135 +  if (msg_level < 0) {
  53.136 +    /* It's a warning message.  Since corrupt files may generate many warnings,
  53.137 +     * the policy implemented here is to show only the first warning,
  53.138 +     * unless trace_level >= 3.
  53.139 +     */
  53.140 +    if (err->num_warnings == 0 || err->trace_level >= 3)
  53.141 +      (*err->output_message) (cinfo);
  53.142 +    /* Always count warnings in num_warnings. */
  53.143 +    err->num_warnings++;
  53.144 +  } else {
  53.145 +    /* It's a trace message.  Show it if trace_level >= msg_level. */
  53.146 +    if (err->trace_level >= msg_level)
  53.147 +      (*err->output_message) (cinfo);
  53.148 +  }
  53.149 +}
  53.150 +
  53.151 +
  53.152 +/*
  53.153 + * Format a message string for the most recent JPEG error or message.
  53.154 + * The message is stored into buffer, which should be at least JMSG_LENGTH_MAX
  53.155 + * characters.  Note that no '\n' character is added to the string.
  53.156 + * Few applications should need to override this method.
  53.157 + */
  53.158 +
  53.159 +METHODDEF(void)
  53.160 +format_message (j_common_ptr cinfo, char * buffer)
  53.161 +{
  53.162 +  struct jpeg_error_mgr * err = cinfo->err;
  53.163 +  int msg_code = err->msg_code;
  53.164 +  const char * msgtext = NULL;
  53.165 +  const char * msgptr;
  53.166 +  char ch;
  53.167 +  boolean isstring;
  53.168 +
  53.169 +  /* Look up message string in proper table */
  53.170 +  if (msg_code > 0 && msg_code <= err->last_jpeg_message) {
  53.171 +    msgtext = err->jpeg_message_table[msg_code];
  53.172 +  } else if (err->addon_message_table != NULL &&
  53.173 +	     msg_code >= err->first_addon_message &&
  53.174 +	     msg_code <= err->last_addon_message) {
  53.175 +    msgtext = err->addon_message_table[msg_code - err->first_addon_message];
  53.176 +  }
  53.177 +
  53.178 +  /* Defend against bogus message number */
  53.179 +  if (msgtext == NULL) {
  53.180 +    err->msg_parm.i[0] = msg_code;
  53.181 +    msgtext = err->jpeg_message_table[0];
  53.182 +  }
  53.183 +
  53.184 +  /* Check for string parameter, as indicated by %s in the message text */
  53.185 +  isstring = FALSE;
  53.186 +  msgptr = msgtext;
  53.187 +  while ((ch = *msgptr++) != '\0') {
  53.188 +    if (ch == '%') {
  53.189 +      if (*msgptr == 's') isstring = TRUE;
  53.190 +      break;
  53.191 +    }
  53.192 +  }
  53.193 +
  53.194 +  /* Format the message into the passed buffer */
  53.195 +  if (isstring)
  53.196 +    sprintf(buffer, msgtext, err->msg_parm.s);
  53.197 +  else
  53.198 +    sprintf(buffer, msgtext,
  53.199 +	    err->msg_parm.i[0], err->msg_parm.i[1],
  53.200 +	    err->msg_parm.i[2], err->msg_parm.i[3],
  53.201 +	    err->msg_parm.i[4], err->msg_parm.i[5],
  53.202 +	    err->msg_parm.i[6], err->msg_parm.i[7]);
  53.203 +}
  53.204 +
  53.205 +
  53.206 +/*
  53.207 + * Reset error state variables at start of a new image.
  53.208 + * This is called during compression startup to reset trace/error
  53.209 + * processing to default state, without losing any application-specific
  53.210 + * method pointers.  An application might possibly want to override
  53.211 + * this method if it has additional error processing state.
  53.212 + */
  53.213 +
  53.214 +METHODDEF(void)
  53.215 +reset_error_mgr (j_common_ptr cinfo)
  53.216 +{
  53.217 +  cinfo->err->num_warnings = 0;
  53.218 +  /* trace_level is not reset since it is an application-supplied parameter */
  53.219 +  cinfo->err->msg_code = 0;	/* may be useful as a flag for "no error" */
  53.220 +}
  53.221 +
  53.222 +
  53.223 +/*
  53.224 + * Fill in the standard error-handling methods in a jpeg_error_mgr object.
  53.225 + * Typical call is:
  53.226 + *	struct jpeg_compress_struct cinfo;
  53.227 + *	struct jpeg_error_mgr err;
  53.228 + *
  53.229 + *	cinfo.err = jpeg_std_error(&err);
  53.230 + * after which the application may override some of the methods.
  53.231 + */
  53.232 +
  53.233 +GLOBAL(struct jpeg_error_mgr *)
  53.234 +jpeg_std_error (struct jpeg_error_mgr * err)
  53.235 +{
  53.236 +  err->error_exit = error_exit;
  53.237 +  err->emit_message = emit_message;
  53.238 +  err->output_message = output_message;
  53.239 +  err->format_message = format_message;
  53.240 +  err->reset_error_mgr = reset_error_mgr;
  53.241 +
  53.242 +  err->trace_level = 0;		/* default = no tracing */
  53.243 +  err->num_warnings = 0;	/* no warnings emitted yet */
  53.244 +  err->msg_code = 0;		/* may be useful as a flag for "no error" */
  53.245 +
  53.246 +  /* Initialize message table pointers */
  53.247 +  err->jpeg_message_table = jpeg_std_message_table;
  53.248 +  err->last_jpeg_message = (int) JMSG_LASTMSGCODE - 1;
  53.249 +
  53.250 +  err->addon_message_table = NULL;
  53.251 +  err->first_addon_message = 0;	/* for safety */
  53.252 +  err->last_addon_message = 0;
  53.253 +
  53.254 +  return err;
  53.255 +}
    54.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    54.2 +++ b/libs/libjpeg/jerror.h	Sun Nov 01 00:36:56 2015 +0200
    54.3 @@ -0,0 +1,291 @@
    54.4 +/*
    54.5 + * jerror.h
    54.6 + *
    54.7 + * Copyright (C) 1994-1997, Thomas G. Lane.
    54.8 + * This file is part of the Independent JPEG Group's software.
    54.9 + * For conditions of distribution and use, see the accompanying README file.
   54.10 + *
   54.11 + * This file defines the error and message codes for the JPEG library.
   54.12 + * Edit this file to add new codes, or to translate the message strings to
   54.13 + * some other language.
   54.14 + * A set of error-reporting macros are defined too.  Some applications using
   54.15 + * the JPEG library may wish to include this file to get the error codes
   54.16 + * and/or the macros.
   54.17 + */
   54.18 +
   54.19 +/*
   54.20 + * To define the enum list of message codes, include this file without
   54.21 + * defining macro JMESSAGE.  To create a message string table, include it
   54.22 + * again with a suitable JMESSAGE definition (see jerror.c for an example).
   54.23 + */
   54.24 +#ifndef JMESSAGE
   54.25 +#ifndef JERROR_H
   54.26 +/* First time through, define the enum list */
   54.27 +#define JMAKE_ENUM_LIST
   54.28 +#else
   54.29 +/* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */
   54.30 +#define JMESSAGE(code,string)
   54.31 +#endif /* JERROR_H */
   54.32 +#endif /* JMESSAGE */
   54.33 +
   54.34 +#ifdef JMAKE_ENUM_LIST
   54.35 +
   54.36 +typedef enum {
   54.37 +
   54.38 +#define JMESSAGE(code,string)	code ,
   54.39 +
   54.40 +#endif /* JMAKE_ENUM_LIST */
   54.41 +
   54.42 +JMESSAGE(JMSG_NOMESSAGE, "Bogus message code %d") /* Must be first entry! */
   54.43 +
   54.44 +/* For maintenance convenience, list is alphabetical by message code name */
   54.45 +JMESSAGE(JERR_ARITH_NOTIMPL,
   54.46 +	 "Sorry, there are legal restrictions on arithmetic coding")
   54.47 +JMESSAGE(JERR_BAD_ALIGN_TYPE, "ALIGN_TYPE is wrong, please fix")
   54.48 +JMESSAGE(JERR_BAD_ALLOC_CHUNK, "MAX_ALLOC_CHUNK is wrong, please fix")
   54.49 +JMESSAGE(JERR_BAD_BUFFER_MODE, "Bogus buffer control mode")
   54.50 +JMESSAGE(JERR_BAD_COMPONENT_ID, "Invalid component ID %d in SOS")
   54.51 +JMESSAGE(JERR_BAD_DCT_COEF, "DCT coefficient out of range")
   54.52 +JMESSAGE(JERR_BAD_DCTSIZE, "IDCT output block size %d not supported")
   54.53 +JMESSAGE(JERR_BAD_HUFF_TABLE, "Bogus Huffman table definition")
   54.54 +JMESSAGE(JERR_BAD_IN_COLORSPACE, "Bogus input colorspace")
   54.55 +JMESSAGE(JERR_BAD_J_COLORSPACE, "Bogus JPEG colorspace")
   54.56 +JMESSAGE(JERR_BAD_LENGTH, "Bogus marker length")
   54.57 +JMESSAGE(JERR_BAD_LIB_VERSION,
   54.58 +	 "Wrong JPEG library version: library is %d, caller expects %d")
   54.59 +JMESSAGE(JERR_BAD_MCU_SIZE, "Sampling factors too large for interleaved scan")
   54.60 +JMESSAGE(JERR_BAD_POOL_ID, "Invalid memory pool code %d")
   54.61 +JMESSAGE(JERR_BAD_PRECISION, "Unsupported JPEG data precision %d")
   54.62 +JMESSAGE(JERR_BAD_PROGRESSION,
   54.63 +	 "Invalid progressive parameters Ss=%d Se=%d Ah=%d Al=%d")
   54.64 +JMESSAGE(JERR_BAD_PROG_SCRIPT,
   54.65 +	 "Invalid progressive parameters at scan script entry %d")
   54.66 +JMESSAGE(JERR_BAD_SAMPLING, "Bogus sampling factors")
   54.67 +JMESSAGE(JERR_BAD_SCAN_SCRIPT, "Invalid scan script at entry %d")
   54.68 +JMESSAGE(JERR_BAD_STATE, "Improper call to JPEG library in state %d")
   54.69 +JMESSAGE(JERR_BAD_STRUCT_SIZE,
   54.70 +	 "JPEG parameter struct mismatch: library thinks size is %u, caller expects %u")
   54.71 +JMESSAGE(JERR_BAD_VIRTUAL_ACCESS, "Bogus virtual array access")
   54.72 +JMESSAGE(JERR_BUFFER_SIZE, "Buffer passed to JPEG library is too small")
   54.73 +JMESSAGE(JERR_CANT_SUSPEND, "Suspension not allowed here")
   54.74 +JMESSAGE(JERR_CCIR601_NOTIMPL, "CCIR601 sampling not implemented yet")
   54.75 +JMESSAGE(JERR_COMPONENT_COUNT, "Too many color components: %d, max %d")
   54.76 +JMESSAGE(JERR_CONVERSION_NOTIMPL, "Unsupported color conversion request")
   54.77 +JMESSAGE(JERR_DAC_INDEX, "Bogus DAC index %d")
   54.78 +JMESSAGE(JERR_DAC_VALUE, "Bogus DAC value 0x%x")
   54.79 +JMESSAGE(JERR_DHT_INDEX, "Bogus DHT index %d")
   54.80 +JMESSAGE(JERR_DQT_INDEX, "Bogus DQT index %d")
   54.81 +JMESSAGE(JERR_EMPTY_IMAGE, "Empty JPEG image (DNL not supported)")
   54.82 +JMESSAGE(JERR_EMS_READ, "Read from EMS failed")
   54.83 +JMESSAGE(JERR_EMS_WRITE, "Write to EMS failed")
   54.84 +JMESSAGE(JERR_EOI_EXPECTED, "Didn't expect more than one scan")
   54.85 +JMESSAGE(JERR_FILE_READ, "Input file read error")
   54.86 +JMESSAGE(JERR_FILE_WRITE, "Output file write error --- out of disk space?")
   54.87 +JMESSAGE(JERR_FRACT_SAMPLE_NOTIMPL, "Fractional sampling not implemented yet")
   54.88 +JMESSAGE(JERR_HUFF_CLEN_OVERFLOW, "Huffman code size table overflow")
   54.89 +JMESSAGE(JERR_HUFF_MISSING_CODE, "Missing Huffman code table entry")
   54.90 +JMESSAGE(JERR_IMAGE_TOO_BIG, "Maximum supported image dimension is %u pixels")
   54.91 +JMESSAGE(JERR_INPUT_EMPTY, "Empty input file")
   54.92 +JMESSAGE(JERR_INPUT_EOF, "Premature end of input file")
   54.93 +JMESSAGE(JERR_MISMATCHED_QUANT_TABLE,
   54.94 +	 "Cannot transcode due to multiple use of quantization table %d")
   54.95 +JMESSAGE(JERR_MISSING_DATA, "Scan script does not transmit all data")
   54.96 +JMESSAGE(JERR_MODE_CHANGE, "Invalid color quantization mode change")
   54.97 +JMESSAGE(JERR_NOTIMPL, "Not implemented yet")
   54.98 +JMESSAGE(JERR_NOT_COMPILED, "Requested feature was omitted at compile time")
   54.99 +JMESSAGE(JERR_NO_BACKING_STORE, "Backing store not supported")
  54.100 +JMESSAGE(JERR_NO_HUFF_TABLE, "Huffman table 0x%02x was not defined")
  54.101 +JMESSAGE(JERR_NO_IMAGE, "JPEG datastream contains no image")
  54.102 +JMESSAGE(JERR_NO_QUANT_TABLE, "Quantization table 0x%02x was not defined")
  54.103 +JMESSAGE(JERR_NO_SOI, "Not a JPEG file: starts with 0x%02x 0x%02x")
  54.104 +JMESSAGE(JERR_OUT_OF_MEMORY, "Insufficient memory (case %d)")
  54.105 +JMESSAGE(JERR_QUANT_COMPONENTS,
  54.106 +	 "Cannot quantize more than %d color components")
  54.107 +JMESSAGE(JERR_QUANT_FEW_COLORS, "Cannot quantize to fewer than %d colors")
  54.108 +JMESSAGE(JERR_QUANT_MANY_COLORS, "Cannot quantize to more than %d colors")
  54.109 +JMESSAGE(JERR_SOF_DUPLICATE, "Invalid JPEG file structure: two SOF markers")
  54.110 +JMESSAGE(JERR_SOF_NO_SOS, "Invalid JPEG file structure: missing SOS marker")
  54.111 +JMESSAGE(JERR_SOF_UNSUPPORTED, "Unsupported JPEG process: SOF type 0x%02x")
  54.112 +JMESSAGE(JERR_SOI_DUPLICATE, "Invalid JPEG file structure: two SOI markers")
  54.113 +JMESSAGE(JERR_SOS_NO_SOF, "Invalid JPEG file structure: SOS before SOF")
  54.114 +JMESSAGE(JERR_TFILE_CREATE, "Failed to create temporary file %s")
  54.115 +JMESSAGE(JERR_TFILE_READ, "Read failed on temporary file")
  54.116 +JMESSAGE(JERR_TFILE_SEEK, "Seek failed on temporary file")
  54.117 +JMESSAGE(JERR_TFILE_WRITE,
  54.118 +	 "Write failed on temporary file --- out of disk space?")
  54.119 +JMESSAGE(JERR_TOO_LITTLE_DATA, "Application transferred too few scanlines")
  54.120 +JMESSAGE(JERR_UNKNOWN_MARKER, "Unsupported marker type 0x%02x")
  54.121 +JMESSAGE(JERR_VIRTUAL_BUG, "Virtual array controller messed up")
  54.122 +JMESSAGE(JERR_WIDTH_OVERFLOW, "Image too wide for this implementation")
  54.123 +JMESSAGE(JERR_XMS_READ, "Read from XMS failed")
  54.124 +JMESSAGE(JERR_XMS_WRITE, "Write to XMS failed")
  54.125 +JMESSAGE(JMSG_COPYRIGHT, JCOPYRIGHT)
  54.126 +JMESSAGE(JMSG_VERSION, JVERSION)
  54.127 +JMESSAGE(JTRC_16BIT_TABLES,
  54.128 +	 "Caution: quantization tables are too coarse for baseline JPEG")
  54.129 +JMESSAGE(JTRC_ADOBE,
  54.130 +	 "Adobe APP14 marker: version %d, flags 0x%04x 0x%04x, transform %d")
  54.131 +JMESSAGE(JTRC_APP0, "Unknown APP0 marker (not JFIF), length %u")
  54.132 +JMESSAGE(JTRC_APP14, "Unknown APP14 marker (not Adobe), length %u")
  54.133 +JMESSAGE(JTRC_DAC, "Define Arithmetic Table 0x%02x: 0x%02x")
  54.134 +JMESSAGE(JTRC_DHT, "Define Huffman Table 0x%02x")
  54.135 +JMESSAGE(JTRC_DQT, "Define Quantization Table %d  precision %d")
  54.136 +JMESSAGE(JTRC_DRI, "Define Restart Interval %u")
  54.137 +JMESSAGE(JTRC_EMS_CLOSE, "Freed EMS handle %u")
  54.138 +JMESSAGE(JTRC_EMS_OPEN, "Obtained EMS handle %u")
  54.139 +JMESSAGE(JTRC_EOI, "End Of Image")
  54.140 +JMESSAGE(JTRC_HUFFBITS, "        %3d %3d %3d %3d %3d %3d %3d %3d")
  54.141 +JMESSAGE(JTRC_JFIF, "JFIF APP0 marker: version %d.%02d, density %dx%d  %d")
  54.142 +JMESSAGE(JTRC_JFIF_BADTHUMBNAILSIZE,
  54.143 +	 "Warning: thumbnail image size does not match data length %u")
  54.144 +JMESSAGE(JTRC_JFIF_EXTENSION,
  54.145 +	 "JFIF extension marker: type 0x%02x, length %u")
  54.146 +JMESSAGE(JTRC_JFIF_THUMBNAIL, "    with %d x %d thumbnail image")
  54.147 +JMESSAGE(JTRC_MISC_MARKER, "Miscellaneous marker 0x%02x, length %u")
  54.148 +JMESSAGE(JTRC_PARMLESS_MARKER, "Unexpected marker 0x%02x")
  54.149 +JMESSAGE(JTRC_QUANTVALS, "        %4u %4u %4u %4u %4u %4u %4u %4u")
  54.150 +JMESSAGE(JTRC_QUANT_3_NCOLORS, "Quantizing to %d = %d*%d*%d colors")
  54.151 +JMESSAGE(JTRC_QUANT_NCOLORS, "Quantizing to %d colors")
  54.152 +JMESSAGE(JTRC_QUANT_SELECTED, "Selected %d colors for quantization")
  54.153 +JMESSAGE(JTRC_RECOVERY_ACTION, "At marker 0x%02x, recovery action %d")
  54.154 +JMESSAGE(JTRC_RST, "RST%d")
  54.155 +JMESSAGE(JTRC_SMOOTH_NOTIMPL,
  54.156 +	 "Smoothing not supported with nonstandard sampling ratios")
  54.157 +JMESSAGE(JTRC_SOF, "Start Of Frame 0x%02x: width=%u, height=%u, components=%d")
  54.158 +JMESSAGE(JTRC_SOF_COMPONENT, "    Component %d: %dhx%dv q=%d")
  54.159 +JMESSAGE(JTRC_SOI, "Start of Image")
  54.160 +JMESSAGE(JTRC_SOS, "Start Of Scan: %d components")
  54.161 +JMESSAGE(JTRC_SOS_COMPONENT, "    Component %d: dc=%d ac=%d")
  54.162 +JMESSAGE(JTRC_SOS_PARAMS, "  Ss=%d, Se=%d, Ah=%d, Al=%d")
  54.163 +JMESSAGE(JTRC_TFILE_CLOSE, "Closed temporary file %s")
  54.164 +JMESSAGE(JTRC_TFILE_OPEN, "Opened temporary file %s")
  54.165 +JMESSAGE(JTRC_THUMB_JPEG,
  54.166 +	 "JFIF extension marker: JPEG-compressed thumbnail image, length %u")
  54.167 +JMESSAGE(JTRC_THUMB_PALETTE,
  54.168 +	 "JFIF extension marker: palette thumbnail image, length %u")
  54.169 +JMESSAGE(JTRC_THUMB_RGB,
  54.170 +	 "JFIF extension marker: RGB thumbnail image, length %u")
  54.171 +JMESSAGE(JTRC_UNKNOWN_IDS,
  54.172 +	 "Unrecognized component IDs %d %d %d, assuming YCbCr")
  54.173 +JMESSAGE(JTRC_XMS_CLOSE, "Freed XMS handle %u")
  54.174 +JMESSAGE(JTRC_XMS_OPEN, "Obtained XMS handle %u")
  54.175 +JMESSAGE(JWRN_ADOBE_XFORM, "Unknown Adobe color transform code %d")
  54.176 +JMESSAGE(JWRN_BOGUS_PROGRESSION,
  54.177 +	 "Inconsistent progression sequence for component %d coefficient %d")
  54.178 +JMESSAGE(JWRN_EXTRANEOUS_DATA,
  54.179 +	 "Corrupt JPEG data: %u extraneous bytes before marker 0x%02x")
  54.180 +JMESSAGE(JWRN_HIT_MARKER, "Corrupt JPEG data: premature end of data segment")
  54.181 +JMESSAGE(JWRN_HUFF_BAD_CODE, "Corrupt JPEG data: bad Huffman code")
  54.182 +JMESSAGE(JWRN_JFIF_MAJOR, "Warning: unknown JFIF revision number %d.%02d")
  54.183 +JMESSAGE(JWRN_JPEG_EOF, "Premature end of JPEG file")
  54.184 +JMESSAGE(JWRN_MUST_RESYNC,
  54.185 +	 "Corrupt JPEG data: found marker 0x%02x instead of RST%d")
  54.186 +JMESSAGE(JWRN_NOT_SEQUENTIAL, "Invalid SOS parameters for sequential JPEG")
  54.187 +JMESSAGE(JWRN_TOO_MUCH_DATA, "Application transferred too many scanlines")
  54.188 +
  54.189 +#ifdef JMAKE_ENUM_LIST
  54.190 +
  54.191 +  JMSG_LASTMSGCODE
  54.192 +} J_MESSAGE_CODE;
  54.193 +
  54.194 +#undef JMAKE_ENUM_LIST
  54.195 +#endif /* JMAKE_ENUM_LIST */
  54.196 +
  54.197 +/* Zap JMESSAGE macro so that future re-inclusions do nothing by default */
  54.198 +#undef JMESSAGE
  54.199 +
  54.200 +
  54.201 +#ifndef JERROR_H
  54.202 +#define JERROR_H
  54.203 +
  54.204 +/* Macros to simplify using the error and trace message stuff */
  54.205 +/* The first parameter is either type of cinfo pointer */
  54.206 +
  54.207 +/* Fatal errors (print message and exit) */
  54.208 +#define ERREXIT(cinfo,code)  \
  54.209 +  ((cinfo)->err->msg_code = (code), \
  54.210 +   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
  54.211 +#define ERREXIT1(cinfo,code,p1)  \
  54.212 +  ((cinfo)->err->msg_code = (code), \
  54.213 +   (cinfo)->err->msg_parm.i[0] = (p1), \
  54.214 +   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
  54.215 +#define ERREXIT2(cinfo,code,p1,p2)  \
  54.216 +  ((cinfo)->err->msg_code = (code), \
  54.217 +   (cinfo)->err->msg_parm.i[0] = (p1), \
  54.218 +   (cinfo)->err->msg_parm.i[1] = (p2), \
  54.219 +   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
  54.220 +#define ERREXIT3(cinfo,code,p1,p2,p3)  \
  54.221 +  ((cinfo)->err->msg_code = (code), \
  54.222 +   (cinfo)->err->msg_parm.i[0] = (p1), \
  54.223 +   (cinfo)->err->msg_parm.i[1] = (p2), \
  54.224 +   (cinfo)->err->msg_parm.i[2] = (p3), \
  54.225 +   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
  54.226 +#define ERREXIT4(cinfo,code,p1,p2,p3,p4)  \
  54.227 +  ((cinfo)->err->msg_code = (code), \
  54.228 +   (cinfo)->err->msg_parm.i[0] = (p1), \
  54.229 +   (cinfo)->err->msg_parm.i[1] = (p2), \
  54.230 +   (cinfo)->err->msg_parm.i[2] = (p3), \
  54.231 +   (cinfo)->err->msg_parm.i[3] = (p4), \
  54.232 +   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
  54.233 +#define ERREXITS(cinfo,code,str)  \
  54.234 +  ((cinfo)->err->msg_code = (code), \
  54.235 +   strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \
  54.236 +   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
  54.237 +
  54.238 +#define MAKESTMT(stuff)		do { stuff } while (0)
  54.239 +
  54.240 +/* Nonfatal errors (we can keep going, but the data is probably corrupt) */
  54.241 +#define WARNMS(cinfo,code)  \
  54.242 +  ((cinfo)->err->msg_code = (code), \
  54.243 +   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))
  54.244 +#define WARNMS1(cinfo,code,p1)  \
  54.245 +  ((cinfo)->err->msg_code = (code), \
  54.246 +   (cinfo)->err->msg_parm.i[0] = (p1), \
  54.247 +   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))
  54.248 +#define WARNMS2(cinfo,code,p1,p2)  \
  54.249 +  ((cinfo)->err->msg_code = (code), \
  54.250 +   (cinfo)->err->msg_parm.i[0] = (p1), \
  54.251 +   (cinfo)->err->msg_parm.i[1] = (p2), \
  54.252 +   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))
  54.253 +
  54.254 +/* Informational/debugging messages */
  54.255 +#define TRACEMS(cinfo,lvl,code)  \
  54.256 +  ((cinfo)->err->msg_code = (code), \
  54.257 +   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
  54.258 +#define TRACEMS1(cinfo,lvl,code,p1)  \
  54.259 +  ((cinfo)->err->msg_code = (code), \
  54.260 +   (cinfo)->err->msg_parm.i[0] = (p1), \
  54.261 +   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
  54.262 +#define TRACEMS2(cinfo,lvl,code,p1,p2)  \
  54.263 +  ((cinfo)->err->msg_code = (code), \
  54.264 +   (cinfo)->err->msg_parm.i[0] = (p1), \
  54.265 +   (cinfo)->err->msg_parm.i[1] = (p2), \
  54.266 +   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
  54.267 +#define TRACEMS3(cinfo,lvl,code,p1,p2,p3)  \
  54.268 +  MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
  54.269 +	   _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); \
  54.270 +	   (cinfo)->err->msg_code = (code); \
  54.271 +	   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
  54.272 +#define TRACEMS4(cinfo,lvl,code,p1,p2,p3,p4)  \
  54.273 +  MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
  54.274 +	   _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
  54.275 +	   (cinfo)->err->msg_code = (code); \
  54.276 +	   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
  54.277 +#define TRACEMS5(cinfo,lvl,code,p1,p2,p3,p4,p5)  \
  54.278 +  MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
  54.279 +	   _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
  54.280 +	   _mp[4] = (p5); \
  54.281 +	   (cinfo)->err->msg_code = (code); \
  54.282 +	   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
  54.283 +#define TRACEMS8(cinfo,lvl,code,p1,p2,p3,p4,p5,p6,p7,p8)  \
  54.284 +  MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
  54.285 +	   _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
  54.286 +	   _mp[4] = (p5); _mp[5] = (p6); _mp[6] = (p7); _mp[7] = (p8); \
  54.287 +	   (cinfo)->err->msg_code = (code); \
  54.288 +	   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
  54.289 +#define TRACEMSS(cinfo,lvl,code,str)  \
  54.290 +  ((cinfo)->err->msg_code = (code), \
  54.291 +   strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \
  54.292 +   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
  54.293 +
  54.294 +#endif /* JERROR_H */
    55.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    55.2 +++ b/libs/libjpeg/jfdctflt.c	Sun Nov 01 00:36:56 2015 +0200
    55.3 @@ -0,0 +1,168 @@
    55.4 +/*
    55.5 + * jfdctflt.c
    55.6 + *
    55.7 + * Copyright (C) 1994-1996, Thomas G. Lane.
    55.8 + * This file is part of the Independent JPEG Group's software.
    55.9 + * For conditions of distribution and use, see the accompanying README file.
   55.10 + *
   55.11 + * This file contains a floating-point implementation of the
   55.12 + * forward DCT (Discrete Cosine Transform).
   55.13 + *
   55.14 + * This implementation should be more accurate than either of the integer
   55.15 + * DCT implementations.  However, it may not give the same results on all
   55.16 + * machines because of differences in roundoff behavior.  Speed will depend
   55.17 + * on the hardware's floating point capacity.
   55.18 + *
   55.19 + * A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT
   55.20 + * on each column.  Direct algorithms are also available, but they are
   55.21 + * much more complex and seem not to be any faster when reduced to code.
   55.22 + *
   55.23 + * This implementation is based on Arai, Agui, and Nakajima's algorithm for
   55.24 + * scaled DCT.  Their original paper (Trans. IEICE E-71(11):1095) is in
   55.25 + * Japanese, but the algorithm is described in the Pennebaker & Mitchell
   55.26 + * JPEG textbook (see REFERENCES section in file README).  The following code
   55.27 + * is based directly on figure 4-8 in P&M.
   55.28 + * While an 8-point DCT cannot be done in less than 11 multiplies, it is
   55.29 + * possible to arrange the computation so that many of the multiplies are
   55.30 + * simple scalings of the final outputs.  These multiplies can then be
   55.31 + * folded into the multiplications or divisions by the JPEG quantization
   55.32 + * table entries.  The AA&N method leaves only 5 multiplies and 29 adds
   55.33 + * to be done in the DCT itself.
   55.34 + * The primary disadvantage of this method is that with a fixed-point
   55.35 + * implementation, accuracy is lost due to imprecise representation of the
   55.36 + * scaled quantization values.  However, that problem does not arise if
   55.37 + * we use floating point arithmetic.
   55.38 + */
   55.39 +
   55.40 +#define JPEG_INTERNALS
   55.41 +#include "jinclude.h"
   55.42 +#include "jpeglib.h"
   55.43 +#include "jdct.h"		/* Private declarations for DCT subsystem */
   55.44 +
   55.45 +#ifdef DCT_FLOAT_SUPPORTED
   55.46 +
   55.47 +
   55.48 +/*
   55.49 + * This module is specialized to the case DCTSIZE = 8.
   55.50 + */
   55.51 +
   55.52 +#if DCTSIZE != 8
   55.53 +  Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
   55.54 +#endif
   55.55 +
   55.56 +
   55.57 +/*
   55.58 + * Perform the forward DCT on one block of samples.
   55.59 + */
   55.60 +
   55.61 +GLOBAL(void)
   55.62 +jpeg_fdct_float (FAST_FLOAT * data)
   55.63 +{
   55.64 +  FAST_FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
   55.65 +  FAST_FLOAT tmp10, tmp11, tmp12, tmp13;
   55.66 +  FAST_FLOAT z1, z2, z3, z4, z5, z11, z13;
   55.67 +  FAST_FLOAT *dataptr;
   55.68 +  int ctr;
   55.69 +
   55.70 +  /* Pass 1: process rows. */
   55.71 +
   55.72 +  dataptr = data;
   55.73 +  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
   55.74 +    tmp0 = dataptr[0] + dataptr[7];
   55.75 +    tmp7 = dataptr[0] - dataptr[7];
   55.76 +    tmp1 = dataptr[1] + dataptr[6];
   55.77 +    tmp6 = dataptr[1] - dataptr[6];
   55.78 +    tmp2 = dataptr[2] + dataptr[5];
   55.79 +    tmp5 = dataptr[2] - dataptr[5];
   55.80 +    tmp3 = dataptr[3] + dataptr[4];
   55.81 +    tmp4 = dataptr[3] - dataptr[4];
   55.82 +    
   55.83 +    /* Even part */
   55.84 +    
   55.85 +    tmp10 = tmp0 + tmp3;	/* phase 2 */
   55.86 +    tmp13 = tmp0 - tmp3;
   55.87 +    tmp11 = tmp1 + tmp2;
   55.88 +    tmp12 = tmp1 - tmp2;
   55.89 +    
   55.90 +    dataptr[0] = tmp10 + tmp11; /* phase 3 */
   55.91 +    dataptr[4] = tmp10 - tmp11;
   55.92 +    
   55.93 +    z1 = (tmp12 + tmp13) * ((FAST_FLOAT) 0.707106781); /* c4 */
   55.94 +    dataptr[2] = tmp13 + z1;	/* phase 5 */
   55.95 +    dataptr[6] = tmp13 - z1;
   55.96 +    
   55.97 +    /* Odd part */
   55.98 +
   55.99 +    tmp10 = tmp4 + tmp5;	/* phase 2 */
  55.100 +    tmp11 = tmp5 + tmp6;
  55.101 +    tmp12 = tmp6 + tmp7;
  55.102 +
  55.103 +    /* The rotator is modified from fig 4-8 to avoid extra negations. */
  55.104 +    z5 = (tmp10 - tmp12) * ((FAST_FLOAT) 0.382683433); /* c6 */
  55.105 +    z2 = ((FAST_FLOAT) 0.541196100) * tmp10 + z5; /* c2-c6 */
  55.106 +    z4 = ((FAST_FLOAT) 1.306562965) * tmp12 + z5; /* c2+c6 */
  55.107 +    z3 = tmp11 * ((FAST_FLOAT) 0.707106781); /* c4 */
  55.108 +
  55.109 +    z11 = tmp7 + z3;		/* phase 5 */
  55.110 +    z13 = tmp7 - z3;
  55.111 +
  55.112 +    dataptr[5] = z13 + z2;	/* phase 6 */
  55.113 +    dataptr[3] = z13 - z2;
  55.114 +    dataptr[1] = z11 + z4;
  55.115 +    dataptr[7] = z11 - z4;
  55.116 +
  55.117 +    dataptr += DCTSIZE;		/* advance pointer to next row */
  55.118 +  }
  55.119 +
  55.120 +  /* Pass 2: process columns. */
  55.121 +
  55.122 +  dataptr = data;
  55.123 +  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
  55.124 +    tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7];
  55.125 +    tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7];
  55.126 +    tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6];
  55.127 +    tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6];
  55.128 +    tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5];
  55.129 +    tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5];
  55.130 +    tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4];
  55.131 +    tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4];
  55.132 +    
  55.133 +    /* Even part */
  55.134 +    
  55.135 +    tmp10 = tmp0 + tmp3;	/* phase 2 */
  55.136 +    tmp13 = tmp0 - tmp3;
  55.137 +    tmp11 = tmp1 + tmp2;
  55.138 +    tmp12 = tmp1 - tmp2;
  55.139 +    
  55.140 +    dataptr[DCTSIZE*0] = tmp10 + tmp11; /* phase 3 */
  55.141 +    dataptr[DCTSIZE*4] = tmp10 - tmp11;
  55.142 +    
  55.143 +    z1 = (tmp12 + tmp13) * ((FAST_FLOAT) 0.707106781); /* c4 */
  55.144 +    dataptr[DCTSIZE*2] = tmp13 + z1; /* phase 5 */
  55.145 +    dataptr[DCTSIZE*6] = tmp13 - z1;
  55.146 +    
  55.147 +    /* Odd part */
  55.148 +
  55.149 +    tmp10 = tmp4 + tmp5;	/* phase 2 */
  55.150 +    tmp11 = tmp5 + tmp6;
  55.151 +    tmp12 = tmp6 + tmp7;
  55.152 +
  55.153 +    /* The rotator is modified from fig 4-8 to avoid extra negations. */
  55.154 +    z5 = (tmp10 - tmp12) * ((FAST_FLOAT) 0.382683433); /* c6 */
  55.155 +    z2 = ((FAST_FLOAT) 0.541196100) * tmp10 + z5; /* c2-c6 */
  55.156 +    z4 = ((FAST_FLOAT) 1.306562965) * tmp12 + z5; /* c2+c6 */
  55.157 +    z3 = tmp11 * ((FAST_FLOAT) 0.707106781); /* c4 */
  55.158 +
  55.159 +    z11 = tmp7 + z3;		/* phase 5 */
  55.160 +    z13 = tmp7 - z3;
  55.161 +
  55.162 +    dataptr[DCTSIZE*5] = z13 + z2; /* phase 6 */
  55.163 +    dataptr[DCTSIZE*3] = z13 - z2;
  55.164 +    dataptr[DCTSIZE*1] = z11 + z4;
  55.165 +    dataptr[DCTSIZE*7] = z11 - z4;
  55.166 +
  55.167 +    dataptr++;			/* advance pointer to next column */
  55.168 +  }
  55.169 +}
  55.170 +
  55.171 +#endif /* DCT_FLOAT_SUPPORTED */
    56.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    56.2 +++ b/libs/libjpeg/jfdctfst.c	Sun Nov 01 00:36:56 2015 +0200
    56.3 @@ -0,0 +1,224 @@
    56.4 +/*
    56.5 + * jfdctfst.c
    56.6 + *
    56.7 + * Copyright (C) 1994-1996, Thomas G. Lane.
    56.8 + * This file is part of the Independent JPEG Group's software.
    56.9 + * For conditions of distribution and use, see the accompanying README file.
   56.10 + *
   56.11 + * This file contains a fast, not so accurate integer implementation of the
   56.12 + * forward DCT (Discrete Cosine Transform).
   56.13 + *
   56.14 + * A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT
   56.15 + * on each column.  Direct algorithms are also available, but they are
   56.16 + * much more complex and seem not to be any faster when reduced to code.
   56.17 + *
   56.18 + * This implementation is based on Arai, Agui, and Nakajima's algorithm for
   56.19 + * scaled DCT.  Their original paper (Trans. IEICE E-71(11):1095) is in
   56.20 + * Japanese, but the algorithm is described in the Pennebaker & Mitchell
   56.21 + * JPEG textbook (see REFERENCES section in file README).  The following code
   56.22 + * is based directly on figure 4-8 in P&M.
   56.23 + * While an 8-point DCT cannot be done in less than 11 multiplies, it is
   56.24 + * possible to arrange the computation so that many of the multiplies are
   56.25 + * simple scalings of the final outputs.  These multiplies can then be
   56.26 + * folded into the multiplications or divisions by the JPEG quantization
   56.27 + * table entries.  The AA&N method leaves only 5 multiplies and 29 adds
   56.28 + * to be done in the DCT itself.
   56.29 + * The primary disadvantage of this method is that with fixed-point math,
   56.30 + * accuracy is lost due to imprecise representation of the scaled
   56.31 + * quantization values.  The smaller the quantization table entry, the less
   56.32 + * precise the scaled value, so this implementation does worse with high-
   56.33 + * quality-setting files than with low-quality ones.
   56.34 + */
   56.35 +
   56.36 +#define JPEG_INTERNALS
   56.37 +#include "jinclude.h"
   56.38 +#include "jpeglib.h"
   56.39 +#include "jdct.h"		/* Private declarations for DCT subsystem */
   56.40 +
   56.41 +#ifdef DCT_IFAST_SUPPORTED
   56.42 +
   56.43 +
   56.44 +/*
   56.45 + * This module is specialized to the case DCTSIZE = 8.
   56.46 + */
   56.47 +
   56.48 +#if DCTSIZE != 8
   56.49 +  Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
   56.50 +#endif
   56.51 +
   56.52 +
   56.53 +/* Scaling decisions are generally the same as in the LL&M algorithm;
   56.54 + * see jfdctint.c for more details.  However, we choose to descale
   56.55 + * (right shift) multiplication products as soon as they are formed,
   56.56 + * rather than carrying additional fractional bits into subsequent additions.
   56.57 + * This compromises accuracy slightly, but it lets us save a few shifts.
   56.58 + * More importantly, 16-bit arithmetic is then adequate (for 8-bit samples)
   56.59 + * everywhere except in the multiplications proper; this saves a good deal
   56.60 + * of work on 16-bit-int machines.
   56.61 + *
   56.62 + * Again to save a few shifts, the intermediate results between pass 1 and
   56.63 + * pass 2 are not upscaled, but are represented only to integral precision.
   56.64 + *
   56.65 + * A final compromise is to represent the multiplicative constants to only
   56.66 + * 8 fractional bits, rather than 13.  This saves some shifting work on some
   56.67 + * machines, and may also reduce the cost of multiplication (since there
   56.68 + * are fewer one-bits in the constants).
   56.69 + */
   56.70 +
   56.71 +#define CONST_BITS  8
   56.72 +
   56.73 +
   56.74 +/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus
   56.75 + * causing a lot of useless floating-point operations at run time.
   56.76 + * To get around this we use the following pre-calculated constants.
   56.77 + * If you change CONST_BITS you may want to add appropriate values.
   56.78 + * (With a reasonable C compiler, you can just rely on the FIX() macro...)
   56.79 + */
   56.80 +
   56.81 +#if CONST_BITS == 8
   56.82 +#define FIX_0_382683433  ((INT32)   98)		/* FIX(0.382683433) */
   56.83 +#define FIX_0_541196100  ((INT32)  139)		/* FIX(0.541196100) */
   56.84 +#define FIX_0_707106781  ((INT32)  181)		/* FIX(0.707106781) */
   56.85 +#define FIX_1_306562965  ((INT32)  334)		/* FIX(1.306562965) */
   56.86 +#else
   56.87 +#define FIX_0_382683433  FIX(0.382683433)
   56.88 +#define FIX_0_541196100  FIX(0.541196100)
   56.89 +#define FIX_0_707106781  FIX(0.707106781)
   56.90 +#define FIX_1_306562965  FIX(1.306562965)
   56.91 +#endif
   56.92 +
   56.93 +
   56.94 +/* We can gain a little more speed, with a further compromise in accuracy,
   56.95 + * by omitting the addition in a descaling shift.  This yields an incorrectly
   56.96 + * rounded result half the time...
   56.97 + */
   56.98 +
   56.99 +#ifndef USE_ACCURATE_ROUNDING
  56.100 +#undef DESCALE
  56.101 +#define DESCALE(x,n)  RIGHT_SHIFT(x, n)
  56.102 +#endif
  56.103 +
  56.104 +
  56.105 +/* Multiply a DCTELEM variable by an INT32 constant, and immediately
  56.106 + * descale to yield a DCTELEM result.
  56.107 + */
  56.108 +
  56.109 +#define MULTIPLY(var,const)  ((DCTELEM) DESCALE((var) * (const), CONST_BITS))
  56.110 +
  56.111 +
  56.112 +/*
  56.113 + * Perform the forward DCT on one block of samples.
  56.114 + */
  56.115 +
  56.116 +GLOBAL(void)
  56.117 +jpeg_fdct_ifast (DCTELEM * data)
  56.118 +{
  56.119 +  DCTELEM tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
  56.120 +  DCTELEM tmp10, tmp11, tmp12, tmp13;
  56.121 +  DCTELEM z1, z2, z3, z4, z5, z11, z13;
  56.122 +  DCTELEM *dataptr;
  56.123 +  int ctr;
  56.124 +  SHIFT_TEMPS
  56.125 +
  56.126 +  /* Pass 1: process rows. */
  56.127 +
  56.128 +  dataptr = data;
  56.129 +  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
  56.130 +    tmp0 = dataptr[0] + dataptr[7];
  56.131 +    tmp7 = dataptr[0] - dataptr[7];
  56.132 +    tmp1 = dataptr[1] + dataptr[6];
  56.133 +    tmp6 = dataptr[1] - dataptr[6];
  56.134 +    tmp2 = dataptr[2] + dataptr[5];
  56.135 +    tmp5 = dataptr[2] - dataptr[5];
  56.136 +    tmp3 = dataptr[3] + dataptr[4];
  56.137 +    tmp4 = dataptr[3] - dataptr[4];
  56.138 +    
  56.139 +    /* Even part */
  56.140 +    
  56.141 +    tmp10 = tmp0 + tmp3;	/* phase 2 */
  56.142 +    tmp13 = tmp0 - tmp3;
  56.143 +    tmp11 = tmp1 + tmp2;
  56.144 +    tmp12 = tmp1 - tmp2;
  56.145 +    
  56.146 +    dataptr[0] = tmp10 + tmp11; /* phase 3 */
  56.147 +    dataptr[4] = tmp10 - tmp11;
  56.148 +    
  56.149 +    z1 = MULTIPLY(tmp12 + tmp13, FIX_0_707106781); /* c4 */
  56.150 +    dataptr[2] = tmp13 + z1;	/* phase 5 */
  56.151 +    dataptr[6] = tmp13 - z1;
  56.152 +    
  56.153 +    /* Odd part */
  56.154 +
  56.155 +    tmp10 = tmp4 + tmp5;	/* phase 2 */
  56.156 +    tmp11 = tmp5 + tmp6;
  56.157 +    tmp12 = tmp6 + tmp7;
  56.158 +
  56.159 +    /* The rotator is modified from fig 4-8 to avoid extra negations. */
  56.160 +    z5 = MULTIPLY(tmp10 - tmp12, FIX_0_382683433); /* c6 */
  56.161 +    z2 = MULTIPLY(tmp10, FIX_0_541196100) + z5; /* c2-c6 */
  56.162 +    z4 = MULTIPLY(tmp12, FIX_1_306562965) + z5; /* c2+c6 */
  56.163 +    z3 = MULTIPLY(tmp11, FIX_0_707106781); /* c4 */
  56.164 +
  56.165 +    z11 = tmp7 + z3;		/* phase 5 */
  56.166 +    z13 = tmp7 - z3;
  56.167 +
  56.168 +    dataptr[5] = z13 + z2;	/* phase 6 */
  56.169 +    dataptr[3] = z13 - z2;
  56.170 +    dataptr[1] = z11 + z4;
  56.171 +    dataptr[7] = z11 - z4;
  56.172 +
  56.173 +    dataptr += DCTSIZE;		/* advance pointer to next row */
  56.174 +  }
  56.175 +
  56.176 +  /* Pass 2: process columns. */
  56.177 +
  56.178 +  dataptr = data;
  56.179 +  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
  56.180 +    tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7];
  56.181 +    tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7];
  56.182 +    tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6];
  56.183 +    tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6];
  56.184 +    tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5];
  56.185 +    tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5];
  56.186 +    tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4];
  56.187 +    tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4];
  56.188 +    
  56.189 +    /* Even part */
  56.190 +    
  56.191 +    tmp10 = tmp0 + tmp3;	/* phase 2 */
  56.192 +    tmp13 = tmp0 - tmp3;
  56.193 +    tmp11 = tmp1 + tmp2;
  56.194 +    tmp12 = tmp1 - tmp2;
  56.195 +    
  56.196 +    dataptr[DCTSIZE*0] = tmp10 + tmp11; /* phase 3 */
  56.197 +    dataptr[DCTSIZE*4] = tmp10 - tmp11;
  56.198 +    
  56.199 +    z1 = MULTIPLY(tmp12 + tmp13, FIX_0_707106781); /* c4 */
  56.200 +    dataptr[DCTSIZE*2] = tmp13 + z1; /* phase 5 */
  56.201 +    dataptr[DCTSIZE*6] = tmp13 - z1;
  56.202 +    
  56.203 +    /* Odd part */
  56.204 +
  56.205 +    tmp10 = tmp4 + tmp5;	/* phase 2 */
  56.206 +    tmp11 = tmp5 + tmp6;
  56.207 +    tmp12 = tmp6 + tmp7;
  56.208 +
  56.209 +    /* The rotator is modified from fig 4-8 to avoid extra negations. */
  56.210 +    z5 = MULTIPLY(tmp10 - tmp12, FIX_0_382683433); /* c6 */
  56.211 +    z2 = MULTIPLY(tmp10, FIX_0_541196100) + z5; /* c2-c6 */
  56.212 +    z4 = MULTIPLY(tmp12, FIX_1_306562965) + z5; /* c2+c6 */
  56.213 +    z3 = MULTIPLY(tmp11, FIX_0_707106781); /* c4 */
  56.214 +
  56.215 +    z11 = tmp7 + z3;		/* phase 5 */
  56.216 +    z13 = tmp7 - z3;
  56.217 +
  56.218 +    dataptr[DCTSIZE*5] = z13 + z2; /* phase 6 */
  56.219 +    dataptr[DCTSIZE*3] = z13 - z2;
  56.220 +    dataptr[DCTSIZE*1] = z11 + z4;
  56.221 +    dataptr[DCTSIZE*7] = z11 - z4;
  56.222 +
  56.223 +    dataptr++;			/* advance pointer to next column */
  56.224 +  }
  56.225 +}
  56.226 +
  56.227 +#endif /* DCT_IFAST_SUPPORTED */
    57.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    57.2 +++ b/libs/libjpeg/jfdctint.c	Sun Nov 01 00:36:56 2015 +0200
    57.3 @@ -0,0 +1,283 @@
    57.4 +/*
    57.5 + * jfdctint.c
    57.6 + *
    57.7 + * Copyright (C) 1991-1996, Thomas G. Lane.
    57.8 + * This file is part of the Independent JPEG Group's software.
    57.9 + * For conditions of distribution and use, see the accompanying README file.
   57.10 + *
   57.11 + * This file contains a slow-but-accurate integer implementation of the
   57.12 + * forward DCT (Discrete Cosine Transform).
   57.13 + *
   57.14 + * A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT
   57.15 + * on each column.  Direct algorithms are also available, but they are
   57.16 + * much more complex and seem not to be any faster when reduced to code.
   57.17 + *
   57.18 + * This implementation is based on an algorithm described in
   57.19 + *   C. Loeffler, A. Ligtenberg and G. Moschytz, "Practical Fast 1-D DCT
   57.20 + *   Algorithms with 11 Multiplications", Proc. Int'l. Conf. on Acoustics,
   57.21 + *   Speech, and Signal Processing 1989 (ICASSP '89), pp. 988-991.
   57.22 + * The primary algorithm described there uses 11 multiplies and 29 adds.
   57.23 + * We use their alternate method with 12 multiplies and 32 adds.
   57.24 + * The advantage of this method is that no data path contains more than one
   57.25 + * multiplication; this allows a very simple and accurate implementation in
   57.26 + * scaled fixed-point arithmetic, with a minimal number of shifts.
   57.27 + */
   57.28 +
   57.29 +#define JPEG_INTERNALS
   57.30 +#include "jinclude.h"
   57.31 +#include "jpeglib.h"
   57.32 +#include "jdct.h"		/* Private declarations for DCT subsystem */
   57.33 +
   57.34 +#ifdef DCT_ISLOW_SUPPORTED
   57.35 +
   57.36 +
   57.37 +/*
   57.38 + * This module is specialized to the case DCTSIZE = 8.
   57.39 + */
   57.40 +
   57.41 +#if DCTSIZE != 8
   57.42 +  Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
   57.43 +#endif
   57.44 +
   57.45 +
   57.46 +/*
   57.47 + * The poop on this scaling stuff is as follows:
   57.48 + *
   57.49 + * Each 1-D DCT step produces outputs which are a factor of sqrt(N)
   57.50 + * larger than the true DCT outputs.  The final outputs are therefore
   57.51 + * a factor of N larger than desired; since N=8 this can be cured by
   57.52 + * a simple right shift at the end of the algorithm.  The advantage of
   57.53 + * this arrangement is that we save two multiplications per 1-D DCT,
   57.54 + * because the y0 and y4 outputs need not be divided by sqrt(N).
   57.55 + * In the IJG code, this factor of 8 is removed by the quantization step
   57.56 + * (in jcdctmgr.c), NOT in this module.
   57.57 + *
   57.58 + * We have to do addition and subtraction of the integer inputs, which
   57.59 + * is no problem, and multiplication by fractional constants, which is
   57.60 + * a problem to do in integer arithmetic.  We multiply all the constants
   57.61 + * by CONST_SCALE and convert them to integer constants (thus retaining
   57.62 + * CONST_BITS bits of precision in the constants).  After doing a
   57.63 + * multiplication we have to divide the product by CONST_SCALE, with proper
   57.64 + * rounding, to produce the correct output.  This division can be done
   57.65 + * cheaply as a right shift of CONST_BITS bits.  We postpone shifting
   57.66 + * as long as possible so that partial sums can be added together with
   57.67 + * full fractional precision.
   57.68 + *
   57.69 + * The outputs of the first pass are scaled up by PASS1_BITS bits so that
   57.70 + * they are represented to better-than-integral precision.  These outputs
   57.71 + * require BITS_IN_JSAMPLE + PASS1_BITS + 3 bits; this fits in a 16-bit word
   57.72 + * with the recommended scaling.  (For 12-bit sample data, the intermediate
   57.73 + * array is INT32 anyway.)
   57.74 + *
   57.75 + * To avoid overflow of the 32-bit intermediate results in pass 2, we must
   57.76 + * have BITS_IN_JSAMPLE + CONST_BITS + PASS1_BITS <= 26.  Error analysis
   57.77 + * shows that the values given below are the most effective.
   57.78 + */
   57.79 +
   57.80 +#if BITS_IN_JSAMPLE == 8
   57.81 +#define CONST_BITS  13
   57.82 +#define PASS1_BITS  2
   57.83 +#else
   57.84 +#define CONST_BITS  13
   57.85 +#define PASS1_BITS  1		/* lose a little precision to avoid overflow */
   57.86 +#endif
   57.87 +
   57.88 +/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus
   57.89 + * causing a lot of useless floating-point operations at run time.
   57.90 + * To get around this we use the following pre-calculated constants.
   57.91 + * If you change CONST_BITS you may want to add appropriate values.
   57.92 + * (With a reasonable C compiler, you can just rely on the FIX() macro...)
   57.93 + */
   57.94 +
   57.95 +#if CONST_BITS == 13
   57.96 +#define FIX_0_298631336  ((INT32)  2446)	/* FIX(0.298631336) */
   57.97 +#define FIX_0_390180644  ((INT32)  3196)	/* FIX(0.390180644) */
   57.98 +#define FIX_0_541196100  ((INT32)  4433)	/* FIX(0.541196100) */
   57.99 +#define FIX_0_765366865  ((INT32)  6270)	/* FIX(0.765366865) */
  57.100 +#define FIX_0_899976223  ((INT32)  7373)	/* FIX(0.899976223) */
  57.101 +#define FIX_1_175875602  ((INT32)  9633)	/* FIX(1.175875602) */
  57.102 +#define FIX_1_501321110  ((INT32)  12299)	/* FIX(1.501321110) */
  57.103 +#define FIX_1_847759065  ((INT32)  15137)	/* FIX(1.847759065) */
  57.104 +#define FIX_1_961570560  ((INT32)  16069)	/* FIX(1.961570560) */
  57.105 +#define FIX_2_053119869  ((INT32)  16819)	/* FIX(2.053119869) */
  57.106 +#define FIX_2_562915447  ((INT32)  20995)	/* FIX(2.562915447) */
  57.107 +#define FIX_3_072711026  ((INT32)  25172)	/* FIX(3.072711026) */
  57.108 +#else
  57.109 +#define FIX_0_298631336  FIX(0.298631336)
  57.110 +#define FIX_0_390180644  FIX(0.390180644)
  57.111 +#define FIX_0_541196100  FIX(0.541196100)
  57.112 +#define FIX_0_765366865  FIX(0.765366865)
  57.113 +#define FIX_0_899976223  FIX(0.899976223)
  57.114 +#define FIX_1_175875602  FIX(1.175875602)
  57.115 +#define FIX_1_501321110  FIX(1.501321110)
  57.116 +#define FIX_1_847759065  FIX(1.847759065)
  57.117 +#define FIX_1_961570560  FIX(1.961570560)
  57.118 +#define FIX_2_053119869  FIX(2.053119869)
  57.119 +#define FIX_2_562915447  FIX(2.562915447)
  57.120 +#define FIX_3_072711026  FIX(3.072711026)
  57.121 +#endif
  57.122 +
  57.123 +
  57.124 +/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result.
  57.125 + * For 8-bit samples with the recommended scaling, all the variable
  57.126 + * and constant values involved are no more than 16 bits wide, so a
  57.127 + * 16x16->32 bit multiply can be used instead of a full 32x32 multiply.
  57.128 + * For 12-bit samples, a full 32-bit multiplication will be needed.
  57.129 + */
  57.130 +
  57.131 +#if BITS_IN_JSAMPLE == 8
  57.132 +#define MULTIPLY(var,const)  MULTIPLY16C16(var,const)
  57.133 +#else
  57.134 +#define MULTIPLY(var,const)  ((var) * (const))
  57.135 +#endif
  57.136 +
  57.137 +
  57.138 +/*
  57.139 + * Perform the forward DCT on one block of samples.
  57.140 + */
  57.141 +
  57.142 +GLOBAL(void)
  57.143 +jpeg_fdct_islow (DCTELEM * data)
  57.144 +{
  57.145 +  INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
  57.146 +  INT32 tmp10, tmp11, tmp12, tmp13;
  57.147 +  INT32 z1, z2, z3, z4, z5;
  57.148 +  DCTELEM *dataptr;
  57.149 +  int ctr;
  57.150 +  SHIFT_TEMPS
  57.151 +
  57.152 +  /* Pass 1: process rows. */
  57.153 +  /* Note results are scaled up by sqrt(8) compared to a true DCT; */
  57.154 +  /* furthermore, we scale the results by 2**PASS1_BITS. */
  57.155 +
  57.156 +  dataptr = data;
  57.157 +  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
  57.158 +    tmp0 = dataptr[0] + dataptr[7];
  57.159 +    tmp7 = dataptr[0] - dataptr[7];
  57.160 +    tmp1 = dataptr[1] + dataptr[6];
  57.161 +    tmp6 = dataptr[1] - dataptr[6];
  57.162 +    tmp2 = dataptr[2] + dataptr[5];
  57.163 +    tmp5 = dataptr[2] - dataptr[5];
  57.164 +    tmp3 = dataptr[3] + dataptr[4];
  57.165 +    tmp4 = dataptr[3] - dataptr[4];
  57.166 +    
  57.167 +    /* Even part per LL&M figure 1 --- note that published figure is faulty;
  57.168 +     * rotator "sqrt(2)*c1" should be "sqrt(2)*c6".
  57.169 +     */
  57.170 +    
  57.171 +    tmp10 = tmp0 + tmp3;
  57.172 +    tmp13 = tmp0 - tmp3;
  57.173 +    tmp11 = tmp1 + tmp2;
  57.174 +    tmp12 = tmp1 - tmp2;
  57.175 +    
  57.176 +    dataptr[0] = (DCTELEM) ((tmp10 + tmp11) << PASS1_BITS);
  57.177 +    dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << PASS1_BITS);
  57.178 +    
  57.179 +    z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100);
  57.180 +    dataptr[2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865),
  57.181 +				   CONST_BITS-PASS1_BITS);
  57.182 +    dataptr[6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065),
  57.183 +				   CONST_BITS-PASS1_BITS);
  57.184 +    
  57.185 +    /* Odd part per figure 8 --- note paper omits factor of sqrt(2).
  57.186 +     * cK represents cos(K*pi/16).
  57.187 +     * i0..i3 in the paper are tmp4..tmp7 here.
  57.188 +     */
  57.189 +    
  57.190 +    z1 = tmp4 + tmp7;
  57.191 +    z2 = tmp5 + tmp6;
  57.192 +    z3 = tmp4 + tmp6;
  57.193 +    z4 = tmp5 + tmp7;
  57.194 +    z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */
  57.195 +    
  57.196 +    tmp4 = MULTIPLY(tmp4, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */
  57.197 +    tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */
  57.198 +    tmp6 = MULTIPLY(tmp6, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */
  57.199 +    tmp7 = MULTIPLY(tmp7, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */
  57.200 +    z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */
  57.201 +    z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */
  57.202 +    z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */
  57.203 +    z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */
  57.204 +    
  57.205 +    z3 += z5;
  57.206 +    z4 += z5;
  57.207 +    
  57.208 +    dataptr[7] = (DCTELEM) DESCALE(tmp4 + z1 + z3, CONST_BITS-PASS1_BITS);
  57.209 +    dataptr[5] = (DCTELEM) DESCALE(tmp5 + z2 + z4, CONST_BITS-PASS1_BITS);
  57.210 +    dataptr[3] = (DCTELEM) DESCALE(tmp6 + z2 + z3, CONST_BITS-PASS1_BITS);
  57.211 +    dataptr[1] = (DCTELEM) DESCALE(tmp7 + z1 + z4, CONST_BITS-PASS1_BITS);
  57.212 +    
  57.213 +    dataptr += DCTSIZE;		/* advance pointer to next row */
  57.214 +  }
  57.215 +
  57.216 +  /* Pass 2: process columns.
  57.217 +   * We remove the PASS1_BITS scaling, but leave the results scaled up
  57.218 +   * by an overall factor of 8.
  57.219 +   */
  57.220 +
  57.221 +  dataptr = data;
  57.222 +  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
  57.223 +    tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7];
  57.224 +    tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7];
  57.225 +    tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6];
  57.226 +    tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6];
  57.227 +    tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5];
  57.228 +    tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5];
  57.229 +    tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4];
  57.230 +    tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4];
  57.231 +    
  57.232 +    /* Even part per LL&M figure 1 --- note that published figure is faulty;
  57.233 +     * rotator "sqrt(2)*c1" should be "sqrt(2)*c6".
  57.234 +     */
  57.235 +    
  57.236 +    tmp10 = tmp0 + tmp3;
  57.237 +    tmp13 = tmp0 - tmp3;
  57.238 +    tmp11 = tmp1 + tmp2;
  57.239 +    tmp12 = tmp1 - tmp2;
  57.240 +    
  57.241 +    dataptr[DCTSIZE*0] = (DCTELEM) DESCALE(tmp10 + tmp11, PASS1_BITS);
  57.242 +    dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(tmp10 - tmp11, PASS1_BITS);
  57.243 +    
  57.244 +    z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100);
  57.245 +    dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865),
  57.246 +					   CONST_BITS+PASS1_BITS);
  57.247 +    dataptr[DCTSIZE*6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065),
  57.248 +					   CONST_BITS+PASS1_BITS);
  57.249 +    
  57.250 +    /* Odd part per figure 8 --- note paper omits factor of sqrt(2).
  57.251 +     * cK represents cos(K*pi/16).
  57.252 +     * i0..i3 in the paper are tmp4..tmp7 here.
  57.253 +     */
  57.254 +    
  57.255 +    z1 = tmp4 + tmp7;
  57.256 +    z2 = tmp5 + tmp6;
  57.257 +    z3 = tmp4 + tmp6;
  57.258 +    z4 = tmp5 + tmp7;
  57.259 +    z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */
  57.260 +    
  57.261 +    tmp4 = MULTIPLY(tmp4, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */
  57.262 +    tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */
  57.263 +    tmp6 = MULTIPLY(tmp6, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */
  57.264 +    tmp7 = MULTIPLY(tmp7, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */
  57.265 +    z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */
  57.266 +    z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */
  57.267 +    z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */
  57.268 +    z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */
  57.269 +    
  57.270 +    z3 += z5;
  57.271 +    z4 += z5;
  57.272 +    
  57.273 +    dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp4 + z1 + z3,
  57.274 +					   CONST_BITS+PASS1_BITS);
  57.275 +    dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp5 + z2 + z4,
  57.276 +					   CONST_BITS+PASS1_BITS);
  57.277 +    dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp6 + z2 + z3,
  57.278 +					   CONST_BITS+PASS1_BITS);
  57.279 +    dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp7 + z1 + z4,
  57.280 +					   CONST_BITS+PASS1_BITS);
  57.281 +    
  57.282 +    dataptr++;			/* advance pointer to next column */
  57.283 +  }
  57.284 +}
  57.285 +
  57.286 +#endif /* DCT_ISLOW_SUPPORTED */
    58.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    58.2 +++ b/libs/libjpeg/jidctflt.c	Sun Nov 01 00:36:56 2015 +0200
    58.3 @@ -0,0 +1,242 @@
    58.4 +/*
    58.5 + * jidctflt.c
    58.6 + *
    58.7 + * Copyright (C) 1994-1998, Thomas G. Lane.
    58.8 + * This file is part of the Independent JPEG Group's software.
    58.9 + * For conditions of distribution and use, see the accompanying README file.
   58.10 + *
   58.11 + * This file contains a floating-point implementation of the
   58.12 + * inverse DCT (Discrete Cosine Transform).  In the IJG code, this routine
   58.13 + * must also perform dequantization of the input coefficients.
   58.14 + *
   58.15 + * This implementation should be more accurate than either of the integer
   58.16 + * IDCT implementations.  However, it may not give the same results on all
   58.17 + * machines because of differences in roundoff behavior.  Speed will depend
   58.18 + * on the hardware's floating point capacity.
   58.19 + *
   58.20 + * A 2-D IDCT can be done by 1-D IDCT on each column followed by 1-D IDCT
   58.21 + * on each row (or vice versa, but it's more convenient to emit a row at
   58.22 + * a time).  Direct algorithms are also available, but they are much more
   58.23 + * complex and seem not to be any faster when reduced to code.
   58.24 + *
   58.25 + * This implementation is based on Arai, Agui, and Nakajima's algorithm for
   58.26 + * scaled DCT.  Their original paper (Trans. IEICE E-71(11):1095) is in
   58.27 + * Japanese, but the algorithm is described in the Pennebaker & Mitchell
   58.28 + * JPEG textbook (see REFERENCES section in file README).  The following code
   58.29 + * is based directly on figure 4-8 in P&M.
   58.30 + * While an 8-point DCT cannot be done in less than 11 multiplies, it is
   58.31 + * possible to arrange the computation so that many of the multiplies are
   58.32 + * simple scalings of the final outputs.  These multiplies can then be
   58.33 + * folded into the multiplications or divisions by the JPEG quantization
   58.34 + * table entries.  The AA&N method leaves only 5 multiplies and 29 adds
   58.35 + * to be done in the DCT itself.
   58.36 + * The primary disadvantage of this method is that with a fixed-point
   58.37 + * implementation, accuracy is lost due to imprecise representation of the
   58.38 + * scaled quantization values.  However, that problem does not arise if
   58.39 + * we use floating point arithmetic.
   58.40 + */
   58.41 +
   58.42 +#define JPEG_INTERNALS
   58.43 +#include "jinclude.h"
   58.44 +#include "jpeglib.h"
   58.45 +#include "jdct.h"		/* Private declarations for DCT subsystem */
   58.46 +
   58.47 +#ifdef DCT_FLOAT_SUPPORTED
   58.48 +
   58.49 +
   58.50 +/*
   58.51 + * This module is specialized to the case DCTSIZE = 8.
   58.52 + */
   58.53 +
   58.54 +#if DCTSIZE != 8
   58.55 +  Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
   58.56 +#endif
   58.57 +
   58.58 +
   58.59 +/* Dequantize a coefficient by multiplying it by the multiplier-table
   58.60 + * entry; produce a float result.
   58.61 + */
   58.62 +
   58.63 +#define DEQUANTIZE(coef,quantval)  (((FAST_FLOAT) (coef)) * (quantval))
   58.64 +
   58.65 +
   58.66 +/*
   58.67 + * Perform dequantization and inverse DCT on one block of coefficients.
   58.68 + */
   58.69 +
   58.70 +GLOBAL(void)
   58.71 +jpeg_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr,
   58.72 +		 JCOEFPTR coef_block,
   58.73 +		 JSAMPARRAY output_buf, JDIMENSION output_col)
   58.74 +{
   58.75 +  FAST_FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
   58.76 +  FAST_FLOAT tmp10, tmp11, tmp12, tmp13;
   58.77 +  FAST_FLOAT z5, z10, z11, z12, z13;
   58.78 +  JCOEFPTR inptr;
   58.79 +  FLOAT_MULT_TYPE * quantptr;
   58.80 +  FAST_FLOAT * wsptr;
   58.81 +  JSAMPROW outptr;
   58.82 +  JSAMPLE *range_limit = IDCT_range_limit(cinfo);
   58.83 +  int ctr;
   58.84 +  FAST_FLOAT workspace[DCTSIZE2]; /* buffers data between passes */
   58.85 +  SHIFT_TEMPS
   58.86 +
   58.87 +  /* Pass 1: process columns from input, store into work array. */
   58.88 +
   58.89 +  inptr = coef_block;
   58.90 +  quantptr = (FLOAT_MULT_TYPE *) compptr->dct_table;
   58.91 +  wsptr = workspace;
   58.92 +  for (ctr = DCTSIZE; ctr > 0; ctr--) {
   58.93 +    /* Due to quantization, we will usually find that many of the input
   58.94 +     * coefficients are zero, especially the AC terms.  We can exploit this
   58.95 +     * by short-circuiting the IDCT calculation for any column in which all
   58.96 +     * the AC terms are zero.  In that case each output is equal to the
   58.97 +     * DC coefficient (with scale factor as needed).
   58.98 +     * With typical images and quantization tables, half or more of the
   58.99 +     * column DCT calculations can be simplified this way.
  58.100 +     */
  58.101 +    
  58.102 +    if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 &&
  58.103 +	inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 &&
  58.104 +	inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 &&
  58.105 +	inptr[DCTSIZE*7] == 0) {
  58.106 +      /* AC terms all zero */
  58.107 +      FAST_FLOAT dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
  58.108 +      
  58.109 +      wsptr[DCTSIZE*0] = dcval;
  58.110 +      wsptr[DCTSIZE*1] = dcval;
  58.111 +      wsptr[DCTSIZE*2] = dcval;
  58.112 +      wsptr[DCTSIZE*3] = dcval;
  58.113 +      wsptr[DCTSIZE*4] = dcval;
  58.114 +      wsptr[DCTSIZE*5] = dcval;
  58.115 +      wsptr[DCTSIZE*6] = dcval;
  58.116 +      wsptr[DCTSIZE*7] = dcval;
  58.117 +      
  58.118 +      inptr++;			/* advance pointers to next column */
  58.119 +      quantptr++;
  58.120 +      wsptr++;
  58.121 +      continue;
  58.122 +    }
  58.123 +    
  58.124 +    /* Even part */
  58.125 +
  58.126 +    tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
  58.127 +    tmp1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
  58.128 +    tmp2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
  58.129 +    tmp3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
  58.130 +
  58.131 +    tmp10 = tmp0 + tmp2;	/* phase 3 */
  58.132 +    tmp11 = tmp0 - tmp2;
  58.133 +
  58.134 +    tmp13 = tmp1 + tmp3;	/* phases 5-3 */
  58.135 +    tmp12 = (tmp1 - tmp3) * ((FAST_FLOAT) 1.414213562) - tmp13; /* 2*c4 */
  58.136 +
  58.137 +    tmp0 = tmp10 + tmp13;	/* phase 2 */
  58.138 +    tmp3 = tmp10 - tmp13;
  58.139 +    tmp1 = tmp11 + tmp12;
  58.140 +    tmp2 = tmp11 - tmp12;
  58.141 +    
  58.142 +    /* Odd part */
  58.143 +
  58.144 +    tmp4 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
  58.145 +    tmp5 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);
  58.146 +    tmp6 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);
  58.147 +    tmp7 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);
  58.148 +
  58.149 +    z13 = tmp6 + tmp5;		/* phase 6 */
  58.150 +    z10 = tmp6 - tmp5;
  58.151 +    z11 = tmp4 + tmp7;
  58.152 +    z12 = tmp4 - tmp7;
  58.153 +
  58.154 +    tmp7 = z11 + z13;		/* phase 5 */
  58.155 +    tmp11 = (z11 - z13) * ((FAST_FLOAT) 1.414213562); /* 2*c4 */
  58.156 +
  58.157 +    z5 = (z10 + z12) * ((FAST_FLOAT) 1.847759065); /* 2*c2 */
  58.158 +    tmp10 = ((FAST_FLOAT) 1.082392200) * z12 - z5; /* 2*(c2-c6) */
  58.159 +    tmp12 = ((FAST_FLOAT) -2.613125930) * z10 + z5; /* -2*(c2+c6) */
  58.160 +
  58.161 +    tmp6 = tmp12 - tmp7;	/* phase 2 */
  58.162 +    tmp5 = tmp11 - tmp6;
  58.163 +    tmp4 = tmp10 + tmp5;
  58.164 +
  58.165 +    wsptr[DCTSIZE*0] = tmp0 + tmp7;
  58.166 +    wsptr[DCTSIZE*7] = tmp0 - tmp7;
  58.167 +    wsptr[DCTSIZE*1] = tmp1 + tmp6;
  58.168 +    wsptr[DCTSIZE*6] = tmp1 - tmp6;
  58.169 +    wsptr[DCTSIZE*2] = tmp2 + tmp5;
  58.170 +    wsptr[DCTSIZE*5] = tmp2 - tmp5;
  58.171 +    wsptr[DCTSIZE*4] = tmp3 + tmp4;
  58.172 +    wsptr[DCTSIZE*3] = tmp3 - tmp4;
  58.173 +
  58.174 +    inptr++;			/* advance pointers to next column */
  58.175 +    quantptr++;
  58.176 +    wsptr++;
  58.177 +  }
  58.178 +  
  58.179 +  /* Pass 2: process rows from work array, store into output array. */
  58.180 +  /* Note that we must descale the results by a factor of 8 == 2**3. */
  58.181 +
  58.182 +  wsptr = workspace;
  58.183 +  for (ctr = 0; ctr < DCTSIZE; ctr++) {
  58.184 +    outptr = output_buf[ctr] + output_col;
  58.185 +    /* Rows of zeroes can be exploited in the same way as we did with columns.
  58.186 +     * However, the column calculation has created many nonzero AC terms, so
  58.187 +     * the simplification applies less often (typically 5% to 10% of the time).
  58.188 +     * And testing floats for zero is relatively expensive, so we don't bother.
  58.189 +     */
  58.190 +    
  58.191 +    /* Even part */
  58.192 +
  58.193 +    tmp10 = wsptr[0] + wsptr[4];
  58.194 +    tmp11 = wsptr[0] - wsptr[4];
  58.195 +
  58.196 +    tmp13 = wsptr[2] + wsptr[6];
  58.197 +    tmp12 = (wsptr[2] - wsptr[6]) * ((FAST_FLOAT) 1.414213562) - tmp13;
  58.198 +
  58.199 +    tmp0 = tmp10 + tmp13;
  58.200 +    tmp3 = tmp10 - tmp13;
  58.201 +    tmp1 = tmp11 + tmp12;
  58.202 +    tmp2 = tmp11 - tmp12;
  58.203 +
  58.204 +    /* Odd part */
  58.205 +
  58.206 +    z13 = wsptr[5] + wsptr[3];
  58.207 +    z10 = wsptr[5] - wsptr[3];
  58.208 +    z11 = wsptr[1] + wsptr[7];
  58.209 +    z12 = wsptr[1] - wsptr[7];
  58.210 +
  58.211 +    tmp7 = z11 + z13;
  58.212 +    tmp11 = (z11 - z13) * ((FAST_FLOAT) 1.414213562);
  58.213 +
  58.214 +    z5 = (z10 + z12) * ((FAST_FLOAT) 1.847759065); /* 2*c2 */
  58.215 +    tmp10 = ((FAST_FLOAT) 1.082392200) * z12 - z5; /* 2*(c2-c6) */
  58.216 +    tmp12 = ((FAST_FLOAT) -2.613125930) * z10 + z5; /* -2*(c2+c6) */
  58.217 +
  58.218 +    tmp6 = tmp12 - tmp7;
  58.219 +    tmp5 = tmp11 - tmp6;
  58.220 +    tmp4 = tmp10 + tmp5;
  58.221 +
  58.222 +    /* Final output stage: scale down by a factor of 8 and range-limit */
  58.223 +
  58.224 +    outptr[0] = range_limit[(int) DESCALE((INT32) (tmp0 + tmp7), 3)
  58.225 +			    & RANGE_MASK];
  58.226 +    outptr[7] = range_limit[(int) DESCALE((INT32) (tmp0 - tmp7), 3)
  58.227 +			    & RANGE_MASK];
  58.228 +    outptr[1] = range_limit[(int) DESCALE((INT32) (tmp1 + tmp6), 3)
  58.229 +			    & RANGE_MASK];
  58.230 +    outptr[6] = range_limit[(int) DESCALE((INT32) (tmp1 - tmp6), 3)
  58.231 +			    & RANGE_MASK];
  58.232 +    outptr[2] = range_limit[(int) DESCALE((INT32) (tmp2 + tmp5), 3)
  58.233 +			    & RANGE_MASK];
  58.234 +    outptr[5] = range_limit[(int) DESCALE((INT32) (tmp2 - tmp5), 3)
  58.235 +			    & RANGE_MASK];
  58.236 +    outptr[4] = range_limit[(int) DESCALE((INT32) (tmp3 + tmp4), 3)
  58.237 +			    & RANGE_MASK];
  58.238 +    outptr[3] = range_limit[(int) DESCALE((INT32) (tmp3 - tmp4), 3)
  58.239 +			    & RANGE_MASK];
  58.240 +    
  58.241 +    wsptr += DCTSIZE;		/* advance pointer to next row */
  58.242 +  }
  58.243 +}
  58.244 +
  58.245 +#endif /* DCT_FLOAT_SUPPORTED */
    59.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    59.2 +++ b/libs/libjpeg/jidctfst.c	Sun Nov 01 00:36:56 2015 +0200
    59.3 @@ -0,0 +1,368 @@
    59.4 +/*
    59.5 + * jidctfst.c
    59.6 + *
    59.7 + * Copyright (C) 1994-1998, Thomas G. Lane.
    59.8 + * This file is part of the Independent JPEG Group's software.
    59.9 + * For conditions of distribution and use, see the accompanying README file.
   59.10 + *
   59.11 + * This file contains a fast, not so accurate integer implementation of the
   59.12 + * inverse DCT (Discrete Cosine Transform).  In the IJG code, this routine
   59.13 + * must also perform dequantization of the input coefficients.
   59.14 + *
   59.15 + * A 2-D IDCT can be done by 1-D IDCT on each column followed by 1-D IDCT
   59.16 + * on each row (or vice versa, but it's more convenient to emit a row at
   59.17 + * a time).  Direct algorithms are also available, but they are much more
   59.18 + * complex and seem not to be any faster when reduced to code.
   59.19 + *
   59.20 + * This implementation is based on Arai, Agui, and Nakajima's algorithm for
   59.21 + * scaled DCT.  Their original paper (Trans. IEICE E-71(11):1095) is in
   59.22 + * Japanese, but the algorithm is described in the Pennebaker & Mitchell
   59.23 + * JPEG textbook (see REFERENCES section in file README).  The following code
   59.24 + * is based directly on figure 4-8 in P&M.
   59.25 + * While an 8-point DCT cannot be done in less than 11 multiplies, it is
   59.26 + * possible to arrange the computation so that many of the multiplies are
   59.27 + * simple scalings of the final outputs.  These multiplies can then be
   59.28 + * folded into the multiplications or divisions by the JPEG quantization
   59.29 + * table entries.  The AA&N method leaves only 5 multiplies and 29 adds
   59.30 + * to be done in the DCT itself.
   59.31 + * The primary disadvantage of this method is that with fixed-point math,
   59.32 + * accuracy is lost due to imprecise representation of the scaled
   59.33 + * quantization values.  The smaller the quantization table entry, the less
   59.34 + * precise the scaled value, so this implementation does worse with high-
   59.35 + * quality-setting files than with low-quality ones.
   59.36 + */
   59.37 +
   59.38 +#define JPEG_INTERNALS
   59.39 +#include "jinclude.h"
   59.40 +#include "jpeglib.h"
   59.41 +#include "jdct.h"		/* Private declarations for DCT subsystem */
   59.42 +
   59.43 +#ifdef DCT_IFAST_SUPPORTED
   59.44 +
   59.45 +
   59.46 +/*
   59.47 + * This module is specialized to the case DCTSIZE = 8.
   59.48 + */
   59.49 +
   59.50 +#if DCTSIZE != 8
   59.51 +  Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
   59.52 +#endif
   59.53 +
   59.54 +
   59.55 +/* Scaling decisions are generally the same as in the LL&M algorithm;
   59.56 + * see jidctint.c for more details.  However, we choose to descale
   59.57 + * (right shift) multiplication products as soon as they are formed,
   59.58 + * rather than carrying additional fractional bits into subsequent additions.
   59.59 + * This compromises accuracy slightly, but it lets us save a few shifts.
   59.60 + * More importantly, 16-bit arithmetic is then adequate (for 8-bit samples)
   59.61 + * everywhere except in the multiplications proper; this saves a good deal
   59.62 + * of work on 16-bit-int machines.
   59.63 + *
   59.64 + * The dequantized coefficients are not integers because the AA&N scaling
   59.65 + * factors have been incorporated.  We represent them scaled up by PASS1_BITS,
   59.66 + * so that the first and second IDCT rounds have the same input scaling.
   59.67 + * For 8-bit JSAMPLEs, we choose IFAST_SCALE_BITS = PASS1_BITS so as to
   59.68 + * avoid a descaling shift; this compromises accuracy rather drastically
   59.69 + * for small quantization table entries, but it saves a lot of shifts.
   59.70 + * For 12-bit JSAMPLEs, there's no hope of using 16x16 multiplies anyway,
   59.71 + * so we use a much larger scaling factor to preserve accuracy.
   59.72 + *
   59.73 + * A final compromise is to represent the multiplicative constants to only
   59.74 + * 8 fractional bits, rather than 13.  This saves some shifting work on some
   59.75 + * machines, and may also reduce the cost of multiplication (since there
   59.76 + * are fewer one-bits in the constants).
   59.77 + */
   59.78 +
   59.79 +#if BITS_IN_JSAMPLE == 8
   59.80 +#define CONST_BITS  8
   59.81 +#define PASS1_BITS  2
   59.82 +#else
   59.83 +#define CONST_BITS  8
   59.84 +#define PASS1_BITS  1		/* lose a little precision to avoid overflow */
   59.85 +#endif
   59.86 +
   59.87 +/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus
   59.88 + * causing a lot of useless floating-point operations at run time.
   59.89 + * To get around this we use the following pre-calculated constants.
   59.90 + * If you change CONST_BITS you may want to add appropriate values.
   59.91 + * (With a reasonable C compiler, you can just rely on the FIX() macro...)
   59.92 + */
   59.93 +
   59.94 +#if CONST_BITS == 8
   59.95 +#define FIX_1_082392200  ((INT32)  277)		/* FIX(1.082392200) */
   59.96 +#define FIX_1_414213562  ((INT32)  362)		/* FIX(1.414213562) */
   59.97 +#define FIX_1_847759065  ((INT32)  473)		/* FIX(1.847759065) */
   59.98 +#define FIX_2_613125930  ((INT32)  669)		/* FIX(2.613125930) */
   59.99 +#else
  59.100 +#define FIX_1_082392200  FIX(1.082392200)
  59.101 +#define FIX_1_414213562  FIX(1.414213562)
  59.102 +#define FIX_1_847759065  FIX(1.847759065)
  59.103 +#define FIX_2_613125930  FIX(2.613125930)
  59.104 +#endif
  59.105 +
  59.106 +
  59.107 +/* We can gain a little more speed, with a further compromise in accuracy,
  59.108 + * by omitting the addition in a descaling shift.  This yields an incorrectly
  59.109 + * rounded result half the time...
  59.110 + */
  59.111 +
  59.112 +#ifndef USE_ACCURATE_ROUNDING
  59.113 +#undef DESCALE
  59.114 +#define DESCALE(x,n)  RIGHT_SHIFT(x, n)
  59.115 +#endif
  59.116 +
  59.117 +
  59.118 +/* Multiply a DCTELEM variable by an INT32 constant, and immediately
  59.119 + * descale to yield a DCTELEM result.
  59.120 + */
  59.121 +
  59.122 +#define MULTIPLY(var,const)  ((DCTELEM) DESCALE((var) * (const), CONST_BITS))
  59.123 +
  59.124 +
  59.125 +/* Dequantize a coefficient by multiplying it by the multiplier-table
  59.126 + * entry; produce a DCTELEM result.  For 8-bit data a 16x16->16
  59.127 + * multiplication will do.  For 12-bit data, the multiplier table is
  59.128 + * declared INT32, so a 32-bit multiply will be used.
  59.129 + */
  59.130 +
  59.131 +#if BITS_IN_JSAMPLE == 8
  59.132 +#define DEQUANTIZE(coef,quantval)  (((IFAST_MULT_TYPE) (coef)) * (quantval))
  59.133 +#else
  59.134 +#define DEQUANTIZE(coef,quantval)  \
  59.135 +	DESCALE((coef)*(quantval), IFAST_SCALE_BITS-PASS1_BITS)
  59.136 +#endif
  59.137 +
  59.138 +
  59.139 +/* Like DESCALE, but applies to a DCTELEM and produces an int.
  59.140 + * We assume that int right shift is unsigned if INT32 right shift is.
  59.141 + */
  59.142 +
  59.143 +#ifdef RIGHT_SHIFT_IS_UNSIGNED
  59.144 +#define ISHIFT_TEMPS	DCTELEM ishift_temp;
  59.145 +#if BITS_IN_JSAMPLE == 8
  59.146 +#define DCTELEMBITS  16		/* DCTELEM may be 16 or 32 bits */
  59.147 +#else
  59.148 +#define DCTELEMBITS  32		/* DCTELEM must be 32 bits */
  59.149 +#endif
  59.150 +#define IRIGHT_SHIFT(x,shft)  \
  59.151 +    ((ishift_temp = (x)) < 0 ? \
  59.152 +     (ishift_temp >> (shft)) | ((~((DCTELEM) 0)) << (DCTELEMBITS-(shft))) : \
  59.153 +     (ishift_temp >> (shft)))
  59.154 +#else
  59.155 +#define ISHIFT_TEMPS
  59.156 +#define IRIGHT_SHIFT(x,shft)	((x) >> (shft))
  59.157 +#endif
  59.158 +
  59.159 +#ifdef USE_ACCURATE_ROUNDING
  59.160 +#define IDESCALE(x,n)  ((int) IRIGHT_SHIFT((x) + (1 << ((n)-1)), n))
  59.161 +#else
  59.162 +#define IDESCALE(x,n)  ((int) IRIGHT_SHIFT(x, n))
  59.163 +#endif
  59.164 +
  59.165 +
  59.166 +/*
  59.167 + * Perform dequantization and inverse DCT on one block of coefficients.
  59.168 + */
  59.169 +
  59.170 +GLOBAL(void)
  59.171 +jpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr,
  59.172 +		 JCOEFPTR coef_block,
  59.173 +		 JSAMPARRAY output_buf, JDIMENSION output_col)
  59.174 +{
  59.175 +  DCTELEM tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
  59.176 +  DCTELEM tmp10, tmp11, tmp12, tmp13;
  59.177 +  DCTELEM z5, z10, z11, z12, z13;
  59.178 +  JCOEFPTR inptr;
  59.179 +  IFAST_MULT_TYPE * quantptr;
  59.180 +  int * wsptr;
  59.181 +  JSAMPROW outptr;
  59.182 +  JSAMPLE *range_limit = IDCT_range_limit(cinfo);
  59.183 +  int ctr;
  59.184 +  int workspace[DCTSIZE2];	/* buffers data between passes */
  59.185 +  SHIFT_TEMPS			/* for DESCALE */
  59.186 +  ISHIFT_TEMPS			/* for IDESCALE */
  59.187 +
  59.188 +  /* Pass 1: process columns from input, store into work array. */
  59.189 +
  59.190 +  inptr = coef_block;
  59.191 +  quantptr = (IFAST_MULT_TYPE *) compptr->dct_table;
  59.192 +  wsptr = workspace;
  59.193 +  for (ctr = DCTSIZE; ctr > 0; ctr--) {
  59.194 +    /* Due to quantization, we will usually find that many of the input
  59.195 +     * coefficients are zero, especially the AC terms.  We can exploit this
  59.196 +     * by short-circuiting the IDCT calculation for any column in which all
  59.197 +     * the AC terms are zero.  In that case each output is equal to the
  59.198 +     * DC coefficient (with scale factor as needed).
  59.199 +     * With typical images and quantization tables, half or more of the
  59.200 +     * column DCT calculations can be simplified this way.
  59.201 +     */
  59.202 +    
  59.203 +    if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 &&
  59.204 +	inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 &&
  59.205 +	inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 &&
  59.206 +	inptr[DCTSIZE*7] == 0) {
  59.207 +      /* AC terms all zero */
  59.208 +      int dcval = (int) DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
  59.209 +
  59.210 +      wsptr[DCTSIZE*0] = dcval;
  59.211 +      wsptr[DCTSIZE*1] = dcval;
  59.212 +      wsptr[DCTSIZE*2] = dcval;
  59.213 +      wsptr[DCTSIZE*3] = dcval;
  59.214 +      wsptr[DCTSIZE*4] = dcval;
  59.215 +      wsptr[DCTSIZE*5] = dcval;
  59.216 +      wsptr[DCTSIZE*6] = dcval;
  59.217 +      wsptr[DCTSIZE*7] = dcval;
  59.218 +      
  59.219 +      inptr++;			/* advance pointers to next column */
  59.220 +      quantptr++;
  59.221 +      wsptr++;
  59.222 +      continue;
  59.223 +    }
  59.224 +    
  59.225 +    /* Even part */
  59.226 +
  59.227 +    tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
  59.228 +    tmp1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
  59.229 +    tmp2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
  59.230 +    tmp3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
  59.231 +
  59.232 +    tmp10 = tmp0 + tmp2;	/* phase 3 */
  59.233 +    tmp11 = tmp0 - tmp2;
  59.234 +
  59.235 +    tmp13 = tmp1 + tmp3;	/* phases 5-3 */
  59.236 +    tmp12 = MULTIPLY(tmp1 - tmp3, FIX_1_414213562) - tmp13; /* 2*c4 */
  59.237 +
  59.238 +    tmp0 = tmp10 + tmp13;	/* phase 2 */
  59.239 +    tmp3 = tmp10 - tmp13;
  59.240 +    tmp1 = tmp11 + tmp12;
  59.241 +    tmp2 = tmp11 - tmp12;
  59.242 +    
  59.243 +    /* Odd part */
  59.244 +
  59.245 +    tmp4 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
  59.246 +    tmp5 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);
  59.247 +    tmp6 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);
  59.248 +    tmp7 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);
  59.249 +
  59.250 +    z13 = tmp6 + tmp5;		/* phase 6 */
  59.251 +    z10 = tmp6 - tmp5;
  59.252 +    z11 = tmp4 + tmp7;
  59.253 +    z12 = tmp4 - tmp7;
  59.254 +
  59.255 +    tmp7 = z11 + z13;		/* phase 5 */
  59.256 +    tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); /* 2*c4 */
  59.257 +
  59.258 +    z5 = MULTIPLY(z10 + z12, FIX_1_847759065); /* 2*c2 */
  59.259 +    tmp10 = MULTIPLY(z12, FIX_1_082392200) - z5; /* 2*(c2-c6) */
  59.260 +    tmp12 = MULTIPLY(z10, - FIX_2_613125930) + z5; /* -2*(c2+c6) */
  59.261 +
  59.262 +    tmp6 = tmp12 - tmp7;	/* phase 2 */
  59.263 +    tmp5 = tmp11 - tmp6;
  59.264 +    tmp4 = tmp10 + tmp5;
  59.265 +
  59.266 +    wsptr[DCTSIZE*0] = (int) (tmp0 + tmp7);
  59.267 +    wsptr[DCTSIZE*7] = (int) (tmp0 - tmp7);
  59.268 +    wsptr[DCTSIZE*1] = (int) (tmp1 + tmp6);
  59.269 +    wsptr[DCTSIZE*6] = (int) (tmp1 - tmp6);
  59.270 +    wsptr[DCTSIZE*2] = (int) (tmp2 + tmp5);
  59.271 +    wsptr[DCTSIZE*5] = (int) (tmp2 - tmp5);
  59.272 +    wsptr[DCTSIZE*4] = (int) (tmp3 + tmp4);
  59.273 +    wsptr[DCTSIZE*3] = (int) (tmp3 - tmp4);
  59.274 +
  59.275 +    inptr++;			/* advance pointers to next column */
  59.276 +    quantptr++;
  59.277 +    wsptr++;
  59.278 +  }
  59.279 +  
  59.280 +  /* Pass 2: process rows from work array, store into output array. */
  59.281 +  /* Note that we must descale the results by a factor of 8 == 2**3, */
  59.282 +  /* and also undo the PASS1_BITS scaling. */
  59.283 +
  59.284 +  wsptr = workspace;
  59.285 +  for (ctr = 0; ctr < DCTSIZE; ctr++) {
  59.286 +    outptr = output_buf[ctr] + output_col;
  59.287 +    /* Rows of zeroes can be exploited in the same way as we did with columns.
  59.288 +     * However, the column calculation has created many nonzero AC terms, so
  59.289 +     * the simplification applies less often (typically 5% to 10% of the time).
  59.290 +     * On machines with very fast multiplication, it's possible that the
  59.291 +     * test takes more time than it's worth.  In that case this section
  59.292 +     * may be commented out.
  59.293 +     */
  59.294 +    
  59.295 +#ifndef NO_ZERO_ROW_TEST
  59.296 +    if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && wsptr[4] == 0 &&
  59.297 +	wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) {
  59.298 +      /* AC terms all zero */
  59.299 +      JSAMPLE dcval = range_limit[IDESCALE(wsptr[0], PASS1_BITS+3)
  59.300 +				  & RANGE_MASK];
  59.301 +      
  59.302 +      outptr[0] = dcval;
  59.303 +      outptr[1] = dcval;
  59.304 +      outptr[2] = dcval;
  59.305 +      outptr[3] = dcval;
  59.306 +      outptr[4] = dcval;
  59.307 +      outptr[5] = dcval;
  59.308 +      outptr[6] = dcval;
  59.309 +      outptr[7] = dcval;
  59.310 +
  59.311 +      wsptr += DCTSIZE;		/* advance pointer to next row */
  59.312 +      continue;
  59.313 +    }
  59.314 +#endif
  59.315 +    
  59.316 +    /* Even part */
  59.317 +
  59.318 +    tmp10 = ((DCTELEM) wsptr[0] + (DCTELEM) wsptr[4]);
  59.319 +    tmp11 = ((DCTELEM) wsptr[0] - (DCTELEM) wsptr[4]);
  59.320 +
  59.321 +    tmp13 = ((DCTELEM) wsptr[2] + (DCTELEM) wsptr[6]);
  59.322 +    tmp12 = MULTIPLY((DCTELEM) wsptr[2] - (DCTELEM) wsptr[6], FIX_1_414213562)
  59.323 +	    - tmp13;
  59.324 +
  59.325 +    tmp0 = tmp10 + tmp13;
  59.326 +    tmp3 = tmp10 - tmp13;
  59.327 +    tmp1 = tmp11 + tmp12;
  59.328 +    tmp2 = tmp11 - tmp12;
  59.329 +
  59.330 +    /* Odd part */
  59.331 +
  59.332 +    z13 = (DCTELEM) wsptr[5] + (DCTELEM) wsptr[3];
  59.333 +    z10 = (DCTELEM) wsptr[5] - (DCTELEM) wsptr[3];
  59.334 +    z11 = (DCTELEM) wsptr[1] + (DCTELEM) wsptr[7];
  59.335 +    z12 = (DCTELEM) wsptr[1] - (DCTELEM) wsptr[7];
  59.336 +
  59.337 +    tmp7 = z11 + z13;		/* phase 5 */
  59.338 +    tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); /* 2*c4 */
  59.339 +
  59.340 +    z5 = MULTIPLY(z10 + z12, FIX_1_847759065); /* 2*c2 */
  59.341 +    tmp10 = MULTIPLY(z12, FIX_1_082392200) - z5; /* 2*(c2-c6) */
  59.342 +    tmp12 = MULTIPLY(z10, - FIX_2_613125930) + z5; /* -2*(c2+c6) */
  59.343 +
  59.344 +    tmp6 = tmp12 - tmp7;	/* phase 2 */
  59.345 +    tmp5 = tmp11 - tmp6;
  59.346 +    tmp4 = tmp10 + tmp5;
  59.347 +
  59.348 +    /* Final output stage: scale down by a factor of 8 and range-limit */
  59.349 +
  59.350 +    outptr[0] = range_limit[IDESCALE(tmp0 + tmp7, PASS1_BITS+3)
  59.351 +			    & RANGE_MASK];
  59.352 +    outptr[7] = range_limit[IDESCALE(tmp0 - tmp7, PASS1_BITS+3)
  59.353 +			    & RANGE_MASK];
  59.354 +    outptr[1] = range_limit[IDESCALE(tmp1 + tmp6, PASS1_BITS+3)
  59.355 +			    & RANGE_MASK];
  59.356 +    outptr[6] = range_limit[IDESCALE(tmp1 - tmp6, PASS1_BITS+3)
  59.357 +			    & RANGE_MASK];
  59.358 +    outptr[2] = range_limit[IDESCALE(tmp2 + tmp5, PASS1_BITS+3)
  59.359 +			    & RANGE_MASK];
  59.360 +    outptr[5] = range_limit[IDESCALE(tmp2 - tmp5, PASS1_BITS+3)
  59.361 +			    & RANGE_MASK];
  59.362 +    outptr[4] = range_limit[IDESCALE(tmp3 + tmp4, PASS1_BITS+3)
  59.363 +			    & RANGE_MASK];
  59.364 +    outptr[3] = range_limit[IDESCALE(tmp3 - tmp4, PASS1_BITS+3)
  59.365 +			    & RANGE_MASK];
  59.366 +
  59.367 +    wsptr += DCTSIZE;		/* advance pointer to next row */
  59.368 +  }
  59.369 +}
  59.370 +
  59.371 +#endif /* DCT_IFAST_SUPPORTED */
    60.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    60.2 +++ b/libs/libjpeg/jidctint.c	Sun Nov 01 00:36:56 2015 +0200
    60.3 @@ -0,0 +1,389 @@
    60.4 +/*
    60.5 + * jidctint.c
    60.6 + *
    60.7 + * Copyright (C) 1991-1998, Thomas G. Lane.
    60.8 + * This file is part of the Independent JPEG Group's software.
    60.9 + * For conditions of distribution and use, see the accompanying README file.
   60.10 + *
   60.11 + * This file contains a slow-but-accurate integer implementation of the
   60.12 + * inverse DCT (Discrete Cosine Transform).  In the IJG code, this routine
   60.13 + * must also perform dequantization of the input coefficients.
   60.14 + *
   60.15 + * A 2-D IDCT can be done by 1-D IDCT on each column followed by 1-D IDCT
   60.16 + * on each row (or vice versa, but it's more convenient to emit a row at
   60.17 + * a time).  Direct algorithms are also available, but they are much more
   60.18 + * complex and seem not to be any faster when reduced to code.
   60.19 + *
   60.20 + * This implementation is based on an algorithm described in
   60.21 + *   C. Loeffler, A. Ligtenberg and G. Moschytz, "Practical Fast 1-D DCT
   60.22 + *   Algorithms with 11 Multiplications", Proc. Int'l. Conf. on Acoustics,
   60.23 + *   Speech, and Signal Processing 1989 (ICASSP '89), pp. 988-991.
   60.24 + * The primary algorithm described there uses 11 multiplies and 29 adds.
   60.25 + * We use their alternate method with 12 multiplies and 32 adds.
   60.26 + * The advantage of this method is that no data path contains more than one
   60.27 + * multiplication; this allows a very simple and accurate implementation in
   60.28 + * scaled fixed-point arithmetic, with a minimal number of shifts.
   60.29 + */
   60.30 +
   60.31 +#define JPEG_INTERNALS
   60.32 +#include "jinclude.h"
   60.33 +#include "jpeglib.h"
   60.34 +#include "jdct.h"		/* Private declarations for DCT subsystem */
   60.35 +
   60.36 +#ifdef DCT_ISLOW_SUPPORTED
   60.37 +
   60.38 +
   60.39 +/*
   60.40 + * This module is specialized to the case DCTSIZE = 8.
   60.41 + */
   60.42 +
   60.43 +#if DCTSIZE != 8
   60.44 +  Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
   60.45 +#endif
   60.46 +
   60.47 +
   60.48 +/*
   60.49 + * The poop on this scaling stuff is as follows:
   60.50 + *
   60.51 + * Each 1-D IDCT step produces outputs which are a factor of sqrt(N)
   60.52 + * larger than the true IDCT outputs.  The final outputs are therefore
   60.53 + * a factor of N larger than desired; since N=8 this can be cured by
   60.54 + * a simple right shift at the end of the algorithm.  The advantage of
   60.55 + * this arrangement is that we save two multiplications per 1-D IDCT,
   60.56 + * because the y0 and y4 inputs need not be divided by sqrt(N).
   60.57 + *
   60.58 + * We have to do addition and subtraction of the integer inputs, which
   60.59 + * is no problem, and multiplication by fractional constants, which is
   60.60 + * a problem to do in integer arithmetic.  We multiply all the constants
   60.61 + * by CONST_SCALE and convert them to integer constants (thus retaining
   60.62 + * CONST_BITS bits of precision in the constants).  After doing a
   60.63 + * multiplication we have to divide the product by CONST_SCALE, with proper
   60.64 + * rounding, to produce the correct output.  This division can be done
   60.65 + * cheaply as a right shift of CONST_BITS bits.  We postpone shifting
   60.66 + * as long as possible so that partial sums can be added together with
   60.67 + * full fractional precision.
   60.68 + *
   60.69 + * The outputs of the first pass are scaled up by PASS1_BITS bits so that
   60.70 + * they are represented to better-than-integral precision.  These outputs
   60.71 + * require BITS_IN_JSAMPLE + PASS1_BITS + 3 bits; this fits in a 16-bit word
   60.72 + * with the recommended scaling.  (To scale up 12-bit sample data further, an
   60.73 + * intermediate INT32 array would be needed.)
   60.74 + *
   60.75 + * To avoid overflow of the 32-bit intermediate results in pass 2, we must
   60.76 + * have BITS_IN_JSAMPLE + CONST_BITS + PASS1_BITS <= 26.  Error analysis
   60.77 + * shows that the values given below are the most effective.
   60.78 + */
   60.79 +
   60.80 +#if BITS_IN_JSAMPLE == 8
   60.81 +#define CONST_BITS  13
   60.82 +#define PASS1_BITS  2
   60.83 +#else
   60.84 +#define CONST_BITS  13
   60.85 +#define PASS1_BITS  1		/* lose a little precision to avoid overflow */
   60.86 +#endif
   60.87 +
   60.88 +/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus
   60.89 + * causing a lot of useless floating-point operations at run time.
   60.90 + * To get around this we use the following pre-calculated constants.
   60.91 + * If you change CONST_BITS you may want to add appropriate values.
   60.92 + * (With a reasonable C compiler, you can just rely on the FIX() macro...)
   60.93 + */
   60.94 +
   60.95 +#if CONST_BITS == 13
   60.96 +#define FIX_0_298631336  ((INT32)  2446)	/* FIX(0.298631336) */
   60.97 +#define FIX_0_390180644  ((INT32)  3196)	/* FIX(0.390180644) */
   60.98 +#define FIX_0_541196100  ((INT32)  4433)	/* FIX(0.541196100) */
   60.99 +#define FIX_0_765366865  ((INT32)  6270)	/* FIX(0.765366865) */
  60.100 +#define FIX_0_899976223  ((INT32)  7373)	/* FIX(0.899976223) */
  60.101 +#define FIX_1_175875602  ((INT32)  9633)	/* FIX(1.175875602) */
  60.102 +#define FIX_1_501321110  ((INT32)  12299)	/* FIX(1.501321110) */
  60.103 +#define FIX_1_847759065  ((INT32)  15137)	/* FIX(1.847759065) */
  60.104 +#define FIX_1_961570560  ((INT32)  16069)	/* FIX(1.961570560) */
  60.105 +#define FIX_2_053119869  ((INT32)  16819)	/* FIX(2.053119869) */
  60.106 +#define FIX_2_562915447  ((INT32)  20995)	/* FIX(2.562915447) */
  60.107 +#define FIX_3_072711026  ((INT32)  25172)	/* FIX(3.072711026) */
  60.108 +#else
  60.109 +#define FIX_0_298631336  FIX(0.298631336)
  60.110 +#define FIX_0_390180644  FIX(0.390180644)
  60.111 +#define FIX_0_541196100  FIX(0.541196100)
  60.112 +#define FIX_0_765366865  FIX(0.765366865)
  60.113 +#define FIX_0_899976223  FIX(0.899976223)
  60.114 +#define FIX_1_175875602  FIX(1.175875602)
  60.115 +#define FIX_1_501321110  FIX(1.501321110)
  60.116 +#define FIX_1_847759065  FIX(1.847759065)
  60.117 +#define FIX_1_961570560  FIX(1.961570560)
  60.118 +#define FIX_2_053119869  FIX(2.053119869)
  60.119 +#define FIX_2_562915447  FIX(2.562915447)
  60.120 +#define FIX_3_072711026  FIX(3.072711026)
  60.121 +#endif
  60.122 +
  60.123 +
  60.124 +/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result.
  60.125 + * For 8-bit samples with the recommended scaling, all the variable
  60.126 + * and constant values involved are no more than 16 bits wide, so a
  60.127 + * 16x16->32 bit multiply can be used instead of a full 32x32 multiply.
  60.128 + * For 12-bit samples, a full 32-bit multiplication will be needed.
  60.129 + */
  60.130 +
  60.131 +#if BITS_IN_JSAMPLE == 8
  60.132 +#define MULTIPLY(var,const)  MULTIPLY16C16(var,const)
  60.133 +#else
  60.134 +#define MULTIPLY(var,const)  ((var) * (const))
  60.135 +#endif
  60.136 +
  60.137 +
  60.138 +/* Dequantize a coefficient by multiplying it by the multiplier-table
  60.139 + * entry; produce an int result.  In this module, both inputs and result
  60.140 + * are 16 bits or less, so either int or short multiply will work.
  60.141 + */
  60.142 +
  60.143 +#define DEQUANTIZE(coef,quantval)  (((ISLOW_MULT_TYPE) (coef)) * (quantval))
  60.144 +
  60.145 +
  60.146 +/*
  60.147 + * Perform dequantization and inverse DCT on one block of coefficients.
  60.148 + */
  60.149 +
  60.150 +GLOBAL(void)
  60.151 +jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr,
  60.152 +		 JCOEFPTR coef_block,
  60.153 +		 JSAMPARRAY output_buf, JDIMENSION output_col)
  60.154 +{
  60.155 +  INT32 tmp0, tmp1, tmp2, tmp3;
  60.156 +  INT32 tmp10, tmp11, tmp12, tmp13;
  60.157 +  INT32 z1, z2, z3, z4, z5;
  60.158 +  JCOEFPTR inptr;
  60.159 +  ISLOW_MULT_TYPE * quantptr;
  60.160 +  int * wsptr;
  60.161 +  JSAMPROW outptr;
  60.162 +  JSAMPLE *range_limit = IDCT_range_limit(cinfo);
  60.163 +  int ctr;
  60.164 +  int workspace[DCTSIZE2];	/* buffers data between passes */
  60.165 +  SHIFT_TEMPS
  60.166 +
  60.167 +  /* Pass 1: process columns from input, store into work array. */
  60.168 +  /* Note results are scaled up by sqrt(8) compared to a true IDCT; */
  60.169 +  /* furthermore, we scale the results by 2**PASS1_BITS. */
  60.170 +
  60.171 +  inptr = coef_block;
  60.172 +  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
  60.173 +  wsptr = workspace;
  60.174 +  for (ctr = DCTSIZE; ctr > 0; ctr--) {
  60.175 +    /* Due to quantization, we will usually find that many of the input
  60.176 +     * coefficients are zero, especially the AC terms.  We can exploit this
  60.177 +     * by short-circuiting the IDCT calculation for any column in which all
  60.178 +     * the AC terms are zero.  In that case each output is equal to the
  60.179 +     * DC coefficient (with scale factor as needed).
  60.180 +     * With typical images and quantization tables, half or more of the
  60.181 +     * column DCT calculations can be simplified this way.
  60.182 +     */
  60.183 +    
  60.184 +    if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 &&
  60.185 +	inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 &&
  60.186 +	inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 &&
  60.187 +	inptr[DCTSIZE*7] == 0) {
  60.188 +      /* AC terms all zero */
  60.189 +      int dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) << PASS1_BITS;
  60.190 +      
  60.191 +      wsptr[DCTSIZE*0] = dcval;
  60.192 +      wsptr[DCTSIZE*1] = dcval;
  60.193 +      wsptr[DCTSIZE*2] = dcval;
  60.194 +      wsptr[DCTSIZE*3] = dcval;
  60.195 +      wsptr[DCTSIZE*4] = dcval;
  60.196 +      wsptr[DCTSIZE*5] = dcval;
  60.197 +      wsptr[DCTSIZE*6] = dcval;
  60.198 +      wsptr[DCTSIZE*7] = dcval;
  60.199 +      
  60.200 +      inptr++;			/* advance pointers to next column */
  60.201 +      quantptr++;
  60.202 +      wsptr++;
  60.203 +      continue;
  60.204 +    }
  60.205 +    
  60.206 +    /* Even part: reverse the even part of the forward DCT. */
  60.207 +    /* The rotator is sqrt(2)*c(-6). */
  60.208 +    
  60.209 +    z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
  60.210 +    z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
  60.211 +    
  60.212 +    z1 = MULTIPLY(z2 + z3, FIX_0_541196100);
  60.213 +    tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065);
  60.214 +    tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865);
  60.215 +    
  60.216 +    z2 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
  60.217 +    z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
  60.218 +
  60.219 +    tmp0 = (z2 + z3) << CONST_BITS;
  60.220 +    tmp1 = (z2 - z3) << CONST_BITS;
  60.221 +    
  60.222 +    tmp10 = tmp0 + tmp3;
  60.223 +    tmp13 = tmp0 - tmp3;
  60.224 +    tmp11 = tmp1 + tmp2;
  60.225 +    tmp12 = tmp1 - tmp2;
  60.226 +    
  60.227 +    /* Odd part per figure 8; the matrix is unitary and hence its
  60.228 +     * transpose is its inverse.  i0..i3 are y7,y5,y3,y1 respectively.
  60.229 +     */
  60.230 +    
  60.231 +    tmp0 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);
  60.232 +    tmp1 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);
  60.233 +    tmp2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);
  60.234 +    tmp3 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
  60.235 +    
  60.236 +    z1 = tmp0 + tmp3;
  60.237 +    z2 = tmp1 + tmp2;
  60.238 +    z3 = tmp0 + tmp2;
  60.239 +    z4 = tmp1 + tmp3;
  60.240 +    z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */
  60.241 +    
  60.242 +    tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */
  60.243 +    tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */
  60.244 +    tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */
  60.245 +    tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */
  60.246 +    z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */
  60.247 +    z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */
  60.248 +    z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */
  60.249 +    z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */
  60.250 +    
  60.251 +    z3 += z5;
  60.252 +    z4 += z5;
  60.253 +    
  60.254 +    tmp0 += z1 + z3;
  60.255 +    tmp1 += z2 + z4;
  60.256 +    tmp2 += z2 + z3;
  60.257 +    tmp3 += z1 + z4;
  60.258 +    
  60.259 +    /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */
  60.260 +    
  60.261 +    wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS);
  60.262 +    wsptr[DCTSIZE*7] = (int) DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS);
  60.263 +    wsptr[DCTSIZE*1] = (int) DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS);
  60.264 +    wsptr[DCTSIZE*6] = (int) DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS);
  60.265 +    wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS);
  60.266 +    wsptr[DCTSIZE*5] = (int) DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS);
  60.267 +    wsptr[DCTSIZE*3] = (int) DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS);
  60.268 +    wsptr[DCTSIZE*4] = (int) DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS);
  60.269 +    
  60.270 +    inptr++;			/* advance pointers to next column */
  60.271 +    quantptr++;
  60.272 +    wsptr++;
  60.273 +  }
  60.274 +  
  60.275 +  /* Pass 2: process rows from work array, store into output array. */
  60.276 +  /* Note that we must descale the results by a factor of 8 == 2**3, */
  60.277 +  /* and also undo the PASS1_BITS scaling. */
  60.278 +
  60.279 +  wsptr = workspace;
  60.280 +  for (ctr = 0; ctr < DCTSIZE; ctr++) {
  60.281 +    outptr = output_buf[ctr] + output_col;
  60.282 +    /* Rows of zeroes can be exploited in the same way as we did with columns.
  60.283 +     * However, the column calculation has created many nonzero AC terms, so
  60.284 +     * the simplification applies less often (typically 5% to 10% of the time).
  60.285 +     * On machines with very fast multiplication, it's possible that the
  60.286 +     * test takes more time than it's worth.  In that case this section
  60.287 +     * may be commented out.
  60.288 +     */
  60.289 +    
  60.290 +#ifndef NO_ZERO_ROW_TEST
  60.291 +    if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && wsptr[4] == 0 &&
  60.292 +	wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) {
  60.293 +      /* AC terms all zero */
  60.294 +      JSAMPLE dcval = range_limit[(int) DESCALE((INT32) wsptr[0], PASS1_BITS+3)
  60.295 +				  & RANGE_MASK];
  60.296 +      
  60.297 +      outptr[0] = dcval;
  60.298 +      outptr[1] = dcval;
  60.299 +      outptr[2] = dcval;
  60.300 +      outptr[3] = dcval;
  60.301 +      outptr[4] = dcval;
  60.302 +      outptr[5] = dcval;
  60.303 +      outptr[6] = dcval;
  60.304 +      outptr[7] = dcval;
  60.305 +
  60.306 +      wsptr += DCTSIZE;		/* advance pointer to next row */
  60.307 +      continue;
  60.308 +    }
  60.309 +#endif
  60.310 +    
  60.311 +    /* Even part: reverse the even part of the forward DCT. */
  60.312 +    /* The rotator is sqrt(2)*c(-6). */
  60.313 +    
  60.314 +    z2 = (INT32) wsptr[2];
  60.315 +    z3 = (INT32) wsptr[6];
  60.316 +    
  60.317 +    z1 = MULTIPLY(z2 + z3, FIX_0_541196100);
  60.318 +    tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065);
  60.319 +    tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865);
  60.320 +    
  60.321 +    tmp0 = ((INT32) wsptr[0] + (INT32) wsptr[4]) << CONST_BITS;
  60.322 +    tmp1 = ((INT32) wsptr[0] - (INT32) wsptr[4]) << CONST_BITS;
  60.323 +    
  60.324 +    tmp10 = tmp0 + tmp3;
  60.325 +    tmp13 = tmp0 - tmp3;
  60.326 +    tmp11 = tmp1 + tmp2;
  60.327 +    tmp12 = tmp1 - tmp2;
  60.328 +    
  60.329 +    /* Odd part per figure 8; the matrix is unitary and hence its
  60.330 +     * transpose is its inverse.  i0..i3 are y7,y5,y3,y1 respectively.
  60.331 +     */
  60.332 +    
  60.333 +    tmp0 = (INT32) wsptr[7];
  60.334 +    tmp1 = (INT32) wsptr[5];
  60.335 +    tmp2 = (INT32) wsptr[3];
  60.336 +    tmp3 = (INT32) wsptr[1];
  60.337 +    
  60.338 +    z1 = tmp0 + tmp3;
  60.339 +    z2 = tmp1 + tmp2;
  60.340 +    z3 = tmp0 + tmp2;
  60.341 +    z4 = tmp1 + tmp3;
  60.342 +    z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */
  60.343 +    
  60.344 +    tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */
  60.345 +    tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */
  60.346 +    tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */
  60.347 +    tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */
  60.348 +    z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */
  60.349 +    z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */
  60.350 +    z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */
  60.351 +    z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */
  60.352 +    
  60.353 +    z3 += z5;
  60.354 +    z4 += z5;
  60.355 +    
  60.356 +    tmp0 += z1 + z3;
  60.357 +    tmp1 += z2 + z4;
  60.358 +    tmp2 += z2 + z3;
  60.359 +    tmp3 += z1 + z4;
  60.360 +    
  60.361 +    /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */
  60.362 +    
  60.363 +    outptr[0] = range_limit[(int) DESCALE(tmp10 + tmp3,
  60.364 +					  CONST_BITS+PASS1_BITS+3)
  60.365 +			    & RANGE_MASK];
  60.366 +    outptr[7] = range_limit[(int) DESCALE(tmp10 - tmp3,
  60.367 +					  CONST_BITS+PASS1_BITS+3)
  60.368 +			    & RANGE_MASK];
  60.369 +    outptr[1] = range_limit[(int) DESCALE(tmp11 + tmp2,
  60.370 +					  CONST_BITS+PASS1_BITS+3)
  60.371 +			    & RANGE_MASK];
  60.372 +    outptr[6] = range_limit[(int) DESCALE(tmp11 - tmp2,
  60.373 +					  CONST_BITS+PASS1_BITS+3)
  60.374 +			    & RANGE_MASK];
  60.375 +    outptr[2] = range_limit[(int) DESCALE(tmp12 + tmp1,
  60.376 +					  CONST_BITS+PASS1_BITS+3)
  60.377 +			    & RANGE_MASK];
  60.378 +    outptr[5] = range_limit[(int) DESCALE(tmp12 - tmp1,
  60.379 +					  CONST_BITS+PASS1_BITS+3)
  60.380 +			    & RANGE_MASK];
  60.381 +    outptr[3] = range_limit[(int) DESCALE(tmp13 + tmp0,
  60.382 +					  CONST_BITS+PASS1_BITS+3)
  60.383 +			    & RANGE_MASK];
  60.384 +    outptr[4] = range_limit[(int) DESCALE(tmp13 - tmp0,
  60.385 +					  CONST_BITS+PASS1_BITS+3)
  60.386 +			    & RANGE_MASK];
  60.387 +    
  60.388 +    wsptr += DCTSIZE;		/* advance pointer to next row */
  60.389 +  }
  60.390 +}
  60.391 +
  60.392 +#endif /* DCT_ISLOW_SUPPORTED */
    61.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    61.2 +++ b/libs/libjpeg/jidctred.c	Sun Nov 01 00:36:56 2015 +0200
    61.3 @@ -0,0 +1,398 @@
    61.4 +/*
    61.5 + * jidctred.c
    61.6 + *
    61.7 + * Copyright (C) 1994-1998, Thomas G. Lane.
    61.8 + * This file is part of the Independent JPEG Group's software.
    61.9 + * For conditions of distribution and use, see the accompanying README file.
   61.10 + *
   61.11 + * This file contains inverse-DCT routines that produce reduced-size output:
   61.12 + * either 4x4, 2x2, or 1x1 pixels from an 8x8 DCT block.
   61.13 + *
   61.14 + * The implementation is based on the Loeffler, Ligtenberg and Moschytz (LL&M)
   61.15 + * algorithm used in jidctint.c.  We simply replace each 8-to-8 1-D IDCT step
   61.16 + * with an 8-to-4 step that produces the four averages of two adjacent outputs
   61.17 + * (or an 8-to-2 step producing two averages of four outputs, for 2x2 output).
   61.18 + * These steps were derived by computing the corresponding values at the end
   61.19 + * of the normal LL&M code, then simplifying as much as possible.
   61.20 + *
   61.21 + * 1x1 is trivial: just take the DC coefficient divided by 8.
   61.22 + *
   61.23 + * See jidctint.c for additional comments.
   61.24 + */
   61.25 +
   61.26 +#define JPEG_INTERNALS
   61.27 +#include "jinclude.h"
   61.28 +#include "jpeglib.h"
   61.29 +#include "jdct.h"		/* Private declarations for DCT subsystem */
   61.30 +
   61.31 +#ifdef IDCT_SCALING_SUPPORTED
   61.32 +
   61.33 +
   61.34 +/*
   61.35 + * This module is specialized to the case DCTSIZE = 8.
   61.36 + */
   61.37 +
   61.38 +#if DCTSIZE != 8
   61.39 +  Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
   61.40 +#endif
   61.41 +
   61.42 +
   61.43 +/* Scaling is the same as in jidctint.c. */
   61.44 +
   61.45 +#if BITS_IN_JSAMPLE == 8
   61.46 +#define CONST_BITS  13
   61.47 +#define PASS1_BITS  2
   61.48 +#else
   61.49 +#define CONST_BITS  13
   61.50 +#define PASS1_BITS  1		/* lose a little precision to avoid overflow */
   61.51 +#endif
   61.52 +
   61.53 +/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus
   61.54 + * causing a lot of useless floating-point operations at run time.
   61.55 + * To get around this we use the following pre-calculated constants.
   61.56 + * If you change CONST_BITS you may want to add appropriate values.
   61.57 + * (With a reasonable C compiler, you can just rely on the FIX() macro...)
   61.58 + */
   61.59 +
   61.60 +#if CONST_BITS == 13
   61.61 +#define FIX_0_211164243  ((INT32)  1730)	/* FIX(0.211164243) */
   61.62 +#define FIX_0_509795579  ((INT32)  4176)	/* FIX(0.509795579) */
   61.63 +#define FIX_0_601344887  ((INT32)  4926)	/* FIX(0.601344887) */
   61.64 +#define FIX_0_720959822  ((INT32)  5906)	/* FIX(0.720959822) */
   61.65 +#define FIX_0_765366865  ((INT32)  6270)	/* FIX(0.765366865) */
   61.66 +#define FIX_0_850430095  ((INT32)  6967)	/* FIX(0.850430095) */
   61.67 +#define FIX_0_899976223  ((INT32)  7373)	/* FIX(0.899976223) */
   61.68 +#define FIX_1_061594337  ((INT32)  8697)	/* FIX(1.061594337) */
   61.69 +#define FIX_1_272758580  ((INT32)  10426)	/* FIX(1.272758580) */
   61.70 +#define FIX_1_451774981  ((INT32)  11893)	/* FIX(1.451774981) */
   61.71 +#define FIX_1_847759065  ((INT32)  15137)	/* FIX(1.847759065) */
   61.72 +#define FIX_2_172734803  ((INT32)  17799)	/* FIX(2.172734803) */
   61.73 +#define FIX_2_562915447  ((INT32)  20995)	/* FIX(2.562915447) */
   61.74 +#define FIX_3_624509785  ((INT32)  29692)	/* FIX(3.624509785) */
   61.75 +#else
   61.76 +#define FIX_0_211164243  FIX(0.211164243)
   61.77 +#define FIX_0_509795579  FIX(0.509795579)
   61.78 +#define FIX_0_601344887  FIX(0.601344887)
   61.79 +#define FIX_0_720959822  FIX(0.720959822)
   61.80 +#define FIX_0_765366865  FIX(0.765366865)
   61.81 +#define FIX_0_850430095  FIX(0.850430095)
   61.82 +#define FIX_0_899976223  FIX(0.899976223)
   61.83 +#define FIX_1_061594337  FIX(1.061594337)
   61.84 +#define FIX_1_272758580  FIX(1.272758580)
   61.85 +#define FIX_1_451774981  FIX(1.451774981)
   61.86 +#define FIX_1_847759065  FIX(1.847759065)
   61.87 +#define FIX_2_172734803  FIX(2.172734803)
   61.88 +#define FIX_2_562915447  FIX(2.562915447)
   61.89 +#define FIX_3_624509785  FIX(3.624509785)
   61.90 +#endif
   61.91 +
   61.92 +
   61.93 +/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result.
   61.94 + * For 8-bit samples with the recommended scaling, all the variable
   61.95 + * and constant values involved are no more than 16 bits wide, so a
   61.96 + * 16x16->32 bit multiply can be used instead of a full 32x32 multiply.
   61.97 + * For 12-bit samples, a full 32-bit multiplication will be needed.
   61.98 + */
   61.99 +
  61.100 +#if BITS_IN_JSAMPLE == 8
  61.101 +#define MULTIPLY(var,const)  MULTIPLY16C16(var,const)
  61.102 +#else
  61.103 +#define MULTIPLY(var,const)  ((var) * (const))
  61.104 +#endif
  61.105 +
  61.106 +
  61.107 +/* Dequantize a coefficient by multiplying it by the multiplier-table
  61.108 + * entry; produce an int result.  In this module, both inputs and result
  61.109 + * are 16 bits or less, so either int or short multiply will work.
  61.110 + */
  61.111 +
  61.112 +#define DEQUANTIZE(coef,quantval)  (((ISLOW_MULT_TYPE) (coef)) * (quantval))
  61.113 +
  61.114 +
  61.115 +/*
  61.116 + * Perform dequantization and inverse DCT on one block of coefficients,
  61.117 + * producing a reduced-size 4x4 output block.
  61.118 + */
  61.119 +
  61.120 +GLOBAL(void)
  61.121 +jpeg_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
  61.122 +	       JCOEFPTR coef_block,
  61.123 +	       JSAMPARRAY output_buf, JDIMENSION output_col)
  61.124 +{
  61.125 +  INT32 tmp0, tmp2, tmp10, tmp12;
  61.126 +  INT32 z1, z2, z3, z4;
  61.127 +  JCOEFPTR inptr;
  61.128 +  ISLOW_MULT_TYPE * quantptr;
  61.129 +  int * wsptr;
  61.130 +  JSAMPROW outptr;
  61.131 +  JSAMPLE *range_limit = IDCT_range_limit(cinfo);
  61.132 +  int ctr;
  61.133 +  int workspace[DCTSIZE*4];	/* buffers data between passes */
  61.134 +  SHIFT_TEMPS
  61.135 +
  61.136 +  /* Pass 1: process columns from input, store into work array. */
  61.137 +
  61.138 +  inptr = coef_block;
  61.139 +  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
  61.140 +  wsptr = workspace;
  61.141 +  for (ctr = DCTSIZE; ctr > 0; inptr++, quantptr++, wsptr++, ctr--) {
  61.142 +    /* Don't bother to process column 4, because second pass won't use it */
  61.143 +    if (ctr == DCTSIZE-4)
  61.144 +      continue;
  61.145 +    if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 &&
  61.146 +	inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*5] == 0 &&
  61.147 +	inptr[DCTSIZE*6] == 0 && inptr[DCTSIZE*7] == 0) {
  61.148 +      /* AC terms all zero; we need not examine term 4 for 4x4 output */
  61.149 +      int dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) << PASS1_BITS;
  61.150 +      
  61.151 +      wsptr[DCTSIZE*0] = dcval;
  61.152 +      wsptr[DCTSIZE*1] = dcval;
  61.153 +      wsptr[DCTSIZE*2] = dcval;
  61.154 +      wsptr[DCTSIZE*3] = dcval;
  61.155 +      
  61.156 +      continue;
  61.157 +    }
  61.158 +    
  61.159 +    /* Even part */
  61.160 +    
  61.161 +    tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
  61.162 +    tmp0 <<= (CONST_BITS+1);
  61.163 +    
  61.164 +    z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
  61.165 +    z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
  61.166 +
  61.167 +    tmp2 = MULTIPLY(z2, FIX_1_847759065) + MULTIPLY(z3, - FIX_0_765366865);
  61.168 +    
  61.169 +    tmp10 = tmp0 + tmp2;
  61.170 +    tmp12 = tmp0 - tmp2;
  61.171 +    
  61.172 +    /* Odd part */
  61.173 +    
  61.174 +    z1 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);
  61.175 +    z2 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);
  61.176 +    z3 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);
  61.177 +    z4 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
  61.178 +    
  61.179 +    tmp0 = MULTIPLY(z1, - FIX_0_211164243) /* sqrt(2) * (c3-c1) */
  61.180 +	 + MULTIPLY(z2, FIX_1_451774981) /* sqrt(2) * (c3+c7) */
  61.181 +	 + MULTIPLY(z3, - FIX_2_172734803) /* sqrt(2) * (-c1-c5) */
  61.182 +	 + MULTIPLY(z4, FIX_1_061594337); /* sqrt(2) * (c5+c7) */
  61.183 +    
  61.184 +    tmp2 = MULTIPLY(z1, - FIX_0_509795579) /* sqrt(2) * (c7-c5) */
  61.185 +	 + MULTIPLY(z2, - FIX_0_601344887) /* sqrt(2) * (c5-c1) */
  61.186 +	 + MULTIPLY(z3, FIX_0_899976223) /* sqrt(2) * (c3-c7) */
  61.187 +	 + MULTIPLY(z4, FIX_2_562915447); /* sqrt(2) * (c1+c3) */
  61.188 +
  61.189 +    /* Final output stage */
  61.190 +    
  61.191 +    wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp2, CONST_BITS-PASS1_BITS+1);
  61.192 +    wsptr[DCTSIZE*3] = (int) DESCALE(tmp10 - tmp2, CONST_BITS-PASS1_BITS+1);
  61.193 +    wsptr[DCTSIZE*1] = (int) DESCALE(tmp12 + tmp0, CONST_BITS-PASS1_BITS+1);
  61.194 +    wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 - tmp0, CONST_BITS-PASS1_BITS+1);
  61.195 +  }
  61.196 +  
  61.197 +  /* Pass 2: process 4 rows from work array, store into output array. */
  61.198 +
  61.199 +  wsptr = workspace;
  61.200 +  for (ctr = 0; ctr < 4; ctr++) {
  61.201 +    outptr = output_buf[ctr] + output_col;
  61.202 +    /* It's not clear whether a zero row test is worthwhile here ... */
  61.203 +
  61.204 +#ifndef NO_ZERO_ROW_TEST
  61.205 +    if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 &&
  61.206 +	wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) {
  61.207 +      /* AC terms all zero */
  61.208 +      JSAMPLE dcval = range_limit[(int) DESCALE((INT32) wsptr[0], PASS1_BITS+3)
  61.209 +				  & RANGE_MASK];
  61.210 +      
  61.211 +      outptr[0] = dcval;
  61.212 +      outptr[1] = dcval;
  61.213 +      outptr[2] = dcval;
  61.214 +      outptr[3] = dcval;
  61.215 +      
  61.216 +      wsptr += DCTSIZE;		/* advance pointer to next row */
  61.217 +      continue;
  61.218 +    }
  61.219 +#endif
  61.220 +    
  61.221 +    /* Even part */
  61.222 +    
  61.223 +    tmp0 = ((INT32) wsptr[0]) << (CONST_BITS+1);
  61.224 +    
  61.225 +    tmp2 = MULTIPLY((INT32) wsptr[2], FIX_1_847759065)
  61.226 +	 + MULTIPLY((INT32) wsptr[6], - FIX_0_765366865);
  61.227 +    
  61.228 +    tmp10 = tmp0 + tmp2;
  61.229 +    tmp12 = tmp0 - tmp2;
  61.230 +    
  61.231 +    /* Odd part */
  61.232 +    
  61.233 +    z1 = (INT32) wsptr[7];
  61.234 +    z2 = (INT32) wsptr[5];
  61.235 +    z3 = (INT32) wsptr[3];
  61.236 +    z4 = (INT32) wsptr[1];
  61.237 +    
  61.238 +    tmp0 = MULTIPLY(z1, - FIX_0_211164243) /* sqrt(2) * (c3-c1) */
  61.239 +	 + MULTIPLY(z2, FIX_1_451774981) /* sqrt(2) * (c3+c7) */
  61.240 +	 + MULTIPLY(z3, - FIX_2_172734803) /* sqrt(2) * (-c1-c5) */
  61.241 +	 + MULTIPLY(z4, FIX_1_061594337); /* sqrt(2) * (c5+c7) */
  61.242 +    
  61.243 +    tmp2 = MULTIPLY(z1, - FIX_0_509795579) /* sqrt(2) * (c7-c5) */
  61.244 +	 + MULTIPLY(z2, - FIX_0_601344887) /* sqrt(2) * (c5-c1) */
  61.245 +	 + MULTIPLY(z3, FIX_0_899976223) /* sqrt(2) * (c3-c7) */
  61.246 +	 + MULTIPLY(z4, FIX_2_562915447); /* sqrt(2) * (c1+c3) */
  61.247 +
  61.248 +    /* Final output stage */
  61.249 +    
  61.250 +    outptr[0] = range_limit[(int) DESCALE(tmp10 + tmp2,
  61.251 +					  CONST_BITS+PASS1_BITS+3+1)
  61.252 +			    & RANGE_MASK];
  61.253 +    outptr[3] = range_limit[(int) DESCALE(tmp10 - tmp2,
  61.254 +					  CONST_BITS+PASS1_BITS+3+1)
  61.255 +			    & RANGE_MASK];
  61.256 +    outptr[1] = range_limit[(int) DESCALE(tmp12 + tmp0,
  61.257 +					  CONST_BITS+PASS1_BITS+3+1)
  61.258 +			    & RANGE_MASK];
  61.259 +    outptr[2] = range_limit[(int) DESCALE(tmp12 - tmp0,
  61.260 +					  CONST_BITS+PASS1_BITS+3+1)
  61.261 +			    & RANGE_MASK];
  61.262 +    
  61.263 +    wsptr += DCTSIZE;		/* advance pointer to next row */
  61.264 +  }
  61.265 +}
  61.266 +
  61.267 +
  61.268 +/*
  61.269 + * Perform dequantization and inverse DCT on one block of coefficients,
  61.270 + * producing a reduced-size 2x2 output block.
  61.271 + */
  61.272 +
  61.273 +GLOBAL(void)
  61.274 +jpeg_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
  61.275 +	       JCOEFPTR coef_block,
  61.276 +	       JSAMPARRAY output_buf, JDIMENSION output_col)
  61.277 +{
  61.278 +  INT32 tmp0, tmp10, z1;
  61.279 +  JCOEFPTR inptr;
  61.280 +  ISLOW_MULT_TYPE * quantptr;
  61.281 +  int * wsptr;
  61.282 +  JSAMPROW outptr;
  61.283 +  JSAMPLE *range_limit = IDCT_range_limit(cinfo);
  61.284 +  int ctr;
  61.285 +  int workspace[DCTSIZE*2];	/* buffers data between passes */
  61.286 +  SHIFT_TEMPS
  61.287 +
  61.288 +  /* Pass 1: process columns from input, store into work array. */
  61.289 +
  61.290 +  inptr = coef_block;
  61.291 +  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
  61.292 +  wsptr = workspace;
  61.293 +  for (ctr = DCTSIZE; ctr > 0; inptr++, quantptr++, wsptr++, ctr--) {
  61.294 +    /* Don't bother to process columns 2,4,6 */
  61.295 +    if (ctr == DCTSIZE-2 || ctr == DCTSIZE-4 || ctr == DCTSIZE-6)
  61.296 +      continue;
  61.297 +    if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*3] == 0 &&
  61.298 +	inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*7] == 0) {
  61.299 +      /* AC terms all zero; we need not examine terms 2,4,6 for 2x2 output */
  61.300 +      int dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) << PASS1_BITS;
  61.301 +      
  61.302 +      wsptr[DCTSIZE*0] = dcval;
  61.303 +      wsptr[DCTSIZE*1] = dcval;
  61.304 +      
  61.305 +      continue;
  61.306 +    }
  61.307 +    
  61.308 +    /* Even part */
  61.309 +    
  61.310 +    z1 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
  61.311 +    tmp10 = z1 << (CONST_BITS+2);
  61.312 +    
  61.313 +    /* Odd part */
  61.314 +
  61.315 +    z1 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);
  61.316 +    tmp0 = MULTIPLY(z1, - FIX_0_720959822); /* sqrt(2) * (c7-c5+c3-c1) */
  61.317 +    z1 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);
  61.318 +    tmp0 += MULTIPLY(z1, FIX_0_850430095); /* sqrt(2) * (-c1+c3+c5+c7) */
  61.319 +    z1 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);
  61.320 +    tmp0 += MULTIPLY(z1, - FIX_1_272758580); /* sqrt(2) * (-c1+c3-c5-c7) */
  61.321 +    z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
  61.322 +    tmp0 += MULTIPLY(z1, FIX_3_624509785); /* sqrt(2) * (c1+c3+c5+c7) */
  61.323 +
  61.324 +    /* Final output stage */
  61.325 +    
  61.326 +    wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp0, CONST_BITS-PASS1_BITS+2);
  61.327 +    wsptr[DCTSIZE*1] = (int) DESCALE(tmp10 - tmp0, CONST_BITS-PASS1_BITS+2);
  61.328 +  }
  61.329 +  
  61.330 +  /* Pass 2: process 2 rows from work array, store into output array. */
  61.331 +
  61.332 +  wsptr = workspace;
  61.333 +  for (ctr = 0; ctr < 2; ctr++) {
  61.334 +    outptr = output_buf[ctr] + output_col;
  61.335 +    /* It's not clear whether a zero row test is worthwhile here ... */
  61.336 +
  61.337 +#ifndef NO_ZERO_ROW_TEST
  61.338 +    if (wsptr[1] == 0 && wsptr[3] == 0 && wsptr[5] == 0 && wsptr[7] == 0) {
  61.339 +      /* AC terms all zero */
  61.340 +      JSAMPLE dcval = range_limit[(int) DESCALE((INT32) wsptr[0], PASS1_BITS+3)
  61.341 +				  & RANGE_MASK];
  61.342 +      
  61.343 +      outptr[0] = dcval;
  61.344 +      outptr[1] = dcval;
  61.345 +      
  61.346 +      wsptr += DCTSIZE;		/* advance pointer to next row */
  61.347 +      continue;
  61.348 +    }
  61.349 +#endif
  61.350 +    
  61.351 +    /* Even part */
  61.352 +    
  61.353 +    tmp10 = ((INT32) wsptr[0]) << (CONST_BITS+2);
  61.354 +    
  61.355 +    /* Odd part */
  61.356 +
  61.357 +    tmp0 = MULTIPLY((INT32) wsptr[7], - FIX_0_720959822) /* sqrt(2) * (c7-c5+c3-c1) */
  61.358 +	 + MULTIPLY((INT32) wsptr[5], FIX_0_850430095) /* sqrt(2) * (-c1+c3+c5+c7) */
  61.359 +	 + MULTIPLY((INT32) wsptr[3], - FIX_1_272758580) /* sqrt(2) * (-c1+c3-c5-c7) */
  61.360 +	 + MULTIPLY((INT32) wsptr[1], FIX_3_624509785); /* sqrt(2) * (c1+c3+c5+c7) */
  61.361 +
  61.362 +    /* Final output stage */
  61.363 +    
  61.364 +    outptr[0] = range_limit[(int) DESCALE(tmp10 + tmp0,
  61.365 +					  CONST_BITS+PASS1_BITS+3+2)
  61.366 +			    & RANGE_MASK];
  61.367 +    outptr[1] = range_limit[(int) DESCALE(tmp10 - tmp0,
  61.368 +					  CONST_BITS+PASS1_BITS+3+2)
  61.369 +			    & RANGE_MASK];
  61.370 +    
  61.371 +    wsptr += DCTSIZE;		/* advance pointer to next row */
  61.372 +  }
  61.373 +}
  61.374 +
  61.375 +
  61.376 +/*
  61.377 + * Perform dequantization and inverse DCT on one block of coefficients,
  61.378 + * producing a reduced-size 1x1 output block.
  61.379 + */
  61.380 +
  61.381 +GLOBAL(void)
  61.382 +jpeg_idct_1x1 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
  61.383 +	       JCOEFPTR coef_block,
  61.384 +	       JSAMPARRAY output_buf, JDIMENSION output_col)
  61.385 +{
  61.386 +  int dcval;
  61.387 +  ISLOW_MULT_TYPE * quantptr;
  61.388 +  JSAMPLE *range_limit = IDCT_range_limit(cinfo);
  61.389 +  SHIFT_TEMPS
  61.390 +
  61.391 +  /* We hardly need an inverse DCT routine for this: just take the
  61.392 +   * average pixel value, which is one-eighth of the DC coefficient.
  61.393 +   */
  61.394 +  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
  61.395 +  dcval = DEQUANTIZE(coef_block[0], quantptr[0]);
  61.396 +  dcval = (int) DESCALE((INT32) dcval, 3);
  61.397 +
  61.398 +  output_buf[0][output_col] = range_limit[dcval & RANGE_MASK];
  61.399 +}
  61.400 +
  61.401 +#endif /* IDCT_SCALING_SUPPORTED */
    62.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    62.2 +++ b/libs/libjpeg/jinclude.h	Sun Nov 01 00:36:56 2015 +0200
    62.3 @@ -0,0 +1,91 @@
    62.4 +/*
    62.5 + * jinclude.h
    62.6 + *
    62.7 + * Copyright (C) 1991-1994, Thomas G. Lane.
    62.8 + * This file is part of the Independent JPEG Group's software.
    62.9 + * For conditions of distribution and use, see the accompanying README file.
   62.10 + *
   62.11 + * This file exists to provide a single place to fix any problems with
   62.12 + * including the wrong system include files.  (Common problems are taken
   62.13 + * care of by the standard jconfig symbols, but on really weird systems
   62.14 + * you may have to edit this file.)
   62.15 + *
   62.16 + * NOTE: this file is NOT intended to be included by applications using the
   62.17 + * JPEG library.  Most applications need only include jpeglib.h.
   62.18 + */
   62.19 +
   62.20 +
   62.21 +/* Include auto-config file to find out which system include files we need. */
   62.22 +
   62.23 +#include "jconfig.h"		/* auto configuration options */
   62.24 +#define JCONFIG_INCLUDED	/* so that jpeglib.h doesn't do it again */
   62.25 +
   62.26 +/*
   62.27 + * We need the NULL macro and size_t typedef.
   62.28 + * On an ANSI-conforming system it is sufficient to include <stddef.h>.
   62.29 + * Otherwise, we get them from <stdlib.h> or <stdio.h>; we may have to
   62.30 + * pull in <sys/types.h> as well.
   62.31 + * Note that the core JPEG library does not require <stdio.h>;
   62.32 + * only the default error handler and data source/destination modules do.
   62.33 + * But we must pull it in because of the references to FILE in jpeglib.h.
   62.34 + * You can remove those references if you want to compile without <stdio.h>.
   62.35 + */
   62.36 +
   62.37 +#ifdef HAVE_STDDEF_H
   62.38 +#include <stddef.h>
   62.39 +#endif
   62.40 +
   62.41 +#ifdef HAVE_STDLIB_H
   62.42 +#include <stdlib.h>
   62.43 +#endif
   62.44 +
   62.45 +#ifdef NEED_SYS_TYPES_H
   62.46 +#include <sys/types.h>
   62.47 +#endif
   62.48 +
   62.49 +#include <stdio.h>
   62.50 +
   62.51 +/*
   62.52 + * We need memory copying and zeroing functions, plus strncpy().
   62.53 + * ANSI and System V implementations declare these in <string.h>.
   62.54 + * BSD doesn't have the mem() functions, but it does have bcopy()/bzero().
   62.55 + * Some systems may declare memset and memcpy in <memory.h>.
   62.56 + *
   62.57 + * NOTE: we assume the size parameters to these functions are of type size_t.
   62.58 + * Change the casts in these macros if not!
   62.59 + */
   62.60 +
   62.61 +#ifdef NEED_BSD_STRINGS
   62.62 +
   62.63 +#include <strings.h>
   62.64 +#define MEMZERO(target,size)	bzero((void *)(target), (size_t)(size))
   62.65 +#define MEMCOPY(dest,src,size)	bcopy((const void *)(src), (void *)(dest), (size_t)(size))
   62.66 +
   62.67 +#else /* not BSD, assume ANSI/SysV string lib */
   62.68 +
   62.69 +#include <string.h>
   62.70 +#define MEMZERO(target,size)	memset((void *)(target), 0, (size_t)(size))
   62.71 +#define MEMCOPY(dest,src,size)	memcpy((void *)(dest), (const void *)(src), (size_t)(size))
   62.72 +
   62.73 +#endif
   62.74 +
   62.75 +/*
   62.76 + * In ANSI C, and indeed any rational implementation, size_t is also the
   62.77 + * type returned by sizeof().  However, it seems there are some irrational
   62.78 + * implementations out there, in which sizeof() returns an int even though
   62.79 + * size_t is defined as long or unsigned long.  To ensure consistent results
   62.80 + * we always use this SIZEOF() macro in place of using sizeof() directly.
   62.81 + */
   62.82 +
   62.83 +#define SIZEOF(object)	((size_t) sizeof(object))
   62.84 +
   62.85 +/*
   62.86 + * The modules that use fread() and fwrite() always invoke them through
   62.87 + * these macros.  On some systems you may need to twiddle the argument casts.
   62.88 + * CAUTION: argument order is different from underlying functions!
   62.89 + */
   62.90 +
   62.91 +#define JFREAD(file,buf,sizeofbuf)  \
   62.92 +  ((size_t) fread((void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file)))
   62.93 +#define JFWRITE(file,buf,sizeofbuf)  \
   62.94 +  ((size_t) fwrite((const void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file)))
    63.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    63.2 +++ b/libs/libjpeg/jmemmgr.c	Sun Nov 01 00:36:56 2015 +0200
    63.3 @@ -0,0 +1,1118 @@
    63.4 +/*
    63.5 + * jmemmgr.c
    63.6 + *
    63.7 + * Copyright (C) 1991-1997, Thomas G. Lane.
    63.8 + * This file is part of the Independent JPEG Group's software.
    63.9 + * For conditions of distribution and use, see the accompanying README file.
   63.10 + *
   63.11 + * This file contains the JPEG system-independent memory management
   63.12 + * routines.  This code is usable across a wide variety of machines; most
   63.13 + * of the system dependencies have been isolated in a separate file.
   63.14 + * The major functions provided here are:
   63.15 + *   * pool-based allocation and freeing of memory;
   63.16 + *   * policy decisions about how to divide available memory among the
   63.17 + *     virtual arrays;
   63.18 + *   * control logic for swapping virtual arrays between main memory and
   63.19 + *     backing storage.
   63.20 + * The separate system-dependent file provides the actual backing-storage
   63.21 + * access code, and it contains the policy decision about how much total
   63.22 + * main memory to use.
   63.23 + * This file is system-dependent in the sense that some of its functions
   63.24 + * are unnecessary in some systems.  For example, if there is enough virtual
   63.25 + * memory so that backing storage will never be used, much of the virtual
   63.26 + * array control logic could be removed.  (Of course, if you have that much
   63.27 + * memory then you shouldn't care about a little bit of unused code...)
   63.28 + */
   63.29 +
   63.30 +#define JPEG_INTERNALS
   63.31 +#define AM_MEMORY_MANAGER	/* we define jvirt_Xarray_control structs */
   63.32 +#include "jinclude.h"
   63.33 +#include "jpeglib.h"
   63.34 +#include "jmemsys.h"		/* import the system-dependent declarations */
   63.35 +
   63.36 +#ifndef NO_GETENV
   63.37 +#ifndef HAVE_STDLIB_H		/* <stdlib.h> should declare getenv() */
   63.38 +extern char * getenv JPP((const char * name));
   63.39 +#endif
   63.40 +#endif
   63.41 +
   63.42 +
   63.43 +/*
   63.44 + * Some important notes:
   63.45 + *   The allocation routines provided here must never return NULL.
   63.46 + *   They should exit to error_exit if unsuccessful.
   63.47 + *
   63.48 + *   It's not a good idea to try to merge the sarray and barray routines,
   63.49 + *   even though they are textually almost the same, because samples are
   63.50 + *   usually stored as bytes while coefficients are shorts or ints.  Thus,
   63.51 + *   in machines where byte pointers have a different representation from
   63.52 + *   word pointers, the resulting machine code could not be the same.
   63.53 + */
   63.54 +
   63.55 +
   63.56 +/*
   63.57 + * Many machines require storage alignment: longs must start on 4-byte
   63.58 + * boundaries, doubles on 8-byte boundaries, etc.  On such machines, malloc()
   63.59 + * always returns pointers that are multiples of the worst-case alignment
   63.60 + * requirement, and we had better do so too.
   63.61 + * There isn't any really portable way to determine the worst-case alignment
   63.62 + * requirement.  This module assumes that the alignment requirement is
   63.63 + * multiples of sizeof(ALIGN_TYPE).
   63.64 + * By default, we define ALIGN_TYPE as double.  This is necessary on some
   63.65 + * workstations (where doubles really do need 8-byte alignment) and will work
   63.66 + * fine on nearly everything.  If your machine has lesser alignment needs,
   63.67 + * you can save a few bytes by making ALIGN_TYPE smaller.
   63.68 + * The only place I know of where this will NOT work is certain Macintosh
   63.69 + * 680x0 compilers that define double as a 10-byte IEEE extended float.
   63.70 + * Doing 10-byte alignment is counterproductive because longwords won't be
   63.71 + * aligned well.  Put "#define ALIGN_TYPE long" in jconfig.h if you have
   63.72 + * such a compiler.
   63.73 + */
   63.74 +
   63.75 +#ifndef ALIGN_TYPE		/* so can override from jconfig.h */
   63.76 +#define ALIGN_TYPE  double
   63.77 +#endif
   63.78 +
   63.79 +
   63.80 +/*
   63.81 + * We allocate objects from "pools", where each pool is gotten with a single
   63.82 + * request to jpeg_get_small() or jpeg_get_large().  There is no per-object
   63.83 + * overhead within a pool, except for alignment padding.  Each pool has a
   63.84 + * header with a link to the next pool of the same class.
   63.85 + * Small and large pool headers are identical except that the latter's
   63.86 + * link pointer must be FAR on 80x86 machines.
   63.87 + * Notice that the "real" header fields are union'ed with a dummy ALIGN_TYPE
   63.88 + * field.  This forces the compiler to make SIZEOF(small_pool_hdr) a multiple
   63.89 + * of the alignment requirement of ALIGN_TYPE.
   63.90 + */
   63.91 +
   63.92 +typedef union small_pool_struct * small_pool_ptr;
   63.93 +
   63.94 +typedef union small_pool_struct {
   63.95 +  struct {
   63.96 +    small_pool_ptr next;	/* next in list of pools */
   63.97 +    size_t bytes_used;		/* how many bytes already used within pool */
   63.98 +    size_t bytes_left;		/* bytes still available in this pool */
   63.99 +  } hdr;
  63.100 +  ALIGN_TYPE dummy;		/* included in union to ensure alignment */
  63.101 +} small_pool_hdr;
  63.102 +
  63.103 +typedef union large_pool_struct FAR * large_pool_ptr;
  63.104 +
  63.105 +typedef union large_pool_struct {
  63.106 +  struct {
  63.107 +    large_pool_ptr next;	/* next in list of pools */
  63.108 +    size_t bytes_used;		/* how many bytes already used within pool */
  63.109 +    size_t bytes_left;		/* bytes still available in this pool */
  63.110 +  } hdr;
  63.111 +  ALIGN_TYPE dummy;		/* included in union to ensure alignment */
  63.112 +} large_pool_hdr;
  63.113 +
  63.114 +
  63.115 +/*
  63.116 + * Here is the full definition of a memory manager object.
  63.117 + */
  63.118 +
  63.119 +typedef struct {
  63.120 +  struct jpeg_memory_mgr pub;	/* public fields */
  63.121 +
  63.122 +  /* Each pool identifier (lifetime class) names a linked list of pools. */
  63.123 +  small_pool_ptr small_list[JPOOL_NUMPOOLS];
  63.124 +  large_pool_ptr large_list[JPOOL_NUMPOOLS];
  63.125 +
  63.126 +  /* Since we only have one lifetime class of virtual arrays, only one
  63.127 +   * linked list is necessary (for each datatype).  Note that the virtual
  63.128 +   * array control blocks being linked together are actually stored somewhere
  63.129 +   * in the small-pool list.
  63.130 +   */
  63.131 +  jvirt_sarray_ptr virt_sarray_list;
  63.132 +  jvirt_barray_ptr virt_barray_list;
  63.133 +
  63.134 +  /* This counts total space obtained from jpeg_get_small/large */
  63.135 +  long total_space_allocated;
  63.136 +
  63.137 +  /* alloc_sarray and alloc_barray set this value for use by virtual
  63.138 +   * array routines.
  63.139 +   */
  63.140 +  JDIMENSION last_rowsperchunk;	/* from most recent alloc_sarray/barray */
  63.141 +} my_memory_mgr;
  63.142 +
  63.143 +typedef my_memory_mgr * my_mem_ptr;
  63.144 +
  63.145 +
  63.146 +/*
  63.147 + * The control blocks for virtual arrays.
  63.148 + * Note that these blocks are allocated in the "small" pool area.
  63.149 + * System-dependent info for the associated backing store (if any) is hidden
  63.150 + * inside the backing_store_info struct.
  63.151 + */
  63.152 +
  63.153 +struct jvirt_sarray_control {
  63.154 +  JSAMPARRAY mem_buffer;	/* => the in-memory buffer */
  63.155 +  JDIMENSION rows_in_array;	/* total virtual array height */
  63.156 +  JDIMENSION samplesperrow;	/* width of array (and of memory buffer) */
  63.157 +  JDIMENSION maxaccess;		/* max rows accessed by access_virt_sarray */
  63.158 +  JDIMENSION rows_in_mem;	/* height of memory buffer */
  63.159 +  JDIMENSION rowsperchunk;	/* allocation chunk size in mem_buffer */
  63.160 +  JDIMENSION cur_start_row;	/* first logical row # in the buffer */
  63.161 +  JDIMENSION first_undef_row;	/* row # of first uninitialized row */
  63.162 +  boolean pre_zero;		/* pre-zero mode requested? */
  63.163 +  boolean dirty;		/* do current buffer contents need written? */
  63.164 +  boolean b_s_open;		/* is backing-store data valid? */
  63.165 +  jvirt_sarray_ptr next;	/* link to next virtual sarray control block */
  63.166 +  backing_store_info b_s_info;	/* System-dependent control info */
  63.167 +};
  63.168 +
  63.169 +struct jvirt_barray_control {
  63.170 +  JBLOCKARRAY mem_buffer;	/* => the in-memory buffer */
  63.171 +  JDIMENSION rows_in_array;	/* total virtual array height */
  63.172 +  JDIMENSION blocksperrow;	/* width of array (and of memory buffer) */
  63.173 +  JDIMENSION maxaccess;		/* max rows accessed by access_virt_barray */
  63.174 +  JDIMENSION rows_in_mem;	/* height of memory buffer */
  63.175 +  JDIMENSION rowsperchunk;	/* allocation chunk size in mem_buffer */
  63.176 +  JDIMENSION cur_start_row;	/* first logical row # in the buffer */
  63.177 +  JDIMENSION first_undef_row;	/* row # of first uninitialized row */
  63.178 +  boolean pre_zero;		/* pre-zero mode requested? */
  63.179 +  boolean dirty;		/* do current buffer contents need written? */
  63.180 +  boolean b_s_open;		/* is backing-store data valid? */
  63.181 +  jvirt_barray_ptr next;	/* link to next virtual barray control block */
  63.182 +  backing_store_info b_s_info;	/* System-dependent control info */
  63.183 +};
  63.184 +
  63.185 +
  63.186 +#ifdef MEM_STATS		/* optional extra stuff for statistics */
  63.187 +
  63.188 +LOCAL(void)
  63.189 +print_mem_stats (j_common_ptr cinfo, int pool_id)
  63.190 +{
  63.191 +  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
  63.192 +  small_pool_ptr shdr_ptr;
  63.193 +  large_pool_ptr lhdr_ptr;
  63.194 +
  63.195 +  /* Since this is only a debugging stub, we can cheat a little by using
  63.196 +   * fprintf directly rather than going through the trace message code.
  63.197 +   * This is helpful because message parm array can't handle longs.
  63.198 +   */
  63.199 +  fprintf(stderr, "Freeing pool %d, total space = %ld\n",
  63.200 +	  pool_id, mem->total_space_allocated);
  63.201 +
  63.202 +  for (lhdr_ptr = mem->large_list[pool_id]; lhdr_ptr != NULL;
  63.203 +       lhdr_ptr = lhdr_ptr->hdr.next) {
  63.204 +    fprintf(stderr, "  Large chunk used %ld\n",
  63.205 +	    (long) lhdr_ptr->hdr.bytes_used);
  63.206 +  }
  63.207 +
  63.208 +  for (shdr_ptr = mem->small_list[pool_id]; shdr_ptr != NULL;
  63.209 +       shdr_ptr = shdr_ptr->hdr.next) {
  63.210 +    fprintf(stderr, "  Small chunk used %ld free %ld\n",
  63.211 +	    (long) shdr_ptr->hdr.bytes_used,
  63.212 +	    (long) shdr_ptr->hdr.bytes_left);
  63.213 +  }
  63.214 +}
  63.215 +
  63.216 +#endif /* MEM_STATS */
  63.217 +
  63.218 +
  63.219 +LOCAL(void)
  63.220 +out_of_memory (j_common_ptr cinfo, int which)
  63.221 +/* Report an out-of-memory error and stop execution */
  63.222 +/* If we compiled MEM_STATS support, report alloc requests before dying */
  63.223 +{
  63.224 +#ifdef MEM_STATS
  63.225 +  cinfo->err->trace_level = 2;	/* force self_destruct to report stats */
  63.226 +#endif
  63.227 +  ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, which);
  63.228 +}
  63.229 +
  63.230 +
  63.231 +/*
  63.232 + * Allocation of "small" objects.
  63.233 + *
  63.234 + * For these, we use pooled storage.  When a new pool must be created,
  63.235 + * we try to get enough space for the current request plus a "slop" factor,
  63.236 + * where the slop will be the amount of leftover space in the new pool.
  63.237 + * The speed vs. space tradeoff is largely determined by the slop values.
  63.238 + * A different slop value is provided for each pool class (lifetime),
  63.239 + * and we also distinguish the first pool of a class from later ones.
  63.240 + * NOTE: the values given work fairly well on both 16- and 32-bit-int
  63.241 + * machines, but may be too small if longs are 64 bits or more.
  63.242 + */
  63.243 +
  63.244 +static const size_t first_pool_slop[JPOOL_NUMPOOLS] = 
  63.245 +{
  63.246 +	1600,			/* first PERMANENT pool */
  63.247 +	16000			/* first IMAGE pool */
  63.248 +};
  63.249 +
  63.250 +static const size_t extra_pool_slop[JPOOL_NUMPOOLS] = 
  63.251 +{
  63.252 +	0,			/* additional PERMANENT pools */
  63.253 +	5000			/* additional IMAGE pools */
  63.254 +};
  63.255 +
  63.256 +#define MIN_SLOP  50		/* greater than 0 to avoid futile looping */
  63.257 +
  63.258 +
  63.259 +METHODDEF(void *)
  63.260 +alloc_small (j_common_ptr cinfo, int pool_id, size_t sizeofobject)
  63.261 +/* Allocate a "small" object */
  63.262 +{
  63.263 +  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
  63.264 +  small_pool_ptr hdr_ptr, prev_hdr_ptr;
  63.265 +  char * data_ptr;
  63.266 +  size_t odd_bytes, min_request, slop;
  63.267 +
  63.268 +  /* Check for unsatisfiable request (do now to ensure no overflow below) */
  63.269 +  if (sizeofobject > (size_t) (MAX_ALLOC_CHUNK-SIZEOF(small_pool_hdr)))
  63.270 +    out_of_memory(cinfo, 1);	/* request exceeds malloc's ability */
  63.271 +
  63.272 +  /* Round up the requested size to a multiple of SIZEOF(ALIGN_TYPE) */
  63.273 +  odd_bytes = sizeofobject % SIZEOF(ALIGN_TYPE);
  63.274 +  if (odd_bytes > 0)
  63.275 +    sizeofobject += SIZEOF(ALIGN_TYPE) - odd_bytes;
  63.276 +
  63.277 +  /* See if space is available in any existing pool */
  63.278 +  if (pool_id < 0 || pool_id >= JPOOL_NUMPOOLS)
  63.279 +    ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id);	/* safety check */
  63.280 +  prev_hdr_ptr = NULL;
  63.281 +  hdr_ptr = mem->small_list[pool_id];
  63.282 +  while (hdr_ptr != NULL) {
  63.283 +    if (hdr_ptr->hdr.bytes_left >= sizeofobject)
  63.284 +      break;			/* found pool with enough space */
  63.285 +    prev_hdr_ptr = hdr_ptr;
  63.286 +    hdr_ptr = hdr_ptr->hdr.next;
  63.287 +  }
  63.288 +
  63.289 +  /* Time to make a new pool? */
  63.290 +  if (hdr_ptr == NULL) {
  63.291 +    /* min_request is what we need now, slop is what will be leftover */
  63.292 +    min_request = sizeofobject + SIZEOF(small_pool_hdr);
  63.293 +    if (prev_hdr_ptr == NULL)	/* first pool in class? */
  63.294 +      slop = first_pool_slop[pool_id];
  63.295 +    else
  63.296 +      slop = extra_pool_slop[pool_id];
  63.297 +    /* Don't ask for more than MAX_ALLOC_CHUNK */
  63.298 +    if (slop > (size_t) (MAX_ALLOC_CHUNK-min_request))
  63.299 +      slop = (size_t) (MAX_ALLOC_CHUNK-min_request);
  63.300 +    /* Try to get space, if fail reduce slop and try again */
  63.301 +    for (;;) {
  63.302 +      hdr_ptr = (small_pool_ptr) jpeg_get_small(cinfo, min_request + slop);
  63.303 +      if (hdr_ptr != NULL)
  63.304 +	break;
  63.305 +      slop /= 2;
  63.306 +      if (slop < MIN_SLOP)	/* give up when it gets real small */
  63.307 +	out_of_memory(cinfo, 2); /* jpeg_get_small failed */
  63.308 +    }
  63.309 +    mem->total_space_allocated += min_request + slop;
  63.310 +    /* Success, initialize the new pool header and add to end of list */
  63.311 +    hdr_ptr->hdr.next = NULL;
  63.312 +    hdr_ptr->hdr.bytes_used = 0;
  63.313 +    hdr_ptr->hdr.bytes_left = sizeofobject + slop;
  63.314 +    if (prev_hdr_ptr == NULL)	/* first pool in class? */
  63.315 +      mem->small_list[pool_id] = hdr_ptr;
  63.316 +    else
  63.317 +      prev_hdr_ptr->hdr.next = hdr_ptr;
  63.318 +  }
  63.319 +
  63.320 +  /* OK, allocate the object from the current pool */
  63.321 +  data_ptr = (char *) (hdr_ptr + 1); /* point to first data byte in pool */
  63.322 +  data_ptr += hdr_ptr->hdr.bytes_used; /* point to place for object */
  63.323 +  hdr_ptr->hdr.bytes_used += sizeofobject;
  63.324 +  hdr_ptr->hdr.bytes_left -= sizeofobject;
  63.325 +
  63.326 +  return (void *) data_ptr;
  63.327 +}
  63.328 +
  63.329 +
  63.330 +/*
  63.331 + * Allocation of "large" objects.
  63.332 + *
  63.333 + * The external semantics of these are the same as "small" objects,
  63.334 + * except that FAR pointers are used on 80x86.  However the pool
  63.335 + * management heuristics are quite different.  We assume that each
  63.336 + * request is large enough that it may as well be passed directly to
  63.337 + * jpeg_get_large; the pool management just links everything together
  63.338 + * so that we can free it all on demand.
  63.339 + * Note: the major use of "large" objects is in JSAMPARRAY and JBLOCKARRAY
  63.340 + * structures.  The routines that create these structures (see below)
  63.341 + * deliberately bunch rows together to ensure a large request size.
  63.342 + */
  63.343 +
  63.344 +METHODDEF(void FAR *)
  63.345 +alloc_large (j_common_ptr cinfo, int pool_id, size_t sizeofobject)
  63.346 +/* Allocate a "large" object */
  63.347 +{
  63.348 +  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
  63.349 +  large_pool_ptr hdr_ptr;
  63.350 +  size_t odd_bytes;
  63.351 +
  63.352 +  /* Check for unsatisfiable request (do now to ensure no overflow below) */
  63.353 +  if (sizeofobject > (size_t) (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr)))
  63.354 +    out_of_memory(cinfo, 3);	/* request exceeds malloc's ability */
  63.355 +
  63.356 +  /* Round up the requested size to a multiple of SIZEOF(ALIGN_TYPE) */
  63.357 +  odd_bytes = sizeofobject % SIZEOF(ALIGN_TYPE);
  63.358 +  if (odd_bytes > 0)
  63.359 +    sizeofobject += SIZEOF(ALIGN_TYPE) - odd_bytes;
  63.360 +
  63.361 +  /* Always make a new pool */
  63.362 +  if (pool_id < 0 || pool_id >= JPOOL_NUMPOOLS)
  63.363 +    ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id);	/* safety check */
  63.364 +
  63.365 +  hdr_ptr = (large_pool_ptr) jpeg_get_large(cinfo, sizeofobject +
  63.366 +					    SIZEOF(large_pool_hdr));
  63.367 +  if (hdr_ptr == NULL)
  63.368 +    out_of_memory(cinfo, 4);	/* jpeg_get_large failed */
  63.369 +  mem->total_space_allocated += sizeofobject + SIZEOF(large_pool_hdr);
  63.370 +
  63.371 +  /* Success, initialize the new pool header and add to list */
  63.372 +  hdr_ptr->hdr.next = mem->large_list[pool_id];
  63.373 +  /* We maintain space counts in each pool header for statistical purposes,
  63.374 +   * even though they are not needed for allocation.
  63.375 +   */
  63.376 +  hdr_ptr->hdr.bytes_used = sizeofobject;
  63.377 +  hdr_ptr->hdr.bytes_left = 0;
  63.378 +  mem->large_list[pool_id] = hdr_ptr;
  63.379 +
  63.380 +  return (void FAR *) (hdr_ptr + 1); /* point to first data byte in pool */
  63.381 +}
  63.382 +
  63.383 +
  63.384 +/*
  63.385 + * Creation of 2-D sample arrays.
  63.386 + * The pointers are in near heap, the samples themselves in FAR heap.
  63.387 + *
  63.388 + * To minimize allocation overhead and to allow I/O of large contiguous
  63.389 + * blocks, we allocate the sample rows in groups of as many rows as possible
  63.390 + * without exceeding MAX_ALLOC_CHUNK total bytes per allocation request.
  63.391 + * NB: the virtual array control routines, later in this file, know about
  63.392 + * this chunking of rows.  The rowsperchunk value is left in the mem manager
  63.393 + * object so that it can be saved away if this sarray is the workspace for
  63.394 + * a virtual array.
  63.395 + */
  63.396 +
  63.397 +METHODDEF(JSAMPARRAY)
  63.398 +alloc_sarray (j_common_ptr cinfo, int pool_id,
  63.399 +	      JDIMENSION samplesperrow, JDIMENSION numrows)
  63.400 +/* Allocate a 2-D sample array */
  63.401 +{
  63.402 +  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
  63.403 +  JSAMPARRAY result;
  63.404 +  JSAMPROW workspace;
  63.405 +  JDIMENSION rowsperchunk, currow, i;
  63.406 +  long ltemp;
  63.407 +
  63.408 +  /* Calculate max # of rows allowed in one allocation chunk */
  63.409 +  ltemp = (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr)) /
  63.410 +	  ((long) samplesperrow * SIZEOF(JSAMPLE));
  63.411 +  if (ltemp <= 0)
  63.412 +    ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
  63.413 +  if (ltemp < (long) numrows)
  63.414 +    rowsperchunk = (JDIMENSION) ltemp;
  63.415 +  else
  63.416 +    rowsperchunk = numrows;
  63.417 +  mem->last_rowsperchunk = rowsperchunk;
  63.418 +
  63.419 +  /* Get space for row pointers (small object) */
  63.420 +  result = (JSAMPARRAY) alloc_small(cinfo, pool_id,
  63.421 +				    (size_t) (numrows * SIZEOF(JSAMPROW)));
  63.422 +
  63.423 +  /* Get the rows themselves (large objects) */
  63.424 +  currow = 0;
  63.425 +  while (currow < numrows) {
  63.426 +    rowsperchunk = MIN(rowsperchunk, numrows - currow);
  63.427 +    workspace = (JSAMPROW) alloc_large(cinfo, pool_id,
  63.428 +	(size_t) ((size_t) rowsperchunk * (size_t) samplesperrow
  63.429 +		  * SIZEOF(JSAMPLE)));
  63.430 +    for (i = rowsperchunk; i > 0; i--) {
  63.431 +      result[currow++] = workspace;
  63.432 +      workspace += samplesperrow;
  63.433 +    }
  63.434 +  }
  63.435 +
  63.436 +  return result;
  63.437 +}
  63.438 +
  63.439 +
  63.440 +/*
  63.441 + * Creation of 2-D coefficient-block arrays.
  63.442 + * This is essentially the same as the code for sample arrays, above.
  63.443 + */
  63.444 +
  63.445 +METHODDEF(JBLOCKARRAY)
  63.446 +alloc_barray (j_common_ptr cinfo, int pool_id,
  63.447 +	      JDIMENSION blocksperrow, JDIMENSION numrows)
  63.448 +/* Allocate a 2-D coefficient-block array */
  63.449 +{
  63.450 +  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
  63.451 +  JBLOCKARRAY result;
  63.452 +  JBLOCKROW workspace;
  63.453 +  JDIMENSION rowsperchunk, currow, i;
  63.454 +  long ltemp;
  63.455 +
  63.456 +  /* Calculate max # of rows allowed in one allocation chunk */
  63.457 +  ltemp = (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr)) /
  63.458 +	  ((long) blocksperrow * SIZEOF(JBLOCK));
  63.459 +  if (ltemp <= 0)
  63.460 +    ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
  63.461 +  if (ltemp < (long) numrows)
  63.462 +    rowsperchunk = (JDIMENSION) ltemp;
  63.463 +  else
  63.464 +    rowsperchunk = numrows;
  63.465 +  mem->last_rowsperchunk = rowsperchunk;
  63.466 +
  63.467 +  /* Get space for row pointers (small object) */
  63.468 +  result = (JBLOCKARRAY) alloc_small(cinfo, pool_id,
  63.469 +				     (size_t) (numrows * SIZEOF(JBLOCKROW)));
  63.470 +
  63.471 +  /* Get the rows themselves (large objects) */
  63.472 +  currow = 0;
  63.473 +  while (currow < numrows) {
  63.474 +    rowsperchunk = MIN(rowsperchunk, numrows - currow);
  63.475 +    workspace = (JBLOCKROW) alloc_large(cinfo, pool_id,
  63.476 +	(size_t) ((size_t) rowsperchunk * (size_t) blocksperrow
  63.477 +		  * SIZEOF(JBLOCK)));
  63.478 +    for (i = rowsperchunk; i > 0; i--) {
  63.479 +      result[currow++] = workspace;
  63.480 +      workspace += blocksperrow;
  63.481 +    }
  63.482 +  }
  63.483 +
  63.484 +  return result;
  63.485 +}
  63.486 +
  63.487 +
  63.488 +/*
  63.489 + * About virtual array management:
  63.490 + *
  63.491 + * The above "normal" array routines are only used to allocate strip buffers
  63.492 + * (as wide as the image, but just a few rows high).  Full-image-sized buffers
  63.493 + * are handled as "virtual" arrays.  The array is still accessed a strip at a
  63.494 + * time, but the memory manager must save the whole array for repeated
  63.495 + * accesses.  The intended implementation is that there is a strip buffer in
  63.496 + * memory (as high as is possible given the desired memory limit), plus a
  63.497 + * backing file that holds the rest of the array.
  63.498 + *
  63.499 + * The request_virt_array routines are told the total size of the image and
  63.500 + * the maximum number of rows that will be accessed at once.  The in-memory
  63.501 + * buffer must be at least as large as the maxaccess value.
  63.502 + *
  63.503 + * The request routines create control blocks but not the in-memory buffers.
  63.504 + * That is postponed until realize_virt_arrays is called.  At that time the
  63.505 + * total amount of space needed is known (approximately, anyway), so free
  63.506 + * memory can be divided up fairly.
  63.507 + *
  63.508 + * The access_virt_array routines are responsible for making a specific strip
  63.509 + * area accessible (after reading or writing the backing file, if necessary).
  63.510 + * Note that the access routines are told whether the caller intends to modify
  63.511 + * the accessed strip; during a read-only pass this saves having to rewrite
  63.512 + * data to disk.  The access routines are also responsible for pre-zeroing
  63.513 + * any newly accessed rows, if pre-zeroing was requested.
  63.514 + *
  63.515 + * In current usage, the access requests are usually for nonoverlapping
  63.516 + * strips; that is, successive access start_row numbers differ by exactly
  63.517 + * num_rows = maxaccess.  This means we can get good performance with simple
  63.518 + * buffer dump/reload logic, by making the in-memory buffer be a multiple
  63.519 + * of the access height; then there will never be accesses across bufferload
  63.520 + * boundaries.  The code will still work with overlapping access requests,
  63.521 + * but it doesn't handle bufferload overlaps very efficiently.
  63.522 + */
  63.523 +
  63.524 +
  63.525 +METHODDEF(jvirt_sarray_ptr)
  63.526 +request_virt_sarray (j_common_ptr cinfo, int pool_id, boolean pre_zero,
  63.527 +		     JDIMENSION samplesperrow, JDIMENSION numrows,
  63.528 +		     JDIMENSION maxaccess)
  63.529 +/* Request a virtual 2-D sample array */
  63.530 +{
  63.531 +  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
  63.532 +  jvirt_sarray_ptr result;
  63.533 +
  63.534 +  /* Only IMAGE-lifetime virtual arrays are currently supported */
  63.535 +  if (pool_id != JPOOL_IMAGE)
  63.536 +    ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id);	/* safety check */
  63.537 +
  63.538 +  /* get control block */
  63.539 +  result = (jvirt_sarray_ptr) alloc_small(cinfo, pool_id,
  63.540 +					  SIZEOF(struct jvirt_sarray_control));
  63.541 +
  63.542 +  result->mem_buffer = NULL;	/* marks array not yet realized */
  63.543 +  result->rows_in_array = numrows;
  63.544 +  result->samplesperrow = samplesperrow;
  63.545 +  result->maxaccess = maxaccess;
  63.546 +  result->pre_zero = pre_zero;
  63.547 +  result->b_s_open = FALSE;	/* no associated backing-store object */
  63.548 +  result->next = mem->virt_sarray_list; /* add to list of virtual arrays */
  63.549 +  mem->virt_sarray_list = result;
  63.550 +
  63.551 +  return result;
  63.552 +}
  63.553 +
  63.554 +
  63.555 +METHODDEF(jvirt_barray_ptr)
  63.556 +request_virt_barray (j_common_ptr cinfo, int pool_id, boolean pre_zero,
  63.557 +		     JDIMENSION blocksperrow, JDIMENSION numrows,
  63.558 +		     JDIMENSION maxaccess)
  63.559 +/* Request a virtual 2-D coefficient-block array */
  63.560 +{
  63.561 +  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
  63.562 +  jvirt_barray_ptr result;
  63.563 +
  63.564 +  /* Only IMAGE-lifetime virtual arrays are currently supported */
  63.565 +  if (pool_id != JPOOL_IMAGE)
  63.566 +    ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id);	/* safety check */
  63.567 +
  63.568 +  /* get control block */
  63.569 +  result = (jvirt_barray_ptr) alloc_small(cinfo, pool_id,
  63.570 +					  SIZEOF(struct jvirt_barray_control));
  63.571 +
  63.572 +  result->mem_buffer = NULL;	/* marks array not yet realized */
  63.573 +  result->rows_in_array = numrows;
  63.574 +  result->blocksperrow = blocksperrow;
  63.575 +  result->maxaccess = maxaccess;
  63.576 +  result->pre_zero = pre_zero;
  63.577 +  result->b_s_open = FALSE;	/* no associated backing-store object */
  63.578 +  result->next = mem->virt_barray_list; /* add to list of virtual arrays */
  63.579 +  mem->virt_barray_list = result;
  63.580 +
  63.581 +  return result;
  63.582 +}
  63.583 +
  63.584 +
  63.585 +METHODDEF(void)
  63.586 +realize_virt_arrays (j_common_ptr cinfo)
  63.587 +/* Allocate the in-memory buffers for any unrealized virtual arrays */
  63.588 +{
  63.589 +  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
  63.590 +  long space_per_minheight, maximum_space, avail_mem;
  63.591 +  long minheights, max_minheights;
  63.592 +  jvirt_sarray_ptr sptr;
  63.593 +  jvirt_barray_ptr bptr;
  63.594 +
  63.595 +  /* Compute the minimum space needed (maxaccess rows in each buffer)
  63.596 +   * and the maximum space needed (full image height in each buffer).
  63.597 +   * These may be of use to the system-dependent jpeg_mem_available routine.
  63.598 +   */
  63.599 +  space_per_minheight = 0;
  63.600 +  maximum_space = 0;
  63.601 +  for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) {
  63.602 +    if (sptr->mem_buffer == NULL) { /* if not realized yet */
  63.603 +      space_per_minheight += (long) sptr->maxaccess *
  63.604 +			     (long) sptr->samplesperrow * SIZEOF(JSAMPLE);
  63.605 +      maximum_space += (long) sptr->rows_in_array *
  63.606 +		       (long) sptr->samplesperrow * SIZEOF(JSAMPLE);
  63.607 +    }
  63.608 +  }
  63.609 +  for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) {
  63.610 +    if (bptr->mem_buffer == NULL) { /* if not realized yet */
  63.611 +      space_per_minheight += (long) bptr->maxaccess *
  63.612 +			     (long) bptr->blocksperrow * SIZEOF(JBLOCK);
  63.613 +      maximum_space += (long) bptr->rows_in_array *
  63.614 +		       (long) bptr->blocksperrow * SIZEOF(JBLOCK);
  63.615 +    }
  63.616 +  }
  63.617 +
  63.618 +  if (space_per_minheight <= 0)
  63.619 +    return;			/* no unrealized arrays, no work */
  63.620 +
  63.621 +  /* Determine amount of memory to actually use; this is system-dependent. */
  63.622 +  avail_mem = jpeg_mem_available(cinfo, space_per_minheight, maximum_space,
  63.623 +				 mem->total_space_allocated);
  63.624 +
  63.625 +  /* If the maximum space needed is available, make all the buffers full
  63.626 +   * height; otherwise parcel it out with the same number of minheights
  63.627 +   * in each buffer.
  63.628 +   */
  63.629 +  if (avail_mem >= maximum_space)
  63.630 +    max_minheights = 1000000000L;
  63.631 +  else {
  63.632 +    max_minheights = avail_mem / space_per_minheight;
  63.633 +    /* If there doesn't seem to be enough space, try to get the minimum
  63.634 +     * anyway.  This allows a "stub" implementation of jpeg_mem_available().
  63.635 +     */
  63.636 +    if (max_minheights <= 0)
  63.637 +      max_minheights = 1;
  63.638 +  }
  63.639 +
  63.640 +  /* Allocate the in-memory buffers and initialize backing store as needed. */
  63.641 +
  63.642 +  for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) {
  63.643 +    if (sptr->mem_buffer == NULL) { /* if not realized yet */
  63.644 +      minheights = ((long) sptr->rows_in_array - 1L) / sptr->maxaccess + 1L;
  63.645 +      if (minheights <= max_minheights) {
  63.646 +	/* This buffer fits in memory */
  63.647 +	sptr->rows_in_mem = sptr->rows_in_array;
  63.648 +      } else {
  63.649 +	/* It doesn't fit in memory, create backing store. */
  63.650 +	sptr->rows_in_mem = (JDIMENSION) (max_minheights * sptr->maxaccess);
  63.651 +	jpeg_open_backing_store(cinfo, & sptr->b_s_info,
  63.652 +				(long) sptr->rows_in_array *
  63.653 +				(long) sptr->samplesperrow *
  63.654 +				(long) SIZEOF(JSAMPLE));
  63.655 +	sptr->b_s_open = TRUE;
  63.656 +      }
  63.657 +      sptr->mem_buffer = alloc_sarray(cinfo, JPOOL_IMAGE,
  63.658 +				      sptr->samplesperrow, sptr->rows_in_mem);
  63.659 +      sptr->rowsperchunk = mem->last_rowsperchunk;
  63.660 +      sptr->cur_start_row = 0;
  63.661 +      sptr->first_undef_row = 0;
  63.662 +      sptr->dirty = FALSE;
  63.663 +    }
  63.664 +  }
  63.665 +
  63.666 +  for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) {
  63.667 +    if (bptr->mem_buffer == NULL) { /* if not realized yet */
  63.668 +      minheights = ((long) bptr->rows_in_array - 1L) / bptr->maxaccess + 1L;
  63.669 +      if (minheights <= max_minheights) {
  63.670 +	/* This buffer fits in memory */
  63.671 +	bptr->rows_in_mem = bptr->rows_in_array;
  63.672 +      } else {
  63.673 +	/* It doesn't fit in memory, create backing store. */
  63.674 +	bptr->rows_in_mem = (JDIMENSION) (max_minheights * bptr->maxaccess);
  63.675 +	jpeg_open_backing_store(cinfo, & bptr->b_s_info,
  63.676 +				(long) bptr->rows_in_array *
  63.677 +				(long) bptr->blocksperrow *
  63.678 +				(long) SIZEOF(JBLOCK));
  63.679 +	bptr->b_s_open = TRUE;
  63.680 +      }
  63.681 +      bptr->mem_buffer = alloc_barray(cinfo, JPOOL_IMAGE,
  63.682 +				      bptr->blocksperrow, bptr->rows_in_mem);
  63.683 +      bptr->rowsperchunk = mem->last_rowsperchunk;
  63.684 +      bptr->cur_start_row = 0;
  63.685 +      bptr->first_undef_row = 0;
  63.686 +      bptr->dirty = FALSE;
  63.687 +    }
  63.688 +  }
  63.689 +}
  63.690 +
  63.691 +
  63.692 +LOCAL(void)
  63.693 +do_sarray_io (j_common_ptr cinfo, jvirt_sarray_ptr ptr, boolean writing)
  63.694 +/* Do backing store read or write of a virtual sample array */
  63.695 +{
  63.696 +  long bytesperrow, file_offset, byte_count, rows, thisrow, i;
  63.697 +
  63.698 +  bytesperrow = (long) ptr->samplesperrow * SIZEOF(JSAMPLE);
  63.699 +  file_offset = ptr->cur_start_row * bytesperrow;
  63.700 +  /* Loop to read or write each allocation chunk in mem_buffer */
  63.701 +  for (i = 0; i < (long) ptr->rows_in_mem; i += ptr->rowsperchunk) {
  63.702 +    /* One chunk, but check for short chunk at end of buffer */
  63.703 +    rows = MIN((long) ptr->rowsperchunk, (long) ptr->rows_in_mem - i);
  63.704 +    /* Transfer no more than is currently defined */
  63.705 +    thisrow = (long) ptr->cur_start_row + i;
  63.706 +    rows = MIN(rows, (long) ptr->first_undef_row - thisrow);
  63.707 +    /* Transfer no more than fits in file */
  63.708 +    rows = MIN(rows, (long) ptr->rows_in_array - thisrow);
  63.709 +    if (rows <= 0)		/* this chunk might be past end of file! */
  63.710 +      break;
  63.711 +    byte_count = rows * bytesperrow;
  63.712 +    if (writing)
  63.713 +      (*ptr->b_s_info.write_backing_store) (cinfo, & ptr->b_s_info,
  63.714 +					    (void FAR *) ptr->mem_buffer[i],
  63.715 +					    file_offset, byte_count);
  63.716 +    else
  63.717 +      (*ptr->b_s_info.read_backing_store) (cinfo, & ptr->b_s_info,
  63.718 +					   (void FAR *) ptr->mem_buffer[i],
  63.719 +					   file_offset, byte_count);
  63.720 +    file_offset += byte_count;
  63.721 +  }
  63.722 +}
  63.723 +
  63.724 +
  63.725 +LOCAL(void)
  63.726 +do_barray_io (j_common_ptr cinfo, jvirt_barray_ptr ptr, boolean writing)
  63.727 +/* Do backing store read or write of a virtual coefficient-block array */
  63.728 +{
  63.729 +  long bytesperrow, file_offset, byte_count, rows, thisrow, i;
  63.730 +
  63.731 +  bytesperrow = (long) ptr->blocksperrow * SIZEOF(JBLOCK);
  63.732 +  file_offset = ptr->cur_start_row * bytesperrow;
  63.733 +  /* Loop to read or write each allocation chunk in mem_buffer */
  63.734 +  for (i = 0; i < (long) ptr->rows_in_mem; i += ptr->rowsperchunk) {
  63.735 +    /* One chunk, but check for short chunk at end of buffer */
  63.736 +    rows = MIN((long) ptr->rowsperchunk, (long) ptr->rows_in_mem - i);
  63.737 +    /* Transfer no more than is currently defined */
  63.738 +    thisrow = (long) ptr->cur_start_row + i;
  63.739 +    rows = MIN(rows, (long) ptr->first_undef_row - thisrow);
  63.740 +    /* Transfer no more than fits in file */
  63.741 +    rows = MIN(rows, (long) ptr->rows_in_array - thisrow);
  63.742 +    if (rows <= 0)		/* this chunk might be past end of file! */
  63.743 +      break;
  63.744 +    byte_count = rows * bytesperrow;
  63.745 +    if (writing)
  63.746 +      (*ptr->b_s_info.write_backing_store) (cinfo, & ptr->b_s_info,
  63.747 +					    (void FAR *) ptr->mem_buffer[i],
  63.748 +					    file_offset, byte_count);
  63.749 +    else
  63.750 +      (*ptr->b_s_info.read_backing_store) (cinfo, & ptr->b_s_info,
  63.751 +					   (void FAR *) ptr->mem_buffer[i],
  63.752 +					   file_offset, byte_count);
  63.753 +    file_offset += byte_count;
  63.754 +  }
  63.755 +}
  63.756 +
  63.757 +
  63.758 +METHODDEF(JSAMPARRAY)
  63.759 +access_virt_sarray (j_common_ptr cinfo, jvirt_sarray_ptr ptr,
  63.760 +		    JDIMENSION start_row, JDIMENSION num_rows,
  63.761 +		    boolean writable)
  63.762 +/* Access the part of a virtual sample array starting at start_row */
  63.763 +/* and extending for num_rows rows.  writable is true if  */
  63.764 +/* caller intends to modify the accessed area. */
  63.765 +{
  63.766 +  JDIMENSION end_row = start_row + num_rows;
  63.767 +  JDIMENSION undef_row;
  63.768 +
  63.769 +  /* debugging check */
  63.770 +  if (end_row > ptr->rows_in_array || num_rows > ptr->maxaccess ||
  63.771 +      ptr->mem_buffer == NULL)
  63.772 +    ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);
  63.773 +
  63.774 +  /* Make the desired part of the virtual array accessible */
  63.775 +  if (start_row < ptr->cur_start_row ||
  63.776 +      end_row > ptr->cur_start_row+ptr->rows_in_mem) {
  63.777 +    if (! ptr->b_s_open)
  63.778 +      ERREXIT(cinfo, JERR_VIRTUAL_BUG);
  63.779 +    /* Flush old buffer contents if necessary */
  63.780 +    if (ptr->dirty) {
  63.781 +      do_sarray_io(cinfo, ptr, TRUE);
  63.782 +      ptr->dirty = FALSE;
  63.783 +    }
  63.784 +    /* Decide what part of virtual array to access.
  63.785 +     * Algorithm: if target address > current window, assume forward scan,
  63.786 +     * load starting at target address.  If target address < current window,
  63.787 +     * assume backward scan, load so that target area is top of window.
  63.788 +     * Note that when switching from forward write to forward read, will have
  63.789 +     * start_row = 0, so the limiting case applies and we load from 0 anyway.
  63.790 +     */
  63.791 +    if (start_row > ptr->cur_start_row) {
  63.792 +      ptr->cur_start_row = start_row;
  63.793 +    } else {
  63.794 +      /* use long arithmetic here to avoid overflow & unsigned problems */
  63.795 +      long ltemp;
  63.796 +
  63.797 +      ltemp = (long) end_row - (long) ptr->rows_in_mem;
  63.798 +      if (ltemp < 0)
  63.799 +	ltemp = 0;		/* don't fall off front end of file */
  63.800 +      ptr->cur_start_row = (JDIMENSION) ltemp;
  63.801 +    }
  63.802 +    /* Read in the selected part of the array.
  63.803 +     * During the initial write pass, we will do no actual read
  63.804 +     * because the selected part is all undefined.
  63.805 +     */
  63.806 +    do_sarray_io(cinfo, ptr, FALSE);
  63.807 +  }
  63.808 +  /* Ensure the accessed part of the array is defined; prezero if needed.
  63.809 +   * To improve locality of access, we only prezero the part of the array
  63.810 +   * that the caller is about to access, not the entire in-memory array.
  63.811 +   */
  63.812 +  if (ptr->first_undef_row < end_row) {
  63.813 +    if (ptr->first_undef_row < start_row) {
  63.814 +      if (writable)		/* writer skipped over a section of array */
  63.815 +	ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);
  63.816 +      undef_row = start_row;	/* but reader is allowed to read ahead */
  63.817 +    } else {
  63.818 +      undef_row = ptr->first_undef_row;
  63.819 +    }
  63.820 +    if (writable)
  63.821 +      ptr->first_undef_row = end_row;
  63.822 +    if (ptr->pre_zero) {
  63.823 +      size_t bytesperrow = (size_t) ptr->samplesperrow * SIZEOF(JSAMPLE);
  63.824 +      undef_row -= ptr->cur_start_row; /* make indexes relative to buffer */
  63.825 +      end_row -= ptr->cur_start_row;
  63.826 +      while (undef_row < end_row) {
  63.827 +	jzero_far((void FAR *) ptr->mem_buffer[undef_row], bytesperrow);
  63.828 +	undef_row++;
  63.829 +      }
  63.830 +    } else {
  63.831 +      if (! writable)		/* reader looking at undefined data */
  63.832 +	ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);
  63.833 +    }
  63.834 +  }
  63.835 +  /* Flag the buffer dirty if caller will write in it */
  63.836 +  if (writable)
  63.837 +    ptr->dirty = TRUE;
  63.838 +  /* Return address of proper part of the buffer */
  63.839 +  return ptr->mem_buffer + (start_row - ptr->cur_start_row);
  63.840 +}
  63.841 +
  63.842 +
  63.843 +METHODDEF(JBLOCKARRAY)
  63.844 +access_virt_barray (j_common_ptr cinfo, jvirt_barray_ptr ptr,
  63.845 +		    JDIMENSION start_row, JDIMENSION num_rows,
  63.846 +		    boolean writable)
  63.847 +/* Access the part of a virtual block array starting at start_row */
  63.848 +/* and extending for num_rows rows.  writable is true if  */
  63.849 +/* caller intends to modify the accessed area. */
  63.850 +{
  63.851 +  JDIMENSION end_row = start_row + num_rows;
  63.852 +  JDIMENSION undef_row;
  63.853 +
  63.854 +  /* debugging check */
  63.855 +  if (end_row > ptr->rows_in_array || num_rows > ptr->maxaccess ||
  63.856 +      ptr->mem_buffer == NULL)
  63.857 +    ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);
  63.858 +
  63.859 +  /* Make the desired part of the virtual array accessible */
  63.860 +  if (start_row < ptr->cur_start_row ||
  63.861 +      end_row > ptr->cur_start_row+ptr->rows_in_mem) {
  63.862 +    if (! ptr->b_s_open)
  63.863 +      ERREXIT(cinfo, JERR_VIRTUAL_BUG);
  63.864 +    /* Flush old buffer contents if necessary */
  63.865 +    if (ptr->dirty) {
  63.866 +      do_barray_io(cinfo, ptr, TRUE);
  63.867 +      ptr->dirty = FALSE;
  63.868 +    }
  63.869 +    /* Decide what part of virtual array to access.
  63.870 +     * Algorithm: if target address > current window, assume forward scan,
  63.871 +     * load starting at target address.  If target address < current window,
  63.872 +     * assume backward scan, load so that target area is top of window.
  63.873 +     * Note that when switching from forward write to forward read, will have
  63.874 +     * start_row = 0, so the limiting case applies and we load from 0 anyway.
  63.875 +     */
  63.876 +    if (start_row > ptr->cur_start_row) {
  63.877 +      ptr->cur_start_row = start_row;
  63.878 +    } else {
  63.879 +      /* use long arithmetic here to avoid overflow & unsigned problems */
  63.880 +      long ltemp;
  63.881 +
  63.882 +      ltemp = (long) end_row - (long) ptr->rows_in_mem;
  63.883 +      if (ltemp < 0)
  63.884 +	ltemp = 0;		/* don't fall off front end of file */
  63.885 +      ptr->cur_start_row = (JDIMENSION) ltemp;
  63.886 +    }
  63.887 +    /* Read in the selected part of the array.
  63.888 +     * During the initial write pass, we will do no actual read
  63.889 +     * because the selected part is all undefined.
  63.890 +     */
  63.891 +    do_barray_io(cinfo, ptr, FALSE);
  63.892 +  }
  63.893 +  /* Ensure the accessed part of the array is defined; prezero if needed.
  63.894 +   * To improve locality of access, we only prezero the part of the array
  63.895 +   * that the caller is about to access, not the entire in-memory array.
  63.896 +   */
  63.897 +  if (ptr->first_undef_row < end_row) {
  63.898 +    if (ptr->first_undef_row < start_row) {
  63.899 +      if (writable)		/* writer skipped over a section of array */
  63.900 +	ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);
  63.901 +      undef_row = start_row;	/* but reader is allowed to read ahead */
  63.902 +    } else {
  63.903 +      undef_row = ptr->first_undef_row;
  63.904 +    }
  63.905 +    if (writable)
  63.906 +      ptr->first_undef_row = end_row;
  63.907 +    if (ptr->pre_zero) {
  63.908 +      size_t bytesperrow = (size_t) ptr->blocksperrow * SIZEOF(JBLOCK);
  63.909 +      undef_row -= ptr->cur_start_row; /* make indexes relative to buffer */
  63.910 +      end_row -= ptr->cur_start_row;
  63.911 +      while (undef_row < end_row) {
  63.912 +	jzero_far((void FAR *) ptr->mem_buffer[undef_row], bytesperrow);
  63.913 +	undef_row++;
  63.914 +      }
  63.915 +    } else {
  63.916 +      if (! writable)		/* reader looking at undefined data */
  63.917 +	ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);
  63.918 +    }
  63.919 +  }
  63.920 +  /* Flag the buffer dirty if caller will write in it */
  63.921 +  if (writable)
  63.922 +    ptr->dirty = TRUE;
  63.923 +  /* Return address of proper part of the buffer */
  63.924 +  return ptr->mem_buffer + (start_row - ptr->cur_start_row);
  63.925 +}
  63.926 +
  63.927 +
  63.928 +/*
  63.929 + * Release all objects belonging to a specified pool.
  63.930 + */
  63.931 +
  63.932 +METHODDEF(void)
  63.933 +free_pool (j_common_ptr cinfo, int pool_id)
  63.934 +{
  63.935 +  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
  63.936 +  small_pool_ptr shdr_ptr;
  63.937 +  large_pool_ptr lhdr_ptr;
  63.938 +  size_t space_freed;
  63.939 +
  63.940 +  if (pool_id < 0 || pool_id >= JPOOL_NUMPOOLS)
  63.941 +    ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id);	/* safety check */
  63.942 +
  63.943 +#ifdef MEM_STATS
  63.944 +  if (cinfo->err->trace_level > 1)
  63.945 +    print_mem_stats(cinfo, pool_id); /* print pool's memory usage statistics */
  63.946 +#endif
  63.947 +
  63.948 +  /* If freeing IMAGE pool, close any virtual arrays first */
  63.949 +  if (pool_id == JPOOL_IMAGE) {
  63.950 +    jvirt_sarray_ptr sptr;
  63.951 +    jvirt_barray_ptr bptr;
  63.952 +
  63.953 +    for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) {
  63.954 +      if (sptr->b_s_open) {	/* there may be no backing store */
  63.955 +	sptr->b_s_open = FALSE;	/* prevent recursive close if error */
  63.956 +	(*sptr->b_s_info.close_backing_store) (cinfo, & sptr->b_s_info);
  63.957 +      }
  63.958 +    }
  63.959 +    mem->virt_sarray_list = NULL;
  63.960 +    for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) {
  63.961 +      if (bptr->b_s_open) {	/* there may be no backing store */
  63.962 +	bptr->b_s_open = FALSE;	/* prevent recursive close if error */
  63.963 +	(*bptr->b_s_info.close_backing_store) (cinfo, & bptr->b_s_info);
  63.964 +      }
  63.965 +    }
  63.966 +    mem->virt_barray_list = NULL;
  63.967 +  }
  63.968 +
  63.969 +  /* Release large objects */
  63.970 +  lhdr_ptr = mem->large_list[pool_id];
  63.971 +  mem->large_list[pool_id] = NULL;
  63.972 +
  63.973 +  while (lhdr_ptr != NULL) {
  63.974 +    large_pool_ptr next_lhdr_ptr = lhdr_ptr->hdr.next;
  63.975 +    space_freed = lhdr_ptr->hdr.bytes_used +
  63.976 +		  lhdr_ptr->hdr.bytes_left +
  63.977 +		  SIZEOF(large_pool_hdr);
  63.978 +    jpeg_free_large(cinfo, (void FAR *) lhdr_ptr, space_freed);
  63.979 +    mem->total_space_allocated -= space_freed;
  63.980 +    lhdr_ptr = next_lhdr_ptr;
  63.981 +  }
  63.982 +
  63.983 +  /* Release small objects */
  63.984 +  shdr_ptr = mem->small_list[pool_id];
  63.985 +  mem->small_list[pool_id] = NULL;
  63.986 +
  63.987 +  while (shdr_ptr != NULL) {
  63.988 +    small_pool_ptr next_shdr_ptr = shdr_ptr->hdr.next;
  63.989 +    space_freed = shdr_ptr->hdr.bytes_used +
  63.990 +		  shdr_ptr->hdr.bytes_left +
  63.991 +		  SIZEOF(small_pool_hdr);
  63.992 +    jpeg_free_small(cinfo, (void *) shdr_ptr, space_freed);
  63.993 +    mem->total_space_allocated -= space_freed;
  63.994 +    shdr_ptr = next_shdr_ptr;
  63.995 +  }
  63.996 +}
  63.997 +
  63.998 +
  63.999 +/*
 63.1000 + * Close up shop entirely.
 63.1001 + * Note that this cannot be called unless cinfo->mem is non-NULL.
 63.1002 + */
 63.1003 +
 63.1004 +METHODDEF(void)
 63.1005 +self_destruct (j_common_ptr cinfo)
 63.1006 +{
 63.1007 +  int pool;
 63.1008 +
 63.1009 +  /* Close all backing store, release all memory.
 63.1010 +   * Releasing pools in reverse order might help avoid fragmentation
 63.1011 +   * with some (brain-damaged) malloc libraries.
 63.1012 +   */
 63.1013 +  for (pool = JPOOL_NUMPOOLS-1; pool >= JPOOL_PERMANENT; pool--) {
 63.1014 +    free_pool(cinfo, pool);
 63.1015 +  }
 63.1016 +
 63.1017 +  /* Release the memory manager control block too. */
 63.1018 +  jpeg_free_small(cinfo, (void *) cinfo->mem, SIZEOF(my_memory_mgr));
 63.1019 +  cinfo->mem = NULL;		/* ensures I will be called only once */
 63.1020 +
 63.1021 +  jpeg_mem_term(cinfo);		/* system-dependent cleanup */
 63.1022 +}
 63.1023 +
 63.1024 +
 63.1025 +/*
 63.1026 + * Memory manager initialization.
 63.1027 + * When this is called, only the error manager pointer is valid in cinfo!
 63.1028 + */
 63.1029 +
 63.1030 +GLOBAL(void)
 63.1031 +jinit_memory_mgr (j_common_ptr cinfo)
 63.1032 +{
 63.1033 +  my_mem_ptr mem;
 63.1034 +  long max_to_use;
 63.1035 +  int pool;
 63.1036 +  size_t test_mac;
 63.1037 +
 63.1038 +  cinfo->mem = NULL;		/* for safety if init fails */
 63.1039 +
 63.1040 +  /* Check for configuration errors.
 63.1041 +   * SIZEOF(ALIGN_TYPE) should be a power of 2; otherwise, it probably
 63.1042 +   * doesn't reflect any real hardware alignment requirement.
 63.1043 +   * The test is a little tricky: for X>0, X and X-1 have no one-bits
 63.1044 +   * in common if and only if X is a power of 2, ie has only one one-bit.
 63.1045 +   * Some compilers may give an "unreachable code" warning here; ignore it.
 63.1046 +   */
 63.1047 +  if ((SIZEOF(ALIGN_TYPE) & (SIZEOF(ALIGN_TYPE)-1)) != 0)
 63.1048 +    ERREXIT(cinfo, JERR_BAD_ALIGN_TYPE);
 63.1049 +  /* MAX_ALLOC_CHUNK must be representable as type size_t, and must be
 63.1050 +   * a multiple of SIZEOF(ALIGN_TYPE).
 63.1051 +   * Again, an "unreachable code" warning may be ignored here.
 63.1052 +   * But a "constant too large" warning means you need to fix MAX_ALLOC_CHUNK.
 63.1053 +   */
 63.1054 +  test_mac = (size_t) MAX_ALLOC_CHUNK;
 63.1055 +  if ((long) test_mac != MAX_ALLOC_CHUNK ||
 63.1056 +      (MAX_ALLOC_CHUNK % SIZEOF(ALIGN_TYPE)) != 0)
 63.1057 +    ERREXIT(cinfo, JERR_BAD_ALLOC_CHUNK);
 63.1058 +
 63.1059 +  max_to_use = jpeg_mem_init(cinfo); /* system-dependent initialization */
 63.1060 +
 63.1061 +  /* Attempt to allocate memory manager's control block */
 63.1062 +  mem = (my_mem_ptr) jpeg_get_small(cinfo, SIZEOF(my_memory_mgr));
 63.1063 +
 63.1064 +  if (mem == NULL) {
 63.1065 +    jpeg_mem_term(cinfo);	/* system-dependent cleanup */
 63.1066 +    ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 0);
 63.1067 +  }
 63.1068 +
 63.1069 +  /* OK, fill in the method pointers */
 63.1070 +  mem->pub.alloc_small = alloc_small;
 63.1071 +  mem->pub.alloc_large = alloc_large;
 63.1072 +  mem->pub.alloc_sarray = alloc_sarray;
 63.1073 +  mem->pub.alloc_barray = alloc_barray;
 63.1074 +  mem->pub.request_virt_sarray = request_virt_sarray;
 63.1075 +  mem->pub.request_virt_barray = request_virt_barray;
 63.1076 +  mem->pub.realize_virt_arrays = realize_virt_arrays;
 63.1077 +  mem->pub.access_virt_sarray = access_virt_sarray;
 63.1078 +  mem->pub.access_virt_barray = access_virt_barray;
 63.1079 +  mem->pub.free_pool = free_pool;
 63.1080 +  mem->pub.self_destruct = self_destruct;
 63.1081 +
 63.1082 +  /* Make MAX_ALLOC_CHUNK accessible to other modules */
 63.1083 +  mem->pub.max_alloc_chunk = MAX_ALLOC_CHUNK;
 63.1084 +
 63.1085 +  /* Initialize working state */
 63.1086 +  mem->pub.max_memory_to_use = max_to_use;
 63.1087 +
 63.1088 +  for (pool = JPOOL_NUMPOOLS-1; pool >= JPOOL_PERMANENT; pool--) {
 63.1089 +    mem->small_list[pool] = NULL;
 63.1090 +    mem->large_list[pool] = NULL;
 63.1091 +  }
 63.1092 +  mem->virt_sarray_list = NULL;
 63.1093 +  mem->virt_barray_list = NULL;
 63.1094 +
 63.1095 +  mem->total_space_allocated = SIZEOF(my_memory_mgr);
 63.1096 +
 63.1097 +  /* Declare ourselves open for business */
 63.1098 +  cinfo->mem = & mem->pub;
 63.1099 +
 63.1100 +  /* Check for an environment variable JPEGMEM; if found, override the
 63.1101 +   * default max_memory setting from jpeg_mem_init.  Note that the
 63.1102 +   * surrounding application may again override this value.
 63.1103 +   * If your system doesn't support getenv(), define NO_GETENV to disable
 63.1104 +   * this feature.
 63.1105 +   */
 63.1106 +#ifndef NO_GETENV
 63.1107 +  { char * memenv;
 63.1108 +
 63.1109 +    if ((memenv = getenv("JPEGMEM")) != NULL) {
 63.1110 +      char ch = 'x';
 63.1111 +
 63.1112 +      if (sscanf(memenv, "%ld%c", &max_to_use, &ch) > 0) {
 63.1113 +	if (ch == 'm' || ch == 'M')
 63.1114 +	  max_to_use *= 1000L;
 63.1115 +	mem->pub.max_memory_to_use = max_to_use * 1000L;
 63.1116 +      }
 63.1117 +    }
 63.1118 +  }
 63.1119 +#endif
 63.1120 +
 63.1121 +}
    64.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    64.2 +++ b/libs/libjpeg/jmemnobs.c	Sun Nov 01 00:36:56 2015 +0200
    64.3 @@ -0,0 +1,109 @@
    64.4 +/*
    64.5 + * jmemnobs.c
    64.6 + *
    64.7 + * Copyright (C) 1992-1996, Thomas G. Lane.
    64.8 + * This file is part of the Independent JPEG Group's software.
    64.9 + * For conditions of distribution and use, see the accompanying README file.
   64.10 + *
   64.11 + * This file provides a really simple implementation of the system-
   64.12 + * dependent portion of the JPEG memory manager.  This implementation
   64.13 + * assumes that no backing-store files are needed: all required space
   64.14 + * can be obtained from malloc().
   64.15 + * This is very portable in the sense that it'll compile on almost anything,
   64.16 + * but you'd better have lots of main memory (or virtual memory) if you want
   64.17 + * to process big images.
   64.18 + * Note that the max_memory_to_use option is ignored by this implementation.
   64.19 + */
   64.20 +
   64.21 +#define JPEG_INTERNALS
   64.22 +#include "jinclude.h"
   64.23 +#include "jpeglib.h"
   64.24 +#include "jmemsys.h"		/* import the system-dependent declarations */
   64.25 +
   64.26 +#ifndef HAVE_STDLIB_H		/* <stdlib.h> should declare malloc(),free() */
   64.27 +extern void * malloc JPP((size_t size));
   64.28 +extern void free JPP((void *ptr));
   64.29 +#endif
   64.30 +
   64.31 +
   64.32 +/*
   64.33 + * Memory allocation and freeing are controlled by the regular library
   64.34 + * routines malloc() and free().
   64.35 + */
   64.36 +
   64.37 +GLOBAL(void *)
   64.38 +jpeg_get_small (j_common_ptr cinfo, size_t sizeofobject)
   64.39 +{
   64.40 +  return (void *) malloc(sizeofobject);
   64.41 +}
   64.42 +
   64.43 +GLOBAL(void)
   64.44 +jpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject)
   64.45 +{
   64.46 +  free(object);
   64.47 +}
   64.48 +
   64.49 +
   64.50 +/*
   64.51 + * "Large" objects are treated the same as "small" ones.
   64.52 + * NB: although we include FAR keywords in the routine declarations,
   64.53 + * this file won't actually work in 80x86 small/medium model; at least,
   64.54 + * you probably won't be able to process useful-size images in only 64KB.
   64.55 + */
   64.56 +
   64.57 +GLOBAL(void FAR *)
   64.58 +jpeg_get_large (j_common_ptr cinfo, size_t sizeofobject)
   64.59 +{
   64.60 +  return (void FAR *) malloc(sizeofobject);
   64.61 +}
   64.62 +
   64.63 +GLOBAL(void)
   64.64 +jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject)
   64.65 +{
   64.66 +  free(object);
   64.67 +}
   64.68 +
   64.69 +
   64.70 +/*
   64.71 + * This routine computes the total memory space available for allocation.
   64.72 + * Here we always say, "we got all you want bud!"
   64.73 + */
   64.74 +
   64.75 +GLOBAL(long)
   64.76 +jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed,
   64.77 +		    long max_bytes_needed, long already_allocated)
   64.78 +{
   64.79 +  return max_bytes_needed;
   64.80 +}
   64.81 +
   64.82 +
   64.83 +/*
   64.84 + * Backing store (temporary file) management.
   64.85 + * Since jpeg_mem_available always promised the moon,
   64.86 + * this should never be called and we can just error out.
   64.87 + */
   64.88 +
   64.89 +GLOBAL(void)
   64.90 +jpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info,
   64.91 +			 long total_bytes_needed)
   64.92 +{
   64.93 +  ERREXIT(cinfo, JERR_NO_BACKING_STORE);
   64.94 +}
   64.95 +
   64.96 +
   64.97 +/*
   64.98 + * These routines take care of any system-dependent initialization and
   64.99 + * cleanup required.  Here, there isn't any.
  64.100 + */
  64.101 +
  64.102 +GLOBAL(long)
  64.103 +jpeg_mem_init (j_common_ptr cinfo)
  64.104 +{
  64.105 +  return 0;			/* just set max_memory_to_use to 0 */
  64.106 +}
  64.107 +
  64.108 +GLOBAL(void)
  64.109 +jpeg_mem_term (j_common_ptr cinfo)
  64.110 +{
  64.111 +  /* no work */
  64.112 +}
    65.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    65.2 +++ b/libs/libjpeg/jmemsys.h	Sun Nov 01 00:36:56 2015 +0200
    65.3 @@ -0,0 +1,198 @@
    65.4 +/*
    65.5 + * jmemsys.h
    65.6 + *
    65.7 + * Copyright (C) 1992-1997, Thomas G. Lane.
    65.8 + * This file is part of the Independent JPEG Group's software.
    65.9 + * For conditions of distribution and use, see the accompanying README file.
   65.10 + *
   65.11 + * This include file defines the interface between the system-independent
   65.12 + * and system-dependent portions of the JPEG memory manager.  No other
   65.13 + * modules need include it.  (The system-independent portion is jmemmgr.c;
   65.14 + * there are several different versions of the system-dependent portion.)
   65.15 + *
   65.16 + * This file works as-is for the system-dependent memory managers supplied
   65.17 + * in the IJG distribution.  You may need to modify it if you write a
   65.18 + * custom memory manager.  If system-dependent changes are needed in
   65.19 + * this file, the best method is to #ifdef them based on a configuration
   65.20 + * symbol supplied in jconfig.h, as we have done with USE_MSDOS_MEMMGR
   65.21 + * and USE_MAC_MEMMGR.
   65.22 + */
   65.23 +
   65.24 +
   65.25 +/* Short forms of external names for systems with brain-damaged linkers. */
   65.26 +
   65.27 +#ifdef NEED_SHORT_EXTERNAL_NAMES
   65.28 +#define jpeg_get_small		jGetSmall
   65.29 +#define jpeg_free_small		jFreeSmall
   65.30 +#define jpeg_get_large		jGetLarge
   65.31 +#define jpeg_free_large		jFreeLarge
   65.32 +#define jpeg_mem_available	jMemAvail
   65.33 +#define jpeg_open_backing_store	jOpenBackStore
   65.34 +#define jpeg_mem_init		jMemInit
   65.35 +#define jpeg_mem_term		jMemTerm
   65.36 +#endif /* NEED_SHORT_EXTERNAL_NAMES */
   65.37 +
   65.38 +
   65.39 +/*
   65.40 + * These two functions are used to allocate and release small chunks of
   65.41 + * memory.  (Typically the total amount requested through jpeg_get_small is
   65.42 + * no more than 20K or so; this will be requested in chunks of a few K each.)
   65.43 + * Behavior should be the same as for the standard library functions malloc
   65.44 + * and free; in particular, jpeg_get_small must return NULL on failure.
   65.45 + * On most systems, these ARE malloc and free.  jpeg_free_small is passed the
   65.46 + * size of the object being freed, just in case it's needed.
   65.47 + * On an 80x86 machine using small-data memory model, these manage near heap.
   65.48 + */
   65.49 +
   65.50 +EXTERN(void *) jpeg_get_small JPP((j_common_ptr cinfo, size_t sizeofobject));
   65.51 +EXTERN(void) jpeg_free_small JPP((j_common_ptr cinfo, void * object,
   65.52 +				  size_t sizeofobject));
   65.53 +
   65.54 +/*
   65.55 + * These two functions are used to allocate and release large chunks of
   65.56 + * memory (up to the total free space designated by jpeg_mem_available).
   65.57 + * The interface is the same as above, except that on an 80x86 machine,
   65.58 + * far pointers are used.  On most other machines these are identical to
   65.59 + * the jpeg_get/free_small routines; but we keep them separate anyway,
   65.60 + * in case a different allocation strategy is desirable for large chunks.
   65.61 + */
   65.62 +
   65.63 +EXTERN(void FAR *) jpeg_get_large JPP((j_common_ptr cinfo,
   65.64 +				       size_t sizeofobject));
   65.65 +EXTERN(void) jpeg_free_large JPP((j_common_ptr cinfo, void FAR * object,
   65.66 +				  size_t sizeofobject));
   65.67 +
   65.68 +/*
   65.69 + * The macro MAX_ALLOC_CHUNK designates the maximum number of bytes that may
   65.70 + * be requested in a single call to jpeg_get_large (and jpeg_get_small for that
   65.71 + * matter, but that case should never come into play).  This macro is needed
   65.72 + * to model the 64Kb-segment-size limit of far addressing on 80x86 machines.
   65.73 + * On those machines, we expect that jconfig.h will provide a proper value.
   65.74 + * On machines with 32-bit flat address spaces, any large constant may be used.
   65.75 + *
   65.76 + * NB: jmemmgr.c expects that MAX_ALLOC_CHUNK will be representable as type
   65.77 + * size_t and will be a multiple of sizeof(align_type).
   65.78 + */
   65.79 +
   65.80 +#ifndef MAX_ALLOC_CHUNK		/* may be overridden in jconfig.h */
   65.81 +#define MAX_ALLOC_CHUNK  1000000000L
   65.82 +#endif
   65.83 +
   65.84 +/*
   65.85 + * This routine computes the total space still available for allocation by
   65.86 + * jpeg_get_large.  If more space than this is needed, backing store will be
   65.87 + * used.  NOTE: any memory already allocated must not be counted.
   65.88 + *
   65.89 + * There is a minimum space requirement, corresponding to the minimum
   65.90 + * feasible buffer sizes; jmemmgr.c will request that much space even if
   65.91 + * jpeg_mem_available returns zero.  The maximum space needed, enough to hold
   65.92 + * all working storage in memory, is also passed in case it is useful.
   65.93 + * Finally, the total space already allocated is passed.  If no better
   65.94 + * method is available, cinfo->mem->max_memory_to_use - already_allocated
   65.95 + * is often a suitable calculation.
   65.96 + *
   65.97 + * It is OK for jpeg_mem_available to underestimate the space available
   65.98 + * (that'll just lead to more backing-store access than is really necessary).
   65.99 + * However, an overestimate will lead to failure.  Hence it's wise to subtract
  65.100 + * a slop factor from the true available space.  5% should be enough.
  65.101 + *
  65.102 + * On machines with lots of virtual memory, any large constant may be returned.
  65.103 + * Conversely, zero may be returned to always use the minimum amount of memory.
  65.104 + */
  65.105 +
  65.106 +EXTERN(long) jpeg_mem_available JPP((j_common_ptr cinfo,
  65.107 +				     long min_bytes_needed,
  65.108 +				     long max_bytes_needed,
  65.109 +				     long already_allocated));
  65.110 +
  65.111 +
  65.112 +/*
  65.113 + * This structure holds whatever state is needed to access a single
  65.114 + * backing-store object.  The read/write/close method pointers are called
  65.115 + * by jmemmgr.c to manipulate the backing-store object; all other fields
  65.116 + * are private to the system-dependent backing store routines.
  65.117 + */
  65.118 +
  65.119 +#define TEMP_NAME_LENGTH   64	/* max length of a temporary file's name */
  65.120 +
  65.121 +
  65.122 +#ifdef USE_MSDOS_MEMMGR		/* DOS-specific junk */
  65.123 +
  65.124 +typedef unsigned short XMSH;	/* type of extended-memory handles */
  65.125 +typedef unsigned short EMSH;	/* type of expanded-memory handles */
  65.126 +
  65.127 +typedef union {
  65.128 +  short file_handle;		/* DOS file handle if it's a temp file */
  65.129 +  XMSH xms_handle;		/* handle if it's a chunk of XMS */
  65.130 +  EMSH ems_handle;		/* handle if it's a chunk of EMS */
  65.131 +} handle_union;
  65.132 +
  65.133 +#endif /* USE_MSDOS_MEMMGR */
  65.134 +
  65.135 +#ifdef USE_MAC_MEMMGR		/* Mac-specific junk */
  65.136 +#include <Files.h>
  65.137 +#endif /* USE_MAC_MEMMGR */
  65.138 +
  65.139 +
  65.140 +typedef struct backing_store_struct * backing_store_ptr;
  65.141 +
  65.142 +typedef struct backing_store_struct {
  65.143 +  /* Methods for reading/writing/closing this backing-store object */
  65.144 +  JMETHOD(void, read_backing_store, (j_common_ptr cinfo,
  65.145 +				     backing_store_ptr info,
  65.146 +				     void FAR * buffer_address,
  65.147 +				     long file_offset, long byte_count));
  65.148 +  JMETHOD(void, write_backing_store, (j_common_ptr cinfo,
  65.149 +				      backing_store_ptr info,
  65.150 +				      void FAR * buffer_address,
  65.151 +				      long file_offset, long byte_count));
  65.152 +  JMETHOD(void, close_backing_store, (j_common_ptr cinfo,
  65.153 +				      backing_store_ptr info));
  65.154 +
  65.155 +  /* Private fields for system-dependent backing-store management */
  65.156 +#ifdef USE_MSDOS_MEMMGR
  65.157 +  /* For the MS-DOS manager (jmemdos.c), we need: */
  65.158 +  handle_union handle;		/* reference to backing-store storage object */
  65.159 +  char temp_name[TEMP_NAME_LENGTH]; /* name if it's a file */
  65.160 +#else
  65.161 +#ifdef USE_MAC_MEMMGR
  65.162 +  /* For the Mac manager (jmemmac.c), we need: */
  65.163 +  short temp_file;		/* file reference number to temp file */
  65.164 +  FSSpec tempSpec;		/* the FSSpec for the temp file */
  65.165 +  char temp_name[TEMP_NAME_LENGTH]; /* name if it's a file */
  65.166 +#else
  65.167 +  /* For a typical implementation with temp files, we need: */
  65.168 +  FILE * temp_file;		/* stdio reference to temp file */
  65.169 +  char temp_name[TEMP_NAME_LENGTH]; /* name of temp file */
  65.170 +#endif
  65.171 +#endif
  65.172 +} backing_store_info;
  65.173 +
  65.174 +
  65.175 +/*
  65.176 + * Initial opening of a backing-store object.  This must fill in the
  65.177 + * read/write/close pointers in the object.  The read/write routines
  65.178 + * may take an error exit if the specified maximum file size is exceeded.
  65.179 + * (If jpeg_mem_available always returns a large value, this routine can
  65.180 + * just take an error exit.)
  65.181 + */
  65.182 +
  65.183 +EXTERN(void) jpeg_open_backing_store JPP((j_common_ptr cinfo,
  65.184 +					  backing_store_ptr info,
  65.185 +					  long total_bytes_needed));
  65.186 +
  65.187 +
  65.188 +/*
  65.189 + * These routines take care of any system-dependent initialization and
  65.190 + * cleanup required.  jpeg_mem_init will be called before anything is
  65.191 + * allocated (and, therefore, nothing in cinfo is of use except the error
  65.192 + * manager pointer).  It should return a suitable default value for
  65.193 + * max_memory_to_use; this may subsequently be overridden by the surrounding
  65.194 + * application.  (Note that max_memory_to_use is only important if
  65.195 + * jpeg_mem_available chooses to consult it ... no one else will.)
  65.196 + * jpeg_mem_term may assume that all requested memory has been freed and that
  65.197 + * all opened backing-store objects have been closed.
  65.198 + */
  65.199 +
  65.200 +EXTERN(long) jpeg_mem_init JPP((j_common_ptr cinfo));
  65.201 +EXTERN(void) jpeg_mem_term JPP((j_common_ptr cinfo));
    66.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    66.2 +++ b/libs/libjpeg/jmorecfg.h	Sun Nov 01 00:36:56 2015 +0200
    66.3 @@ -0,0 +1,367 @@
    66.4 +/*
    66.5 + * jmorecfg.h
    66.6 + *
    66.7 + * Copyright (C) 1991-1997, Thomas G. Lane.
    66.8 + * This file is part of the Independent JPEG Group's software.
    66.9 + * For conditions of distribution and use, see the accompanying README file.
   66.10 + *
   66.11 + * This file contains additional configuration options that customize the
   66.12 + * JPEG software for special applications or support machine-dependent
   66.13 + * optimizations.  Most users will not need to touch this file.
   66.14 + */
   66.15 +
   66.16 +
   66.17 +/*
   66.18 + * Define BITS_IN_JSAMPLE as either
   66.19 + *   8   for 8-bit sample values (the usual setting)
   66.20 + *   12  for 12-bit sample values
   66.21 + * Only 8 and 12 are legal data precisions for lossy JPEG according to the
   66.22 + * JPEG standard, and the IJG code does not support anything else!
   66.23 + * We do not support run-time selection of data precision, sorry.
   66.24 + */
   66.25 +
   66.26 +#define BITS_IN_JSAMPLE  8	/* use 8 or 12 */
   66.27 +
   66.28 +
   66.29 +/*
   66.30 + * Maximum number of components (color channels) allowed in JPEG image.
   66.31 + * To meet the letter of the JPEG spec, set this to 255.  However, darn
   66.32 + * few applications need more than 4 channels (maybe 5 for CMYK + alpha
   66.33 + * mask).  We recommend 10 as a reasonable compromise; use 4 if you are
   66.34 + * really short on memory.  (Each allowed component costs a hundred or so
   66.35 + * bytes of storage, whether actually used in an image or not.)
   66.36 + */
   66.37 +
   66.38 +#define MAX_COMPONENTS  10	/* maximum number of image components */
   66.39 +
   66.40 +
   66.41 +/*
   66.42 + * Basic data types.
   66.43 + * You may need to change these if you have a machine with unusual data
   66.44 + * type sizes; for example, "char" not 8 bits, "short" not 16 bits,
   66.45 + * or "long" not 32 bits.  We don't care whether "int" is 16 or 32 bits,
   66.46 + * but it had better be at least 16.
   66.47 + */
   66.48 +
   66.49 +/* Representation of a single sample (pixel element value).
   66.50 + * We frequently allocate large arrays of these, so it's important to keep
   66.51 + * them small.  But if you have memory to burn and access to char or short
   66.52 + * arrays is very slow on your hardware, you might want to change these.
   66.53 + */
   66.54 +
   66.55 +#if BITS_IN_JSAMPLE == 8
   66.56 +/* JSAMPLE should be the smallest type that will hold the values 0..255.
   66.57 + * You can use a signed char by having GETJSAMPLE mask it with 0xFF.
   66.58 + */
   66.59 +
   66.60 +#ifdef HAVE_UNSIGNED_CHAR
   66.61 +
   66.62 +typedef unsigned char JSAMPLE;
   66.63 +#define GETJSAMPLE(value)  ((int) (value))
   66.64 +
   66.65 +#else /* not HAVE_UNSIGNED_CHAR */
   66.66 +
   66.67 +typedef char JSAMPLE;
   66.68 +#ifdef CHAR_IS_UNSIGNED
   66.69 +#define GETJSAMPLE(value)  ((int) (value))
   66.70 +#else
   66.71 +#define GETJSAMPLE(value)  ((int) (value) & 0xFF)
   66.72 +#endif /* CHAR_IS_UNSIGNED */
   66.73 +
   66.74 +#endif /* HAVE_UNSIGNED_CHAR */
   66.75 +
   66.76 +#define MAXJSAMPLE	255
   66.77 +#define CENTERJSAMPLE	128
   66.78 +
   66.79 +#endif /* BITS_IN_JSAMPLE == 8 */
   66.80 +
   66.81 +
   66.82 +#if BITS_IN_JSAMPLE == 12
   66.83 +/* JSAMPLE should be the smallest type that will hold the values 0..4095.
   66.84 + * On nearly all machines "short" will do nicely.
   66.85 + */
   66.86 +
   66.87 +typedef short JSAMPLE;
   66.88 +#define GETJSAMPLE(value)  ((int) (value))
   66.89 +
   66.90 +#define MAXJSAMPLE	4095
   66.91 +#define CENTERJSAMPLE	2048
   66.92 +
   66.93 +#endif /* BITS_IN_JSAMPLE == 12 */
   66.94 +
   66.95 +
   66.96 +/* Representation of a DCT frequency coefficient.
   66.97 + * This should be a signed value of at least 16 bits; "short" is usually OK.
   66.98 + * Again, we allocate large arrays of these, but you can change to int
   66.99 + * if you have memory to burn and "short" is really slow.
  66.100 + */
  66.101 +
  66.102 +typedef short JCOEF;
  66.103 +
  66.104 +
  66.105 +/* Compressed datastreams are represented as arrays of JOCTET.
  66.106 + * These must be EXACTLY 8 bits wide, at least once they are written to
  66.107 + * external storage.  Note that when using the stdio data source/destination
  66.108 + * managers, this is also the data type passed to fread/fwrite.
  66.109 + */
  66.110 +
  66.111 +#ifdef HAVE_UNSIGNED_CHAR
  66.112 +
  66.113 +typedef unsigned char JOCTET;
  66.114 +#define GETJOCTET(value)  (value)
  66.115 +
  66.116 +#else /* not HAVE_UNSIGNED_CHAR */
  66.117 +
  66.118 +typedef char JOCTET;
  66.119 +#ifdef CHAR_IS_UNSIGNED
  66.120 +#define GETJOCTET(value)  (value)
  66.121 +#else
  66.122 +#define GETJOCTET(value)  ((value) & 0xFF)
  66.123 +#endif /* CHAR_IS_UNSIGNED */
  66.124 +
  66.125 +#endif /* HAVE_UNSIGNED_CHAR */
  66.126 +
  66.127 +
  66.128 +/* These typedefs are used for various table entries and so forth.
  66.129 + * They must be at least as wide as specified; but making them too big
  66.130 + * won't cost a huge amount of memory, so we don't provide special
  66.131 + * extraction code like we did for JSAMPLE.  (In other words, these
  66.132 + * typedefs live at a different point on the speed/space tradeoff curve.)
  66.133 + */
  66.134 +
  66.135 +/* UINT8 must hold at least the values 0..255. */
  66.136 +
  66.137 +#ifdef HAVE_UNSIGNED_CHAR
  66.138 +typedef unsigned char UINT8;
  66.139 +#else /* not HAVE_UNSIGNED_CHAR */
  66.140 +#ifdef CHAR_IS_UNSIGNED
  66.141 +typedef char UINT8;
  66.142 +#else /* not CHAR_IS_UNSIGNED */
  66.143 +typedef short UINT8;
  66.144 +#endif /* CHAR_IS_UNSIGNED */
  66.145 +#endif /* HAVE_UNSIGNED_CHAR */
  66.146 +
  66.147 +/* UINT16 must hold at least the values 0..65535. */
  66.148 +
  66.149 +#ifdef HAVE_UNSIGNED_SHORT
  66.150 +typedef unsigned short UINT16;
  66.151 +#else /* not HAVE_UNSIGNED_SHORT */
  66.152 +typedef unsigned int UINT16;
  66.153 +#endif /* HAVE_UNSIGNED_SHORT */
  66.154 +
  66.155 +/* INT16 must hold at least the values -32768..32767. */
  66.156 +
  66.157 +#ifndef XMD_H			/* X11/xmd.h correctly defines INT16 */
  66.158 +typedef short INT16;
  66.159 +#endif
  66.160 +
  66.161 +/* INT32 must hold at least signed 32-bit values. */
  66.162 +
  66.163 +#ifndef XMD_H			/* X11/xmd.h correctly defines INT32 */
  66.164 +typedef int INT32;
  66.165 +#endif
  66.166 +
  66.167 +/* Datatype used for image dimensions.  The JPEG standard only supports
  66.168 + * images up to 64K*64K due to 16-bit fields in SOF markers.  Therefore
  66.169 + * "unsigned int" is sufficient on all machines.  However, if you need to
  66.170 + * handle larger images and you don't mind deviating from the spec, you
  66.171 + * can change this datatype.
  66.172 + */
  66.173 +
  66.174 +typedef unsigned int JDIMENSION;
  66.175 +
  66.176 +#define JPEG_MAX_DIMENSION  65500L  /* a tad under 64K to prevent overflows */
  66.177 +
  66.178 +
  66.179 +/* These macros are used in all function definitions and extern declarations.
  66.180 + * You could modify them if you need to change function linkage conventions;
  66.181 + * in particular, you'll need to do that to make the library a Windows DLL.
  66.182 + * Another application is to make all functions global for use with debuggers
  66.183 + * or code profilers that require it.
  66.184 + */
  66.185 +
  66.186 +/* a function called through method pointers: */
  66.187 +#define METHODDEF(type)		static type
  66.188 +/* a function used only in its module: */
  66.189 +#define LOCAL(type)		static type
  66.190 +/* a function referenced thru EXTERNs: */
  66.191 +#define GLOBAL(type)		type
  66.192 +/* a reference to a GLOBAL function: */
  66.193 +#define EXTERN(type)		extern type
  66.194 +
  66.195 +
  66.196 +/* This macro is used to declare a "method", that is, a function pointer.
  66.197 + * We want to supply prototype parameters if the compiler can cope.
  66.198 + * Note that the arglist parameter must be parenthesized!
  66.199 + * Again, you can customize this if you need special linkage keywords.
  66.200 + */
  66.201 +
  66.202 +#ifdef HAVE_PROTOTYPES
  66.203 +#define JMETHOD(type,methodname,arglist)  type (*methodname) arglist
  66.204 +#else
  66.205 +#define JMETHOD(type,methodname,arglist)  type (*methodname) ()
  66.206 +#endif
  66.207 +
  66.208 +
  66.209 +/* Here is the pseudo-keyword for declaring pointers that must be "far"
  66.210 + * on 80x86 machines.  Most of the specialized coding for 80x86 is handled
  66.211 + * by just saying "FAR *" where such a pointer is needed.  In a few places
  66.212 + * explicit coding is needed; see uses of the NEED_FAR_POINTERS symbol.
  66.213 + */
  66.214 +
  66.215 +#ifdef FAR
  66.216 +#undef FAR
  66.217 +#endif
  66.218 +
  66.219 +#ifdef NEED_FAR_POINTERS
  66.220 +#define FAR  far
  66.221 +#else
  66.222 +#define FAR
  66.223 +#endif
  66.224 +
  66.225 +
  66.226 +/*
  66.227 + * On a few systems, type boolean and/or its values FALSE, TRUE may appear
  66.228 + * in standard header files.  Or you may have conflicts with application-
  66.229 + * specific header files that you want to include together with these files.
  66.230 + * Defining HAVE_BOOLEAN before including jpeglib.h should make it work.
  66.231 + */
  66.232 +
  66.233 +#ifndef HAVE_BOOLEAN
  66.234 +typedef int boolean;
  66.235 +#endif
  66.236 +#ifndef FALSE			/* in case these macros already exist */
  66.237 +#define FALSE	0		/* values of boolean */
  66.238 +#endif
  66.239 +#ifndef TRUE
  66.240 +#define TRUE	1
  66.241 +#endif
  66.242 +
  66.243 +
  66.244 +/*
  66.245 + * The remaining options affect code selection within the JPEG library,
  66.246 + * but they don't need to be visible to most applications using the library.
  66.247 + * To minimize application namespace pollution, the symbols won't be
  66.248 + * defined unless JPEG_INTERNALS or JPEG_INTERNAL_OPTIONS has been defined.
  66.249 + */
  66.250 +
  66.251 +#ifdef JPEG_INTERNALS
  66.252 +#define JPEG_INTERNAL_OPTIONS
  66.253 +#endif
  66.254 +
  66.255 +#ifdef JPEG_INTERNAL_OPTIONS
  66.256 +
  66.257 +
  66.258 +/*
  66.259 + * These defines indicate whether to include various optional functions.
  66.260 + * Undefining some of these symbols will produce a smaller but less capable
  66.261 + * library.  Note that you can leave certain source files out of the
  66.262 + * compilation/linking process if you've #undef'd the corresponding symbols.
  66.263 + * (You may HAVE to do that if your compiler doesn't like null source files.)
  66.264 + */
  66.265 +
  66.266 +/* Arithmetic coding is unsupported for legal reasons.  Complaints to IBM. */
  66.267 +
  66.268 +/* Capability options common to encoder and decoder: */
  66.269 +
  66.270 +#define DCT_ISLOW_SUPPORTED	/* slow but accurate integer algorithm */
  66.271 +#define DCT_IFAST_SUPPORTED	/* faster, less accurate integer method */
  66.272 +#define DCT_FLOAT_SUPPORTED	/* floating-point: accurate, fast on fast HW */
  66.273 +
  66.274 +/* Encoder capability options: */
  66.275 +
  66.276 +#undef  C_ARITH_CODING_SUPPORTED    /* Arithmetic coding back end? */
  66.277 +#define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
  66.278 +#define C_PROGRESSIVE_SUPPORTED	    /* Progressive JPEG? (Requires MULTISCAN)*/
  66.279 +#define ENTROPY_OPT_SUPPORTED	    /* Optimization of entropy coding parms? */
  66.280 +/* Note: if you selected 12-bit data precision, it is dangerous to turn off
  66.281 + * ENTROPY_OPT_SUPPORTED.  The standard Huffman tables are only good for 8-bit
  66.282 + * precision, so jchuff.c normally uses entropy optimization to compute
  66.283 + * usable tables for higher precision.  If you don't want to do optimization,
  66.284 + * you'll have to supply different default Huffman tables.
  66.285 + * The exact same statements apply for progressive JPEG: the default tables
  66.286 + * don't work for progressive mode.  (This may get fixed, however.)
  66.287 + */
  66.288 +#define INPUT_SMOOTHING_SUPPORTED   /* Input image smoothing option? */
  66.289 +
  66.290 +/* Decoder capability options: */
  66.291 +
  66.292 +#undef  D_ARITH_CODING_SUPPORTED    /* Arithmetic coding back end? */
  66.293 +#define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
  66.294 +#define D_PROGRESSIVE_SUPPORTED	    /* Progressive JPEG? (Requires MULTISCAN)*/
  66.295 +#define SAVE_MARKERS_SUPPORTED	    /* jpeg_save_markers() needed? */
  66.296 +#define BLOCK_SMOOTHING_SUPPORTED   /* Block smoothing? (Progressive only) */
  66.297 +#define IDCT_SCALING_SUPPORTED	    /* Output rescaling via IDCT? */
  66.298 +#undef  UPSAMPLE_SCALING_SUPPORTED  /* Output rescaling at upsample stage? */
  66.299 +#define UPSAMPLE_MERGING_SUPPORTED  /* Fast path for sloppy upsampling? */
  66.300 +#define QUANT_1PASS_SUPPORTED	    /* 1-pass color quantization? */
  66.301 +#define QUANT_2PASS_SUPPORTED	    /* 2-pass color quantization? */
  66.302 +
  66.303 +/* more capability options later, no doubt */
  66.304 +
  66.305 +
  66.306 +/*
  66.307 + * Ordering of RGB data in scanlines passed to or from the application.
  66.308 + * If your application wants to deal with data in the order B,G,R, just
  66.309 + * change these macros.  You can also deal with formats such as R,G,B,X
  66.310 + * (one extra byte per pixel) by changing RGB_PIXELSIZE.  Note that changing
  66.311 + * the offsets will also change the order in which colormap data is organized.
  66.312 + * RESTRICTIONS:
  66.313 + * 1. The sample applications cjpeg,djpeg do NOT support modified RGB formats.
  66.314 + * 2. These macros only affect RGB<=>YCbCr color conversion, so they are not
  66.315 + *    useful if you are using JPEG color spaces other than YCbCr or grayscale.
  66.316 + * 3. The color quantizer modules will not behave desirably if RGB_PIXELSIZE
  66.317 + *    is not 3 (they don't understand about dummy color components!).  So you
  66.318 + *    can't use color quantization if you change that value.
  66.319 + */
  66.320 +
  66.321 +#define RGB_RED		0	/* Offset of Red in an RGB scanline element */
  66.322 +#define RGB_GREEN	1	/* Offset of Green */
  66.323 +#define RGB_BLUE	2	/* Offset of Blue */
  66.324 +#define RGB_PIXELSIZE	3	/* JSAMPLEs per RGB scanline element */
  66.325 +
  66.326 +
  66.327 +/* Definitions for speed-related optimizations. */
  66.328 +
  66.329 +
  66.330 +/* If your compiler supports inline functions, define INLINE
  66.331 + * as the inline keyword; otherwise define it as empty.
  66.332 + */
  66.333 +
  66.334 +#ifndef INLINE
  66.335 +#ifdef __GNUC__			/* for instance, GNU C knows about inline */
  66.336 +#define INLINE __inline__
  66.337 +#endif
  66.338 +#ifndef INLINE
  66.339 +#define INLINE			/* default is to define it as empty */
  66.340 +#endif
  66.341 +#endif
  66.342 +
  66.343 +
  66.344 +/* On some machines (notably 68000 series) "int" is 32 bits, but multiplying
  66.345 + * two 16-bit shorts is faster than multiplying two ints.  Define MULTIPLIER
  66.346 + * as short on such a machine.  MULTIPLIER must be at least 16 bits wide.
  66.347 + */
  66.348 +
  66.349 +#ifndef MULTIPLIER
  66.350 +#define MULTIPLIER  int		/* type for fastest integer multiply */
  66.351 +#endif
  66.352 +
  66.353 +
  66.354 +/* FAST_FLOAT should be either float or double, whichever is done faster
  66.355 + * by your compiler.  (Note that this type is only used in the floating point
  66.356 + * DCT routines, so it only matters if you've defined DCT_FLOAT_SUPPORTED.)
  66.357 + * Typically, float is faster in ANSI C compilers, while double is faster in
  66.358 + * pre-ANSI compilers (because they insist on converting to double anyway).
  66.359 + * The code below therefore chooses float if we have ANSI-style prototypes.
  66.360 + */
  66.361 +
  66.362 +#ifndef FAST_FLOAT
  66.363 +#ifdef HAVE_PROTOTYPES
  66.364 +#define FAST_FLOAT  float
  66.365 +#else
  66.366 +#define FAST_FLOAT  double
  66.367 +#endif
  66.368 +#endif
  66.369 +
  66.370 +#endif /* JPEG_INTERNAL_OPTIONS */
    67.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    67.2 +++ b/libs/libjpeg/jpegint.h	Sun Nov 01 00:36:56 2015 +0200
    67.3 @@ -0,0 +1,392 @@
    67.4 +/*
    67.5 + * jpegint.h
    67.6 + *
    67.7 + * Copyright (C) 1991-1997, Thomas G. Lane.
    67.8 + * This file is part of the Independent JPEG Group's software.
    67.9 + * For conditions of distribution and use, see the accompanying README file.
   67.10 + *
   67.11 + * This file provides common declarations for the various JPEG modules.
   67.12 + * These declarations are considered internal to the JPEG library; most
   67.13 + * applications using the library shouldn't need to include this file.
   67.14 + */
   67.15 +
   67.16 +
   67.17 +/* Declarations for both compression & decompression */
   67.18 +
   67.19 +typedef enum {			/* Operating modes for buffer controllers */
   67.20 +	JBUF_PASS_THRU,		/* Plain stripwise operation */
   67.21 +	/* Remaining modes require a full-image buffer to have been created */
   67.22 +	JBUF_SAVE_SOURCE,	/* Run source subobject only, save output */
   67.23 +	JBUF_CRANK_DEST,	/* Run dest subobject only, using saved data */
   67.24 +	JBUF_SAVE_AND_PASS	/* Run both subobjects, save output */
   67.25 +} J_BUF_MODE;
   67.26 +
   67.27 +/* Values of global_state field (jdapi.c has some dependencies on ordering!) */
   67.28 +#define CSTATE_START	100	/* after create_compress */
   67.29 +#define CSTATE_SCANNING	101	/* start_compress done, write_scanlines OK */
   67.30 +#define CSTATE_RAW_OK	102	/* start_compress done, write_raw_data OK */
   67.31 +#define CSTATE_WRCOEFS	103	/* jpeg_write_coefficients done */
   67.32 +#define DSTATE_START	200	/* after create_decompress */
   67.33 +#define DSTATE_INHEADER	201	/* reading header markers, no SOS yet */
   67.34 +#define DSTATE_READY	202	/* found SOS, ready for start_decompress */
   67.35 +#define DSTATE_PRELOAD	203	/* reading multiscan file in start_decompress*/
   67.36 +#define DSTATE_PRESCAN	204	/* performing dummy pass for 2-pass quant */
   67.37 +#define DSTATE_SCANNING	205	/* start_decompress done, read_scanlines OK */
   67.38 +#define DSTATE_RAW_OK	206	/* start_decompress done, read_raw_data OK */
   67.39 +#define DSTATE_BUFIMAGE	207	/* expecting jpeg_start_output */
   67.40 +#define DSTATE_BUFPOST	208	/* looking for SOS/EOI in jpeg_finish_output */
   67.41 +#define DSTATE_RDCOEFS	209	/* reading file in jpeg_read_coefficients */
   67.42 +#define DSTATE_STOPPING	210	/* looking for EOI in jpeg_finish_decompress */
   67.43 +
   67.44 +
   67.45 +/* Declarations for compression modules */
   67.46 +
   67.47 +/* Master control module */
   67.48 +struct jpeg_comp_master {
   67.49 +  JMETHOD(void, prepare_for_pass, (j_compress_ptr cinfo));
   67.50 +  JMETHOD(void, pass_startup, (j_compress_ptr cinfo));
   67.51 +  JMETHOD(void, finish_pass, (j_compress_ptr cinfo));
   67.52 +
   67.53 +  /* State variables made visible to other modules */
   67.54 +  boolean call_pass_startup;	/* True if pass_startup must be called */
   67.55 +  boolean is_last_pass;		/* True during last pass */
   67.56 +};
   67.57 +
   67.58 +/* Main buffer control (downsampled-data buffer) */
   67.59 +struct jpeg_c_main_controller {
   67.60 +  JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode));
   67.61 +  JMETHOD(void, process_data, (j_compress_ptr cinfo,
   67.62 +			       JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
   67.63 +			       JDIMENSION in_rows_avail));
   67.64 +};
   67.65 +
   67.66 +/* Compression preprocessing (downsampling input buffer control) */
   67.67 +struct jpeg_c_prep_controller {
   67.68 +  JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode));
   67.69 +  JMETHOD(void, pre_process_data, (j_compress_ptr cinfo,
   67.70 +				   JSAMPARRAY input_buf,
   67.71 +				   JDIMENSION *in_row_ctr,
   67.72 +				   JDIMENSION in_rows_avail,
   67.73 +				   JSAMPIMAGE output_buf,
   67.74 +				   JDIMENSION *out_row_group_ctr,
   67.75 +				   JDIMENSION out_row_groups_avail));
   67.76 +};
   67.77 +
   67.78 +/* Coefficient buffer control */
   67.79 +struct jpeg_c_coef_controller {
   67.80 +  JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode));
   67.81 +  JMETHOD(boolean, compress_data, (j_compress_ptr cinfo,
   67.82 +				   JSAMPIMAGE input_buf));
   67.83 +};
   67.84 +
   67.85 +/* Colorspace conversion */
   67.86 +struct jpeg_color_converter {
   67.87 +  JMETHOD(void, start_pass, (j_compress_ptr cinfo));
   67.88 +  JMETHOD(void, color_convert, (j_compress_ptr cinfo,
   67.89 +				JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
   67.90 +				JDIMENSION output_row, int num_rows));
   67.91 +};
   67.92 +
   67.93 +/* Downsampling */
   67.94 +struct jpeg_downsampler {
   67.95 +  JMETHOD(void, start_pass, (j_compress_ptr cinfo));
   67.96 +  JMETHOD(void, downsample, (j_compress_ptr cinfo,
   67.97 +			     JSAMPIMAGE input_buf, JDIMENSION in_row_index,
   67.98 +			     JSAMPIMAGE output_buf,
   67.99 +			     JDIMENSION out_row_group_index));
  67.100 +
  67.101 +  boolean need_context_rows;	/* TRUE if need rows above & below */
  67.102 +};
  67.103 +
  67.104 +/* Forward DCT (also controls coefficient quantization) */
  67.105 +struct jpeg_forward_dct {
  67.106 +  JMETHOD(void, start_pass, (j_compress_ptr cinfo));
  67.107 +  /* perhaps this should be an array??? */
  67.108 +  JMETHOD(void, forward_DCT, (j_compress_ptr cinfo,
  67.109 +			      jpeg_component_info * compptr,
  67.110 +			      JSAMPARRAY sample_data, JBLOCKROW coef_blocks,
  67.111 +			      JDIMENSION start_row, JDIMENSION start_col,
  67.112 +			      JDIMENSION num_blocks));
  67.113 +};
  67.114 +
  67.115 +/* Entropy encoding */
  67.116 +struct jpeg_entropy_encoder {
  67.117 +  JMETHOD(void, start_pass, (j_compress_ptr cinfo, boolean gather_statistics));
  67.118 +  JMETHOD(boolean, encode_mcu, (j_compress_ptr cinfo, JBLOCKROW *MCU_data));
  67.119 +  JMETHOD(void, finish_pass, (j_compress_ptr cinfo));
  67.120 +};
  67.121 +
  67.122 +/* Marker writing */
  67.123 +struct jpeg_marker_writer {
  67.124 +  JMETHOD(void, write_file_header, (j_compress_ptr cinfo));
  67.125 +  JMETHOD(void, write_frame_header, (j_compress_ptr cinfo));
  67.126 +  JMETHOD(void, write_scan_header, (j_compress_ptr cinfo));
  67.127 +  JMETHOD(void, write_file_trailer, (j_compress_ptr cinfo));
  67.128 +  JMETHOD(void, write_tables_only, (j_compress_ptr cinfo));
  67.129 +  /* These routines are exported to allow insertion of extra markers */
  67.130 +  /* Probably only COM and APPn markers should be written this way */
  67.131 +  JMETHOD(void, write_marker_header, (j_compress_ptr cinfo, int marker,
  67.132 +				      unsigned int datalen));
  67.133 +  JMETHOD(void, write_marker_byte, (j_compress_ptr cinfo, int val));
  67.134 +};
  67.135 +
  67.136 +
  67.137 +/* Declarations for decompression modules */
  67.138 +
  67.139 +/* Master control module */
  67.140 +struct jpeg_decomp_master {
  67.141 +  JMETHOD(void, prepare_for_output_pass, (j_decompress_ptr cinfo));
  67.142 +  JMETHOD(void, finish_output_pass, (j_decompress_ptr cinfo));
  67.143 +
  67.144 +  /* State variables made visible to other modules */
  67.145 +  boolean is_dummy_pass;	/* True during 1st pass for 2-pass quant */
  67.146 +};
  67.147 +
  67.148 +/* Input control module */
  67.149 +struct jpeg_input_controller {
  67.150 +  JMETHOD(int, consume_input, (j_decompress_ptr cinfo));
  67.151 +  JMETHOD(void, reset_input_controller, (j_decompress_ptr cinfo));
  67.152 +  JMETHOD(void, start_input_pass, (j_decompress_ptr cinfo));
  67.153 +  JMETHOD(void, finish_input_pass, (j_decompress_ptr cinfo));
  67.154 +
  67.155 +  /* State variables made visible to other modules */
  67.156 +  boolean has_multiple_scans;	/* True if file has multiple scans */
  67.157 +  boolean eoi_reached;		/* True when EOI has been consumed */
  67.158 +};
  67.159 +
  67.160 +/* Main buffer control (downsampled-data buffer) */
  67.161 +struct jpeg_d_main_controller {
  67.162 +  JMETHOD(void, start_pass, (j_decompress_ptr cinfo, J_BUF_MODE pass_mode));
  67.163 +  JMETHOD(void, process_data, (j_decompress_ptr cinfo,
  67.164 +			       JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
  67.165 +			       JDIMENSION out_rows_avail));
  67.166 +};
  67.167 +
  67.168 +/* Coefficient buffer control */
  67.169 +struct jpeg_d_coef_controller {
  67.170 +  JMETHOD(void, start_input_pass, (j_decompress_ptr cinfo));
  67.171 +  JMETHOD(int, consume_data, (j_decompress_ptr cinfo));
  67.172 +  JMETHOD(void, start_output_pass, (j_decompress_ptr cinfo));
  67.173 +  JMETHOD(int, decompress_data, (j_decompress_ptr cinfo,
  67.174 +				 JSAMPIMAGE output_buf));
  67.175 +  /* Pointer to array of coefficient virtual arrays, or NULL if none */
  67.176 +  jvirt_barray_ptr *coef_arrays;
  67.177 +};
  67.178 +
  67.179 +/* Decompression postprocessing (color quantization buffer control) */
  67.180 +struct jpeg_d_post_controller {
  67.181 +  JMETHOD(void, start_pass, (j_decompress_ptr cinfo, J_BUF_MODE pass_mode));
  67.182 +  JMETHOD(void, post_process_data, (j_decompress_ptr cinfo,
  67.183 +				    JSAMPIMAGE input_buf,
  67.184 +				    JDIMENSION *in_row_group_ctr,
  67.185 +				    JDIMENSION in_row_groups_avail,
  67.186 +				    JSAMPARRAY output_buf,
  67.187 +				    JDIMENSION *out_row_ctr,
  67.188 +				    JDIMENSION out_rows_avail));
  67.189 +};
  67.190 +
  67.191 +/* Marker reading & parsing */
  67.192 +struct jpeg_marker_reader {
  67.193 +  JMETHOD(void, reset_marker_reader, (j_decompress_ptr cinfo));
  67.194 +  /* Read markers until SOS or EOI.
  67.195 +   * Returns same codes as are defined for jpeg_consume_input:
  67.196 +   * JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI.
  67.197 +   */
  67.198 +  JMETHOD(int, read_markers, (j_decompress_ptr cinfo));
  67.199 +  /* Read a restart marker --- exported for use by entropy decoder only */
  67.200 +  jpeg_marker_parser_method read_restart_marker;
  67.201 +
  67.202 +  /* State of marker reader --- nominally internal, but applications
  67.203 +   * supplying COM or APPn handlers might like to know the state.
  67.204 +   */
  67.205 +  boolean saw_SOI;		/* found SOI? */
  67.206 +  boolean saw_SOF;		/* found SOF? */
  67.207 +  int next_restart_num;		/* next restart number expected (0-7) */
  67.208 +  unsigned int discarded_bytes;	/* # of bytes skipped looking for a marker */
  67.209 +};
  67.210 +
  67.211 +/* Entropy decoding */
  67.212 +struct jpeg_entropy_decoder {
  67.213 +  JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
  67.214 +  JMETHOD(boolean, decode_mcu, (j_decompress_ptr cinfo,
  67.215 +				JBLOCKROW *MCU_data));
  67.216 +
  67.217 +  /* This is here to share code between baseline and progressive decoders; */
  67.218 +  /* other modules probably should not use it */
  67.219 +  boolean insufficient_data;	/* set TRUE after emitting warning */
  67.220 +};
  67.221 +
  67.222 +/* Inverse DCT (also performs dequantization) */
  67.223 +typedef JMETHOD(void, inverse_DCT_method_ptr,
  67.224 +		(j_decompress_ptr cinfo, jpeg_component_info * compptr,
  67.225 +		 JCOEFPTR coef_block,
  67.226 +		 JSAMPARRAY output_buf, JDIMENSION output_col));
  67.227 +
  67.228 +struct jpeg_inverse_dct {
  67.229 +  JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
  67.230 +  /* It is useful to allow each component to have a separate IDCT method. */
  67.231 +  inverse_DCT_method_ptr inverse_DCT[MAX_COMPONENTS];
  67.232 +};
  67.233 +
  67.234 +/* Upsampling (note that upsampler must also call color converter) */
  67.235 +struct jpeg_upsampler {
  67.236 +  JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
  67.237 +  JMETHOD(void, upsample, (j_decompress_ptr cinfo,
  67.238 +			   JSAMPIMAGE input_buf,
  67.239 +			   JDIMENSION *in_row_group_ctr,
  67.240 +			   JDIMENSION in_row_groups_avail,
  67.241 +			   JSAMPARRAY output_buf,
  67.242 +			   JDIMENSION *out_row_ctr,
  67.243 +			   JDIMENSION out_rows_avail));
  67.244 +
  67.245 +  boolean need_context_rows;	/* TRUE if need rows above & below */
  67.246 +};
  67.247 +
  67.248 +/* Colorspace conversion */
  67.249 +struct jpeg_color_deconverter {
  67.250 +  JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
  67.251 +  JMETHOD(void, color_convert, (j_decompress_ptr cinfo,
  67.252 +				JSAMPIMAGE input_buf, JDIMENSION input_row,
  67.253 +				JSAMPARRAY output_buf, int num_rows));
  67.254 +};
  67.255 +
  67.256 +/* Color quantization or color precision reduction */
  67.257 +struct jpeg_color_quantizer {
  67.258 +  JMETHOD(void, start_pass, (j_decompress_ptr cinfo, boolean is_pre_scan));
  67.259 +  JMETHOD(void, color_quantize, (j_decompress_ptr cinfo,
  67.260 +				 JSAMPARRAY input_buf, JSAMPARRAY output_buf,
  67.261 +				 int num_rows));
  67.262 +  JMETHOD(void, finish_pass, (j_decompress_ptr cinfo));
  67.263 +  JMETHOD(void, new_color_map, (j_decompress_ptr cinfo));
  67.264 +};
  67.265 +
  67.266 +
  67.267 +/* Miscellaneous useful macros */
  67.268 +
  67.269 +#undef MAX
  67.270 +#define MAX(a,b)	((a) > (b) ? (a) : (b))
  67.271 +#undef MIN
  67.272 +#define MIN(a,b)	((a) < (b) ? (a) : (b))
  67.273 +
  67.274 +
  67.275 +/* We assume that right shift corresponds to signed division by 2 with
  67.276 + * rounding towards minus infinity.  This is correct for typical "arithmetic
  67.277 + * shift" instructions that shift in copies of the sign bit.  But some
  67.278 + * C compilers implement >> with an unsigned shift.  For these machines you
  67.279 + * must define RIGHT_SHIFT_IS_UNSIGNED.
  67.280 + * RIGHT_SHIFT provides a proper signed right shift of an INT32 quantity.
  67.281 + * It is only applied with constant shift counts.  SHIFT_TEMPS must be
  67.282 + * included in the variables of any routine using RIGHT_SHIFT.
  67.283 + */
  67.284 +
  67.285 +#ifdef RIGHT_SHIFT_IS_UNSIGNED
  67.286 +#define SHIFT_TEMPS	INT32 shift_temp;
  67.287 +#define RIGHT_SHIFT(x,shft)  \
  67.288 +	((shift_temp = (x)) < 0 ? \
  67.289 +	 (shift_temp >> (shft)) | ((~((INT32) 0)) << (32-(shft))) : \
  67.290 +	 (shift_temp >> (shft)))
  67.291 +#else
  67.292 +#define SHIFT_TEMPS
  67.293 +#define RIGHT_SHIFT(x,shft)	((x) >> (shft))
  67.294 +#endif
  67.295 +
  67.296 +
  67.297 +/* Short forms of external names for systems with brain-damaged linkers. */
  67.298 +
  67.299 +#ifdef NEED_SHORT_EXTERNAL_NAMES
  67.300 +#define jinit_compress_master	jICompress
  67.301 +#define jinit_c_master_control	jICMaster
  67.302 +#define jinit_c_main_controller	jICMainC
  67.303 +#define jinit_c_prep_controller	jICPrepC
  67.304 +#define jinit_c_coef_controller	jICCoefC
  67.305 +#define jinit_color_converter	jICColor
  67.306 +#define jinit_downsampler	jIDownsampler
  67.307 +#define jinit_forward_dct	jIFDCT
  67.308 +#define jinit_huff_encoder	jIHEncoder
  67.309 +#define jinit_phuff_encoder	jIPHEncoder
  67.310 +#define jinit_marker_writer	jIMWriter
  67.311 +#define jinit_master_decompress	jIDMaster
  67.312 +#define jinit_d_main_controller	jIDMainC
  67.313 +#define jinit_d_coef_controller	jIDCoefC
  67.314 +#define jinit_d_post_controller	jIDPostC
  67.315 +#define jinit_input_controller	jIInCtlr
  67.316 +#define jinit_marker_reader	jIMReader
  67.317 +#define jinit_huff_decoder	jIHDecoder
  67.318 +#define jinit_phuff_decoder	jIPHDecoder
  67.319 +#define jinit_inverse_dct	jIIDCT
  67.320 +#define jinit_upsampler		jIUpsampler
  67.321 +#define jinit_color_deconverter	jIDColor
  67.322 +#define jinit_1pass_quantizer	jI1Quant
  67.323 +#define jinit_2pass_quantizer	jI2Quant
  67.324 +#define jinit_merged_upsampler	jIMUpsampler
  67.325 +#define jinit_memory_mgr	jIMemMgr
  67.326 +#define jdiv_round_up		jDivRound
  67.327 +#define jround_up		jRound
  67.328 +#define jcopy_sample_rows	jCopySamples
  67.329 +#define jcopy_block_row		jCopyBlocks
  67.330 +#define jzero_far		jZeroFar
  67.331 +#define jpeg_zigzag_order	jZIGTable
  67.332 +#define jpeg_natural_order	jZAGTable
  67.333 +#endif /* NEED_SHORT_EXTERNAL_NAMES */
  67.334 +
  67.335 +
  67.336 +/* Compression module initialization routines */
  67.337 +EXTERN(void) jinit_compress_master JPP((j_compress_ptr cinfo));
  67.338 +EXTERN(void) jinit_c_master_control JPP((j_compress_ptr cinfo,
  67.339 +					 boolean transcode_only));
  67.340 +EXTERN(void) jinit_c_main_controller JPP((j_compress_ptr cinfo,
  67.341 +					  boolean need_full_buffer));
  67.342 +EXTERN(void) jinit_c_prep_controller JPP((j_compress_ptr cinfo,
  67.343 +					  boolean need_full_buffer));
  67.344 +EXTERN(void) jinit_c_coef_controller JPP((j_compress_ptr cinfo,
  67.345 +					  boolean need_full_buffer));
  67.346 +EXTERN(void) jinit_color_converter JPP((j_compress_ptr cinfo));
  67.347 +EXTERN(void) jinit_downsampler JPP((j_compress_ptr cinfo));
  67.348 +EXTERN(void) jinit_forward_dct JPP((j_compress_ptr cinfo));
  67.349 +EXTERN(void) jinit_huff_encoder JPP((j_compress_ptr cinfo));
  67.350 +EXTERN(void) jinit_phuff_encoder JPP((j_compress_ptr cinfo));
  67.351 +EXTERN(void) jinit_marker_writer JPP((j_compress_ptr cinfo));
  67.352 +/* Decompression module initialization routines */
  67.353 +EXTERN(void) jinit_master_decompress JPP((j_decompress_ptr cinfo));
  67.354 +EXTERN(void) jinit_d_main_controller JPP((j_decompress_ptr cinfo,
  67.355 +					  boolean need_full_buffer));
  67.356 +EXTERN(void) jinit_d_coef_controller JPP((j_decompress_ptr cinfo,
  67.357 +					  boolean need_full_buffer));
  67.358 +EXTERN(void) jinit_d_post_controller JPP((j_decompress_ptr cinfo,
  67.359 +					  boolean need_full_buffer));
  67.360 +EXTERN(void) jinit_input_controller JPP((j_decompress_ptr cinfo));
  67.361 +EXTERN(void) jinit_marker_reader JPP((j_decompress_ptr cinfo));
  67.362 +EXTERN(void) jinit_huff_decoder JPP((j_decompress_ptr cinfo));
  67.363 +EXTERN(void) jinit_phuff_decoder JPP((j_decompress_ptr cinfo));
  67.364 +EXTERN(void) jinit_inverse_dct JPP((j_decompress_ptr cinfo));
  67.365 +EXTERN(void) jinit_upsampler JPP((j_decompress_ptr cinfo));
  67.366 +EXTERN(void) jinit_color_deconverter JPP((j_decompress_ptr cinfo));
  67.367 +EXTERN(void) jinit_1pass_quantizer JPP((j_decompress_ptr cinfo));
  67.368 +EXTERN(void) jinit_2pass_quantizer JPP((j_decompress_ptr cinfo));
  67.369 +EXTERN(void) jinit_merged_upsampler JPP((j_decompress_ptr cinfo));
  67.370 +/* Memory manager initialization */
  67.371 +EXTERN(void) jinit_memory_mgr JPP((j_common_ptr cinfo));
  67.372 +
  67.373 +/* Utility routines in jutils.c */
  67.374 +EXTERN(long) jdiv_round_up JPP((long a, long b));
  67.375 +EXTERN(long) jround_up JPP((long a, long b));
  67.376 +EXTERN(void) jcopy_sample_rows JPP((JSAMPARRAY input_array, int source_row,
  67.377 +				    JSAMPARRAY output_array, int dest_row,
  67.378 +				    int num_rows, JDIMENSION num_cols));
  67.379 +EXTERN(void) jcopy_block_row JPP((JBLOCKROW input_row, JBLOCKROW output_row,
  67.380 +				  JDIMENSION num_blocks));
  67.381 +EXTERN(void) jzero_far JPP((void FAR * target, size_t bytestozero));
  67.382 +/* Constant tables in jutils.c */
  67.383 +#if 0				/* This table is not actually needed in v6a */
  67.384 +extern const int jpeg_zigzag_order[]; /* natural coef order to zigzag order */
  67.385 +#endif
  67.386 +extern const int jpeg_natural_order[]; /* zigzag coef order to natural order */
  67.387 +
  67.388 +/* Suppress undefined-structure complaints if necessary. */
  67.389 +
  67.390 +#ifdef INCOMPLETE_TYPES_BROKEN
  67.391 +#ifndef AM_MEMORY_MANAGER	/* only jmemmgr.c defines these */
  67.392 +struct jvirt_sarray_control { long dummy; };
  67.393 +struct jvirt_barray_control { long dummy; };
  67.394 +#endif
  67.395 +#endif /* INCOMPLETE_TYPES_BROKEN */
    68.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    68.2 +++ b/libs/libjpeg/jpeglib.h	Sun Nov 01 00:36:56 2015 +0200
    68.3 @@ -0,0 +1,1096 @@
    68.4 +/*
    68.5 + * jpeglib.h
    68.6 + *
    68.7 + * Copyright (C) 1991-1998, Thomas G. Lane.
    68.8 + * This file is part of the Independent JPEG Group's software.
    68.9 + * For conditions of distribution and use, see the accompanying README file.
   68.10 + *
   68.11 + * This file defines the application interface for the JPEG library.
   68.12 + * Most applications using the library need only include this file,
   68.13 + * and perhaps jerror.h if they want to know the exact error codes.
   68.14 + */
   68.15 +
   68.16 +#ifndef JPEGLIB_H
   68.17 +#define JPEGLIB_H
   68.18 +
   68.19 +/*
   68.20 + * First we include the configuration files that record how this
   68.21 + * installation of the JPEG library is set up.  jconfig.h can be
   68.22 + * generated automatically for many systems.  jmorecfg.h contains
   68.23 + * manual configuration options that most people need not worry about.
   68.24 + */
   68.25 +
   68.26 +#ifndef JCONFIG_INCLUDED	/* in case jinclude.h already did */
   68.27 +#include "jconfig.h"		/* widely used configuration options */
   68.28 +#endif
   68.29 +#include "jmorecfg.h"		/* seldom changed options */
   68.30 +
   68.31 +
   68.32 +/* Version ID for the JPEG library.
   68.33 + * Might be useful for tests like "#if JPEG_LIB_VERSION >= 60".
   68.34 + */
   68.35 +
   68.36 +#define JPEG_LIB_VERSION  62	/* Version 6b */
   68.37 +
   68.38 +
   68.39 +/* Various constants determining the sizes of things.
   68.40 + * All of these are specified by the JPEG standard, so don't change them
   68.41 + * if you want to be compatible.
   68.42 + */
   68.43 +
   68.44 +#define DCTSIZE		    8	/* The basic DCT block is 8x8 samples */
   68.45 +#define DCTSIZE2	    64	/* DCTSIZE squared; # of elements in a block */
   68.46 +#define NUM_QUANT_TBLS      4	/* Quantization tables are numbered 0..3 */
   68.47 +#define NUM_HUFF_TBLS       4	/* Huffman tables are numbered 0..3 */
   68.48 +#define NUM_ARITH_TBLS      16	/* Arith-coding tables are numbered 0..15 */
   68.49 +#define MAX_COMPS_IN_SCAN   4	/* JPEG limit on # of components in one scan */
   68.50 +#define MAX_SAMP_FACTOR     4	/* JPEG limit on sampling factors */
   68.51 +/* Unfortunately, some bozo at Adobe saw no reason to be bound by the standard;
   68.52 + * the PostScript DCT filter can emit files with many more than 10 blocks/MCU.
   68.53 + * If you happen to run across such a file, you can up D_MAX_BLOCKS_IN_MCU
   68.54 + * to handle it.  We even let you do this from the jconfig.h file.  However,
   68.55 + * we strongly discourage changing C_MAX_BLOCKS_IN_MCU; just because Adobe
   68.56 + * sometimes emits noncompliant files doesn't mean you should too.
   68.57 + */
   68.58 +#define C_MAX_BLOCKS_IN_MCU   10 /* compressor's limit on blocks per MCU */
   68.59 +#ifndef D_MAX_BLOCKS_IN_MCU
   68.60 +#define D_MAX_BLOCKS_IN_MCU   10 /* decompressor's limit on blocks per MCU */
   68.61 +#endif
   68.62 +
   68.63 +
   68.64 +/* Data structures for images (arrays of samples and of DCT coefficients).
   68.65 + * On 80x86 machines, the image arrays are too big for near pointers,
   68.66 + * but the pointer arrays can fit in near memory.
   68.67 + */
   68.68 +
   68.69 +typedef JSAMPLE FAR *JSAMPROW;	/* ptr to one image row of pixel samples. */
   68.70 +typedef JSAMPROW *JSAMPARRAY;	/* ptr to some rows (a 2-D sample array) */
   68.71 +typedef JSAMPARRAY *JSAMPIMAGE;	/* a 3-D sample array: top index is color */
   68.72 +
   68.73 +typedef JCOEF JBLOCK[DCTSIZE2];	/* one block of coefficients */
   68.74 +typedef JBLOCK FAR *JBLOCKROW;	/* pointer to one row of coefficient blocks */
   68.75 +typedef JBLOCKROW *JBLOCKARRAY;		/* a 2-D array of coefficient blocks */
   68.76 +typedef JBLOCKARRAY *JBLOCKIMAGE;	/* a 3-D array of coefficient blocks */
   68.77 +
   68.78 +typedef JCOEF FAR *JCOEFPTR;	/* useful in a couple of places */
   68.79 +
   68.80 +
   68.81 +/* Types for JPEG compression parameters and working tables. */
   68.82 +
   68.83 +
   68.84 +/* DCT coefficient quantization tables. */
   68.85 +
   68.86 +typedef struct {
   68.87 +  /* This array gives the coefficient quantizers in natural array order
   68.88 +   * (not the zigzag order in which they are stored in a JPEG DQT marker).
   68.89 +   * CAUTION: IJG versions prior to v6a kept this array in zigzag order.
   68.90 +   */
   68.91 +  UINT16 quantval[DCTSIZE2];	/* quantization step for each coefficient */
   68.92 +  /* This field is used only during compression.  It's initialized FALSE when
   68.93 +   * the table is created, and set TRUE when it's been output to the file.
   68.94 +   * You could suppress output of a table by setting this to TRUE.
   68.95 +   * (See jpeg_suppress_tables for an example.)
   68.96 +   */
   68.97 +  boolean sent_table;		/* TRUE when table has been output */
   68.98 +} JQUANT_TBL;
   68.99 +
  68.100 +
  68.101 +/* Huffman coding tables. */
  68.102 +
  68.103 +typedef struct {
  68.104 +  /* These two fields directly represent the contents of a JPEG DHT marker */
  68.105 +  UINT8 bits[17];		/* bits[k] = # of symbols with codes of */
  68.106 +				/* length k bits; bits[0] is unused */
  68.107 +  UINT8 huffval[256];		/* The symbols, in order of incr code length */
  68.108 +  /* This field is used only during compression.  It's initialized FALSE when
  68.109 +   * the table is created, and set TRUE when it's been output to the file.
  68.110 +   * You could suppress output of a table by setting this to TRUE.
  68.111 +   * (See jpeg_suppress_tables for an example.)
  68.112 +   */
  68.113 +  boolean sent_table;		/* TRUE when table has been output */
  68.114 +} JHUFF_TBL;
  68.115 +
  68.116 +
  68.117 +/* Basic info about one component (color channel). */
  68.118 +
  68.119 +typedef struct {
  68.120 +  /* These values are fixed over the whole image. */
  68.121 +  /* For compression, they must be supplied by parameter setup; */
  68.122 +  /* for decompression, they are read from the SOF marker. */
  68.123 +  int component_id;		/* identifier for this component (0..255) */
  68.124 +  int component_index;		/* its index in SOF or cinfo->comp_info[] */
  68.125 +  int h_samp_factor;		/* horizontal sampling factor (1..4) */
  68.126 +  int v_samp_factor;		/* vertical sampling factor (1..4) */
  68.127 +  int quant_tbl_no;		/* quantization table selector (0..3) */
  68.128 +  /* These values may vary between scans. */
  68.129 +  /* For compression, they must be supplied by parameter setup; */
  68.130 +  /* for decompression, they are read from the SOS marker. */
  68.131 +  /* The decompressor output side may not use these variables. */
  68.132 +  int dc_tbl_no;		/* DC entropy table selector (0..3) */
  68.133 +  int ac_tbl_no;		/* AC entropy table selector (0..3) */
  68.134 +  
  68.135 +  /* Remaining fields should be treated as private by applications. */
  68.136 +  
  68.137 +  /* These values are computed during compression or decompression startup: */
  68.138 +  /* Component's size in DCT blocks.
  68.139 +   * Any dummy blocks added to complete an MCU are not counted; therefore
  68.140 +   * these values do not depend on whether a scan is interleaved or not.
  68.141 +   */
  68.142 +  JDIMENSION width_in_blocks;
  68.143 +  JDIMENSION height_in_blocks;
  68.144 +  /* Size of a DCT block in samples.  Always DCTSIZE for compression.
  68.145 +   * For decompression this is the size of the output from one DCT block,
  68.146 +   * reflecting any scaling we choose to apply during the IDCT step.
  68.147 +   * Values of 1,2,4,8 are likely to be supported.  Note that different
  68.148 +   * components may receive different IDCT scalings.
  68.149 +   */
  68.150 +  int DCT_scaled_size;
  68.151 +  /* The downsampled dimensions are the component's actual, unpadded number
  68.152 +   * of samples at the main buffer (preprocessing/compression interface), thus
  68.153 +   * downsampled_width = ceil(image_width * Hi/Hmax)
  68.154 +   * and similarly for height.  For decompression, IDCT scaling is included, so
  68.155 +   * downsampled_width = ceil(image_width * Hi/Hmax * DCT_scaled_size/DCTSIZE)
  68.156 +   */
  68.157 +  JDIMENSION downsampled_width;	 /* actual width in samples */
  68.158 +  JDIMENSION downsampled_height; /* actual height in samples */
  68.159 +  /* This flag is used only for decompression.  In cases where some of the
  68.160 +   * components will be ignored (eg grayscale output from YCbCr image),
  68.161 +   * we can skip most computations for the unused components.
  68.162 +   */
  68.163 +  boolean component_needed;	/* do we need the value of this component? */
  68.164 +
  68.165 +  /* These values are computed before starting a scan of the component. */
  68.166 +  /* The decompressor output side may not use these variables. */
  68.167 +  int MCU_width;		/* number of blocks per MCU, horizontally */
  68.168 +  int MCU_height;		/* number of blocks per MCU, vertically */
  68.169 +  int MCU_blocks;		/* MCU_width * MCU_height */
  68.170 +  int MCU_sample_width;		/* MCU width in samples, MCU_width*DCT_scaled_size */
  68.171 +  int last_col_width;		/* # of non-dummy blocks across in last MCU */
  68.172 +  int last_row_height;		/* # of non-dummy blocks down in last MCU */
  68.173 +
  68.174 +  /* Saved quantization table for component; NULL if none yet saved.
  68.175 +   * See jdinput.c comments about the need for this information.
  68.176 +   * This field is currently used only for decompression.
  68.177 +   */
  68.178 +  JQUANT_TBL * quant_table;
  68.179 +
  68.180 +  /* Private per-component storage for DCT or IDCT subsystem. */
  68.181 +  void * dct_table;
  68.182 +} jpeg_component_info;
  68.183 +
  68.184 +
  68.185 +/* The script for encoding a multiple-scan file is an array of these: */
  68.186 +
  68.187 +typedef struct {
  68.188 +  int comps_in_scan;		/* number of components encoded in this scan */
  68.189 +  int component_index[MAX_COMPS_IN_SCAN]; /* their SOF/comp_info[] indexes */
  68.190 +  int Ss, Se;			/* progressive JPEG spectral selection parms */
  68.191 +  int Ah, Al;			/* progressive JPEG successive approx. parms */
  68.192 +} jpeg_scan_info;
  68.193 +
  68.194 +/* The decompressor can save APPn and COM markers in a list of these: */
  68.195 +
  68.196 +typedef struct jpeg_marker_struct FAR * jpeg_saved_marker_ptr;
  68.197 +
  68.198 +struct jpeg_marker_struct {
  68.199 +  jpeg_saved_marker_ptr next;	/* next in list, or NULL */
  68.200 +  UINT8 marker;			/* marker code: JPEG_COM, or JPEG_APP0+n */
  68.201 +  unsigned int original_length;	/* # bytes of data in the file */
  68.202 +  unsigned int data_length;	/* # bytes of data saved at data[] */
  68.203 +  JOCTET FAR * data;		/* the data contained in the marker */
  68.204 +  /* the marker length word is not counted in data_length or original_length */
  68.205 +};
  68.206 +
  68.207 +/* Known color spaces. */
  68.208 +
  68.209 +typedef enum {
  68.210 +	JCS_UNKNOWN,		/* error/unspecified */
  68.211 +	JCS_GRAYSCALE,		/* monochrome */
  68.212 +	JCS_RGB,		/* red/green/blue */
  68.213 +	JCS_YCbCr,		/* Y/Cb/Cr (also known as YUV) */
  68.214 +	JCS_CMYK,		/* C/M/Y/K */
  68.215 +	JCS_YCCK		/* Y/Cb/Cr/K */
  68.216 +} J_COLOR_SPACE;
  68.217 +
  68.218 +/* DCT/IDCT algorithm options. */
  68.219 +
  68.220 +typedef enum {
  68.221 +	JDCT_ISLOW,		/* slow but accurate integer algorithm */
  68.222 +	JDCT_IFAST,		/* faster, less accurate integer method */
  68.223 +	JDCT_FLOAT		/* floating-point: accurate, fast on fast HW */
  68.224 +} J_DCT_METHOD;
  68.225 +
  68.226 +#ifndef JDCT_DEFAULT		/* may be overridden in jconfig.h */
  68.227 +#define JDCT_DEFAULT  JDCT_ISLOW
  68.228 +#endif
  68.229 +#ifndef JDCT_FASTEST		/* may be overridden in jconfig.h */
  68.230 +#define JDCT_FASTEST  JDCT_IFAST
  68.231 +#endif
  68.232 +
  68.233 +/* Dithering options for decompression. */
  68.234 +
  68.235 +typedef enum {
  68.236 +	JDITHER_NONE,		/* no dithering */
  68.237 +	JDITHER_ORDERED,	/* simple ordered dither */
  68.238 +	JDITHER_FS		/* Floyd-Steinberg error diffusion dither */
  68.239 +} J_DITHER_MODE;
  68.240 +
  68.241 +
  68.242 +/* Common fields between JPEG compression and decompression master structs. */
  68.243 +
  68.244 +#define jpeg_common_fields \
  68.245 +  struct jpeg_error_mgr * err;	/* Error handler module */\
  68.246 +  struct jpeg_memory_mgr * mem;	/* Memory manager module */\
  68.247 +  struct jpeg_progress_mgr * progress; /* Progress monitor, or NULL if none */\
  68.248 +  void * client_data;		/* Available for use by application */\
  68.249 +  boolean is_decompressor;	/* So common code can tell which is which */\
  68.250 +  int global_state		/* For checking call sequence validity */
  68.251 +
  68.252 +/* Routines that are to be used by both halves of the library are declared
  68.253 + * to receive a pointer to this structure.  There are no actual instances of
  68.254 + * jpeg_common_struct, only of jpeg_compress_struct and jpeg_decompress_struct.
  68.255 + */
  68.256 +struct jpeg_common_struct {
  68.257 +  jpeg_common_fields;		/* Fields common to both master struct types */
  68.258 +  /* Additional fields follow in an actual jpeg_compress_struct or
  68.259 +   * jpeg_decompress_struct.  All three structs must agree on these
  68.260 +   * initial fields!  (This would be a lot cleaner in C++.)
  68.261 +   */
  68.262 +};
  68.263 +
  68.264 +typedef struct jpeg_common_struct * j_common_ptr;
  68.265 +typedef struct jpeg_compress_struct * j_compress_ptr;
  68.266 +typedef struct jpeg_decompress_struct * j_decompress_ptr;
  68.267 +
  68.268 +
  68.269 +/* Master record for a compression instance */
  68.270 +
  68.271 +struct jpeg_compress_struct {
  68.272 +  jpeg_common_fields;		/* Fields shared with jpeg_decompress_struct */
  68.273 +
  68.274 +  /* Destination for compressed data */
  68.275 +  struct jpeg_destination_mgr * dest;
  68.276 +
  68.277 +  /* Description of source image --- these fields must be filled in by
  68.278 +   * outer application before starting compression.  in_color_space must
  68.279 +   * be correct before you can even call jpeg_set_defaults().
  68.280 +   */
  68.281 +
  68.282 +  JDIMENSION image_width;	/* input image width */
  68.283 +  JDIMENSION image_height;	/* input image height */
  68.284 +  int input_components;		/* # of color components in input image */
  68.285 +  J_COLOR_SPACE in_color_space;	/* colorspace of input image */
  68.286 +
  68.287 +  double input_gamma;		/* image gamma of input image */
  68.288 +
  68.289 +  /* Compression parameters --- these fields must be set before calling
  68.290 +   * jpeg_start_compress().  We recommend calling jpeg_set_defaults() to
  68.291 +   * initialize everything to reasonable defaults, then changing anything
  68.292 +   * the application specifically wants to change.  That way you won't get
  68.293 +   * burnt when new parameters are added.  Also note that there are several
  68.294 +   * helper routines to simplify changing parameters.
  68.295 +   */
  68.296 +
  68.297 +  int data_precision;		/* bits of precision in image data */
  68.298 +
  68.299 +  int num_components;		/* # of color components in JPEG image */
  68.300 +  J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */
  68.301 +
  68.302 +  jpeg_component_info * comp_info;
  68.303 +  /* comp_info[i] describes component that appears i'th in SOF */
  68.304 +  
  68.305 +  JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS];
  68.306 +  /* ptrs to coefficient quantization tables, or NULL if not defined */
  68.307 +  
  68.308 +  JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS];
  68.309 +  JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS];
  68.310 +  /* ptrs to Huffman coding tables, or NULL if not defined */
  68.311 +  
  68.312 +  UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */
  68.313 +  UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */
  68.314 +  UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */
  68.315 +
  68.316 +  int num_scans;		/* # of entries in scan_info array */
  68.317 +  const jpeg_scan_info * scan_info; /* script for multi-scan file, or NULL */
  68.318 +  /* The default value of scan_info is NULL, which causes a single-scan
  68.319 +   * sequential JPEG file to be emitted.  To create a multi-scan file,
  68.320 +   * set num_scans and scan_info to point to an array of scan definitions.
  68.321 +   */
  68.322 +
  68.323 +  boolean raw_data_in;		/* TRUE=caller supplies downsampled data */
  68.324 +  boolean arith_code;		/* TRUE=arithmetic coding, FALSE=Huffman */
  68.325 +  boolean optimize_coding;	/* TRUE=optimize entropy encoding parms */
  68.326 +  boolean CCIR601_sampling;	/* TRUE=first samples are cosited */
  68.327 +  int smoothing_factor;		/* 1..100, or 0 for no input smoothing */
  68.328 +  J_DCT_METHOD dct_method;	/* DCT algorithm selector */
  68.329 +
  68.330 +  /* The restart interval can be specified in absolute MCUs by setting
  68.331 +   * restart_interval, or in MCU rows by setting restart_in_rows
  68.332 +   * (in which case the correct restart_interval will be figured
  68.333 +   * for each scan).
  68.334 +   */
  68.335 +  unsigned int restart_interval; /* MCUs per restart, or 0 for no restart */
  68.336 +  int restart_in_rows;		/* if > 0, MCU rows per restart interval */
  68.337 +
  68.338 +  /* Parameters controlling emission of special markers. */
  68.339 +
  68.340 +  boolean write_JFIF_header;	/* should a JFIF marker be written? */
  68.341 +  UINT8 JFIF_major_version;	/* What to write for the JFIF version number */
  68.342 +  UINT8 JFIF_minor_version;
  68.343 +  /* These three values are not used by the JPEG code, merely copied */
  68.344 +  /* into the JFIF APP0 marker.  density_unit can be 0 for unknown, */
  68.345 +  /* 1 for dots/inch, or 2 for dots/cm.  Note that the pixel aspect */
  68.346 +  /* ratio is defined by X_density/Y_density even when density_unit=0. */
  68.347 +  UINT8 density_unit;		/* JFIF code for pixel size units */
  68.348 +  UINT16 X_density;		/* Horizontal pixel density */
  68.349 +  UINT16 Y_density;		/* Vertical pixel density */
  68.350 +  boolean write_Adobe_marker;	/* should an Adobe marker be written? */
  68.351 +  
  68.352 +  /* State variable: index of next scanline to be written to
  68.353 +   * jpeg_write_scanlines().  Application may use this to control its
  68.354 +   * processing loop, e.g., "while (next_scanline < image_height)".
  68.355 +   */
  68.356 +
  68.357 +  JDIMENSION next_scanline;	/* 0 .. image_height-1  */
  68.358 +
  68.359 +  /* Remaining fields are known throughout compressor, but generally
  68.360 +   * should not be touched by a surrounding application.
  68.361 +   */
  68.362 +
  68.363 +  /*
  68.364 +   * These fields are computed during compression startup
  68.365 +   */
  68.366 +  boolean progressive_mode;	/* TRUE if scan script uses progressive mode */
  68.367 +  int max_h_samp_factor;	/* largest h_samp_factor */
  68.368 +  int max_v_samp_factor;	/* largest v_samp_factor */
  68.369 +
  68.370 +  JDIMENSION total_iMCU_rows;	/* # of iMCU rows to be input to coef ctlr */
  68.371 +  /* The coefficient controller receives data in units of MCU rows as defined
  68.372 +   * for fully interleaved scans (whether the JPEG file is interleaved or not).
  68.373 +   * There are v_samp_factor * DCTSIZE sample rows of each component in an
  68.374 +   * "iMCU" (interleaved MCU) row.
  68.375 +   */
  68.376 +  
  68.377 +  /*
  68.378 +   * These fields are valid during any one scan.
  68.379 +   * They describe the components and MCUs actually appearing in the scan.
  68.380 +   */
  68.381 +  int comps_in_scan;		/* # of JPEG components in this scan */
  68.382 +  jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN];
  68.383 +  /* *cur_comp_info[i] describes component that appears i'th in SOS */
  68.384 +  
  68.385 +  JDIMENSION MCUs_per_row;	/* # of MCUs across the image */
  68.386 +  JDIMENSION MCU_rows_in_scan;	/* # of MCU rows in the image */
  68.387 +  
  68.388 +  int blocks_in_MCU;		/* # of DCT blocks per MCU */
  68.389 +  int MCU_membership[C_MAX_BLOCKS_IN_MCU];
  68.390 +  /* MCU_membership[i] is index in cur_comp_info of component owning */
  68.391 +  /* i'th block in an MCU */
  68.392 +
  68.393 +  int Ss, Se, Ah, Al;		/* progressive JPEG parameters for scan */
  68.394 +
  68.395 +  /*
  68.396 +   * Links to compression subobjects (methods and private variables of modules)
  68.397 +   */
  68.398 +  struct jpeg_comp_master * master;
  68.399 +  struct jpeg_c_main_controller * main;
  68.400 +  struct jpeg_c_prep_controller * prep;
  68.401 +  struct jpeg_c_coef_controller * coef;
  68.402 +  struct jpeg_marker_writer * marker;
  68.403 +  struct jpeg_color_converter * cconvert;
  68.404 +  struct jpeg_downsampler * downsample;
  68.405 +  struct jpeg_forward_dct * fdct;
  68.406 +  struct jpeg_entropy_encoder * entropy;
  68.407 +  jpeg_scan_info * script_space; /* workspace for jpeg_simple_progression */
  68.408 +  int script_space_size;
  68.409 +};
  68.410 +
  68.411 +
  68.412 +/* Master record for a decompression instance */
  68.413 +
  68.414 +struct jpeg_decompress_struct {
  68.415 +  jpeg_common_fields;		/* Fields shared with jpeg_compress_struct */
  68.416 +
  68.417 +  /* Source of compressed data */
  68.418 +  struct jpeg_source_mgr * src;
  68.419 +
  68.420 +  /* Basic description of image --- filled in by jpeg_read_header(). */
  68.421 +  /* Application may inspect these values to decide how to process image. */
  68.422 +
  68.423 +  JDIMENSION image_width;	/* nominal image width (from SOF marker) */
  68.424 +  JDIMENSION image_height;	/* nominal image height */
  68.425 +  int num_components;		/* # of color components in JPEG image */
  68.426 +  J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */
  68.427 +
  68.428 +  /* Decompression processing parameters --- these fields must be set before
  68.429 +   * calling jpeg_start_decompress().  Note that jpeg_read_header() initializes
  68.430 +   * them to default values.
  68.431 +   */
  68.432 +
  68.433 +  J_COLOR_SPACE out_color_space; /* colorspace for output */
  68.434 +
  68.435 +  unsigned int scale_num, scale_denom; /* fraction by which to scale image */
  68.436 +
  68.437 +  double output_gamma;		/* image gamma wanted in output */
  68.438 +
  68.439 +  boolean buffered_image;	/* TRUE=multiple output passes */
  68.440 +  boolean raw_data_out;		/* TRUE=downsampled data wanted */
  68.441 +
  68.442 +  J_DCT_METHOD dct_method;	/* IDCT algorithm selector */
  68.443 +  boolean do_fancy_upsampling;	/* TRUE=apply fancy upsampling */
  68.444 +  boolean do_block_smoothing;	/* TRUE=apply interblock smoothing */
  68.445 +
  68.446 +  boolean quantize_colors;	/* TRUE=colormapped output wanted */
  68.447 +  /* the following are ignored if not quantize_colors: */
  68.448 +  J_DITHER_MODE dither_mode;	/* type of color dithering to use */
  68.449 +  boolean two_pass_quantize;	/* TRUE=use two-pass color quantization */
  68.450 +  int desired_number_of_colors;	/* max # colors to use in created colormap */
  68.451 +  /* these are significant only in buffered-image mode: */
  68.452 +  boolean enable_1pass_quant;	/* enable future use of 1-pass quantizer */
  68.453 +  boolean enable_external_quant;/* enable future use of external colormap */
  68.454 +  boolean enable_2pass_quant;	/* enable future use of 2-pass quantizer */
  68.455 +
  68.456 +  /* Description of actual output image that will be returned to application.
  68.457 +   * These fields are computed by jpeg_start_decompress().
  68.458 +   * You can also use jpeg_calc_output_dimensions() to determine these values
  68.459 +   * in advance of calling jpeg_start_decompress().
  68.460 +   */
  68.461 +
  68.462 +  JDIMENSION output_width;	/* scaled image width */
  68.463 +  JDIMENSION output_height;	/* scaled image height */
  68.464 +  int out_color_components;	/* # of color components in out_color_space */
  68.465 +  int output_components;	/* # of color components returned */
  68.466 +  /* output_components is 1 (a colormap index) when quantizing colors;
  68.467 +   * otherwise it equals out_color_components.
  68.468 +   */
  68.469 +  int rec_outbuf_height;	/* min recommended height of scanline buffer */
  68.470 +  /* If the buffer passed to jpeg_read_scanlines() is less than this many rows
  68.471 +   * high, space and time will be wasted due to unnecessary data copying.
  68.472 +   * Usually rec_outbuf_height will be 1 or 2, at most 4.
  68.473 +   */
  68.474 +
  68.475 +  /* When quantizing colors, the output colormap is described by these fields.
  68.476 +   * The application can supply a colormap by setting colormap non-NULL before
  68.477 +   * calling jpeg_start_decompress; otherwise a colormap is created during
  68.478 +   * jpeg_start_decompress or jpeg_start_output.
  68.479 +   * The map has out_color_components rows and actual_number_of_colors columns.
  68.480 +   */
  68.481 +  int actual_number_of_colors;	/* number of entries in use */
  68.482 +  JSAMPARRAY colormap;		/* The color map as a 2-D pixel array */
  68.483 +
  68.484 +  /* State variables: these variables indicate the progress of decompression.
  68.485 +   * The application may examine these but must not modify them.
  68.486 +   */
  68.487 +
  68.488 +  /* Row index of next scanline to be read from jpeg_read_scanlines().
  68.489 +   * Application may use this to control its processing loop, e.g.,
  68.490 +   * "while (output_scanline < output_height)".
  68.491 +   */
  68.492 +  JDIMENSION output_scanline;	/* 0 .. output_height-1  */
  68.493 +
  68.494 +  /* Current input scan number and number of iMCU rows completed in scan.
  68.495 +   * These indicate the progress of the decompressor input side.
  68.496 +   */
  68.497 +  int input_scan_number;	/* Number of SOS markers seen so far */
  68.498 +  JDIMENSION input_iMCU_row;	/* Number of iMCU rows completed */
  68.499 +
  68.500 +  /* The "output scan number" is the notional scan being displayed by the
  68.501 +   * output side.  The decompressor will not allow output scan/row number
  68.502 +   * to get ahead of input scan/row, but it can fall arbitrarily far behind.
  68.503 +   */
  68.504 +  int output_scan_number;	/* Nominal scan number being displayed */
  68.505 +  JDIMENSION output_iMCU_row;	/* Number of iMCU rows read */
  68.506 +
  68.507 +  /* Current progression status.  coef_bits[c][i] indicates the precision
  68.508 +   * with which component c's DCT coefficient i (in zigzag order) is known.
  68.509 +   * It is -1 when no data has yet been received, otherwise it is the point
  68.510 +   * transform (shift) value for the most recent scan of the coefficient
  68.511 +   * (thus, 0 at completion of the progression).
  68.512 +   * This pointer is NULL when reading a non-progressive file.
  68.513 +   */
  68.514 +  int (*coef_bits)[DCTSIZE2];	/* -1 or current Al value for each coef */
  68.515 +
  68.516 +  /* Internal JPEG parameters --- the application usually need not look at
  68.517 +   * these fields.  Note that the decompressor output side may not use
  68.518 +   * any parameters that can change between scans.
  68.519 +   */
  68.520 +
  68.521 +  /* Quantization and Huffman tables are carried forward across input
  68.522 +   * datastreams when processing abbreviated JPEG datastreams.
  68.523 +   */
  68.524 +
  68.525 +  JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS];
  68.526 +  /* ptrs to coefficient quantization tables, or NULL if not defined */
  68.527 +
  68.528 +  JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS];
  68.529 +  JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS];
  68.530 +  /* ptrs to Huffman coding tables, or NULL if not defined */
  68.531 +
  68.532 +  /* These parameters are never carried across datastreams, since they
  68.533 +   * are given in SOF/SOS markers or defined to be reset by SOI.
  68.534 +   */
  68.535 +
  68.536 +  int data_precision;		/* bits of precision in image data */
  68.537 +
  68.538 +  jpeg_component_info * comp_info;
  68.539 +  /* comp_info[i] describes component that appears i'th in SOF */
  68.540 +
  68.541 +  boolean progressive_mode;	/* TRUE if SOFn specifies progressive mode */
  68.542 +  boolean arith_code;		/* TRUE=arithmetic coding, FALSE=Huffman */
  68.543 +
  68.544 +  UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */
  68.545 +  UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */
  68.546 +  UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */
  68.547 +
  68.548 +  unsigned int restart_interval; /* MCUs per restart interval, or 0 for no restart */
  68.549 +
  68.550 +  /* These fields record data obtained from optional markers recognized by
  68.551 +   * the JPEG library.
  68.552 +   */
  68.553 +  boolean saw_JFIF_marker;	/* TRUE iff a JFIF APP0 marker was found */
  68.554 +  /* Data copied from JFIF marker; only valid if saw_JFIF_marker is TRUE: */
  68.555 +  UINT8 JFIF_major_version;	/* JFIF version number */
  68.556 +  UINT8 JFIF_minor_version;
  68.557 +  UINT8 density_unit;		/* JFIF code for pixel size units */
  68.558 +  UINT16 X_density;		/* Horizontal pixel density */
  68.559 +  UINT16 Y_density;		/* Vertical pixel density */
  68.560 +  boolean saw_Adobe_marker;	/* TRUE iff an Adobe APP14 marker was found */
  68.561 +  UINT8 Adobe_transform;	/* Color transform code from Adobe marker */
  68.562 +
  68.563 +  boolean CCIR601_sampling;	/* TRUE=first samples are cosited */
  68.564 +
  68.565 +  /* Aside from the specific data retained from APPn markers known to the
  68.566 +   * library, the uninterpreted contents of any or all APPn and COM markers
  68.567 +   * can be saved in a list for examination by the application.
  68.568 +   */
  68.569 +  jpeg_saved_marker_ptr marker_list; /* Head of list of saved markers */
  68.570 +
  68.571 +  /* Remaining fields are known throughout decompressor, but generally
  68.572 +   * should not be touched by a surrounding application.
  68.573 +   */
  68.574 +
  68.575 +  /*
  68.576 +   * These fields are computed during decompression startup
  68.577 +   */
  68.578 +  int max_h_samp_factor;	/* largest h_samp_factor */
  68.579 +  int max_v_samp_factor;	/* largest v_samp_factor */
  68.580 +
  68.581 +  int min_DCT_scaled_size;	/* smallest DCT_scaled_size of any component */
  68.582 +
  68.583 +  JDIMENSION total_iMCU_rows;	/* # of iMCU rows in image */
  68.584 +  /* The coefficient controller's input and output progress is measured in
  68.585 +   * units of "iMCU" (interleaved MCU) rows.  These are the same as MCU rows
  68.586 +   * in fully interleaved JPEG scans, but are used whether the scan is
  68.587 +   * interleaved or not.  We define an iMCU row as v_samp_factor DCT block
  68.588 +   * rows of each component.  Therefore, the IDCT output contains
  68.589 +   * v_samp_factor*DCT_scaled_size sample rows of a component per iMCU row.
  68.590 +   */
  68.591 +
  68.592 +  JSAMPLE * sample_range_limit; /* table for fast range-limiting */
  68.593 +
  68.594 +  /*
  68.595 +   * These fields are valid during any one scan.
  68.596 +   * They describe the components and MCUs actually appearing in the scan.
  68.597 +   * Note that the decompressor output side must not use these fields.
  68.598 +   */
  68.599 +  int comps_in_scan;		/* # of JPEG components in this scan */
  68.600 +  jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN];
  68.601 +  /* *cur_comp_info[i] describes component that appears i'th in SOS */
  68.602 +
  68.603 +  JDIMENSION MCUs_per_row;	/* # of MCUs across the image */
  68.604 +  JDIMENSION MCU_rows_in_scan;	/* # of MCU rows in the image */
  68.605 +
  68.606 +  int blocks_in_MCU;		/* # of DCT blocks per MCU */
  68.607 +  int MCU_membership[D_MAX_BLOCKS_IN_MCU];
  68.608 +  /* MCU_membership[i] is index in cur_comp_info of component owning */
  68.609 +  /* i'th block in an MCU */
  68.610 +
  68.611 +  int Ss, Se, Ah, Al;		/* progressive JPEG parameters for scan */
  68.612 +
  68.613 +  /* This field is shared between entropy decoder and marker parser.
  68.614 +   * It is either zero or the code of a JPEG marker that has been
  68.615 +   * read from the data source, but has not yet been processed.
  68.616 +   */
  68.617 +  int unread_marker;
  68.618 +
  68.619 +  /*
  68.620 +   * Links to decompression subobjects (methods, private variables of modules)
  68.621 +   */
  68.622 +  struct jpeg_decomp_master * master;
  68.623 +  struct jpeg_d_main_controller * main;
  68.624 +  struct jpeg_d_coef_controller * coef;
  68.625 +  struct jpeg_d_post_controller * post;
  68.626 +  struct jpeg_input_controller * inputctl;
  68.627 +  struct jpeg_marker_reader * marker;
  68.628 +  struct jpeg_entropy_decoder * entropy;
  68.629 +  struct jpeg_inverse_dct * idct;
  68.630 +  struct jpeg_upsampler * upsample;
  68.631 +  struct jpeg_color_deconverter * cconvert;
  68.632 +  struct jpeg_color_quantizer * cquantize;
  68.633 +};
  68.634 +
  68.635 +
  68.636 +/* "Object" declarations for JPEG modules that may be supplied or called
  68.637 + * directly by the surrounding application.
  68.638 + * As with all objects in the JPEG library, these structs only define the
  68.639 + * publicly visible methods and state variables of a module.  Additional
  68.640 + * private fields may exist after the public ones.
  68.641 + */
  68.642 +
  68.643 +
  68.644 +/* Error handler object */
  68.645 +
  68.646 +struct jpeg_error_mgr {
  68.647 +  /* Error exit handler: does not return to caller */
  68.648 +  JMETHOD(void, error_exit, (j_common_ptr cinfo));
  68.649 +  /* Conditionally emit a trace or warning message */
  68.650 +  JMETHOD(void, emit_message, (j_common_ptr cinfo, int msg_level));
  68.651 +  /* Routine that actually outputs a trace or error message */
  68.652 +  JMETHOD(void, output_message, (j_common_ptr cinfo));
  68.653 +  /* Format a message string for the most recent JPEG error or message */
  68.654 +  JMETHOD(void, format_message, (j_common_ptr cinfo, char * buffer));
  68.655 +#define JMSG_LENGTH_MAX  200	/* recommended size of format_message buffer */
  68.656 +  /* Reset error state variables at start of a new image */
  68.657 +  JMETHOD(void, reset_error_mgr, (j_common_ptr cinfo));
  68.658 +  
  68.659 +  /* The message ID code and any parameters are saved here.
  68.660 +   * A message can have one string parameter or up to 8 int parameters.
  68.661 +   */
  68.662 +  int msg_code;
  68.663 +#define JMSG_STR_PARM_MAX  80
  68.664 +  union {
  68.665 +    int i[8];
  68.666 +    char s[JMSG_STR_PARM_MAX];
  68.667 +  } msg_parm;
  68.668 +  
  68.669 +  /* Standard state variables for error facility */
  68.670 +  
  68.671 +  int trace_level;		/* max msg_level that will be displayed */
  68.672 +  
  68.673 +  /* For recoverable corrupt-data errors, we emit a warning message,
  68.674 +   * but keep going unless emit_message chooses to abort.  emit_message
  68.675 +   * should count warnings in num_warnings.  The surrounding application
  68.676 +   * can check for bad data by seeing if num_warnings is nonzero at the
  68.677 +   * end of processing.
  68.678 +   */
  68.679 +  long num_warnings;		/* number of corrupt-data warnings */
  68.680 +
  68.681 +  /* These fields point to the table(s) of error message strings.
  68.682 +   * An application can change the table pointer to switch to a different
  68.683 +   * message list (typically, to change the language in which errors are
  68.684 +   * reported).  Some applications may wish to add additional error codes
  68.685 +   * that will be handled by the JPEG library error mechanism; the second
  68.686 +   * table pointer is used for this purpose.
  68.687 +   *
  68.688 +   * First table includes all errors generated by JPEG library itself.
  68.689 +   * Error code 0 is reserved for a "no such error string" message.
  68.690 +   */
  68.691 +  const char * const * jpeg_message_table; /* Library errors */
  68.692 +  int last_jpeg_message;    /* Table contains strings 0..last_jpeg_message */
  68.693 +  /* Second table can be added by application (see cjpeg/djpeg for example).
  68.694 +   * It contains strings numbered first_addon_message..last_addon_message.
  68.695 +   */
  68.696 +  const char * const * addon_message_table; /* Non-library errors */
  68.697 +  int first_addon_message;	/* code for first string in addon table */
  68.698 +  int last_addon_message;	/* code for last string in addon table */
  68.699 +};
  68.700 +
  68.701 +
  68.702 +/* Progress monitor object */
  68.703 +
  68.704 +struct jpeg_progress_mgr {
  68.705 +  JMETHOD(void, progress_monitor, (j_common_ptr cinfo));
  68.706 +
  68.707 +  long pass_counter;		/* work units completed in this pass */
  68.708 +  long pass_limit;		/* total number of work units in this pass */
  68.709 +  int completed_passes;		/* passes completed so far */
  68.710 +  int total_passes;		/* total number of passes expected */
  68.711 +};
  68.712 +
  68.713 +
  68.714 +/* Data destination object for compression */
  68.715 +
  68.716 +struct jpeg_destination_mgr {
  68.717 +  JOCTET * next_output_byte;	/* => next byte to write in buffer */
  68.718 +  size_t free_in_buffer;	/* # of byte spaces remaining in buffer */
  68.719 +
  68.720 +  JMETHOD(void, init_destination, (j_compress_ptr cinfo));
  68.721 +  JMETHOD(boolean, empty_output_buffer, (j_compress_ptr cinfo));
  68.722 +  JMETHOD(void, term_destination, (j_compress_ptr cinfo));
  68.723 +};
  68.724 +
  68.725 +
  68.726 +/* Data source object for decompression */
  68.727 +
  68.728 +struct jpeg_source_mgr {
  68.729 +  const JOCTET * next_input_byte; /* => next byte to read from buffer */
  68.730 +  size_t bytes_in_buffer;	/* # of bytes remaining in buffer */
  68.731 +
  68.732 +  JMETHOD(void, init_source, (j_decompress_ptr cinfo));
  68.733 +  JMETHOD(boolean, fill_input_buffer, (j_decompress_ptr cinfo));
  68.734 +  JMETHOD(void, skip_input_data, (j_decompress_ptr cinfo, long num_bytes));
  68.735 +  JMETHOD(boolean, resync_to_restart, (j_decompress_ptr cinfo, int desired));
  68.736 +  JMETHOD(void, term_source, (j_decompress_ptr cinfo));
  68.737 +};
  68.738 +
  68.739 +
  68.740 +/* Memory manager object.
  68.741 + * Allocates "small" objects (a few K total), "large" objects (tens of K),
  68.742 + * and "really big" objects (virtual arrays with backing store if needed).
  68.743 + * The memory manager does not allow individual objects to be freed; rather,
  68.744 + * each created object is assigned to a pool, and whole pools can be freed
  68.745 + * at once.  This is faster and more convenient than remembering exactly what
  68.746 + * to free, especially where malloc()/free() are not too speedy.
  68.747 + * NB: alloc routines never return NULL.  They exit to error_exit if not
  68.748 + * successful.
  68.749 + */
  68.750 +
  68.751 +#define JPOOL_PERMANENT	0	/* lasts until master record is destroyed */
  68.752 +#define JPOOL_IMAGE	1	/* lasts until done with image/datastream */
  68.753 +#define JPOOL_NUMPOOLS	2
  68.754 +
  68.755 +typedef struct jvirt_sarray_control * jvirt_sarray_ptr;
  68.756 +typedef struct jvirt_barray_control * jvirt_barray_ptr;
  68.757 +
  68.758 +
  68.759 +struct jpeg_memory_mgr {
  68.760 +  /* Method pointers */
  68.761 +  JMETHOD(void *, alloc_small, (j_common_ptr cinfo, int pool_id,
  68.762 +				size_t sizeofobject));
  68.763 +  JMETHOD(void FAR *, alloc_large, (j_common_ptr cinfo, int pool_id,
  68.764 +				     size_t sizeofobject));
  68.765 +  JMETHOD(JSAMPARRAY, alloc_sarray, (j_common_ptr cinfo, int pool_id,
  68.766 +				     JDIMENSION samplesperrow,
  68.767 +				     JDIMENSION numrows));
  68.768 +  JMETHOD(JBLOCKARRAY, alloc_barray, (j_common_ptr cinfo, int pool_id,
  68.769 +				      JDIMENSION blocksperrow,
  68.770 +				      JDIMENSION numrows));
  68.771 +  JMETHOD(jvirt_sarray_ptr, request_virt_sarray, (j_common_ptr cinfo,
  68.772 +						  int pool_id,
  68.773 +						  boolean pre_zero,
  68.774 +						  JDIMENSION samplesperrow,
  68.775 +						  JDIMENSION numrows,
  68.776 +						  JDIMENSION maxaccess));
  68.777 +  JMETHOD(jvirt_barray_ptr, request_virt_barray, (j_common_ptr cinfo,
  68.778 +						  int pool_id,
  68.779 +						  boolean pre_zero,
  68.780 +						  JDIMENSION blocksperrow,
  68.781 +						  JDIMENSION numrows,
  68.782 +						  JDIMENSION maxaccess));
  68.783 +  JMETHOD(void, realize_virt_arrays, (j_common_ptr cinfo));
  68.784 +  JMETHOD(JSAMPARRAY, access_virt_sarray, (j_common_ptr cinfo,
  68.785 +					   jvirt_sarray_ptr ptr,
  68.786 +					   JDIMENSION start_row,
  68.787 +					   JDIMENSION num_rows,
  68.788 +					   boolean writable));
  68.789 +  JMETHOD(JBLOCKARRAY, access_virt_barray, (j_common_ptr cinfo,
  68.790 +					    jvirt_barray_ptr ptr,
  68.791 +					    JDIMENSION start_row,
  68.792 +					    JDIMENSION num_rows,
  68.793 +					    boolean writable));
  68.794 +  JMETHOD(void, free_pool, (j_common_ptr cinfo, int pool_id));
  68.795 +  JMETHOD(void, self_destruct, (j_common_ptr cinfo));
  68.796 +
  68.797 +  /* Limit on memory allocation for this JPEG object.  (Note that this is
  68.798 +   * merely advisory, not a guaranteed maximum; it only affects the space
  68.799 +   * used for virtual-array buffers.)  May be changed by outer application
  68.800 +   * after creating the JPEG object.
  68.801 +   */
  68.802 +  long max_memory_to_use;
  68.803 +
  68.804 +  /* Maximum allocation request accepted by alloc_large. */
  68.805 +  long max_alloc_chunk;
  68.806 +};
  68.807 +
  68.808 +
  68.809 +/* Routine signature for application-supplied marker processing methods.
  68.810 + * Need not pass marker code since it is stored in cinfo->unread_marker.
  68.811 + */
  68.812 +typedef JMETHOD(boolean, jpeg_marker_parser_method, (j_decompress_ptr cinfo));
  68.813 +
  68.814 +
  68.815 +/* Declarations for routines called by application.
  68.816 + * The JPP macro hides prototype parameters from compilers that can't cope.
  68.817 + * Note JPP requires double parentheses.
  68.818 + */
  68.819 +
  68.820 +#ifdef HAVE_PROTOTYPES
  68.821 +#define JPP(arglist)	arglist
  68.822 +#else
  68.823 +#define JPP(arglist)	()
  68.824 +#endif
  68.825 +
  68.826 +
  68.827 +/* Short forms of external names for systems with brain-damaged linkers.
  68.828 + * We shorten external names to be unique in the first six letters, which
  68.829 + * is good enough for all known systems.
  68.830 + * (If your compiler itself needs names to be unique in less than 15 
  68.831 + * characters, you are out of luck.  Get a better compiler.)
  68.832 + */
  68.833 +
  68.834 +#ifdef NEED_SHORT_EXTERNAL_NAMES
  68.835 +#define jpeg_std_error		jStdError
  68.836 +#define jpeg_CreateCompress	jCreaCompress
  68.837 +#define jpeg_CreateDecompress	jCreaDecompress
  68.838 +#define jpeg_destroy_compress	jDestCompress
  68.839 +#define jpeg_destroy_decompress	jDestDecompress
  68.840 +#define jpeg_stdio_dest		jStdDest
  68.841 +#define jpeg_stdio_src		jStdSrc
  68.842 +#define jpeg_set_defaults	jSetDefaults
  68.843 +#define jpeg_set_colorspace	jSetColorspace
  68.844 +#define jpeg_default_colorspace	jDefColorspace
  68.845 +#define jpeg_set_quality	jSetQuality
  68.846 +#define jpeg_set_linear_quality	jSetLQuality
  68.847 +#define jpeg_add_quant_table	jAddQuantTable
  68.848 +#define jpeg_quality_scaling	jQualityScaling
  68.849 +#define jpeg_simple_progression	jSimProgress
  68.850 +#define jpeg_suppress_tables	jSuppressTables
  68.851 +#define jpeg_alloc_quant_table	jAlcQTable
  68.852 +#define jpeg_alloc_huff_table	jAlcHTable
  68.853 +#define jpeg_start_compress	jStrtCompress
  68.854 +#define jpeg_write_scanlines	jWrtScanlines
  68.855 +#define jpeg_finish_compress	jFinCompress
  68.856 +#define jpeg_write_raw_data	jWrtRawData
  68.857 +#define jpeg_write_marker	jWrtMarker
  68.858 +#define jpeg_write_m_header	jWrtMHeader
  68.859 +#define jpeg_write_m_byte	jWrtMByte
  68.860 +#define jpeg_write_tables	jWrtTables
  68.861 +#define jpeg_read_header	jReadHeader
  68.862 +#define jpeg_start_decompress	jStrtDecompress
  68.863 +#define jpeg_read_scanlines	jReadScanlines
  68.864 +#define jpeg_finish_decompress	jFinDecompress
  68.865 +#define jpeg_read_raw_data	jReadRawData
  68.866 +#define jpeg_has_multiple_scans	jHasMultScn
  68.867 +#define jpeg_start_output	jStrtOutput
  68.868 +#define jpeg_finish_output	jFinOutput
  68.869 +#define jpeg_input_complete	jInComplete
  68.870 +#define jpeg_new_colormap	jNewCMap
  68.871 +#define jpeg_consume_input	jConsumeInput
  68.872 +#define jpeg_calc_output_dimensions	jCalcDimensions
  68.873 +#define jpeg_save_markers	jSaveMarkers
  68.874 +#define jpeg_set_marker_processor	jSetMarker
  68.875 +#define jpeg_read_coefficients	jReadCoefs
  68.876 +#define jpeg_write_coefficients	jWrtCoefs
  68.877 +#define jpeg_copy_critical_parameters	jCopyCrit
  68.878 +#define jpeg_abort_compress	jAbrtCompress
  68.879 +#define jpeg_abort_decompress	jAbrtDecompress
  68.880 +#define jpeg_abort		jAbort
  68.881 +#define jpeg_destroy		jDestroy
  68.882 +#define jpeg_resync_to_restart	jResyncRestart
  68.883 +#endif /* NEED_SHORT_EXTERNAL_NAMES */
  68.884 +
  68.885 +
  68.886 +/* Default error-management setup */
  68.887 +EXTERN(struct jpeg_error_mgr *) jpeg_std_error
  68.888 +	JPP((struct jpeg_error_mgr * err));
  68.889 +
  68.890 +/* Initialization of JPEG compression objects.
  68.891 + * jpeg_create_compress() and jpeg_create_decompress() are the exported
  68.892 + * names that applications should call.  These expand to calls on
  68.893 + * jpeg_CreateCompress and jpeg_CreateDecompress with additional information
  68.894 + * passed for version mismatch checking.
  68.895 + * NB: you must set up the error-manager BEFORE calling jpeg_create_xxx.
  68.896 + */
  68.897 +#define jpeg_create_compress(cinfo) \
  68.898 +    jpeg_CreateCompress((cinfo), JPEG_LIB_VERSION, \
  68.899 +			(size_t) sizeof(struct jpeg_compress_struct))
  68.900 +#define jpeg_create_decompress(cinfo) \
  68.901 +    jpeg_CreateDecompress((cinfo), JPEG_LIB_VERSION, \
  68.902 +			  (size_t) sizeof(struct jpeg_decompress_struct))
  68.903 +EXTERN(void) jpeg_CreateCompress JPP((j_compress_ptr cinfo,
  68.904 +				      int version, size_t structsize));
  68.905 +EXTERN(void) jpeg_CreateDecompress JPP((j_decompress_ptr cinfo,
  68.906 +					int version, size_t structsize));
  68.907 +/* Destruction of JPEG compression objects */
  68.908 +EXTERN(void) jpeg_destroy_compress JPP((j_compress_ptr cinfo));
  68.909 +EXTERN(void) jpeg_destroy_decompress JPP((j_decompress_ptr cinfo));
  68.910 +
  68.911 +/* Standard data source and destination managers: stdio streams. */
  68.912 +/* Caller is responsible for opening the file before and closing after. */
  68.913 +EXTERN(void) jpeg_stdio_dest JPP((j_compress_ptr cinfo, FILE * outfile));
  68.914 +EXTERN(void) jpeg_stdio_src JPP((j_decompress_ptr cinfo, FILE * infile));
  68.915 +
  68.916 +/* Default parameter setup for compression */
  68.917 +EXTERN(void) jpeg_set_defaults JPP((j_compress_ptr cinfo));
  68.918 +/* Compression parameter setup aids */
  68.919 +EXTERN(void) jpeg_set_colorspace JPP((j_compress_ptr cinfo,
  68.920 +				      J_COLOR_SPACE colorspace));
  68.921 +EXTERN(void) jpeg_default_colorspace JPP((j_compress_ptr cinfo));
  68.922 +EXTERN(void) jpeg_set_quality JPP((j_compress_ptr cinfo, int quality,
  68.923 +				   boolean force_baseline));
  68.924 +EXTERN(void) jpeg_set_linear_quality JPP((j_compress_ptr cinfo,
  68.925 +					  int scale_factor,
  68.926 +					  boolean force_baseline));
  68.927 +EXTERN(void) jpeg_add_quant_table JPP((j_compress_ptr cinfo, int which_tbl,
  68.928 +				       const unsigned int *basic_table,
  68.929 +				       int scale_factor,
  68.930 +				       boolean force_baseline));
  68.931 +EXTERN(int) jpeg_quality_scaling JPP((int quality));
  68.932 +EXTERN(void) jpeg_simple_progression JPP((j_compress_ptr cinfo));
  68.933 +EXTERN(void) jpeg_suppress_tables JPP((j_compress_ptr cinfo,
  68.934 +				       boolean suppress));
  68.935 +EXTERN(JQUANT_TBL *) jpeg_alloc_quant_table JPP((j_common_ptr cinfo));
  68.936 +EXTERN(JHUFF_TBL *) jpeg_alloc_huff_table JPP((j_common_ptr cinfo));
  68.937 +
  68.938 +/* Main entry points for compression */
  68.939 +EXTERN(void) jpeg_start_compress JPP((j_compress_ptr cinfo,
  68.940 +				      boolean write_all_tables));
  68.941 +EXTERN(JDIMENSION) jpeg_write_scanlines JPP((j_compress_ptr cinfo,
  68.942 +					     JSAMPARRAY scanlines,
  68.943 +					     JDIMENSION num_lines));
  68.944 +EXTERN(void) jpeg_finish_compress JPP((j_compress_ptr cinfo));
  68.945 +
  68.946 +/* Replaces jpeg_write_scanlines when writing raw downsampled data. */
  68.947 +EXTERN(JDIMENSION) jpeg_write_raw_data JPP((j_compress_ptr cinfo,
  68.948 +					    JSAMPIMAGE data,
  68.949 +					    JDIMENSION num_lines));
  68.950 +
  68.951 +/* Write a special marker.  See libjpeg.doc concerning safe usage. */
  68.952 +EXTERN(void) jpeg_write_marker
  68.953 +	JPP((j_compress_ptr cinfo, int marker,
  68.954 +	     const JOCTET * dataptr, unsigned int datalen));
  68.955 +/* Same, but piecemeal. */
  68.956 +EXTERN(void) jpeg_write_m_header
  68.957 +	JPP((j_compress_ptr cinfo, int marker, unsigned int datalen));
  68.958 +EXTERN(void) jpeg_write_m_byte
  68.959 +	JPP((j_compress_ptr cinfo, int val));
  68.960 +
  68.961 +/* Alternate compression function: just write an abbreviated table file */
  68.962 +EXTERN(void) jpeg_write_tables JPP((j_compress_ptr cinfo));
  68.963 +
  68.964 +/* Decompression startup: read start of JPEG datastream to see what's there */
  68.965 +EXTERN(int) jpeg_read_header JPP((j_decompress_ptr cinfo,
  68.966 +				  boolean require_image));
  68.967 +/* Return value is one of: */
  68.968 +#define JPEG_SUSPENDED		0 /* Suspended due to lack of input data */
  68.969 +#define JPEG_HEADER_OK		1 /* Found valid image datastream */
  68.970 +#define JPEG_HEADER_TABLES_ONLY	2 /* Found valid table-specs-only datastream */
  68.971 +/* If you pass require_image = TRUE (normal case), you need not check for
  68.972 + * a TABLES_ONLY return code; an abbreviated file will cause an error exit.
  68.973 + * JPEG_SUSPENDED is only possible if you use a data source module that can
  68.974 + * give a suspension return (the stdio source module doesn't).
  68.975 + */
  68.976 +
  68.977 +/* Main entry points for decompression */
  68.978 +EXTERN(boolean) jpeg_start_decompress JPP((j_decompress_ptr cinfo));
  68.979 +EXTERN(JDIMENSION) jpeg_read_scanlines JPP((j_decompress_ptr cinfo,
  68.980 +					    JSAMPARRAY scanlines,
  68.981 +					    JDIMENSION max_lines));
  68.982 +EXTERN(boolean) jpeg_finish_decompress JPP((j_decompress_ptr cinfo));
  68.983 +
  68.984 +/* Replaces jpeg_read_scanlines when reading raw downsampled data. */
  68.985 +EXTERN(JDIMENSION) jpeg_read_raw_data JPP((j_decompress_ptr cinfo,
  68.986 +					   JSAMPIMAGE data,
  68.987 +					   JDIMENSION max_lines));
  68.988 +
  68.989 +/* Additional entry points for buffered-image mode. */
  68.990 +EXTERN(boolean) jpeg_has_multiple_scans JPP((j_decompress_ptr cinfo));
  68.991 +EXTERN(boolean) jpeg_start_output JPP((j_decompress_ptr cinfo,
  68.992 +				       int scan_number));
  68.993 +EXTERN(boolean) jpeg_finish_output JPP((j_decompress_ptr cinfo));
  68.994 +EXTERN(boolean) jpeg_input_complete JPP((j_decompress_ptr cinfo));
  68.995 +EXTERN(void) jpeg_new_colormap JPP((j_decompress_ptr cinfo));
  68.996 +EXTERN(int) jpeg_consume_input JPP((j_decompress_ptr cinfo));
  68.997 +/* Return value is one of: */
  68.998 +/* #define JPEG_SUSPENDED	0    Suspended due to lack of input data */
  68.999 +#define JPEG_REACHED_SOS	1 /* Reached start of new scan */
 68.1000 +#define JPEG_REACHED_EOI	2 /* Reached end of image */
 68.1001 +#define JPEG_ROW_COMPLETED	3 /* Completed one iMCU row */
 68.1002 +#define JPEG_SCAN_COMPLETED	4 /* Completed last iMCU row of a scan */
 68.1003 +
 68.1004 +/* Precalculate output dimensions for current decompression parameters. */
 68.1005 +EXTERN(void) jpeg_calc_output_dimensions JPP((j_decompress_ptr cinfo));
 68.1006 +
 68.1007 +/* Control saving of COM and APPn markers into marker_list. */
 68.1008 +EXTERN(void) jpeg_save_markers
 68.1009 +	JPP((j_decompress_ptr cinfo, int marker_code,
 68.1010 +	     unsigned int length_limit));
 68.1011 +
 68.1012 +/* Install a special processing method for COM or APPn markers. */
 68.1013 +EXTERN(void) jpeg_set_marker_processor
 68.1014 +	JPP((j_decompress_ptr cinfo, int marker_code,
 68.1015 +	     jpeg_marker_parser_method routine));
 68.1016 +
 68.1017 +/* Read or write raw DCT coefficients --- useful for lossless transcoding. */
 68.1018 +EXTERN(jvirt_barray_ptr *) jpeg_read_coefficients JPP((j_decompress_ptr cinfo));
 68.1019 +EXTERN(void) jpeg_write_coefficients JPP((j_compress_ptr cinfo,
 68.1020 +					  jvirt_barray_ptr * coef_arrays));
 68.1021 +EXTERN(void) jpeg_copy_critical_parameters JPP((j_decompress_ptr srcinfo,
 68.1022 +						j_compress_ptr dstinfo));
 68.1023 +
 68.1024 +/* If you choose to abort compression or decompression before completing
 68.1025 + * jpeg_finish_(de)compress, then you need to clean up to release memory,
 68.1026 + * temporary files, etc.  You can just call jpeg_destroy_(de)compress
 68.1027 + * if you're done with the JPEG object, but if you want to clean it up and
 68.1028 + * reuse it, call this:
 68.1029 + */
 68.1030 +EXTERN(void) jpeg_abort_compress JPP((j_compress_ptr cinfo));
 68.1031 +EXTERN(void) jpeg_abort_decompress JPP((j_decompress_ptr cinfo));
 68.1032 +
 68.1033 +/* Generic versions of jpeg_abort and jpeg_destroy that work on either
 68.1034 + * flavor of JPEG object.  These may be more convenient in some places.
 68.1035 + */
 68.1036 +EXTERN(void) jpeg_abort JPP((j_common_ptr cinfo));
 68.1037 +EXTERN(void) jpeg_destroy JPP((j_common_ptr cinfo));
 68.1038 +
 68.1039 +/* Default restart-marker-resync procedure for use by data source modules */
 68.1040 +EXTERN(boolean) jpeg_resync_to_restart JPP((j_decompress_ptr cinfo,
 68.1041 +					    int desired));
 68.1042 +
 68.1043 +
 68.1044 +/* These marker codes are exported since applications and data source modules
 68.1045 + * are likely to want to use them.
 68.1046 + */
 68.1047 +
 68.1048 +#define JPEG_RST0	0xD0	/* RST0 marker code */
 68.1049 +#define JPEG_EOI	0xD9	/* EOI marker code */
 68.1050 +#define JPEG_APP0	0xE0	/* APP0 marker code */
 68.1051 +#define JPEG_COM	0xFE	/* COM marker code */
 68.1052 +
 68.1053 +
 68.1054 +/* If we have a brain-damaged compiler that emits warnings (or worse, errors)
 68.1055 + * for structure definitions that are never filled in, keep it quiet by
 68.1056 + * supplying dummy definitions for the various substructures.
 68.1057 + */
 68.1058 +
 68.1059 +#ifdef INCOMPLETE_TYPES_BROKEN
 68.1060 +#ifndef JPEG_INTERNALS		/* will be defined in jpegint.h */
 68.1061 +struct jvirt_sarray_control { long dummy; };
 68.1062 +struct jvirt_barray_control { long dummy; };
 68.1063 +struct jpeg_comp_master { long dummy; };
 68.1064 +struct jpeg_c_main_controller { long dummy; };
 68.1065 +struct jpeg_c_prep_controller { long dummy; };
 68.1066 +struct jpeg_c_coef_controller { long dummy; };
 68.1067 +struct jpeg_marker_writer { long dummy; };
 68.1068 +struct jpeg_color_converter { long dummy; };
 68.1069 +struct jpeg_downsampler { long dummy; };
 68.1070 +struct jpeg_forward_dct { long dummy; };
 68.1071 +struct jpeg_entropy_encoder { long dummy; };
 68.1072 +struct jpeg_decomp_master { long dummy; };
 68.1073 +struct jpeg_d_main_controller { long dummy; };
 68.1074 +struct jpeg_d_coef_controller { long dummy; };
 68.1075 +struct jpeg_d_post_controller { long dummy; };
 68.1076 +struct jpeg_input_controller { long dummy; };
 68.1077 +struct jpeg_marker_reader { long dummy; };
 68.1078 +struct jpeg_entropy_decoder { long dummy; };
 68.1079 +struct jpeg_inverse_dct { long dummy; };
 68.1080 +struct jpeg_upsampler { long dummy; };
 68.1081 +struct jpeg_color_deconverter { long dummy; };
 68.1082 +struct jpeg_color_quantizer { long dummy; };
 68.1083 +#endif /* JPEG_INTERNALS */
 68.1084 +#endif /* INCOMPLETE_TYPES_BROKEN */
 68.1085 +
 68.1086 +
 68.1087 +/*
 68.1088 + * The JPEG library modules define JPEG_INTERNALS before including this file.
 68.1089 + * The internal structure declarations are read only when that is true.
 68.1090 + * Applications using the library should not include jpegint.h, but may wish
 68.1091 + * to include jerror.h.
 68.1092 + */
 68.1093 +
 68.1094 +#ifdef JPEG_INTERNALS
 68.1095 +#include "jpegint.h"		/* fetch private declarations */
 68.1096 +#include "jerror.h"		/* fetch error codes too */
 68.1097 +#endif
 68.1098 +
 68.1099 +#endif /* JPEGLIB_H */
    69.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    69.2 +++ b/libs/libjpeg/jquant1.c	Sun Nov 01 00:36:56 2015 +0200
    69.3 @@ -0,0 +1,856 @@
    69.4 +/*
    69.5 + * jquant1.c
    69.6 + *
    69.7 + * Copyright (C) 1991-1996, Thomas G. Lane.
    69.8 + * This file is part of the Independent JPEG Group's software.
    69.9 + * For conditions of distribution and use, see the accompanying README file.
   69.10 + *
   69.11 + * This file contains 1-pass color quantization (color mapping) routines.
   69.12 + * These routines provide mapping to a fixed color map using equally spaced
   69.13 + * color values.  Optional Floyd-Steinberg or ordered dithering is available.
   69.14 + */
   69.15 +
   69.16 +#define JPEG_INTERNALS
   69.17 +#include "jinclude.h"
   69.18 +#include "jpeglib.h"
   69.19 +
   69.20 +#ifdef QUANT_1PASS_SUPPORTED
   69.21 +
   69.22 +
   69.23 +/*
   69.24 + * The main purpose of 1-pass quantization is to provide a fast, if not very
   69.25 + * high quality, colormapped output capability.  A 2-pass quantizer usually
   69.26 + * gives better visual quality; however, for quantized grayscale output this
   69.27 + * quantizer is perfectly adequate.  Dithering is highly recommended with this
   69.28 + * quantizer, though you can turn it off if you really want to.
   69.29 + *
   69.30 + * In 1-pass quantization the colormap must be chosen in advance of seeing the
   69.31 + * image.  We use a map consisting of all combinations of Ncolors[i] color
   69.32 + * values for the i'th component.  The Ncolors[] values are chosen so that
   69.33 + * their product, the total number of colors, is no more than that requested.
   69.34 + * (In most cases, the product will be somewhat less.)
   69.35 + *
   69.36 + * Since the colormap is orthogonal, the representative value for each color
   69.37 + * component can be determined without considering the other components;
   69.38 + * then these indexes can be combined into a colormap index by a standard
   69.39 + * N-dimensional-array-subscript calculation.  Most of the arithmetic involved
   69.40 + * can be precalculated and stored in the lookup table colorindex[].
   69.41 + * colorindex[i][j] maps pixel value j in component i to the nearest
   69.42 + * representative value (grid plane) for that component; this index is
   69.43 + * multiplied by the array stride for component i, so that the
   69.44 + * index of the colormap entry closest to a given pixel value is just
   69.45 + *    sum( colorindex[component-number][pixel-component-value] )
   69.46 + * Aside from being fast, this scheme allows for variable spacing between
   69.47 + * representative values with no additional lookup cost.
   69.48 + *
   69.49 + * If gamma correction has been applied in color conversion, it might be wise
   69.50 + * to adjust the color grid spacing so that the representative colors are
   69.51 + * equidistant in linear space.  At this writing, gamma correction is not
   69.52 + * implemented by jdcolor, so nothing is done here.
   69.53 + */
   69.54 +
   69.55 +
   69.56 +/* Declarations for ordered dithering.
   69.57 + *
   69.58 + * We use a standard 16x16 ordered dither array.  The basic concept of ordered
   69.59 + * dithering is described in many references, for instance Dale Schumacher's
   69.60 + * chapter II.2 of Graphics Gems II (James Arvo, ed. Academic Press, 1991).
   69.61 + * In place of Schumacher's comparisons against a "threshold" value, we add a
   69.62 + * "dither" value to the input pixel and then round the result to the nearest
   69.63 + * output value.  The dither value is equivalent to (0.5 - threshold) times
   69.64 + * the distance between output values.  For ordered dithering, we assume that
   69.65 + * the output colors are equally spaced; if not, results will probably be
   69.66 + * worse, since the dither may be too much or too little at a given point.
   69.67 + *
   69.68 + * The normal calculation would be to form pixel value + dither, range-limit
   69.69 + * this to 0..MAXJSAMPLE, and then index into the colorindex table as usual.
   69.70 + * We can skip the separate range-limiting step by extending the colorindex
   69.71 + * table in both directions.
   69.72 + */
   69.73 +
   69.74 +#define ODITHER_SIZE  16	/* dimension of dither matrix */
   69.75 +/* NB: if ODITHER_SIZE is not a power of 2, ODITHER_MASK uses will break */
   69.76 +#define ODITHER_CELLS (ODITHER_SIZE*ODITHER_SIZE)	/* # cells in matrix */
   69.77 +#define ODITHER_MASK  (ODITHER_SIZE-1) /* mask for wrapping around counters */
   69.78 +
   69.79 +typedef int ODITHER_MATRIX[ODITHER_SIZE][ODITHER_SIZE];
   69.80 +typedef int (*ODITHER_MATRIX_PTR)[ODITHER_SIZE];
   69.81 +
   69.82 +static const UINT8 base_dither_matrix[ODITHER_SIZE][ODITHER_SIZE] = {
   69.83 +  /* Bayer's order-4 dither array.  Generated by the code given in
   69.84 +   * Stephen Hawley's article "Ordered Dithering" in Graphics Gems I.
   69.85 +   * The values in this array must range from 0 to ODITHER_CELLS-1.
   69.86 +   */
   69.87 +  {   0,192, 48,240, 12,204, 60,252,  3,195, 51,243, 15,207, 63,255 },
   69.88 +  { 128, 64,176,112,140, 76,188,124,131, 67,179,115,143, 79,191,127 },
   69.89 +  {  32,224, 16,208, 44,236, 28,220, 35,227, 19,211, 47,239, 31,223 },
   69.90 +  { 160, 96,144, 80,172,108,156, 92,163, 99,147, 83,175,111,159, 95 },
   69.91 +  {   8,200, 56,248,  4,196, 52,244, 11,203, 59,251,  7,199, 55,247 },
   69.92 +  { 136, 72,184,120,132, 68,180,116,139, 75,187,123,135, 71,183,119 },
   69.93 +  {  40,232, 24,216, 36,228, 20,212, 43,235, 27,219, 39,231, 23,215 },
   69.94 +  { 168,104,152, 88,164,100,148, 84,171,107,155, 91,167,103,151, 87 },
   69.95 +  {   2,194, 50,242, 14,206, 62,254,  1,193, 49,241, 13,205, 61,253 },
   69.96 +  { 130, 66,178,114,142, 78,190,126,129, 65,177,113,141, 77,189,125 },
   69.97 +  {  34,226, 18,210, 46,238, 30,222, 33,225, 17,209, 45,237, 29,221 },
   69.98 +  { 162, 98,146, 82,174,110,158, 94,161, 97,145, 81,173,109,157, 93 },
   69.99 +  {  10,202, 58,250,  6,198, 54,246,  9,201, 57,249,  5,197, 53,245 },
  69.100 +  { 138, 74,186,122,134, 70,182,118,137, 73,185,121,133, 69,181,117 },
  69.101 +  {  42,234, 26,218, 38,230, 22,214, 41,233, 25,217, 37,229, 21,213 },
  69.102 +  { 170,106,154, 90,166,102,150, 86,169,105,153, 89,165,101,149, 85 }
  69.103 +};
  69.104 +
  69.105 +
  69.106 +/* Declarations for Floyd-Steinberg dithering.
  69.107 + *
  69.108 + * Errors are accumulated into the array fserrors[], at a resolution of
  69.109 + * 1/16th of a pixel count.  The error at a given pixel is propagated
  69.110 + * to its not-yet-processed neighbors using the standard F-S fractions,
  69.111 + *		...	(here)	7/16
  69.112 + *		3/16	5/16	1/16
  69.113 + * We work left-to-right on even rows, right-to-left on odd rows.
  69.114 + *
  69.115 + * We can get away with a single array (holding one row's worth of errors)
  69.116 + * by using it to store the current row's errors at pixel columns not yet
  69.117 + * processed, but the next row's errors at columns already processed.  We
  69.118 + * need only a few extra variables to hold the errors immediately around the
  69.119 + * current column.  (If we are lucky, those variables are in registers, but
  69.120 + * even if not, they're probably cheaper to access than array elements are.)
  69.121 + *
  69.122 + * The fserrors[] array is indexed [component#][position].
  69.123 + * We provide (#columns + 2) entries per component; the extra entry at each
  69.124 + * end saves us from special-casing the first and last pixels.
  69.125 + *
  69.126 + * Note: on a wide image, we might not have enough room in a PC's near data
  69.127 + * segment to hold the error array; so it is allocated with alloc_large.
  69.128 + */
  69.129 +
  69.130 +#if BITS_IN_JSAMPLE == 8
  69.131 +typedef INT16 FSERROR;		/* 16 bits should be enough */
  69.132 +typedef int LOCFSERROR;		/* use 'int' for calculation temps */
  69.133 +#else
  69.134 +typedef INT32 FSERROR;		/* may need more than 16 bits */
  69.135 +typedef INT32 LOCFSERROR;	/* be sure calculation temps are big enough */
  69.136 +#endif
  69.137 +
  69.138 +typedef FSERROR FAR *FSERRPTR;	/* pointer to error array (in FAR storage!) */
  69.139 +
  69.140 +
  69.141 +/* Private subobject */
  69.142 +
  69.143 +#define MAX_Q_COMPS 4		/* max components I can handle */
  69.144 +
  69.145 +typedef struct {
  69.146 +  struct jpeg_color_quantizer pub; /* public fields */
  69.147 +
  69.148 +  /* Initially allocated colormap is saved here */
  69.149 +  JSAMPARRAY sv_colormap;	/* The color map as a 2-D pixel array */
  69.150 +  int sv_actual;		/* number of entries in use */
  69.151 +
  69.152 +  JSAMPARRAY colorindex;	/* Precomputed mapping for speed */
  69.153 +  /* colorindex[i][j] = index of color closest to pixel value j in component i,
  69.154 +   * premultiplied as described above.  Since colormap indexes must fit into
  69.155 +   * JSAMPLEs, the entries of this array will too.
  69.156 +   */
  69.157 +  boolean is_padded;		/* is the colorindex padded for odither? */
  69.158 +
  69.159 +  int Ncolors[MAX_Q_COMPS];	/* # of values alloced to each component */
  69.160 +
  69.161 +  /* Variables for ordered dithering */
  69.162 +  int row_index;		/* cur row's vertical index in dither matrix */
  69.163 +  ODITHER_MATRIX_PTR odither[MAX_Q_COMPS]; /* one dither array per component */
  69.164 +
  69.165 +  /* Variables for Floyd-Steinberg dithering */
  69.166 +  FSERRPTR fserrors[MAX_Q_COMPS]; /* accumulated errors */
  69.167 +  boolean on_odd_row;		/* flag to remember which row we are on */
  69.168 +} my_cquantizer;
  69.169 +
  69.170 +typedef my_cquantizer * my_cquantize_ptr;
  69.171 +
  69.172 +
  69.173 +/*
  69.174 + * Policy-making subroutines for create_colormap and create_colorindex.
  69.175 + * These routines determine the colormap to be used.  The rest of the module
  69.176 + * only assumes that the colormap is orthogonal.
  69.177 + *
  69.178 + *  * select_ncolors decides how to divvy up the available colors
  69.179 + *    among the components.
  69.180 + *  * output_value defines the set of representative values for a component.
  69.181 + *  * largest_input_value defines the mapping from input values to
  69.182 + *    representative values for a component.
  69.183 + * Note that the latter two routines may impose different policies for
  69.184 + * different components, though this is not currently done.
  69.185 + */
  69.186 +
  69.187 +
  69.188 +LOCAL(int)
  69.189 +select_ncolors (j_decompress_ptr cinfo, int Ncolors[])
  69.190 +/* Determine allocation of desired colors to components, */
  69.191 +/* and fill in Ncolors[] array to indicate choice. */
  69.192 +/* Return value is total number of colors (product of Ncolors[] values). */
  69.193 +{
  69.194 +  int nc = cinfo->out_color_components; /* number of color components */
  69.195 +  int max_colors = cinfo->desired_number_of_colors;
  69.196 +  int total_colors, iroot, i, j;
  69.197 +  boolean changed;
  69.198 +  long temp;
  69.199 +  static const int RGB_order[3] = { RGB_GREEN, RGB_RED, RGB_BLUE };
  69.200 +
  69.201 +  /* We can allocate at least the nc'th root of max_colors per component. */
  69.202 +  /* Compute floor(nc'th root of max_colors). */
  69.203 +  iroot = 1;
  69.204 +  do {
  69.205 +    iroot++;
  69.206 +    temp = iroot;		/* set temp = iroot ** nc */
  69.207 +    for (i = 1; i < nc; i++)
  69.208 +      temp *= iroot;
  69.209 +  } while (temp <= (long) max_colors); /* repeat till iroot exceeds root */
  69.210 +  iroot--;			/* now iroot = floor(root) */
  69.211 +
  69.212 +  /* Must have at least 2 color values per component */
  69.213 +  if (iroot < 2)
  69.214 +    ERREXIT1(cinfo, JERR_QUANT_FEW_COLORS, (int) temp);
  69.215 +
  69.216 +  /* Initialize to iroot color values for each component */
  69.217 +  total_colors = 1;
  69.218 +  for (i = 0; i < nc; i++) {
  69.219 +    Ncolors[i] = iroot;
  69.220 +    total_colors *= iroot;
  69.221 +  }
  69.222 +  /* We may be able to increment the count for one or more components without
  69.223 +   * exceeding max_colors, though we know not all can be incremented.
  69.224 +   * Sometimes, the first component can be incremented more than once!
  69.225 +   * (Example: for 16 colors, we start at 2*2*2, go to 3*2*2, then 4*2*2.)
  69.226 +   * In RGB colorspace, try to increment G first, then R, then B.
  69.227 +   */
  69.228 +  do {
  69.229 +    changed = FALSE;
  69.230 +    for (i = 0; i < nc; i++) {
  69.231 +      j = (cinfo->out_color_space == JCS_RGB ? RGB_order[i] : i);
  69.232 +      /* calculate new total_colors if Ncolors[j] is incremented */
  69.233 +      temp = total_colors / Ncolors[j];
  69.234 +      temp *= Ncolors[j]+1;	/* done in long arith to avoid oflo */
  69.235 +      if (temp > (long) max_colors)
  69.236 +	break;			/* won't fit, done with this pass */
  69.237 +      Ncolors[j]++;		/* OK, apply the increment */
  69.238 +      total_colors = (int) temp;
  69.239 +      changed = TRUE;
  69.240 +    }
  69.241 +  } while (changed);
  69.242 +
  69.243 +  return total_colors;
  69.244 +}
  69.245 +
  69.246 +
  69.247 +LOCAL(int)
  69.248 +output_value (j_decompress_ptr cinfo, int ci, int j, int maxj)
  69.249 +/* Return j'th output value, where j will range from 0 to maxj */
  69.250 +/* The output values must fall in 0..MAXJSAMPLE in increasing order */
  69.251 +{
  69.252 +  /* We always provide values 0 and MAXJSAMPLE for each component;
  69.253 +   * any additional values are equally spaced between these limits.
  69.254 +   * (Forcing the upper and lower values to the limits ensures that
  69.255 +   * dithering can't produce a color outside the selected gamut.)
  69.256 +   */
  69.257 +  return (int) (((INT32) j * MAXJSAMPLE + maxj/2) / maxj);
  69.258 +}
  69.259 +
  69.260 +
  69.261 +LOCAL(int)
  69.262 +largest_input_value (j_decompress_ptr cinfo, int ci, int j, int maxj)
  69.263 +/* Return largest input value that should map to j'th output value */
  69.264 +/* Must have largest(j=0) >= 0, and largest(j=maxj) >= MAXJSAMPLE */
  69.265 +{
  69.266 +  /* Breakpoints are halfway between values returned by output_value */
  69.267 +  return (int) (((INT32) (2*j + 1) * MAXJSAMPLE + maxj) / (2*maxj));
  69.268 +}
  69.269 +
  69.270 +
  69.271 +/*
  69.272 + * Create the colormap.
  69.273 + */
  69.274 +
  69.275 +LOCAL(void)
  69.276 +create_colormap (j_decompress_ptr cinfo)
  69.277 +{
  69.278 +  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
  69.279 +  JSAMPARRAY colormap;		/* Created colormap */
  69.280 +  int total_colors;		/* Number of distinct output colors */
  69.281 +  int i,j,k, nci, blksize, blkdist, ptr, val;
  69.282 +
  69.283 +  /* Select number of colors for each component */
  69.284 +  total_colors = select_ncolors(cinfo, cquantize->Ncolors);
  69.285 +
  69.286 +  /* Report selected color counts */
  69.287 +  if (cinfo->out_color_components == 3)
  69.288 +    TRACEMS4(cinfo, 1, JTRC_QUANT_3_NCOLORS,
  69.289 +	     total_colors, cquantize->Ncolors[0],
  69.290 +	     cquantize->Ncolors[1], cquantize->Ncolors[2]);
  69.291 +  else
  69.292 +    TRACEMS1(cinfo, 1, JTRC_QUANT_NCOLORS, total_colors);
  69.293 +
  69.294 +  /* Allocate and fill in the colormap. */
  69.295 +  /* The colors are ordered in the map in standard row-major order, */
  69.296 +  /* i.e. rightmost (highest-indexed) color changes most rapidly. */
  69.297 +
  69.298 +  colormap = (*cinfo->mem->alloc_sarray)
  69.299 +    ((j_common_ptr) cinfo, JPOOL_IMAGE,
  69.300 +     (JDIMENSION) total_colors, (JDIMENSION) cinfo->out_color_components);
  69.301 +
  69.302 +  /* blksize is number of adjacent repeated entries for a component */
  69.303 +  /* blkdist is distance between groups of identical entries for a component */
  69.304 +  blkdist = total_colors;
  69.305 +
  69.306 +  for (i = 0; i < cinfo->out_color_components; i++) {
  69.307 +    /* fill in colormap entries for i'th color component */
  69.308 +    nci = cquantize->Ncolors[i]; /* # of distinct values for this color */
  69.309 +    blksize = blkdist / nci;
  69.310 +    for (j = 0; j < nci; j++) {
  69.311 +      /* Compute j'th output value (out of nci) for component */
  69.312 +      val = output_value(cinfo, i, j, nci-1);
  69.313 +      /* Fill in all colormap entries that have this value of this component */
  69.314 +      for (ptr = j * blksize; ptr < total_colors; ptr += blkdist) {
  69.315 +	/* fill in blksize entries beginning at ptr */
  69.316 +	for (k = 0; k < blksize; k++)
  69.317 +	  colormap[i][ptr+k] = (JSAMPLE) val;
  69.318 +      }
  69.319 +    }
  69.320 +    blkdist = blksize;		/* blksize of this color is blkdist of next */
  69.321 +  }
  69.322 +
  69.323 +  /* Save the colormap in private storage,
  69.324 +   * where it will survive color quantization mode changes.
  69.325 +   */
  69.326 +  cquantize->sv_colormap = colormap;
  69.327 +  cquantize->sv_actual = total_colors;
  69.328 +}
  69.329 +
  69.330 +
  69.331 +/*
  69.332 + * Create the color index table.
  69.333 + */
  69.334 +
  69.335 +LOCAL(void)
  69.336 +create_colorindex (j_decompress_ptr cinfo)
  69.337 +{
  69.338 +  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
  69.339 +  JSAMPROW indexptr;
  69.340 +  int i,j,k, nci, blksize, val, pad;
  69.341 +
  69.342 +  /* For ordered dither, we pad the color index tables by MAXJSAMPLE in
  69.343 +   * each direction (input index values can be -MAXJSAMPLE .. 2*MAXJSAMPLE).
  69.344 +   * This is not necessary in the other dithering modes.  However, we
  69.345 +   * flag whether it was done in case user changes dithering mode.
  69.346 +   */
  69.347 +  if (cinfo->dither_mode == JDITHER_ORDERED) {
  69.348 +    pad = MAXJSAMPLE*2;
  69.349 +    cquantize->is_padded = TRUE;
  69.350 +  } else {
  69.351 +    pad = 0;
  69.352 +    cquantize->is_padded = FALSE;
  69.353 +  }
  69.354 +
  69.355 +  cquantize->colorindex = (*cinfo->mem->alloc_sarray)
  69.356 +    ((j_common_ptr) cinfo, JPOOL_IMAGE,
  69.357 +     (JDIMENSION) (MAXJSAMPLE+1 + pad),
  69.358 +     (JDIMENSION) cinfo->out_color_components);
  69.359 +
  69.360 +  /* blksize is number of adjacent repeated entries for a component */
  69.361 +  blksize = cquantize->sv_actual;
  69.362 +
  69.363 +  for (i = 0; i < cinfo->out_color_components; i++) {
  69.364 +    /* fill in colorindex entries for i'th color component */
  69.365 +    nci = cquantize->Ncolors[i]; /* # of distinct values for this color */
  69.366 +    blksize = blksize / nci;
  69.367 +
  69.368 +    /* adjust colorindex pointers to provide padding at negative indexes. */
  69.369 +    if (pad)
  69.370 +      cquantize->colorindex[i] += MAXJSAMPLE;
  69.371 +
  69.372 +    /* in loop, val = index of current output value, */
  69.373 +    /* and k = largest j that maps to current val */
  69.374 +    indexptr = cquantize->colorindex[i];
  69.375 +    val = 0;
  69.376 +    k = largest_input_value(cinfo, i, 0, nci-1);
  69.377 +    for (j = 0; j <= MAXJSAMPLE; j++) {
  69.378 +      while (j > k)		/* advance val if past boundary */
  69.379 +	k = largest_input_value(cinfo, i, ++val, nci-1);
  69.380 +      /* premultiply so that no multiplication needed in main processing */
  69.381 +      indexptr[j] = (JSAMPLE) (val * blksize);
  69.382 +    }
  69.383 +    /* Pad at both ends if necessary */
  69.384 +    if (pad)
  69.385 +      for (j = 1; j <= MAXJSAMPLE; j++) {
  69.386 +	indexptr[-j] = indexptr[0];
  69.387 +	indexptr[MAXJSAMPLE+j] = indexptr[MAXJSAMPLE];
  69.388 +      }
  69.389 +  }
  69.390 +}
  69.391 +
  69.392 +
  69.393 +/*
  69.394 + * Create an ordered-dither array for a component having ncolors
  69.395 + * distinct output values.
  69.396 + */
  69.397 +
  69.398 +LOCAL(ODITHER_MATRIX_PTR)
  69.399 +make_odither_array (j_decompress_ptr cinfo, int ncolors)
  69.400 +{
  69.401 +  ODITHER_MATRIX_PTR odither;
  69.402 +  int j,k;
  69.403 +  INT32 num,den;
  69.404 +
  69.405 +  odither = (ODITHER_MATRIX_PTR)
  69.406 +    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
  69.407 +				SIZEOF(ODITHER_MATRIX));
  69.408 +  /* The inter-value distance for this color is MAXJSAMPLE/(ncolors-1).
  69.409 +   * Hence the dither value for the matrix cell with fill order f
  69.410 +   * (f=0..N-1) should be (N-1-2*f)/(2*N) * MAXJSAMPLE/(ncolors-1).
  69.411 +   * On 16-bit-int machine, be careful to avoid overflow.
  69.412 +   */
  69.413 +  den = 2 * ODITHER_CELLS * ((INT32) (ncolors - 1));
  69.414 +  for (j = 0; j < ODITHER_SIZE; j++) {
  69.415 +    for (k = 0; k < ODITHER_SIZE; k++) {
  69.416 +      num = ((INT32) (ODITHER_CELLS-1 - 2*((int)base_dither_matrix[j][k])))
  69.417 +	    * MAXJSAMPLE;
  69.418 +      /* Ensure round towards zero despite C's lack of consistency
  69.419 +       * about rounding negative values in integer division...
  69.420 +       */
  69.421 +      odither[j][k] = (int) (num<0 ? -((-num)/den) : num/den);
  69.422 +    }
  69.423 +  }
  69.424 +  return odither;
  69.425 +}
  69.426 +
  69.427 +
  69.428 +/*
  69.429 + * Create the ordered-dither tables.
  69.430 + * Components having the same number of representative colors may 
  69.431 + * share a dither table.
  69.432 + */
  69.433 +
  69.434 +LOCAL(void)
  69.435 +create_odither_tables (j_decompress_ptr cinfo)
  69.436 +{
  69.437 +  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
  69.438 +  ODITHER_MATRIX_PTR odither;
  69.439 +  int i, j, nci;
  69.440 +
  69.441 +  for (i = 0; i < cinfo->out_color_components; i++) {
  69.442 +    nci = cquantize->Ncolors[i]; /* # of distinct values for this color */
  69.443 +    odither = NULL;		/* search for matching prior component */
  69.444 +    for (j = 0; j < i; j++) {
  69.445 +      if (nci == cquantize->Ncolors[j]) {
  69.446 +	odither = cquantize->odither[j];
  69.447 +	break;
  69.448 +      }
  69.449 +    }
  69.450 +    if (odither == NULL)	/* need a new table? */
  69.451 +      odither = make_odither_array(cinfo, nci);
  69.452 +    cquantize->odither[i] = odither;
  69.453 +  }
  69.454 +}
  69.455 +
  69.456 +
  69.457 +/*
  69.458 + * Map some rows of pixels to the output colormapped representation.
  69.459 + */
  69.460 +
  69.461 +METHODDEF(void)
  69.462 +color_quantize (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
  69.463 +		JSAMPARRAY output_buf, int num_rows)
  69.464 +/* General case, no dithering */
  69.465 +{
  69.466 +  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
  69.467 +  JSAMPARRAY colorindex = cquantize->colorindex;
  69.468 +  register int pixcode, ci;
  69.469 +  register JSAMPROW ptrin, ptrout;
  69.470 +  int row;
  69.471 +  JDIMENSION col;
  69.472 +  JDIMENSION width = cinfo->output_width;
  69.473 +  register int nc = cinfo->out_color_components;
  69.474 +
  69.475 +  for (row = 0; row < num_rows; row++) {
  69.476 +    ptrin = input_buf[row];
  69.477 +    ptrout = output_buf[row];
  69.478 +    for (col = width; col > 0; col--) {
  69.479 +      pixcode = 0;
  69.480 +      for (ci = 0; ci < nc; ci++) {
  69.481 +	pixcode += GETJSAMPLE(colorindex[ci][GETJSAMPLE(*ptrin++)]);
  69.482 +      }
  69.483 +      *ptrout++ = (JSAMPLE) pixcode;
  69.484 +    }
  69.485 +  }
  69.486 +}
  69.487 +
  69.488 +
  69.489 +METHODDEF(void)
  69.490 +color_quantize3 (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
  69.491 +		 JSAMPARRAY output_buf, int num_rows)
  69.492 +/* Fast path for out_color_components==3, no dithering */
  69.493 +{
  69.494 +  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
  69.495 +  register int pixcode;
  69.496 +  register JSAMPROW ptrin, ptrout;
  69.497 +  JSAMPROW colorindex0 = cquantize->colorindex[0];
  69.498 +  JSAMPROW colorindex1 = cquantize->colorindex[1];
  69.499 +  JSAMPROW colorindex2 = cquantize->colorindex[2];
  69.500 +  int row;
  69.501 +  JDIMENSION col;
  69.502 +  JDIMENSION width = cinfo->output_width;
  69.503 +
  69.504 +  for (row = 0; row < num_rows; row++) {
  69.505 +    ptrin = input_buf[row];
  69.506 +    ptrout = output_buf[row];
  69.507 +    for (col = width; col > 0; col--) {
  69.508 +      pixcode  = GETJSAMPLE(colorindex0[GETJSAMPLE(*ptrin++)]);
  69.509 +      pixcode += GETJSAMPLE(colorindex1[GETJSAMPLE(*ptrin++)]);
  69.510 +      pixcode += GETJSAMPLE(colorindex2[GETJSAMPLE(*ptrin++)]);
  69.511 +      *ptrout++ = (JSAMPLE) pixcode;
  69.512 +    }
  69.513 +  }
  69.514 +}
  69.515 +
  69.516 +
  69.517 +METHODDEF(void)
  69.518 +quantize_ord_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
  69.519 +		     JSAMPARRAY output_buf, int num_rows)
  69.520 +/* General case, with ordered dithering */
  69.521 +{
  69.522 +  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
  69.523 +  register JSAMPROW input_ptr;
  69.524 +  register JSAMPROW output_ptr;
  69.525 +  JSAMPROW colorindex_ci;
  69.526 +  int * dither;			/* points to active row of dither matrix */
  69.527 +  int row_index, col_index;	/* current indexes into dither matrix */
  69.528 +  int nc = cinfo->out_color_components;
  69.529 +  int ci;
  69.530 +  int row;
  69.531 +  JDIMENSION col;
  69.532 +  JDIMENSION width = cinfo->output_width;
  69.533 +
  69.534 +  for (row = 0; row < num_rows; row++) {
  69.535 +    /* Initialize output values to 0 so can process components separately */
  69.536 +    jzero_far((void FAR *) output_buf[row],
  69.537 +	      (size_t) (width * SIZEOF(JSAMPLE)));
  69.538 +    row_index = cquantize->row_index;
  69.539 +    for (ci = 0; ci < nc; ci++) {
  69.540 +      input_ptr = input_buf[row] + ci;
  69.541 +      output_ptr = output_buf[row];
  69.542 +      colorindex_ci = cquantize->colorindex[ci];
  69.543 +      dither = cquantize->odither[ci][row_index];
  69.544 +      col_index = 0;
  69.545 +
  69.546 +      for (col = width; col > 0; col--) {
  69.547 +	/* Form pixel value + dither, range-limit to 0..MAXJSAMPLE,
  69.548 +	 * select output value, accumulate into output code for this pixel.
  69.549 +	 * Range-limiting need not be done explicitly, as we have extended
  69.550 +	 * the colorindex table to produce the right answers for out-of-range
  69.551 +	 * inputs.  The maximum dither is +- MAXJSAMPLE; this sets the
  69.552 +	 * required amount of padding.
  69.553 +	 */
  69.554 +	*output_ptr += colorindex_ci[GETJSAMPLE(*input_ptr)+dither[col_index]];
  69.555 +	input_ptr += nc;
  69.556 +	output_ptr++;
  69.557 +	col_index = (col_index + 1) & ODITHER_MASK;
  69.558 +      }
  69.559 +    }
  69.560 +    /* Advance row index for next row */
  69.561 +    row_index = (row_index + 1) & ODITHER_MASK;
  69.562 +    cquantize->row_index = row_index;
  69.563 +  }
  69.564 +}
  69.565 +
  69.566 +
  69.567 +METHODDEF(void)
  69.568 +quantize3_ord_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
  69.569 +		      JSAMPARRAY output_buf, int num_rows)
  69.570 +/* Fast path for out_color_components==3, with ordered dithering */
  69.571 +{
  69.572 +  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
  69.573 +  register int pixcode;
  69.574 +  register JSAMPROW input_ptr;
  69.575 +  register JSAMPROW output_ptr;
  69.576 +  JSAMPROW colorindex0 = cquantize->colorindex[0];
  69.577 +  JSAMPROW colorindex1 = cquantize->colorindex[1];
  69.578 +  JSAMPROW colorindex2 = cquantize->colorindex[2];
  69.579 +  int * dither0;		/* points to active row of dither matrix */
  69.580 +  int * dither1;
  69.581 +  int * dither2;
  69.582 +  int row_index, col_index;	/* current indexes into dither matrix */
  69.583 +  int row;
  69.584 +  JDIMENSION col;
  69.585 +  JDIMENSION width = cinfo->output_width;
  69.586 +
  69.587 +  for (row = 0; row < num_rows; row++) {
  69.588 +    row_index = cquantize->row_index;
  69.589 +    input_ptr = input_buf[row];
  69.590 +    output_ptr = output_buf[row];
  69.591 +    dither0 = cquantize->odither[0][row_index];
  69.592 +    dither1 = cquantize->odither[1][row_index];
  69.593 +    dither2 = cquantize->odither[2][row_index];
  69.594 +    col_index = 0;
  69.595 +
  69.596 +    for (col = width; col > 0; col--) {
  69.597 +      pixcode  = GETJSAMPLE(colorindex0[GETJSAMPLE(*input_ptr++) +
  69.598 +					dither0[col_index]]);
  69.599 +      pixcode += GETJSAMPLE(colorindex1[GETJSAMPLE(*input_ptr++) +
  69.600 +					dither1[col_index]]);
  69.601 +      pixcode += GETJSAMPLE(colorindex2[GETJSAMPLE(*input_ptr++) +
  69.602 +					dither2[col_index]]);
  69.603 +      *output_ptr++ = (JSAMPLE) pixcode;
  69.604 +      col_index = (col_index + 1) & ODITHER_MASK;
  69.605 +    }
  69.606 +    row_index = (row_index + 1) & ODITHER_MASK;
  69.607 +    cquantize->row_index = row_index;
  69.608 +  }
  69.609 +}
  69.610 +
  69.611 +
  69.612 +METHODDEF(void)
  69.613 +quantize_fs_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
  69.614 +		    JSAMPARRAY output_buf, int num_rows)
  69.615 +/* General case, with Floyd-Steinberg dithering */
  69.616 +{
  69.617 +  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
  69.618 +  register LOCFSERROR cur;	/* current error or pixel value */
  69.619 +  LOCFSERROR belowerr;		/* error for pixel below cur */
  69.620 +  LOCFSERROR bpreverr;		/* error for below/prev col */
  69.621 +  LOCFSERROR bnexterr;		/* error for below/next col */
  69.622 +  LOCFSERROR delta;
  69.623 +  register FSERRPTR errorptr;	/* => fserrors[] at column before current */
  69.624 +  register JSAMPROW input_ptr;
  69.625 +  register JSAMPROW output_ptr;
  69.626 +  JSAMPROW colorindex_ci;
  69.627 +  JSAMPROW colormap_ci;
  69.628 +  int pixcode;
  69.629 +  int nc = cinfo->out_color_components;
  69.630 +  int dir;			/* 1 for left-to-right, -1 for right-to-left */
  69.631 +  int dirnc;			/* dir * nc */
  69.632 +  int ci;
  69.633 +  int row;
  69.634 +  JDIMENSION col;
  69.635 +  JDIMENSION width = cinfo->output_width;
  69.636 +  JSAMPLE *range_limit = cinfo->sample_range_limit;
  69.637 +  SHIFT_TEMPS
  69.638 +
  69.639 +  for (row = 0; row < num_rows; row++) {
  69.640 +    /* Initialize output values to 0 so can process components separately */
  69.641 +    jzero_far((void FAR *) output_buf[row],
  69.642 +	      (size_t) (width * SIZEOF(JSAMPLE)));
  69.643 +    for (ci = 0; ci < nc; ci++) {
  69.644 +      input_ptr = input_buf[row] + ci;
  69.645 +      output_ptr = output_buf[row];
  69.646 +      if (cquantize->on_odd_row) {
  69.647 +	/* work right to left in this row */
  69.648 +	input_ptr += (width-1) * nc; /* so point to rightmost pixel */
  69.649 +	output_ptr += width-1;
  69.650 +	dir = -1;
  69.651 +	dirnc = -nc;
  69.652 +	errorptr = cquantize->fserrors[ci] + (width+1); /* => entry after last column */
  69.653 +      } else {
  69.654 +	/* work left to right in this row */
  69.655 +	dir = 1;
  69.656 +	dirnc = nc;
  69.657 +	errorptr = cquantize->fserrors[ci]; /* => entry before first column */
  69.658 +      }
  69.659 +      colorindex_ci = cquantize->colorindex[ci];
  69.660 +      colormap_ci = cquantize->sv_colormap[ci];
  69.661 +      /* Preset error values: no error propagated to first pixel from left */
  69.662 +      cur = 0;
  69.663 +      /* and no error propagated to row below yet */
  69.664 +      belowerr = bpreverr = 0;
  69.665 +
  69.666 +      for (col = width; col > 0; col--) {
  69.667 +	/* cur holds the error propagated from the previous pixel on the
  69.668 +	 * current line.  Add the error propagated from the previous line
  69.669 +	 * to form the complete error correction term for this pixel, and
  69.670 +	 * round the error term (which is expressed * 16) to an integer.
  69.671 +	 * RIGHT_SHIFT rounds towards minus infinity, so adding 8 is correct
  69.672 +	 * for either sign of the error value.
  69.673 +	 * Note: errorptr points to *previous* column's array entry.
  69.674 +	 */
  69.675 +	cur = RIGHT_SHIFT(cur + errorptr[dir] + 8, 4);
  69.676 +	/* Form pixel value + error, and range-limit to 0..MAXJSAMPLE.
  69.677 +	 * The maximum error is +- MAXJSAMPLE; this sets the required size
  69.678 +	 * of the range_limit array.
  69.679 +	 */
  69.680 +	cur += GETJSAMPLE(*input_ptr);
  69.681 +	cur = GETJSAMPLE(range_limit[cur]);
  69.682 +	/* Select output value, accumulate into output code for this pixel */
  69.683 +	pixcode = GETJSAMPLE(colorindex_ci[cur]);
  69.684 +	*output_ptr += (JSAMPLE) pixcode;
  69.685 +	/* Compute actual representation error at this pixel */
  69.686 +	/* Note: we can do this even though we don't have the final */
  69.687 +	/* pixel code, because the colormap is orthogonal. */
  69.688 +	cur -= GETJSAMPLE(colormap_ci[pixcode]);
  69.689 +	/* Compute error fractions to be propagated to adjacent pixels.
  69.690 +	 * Add these into the running sums, and simultaneously shift the
  69.691 +	 * next-line error sums left by 1 column.
  69.692 +	 */
  69.693 +	bnexterr = cur;
  69.694 +	delta = cur * 2;
  69.695 +	cur += delta;		/* form error * 3 */
  69.696 +	errorptr[0] = (FSERROR) (bpreverr + cur);
  69.697 +	cur += delta;		/* form error * 5 */
  69.698 +	bpreverr = belowerr + cur;
  69.699 +	belowerr = bnexterr;
  69.700 +	cur += delta;		/* form error * 7 */
  69.701 +	/* At this point cur contains the 7/16 error value to be propagated
  69.702 +	 * to the next pixel on the current line, and all the errors for the
  69.703 +	 * next line have been shifted over. We are therefore ready to move on.
  69.704 +	 */
  69.705 +	input_ptr += dirnc;	/* advance input ptr to next column */
  69.706 +	output_ptr += dir;	/* advance output ptr to next column */
  69.707 +	errorptr += dir;	/* advance errorptr to current column */
  69.708 +      }
  69.709 +      /* Post-loop cleanup: we must unload the final error value into the
  69.710 +       * final fserrors[] entry.  Note we need not unload belowerr because
  69.711 +       * it is for the dummy column before or after the actual array.
  69.712 +       */
  69.713 +      errorptr[0] = (FSERROR) bpreverr; /* unload prev err into array */
  69.714 +    }
  69.715 +    cquantize->on_odd_row = (cquantize->on_odd_row ? FALSE : TRUE);
  69.716 +  }
  69.717 +}
  69.718 +
  69.719 +
  69.720 +/*
  69.721 + * Allocate workspace for Floyd-Steinberg errors.
  69.722 + */
  69.723 +
  69.724 +LOCAL(void)
  69.725 +alloc_fs_workspace (j_decompress_ptr cinfo)
  69.726 +{
  69.727 +  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
  69.728 +  size_t arraysize;
  69.729 +  int i;
  69.730 +
  69.731 +  arraysize = (size_t) ((cinfo->output_width + 2) * SIZEOF(FSERROR));
  69.732 +  for (i = 0; i < cinfo->out_color_components; i++) {
  69.733 +    cquantize->fserrors[i] = (FSERRPTR)
  69.734 +      (*cinfo->mem->alloc_large)((j_common_ptr) cinfo, JPOOL_IMAGE, arraysize);
  69.735 +  }
  69.736 +}
  69.737 +
  69.738 +
  69.739 +/*
  69.740 + * Initialize for one-pass color quantization.
  69.741 + */
  69.742 +
  69.743 +METHODDEF(void)
  69.744 +start_pass_1_quant (j_decompress_ptr cinfo, boolean is_pre_scan)
  69.745 +{
  69.746 +  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
  69.747 +  size_t arraysize;
  69.748 +  int i;
  69.749 +
  69.750 +  /* Install my colormap. */
  69.751 +  cinfo->colormap = cquantize->sv_colormap;
  69.752 +  cinfo->actual_number_of_colors = cquantize->sv_actual;
  69.753 +
  69.754 +  /* Initialize for desired dithering mode. */
  69.755 +  switch (cinfo->dither_mode) {
  69.756 +  case JDITHER_NONE:
  69.757 +    if (cinfo->out_color_components == 3)
  69.758 +      cquantize->pub.color_quantize = color_quantize3;
  69.759 +    else
  69.760 +      cquantize->pub.color_quantize = color_quantize;
  69.761 +    break;
  69.762 +  case JDITHER_ORDERED:
  69.763 +    if (cinfo->out_color_components == 3)
  69.764 +      cquantize->pub.color_quantize = quantize3_ord_dither;
  69.765 +    else
  69.766 +      cquantize->pub.color_quantize = quantize_ord_dither;
  69.767 +    cquantize->row_index = 0;	/* initialize state for ordered dither */
  69.768 +    /* If user changed to ordered dither from another mode,
  69.769 +     * we must recreate the color index table with padding.
  69.770 +     * This will cost extra space, but probably isn't very likely.
  69.771 +     */
  69.772 +    if (! cquantize->is_padded)
  69.773 +      create_colorindex(cinfo);
  69.774 +    /* Create ordered-dither tables if we didn't already. */
  69.775 +    if (cquantize->odither[0] == NULL)
  69.776 +      create_odither_tables(cinfo);
  69.777 +    break;
  69.778 +  case JDITHER_FS:
  69.779 +    cquantize->pub.color_quantize = quantize_fs_dither;
  69.780 +    cquantize->on_odd_row = FALSE; /* initialize state for F-S dither */
  69.781 +    /* Allocate Floyd-Steinberg workspace if didn't already. */
  69.782 +    if (cquantize->fserrors[0] == NULL)
  69.783 +      alloc_fs_workspace(cinfo);
  69.784 +    /* Initialize the propagated errors to zero. */
  69.785 +    arraysize = (size_t) ((cinfo->output_width + 2) * SIZEOF(FSERROR));
  69.786 +    for (i = 0; i < cinfo->out_color_components; i++)
  69.787 +      jzero_far((void FAR *) cquantize->fserrors[i], arraysize);
  69.788 +    break;
  69.789 +  default:
  69.790 +    ERREXIT(cinfo, JERR_NOT_COMPILED);
  69.791 +    break;
  69.792 +  }
  69.793 +}
  69.794 +
  69.795 +
  69.796 +/*
  69.797 + * Finish up at the end of the pass.
  69.798 + */
  69.799 +
  69.800 +METHODDEF(void)
  69.801 +finish_pass_1_quant (j_decompress_ptr cinfo)
  69.802 +{
  69.803 +  /* no work in 1-pass case */
  69.804 +}
  69.805 +
  69.806 +
  69.807 +/*
  69.808 + * Switch to a new external colormap between output passes.
  69.809 + * Shouldn't get to this module!
  69.810 + */
  69.811 +
  69.812 +METHODDEF(void)
  69.813 +new_color_map_1_quant (j_decompress_ptr cinfo)
  69.814 +{
  69.815 +  ERREXIT(cinfo, JERR_MODE_CHANGE);
  69.816 +}
  69.817 +
  69.818 +
  69.819 +/*
  69.820 + * Module initialization routine for 1-pass color quantization.
  69.821 + */
  69.822 +
  69.823 +GLOBAL(void)
  69.824 +jinit_1pass_quantizer (j_decompress_ptr cinfo)
  69.825 +{
  69.826 +  my_cquantize_ptr cquantize;
  69.827 +
  69.828 +  cquantize = (my_cquantize_ptr)
  69.829 +    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
  69.830 +				SIZEOF(my_cquantizer));
  69.831 +  cinfo->cquantize = (struct jpeg_color_quantizer *) cquantize;
  69.832 +  cquantize->pub.start_pass = start_pass_1_quant;
  69.833 +  cquantize->pub.finish_pass = finish_pass_1_quant;
  69.834 +  cquantize->pub.new_color_map = new_color_map_1_quant;
  69.835 +  cquantize->fserrors[0] = NULL; /* Flag FS workspace not allocated */
  69.836 +  cquantize->odither[0] = NULL;	/* Also flag odither arrays not allocated */
  69.837 +
  69.838 +  /* Make sure my internal arrays won't overflow */
  69.839 +  if (cinfo->out_color_components > MAX_Q_COMPS)
  69.840 +    ERREXIT1(cinfo, JERR_QUANT_COMPONENTS, MAX_Q_COMPS);
  69.841 +  /* Make sure colormap indexes can be represented by JSAMPLEs */
  69.842 +  if (cinfo->desired_number_of_colors > (MAXJSAMPLE+1))
  69.843 +    ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, MAXJSAMPLE+1);
  69.844 +
  69.845 +  /* Create the colormap and color index table. */
  69.846 +  create_colormap(cinfo);
  69.847 +  create_colorindex(cinfo);
  69.848 +
  69.849 +  /* Allocate Floyd-Steinberg workspace now if requested.
  69.850 +   * We do this now since it is FAR storage and may affect the memory
  69.851 +   * manager's space calculations.  If the user changes to FS dither
  69.852 +   * mode in a later pass, we will allocate the space then, and will
  69.853 +   * possibly overrun the max_memory_to_use setting.
  69.854 +   */
  69.855 +  if (cinfo->dither_mode == JDITHER_FS)
  69.856 +    alloc_fs_workspace(cinfo);
  69.857 +}
  69.858 +
  69.859 +#endif /* QUANT_1PASS_SUPPORTED */
    70.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    70.2 +++ b/libs/libjpeg/jquant2.c	Sun Nov 01 00:36:56 2015 +0200
    70.3 @@ -0,0 +1,1310 @@
    70.4 +/*
    70.5 + * jquant2.c
    70.6 + *
    70.7 + * Copyright (C) 1991-1996, Thomas G. Lane.
    70.8 + * This file is part of the Independent JPEG Group's software.
    70.9 + * For conditions of distribution and use, see the accompanying README file.
   70.10 + *
   70.11 + * This file contains 2-pass color quantization (color mapping) routines.
   70.12 + * These routines provide selection of a custom color map for an image,
   70.13 + * followed by mapping of the image to that color map, with optional
   70.14 + * Floyd-Steinberg dithering.
   70.15 + * It is also possible to use just the second pass to map to an arbitrary
   70.16 + * externally-given color map.
   70.17 + *
   70.18 + * Note: ordered dithering is not supported, since there isn't any fast
   70.19 + * way to compute intercolor distances; it's unclear that ordered dither's
   70.20 + * fundamental assumptions even hold with an irregularly spaced color map.
   70.21 + */
   70.22 +
   70.23 +#define JPEG_INTERNALS
   70.24 +#include "jinclude.h"
   70.25 +#include "jpeglib.h"
   70.26 +
   70.27 +#ifdef QUANT_2PASS_SUPPORTED
   70.28 +
   70.29 +
   70.30 +/*
   70.31 + * This module implements the well-known Heckbert paradigm for color
   70.32 + * quantization.  Most of the ideas used here can be traced back to
   70.33 + * Heckbert's seminal paper
   70.34 + *   Heckbert, Paul.  "Color Image Quantization for Frame Buffer Display",
   70.35 + *   Proc. SIGGRAPH '82, Computer Graphics v.16 #3 (July 1982), pp 297-304.
   70.36 + *
   70.37 + * In the first pass over the image, we accumulate a histogram showing the
   70.38 + * usage count of each possible color.  To keep the histogram to a reasonable
   70.39 + * size, we reduce the precision of the input; typical practice is to retain
   70.40 + * 5 or 6 bits per color, so that 8 or 4 different input values are counted
   70.41 + * in the same histogram cell.
   70.42 + *
   70.43 + * Next, the color-selection step begins with a box representing the whole
   70.44 + * color space, and repeatedly splits the "largest" remaining box until we
   70.45 + * have as many boxes as desired colors.  Then the mean color in each
   70.46 + * remaining box becomes one of the possible output colors.
   70.47 + * 
   70.48 + * The second pass over the image maps each input pixel to the closest output
   70.49 + * color (optionally after applying a Floyd-Steinberg dithering correction).
   70.50 + * This mapping is logically trivial, but making it go fast enough requires
   70.51 + * considerable care.
   70.52 + *
   70.53 + * Heckbert-style quantizers vary a good deal in their policies for choosing
   70.54 + * the "largest" box and deciding where to cut it.  The particular policies
   70.55 + * used here have proved out well in experimental comparisons, but better ones
   70.56 + * may yet be found.
   70.57 + *
   70.58 + * In earlier versions of the IJG code, this module quantized in YCbCr color
   70.59 + * space, processing the raw upsampled data without a color conversion step.
   70.60 + * This allowed the color conversion math to be done only once per colormap
   70.61 + * entry, not once per pixel.  However, that optimization precluded other
   70.62 + * useful optimizations (such as merging color conversion with upsampling)
   70.63 + * and it also interfered with desired capabilities such as quantizing to an
   70.64 + * externally-supplied colormap.  We have therefore abandoned that approach.
   70.65 + * The present code works in the post-conversion color space, typically RGB.
   70.66 + *
   70.67 + * To improve the visual quality of the results, we actually work in scaled
   70.68 + * RGB space, giving G distances more weight than R, and R in turn more than
   70.69 + * B.  To do everything in integer math, we must use integer scale factors.
   70.70 + * The 2/3/1 scale factors used here correspond loosely to the relative
   70.71 + * weights of the colors in the NTSC grayscale equation.
   70.72 + * If you want to use this code to quantize a non-RGB color space, you'll
   70.73 + * probably need to change these scale factors.
   70.74 + */
   70.75 +
   70.76 +#define R_SCALE 2		/* scale R distances by this much */
   70.77 +#define G_SCALE 3		/* scale G distances by this much */
   70.78 +#define B_SCALE 1		/* and B by this much */
   70.79 +
   70.80 +/* Relabel R/G/B as components 0/1/2, respecting the RGB ordering defined
   70.81 + * in jmorecfg.h.  As the code stands, it will do the right thing for R,G,B
   70.82 + * and B,G,R orders.  If you define some other weird order in jmorecfg.h,
   70.83 + * you'll get compile errors until you extend this logic.  In that case
   70.84 + * you'll probably want to tweak the histogram sizes too.
   70.85 + */
   70.86 +
   70.87 +#if RGB_RED == 0
   70.88 +#define C0_SCALE R_SCALE
   70.89 +#endif
   70.90 +#if RGB_BLUE == 0
   70.91 +#define C0_SCALE B_SCALE
   70.92 +#endif
   70.93 +#if RGB_GREEN == 1
   70.94 +#define C1_SCALE G_SCALE
   70.95 +#endif
   70.96 +#if RGB_RED == 2
   70.97 +#define C2_SCALE R_SCALE
   70.98 +#endif
   70.99 +#if RGB_BLUE == 2
  70.100 +#define C2_SCALE B_SCALE
  70.101 +#endif
  70.102 +
  70.103 +
  70.104 +/*
  70.105 + * First we have the histogram data structure and routines for creating it.
  70.106 + *
  70.107 + * The number of bits of precision can be adjusted by changing these symbols.
  70.108 + * We recommend keeping 6 bits for G and 5 each for R and B.
  70.109 + * If you have plenty of memory and cycles, 6 bits all around gives marginally
  70.110 + * better results; if you are short of memory, 5 bits all around will save
  70.111 + * some space but degrade the results.
  70.112 + * To maintain a fully accurate histogram, we'd need to allocate a "long"
  70.113 + * (preferably unsigned long) for each cell.  In practice this is overkill;
  70.114 + * we can get by with 16 bits per cell.  Few of the cell counts will overflow,
  70.115 + * and clamping those that do overflow to the maximum value will give close-
  70.116 + * enough results.  This reduces the recommended histogram size from 256Kb
  70.117 + * to 128Kb, which is a useful savings on PC-class machines.
  70.118 + * (In the second pass the histogram space is re-used for pixel mapping data;
  70.119 + * in that capacity, each cell must be able to store zero to the number of
  70.120 + * desired colors.  16 bits/cell is plenty for that too.)
  70.121 + * Since the JPEG code is intended to run in small memory model on 80x86
  70.122 + * machines, we can't just allocate the histogram in one chunk.  Instead
  70.123 + * of a true 3-D array, we use a row of pointers to 2-D arrays.  Each
  70.124 + * pointer corresponds to a C0 value (typically 2^5 = 32 pointers) and
  70.125 + * each 2-D array has 2^6*2^5 = 2048 or 2^6*2^6 = 4096 entries.  Note that
  70.126 + * on 80x86 machines, the pointer row is in near memory but the actual
  70.127 + * arrays are in far memory (same arrangement as we use for image arrays).
  70.128 + */
  70.129 +
  70.130 +#define MAXNUMCOLORS  (MAXJSAMPLE+1) /* maximum size of colormap */
  70.131 +
  70.132 +/* These will do the right thing for either R,G,B or B,G,R color order,
  70.133 + * but you may not like the results for other color orders.
  70.134 + */
  70.135 +#define HIST_C0_BITS  5		/* bits of precision in R/B histogram */
  70.136 +#define HIST_C1_BITS  6		/* bits of precision in G histogram */
  70.137 +#define HIST_C2_BITS  5		/* bits of precision in B/R histogram */
  70.138 +
  70.139 +/* Number of elements along histogram axes. */
  70.140 +#define HIST_C0_ELEMS  (1<<HIST_C0_BITS)
  70.141 +#define HIST_C1_ELEMS  (1<<HIST_C1_BITS)
  70.142 +#define HIST_C2_ELEMS  (1<<HIST_C2_BITS)
  70.143 +
  70.144 +/* These are the amounts to shift an input value to get a histogram index. */
  70.145 +#define C0_SHIFT  (BITS_IN_JSAMPLE-HIST_C0_BITS)
  70.146 +#define C1_SHIFT  (BITS_IN_JSAMPLE-HIST_C1_BITS)
  70.147 +#define C2_SHIFT  (BITS_IN_JSAMPLE-HIST_C2_BITS)
  70.148 +
  70.149 +
  70.150 +typedef UINT16 histcell;	/* histogram cell; prefer an unsigned type */
  70.151 +
  70.152 +typedef histcell FAR * histptr;	/* for pointers to histogram cells */
  70.153 +
  70.154 +typedef histcell hist1d[HIST_C2_ELEMS]; /* typedefs for the array */
  70.155 +typedef hist1d FAR * hist2d;	/* type for the 2nd-level pointers */
  70.156 +typedef hist2d * hist3d;	/* type for top-level pointer */
  70.157 +
  70.158 +
  70.159 +/* Declarations for Floyd-Steinberg dithering.
  70.160 + *
  70.161 + * Errors are accumulated into the array fserrors[], at a resolution of
  70.162 + * 1/16th of a pixel count.  The error at a given pixel is propagated
  70.163 + * to its not-yet-processed neighbors using the standard F-S fractions,
  70.164 + *		...	(here)	7/16
  70.165 + *		3/16	5/16	1/16
  70.166 + * We work left-to-right on even rows, right-to-left on odd rows.
  70.167 + *
  70.168 + * We can get away with a single array (holding one row's worth of errors)
  70.169 + * by using it to store the current row's errors at pixel columns not yet
  70.170 + * processed, but the next row's errors at columns already processed.  We
  70.171 + * need only a few extra variables to hold the errors immediately around the
  70.172 + * current column.  (If we are lucky, those variables are in registers, but
  70.173 + * even if not, they're probably cheaper to access than array elements are.)
  70.174 + *
  70.175 + * The fserrors[] array has (#columns + 2) entries; the extra entry at
  70.176 + * each end saves us from special-casing the first and last pixels.
  70.177 + * Each entry is three values long, one value for each color component.
  70.178 + *
  70.179 + * Note: on a wide image, we might not have enough room in a PC's near data
  70.180 + * segment to hold the error array; so it is allocated with alloc_large.
  70.181 + */
  70.182 +
  70.183 +#if BITS_IN_JSAMPLE == 8
  70.184 +typedef INT16 FSERROR;		/* 16 bits should be enough */
  70.185 +typedef int LOCFSERROR;		/* use 'int' for calculation temps */
  70.186 +#else
  70.187 +typedef INT32 FSERROR;		/* may need more than 16 bits */
  70.188 +typedef INT32 LOCFSERROR;	/* be sure calculation temps are big enough */
  70.189 +#endif
  70.190 +
  70.191 +typedef FSERROR FAR *FSERRPTR;	/* pointer to error array (in FAR storage!) */
  70.192 +
  70.193 +
  70.194 +/* Private subobject */
  70.195 +
  70.196 +typedef struct {
  70.197 +  struct jpeg_color_quantizer pub; /* public fields */
  70.198 +
  70.199 +  /* Space for the eventually created colormap is stashed here */
  70.200 +  JSAMPARRAY sv_colormap;	/* colormap allocated at init time */
  70.201 +  int desired;			/* desired # of colors = size of colormap */
  70.202 +
  70.203 +  /* Variables for accumulating image statistics */
  70.204 +  hist3d histogram;		/* pointer to the histogram */
  70.205 +
  70.206 +  boolean needs_zeroed;		/* TRUE if next pass must zero histogram */
  70.207 +
  70.208 +  /* Variables for Floyd-Steinberg dithering */
  70.209 +  FSERRPTR fserrors;		/* accumulated errors */
  70.210 +  boolean on_odd_row;		/* flag to remember which row we are on */
  70.211 +  int * error_limiter;		/* table for clamping the applied error */
  70.212 +} my_cquantizer;
  70.213 +
  70.214 +typedef my_cquantizer * my_cquantize_ptr;
  70.215 +
  70.216 +
  70.217 +/*
  70.218 + * Prescan some rows of pixels.
  70.219 + * In this module the prescan simply updates the histogram, which has been
  70.220 + * initialized to zeroes by start_pass.
  70.221 + * An output_buf parameter is required by the method signature, but no data
  70.222 + * is actually output (in fact the buffer controller is probably passing a
  70.223 + * NULL pointer).
  70.224 + */
  70.225 +
  70.226 +METHODDEF(void)
  70.227 +prescan_quantize (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
  70.228 +		  JSAMPARRAY output_buf, int num_rows)
  70.229 +{
  70.230 +  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
  70.231 +  register JSAMPROW ptr;
  70.232 +  register histptr histp;
  70.233 +  register hist3d histogram = cquantize->histogram;
  70.234 +  int row;
  70.235 +  JDIMENSION col;
  70.236 +  JDIMENSION width = cinfo->output_width;
  70.237 +
  70.238 +  for (row = 0; row < num_rows; row++) {
  70.239 +    ptr = input_buf[row];
  70.240 +    for (col = width; col > 0; col--) {
  70.241 +      /* get pixel value and index into the histogram */
  70.242 +      histp = & histogram[GETJSAMPLE(ptr[0]) >> C0_SHIFT]
  70.243 +			 [GETJSAMPLE(ptr[1]) >> C1_SHIFT]
  70.244 +			 [GETJSAMPLE(ptr[2]) >> C2_SHIFT];
  70.245 +      /* increment, check for overflow and undo increment if so. */
  70.246 +      if (++(*histp) <= 0)
  70.247 +	(*histp)--;
  70.248 +      ptr += 3;
  70.249 +    }
  70.250 +  }
  70.251 +}
  70.252 +
  70.253 +
  70.254 +/*
  70.255 + * Next we have the really interesting routines: selection of a colormap
  70.256 + * given the completed histogram.
  70.257 + * These routines work with a list of "boxes", each representing a rectangular
  70.258 + * subset of the input color space (to histogram precision).
  70.259 + */
  70.260 +
  70.261 +typedef struct {
  70.262 +  /* The bounds of the box (inclusive); expressed as histogram indexes */
  70.263 +  int c0min, c0max;
  70.264 +  int c1min, c1max;
  70.265 +  int c2min, c2max;
  70.266 +  /* The volume (actually 2-norm) of the box */
  70.267 +  INT32 volume;
  70.268 +  /* The number of nonzero histogram cells within this box */
  70.269 +  long colorcount;
  70.270 +} box_t;
  70.271 +
  70.272 +typedef box_t * boxptr;
  70.273 +
  70.274 +
  70.275 +LOCAL(boxptr)
  70.276 +find_biggest_color_pop (boxptr boxlist, int numboxes)
  70.277 +/* Find the splittable box with the largest color population */
  70.278 +/* Returns NULL if no splittable boxes remain */
  70.279 +{
  70.280 +  register boxptr boxp;
  70.281 +  register int i;
  70.282 +  register long maxc = 0;
  70.283 +  boxptr which = NULL;
  70.284 +  
  70.285 +  for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++) {
  70.286 +    if (boxp->colorcount > maxc && boxp->volume > 0) {
  70.287 +      which = boxp;
  70.288 +      maxc = boxp->colorcount;
  70.289 +    }
  70.290 +  }
  70.291 +  return which;
  70.292 +}
  70.293 +
  70.294 +
  70.295 +LOCAL(boxptr)
  70.296 +find_biggest_volume (boxptr boxlist, int numboxes)
  70.297 +/* Find the splittable box with the largest (scaled) volume */
  70.298 +/* Returns NULL if no splittable boxes remain */
  70.299 +{
  70.300 +  register boxptr boxp;
  70.301 +  register int i;
  70.302 +  register INT32 maxv = 0;
  70.303 +  boxptr which = NULL;
  70.304 +  
  70.305 +  for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++) {
  70.306 +    if (boxp->volume > maxv) {
  70.307 +      which = boxp;
  70.308 +      maxv = boxp->volume;
  70.309 +    }
  70.310 +  }
  70.311 +  return which;
  70.312 +}
  70.313 +
  70.314 +
  70.315 +LOCAL(void)
  70.316 +update_box (j_decompress_ptr cinfo, boxptr boxp)
  70.317 +/* Shrink the min/max bounds of a box to enclose only nonzero elements, */
  70.318 +/* and recompute its volume and population */
  70.319 +{
  70.320 +  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
  70.321 +  hist3d histogram = cquantize->histogram;
  70.322 +  histptr histp;
  70.323 +  int c0,c1,c2;
  70.324 +  int c0min,c0max,c1min,c1max,c2min,c2max;
  70.325 +  INT32 dist0,dist1,dist2;
  70.326 +  long ccount;
  70.327 +  
  70.328 +  c0min = boxp->c0min;  c0max = boxp->c0max;
  70.329 +  c1min = boxp->c1min;  c1max = boxp->c1max;
  70.330 +  c2min = boxp->c2min;  c2max = boxp->c2max;
  70.331 +  
  70.332 +  if (c0max > c0min)
  70.333 +    for (c0 = c0min; c0 <= c0max; c0++)
  70.334 +      for (c1 = c1min; c1 <= c1max; c1++) {
  70.335 +	histp = & histogram[c0][c1][c2min];
  70.336 +	for (c2 = c2min; c2 <= c2max; c2++)
  70.337 +	  if (*histp++ != 0) {
  70.338 +	    boxp->c0min = c0min = c0;
  70.339 +	    goto have_c0min;
  70.340 +	  }
  70.341 +      }
  70.342 + have_c0min:
  70.343 +  if (c0max > c0min)
  70.344 +    for (c0 = c0max; c0 >= c0min; c0--)
  70.345 +      for (c1 = c1min; c1 <= c1max; c1++) {
  70.346 +	histp = & histogram[c0][c1][c2min];
  70.347 +	for (c2 = c2min; c2 <= c2max; c2++)
  70.348 +	  if (*histp++ != 0) {
  70.349 +	    boxp->c0max = c0max = c0;
  70.350 +	    goto have_c0max;
  70.351 +	  }
  70.352 +      }
  70.353 + have_c0max:
  70.354 +  if (c1max > c1min)
  70.355 +    for (c1 = c1min; c1 <= c1max; c1++)
  70.356 +      for (c0 = c0min; c0 <= c0max; c0++) {
  70.357 +	histp = & histogram[c0][c1][c2min];
  70.358 +	for (c2 = c2min; c2 <= c2max; c2++)
  70.359 +	  if (*histp++ != 0) {
  70.360 +	    boxp->c1min = c1min = c1;
  70.361 +	    goto have_c1min;
  70.362 +	  }
  70.363 +      }
  70.364 + have_c1min:
  70.365 +  if (c1max > c1min)
  70.366 +    for (c1 = c1max; c1 >= c1min; c1--)
  70.367 +      for (c0 = c0min; c0 <= c0max; c0++) {
  70.368 +	histp = & histogram[c0][c1][c2min];
  70.369 +	for (c2 = c2min; c2 <= c2max; c2++)
  70.370 +	  if (*histp++ != 0) {
  70.371 +	    boxp->c1max = c1max = c1;
  70.372 +	    goto have_c1max;
  70.373 +	  }
  70.374 +      }
  70.375 + have_c1max:
  70.376 +  if (c2max > c2min)
  70.377 +    for (c2 = c2min; c2 <= c2max; c2++)
  70.378 +      for (c0 = c0min; c0 <= c0max; c0++) {
  70.379 +	histp = & histogram[c0][c1min][c2];
  70.380 +	for (c1 = c1min; c1 <= c1max; c1++, histp += HIST_C2_ELEMS)
  70.381 +	  if (*histp != 0) {
  70.382 +	    boxp->c2min = c2min = c2;
  70.383 +	    goto have_c2min;
  70.384 +	  }
  70.385 +      }
  70.386 + have_c2min:
  70.387 +  if (c2max > c2min)
  70.388 +    for (c2 = c2max; c2 >= c2min; c2--)
  70.389 +      for (c0 = c0min; c0 <= c0max; c0++) {
  70.390 +	histp = & histogram[c0][c1min][c2];
  70.391 +	for (c1 = c1min; c1 <= c1max; c1++, histp += HIST_C2_ELEMS)
  70.392 +	  if (*histp != 0) {
  70.393 +	    boxp->c2max = c2max = c2;
  70.394 +	    goto have_c2max;
  70.395 +	  }
  70.396 +      }
  70.397 + have_c2max:
  70.398 +
  70.399 +  /* Update box volume.
  70.400 +   * We use 2-norm rather than real volume here; this biases the method
  70.401 +   * against making long narrow boxes, and it has the side benefit that
  70.402 +   * a box is splittable iff norm > 0.
  70.403 +   * Since the differences are expressed in histogram-cell units,
  70.404 +   * we have to shift back to JSAMPLE units to get consistent distances;
  70.405 +   * after which, we scale according to the selected distance scale factors.
  70.406 +   */
  70.407 +  dist0 = ((c0max - c0min) << C0_SHIFT) * C0_SCALE;
  70.408 +  dist1 = ((c1max - c1min) << C1_SHIFT) * C1_SCALE;
  70.409 +  dist2 = ((c2max - c2min) << C2_SHIFT) * C2_SCALE;
  70.410 +  boxp->volume = dist0*dist0 + dist1*dist1 + dist2*dist2;
  70.411 +  
  70.412 +  /* Now scan remaining volume of box and compute population */
  70.413 +  ccount = 0;
  70.414 +  for (c0 = c0min; c0 <= c0max; c0++)
  70.415 +    for (c1 = c1min; c1 <= c1max; c1++) {
  70.416 +      histp = & histogram[c0][c1][c2min];
  70.417 +      for (c2 = c2min; c2 <= c2max; c2++, histp++)
  70.418 +	if (*histp != 0) {
  70.419 +	  ccount++;
  70.420 +	}
  70.421 +    }
  70.422 +  boxp->colorcount = ccount;
  70.423 +}
  70.424 +
  70.425 +
  70.426 +LOCAL(int)
  70.427 +median_cut (j_decompress_ptr cinfo, boxptr boxlist, int numboxes,
  70.428 +	    int desired_colors)
  70.429 +/* Repeatedly select and split the largest box until we have enough boxes */
  70.430 +{
  70.431 +  int n,lb;
  70.432 +  int c0,c1,c2,cmax;
  70.433 +  register boxptr b1,b2;
  70.434 +
  70.435 +  while (numboxes < desired_colors) {
  70.436 +    /* Select box to split.
  70.437 +     * Current algorithm: by population for first half, then by volume.
  70.438 +     */
  70.439 +    if (numboxes*2 <= desired_colors) {
  70.440 +      b1 = find_biggest_color_pop(boxlist, numboxes);
  70.441 +    } else {
  70.442 +      b1 = find_biggest_volume(boxlist, numboxes);
  70.443 +    }
  70.444 +    if (b1 == NULL)		/* no splittable boxes left! */
  70.445 +      break;
  70.446 +    b2 = &boxlist[numboxes];	/* where new box will go */
  70.447 +    /* Copy the color bounds to the new box. */
  70.448 +    b2->c0max = b1->c0max; b2->c1max = b1->c1max; b2->c2max = b1->c2max;
  70.449 +    b2->c0min = b1->c0min; b2->c1min = b1->c1min; b2->c2min = b1->c2min;
  70.450 +    /* Choose which axis to split the box on.
  70.451 +     * Current algorithm: longest scaled axis.
  70.452 +     * See notes in update_box about scaling distances.
  70.453 +     */
  70.454 +    c0 = ((b1->c0max - b1->c0min) << C0_SHIFT) * C0_SCALE;
  70.455 +    c1 = ((b1->c1max - b1->c1min) << C1_SHIFT) * C1_SCALE;
  70.456 +    c2 = ((b1->c2max - b1->c2min) << C2_SHIFT) * C2_SCALE;
  70.457 +    /* We want to break any ties in favor of green, then red, blue last.
  70.458 +     * This code does the right thing for R,G,B or B,G,R color orders only.
  70.459 +     */
  70.460 +#if RGB_RED == 0
  70.461 +    cmax = c1; n = 1;
  70.462 +    if (c0 > cmax) { cmax = c0; n = 0; }
  70.463 +    if (c2 > cmax) { n = 2; }
  70.464 +#else
  70.465 +    cmax = c1; n = 1;
  70.466 +    if (c2 > cmax) { cmax = c2; n = 2; }
  70.467 +    if (c0 > cmax) { n = 0; }
  70.468 +#endif
  70.469 +    /* Choose split point along selected axis, and update box bounds.
  70.470 +     * Current algorithm: split at halfway point.
  70.471 +     * (Since the box has been shrunk to minimum volume,
  70.472 +     * any split will produce two nonempty subboxes.)
  70.473 +     * Note that lb value is max for lower box, so must be < old max.
  70.474 +     */
  70.475 +    switch (n) {
  70.476 +    case 0:
  70.477 +      lb = (b1->c0max + b1->c0min) / 2;
  70.478 +      b1->c0max = lb;
  70.479 +      b2->c0min = lb+1;
  70.480 +      break;
  70.481 +    case 1:
  70.482 +      lb = (b1->c1max + b1->c1min) / 2;
  70.483 +      b1->c1max = lb;
  70.484 +      b2->c1min = lb+1;
  70.485 +      break;
  70.486 +    case 2:
  70.487 +      lb = (b1->c2max + b1->c2min) / 2;
  70.488 +      b1->c2max = lb;
  70.489 +      b2->c2min = lb+1;
  70.490 +      break;
  70.491 +    }
  70.492 +    /* Update stats for boxes */
  70.493 +    update_box(cinfo, b1);
  70.494 +    update_box(cinfo, b2);
  70.495 +    numboxes++;
  70.496 +  }
  70.497 +  return numboxes;
  70.498 +}
  70.499 +
  70.500 +
  70.501 +LOCAL(void)
  70.502 +compute_color (j_decompress_ptr cinfo, boxptr boxp, int icolor)
  70.503 +/* Compute representative color for a box, put it in colormap[icolor] */
  70.504 +{
  70.505 +  /* Current algorithm: mean weighted by pixels (not colors) */
  70.506 +  /* Note it is important to get the rounding correct! */
  70.507 +  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
  70.508 +  hist3d histogram = cquantize->histogram;
  70.509 +  histptr histp;
  70.510 +  int c0,c1,c2;
  70.511 +  int c0min,c0max,c1min,c1max,c2min,c2max;
  70.512 +  long count;
  70.513 +  long total = 0;
  70.514 +  long c0total = 0;
  70.515 +  long c1total = 0;
  70.516 +  long c2total = 0;
  70.517 +  
  70.518 +  c0min = boxp->c0min;  c0max = boxp->c0max;
  70.519 +  c1min = boxp->c1min;  c1max = boxp->c1max;
  70.520 +  c2min = boxp->c2min;  c2max = boxp->c2max;
  70.521 +  
  70.522 +  for (c0 = c0min; c0 <= c0max; c0++)
  70.523 +    for (c1 = c1min; c1 <= c1max; c1++) {
  70.524 +      histp = & histogram[c0][c1][c2min];
  70.525 +      for (c2 = c2min; c2 <= c2max; c2++) {
  70.526 +	if ((count = *histp++) != 0) {
  70.527 +	  total += count;
  70.528 +	  c0total += ((c0 << C0_SHIFT) + ((1<<C0_SHIFT)>>1)) * count;
  70.529 +	  c1total += ((c1 << C1_SHIFT) + ((1<<C1_SHIFT)>>1)) * count;
  70.530 +	  c2total += ((c2 << C2_SHIFT) + ((1<<C2_SHIFT)>>1)) * count;
  70.531 +	}
  70.532 +      }
  70.533 +    }
  70.534 +  
  70.535 +  cinfo->colormap[0][icolor] = (JSAMPLE) ((c0total + (total>>1)) / total);
  70.536 +  cinfo->colormap[1][icolor] = (JSAMPLE) ((c1total + (total>>1)) / total);
  70.537 +  cinfo->colormap[2][icolor] = (JSAMPLE) ((c2total + (total>>1)) / total);
  70.538 +}
  70.539 +
  70.540 +
  70.541 +LOCAL(void)
  70.542 +select_colors (j_decompress_ptr cinfo, int desired_colors)
  70.543 +/* Master routine for color selection */
  70.544 +{
  70.545 +  boxptr boxlist;
  70.546 +  int numboxes;
  70.547 +  int i;
  70.548 +
  70.549 +  /* Allocate workspace for box list */
  70.550 +  boxlist = (boxptr) (*cinfo->mem->alloc_small)
  70.551 +    ((j_common_ptr) cinfo, JPOOL_IMAGE, desired_colors * SIZEOF(box_t));
  70.552 +  /* Initialize one box containing whole space */
  70.553 +  numboxes = 1;
  70.554 +  boxlist[0].c0min = 0;
  70.555 +  boxlist[0].c0max = MAXJSAMPLE >> C0_SHIFT;
  70.556 +  boxlist[0].c1min = 0;
  70.557 +  boxlist[0].c1max = MAXJSAMPLE >> C1_SHIFT;
  70.558 +  boxlist[0].c2min = 0;
  70.559 +  boxlist[0].c2max = MAXJSAMPLE >> C2_SHIFT;
  70.560 +  /* Shrink it to actually-used volume and set its statistics */
  70.561 +  update_box(cinfo, & boxlist[0]);
  70.562 +  /* Perform median-cut to produce final box list */
  70.563 +  numboxes = median_cut(cinfo, boxlist, numboxes, desired_colors);
  70.564 +  /* Compute the representative color for each box, fill colormap */
  70.565 +  for (i = 0; i < numboxes; i++)
  70.566 +    compute_color(cinfo, & boxlist[i], i);
  70.567 +  cinfo->actual_number_of_colors = numboxes;
  70.568 +  TRACEMS1(cinfo, 1, JTRC_QUANT_SELECTED, numboxes);
  70.569 +}
  70.570 +
  70.571 +
  70.572 +/*
  70.573 + * These routines are concerned with the time-critical task of mapping input
  70.574 + * colors to the nearest color in the selected colormap.
  70.575 + *
  70.576 + * We re-use the histogram space as an "inverse color map", essentially a
  70.577 + * cache for the results of nearest-color searches.  All colors within a
  70.578 + * histogram cell will be mapped to the same colormap entry, namely the one
  70.579 + * closest to the cell's center.  This may not be quite the closest entry to
  70.580 + * the actual input color, but it's almost as good.  A zero in the cache
  70.581 + * indicates we haven't found the nearest color for that cell yet; the array
  70.582 + * is cleared to zeroes before starting the mapping pass.  When we find the
  70.583 + * nearest color for a cell, its colormap index plus one is recorded in the
  70.584 + * cache for future use.  The pass2 scanning routines call fill_inverse_cmap
  70.585 + * when they need to use an unfilled entry in the cache.
  70.586 + *
  70.587 + * Our method of efficiently finding nearest colors is based on the "locally
  70.588 + * sorted search" idea described by Heckbert and on the incremental distance
  70.589 + * calculation described by Spencer W. Thomas in chapter III.1 of Graphics
  70.590 + * Gems II (James Arvo, ed.  Academic Press, 1991).  Thomas points out that
  70.591 + * the distances from a given colormap entry to each cell of the histogram can
  70.592 + * be computed quickly using an incremental method: the differences between
  70.593 + * distances to adjacent cells themselves differ by a constant.  This allows a
  70.594 + * fairly fast implementation of the "brute force" approach of computing the
  70.595 + * distance from every colormap entry to every histogram cell.  Unfortunately,
  70.596 + * it needs a work array to hold the best-distance-so-far for each histogram
  70.597 + * cell (because the inner loop has to be over cells, not colormap entries).
  70.598 + * The work array elements have to be INT32s, so the work array would need
  70.599 + * 256Kb at our recommended precision.  This is not feasible in DOS machines.
  70.600 + *
  70.601 + * To get around these problems, we apply Thomas' method to compute the
  70.602 + * nearest colors for only the cells within a small subbox of the histogram.
  70.603 + * The work array need be only as big as the subbox, so the memory usage
  70.604 + * problem is solved.  Furthermore, we need not fill subboxes that are never
  70.605 + * referenced in pass2; many images use only part of the color gamut, so a
  70.606 + * fair amount of work is saved.  An additional advantage of this
  70.607 + * approach is that we can apply Heckbert's locality criterion to quickly
  70.608 + * eliminate colormap entries that are far away from the subbox; typically
  70.609 + * three-fourths of the colormap entries are rejected by Heckbert's criterion,
  70.610 + * and we need not compute their distances to individual cells in the subbox.
  70.611 + * The speed of this approach is heavily influenced by the subbox size: too
  70.612 + * small means too much overhead, too big loses because Heckbert's criterion
  70.613 + * can't eliminate as many colormap entries.  Empirically the best subbox
  70.614 + * size seems to be about 1/512th of the histogram (1/8th in each direction).
  70.615 + *
  70.616 + * Thomas' article also describes a refined method which is asymptotically
  70.617 + * faster than the brute-force method, but it is also far more complex and
  70.618 + * cannot efficiently be applied to small subboxes.  It is therefore not
  70.619 + * useful for programs intended to be portable to DOS machines.  On machines
  70.620 + * with plenty of memory, filling the whole histogram in one shot with Thomas'
  70.621 + * refined method might be faster than the present code --- but then again,
  70.622 + * it might not be any faster, and it's certainly more complicated.
  70.623 + */
  70.624 +
  70.625 +
  70.626 +/* log2(histogram cells in update box) for each axis; this can be adjusted */
  70.627 +#define BOX_C0_LOG  (HIST_C0_BITS-3)
  70.628 +#define BOX_C1_LOG  (HIST_C1_BITS-3)
  70.629 +#define BOX_C2_LOG  (HIST_C2_BITS-3)
  70.630 +
  70.631 +#define BOX_C0_ELEMS  (1<<BOX_C0_LOG) /* # of hist cells in update box */
  70.632 +#define BOX_C1_ELEMS  (1<<BOX_C1_LOG)
  70.633 +#define BOX_C2_ELEMS  (1<<BOX_C2_LOG)
  70.634 +
  70.635 +#define BOX_C0_SHIFT  (C0_SHIFT + BOX_C0_LOG)
  70.636 +#define BOX_C1_SHIFT  (C1_SHIFT + BOX_C1_LOG)
  70.637 +#define BOX_C2_SHIFT  (C2_SHIFT + BOX_C2_LOG)
  70.638 +
  70.639 +
  70.640 +/*
  70.641 + * The next three routines implement inverse colormap filling.  They could
  70.642 + * all be folded into one big routine, but splitting them up this way saves
  70.643 + * some stack space (the mindist[] and bestdist[] arrays need not coexist)
  70.644 + * and may allow some compilers to produce better code by registerizing more
  70.645 + * inner-loop variables.
  70.646 + */
  70.647 +
  70.648 +LOCAL(int)
  70.649 +find_nearby_colors (j_decompress_ptr cinfo, int minc0, int minc1, int minc2,
  70.650 +		    JSAMPLE colorlist[])
  70.651 +/* Locate the colormap entries close enough to an update box to be candidates
  70.652 + * for the nearest entry to some cell(s) in the update box.  The update box
  70.653 + * is specified by the center coordinates of its first cell.  The number of
  70.654 + * candidate colormap entries is returned, and their colormap indexes are
  70.655 + * placed in colorlist[].
  70.656 + * This routine uses Heckbert's "locally sorted search" criterion to select
  70.657 + * the colors that need further consideration.
  70.658 + */
  70.659 +{
  70.660 +  int numcolors = cinfo->actual_number_of_colors;
  70.661 +  int maxc0, maxc1, maxc2;
  70.662 +  int centerc0, centerc1, centerc2;
  70.663 +  int i, x, ncolors;
  70.664 +  INT32 minmaxdist, min_dist, max_dist, tdist;
  70.665 +  INT32 mindist[MAXNUMCOLORS];	/* min distance to colormap entry i */
  70.666 +
  70.667 +  /* Compute true coordinates of update box's upper corner and center.
  70.668 +   * Actually we compute the coordinates of the center of the upper-corner
  70.669 +   * histogram cell, which are the upper bounds of the volume we care about.
  70.670 +   * Note that since ">>" rounds down, the "center" values may be closer to
  70.671 +   * min than to max; hence comparisons to them must be "<=", not "<".
  70.672 +   */
  70.673 +  maxc0 = minc0 + ((1 << BOX_C0_SHIFT) - (1 << C0_SHIFT));
  70.674 +  centerc0 = (minc0 + maxc0) >> 1;
  70.675 +  maxc1 = minc1 + ((1 << BOX_C1_SHIFT) - (1 << C1_SHIFT));
  70.676 +  centerc1 = (minc1 + maxc1) >> 1;
  70.677 +  maxc2 = minc2 + ((1 << BOX_C2_SHIFT) - (1 << C2_SHIFT));
  70.678 +  centerc2 = (minc2 + maxc2) >> 1;
  70.679 +
  70.680 +  /* For each color in colormap, find:
  70.681 +   *  1. its minimum squared-distance to any point in the update box
  70.682 +   *     (zero if color is within update box);
  70.683 +   *  2. its maximum squared-distance to any point in the update box.
  70.684 +   * Both of these can be found by considering only the corners of the box.
  70.685 +   * We save the minimum distance for each color in mindist[];
  70.686 +   * only the smallest maximum distance is of interest.
  70.687 +   */
  70.688 +  minmaxdist = 0x7FFFFFFFL;
  70.689 +
  70.690 +  for (i = 0; i < numcolors; i++) {
  70.691 +    /* We compute the squared-c0-distance term, then add in the other two. */
  70.692 +    x = GETJSAMPLE(cinfo->colormap[0][i]);
  70.693 +    if (x < minc0) {
  70.694 +      tdist = (x - minc0) * C0_SCALE;
  70.695 +      min_dist = tdist*tdist;
  70.696 +      tdist = (x - maxc0) * C0_SCALE;
  70.697 +      max_dist = tdist*tdist;
  70.698 +    } else if (x > maxc0) {
  70.699 +      tdist = (x - maxc0) * C0_SCALE;
  70.700 +      min_dist = tdist*tdist;
  70.701 +      tdist = (x - minc0) * C0_SCALE;
  70.702 +      max_dist = tdist*tdist;
  70.703 +    } else {
  70.704 +      /* within cell range so no contribution to min_dist */
  70.705 +      min_dist = 0;
  70.706 +      if (x <= centerc0) {
  70.707 +	tdist = (x - maxc0) * C0_SCALE;
  70.708 +	max_dist = tdist*tdist;
  70.709 +      } else {
  70.710 +	tdist = (x - minc0) * C0_SCALE;
  70.711 +	max_dist = tdist*tdist;
  70.712 +      }
  70.713 +    }
  70.714 +
  70.715 +    x = GETJSAMPLE(cinfo->colormap[1][i]);
  70.716 +    if (x < minc1) {
  70.717 +      tdist = (x - minc1) * C1_SCALE;
  70.718 +      min_dist += tdist*tdist;
  70.719 +      tdist = (x - maxc1) * C1_SCALE;
  70.720 +      max_dist += tdist*tdist;
  70.721 +    } else if (x > maxc1) {
  70.722 +      tdist = (x - maxc1) * C1_SCALE;
  70.723 +      min_dist += tdist*tdist;
  70.724 +      tdist = (x - minc1) * C1_SCALE;
  70.725 +      max_dist += tdist*tdist;
  70.726 +    } else {
  70.727 +      /* within cell range so no contribution to min_dist */
  70.728 +      if (x <= centerc1) {
  70.729 +	tdist = (x - maxc1) * C1_SCALE;
  70.730 +	max_dist += tdist*tdist;
  70.731 +      } else {
  70.732 +	tdist = (x - minc1) * C1_SCALE;
  70.733 +	max_dist += tdist*tdist;
  70.734 +      }
  70.735 +    }
  70.736 +
  70.737 +    x = GETJSAMPLE(cinfo->colormap[2][i]);
  70.738 +    if (x < minc2) {
  70.739 +      tdist = (x - minc2) * C2_SCALE;
  70.740 +      min_dist += tdist*tdist;
  70.741 +      tdist = (x - maxc2) * C2_SCALE;
  70.742 +      max_dist += tdist*tdist;
  70.743 +    } else if (x > maxc2) {
  70.744 +      tdist = (x - maxc2) * C2_SCALE;
  70.745 +      min_dist += tdist*tdist;
  70.746 +      tdist = (x - minc2) * C2_SCALE;
  70.747 +      max_dist += tdist*tdist;
  70.748 +    } else {
  70.749 +      /* within cell range so no contribution to min_dist */
  70.750 +      if (x <= centerc2) {
  70.751 +	tdist = (x - maxc2) * C2_SCALE;
  70.752 +	max_dist += tdist*tdist;
  70.753 +      } else {
  70.754 +	tdist = (x - minc2) * C2_SCALE;
  70.755 +	max_dist += tdist*tdist;
  70.756 +      }
  70.757 +    }
  70.758 +
  70.759 +    mindist[i] = min_dist;	/* save away the results */
  70.760 +    if (max_dist < minmaxdist)
  70.761 +      minmaxdist = max_dist;
  70.762 +  }
  70.763 +
  70.764 +  /* Now we know that no cell in the update box is more than minmaxdist
  70.765 +   * away from some colormap entry.  Therefore, only colors that are
  70.766 +   * within minmaxdist of some part of the box need be considered.
  70.767 +   */
  70.768 +  ncolors = 0;
  70.769 +  for (i = 0; i < numcolors; i++) {
  70.770 +    if (mindist[i] <= minmaxdist)
  70.771 +      colorlist[ncolors++] = (JSAMPLE) i;
  70.772 +  }
  70.773 +  return ncolors;
  70.774 +}
  70.775 +
  70.776 +
  70.777 +LOCAL(void)
  70.778 +find_best_colors (j_decompress_ptr cinfo, int minc0, int minc1, int minc2,
  70.779 +		  int numcolors, JSAMPLE colorlist[], JSAMPLE bestcolor[])
  70.780 +/* Find the closest colormap entry for each cell in the update box,
  70.781 + * given the list of candidate colors prepared by find_nearby_colors.
  70.782 + * Return the indexes of the closest entries in the bestcolor[] array.
  70.783 + * This routine uses Thomas' incremental distance calculation method to
  70.784 + * find the distance from a colormap entry to successive cells in the box.
  70.785 + */
  70.786 +{
  70.787 +  int ic0, ic1, ic2;
  70.788 +  int i, icolor;
  70.789 +  register INT32 * bptr;	/* pointer into bestdist[] array */
  70.790 +  JSAMPLE * cptr;		/* pointer into bestcolor[] array */
  70.791 +  INT32 dist0, dist1;		/* initial distance values */
  70.792 +  register INT32 dist2;		/* current distance in inner loop */
  70.793 +  INT32 xx0, xx1;		/* distance increments */
  70.794 +  register INT32 xx2;
  70.795 +  INT32 inc0, inc1, inc2;	/* initial values for increments */
  70.796 +  /* This array holds the distance to the nearest-so-far color for each cell */
  70.797 +  INT32 bestdist[BOX_C0_ELEMS * BOX_C1_ELEMS * BOX_C2_ELEMS];
  70.798 +
  70.799 +  /* Initialize best-distance for each cell of the update box */
  70.800 +  bptr = bestdist;
  70.801 +  for (i = BOX_C0_ELEMS*BOX_C1_ELEMS*BOX_C2_ELEMS-1; i >= 0; i--)
  70.802 +    *bptr++ = 0x7FFFFFFFL;
  70.803 +  
  70.804 +  /* For each color selected by find_nearby_colors,
  70.805 +   * compute its distance to the center of each cell in the box.
  70.806 +   * If that's less than best-so-far, update best distance and color number.
  70.807 +   */
  70.808 +  
  70.809 +  /* Nominal steps between cell centers ("x" in Thomas article) */
  70.810 +#define STEP_C0  ((1 << C0_SHIFT) * C0_SCALE)
  70.811 +#define STEP_C1  ((1 << C1_SHIFT) * C1_SCALE)
  70.812 +#define STEP_C2  ((1 << C2_SHIFT) * C2_SCALE)
  70.813 +  
  70.814 +  for (i = 0; i < numcolors; i++) {
  70.815 +    icolor = GETJSAMPLE(colorlist[i]);
  70.816 +    /* Compute (square of) distance from minc0/c1/c2 to this color */
  70.817 +    inc0 = (minc0 - GETJSAMPLE(cinfo->colormap[0][icolor])) * C0_SCALE;
  70.818 +    dist0 = inc0*inc0;
  70.819 +    inc1 = (minc1 - GETJSAMPLE(cinfo->colormap[1][icolor])) * C1_SCALE;
  70.820 +    dist0 += inc1*inc1;
  70.821 +    inc2 = (minc2 - GETJSAMPLE(cinfo->colormap[2][icolor])) * C2_SCALE;
  70.822 +    dist0 += inc2*inc2;
  70.823 +    /* Form the initial difference increments */
  70.824 +    inc0 = inc0 * (2 * STEP_C0) + STEP_C0 * STEP_C0;
  70.825 +    inc1 = inc1 * (2 * STEP_C1) + STEP_C1 * STEP_C1;
  70.826 +    inc2 = inc2 * (2 * STEP_C2) + STEP_C2 * STEP_C2;
  70.827 +    /* Now loop over all cells in box, updating distance per Thomas method */
  70.828 +    bptr = bestdist;
  70.829 +    cptr = bestcolor;
  70.830 +    xx0 = inc0;
  70.831 +    for (ic0 = BOX_C0_ELEMS-1; ic0 >= 0; ic0--) {
  70.832 +      dist1 = dist0;
  70.833 +      xx1 = inc1;
  70.834 +      for (ic1 = BOX_C1_ELEMS-1; ic1 >= 0; ic1--) {
  70.835 +	dist2 = dist1;
  70.836 +	xx2 = inc2;
  70.837 +	for (ic2 = BOX_C2_ELEMS-1; ic2 >= 0; ic2--) {
  70.838 +	  if (dist2 < *bptr) {
  70.839 +	    *bptr = dist2;
  70.840 +	    *cptr = (JSAMPLE) icolor;
  70.841 +	  }
  70.842 +	  dist2 += xx2;
  70.843 +	  xx2 += 2 * STEP_C2 * STEP_C2;
  70.844 +	  bptr++;
  70.845 +	  cptr++;
  70.846 +	}
  70.847 +	dist1 += xx1;
  70.848 +	xx1 += 2 * STEP_C1 * STEP_C1;
  70.849 +      }
  70.850 +      dist0 += xx0;
  70.851 +      xx0 += 2 * STEP_C0 * STEP_C0;
  70.852 +    }
  70.853 +  }
  70.854 +}
  70.855 +
  70.856 +
  70.857 +LOCAL(void)
  70.858 +fill_inverse_cmap (j_decompress_ptr cinfo, int c0, int c1, int c2)
  70.859 +/* Fill the inverse-colormap entries in the update box that contains */
  70.860 +/* histogram cell c0/c1/c2.  (Only that one cell MUST be filled, but */
  70.861 +/* we can fill as many others as we wish.) */
  70.862 +{
  70.863 +  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
  70.864 +  hist3d histogram = cquantize->histogram;
  70.865 +  int minc0, minc1, minc2;	/* lower left corner of update box */
  70.866 +  int ic0, ic1, ic2;
  70.867 +  register JSAMPLE * cptr;	/* pointer into bestcolor[] array */
  70.868 +  register histptr cachep;	/* pointer into main cache array */
  70.869 +  /* This array lists the candidate colormap indexes. */
  70.870 +  JSAMPLE colorlist[MAXNUMCOLORS];
  70.871 +  int numcolors;		/* number of candidate colors */
  70.872 +  /* This array holds the actually closest colormap index for each cell. */
  70.873 +  JSAMPLE bestcolor[BOX_C0_ELEMS * BOX_C1_ELEMS * BOX_C2_ELEMS];
  70.874 +
  70.875 +  /* Convert cell coordinates to update box ID */
  70.876 +  c0 >>= BOX_C0_LOG;
  70.877 +  c1 >>= BOX_C1_LOG;
  70.878 +  c2 >>= BOX_C2_LOG;
  70.879 +
  70.880 +  /* Compute true coordinates of update box's origin corner.
  70.881 +   * Actually we compute the coordinates of the center of the corner
  70.882 +   * histogram cell, which are the lower bounds of the volume we care about.
  70.883 +   */
  70.884 +  minc0 = (c0 << BOX_C0_SHIFT) + ((1 << C0_SHIFT) >> 1);
  70.885 +  minc1 = (c1 << BOX_C1_SHIFT) + ((1 << C1_SHIFT) >> 1);
  70.886 +  minc2 = (c2 << BOX_C2_SHIFT) + ((1 << C2_SHIFT) >> 1);
  70.887 +  
  70.888 +  /* Determine which colormap entries are close enough to be candidates
  70.889 +   * for the nearest entry to some cell in the update box.
  70.890 +   */
  70.891 +  numcolors = find_nearby_colors(cinfo, minc0, minc1, minc2, colorlist);
  70.892 +
  70.893 +  /* Determine the actually nearest colors. */
  70.894 +  find_best_colors(cinfo, minc0, minc1, minc2, numcolors, colorlist,
  70.895 +		   bestcolor);
  70.896 +
  70.897 +  /* Save the best color numbers (plus 1) in the main cache array */
  70.898 +  c0 <<= BOX_C0_LOG;		/* convert ID back to base cell indexes */
  70.899 +  c1 <<= BOX_C1_LOG;
  70.900 +  c2 <<= BOX_C2_LOG;
  70.901 +  cptr = bestcolor;
  70.902 +  for (ic0 = 0; ic0 < BOX_C0_ELEMS; ic0++) {
  70.903 +    for (ic1 = 0; ic1 < BOX_C1_ELEMS; ic1++) {
  70.904 +      cachep = & histogram[c0+ic0][c1+ic1][c2];
  70.905 +      for (ic2 = 0; ic2 < BOX_C2_ELEMS; ic2++) {
  70.906 +	*cachep++ = (histcell) (GETJSAMPLE(*cptr++) + 1);
  70.907 +      }
  70.908 +    }
  70.909 +  }
  70.910 +}
  70.911 +
  70.912 +
  70.913 +/*
  70.914 + * Map some rows of pixels to the output colormapped representation.
  70.915 + */
  70.916 +
  70.917 +METHODDEF(void)
  70.918 +pass2_no_dither (j_decompress_ptr cinfo,
  70.919 +		 JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows)
  70.920 +/* This version performs no dithering */
  70.921 +{
  70.922 +  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
  70.923 +  hist3d histogram = cquantize->histogram;
  70.924 +  register JSAMPROW inptr, outptr;
  70.925 +  register histptr cachep;
  70.926 +  register int c0, c1, c2;
  70.927 +  int row;
  70.928 +  JDIMENSION col;
  70.929 +  JDIMENSION width = cinfo->output_width;
  70.930 +
  70.931 +  for (row = 0; row < num_rows; row++) {
  70.932 +    inptr = input_buf[row];
  70.933 +    outptr = output_buf[row];
  70.934 +    for (col = width; col > 0; col--) {
  70.935 +      /* get pixel value and index into the cache */
  70.936 +      c0 = GETJSAMPLE(*inptr++) >> C0_SHIFT;
  70.937 +      c1 = GETJSAMPLE(*inptr++) >> C1_SHIFT;
  70.938 +      c2 = GETJSAMPLE(*inptr++) >> C2_SHIFT;
  70.939 +      cachep = & histogram[c0][c1][c2];
  70.940 +      /* If we have not seen this color before, find nearest colormap entry */
  70.941 +      /* and update the cache */
  70.942 +      if (*cachep == 0)
  70.943 +	fill_inverse_cmap(cinfo, c0,c1,c2);
  70.944 +      /* Now emit the colormap index for this cell */
  70.945 +      *outptr++ = (JSAMPLE) (*cachep - 1);
  70.946 +    }
  70.947 +  }
  70.948 +}
  70.949 +
  70.950 +
  70.951 +METHODDEF(void)
  70.952 +pass2_fs_dither (j_decompress_ptr cinfo,
  70.953 +		 JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows)
  70.954 +/* This version performs Floyd-Steinberg dithering */
  70.955 +{
  70.956 +  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
  70.957 +  hist3d histogram = cquantize->histogram;
  70.958 +  register LOCFSERROR cur0, cur1, cur2;	/* current error or pixel value */
  70.959 +  LOCFSERROR belowerr0, belowerr1, belowerr2; /* error for pixel below cur */
  70.960 +  LOCFSERROR bpreverr0, bpreverr1, bpreverr2; /* error for below/prev col */
  70.961 +  register FSERRPTR errorptr;	/* => fserrors[] at column before current */
  70.962 +  JSAMPROW inptr;		/* => current input pixel */
  70.963 +  JSAMPROW outptr;		/* => current output pixel */
  70.964 +  histptr cachep;
  70.965 +  int dir;			/* +1 or -1 depending on direction */
  70.966 +  int dir3;			/* 3*dir, for advancing inptr & errorptr */
  70.967 +  int row;
  70.968 +  JDIMENSION col;
  70.969 +  JDIMENSION width = cinfo->output_width;
  70.970 +  JSAMPLE *range_limit = cinfo->sample_range_limit;
  70.971 +  int *error_limit = cquantize->error_limiter;
  70.972 +  JSAMPROW colormap0 = cinfo->colormap[0];
  70.973 +  JSAMPROW colormap1 = cinfo->colormap[1];
  70.974 +  JSAMPROW colormap2 = cinfo->colormap[2];
  70.975 +  SHIFT_TEMPS
  70.976 +
  70.977 +  for (row = 0; row < num_rows; row++) {
  70.978 +    inptr = input_buf[row];
  70.979 +    outptr = output_buf[row];
  70.980 +    if (cquantize->on_odd_row) {
  70.981 +      /* work right to left in this row */
  70.982 +      inptr += (width-1) * 3;	/* so point to rightmost pixel */
  70.983 +      outptr += width-1;
  70.984 +      dir = -1;
  70.985 +      dir3 = -3;
  70.986 +      errorptr = cquantize->fserrors + (width+1)*3; /* => entry after last column */
  70.987 +      cquantize->on_odd_row = FALSE; /* flip for next time */
  70.988 +    } else {
  70.989 +      /* work left to right in this row */
  70.990 +      dir = 1;
  70.991 +      dir3 = 3;
  70.992 +      errorptr = cquantize->fserrors; /* => entry before first real column */
  70.993 +      cquantize->on_odd_row = TRUE; /* flip for next time */
  70.994 +    }
  70.995 +    /* Preset error values: no error propagated to first pixel from left */
  70.996 +    cur0 = cur1 = cur2 = 0;
  70.997 +    /* and no error propagated to row below yet */
  70.998 +    belowerr0 = belowerr1 = belowerr2 = 0;
  70.999 +    bpreverr0 = bpreverr1 = bpreverr2 = 0;
 70.1000 +
 70.1001 +    for (col = width; col > 0; col--) {
 70.1002 +      /* curN holds the error propagated from the previous pixel on the
 70.1003 +       * current line.  Add the error propagated from the previous line
 70.1004 +       * to form the complete error correction term for this pixel, and
 70.1005 +       * round the error term (which is expressed * 16) to an integer.
 70.1006 +       * RIGHT_SHIFT rounds towards minus infinity, so adding 8 is correct
 70.1007 +       * for either sign of the error value.
 70.1008 +       * Note: errorptr points to *previous* column's array entry.
 70.1009 +       */
 70.1010 +      cur0 = RIGHT_SHIFT(cur0 + errorptr[dir3+0] + 8, 4);
 70.1011 +      cur1 = RIGHT_SHIFT(cur1 + errorptr[dir3+1] + 8, 4);
 70.1012 +      cur2 = RIGHT_SHIFT(cur2 + errorptr[dir3+2] + 8, 4);
 70.1013 +      /* Limit the error using transfer function set by init_error_limit.
 70.1014 +       * See comments with init_error_limit for rationale.
 70.1015 +       */
 70.1016 +      cur0 = error_limit[cur0];
 70.1017 +      cur1 = error_limit[cur1];
 70.1018 +      cur2 = error_limit[cur2];
 70.1019 +      /* Form pixel value + error, and range-limit to 0..MAXJSAMPLE.
 70.1020 +       * The maximum error is +- MAXJSAMPLE (or less with error limiting);
 70.1021 +       * this sets the required size of the range_limit array.
 70.1022 +       */
 70.1023 +      cur0 += GETJSAMPLE(inptr[0]);
 70.1024 +      cur1 += GETJSAMPLE(inptr[1]);
 70.1025 +      cur2 += GETJSAMPLE(inptr[2]);
 70.1026 +      cur0 = GETJSAMPLE(range_limit[cur0]);
 70.1027 +      cur1 = GETJSAMPLE(range_limit[cur1]);
 70.1028 +      cur2 = GETJSAMPLE(range_limit[cur2]);
 70.1029 +      /* Index into the cache with adjusted pixel value */
 70.1030 +      cachep = & histogram[cur0>>C0_SHIFT][cur1>>C1_SHIFT][cur2>>C2_SHIFT];
 70.1031 +      /* If we have not seen this color before, find nearest colormap */
 70.1032 +      /* entry and update the cache */
 70.1033 +      if (*cachep == 0)
 70.1034 +	fill_inverse_cmap(cinfo, cur0>>C0_SHIFT,cur1>>C1_SHIFT,cur2>>C2_SHIFT);
 70.1035 +      /* Now emit the colormap index for this cell */
 70.1036 +      { register int pixcode = *cachep - 1;
 70.1037 +	*outptr = (JSAMPLE) pixcode;
 70.1038 +	/* Compute representation error for this pixel */
 70.1039 +	cur0 -= GETJSAMPLE(colormap0[pixcode]);
 70.1040 +	cur1 -= GETJSAMPLE(colormap1[pixcode]);
 70.1041 +	cur2 -= GETJSAMPLE(colormap2[pixcode]);
 70.1042 +      }
 70.1043 +      /* Compute error fractions to be propagated to adjacent pixels.
 70.1044 +       * Add these into the running sums, and simultaneously shift the
 70.1045 +       * next-line error sums left by 1 column.
 70.1046 +       */
 70.1047 +      { register LOCFSERROR bnexterr, delta;
 70.1048 +
 70.1049 +	bnexterr = cur0;	/* Process component 0 */
 70.1050 +	delta = cur0 * 2;
 70.1051 +	cur0 += delta;		/* form error * 3 */
 70.1052 +	errorptr[0] = (FSERROR) (bpreverr0 + cur0);
 70.1053 +	cur0 += delta;		/* form error * 5 */
 70.1054 +	bpreverr0 = belowerr0 + cur0;
 70.1055 +	belowerr0 = bnexterr;
 70.1056 +	cur0 += delta;		/* form error * 7 */
 70.1057 +	bnexterr = cur1;	/* Process component 1 */
 70.1058 +	delta = cur1 * 2;
 70.1059 +	cur1 += delta;		/* form error * 3 */
 70.1060 +	errorptr[1] = (FSERROR) (bpreverr1 + cur1);
 70.1061 +	cur1 += delta;		/* form error * 5 */
 70.1062 +	bpreverr1 = belowerr1 + cur1;
 70.1063 +	belowerr1 = bnexterr;
 70.1064 +	cur1 += delta;		/* form error * 7 */
 70.1065 +	bnexterr = cur2;	/* Process component 2 */
 70.1066 +	delta = cur2 * 2;
 70.1067 +	cur2 += delta;		/* form error * 3 */
 70.1068 +	errorptr[2] = (FSERROR) (bpreverr2 + cur2);
 70.1069 +	cur2 += delta;		/* form error * 5 */
 70.1070 +	bpreverr2 = belowerr2 + cur2;
 70.1071 +	belowerr2 = bnexterr;
 70.1072 +	cur2 += delta;		/* form error * 7 */
 70.1073 +      }
 70.1074 +      /* At this point curN contains the 7/16 error value to be propagated
 70.1075 +       * to the next pixel on the current line, and all the errors for the
 70.1076 +       * next line have been shifted over.  We are therefore ready to move on.
 70.1077 +       */
 70.1078 +      inptr += dir3;		/* Advance pixel pointers to next column */
 70.1079 +      outptr += dir;
 70.1080 +      errorptr += dir3;		/* advance errorptr to current column */
 70.1081 +    }
 70.1082 +    /* Post-loop cleanup: we must unload the final error values into the
 70.1083 +     * final fserrors[] entry.  Note we need not unload belowerrN because
 70.1084 +     * it is for the dummy column before or after the actual array.
 70.1085 +     */
 70.1086 +    errorptr[0] = (FSERROR) bpreverr0; /* unload prev errs into array */
 70.1087 +    errorptr[1] = (FSERROR) bpreverr1;
 70.1088 +    errorptr[2] = (FSERROR) bpreverr2;
 70.1089 +  }
 70.1090 +}
 70.1091 +
 70.1092 +
 70.1093 +/*
 70.1094 + * Initialize the error-limiting transfer function (lookup table).
 70.1095 + * The raw F-S error computation can potentially compute error values of up to
 70.1096 + * +- MAXJSAMPLE.  But we want the maximum correction applied to a pixel to be
 70.1097 + * much less, otherwise obviously wrong pixels will be created.  (Typical
 70.1098 + * effects include weird fringes at color-area boundaries, isolated bright
 70.1099 + * pixels in a dark area, etc.)  The standard advice for avoiding this problem
 70.1100 + * is to ensure that the "corners" of the color cube are allocated as output
 70.1101 + * colors; then repeated errors in the same direction cannot cause cascading
 70.1102 + * error buildup.  However, that only prevents the error from getting
 70.1103 + * completely out of hand; Aaron Giles reports that error limiting improves
 70.1104 + * the results even with corner colors allocated.
 70.1105 + * A simple clamping of the error values to about +- MAXJSAMPLE/8 works pretty
 70.1106 + * well, but the smoother transfer function used below is even better.  Thanks
 70.1107 + * to Aaron Giles for this idea.
 70.1108 + */
 70.1109 +
 70.1110 +LOCAL(void)
 70.1111 +init_error_limit (j_decompress_ptr cinfo)
 70.1112 +/* Allocate and fill in the error_limiter table */
 70.1113 +{
 70.1114 +  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
 70.1115 +  int * table;
 70.1116 +  int in, out;
 70.1117 +
 70.1118 +  table = (int *) (*cinfo->mem->alloc_small)
 70.1119 +    ((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE*2+1) * SIZEOF(int));
 70.1120 +  table += MAXJSAMPLE;		/* so can index -MAXJSAMPLE .. +MAXJSAMPLE */
 70.1121 +  cquantize->error_limiter = table;
 70.1122 +
 70.1123 +#define STEPSIZE ((MAXJSAMPLE+1)/16)
 70.1124 +  /* Map errors 1:1 up to +- MAXJSAMPLE/16 */
 70.1125 +  out = 0;
 70.1126 +  for (in = 0; in < STEPSIZE; in++, out++) {
 70.1127 +    table[in] = out; table[-in] = -out;
 70.1128 +  }
 70.1129 +  /* Map errors 1:2 up to +- 3*MAXJSAMPLE/16 */
 70.1130 +  for (; in < STEPSIZE*3; in++, out += (in&1) ? 0 : 1) {
 70.1131 +    table[in] = out; table[-in] = -out;
 70.1132 +  }
 70.1133 +  /* Clamp the rest to final out value (which is (MAXJSAMPLE+1)/8) */
 70.1134 +  for (; in <= MAXJSAMPLE; in++) {
 70.1135 +    table[in] = out; table[-in] = -out;
 70.1136 +  }
 70.1137 +#undef STEPSIZE
 70.1138 +}
 70.1139 +
 70.1140 +
 70.1141 +/*
 70.1142 + * Finish up at the end of each pass.
 70.1143 + */
 70.1144 +
 70.1145 +METHODDEF(void)
 70.1146 +finish_pass1 (j_decompress_ptr cinfo)
 70.1147 +{
 70.1148 +  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
 70.1149 +
 70.1150 +  /* Select the representative colors and fill in cinfo->colormap */
 70.1151 +  cinfo->colormap = cquantize->sv_colormap;
 70.1152 +  select_colors(cinfo, cquantize->desired);
 70.1153 +  /* Force next pass to zero the color index table */
 70.1154 +  cquantize->needs_zeroed = TRUE;
 70.1155 +}
 70.1156 +
 70.1157 +
 70.1158 +METHODDEF(void)
 70.1159 +finish_pass2 (j_decompress_ptr cinfo)
 70.1160 +{
 70.1161 +  /* no work */
 70.1162 +}
 70.1163 +
 70.1164 +
 70.1165 +/*
 70.1166 + * Initialize for each processing pass.
 70.1167 + */
 70.1168 +
 70.1169 +METHODDEF(void)
 70.1170 +start_pass_2_quant (j_decompress_ptr cinfo, boolean is_pre_scan)
 70.1171 +{
 70.1172 +  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
 70.1173 +  hist3d histogram = cquantize->histogram;
 70.1174 +  int i;
 70.1175 +
 70.1176 +  /* Only F-S dithering or no dithering is supported. */
 70.1177 +  /* If user asks for ordered dither, give him F-S. */
 70.1178 +  if (cinfo->dither_mode != JDITHER_NONE)
 70.1179 +    cinfo->dither_mode = JDITHER_FS;
 70.1180 +
 70.1181 +  if (is_pre_scan) {
 70.1182 +    /* Set up method pointers */
 70.1183 +    cquantize->pub.color_quantize = prescan_quantize;
 70.1184 +    cquantize->pub.finish_pass = finish_pass1;
 70.1185 +    cquantize->needs_zeroed = TRUE; /* Always zero histogram */
 70.1186 +  } else {
 70.1187 +    /* Set up method pointers */
 70.1188 +    if (cinfo->dither_mode == JDITHER_FS)
 70.1189 +      cquantize->pub.color_quantize = pass2_fs_dither;
 70.1190 +    else
 70.1191 +      cquantize->pub.color_quantize = pass2_no_dither;
 70.1192 +    cquantize->pub.finish_pass = finish_pass2;
 70.1193 +
 70.1194 +    /* Make sure color count is acceptable */
 70.1195 +    i = cinfo->actual_number_of_colors;
 70.1196 +    if (i < 1)
 70.1197 +      ERREXIT1(cinfo, JERR_QUANT_FEW_COLORS, 1);
 70.1198 +    if (i > MAXNUMCOLORS)
 70.1199 +      ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, MAXNUMCOLORS);
 70.1200 +
 70.1201 +    if (cinfo->dither_mode == JDITHER_FS) {
 70.1202 +      size_t arraysize = (size_t) ((cinfo->output_width + 2) *
 70.1203 +				   (3 * SIZEOF(FSERROR)));
 70.1204 +      /* Allocate Floyd-Steinberg workspace if we didn't already. */
 70.1205 +      if (cquantize->fserrors == NULL)
 70.1206 +	cquantize->fserrors = (FSERRPTR) (*cinfo->mem->alloc_large)
 70.1207 +	  ((j_common_ptr) cinfo, JPOOL_IMAGE, arraysize);
 70.1208 +      /* Initialize the propagated errors to zero. */
 70.1209 +      jzero_far((void FAR *) cquantize->fserrors, arraysize);
 70.1210 +      /* Make the error-limit table if we didn't already. */
 70.1211 +      if (cquantize->error_limiter == NULL)
 70.1212 +	init_error_limit(cinfo);
 70.1213 +      cquantize->on_odd_row = FALSE;
 70.1214 +    }
 70.1215 +
 70.1216 +  }
 70.1217 +  /* Zero the histogram or inverse color map, if necessary */
 70.1218 +  if (cquantize->needs_zeroed) {
 70.1219 +    for (i = 0; i < HIST_C0_ELEMS; i++) {
 70.1220 +      jzero_far((void FAR *) histogram[i],
 70.1221 +		HIST_C1_ELEMS*HIST_C2_ELEMS * SIZEOF(histcell));
 70.1222 +    }
 70.1223 +    cquantize->needs_zeroed = FALSE;
 70.1224 +  }
 70.1225 +}
 70.1226 +
 70.1227 +
 70.1228 +/*
 70.1229 + * Switch to a new external colormap between output passes.
 70.1230 + */
 70.1231 +
 70.1232 +METHODDEF(void)
 70.1233 +new_color_map_2_quant (j_decompress_ptr cinfo)
 70.1234 +{
 70.1235 +  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
 70.1236 +
 70.1237 +  /* Reset the inverse color map */
 70.1238 +  cquantize->needs_zeroed = TRUE;
 70.1239 +}
 70.1240 +
 70.1241 +
 70.1242 +/*
 70.1243 + * Module initialization routine for 2-pass color quantization.
 70.1244 + */
 70.1245 +
 70.1246 +GLOBAL(void)
 70.1247 +jinit_2pass_quantizer (j_decompress_ptr cinfo)
 70.1248 +{
 70.1249 +  my_cquantize_ptr cquantize;
 70.1250 +  int i;
 70.1251 +
 70.1252 +  cquantize = (my_cquantize_ptr)
 70.1253 +    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
 70.1254 +				SIZEOF(my_cquantizer));
 70.1255 +  cinfo->cquantize = (struct jpeg_color_quantizer *) cquantize;
 70.1256 +  cquantize->pub.start_pass = start_pass_2_quant;
 70.1257 +  cquantize->pub.new_color_map = new_color_map_2_quant;
 70.1258 +  cquantize->fserrors = NULL;	/* flag optional arrays not allocated */
 70.1259 +  cquantize->error_limiter = NULL;
 70.1260 +
 70.1261 +  /* Make sure jdmaster didn't give me a case I can't handle */
 70.1262 +  if (cinfo->out_color_components != 3)
 70.1263 +    ERREXIT(cinfo, JERR_NOTIMPL);
 70.1264 +
 70.1265 +  /* Allocate the histogram/inverse colormap storage */
 70.1266 +  cquantize->histogram = (hist3d) (*cinfo->mem->alloc_small)
 70.1267 +    ((j_common_ptr) cinfo, JPOOL_IMAGE, HIST_C0_ELEMS * SIZEOF(hist2d));
 70.1268 +  for (i = 0; i < HIST_C0_ELEMS; i++) {
 70.1269 +    cquantize->histogram[i] = (hist2d) (*cinfo->mem->alloc_large)
 70.1270 +      ((j_common_ptr) cinfo, JPOOL_IMAGE,
 70.1271 +       HIST_C1_ELEMS*HIST_C2_ELEMS * SIZEOF(histcell));
 70.1272 +  }
 70.1273 +  cquantize->needs_zeroed = TRUE; /* histogram is garbage now */
 70.1274 +
 70.1275 +  /* Allocate storage for the completed colormap, if required.
 70.1276 +   * We do this now since it is FAR storage and may affect
 70.1277 +   * the memory manager's space calculations.
 70.1278 +   */
 70.1279 +  if (cinfo->enable_2pass_quant) {
 70.1280 +    /* Make sure color count is acceptable */
 70.1281 +    int desired = cinfo->desired_number_of_colors;
 70.1282 +    /* Lower bound on # of colors ... somewhat arbitrary as long as > 0 */
 70.1283 +    if (desired < 8)
 70.1284 +      ERREXIT1(cinfo, JERR_QUANT_FEW_COLORS, 8);
 70.1285 +    /* Make sure colormap indexes can be represented by JSAMPLEs */
 70.1286 +    if (desired > MAXNUMCOLORS)
 70.1287 +      ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, MAXNUMCOLORS);
 70.1288 +    cquantize->sv_colormap = (*cinfo->mem->alloc_sarray)
 70.1289 +      ((j_common_ptr) cinfo,JPOOL_IMAGE, (JDIMENSION) desired, (JDIMENSION) 3);
 70.1290 +    cquantize->desired = desired;
 70.1291 +  } else
 70.1292 +    cquantize->sv_colormap = NULL;
 70.1293 +
 70.1294 +  /* Only F-S dithering or no dithering is supported. */
 70.1295 +  /* If user asks for ordered dither, give him F-S. */
 70.1296 +  if (cinfo->dither_mode != JDITHER_NONE)
 70.1297 +    cinfo->dither_mode = JDITHER_FS;
 70.1298 +
 70.1299 +  /* Allocate Floyd-Steinberg workspace if necessary.
 70.1300 +   * This isn't really needed until pass 2, but again it is FAR storage.
 70.1301 +   * Although we will cope with a later change in dither_mode,
 70.1302 +   * we do not promise to honor max_memory_to_use if dither_mode changes.
 70.1303 +   */
 70.1304 +  if (cinfo->dither_mode == JDITHER_FS) {
 70.1305 +    cquantize->fserrors = (FSERRPTR) (*cinfo->mem->alloc_large)
 70.1306 +      ((j_common_ptr) cinfo, JPOOL_IMAGE,
 70.1307 +       (size_t) ((cinfo->output_width + 2) * (3 * SIZEOF(FSERROR))));
 70.1308 +    /* Might as well create the error-limiting table too. */
 70.1309 +    init_error_limit(cinfo);
 70.1310 +  }
 70.1311 +}
 70.1312 +
 70.1313 +#endif /* QUANT_2PASS_SUPPORTED */
    71.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    71.2 +++ b/libs/libjpeg/jutils.c	Sun Nov 01 00:36:56 2015 +0200
    71.3 @@ -0,0 +1,179 @@
    71.4 +/*
    71.5 + * jutils.c
    71.6 + *
    71.7 + * Copyright (C) 1991-1996, Thomas G. Lane.
    71.8 + * This file is part of the Independent JPEG Group's software.
    71.9 + * For conditions of distribution and use, see the accompanying README file.
   71.10 + *
   71.11 + * This file contains tables and miscellaneous utility routines needed
   71.12 + * for both compression and decompression.
   71.13 + * Note we prefix all global names with "j" to minimize conflicts with
   71.14 + * a surrounding application.
   71.15 + */
   71.16 +
   71.17 +#define JPEG_INTERNALS
   71.18 +#include "jinclude.h"
   71.19 +#include "jpeglib.h"
   71.20 +
   71.21 +
   71.22 +/*
   71.23 + * jpeg_zigzag_order[i] is the zigzag-order position of the i'th element
   71.24 + * of a DCT block read in natural order (left to right, top to bottom).
   71.25 + */
   71.26 +
   71.27 +#if 0				/* This table is not actually needed in v6a */
   71.28 +
   71.29 +const int jpeg_zigzag_order[DCTSIZE2] = {
   71.30 +   0,  1,  5,  6, 14, 15, 27, 28,
   71.31 +   2,  4,  7, 13, 16, 26, 29, 42,
   71.32 +   3,  8, 12, 17, 25, 30, 41, 43,
   71.33 +   9, 11, 18, 24, 31, 40, 44, 53,
   71.34 +  10, 19, 23, 32, 39, 45, 52, 54,
   71.35 +  20, 22, 33, 38, 46, 51, 55, 60,
   71.36 +  21, 34, 37, 47, 50, 56, 59, 61,
   71.37 +  35, 36, 48, 49, 57, 58, 62, 63
   71.38 +};
   71.39 +
   71.40 +#endif
   71.41 +
   71.42 +/*
   71.43 + * jpeg_natural_order[i] is the natural-order position of the i'th element
   71.44 + * of zigzag order.
   71.45 + *
   71.46 + * When reading corrupted data, the Huffman decoders could attempt
   71.47 + * to reference an entry beyond the end of this array (if the decoded
   71.48 + * zero run length reaches past the end of the block).  To prevent
   71.49 + * wild stores without adding an inner-loop test, we put some extra
   71.50 + * "63"s after the real entries.  This will cause the extra coefficient
   71.51 + * to be stored in location 63 of the block, not somewhere random.
   71.52 + * The worst case would be a run-length of 15, which means we need 16
   71.53 + * fake entries.
   71.54 + */
   71.55 +
   71.56 +const int jpeg_natural_order[DCTSIZE2+16] = {
   71.57 +  0,  1,  8, 16,  9,  2,  3, 10,
   71.58 + 17, 24, 32, 25, 18, 11,  4,  5,
   71.59 + 12, 19, 26, 33, 40, 48, 41, 34,
   71.60 + 27, 20, 13,  6,  7, 14, 21, 28,
   71.61 + 35, 42, 49, 56, 57, 50, 43, 36,
   71.62 + 29, 22, 15, 23, 30, 37, 44, 51,
   71.63 + 58, 59, 52, 45, 38, 31, 39, 46,
   71.64 + 53, 60, 61, 54, 47, 55, 62, 63,
   71.65 + 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */
   71.66 + 63, 63, 63, 63, 63, 63, 63, 63
   71.67 +};
   71.68 +
   71.69 +
   71.70 +/*
   71.71 + * Arithmetic utilities
   71.72 + */
   71.73 +
   71.74 +GLOBAL(long)
   71.75 +jdiv_round_up (long a, long b)
   71.76 +/* Compute a/b rounded up to next integer, ie, ceil(a/b) */
   71.77 +/* Assumes a >= 0, b > 0 */
   71.78 +{
   71.79 +  return (a + b - 1L) / b;
   71.80 +}
   71.81 +
   71.82 +
   71.83 +GLOBAL(long)
   71.84 +jround_up (long a, long b)
   71.85 +/* Compute a rounded up to next multiple of b, ie, ceil(a/b)*b */
   71.86 +/* Assumes a >= 0, b > 0 */
   71.87 +{
   71.88 +  a += b - 1L;
   71.89 +  return a - (a % b);
   71.90 +}
   71.91 +
   71.92 +
   71.93 +/* On normal machines we can apply MEMCOPY() and MEMZERO() to sample arrays
   71.94 + * and coefficient-block arrays.  This won't work on 80x86 because the arrays
   71.95 + * are FAR and we're assuming a small-pointer memory model.  However, some
   71.96 + * DOS compilers provide far-pointer versions of memcpy() and memset() even
   71.97 + * in the small-model libraries.  These will be used if USE_FMEM is defined.
   71.98 + * Otherwise, the routines below do it the hard way.  (The performance cost
   71.99 + * is not all that great, because these routines aren't very heavily used.)
  71.100 + */
  71.101 +
  71.102 +#ifndef NEED_FAR_POINTERS	/* normal case, same as regular macros */
  71.103 +#define FMEMCOPY(dest,src,size)	MEMCOPY(dest,src,size)
  71.104 +#define FMEMZERO(target,size)	MEMZERO(target,size)
  71.105 +#else				/* 80x86 case, define if we can */
  71.106 +#ifdef USE_FMEM
  71.107 +#define FMEMCOPY(dest,src,size)	_fmemcpy((void FAR *)(dest), (const void FAR *)(src), (size_t)(size))
  71.108 +#define FMEMZERO(target,size)	_fmemset((void FAR *)(target), 0, (size_t)(size))
  71.109 +#endif
  71.110 +#endif
  71.111 +
  71.112 +
  71.113 +GLOBAL(void)
  71.114 +jcopy_sample_rows (JSAMPARRAY input_array, int source_row,
  71.115 +		   JSAMPARRAY output_array, int dest_row,
  71.116 +		   int num_rows, JDIMENSION num_cols)
  71.117 +/* Copy some rows of samples from one place to another.
  71.118 + * num_rows rows are copied from input_array[source_row++]
  71.119 + * to output_array[dest_row++]; these areas may overlap for duplication.
  71.120 + * The source and destination arrays must be at least as wide as num_cols.
  71.121 + */
  71.122 +{
  71.123 +  register JSAMPROW inptr, outptr;
  71.124 +#ifdef FMEMCOPY
  71.125 +  register size_t count = (size_t) (num_cols * SIZEOF(JSAMPLE));
  71.126 +#else
  71.127 +  register JDIMENSION count;
  71.128 +#endif
  71.129 +  register int row;
  71.130 +
  71.131 +  input_array += source_row;
  71.132 +  output_array += dest_row;
  71.133 +
  71.134 +  for (row = num_rows; row > 0; row--) {
  71.135 +    inptr = *input_array++;
  71.136 +    outptr = *output_array++;
  71.137 +#ifdef FMEMCOPY
  71.138 +    FMEMCOPY(outptr, inptr, count);
  71.139 +#else
  71.140 +    for (count = num_cols; count > 0; count--)
  71.141 +      *outptr++ = *inptr++;	/* needn't bother with GETJSAMPLE() here */
  71.142 +#endif
  71.143 +  }
  71.144 +}
  71.145 +
  71.146 +
  71.147 +GLOBAL(void)
  71.148 +jcopy_block_row (JBLOCKROW input_row, JBLOCKROW output_row,
  71.149 +		 JDIMENSION num_blocks)
  71.150 +/* Copy a row of coefficient blocks from one place to another. */
  71.151 +{
  71.152 +#ifdef FMEMCOPY
  71.153 +  FMEMCOPY(output_row, input_row, num_blocks * (DCTSIZE2 * SIZEOF(JCOEF)));
  71.154 +#else
  71.155 +  register JCOEFPTR inptr, outptr;
  71.156 +  register long count;
  71.157 +
  71.158 +  inptr = (JCOEFPTR) input_row;
  71.159 +  outptr = (JCOEFPTR) output_row;
  71.160 +  for (count = (long) num_blocks * DCTSIZE2; count > 0; count--) {
  71.161 +    *outptr++ = *inptr++;
  71.162 +  }
  71.163 +#endif
  71.164 +}
  71.165 +
  71.166 +
  71.167 +GLOBAL(void)
  71.168 +jzero_far (void FAR * target, size_t bytestozero)
  71.169 +/* Zero out a chunk of FAR memory. */
  71.170 +/* This might be sample-array data, block-array data, or alloc_large data. */
  71.171 +{
  71.172 +#ifdef FMEMZERO
  71.173 +  FMEMZERO(target, bytestozero);
  71.174 +#else
  71.175 +  register char FAR * ptr = (char FAR *) target;
  71.176 +  register size_t count;
  71.177 +
  71.178 +  for (count = bytestozero; count > 0; count--) {
  71.179 +    *ptr++ = 0;
  71.180 +  }
  71.181 +#endif
  71.182 +}
    72.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    72.2 +++ b/libs/libjpeg/jversion.h	Sun Nov 01 00:36:56 2015 +0200
    72.3 @@ -0,0 +1,14 @@
    72.4 +/*
    72.5 + * jversion.h
    72.6 + *
    72.7 + * Copyright (C) 1991-1998, Thomas G. Lane.
    72.8 + * This file is part of the Independent JPEG Group's software.
    72.9 + * For conditions of distribution and use, see the accompanying README file.
   72.10 + *
   72.11 + * This file contains software version identification.
   72.12 + */
   72.13 +
   72.14 +
   72.15 +#define JVERSION	"6b  27-Mar-1998"
   72.16 +
   72.17 +#define JCOPYRIGHT	"Copyright (C) 1998, Thomas G. Lane"
    73.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    73.2 +++ b/libs/libpng/LICENSE	Sun Nov 01 00:36:56 2015 +0200
    73.3 @@ -0,0 +1,111 @@
    73.4 +
    73.5 +This copy of the libpng notices is provided for your convenience.  In case of
    73.6 +any discrepancy between this copy and the notices in the file png.h that is
    73.7 +included in the libpng distribution, the latter shall prevail.
    73.8 +
    73.9 +COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
   73.10 +
   73.11 +If you modify libpng you may insert additional notices immediately following
   73.12 +this sentence.
   73.13 +
   73.14 +This code is released under the libpng license.
   73.15 +
   73.16 +libpng versions 1.2.6, August 15, 2004, through 1.5.4, July 7, 2011, are
   73.17 +Copyright (c) 2004, 2006-2011 Glenn Randers-Pehrson, and are
   73.18 +distributed according to the same disclaimer and license as libpng-1.2.5
   73.19 +with the following individual added to the list of Contributing Authors
   73.20 +
   73.21 +   Cosmin Truta
   73.22 +
   73.23 +libpng versions 1.0.7, July 1, 2000, through 1.2.5 - October 3, 2002, are
   73.24 +Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are
   73.25 +distributed according to the same disclaimer and license as libpng-1.0.6
   73.26 +with the following individuals added to the list of Contributing Authors
   73.27 +
   73.28 +   Simon-Pierre Cadieux
   73.29 +   Eric S. Raymond
   73.30 +   Gilles Vollant
   73.31 +
   73.32 +and with the following additions to the disclaimer:
   73.33 +
   73.34 +   There is no warranty against interference with your enjoyment of the
   73.35 +   library or against infringement.  There is no warranty that our
   73.36 +   efforts or the library will fulfill any of your particular purposes
   73.37 +   or needs.  This library is provided with all faults, and the entire
   73.38 +   risk of satisfactory quality, performance, accuracy, and effort is with
   73.39 +   the user.
   73.40 +
   73.41 +libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
   73.42 +Copyright (c) 1998, 1999 Glenn Randers-Pehrson, and are
   73.43 +distributed according to the same disclaimer and license as libpng-0.96,
   73.44 +with the following individuals added to the list of Contributing Authors:
   73.45 +
   73.46 +   Tom Lane
   73.47 +   Glenn Randers-Pehrson
   73.48 +   Willem van Schaik
   73.49 +
   73.50 +libpng versions 0.89, June 1996, through 0.96, May 1997, are
   73.51 +Copyright (c) 1996, 1997 Andreas Dilger
   73.52 +Distributed according to the same disclaimer and license as libpng-0.88,
   73.53 +with the following individuals added to the list of Contributing Authors:
   73.54 +
   73.55 +   John Bowler
   73.56 +   Kevin Bracey
   73.57 +   Sam Bushell
   73.58 +   Magnus Holmgren
   73.59 +   Greg Roelofs
   73.60 +   Tom Tanner
   73.61 +
   73.62 +libpng versions 0.5, May 1995, through 0.88, January 1996, are
   73.63 +Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
   73.64 +
   73.65 +For the purposes of this copyright and license, "Contributing Authors"
   73.66 +is defined as the following set of individuals:
   73.67 +
   73.68 +   Andreas Dilger
   73.69 +   Dave Martindale
   73.70 +   Guy Eric Schalnat
   73.71 +   Paul Schmidt
   73.72 +   Tim Wegner
   73.73 +
   73.74 +The PNG Reference Library is supplied "AS IS".  The Contributing Authors
   73.75 +and Group 42, Inc. disclaim all warranties, expressed or implied,
   73.76 +including, without limitation, the warranties of merchantability and of
   73.77 +fitness for any purpose.  The Contributing Authors and Group 42, Inc.
   73.78 +assume no liability for direct, indirect, incidental, special, exemplary,
   73.79 +or consequential damages, which may result from the use of the PNG
   73.80 +Reference Library, even if advised of the possibility of such damage.
   73.81 +
   73.82 +Permission is hereby granted to use, copy, modify, and distribute this
   73.83 +source code, or portions hereof, for any purpose, without fee, subject
   73.84 +to the following restrictions:
   73.85 +
   73.86 +1. The origin of this source code must not be misrepresented.
   73.87 +
   73.88 +2. Altered versions must be plainly marked as such and must not
   73.89 +   be misrepresented as being the original source.
   73.90 +
   73.91 +3. This Copyright notice may not be removed or altered from any
   73.92 +   source or altered source distribution.
   73.93 +
   73.94 +The Contributing Authors and Group 42, Inc. specifically permit, without
   73.95 +fee, and encourage the use of this source code as a component to
   73.96 +supporting the PNG file format in commercial products.  If you use this
   73.97 +source code in a product, acknowledgment is not required but would be
   73.98 +appreciated.
   73.99 +
  73.100 +
  73.101 +A "png_get_copyright" function is available, for convenient use in "about"
  73.102 +boxes and the like:
  73.103 +
  73.104 +   printf("%s",png_get_copyright(NULL));
  73.105 +
  73.106 +Also, the PNG logo (in PNG format, of course) is supplied in the
  73.107 +files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31).
  73.108 +
  73.109 +Libpng is OSI Certified Open Source Software.  OSI Certified Open Source is a
  73.110 +certification mark of the Open Source Initiative.
  73.111 +
  73.112 +Glenn Randers-Pehrson
  73.113 +glennrp at users.sourceforge.net
  73.114 +July 7, 2011
    74.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    74.2 +++ b/libs/libpng/png.c	Sun Nov 01 00:36:56 2015 +0200
    74.3 @@ -0,0 +1,799 @@
    74.4 +
    74.5 +/* png.c - location for general purpose libpng functions
    74.6 + *
    74.7 + * Last changed in libpng 1.2.30 [August 15, 2008]
    74.8 + * For conditions of distribution and use, see copyright notice in png.h
    74.9 + * Copyright (c) 1998-2008 Glenn Randers-Pehrson
   74.10 + * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
   74.11 + * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
   74.12 + */
   74.13 +
   74.14 +#define PNG_INTERNAL
   74.15 +#define PNG_NO_EXTERN
   74.16 +#include "png.h"
   74.17 +
   74.18 +/* Generate a compiler error if there is an old png.h in the search path. */
   74.19 +typedef version_1_2_33 Your_png_h_is_not_version_1_2_33;
   74.20 +
   74.21 +/* Version information for C files.  This had better match the version
   74.22 + * string defined in png.h.  */
   74.23 +
   74.24 +#ifdef PNG_USE_GLOBAL_ARRAYS
   74.25 +/* png_libpng_ver was changed to a function in version 1.0.5c */
   74.26 +PNG_CONST char png_libpng_ver[18] = PNG_LIBPNG_VER_STRING;
   74.27 +
   74.28 +#ifdef PNG_READ_SUPPORTED
   74.29 +
   74.30 +/* png_sig was changed to a function in version 1.0.5c */
   74.31 +/* Place to hold the signature string for a PNG file. */
   74.32 +PNG_CONST png_byte FARDATA png_sig[8] = {137, 80, 78, 71, 13, 10, 26, 10};
   74.33 +#endif /* PNG_READ_SUPPORTED */
   74.34 +
   74.35 +/* Invoke global declarations for constant strings for known chunk types */
   74.36 +PNG_IHDR;
   74.37 +PNG_IDAT;
   74.38 +PNG_IEND;
   74.39 +PNG_PLTE;
   74.40 +PNG_bKGD;
   74.41 +PNG_cHRM;
   74.42 +PNG_gAMA;
   74.43 +PNG_hIST;
   74.44 +PNG_iCCP;
   74.45 +PNG_iTXt;
   74.46 +PNG_oFFs;
   74.47 +PNG_pCAL;
   74.48 +PNG_sCAL;
   74.49 +PNG_pHYs;
   74.50 +PNG_sBIT;
   74.51 +PNG_sPLT;
   74.52 +PNG_sRGB;
   74.53 +PNG_tEXt;
   74.54 +PNG_tIME;
   74.55 +PNG_tRNS;
   74.56 +PNG_zTXt;
   74.57 +
   74.58 +#ifdef PNG_READ_SUPPORTED
   74.59 +/* arrays to facilitate easy interlacing - use pass (0 - 6) as index */
   74.60 +
   74.61 +/* start of interlace block */
   74.62 +PNG_CONST int FARDATA png_pass_start[] = {0, 4, 0, 2, 0, 1, 0};
   74.63 +
   74.64 +/* offset to next interlace block */
   74.65 +PNG_CONST int FARDATA png_pass_inc[] = {8, 8, 4, 4, 2, 2, 1};
   74.66 +
   74.67 +/* start of interlace block in the y direction */
   74.68 +PNG_CONST int FARDATA png_pass_ystart[] = {0, 0, 4, 0, 2, 0, 1};
   74.69 +
   74.70 +/* offset to next interlace block in the y direction */
   74.71 +PNG_CONST int FARDATA png_pass_yinc[] = {8, 8, 8, 4, 4, 2, 2};
   74.72 +
   74.73 +/* Height of interlace block.  This is not currently used - if you need
   74.74 + * it, uncomment it here and in png.h
   74.75 +PNG_CONST int FARDATA png_pass_height[] = {8, 8, 4, 4, 2, 2, 1};
   74.76 +*/
   74.77 +
   74.78 +/* Mask to determine which pixels are valid in a pass */
   74.79 +PNG_CONST int FARDATA png_pass_mask[] = {0x80, 0x08, 0x88, 0x22, 0xaa, 0x55, 0xff};
   74.80 +
   74.81 +/* Mask to determine which pixels to overwrite while displaying */
   74.82 +PNG_CONST int FARDATA png_pass_dsp_mask[]
   74.83 +   = {0xff, 0x0f, 0xff, 0x33, 0xff, 0x55, 0xff};
   74.84 +
   74.85 +#endif /* PNG_READ_SUPPORTED */
   74.86 +#endif /* PNG_USE_GLOBAL_ARRAYS */
   74.87 +
   74.88 +/* Tells libpng that we have already handled the first "num_bytes" bytes
   74.89 + * of the PNG file signature.  If the PNG data is embedded into another
   74.90 + * stream we can set num_bytes = 8 so that libpng will not attempt to read
   74.91 + * or write any of the magic bytes before it starts on the IHDR.
   74.92 + */
   74.93 +
   74.94 +#ifdef PNG_READ_SUPPORTED
   74.95 +void PNGAPI
   74.96 +png_set_sig_bytes(png_structp png_ptr, int num_bytes)
   74.97 +{
   74.98 +   if (png_ptr == NULL) return;
   74.99 +   png_debug(1, "in png_set_sig_bytes\n");
  74.100 +   if (num_bytes > 8)
  74.101 +      png_error(png_ptr, "Too many bytes for PNG signature.");
  74.102 +
  74.103 +   png_ptr->sig_bytes = (png_byte)(num_bytes < 0 ? 0 : num_bytes);
  74.104 +}
  74.105 +
  74.106 +/* Checks whether the supplied bytes match the PNG signature.  We allow
  74.107 + * checking less than the full 8-byte signature so that those apps that
  74.108 + * already read the first few bytes of a file to determine the file type
  74.109 + * can simply check the remaining bytes for extra assurance.  Returns
  74.110 + * an integer less than, equal to, or greater than zero if sig is found,
  74.111 + * respectively, to be less than, to match, or be greater than the correct
  74.112 + * PNG signature (this is the same behaviour as strcmp, memcmp, etc).
  74.113 + */
  74.114 +int PNGAPI
  74.115 +png_sig_cmp(png_bytep sig, png_size_t start, png_size_t num_to_check)
  74.116 +{
  74.117 +   png_byte png_signature[8] = {137, 80, 78, 71, 13, 10, 26, 10};
  74.118 +   if (num_to_check > 8)
  74.119 +      num_to_check = 8;
  74.120 +   else if (num_to_check < 1)
  74.121 +      return (-1);
  74.122 +
  74.123 +   if (start > 7)
  74.124 +      return (-1);
  74.125 +
  74.126 +   if (start + num_to_check > 8)
  74.127 +      num_to_check = 8 - start;
  74.128 +
  74.129 +   return ((int)(png_memcmp(&sig[start], &png_signature[start], num_to_check)));
  74.130 +}
  74.131 +
  74.132 +#if defined(PNG_1_0_X) || defined(PNG_1_2_X)
  74.133 +/* (Obsolete) function to check signature bytes.  It does not allow one
  74.134 + * to check a partial signature.  This function might be removed in the
  74.135 + * future - use png_sig_cmp().  Returns true (nonzero) if the file is PNG.
  74.136 + */
  74.137 +int PNGAPI
  74.138 +png_check_sig(png_bytep sig, int num)
  74.139 +{
  74.140 +  return ((int)!png_sig_cmp(sig, (png_size_t)0, (png_size_t)num));
  74.141 +}
  74.142 +#endif
  74.143 +#endif /* PNG_READ_SUPPORTED */
  74.144 +
  74.145 +#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
  74.146 +/* Function to allocate memory for zlib and clear it to 0. */
  74.147 +#ifdef PNG_1_0_X
  74.148 +voidpf PNGAPI
  74.149 +#else
  74.150 +voidpf /* private */
  74.151 +#endif
  74.152 +png_zalloc(voidpf png_ptr, uInt items, uInt size)
  74.153 +{
  74.154 +   png_voidp ptr;
  74.155 +   png_structp p=(png_structp)png_ptr;
  74.156 +   png_uint_32 save_flags=p->flags;
  74.157 +   png_uint_32 num_bytes;
  74.158 +
  74.159 +   if (png_ptr == NULL) return (NULL);
  74.160 +   if (items > PNG_UINT_32_MAX/size)
  74.161 +   {
  74.162 +     png_warning (p, "Potential overflow in png_zalloc()");
  74.163 +     return (NULL);
  74.164 +   }
  74.165 +   num_bytes = (png_uint_32)items * size;
  74.166 +
  74.167 +   p->flags|=PNG_FLAG_MALLOC_NULL_MEM_OK;
  74.168 +   ptr = (png_voidp)png_malloc((png_structp)png_ptr, num_bytes);
  74.169 +   p->flags=save_flags;
  74.170 +
  74.171 +#if defined(PNG_1_0_X) && !defined(PNG_NO_ZALLOC_ZERO)
  74.172 +   if (ptr == NULL)
  74.173 +       return ((voidpf)ptr);
  74.174 +
  74.175 +   if (num_bytes > (png_uint_32)0x8000L)
  74.176 +   {
  74.177 +      png_memset(ptr, 0, (png_size_t)0x8000L);
  74.178 +      png_memset((png_bytep)ptr + (png_size_t)0x8000L, 0,
  74.179 +         (png_size_t)(num_bytes - (png_uint_32)0x8000L));
  74.180 +   }
  74.181 +   else
  74.182 +   {
  74.183 +      png_memset(ptr, 0, (png_size_t)num_bytes);
  74.184 +   }
  74.185 +#endif
  74.186 +   return ((voidpf)ptr);
  74.187 +}
  74.188 +
  74.189 +/* function to free memory for zlib */
  74.190 +#ifdef PNG_1_0_X
  74.191 +void PNGAPI
  74.192 +#else
  74.193 +void /* private */
  74.194 +#endif
  74.195 +png_zfree(voidpf png_ptr, voidpf ptr)
  74.196 +{
  74.197 +   png_free((png_structp)png_ptr, (png_voidp)ptr);
  74.198 +}
  74.199 +
  74.200 +/* Reset the CRC variable to 32 bits of 1's.  Care must be taken
  74.201 + * in case CRC is > 32 bits to leave the top bits 0.
  74.202 + */
  74.203 +void /* PRIVATE */
  74.204 +png_reset_crc(png_structp png_ptr)
  74.205 +{
  74.206 +   png_ptr->crc = crc32(0, Z_NULL, 0);
  74.207 +}
  74.208 +
  74.209 +/* Calculate the CRC over a section of data.  We can only pass as
  74.210 + * much data to this routine as the largest single buffer size.  We
  74.211 + * also check that this data will actually be used before going to the
  74.212 + * trouble of calculating it.
  74.213 + */
  74.214 +void /* PRIVATE */
  74.215 +png_calculate_crc(png_structp png_ptr, png_bytep ptr, png_size_t length)
  74.216 +{
  74.217 +   int need_crc = 1;
  74.218 +
  74.219 +   if (png_ptr->chunk_name[0] & 0x20)                     /* ancillary */
  74.220 +   {
  74.221 +      if ((png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_MASK) ==
  74.222 +          (PNG_FLAG_CRC_ANCILLARY_USE | PNG_FLAG_CRC_ANCILLARY_NOWARN))
  74.223 +         need_crc = 0;
  74.224 +   }
  74.225 +   else                                                    /* critical */
  74.226 +   {
  74.227 +      if (png_ptr->flags & PNG_FLAG_CRC_CRITICAL_IGNORE)
  74.228 +         need_crc = 0;
  74.229 +   }
  74.230 +
  74.231 +   if (need_crc)
  74.232 +      png_ptr->crc = crc32(png_ptr->crc, ptr, (uInt)length);
  74.233 +}
  74.234 +
  74.235 +/* Allocate the memory for an info_struct for the application.  We don't
  74.236 + * really need the png_ptr, but it could potentially be useful in the
  74.237 + * future.  This should be used in favour of malloc(png_sizeof(png_info))
  74.238 + * and png_info_init() so that applications that want to use a shared
  74.239 + * libpng don't have to be recompiled if png_info changes size.
  74.240 + */
  74.241 +png_infop PNGAPI
  74.242 +png_create_info_struct(png_structp png_ptr)
  74.243 +{
  74.244 +   png_infop info_ptr;
  74.245 +
  74.246 +   png_debug(1, "in png_create_info_struct\n");
  74.247 +   if (png_ptr == NULL) return (NULL);
  74.248 +#ifdef PNG_USER_MEM_SUPPORTED
  74.249 +   info_ptr = (png_infop)png_create_struct_2(PNG_STRUCT_INFO,
  74.250 +      png_ptr->malloc_fn, png_ptr->mem_ptr);
  74.251 +#else
  74.252 +   info_ptr = (png_infop)png_create_struct(PNG_STRUCT_INFO);
  74.253 +#endif
  74.254 +   if (info_ptr != NULL)
  74.255 +      png_info_init_3(&info_ptr, png_sizeof(png_info));
  74.256 +
  74.257 +   return (info_ptr);
  74.258 +}
  74.259 +
  74.260 +/* This function frees the memory associated with a single info struct.
  74.261 + * Normally, one would use either png_destroy_read_struct() or
  74.262 + * png_destroy_write_struct() to free an info struct, but this may be
  74.263 + * useful for some applications.
  74.264 + */
  74.265 +void PNGAPI
  74.266 +png_destroy_info_struct(png_structp png_ptr, png_infopp info_ptr_ptr)
  74.267 +{
  74.268 +   png_infop info_ptr = NULL;
  74.269 +   if (png_ptr == NULL) return;
  74.270 +
  74.271 +   png_debug(1, "in png_destroy_info_struct\n");
  74.272 +   if (info_ptr_ptr != NULL)
  74.273 +      info_ptr = *info_ptr_ptr;
  74.274 +
  74.275 +   if (info_ptr != NULL)
  74.276 +   {
  74.277 +      png_info_destroy(png_ptr, info_ptr);
  74.278 +
  74.279 +#ifdef PNG_USER_MEM_SUPPORTED
  74.280 +      png_destroy_struct_2((png_voidp)info_ptr, png_ptr->free_fn,
  74.281 +          png_ptr->mem_ptr);
  74.282 +#else
  74.283 +      png_destroy_struct((png_voidp)info_ptr);
  74.284 +#endif
  74.285 +      *info_ptr_ptr = NULL;
  74.286 +   }
  74.287 +}
  74.288 +
  74.289 +/* Initialize the info structure.  This is now an internal function (0.89)
  74.290 + * and applications using it are urged to use png_create_info_struct()
  74.291 + * instead.
  74.292 + */
  74.293 +#if defined(PNG_1_0_X) || defined(PNG_1_2_X)
  74.294 +#undef png_info_init
  74.295 +void PNGAPI
  74.296 +png_info_init(png_infop info_ptr)
  74.297 +{
  74.298 +   /* We only come here via pre-1.0.12-compiled applications */
  74.299 +   png_info_init_3(&info_ptr, 0);
  74.300 +}
  74.301 +#endif
  74.302 +
  74.303 +void PNGAPI
  74.304 +png_info_init_3(png_infopp ptr_ptr, png_size_t png_info_struct_size)
  74.305 +{
  74.306 +   png_infop info_ptr = *ptr_ptr;
  74.307 +
  74.308 +   if (info_ptr == NULL) return;
  74.309 +
  74.310 +   png_debug(1, "in png_info_init_3\n");
  74.311 +
  74.312 +   if (png_sizeof(png_info) > png_info_struct_size)
  74.313 +     {
  74.314 +       png_destroy_struct(info_ptr);
  74.315 +       info_ptr = (png_infop)png_create_struct(PNG_STRUCT_INFO);
  74.316 +       *ptr_ptr = info_ptr;
  74.317 +     }
  74.318 +
  74.319 +   /* set everything to 0 */
  74.320 +   png_memset(info_ptr, 0, png_sizeof(png_info));
  74.321 +}
  74.322 +
  74.323 +#ifdef PNG_FREE_ME_SUPPORTED
  74.324 +void PNGAPI
  74.325 +png_data_freer(png_structp png_ptr, png_infop info_ptr,
  74.326 +   int freer, png_uint_32 mask)
  74.327 +{
  74.328 +   png_debug(1, "in png_data_freer\n");
  74.329 +   if (png_ptr == NULL || info_ptr == NULL)
  74.330 +      return;
  74.331 +   if (freer == PNG_DESTROY_WILL_FREE_DATA)
  74.332 +      info_ptr->free_me |= mask;
  74.333 +   else if (freer == PNG_USER_WILL_FREE_DATA)
  74.334 +      info_ptr->free_me &= ~mask;
  74.335 +   else
  74.336 +      png_warning(png_ptr,
  74.337 +         "Unknown freer parameter in png_data_freer.");
  74.338 +}
  74.339 +#endif
  74.340 +
  74.341 +void PNGAPI
  74.342 +png_free_data(png_structp png_ptr, png_infop info_ptr, png_uint_32 mask,
  74.343 +   int num)
  74.344 +{
  74.345 +   png_debug(1, "in png_free_data\n");
  74.346 +   if (png_ptr == NULL || info_ptr == NULL)
  74.347 +      return;
  74.348 +
  74.349 +#if defined(PNG_TEXT_SUPPORTED)
  74.350 +/* free text item num or (if num == -1) all text items */
  74.351 +#ifdef PNG_FREE_ME_SUPPORTED
  74.352 +if ((mask & PNG_FREE_TEXT) & info_ptr->free_me)
  74.353 +#else
  74.354 +if (mask & PNG_FREE_TEXT)
  74.355 +#endif
  74.356 +{
  74.357 +   if (num != -1)
  74.358 +   {
  74.359 +     if (info_ptr->text && info_ptr->text[num].key)
  74.360 +     {
  74.361 +         png_free(png_ptr, info_ptr->text[num].key);
  74.362 +         info_ptr->text[num].key = NULL;
  74.363 +     }
  74.364 +   }
  74.365 +   else
  74.366 +   {
  74.367 +       int i;
  74.368 +       for (i = 0; i < info_ptr->num_text; i++)
  74.369 +           png_free_data(png_ptr, info_ptr, PNG_FREE_TEXT, i);
  74.370 +       png_free(png_ptr, info_ptr->text);
  74.371 +       info_ptr->text = NULL;
  74.372 +       info_ptr->num_text=0;
  74.373 +   }
  74.374 +}
  74.375 +#endif
  74.376 +
  74.377 +#if defined(PNG_tRNS_SUPPORTED)
  74.378 +/* free any tRNS entry */
  74.379 +#ifdef PNG_FREE_ME_SUPPORTED
  74.380 +if ((mask & PNG_FREE_TRNS) & info_ptr->free_me)
  74.381 +#else
  74.382 +if ((mask & PNG_FREE_TRNS) && (png_ptr->flags & PNG_FLAG_FREE_TRNS))
  74.383 +#endif
  74.384 +{
  74.385 +    png_free(png_ptr, info_ptr->trans);
  74.386 +    info_ptr->trans = NULL;
  74.387 +    info_ptr->valid &= ~PNG_INFO_tRNS;
  74.388 +#ifndef PNG_FREE_ME_SUPPORTED
  74.389 +    png_ptr->flags &= ~PNG_FLAG_FREE_TRNS;
  74.390 +#endif
  74.391 +}
  74.392 +#endif
  74.393 +
  74.394 +#if defined(PNG_sCAL_SUPPORTED)
  74.395 +/* free any sCAL entry */
  74.396 +#ifdef PNG_FREE_ME_SUPPORTED
  74.397 +if ((mask & PNG_FREE_SCAL) & info_ptr->free_me)
  74.398 +#else
  74.399 +if (mask & PNG_FREE_SCAL)
  74.400 +#endif
  74.401 +{
  74.402 +#if defined(PNG_FIXED_POINT_SUPPORTED) && !defined(PNG_FLOATING_POINT_SUPPORTED)
  74.403 +    png_free(png_ptr, info_ptr->scal_s_width);
  74.404 +    png_free(png_ptr, info_ptr->scal_s_height);
  74.405 +    info_ptr->scal_s_width = NULL;
  74.406 +    info_ptr->scal_s_height = NULL;
  74.407 +#endif
  74.408 +    info_ptr->valid &= ~PNG_INFO_sCAL;
  74.409 +}
  74.410 +#endif
  74.411 +
  74.412 +#if defined(PNG_pCAL_SUPPORTED)
  74.413 +/* free any pCAL entry */
  74.414 +#ifdef PNG_FREE_ME_SUPPORTED
  74.415 +if ((mask & PNG_FREE_PCAL) & info_ptr->free_me)
  74.416 +#else
  74.417 +if (mask & PNG_FREE_PCAL)
  74.418 +#endif
  74.419 +{
  74.420 +    png_free(png_ptr, info_ptr->pcal_purpose);
  74.421 +    png_free(png_ptr, info_ptr->pcal_units);
  74.422 +    info_ptr->pcal_purpose = NULL;
  74.423 +    info_ptr->pcal_units = NULL;
  74.424 +    if (info_ptr->pcal_params != NULL)
  74.425 +    {
  74.426 +        int i;
  74.427 +        for (i = 0; i < (int)info_ptr->pcal_nparams; i++)
  74.428 +        {
  74.429 +          png_free(png_ptr, info_ptr->pcal_params[i]);
  74.430 +          info_ptr->pcal_params[i]=NULL;
  74.431 +        }
  74.432 +        png_free(png_ptr, info_ptr->pcal_params);
  74.433 +        info_ptr->pcal_params = NULL;
  74.434 +    }
  74.435 +    info_ptr->valid &= ~PNG_INFO_pCAL;
  74.436 +}
  74.437 +#endif
  74.438 +
  74.439 +#if defined(PNG_iCCP_SUPPORTED)
  74.440 +/* free any iCCP entry */
  74.441 +#ifdef PNG_FREE_ME_SUPPORTED
  74.442 +if ((mask & PNG_FREE_ICCP) & info_ptr->free_me)
  74.443 +#else
  74.444 +if (mask & PNG_FREE_ICCP)
  74.445 +#endif
  74.446 +{
  74.447 +    png_free(png_ptr, info_ptr->iccp_name);
  74.448 +    png_free(png_ptr, info_ptr->iccp_profile);
  74.449 +    info_ptr->iccp_name = NULL;
  74.450 +    info_ptr->iccp_profile = NULL;
  74.451 +    info_ptr->valid &= ~PNG_INFO_iCCP;
  74.452 +}
  74.453 +#endif
  74.454 +
  74.455 +#if defined(PNG_sPLT_SUPPORTED)
  74.456 +/* free a given sPLT entry, or (if num == -1) all sPLT entries */
  74.457 +#ifdef PNG_FREE_ME_SUPPORTED
  74.458 +if ((mask & PNG_FREE_SPLT) & info_ptr->free_me)
  74.459 +#else
  74.460 +if (mask & PNG_FREE_SPLT)
  74.461 +#endif
  74.462 +{
  74.463 +   if (num != -1)
  74.464 +   {
  74.465 +      if (info_ptr->splt_palettes)
  74.466 +      {
  74.467 +          png_free(png_ptr, info_ptr->splt_palettes[num].name);
  74.468 +          png_free(png_ptr, info_ptr->splt_palettes[num].entries);
  74.469 +          info_ptr->splt_palettes[num].name = NULL;
  74.470 +          info_ptr->splt_palettes[num].entries = NULL;
  74.471 +      }
  74.472 +   }
  74.473 +   else
  74.474 +   {
  74.475 +       if (info_ptr->splt_palettes_num)
  74.476 +       {
  74.477 +         int i;
  74.478 +         for (i = 0; i < (int)info_ptr->splt_palettes_num; i++)
  74.479 +            png_free_data(png_ptr, info_ptr, PNG_FREE_SPLT, i);
  74.480 +
  74.481 +         png_free(png_ptr, info_ptr->splt_palettes);
  74.482 +         info_ptr->splt_palettes = NULL;
  74.483 +         info_ptr->splt_palettes_num = 0;
  74.484 +       }
  74.485 +       info_ptr->valid &= ~PNG_INFO_sPLT;
  74.486 +   }
  74.487 +}
  74.488 +#endif
  74.489 +
  74.490 +#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
  74.491 +  if (png_ptr->unknown_chunk.data)
  74.492 +  {
  74.493 +    png_free(png_ptr, png_ptr->unknown_chunk.data);
  74.494 +    png_ptr->unknown_chunk.data = NULL;
  74.495 +  }
  74.496 +
  74.497 +#ifdef PNG_FREE_ME_SUPPORTED
  74.498 +if ((mask & PNG_FREE_UNKN) & info_ptr->free_me)
  74.499 +#else
  74.500 +if (mask & PNG_FREE_UNKN)
  74.501 +#endif
  74.502 +{
  74.503 +   if (num != -1)
  74.504 +   {
  74.505 +       if (info_ptr->unknown_chunks)
  74.506 +       {
  74.507 +          png_free(png_ptr, info_ptr->unknown_chunks[num].data);
  74.508 +          info_ptr->unknown_chunks[num].data = NULL;
  74.509 +       }
  74.510 +   }
  74.511 +   else
  74.512 +   {
  74.513 +       int i;
  74.514 +
  74.515 +       if (info_ptr->unknown_chunks_num)
  74.516 +       {
  74.517 +         for (i = 0; i < (int)info_ptr->unknown_chunks_num; i++)
  74.518 +            png_free_data(png_ptr, info_ptr, PNG_FREE_UNKN, i);
  74.519 +
  74.520 +         png_free(png_ptr, info_ptr->unknown_chunks);
  74.521 +         info_ptr->unknown_chunks = NULL;
  74.522 +         info_ptr->unknown_chunks_num = 0;
  74.523 +       }
  74.524 +   }
  74.525 +}
  74.526 +#endif
  74.527 +
  74.528 +#if defined(PNG_hIST_SUPPORTED)
  74.529 +/* free any hIST entry */
  74.530 +#ifdef PNG_FREE_ME_SUPPORTED
  74.531 +if ((mask & PNG_FREE_HIST)  & info_ptr->free_me)
  74.532 +#else
  74.533 +if ((mask & PNG_FREE_HIST) && (png_ptr->flags & PNG_FLAG_FREE_HIST))
  74.534 +#endif
  74.535 +{
  74.536 +    png_free(png_ptr, info_ptr->hist);
  74.537 +    info_ptr->hist = NULL;
  74.538 +    info_ptr->valid &= ~PNG_INFO_hIST;
  74.539 +#ifndef PNG_FREE_ME_SUPPORTED
  74.540 +    png_ptr->flags &= ~PNG_FLAG_FREE_HIST;
  74.541 +#endif
  74.542 +}
  74.543 +#endif
  74.544 +
  74.545 +/* free any PLTE entry that was internally allocated */
  74.546 +#ifdef PNG_FREE_ME_SUPPORTED
  74.547 +if ((mask & PNG_FREE_PLTE) & info_ptr->free_me)
  74.548 +#else
  74.549 +if ((mask & PNG_FREE_PLTE) && (png_ptr->flags & PNG_FLAG_FREE_PLTE))
  74.550 +#endif
  74.551 +{
  74.552 +    png_zfree(png_ptr, info_ptr->palette);
  74.553 +    info_ptr->palette = NULL;
  74.554 +    info_ptr->valid &= ~PNG_INFO_PLTE;
  74.555 +#ifndef PNG_FREE_ME_SUPPORTED
  74.556 +    png_ptr->flags &= ~PNG_FLAG_FREE_PLTE;
  74.557 +#endif
  74.558 +    info_ptr->num_palette = 0;
  74.559 +}
  74.560 +
  74.561 +#if defined(PNG_INFO_IMAGE_SUPPORTED)
  74.562 +/* free any image bits attached to the info structure */
  74.563 +#ifdef PNG_FREE_ME_SUPPORTED
  74.564 +if ((mask & PNG_FREE_ROWS) & info_ptr->free_me)
  74.565 +#else
  74.566 +if (mask & PNG_FREE_ROWS)
  74.567 +#endif
  74.568 +{
  74.569 +    if (info_ptr->row_pointers)
  74.570 +    {
  74.571 +       int row;
  74.572 +       for (row = 0; row < (int)info_ptr->height; row++)
  74.573 +       {
  74.574 +          png_free(png_ptr, info_ptr->row_pointers[row]);
  74.575 +          info_ptr->row_pointers[row]=NULL;
  74.576 +       }
  74.577 +       png_free(png_ptr, info_ptr->row_pointers);
  74.578 +       info_ptr->row_pointers=NULL;
  74.579 +    }
  74.580 +    info_ptr->valid &= ~PNG_INFO_IDAT;
  74.581 +}
  74.582 +#endif
  74.583 +
  74.584 +#ifdef PNG_FREE_ME_SUPPORTED
  74.585 +   if (num == -1)
  74.586 +     info_ptr->free_me &= ~mask;
  74.587 +   else
  74.588 +     info_ptr->free_me &= ~(mask & ~PNG_FREE_MUL);
  74.589 +#endif
  74.590 +}
  74.591 +
  74.592 +/* This is an internal routine to free any memory that the info struct is
  74.593 + * pointing to before re-using it or freeing the struct itself.  Recall
  74.594 + * that png_free() checks for NULL pointers for us.
  74.595 + */
  74.596 +void /* PRIVATE */
  74.597 +png_info_destroy(png_structp png_ptr, png_infop info_ptr)
  74.598 +{
  74.599 +   png_debug(1, "in png_info_destroy\n");
  74.600 +
  74.601 +   png_free_data(png_ptr, info_ptr, PNG_FREE_ALL, -1);
  74.602 +
  74.603 +#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
  74.604 +   if (png_ptr->num_chunk_list)
  74.605 +   {
  74.606 +       png_free(png_ptr, png_ptr->chunk_list);
  74.607 +       png_ptr->chunk_list=NULL;
  74.608 +       png_ptr->num_chunk_list = 0;
  74.609 +   }
  74.610 +#endif
  74.611 +
  74.612 +   png_info_init_3(&info_ptr, png_sizeof(png_info));
  74.613 +}
  74.614 +#endif /* defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) */
  74.615 +
  74.616 +/* This function returns a pointer to the io_ptr associated with the user
  74.617 + * functions.  The application should free any memory associated with this
  74.618 + * pointer before png_write_destroy() or png_read_destroy() are called.
  74.619 + */
  74.620 +png_voidp PNGAPI
  74.621 +png_get_io_ptr(png_structp png_ptr)
  74.622 +{
  74.623 +   if (png_ptr == NULL) return (NULL);
  74.624 +   return (png_ptr->io_ptr);
  74.625 +}
  74.626 +
  74.627 +#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
  74.628 +#if !defined(PNG_NO_STDIO)
  74.629 +/* Initialize the default input/output functions for the PNG file.  If you
  74.630 + * use your own read or write routines, you can call either png_set_read_fn()
  74.631 + * or png_set_write_fn() instead of png_init_io().  If you have defined
  74.632 + * PNG_NO_STDIO, you must use a function of your own because "FILE *" isn't
  74.633 + * necessarily available.
  74.634 + */
  74.635 +void PNGAPI
  74.636 +png_init_io(png_structp png_ptr, png_FILE_p fp)
  74.637 +{
  74.638 +   png_debug(1, "in png_init_io\n");
  74.639 +   if (png_ptr == NULL) return;
  74.640 +   png_ptr->io_ptr = (png_voidp)fp;
  74.641 +}
  74.642 +#endif
  74.643 +
  74.644 +#if defined(PNG_TIME_RFC1123_SUPPORTED)
  74.645 +/* Convert the supplied time into an RFC 1123 string suitable for use in
  74.646 + * a "Creation Time" or other text-based time string.
  74.647 + */
  74.648 +png_charp PNGAPI
  74.649 +png_convert_to_rfc1123(png_structp png_ptr, png_timep ptime)
  74.650 +{
  74.651 +   static PNG_CONST char short_months[12][4] =
  74.652 +        {"Jan", "Feb", "Mar", "Apr", "May", "Jun",
  74.653 +         "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
  74.654 +
  74.655 +   if (png_ptr == NULL) return (NULL);
  74.656 +   if (png_ptr->time_buffer == NULL)
  74.657 +   {
  74.658 +      png_ptr->time_buffer = (png_charp)png_malloc(png_ptr, (png_uint_32)(29*
  74.659 +         png_sizeof(char)));
  74.660 +   }
  74.661 +
  74.662 +#if defined(_WIN32_WCE)
  74.663 +   {
  74.664 +      wchar_t time_buf[29];
  74.665 +      wsprintf(time_buf, TEXT("%d %S %d %02d:%02d:%02d +0000"),
  74.666 +          ptime->day % 32, short_months[(ptime->month - 1) % 12],
  74.667 +        ptime->year, ptime->hour % 24, ptime->minute % 60,
  74.668 +          ptime->second % 61);
  74.669 +      WideCharToMultiByte(CP_ACP, 0, time_buf, -1, png_ptr->time_buffer, 29,
  74.670 +          NULL, NULL);
  74.671 +   }
  74.672 +#else
  74.673 +#ifdef USE_FAR_KEYWORD
  74.674 +   {
  74.675 +      char near_time_buf[29];
  74.676 +      png_snprintf6(near_time_buf, 29, "%d %s %d %02d:%02d:%02d +0000",
  74.677 +          ptime->day % 32, short_months[(ptime->month - 1) % 12],
  74.678 +          ptime->year, ptime->hour % 24, ptime->minute % 60,
  74.679 +          ptime->second % 61);
  74.680 +      png_memcpy(png_ptr->time_buffer, near_time_buf,
  74.681 +          29*png_sizeof(char));
  74.682 +   }
  74.683 +#else
  74.684 +   png_snprintf6(png_ptr->time_buffer, 29, "%d %s %d %02d:%02d:%02d +0000",
  74.685 +       ptime->day % 32, short_months[(ptime->month - 1) % 12],
  74.686 +       ptime->year, ptime->hour % 24, ptime->minute % 60,
  74.687 +       ptime->second % 61);
  74.688 +#endif
  74.689 +#endif /* _WIN32_WCE */
  74.690 +   return ((png_charp)png_ptr->time_buffer);
  74.691 +}
  74.692 +#endif /* PNG_TIME_RFC1123_SUPPORTED */
  74.693 +
  74.694 +#endif /* defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) */
  74.695 +
  74.696 +png_charp PNGAPI
  74.697 +png_get_copyright(png_structp png_ptr)
  74.698 +{
  74.699 +   png_ptr = png_ptr;  /* silence compiler warning about unused png_ptr */
  74.700 +   return ((png_charp) "\n libpng version 1.2.33 - October 31, 2008\n\
  74.701 +   Copyright (c) 1998-2008 Glenn Randers-Pehrson\n\
  74.702 +   Copyright (c) 1996-1997 Andreas Dilger\n\
  74.703 +   Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.\n");
  74.704 +}
  74.705 +
  74.706 +/* The following return the library version as a short string in the
  74.707 + * format 1.0.0 through 99.99.99zz.  To get the version of *.h files
  74.708 + * used with your application, print out PNG_LIBPNG_VER_STRING, which
  74.709 + * is defined in png.h.
  74.710 + * Note: now there is no difference between png_get_libpng_ver() and
  74.711 + * png_get_header_ver().  Due to the version_nn_nn_nn typedef guard,
  74.712 + * it is guaranteed that png.c uses the correct version of png.h.
  74.713 + */
  74.714 +png_charp PNGAPI
  74.715 +png_get_libpng_ver(png_structp png_ptr)
  74.716 +{
  74.717 +   /* Version of *.c files used when building libpng */
  74.718 +   png_ptr = png_ptr;  /* silence compiler warning about unused png_ptr */
  74.719 +   return ((png_charp) PNG_LIBPNG_VER_STRING);
  74.720 +}
  74.721 +
  74.722 +png_charp PNGAPI
  74.723 +png_get_header_ver(png_structp png_ptr)
  74.724 +{
  74.725 +   /* Version of *.h files used when building libpng */
  74.726 +   png_ptr = png_ptr;  /* silence compiler warning about unused png_ptr */
  74.727 +   return ((png_charp) PNG_LIBPNG_VER_STRING);
  74.728 +}
  74.729 +
  74.730 +png_charp PNGAPI
  74.731 +png_get_header_version(png_structp png_ptr)
  74.732 +{
  74.733 +   /* Returns longer string containing both version and date */
  74.734 +   png_ptr = png_ptr;  /* silence compiler warning about unused png_ptr */
  74.735 +   return ((png_charp) PNG_HEADER_VERSION_STRING
  74.736 +#ifndef PNG_READ_SUPPORTED
  74.737 +   "     (NO READ SUPPORT)"
  74.738 +#endif
  74.739 +   "\n");
  74.740 +}
  74.741 +
  74.742 +#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
  74.743 +#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
  74.744 +int PNGAPI
  74.745 +png_handle_as_unknown(png_structp png_ptr, png_bytep chunk_name)
  74.746 +{
  74.747 +   /* check chunk_name and return "keep" value if it's on the list, else 0 */
  74.748 +   int i;
  74.749 +   png_bytep p;
  74.750 +   if (png_ptr == NULL || chunk_name == NULL || png_ptr->num_chunk_list<=0)
  74.751 +      return 0;
  74.752 +   p = png_ptr->chunk_list + png_ptr->num_chunk_list*5 - 5;
  74.753 +   for (i = png_ptr->num_chunk_list; i; i--, p -= 5)
  74.754 +      if (!png_memcmp(chunk_name, p, 4))
  74.755 +        return ((int)*(p + 4));
  74.756 +   return 0;
  74.757 +}
  74.758 +#endif
  74.759 +
  74.760 +/* This function, added to libpng-1.0.6g, is untested. */
  74.761 +int PNGAPI
  74.762 +png_reset_zstream(png_structp png_ptr)
  74.763 +{
  74.764 +   if (png_ptr == NULL) return Z_STREAM_ERROR;
  74.765 +   return (inflateReset(&png_ptr->zstream));
  74.766 +}
  74.767 +#endif /* defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) */
  74.768 +
  74.769 +/* This function was added to libpng-1.0.7 */
  74.770 +png_uint_32 PNGAPI
  74.771 +png_access_version_number(void)
  74.772 +{
  74.773 +   /* Version of *.c files used when building libpng */
  74.774 +   return((png_uint_32) PNG_LIBPNG_VER);
  74.775 +}
  74.776 +
  74.777 +
  74.778 +#if defined(PNG_READ_SUPPORTED) && defined(PNG_ASSEMBLER_CODE_SUPPORTED)
  74.779 +#if !defined(PNG_1_0_X)
  74.780 +/* this function was added to libpng 1.2.0 */
  74.781 +int PNGAPI
  74.782 +png_mmx_support(void)
  74.783 +{
  74.784 +   /* obsolete, to be removed from libpng-1.4.0 */
  74.785 +    return -1;
  74.786 +}
  74.787 +#endif /* PNG_1_0_X */
  74.788 +#endif /* PNG_READ_SUPPORTED && PNG_ASSEMBLER_CODE_SUPPORTED */
  74.789 +
  74.790 +#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
  74.791 +#ifdef PNG_SIZE_T
  74.792 +/* Added at libpng version 1.2.6 */
  74.793 +   PNG_EXTERN png_size_t PNGAPI png_convert_size PNGARG((size_t size));
  74.794 +png_size_t PNGAPI
  74.795 +png_convert_size(size_t size)
  74.796 +{
  74.797 +  if (size > (png_size_t)-1)
  74.798 +     PNG_ABORT();  /* We haven't got access to png_ptr, so no png_error() */
  74.799 +  return ((png_size_t)size);
  74.800 +}
  74.801 +#endif /* PNG_SIZE_T */
  74.802 +#endif /* defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) */
    75.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    75.2 +++ b/libs/libpng/png.h	Sun Nov 01 00:36:56 2015 +0200
    75.3 @@ -0,0 +1,3597 @@
    75.4 +/* png.h - header file for PNG reference library
    75.5 + *
    75.6 + * libpng version 1.2.33 - October 31, 2008
    75.7 + * Copyright (c) 1998-2008 Glenn Randers-Pehrson
    75.8 + * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
    75.9 + * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
   75.10 + *
   75.11 + * Authors and maintainers:
   75.12 + *  libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
   75.13 + *  libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
   75.14 + *  libpng versions 0.97, January 1998, through 1.2.33 - October 31, 2008: Glenn
   75.15 + *  See also "Contributing Authors", below.
   75.16 + *
   75.17 + * Note about libpng version numbers:
   75.18 + *
   75.19 + *    Due to various miscommunications, unforeseen code incompatibilities
   75.20 + *    and occasional factors outside the authors' control, version numbering
   75.21 + *    on the library has not always been consistent and straightforward.
   75.22 + *    The following table summarizes matters since version 0.89c, which was
   75.23 + *    the first widely used release:
   75.24 + *
   75.25 + *    source                 png.h  png.h  shared-lib
   75.26 + *    version                string   int  version
   75.27 + *    -------                ------ -----  ----------
   75.28 + *    0.89c "1.0 beta 3"     0.89      89  1.0.89
   75.29 + *    0.90  "1.0 beta 4"     0.90      90  0.90  [should have been 2.0.90]
   75.30 + *    0.95  "1.0 beta 5"     0.95      95  0.95  [should have been 2.0.95]
   75.31 + *    0.96  "1.0 beta 6"     0.96      96  0.96  [should have been 2.0.96]
   75.32 + *    0.97b "1.00.97 beta 7" 1.00.97   97  1.0.1 [should have been 2.0.97]
   75.33 + *    0.97c                  0.97      97  2.0.97
   75.34 + *    0.98                   0.98      98  2.0.98
   75.35 + *    0.99                   0.99      98  2.0.99
   75.36 + *    0.99a-m                0.99      99  2.0.99
   75.37 + *    1.00                   1.00     100  2.1.0 [100 should be 10000]
   75.38 + *    1.0.0      (from here on, the   100  2.1.0 [100 should be 10000]
   75.39 + *    1.0.1       png.h string is   10001  2.1.0
   75.40 + *    1.0.1a-e    identical to the  10002  from here on, the shared library
   75.41 + *    1.0.2       source version)   10002  is 2.V where V is the source code
   75.42 + *    1.0.2a-b                      10003  version, except as noted.
   75.43 + *    1.0.3                         10003
   75.44 + *    1.0.3a-d                      10004
   75.45 + *    1.0.4                         10004
   75.46 + *    1.0.4a-f                      10005
   75.47 + *    1.0.5 (+ 2 patches)           10005
   75.48 + *    1.0.5a-d                      10006
   75.49 + *    1.0.5e-r                      10100 (not source compatible)
   75.50 + *    1.0.5s-v                      10006 (not binary compatible)
   75.51 + *    1.0.6 (+ 3 patches)           10006 (still binary incompatible)
   75.52 + *    1.0.6d-f                      10007 (still binary incompatible)
   75.53 + *    1.0.6g                        10007
   75.54 + *    1.0.6h                        10007  10.6h (testing xy.z so-numbering)
   75.55 + *    1.0.6i                        10007  10.6i
   75.56 + *    1.0.6j                        10007  2.1.0.6j (incompatible with 1.0.0)
   75.57 + *    1.0.7beta11-14        DLLNUM  10007  2.1.0.7beta11-14 (binary compatible)
   75.58 + *    1.0.7beta15-18           1    10007  2.1.0.7beta15-18 (binary compatible)
   75.59 + *    1.0.7rc1-2               1    10007  2.1.0.7rc1-2 (binary compatible)
   75.60 + *    1.0.7                    1    10007  (still compatible)
   75.61 + *    1.0.8beta1-4             1    10008  2.1.0.8beta1-4
   75.62 + *    1.0.8rc1                 1    10008  2.1.0.8rc1
   75.63 + *    1.0.8                    1    10008  2.1.0.8
   75.64 + *    1.0.9beta1-6             1    10009  2.1.0.9beta1-6
   75.65 + *    1.0.9rc1                 1    10009  2.1.0.9rc1
   75.66 + *    1.0.9beta7-10            1    10009  2.1.0.9beta7-10
   75.67 + *    1.0.9rc2                 1    10009  2.1.0.9rc2
   75.68 + *    1.0.9                    1    10009  2.1.0.9
   75.69 + *    1.0.10beta1              1    10010  2.1.0.10beta1
   75.70 + *    1.0.10rc1                1    10010  2.1.0.10rc1
   75.71 + *    1.0.10                   1    10010  2.1.0.10
   75.72 + *    1.0.11beta1-3            1    10011  2.1.0.11beta1-3
   75.73 + *    1.0.11rc1                1    10011  2.1.0.11rc1
   75.74 + *    1.0.11                   1    10011  2.1.0.11
   75.75 + *    1.0.12beta1-2            2    10012  2.1.0.12beta1-2
   75.76 + *    1.0.12rc1                2    10012  2.1.0.12rc1
   75.77 + *    1.0.12                   2    10012  2.1.0.12
   75.78 + *    1.1.0a-f                 -    10100  2.1.1.0a-f (branch abandoned)
   75.79 + *    1.2.0beta1-2             2    10200  2.1.2.0beta1-2
   75.80 + *    1.2.0beta3-5             3    10200  3.1.2.0beta3-5
   75.81 + *    1.2.0rc1                 3    10200  3.1.2.0rc1
   75.82 + *    1.2.0                    3    10200  3.1.2.0
   75.83 + *    1.2.1beta1-4             3    10201  3.1.2.1beta1-4
   75.84 + *    1.2.1rc1-2               3    10201  3.1.2.1rc1-2
   75.85 + *    1.2.1                    3    10201  3.1.2.1
   75.86 + *    1.2.2beta1-6            12    10202  12.so.0.1.2.2beta1-6
   75.87 + *    1.0.13beta1             10    10013  10.so.0.1.0.13beta1
   75.88 + *    1.0.13rc1               10    10013  10.so.0.1.0.13rc1
   75.89 + *    1.2.2rc1                12    10202  12.so.0.1.2.2rc1
   75.90 + *    1.0.13                  10    10013  10.so.0.1.0.13
   75.91 + *    1.2.2                   12    10202  12.so.0.1.2.2
   75.92 + *    1.2.3rc1-6              12    10203  12.so.0.1.2.3rc1-6
   75.93 + *    1.2.3                   12    10203  12.so.0.1.2.3
   75.94 + *    1.2.4beta1-3            13    10204  12.so.0.1.2.4beta1-3
   75.95 + *    1.0.14rc1               13    10014  10.so.0.1.0.14rc1
   75.96 + *    1.2.4rc1                13    10204  12.so.0.1.2.4rc1
   75.97 + *    1.0.14                  10    10014  10.so.0.1.0.14
   75.98 + *    1.2.4                   13    10204  12.so.0.1.2.4
   75.99 + *    1.2.5beta1-2            13    10205  12.so.0.1.2.5beta1-2
  75.100 + *    1.0.15rc1-3             10    10015  10.so.0.1.0.15rc1-3
  75.101 + *    1.2.5rc1-3              13    10205  12.so.0.1.2.5rc1-3
  75.102 + *    1.0.15                  10    10015  10.so.0.1.0.15
  75.103 + *    1.2.5                   13    10205  12.so.0.1.2.5
  75.104 + *    1.2.6beta1-4            13    10206  12.so.0.1.2.6beta1-4
  75.105 + *    1.0.16                  10    10016  10.so.0.1.0.16
  75.106 + *    1.2.6                   13    10206  12.so.0.1.2.6
  75.107 + *    1.2.7beta1-2            13    10207  12.so.0.1.2.7beta1-2
  75.108 + *    1.0.17rc1               10    10017  10.so.0.1.0.17rc1
  75.109 + *    1.2.7rc1                13    10207  12.so.0.1.2.7rc1
  75.110 + *    1.0.17                  10    10017  10.so.0.1.0.17
  75.111 + *    1.2.7                   13    10207  12.so.0.1.2.7
  75.112 + *    1.2.8beta1-5            13    10208  12.so.0.1.2.8beta1-5
  75.113 + *    1.0.18rc1-5             10    10018  10.so.0.1.0.18rc1-5
  75.114 + *    1.2.8rc1-5              13    10208  12.so.0.1.2.8rc1-5
  75.115 + *    1.0.18                  10    10018  10.so.0.1.0.18
  75.116 + *    1.2.8                   13    10208  12.so.0.1.2.8
  75.117 + *    1.2.9beta1-3            13    10209  12.so.0.1.2.9beta1-3
  75.118 + *    1.2.9beta4-11           13    10209  12.so.0.9[.0]
  75.119 + *    1.2.9rc1                13    10209  12.so.0.9[.0]
  75.120 + *    1.2.9                   13    10209  12.so.0.9[.0]
  75.121 + *    1.2.10beta1-8           13    10210  12.so.0.10[.0]
  75.122 + *    1.2.10rc1-3             13    10210  12.so.0.10[.0]
  75.123 + *    1.2.10                  13    10210  12.so.0.10[.0]
  75.124 + *    1.2.11beta1-4           13    10211  12.so.0.11[.0]
  75.125 + *    1.0.19rc1-5             10    10019  10.so.0.19[.0]
  75.126 + *    1.2.11rc1-5             13    10211  12.so.0.11[.0]
  75.127 + *    1.0.19                  10    10019  10.so.0.19[.0]
  75.128 + *    1.2.11                  13    10211  12.so.0.11[.0]
  75.129 + *    1.0.20                  10    10020  10.so.0.20[.0]
  75.130 + *    1.2.12                  13    10212  12.so.0.12[.0]
  75.131 + *    1.2.13beta1             13    10213  12.so.0.13[.0]
  75.132 + *    1.0.21                  10    10021  10.so.0.21[.0]
  75.133 + *    1.2.13                  13    10213  12.so.0.13[.0]
  75.134 + *    1.2.14beta1-2           13    10214  12.so.0.14[.0]
  75.135 + *    1.0.22rc1               10    10022  10.so.0.22[.0]
  75.136 + *    1.2.14rc1               13    10214  12.so.0.14[.0]
  75.137 + *    1.0.22                  10    10022  10.so.0.22[.0]
  75.138 + *    1.2.14                  13    10214  12.so.0.14[.0]
  75.139 + *    1.2.15beta1-6           13    10215  12.so.0.15[.0]
  75.140 + *    1.0.23rc1-5             10    10023  10.so.0.23[.0]
  75.141 + *    1.2.15rc1-5             13    10215  12.so.0.15[.0]
  75.142 + *    1.0.23                  10    10023  10.so.0.23[.0]
  75.143 + *    1.2.15                  13    10215  12.so.0.15[.0]
  75.144 + *    1.2.16beta1-2           13    10216  12.so.0.16[.0]
  75.145 + *    1.2.16rc1               13    10216  12.so.0.16[.0]
  75.146 + *    1.0.24                  10    10024  10.so.0.24[.0]
  75.147 + *    1.2.16                  13    10216  12.so.0.16[.0]
  75.148 + *    1.2.17beta1-2           13    10217  12.so.0.17[.0]
  75.149 + *    1.0.25rc1               10    10025  10.so.0.25[.0]
  75.150 + *    1.2.17rc1-3             13    10217  12.so.0.17[.0]
  75.151 + *    1.0.25                  10    10025  10.so.0.25[.0]
  75.152 + *    1.2.17                  13    10217  12.so.0.17[.0]
  75.153 + *    1.0.26                  10    10026  10.so.0.26[.0]
  75.154 + *    1.2.18                  13    10218  12.so.0.18[.0]
  75.155 + *    1.2.19beta1-31          13    10219  12.so.0.19[.0]
  75.156 + *    1.0.27rc1-6             10    10027  10.so.0.27[.0]
  75.157 + *    1.2.19rc1-6             13    10219  12.so.0.19[.0]
  75.158 + *    1.0.27                  10    10027  10.so.0.27[.0]
  75.159 + *    1.2.19                  13    10219  12.so.0.19[.0]
  75.160 + *    1.2.20beta01-04         13    10220  12.so.0.20[.0]
  75.161 + *    1.0.28rc1-6             10    10028  10.so.0.28[.0]
  75.162 + *    1.2.20rc1-6             13    10220  12.so.0.20[.0]
  75.163 + *    1.0.28                  10    10028  10.so.0.28[.0]
  75.164 + *    1.2.20                  13    10220  12.so.0.20[.0]
  75.165 + *    1.2.21beta1-2           13    10221  12.so.0.21[.0]
  75.166 + *    1.2.21rc1-3             13    10221  12.so.0.21[.0]
  75.167 + *    1.0.29                  10    10029  10.so.0.29[.0]
  75.168 + *    1.2.21                  13    10221  12.so.0.21[.0]
  75.169 + *    1.2.22beta1-4           13    10222  12.so.0.22[.0]
  75.170 + *    1.0.30rc1               10    10030  10.so.0.30[.0]
  75.171 + *    1.2.22rc1               13    10222  12.so.0.22[.0]
  75.172 + *    1.0.30                  10    10030  10.so.0.30[.0]
  75.173 + *    1.2.22                  13    10222  12.so.0.22[.0]
  75.174 + *    1.2.23beta01-05         13    10223  12.so.0.23[.0]
  75.175 + *    1.2.23rc01              13    10223  12.so.0.23[.0]
  75.176 + *    1.2.23                  13    10223  12.so.0.23[.0]
  75.177 + *    1.2.24beta01-02         13    10224  12.so.0.24[.0]
  75.178 + *    1.2.24rc01              13    10224  12.so.0.24[.0]
  75.179 + *    1.2.24                  13    10224  12.so.0.24[.0]
  75.180 + *    1.2.25beta01-06         13    10225  12.so.0.25[.0]
  75.181 + *    1.2.25rc01-02           13    10225  12.so.0.25[.0]
  75.182 + *    1.0.31                  10    10031  10.so.0.31[.0]
  75.183 + *    1.2.25                  13    10225  12.so.0.25[.0]
  75.184 + *    1.2.26beta01-06         13    10226  12.so.0.26[.0]
  75.185 + *    1.2.26rc01              13    10226  12.so.0.26[.0]
  75.186 + *    1.2.26                  13    10226  12.so.0.26[.0]
  75.187 + *    1.0.32                  10    10032  10.so.0.32[.0]
  75.188 + *    1.2.27beta01-06         13    10227  12.so.0.27[.0]
  75.189 + *    1.2.27rc01              13    10227  12.so.0.27[.0]
  75.190 + *    1.0.33                  10    10033  10.so.0.33[.0]
  75.191 + *    1.2.27                  13    10227  12.so.0.27[.0]
  75.192 + *    1.0.34                  10    10034  10.so.0.34[.0]
  75.193 + *    1.2.28                  13    10228  12.so.0.28[.0]
  75.194 + *    1.2.29beta01-03         13    10229  12.so.0.29[.0]
  75.195 + *    1.2.29rc01              13    10229  12.so.0.29[.0]
  75.196 + *    1.0.35                  10    10035  10.so.0.35[.0]
  75.197 + *    1.2.29                  13    10229  12.so.0.29[.0]
  75.198 + *    1.0.37                  10    10037  10.so.0.37[.0]
  75.199 + *    1.2.30beta01-04         13    10230  12.so.0.30[.0]
  75.200 + *    1.0.38rc01-08           10    10038  10.so.0.38[.0]
  75.201 + *    1.2.30rc01-08           13    10230  12.so.0.30[.0]
  75.202 + *    1.0.38                  10    10038  10.so.0.38[.0]
  75.203 + *    1.2.30                  13    10230  12.so.0.30[.0]
  75.204 + *    1.0.39rc01-03           10    10039  10.so.0.39[.0]
  75.205 + *    1.2.31rc01-03           13    10231  12.so.0.31[.0]
  75.206 + *    1.0.39                  10    10039  10.so.0.39[.0]
  75.207 + *    1.2.31                  13    10231  12.so.0.31[.0]
  75.208 + *    1.2.32beta01-02         13    10232  12.so.0.32[.0]
  75.209 + *    1.0.40rc01              10    10040  10.so.0.40[.0]
  75.210 + *    1.2.32rc01              13    10232  12.so.0.32[.0]
  75.211 + *    1.0.40                  10    10040  10.so.0.40[.0]
  75.212 + *    1.2.32                  13    10232  12.so.0.32[.0]
  75.213 + *    1.2.33beta01-02         13    10233  12.so.0.33[.0]
  75.214 + *    1.2.33rc01-02           13    10233  12.so.0.33[.0]
  75.215 + *    1.0.41rc01              10    10041  10.so.0.41[.0]
  75.216 + *    1.2.33                  13    10233  12.so.0.33[.0]
  75.217 + *    1.0.41                  10    10041  10.so.0.41[.0]
  75.218 + *
  75.219 + *    Henceforth the source version will match the shared-library major
  75.220 + *    and minor numbers; the shared-library major version number will be
  75.221 + *    used for changes in backward compatibility, as it is intended.  The
  75.222 + *    PNG_LIBPNG_VER macro, which is not used within libpng but is available
  75.223 + *    for applications, is an unsigned integer of the form xyyzz corresponding
  75.224 + *    to the source version x.y.z (leading zeros in y and z).  Beta versions
  75.225 + *    were given the previous public release number plus a letter, until
  75.226 + *    version 1.0.6j; from then on they were given the upcoming public
  75.227 + *    release number plus "betaNN" or "rcNN".
  75.228 + *
  75.229 + *    Binary incompatibility exists only when applications make direct access
  75.230 + *    to the info_ptr or png_ptr members through png.h, and the compiled
  75.231 + *    application is loaded with a different version of the library.
  75.232 + *
  75.233 + *    DLLNUM will change each time there are forward or backward changes
  75.234 + *    in binary compatibility (e.g., when a new feature is added).
  75.235 + *
  75.236 + * See libpng.txt or libpng.3 for more information.  The PNG specification
  75.237 + * is available as a W3C Recommendation and as an ISO Specification,
  75.238 + * <http://www.w3.org/TR/2003/REC-PNG-20031110/
  75.239 + */
  75.240 +
  75.241 +/*
  75.242 + * COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
  75.243 + *
  75.244 + * If you modify libpng you may insert additional notices immediately following
  75.245 + * this sentence.
  75.246 + *
  75.247 + * libpng versions 1.2.6, August 15, 2004, through 1.2.33, October 31, 2008, are
  75.248 + * Copyright (c) 2004, 2006-2008 Glenn Randers-Pehrson, and are
  75.249 + * distributed according to the same disclaimer and license as libpng-1.2.5
  75.250 + * with the following individual added to the list of Contributing Authors:
  75.251 + *
  75.252 + *    Cosmin Truta
  75.253 + *
  75.254 + * libpng versions 1.0.7, July 1, 2000, through 1.2.5, October 3, 2002, are
  75.255 + * Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are
  75.256 + * distributed according to the same disclaimer and license as libpng-1.0.6
  75.257 + * with the following individuals added to the list of Contributing Authors:
  75.258 + *
  75.259 + *    Simon-Pierre Cadieux
  75.260 + *    Eric S. Raymond
  75.261 + *    Gilles Vollant
  75.262 + *
  75.263 + * and with the following additions to the disclaimer:
  75.264 + *
  75.265 + *    There is no warranty against interference with your enjoyment of the
  75.266 + *    library or against infringement.  There is no warranty that our
  75.267 + *    efforts or the library will fulfill any of your particular purposes
  75.268 + *    or needs.  This library is provided with all faults, and the entire
  75.269 + *    risk of satisfactory quality, performance, accuracy, and effort is with
  75.270 + *    the user.
  75.271 + *
  75.272 + * libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
  75.273 + * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson, and are
  75.274 + * distributed according to the same disclaimer and license as libpng-0.96,
  75.275 + * with the following individuals added to the list of Contributing Authors:
  75.276 + *
  75.277 + *    Tom Lane
  75.278 + *    Glenn Randers-Pehrson
  75.279 + *    Willem van Schaik
  75.280 + *
  75.281 + * libpng versions 0.89, June 1996, through 0.96, May 1997, are
  75.282 + * Copyright (c) 1996, 1997 Andreas Dilger
  75.283 + * Distributed according to the same disclaimer and license as libpng-0.88,
  75.284 + * with the following individuals added to the list of Contributing Authors:
  75.285 + *
  75.286 + *    John Bowler
  75.287 + *    Kevin Bracey
  75.288 + *    Sam Bushell
  75.289 + *    Magnus Holmgren
  75.290 + *    Greg Roelofs
  75.291 + *    Tom Tanner
  75.292 + *
  75.293 + * libpng versions 0.5, May 1995, through 0.88, January 1996, are
  75.294 + * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
  75.295 + *
  75.296 + * For the purposes of this copyright and license, "Contributing Authors"
  75.297 + * is defined as the following set of individuals:
  75.298 + *
  75.299 + *    Andreas Dilger
  75.300 + *    Dave Martindale
  75.301 + *    Guy Eric Schalnat
  75.302 + *    Paul Schmidt
  75.303 + *    Tim Wegner
  75.304 + *
  75.305 + * The PNG Reference Library is supplied "AS IS".  The Contributing Authors
  75.306 + * and Group 42, Inc. disclaim all warranties, expressed or implied,
  75.307 + * including, without limitation, the warranties of merchantability and of
  75.308 + * fitness for any purpose.  The Contributing Authors and Group 42, Inc.
  75.309 + * assume no liability for direct, indirect, incidental, special, exemplary,
  75.310 + * or consequential damages, which may result from the use of the PNG
  75.311 + * Reference Library, even if advised of the possibility of such damage.
  75.312 + *
  75.313 + * Permission is hereby granted to use, copy, modify, and distribute this
  75.314 + * source code, or portions hereof, for any purpose, without fee, subject
  75.315 + * to the following restrictions:
  75.316 + *
  75.317 + * 1. The origin of this source code must not be misrepresented.
  75.318 + *
  75.319 + * 2. Altered versions must be plainly marked as such and
  75.320 + * must not be misrepresented as being the original source.
  75.321 + *
  75.322 + * 3. This Copyright notice may not be removed or altered from
  75.323 + *    any source or altered source distribution.
  75.324 + *
  75.325 + * The Contributing Authors and Group 42, Inc. specifically permit, without
  75.326 + * fee, and encourage the use of this source code as a component to
  75.327 + * supporting the PNG file format in commercial products.  If you use this
  75.328 + * source code in a product, acknowledgment is not required but would be
  75.329 + * appreciated.
  75.330 + */
  75.331 +
  75.332 +/*
  75.333 + * A "png_get_copyright" function is available, for convenient use in "about"
  75.334 + * boxes and the like:
  75.335 + *
  75.336 + * printf("%s",png_get_copyright(NULL));
  75.337 + *
  75.338 + * Also, the PNG logo (in PNG format, of course) is supplied in the
  75.339 + * files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31).
  75.340 + */
  75.341 +
  75.342 +/*
  75.343 + * Libpng is OSI Certified Open Source Software.  OSI Certified is a
  75.344 + * certification mark of the Open Source Initiative.
  75.345 + */
  75.346 +
  75.347 +/*
  75.348 + * The contributing authors would like to thank all those who helped
  75.349 + * with testing, bug fixes, and patience.  This wouldn't have been
  75.350 + * possible without all of you.
  75.351 + *
  75.352 + * Thanks to Frank J. T. Wojcik for helping with the documentation.
  75.353 + */
  75.354 +
  75.355 +/*
  75.356 + * Y2K compliance in libpng:
  75.357 + * =========================
  75.358 + *
  75.359 + *    October 31, 2008
  75.360 + *
  75.361 + *    Since the PNG Development group is an ad-hoc body, we can't make
  75.362 + *    an official declaration.
  75.363 + *
  75.364 + *    This is your unofficial assurance that libpng from version 0.71 and
  75.365 + *    upward through 1.2.33 are Y2K compliant.  It is my belief that earlier
  75.366 + *    versions were also Y2K compliant.
  75.367 + *
  75.368 + *    Libpng only has three year fields.  One is a 2-byte unsigned integer
  75.369 + *    that will hold years up to 65535.  The other two hold the date in text
  75.370 + *    format, and will hold years up to 9999.
  75.371 + *
  75.372 + *    The integer is
  75.373 + *        "png_uint_16 year" in png_time_struct.
  75.374 + *
  75.375 + *    The strings are
  75.376 + *        "png_charp time_buffer" in png_struct and
  75.377 + *        "near_time_buffer", which is a local character string in png.c.
  75.378 + *
  75.379 + *    There are seven time-related functions:
  75.380 + *        png.c: png_convert_to_rfc_1123() in png.c
  75.381 + *          (formerly png_convert_to_rfc_1152() in error)
  75.382 + *        png_convert_from_struct_tm() in pngwrite.c, called in pngwrite.c
  75.383 + *        png_convert_from_time_t() in pngwrite.c
  75.384 + *        png_get_tIME() in pngget.c
  75.385 + *        png_handle_tIME() in pngrutil.c, called in pngread.c
  75.386 + *        png_set_tIME() in pngset.c
  75.387 + *        png_write_tIME() in pngwutil.c, called in pngwrite.c
  75.388 + *
  75.389 + *    All handle dates properly in a Y2K environment.  The
  75.390 + *    png_convert_from_time_t() function calls gmtime() to convert from system
  75.391 + *    clock time, which returns (year - 1900), which we properly convert to
  75.392 + *    the full 4-digit year.  There is a possibility that applications using
  75.393 + *    libpng are not passing 4-digit years into the png_convert_to_rfc_1123()
  75.394 + *    function, or that they are incorrectly passing only a 2-digit year
  75.395 + *    instead of "year - 1900" into the png_convert_from_struct_tm() function,
  75.396 + *    but this is not under our control.  The libpng documentation has always
  75.397 + *    stated that it works with 4-digit years, and the APIs have been
  75.398 + *    documented as such.
  75.399 + *
  75.400 + *    The tIME chunk itself is also Y2K compliant.  It uses a 2-byte unsigned
  75.401 + *    integer to hold the year, and can hold years as large as 65535.
  75.402 + *
  75.403 + *    zlib, upon which libpng depends, is also Y2K compliant.  It contains
  75.404 + *    no date-related code.
  75.405 + *
  75.406 + *       Glenn Randers-Pehrson
  75.407 + *       libpng maintainer
  75.408 + *       PNG Development Group
  75.409 + */
  75.410 +
  75.411 +#ifndef PNG_H
  75.412 +#define PNG_H
  75.413 +
  75.414 +/* This is not the place to learn how to use libpng.  The file libpng.txt
  75.415 + * describes how to use libpng, and the file example.c summarizes it
  75.416 + * with some code on which to build.  This file is useful for looking
  75.417 + * at the actual function definitions and structure components.
  75.418 + */
  75.419 +
  75.420 +/* Version information for png.h - this should match the version in png.c */
  75.421 +#define PNG_LIBPNG_VER_STRING "1.2.33"
  75.422 +#define PNG_HEADER_VERSION_STRING \
  75.423 +   " libpng version 1.2.33 - October 31, 2008\n"
  75.424 +
  75.425 +#define PNG_LIBPNG_VER_SONUM   0
  75.426 +#define PNG_LIBPNG_VER_DLLNUM  13
  75.427 +
  75.428 +/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
  75.429 +#define PNG_LIBPNG_VER_MAJOR   1
  75.430 +#define PNG_LIBPNG_VER_MINOR   2
  75.431 +#define PNG_LIBPNG_VER_RELEASE 33
  75.432 +/* This should match the numeric part of the final component of
  75.433 + * PNG_LIBPNG_VER_STRING, omitting any leading zero: */
  75.434 +
  75.435 +#define PNG_LIBPNG_VER_BUILD  0
  75.436 +
  75.437 +/* Release Status */
  75.438 +#define PNG_LIBPNG_BUILD_ALPHA    1
  75.439 +#define PNG_LIBPNG_BUILD_BETA     2
  75.440 +#define PNG_LIBPNG_BUILD_RC       3
  75.441 +#define PNG_LIBPNG_BUILD_STABLE   4
  75.442 +#define PNG_LIBPNG_BUILD_RELEASE_STATUS_MASK 7
  75.443 +  
  75.444 +/* Release-Specific Flags */
  75.445 +#define PNG_LIBPNG_BUILD_PATCH    8 /* Can be OR'ed with
  75.446 +                                       PNG_LIBPNG_BUILD_STABLE only */
  75.447 +#define PNG_LIBPNG_BUILD_PRIVATE 16 /* Cannot be OR'ed with
  75.448 +                                       PNG_LIBPNG_BUILD_SPECIAL */
  75.449 +#define PNG_LIBPNG_BUILD_SPECIAL 32 /* Cannot be OR'ed with
  75.450 +                                       PNG_LIBPNG_BUILD_PRIVATE */
  75.451 +
  75.452 +#define PNG_LIBPNG_BUILD_BASE_TYPE PNG_LIBPNG_BUILD_STABLE
  75.453 +
  75.454 +/* Careful here.  At one time, Guy wanted to use 082, but that would be octal.
  75.455 + * We must not include leading zeros.
  75.456 + * Versions 0.7 through 1.0.0 were in the range 0 to 100 here (only
  75.457 + * version 1.0.0 was mis-numbered 100 instead of 10000).  From
  75.458 + * version 1.0.1 it's    xxyyzz, where x=major, y=minor, z=release */
  75.459 +#define PNG_LIBPNG_VER 10233 /* 1.2.33 */
  75.460 +
  75.461 +#ifndef PNG_VERSION_INFO_ONLY
  75.462 +/* include the compression library's header */
  75.463 +#include "zlib.h"
  75.464 +#endif
  75.465 +
  75.466 +/* include all user configurable info, including optional assembler routines */
  75.467 +#include "pngconf.h"
  75.468 +
  75.469 +/*
  75.470 + * Added at libpng-1.2.8 */
  75.471 +/* Ref MSDN: Private as priority over Special
  75.472 + * VS_FF_PRIVATEBUILD File *was not* built using standard release
  75.473 + * procedures. If this value is given, the StringFileInfo block must
  75.474 + * contain a PrivateBuild string. 
  75.475 + *
  75.476 + * VS_FF_SPECIALBUILD File *was* built by the original company using
  75.477 + * standard release procedures but is a variation of the standard
  75.478 + * file of the same version number. If this value is given, the
  75.479 + * StringFileInfo block must contain a SpecialBuild string. 
  75.480 + */
  75.481 +
  75.482 +#if defined(PNG_USER_PRIVATEBUILD)
  75.483 +#  define PNG_LIBPNG_BUILD_TYPE \
  75.484 +          (PNG_LIBPNG_BUILD_BASE_TYPE | PNG_LIBPNG_BUILD_PRIVATE)
  75.485 +#else
  75.486 +#  if defined(PNG_LIBPNG_SPECIALBUILD)
  75.487 +#    define PNG_LIBPNG_BUILD_TYPE \
  75.488 +            (PNG_LIBPNG_BUILD_BASE_TYPE | PNG_LIBPNG_BUILD_SPECIAL)
  75.489 +#  else
  75.490 +#    define PNG_LIBPNG_BUILD_TYPE (PNG_LIBPNG_BUILD_BASE_TYPE)
  75.491 +#  endif
  75.492 +#endif
  75.493 +
  75.494 +#ifndef PNG_VERSION_INFO_ONLY
  75.495 +
  75.496 +/* Inhibit C++ name-mangling for libpng functions but not for system calls. */
  75.497 +#ifdef __cplusplus
  75.498 +extern "C" {
  75.499 +#endif /* __cplusplus */
  75.500 +
  75.501 +/* This file is arranged in several sections.  The first section contains
  75.502 + * structure and type definitions.  The second section contains the external
  75.503 + * library functions, while the third has the internal library functions,
  75.504 + * which applications aren't expected to use directly.
  75.505 + */
  75.506 +
  75.507 +#ifndef PNG_NO_TYPECAST_NULL
  75.508 +#define int_p_NULL                (int *)NULL
  75.509 +#define png_bytep_NULL            (png_bytep)NULL
  75.510 +#define png_bytepp_NULL           (png_bytepp)NULL
  75.511 +#define png_doublep_NULL          (png_doublep)NULL
  75.512 +#define png_error_ptr_NULL        (png_error_ptr)NULL
  75.513 +#define png_flush_ptr_NULL        (png_flush_ptr)NULL
  75.514 +#define png_free_ptr_NULL         (png_free_ptr)NULL
  75.515 +#define png_infopp_NULL           (png_infopp)NULL
  75.516 +#define png_malloc_ptr_NULL       (png_malloc_ptr)NULL
  75.517 +#define png_read_status_ptr_NULL  (png_read_status_ptr)NULL
  75.518 +#define png_rw_ptr_NULL           (png_rw_ptr)NULL
  75.519 +#define png_structp_NULL          (png_structp)NULL
  75.520 +#define png_uint_16p_NULL         (png_uint_16p)NULL
  75.521 +#define png_voidp_NULL            (png_voidp)NULL
  75.522 +#define png_write_status_ptr_NULL (png_write_status_ptr)NULL
  75.523 +#else
  75.524 +#define int_p_NULL                NULL
  75.525 +#define png_bytep_NULL            NULL
  75.526 +#define png_bytepp_NULL           NULL
  75.527 +#define png_doublep_NULL          NULL
  75.528 +#define png_error_ptr_NULL        NULL
  75.529 +#define png_flush_ptr_NULL        NULL
  75.530 +#define png_free_ptr_NULL         NULL
  75.531 +#define png_infopp_NULL           NULL
  75.532 +#define png_malloc_ptr_NULL       NULL
  75.533 +#define png_read_status_ptr_NULL  NULL
  75.534 +#define png_rw_ptr_NULL           NULL
  75.535 +#define png_structp_NULL          NULL
  75.536 +#define png_uint_16p_NULL         NULL
  75.537 +#define png_voidp_NULL            NULL
  75.538 +#define png_write_status_ptr_NULL NULL
  75.539 +#endif
  75.540 +
  75.541 +/* variables declared in png.c - only it needs to define PNG_NO_EXTERN */
  75.542 +#if !defined(PNG_NO_EXTERN) || defined(PNG_ALWAYS_EXTERN)
  75.543 +/* Version information for C files, stored in png.c.  This had better match
  75.544 + * the version above.
  75.545 + */
  75.546 +#ifdef PNG_USE_GLOBAL_ARRAYS
  75.547 +PNG_EXPORT_VAR (PNG_CONST char) png_libpng_ver[18];
  75.548 +  /* need room for 99.99.99beta99z */
  75.549 +#else
  75.550 +#define png_libpng_ver png_get_header_ver(NULL)
  75.551 +#endif
  75.552 +
  75.553 +#ifdef PNG_USE_GLOBAL_ARRAYS
  75.554 +/* This was removed in version 1.0.5c */
  75.555 +/* Structures to facilitate easy interlacing.  See png.c for more details */
  75.556 +PNG_EXPORT_VAR (PNG_CONST int FARDATA) png_pass_start[7];
  75.557 +PNG_EXPORT_VAR (PNG_CONST int FARDATA) png_pass_inc[7];
  75.558 +PNG_EXPORT_VAR (PNG_CONST int FARDATA) png_pass_ystart[7];
  75.559 +PNG_EXPORT_VAR (PNG_CONST int FARDATA) png_pass_yinc[7];
  75.560 +PNG_EXPORT_VAR (PNG_CONST int FARDATA) png_pass_mask[7];
  75.561 +PNG_EXPORT_VAR (PNG_CONST int FARDATA) png_pass_dsp_mask[7];
  75.562 +/* This isn't currently used.  If you need it, see png.c for more details.
  75.563 +PNG_EXPORT_VAR (PNG_CONST int FARDATA) png_pass_height[7];
  75.564 +*/
  75.565 +#endif
  75.566 +
  75.567 +#endif /* PNG_NO_EXTERN */
  75.568 +
  75.569 +/* Three color definitions.  The order of the red, green, and blue, (and the
  75.570 + * exact size) is not important, although the size of the fields need to
  75.571 + * be png_byte or png_uint_16 (as defined below).
  75.572 + */
  75.573 +typedef struct png_color_struct
  75.574 +{
  75.575 +   png_byte red;
  75.576 +   png_byte green;
  75.577 +   png_byte blue;
  75.578 +} png_color;
  75.579 +typedef png_color FAR * png_colorp;
  75.580 +typedef png_color FAR * FAR * png_colorpp;
  75.581 +
  75.582 +typedef struct png_color_16_struct
  75.583 +{
  75.584 +   png_byte index;    /* used for palette files */
  75.585 +   png_uint_16 red;   /* for use in red green blue files */
  75.586 +   png_uint_16 green;
  75.587 +   png_uint_16 blue;
  75.588 +   png_uint_16 gray;  /* for use in grayscale files */
  75.589 +} png_color_16;
  75.590 +typedef png_color_16 FAR * png_color_16p;
  75.591 +typedef png_color_16 FAR * FAR * png_color_16pp;
  75.592 +
  75.593 +typedef struct png_color_8_struct
  75.594 +{
  75.595 +   png_byte red;   /* for use in red green blue files */
  75.596 +   png_byte green;
  75.597 +   png_byte blue;
  75.598 +   png_byte gray;  /* for use in grayscale files */
  75.599 +   png_byte alpha; /* for alpha channel files */
  75.600 +} png_color_8;
  75.601 +typedef png_color_8 FAR * png_color_8p;
  75.602 +typedef png_color_8 FAR * FAR * png_color_8pp;
  75.603 +
  75.604 +/*
  75.605 + * The following two structures are used for the in-core representation
  75.606 + * of sPLT chunks.
  75.607 + */
  75.608 +typedef struct png_sPLT_entry_struct
  75.609 +{
  75.610 +   png_uint_16 red;
  75.611 +   png_uint_16 green;
  75.612 +   png_uint_16 blue;
  75.613 +   png_uint_16 alpha;
  75.614 +   png_uint_16 frequency;
  75.615 +} png_sPLT_entry;
  75.616 +typedef png_sPLT_entry FAR * png_sPLT_entryp;
  75.617 +typedef png_sPLT_entry FAR * FAR * png_sPLT_entrypp;
  75.618 +
  75.619 +/*  When the depth of the sPLT palette is 8 bits, the color and alpha samples
  75.620 + *  occupy the LSB of their respective members, and the MSB of each member
  75.621 + *  is zero-filled.  The frequency member always occupies the full 16 bits.
  75.622 + */
  75.623 +
  75.624 +typedef struct png_sPLT_struct
  75.625 +{
  75.626 +   png_charp name;           /* palette name */
  75.627 +   png_byte depth;           /* depth of palette samples */
  75.628 +   png_sPLT_entryp entries;  /* palette entries */
  75.629 +   png_int_32 nentries;      /* number of palette entries */
  75.630 +} png_sPLT_t;
  75.631 +typedef png_sPLT_t FAR * png_sPLT_tp;
  75.632 +typedef png_sPLT_t FAR * FAR * png_sPLT_tpp;
  75.633 +
  75.634 +#ifdef PNG_TEXT_SUPPORTED
  75.635 +/* png_text holds the contents of a text/ztxt/itxt chunk in a PNG file,
  75.636 + * and whether that contents is compressed or not.  The "key" field
  75.637 + * points to a regular zero-terminated C string.  The "text", "lang", and
  75.638 + * "lang_key" fields can be regular C strings, empty strings, or NULL pointers.
  75.639 + * However, the * structure returned by png_get_text() will always contain
  75.640 + * regular zero-terminated C strings (possibly empty), never NULL pointers,
  75.641 + * so they can be safely used in printf() and other string-handling functions.
  75.642 + */
  75.643 +typedef struct png_text_struct
  75.644 +{
  75.645 +   int  compression;       /* compression value:
  75.646 +                             -1: tEXt, none
  75.647 +                              0: zTXt, deflate
  75.648 +                              1: iTXt, none
  75.649 +                              2: iTXt, deflate  */
  75.650 +   png_charp key;          /* keyword, 1-79 character description of "text" */
  75.651 +   png_charp text;         /* comment, may be an empty string (ie "")
  75.652 +                              or a NULL pointer */
  75.653 +   png_size_t text_length; /* length of the text string */
  75.654 +#ifdef PNG_iTXt_SUPPORTED
  75.655 +   png_size_t itxt_length; /* length of the itxt string */
  75.656 +   png_charp lang;         /* language code, 0-79 characters
  75.657 +                              or a NULL pointer */
  75.658 +   png_charp lang_key;     /* keyword translated UTF-8 string, 0 or more
  75.659 +                              chars or a NULL pointer */
  75.660 +#endif
  75.661 +} png_text;
  75.662 +typedef png_text FAR * png_textp;
  75.663 +typedef png_text FAR * FAR * png_textpp;
  75.664 +#endif
  75.665 +
  75.666 +/* Supported compression types for text in PNG files (tEXt, and zTXt).
  75.667 + * The values of the PNG_TEXT_COMPRESSION_ defines should NOT be changed. */
  75.668 +#define PNG_TEXT_COMPRESSION_NONE_WR -3
  75.669 +#define PNG_TEXT_COMPRESSION_zTXt_WR -2
  75.670 +#define PNG_TEXT_COMPRESSION_NONE    -1
  75.671 +#define PNG_TEXT_COMPRESSION_zTXt     0
  75.672 +#define PNG_ITXT_COMPRESSION_NONE     1
  75.673 +#define PNG_ITXT_COMPRESSION_zTXt     2
  75.674 +#define PNG_TEXT_COMPRESSION_LAST     3  /* Not a valid value */
  75.675 +
  75.676 +/* png_time is a way to hold the time in an machine independent way.
  75.677 + * Two conversions are provided, both from time_t and struct tm.  There
  75.678 + * is no portable way to convert to either of these structures, as far
  75.679 + * as I know.  If you know of a portable way, send it to me.  As a side
  75.680 + * note - PNG has always been Year 2000 compliant!
  75.681 + */
  75.682 +typedef struct png_time_struct
  75.683 +{
  75.684 +   png_uint_16 year; /* full year, as in, 1995 */
  75.685 +   png_byte month;   /* month of year, 1 - 12 */
  75.686 +   png_byte day;     /* day of month, 1 - 31 */
  75.687 +   png_byte hour;    /* hour of day, 0 - 23 */
  75.688 +   png_byte minute;  /* minute of hour, 0 - 59 */
  75.689 +   png_byte second;  /* second of minute, 0 - 60 (for leap seconds) */
  75.690 +} png_time;
  75.691 +typedef png_time FAR * png_timep;
  75.692 +typedef png_time FAR * FAR * png_timepp;
  75.693 +
  75.694 +#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
  75.695 +/* png_unknown_chunk is a structure to hold queued chunks for which there is
  75.696 + * no specific support.  The idea is that we can use this to queue
  75.697 + * up private chunks for output even though the library doesn't actually
  75.698 + * know about their semantics.
  75.699 + */
  75.700 +#define PNG_CHUNK_NAME_LENGTH 5
  75.701 +typedef struct png_unknown_chunk_t
  75.702 +{
  75.703 +    png_byte name[PNG_CHUNK_NAME_LENGTH];
  75.704 +    png_byte *data;
  75.705 +    png_size_t size;
  75.706 +
  75.707 +    /* libpng-using applications should NOT directly modify this byte. */
  75.708 +    png_byte location; /* mode of operation at read time */
  75.709 +}
  75.710 +png_unknown_chunk;
  75.711 +typedef png_unknown_chunk FAR * png_unknown_chunkp;
  75.712 +typedef png_unknown_chunk FAR * FAR * png_unknown_chunkpp;
  75.713 +#endif
  75.714 +
  75.715 +/* png_info is a structure that holds the information in a PNG file so
  75.716 + * that the application can find out the characteristics of the image.
  75.717 + * If you are reading the file, this structure will tell you what is
  75.718 + * in the PNG file.  If you are writing the file, fill in the information
  75.719 + * you want to put into the PNG file, then call png_write_info().
  75.720 + * The names chosen should be very close to the PNG specification, so
  75.721 + * consult that document for information about the meaning of each field.
  75.722 + *
  75.723 + * With libpng < 0.95, it was only possible to directly set and read the
  75.724 + * the values in the png_info_struct, which meant that the contents and
  75.725 + * order of the values had to remain fixed.  With libpng 0.95 and later,
  75.726 + * however, there are now functions that abstract the contents of
  75.727 + * png_info_struct from the application, so this makes it easier to use
  75.728 + * libpng with dynamic libraries, and even makes it possible to use
  75.729 + * libraries that don't have all of the libpng ancillary chunk-handing
  75.730 + * functionality.
  75.731 + *
  75.732 + * In any case, the order of the parameters in png_info_struct should NOT
  75.733 + * be changed for as long as possible to keep compatibility with applications
  75.734 + * that use the old direct-access method with png_info_struct.
  75.735 + *
  75.736 + * The following members may have allocated storage attached that should be
  75.737 + * cleaned up before the structure is discarded: palette, trans, text,
  75.738 + * pcal_purpose, pcal_units, pcal_params, hist, iccp_name, iccp_profile,
  75.739 + * splt_palettes, scal_unit, row_pointers, and unknowns.   By default, these
  75.740 + * are automatically freed when the info structure is deallocated, if they were
  75.741 + * allocated internally by libpng.  This behavior can be changed by means
  75.742 + * of the png_data_freer() function.
  75.743 + *
  75.744 + * More allocation details: all the chunk-reading functions that
  75.745 + * change these members go through the corresponding png_set_*
  75.746 + * functions.  A function to clear these members is available: see
  75.747 + * png_free_data().  The png_set_* functions do not depend on being
  75.748 + * able to point info structure members to any of the storage they are
  75.749 + * passed (they make their own copies), EXCEPT that the png_set_text
  75.750 + * functions use the same storage passed to them in the text_ptr or
  75.751 + * itxt_ptr structure argument, and the png_set_rows and png_set_unknowns
  75.752 + * functions do not make their own copies.
  75.753 + */
  75.754 +typedef struct png_info_struct
  75.755 +{
  75.756 +   /* the following are necessary for every PNG file */
  75.757 +   png_uint_32 width;       /* width of image in pixels (from IHDR) */
  75.758 +   png_uint_32 height;      /* height of image in pixels (from IHDR) */
  75.759 +   png_uint_32 valid;       /* valid chunk data (see PNG_INFO_ below) */
  75.760 +   png_uint_32 rowbytes;    /* bytes needed to hold an untransformed row */
  75.761 +   png_colorp palette;      /* array of color values (valid & PNG_INFO_PLTE) */
  75.762 +   png_uint_16 num_palette; /* number of color entries in "palette" (PLTE) */
  75.763 +   png_uint_16 num_trans;   /* number of transparent palette color (tRNS) */
  75.764 +   png_byte bit_depth;      /* 1, 2, 4, 8, or 16 bits/channel (from IHDR) */
  75.765 +   png_byte color_type;     /* see PNG_COLOR_TYPE_ below (from IHDR) */
  75.766 +   /* The following three should have been named *_method not *_type */
  75.767 +   png_byte compression_type; /* must be PNG_COMPRESSION_TYPE_BASE (IHDR) */
  75.768 +   png_byte filter_type;    /* must be PNG_FILTER_TYPE_BASE (from IHDR) */
  75.769 +   png_byte interlace_type; /* One of PNG_INTERLACE_NONE, PNG_INTERLACE_ADAM7 */
  75.770 +
  75.771 +   /* The following is informational only on read, and not used on writes. */
  75.772 +   png_byte channels;       /* number of data channels per pixel (1, 2, 3, 4) */
  75.773 +   png_byte pixel_depth;    /* number of bits per pixel */
  75.774 +   png_byte spare_byte;     /* to align the data, and for future use */
  75.775 +   png_byte signature[8];   /* magic bytes read by libpng from start of file */
  75.776 +
  75.777 +   /* The rest of the data is optional.  If you are reading, check the
  75.778 +    * valid field to see if the information in these are valid.  If you
  75.779 +    * are writing, set the valid field to those chunks you want written,
  75.780 +    * and initialize the appropriate fields below.
  75.781 +    */
  75.782 +
  75.783 +#if defined(PNG_gAMA_SUPPORTED) && defined(PNG_FLOATING_POINT_SUPPORTED)
  75.784 +   /* The gAMA chunk describes the gamma characteristics of the system
  75.785 +    * on which the image was created, normally in the range [1.0, 2.5].
  75.786 +    * Data is valid if (valid & PNG_INFO_gAMA) is non-zero.
  75.787 +    */
  75.788 +   float gamma; /* gamma value of image, if (valid & PNG_INFO_gAMA) */
  75.789 +#endif
  75.790 +
  75.791 +#if defined(PNG_sRGB_SUPPORTED)
  75.792 +    /* GR-P, 0.96a */
  75.793 +    /* Data valid if (valid & PNG_INFO_sRGB) non-zero. */
  75.794 +   png_byte srgb_intent; /* sRGB rendering intent [0, 1, 2, or 3] */
  75.795 +#endif
  75.796 +
  75.797 +#if defined(PNG_TEXT_SUPPORTED)
  75.798 +   /* The tEXt, and zTXt chunks contain human-readable textual data in
  75.799 +    * uncompressed, compressed, and optionally compressed forms, respectively.
  75.800 +    * The data in "text" is an array of pointers to uncompressed,
  75.801 +    * null-terminated C strings. Each chunk has a keyword that describes the
  75.802 +    * textual data contained in that chunk.  Keywords are not required to be
  75.803 +    * unique, and the text string may be empty.  Any number of text chunks may
  75.804 +    * be in an image.
  75.805 +    */
  75.806 +   int num_text; /* number of comments read/to write */
  75.807 +   int max_text; /* current size of text array */
  75.808 +   png_textp text; /* array of comments read/to write */
  75.809 +#endif /* PNG_TEXT_SUPPORTED */
  75.810 +
  75.811 +#if defined(PNG_tIME_SUPPORTED)
  75.812 +   /* The tIME chunk holds the last time the displayed image data was
  75.813 +    * modified.  See the png_time struct for the contents of this struct.
  75.814 +    */
  75.815 +   png_time mod_time;
  75.816 +#endif
  75.817 +
  75.818 +#if defined(PNG_sBIT_SUPPORTED)
  75.819 +   /* The sBIT chunk specifies the number of significant high-order bits
  75.820 +    * in the pixel data.  Values are in the range [1, bit_depth], and are
  75.821 +    * only specified for the channels in the pixel data.  The contents of
  75.822 +    * the low-order bits is not specified.  Data is valid if
  75.823 +    * (valid & PNG_INFO_sBIT) is non-zero.
  75.824 +    */
  75.825 +   png_color_8 sig_bit; /* significant bits in color channels */
  75.826 +#endif
  75.827 +
  75.828 +#if defined(PNG_tRNS_SUPPORTED) || defined(PNG_READ_EXPAND_SUPPORTED) || \
  75.829 +defined(PNG_READ_BACKGROUND_SUPPORTED)
  75.830 +   /* The tRNS chunk supplies transparency data for paletted images and
  75.831 +    * other image types that don't need a full alpha channel.  There are
  75.832 +    * "num_trans" transparency values for a paletted image, stored in the
  75.833 +    * same order as the palette colors, starting from index 0.  Values
  75.834 +    * for the data are in the range [0, 255], ranging from fully transparent
  75.835 +    * to fully opaque, respectively.  For non-paletted images, there is a
  75.836 +    * single color specified that should be treated as fully transparent.
  75.837 +    * Data is valid if (valid & PNG_INFO_tRNS) is non-zero.
  75.838 +    */
  75.839 +   png_bytep trans; /* transparent values for paletted image */
  75.840 +   png_color_16 trans_values; /* transparent color for non-palette image */
  75.841 +#endif
  75.842 +
  75.843 +#if defined(PNG_bKGD_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED)
  75.844 +   /* The bKGD chunk gives the suggested image background color if the
  75.845 +    * display program does not have its own background color and the image
  75.846 +    * is needs to composited onto a background before display.  The colors
  75.847 +    * in "background" are normally in the same color space/depth as the
  75.848 +    * pixel data.  Data is valid if (valid & PNG_INFO_bKGD) is non-zero.
  75.849 +    */
  75.850 +   png_color_16 background;
  75.851 +#endif
  75.852 +
  75.853 +#if defined(PNG_oFFs_SUPPORTED)
  75.854 +   /* The oFFs chunk gives the offset in "offset_unit_type" units rightwards
  75.855 +    * and downwards from the top-left corner of the display, page, or other
  75.856 +    * application-specific co-ordinate space.  See the PNG_OFFSET_ defines
  75.857 +    * below for the unit types.  Valid if (valid & PNG_INFO_oFFs) non-zero.
  75.858 +    */
  75.859 +   png_int_32 x_offset; /* x offset on page */
  75.860 +   png_int_32 y_offset; /* y offset on page */
  75.861 +   png_byte offset_unit_type; /* offset units type */
  75.862 +#endif
  75.863 +
  75.864 +#if defined(PNG_pHYs_SUPPORTED)
  75.865 +   /* The pHYs chunk gives the physical pixel density of the image for
  75.866 +    * display or printing in "phys_unit_type" units (see PNG_RESOLUTION_
  75.867 +    * defines below).  Data is valid if (valid & PNG_INFO_pHYs) is non-zero.
  75.868 +    */
  75.869 +   png_uint_32 x_pixels_per_unit; /* horizontal pixel density */
  75.870 +   png_uint_32 y_pixels_per_unit; /* vertical pixel density */
  75.871 +   png_byte phys_unit_type; /* resolution type (see PNG_RESOLUTION_ below) */
  75.872 +#endif
  75.873 +
  75.874 +#if defined(PNG_hIST_SUPPORTED)
  75.875 +   /* The hIST chunk contains the relative frequency or importance of the
  75.876 +    * various palette entries, so that a viewer can intelligently select a
  75.877 +    * reduced-color palette, if required.  Data is an array of "num_palette"
  75.878 +    * values in the range [0,65535]. Data valid if (valid & PNG_INFO_hIST)
  75.879 +    * is non-zero.
  75.880 +    */
  75.881 +   png_uint_16p hist;
  75.882 +#endif
  75.883 +
  75.884 +#ifdef PNG_cHRM_SUPPORTED
  75.885 +   /* The cHRM chunk describes the CIE color characteristics of the monitor
  75.886 +    * on which the PNG was created.  This data allows the viewer to do gamut
  75.887 +    * mapping of the input image to ensure that the viewer sees the same
  75.888 +    * colors in the image as the creator.  Values are in the range
  75.889 +    * [0.0, 0.8].  Data valid if (valid & PNG_INFO_cHRM) non-zero.
  75.890 +    */
  75.891 +#ifdef PNG_FLOATING_POINT_SUPPORTED
  75.892 +   float x_white;
  75.893 +   float y_white;
  75.894 +   float x_red;
  75.895 +   float y_red;
  75.896 +   float x_green;
  75.897 +   float y_green;
  75.898 +   float x_blue;
  75.899 +   float y_blue;
  75.900 +#endif
  75.901 +#endif
  75.902 +
  75.903 +#if defined(PNG_pCAL_SUPPORTED)
  75.904 +   /* The pCAL chunk describes a transformation between the stored pixel
  75.905 +    * values and original physical data values used to create the image.
  75.906 +    * The integer range [0, 2^bit_depth - 1] maps to the floating-point
  75.907 +    * range given by [pcal_X0, pcal_X1], and are further transformed by a
  75.908 +    * (possibly non-linear) transformation function given by "pcal_type"
  75.909 +    * and "pcal_params" into "pcal_units".  Please see the PNG_EQUATION_
  75.910 +    * defines below, and the PNG-Group's PNG extensions document for a
  75.911 +    * complete description of the transformations and how they should be
  75.912 +    * implemented, and for a description of the ASCII parameter strings.
  75.913 +    * Data values are valid if (valid & PNG_INFO_pCAL) non-zero.
  75.914 +    */
  75.915 +   png_charp pcal_purpose;  /* pCAL chunk description string */
  75.916 +   png_int_32 pcal_X0;      /* minimum value */
  75.917 +   png_int_32 pcal_X1;      /* maximum value */
  75.918 +   png_charp pcal_units;    /* Latin-1 string giving physical units */
  75.919 +   png_charpp pcal_params;  /* ASCII strings containing parameter values */
  75.920 +   png_byte pcal_type;      /* equation type (see PNG_EQUATION_ below) */
  75.921 +   png_byte pcal_nparams;   /* number of parameters given in pcal_params */
  75.922 +#endif
  75.923 +
  75.924 +/* New members added in libpng-1.0.6 */
  75.925 +#ifdef PNG_FREE_ME_SUPPORTED
  75.926 +   png_uint_32 free_me;     /* flags items libpng is responsible for freeing */
  75.927 +#endif
  75.928 +
  75.929 +#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
  75.930 +   /* storage for unknown chunks that the library doesn't recognize. */
  75.931 +   png_unknown_chunkp unknown_chunks;
  75.932 +   png_size_t unknown_chunks_num;
  75.933 +#endif
  75.934 +
  75.935 +#if defined(PNG_iCCP_SUPPORTED)
  75.936 +   /* iCCP chunk data. */
  75.937 +   png_charp iccp_name;     /* profile name */
  75.938 +   png_charp iccp_profile;  /* International Color Consortium profile data */
  75.939 +                            /* Note to maintainer: should be png_bytep */
  75.940 +   png_uint_32 iccp_proflen;  /* ICC profile data length */
  75.941 +   png_byte iccp_compression; /* Always zero */
  75.942 +#endif
  75.943 +
  75.944 +#if defined(PNG_sPLT_SUPPORTED)
  75.945 +   /* data on sPLT chunks (there may be more than one). */
  75.946 +   png_sPLT_tp splt_palettes;
  75.947 +   png_uint_32 splt_palettes_num;
  75.948 +#endif
  75.949 +
  75.950 +#if defined(PNG_sCAL_SUPPORTED)
  75.951 +   /* The sCAL chunk describes the actual physical dimensions of the
  75.952 +    * subject matter of the graphic.  The chunk contains a unit specification
  75.953 +    * a byte value, and two ASCII strings representing floating-point
  75.954 +    * values.  The values are width and height corresponsing to one pixel
  75.955 +    * in the image.  This external representation is converted to double
  75.956 +    * here.  Data values are valid if (valid & PNG_INFO_sCAL) is non-zero.
  75.957 +    */
  75.958 +   png_byte scal_unit;         /* unit of physical scale */
  75.959 +#ifdef PNG_FLOATING_POINT_SUPPORTED
  75.960 +   double scal_pixel_width;    /* width of one pixel */
  75.961 +   double scal_pixel_height;   /* height of one pixel */
  75.962 +#endif
  75.963 +#ifdef PNG_FIXED_POINT_SUPPORTED
  75.964 +   png_charp scal_s_width;     /* string containing height */
  75.965 +   png_charp scal_s_height;    /* string containing width */
  75.966 +#endif
  75.967 +#endif
  75.968 +
  75.969 +#if defined(PNG_INFO_IMAGE_SUPPORTED)
  75.970 +   /* Memory has been allocated if (valid & PNG_ALLOCATED_INFO_ROWS) non-zero */
  75.971 +   /* Data valid if (valid & PNG_INFO_IDAT) non-zero */
  75.972 +   png_bytepp row_pointers;        /* the image bits */
  75.973 +#endif
  75.974 +
  75.975 +#if defined(PNG_FIXED_POINT_SUPPORTED) && defined(PNG_gAMA_SUPPORTED)
  75.976 +   png_fixed_point int_gamma; /* gamma of image, if (valid & PNG_INFO_gAMA) */
  75.977 +#endif
  75.978 +
  75.979 +#if defined(PNG_cHRM_SUPPORTED) && defined(PNG_FIXED_POINT_SUPPORTED)
  75.980 +   png_fixed_point int_x_white;
  75.981 +   png_fixed_point int_y_white;
  75.982 +   png_fixed_point int_x_red;
  75.983 +   png_fixed_point int_y_red;
  75.984 +   png_fixed_point int_x_green;
  75.985 +   png_fixed_point int_y_green;
  75.986 +   png_fixed_point int_x_blue;
  75.987 +   png_fixed_point int_y_blue;
  75.988 +#endif
  75.989 +
  75.990 +} png_info;
  75.991 +
  75.992 +typedef png_info FAR * png_infop;
  75.993 +typedef png_info FAR * FAR * png_infopp;
  75.994 +
  75.995 +/* Maximum positive integer used in PNG is (2^31)-1 */
  75.996 +#define PNG_UINT_31_MAX ((png_uint_32)0x7fffffffL)
  75.997 +#define PNG_UINT_32_MAX ((png_uint_32)(-1))
  75.998 +#define PNG_SIZE_MAX ((png_size_t)(-1))
  75.999 +#if defined(PNG_1_0_X) || defined (PNG_1_2_X)
 75.1000 +/* PNG_MAX_UINT is deprecated; use PNG_UINT_31_MAX instead. */
 75.1001 +#define PNG_MAX_UINT PNG_UINT_31_MAX
 75.1002 +#endif
 75.1003 +
 75.1004 +/* These describe the color_type field in png_info. */
 75.1005 +/* color type masks */
 75.1006 +#define PNG_COLOR_MASK_PALETTE    1
 75.1007 +#define PNG_COLOR_MASK_COLOR      2
 75.1008 +#define PNG_COLOR_MASK_ALPHA      4
 75.1009 +
 75.1010 +/* color types.  Note that not all combinations are legal */
 75.1011 +#define PNG_COLOR_TYPE_GRAY 0
 75.1012 +#define PNG_COLOR_TYPE_PALETTE  (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_PALETTE)
 75.1013 +#define PNG_COLOR_TYPE_RGB        (PNG_COLOR_MASK_COLOR)
 75.1014 +#define PNG_COLOR_TYPE_RGB_ALPHA  (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_ALPHA)
 75.1015 +#define PNG_COLOR_TYPE_GRAY_ALPHA (PNG_COLOR_MASK_ALPHA)
 75.1016 +/* aliases */
 75.1017 +#define PNG_COLOR_TYPE_RGBA  PNG_COLOR_TYPE_RGB_ALPHA
 75.1018 +#define PNG_COLOR_TYPE_GA  PNG_COLOR_TYPE_GRAY_ALPHA
 75.1019 +
 75.1020 +/* This is for compression type. PNG 1.0-1.2 only define the single type. */
 75.1021 +#define PNG_COMPRESSION_TYPE_BASE 0 /* Deflate method 8, 32K window */
 75.1022 +#define PNG_COMPRESSION_TYPE_DEFAULT PNG_COMPRESSION_TYPE_BASE
 75.1023 +
 75.1024 +/* This is for filter type. PNG 1.0-1.2 only define the single type. */
 75.1025 +#define PNG_FILTER_TYPE_BASE      0 /* Single row per-byte filtering */
 75.1026 +#define PNG_INTRAPIXEL_DIFFERENCING 64 /* Used only in MNG datastreams */
 75.1027 +#define PNG_FILTER_TYPE_DEFAULT   PNG_FILTER_TYPE_BASE
 75.1028 +
 75.1029 +/* These are for the interlacing type.  These values should NOT be changed. */
 75.1030 +#define PNG_INTERLACE_NONE        0 /* Non-interlaced image */
 75.1031 +#define PNG_INTERLACE_ADAM7       1 /* Adam7 interlacing */
 75.1032 +#define PNG_INTERLACE_LAST        2 /* Not a valid value */
 75.1033 +
 75.1034 +/* These are for the oFFs chunk.  These values should NOT be changed. */
 75.1035 +#define PNG_OFFSET_PIXEL          0 /* Offset in pixels */
 75.1036 +#define PNG_OFFSET_MICROMETER     1 /* Offset in micrometers (1/10^6 meter) */
 75.1037 +#define PNG_OFFSET_LAST           2 /* Not a valid value */
 75.1038 +
 75.1039 +/* These are for the pCAL chunk.  These values should NOT be changed. */
 75.1040 +#define PNG_EQUATION_LINEAR       0 /* Linear transformation */
 75.1041 +#define PNG_EQUATION_BASE_E       1 /* Exponential base e transform */
 75.1042 +#define PNG_EQUATION_ARBITRARY    2 /* Arbitrary base exponential transform */
 75.1043 +#define PNG_EQUATION_HYPERBOLIC   3 /* Hyperbolic sine transformation */
 75.1044 +#define PNG_EQUATION_LAST         4 /* Not a valid value */
 75.1045 +
 75.1046 +/* These are for the sCAL chunk.  These values should NOT be changed. */
 75.1047 +#define PNG_SCALE_UNKNOWN         0 /* unknown unit (image scale) */
 75.1048 +#define PNG_SCALE_METER           1 /* meters per pixel */
 75.1049 +#define PNG_SCALE_RADIAN          2 /* radians per pixel */
 75.1050 +#define PNG_SCALE_LAST            3 /* Not a valid value */
 75.1051 +
 75.1052 +/* These are for the pHYs chunk.  These values should NOT be changed. */
 75.1053 +#define PNG_RESOLUTION_UNKNOWN    0 /* pixels/unknown unit (aspect ratio) */
 75.1054 +#define PNG_RESOLUTION_METER      1 /* pixels/meter */
 75.1055 +#define PNG_RESOLUTION_LAST       2 /* Not a valid value */
 75.1056 +
 75.1057 +/* These are for the sRGB chunk.  These values should NOT be changed. */
 75.1058 +#define PNG_sRGB_INTENT_PERCEPTUAL 0
 75.1059 +#define PNG_sRGB_INTENT_RELATIVE   1
 75.1060 +#define PNG_sRGB_INTENT_SATURATION 2
 75.1061 +#define PNG_sRGB_INTENT_ABSOLUTE   3
 75.1062 +#define PNG_sRGB_INTENT_LAST       4 /* Not a valid value */
 75.1063 +
 75.1064 +/* This is for text chunks */
 75.1065 +#define PNG_KEYWORD_MAX_LENGTH     79
 75.1066 +
 75.1067 +/* Maximum number of entries in PLTE/sPLT/tRNS arrays */
 75.1068 +#define PNG_MAX_PALETTE_LENGTH    256
 75.1069 +
 75.1070 +/* These determine if an ancillary chunk's data has been successfully read
 75.1071 + * from the PNG header, or if the application has filled in the corresponding
 75.1072 + * data in the info_struct to be written into the output file.  The values
 75.1073 + * of the PNG_INFO_<chunk> defines should NOT be changed.
 75.1074 + */
 75.1075 +#define PNG_INFO_gAMA 0x0001
 75.1076 +#define PNG_INFO_sBIT 0x0002
 75.1077 +#define PNG_INFO_cHRM 0x0004
 75.1078 +#define PNG_INFO_PLTE 0x0008
 75.1079 +#define PNG_INFO_tRNS 0x0010
 75.1080 +#define PNG_INFO_bKGD 0x0020
 75.1081 +#define PNG_INFO_hIST 0x0040
 75.1082 +#define PNG_INFO_pHYs 0x0080
 75.1083 +#define PNG_INFO_oFFs 0x0100
 75.1084 +#define PNG_INFO_tIME 0x0200
 75.1085 +#define PNG_INFO_pCAL 0x0400
 75.1086 +#define PNG_INFO_sRGB 0x0800   /* GR-P, 0.96a */
 75.1087 +#define PNG_INFO_iCCP 0x1000   /* ESR, 1.0.6 */
 75.1088 +#define PNG_INFO_sPLT 0x2000   /* ESR, 1.0.6 */
 75.1089 +#define PNG_INFO_sCAL 0x4000   /* ESR, 1.0.6 */
 75.1090 +#define PNG_INFO_IDAT 0x8000L  /* ESR, 1.0.6 */
 75.1091 +
 75.1092 +/* This is used for the transformation routines, as some of them
 75.1093 + * change these values for the row.  It also should enable using
 75.1094 + * the routines for other purposes.
 75.1095 + */
 75.1096 +typedef struct png_row_info_struct
 75.1097 +{
 75.1098 +   png_uint_32 width; /* width of row */
 75.1099 +   png_uint_32 rowbytes; /* number of bytes in row */
 75.1100 +   png_byte color_type; /* color type of row */
 75.1101 +   png_byte bit_depth; /* bit depth of row */
 75.1102 +   png_byte channels; /* number of channels (1, 2, 3, or 4) */
 75.1103 +   png_byte pixel_depth; /* bits per pixel (depth * channels) */
 75.1104 +} png_row_info;
 75.1105 +
 75.1106 +typedef png_row_info FAR * png_row_infop;
 75.1107 +typedef png_row_info FAR * FAR * png_row_infopp;
 75.1108 +
 75.1109 +/* These are the function types for the I/O functions and for the functions
 75.1110 + * that allow the user to override the default I/O functions with his or her
 75.1111 + * own.  The png_error_ptr type should match that of user-supplied warning
 75.1112 + * and error functions, while the png_rw_ptr type should match that of the
 75.1113 + * user read/write data functions.
 75.1114 + */
 75.1115 +typedef struct png_struct_def png_struct;
 75.1116 +typedef png_struct FAR * png_structp;
 75.1117 +
 75.1118 +typedef void (PNGAPI *png_error_ptr) PNGARG((png_structp, png_const_charp));
 75.1119 +typedef void (PNGAPI *png_rw_ptr) PNGARG((png_structp, png_bytep, png_size_t));
 75.1120 +typedef void (PNGAPI *png_flush_ptr) PNGARG((png_structp));
 75.1121 +typedef void (PNGAPI *png_read_status_ptr) PNGARG((png_structp, png_uint_32,
 75.1122 +   int));
 75.1123 +typedef void (PNGAPI *png_write_status_ptr) PNGARG((png_structp, png_uint_32,
 75.1124 +   int));
 75.1125 +
 75.1126 +#ifdef PNG_PROGRESSIVE_READ_SUPPORTED
 75.1127 +typedef void (PNGAPI *png_progressive_info_ptr) PNGARG((png_structp, png_infop));
 75.1128 +typedef void (PNGAPI *png_progressive_end_ptr) PNGARG((png_structp, png_infop));
 75.1129 +typedef void (PNGAPI *png_progressive_row_ptr) PNGARG((png_structp, png_bytep,
 75.1130 +   png_uint_32, int));
 75.1131 +#endif
 75.1132 +
 75.1133 +#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \
 75.1134 +    defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) || \
 75.1135 +    defined(PNG_LEGACY_SUPPORTED)
 75.1136 +typedef void (PNGAPI *png_user_transform_ptr) PNGARG((png_structp,
 75.1137 +    png_row_infop, png_bytep));
 75.1138 +#endif
 75.1139 +
 75.1140 +#if defined(PNG_USER_CHUNKS_SUPPORTED)
 75.1141 +typedef int (PNGAPI *png_user_chunk_ptr) PNGARG((png_structp, png_unknown_chunkp));
 75.1142 +#endif
 75.1143 +#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
 75.1144 +typedef void (PNGAPI *png_unknown_chunk_ptr) PNGARG((png_structp));
 75.1145 +#endif
 75.1146 +
 75.1147 +/* Transform masks for the high-level interface */
 75.1148 +#define PNG_TRANSFORM_IDENTITY       0x0000    /* read and write */
 75.1149 +#define PNG_TRANSFORM_STRIP_16       0x0001    /* read only */
 75.1150 +#define PNG_TRANSFORM_STRIP_ALPHA    0x0002    /* read only */
 75.1151 +#define PNG_TRANSFORM_PACKING        0x0004    /* read and write */
 75.1152 +#define PNG_TRANSFORM_PACKSWAP       0x0008    /* read and write */
 75.1153 +#define PNG_TRANSFORM_EXPAND         0x0010    /* read only */
 75.1154 +#define PNG_TRANSFORM_INVERT_MONO    0x0020    /* read and write */
 75.1155 +#define PNG_TRANSFORM_SHIFT          0x0040    /* read and write */
 75.1156 +#define PNG_TRANSFORM_BGR            0x0080    /* read and write */
 75.1157 +#define PNG_TRANSFORM_SWAP_ALPHA     0x0100    /* read and write */
 75.1158 +#define PNG_TRANSFORM_SWAP_ENDIAN    0x0200    /* read and write */
 75.1159 +#define PNG_TRANSFORM_INVERT_ALPHA   0x0400    /* read and write */
 75.1160 +#define PNG_TRANSFORM_STRIP_FILLER   0x0800    /* WRITE only */
 75.1161 +
 75.1162 +/* Flags for MNG supported features */
 75.1163 +#define PNG_FLAG_MNG_EMPTY_PLTE     0x01
 75.1164 +#define PNG_FLAG_MNG_FILTER_64      0x04
 75.1165 +#define PNG_ALL_MNG_FEATURES        0x05
 75.1166 +
 75.1167 +typedef png_voidp (*png_malloc_ptr) PNGARG((png_structp, png_size_t));
 75.1168 +typedef void (*png_free_ptr) PNGARG((png_structp, png_voidp));
 75.1169 +
 75.1170 +/* The structure that holds the information to read and write PNG files.
 75.1171 + * The only people who need to care about what is inside of this are the
 75.1172 + * people who will be modifying the library for their own special needs.
 75.1173 + * It should NOT be accessed directly by an application, except to store
 75.1174 + * the jmp_buf.
 75.1175 + */
 75.1176 +
 75.1177 +struct png_struct_def
 75.1178 +{
 75.1179 +#ifdef PNG_SETJMP_SUPPORTED
 75.1180 +   jmp_buf jmpbuf;            /* used in png_error */
 75.1181 +#endif
 75.1182 +   png_error_ptr error_fn;    /* function for printing errors and aborting */
 75.1183 +   png_error_ptr warning_fn;  /* function for printing warnings */
 75.1184 +   png_voidp error_ptr;       /* user supplied struct for error functions */
 75.1185 +   png_rw_ptr write_data_fn;  /* function for writing output data */
 75.1186 +   png_rw_ptr read_data_fn;   /* function for reading input data */
 75.1187 +   png_voidp io_ptr;          /* ptr to application struct for I/O functions */
 75.1188 +
 75.1189 +#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED)
 75.1190 +   png_user_transform_ptr read_user_transform_fn; /* user read transform */
 75.1191 +#endif
 75.1192 +
 75.1193 +#if defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)
 75.1194 +   png_user_transform_ptr write_user_transform_fn; /* user write transform */
 75.1195 +#endif
 75.1196 +
 75.1197 +/* These were added in libpng-1.0.2 */
 75.1198 +#if defined(PNG_USER_TRANSFORM_PTR_SUPPORTED)
 75.1199 +#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \
 75.1200 +    defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)
 75.1201 +   png_voidp user_transform_ptr; /* user supplied struct for user transform */
 75.1202 +   png_byte user_transform_depth;    /* bit depth of user transformed pixels */
 75.1203 +   png_byte user_transform_channels; /* channels in user transformed pixels */
 75.1204 +#endif
 75.1205 +#endif
 75.1206 +
 75.1207 +   png_uint_32 mode;          /* tells us where we are in the PNG file */
 75.1208 +   png_uint_32 flags;         /* flags indicating various things to libpng */
 75.1209 +   png_uint_32 transformations; /* which transformations to perform */
 75.1210 +
 75.1211 +   z_stream zstream;          /* pointer to decompression structure (below) */
 75.1212 +   png_bytep zbuf;            /* buffer for zlib */
 75.1213 +   png_size_t zbuf_size;      /* size of zbuf */
 75.1214 +   int zlib_level;            /* holds zlib compression level */
 75.1215 +   int zlib_method;           /* holds zlib compression method */
 75.1216 +   int zlib_window_bits;      /* holds zlib compression window bits */
 75.1217 +   int zlib_mem_level;        /* holds zlib compression memory level */
 75.1218 +   int zlib_strategy;         /* holds zlib compression strategy */
 75.1219 +
 75.1220 +   png_uint_32 width;         /* width of image in pixels */
 75.1221 +   png_uint_32 height;        /* height of image in pixels */
 75.1222 +   png_uint_32 num_rows;      /* number of rows in current pass */
 75.1223 +   png_uint_32 usr_width;     /* width of row at start of write */
 75.1224 +   png_uint_32 rowbytes;      /* size of row in bytes */
 75.1225 +   png_uint_32 irowbytes;     /* size of current interlaced row in bytes */
 75.1226 +   png_uint_32 iwidth;        /* width of current interlaced row in pixels */
 75.1227 +   png_uint_32 row_number;    /* current row in interlace pass */
 75.1228 +   png_bytep prev_row;        /* buffer to save previous (unfiltered) row */
 75.1229 +   png_bytep row_buf;         /* buffer to save current (unfiltered) row */
 75.1230 +#ifndef PNG_NO_WRITE_FILTER
 75.1231 +   png_bytep sub_row;         /* buffer to save "sub" row when filtering */
 75.1232 +   png_bytep up_row;          /* buffer to save "up" row when filtering */
 75.1233 +   png_bytep avg_row;         /* buffer to save "avg" row when filtering */
 75.1234 +   png_bytep paeth_row;       /* buffer to save "Paeth" row when filtering */
 75.1235 +#endif
 75.1236 +   png_row_info row_info;     /* used for transformation routines */
 75.1237 +
 75.1238 +   png_uint_32 idat_size;     /* current IDAT size for read */
 75.1239 +   png_uint_32 crc;           /* current chunk CRC value */
 75.1240 +   png_colorp palette;        /* palette from the input file */
 75.1241 +   png_uint_16 num_palette;   /* number of color entries in palette */
 75.1242 +   png_uint_16 num_trans;     /* number of transparency values */
 75.1243 +   png_byte chunk_name[5];    /* null-terminated name of current chunk */
 75.1244 +   png_byte compression;      /* file compression type (always 0) */
 75.1245 +   png_byte filter;           /* file filter type (always 0) */
 75.1246 +   png_byte interlaced;       /* PNG_INTERLACE_NONE, PNG_INTERLACE_ADAM7 */
 75.1247 +   png_byte pass;             /* current interlace pass (0 - 6) */
 75.1248 +   png_byte do_filter;        /* row filter flags (see PNG_FILTER_ below ) */
 75.1249 +   png_byte color_type;       /* color type of file */
 75.1250 +   png_byte bit_depth;        /* bit depth of file */
 75.1251 +   png_byte usr_bit_depth;    /* bit depth of users row */
 75.1252 +   png_byte pixel_depth;      /* number of bits per pixel */
 75.1253 +   png_byte channels;         /* number of channels in file */
 75.1254 +   png_byte usr_channels;     /* channels at start of write */
 75.1255 +   png_byte sig_bytes;        /* magic bytes read/written from start of file */
 75.1256 +
 75.1257 +#if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED)
 75.1258 +#ifdef PNG_LEGACY_SUPPORTED
 75.1259 +   png_byte filler;           /* filler byte for pixel expansion */
 75.1260 +#else
 75.1261 +   png_uint_16 filler;           /* filler bytes for pixel expansion */
 75.1262 +#endif
 75.1263 +#endif
 75.1264 +
 75.1265 +#if defined(PNG_bKGD_SUPPORTED)
 75.1266 +   png_byte background_gamma_type;
 75.1267 +#  ifdef PNG_FLOATING_POINT_SUPPORTED
 75.1268 +   float background_gamma;
 75.1269 +#  endif
 75.1270 +   png_color_16 background;   /* background color in screen gamma space */
 75.1271 +#if defined(PNG_READ_GAMMA_SUPPORTED)
 75.1272 +   png_color_16 background_1; /* background normalized to gamma 1.0 */
 75.1273 +#endif
 75.1274 +#endif /* PNG_bKGD_SUPPORTED */
 75.1275 +
 75.1276 +#if defined(PNG_WRITE_FLUSH_SUPPORTED)
 75.1277 +   png_flush_ptr output_flush_fn;/* Function for flushing output */
 75.1278 +   png_uint_32 flush_dist;    /* how many rows apart to flush, 0 - no flush */
 75.1279 +   png_uint_32 flush_rows;    /* number of rows written since last flush */
 75.1280 +#endif
 75.1281 +
 75.1282 +#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED)
 75.1283 +   int gamma_shift;      /* number of "insignificant" bits 16-bit gamma */
 75.1284 +#ifdef PNG_FLOATING_POINT_SUPPORTED
 75.1285 +   float gamma;          /* file gamma value */
 75.1286 +   float screen_gamma;   /* screen gamma value (display_exponent) */
 75.1287 +#endif
 75.1288 +#endif
 75.1289 +
 75.1290 +#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED)
 75.1291 +   png_bytep gamma_table;     /* gamma table for 8-bit depth files */
 75.1292 +   png_bytep gamma_from_1;    /* converts from 1.0 to screen */
 75.1293 +   png_bytep gamma_to_1;      /* converts from file to 1.0 */
 75.1294 +   png_uint_16pp gamma_16_table; /* gamma table for 16-bit depth files */
 75.1295 +   png_uint_16pp gamma_16_from_1; /* converts from 1.0 to screen */
 75.1296 +   png_uint_16pp gamma_16_to_1; /* converts from file to 1.0 */
 75.1297 +#endif
 75.1298 +
 75.1299 +#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_sBIT_SUPPORTED)
 75.1300 +   png_color_8 sig_bit;       /* significant bits in each available channel */
 75.1301 +#endif
 75.1302 +
 75.1303 +#if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED)
 75.1304 +   png_color_8 shift;         /* shift for significant bit tranformation */
 75.1305 +#endif
 75.1306 +
 75.1307 +#if defined(PNG_tRNS_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) \
 75.1308 + || defined(PNG_READ_EXPAND_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED)
 75.1309 +   png_bytep trans;           /* transparency values for paletted files */
 75.1310 +   png_color_16 trans_values; /* transparency values for non-paletted files */
 75.1311 +#endif
 75.1312 +
 75.1313 +   png_read_status_ptr read_row_fn;   /* called after each row is decoded */
 75.1314 +   png_write_status_ptr write_row_fn; /* called after each row is encoded */
 75.1315 +#ifdef PNG_PROGRESSIVE_READ_SUPPORTED
 75.1316 +   png_progressive_info_ptr info_fn; /* called after header data fully read */
 75.1317 +   png_progressive_row_ptr row_fn;   /* called after each prog. row is decoded */
 75.1318 +   png_progressive_end_ptr end_fn;   /* called after image is complete */
 75.1319 +   png_bytep save_buffer_ptr;        /* current location in save_buffer */
 75.1320 +   png_bytep save_buffer;            /* buffer for previously read data */
 75.1321 +   png_bytep current_buffer_ptr;     /* current location in current_buffer */
 75.1322 +   png_bytep current_buffer;         /* buffer for recently used data */
 75.1323 +   png_uint_32 push_length;          /* size of current input chunk */
 75.1324 +   png_uint_32 skip_length;          /* bytes to skip in input data */
 75.1325 +   png_size_t save_buffer_size;      /* amount of data now in save_buffer */
 75.1326 +   png_size_t save_buffer_max;       /* total size of save_buffer */
 75.1327 +   png_size_t buffer_size;           /* total amount of available input data */
 75.1328 +   png_size_t current_buffer_size;   /* amount of data now in current_buffer */
 75.1329 +   int process_mode;                 /* what push library is currently doing */
 75.1330 +   int cur_palette;                  /* current push library palette index */
 75.1331 +
 75.1332 +#  if defined(PNG_TEXT_SUPPORTED)
 75.1333 +     png_size_t current_text_size;   /* current size of text input data */
 75.1334 +     png_size_t current_text_left;   /* how much text left to read in input */
 75.1335 +     png_charp current_text;         /* current text chunk buffer */
 75.1336 +     png_charp current_text_ptr;     /* current location in current_text */
 75.1337 +#  endif /* PNG_TEXT_SUPPORTED */
 75.1338 +#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */
 75.1339 +
 75.1340 +#if defined(__TURBOC__) && !defined(_Windows) && !defined(__FLAT__)
 75.1341 +/* for the Borland special 64K segment handler */
 75.1342 +   png_bytepp offset_table_ptr;
 75.1343 +   png_bytep offset_table;
 75.1344 +   png_uint_16 offset_table_number;
 75.1345 +   png_uint_16 offset_table_count;
 75.1346 +   png_uint_16 offset_table_count_free;
 75.1347 +#endif
 75.1348 +
 75.1349 +#if defined(PNG_READ_DITHER_SUPPORTED)
 75.1350 +   png_bytep palette_lookup;         /* lookup table for dithering */
 75.1351 +   png_bytep dither_index;           /* index translation for palette files */
 75.1352 +#endif
 75.1353 +
 75.1354 +#if defined(PNG_READ_DITHER_SUPPORTED) || defined(PNG_hIST_SUPPORTED)
 75.1355 +   png_uint_16p hist;                /* histogram */
 75.1356 +#endif
 75.1357 +
 75.1358 +#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED)
 75.1359 +   png_byte heuristic_method;        /* heuristic for row filter selection */
 75.1360 +   png_byte num_prev_filters;        /* number of weights for previous rows */
 75.1361 +   png_bytep prev_filters;           /* filter type(s) of previous row(s) */
 75.1362 +   png_uint_16p filter_weights;      /* weight(s) for previous line(s) */
 75.1363 +   png_uint_16p inv_filter_weights;  /* 1/weight(s) for previous line(s) */
 75.1364 +   png_uint_16p filter_costs;        /* relative filter calculation cost */
 75.1365 +   png_uint_16p inv_filter_costs;    /* 1/relative filter calculation cost */
 75.1366 +#endif
 75.1367 +
 75.1368 +#if defined(PNG_TIME_RFC1123_SUPPORTED)
 75.1369 +   png_charp time_buffer;            /* String to hold RFC 1123 time text */
 75.1370 +#endif
 75.1371 +
 75.1372 +/* New members added in libpng-1.0.6 */
 75.1373 +
 75.1374 +#ifdef PNG_FREE_ME_SUPPORTED
 75.1375 +   png_uint_32 free_me;       /* flags items libpng is responsible for freeing */
 75.1376 +#endif
 75.1377 +
 75.1378 +#if defined(PNG_USER_CHUNKS_SUPPORTED)
 75.1379 +   png_voidp user_chunk_ptr;
 75.1380 +   png_user_chunk_ptr read_user_chunk_fn; /* user read chunk handler */
 75.1381 +#endif
 75.1382 +
 75.1383 +#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
 75.1384 +   int num_chunk_list;
 75.1385 +   png_bytep chunk_list;
 75.1386 +#endif
 75.1387 +
 75.1388 +/* New members added in libpng-1.0.3 */
 75.1389 +#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED)
 75.1390 +   png_byte rgb_to_gray_status;
 75.1391 +   /* These were changed from png_byte in libpng-1.0.6 */
 75.1392 +   png_uint_16 rgb_to_gray_red_coeff;
 75.1393 +   png_uint_16 rgb_to_gray_green_coeff;
 75.1394 +   png_uint_16 rgb_to_gray_blue_coeff;
 75.1395 +#endif
 75.1396 +
 75.1397 +/* New member added in libpng-1.0.4 (renamed in 1.0.9) */
 75.1398 +#if defined(PNG_MNG_FEATURES_SUPPORTED) || \
 75.1399 +    defined(PNG_READ_EMPTY_PLTE_SUPPORTED) || \
 75.1400 +    defined(PNG_WRITE_EMPTY_PLTE_SUPPORTED)
 75.1401 +/* changed from png_byte to png_uint_32 at version 1.2.0 */
 75.1402 +#ifdef PNG_1_0_X
 75.1403 +   png_byte mng_features_permitted;
 75.1404 +#else
 75.1405 +   png_uint_32 mng_features_permitted;
 75.1406 +#endif /* PNG_1_0_X */
 75.1407 +#endif
 75.1408 +
 75.1409 +/* New member added in libpng-1.0.7 */
 75.1410 +#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED)
 75.1411 +   png_fixed_point int_gamma;
 75.1412 +#endif
 75.1413 +
 75.1414 +/* New member added in libpng-1.0.9, ifdef'ed out in 1.0.12, enabled in 1.2.0 */
 75.1415 +#if defined(PNG_MNG_FEATURES_SUPPORTED)
 75.1416 +   png_byte filter_type;
 75.1417 +#endif
 75.1418 +
 75.1419 +#if defined(PNG_1_0_X)
 75.1420 +/* New member added in libpng-1.0.10, ifdef'ed out in 1.2.0 */
 75.1421 +   png_uint_32 row_buf_size;
 75.1422 +#endif
 75.1423 +
 75.1424 +/* New members added in libpng-1.2.0 */
 75.1425 +#if defined(PNG_ASSEMBLER_CODE_SUPPORTED)
 75.1426 +#  if !defined(PNG_1_0_X)
 75.1427 +#    if defined(PNG_MMX_CODE_SUPPORTED)
 75.1428 +   png_byte     mmx_bitdepth_threshold;
 75.1429 +   png_uint_32  mmx_rowbytes_threshold;
 75.1430 +#    endif
 75.1431 +   png_uint_32  asm_flags;
 75.1432 +#  endif
 75.1433 +#endif
 75.1434 +
 75.1435 +/* New members added in libpng-1.0.2 but first enabled by default in 1.2.0 */
 75.1436 +#ifdef PNG_USER_MEM_SUPPORTED
 75.1437 +   png_voidp mem_ptr;                /* user supplied struct for mem functions */
 75.1438 +   png_malloc_ptr malloc_fn;         /* function for allocating memory */
 75.1439 +   png_free_ptr free_fn;             /* function for freeing memory */
 75.1440 +#endif
 75.1441 +
 75.1442 +/* New member added in libpng-1.0.13 and 1.2.0 */
 75.1443 +   png_bytep big_row_buf;         /* buffer to save current (unfiltered) row */
 75.1444 +
 75.1445 +#if defined(PNG_READ_DITHER_SUPPORTED)
 75.1446 +/* The following three members were added at version 1.0.14 and 1.2.4 */
 75.1447 +   png_bytep dither_sort;            /* working sort array */
 75.1448 +   png_bytep index_to_palette;       /* where the original index currently is */
 75.1449 +                                     /* in the palette */
 75.1450 +   png_bytep palette_to_index;       /* which original index points to this */
 75.1451 +                                     /* palette color */
 75.1452 +#endif
 75.1453 +
 75.1454 +/* New members added in libpng-1.0.16 and 1.2.6 */
 75.1455 +   png_byte compression_type;
 75.1456 +
 75.1457 +#ifdef PNG_SET_USER_LIMITS_SUPPORTED
 75.1458 +   png_uint_32 user_width_max;
 75.1459 +   png_uint_32 user_height_max;
 75.1460 +#endif
 75.1461 +
 75.1462 +/* New member added in libpng-1.0.25 and 1.2.17 */
 75.1463 +#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
 75.1464 +   /* storage for unknown chunk that the library doesn't recognize. */
 75.1465 +   png_unknown_chunk unknown_chunk;
 75.1466 +#endif
 75.1467 +
 75.1468 +/* New members added in libpng-1.2.26 */
 75.1469 +  png_uint_32 old_big_row_buf_size, old_prev_row_size;
 75.1470 +
 75.1471 +/* New member added in libpng-1.2.30 */
 75.1472 +  png_charp chunkdata;  /* buffer for reading chunk data */
 75.1473 +
 75.1474 +};
 75.1475 +
 75.1476 +
 75.1477 +/* This triggers a compiler error in png.c, if png.c and png.h
 75.1478 + * do not agree upon the version number.
 75.1479 + */
 75.1480 +typedef png_structp version_1_2_33;
 75.1481 +
 75.1482 +typedef png_struct FAR * FAR * png_structpp;
 75.1483 +
 75.1484 +/* Here are the function definitions most commonly used.  This is not
 75.1485 + * the place to find out how to use libpng.  See libpng.txt for the
 75.1486 + * full explanation, see example.c for the summary.  This just provides
 75.1487 + * a simple one line description of the use of each function.
 75.1488 + */
 75.1489 +
 75.1490 +/* Returns the version number of the library */
 75.1491 +extern PNG_EXPORT(png_uint_32,png_access_version_number) PNGARG((void));
 75.1492 +
 75.1493 +/* Tell lib we have already handled the first <num_bytes> magic bytes.
 75.1494 + * Handling more than 8 bytes from the beginning of the file is an error.
 75.1495 + */
 75.1496 +extern PNG_EXPORT(void,png_set_sig_bytes) PNGARG((png_structp png_ptr,
 75.1497 +   int num_bytes));
 75.1498 +
 75.1499 +/* Check sig[start] through sig[start + num_to_check - 1] to see if it's a
 75.1500 + * PNG file.  Returns zero if the supplied bytes match the 8-byte PNG
 75.1501 + * signature, and non-zero otherwise.  Having num_to_check == 0 or
 75.1502 + * start > 7 will always fail (ie return non-zero).
 75.1503 + */
 75.1504 +extern PNG_EXPORT(int,png_sig_cmp) PNGARG((png_bytep sig, png_size_t start,
 75.1505 +   png_size_t num_to_check));
 75.1506 +
 75.1507 +/* Simple signature checking function.  This is the same as calling
 75.1508 + * png_check_sig(sig, n) := !png_sig_cmp(sig, 0, n).
 75.1509 + */
 75.1510 +extern PNG_EXPORT(int,png_check_sig) PNGARG((png_bytep sig, int num));
 75.1511 +
 75.1512 +/* Allocate and initialize png_ptr struct for reading, and any other memory. */
 75.1513 +extern PNG_EXPORT(png_structp,png_create_read_struct)
 75.1514 +   PNGARG((png_const_charp user_png_ver, png_voidp error_ptr,
 75.1515 +   png_error_ptr error_fn, png_error_ptr warn_fn));
 75.1516 +
 75.1517 +/* Allocate and initialize png_ptr struct for writing, and any other memory */
 75.1518 +extern PNG_EXPORT(png_structp,png_create_write_struct)
 75.1519 +   PNGARG((png_const_charp user_png_ver, png_voidp error_ptr,
 75.1520 +   png_error_ptr error_fn, png_error_ptr warn_fn));
 75.1521 +
 75.1522 +#ifdef PNG_WRITE_SUPPORTED
 75.1523 +extern PNG_EXPORT(png_uint_32,png_get_compression_buffer_size)
 75.1524 +   PNGARG((png_structp png_ptr));
 75.1525 +#endif
 75.1526 +
 75.1527 +#ifdef PNG_WRITE_SUPPORTED
 75.1528 +extern PNG_EXPORT(void,png_set_compression_buffer_size)
 75.1529 +   PNGARG((png_structp png_ptr, png_uint_32 size));
 75.1530 +#endif
 75.1531 +
 75.1532 +/* Reset the compression stream */
 75.1533 +extern PNG_EXPORT(int,png_reset_zstream) PNGARG((png_structp png_ptr));
 75.1534 +
 75.1535 +/* New functions added in libpng-1.0.2 (not enabled by default until 1.2.0) */
 75.1536 +#ifdef PNG_USER_MEM_SUPPORTED
 75.1537 +extern PNG_EXPORT(png_structp,png_create_read_struct_2)
 75.1538 +   PNGARG((png_const_charp user_png_ver, png_voidp error_ptr,
 75.1539 +   png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr,
 75.1540 +   png_malloc_ptr malloc_fn, png_free_ptr free_fn));
 75.1541 +extern PNG_EXPORT(png_structp,png_create_write_struct_2)
 75.1542 +   PNGARG((png_const_charp user_png_ver, png_voidp error_ptr,
 75.1543 +   png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr,
 75.1544 +   png_malloc_ptr malloc_fn, png_free_ptr free_fn));
 75.1545 +#endif
 75.1546 +
 75.1547 +/* Write a PNG chunk - size, type, (optional) data, CRC. */
 75.1548 +extern PNG_EXPORT(void,png_write_chunk) PNGARG((png_structp png_ptr,
 75.1549 +   png_bytep chunk_name, png_bytep data, png_size_t length));
 75.1550 +
 75.1551 +/* Write the start of a PNG chunk - length and chunk name. */
 75.1552 +extern PNG_EXPORT(void,png_write_chunk_start) PNGARG((png_structp png_ptr,
 75.1553 +   png_bytep chunk_name, png_uint_32 length));
 75.1554 +
 75.1555 +/* Write the data of a PNG chunk started with png_write_chunk_start(). */
 75.1556 +extern PNG_EXPORT(void,png_write_chunk_data) PNGARG((png_structp png_ptr,
 75.1557 +   png_bytep data, png_size_t length));
 75.1558 +
 75.1559 +/* Finish a chunk started with png_write_chunk_start() (includes CRC). */
 75.1560 +extern PNG_EXPORT(void,png_write_chunk_end) PNGARG((png_structp png_ptr));
 75.1561 +
 75.1562 +/* Allocate and initialize the info structure */
 75.1563 +extern PNG_EXPORT(png_infop,png_create_info_struct)
 75.1564 +   PNGARG((png_structp png_ptr));
 75.1565 +
 75.1566 +#if defined(PNG_1_0_X) || defined (PNG_1_2_X)
 75.1567 +/* Initialize the info structure (old interface - DEPRECATED) */
 75.1568 +extern PNG_EXPORT(void,png_info_init) PNGARG((png_infop info_ptr));
 75.1569 +#undef png_info_init
 75.1570 +#define png_info_init(info_ptr) png_info_init_3(&info_ptr,\
 75.1571 +    png_sizeof(png_info));
 75.1572 +#endif
 75.1573 +
 75.1574 +extern PNG_EXPORT(void,png_info_init_3) PNGARG((png_infopp info_ptr,
 75.1575 +    png_size_t png_info_struct_size));
 75.1576 +
 75.1577 +/* Writes all the PNG information before the image. */
 75.1578 +extern PNG_EXPORT(void,png_write_info_before_PLTE) PNGARG((png_structp png_ptr,
 75.1579 +   png_infop info_ptr));
 75.1580 +extern PNG_EXPORT(void,png_write_info) PNGARG((png_structp png_ptr,
 75.1581 +   png_infop info_ptr));
 75.1582 +
 75.1583 +#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED
 75.1584 +/* read the information before the actual image data. */
 75.1585 +extern PNG_EXPORT(void,png_read_info) PNGARG((png_structp png_ptr,
 75.1586 +   png_infop info_ptr));
 75.1587 +#endif
 75.1588 +
 75.1589 +#if defined(PNG_TIME_RFC1123_SUPPORTED)
 75.1590 +extern PNG_EXPORT(png_charp,png_convert_to_rfc1123)
 75.1591 +   PNGARG((png_structp png_ptr, png_timep ptime));
 75.1592 +#endif
 75.1593 +
 75.1594 +#if !defined(_WIN32_WCE)
 75.1595 +/* "time.h" functions are not supported on WindowsCE */
 75.1596 +#if defined(PNG_WRITE_tIME_SUPPORTED)
 75.1597 +/* convert from a struct tm to png_time */
 75.1598 +extern PNG_EXPORT(void,png_convert_from_struct_tm) PNGARG((png_timep ptime,
 75.1599 +   struct tm FAR * ttime));
 75.1600 +
 75.1601 +/* convert from time_t to png_time.  Uses gmtime() */
 75.1602 +extern PNG_EXPORT(void,png_convert_from_time_t) PNGARG((png_timep ptime,
 75.1603 +   time_t ttime));
 75.1604 +#endif /* PNG_WRITE_tIME_SUPPORTED */
 75.1605 +#endif /* _WIN32_WCE */
 75.1606 +
 75.1607 +#if defined(PNG_READ_EXPAND_SUPPORTED)
 75.1608 +/* Expand data to 24-bit RGB, or 8-bit grayscale, with alpha if available. */
 75.1609 +extern PNG_EXPORT(void,png_set_expand) PNGARG((png_structp png_ptr));
 75.1610 +#if !defined(PNG_1_0_X)
 75.1611 +extern PNG_EXPORT(void,png_set_expand_gray_1_2_4_to_8) PNGARG((png_structp
 75.1612 +  png_ptr));
 75.1613 +#endif
 75.1614 +extern PNG_EXPORT(void,png_set_palette_to_rgb) PNGARG((png_structp png_ptr));
 75.1615 +extern PNG_EXPORT(void,png_set_tRNS_to_alpha) PNGARG((png_structp png_ptr));
 75.1616 +#if defined(PNG_1_0_X) || defined (PNG_1_2_X)
 75.1617 +/* Deprecated */
 75.1618 +extern PNG_EXPORT(void,png_set_gray_1_2_4_to_8) PNGARG((png_structp png_ptr));
 75.1619 +#endif
 75.1620 +#endif
 75.1621 +
 75.1622 +#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED)
 75.1623 +/* Use blue, green, red order for pixels. */
 75.1624 +extern PNG_EXPORT(void,png_set_bgr) PNGARG((png_structp png_ptr));
 75.1625 +#endif
 75.1626 +
 75.1627 +#if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED)
 75.1628 +/* Expand the grayscale to 24-bit RGB if necessary. */
 75.1629 +extern PNG_EXPORT(void,png_set_gray_to_rgb) PNGARG((png_structp png_ptr));
 75.1630 +#endif
 75.1631 +
 75.1632 +#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED)
 75.1633 +/* Reduce RGB to grayscale. */
 75.1634 +#ifdef PNG_FLOATING_POINT_SUPPORTED
 75.1635 +extern PNG_EXPORT(void,png_set_rgb_to_gray) PNGARG((png_structp png_ptr,
 75.1636 +   int error_action, double red, double green ));
 75.1637 +#endif
 75.1638 +extern PNG_EXPORT(void,png_set_rgb_to_gray_fixed) PNGARG((png_structp png_ptr,
 75.1639 +   int error_action, png_fixed_point red, png_fixed_point green ));
 75.1640 +extern PNG_EXPORT(png_byte,png_get_rgb_to_gray_status) PNGARG((png_structp
 75.1641 +   png_ptr));
 75.1642 +#endif
 75.1643 +
 75.1644 +extern PNG_EXPORT(void,png_build_grayscale_palette) PNGARG((int bit_depth,
 75.1645 +   png_colorp palette));
 75.1646 +
 75.1647 +#if defined(PNG_READ_STRIP_ALPHA_SUPPORTED)
 75.1648 +extern PNG_EXPORT(void,png_set_strip_alpha) PNGARG((png_structp png_ptr));
 75.1649 +#endif
 75.1650 +
 75.1651 +#if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) || \
 75.1652 +    defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED)
 75.1653 +extern PNG_EXPORT(void,png_set_swap_alpha) PNGARG((png_structp png_ptr));
 75.1654 +#endif
 75.1655 +
 75.1656 +#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) || \
 75.1657 +    defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED)
 75.1658 +extern PNG_EXPORT(void,png_set_invert_alpha) PNGARG((png_structp png_ptr));
 75.1659 +#endif
 75.1660 +
 75.1661 +#if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED)
 75.1662 +/* Add a filler byte to 8-bit Gray or 24-bit RGB images. */
 75.1663 +extern PNG_EXPORT(void,png_set_filler) PNGARG((png_structp png_ptr,
 75.1664 +   png_uint_32 filler, int flags));
 75.1665 +/* The values of the PNG_FILLER_ defines should NOT be changed */
 75.1666 +#define PNG_FILLER_BEFORE 0
 75.1667 +#define PNG_FILLER_AFTER 1
 75.1668 +/* Add an alpha byte to 8-bit Gray or 24-bit RGB images. */
 75.1669 +#if !defined(PNG_1_0_X)
 75.1670 +extern PNG_EXPORT(void,png_set_add_alpha) PNGARG((png_structp png_ptr,
 75.1671 +   png_uint_32 filler, int flags));
 75.1672 +#endif
 75.1673 +#endif /* PNG_READ_FILLER_SUPPORTED || PNG_WRITE_FILLER_SUPPORTED */
 75.1674 +
 75.1675 +#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED)
 75.1676 +/* Swap bytes in 16-bit depth files. */
 75.1677 +extern PNG_EXPORT(void,png_set_swap) PNGARG((png_structp png_ptr));
 75.1678 +#endif
 75.1679 +
 75.1680 +#if defined(PNG_READ_PACK_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED)
 75.1681 +/* Use 1 byte per pixel in 1, 2, or 4-bit depth files. */
 75.1682 +extern PNG_EXPORT(void,png_set_packing) PNGARG((png_structp png_ptr));
 75.1683 +#endif
 75.1684 +
 75.1685 +#if defined(PNG_READ_PACKSWAP_SUPPORTED) || defined(PNG_WRITE_PACKSWAP_SUPPORTED)
 75.1686 +/* Swap packing order of pixels in bytes. */
 75.1687 +extern PNG_EXPORT(void,png_set_packswap) PNGARG((png_structp png_ptr));
 75.1688 +#endif
 75.1689 +
 75.1690 +#if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED)
 75.1691 +/* Converts files to legal bit depths. */
 75.1692 +extern PNG_EXPORT(void,png_set_shift) PNGARG((png_structp png_ptr,
 75.1693 +   png_color_8p true_bits));
 75.1694 +#endif
 75.1695 +
 75.1696 +#if defined(PNG_READ_INTERLACING_SUPPORTED) || \
 75.1697 +    defined(PNG_WRITE_INTERLACING_SUPPORTED)
 75.1698 +/* Have the code handle the interlacing.  Returns the number of passes. */
 75.1699 +extern PNG_EXPORT(int,png_set_interlace_handling) PNGARG((png_structp png_ptr));
 75.1700 +#endif
 75.1701 +
 75.1702 +#if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED)
 75.1703 +/* Invert monochrome files */
 75.1704 +extern PNG_EXPORT(void,png_set_invert_mono) PNGARG((png_structp png_ptr));
 75.1705 +#endif
 75.1706 +
 75.1707 +#if defined(PNG_READ_BACKGROUND_SUPPORTED)
 75.1708 +/* Handle alpha and tRNS by replacing with a background color. */
 75.1709 +#ifdef PNG_FLOATING_POINT_SUPPORTED
 75.1710 +extern PNG_EXPORT(void,png_set_background) PNGARG((png_structp png_ptr,
 75.1711 +   png_color_16p background_color, int background_gamma_code,
 75.1712 +   int need_expand, double background_gamma));
 75.1713 +#endif
 75.1714 +#define PNG_BACKGROUND_GAMMA_UNKNOWN 0
 75.1715 +#define PNG_BACKGROUND_GAMMA_SCREEN  1
 75.1716 +#define PNG_BACKGROUND_GAMMA_FILE    2
 75.1717 +#define PNG_BACKGROUND_GAMMA_UNIQUE  3
 75.1718 +#endif
 75.1719 +
 75.1720 +#if defined(PNG_READ_16_TO_8_SUPPORTED)
 75.1721 +/* strip the second byte of information from a 16-bit depth file. */
 75.1722 +extern PNG_EXPORT(void,png_set_strip_16) PNGARG((png_structp png_ptr));
 75.1723 +#endif
 75.1724 +
 75.1725 +#if defined(PNG_READ_DITHER_SUPPORTED)
 75.1726 +/* Turn on dithering, and reduce the palette to the number of colors available. */
 75.1727 +extern PNG_EXPORT(void,png_set_dither) PNGARG((png_structp png_ptr,
 75.1728 +   png_colorp palette, int num_palette, int maximum_colors,
 75.1729 +   png_uint_16p histogram, int full_dither));
 75.1730 +#endif
 75.1731 +
 75.1732 +#if defined(PNG_READ_GAMMA_SUPPORTED)
 75.1733 +/* Handle gamma correction. Screen_gamma=(display_exponent) */
 75.1734 +#ifdef PNG_FLOATING_POINT_SUPPORTED
 75.1735 +extern PNG_EXPORT(void,png_set_gamma) PNGARG((png_structp png_ptr,
 75.1736 +   double screen_gamma, double default_file_gamma));
 75.1737 +#endif
 75.1738 +#endif
 75.1739 +
 75.1740 +#if defined(PNG_1_0_X) || defined (PNG_1_2_X)
 75.1741 +#if defined(PNG_READ_EMPTY_PLTE_SUPPORTED) || \
 75.1742 +    defined(PNG_WRITE_EMPTY_PLTE_SUPPORTED)
 75.1743 +/* Permit or disallow empty PLTE (0: not permitted, 1: permitted) */
 75.1744 +/* Deprecated and will be removed.  Use png_permit_mng_features() instead. */
 75.1745 +extern PNG_EXPORT(void,png_permit_empty_plte) PNGARG((png_structp png_ptr,
 75.1746 +   int empty_plte_permitted));
 75.1747 +#endif
 75.1748 +#endif
 75.1749 +
 75.1750 +#if defined(PNG_WRITE_FLUSH_SUPPORTED)
 75.1751 +/* Set how many lines between output flushes - 0 for no flushing */
 75.1752 +extern PNG_EXPORT(void,png_set_flush) PNGARG((png_structp png_ptr, int nrows));
 75.1753 +/* Flush the current PNG output buffer */
 75.1754 +extern PNG_EXPORT(void,png_write_flush) PNGARG((png_structp png_ptr));
 75.1755 +#endif
 75.1756 +
 75.1757 +/* optional update palette with requested transformations */
 75.1758 +extern PNG_EXPORT(void,png_start_read_image) PNGARG((png_structp png_ptr));
 75.1759 +
 75.1760 +/* optional call to update the users info structure */
 75.1761 +extern PNG_EXPORT(void,png_read_update_info) PNGARG((png_structp png_ptr,
 75.1762 +   png_infop info_ptr));
 75.1763 +
 75.1764 +#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED
 75.1765 +/* read one or more rows of image data. */
 75.1766 +extern PNG_EXPORT(void,png_read_rows) PNGARG((png_structp png_ptr,
 75.1767 +   png_bytepp row, png_bytepp display_row, png_uint_32 num_rows));
 75.1768 +#endif
 75.1769 +
 75.1770 +#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED
 75.1771 +/* read a row of data. */
 75.1772 +extern PNG_EXPORT(void,png_read_row) PNGARG((png_structp png_ptr,
 75.1773 +   png_bytep row,
 75.1774 +   png_bytep display_row));
 75.1775 +#endif
 75.1776 +
 75.1777 +#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED
 75.1778 +/* read the whole image into memory at once. */
 75.1779 +extern PNG_EXPORT(void,png_read_image) PNGARG((png_structp png_ptr,
 75.1780 +   png_bytepp image));
 75.1781 +#endif
 75.1782 +
 75.1783 +/* write a row of image data */
 75.1784 +extern PNG_EXPORT(void,png_write_row) PNGARG((png_structp png_ptr,
 75.1785 +   png_bytep row));
 75.1786 +
 75.1787 +/* write a few rows of image data */
 75.1788 +extern PNG_EXPORT(void,png_write_rows) PNGARG((png_structp png_ptr,
 75.1789 +   png_bytepp row, png_uint_32 num_rows));
 75.1790 +
 75.1791 +/* write the image data */
 75.1792 +extern PNG_EXPORT(void,png_write_image) PNGARG((png_structp png_ptr,
 75.1793 +   png_bytepp image));
 75.1794 +
 75.1795 +/* writes the end of the PNG file. */
 75.1796 +extern PNG_EXPORT(void,png_write_end) PNGARG((png_structp png_ptr,
 75.1797 +   png_infop info_ptr));
 75.1798 +
 75.1799 +#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED
 75.1800 +/* read the end of the PNG file. */
 75.1801 +extern PNG_EXPORT(void,png_read_end) PNGARG((png_structp png_ptr,
 75.1802 +   png_infop info_ptr));
 75.1803 +#endif
 75.1804 +
 75.1805 +/* free any memory associated with the png_info_struct */
 75.1806 +extern PNG_EXPORT(void,png_destroy_info_struct) PNGARG((png_structp png_ptr,
 75.1807 +   png_infopp info_ptr_ptr));
 75.1808 +
 75.1809 +/* free any memory associated with the png_struct and the png_info_structs */
 75.1810 +extern PNG_EXPORT(void,png_destroy_read_struct) PNGARG((png_structpp
 75.1811 +   png_ptr_ptr, png_infopp info_ptr_ptr, png_infopp end_info_ptr_ptr));
 75.1812 +
 75.1813 +/* free all memory used by the read (old method - NOT DLL EXPORTED) */
 75.1814 +extern void png_read_destroy PNGARG((png_structp png_ptr, png_infop info_ptr,
 75.1815 +   png_infop end_info_ptr));
 75.1816 +
 75.1817 +/* free any memory associated with the png_struct and the png_info_structs */
 75.1818 +extern PNG_EXPORT(void,png_destroy_write_struct)
 75.1819 +   PNGARG((png_structpp png_ptr_ptr, png_infopp info_ptr_ptr));
 75.1820 +
 75.1821 +/* free any memory used in png_ptr struct (old method - NOT DLL EXPORTED) */
 75.1822 +extern void png_write_destroy PNGARG((png_structp png_ptr));
 75.1823 +
 75.1824 +/* set the libpng method of handling chunk CRC errors */
 75.1825 +extern PNG_EXPORT(void,png_set_crc_action) PNGARG((png_structp png_ptr,
 75.1826 +   int crit_action, int ancil_action));
 75.1827 +
 75.1828 +/* Values for png_set_crc_action() to say how to handle CRC errors in
 75.1829 + * ancillary and critical chunks, and whether to use the data contained
 75.1830 + * therein.  Note that it is impossible to "discard" data in a critical
 75.1831 + * chunk.  For versions prior to 0.90, the action was always error/quit,
 75.1832 + * whereas in version 0.90 and later, the action for CRC errors in ancillary
 75.1833 + * chunks is warn/discard.  These values should NOT be changed.
 75.1834 + *
 75.1835 + *      value                       action:critical     action:ancillary
 75.1836 + */
 75.1837 +#define PNG_CRC_DEFAULT       0  /* error/quit          warn/discard data */
 75.1838 +#define PNG_CRC_ERROR_QUIT    1  /* error/quit          error/quit        */
 75.1839 +#define PNG_CRC_WARN_DISCARD  2  /* (INVALID)           warn/discard data */
 75.1840 +#define PNG_CRC_WARN_USE      3  /* warn/use data       warn/use data     */
 75.1841 +#define PNG_CRC_QUIET_USE     4  /* quiet/use data      quiet/use data    */
 75.1842 +#define PNG_CRC_NO_CHANGE     5  /* use current value   use current value */
 75.1843 +
 75.1844 +/* These functions give the user control over the scan-line filtering in
 75.1845 + * libpng and the compression methods used by zlib.  These functions are
 75.1846 + * mainly useful for testing, as the defaults should work with most users.
 75.1847 + * Those users who are tight on memory or want faster performance at the
 75.1848 + * expense of compression can modify them.  See the compression library
 75.1849 + * header file (zlib.h) for an explination of the compression functions.
 75.1850 + */
 75.1851 +
 75.1852 +/* set the filtering method(s) used by libpng.  Currently, the only valid
 75.1853 + * value for "method" is 0.
 75.1854 + */
 75.1855 +extern PNG_EXPORT(void,png_set_filter) PNGARG((png_structp png_ptr, int method,
 75.1856 +   int filters));
 75.1857 +
 75.1858 +/* Flags for png_set_filter() to say which filters to use.  The flags
 75.1859 + * are chosen so that they don't conflict with real filter types
 75.1860 + * below, in case they are supplied instead of the #defined constants.
 75.1861 + * These values should NOT be changed.
 75.1862 + */
 75.1863 +#define PNG_NO_FILTERS     0x00
 75.1864 +#define PNG_FILTER_NONE    0x08
 75.1865 +#define PNG_FILTER_SUB     0x10
 75.1866 +#define PNG_FILTER_UP      0x20
 75.1867 +#define PNG_FILTER_AVG     0x40
 75.1868 +#define PNG_FILTER_PAETH   0x80
 75.1869 +#define PNG_ALL_FILTERS (PNG_FILTER_NONE | PNG_FILTER_SUB | PNG_FILTER_UP | \
 75.1870 +                         PNG_FILTER_AVG | PNG_FILTER_PAETH)
 75.1871 +
 75.1872 +/* Filter values (not flags) - used in pngwrite.c, pngwutil.c for now.
 75.1873 + * These defines should NOT be changed.
 75.1874 + */
 75.1875 +#define PNG_FILTER_VALUE_NONE  0
 75.1876 +#define PNG_FILTER_VALUE_SUB   1
 75.1877 +#define PNG_FILTER_VALUE_UP    2
 75.1878 +#define PNG_FILTER_VALUE_AVG   3
 75.1879 +#define PNG_FILTER_VALUE_PAETH 4
 75.1880 +#define PNG_FILTER_VALUE_LAST  5
 75.1881 +
 75.1882 +#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) /* EXPERIMENTAL */
 75.1883 +/* The "heuristic_method" is given by one of the PNG_FILTER_HEURISTIC_
 75.1884 + * defines, either the default (minimum-sum-of-absolute-differences), or
 75.1885 + * the experimental method (weighted-minimum-sum-of-absolute-differences).
 75.1886 + *
 75.1887 + * Weights are factors >= 1.0, indicating how important it is to keep the
 75.1888 + * filter type consistent between rows.  Larger numbers mean the current
 75.1889 + * filter is that many times as likely to be the same as the "num_weights"
 75.1890 + * previous filters.  This is cumulative for each previous row with a weight.
 75.1891 + * There needs to be "num_weights" values in "filter_weights", or it can be
 75.1892 + * NULL if the weights aren't being specified.  Weights have no influence on
 75.1893 + * the selection of the first row filter.  Well chosen weights can (in theory)
 75.1894 + * improve the compression for a given image.
 75.1895 + *
 75.1896 + * Costs are factors >= 1.0 indicating the relative decoding costs of a
 75.1897 + * filter type.  Higher costs indicate more decoding expense, and are
 75.1898 + * therefore less likely to be selected over a filter with lower computational
 75.1899 + * costs.  There needs to be a value in "filter_costs" for each valid filter
 75.1900 + * type (given by PNG_FILTER_VALUE_LAST), or it can be NULL if you aren't
 75.1901 + * setting the costs.  Costs try to improve the speed of decompression without
 75.1902 + * unduly increasing the compressed image size.
 75.1903 + *
 75.1904 + * A negative weight or cost indicates the default value is to be used, and
 75.1905 + * values in the range [0.0, 1.0) indicate the value is to remain unchanged.
 75.1906 + * The default values for both weights and costs are currently 1.0, but may
 75.1907 + * change if good general weighting/cost heuristics can be found.  If both
 75.1908 + * the weights and costs are set to 1.0, this degenerates the WEIGHTED method
 75.1909 + * to the UNWEIGHTED method, but with added encoding time/computation.
 75.1910 + */
 75.1911 +#ifdef PNG_FLOATING_POINT_SUPPORTED
 75.1912 +extern PNG_EXPORT(void,png_set_filter_heuristics) PNGARG((png_structp png_ptr,
 75.1913 +   int heuristic_method, int num_weights, png_doublep filter_weights,
 75.1914 +   png_doublep filter_costs));
 75.1915 +#endif
 75.1916 +#endif /*  PNG_WRITE_WEIGHTED_FILTER_SUPPORTED */
 75.1917 +
 75.1918 +/* Heuristic used for row filter selection.  These defines should NOT be
 75.1919 + * changed.
 75.1920 + */
 75.1921 +#define PNG_FILTER_HEURISTIC_DEFAULT    0  /* Currently "UNWEIGHTED" */
 75.1922 +#define PNG_FILTER_HEURISTIC_UNWEIGHTED 1  /* Used by libpng < 0.95 */
 75.1923 +#define PNG_FILTER_HEURISTIC_WEIGHTED   2  /* Experimental feature */
 75.1924 +#define PNG_FILTER_HEURISTIC_LAST       3  /* Not a valid value */
 75.1925 +
 75.1926 +/* Set the library compression level.  Currently, valid values range from
 75.1927 + * 0 - 9, corresponding directly to the zlib compression levels 0 - 9
 75.1928 + * (0 - no compression, 9 - "maximal" compression).  Note that tests have
 75.1929 + * shown that zlib compression levels 3-6 usually perform as well as level 9
 75.1930 + * for PNG images, and do considerably fewer caclulations.  In the future,
 75.1931 + * these values may not correspond directly to the zlib compression levels.
 75.1932 + */
 75.1933 +extern PNG_EXPORT(void,png_set_compression_level) PNGARG((png_structp png_ptr,
 75.1934 +   int level));
 75.1935 +
 75.1936 +extern PNG_EXPORT(void,png_set_compression_mem_level)
 75.1937 +   PNGARG((png_structp png_ptr, int mem_level));
 75.1938 +
 75.1939 +extern PNG_EXPORT(void,png_set_compression_strategy)
 75.1940 +   PNGARG((png_structp png_ptr, int strategy));
 75.1941 +
 75.1942 +extern PNG_EXPORT(void,png_set_compression_window_bits)
 75.1943 +   PNGARG((png_structp png_ptr, int window_bits));
 75.1944 +
 75.1945 +extern PNG_EXPORT(void,png_set_compression_method) PNGARG((png_structp png_ptr,
 75.1946 +   int method));
 75.1947 +
 75.1948 +/* These next functions are called for input/output, memory, and error
 75.1949 + * handling.  They are in the file pngrio.c, pngwio.c, and pngerror.c,
 75.1950 + * and call standard C I/O routines such as fread(), fwrite(), and
 75.1951 + * fprintf().  These functions can be made to use other I/O routines
 75.1952 + * at run time for those applications that need to handle I/O in a
 75.1953 + * different manner by calling png_set_???_fn().  See libpng.txt for
 75.1954 + * more information.
 75.1955 + */
 75.1956 +
 75.1957 +#if !defined(PNG_NO_STDIO)
 75.1958 +/* Initialize the input/output for the PNG file to the default functions. */
 75.1959 +extern PNG_EXPORT(void,png_init_io) PNGARG((png_structp png_ptr, png_FILE_p fp));
 75.1960 +#endif
 75.1961 +
 75.1962 +/* Replace the (error and abort), and warning functions with user
 75.1963 + * supplied functions.  If no messages are to be printed you must still
 75.1964 + * write and use replacement functions. The replacement error_fn should
 75.1965 + * still do a longjmp to the last setjmp location if you are using this
 75.1966 + * method of error handling.  If error_fn or warning_fn is NULL, the
 75.1967 + * default function will be used.
 75.1968 + */
 75.1969 +
 75.1970 +extern PNG_EXPORT(void,png_set_error_fn) PNGARG((png_structp png_ptr,
 75.1971 +   png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warning_fn));
 75.1972 +
 75.1973 +/* Return the user pointer associated with the error functions */
 75.1974 +extern PNG_EXPORT(png_voidp,png_get_error_ptr) PNGARG((png_structp png_ptr));
 75.1975 +
 75.1976 +/* Replace the default data output functions with a user supplied one(s).
 75.1977 + * If buffered output is not used, then output_flush_fn can be set to NULL.
 75.1978 + * If PNG_WRITE_FLUSH_SUPPORTED is not defined at libpng compile time
 75.1979 + * output_flush_fn will be ignored (and thus can be NULL).
 75.1980 + */
 75.1981 +extern PNG_EXPORT(void,png_set_write_fn) PNGARG((png_structp png_ptr,
 75.1982 +   png_voidp io_ptr, png_rw_ptr write_data_fn, png_flush_ptr output_flush_fn));
 75.1983 +
 75.1984 +/* Replace the default data input function with a user supplied one. */
 75.1985 +extern PNG_EXPORT(void,png_set_read_fn) PNGARG((png_structp png_ptr,
 75.1986 +   png_voidp io_ptr, png_rw_ptr read_data_fn));
 75.1987 +
 75.1988 +/* Return the user pointer associated with the I/O functions */
 75.1989 +extern PNG_EXPORT(png_voidp,png_get_io_ptr) PNGARG((png_structp png_ptr));
 75.1990 +
 75.1991 +extern PNG_EXPORT(void,png_set_read_status_fn) PNGARG((png_structp png_ptr,
 75.1992 +   png_read_status_ptr read_row_fn));
 75.1993 +
 75.1994 +extern PNG_EXPORT(void,png_set_write_status_fn) PNGARG((png_structp png_ptr,
 75.1995 +   png_write_status_ptr write_row_fn));
 75.1996 +
 75.1997 +#ifdef PNG_USER_MEM_SUPPORTED
 75.1998 +/* Replace the default memory allocation functions with user supplied one(s). */
 75.1999 +extern PNG_EXPORT(void,png_set_mem_fn) PNGARG((png_structp png_ptr,
 75.2000 +   png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn));
 75.2001 +/* Return the user pointer associated with the memory functions */
 75.2002 +extern PNG_EXPORT(png_voidp,png_get_mem_ptr) PNGARG((png_structp png_ptr));
 75.2003 +#endif
 75.2004 +
 75.2005 +#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \
 75.2006 +    defined(PNG_LEGACY_SUPPORTED)
 75.2007 +extern PNG_EXPORT(void,png_set_read_user_transform_fn) PNGARG((png_structp
 75.2008 +   png_ptr, png_user_transform_ptr read_user_transform_fn));
 75.2009 +#endif
 75.2010 +
 75.2011 +#if defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) || \
 75.2012 +    defined(PNG_LEGACY_SUPPORTED)
 75.2013 +extern PNG_EXPORT(void,png_set_write_user_transform_fn) PNGARG((png_structp
 75.2014 +   png_ptr, png_user_transform_ptr write_user_transform_fn));
 75.2015 +#endif
 75.2016 +
 75.2017 +#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \
 75.2018 +    defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) || \
 75.2019 +    defined(PNG_LEGACY_SUPPORTED)
 75.2020 +extern PNG_EXPORT(void,png_set_user_transform_info) PNGARG((png_structp
 75.2021 +   png_ptr, png_voidp user_transform_ptr, int user_transform_depth,
 75.2022 +   int user_transform_channels));
 75.2023 +/* Return the user pointer associated with the user transform functions */
 75.2024 +extern PNG_EXPORT(png_voidp,png_get_user_transform_ptr)
 75.2025 +   PNGARG((png_structp png_ptr));
 75.2026 +#endif
 75.2027 +
 75.2028 +#ifdef PNG_USER_CHUNKS_SUPPORTED
 75.2029 +extern PNG_EXPORT(void,png_set_read_user_chunk_fn) PNGARG((png_structp png_ptr,
 75.2030 +   png_voidp user_chunk_ptr, png_user_chunk_ptr read_user_chunk_fn));
 75.2031 +extern PNG_EXPORT(png_voidp,png_get_user_chunk_ptr) PNGARG((png_structp
 75.2032 +   png_ptr));
 75.2033 +#endif
 75.2034 +
 75.2035 +#ifdef PNG_PROGRESSIVE_READ_SUPPORTED
 75.2036 +/* Sets the function callbacks for the push reader, and a pointer to a
 75.2037 + * user-defined structure available to the callback functions.
 75.2038 + */
 75.2039 +extern PNG_EXPORT(void,png_set_progressive_read_fn) PNGARG((png_structp png_ptr,
 75.2040 +   png_voidp progressive_ptr,
 75.2041 +   png_progressive_info_ptr info_fn, png_progressive_row_ptr row_fn,
 75.2042 +   png_progressive_end_ptr end_fn));
 75.2043 +
 75.2044 +/* returns the user pointer associated with the push read functions */
 75.2045 +extern PNG_EXPORT(png_voidp,png_get_progressive_ptr)
 75.2046 +   PNGARG((png_structp png_ptr));
 75.2047 +
 75.2048 +/* function to be called when data becomes available */
 75.2049 +extern PNG_EXPORT(void,png_process_data) PNGARG((png_structp png_ptr,
 75.2050 +   png_infop info_ptr, png_bytep buffer, png_size_t buffer_size));
 75.2051 +
 75.2052 +/* function that combines rows.  Not very much different than the
 75.2053 + * png_combine_row() call.  Is this even used?????
 75.2054 + */
 75.2055 +extern PNG_EXPORT(void,png_progressive_combine_row) PNGARG((png_structp png_ptr,
 75.2056 +   png_bytep old_row, png_bytep new_row));
 75.2057 +#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */
 75.2058 +
 75.2059 +extern PNG_EXPORT(png_voidp,png_malloc) PNGARG((png_structp png_ptr,
 75.2060 +   png_uint_32 size));
 75.2061 +
 75.2062 +#if defined(PNG_1_0_X)
 75.2063 +#  define png_malloc_warn png_malloc
 75.2064 +#else
 75.2065 +/* Added at libpng version 1.2.4 */
 75.2066 +extern PNG_EXPORT(png_voidp,png_malloc_warn) PNGARG((png_structp png_ptr,
 75.2067 +   png_uint_32 size));
 75.2068 +#endif
 75.2069 +
 75.2070 +/* frees a pointer allocated by png_malloc() */
 75.2071 +extern PNG_EXPORT(void,png_free) PNGARG((png_structp png_ptr, png_voidp ptr));
 75.2072 +
 75.2073 +#if defined(PNG_1_0_X)
 75.2074 +/* Function to allocate memory for zlib. */
 75.2075 +extern PNG_EXPORT(voidpf,png_zalloc) PNGARG((voidpf png_ptr, uInt items,
 75.2076 +   uInt size));
 75.2077 +
 75.2078 +/* Function to free memory for zlib */
 75.2079 +extern PNG_EXPORT(void,png_zfree) PNGARG((voidpf png_ptr, voidpf ptr));
 75.2080 +#endif
 75.2081 +
 75.2082 +/* Free data that was allocated internally */
 75.2083 +extern PNG_EXPORT(void,png_free_data) PNGARG((png_structp png_ptr,
 75.2084 +   png_infop info_ptr, png_uint_32 free_me, int num));
 75.2085 +#ifdef PNG_FREE_ME_SUPPORTED
 75.2086 +/* Reassign responsibility for freeing existing data, whether allocated
 75.2087 + * by libpng or by the application */
 75.2088 +extern PNG_EXPORT(void,png_data_freer) PNGARG((png_structp png_ptr,
 75.2089 +   png_infop info_ptr, int freer, png_uint_32 mask));
 75.2090 +#endif
 75.2091 +/* assignments for png_data_freer */
 75.2092 +#define PNG_DESTROY_WILL_FREE_DATA 1
 75.2093 +#define PNG_SET_WILL_FREE_DATA 1
 75.2094 +#define PNG_USER_WILL_FREE_DATA 2
 75.2095 +/* Flags for png_ptr->free_me and info_ptr->free_me */
 75.2096 +#define PNG_FREE_HIST 0x0008
 75.2097 +#define PNG_FREE_ICCP 0x0010
 75.2098 +#define PNG_FREE_SPLT 0x0020
 75.2099 +#define PNG_FREE_ROWS 0x0040
 75.2100 +#define PNG_FREE_PCAL 0x0080
 75.2101 +#define PNG_FREE_SCAL 0x0100
 75.2102 +#define PNG_FREE_UNKN 0x0200
 75.2103 +#define PNG_FREE_LIST 0x0400
 75.2104 +#define PNG_FREE_PLTE 0x1000
 75.2105 +#define PNG_FREE_TRNS 0x2000
 75.2106 +#define PNG_FREE_TEXT 0x4000
 75.2107 +#define PNG_FREE_ALL  0x7fff
 75.2108 +#define PNG_FREE_MUL  0x4220 /* PNG_FREE_SPLT|PNG_FREE_TEXT|PNG_FREE_UNKN */
 75.2109 +
 75.2110 +#ifdef PNG_USER_MEM_SUPPORTED
 75.2111 +extern PNG_EXPORT(png_voidp,png_malloc_default) PNGARG((png_structp png_ptr,
 75.2112 +   png_uint_32 size));
 75.2113 +extern PNG_EXPORT(void,png_free_default) PNGARG((png_structp png_ptr,
 75.2114 +   png_voidp ptr));
 75.2115 +#endif
 75.2116 +
 75.2117 +extern PNG_EXPORT(png_voidp,png_memcpy_check) PNGARG((png_structp png_ptr,
 75.2118 +   png_voidp s1, png_voidp s2, png_uint_32 size));
 75.2119 +
 75.2120 +extern PNG_EXPORT(png_voidp,png_memset_check) PNGARG((png_structp png_ptr,
 75.2121 +   png_voidp s1, int value, png_uint_32 size));
 75.2122 +
 75.2123 +#if defined(USE_FAR_KEYWORD)  /* memory model conversion function */
 75.2124 +extern void *png_far_to_near PNGARG((png_structp png_ptr,png_voidp ptr,
 75.2125 +   int check));
 75.2126 +#endif /* USE_FAR_KEYWORD */
 75.2127 +
 75.2128 +#ifndef PNG_NO_ERROR_TEXT
 75.2129 +/* Fatal error in PNG image of libpng - can't continue */
 75.2130 +extern PNG_EXPORT(void,png_error) PNGARG((png_structp png_ptr,
 75.2131 +   png_const_charp error_message));
 75.2132 +
 75.2133 +/* The same, but the chunk name is prepended to the error string. */
 75.2134 +extern PNG_EXPORT(void,png_chunk_error) PNGARG((png_structp png_ptr,
 75.2135 +   png_const_charp error_message));
 75.2136 +#else
 75.2137 +/* Fatal error in PNG image of libpng - can't continue */
 75.2138 +extern PNG_EXPORT(void,png_err) PNGARG((png_structp png_ptr));
 75.2139 +#endif
 75.2140 +
 75.2141 +#ifndef PNG_NO_WARNINGS
 75.2142 +/* Non-fatal error in libpng.  Can continue, but may have a problem. */
 75.2143 +extern PNG_EXPORT(void,png_warning) PNGARG((png_structp png_ptr,
 75.2144 +   png_const_charp warning_message));
 75.2145 +
 75.2146 +#ifdef PNG_READ_SUPPORTED
 75.2147 +/* Non-fatal error in libpng, chunk name is prepended to message. */
 75.2148 +extern PNG_EXPORT(void,png_chunk_warning) PNGARG((png_structp png_ptr,
 75.2149 +   png_const_charp warning_message));
 75.2150 +#endif /* PNG_READ_SUPPORTED */
 75.2151 +#endif /* PNG_NO_WARNINGS */
 75.2152 +
 75.2153 +/* The png_set_<chunk> functions are for storing values in the png_info_struct.
 75.2154 + * Similarly, the png_get_<chunk> calls are used to read values from the
 75.2155 + * png_info_struct, either storing the parameters in the passed variables, or
 75.2156 + * setting pointers into the png_info_struct where the data is stored.  The
 75.2157 + * png_get_<chunk> functions return a non-zero value if the data was available
 75.2158 + * in info_ptr, or return zero and do not change any of the parameters if the
 75.2159 + * data was not available.
 75.2160 + *
 75.2161 + * These functions should be used instead of directly accessing png_info
 75.2162 + * to avoid problems with future changes in the size and internal layout of
 75.2163 + * png_info_struct.
 75.2164 + */
 75.2165 +/* Returns "flag" if chunk data is valid in info_ptr. */
 75.2166 +extern PNG_EXPORT(png_uint_32,png_get_valid) PNGARG((png_structp png_ptr,
 75.2167 +png_infop info_ptr, png_uint_32 flag));
 75.2168 +
 75.2169 +/* Returns number of bytes needed to hold a transformed row. */
 75.2170 +extern PNG_EXPORT(png_uint_32,png_get_rowbytes) PNGARG((png_structp png_ptr,
 75.2171 +png_infop info_ptr));
 75.2172 +
 75.2173 +#if defined(PNG_INFO_IMAGE_SUPPORTED)
 75.2174 +/* Returns row_pointers, which is an array of pointers to scanlines that was
 75.2175 +returned from png_read_png(). */
 75.2176 +extern PNG_EXPORT(png_bytepp,png_get_rows) PNGARG((png_structp png_ptr,
 75.2177 +png_infop info_ptr));
 75.2178 +/* Set row_pointers, which is an array of pointers to scanlines for use
 75.2179 +by png_write_png(). */
 75.2180 +extern PNG_EXPORT(void,png_set_rows) PNGARG((png_structp png_ptr,
 75.2181 +   png_infop info_ptr, png_bytepp row_pointers));
 75.2182 +#endif
 75.2183 +
 75.2184 +/* Returns number of color channels in image. */
 75.2185 +extern PNG_EXPORT(png_byte,png_get_channels) PNGARG((png_structp png_ptr,
 75.2186 +png_infop info_ptr));
 75.2187 +
 75.2188 +#ifdef PNG_EASY_ACCESS_SUPPORTED
 75.2189 +/* Returns image width in pixels. */
 75.2190 +extern PNG_EXPORT(png_uint_32, png_get_image_width) PNGARG((png_structp
 75.2191 +png_ptr, png_infop info_ptr));
 75.2192 +
 75.2193 +/* Returns image height in pixels. */
 75.2194 +extern PNG_EXPORT(png_uint_32, png_get_image_height) PNGARG((png_structp
 75.2195 +png_ptr, png_infop info_ptr));
 75.2196 +
 75.2197 +/* Returns image bit_depth. */
 75.2198 +extern PNG_EXPORT(png_byte, png_get_bit_depth) PNGARG((png_structp
 75.2199 +png_ptr, png_infop info_ptr));
 75.2200 +
 75.2201 +/* Returns image color_type. */
 75.2202 +extern PNG_EXPORT(png_byte, png_get_color_type) PNGARG((png_structp
 75.2203 +png_ptr, png_infop info_ptr));
 75.2204 +
 75.2205 +/* Returns image filter_type. */
 75.2206 +extern PNG_EXPORT(png_byte, png_get_filter_type) PNGARG((png_structp
 75.2207 +png_ptr, png_infop info_ptr));
 75.2208 +
 75.2209 +/* Returns image interlace_type. */
 75.2210 +extern PNG_EXPORT(png_byte, png_get_interlace_type) PNGARG((png_structp
 75.2211 +png_ptr, png_infop info_ptr));
 75.2212 +
 75.2213 +/* Returns image compression_type. */
 75.2214 +extern PNG_EXPORT(png_byte, png_get_compression_type) PNGARG((png_structp
 75.2215 +png_ptr, png_infop info_ptr));
 75.2216 +
 75.2217 +/* Returns image resolution in pixels per meter, from pHYs chunk data. */
 75.2218 +extern PNG_EXPORT(png_uint_32, png_get_pixels_per_meter) PNGARG((png_structp
 75.2219 +png_ptr, png_infop info_ptr));
 75.2220 +extern PNG_EXPORT(png_uint_32, png_get_x_pixels_per_meter) PNGARG((png_structp
 75.2221 +png_ptr, png_infop info_ptr));
 75.2222 +extern PNG_EXPORT(png_uint_32, png_get_y_pixels_per_meter) PNGARG((png_structp
 75.2223 +png_ptr, png_infop info_ptr));
 75.2224 +
 75.2225 +/* Returns pixel aspect ratio, computed from pHYs chunk data.  */
 75.2226 +#ifdef PNG_FLOATING_POINT_SUPPORTED
 75.2227 +extern PNG_EXPORT(float, png_get_pixel_aspect_ratio) PNGARG((png_structp
 75.2228 +png_ptr, png_infop info_ptr));
 75.2229 +#endif
 75.2230 +
 75.2231 +/* Returns image x, y offset in pixels or microns, from oFFs chunk data. */
 75.2232 +extern PNG_EXPORT(png_int_32, png_get_x_offset_pixels) PNGARG((png_structp
 75.2233 +png_ptr, png_infop info_ptr));
 75.2234 +extern PNG_EXPORT(png_int_32, png_get_y_offset_pixels) PNGARG((png_structp
 75.2235 +png_ptr, png_infop info_ptr));
 75.2236 +extern PNG_EXPORT(png_int_32, png_get_x_offset_microns) PNGARG((png_structp
 75.2237 +png_ptr, png_infop info_ptr));
 75.2238 +extern PNG_EXPORT(png_int_32, png_get_y_offset_microns) PNGARG((png_structp
 75.2239 +png_ptr, png_infop info_ptr));
 75.2240 +
 75.2241 +#endif /* PNG_EASY_ACCESS_SUPPORTED */
 75.2242 +
 75.2243 +/* Returns pointer to signature string read from PNG header */
 75.2244 +extern PNG_EXPORT(png_bytep,png_get_signature) PNGARG((png_structp png_ptr,
 75.2245 +png_infop info_ptr));
 75.2246 +
 75.2247 +#if defined(PNG_bKGD_SUPPORTED)
 75.2248 +extern PNG_EXPORT(png_uint_32,png_get_bKGD) PNGARG((png_structp png_ptr,
 75.2249 +   png_infop info_ptr, png_color_16p *background));
 75.2250 +#endif
 75.2251 +
 75.2252 +#if defined(PNG_bKGD_SUPPORTED)
 75.2253 +extern PNG_EXPORT(void,png_set_bKGD) PNGARG((png_structp png_ptr,
 75.2254 +   png_infop info_ptr, png_color_16p background));
 75.2255 +#endif
 75.2256 +
 75.2257 +#if defined(PNG_cHRM_SUPPORTED)
 75.2258 +#ifdef PNG_FLOATING_POINT_SUPPORTED
 75.2259 +extern PNG_EXPORT(png_uint_32,png_get_cHRM) PNGARG((png_structp png_ptr,
 75.2260 +   png_infop info_ptr, double *white_x, double *white_y, double *red_x,
 75.2261 +   double *red_y, double *green_x, double *green_y, double *blue_x,
 75.2262 +   double *blue_y));
 75.2263 +#endif
 75.2264 +#ifdef PNG_FIXED_POINT_SUPPORTED
 75.2265 +extern PNG_EXPORT(png_uint_32,png_get_cHRM_fixed) PNGARG((png_structp png_ptr,
 75.2266 +   png_infop info_ptr, png_fixed_point *int_white_x, png_fixed_point
 75.2267 +   *int_white_y, png_fixed_point *int_red_x, png_fixed_point *int_red_y,
 75.2268 +   png_fixed_point *int_green_x, png_fixed_point *int_green_y, png_fixed_point
 75.2269 +   *int_blue_x, png_fixed_point *int_blue_y));
 75.2270 +#endif
 75.2271 +#endif
 75.2272 +
 75.2273 +#if defined(PNG_cHRM_SUPPORTED)
 75.2274 +#ifdef PNG_FLOATING_POINT_SUPPORTED
 75.2275 +extern PNG_EXPORT(void,png_set_cHRM) PNGARG((png_structp png_ptr,
 75.2276 +   png_infop info_ptr, double white_x, double white_y, double red_x,
 75.2277 +   double red_y, double green_x, double green_y, double blue_x, double blue_y));
 75.2278 +#endif
 75.2279 +#ifdef PNG_FIXED_POINT_SUPPORTED
 75.2280 +extern PNG_EXPORT(void,png_set_cHRM_fixed) PNGARG((png_structp png_ptr,
 75.2281 +   png_infop info_ptr, png_fixed_point int_white_x, png_fixed_point int_white_y,
 75.2282 +   png_fixed_point int_red_x, png_fixed_point int_red_y, png_fixed_point
 75.2283 +   int_green_x, png_fixed_point int_green_y, png_fixed_point int_blue_x,
 75.2284 +   png_fixed_point int_blue_y));
 75.2285 +#endif
 75.2286 +#endif
 75.2287 +
 75.2288 +#if defined(PNG_gAMA_SUPPORTED)
 75.2289 +#ifdef PNG_FLOATING_POINT_SUPPORTED
 75.2290 +extern PNG_EXPORT(png_uint_32,png_get_gAMA) PNGARG((png_structp png_ptr,
 75.2291 +   png_infop info_ptr, double *file_gamma));
 75.2292 +#endif
 75.2293 +extern PNG_EXPORT(png_uint_32,png_get_gAMA_fixed) PNGARG((png_structp png_ptr,
 75.2294 +   png_infop info_ptr, png_fixed_point *int_file_gamma));
 75.2295 +#endif
 75.2296 +
 75.2297 +#if defined(PNG_gAMA_SUPPORTED)
 75.2298 +#ifdef PNG_FLOATING_POINT_SUPPORTED
 75.2299 +extern PNG_EXPORT(void,png_set_gAMA) PNGARG((png_structp png_ptr,
 75.2300 +   png_infop info_ptr, double file_gamma));
 75.2301 +#endif
 75.2302 +extern PNG_EXPORT(void,png_set_gAMA_fixed) PNGARG((png_structp png_ptr,
 75.2303 +   png_infop info_ptr, png_fixed_point int_file_gamma));
 75.2304 +#endif
 75.2305 +
 75.2306 +#if defined(PNG_hIST_SUPPORTED)
 75.2307 +extern PNG_EXPORT(png_uint_32,png_get_hIST) PNGARG((png_structp png_ptr,
 75.2308 +   png_infop info_ptr, png_uint_16p *hist));
 75.2309 +#endif
 75.2310 +
 75.2311 +#if defined(PNG_hIST_SUPPORTED)
 75.2312 +extern PNG_EXPORT(void,png_set_hIST) PNGARG((png_structp png_ptr,
 75.2313 +   png_infop info_ptr, png_uint_16p hist));
 75.2314 +#endif
 75.2315 +
 75.2316 +extern PNG_EXPORT(png_uint_32,png_get_IHDR) PNGARG((png_structp png_ptr,
 75.2317 +   png_infop info_ptr, png_uint_32 *width, png_uint_32 *height,
 75.2318 +   int *bit_depth, int *color_type, int *interlace_method,
 75.2319 +   int *compression_method, int *filter_method));
 75.2320 +
 75.2321 +extern PNG_EXPORT(void,png_set_IHDR) PNGARG((png_structp png_ptr,
 75.2322 +   png_infop info_ptr, png_uint_32 width, png_uint_32 height, int bit_depth,
 75.2323 +   int color_type, int interlace_method, int compression_method,
 75.2324 +   int filter_method));
 75.2325 +
 75.2326 +#if defined(PNG_oFFs_SUPPORTED)
 75.2327 +extern PNG_EXPORT(png_uint_32,png_get_oFFs) PNGARG((png_structp png_ptr,
 75.2328 +   png_infop info_ptr, png_int_32 *offset_x, png_int_32 *offset_y,
 75.2329 +   int *unit_type));
 75.2330 +#endif
 75.2331 +
 75.2332 +#if defined(PNG_oFFs_SUPPORTED)
 75.2333 +extern PNG_EXPORT(void,png_set_oFFs) PNGARG((png_structp png_ptr,
 75.2334 +   png_infop info_ptr, png_int_32 offset_x, png_int_32 offset_y,
 75.2335 +   int unit_type));
 75.2336 +#endif
 75.2337 +
 75.2338 +#if defined(PNG_pCAL_SUPPORTED)
 75.2339 +extern PNG_EXPORT(png_uint_32,png_get_pCAL) PNGARG((png_structp png_ptr,
 75.2340 +   png_infop info_ptr, png_charp *purpose, png_int_32 *X0, png_int_32 *X1,
 75.2341 +   int *type, int *nparams, png_charp *units, png_charpp *params));
 75.2342 +#endif
 75.2343 +
 75.2344 +#if defined(PNG_pCAL_SUPPORTED)
 75.2345 +extern PNG_EXPORT(void,png_set_pCAL) PNGARG((png_structp png_ptr,
 75.2346 +   png_infop info_ptr, png_charp purpose, png_int_32 X0, png_int_32 X1,
 75.2347 +   int type, int nparams, png_charp units, png_charpp params));
 75.2348 +#endif
 75.2349 +
 75.2350 +#if defined(PNG_pHYs_SUPPORTED)
 75.2351 +extern PNG_EXPORT(png_uint_32,png_get_pHYs) PNGARG((png_structp png_ptr,
 75.2352 +   png_infop info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type));
 75.2353 +#endif
 75.2354 +
 75.2355 +#if defined(PNG_pHYs_SUPPORTED)
 75.2356 +extern PNG_EXPORT(void,png_set_pHYs) PNGARG((png_structp png_ptr,
 75.2357 +   png_infop info_ptr, png_uint_32 res_x, png_uint_32 res_y, int unit_type));
 75.2358 +#endif
 75.2359 +
 75.2360 +extern PNG_EXPORT(png_uint_32,png_get_PLTE) PNGARG((png_structp png_ptr,
 75.2361 +   png_infop info_ptr, png_colorp *palette, int *num_palette));
 75.2362 +
 75.2363 +extern PNG_EXPORT(void,png_set_PLTE) PNGARG((png_structp png_ptr,
 75.2364 +   png_infop info_ptr, png_colorp palette, int num_palette));
 75.2365 +
 75.2366 +#if defined(PNG_sBIT_SUPPORTED)
 75.2367 +extern PNG_EXPORT(png_uint_32,png_get_sBIT) PNGARG((png_structp png_ptr,
 75.2368 +   png_infop info_ptr, png_color_8p *sig_bit));
 75.2369 +#endif
 75.2370 +
 75.2371 +#if defined(PNG_sBIT_SUPPORTED)
 75.2372 +extern PNG_EXPORT(void,png_set_sBIT) PNGARG((png_structp png_ptr,
 75.2373 +   png_infop info_ptr, png_color_8p sig_bit));
 75.2374 +#endif
 75.2375 +
 75.2376 +#if defined(PNG_sRGB_SUPPORTED)
 75.2377 +extern PNG_EXPORT(png_uint_32,png_get_sRGB) PNGARG((png_structp png_ptr,
 75.2378 +   png_infop info_ptr, int *intent));
 75.2379 +#endif
 75.2380 +
 75.2381 +#if defined(PNG_sRGB_SUPPORTED)
 75.2382 +extern PNG_EXPORT(void,png_set_sRGB) PNGARG((png_structp png_ptr,
 75.2383 +   png_infop info_ptr, int intent));
 75.2384 +extern PNG_EXPORT(void,png_set_sRGB_gAMA_and_cHRM) PNGARG((png_structp png_ptr,
 75.2385 +   png_infop info_ptr, int intent));
 75.2386 +#endif
 75.2387 +
 75.2388 +#if defined(PNG_iCCP_SUPPORTED)
 75.2389 +extern PNG_EXPORT(png_uint_32,png_get_iCCP) PNGARG((png_structp png_ptr,
 75.2390 +   png_infop info_ptr, png_charpp name, int *compression_type,
 75.2391 +   png_charpp profile, png_uint_32 *proflen));
 75.2392 +   /* Note to maintainer: profile should be png_bytepp */
 75.2393 +#endif
 75.2394 +
 75.2395 +#if defined(PNG_iCCP_SUPPORTED)
 75.2396 +extern PNG_EXPORT(void,png_set_iCCP) PNGARG((png_structp png_ptr,
 75.2397 +   png_infop info_ptr, png_charp name, int compression_type,
 75.2398 +   png_charp profile, png_uint_32 proflen));
 75.2399 +   /* Note to maintainer: profile should be png_bytep */
 75.2400 +#endif
 75.2401 +
 75.2402 +#if defined(PNG_sPLT_SUPPORTED)
 75.2403 +extern PNG_EXPORT(png_uint_32,png_get_sPLT) PNGARG((png_structp png_ptr,
 75.2404 +   png_infop info_ptr, png_sPLT_tpp entries));
 75.2405 +#endif
 75.2406 +
 75.2407 +#if defined(PNG_sPLT_SUPPORTED)
 75.2408 +extern PNG_EXPORT(void,png_set_sPLT) PNGARG((png_structp png_ptr,
 75.2409 +   png_infop info_ptr, png_sPLT_tp entries, int nentries));
 75.2410 +#endif
 75.2411 +
 75.2412 +#if defined(PNG_TEXT_SUPPORTED)
 75.2413 +/* png_get_text also returns the number of text chunks in *num_text */
 75.2414 +extern PNG_EXPORT(png_uint_32,png_get_text) PNGARG((png_structp png_ptr,
 75.2415 +   png_infop info_ptr, png_textp *text_ptr, int *num_text));
 75.2416 +#endif
 75.2417 +
 75.2418 +/*
 75.2419 + *  Note while png_set_text() will accept a structure whose text,
 75.2420 + *  language, and  translated keywords are NULL pointers, the structure
 75.2421 + *  returned by png_get_text will always contain regular
 75.2422 + *  zero-terminated C strings.  They might be empty strings but
 75.2423 + *  they will never be NULL pointers.
 75.2424 + */
 75.2425 +
 75.2426 +#if defined(PNG_TEXT_SUPPORTED)
 75.2427 +extern PNG_EXPORT(void,png_set_text) PNGARG((png_structp png_ptr,
 75.2428 +   png_infop info_ptr, png_textp text_ptr, int num_text));
 75.2429 +#endif
 75.2430 +
 75.2431 +#if defined(PNG_tIME_SUPPORTED)
 75.2432 +extern PNG_EXPORT(png_uint_32,png_get_tIME) PNGARG((png_structp png_ptr,
 75.2433 +   png_infop info_ptr, png_timep *mod_time));
 75.2434 +#endif
 75.2435 +
 75.2436 +#if defined(PNG_tIME_SUPPORTED)
 75.2437 +extern PNG_EXPORT(void,png_set_tIME) PNGARG((png_structp png_ptr,
 75.2438 +   png_infop info_ptr, png_timep mod_time));
 75.2439 +#endif
 75.2440 +
 75.2441 +#if defined(PNG_tRNS_SUPPORTED)
 75.2442 +extern PNG_EXPORT(png_uint_32,png_get_tRNS) PNGARG((png_structp png_ptr,
 75.2443 +   png_infop info_ptr, png_bytep *trans, int *num_trans,
 75.2444 +   png_color_16p *trans_values));
 75.2445 +#endif
 75.2446 +
 75.2447 +#if defined(PNG_tRNS_SUPPORTED)
 75.2448 +extern PNG_EXPORT(void,png_set_tRNS) PNGARG((png_structp png_ptr,
 75.2449 +   png_infop info_ptr, png_bytep trans, int num_trans,
 75.2450 +   png_color_16p trans_values));
 75.2451 +#endif
 75.2452 +
 75.2453 +#if defined(PNG_tRNS_SUPPORTED)
 75.2454 +#endif
 75.2455 +
 75.2456 +#if defined(PNG_sCAL_SUPPORTED)
 75.2457 +#ifdef PNG_FLOATING_POINT_SUPPORTED
 75.2458 +extern PNG_EXPORT(png_uint_32,png_get_sCAL) PNGARG((png_structp png_ptr,
 75.2459 +   png_infop info_ptr, int *unit, double *width, double *height));
 75.2460 +#else
 75.2461 +#ifdef PNG_FIXED_POINT_SUPPORTED
 75.2462 +extern PNG_EXPORT(png_uint_32,png_get_sCAL_s) PNGARG((png_structp png_ptr,
 75.2463 +   png_infop info_ptr, int *unit, png_charpp swidth, png_charpp sheight));
 75.2464 +#endif
 75.2465 +#endif
 75.2466 +#endif /* PNG_sCAL_SUPPORTED */
 75.2467 +
 75.2468 +#if defined(PNG_sCAL_SUPPORTED)
 75.2469 +#ifdef PNG_FLOATING_POINT_SUPPORTED
 75.2470 +extern PNG_EXPORT(void,png_set_sCAL) PNGARG((png_structp png_ptr,
 75.2471 +   png_infop info_ptr, int unit, double width, double height));
 75.2472 +#else
 75.2473 +#ifdef PNG_FIXED_POINT_SUPPORTED
 75.2474 +extern PNG_EXPORT(void,png_set_sCAL_s) PNGARG((png_structp png_ptr,
 75.2475 +   png_infop info_ptr, int unit, png_charp swidth, png_charp sheight));
 75.2476 +#endif
 75.2477 +#endif
 75.2478 +#endif /* PNG_sCAL_SUPPORTED || PNG_WRITE_sCAL_SUPPORTED */
 75.2479 +
 75.2480 +#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
 75.2481 +/* provide a list of chunks and how they are to be handled, if the built-in
 75.2482 +   handling or default unknown chunk handling is not desired.  Any chunks not
 75.2483 +   listed will be handled in the default manner.  The IHDR and IEND chunks
 75.2484 +   must not be listed.
 75.2485 +      keep = 0: follow default behaviour
 75.2486 +           = 1: do not keep
 75.2487 +           = 2: keep only if safe-to-copy
 75.2488 +           = 3: keep even if unsafe-to-copy
 75.2489 +*/
 75.2490 +extern PNG_EXPORT(void, png_set_keep_unknown_chunks) PNGARG((png_structp
 75.2491 +   png_ptr, int keep, png_bytep chunk_list, int num_chunks));
 75.2492 +extern PNG_EXPORT(void, png_set_unknown_chunks) PNGARG((png_structp png_ptr,
 75.2493 +   png_infop info_ptr, png_unknown_chunkp unknowns, int num_unknowns));
 75.2494 +extern PNG_EXPORT(void, png_set_unknown_chunk_location)
 75.2495 +   PNGARG((png_structp png_ptr, png_infop info_ptr, int chunk, int location));
 75.2496 +extern PNG_EXPORT(png_uint_32,png_get_unknown_chunks) PNGARG((png_structp
 75.2497 +   png_ptr, png_infop info_ptr, png_unknown_chunkpp entries));
 75.2498 +#endif
 75.2499 +#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
 75.2500 +PNG_EXPORT(int,png_handle_as_unknown) PNGARG((png_structp png_ptr, png_bytep
 75.2501 +   chunk_name));
 75.2502 +#endif
 75.2503 +
 75.2504 +/* Png_free_data() will turn off the "valid" flag for anything it frees.
 75.2505 +   If you need to turn it off for a chunk that your application has freed,
 75.2506 +   you can use png_set_invalid(png_ptr, info_ptr, PNG_INFO_CHNK); */
 75.2507 +extern PNG_EXPORT(void, png_set_invalid) PNGARG((png_structp png_ptr,
 75.2508 +   png_infop info_ptr, int mask));
 75.2509 +
 75.2510 +#if defined(PNG_INFO_IMAGE_SUPPORTED)
 75.2511 +/* The "params" pointer is currently not used and is for future expansion. */
 75.2512 +extern PNG_EXPORT(void, png_read_png) PNGARG((png_structp png_ptr,
 75.2513 +                        png_infop info_ptr,
 75.2514 +                        int transforms,
 75.2515 +                        png_voidp params));
 75.2516 +extern PNG_EXPORT(void, png_write_png) PNGARG((png_structp png_ptr,
 75.2517 +                        png_infop info_ptr,
 75.2518 +                        int transforms,
 75.2519 +                        png_voidp params));
 75.2520 +#endif
 75.2521 +
 75.2522 +/* Define PNG_DEBUG at compile time for debugging information.  Higher
 75.2523 + * numbers for PNG_DEBUG mean more debugging information.  This has
 75.2524 + * only been added since version 0.95 so it is not implemented throughout
 75.2525 + * libpng yet, but more support will be added as needed.
 75.2526 + */
 75.2527 +#ifdef PNG_DEBUG
 75.2528 +#if (PNG_DEBUG > 0)
 75.2529 +#if !defined(PNG_DEBUG_FILE) && defined(_MSC_VER)
 75.2530 +#include <crtdbg.h>
 75.2531 +#if (PNG_DEBUG > 1)
 75.2532 +#define png_debug(l,m)  _RPT0(_CRT_WARN,m)
 75.2533 +#define png_debug1(l,m,p1)  _RPT1(_CRT_WARN,m,p1)
 75.2534 +#define png_debug2(l,m,p1,p2) _RPT2(_CRT_WARN,m,p1,p2)
 75.2535 +#endif
 75.2536 +#else /* PNG_DEBUG_FILE || !_MSC_VER */
 75.2537 +#ifndef PNG_DEBUG_FILE
 75.2538 +#define PNG_DEBUG_FILE stderr
 75.2539 +#endif /* PNG_DEBUG_FILE */
 75.2540 +#if (PNG_DEBUG > 1)
 75.2541 +#define png_debug(l,m) \
 75.2542 +{ \
 75.2543 +     int num_tabs=l; \
 75.2544 +     fprintf(PNG_DEBUG_FILE,"%s"m,(num_tabs==1 ? "\t" : \
 75.2545 +       (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":"")))); \
 75.2546 +}
 75.2547 +#define png_debug1(l,m,p1) \
 75.2548 +{ \
 75.2549 +     int num_tabs=l; \
 75.2550 +     fprintf(PNG_DEBUG_FILE,"%s"m,(num_tabs==1 ? "\t" : \
 75.2551 +       (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1); \
 75.2552 +}
 75.2553 +#define png_debug2(l,m,p1,p2) \
 75.2554 +{ \
 75.2555 +     int num_tabs=l; \
 75.2556 +     fprintf(PNG_DEBUG_FILE,"%s"m,(num_tabs==1 ? "\t" : \
 75.2557 +       (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1,p2); \
 75.2558 +}
 75.2559 +#endif /* (PNG_DEBUG > 1) */
 75.2560 +#endif /* _MSC_VER */
 75.2561 +#endif /* (PNG_DEBUG > 0) */
 75.2562 +#endif /* PNG_DEBUG */
 75.2563 +#ifndef png_debug
 75.2564 +#define png_debug(l, m)
 75.2565 +#endif
 75.2566 +#ifndef png_debug1
 75.2567 +#define png_debug1(l, m, p1)
 75.2568 +#endif
 75.2569 +#ifndef png_debug2
 75.2570 +#define png_debug2(l, m, p1, p2)
 75.2571 +#endif
 75.2572 +
 75.2573 +extern PNG_EXPORT(png_charp,png_get_copyright) PNGARG((png_structp png_ptr));
 75.2574 +extern PNG_EXPORT(png_charp,png_get_header_ver) PNGARG((png_structp png_ptr));
 75.2575 +extern PNG_EXPORT(png_charp,png_get_header_version) PNGARG((png_structp png_ptr));
 75.2576 +extern PNG_EXPORT(png_charp,png_get_libpng_ver) PNGARG((png_structp png_ptr));
 75.2577 +
 75.2578 +#ifdef PNG_MNG_FEATURES_SUPPORTED
 75.2579 +extern PNG_EXPORT(png_uint_32,png_permit_mng_features) PNGARG((png_structp
 75.2580 +   png_ptr, png_uint_32 mng_features_permitted));
 75.2581 +#endif
 75.2582 +
 75.2583 +/* For use in png_set_keep_unknown, added to version 1.2.6 */
 75.2584 +#define PNG_HANDLE_CHUNK_AS_DEFAULT   0
 75.2585 +#define PNG_HANDLE_CHUNK_NEVER        1
 75.2586 +#define PNG_HANDLE_CHUNK_IF_SAFE      2
 75.2587 +#define PNG_HANDLE_CHUNK_ALWAYS       3
 75.2588 +
 75.2589 +/* Added to version 1.2.0 */
 75.2590 +#if defined(PNG_ASSEMBLER_CODE_SUPPORTED)
 75.2591 +#if defined(PNG_MMX_CODE_SUPPORTED)
 75.2592 +#define PNG_ASM_FLAG_MMX_SUPPORT_COMPILED  0x01  /* not user-settable */
 75.2593 +#define PNG_ASM_FLAG_MMX_SUPPORT_IN_CPU    0x02  /* not user-settable */
 75.2594 +#define PNG_ASM_FLAG_MMX_READ_COMBINE_ROW  0x04
 75.2595 +#define PNG_ASM_FLAG_MMX_READ_INTERLACE    0x08
 75.2596 +#define PNG_ASM_FLAG_MMX_READ_FILTER_SUB   0x10
 75.2597 +#define PNG_ASM_FLAG_MMX_READ_FILTER_UP    0x20
 75.2598 +#define PNG_ASM_FLAG_MMX_READ_FILTER_AVG   0x40
 75.2599 +#define PNG_ASM_FLAG_MMX_READ_FILTER_PAETH 0x80
 75.2600 +#define PNG_ASM_FLAGS_INITIALIZED          0x80000000  /* not user-settable */
 75.2601 +
 75.2602 +#define PNG_MMX_READ_FLAGS ( PNG_ASM_FLAG_MMX_READ_COMBINE_ROW  \
 75.2603 +                           | PNG_ASM_FLAG_MMX_READ_INTERLACE    \
 75.2604 +                           | PNG_ASM_FLAG_MMX_READ_FILTER_SUB   \
 75.2605 +                           | PNG_ASM_FLAG_MMX_READ_FILTER_UP    \
 75.2606 +                           | PNG_ASM_FLAG_MMX_READ_FILTER_AVG   \
 75.2607 +                           | PNG_ASM_FLAG_MMX_READ_FILTER_PAETH )
 75.2608 +#define PNG_MMX_WRITE_FLAGS ( 0 )
 75.2609 +
 75.2610 +#define PNG_MMX_FLAGS ( PNG_ASM_FLAG_MMX_SUPPORT_COMPILED \
 75.2611 +                      | PNG_ASM_FLAG_MMX_SUPPORT_IN_CPU   \
 75.2612 +                      | PNG_MMX_READ_FLAGS                \
 75.2613 +                      | PNG_MMX_WRITE_FLAGS )
 75.2614 +
 75.2615 +#define PNG_SELECT_READ   1
 75.2616 +#define PNG_SELECT_WRITE  2
 75.2617 +#endif /* PNG_MMX_CODE_SUPPORTED */
 75.2618 +
 75.2619 +#if !defined(PNG_1_0_X)
 75.2620 +/* pngget.c */
 75.2621 +extern PNG_EXPORT(png_uint_32,png_get_mmx_flagmask)
 75.2622 +   PNGARG((int flag_select, int *compilerID));
 75.2623 +
 75.2624 +/* pngget.c */
 75.2625 +extern PNG_EXPORT(png_uint_32,png_get_asm_flagmask)
 75.2626 +   PNGARG((int flag_select));
 75.2627 +
 75.2628 +/* pngget.c */
 75.2629 +extern PNG_EXPORT(png_uint_32,png_get_asm_flags)
 75.2630 +   PNGARG((png_structp png_ptr));
 75.2631 +
 75.2632 +/* pngget.c */
 75.2633 +extern PNG_EXPORT(png_byte,png_get_mmx_bitdepth_threshold)
 75.2634 +   PNGARG((png_structp png_ptr));
 75.2635 +
 75.2636 +/* pngget.c */
 75.2637 +extern PNG_EXPORT(png_uint_32,png_get_mmx_rowbytes_threshold)
 75.2638 +   PNGARG((png_structp png_ptr));
 75.2639 +
 75.2640 +/* pngset.c */
 75.2641 +extern PNG_EXPORT(void,png_set_asm_flags)
 75.2642 +   PNGARG((png_structp png_ptr, png_uint_32 asm_flags));
 75.2643 +
 75.2644 +/* pngset.c */
 75.2645 +extern PNG_EXPORT(void,png_set_mmx_thresholds)
 75.2646 +   PNGARG((png_structp png_ptr, png_byte mmx_bitdepth_threshold,
 75.2647 +   png_uint_32 mmx_rowbytes_threshold));
 75.2648 +
 75.2649 +#endif /* PNG_1_0_X */
 75.2650 +
 75.2651 +#if !defined(PNG_1_0_X)
 75.2652 +/* png.c, pnggccrd.c, or pngvcrd.c */
 75.2653 +extern PNG_EXPORT(int,png_mmx_support) PNGARG((void));
 75.2654 +#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */
 75.2655 +
 75.2656 +/* Strip the prepended error numbers ("#nnn ") from error and warning
 75.2657 + * messages before passing them to the error or warning handler. */
 75.2658 +#ifdef PNG_ERROR_NUMBERS_SUPPORTED
 75.2659 +extern PNG_EXPORT(void,png_set_strip_error_numbers) PNGARG((png_structp
 75.2660 +   png_ptr, png_uint_32 strip_mode));
 75.2661 +#endif
 75.2662 +
 75.2663 +#endif /* PNG_1_0_X */
 75.2664 +
 75.2665 +/* Added at libpng-1.2.6 */
 75.2666 +#ifdef PNG_SET_USER_LIMITS_SUPPORTED
 75.2667 +extern PNG_EXPORT(void,png_set_user_limits) PNGARG((png_structp
 75.2668 +   png_ptr, png_uint_32 user_width_max, png_uint_32 user_height_max));
 75.2669 +extern PNG_EXPORT(png_uint_32,png_get_user_width_max) PNGARG((png_structp
 75.2670 +   png_ptr));
 75.2671 +extern PNG_EXPORT(png_uint_32,png_get_user_height_max) PNGARG((png_structp
 75.2672 +   png_ptr));
 75.2673 +#endif
 75.2674 +
 75.2675 +
 75.2676 +/* Maintainer: Put new public prototypes here ^, in libpng.3, and project defs */
 75.2677 +
 75.2678 +#ifdef PNG_READ_COMPOSITE_NODIV_SUPPORTED
 75.2679 +/* With these routines we avoid an integer divide, which will be slower on
 75.2680 + * most machines.  However, it does take more operations than the corresponding
 75.2681 + * divide method, so it may be slower on a few RISC systems.  There are two
 75.2682 + * shifts (by 8 or 16 bits) and an addition, versus a single integer divide.
 75.2683 + *
 75.2684 + * Note that the rounding factors are NOT supposed to be the same!  128 and
 75.2685 + * 32768 are correct for the NODIV code; 127 and 32767 are correct for the
 75.2686 + * standard method.
 75.2687 + *
 75.2688 + * [Optimized code by Greg Roelofs and Mark Adler...blame us for bugs. :-) ]
 75.2689 + */
 75.2690 +
 75.2691 + /* fg and bg should be in `gamma 1.0' space; alpha is the opacity          */
 75.2692 +
 75.2693 +#  define png_composite(composite, fg, alpha, bg)                            \
 75.2694 +     { png_uint_16 temp = (png_uint_16)((png_uint_16)(fg) * (png_uint_16)(alpha) \
 75.2695 +                        +        (png_uint_16)(bg)*(png_uint_16)(255 -       \
 75.2696 +                        (png_uint_16)(alpha)) + (png_uint_16)128);           \
 75.2697 +       (composite) = (png_byte)((temp + (temp >> 8)) >> 8); }
 75.2698 +
 75.2699 +#  define png_composite_16(composite, fg, alpha, bg)                         \
 75.2700 +     { png_uint_32 temp = (png_uint_32)((png_uint_32)(fg) * (png_uint_32)(alpha) \
 75.2701 +                        + (png_uint_32)(bg)*(png_uint_32)(65535L -           \
 75.2702 +                        (png_uint_32)(alpha)) + (png_uint_32)32768L);        \
 75.2703 +       (composite) = (png_uint_16)((temp + (temp >> 16)) >> 16); }
 75.2704 +
 75.2705 +#else  /* standard method using integer division */
 75.2706 +
 75.2707 +#  define png_composite(composite, fg, alpha, bg)                            \
 75.2708 +     (composite) = (png_byte)(((png_uint_16)(fg) * (png_uint_16)(alpha) +    \
 75.2709 +       (png_uint_16)(bg) * (png_uint_16)(255 - (png_uint_16)(alpha)) +       \
 75.2710 +       (png_uint_16)127) / 255)
 75.2711 +
 75.2712 +#  define png_composite_16(composite, fg, alpha, bg)                         \
 75.2713 +     (composite) = (png_uint_16)(((png_uint_32)(fg) * (png_uint_32)(alpha) + \
 75.2714 +       (png_uint_32)(bg)*(png_uint_32)(65535L - (png_uint_32)(alpha)) +      \
 75.2715 +       (png_uint_32)32767) / (png_uint_32)65535L)
 75.2716 +
 75.2717 +#endif /* PNG_READ_COMPOSITE_NODIV_SUPPORTED */
 75.2718 +
 75.2719 +/* Inline macros to do direct reads of bytes from the input buffer.  These
 75.2720 + * require that you are using an architecture that uses PNG byte ordering
 75.2721 + * (MSB first) and supports unaligned data storage.  I think that PowerPC
 75.2722 + * in big-endian mode and 680x0 are the only ones that will support this.
 75.2723 + * The x86 line of processors definitely do not.  The png_get_int_32()
 75.2724 + * routine also assumes we are using two's complement format for negative
 75.2725 + * values, which is almost certainly true.
 75.2726 + */
 75.2727 +#if defined(PNG_READ_BIG_ENDIAN_SUPPORTED)
 75.2728 +#  define png_get_uint_32(buf) ( *((png_uint_32p) (buf)))
 75.2729 +#  define png_get_uint_16(buf) ( *((png_uint_16p) (buf)))
 75.2730 +#  define png_get_int_32(buf)  ( *((png_int_32p)  (buf)))
 75.2731 +#else
 75.2732 +extern PNG_EXPORT(png_uint_32,png_get_uint_32) PNGARG((png_bytep buf));
 75.2733 +extern PNG_EXPORT(png_uint_16,png_get_uint_16) PNGARG((png_bytep buf));
 75.2734 +extern PNG_EXPORT(png_int_32,png_get_int_32) PNGARG((png_bytep buf));
 75.2735 +#endif /* !PNG_READ_BIG_ENDIAN_SUPPORTED */
 75.2736 +extern PNG_EXPORT(png_uint_32,png_get_uint_31)
 75.2737 +  PNGARG((png_structp png_ptr, png_bytep buf));
 75.2738 +/* No png_get_int_16 -- may be added if there's a real need for it. */
 75.2739 +
 75.2740 +/* Place a 32-bit number into a buffer in PNG byte order (big-endian).
 75.2741 + */
 75.2742 +extern PNG_EXPORT(void,png_save_uint_32)
 75.2743 +   PNGARG((png_bytep buf, png_uint_32 i));
 75.2744 +extern PNG_EXPORT(void,png_save_int_32)
 75.2745 +   PNGARG((png_bytep buf, png_int_32 i));
 75.2746 +
 75.2747 +/* Place a 16-bit number into a buffer in PNG byte order.
 75.2748 + * The parameter is declared unsigned int, not png_uint_16,
 75.2749 + * just to avoid potential problems on pre-ANSI C compilers.
 75.2750 + */
 75.2751 +extern PNG_EXPORT(void,png_save_uint_16)
 75.2752 +   PNGARG((png_bytep buf, unsigned int i));
 75.2753 +/* No png_save_int_16 -- may be added if there's a real need for it. */
 75.2754 +
 75.2755 +/* ************************************************************************* */
 75.2756 +
 75.2757 +/* These next functions are used internally in the code.  They generally
 75.2758 + * shouldn't be used unless you are writing code to add or replace some
 75.2759 + * functionality in libpng.  More information about most functions can
 75.2760 + * be found in the files where the functions are located.
 75.2761 + */
 75.2762 +
 75.2763 +
 75.2764 +/* Various modes of operation, that are visible to applications because
 75.2765 + * they are used for unknown chunk location.
 75.2766 + */
 75.2767 +#define PNG_HAVE_IHDR               0x01
 75.2768 +#define PNG_HAVE_PLTE               0x02
 75.2769 +#define PNG_HAVE_IDAT               0x04
 75.2770 +#define PNG_AFTER_IDAT              0x08 /* Have complete zlib datastream */
 75.2771 +#define PNG_HAVE_IEND               0x10
 75.2772 +
 75.2773 +#if defined(PNG_INTERNAL)
 75.2774 +
 75.2775 +/* More modes of operation.  Note that after an init, mode is set to
 75.2776 + * zero automatically when the structure is created.
 75.2777 + */
 75.2778 +#define PNG_HAVE_gAMA               0x20
 75.2779 +#define PNG_HAVE_cHRM               0x40
 75.2780 +#define PNG_HAVE_sRGB               0x80
 75.2781 +#define PNG_HAVE_CHUNK_HEADER      0x100
 75.2782 +#define PNG_WROTE_tIME             0x200
 75.2783 +#define PNG_WROTE_INFO_BEFORE_PLTE 0x400
 75.2784 +#define PNG_BACKGROUND_IS_GRAY     0x800
 75.2785 +#define PNG_HAVE_PNG_SIGNATURE    0x1000
 75.2786 +#define PNG_HAVE_CHUNK_AFTER_IDAT 0x2000 /* Have another chunk after IDAT */
 75.2787 +
 75.2788 +/* flags for the transformations the PNG library does on the image data */
 75.2789 +#define PNG_BGR                0x0001
 75.2790 +#define PNG_INTERLACE          0x0002
 75.2791 +#define PNG_PACK               0x0004
 75.2792 +#define PNG_SHIFT              0x0008
 75.2793 +#define PNG_SWAP_BYTES         0x0010
 75.2794 +#define PNG_INVERT_MONO        0x0020
 75.2795 +#define PNG_DITHER             0x0040
 75.2796 +#define PNG_BACKGROUND         0x0080
 75.2797 +#define PNG_BACKGROUND_EXPAND  0x0100
 75.2798 +                          /*   0x0200 unused */
 75.2799 +#define PNG_16_TO_8            0x0400
 75.2800 +#define PNG_RGBA               0x0800
 75.2801 +#define PNG_EXPAND             0x1000
 75.2802 +#define PNG_GAMMA              0x2000
 75.2803 +#define PNG_GRAY_TO_RGB        0x4000
 75.2804 +#define PNG_FILLER             0x8000L
 75.2805 +#define PNG_PACKSWAP          0x10000L
 75.2806 +#define PNG_SWAP_ALPHA        0x20000L
 75.2807 +#define PNG_STRIP_ALPHA       0x40000L
 75.2808 +#define PNG_INVERT_ALPHA      0x80000L
 75.2809 +#define PNG_USER_TRANSFORM   0x100000L
 75.2810 +#define PNG_RGB_TO_GRAY_ERR  0x200000L
 75.2811 +#define PNG_RGB_TO_GRAY_WARN 0x400000L
 75.2812 +#define PNG_RGB_TO_GRAY      0x600000L  /* two bits, RGB_TO_GRAY_ERR|WARN */
 75.2813 +                       /*    0x800000L     Unused */
 75.2814 +#define PNG_ADD_ALPHA       0x1000000L  /* Added to libpng-1.2.7 */
 75.2815 +#define PNG_EXPAND_tRNS     0x2000000L  /* Added to libpng-1.2.9 */
 75.2816 +                       /*   0x4000000L  unused */
 75.2817 +                       /*   0x8000000L  unused */
 75.2818 +                       /*  0x10000000L  unused */
 75.2819 +                       /*  0x20000000L  unused */
 75.2820 +                       /*  0x40000000L  unused */
 75.2821 +
 75.2822 +/* flags for png_create_struct */
 75.2823 +#define PNG_STRUCT_PNG   0x0001
 75.2824 +#define PNG_STRUCT_INFO  0x0002
 75.2825 +
 75.2826 +/* Scaling factor for filter heuristic weighting calculations */
 75.2827 +#define PNG_WEIGHT_SHIFT 8
 75.2828 +#define PNG_WEIGHT_FACTOR (1<<(PNG_WEIGHT_SHIFT))
 75.2829 +#define PNG_COST_SHIFT 3
 75.2830 +#define PNG_COST_FACTOR (1<<(PNG_COST_SHIFT))
 75.2831 +
 75.2832 +/* flags for the png_ptr->flags rather than declaring a byte for each one */
 75.2833 +#define PNG_FLAG_ZLIB_CUSTOM_STRATEGY     0x0001
 75.2834 +#define PNG_FLAG_ZLIB_CUSTOM_LEVEL        0x0002
 75.2835 +#define PNG_FLAG_ZLIB_CUSTOM_MEM_LEVEL    0x0004
 75.2836 +#define PNG_FLAG_ZLIB_CUSTOM_WINDOW_BITS  0x0008
 75.2837 +#define PNG_FLAG_ZLIB_CUSTOM_METHOD       0x0010
 75.2838 +#define PNG_FLAG_ZLIB_FINISHED            0x0020
 75.2839 +#define PNG_FLAG_ROW_INIT                 0x0040
 75.2840 +#define PNG_FLAG_FILLER_AFTER             0x0080
 75.2841 +#define PNG_FLAG_CRC_ANCILLARY_USE        0x0100
 75.2842 +#define PNG_FLAG_CRC_ANCILLARY_NOWARN     0x0200
 75.2843 +#define PNG_FLAG_CRC_CRITICAL_USE         0x0400
 75.2844 +#define PNG_FLAG_CRC_CRITICAL_IGNORE      0x0800
 75.2845 +#define PNG_FLAG_FREE_PLTE                0x1000
 75.2846 +#define PNG_FLAG_FREE_TRNS                0x2000
 75.2847 +#define PNG_FLAG_FREE_HIST                0x4000
 75.2848 +#define PNG_FLAG_KEEP_UNKNOWN_CHUNKS      0x8000L
 75.2849 +#define PNG_FLAG_KEEP_UNSAFE_CHUNKS       0x10000L
 75.2850 +#define PNG_FLAG_LIBRARY_MISMATCH         0x20000L
 75.2851 +#define PNG_FLAG_STRIP_ERROR_NUMBERS      0x40000L
 75.2852 +#define PNG_FLAG_STRIP_ERROR_TEXT         0x80000L
 75.2853 +#define PNG_FLAG_MALLOC_NULL_MEM_OK       0x100000L
 75.2854 +#define PNG_FLAG_ADD_ALPHA                0x200000L  /* Added to libpng-1.2.8 */
 75.2855 +#define PNG_FLAG_STRIP_ALPHA              0x400000L  /* Added to libpng-1.2.8 */
 75.2856 +                                  /*      0x800000L  unused */
 75.2857 +                                  /*     0x1000000L  unused */
 75.2858 +                                  /*     0x2000000L  unused */
 75.2859 +                                  /*     0x4000000L  unused */
 75.2860 +                                  /*     0x8000000L  unused */
 75.2861 +                                  /*    0x10000000L  unused */
 75.2862 +                                  /*    0x20000000L  unused */
 75.2863 +                                  /*    0x40000000L  unused */
 75.2864 +
 75.2865 +#define PNG_FLAG_CRC_ANCILLARY_MASK (PNG_FLAG_CRC_ANCILLARY_USE | \
 75.2866 +                                     PNG_FLAG_CRC_ANCILLARY_NOWARN)
 75.2867 +
 75.2868 +#define PNG_FLAG_CRC_CRITICAL_MASK  (PNG_FLAG_CRC_CRITICAL_USE | \
 75.2869 +                                     PNG_FLAG_CRC_CRITICAL_IGNORE)
 75.2870 +
 75.2871 +#define PNG_FLAG_CRC_MASK           (PNG_FLAG_CRC_ANCILLARY_MASK | \
 75.2872 +                                     PNG_FLAG_CRC_CRITICAL_MASK)
 75.2873 +
 75.2874 +/* save typing and make code easier to understand */
 75.2875 +
 75.2876 +#define PNG_COLOR_DIST(c1, c2) (abs((int)((c1).red) - (int)((c2).red)) + \
 75.2877 +   abs((int)((c1).green) - (int)((c2).green)) + \
 75.2878 +   abs((int)((c1).blue) - (int)((c2).blue)))
 75.2879 +
 75.2880 +/* Added to libpng-1.2.6 JB */
 75.2881 +#define PNG_ROWBYTES(pixel_bits, width) \
 75.2882 +    ((pixel_bits) >= 8 ? \
 75.2883 +    ((width) * (((png_uint_32)(pixel_bits)) >> 3)) : \
 75.2884 +    (( ((width) * ((png_uint_32)(pixel_bits))) + 7) >> 3) )
 75.2885 +
 75.2886 +/* PNG_OUT_OF_RANGE returns true if value is outside the range
 75.2887 +   ideal-delta..ideal+delta.  Each argument is evaluated twice.
 75.2888 +   "ideal" and "delta" should be constants, normally simple
 75.2889 +   integers, "value" a variable. Added to libpng-1.2.6 JB */
 75.2890 +#define PNG_OUT_OF_RANGE(value, ideal, delta) \
 75.2891 +        ( (value) < (ideal)-(delta) || (value) > (ideal)+(delta) )
 75.2892 +
 75.2893 +/* variables declared in png.c - only it needs to define PNG_NO_EXTERN */
 75.2894 +#if !defined(PNG_NO_EXTERN) || defined(PNG_ALWAYS_EXTERN)
 75.2895 +/* place to hold the signature string for a PNG file. */
 75.2896 +#ifdef PNG_USE_GLOBAL_ARRAYS
 75.2897 +   PNG_EXPORT_VAR (PNG_CONST png_byte FARDATA) png_sig[8];
 75.2898 +#else
 75.2899 +#endif
 75.2900 +#endif /* PNG_NO_EXTERN */
 75.2901 +
 75.2902 +/* Constant strings for known chunk types.  If you need to add a chunk,
 75.2903 + * define the name here, and add an invocation of the macro in png.c and
 75.2904 + * wherever it's needed.
 75.2905 + */
 75.2906 +#define PNG_IHDR png_byte png_IHDR[5] = { 73,  72,  68,  82, '\0'}
 75.2907 +#define PNG_IDAT png_byte png_IDAT[5] = { 73,  68,  65,  84, '\0'}
 75.2908 +#define PNG_IEND png_byte png_IEND[5] = { 73,  69,  78,  68, '\0'}
 75.2909 +#define PNG_PLTE png_byte png_PLTE[5] = { 80,  76,  84,  69, '\0'}
 75.2910 +#define PNG_bKGD png_byte png_bKGD[5] = { 98,  75,  71,  68, '\0'}
 75.2911 +#define PNG_cHRM png_byte png_cHRM[5] = { 99,  72,  82,  77, '\0'}
 75.2912 +#define PNG_gAMA png_byte png_gAMA[5] = {103,  65,  77,  65, '\0'}
 75.2913 +#define PNG_hIST png_byte png_hIST[5] = {104,  73,  83,  84, '\0'}
 75.2914 +#define PNG_iCCP png_byte png_iCCP[5] = {105,  67,  67,  80, '\0'}
 75.2915 +#define PNG_iTXt png_byte png_iTXt[5] = {105,  84,  88, 116, '\0'}
 75.2916 +#define PNG_oFFs png_byte png_oFFs[5] = {111,  70,  70, 115, '\0'}
 75.2917 +#define PNG_pCAL png_byte png_pCAL[5] = {112,  67,  65,  76, '\0'}
 75.2918 +#define PNG_sCAL png_byte png_sCAL[5] = {115,  67,  65,  76, '\0'}
 75.2919 +#define PNG_pHYs png_byte png_pHYs[5] = {112,  72,  89, 115, '\0'}
 75.2920 +#define PNG_sBIT png_byte png_sBIT[5] = {115,  66,  73,  84, '\0'}
 75.2921 +#define PNG_sPLT png_byte png_sPLT[5] = {115,  80,  76,  84, '\0'}
 75.2922 +#define PNG_sRGB png_byte png_sRGB[5] = {115,  82,  71,  66, '\0'}
 75.2923 +#define PNG_tEXt png_byte png_tEXt[5] = {116,  69,  88, 116, '\0'}
 75.2924 +#define PNG_tIME png_byte png_tIME[5] = {116,  73,  77,  69, '\0'}
 75.2925 +#define PNG_tRNS png_byte png_tRNS[5] = {116,  82,  78,  83, '\0'}
 75.2926 +#define PNG_zTXt png_byte png_zTXt[5] = {122,  84,  88, 116, '\0'}
 75.2927 +
 75.2928 +#ifdef PNG_USE_GLOBAL_ARRAYS
 75.2929 +PNG_EXPORT_VAR (png_byte FARDATA) png_IHDR[5];
 75.2930 +PNG_EXPORT_VAR (png_byte FARDATA) png_IDAT[5];
 75.2931 +PNG_EXPORT_VAR (png_byte FARDATA) png_IEND[5];
 75.2932 +PNG_EXPORT_VAR (png_byte FARDATA) png_PLTE[5];
 75.2933 +PNG_EXPORT_VAR (png_byte FARDATA) png_bKGD[5];
 75.2934 +PNG_EXPORT_VAR (png_byte FARDATA) png_cHRM[5];
 75.2935 +PNG_EXPORT_VAR (png_byte FARDATA) png_gAMA[5];
 75.2936 +PNG_EXPORT_VAR (png_byte FARDATA) png_hIST[5];
 75.2937 +PNG_EXPORT_VAR (png_byte FARDATA) png_iCCP[5];
 75.2938 +PNG_EXPORT_VAR (png_byte FARDATA) png_iTXt[5];
 75.2939 +PNG_EXPORT_VAR (png_byte FARDATA) png_oFFs[5];
 75.2940 +PNG_EXPORT_VAR (png_byte FARDATA) png_pCAL[5];
 75.2941 +PNG_EXPORT_VAR (png_byte FARDATA) png_sCAL[5];
 75.2942 +PNG_EXPORT_VAR (png_byte FARDATA) png_pHYs[5];
 75.2943 +PNG_EXPORT_VAR (png_byte FARDATA) png_sBIT[5];
 75.2944 +PNG_EXPORT_VAR (png_byte FARDATA) png_sPLT[5];
 75.2945 +PNG_EXPORT_VAR (png_byte FARDATA) png_sRGB[5];
 75.2946 +PNG_EXPORT_VAR (png_byte FARDATA) png_tEXt[5];
 75.2947 +PNG_EXPORT_VAR (png_byte FARDATA) png_tIME[5];
 75.2948 +PNG_EXPORT_VAR (png_byte FARDATA) png_tRNS[5];
 75.2949 +PNG_EXPORT_VAR (png_byte FARDATA) png_zTXt[5];
 75.2950 +#endif /* PNG_USE_GLOBAL_ARRAYS */
 75.2951 +
 75.2952 +#if defined(PNG_1_0_X) || defined (PNG_1_2_X)
 75.2953 +/* Initialize png_ptr struct for reading, and allocate any other memory.
 75.2954 + * (old interface - DEPRECATED - use png_create_read_struct instead).
 75.2955 + */
 75.2956 +extern PNG_EXPORT(void,png_read_init) PNGARG((png_structp png_ptr));
 75.2957 +#undef png_read_init
 75.2958 +#define png_read_init(png_ptr) png_read_init_3(&png_ptr, \
 75.2959 +    PNG_LIBPNG_VER_STRING,  png_sizeof(png_struct));
 75.2960 +#endif
 75.2961 +
 75.2962 +extern PNG_EXPORT(void,png_read_init_3) PNGARG((png_structpp ptr_ptr,
 75.2963 +    png_const_charp user_png_ver, png_size_t png_struct_size));
 75.2964 +#if defined(PNG_1_0_X) || defined (PNG_1_2_X)
 75.2965 +extern PNG_EXPORT(void,png_read_init_2) PNGARG((png_structp png_ptr,
 75.2966 +    png_const_charp user_png_ver, png_size_t png_struct_size, png_size_t
 75.2967 +    png_info_size));
 75.2968 +#endif
 75.2969 +
 75.2970 +#if defined(PNG_1_0_X) || defined (PNG_1_2_X)
 75.2971 +/* Initialize png_ptr struct for writing, and allocate any other memory.
 75.2972 + * (old interface - DEPRECATED - use png_create_write_struct instead).
 75.2973 + */
 75.2974 +extern PNG_EXPORT(void,png_write_init) PNGARG((png_structp png_ptr));
 75.2975 +#undef png_write_init
 75.2976 +#define png_write_init(png_ptr) png_write_init_3(&png_ptr, \
 75.2977 +    PNG_LIBPNG_VER_STRING, png_sizeof(png_struct));
 75.2978 +#endif
 75.2979 +
 75.2980 +extern PNG_EXPORT(void,png_write_init_3) PNGARG((png_structpp ptr_ptr,
 75.2981 +    png_const_charp user_png_ver, png_size_t png_struct_size));
 75.2982 +extern PNG_EXPORT(void,png_write_init_2) PNGARG((png_structp png_ptr,
 75.2983 +    png_const_charp user_png_ver, png_size_t png_struct_size, png_size_t
 75.2984 +    png_info_size));
 75.2985 +
 75.2986 +/* Allocate memory for an internal libpng struct */
 75.2987 +PNG_EXTERN png_voidp png_create_struct PNGARG((int type));
 75.2988 +
 75.2989 +/* Free memory from internal libpng struct */
 75.2990 +PNG_EXTERN void png_destroy_struct PNGARG((png_voidp struct_ptr));
 75.2991 +
 75.2992 +PNG_EXTERN png_voidp png_create_struct_2 PNGARG((int type, png_malloc_ptr
 75.2993 +  malloc_fn, png_voidp mem_ptr));
 75.2994 +PNG_EXTERN void png_destroy_struct_2 PNGARG((png_voidp struct_ptr,
 75.2995 +   png_free_ptr free_fn, png_voidp mem_ptr));
 75.2996 +
 75.2997 +/* Free any memory that info_ptr points to and reset struct. */
 75.2998 +PNG_EXTERN void png_info_destroy PNGARG((png_structp png_ptr,
 75.2999 +   png_infop info_ptr));
 75.3000 +
 75.3001 +#ifndef PNG_1_0_X
 75.3002 +/* Function to allocate memory for zlib. */
 75.3003 +PNG_EXTERN voidpf png_zalloc PNGARG((voidpf png_ptr, uInt items, uInt size));
 75.3004 +
 75.3005 +/* Function to free memory for zlib */
 75.3006 +PNG_EXTERN void png_zfree PNGARG((voidpf png_ptr, voidpf ptr));
 75.3007 +
 75.3008 +#ifdef PNG_SIZE_T
 75.3009 +/* Function to convert a sizeof an item to png_sizeof item */
 75.3010 +   PNG_EXTERN png_size_t PNGAPI png_convert_size PNGARG((size_t size));
 75.3011 +#endif
 75.3012 +
 75.3013 +/* Next four functions are used internally as callbacks.  PNGAPI is required
 75.3014 + * but not PNG_EXPORT.  PNGAPI added at libpng version 1.2.3. */
 75.3015 +
 75.3016 +PNG_EXTERN void PNGAPI png_default_read_data PNGARG((png_structp png_ptr,
 75.3017 +   png_bytep data, png_size_t length));
 75.3018 +
 75.3019 +#ifdef PNG_PROGRESSIVE_READ_SUPPORTED
 75.3020 +PNG_EXTERN void PNGAPI png_push_fill_buffer PNGARG((png_structp png_ptr,
 75.3021 +   png_bytep buffer, png_size_t length));
 75.3022 +#endif
 75.3023 +
 75.3024 +PNG_EXTERN void PNGAPI png_default_write_data PNGARG((png_structp png_ptr,
 75.3025 +   png_bytep data, png_size_t length));
 75.3026 +
 75.3027 +#if defined(PNG_WRITE_FLUSH_SUPPORTED)
 75.3028 +#if !defined(PNG_NO_STDIO)
 75.3029 +PNG_EXTERN void PNGAPI png_default_flush PNGARG((png_structp png_ptr));
 75.3030 +#endif
 75.3031 +#endif
 75.3032 +#else /* PNG_1_0_X */
 75.3033 +#ifdef PNG_PROGRESSIVE_READ_SUPPORTED
 75.3034 +PNG_EXTERN void png_push_fill_buffer PNGARG((png_structp png_ptr,
 75.3035 +   png_bytep buffer, png_size_t length));
 75.3036 +#endif
 75.3037 +#endif /* PNG_1_0_X */
 75.3038 +
 75.3039 +/* Reset the CRC variable */
 75.3040 +PNG_EXTERN void png_reset_crc PNGARG((png_structp png_ptr));
 75.3041 +
 75.3042 +/* Write the "data" buffer to whatever output you are using. */
 75.3043 +PNG_EXTERN void png_write_data PNGARG((png_structp png_ptr, png_bytep data,
 75.3044 +   png_size_t length));
 75.3045 +
 75.3046 +/* Read data from whatever input you are using into the "data" buffer */
 75.3047 +PNG_EXTERN void png_read_data PNGARG((png_structp png_ptr, png_bytep data,
 75.3048 +   png_size_t length));
 75.3049 +
 75.3050 +/* Read bytes into buf, and update png_ptr->crc */
 75.3051 +PNG_EXTERN void png_crc_read PNGARG((png_structp png_ptr, png_bytep buf,
 75.3052 +   png_size_t length));
 75.3053 +
 75.3054 +/* Decompress data in a chunk that uses compression */
 75.3055 +#if defined(PNG_zTXt_SUPPORTED) || defined(PNG_iTXt_SUPPORTED) || \
 75.3056 +    defined(PNG_iCCP_SUPPORTED) || defined(PNG_sPLT_SUPPORTED)
 75.3057 +PNG_EXTERN void png_decompress_chunk PNGARG((png_structp png_ptr,
 75.3058 +   int comp_type, png_size_t chunklength,
 75.3059 +   png_size_t prefix_length, png_size_t *data_length));
 75.3060 +#endif
 75.3061 +
 75.3062 +/* Read "skip" bytes, read the file crc, and (optionally) verify png_ptr->crc */
 75.3063 +PNG_EXTERN int png_crc_finish PNGARG((png_structp png_ptr, png_uint_32 skip));
 75.3064 +
 75.3065 +/* Read the CRC from the file and compare it to the libpng calculated CRC */
 75.3066 +PNG_EXTERN int png_crc_error PNGARG((png_structp png_ptr));
 75.3067 +
 75.3068 +/* Calculate the CRC over a section of data.  Note that we are only
 75.3069 + * passing a maximum of 64K on systems that have this as a memory limit,
 75.3070 + * since this is the maximum buffer size we can specify.
 75.3071 + */
 75.3072 +PNG_EXTERN void png_calculate_crc PNGARG((png_structp png_ptr, png_bytep ptr,
 75.3073 +   png_size_t length));
 75.3074 +
 75.3075 +#if defined(PNG_WRITE_FLUSH_SUPPORTED)
 75.3076 +PNG_EXTERN void png_flush PNGARG((png_structp png_ptr));
 75.3077 +#endif
 75.3078 +
 75.3079 +/* simple function to write the signature */
 75.3080 +PNG_EXTERN void png_write_sig PNGARG((png_structp png_ptr));
 75.3081 +
 75.3082 +/* write various chunks */
 75.3083 +
 75.3084 +/* Write the IHDR chunk, and update the png_struct with the necessary
 75.3085 + * information.
 75.3086 + */
 75.3087 +PNG_EXTERN void png_write_IHDR PNGARG((png_structp png_ptr, png_uint_32 width,
 75.3088 +   png_uint_32 height,
 75.3089 +   int bit_depth, int color_type, int compression_method, int filter_method,
 75.3090 +   int interlace_method));
 75.3091 +
 75.3092 +PNG_EXTERN void png_write_PLTE PNGARG((png_structp png_ptr, png_colorp palette,
 75.3093 +   png_uint_32 num_pal));
 75.3094 +
 75.3095 +PNG_EXTERN void png_write_IDAT PNGARG((png_structp png_ptr, png_bytep data,
 75.3096 +   png_size_t length));
 75.3097 +
 75.3098 +PNG_EXTERN void png_write_IEND PNGARG((png_structp png_ptr));
 75.3099 +
 75.3100 +#if defined(PNG_WRITE_gAMA_SUPPORTED)
 75.3101 +#ifdef PNG_FLOATING_POINT_SUPPORTED
 75.3102 +PNG_EXTERN void png_write_gAMA PNGARG((png_structp png_ptr, double file_gamma));
 75.3103 +#endif
 75.3104 +#ifdef PNG_FIXED_POINT_SUPPORTED
 75.3105 +PNG_EXTERN void png_write_gAMA_fixed PNGARG((png_structp png_ptr, png_fixed_point
 75.3106 +    file_gamma));
 75.3107 +#endif
 75.3108 +#endif
 75.3109 +
 75.3110 +#if defined(PNG_WRITE_sBIT_SUPPORTED)
 75.3111 +PNG_EXTERN void png_write_sBIT PNGARG((png_structp png_ptr, png_color_8p sbit,
 75.3112 +   int color_type));
 75.3113 +#endif
 75.3114 +
 75.3115 +#if defined(PNG_WRITE_cHRM_SUPPORTED)
 75.3116 +#ifdef PNG_FLOATING_POINT_SUPPORTED
 75.3117 +PNG_EXTERN void png_write_cHRM PNGARG((png_structp png_ptr,
 75.3118 +   double white_x, double white_y,
 75.3119 +   double red_x, double red_y, double green_x, double green_y,
 75.3120 +   double blue_x, double blue_y));
 75.3121 +#endif
 75.3122 +#ifdef PNG_FIXED_POINT_SUPPORTED
 75.3123 +PNG_EXTERN void png_write_cHRM_fixed PNGARG((png_structp png_ptr,
 75.3124 +   png_fixed_point int_white_x, png_fixed_point int_white_y,
 75.3125 +   png_fixed_point int_red_x, png_fixed_point int_red_y, png_fixed_point
 75.3126 +   int_green_x, png_fixed_point int_green_y, png_fixed_point int_blue_x,
 75.3127 +   png_fixed_point int_blue_y));
 75.3128 +#endif
 75.3129 +#endif
 75.3130 +
 75.3131 +#if defined(PNG_WRITE_sRGB_SUPPORTED)
 75.3132 +PNG_EXTERN void png_write_sRGB PNGARG((png_structp png_ptr,
 75.3133 +   int intent));
 75.3134 +#endif
 75.3135 +
 75.3136 +#if defined(PNG_WRITE_iCCP_SUPPORTED)
 75.3137 +PNG_EXTERN void png_write_iCCP PNGARG((png_structp png_ptr,
 75.3138 +   png_charp name, int compression_type,
 75.3139 +   png_charp profile, int proflen));
 75.3140 +   /* Note to maintainer: profile should be png_bytep */
 75.3141 +#endif
 75.3142 +
 75.3143 +#if defined(PNG_WRITE_sPLT_SUPPORTED)
 75.3144 +PNG_EXTERN void png_write_sPLT PNGARG((png_structp png_ptr,
 75.3145 +   png_sPLT_tp palette));
 75.3146 +#endif
 75.3147 +
 75.3148 +#if defined(PNG_WRITE_tRNS_SUPPORTED)
 75.3149 +PNG_EXTERN void png_write_tRNS PNGARG((png_structp png_ptr, png_bytep trans,
 75.3150 +   png_color_16p values, int number, int color_type));
 75.3151 +#endif
 75.3152 +
 75.3153 +#if defined(PNG_WRITE_bKGD_SUPPORTED)
 75.3154 +PNG_EXTERN void png_write_bKGD PNGARG((png_structp png_ptr,
 75.3155 +   png_color_16p values, int color_type));
 75.3156 +#endif
 75.3157 +
 75.3158 +#if defined(PNG_WRITE_hIST_SUPPORTED)
 75.3159 +PNG_EXTERN void png_write_hIST PNGARG((png_structp png_ptr, png_uint_16p hist,
 75.3160 +   int num_hist));
 75.3161 +#endif
 75.3162 +
 75.3163 +#if defined(PNG_WRITE_TEXT_SUPPORTED) || defined(PNG_WRITE_pCAL_SUPPORTED) || \
 75.3164 +    defined(PNG_WRITE_iCCP_SUPPORTED) || defined(PNG_WRITE_sPLT_SUPPORTED)
 75.3165 +PNG_EXTERN png_size_t png_check_keyword PNGARG((png_structp png_ptr,
 75.3166 +   png_charp key, png_charpp new_key));
 75.3167 +#endif
 75.3168 +
 75.3169 +#if defined(PNG_WRITE_tEXt_SUPPORTED)
 75.3170 +PNG_EXTERN void png_write_tEXt PNGARG((png_structp png_ptr, png_charp key,
 75.3171 +   png_charp text, png_size_t text_len));
 75.3172 +#endif
 75.3173 +
 75.3174 +#if defined(PNG_WRITE_zTXt_SUPPORTED)
 75.3175 +PNG_EXTERN void png_write_zTXt PNGARG((png_structp png_ptr, png_charp key,
 75.3176 +   png_charp text, png_size_t text_len, int compression));
 75.3177 +#endif
 75.3178 +
 75.3179 +#if defined(PNG_WRITE_iTXt_SUPPORTED)
 75.3180 +PNG_EXTERN void png_write_iTXt PNGARG((png_structp png_ptr,
 75.3181 +   int compression, png_charp key, png_charp lang, png_charp lang_key,
 75.3182 +   png_charp text));
 75.3183 +#endif
 75.3184 +
 75.3185 +#if defined(PNG_TEXT_SUPPORTED)  /* Added at version 1.0.14 and 1.2.4 */
 75.3186 +PNG_EXTERN int png_set_text_2 PNGARG((png_structp png_ptr,
 75.3187 +   png_infop info_ptr, png_textp text_ptr, int num_text));
 75.3188 +#endif
 75.3189 +
 75.3190 +#if defined(PNG_WRITE_oFFs_SUPPORTED)
 75.3191 +PNG_EXTERN void png_write_oFFs PNGARG((png_structp png_ptr,
 75.3192 +   png_int_32 x_offset, png_int_32 y_offset, int unit_type));
 75.3193 +#endif
 75.3194 +
 75.3195 +#if defined(PNG_WRITE_pCAL_SUPPORTED)
 75.3196 +PNG_EXTERN void png_write_pCAL PNGARG((png_structp png_ptr, png_charp purpose,
 75.3197 +   png_int_32 X0, png_int_32 X1, int type, int nparams,
 75.3198 +   png_charp units, png_charpp params));
 75.3199 +#endif
 75.3200 +
 75.3201 +#if defined(PNG_WRITE_pHYs_SUPPORTED)
 75.3202 +PNG_EXTERN void png_write_pHYs PNGARG((png_structp png_ptr,
 75.3203 +   png_uint_32 x_pixels_per_unit, png_uint_32 y_pixels_per_unit,
 75.3204 +   int unit_type));
 75.3205 +#endif
 75.3206 +
 75.3207 +#if defined(PNG_WRITE_tIME_SUPPORTED)
 75.3208 +PNG_EXTERN void png_write_tIME PNGARG((png_structp png_ptr,
 75.3209 +   png_timep mod_time));
 75.3210 +#endif
 75.3211 +
 75.3212 +#if defined(PNG_WRITE_sCAL_SUPPORTED)
 75.3213 +#if defined(PNG_FLOATING_POINT_SUPPORTED) && !defined(PNG_NO_STDIO)
 75.3214 +PNG_EXTERN void png_write_sCAL PNGARG((png_structp png_ptr,
 75.3215 +   int unit, double width, double height));
 75.3216 +#else
 75.3217 +#ifdef PNG_FIXED_POINT_SUPPORTED
 75.3218 +PNG_EXTERN void png_write_sCAL_s PNGARG((png_structp png_ptr,
 75.3219 +   int unit, png_charp width, png_charp height));
 75.3220 +#endif
 75.3221 +#endif
 75.3222 +#endif
 75.3223 +
 75.3224 +/* Called when finished processing a row of data */
 75.3225 +PNG_EXTERN void png_write_finish_row PNGARG((png_structp png_ptr));
 75.3226 +
 75.3227 +/* Internal use only.   Called before first row of data */
 75.3228 +PNG_EXTERN void png_write_start_row PNGARG((png_structp png_ptr));
 75.3229 +
 75.3230 +#if defined(PNG_READ_GAMMA_SUPPORTED)
 75.3231 +PNG_EXTERN void png_build_gamma_table PNGARG((png_structp png_ptr));
 75.3232 +#endif
 75.3233 +
 75.3234 +/* combine a row of data, dealing with alpha, etc. if requested */
 75.3235 +PNG_EXTERN void png_combine_row PNGARG((png_structp png_ptr, png_bytep row,
 75.3236 +   int mask));
 75.3237 +
 75.3238 +#if defined(PNG_READ_INTERLACING_SUPPORTED)
 75.3239 +/* expand an interlaced row */
 75.3240 +/* OLD pre-1.0.9 interface:
 75.3241 +PNG_EXTERN void png_do_read_interlace PNGARG((png_row_infop row_info,
 75.3242 +   png_bytep row, int pass, png_uint_32 transformations));
 75.3243 + */
 75.3244 +PNG_EXTERN void png_do_read_interlace PNGARG((png_structp png_ptr));
 75.3245 +#endif
 75.3246 +
 75.3247 +/* GRR TO DO (2.0 or whenever):  simplify other internal calling interfaces */
 75.3248 +
 75.3249 +#if defined(PNG_WRITE_INTERLACING_SUPPORTED)
 75.3250 +/* grab pixels out of a row for an interlaced pass */
 75.3251 +PNG_EXTERN void png_do_write_interlace PNGARG((png_row_infop row_info,
 75.3252 +   png_bytep row, int pass));
 75.3253 +#endif
 75.3254 +
 75.3255 +/* unfilter a row */
 75.3256 +PNG_EXTERN void png_read_filter_row PNGARG((png_structp png_ptr,
 75.3257 +   png_row_infop row_info, png_bytep row, png_bytep prev_row, int filter));
 75.3258 +
 75.3259 +/* Choose the best filter to use and filter the row data */
 75.3260 +PNG_EXTERN void png_write_find_filter PNGARG((png_structp png_ptr,
 75.3261 +   png_row_infop row_info));
 75.3262 +
 75.3263 +/* Write out the filtered row. */
 75.3264 +PNG_EXTERN void png_write_filtered_row PNGARG((png_structp png_ptr,
 75.3265 +   png_bytep filtered_row));
 75.3266 +/* finish a row while reading, dealing with interlacing passes, etc. */
 75.3267 +PNG_EXTERN void png_read_finish_row PNGARG((png_structp png_ptr));
 75.3268 +
 75.3269 +/* initialize the row buffers, etc. */
 75.3270 +PNG_EXTERN void png_read_start_row PNGARG((png_structp png_ptr));
 75.3271 +/* optional call to update the users info structure */
 75.3272 +PNG_EXTERN void png_read_transform_info PNGARG((png_structp png_ptr,
 75.3273 +   png_infop info_ptr));
 75.3274 +
 75.3275 +/* these are the functions that do the transformations */
 75.3276 +#if defined(PNG_READ_FILLER_SUPPORTED)
 75.3277 +PNG_EXTERN void png_do_read_filler PNGARG((png_row_infop row_info,
 75.3278 +   png_bytep row, png_uint_32 filler, png_uint_32 flags));
 75.3279 +#endif
 75.3280 +
 75.3281 +#if defined(PNG_READ_SWAP_ALPHA_SUPPORTED)
 75.3282 +PNG_EXTERN void png_do_read_swap_alpha PNGARG((png_row_infop row_info,
 75.3283 +   png_bytep row));
 75.3284 +#endif
 75.3285 +
 75.3286 +#if defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED)
 75.3287 +PNG_EXTERN void png_do_write_swap_alpha PNGARG((png_row_infop row_info,
 75.3288 +   png_bytep row));
 75.3289 +#endif
 75.3290 +
 75.3291 +#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED)
 75.3292 +PNG_EXTERN void png_do_read_invert_alpha PNGARG((png_row_infop row_info,
 75.3293 +   png_bytep row));
 75.3294 +#endif
 75.3295 +
 75.3296 +#if defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED)
 75.3297 +PNG_EXTERN void png_do_write_invert_alpha PNGARG((png_row_infop row_info,
 75.3298 +   png_bytep row));
 75.3299 +#endif
 75.3300 +
 75.3301 +#if defined(PNG_WRITE_FILLER_SUPPORTED) || \
 75.3302 +    defined(PNG_READ_STRIP_ALPHA_SUPPORTED)
 75.3303 +PNG_EXTERN void png_do_strip_filler PNGARG((png_row_infop row_info,
 75.3304 +   png_bytep row, png_uint_32 flags));
 75.3305 +#endif
 75.3306 +
 75.3307 +#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED)
 75.3308 +PNG_EXTERN void png_do_swap PNGARG((png_row_infop row_info, png_bytep row));
 75.3309 +#endif
 75.3310 +
 75.3311 +#if defined(PNG_READ_PACKSWAP_SUPPORTED) || defined(PNG_WRITE_PACKSWAP_SUPPORTED)
 75.3312 +PNG_EXTERN void png_do_packswap PNGARG((png_row_infop row_info, png_bytep row));
 75.3313 +#endif
 75.3314 +
 75.3315 +#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED)
 75.3316 +PNG_EXTERN int png_do_rgb_to_gray PNGARG((png_structp png_ptr, png_row_infop
 75.3317 +   row_info, png_bytep row));
 75.3318 +#endif
 75.3319 +
 75.3320 +#if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED)
 75.3321 +PNG_EXTERN void png_do_gray_to_rgb PNGARG((png_row_infop row_info,
 75.3322 +   png_bytep row));
 75.3323 +#endif
 75.3324 +
 75.3325 +#if defined(PNG_READ_PACK_SUPPORTED)
 75.3326 +PNG_EXTERN void png_do_unpack PNGARG((png_row_infop row_info, png_bytep row));
 75.3327 +#endif
 75.3328 +
 75.3329 +#if defined(PNG_READ_SHIFT_SUPPORTED)
 75.3330 +PNG_EXTERN void png_do_unshift PNGARG((png_row_infop row_info, png_bytep row,
 75.3331 +   png_color_8p sig_bits));
 75.3332 +#endif
 75.3333 +
 75.3334 +#if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED)
 75.3335 +PNG_EXTERN void png_do_invert PNGARG((png_row_infop row_info, png_bytep row));
 75.3336 +#endif
 75.3337 +
 75.3338 +#if defined(PNG_READ_16_TO_8_SUPPORTED)
 75.3339 +PNG_EXTERN void png_do_chop PNGARG((png_row_infop row_info, png_bytep row));
 75.3340 +#endif
 75.3341 +
 75.3342 +#if defined(PNG_READ_DITHER_SUPPORTED)
 75.3343 +PNG_EXTERN void png_do_dither PNGARG((png_row_infop row_info,
 75.3344 +   png_bytep row, png_bytep palette_lookup, png_bytep dither_lookup));
 75.3345 +
 75.3346 +#  if defined(PNG_CORRECT_PALETTE_SUPPORTED)
 75.3347 +PNG_EXTERN void png_correct_palette PNGARG((png_structp png_ptr,
 75.3348 +   png_colorp palette, int num_palette));
 75.3349 +#  endif
 75.3350 +#endif
 75.3351 +
 75.3352 +#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED)
 75.3353 +PNG_EXTERN void png_do_bgr PNGARG((png_row_infop row_info, png_bytep row));
 75.3354 +#endif
 75.3355 +
 75.3356 +#if defined(PNG_WRITE_PACK_SUPPORTED)
 75.3357 +PNG_EXTERN void png_do_pack PNGARG((png_row_infop row_info,
 75.3358 +   png_bytep row, png_uint_32 bit_depth));
 75.3359 +#endif
 75.3360 +
 75.3361 +#if defined(PNG_WRITE_SHIFT_SUPPORTED)
 75.3362 +PNG_EXTERN void png_do_shift PNGARG((png_row_infop row_info, png_bytep row,
 75.3363 +   png_color_8p bit_depth));
 75.3364 +#endif
 75.3365 +
 75.3366 +#if defined(PNG_READ_BACKGROUND_SUPPORTED)
 75.3367 +#if defined(PNG_READ_GAMMA_SUPPORTED)
 75.3368 +PNG_EXTERN void png_do_background PNGARG((png_row_infop row_info, png_bytep row,
 75.3369 +   png_color_16p trans_values, png_color_16p background,
 75.3370 +   png_color_16p background_1,
 75.3371 +   png_bytep gamma_table, png_bytep gamma_from_1, png_bytep gamma_to_1,
 75.3372 +   png_uint_16pp gamma_16, png_uint_16pp gamma_16_from_1,
 75.3373 +   png_uint_16pp gamma_16_to_1, int gamma_shift));
 75.3374 +#else
 75.3375 +PNG_EXTERN void png_do_background PNGARG((png_row_infop row_info, png_bytep row,
 75.3376 +   png_color_16p trans_values, png_color_16p background));
 75.3377 +#endif
 75.3378 +#endif
 75.3379 +
 75.3380 +#if defined(PNG_READ_GAMMA_SUPPORTED)
 75.3381 +PNG_EXTERN void png_do_gamma PNGARG((png_row_infop row_info, png_bytep row,
 75.3382 +   png_bytep gamma_table, png_uint_16pp gamma_16_table,
 75.3383 +   int gamma_shift));
 75.3384 +#endif
 75.3385 +
 75.3386 +#if defined(PNG_READ_EXPAND_SUPPORTED)
 75.3387 +PNG_EXTERN void png_do_expand_palette PNGARG((png_row_infop row_info,
 75.3388 +   png_bytep row, png_colorp palette, png_bytep trans, int num_trans));
 75.3389 +PNG_EXTERN void png_do_expand PNGARG((png_row_infop row_info,
 75.3390 +   png_bytep row, png_color_16p trans_value));
 75.3391 +#endif
 75.3392 +
 75.3393 +/* The following decodes the appropriate chunks, and does error correction,
 75.3394 + * then calls the appropriate callback for the chunk if it is valid.
 75.3395 + */
 75.3396 +
 75.3397 +/* decode the IHDR chunk */
 75.3398 +PNG_EXTERN void png_handle_IHDR PNGARG((png_structp png_ptr, png_infop info_ptr,
 75.3399 +   png_uint_32 length));
 75.3400 +PNG_EXTERN void png_handle_PLTE PNGARG((png_structp png_ptr, png_infop info_ptr,
 75.3401 +   png_uint_32 length));
 75.3402 +PNG_EXTERN void png_handle_IEND PNGARG((png_structp png_ptr, png_infop info_ptr,
 75.3403 +   png_uint_32 length));
 75.3404 +
 75.3405 +#if defined(PNG_READ_bKGD_SUPPORTED)
 75.3406 +PNG_EXTERN void png_handle_bKGD PNGARG((png_structp png_ptr, png_infop info_ptr,
 75.3407 +   png_uint_32 length));
 75.3408 +#endif
 75.3409 +
 75.3410 +#if defined(PNG_READ_cHRM_SUPPORTED)
 75.3411 +PNG_EXTERN void png_handle_cHRM PNGARG((png_structp png_ptr, png_infop info_ptr,
 75.3412 +   png_uint_32 length));
 75.3413 +#endif
 75.3414 +
 75.3415 +#if defined(PNG_READ_gAMA_SUPPORTED)
 75.3416 +PNG_EXTERN void png_handle_gAMA PNGARG((png_structp png_ptr, png_infop info_ptr,
 75.3417 +   png_uint_32 length));
 75.3418 +#endif
 75.3419 +
 75.3420 +#if defined(PNG_READ_hIST_SUPPORTED)
 75.3421 +PNG_EXTERN void png_handle_hIST PNGARG((png_structp png_ptr, png_infop info_ptr,
 75.3422 +   png_uint_32 length));
 75.3423 +#endif
 75.3424 +
 75.3425 +#if defined(PNG_READ_iCCP_SUPPORTED)
 75.3426 +extern void png_handle_iCCP PNGARG((png_structp png_ptr, png_infop info_ptr,
 75.3427 +   png_uint_32 length));
 75.3428 +#endif /* PNG_READ_iCCP_SUPPORTED */
 75.3429 +
 75.3430 +#if defined(PNG_READ_iTXt_SUPPORTED)
 75.3431 +PNG_EXTERN void png_handle_iTXt PNGARG((png_structp png_ptr, png_infop info_ptr,
 75.3432 +   png_uint_32 length));
 75.3433 +#endif
 75.3434 +
 75.3435 +#if defined(PNG_READ_oFFs_SUPPORTED)
 75.3436 +PNG_EXTERN void png_handle_oFFs PNGARG((png_structp png_ptr, png_infop info_ptr,
 75.3437 +   png_uint_32 length));
 75.3438 +#endif
 75.3439 +
 75.3440 +#if defined(PNG_READ_pCAL_SUPPORTED)
 75.3441 +PNG_EXTERN void png_handle_pCAL PNGARG((png_structp png_ptr, png_infop info_ptr,
 75.3442 +   png_uint_32 length));
 75.3443 +#endif
 75.3444 +
 75.3445 +#if defined(PNG_READ_pHYs_SUPPORTED)
 75.3446 +PNG_EXTERN void png_handle_pHYs PNGARG((png_structp png_ptr, png_infop info_ptr,
 75.3447 +   png_uint_32 length));
 75.3448 +#endif
 75.3449 +
 75.3450 +#if defined(PNG_READ_sBIT_SUPPORTED)
 75.3451 +PNG_EXTERN void png_handle_sBIT PNGARG((png_structp png_ptr, png_infop info_ptr,
 75.3452 +   png_uint_32 length));
 75.3453 +#endif
 75.3454 +
 75.3455 +#if defined(PNG_READ_sCAL_SUPPORTED)
 75.3456 +PNG_EXTERN void png_handle_sCAL PNGARG((png_structp png_ptr, png_infop info_ptr,
 75.3457 +   png_uint_32 length));
 75.3458 +#endif
 75.3459 +
 75.3460 +#if defined(PNG_READ_sPLT_SUPPORTED)
 75.3461 +extern void png_handle_sPLT PNGARG((png_structp png_ptr, png_infop info_ptr,
 75.3462 +   png_uint_32 length));
 75.3463 +#endif /* PNG_READ_sPLT_SUPPORTED */
 75.3464 +
 75.3465 +#if defined(PNG_READ_sRGB_SUPPORTED)
 75.3466 +PNG_EXTERN void png_handle_sRGB PNGARG((png_structp png_ptr, png_infop info_ptr,
 75.3467 +   png_uint_32 length));
 75.3468 +#endif
 75.3469 +
 75.3470 +#if defined(PNG_READ_tEXt_SUPPORTED)
 75.3471 +PNG_EXTERN void png_handle_tEXt PNGARG((png_structp png_ptr, png_infop info_ptr,
 75.3472 +   png_uint_32 length));
 75.3473 +#endif
 75.3474 +
 75.3475 +#if defined(PNG_READ_tIME_SUPPORTED)
 75.3476 +PNG_EXTERN void png_handle_tIME PNGARG((png_structp png_ptr, png_infop info_ptr,
 75.3477 +   png_uint_32 length));
 75.3478 +#endif
 75.3479 +
 75.3480 +#if defined(PNG_READ_tRNS_SUPPORTED)
 75.3481 +PNG_EXTERN void png_handle_tRNS PNGARG((png_structp png_ptr, png_infop info_ptr,
 75.3482 +   png_uint_32 length));
 75.3483 +#endif
 75.3484 +
 75.3485 +#if defined(PNG_READ_zTXt_SUPPORTED)
 75.3486 +PNG_EXTERN void png_handle_zTXt PNGARG((png_structp png_ptr, png_infop info_ptr,
 75.3487 +   png_uint_32 length));
 75.3488 +#endif
 75.3489 +
 75.3490 +PNG_EXTERN void png_handle_unknown PNGARG((png_structp png_ptr,
 75.3491 +   png_infop info_ptr, png_uint_32 length));
 75.3492 +
 75.3493 +PNG_EXTERN void png_check_chunk_name PNGARG((png_structp png_ptr,
 75.3494 +   png_bytep chunk_name));
 75.3495 +
 75.3496 +/* handle the transformations for reading and writing */
 75.3497 +PNG_EXTERN void png_do_read_transformations PNGARG((png_structp png_ptr));
 75.3498 +PNG_EXTERN void png_do_write_transformations PNGARG((png_structp png_ptr));
 75.3499 +
 75.3500 +PNG_EXTERN void png_init_read_transformations PNGARG((png_structp png_ptr));
 75.3501 +
 75.3502 +#ifdef PNG_PROGRESSIVE_READ_SUPPORTED
 75.3503 +PNG_EXTERN void png_push_read_chunk PNGARG((png_structp png_ptr,
 75.3504 +   png_infop info_ptr));
 75.3505 +PNG_EXTERN void png_push_read_sig PNGARG((png_structp png_ptr,
 75.3506 +   png_infop info_ptr));
 75.3507 +PNG_EXTERN void png_push_check_crc PNGARG((png_structp png_ptr));
 75.3508 +PNG_EXTERN void png_push_crc_skip PNGARG((png_structp png_ptr,
 75.3509 +   png_uint_32 length));
 75.3510 +PNG_EXTERN void png_push_crc_finish PNGARG((png_structp png_ptr));
 75.3511 +PNG_EXTERN void png_push_save_buffer PNGARG((png_structp png_ptr));
 75.3512 +PNG_EXTERN void png_push_restore_buffer PNGARG((png_structp png_ptr,
 75.3513 +   png_bytep buffer, png_size_t buffer_length));
 75.3514 +PNG_EXTERN void png_push_read_IDAT PNGARG((png_structp png_ptr));
 75.3515 +PNG_EXTERN void png_process_IDAT_data PNGARG((png_structp png_ptr,
 75.3516 +   png_bytep buffer, png_size_t buffer_length));
 75.3517 +PNG_EXTERN void png_push_process_row PNGARG((png_structp png_ptr));
 75.3518 +PNG_EXTERN void png_push_handle_unknown PNGARG((png_structp png_ptr,
 75.3519 +   png_infop info_ptr, png_uint_32 length));
 75.3520 +PNG_EXTERN void png_push_have_info PNGARG((png_structp png_ptr,
 75.3521 +   png_infop info_ptr));
 75.3522 +PNG_EXTERN void png_push_have_end PNGARG((png_structp png_ptr,
 75.3523 +   png_infop info_ptr));
 75.3524 +PNG_EXTERN void png_push_have_row PNGARG((png_structp png_ptr, png_bytep row));
 75.3525 +PNG_EXTERN void png_push_read_end PNGARG((png_structp png_ptr,
 75.3526 +   png_infop info_ptr));
 75.3527 +PNG_EXTERN void png_process_some_data PNGARG((png_structp png_ptr,
 75.3528 +   png_infop info_ptr));
 75.3529 +PNG_EXTERN void png_read_push_finish_row PNGARG((png_structp png_ptr));
 75.3530 +#if defined(PNG_READ_tEXt_SUPPORTED)
 75.3531 +PNG_EXTERN void png_push_handle_tEXt PNGARG((png_structp png_ptr,
 75.3532 +   png_infop info_ptr, png_uint_32 length));
 75.3533 +PNG_EXTERN void png_push_read_tEXt PNGARG((png_structp png_ptr,
 75.3534 +   png_infop info_ptr));
 75.3535 +#endif
 75.3536 +#if defined(PNG_READ_zTXt_SUPPORTED)
 75.3537 +PNG_EXTERN void png_push_handle_zTXt PNGARG((png_structp png_ptr,
 75.3538 +   png_infop info_ptr, png_uint_32 length));
 75.3539 +PNG_EXTERN void png_push_read_zTXt PNGARG((png_structp png_ptr,
 75.3540 +   png_infop info_ptr));
 75.3541 +#endif
 75.3542 +#if defined(PNG_READ_iTXt_SUPPORTED)
 75.3543 +PNG_EXTERN void png_push_handle_iTXt PNGARG((png_structp png_ptr,
 75.3544 +   png_infop info_ptr, png_uint_32 length));
 75.3545 +PNG_EXTERN void png_push_read_iTXt PNGARG((png_structp png_ptr,
 75.3546 +   png_infop info_ptr));
 75.3547 +#endif
 75.3548 +
 75.3549 +#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */
 75.3550 +
 75.3551 +#ifdef PNG_MNG_FEATURES_SUPPORTED
 75.3552 +PNG_EXTERN void png_do_read_intrapixel PNGARG((png_row_infop row_info,
 75.3553 +   png_bytep row));
 75.3554 +PNG_EXTERN void png_do_write_intrapixel PNGARG((png_row_infop row_info,
 75.3555 +   png_bytep row));
 75.3556 +#endif
 75.3557 +
 75.3558 +#if defined(PNG_ASSEMBLER_CODE_SUPPORTED)
 75.3559 +#if defined(PNG_MMX_CODE_SUPPORTED)
 75.3560 +/* png.c */ /* PRIVATE */
 75.3561 +PNG_EXTERN void png_init_mmx_flags PNGARG((png_structp png_ptr));
 75.3562 +#endif
 75.3563 +#endif
 75.3564 +
 75.3565 +#if defined(PNG_INCH_CONVERSIONS) && defined(PNG_FLOATING_POINT_SUPPORTED)
 75.3566 +PNG_EXTERN png_uint_32 png_get_pixels_per_inch PNGARG((png_structp png_ptr,
 75.3567 +png_infop info_ptr));
 75.3568 +
 75.3569 +PNG_EXTERN png_uint_32 png_get_x_pixels_per_inch PNGARG((png_structp png_ptr,
 75.3570 +png_infop info_ptr));
 75.3571 +
 75.3572 +PNG_EXTERN png_uint_32 png_get_y_pixels_per_inch PNGARG((png_structp png_ptr,
 75.3573 +png_infop info_ptr));
 75.3574 +
 75.3575 +PNG_EXTERN float png_get_x_offset_inches PNGARG((png_structp png_ptr,
 75.3576 +png_infop info_ptr));
 75.3577 +
 75.3578 +PNG_EXTERN float png_get_y_offset_inches PNGARG((png_structp png_ptr,
 75.3579 +png_infop info_ptr));
 75.3580 +
 75.3581 +#if defined(PNG_pHYs_SUPPORTED)
 75.3582 +PNG_EXTERN png_uint_32 png_get_pHYs_dpi PNGARG((png_structp png_ptr,
 75.3583 +png_infop info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type));
 75.3584 +#endif /* PNG_pHYs_SUPPORTED */
 75.3585 +#endif  /* PNG_INCH_CONVERSIONS && PNG_FLOATING_POINT_SUPPORTED */
 75.3586 +
 75.3587 +/* Read the chunk header (length + type name) */
 75.3588 +PNG_EXTERN png_uint_32 png_read_chunk_header PNGARG((png_structp png_ptr));
 75.3589 +
 75.3590 +/* Maintainer: Put new private prototypes here ^ and in libpngpf.3 */
 75.3591 +
 75.3592 +#endif /* PNG_INTERNAL */
 75.3593 +
 75.3594 +#ifdef __cplusplus
 75.3595 +}
 75.3596 +#endif
 75.3597 +
 75.3598 +#endif /* PNG_VERSION_INFO_ONLY */
 75.3599 +/* do not put anything past this line */
 75.3600 +#endif /* PNG_H */
    76.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    76.2 +++ b/libs/libpng/pngconf.h	Sun Nov 01 00:36:56 2015 +0200
    76.3 @@ -0,0 +1,1481 @@
    76.4 +
    76.5 +/* pngconf.h - machine configurable file for libpng
    76.6 + *
    76.7 + * libpng version 1.2.33 - October 31, 2008
    76.8 + * For conditions of distribution and use, see copyright notice in png.h
    76.9 + * Copyright (c) 1998-2008 Glenn Randers-Pehrson
   76.10 + * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
   76.11 + * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
   76.12 + */
   76.13 +
   76.14 +/* Any machine specific code is near the front of this file, so if you
   76.15 + * are configuring libpng for a machine, you may want to read the section
   76.16 + * starting here down to where it starts to typedef png_color, png_text,
   76.17 + * and png_info.
   76.18 + */
   76.19 +
   76.20 +#ifndef PNGCONF_H
   76.21 +#define PNGCONF_H
   76.22 +
   76.23 +#define PNG_1_2_X
   76.24 +
   76.25 +/* 
   76.26 + * PNG_USER_CONFIG has to be defined on the compiler command line. This
   76.27 + * includes the resource compiler for Windows DLL configurations.
   76.28 + */
   76.29 +#ifdef PNG_USER_CONFIG
   76.30 +#  ifndef PNG_USER_PRIVATEBUILD
   76.31 +#    define PNG_USER_PRIVATEBUILD
   76.32 +#  endif
   76.33 +#include "pngusr.h"
   76.34 +#endif
   76.35 +
   76.36 +/* PNG_CONFIGURE_LIBPNG is set by the "configure" script. */
   76.37 +#ifdef PNG_CONFIGURE_LIBPNG
   76.38 +#ifdef HAVE_CONFIG_H
   76.39 +#include "config.h"
   76.40 +#endif
   76.41 +#endif
   76.42 +
   76.43 +/*
   76.44 + * Added at libpng-1.2.8
   76.45 + *  
   76.46 + * If you create a private DLL you need to define in "pngusr.h" the followings:
   76.47 + * #define PNG_USER_PRIVATEBUILD <Describes by whom and why this version of
   76.48 + *        the DLL was built>
   76.49 + *  e.g. #define PNG_USER_PRIVATEBUILD "Build by MyCompany for xyz reasons."
   76.50 + * #define PNG_USER_DLLFNAME_POSTFIX <two-letter postfix that serve to
   76.51 + *        distinguish your DLL from those of the official release. These
   76.52 + *        correspond to the trailing letters that come after the version
   76.53 + *        number and must match your private DLL name>
   76.54 + *  e.g. // private DLL "libpng13gx.dll"
   76.55 + *       #define PNG_USER_DLLFNAME_POSTFIX "gx"
   76.56 + * 
   76.57 + * The following macros are also at your disposal if you want to complete the 
   76.58 + * DLL VERSIONINFO structure.
   76.59 + * - PNG_USER_VERSIONINFO_COMMENTS
   76.60 + * - PNG_USER_VERSIONINFO_COMPANYNAME
   76.61 + * - PNG_USER_VERSIONINFO_LEGALTRADEMARKS
   76.62 + */
   76.63 +
   76.64 +#ifdef __STDC__
   76.65 +#ifdef SPECIALBUILD
   76.66 +#  pragma message("PNG_LIBPNG_SPECIALBUILD (and deprecated SPECIALBUILD)\
   76.67 + are now LIBPNG reserved macros. Use PNG_USER_PRIVATEBUILD instead.")
   76.68 +#endif
   76.69 +
   76.70 +#ifdef PRIVATEBUILD
   76.71 +# pragma message("PRIVATEBUILD is deprecated.\
   76.72 + Use PNG_USER_PRIVATEBUILD instead.")
   76.73 +# define PNG_USER_PRIVATEBUILD PRIVATEBUILD
   76.74 +#endif
   76.75 +#endif /* __STDC__ */
   76.76 +
   76.77 +#ifndef PNG_VERSION_INFO_ONLY
   76.78 +
   76.79 +/* End of material added to libpng-1.2.8 */
   76.80 +
   76.81 +/* Added at libpng-1.2.19, removed at libpng-1.2.20 because it caused trouble
   76.82 +   Restored at libpng-1.2.21 */
   76.83 +#if !defined(PNG_NO_WARN_UNINITIALIZED_ROW) && \
   76.84 +    !defined(PNG_WARN_UNINITIALIZED_ROW)
   76.85 +#  define PNG_WARN_UNINITIALIZED_ROW 1
   76.86 +#endif
   76.87 +/* End of material added at libpng-1.2.19/1.2.21 */
   76.88 +
   76.89 +/* This is the size of the compression buffer, and thus the size of
   76.90 + * an IDAT chunk.  Make this whatever size you feel is best for your
   76.91 + * machine.  One of these will be allocated per png_struct.  When this
   76.92 + * is full, it writes the data to the disk, and does some other
   76.93 + * calculations.  Making this an extremely small size will slow
   76.94 + * the library down, but you may want to experiment to determine
   76.95 + * where it becomes significant, if you are concerned with memory
   76.96 + * usage.  Note that zlib allocates at least 32Kb also.  For readers,
   76.97 + * this describes the size of the buffer available to read the data in.
   76.98 + * Unless this gets smaller than the size of a row (compressed),
   76.99 + * it should not make much difference how big this is.
  76.100 + */
  76.101 +
  76.102 +#ifndef PNG_ZBUF_SIZE
  76.103 +#  define PNG_ZBUF_SIZE 8192
  76.104 +#endif
  76.105 +
  76.106 +/* Enable if you want a write-only libpng */
  76.107 +
  76.108 +#ifndef PNG_NO_READ_SUPPORTED
  76.109 +#  define PNG_READ_SUPPORTED
  76.110 +#endif
  76.111 +
  76.112 +/* Enable if you want a read-only libpng */
  76.113 +
  76.114 +#ifndef PNG_NO_WRITE_SUPPORTED
  76.115 +#  define PNG_WRITE_SUPPORTED
  76.116 +#endif
  76.117 +
  76.118 +/* Enabled by default in 1.2.0.  You can disable this if you don't need to
  76.119 +   support PNGs that are embedded in MNG datastreams */
  76.120 +#if !defined(PNG_1_0_X) && !defined(PNG_NO_MNG_FEATURES)
  76.121 +#  ifndef PNG_MNG_FEATURES_SUPPORTED
  76.122 +#    define PNG_MNG_FEATURES_SUPPORTED
  76.123 +#  endif
  76.124 +#endif
  76.125 +
  76.126 +#ifndef PNG_NO_FLOATING_POINT_SUPPORTED
  76.127 +#  ifndef PNG_FLOATING_POINT_SUPPORTED
  76.128 +#    define PNG_FLOATING_POINT_SUPPORTED
  76.129 +#  endif
  76.130 +#endif
  76.131 +
  76.132 +/* If you are running on a machine where you cannot allocate more
  76.133 + * than 64K of memory at once, uncomment this.  While libpng will not
  76.134 + * normally need that much memory in a chunk (unless you load up a very
  76.135 + * large file), zlib needs to know how big of a chunk it can use, and
  76.136 + * libpng thus makes sure to check any memory allocation to verify it
  76.137 + * will fit into memory.
  76.138 +#define PNG_MAX_MALLOC_64K
  76.139 + */
  76.140 +#if defined(MAXSEG_64K) && !defined(PNG_MAX_MALLOC_64K)
  76.141 +#  define PNG_MAX_MALLOC_64K
  76.142 +#endif
  76.143 +
  76.144 +/* Special munging to support doing things the 'cygwin' way:
  76.145 + * 'Normal' png-on-win32 defines/defaults:
  76.146 + *   PNG_BUILD_DLL -- building dll
  76.147 + *   PNG_USE_DLL   -- building an application, linking to dll
  76.148 + *   (no define)   -- building static library, or building an
  76.149 + *                    application and linking to the static lib
  76.150 + * 'Cygwin' defines/defaults:
  76.151 + *   PNG_BUILD_DLL -- (ignored) building the dll
  76.152 + *   (no define)   -- (ignored) building an application, linking to the dll
  76.153 + *   PNG_STATIC    -- (ignored) building the static lib, or building an 
  76.154 + *                    application that links to the static lib.
  76.155 + *   ALL_STATIC    -- (ignored) building various static libs, or building an 
  76.156 + *                    application that links to the static libs.
  76.157 + * Thus,
  76.158 + * a cygwin user should define either PNG_BUILD_DLL or PNG_STATIC, and
  76.159 + * this bit of #ifdefs will define the 'correct' config variables based on
  76.160 + * that. If a cygwin user *wants* to define 'PNG_USE_DLL' that's okay, but
  76.161 + * unnecessary.
  76.162 + *
  76.163 + * Also, the precedence order is:
  76.164 + *   ALL_STATIC (since we can't #undef something outside our namespace)
  76.165 + *   PNG_BUILD_DLL
  76.166 + *   PNG_STATIC
  76.167 + *   (nothing) == PNG_USE_DLL
  76.168 + * 
  76.169 + * CYGWIN (2002-01-20): The preceding is now obsolete. With the advent
  76.170 + *   of auto-import in binutils, we no longer need to worry about 
  76.171 + *   __declspec(dllexport) / __declspec(dllimport) and friends.  Therefore,
  76.172 + *   we don't need to worry about PNG_STATIC or ALL_STATIC when it comes
  76.173 + *   to __declspec() stuff.  However, we DO need to worry about 
  76.174 + *   PNG_BUILD_DLL and PNG_STATIC because those change some defaults
  76.175 + *   such as CONSOLE_IO and whether GLOBAL_ARRAYS are allowed.
  76.176 + */
  76.177 +#if defined(__CYGWIN__)
  76.178 +#  if defined(ALL_STATIC)
  76.179 +#    if defined(PNG_BUILD_DLL)
  76.180 +#      undef PNG_BUILD_DLL
  76.181 +#    endif
  76.182 +#    if defined(PNG_USE_DLL)
  76.183 +#      undef PNG_USE_DLL
  76.184 +#    endif
  76.185 +#    if defined(PNG_DLL)
  76.186 +#      undef PNG_DLL
  76.187 +#    endif
  76.188 +#    if !defined(PNG_STATIC)
  76.189 +#      define PNG_STATIC
  76.190 +#    endif
  76.191 +#  else
  76.192 +#    if defined (PNG_BUILD_DLL)
  76.193 +#      if defined(PNG_STATIC)
  76.194 +#        undef PNG_STATIC
  76.195 +#      endif
  76.196 +#      if defined(PNG_USE_DLL)
  76.197 +#        undef PNG_USE_DLL
  76.198 +#      endif
  76.199 +#      if !defined(PNG_DLL)
  76.200 +#        define PNG_DLL
  76.201 +#      endif
  76.202 +#    else
  76.203 +#      if defined(PNG_STATIC)
  76.204 +#        if defined(PNG_USE_DLL)
  76.205 +#          undef PNG_USE_DLL
  76.206 +#        endif
  76.207 +#        if defined(PNG_DLL)
  76.208 +#          undef PNG_DLL
  76.209 +#        endif
  76.210 +#      else
  76.211 +#        if !defined(PNG_USE_DLL)
  76.212 +#          define PNG_USE_DLL
  76.213 +#        endif
  76.214 +#        if !defined(PNG_DLL)
  76.215 +#          define PNG_DLL
  76.216 +#        endif
  76.217 +#      endif  
  76.218 +#    endif  
  76.219 +#  endif
  76.220 +#endif
  76.221 +
  76.222 +/* This protects us against compilers that run on a windowing system
  76.223 + * and thus don't have or would rather us not use the stdio types:
  76.224 + * stdin, stdout, and stderr.  The only one currently used is stderr
  76.225 + * in png_error() and png_warning().  #defining PNG_NO_CONSOLE_IO will
  76.226 + * prevent these from being compiled and used. #defining PNG_NO_STDIO
  76.227 + * will also prevent these, plus will prevent the entire set of stdio
  76.228 + * macros and functions (FILE *, printf, etc.) from being compiled and used,
  76.229 + * unless (PNG_DEBUG > 0) has been #defined.
  76.230 + *
  76.231 + * #define PNG_NO_CONSOLE_IO
  76.232 + * #define PNG_NO_STDIO
  76.233 + */
  76.234 +
  76.235 +#if defined(_WIN32_WCE)
  76.236 +#  include <windows.h>
  76.237 +   /* Console I/O functions are not supported on WindowsCE */
  76.238 +#  define PNG_NO_CONSOLE_IO
  76.239 +#  ifdef PNG_DEBUG
  76.240 +#    undef PNG_DEBUG
  76.241 +#  endif
  76.242 +#endif
  76.243 +
  76.244 +#ifdef PNG_BUILD_DLL
  76.245 +#  ifndef PNG_CONSOLE_IO_SUPPORTED
  76.246 +#    ifndef PNG_NO_CONSOLE_IO
  76.247 +#      define PNG_NO_CONSOLE_IO
  76.248 +#    endif
  76.249 +#  endif
  76.250 +#endif
  76.251 +
  76.252 +#  ifdef PNG_NO_STDIO
  76.253 +#    ifndef PNG_NO_CONSOLE_IO
  76.254 +#      define PNG_NO_CONSOLE_IO
  76.255 +#    endif
  76.256 +#    ifdef PNG_DEBUG
  76.257 +#      if (PNG_DEBUG > 0)
  76.258 +#        include <stdio.h>
  76.259 +#      endif
  76.260 +#    endif
  76.261 +#  else
  76.262 +#    if !defined(_WIN32_WCE)
  76.263 +/* "stdio.h" functions are not supported on WindowsCE */
  76.264 +#      include <stdio.h>
  76.265 +#    endif
  76.266 +#  endif
  76.267 +
  76.268 +/* This macro protects us against machines that don't have function
  76.269 + * prototypes (ie K&R style headers).  If your compiler does not handle
  76.270 + * function prototypes, define this macro and use the included ansi2knr.
  76.271 + * I've always been able to use _NO_PROTO as the indicator, but you may
  76.272 + * need to drag the empty declaration out in front of here, or change the
  76.273 + * ifdef to suit your own needs.
  76.274 + */
  76.275 +#ifndef PNGARG
  76.276 +
  76.277 +#ifdef OF /* zlib prototype munger */
  76.278 +#  define PNGARG(arglist) OF(arglist)
  76.279 +#else
  76.280 +
  76.281 +#ifdef _NO_PROTO
  76.282 +#  define PNGARG(arglist) ()
  76.283 +#  ifndef PNG_TYPECAST_NULL
  76.284 +#     define PNG_TYPECAST_NULL
  76.285 +#  endif
  76.286 +#else
  76.287 +#  define PNGARG(arglist) arglist
  76.288 +#endif /* _NO_PROTO */
  76.289 +
  76.290 +
  76.291 +#endif /* OF */
  76.292 +
  76.293 +#endif /* PNGARG */
  76.294 +
  76.295 +/* Try to determine if we are compiling on a Mac.  Note that testing for
  76.296 + * just __MWERKS__ is not good enough, because the Codewarrior is now used
  76.297 + * on non-Mac platforms.
  76.298 + */
  76.299 +#ifndef MACOS
  76.300 +#  if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \
  76.301 +      defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC)
  76.302 +#    define MACOS
  76.303 +#  endif
  76.304 +#endif
  76.305 +
  76.306 +/* enough people need this for various reasons to include it here */
  76.307 +#if !defined(MACOS) && !defined(RISCOS) && !defined(_WIN32_WCE)
  76.308 +#  include <sys/types.h>
  76.309 +#endif
  76.310 +
  76.311 +#if !defined(PNG_SETJMP_NOT_SUPPORTED) && !defined(PNG_NO_SETJMP_SUPPORTED)
  76.312 +#  define PNG_SETJMP_SUPPORTED
  76.313 +#endif
  76.314 +
  76.315 +#ifdef PNG_SETJMP_SUPPORTED
  76.316 +/* This is an attempt to force a single setjmp behaviour on Linux.  If
  76.317 + * the X config stuff didn't define _BSD_SOURCE we wouldn't need this.
  76.318 + */
  76.319 +
  76.320 +#  ifdef __linux__
  76.321 +#    ifdef _BSD_SOURCE
  76.322 +#      define PNG_SAVE_BSD_SOURCE
  76.323 +#      undef _BSD_SOURCE
  76.324 +#    endif
  76.325 +#    ifdef _SETJMP_H
  76.326 +     /* If you encounter a compiler error here, see the explanation
  76.327 +      * near the end of INSTALL.
  76.328 +      */
  76.329 +         __pngconf.h__ already includes setjmp.h;
  76.330 +         __dont__ include it again.;
  76.331 +#    endif
  76.332 +#  endif /* __linux__ */
  76.333 +
  76.334 +   /* include setjmp.h for error handling */
  76.335 +#  include <setjmp.h>
  76.336 +
  76.337 +#  ifdef __linux__
  76.338 +#    ifdef PNG_SAVE_BSD_SOURCE
  76.339 +#      ifndef _BSD_SOURCE
  76.340 +#        define _BSD_SOURCE
  76.341 +#      endif
  76.342 +#      undef PNG_SAVE_BSD_SOURCE
  76.343 +#    endif
  76.344 +#  endif /* __linux__ */
  76.345 +#endif /* PNG_SETJMP_SUPPORTED */
  76.346 +
  76.347 +#ifdef BSD
  76.348 +#  include <strings.h>
  76.349 +#else
  76.350 +#  include <string.h>
  76.351 +#endif
  76.352 +
  76.353 +/* Other defines for things like memory and the like can go here.  */
  76.354 +#ifdef PNG_INTERNAL
  76.355 +
  76.356 +#include <stdlib.h>
  76.357 +
  76.358 +/* The functions exported by PNG_EXTERN are PNG_INTERNAL functions, which
  76.359 + * aren't usually used outside the library (as far as I know), so it is
  76.360 + * debatable if they should be exported at all.  In the future, when it is
  76.361 + * possible to have run-time registry of chunk-handling functions, some of
  76.362 + * these will be made available again.
  76.363 +#define PNG_EXTERN extern
  76.364 + */
  76.365 +#define PNG_EXTERN
  76.366 +
  76.367 +/* Other defines specific to compilers can go here.  Try to keep
  76.368 + * them inside an appropriate ifdef/endif pair for portability.
  76.369 + */
  76.370 +
  76.371 +#if defined(PNG_FLOATING_POINT_SUPPORTED)
  76.372 +#  if defined(MACOS)
  76.373 +     /* We need to check that <math.h> hasn't already been included earlier
  76.374 +      * as it seems it doesn't agree with <fp.h>, yet we should really use
  76.375 +      * <fp.h> if possible.
  76.376 +      */
  76.377 +#    if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__)
  76.378 +#      include <fp.h>
  76.379 +#    endif
  76.380 +#  else
  76.381 +#    include <math.h>
  76.382 +#  endif
  76.383 +#  if defined(_AMIGA) && defined(__SASC) && defined(_M68881)
  76.384 +     /* Amiga SAS/C: We must include builtin FPU functions when compiling using
  76.385 +      * MATH=68881
  76.386 +      */
  76.387 +#    include <m68881.h>
  76.388 +#  endif
  76.389 +#endif
  76.390 +
  76.391 +/* Codewarrior on NT has linking problems without this. */
  76.392 +#if (defined(__MWERKS__) && defined(WIN32)) || defined(__STDC__)
  76.393 +#  define PNG_ALWAYS_EXTERN
  76.394 +#endif
  76.395 +
  76.396 +/* This provides the non-ANSI (far) memory allocation routines. */
  76.397 +#if defined(__TURBOC__) && defined(__MSDOS__)
  76.398 +#  include <mem.h>
  76.399 +#  include <alloc.h>
  76.400 +#endif
  76.401 +
  76.402 +/* I have no idea why is this necessary... */
  76.403 +#if defined(_MSC_VER) && (defined(WIN32) || defined(_Windows) || \
  76.404 +    defined(_WINDOWS) || defined(_WIN32) || defined(__WIN32__))
  76.405 +#  include <malloc.h>
  76.406 +#endif
  76.407 +
  76.408 +/* This controls how fine the dithering gets.  As this allocates
  76.409 + * a largish chunk of memory (32K), those who are not as concerned
  76.410 + * with dithering quality can decrease some or all of these.
  76.411 + */
  76.412 +#ifndef PNG_DITHER_RED_BITS
  76.413 +#  define PNG_DITHER_RED_BITS 5
  76.414 +#endif
  76.415 +#ifndef PNG_DITHER_GREEN_BITS
  76.416 +#  define PNG_DITHER_GREEN_BITS 5
  76.417 +#endif
  76.418 +#ifndef PNG_DITHER_BLUE_BITS
  76.419 +#  define PNG_DITHER_BLUE_BITS 5
  76.420 +#endif
  76.421 +
  76.422 +/* This controls how fine the gamma correction becomes when you
  76.423 + * are only interested in 8 bits anyway.  Increasing this value
  76.424 + * results in more memory being used, and more pow() functions
  76.425 + * being called to fill in the gamma tables.  Don't set this value
  76.426 + * less then 8, and even that may not work (I haven't tested it).
  76.427 + */
  76.428 +
  76.429 +#ifndef PNG_MAX_GAMMA_8
  76.430 +#  define PNG_MAX_GAMMA_8 11
  76.431 +#endif
  76.432 +
  76.433 +/* This controls how much a difference in gamma we can tolerate before
  76.434 + * we actually start doing gamma conversion.
  76.435 + */
  76.436 +#ifndef PNG_GAMMA_THRESHOLD
  76.437 +#  define PNG_GAMMA_THRESHOLD 0.05
  76.438 +#endif
  76.439 +
  76.440 +#endif /* PNG_INTERNAL */
  76.441 +
  76.442 +/* The following uses const char * instead of char * for error
  76.443 + * and warning message functions, so some compilers won't complain.
  76.444 + * If you do not want to use const, define PNG_NO_CONST here.
  76.445 + */
  76.446 +
  76.447 +#ifndef PNG_NO_CONST
  76.448 +#  define PNG_CONST const
  76.449 +#else
  76.450 +#  define PNG_CONST
  76.451 +#endif
  76.452 +
  76.453 +/* The following defines give you the ability to remove code from the
  76.454 + * library that you will not be using.  I wish I could figure out how to
  76.455 + * automate this, but I can't do that without making it seriously hard
  76.456 + * on the users.  So if you are not using an ability, change the #define
  76.457 + * to and #undef, and that part of the library will not be compiled.  If
  76.458 + * your linker can't find a function, you may want to make sure the
  76.459 + * ability is defined here.  Some of these depend upon some others being
  76.460 + * defined.  I haven't figured out all the interactions here, so you may
  76.461 + * have to experiment awhile to get everything to compile.  If you are
  76.462 + * creating or using a shared library, you probably shouldn't touch this,
  76.463 + * as it will affect the size of the structures, and this will cause bad
  76.464 + * things to happen if the library and/or application ever change.
  76.465 + */
  76.466 +
  76.467 +/* Any features you will not be using can be undef'ed here */
  76.468 +
  76.469 +/* GR-P, 0.96a: Set "*TRANSFORMS_SUPPORTED as default but allow user
  76.470 + * to turn it off with "*TRANSFORMS_NOT_SUPPORTED" or *PNG_NO_*_TRANSFORMS
  76.471 + * on the compile line, then pick and choose which ones to define without
  76.472 + * having to edit this file. It is safe to use the *TRANSFORMS_NOT_SUPPORTED
  76.473 + * if you only want to have a png-compliant reader/writer but don't need
  76.474 + * any of the extra transformations.  This saves about 80 kbytes in a
  76.475 + * typical installation of the library. (PNG_NO_* form added in version
  76.476 + * 1.0.1c, for consistency)
  76.477 + */
  76.478 +
  76.479 +/* The size of the png_text structure changed in libpng-1.0.6 when
  76.480 + * iTXt support was added.  iTXt support was turned off by default through
  76.481 + * libpng-1.2.x, to support old apps that malloc the png_text structure
  76.482 + * instead of calling png_set_text() and letting libpng malloc it.  It
  76.483 + * was turned on by default in libpng-1.3.0.
  76.484 + */
  76.485 +
  76.486 +#if defined(PNG_1_0_X) || defined (PNG_1_2_X)
  76.487 +#  ifndef PNG_NO_iTXt_SUPPORTED
  76.488 +#    define PNG_NO_iTXt_SUPPORTED
  76.489 +#  endif
  76.490 +#  ifndef PNG_NO_READ_iTXt
  76.491 +#    define PNG_NO_READ_iTXt
  76.492 +#  endif
  76.493 +#  ifndef PNG_NO_WRITE_iTXt
  76.494 +#    define PNG_NO_WRITE_iTXt
  76.495 +#  endif
  76.496 +#endif
  76.497 +
  76.498 +#if !defined(PNG_NO_iTXt_SUPPORTED)
  76.499 +#  if !defined(PNG_READ_iTXt_SUPPORTED) && !defined(PNG_NO_READ_iTXt)
  76.500 +#    define PNG_READ_iTXt
  76.501 +#  endif
  76.502 +#  if !defined(PNG_WRITE_iTXt_SUPPORTED) && !defined(PNG_NO_WRITE_iTXt)
  76.503 +#    define PNG_WRITE_iTXt
  76.504 +#  endif
  76.505 +#endif
  76.506 +
  76.507 +/* The following support, added after version 1.0.0, can be turned off here en
  76.508 + * masse by defining PNG_LEGACY_SUPPORTED in case you need binary compatibility
  76.509 + * with old applications that require the length of png_struct and png_info
  76.510 + * to remain unchanged.
  76.511 + */
  76.512 +
  76.513 +#ifdef PNG_LEGACY_SUPPORTED
  76.514 +#  define PNG_NO_FREE_ME
  76.515 +#  define PNG_NO_READ_UNKNOWN_CHUNKS
  76.516 +#  define PNG_NO_WRITE_UNKNOWN_CHUNKS
  76.517 +#  define PNG_NO_READ_USER_CHUNKS
  76.518 +#  define PNG_NO_READ_iCCP
  76.519 +#  define PNG_NO_WRITE_iCCP
  76.520 +#  define PNG_NO_READ_iTXt
  76.521 +#  define PNG_NO_WRITE_iTXt
  76.522 +#  define PNG_NO_READ_sCAL
  76.523 +#  define PNG_NO_WRITE_sCAL
  76.524 +#  define PNG_NO_READ_sPLT
  76.525 +#  define PNG_NO_WRITE_sPLT
  76.526 +#  define PNG_NO_INFO_IMAGE
  76.527 +#  define PNG_NO_READ_RGB_TO_GRAY
  76.528 +#  define PNG_NO_READ_USER_TRANSFORM
  76.529 +#  define PNG_NO_WRITE_USER_TRANSFORM
  76.530 +#  define PNG_NO_USER_MEM
  76.531 +#  define PNG_NO_READ_EMPTY_PLTE
  76.532 +#  define PNG_NO_MNG_FEATURES
  76.533 +#  define PNG_NO_FIXED_POINT_SUPPORTED
  76.534 +#endif
  76.535 +
  76.536 +/* Ignore attempt to turn off both floating and fixed point support */
  76.537 +#if !defined(PNG_FLOATING_POINT_SUPPORTED) || \
  76.538 +    !defined(PNG_NO_FIXED_POINT_SUPPORTED)
  76.539 +#  define PNG_FIXED_POINT_SUPPORTED
  76.540 +#endif
  76.541 +
  76.542 +#ifndef PNG_NO_FREE_ME
  76.543 +#  define PNG_FREE_ME_SUPPORTED
  76.544 +#endif
  76.545 +
  76.546 +#if defined(PNG_READ_SUPPORTED)
  76.547 +
  76.548 +#if !defined(PNG_READ_TRANSFORMS_NOT_SUPPORTED) && \
  76.549 +      !defined(PNG_NO_READ_TRANSFORMS)
  76.550 +#  define PNG_READ_TRANSFORMS_SUPPORTED
  76.551 +#endif
  76.552 +
  76.553 +#ifdef PNG_READ_TRANSFORMS_SUPPORTED
  76.554 +#  ifndef PNG_NO_READ_EXPAND
  76.555 +#    define PNG_READ_EXPAND_SUPPORTED
  76.556 +#  endif
  76.557 +#  ifndef PNG_NO_READ_SHIFT
  76.558 +#    define PNG_READ_SHIFT_SUPPORTED
  76.559 +#  endif
  76.560 +#  ifndef PNG_NO_READ_PACK
  76.561 +#    define PNG_READ_PACK_SUPPORTED
  76.562 +#  endif
  76.563 +#  ifndef PNG_NO_READ_BGR
  76.564 +#    define PNG_READ_BGR_SUPPORTED
  76.565 +#  endif
  76.566 +#  ifndef PNG_NO_READ_SWAP
  76.567 +#    define PNG_READ_SWAP_SUPPORTED
  76.568 +#  endif
  76.569 +#  ifndef PNG_NO_READ_PACKSWAP
  76.570 +#    define PNG_READ_PACKSWAP_SUPPORTED
  76.571 +#  endif
  76.572 +#  ifndef PNG_NO_READ_INVERT
  76.573 +#    define PNG_READ_INVERT_SUPPORTED
  76.574 +#  endif
  76.575 +#  ifndef PNG_NO_READ_DITHER
  76.576 +#    define PNG_READ_DITHER_SUPPORTED
  76.577 +#  endif
  76.578 +#  ifndef PNG_NO_READ_BACKGROUND
  76.579 +#    define PNG_READ_BACKGROUND_SUPPORTED
  76.580 +#  endif
  76.581 +#  ifndef PNG_NO_READ_16_TO_8
  76.582 +#    define PNG_READ_16_TO_8_SUPPORTED
  76.583 +#  endif
  76.584 +#  ifndef PNG_NO_READ_FILLER
  76.585 +#    define PNG_READ_FILLER_SUPPORTED
  76.586 +#  endif
  76.587 +#  ifndef PNG_NO_READ_GAMMA
  76.588 +#    define PNG_READ_GAMMA_SUPPORTED
  76.589 +#  endif
  76.590 +#  ifndef PNG_NO_READ_GRAY_TO_RGB
  76.591 +#    define PNG_READ_GRAY_TO_RGB_SUPPORTED
  76.592 +#  endif
  76.593 +#  ifndef PNG_NO_READ_SWAP_ALPHA
  76.594 +#    define PNG_READ_SWAP_ALPHA_SUPPORTED
  76.595 +#  endif
  76.596 +#  ifndef PNG_NO_READ_INVERT_ALPHA
  76.597 +#    define PNG_READ_INVERT_ALPHA_SUPPORTED
  76.598 +#  endif
  76.599 +#  ifndef PNG_NO_READ_STRIP_ALPHA
  76.600 +#    define PNG_READ_STRIP_ALPHA_SUPPORTED
  76.601 +#  endif
  76.602 +#  ifndef PNG_NO_READ_USER_TRANSFORM
  76.603 +#    define PNG_READ_USER_TRANSFORM_SUPPORTED
  76.604 +#  endif
  76.605 +#  ifndef PNG_NO_READ_RGB_TO_GRAY
  76.606 +#    define PNG_READ_RGB_TO_GRAY_SUPPORTED
  76.607 +#  endif
  76.608 +#endif /* PNG_READ_TRANSFORMS_SUPPORTED */
  76.609 +
  76.610 +#if !defined(PNG_NO_PROGRESSIVE_READ) && \
  76.611 + !defined(PNG_PROGRESSIVE_READ_SUPPORTED) /* if you don't do progressive   */
  76.612 +#  define PNG_PROGRESSIVE_READ_SUPPORTED  /* reading.  This is not talking */
  76.613 +#endif                            /* about interlacing capability!  You'll */
  76.614 +           /* still have interlacing unless you change the following line: */
  76.615 +
  76.616 +#define PNG_READ_INTERLACING_SUPPORTED /* required in PNG-compliant decoders */
  76.617 +
  76.618 +#ifndef PNG_NO_READ_COMPOSITE_NODIV
  76.619 +#  ifndef PNG_NO_READ_COMPOSITED_NODIV  /* libpng-1.0.x misspelling */
  76.620 +#    define PNG_READ_COMPOSITE_NODIV_SUPPORTED  /* well tested on Intel, SGI */
  76.621 +#  endif
  76.622 +#endif
  76.623 +
  76.624 +#if defined(PNG_1_0_X) || defined (PNG_1_2_X)
  76.625 +/* Deprecated, will be removed from version 2.0.0.
  76.626 +   Use PNG_MNG_FEATURES_SUPPORTED instead. */
  76.627 +#ifndef PNG_NO_READ_EMPTY_PLTE
  76.628 +#  define PNG_READ_EMPTY_PLTE_SUPPORTED
  76.629 +#endif
  76.630 +#endif
  76.631 +
  76.632 +#endif /* PNG_READ_SUPPORTED */
  76.633 +
  76.634 +#if defined(PNG_WRITE_SUPPORTED)
  76.635 +
  76.636 +# if !defined(PNG_WRITE_TRANSFORMS_NOT_SUPPORTED) && \
  76.637 +    !defined(PNG_NO_WRITE_TRANSFORMS)
  76.638 +#  define PNG_WRITE_TRANSFORMS_SUPPORTED
  76.639 +#endif
  76.640 +
  76.641 +#ifdef PNG_WRITE_TRANSFORMS_SUPPORTED
  76.642 +#  ifndef PNG_NO_WRITE_SHIFT
  76.643 +#    define PNG_WRITE_SHIFT_SUPPORTED
  76.644 +#  endif
  76.645 +#  ifndef PNG_NO_WRITE_PACK
  76.646 +#    define PNG_WRITE_PACK_SUPPORTED
  76.647 +#  endif
  76.648 +#  ifndef PNG_NO_WRITE_BGR
  76.649 +#    define PNG_WRITE_BGR_SUPPORTED
  76.650 +#  endif
  76.651 +#  ifndef PNG_NO_WRITE_SWAP
  76.652 +#    define PNG_WRITE_SWAP_SUPPORTED
  76.653 +#  endif
  76.654 +#  ifndef PNG_NO_WRITE_PACKSWAP
  76.655 +#    define PNG_WRITE_PACKSWAP_SUPPORTED
  76.656 +#  endif
  76.657 +#  ifndef PNG_NO_WRITE_INVERT
  76.658 +#    define PNG_WRITE_INVERT_SUPPORTED
  76.659 +#  endif
  76.660 +#  ifndef PNG_NO_WRITE_FILLER
  76.661 +#    define PNG_WRITE_FILLER_SUPPORTED   /* same as WRITE_STRIP_ALPHA */
  76.662 +#  endif
  76.663 +#  ifndef PNG_NO_WRITE_SWAP_ALPHA
  76.664 +#    define PNG_WRITE_SWAP_ALPHA_SUPPORTED
  76.665 +#  endif
  76.666 +#  ifndef PNG_NO_WRITE_INVERT_ALPHA
  76.667 +#    define PNG_WRITE_INVERT_ALPHA_SUPPORTED
  76.668 +#  endif
  76.669 +#  ifndef PNG_NO_WRITE_USER_TRANSFORM
  76.670 +#    define PNG_WRITE_USER_TRANSFORM_SUPPORTED
  76.671 +#  endif
  76.672 +#endif /* PNG_WRITE_TRANSFORMS_SUPPORTED */
  76.673 +
  76.674 +#if !defined(PNG_NO_WRITE_INTERLACING_SUPPORTED) && \
  76.675 +    !defined(PNG_WRITE_INTERLACING_SUPPORTED)
  76.676 +#define PNG_WRITE_INTERLACING_SUPPORTED  /* not required for PNG-compliant
  76.677 +                                            encoders, but can cause trouble
  76.678 +                                            if left undefined */
  76.679 +#endif
  76.680 +
  76.681 +#if !defined(PNG_NO_WRITE_WEIGHTED_FILTER) && \
  76.682 +    !defined(PNG_WRITE_WEIGHTED_FILTER) && \
  76.683 +     defined(PNG_FLOATING_POINT_SUPPORTED)
  76.684 +#  define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
  76.685 +#endif
  76.686 +
  76.687 +#ifndef PNG_NO_WRITE_FLUSH
  76.688 +#  define PNG_WRITE_FLUSH_SUPPORTED
  76.689 +#endif
  76.690 +
  76.691 +#if defined(PNG_1_0_X) || defined (PNG_1_2_X)
  76.692 +/* Deprecated, see PNG_MNG_FEATURES_SUPPORTED, above */
  76.693 +#ifndef PNG_NO_WRITE_EMPTY_PLTE
  76.694 +#  define PNG_WRITE_EMPTY_PLTE_SUPPORTED
  76.695 +#endif
  76.696 +#endif
  76.697 +
  76.698 +#endif /* PNG_WRITE_SUPPORTED */
  76.699 +
  76.700 +#ifndef PNG_1_0_X
  76.701 +#  ifndef PNG_NO_ERROR_NUMBERS
  76.702 +#    define PNG_ERROR_NUMBERS_SUPPORTED
  76.703 +#  endif
  76.704 +#endif /* PNG_1_0_X */
  76.705 +
  76.706 +#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \
  76.707 +    defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)
  76.708 +#  ifndef PNG_NO_USER_TRANSFORM_PTR
  76.709 +#    define PNG_USER_TRANSFORM_PTR_SUPPORTED
  76.710 +#  endif
  76.711 +#endif
  76.712 +
  76.713 +#ifndef PNG_NO_STDIO
  76.714 +#  define PNG_TIME_RFC1123_SUPPORTED
  76.715 +#endif
  76.716 +
  76.717 +/* This adds extra functions in pngget.c for accessing data from the
  76.718 + * info pointer (added in version 0.99)
  76.719 + * png_get_image_width()
  76.720 + * png_get_image_height()
  76.721 + * png_get_bit_depth()
  76.722 + * png_get_color_type()
  76.723 + * png_get_compression_type()
  76.724 + * png_get_filter_type()
  76.725 + * png_get_interlace_type()
  76.726 + * png_get_pixel_aspect_ratio()
  76.727 + * png_get_pixels_per_meter()
  76.728 + * png_get_x_offset_pixels()
  76.729 + * png_get_y_offset_pixels()
  76.730 + * png_get_x_offset_microns()
  76.731 + * png_get_y_offset_microns()
  76.732 + */
  76.733 +#if !defined(PNG_NO_EASY_ACCESS) && !defined(PNG_EASY_ACCESS_SUPPORTED)
  76.734 +#  define PNG_EASY_ACCESS_SUPPORTED
  76.735 +#endif
  76.736 +
  76.737 +/* PNG_ASSEMBLER_CODE was enabled by default in version 1.2.0 
  76.738 + * and removed from version 1.2.20.  The following will be removed
  76.739 + * from libpng-1.4.0
  76.740 +*/
  76.741 +
  76.742 +#if defined(PNG_READ_SUPPORTED) && !defined(PNG_NO_OPTIMIZED_CODE)
  76.743 +#  ifndef PNG_OPTIMIZED_CODE_SUPPORTED
  76.744 +#    define PNG_OPTIMIZED_CODE_SUPPORTED
  76.745 +#  endif
  76.746 +#endif
  76.747 +
  76.748 +#if defined(PNG_READ_SUPPORTED) && !defined(PNG_NO_ASSEMBLER_CODE)
  76.749 +#  ifndef PNG_ASSEMBLER_CODE_SUPPORTED
  76.750 +#    define PNG_ASSEMBLER_CODE_SUPPORTED
  76.751 +#  endif
  76.752 +
  76.753 +#  if defined(__GNUC__) && defined(__x86_64__) && (__GNUC__ < 4)
  76.754 +     /* work around 64-bit gcc compiler bugs in gcc-3.x */
  76.755 +#    if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE)
  76.756 +#      define PNG_NO_MMX_CODE
  76.757 +#    endif
  76.758 +#  endif
  76.759 +
  76.760 +#  if defined(__APPLE__)
  76.761 +#    if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE)
  76.762 +#      define PNG_NO_MMX_CODE
  76.763 +#    endif
  76.764 +#  endif
  76.765 +
  76.766 +#  if (defined(__MWERKS__) && ((__MWERKS__ < 0x0900) || macintosh))
  76.767 +#    if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE)
  76.768 +#      define PNG_NO_MMX_CODE
  76.769 +#    endif
  76.770 +#  endif
  76.771 +
  76.772 +#  if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE)
  76.773 +#    define PNG_MMX_CODE_SUPPORTED
  76.774 +#  endif
  76.775 +
  76.776 +#endif
  76.777 +/* end of obsolete code to be removed from libpng-1.4.0 */
  76.778 +
  76.779 +#if !defined(PNG_1_0_X)
  76.780 +#if !defined(PNG_NO_USER_MEM) && !defined(PNG_USER_MEM_SUPPORTED)
  76.781 +#  define PNG_USER_MEM_SUPPORTED
  76.782 +#endif
  76.783 +#endif /* PNG_1_0_X */
  76.784 +
  76.785 +/* Added at libpng-1.2.6 */
  76.786 +#if !defined(PNG_1_0_X)
  76.787 +#ifndef PNG_SET_USER_LIMITS_SUPPORTED
  76.788 +#if !defined(PNG_NO_SET_USER_LIMITS) && !defined(PNG_SET_USER_LIMITS_SUPPORTED)
  76.789 +#  define PNG_SET_USER_LIMITS_SUPPORTED
  76.790 +#endif
  76.791 +#endif
  76.792 +#endif /* PNG_1_0_X */
  76.793 +
  76.794 +/* Added at libpng-1.0.16 and 1.2.6.  To accept all valid PNGS no matter
  76.795 + * how large, set these limits to 0x7fffffffL
  76.796 + */
  76.797 +#ifndef PNG_USER_WIDTH_MAX
  76.798 +#  define PNG_USER_WIDTH_MAX 1000000L
  76.799 +#endif
  76.800 +#ifndef PNG_USER_HEIGHT_MAX
  76.801 +#  define PNG_USER_HEIGHT_MAX 1000000L
  76.802 +#endif
  76.803 +
  76.804 +/* These are currently experimental features, define them if you want */
  76.805 +
  76.806 +/* very little testing */
  76.807 +/*
  76.808 +#ifdef PNG_READ_SUPPORTED
  76.809 +#  ifndef PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED
  76.810 +#    define PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED
  76.811 +#  endif
  76.812 +#endif
  76.813 +*/
  76.814 +
  76.815 +/* This is only for PowerPC big-endian and 680x0 systems */
  76.816 +/* some testing */
  76.817 +/*
  76.818 +#ifndef PNG_READ_BIG_ENDIAN_SUPPORTED
  76.819 +#  define PNG_READ_BIG_ENDIAN_SUPPORTED
  76.820 +#endif
  76.821 +*/
  76.822 +
  76.823 +/* Buggy compilers (e.g., gcc 2.7.2.2) need this */
  76.824 +/*
  76.825 +#define PNG_NO_POINTER_INDEXING
  76.826 +*/
  76.827 +
  76.828 +/* These functions are turned off by default, as they will be phased out. */
  76.829 +/*
  76.830 +#define  PNG_USELESS_TESTS_SUPPORTED
  76.831 +#define  PNG_CORRECT_PALETTE_SUPPORTED
  76.832 +*/
  76.833 +
  76.834 +/* Any chunks you are not interested in, you can undef here.  The
  76.835 + * ones that allocate memory may be expecially important (hIST,
  76.836 + * tEXt, zTXt, tRNS, pCAL).  Others will just save time and make png_info
  76.837 + * a bit smaller.
  76.838 + */
  76.839 +
  76.840 +#if defined(PNG_READ_SUPPORTED) && \
  76.841 +    !defined(PNG_READ_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \
  76.842 +    !defined(PNG_NO_READ_ANCILLARY_CHUNKS)
  76.843 +#  define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED
  76.844 +#endif
  76.845 +
  76.846 +#if defined(PNG_WRITE_SUPPORTED) && \
  76.847 +    !defined(PNG_WRITE_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \
  76.848 +    !defined(PNG_NO_WRITE_ANCILLARY_CHUNKS)
  76.849 +#  define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED
  76.850 +#endif
  76.851 +
  76.852 +#ifdef PNG_READ_ANCILLARY_CHUNKS_SUPPORTED
  76.853 +
  76.854 +#ifdef PNG_NO_READ_TEXT
  76.855 +#  define PNG_NO_READ_iTXt
  76.856 +#  define PNG_NO_READ_tEXt
  76.857 +#  define PNG_NO_READ_zTXt
  76.858 +#endif
  76.859 +#ifndef PNG_NO_READ_bKGD
  76.860 +#  define PNG_READ_bKGD_SUPPORTED
  76.861 +#  define PNG_bKGD_SUPPORTED
  76.862 +#endif
  76.863 +#ifndef PNG_NO_READ_cHRM
  76.864 +#  define PNG_READ_cHRM_SUPPORTED
  76.865 +#  define PNG_cHRM_SUPPORTED
  76.866 +#endif
  76.867 +#ifndef PNG_NO_READ_gAMA
  76.868 +#  define PNG_READ_gAMA_SUPPORTED
  76.869 +#  define PNG_gAMA_SUPPORTED
  76.870 +#endif
  76.871 +#ifndef PNG_NO_READ_hIST
  76.872 +#  define PNG_READ_hIST_SUPPORTED
  76.873 +#  define PNG_hIST_SUPPORTED
  76.874 +#endif
  76.875 +#ifndef PNG_NO_READ_iCCP
  76.876 +#  define PNG_READ_iCCP_SUPPORTED
  76.877 +#  define PNG_iCCP_SUPPORTED
  76.878 +#endif
  76.879 +#ifndef PNG_NO_READ_iTXt
  76.880 +#  ifndef PNG_READ_iTXt_SUPPORTED
  76.881 +#    define PNG_READ_iTXt_SUPPORTED
  76.882 +#  endif
  76.883 +#  ifndef PNG_iTXt_SUPPORTED
  76.884 +#    define PNG_iTXt_SUPPORTED
  76.885 +#  endif
  76.886 +#endif
  76.887 +#ifndef PNG_NO_READ_oFFs
  76.888 +#  define PNG_READ_oFFs_SUPPORTED
  76.889 +#  define PNG_oFFs_SUPPORTED
  76.890 +#endif
  76.891 +#ifndef PNG_NO_READ_pCAL
  76.892 +#  define PNG_READ_pCAL_SUPPORTED
  76.893 +#  define PNG_pCAL_SUPPORTED
  76.894 +#endif
  76.895 +#ifndef PNG_NO_READ_sCAL
  76.896 +#  define PNG_READ_sCAL_SUPPORTED
  76.897 +#  define PNG_sCAL_SUPPORTED
  76.898 +#endif
  76.899 +#ifndef PNG_NO_READ_pHYs
  76.900 +#  define PNG_READ_pHYs_SUPPORTED
  76.901 +#  define PNG_pHYs_SUPPORTED
  76.902 +#endif
  76.903 +#ifndef PNG_NO_READ_sBIT
  76.904 +#  define PNG_READ_sBIT_SUPPORTED
  76.905 +#  define PNG_sBIT_SUPPORTED
  76.906 +#endif
  76.907 +#ifndef PNG_NO_READ_sPLT
  76.908 +#  define PNG_READ_sPLT_SUPPORTED
  76.909 +#  define PNG_sPLT_SUPPORTED
  76.910 +#endif
  76.911 +#ifndef PNG_NO_READ_sRGB
  76.912 +#  define PNG_READ_sRGB_SUPPORTED
  76.913 +#  define PNG_sRGB_SUPPORTED
  76.914 +#endif
  76.915 +#ifndef PNG_NO_READ_tEXt
  76.916 +#  define PNG_READ_tEXt_SUPPORTED
  76.917 +#  define PNG_tEXt_SUPPORTED
  76.918 +#endif
  76.919 +#ifndef PNG_NO_READ_tIME
  76.920 +#  define PNG_READ_tIME_SUPPORTED
  76.921 +#  define PNG_tIME_SUPPORTED
  76.922 +#endif
  76.923 +#ifndef PNG_NO_READ_tRNS
  76.924 +#  define PNG_READ_tRNS_SUPPORTED
  76.925 +#  define PNG_tRNS_SUPPORTED
  76.926 +#endif
  76.927 +#ifndef PNG_NO_READ_zTXt
  76.928 +#  define PNG_READ_zTXt_SUPPORTED
  76.929 +#  define PNG_zTXt_SUPPORTED
  76.930 +#endif
  76.931 +#ifndef PNG_NO_READ_UNKNOWN_CHUNKS
  76.932 +#  define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED
  76.933 +#  ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED
  76.934 +#    define PNG_UNKNOWN_CHUNKS_SUPPORTED
  76.935 +#  endif
  76.936 +#  ifndef PNG_NO_HANDLE_AS_UNKNOWN
  76.937 +#    define PNG_HANDLE_AS_UNKNOWN_SUPPORTED
  76.938 +#  endif
  76.939 +#endif
  76.940 +#if !defined(PNG_NO_READ_USER_CHUNKS) && \
  76.941 +     defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED)
  76.942 +#  define PNG_READ_USER_CHUNKS_SUPPORTED
  76.943 +#  define PNG_USER_CHUNKS_SUPPORTED
  76.944 +#  ifdef PNG_NO_READ_UNKNOWN_CHUNKS
  76.945 +#    undef PNG_NO_READ_UNKNOWN_CHUNKS
  76.946 +#  endif
  76.947 +#  ifdef PNG_NO_HANDLE_AS_UNKNOWN
  76.948 +#    undef PNG_NO_HANDLE_AS_UNKNOWN
  76.949 +#  endif
  76.950 +#endif
  76.951 +#ifndef PNG_NO_READ_OPT_PLTE
  76.952 +#  define PNG_READ_OPT_PLTE_SUPPORTED /* only affects support of the */
  76.953 +#endif                      /* optional PLTE chunk in RGB and RGBA images */
  76.954 +#if defined(PNG_READ_iTXt_SUPPORTED) || defined(PNG_READ_tEXt_SUPPORTED) || \
  76.955 +    defined(PNG_READ_zTXt_SUPPORTED)
  76.956 +#  define PNG_READ_TEXT_SUPPORTED
  76.957 +#  define PNG_TEXT_SUPPORTED
  76.958 +#endif
  76.959 +
  76.960 +#endif /* PNG_READ_ANCILLARY_CHUNKS_SUPPORTED */
  76.961 +
  76.962 +#ifdef PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED
  76.963 +
  76.964 +#ifdef PNG_NO_WRITE_TEXT
  76.965 +#  define PNG_NO_WRITE_iTXt
  76.966 +#  define PNG_NO_WRITE_tEXt
  76.967 +#  define PNG_NO_WRITE_zTXt
  76.968 +#endif
  76.969 +#ifndef PNG_NO_WRITE_bKGD
  76.970 +#  define PNG_WRITE_bKGD_SUPPORTED
  76.971 +#  ifndef PNG_bKGD_SUPPORTED
  76.972 +#    define PNG_bKGD_SUPPORTED
  76.973 +#  endif
  76.974 +#endif
  76.975 +#ifndef PNG_NO_WRITE_cHRM
  76.976 +#  define PNG_WRITE_cHRM_SUPPORTED
  76.977 +#  ifndef PNG_cHRM_SUPPORTED
  76.978 +#    define PNG_cHRM_SUPPORTED
  76.979 +#  endif
  76.980 +#endif
  76.981 +#ifndef PNG_NO_WRITE_gAMA
  76.982 +#  define PNG_WRITE_gAMA_SUPPORTED
  76.983 +#  ifndef PNG_gAMA_SUPPORTED
  76.984 +#    define PNG_gAMA_SUPPORTED
  76.985 +#  endif
  76.986 +#endif
  76.987 +#ifndef PNG_NO_WRITE_hIST
  76.988 +#  define PNG_WRITE_hIST_SUPPORTED
  76.989 +#  ifndef PNG_hIST_SUPPORTED
  76.990 +#    define PNG_hIST_SUPPORTED
  76.991 +#  endif
  76.992 +#endif
  76.993 +#ifndef PNG_NO_WRITE_iCCP
  76.994 +#  define PNG_WRITE_iCCP_SUPPORTED
  76.995 +#  ifndef PNG_iCCP_SUPPORTED
  76.996 +#    define PNG_iCCP_SUPPORTED
  76.997 +#  endif
  76.998 +#endif
  76.999 +#ifndef PNG_NO_WRITE_iTXt
 76.1000 +#  ifndef PNG_WRITE_iTXt_SUPPORTED
 76.1001 +#    define PNG_WRITE_iTXt_SUPPORTED
 76.1002 +#  endif
 76.1003 +#  ifndef PNG_iTXt_SUPPORTED
 76.1004 +#    define PNG_iTXt_SUPPORTED
 76.1005 +#  endif
 76.1006 +#endif
 76.1007 +#ifndef PNG_NO_WRITE_oFFs
 76.1008 +#  define PNG_WRITE_oFFs_SUPPORTED
 76.1009 +#  ifndef PNG_oFFs_SUPPORTED
 76.1010 +#    define PNG_oFFs_SUPPORTED
 76.1011 +#  endif
 76.1012 +#endif
 76.1013 +#ifndef PNG_NO_WRITE_pCAL
 76.1014 +#  define PNG_WRITE_pCAL_SUPPORTED
 76.1015 +#  ifndef PNG_pCAL_SUPPORTED
 76.1016 +#    define PNG_pCAL_SUPPORTED
 76.1017 +#  endif
 76.1018 +#endif
 76.1019 +#ifndef PNG_NO_WRITE_sCAL
 76.1020 +#  define PNG_WRITE_sCAL_SUPPORTED
 76.1021 +#  ifndef PNG_sCAL_SUPPORTED
 76.1022 +#    define PNG_sCAL_SUPPORTED
 76.1023 +#  endif
 76.1024 +#endif
 76.1025 +#ifndef PNG_NO_WRITE_pHYs
 76.1026 +#  define PNG_WRITE_pHYs_SUPPORTED
 76.1027 +#  ifndef PNG_pHYs_SUPPORTED
 76.1028 +#    define PNG_pHYs_SUPPORTED
 76.1029 +#  endif
 76.1030 +#endif
 76.1031 +#ifndef PNG_NO_WRITE_sBIT
 76.1032 +#  define PNG_WRITE_sBIT_SUPPORTED
 76.1033 +#  ifndef PNG_sBIT_SUPPORTED
 76.1034 +#    define PNG_sBIT_SUPPORTED
 76.1035 +#  endif
 76.1036 +#endif
 76.1037 +#ifndef PNG_NO_WRITE_sPLT
 76.1038 +#  define PNG_WRITE_sPLT_SUPPORTED
 76.1039 +#  ifndef PNG_sPLT_SUPPORTED
 76.1040 +#    define PNG_sPLT_SUPPORTED
 76.1041 +#  endif
 76.1042 +#endif
 76.1043 +#ifndef PNG_NO_WRITE_sRGB
 76.1044 +#  define PNG_WRITE_sRGB_SUPPORTED
 76.1045 +#  ifndef PNG_sRGB_SUPPORTED
 76.1046 +#    define PNG_sRGB_SUPPORTED
 76.1047 +#  endif
 76.1048 +#endif
 76.1049 +#ifndef PNG_NO_WRITE_tEXt
 76.1050 +#  define PNG_WRITE_tEXt_SUPPORTED
 76.1051 +#  ifndef PNG_tEXt_SUPPORTED
 76.1052 +#    define PNG_tEXt_SUPPORTED
 76.1053 +#  endif
 76.1054 +#endif
 76.1055 +#ifndef PNG_NO_WRITE_tIME
 76.1056 +#  define PNG_WRITE_tIME_SUPPORTED
 76.1057 +#  ifndef PNG_tIME_SUPPORTED
 76.1058 +#    define PNG_tIME_SUPPORTED
 76.1059 +#  endif
 76.1060 +#endif
 76.1061 +#ifndef PNG_NO_WRITE_tRNS
 76.1062 +#  define PNG_WRITE_tRNS_SUPPORTED
 76.1063 +#  ifndef PNG_tRNS_SUPPORTED
 76.1064 +#    define PNG_tRNS_SUPPORTED
 76.1065 +#  endif
 76.1066 +#endif
 76.1067 +#ifndef PNG_NO_WRITE_zTXt
 76.1068 +#  define PNG_WRITE_zTXt_SUPPORTED
 76.1069 +#  ifndef PNG_zTXt_SUPPORTED
 76.1070 +#    define PNG_zTXt_SUPPORTED
 76.1071 +#  endif
 76.1072 +#endif
 76.1073 +#ifndef PNG_NO_WRITE_UNKNOWN_CHUNKS
 76.1074 +#  define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED
 76.1075 +#  ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED
 76.1076 +#    define PNG_UNKNOWN_CHUNKS_SUPPORTED
 76.1077 +#  endif
 76.1078 +#  ifndef PNG_NO_HANDLE_AS_UNKNOWN
 76.1079 +#     ifndef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
 76.1080 +#       define PNG_HANDLE_AS_UNKNOWN_SUPPORTED
 76.1081 +#     endif
 76.1082 +#  endif
 76.1083 +#endif
 76.1084 +#if defined(PNG_WRITE_iTXt_SUPPORTED) || defined(PNG_WRITE_tEXt_SUPPORTED) || \
 76.1085 +    defined(PNG_WRITE_zTXt_SUPPORTED)
 76.1086 +#  define PNG_WRITE_TEXT_SUPPORTED
 76.1087 +#  ifndef PNG_TEXT_SUPPORTED
 76.1088 +#    define PNG_TEXT_SUPPORTED
 76.1089 +#  endif
 76.1090 +#endif
 76.1091 +
 76.1092 +#endif /* PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED */
 76.1093 +
 76.1094 +/* Turn this off to disable png_read_png() and
 76.1095 + * png_write_png() and leave the row_pointers member
 76.1096 + * out of the info structure.
 76.1097 + */
 76.1098 +#ifndef PNG_NO_INFO_IMAGE
 76.1099 +#  define PNG_INFO_IMAGE_SUPPORTED
 76.1100 +#endif
 76.1101 +
 76.1102 +/* need the time information for reading tIME chunks */
 76.1103 +#if defined(PNG_tIME_SUPPORTED)
 76.1104 +#  if !defined(_WIN32_WCE)
 76.1105 +     /* "time.h" functions are not supported on WindowsCE */
 76.1106 +#    include <time.h>
 76.1107 +#  endif
 76.1108 +#endif
 76.1109 +
 76.1110 +/* Some typedefs to get us started.  These should be safe on most of the
 76.1111 + * common platforms.  The typedefs should be at least as large as the
 76.1112 + * numbers suggest (a png_uint_32 must be at least 32 bits long), but they
 76.1113 + * don't have to be exactly that size.  Some compilers dislike passing
 76.1114 + * unsigned shorts as function parameters, so you may be better off using
 76.1115 + * unsigned int for png_uint_16.  Likewise, for 64-bit systems, you may
 76.1116 + * want to have unsigned int for png_uint_32 instead of unsigned long.
 76.1117 + */
 76.1118 +
 76.1119 +typedef unsigned long png_uint_32;
 76.1120 +typedef long png_int_32;
 76.1121 +typedef unsigned short png_uint_16;
 76.1122 +typedef short png_int_16;
 76.1123 +typedef unsigned char png_byte;
 76.1124 +
 76.1125 +/* This is usually size_t.  It is typedef'ed just in case you need it to
 76.1126 +   change (I'm not sure if you will or not, so I thought I'd be safe) */
 76.1127 +#ifdef PNG_SIZE_T
 76.1128 +   typedef PNG_SIZE_T png_size_t;
 76.1129 +#  define png_sizeof(x) png_convert_size(sizeof(x))
 76.1130 +#else
 76.1131 +   typedef size_t png_size_t;
 76.1132 +#  define png_sizeof(x) sizeof(x)
 76.1133 +#endif
 76.1134 +
 76.1135 +/* The following is needed for medium model support.  It cannot be in the
 76.1136 + * PNG_INTERNAL section.  Needs modification for other compilers besides
 76.1137 + * MSC.  Model independent support declares all arrays and pointers to be
 76.1138 + * large using the far keyword.  The zlib version used must also support
 76.1139 + * model independent data.  As of version zlib 1.0.4, the necessary changes
 76.1140 + * have been made in zlib.  The USE_FAR_KEYWORD define triggers other
 76.1141 + * changes that are needed. (Tim Wegner)
 76.1142 + */
 76.1143 +
 76.1144 +/* Separate compiler dependencies (problem here is that zlib.h always
 76.1145 +   defines FAR. (SJT) */
 76.1146 +#ifdef __BORLANDC__
 76.1147 +#  if defined(__LARGE__) || defined(__HUGE__) || defined(__COMPACT__)
 76.1148 +#    define LDATA 1
 76.1149 +#  else
 76.1150 +#    define LDATA 0
 76.1151 +#  endif
 76.1152 +   /* GRR:  why is Cygwin in here?  Cygwin is not Borland C... */
 76.1153 +#  if !defined(__WIN32__) && !defined(__FLAT__) && !defined(__CYGWIN__)
 76.1154 +#    define PNG_MAX_MALLOC_64K
 76.1155 +#    if (LDATA != 1)
 76.1156 +#      ifndef FAR
 76.1157 +#        define FAR __far
 76.1158 +#      endif
 76.1159 +#      define USE_FAR_KEYWORD
 76.1160 +#    endif   /* LDATA != 1 */
 76.1161 +     /* Possibly useful for moving data out of default segment.
 76.1162 +      * Uncomment it if you want. Could also define FARDATA as
 76.1163 +      * const if your compiler supports it. (SJT)
 76.1164 +#    define FARDATA FAR
 76.1165 +      */
 76.1166 +#  endif  /* __WIN32__, __FLAT__, __CYGWIN__ */
 76.1167 +#endif   /* __BORLANDC__ */
 76.1168 +
 76.1169 +
 76.1170 +/* Suggest testing for specific compiler first before testing for
 76.1171 + * FAR.  The Watcom compiler defines both __MEDIUM__ and M_I86MM,
 76.1172 + * making reliance oncertain keywords suspect. (SJT)
 76.1173 + */
 76.1174 +
 76.1175 +/* MSC Medium model */
 76.1176 +#if defined(FAR)
 76.1177 +#  if defined(M_I86MM)
 76.1178 +#    define USE_FAR_KEYWORD
 76.1179 +#    define FARDATA FAR
 76.1180 +#    include <dos.h>
 76.1181 +#  endif
 76.1182 +#endif
 76.1183 +
 76.1184 +/* SJT: default case */
 76.1185 +#ifndef FAR
 76.1186 +#  define FAR
 76.1187 +#endif
 76.1188 +
 76.1189 +/* At this point FAR is always defined */
 76.1190 +#ifndef FARDATA
 76.1191 +#  define FARDATA
 76.1192 +#endif
 76.1193 +
 76.1194 +/* Typedef for floating-point numbers that are converted
 76.1195 +   to fixed-point with a multiple of 100,000, e.g., int_gamma */
 76.1196 +typedef png_int_32 png_fixed_point;
 76.1197 +
 76.1198 +/* Add typedefs for pointers */
 76.1199 +typedef void            FAR * png_voidp;
 76.1200 +typedef png_byte        FAR * png_bytep;
 76.1201 +typedef png_uint_32     FAR * png_uint_32p;
 76.1202 +typedef png_int_32      FAR * png_int_32p;
 76.1203 +typedef png_uint_16     FAR * png_uint_16p;
 76.1204 +typedef png_int_16      FAR * png_int_16p;
 76.1205 +typedef PNG_CONST char  FAR * png_const_charp;
 76.1206 +typedef char            FAR * png_charp;
 76.1207 +typedef png_fixed_point FAR * png_fixed_point_p;
 76.1208 +
 76.1209 +#ifndef PNG_NO_STDIO
 76.1210 +#if defined(_WIN32_WCE)
 76.1211 +typedef HANDLE                png_FILE_p;
 76.1212 +#else
 76.1213 +typedef FILE                * png_FILE_p;
 76.1214 +#endif
 76.1215 +#endif
 76.1216 +
 76.1217 +#ifdef PNG_FLOATING_POINT_SUPPORTED
 76.1218 +typedef double          FAR * png_doublep;
 76.1219 +#endif
 76.1220 +
 76.1221 +/* Pointers to pointers; i.e. arrays */
 76.1222 +typedef png_byte        FAR * FAR * png_bytepp;
 76.1223 +typedef png_uint_32     FAR * FAR * png_uint_32pp;
 76.1224 +typedef png_int_32      FAR * FAR * png_int_32pp;
 76.1225 +typedef png_uint_16     FAR * FAR * png_uint_16pp;
 76.1226 +typedef png_int_16      FAR * FAR * png_int_16pp;
 76.1227 +typedef PNG_CONST char  FAR * FAR * png_const_charpp;
 76.1228 +typedef char            FAR * FAR * png_charpp;
 76.1229 +typedef png_fixed_point FAR * FAR * png_fixed_point_pp;
 76.1230 +#ifdef PNG_FLOATING_POINT_SUPPORTED
 76.1231 +typedef double          FAR * FAR * png_doublepp;
 76.1232 +#endif
 76.1233 +
 76.1234 +/* Pointers to pointers to pointers; i.e., pointer to array */
 76.1235 +typedef char            FAR * FAR * FAR * png_charppp;
 76.1236 +
 76.1237 +#if defined(PNG_1_0_X) || defined(PNG_1_2_X)
 76.1238 +/* SPC -  Is this stuff deprecated? */
 76.1239 +/* It'll be removed as of libpng-1.3.0 - GR-P */
 76.1240 +/* libpng typedefs for types in zlib. If zlib changes
 76.1241 + * or another compression library is used, then change these.
 76.1242 + * Eliminates need to change all the source files.
 76.1243 + */
 76.1244 +typedef charf *         png_zcharp;
 76.1245 +typedef charf * FAR *   png_zcharpp;
 76.1246 +typedef z_stream FAR *  png_zstreamp;
 76.1247 +#endif /* (PNG_1_0_X) || defined(PNG_1_2_X) */
 76.1248 +
 76.1249 +/*
 76.1250 + * Define PNG_BUILD_DLL if the module being built is a Windows
 76.1251 + * LIBPNG DLL.
 76.1252 + *
 76.1253 + * Define PNG_USE_DLL if you want to *link* to the Windows LIBPNG DLL.
 76.1254 + * It is equivalent to Microsoft predefined macro _DLL that is
 76.1255 + * automatically defined when you compile using the share
 76.1256 + * version of the CRT (C Run-Time library)
 76.1257 + *
 76.1258 + * The cygwin mods make this behavior a little different:
 76.1259 + * Define PNG_BUILD_DLL if you are building a dll for use with cygwin
 76.1260 + * Define PNG_STATIC if you are building a static library for use with cygwin,
 76.1261 + *   -or- if you are building an application that you want to link to the
 76.1262 + *   static library.
 76.1263 + * PNG_USE_DLL is defined by default (no user action needed) unless one of
 76.1264 + *   the other flags is defined.
 76.1265 + */
 76.1266 +
 76.1267 +#if !defined(PNG_DLL) && (defined(PNG_BUILD_DLL) || defined(PNG_USE_DLL))
 76.1268 +#  define PNG_DLL
 76.1269 +#endif
 76.1270 +/* If CYGWIN, then disallow GLOBAL ARRAYS unless building a static lib.
 76.1271 + * When building a static lib, default to no GLOBAL ARRAYS, but allow
 76.1272 + * command-line override
 76.1273 + */
 76.1274 +#if defined(__CYGWIN__)
 76.1275 +#  if !defined(PNG_STATIC)
 76.1276 +#    if defined(PNG_USE_GLOBAL_ARRAYS)
 76.1277 +#      undef PNG_USE_GLOBAL_ARRAYS
 76.1278 +#    endif
 76.1279 +#    if !defined(PNG_USE_LOCAL_ARRAYS)
 76.1280 +#      define PNG_USE_LOCAL_ARRAYS
 76.1281 +#    endif
 76.1282 +#  else
 76.1283 +#    if defined(PNG_USE_LOCAL_ARRAYS) || defined(PNG_NO_GLOBAL_ARRAYS)
 76.1284 +#      if defined(PNG_USE_GLOBAL_ARRAYS)
 76.1285 +#        undef PNG_USE_GLOBAL_ARRAYS
 76.1286 +#      endif
 76.1287 +#    endif
 76.1288 +#  endif
 76.1289 +#  if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS)
 76.1290 +#    define PNG_USE_LOCAL_ARRAYS
 76.1291 +#  endif
 76.1292 +#endif
 76.1293 +
 76.1294 +/* Do not use global arrays (helps with building DLL's)
 76.1295 + * They are no longer used in libpng itself, since version 1.0.5c,
 76.1296 + * but might be required for some pre-1.0.5c applications.
 76.1297 + */
 76.1298 +#if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS)
 76.1299 +#  if defined(PNG_NO_GLOBAL_ARRAYS) || \
 76.1300 +      (defined(__GNUC__) && defined(PNG_DLL)) || defined(_MSC_VER)
 76.1301 +#    define PNG_USE_LOCAL_ARRAYS
 76.1302 +#  else
 76.1303 +#    define PNG_USE_GLOBAL_ARRAYS
 76.1304 +#  endif
 76.1305 +#endif
 76.1306 +
 76.1307 +#if defined(__CYGWIN__)
 76.1308 +#  undef PNGAPI
 76.1309 +#  define PNGAPI __cdecl
 76.1310 +#  undef PNG_IMPEXP
 76.1311 +#  define PNG_IMPEXP
 76.1312 +#endif  
 76.1313 +
 76.1314 +/* If you define PNGAPI, e.g., with compiler option "-DPNGAPI=__stdcall",
 76.1315 + * you may get warnings regarding the linkage of png_zalloc and png_zfree.
 76.1316 + * Don't ignore those warnings; you must also reset the default calling
 76.1317 + * convention in your compiler to match your PNGAPI, and you must build
 76.1318 + * zlib and your applications the same way you build libpng.
 76.1319 + */
 76.1320 +
 76.1321 +#if defined(__MINGW32__) && !defined(PNG_MODULEDEF)
 76.1322 +#  ifndef PNG_NO_MODULEDEF
 76.1323 +#    define PNG_NO_MODULEDEF
 76.1324 +#  endif
 76.1325 +#endif
 76.1326 +
 76.1327 +#if !defined(PNG_IMPEXP) && defined(PNG_BUILD_DLL) && !defined(PNG_NO_MODULEDEF)
 76.1328 +#  define PNG_IMPEXP
 76.1329 +#endif
 76.1330 +
 76.1331 +#if defined(PNG_DLL) || defined(_DLL) || defined(__DLL__ ) || \
 76.1332 +    (( defined(_Windows) || defined(_WINDOWS) || \
 76.1333 +       defined(WIN32) || defined(_WIN32) || defined(__WIN32__) ))
 76.1334 +
 76.1335 +#  ifndef PNGAPI
 76.1336 +#     if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800))
 76.1337 +#        define PNGAPI __cdecl
 76.1338 +#     else
 76.1339 +#        define PNGAPI _cdecl
 76.1340 +#     endif
 76.1341 +#  endif
 76.1342 +
 76.1343 +#  if !defined(PNG_IMPEXP) && (!defined(PNG_DLL) || \
 76.1344 +       0 /* WINCOMPILER_WITH_NO_SUPPORT_FOR_DECLIMPEXP */)
 76.1345 +#     define PNG_IMPEXP
 76.1346 +#  endif
 76.1347 +
 76.1348 +#  if !defined(PNG_IMPEXP)
 76.1349 +
 76.1350 +#     define PNG_EXPORT_TYPE1(type,symbol)  PNG_IMPEXP type PNGAPI symbol
 76.1351 +#     define PNG_EXPORT_TYPE2(type,symbol)  type PNG_IMPEXP PNGAPI symbol
 76.1352 +
 76.1353 +      /* Borland/Microsoft */
 76.1354 +#     if defined(_MSC_VER) || defined(__BORLANDC__)
 76.1355 +#        if (_MSC_VER >= 800) || (__BORLANDC__ >= 0x500)
 76.1356 +#           define PNG_EXPORT PNG_EXPORT_TYPE1
 76.1357 +#        else
 76.1358 +#           define PNG_EXPORT PNG_EXPORT_TYPE2
 76.1359 +#           if defined(PNG_BUILD_DLL)
 76.1360 +#              define PNG_IMPEXP __export
 76.1361 +#           else
 76.1362 +#              define PNG_IMPEXP /*__import */ /* doesn't exist AFAIK in
 76.1363 +                                                 VC++ */
 76.1364 +#           endif                             /* Exists in Borland C++ for
 76.1365 +                                                 C++ classes (== huge) */
 76.1366 +#        endif
 76.1367 +#     endif
 76.1368 +
 76.1369 +#     if !defined(PNG_IMPEXP)
 76.1370 +#        if defined(PNG_BUILD_DLL)
 76.1371 +#           define PNG_IMPEXP __declspec(dllexport)
 76.1372 +#        else
 76.1373 +#           define PNG_IMPEXP __declspec(dllimport)
 76.1374 +#        endif
 76.1375 +#     endif
 76.1376 +#  endif  /* PNG_IMPEXP */
 76.1377 +#else /* !(DLL || non-cygwin WINDOWS) */
 76.1378 +#   if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__)
 76.1379 +#      ifndef PNGAPI
 76.1380 +#         define PNGAPI _System
 76.1381 +#      endif
 76.1382 +#   else
 76.1383 +#      if 0 /* ... other platforms, with other meanings */
 76.1384 +#      endif
 76.1385 +#   endif
 76.1386 +#endif
 76.1387 +
 76.1388 +#ifndef PNGAPI
 76.1389 +#  define PNGAPI
 76.1390 +#endif
 76.1391 +#ifndef PNG_IMPEXP
 76.1392 +#  define PNG_IMPEXP
 76.1393 +#endif
 76.1394 +
 76.1395 +#ifdef PNG_BUILDSYMS
 76.1396 +#  ifndef PNG_EXPORT
 76.1397 +#    define PNG_EXPORT(type,symbol) PNG_FUNCTION_EXPORT symbol END
 76.1398 +#  endif
 76.1399 +#  ifdef PNG_USE_GLOBAL_ARRAYS
 76.1400 +#    ifndef PNG_EXPORT_VAR
 76.1401 +#      define PNG_EXPORT_VAR(type) PNG_DATA_EXPORT
 76.1402 +#    endif
 76.1403 +#  endif
 76.1404 +#endif
 76.1405 +
 76.1406 +#ifndef PNG_EXPORT
 76.1407 +#  define PNG_EXPORT(type,symbol) PNG_IMPEXP type PNGAPI symbol
 76.1408 +#endif
 76.1409 +
 76.1410 +#ifdef PNG_USE_GLOBAL_ARRAYS
 76.1411 +#  ifndef PNG_EXPORT_VAR
 76.1412 +#    define PNG_EXPORT_VAR(type) extern PNG_IMPEXP type
 76.1413 +#  endif
 76.1414 +#endif
 76.1415 +
 76.1416 +/* User may want to use these so they are not in PNG_INTERNAL. Any library
 76.1417 + * functions that are passed far data must be model independent.
 76.1418 + */
 76.1419 +
 76.1420 +#ifndef PNG_ABORT
 76.1421 +#  define PNG_ABORT() abort()
 76.1422 +#endif
 76.1423 +
 76.1424 +#ifdef PNG_SETJMP_SUPPORTED
 76.1425 +#  define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf)
 76.1426 +#else
 76.1427 +#  define png_jmpbuf(png_ptr) \
 76.1428 +   (LIBPNG_WAS_COMPILED_WITH__PNG_SETJMP_NOT_SUPPORTED)
 76.1429 +#endif
 76.1430 +
 76.1431 +#if defined(USE_FAR_KEYWORD)  /* memory model independent fns */
 76.1432 +/* use this to make far-to-near assignments */
 76.1433 +#  define CHECK   1
 76.1434 +#  define NOCHECK 0
 76.1435 +#  define CVT_PTR(ptr) (png_far_to_near(png_ptr,ptr,CHECK))
 76.1436 +#  define CVT_PTR_NOCHECK(ptr) (png_far_to_near(png_ptr,ptr,NOCHECK))
 76.1437 +#  define png_snprintf _fsnprintf   /* Added to v 1.2.19 */
 76.1438 +#  define png_strlen  _fstrlen
 76.1439 +#  define png_memcmp  _fmemcmp    /* SJT: added */
 76.1440 +#  define png_memcpy  _fmemcpy
 76.1441 +#  define png_memset  _fmemset
 76.1442 +#else /* use the usual functions */
 76.1443 +#  define CVT_PTR(ptr)         (ptr)
 76.1444 +#  define CVT_PTR_NOCHECK(ptr) (ptr)
 76.1445 +#  ifndef PNG_NO_SNPRINTF
 76.1446 +#    ifdef _MSC_VER
 76.1447 +#      define png_snprintf _snprintf   /* Added to v 1.2.19 */
 76.1448 +#      define png_snprintf2 _snprintf
 76.1449 +#      define png_snprintf6 _snprintf
 76.1450 +#    else
 76.1451 +#      define png_snprintf snprintf   /* Added to v 1.2.19 */
 76.1452 +#      define png_snprintf2 snprintf
 76.1453 +#      define png_snprintf6 snprintf
 76.1454 +#    endif
 76.1455 +#  else
 76.1456 +     /* You don't have or don't want to use snprintf().  Caution: Using
 76.1457 +      * sprintf instead of snprintf exposes your application to accidental
 76.1458 +      * or malevolent buffer overflows.  If you don't have snprintf()
 76.1459 +      * as a general rule you should provide one (you can get one from
 76.1460 +      * Portable OpenSSH). */
 76.1461 +#    define png_snprintf(s1,n,fmt,x1) sprintf(s1,fmt,x1)
 76.1462 +#    define png_snprintf2(s1,n,fmt,x1,x2) sprintf(s1,fmt,x1,x2)
 76.1463 +#    define png_snprintf6(s1,n,fmt,x1,x2,x3,x4,x5,x6) \
 76.1464 +        sprintf(s1,fmt,x1,x2,x3,x4,x5,x6)
 76.1465 +#  endif
 76.1466 +#  define png_strlen  strlen
 76.1467 +#  define png_memcmp  memcmp      /* SJT: added */
 76.1468 +#  define png_memcpy  memcpy
 76.1469 +#  define png_memset  memset
 76.1470 +#endif
 76.1471 +/* End of memory model independent support */
 76.1472 +
 76.1473 +/* Just a little check that someone hasn't tried to define something
 76.1474 + * contradictory.
 76.1475 + */
 76.1476 +#if (PNG_ZBUF_SIZE > 65536L) && defined(PNG_MAX_MALLOC_64K)
 76.1477 +#  undef PNG_ZBUF_SIZE
 76.1478 +#  define PNG_ZBUF_SIZE 65536L
 76.1479 +#endif
 76.1480 +
 76.1481 +/* Added at libpng-1.2.8 */
 76.1482 +#endif /* PNG_VERSION_INFO_ONLY */
 76.1483 +
 76.1484 +#endif /* PNGCONF_H */
    77.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    77.2 +++ b/libs/libpng/pngerror.c	Sun Nov 01 00:36:56 2015 +0200
    77.3 @@ -0,0 +1,345 @@
    77.4 +
    77.5 +/* pngerror.c - stub functions for i/o and memory allocation
    77.6 + *
    77.7 + * Last changed in libpng 1.2.30 [August 15, 2008]
    77.8 + * For conditions of distribution and use, see copyright notice in png.h
    77.9 + * Copyright (c) 1998-2008 Glenn Randers-Pehrson
   77.10 + * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
   77.11 + * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
   77.12 + *
   77.13 + * This file provides a location for all error handling.  Users who
   77.14 + * need special error handling are expected to write replacement functions
   77.15 + * and use png_set_error_fn() to use those functions.  See the instructions
   77.16 + * at each function.
   77.17 + */
   77.18 +
   77.19 +#define PNG_INTERNAL
   77.20 +#include "png.h"
   77.21 +#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
   77.22 +
   77.23 +static void /* PRIVATE */
   77.24 +png_default_error PNGARG((png_structp png_ptr,
   77.25 +  png_const_charp error_message));
   77.26 +#ifndef PNG_NO_WARNINGS
   77.27 +static void /* PRIVATE */
   77.28 +png_default_warning PNGARG((png_structp png_ptr,
   77.29 +  png_const_charp warning_message));
   77.30 +#endif /* PNG_NO_WARNINGS */
   77.31 +
   77.32 +/* This function is called whenever there is a fatal error.  This function
   77.33 + * should not be changed.  If there is a need to handle errors differently,
   77.34 + * you should supply a replacement error function and use png_set_error_fn()
   77.35 + * to replace the error function at run-time.
   77.36 + */
   77.37 +#ifndef PNG_NO_ERROR_TEXT
   77.38 +void PNGAPI
   77.39 +png_error(png_structp png_ptr, png_const_charp error_message)
   77.40 +{
   77.41 +#ifdef PNG_ERROR_NUMBERS_SUPPORTED
   77.42 +   char msg[16];
   77.43 +   if (png_ptr != NULL)
   77.44 +   {
   77.45 +     if (png_ptr->flags&
   77.46 +       (PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT))
   77.47 +     {
   77.48 +       if (*error_message == '#')
   77.49 +       {
   77.50 +         /* Strip "#nnnn " from beginning of error message. */
   77.51 +           int offset;
   77.52 +           for (offset = 1; offset<15; offset++)
   77.53 +              if (error_message[offset] == ' ')
   77.54 +                  break;
   77.55 +           if (png_ptr->flags&PNG_FLAG_STRIP_ERROR_TEXT)
   77.56 +           {
   77.57 +              int i;
   77.58 +              for (i = 0; i < offset - 1; i++)
   77.59 +                 msg[i] = error_message[i + 1];
   77.60 +              msg[i - 1] = '\0';
   77.61 +              error_message = msg;
   77.62 +           }
   77.63 +           else
   77.64 +              error_message += offset;
   77.65 +       }
   77.66 +       else
   77.67 +       {
   77.68 +           if (png_ptr->flags&PNG_FLAG_STRIP_ERROR_TEXT)
   77.69 +           {
   77.70 +              msg[0] = '0';
   77.71 +              msg[1] = '\0';
   77.72 +              error_message = msg;
   77.73 +           }
   77.74 +       }
   77.75 +     }
   77.76 +   }
   77.77 +#endif
   77.78 +   if (png_ptr != NULL && png_ptr->error_fn != NULL)
   77.79 +      (*(png_ptr->error_fn))(png_ptr, error_message);
   77.80 +
   77.81 +   /* If the custom handler doesn't exist, or if it returns,
   77.82 +      use the default handler, which will not return. */
   77.83 +   png_default_error(png_ptr, error_message);
   77.84 +}
   77.85 +#else
   77.86 +void PNGAPI
   77.87 +png_err(png_structp png_ptr)
   77.88 +{
   77.89 +   if (png_ptr != NULL && png_ptr->error_fn != NULL)
   77.90 +      (*(png_ptr->error_fn))(png_ptr, '\0');
   77.91 +
   77.92 +   /* If the custom handler doesn't exist, or if it returns,
   77.93 +      use the default handler, which will not return. */
   77.94 +   png_default_error(png_ptr, '\0');
   77.95 +}
   77.96 +#endif /* PNG_NO_ERROR_TEXT */
   77.97 +
   77.98 +#ifndef PNG_NO_WARNINGS
   77.99 +/* This function is called whenever there is a non-fatal error.  This function
  77.100 + * should not be changed.  If there is a need to handle warnings differently,
  77.101 + * you should supply a replacement warning function and use
  77.102 + * png_set_error_fn() to replace the warning function at run-time.
  77.103 + */
  77.104 +void PNGAPI
  77.105 +png_warning(png_structp png_ptr, png_const_charp warning_message)
  77.106 +{
  77.107 +   int offset = 0;
  77.108 +   if (png_ptr != NULL)
  77.109 +   {
  77.110 +#ifdef PNG_ERROR_NUMBERS_SUPPORTED
  77.111 +   if (png_ptr->flags&
  77.112 +     (PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT))
  77.113 +#endif
  77.114 +     {
  77.115 +       if (*warning_message == '#')
  77.116 +       {
  77.117 +           for (offset = 1; offset < 15; offset++)
  77.118 +              if (warning_message[offset] == ' ')
  77.119 +                  break;
  77.120 +       }
  77.121 +     }
  77.122 +     if (png_ptr != NULL && png_ptr->warning_fn != NULL)
  77.123 +        (*(png_ptr->warning_fn))(png_ptr, warning_message + offset);
  77.124 +   }
  77.125 +   else
  77.126 +      png_default_warning(png_ptr, warning_message + offset);
  77.127 +}
  77.128 +#endif /* PNG_NO_WARNINGS */
  77.129 +
  77.130 +
  77.131 +/* These utilities are used internally to build an error message that relates
  77.132 + * to the current chunk.  The chunk name comes from png_ptr->chunk_name,
  77.133 + * this is used to prefix the message.  The message is limited in length
  77.134 + * to 63 bytes, the name characters are output as hex digits wrapped in []
  77.135 + * if the character is invalid.
  77.136 + */
  77.137 +#define isnonalpha(c) ((c) < 65 || (c) > 122 || ((c) > 90 && (c) < 97))
  77.138 +static PNG_CONST char png_digit[16] = {
  77.139 +   '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
  77.140 +   'A', 'B', 'C', 'D', 'E', 'F'
  77.141 +};
  77.142 +
  77.143 +#define PNG_MAX_ERROR_TEXT 64
  77.144 +
  77.145 +#if !defined(PNG_NO_WARNINGS) || !defined(PNG_NO_ERROR_TEXT)
  77.146 +static void /* PRIVATE */
  77.147 +png_format_buffer(png_structp png_ptr, png_charp buffer, png_const_charp
  77.148 +   error_message)
  77.149 +{
  77.150 +   int iout = 0, iin = 0;
  77.151 +
  77.152 +   while (iin < 4)
  77.153 +   {
  77.154 +      int c = png_ptr->chunk_name[iin++];
  77.155 +      if (isnonalpha(c))
  77.156 +      {
  77.157 +         buffer[iout++] = '[';
  77.158 +         buffer[iout++] = png_digit[(c & 0xf0) >> 4];
  77.159 +         buffer[iout++] = png_digit[c & 0x0f];
  77.160 +         buffer[iout++] = ']';
  77.161 +      }
  77.162 +      else
  77.163 +      {
  77.164 +         buffer[iout++] = (png_byte)c;
  77.165 +      }
  77.166 +   }
  77.167 +
  77.168 +   if (error_message == NULL)
  77.169 +      buffer[iout] = '\0';
  77.170 +   else
  77.171 +   {
  77.172 +      buffer[iout++] = ':';
  77.173 +      buffer[iout++] = ' ';
  77.174 +      png_memcpy(buffer + iout, error_message, PNG_MAX_ERROR_TEXT);
  77.175 +      buffer[iout + PNG_MAX_ERROR_TEXT - 1] = '\0';
  77.176 +   }
  77.177 +}
  77.178 +
  77.179 +#ifdef PNG_READ_SUPPORTED
  77.180 +void PNGAPI
  77.181 +png_chunk_error(png_structp png_ptr, png_const_charp error_message)
  77.182 +{
  77.183 +   char msg[18+PNG_MAX_ERROR_TEXT];
  77.184 +   if (png_ptr == NULL)
  77.185 +     png_error(png_ptr, error_message);
  77.186 +   else
  77.187 +   {
  77.188 +     png_format_buffer(png_ptr, msg, error_message);
  77.189 +     png_error(png_ptr, msg);
  77.190 +   }
  77.191 +}
  77.192 +#endif /* PNG_READ_SUPPORTED */
  77.193 +#endif /* !defined(PNG_NO_WARNINGS) || !defined(PNG_NO_ERROR_TEXT) */
  77.194 +
  77.195 +#ifndef PNG_NO_WARNINGS
  77.196 +void PNGAPI
  77.197 +png_chunk_warning(png_structp png_ptr, png_const_charp warning_message)
  77.198 +{
  77.199 +   char msg[18+PNG_MAX_ERROR_TEXT];
  77.200 +   if (png_ptr == NULL)
  77.201 +     png_warning(png_ptr, warning_message);
  77.202 +   else
  77.203 +   {
  77.204 +     png_format_buffer(png_ptr, msg, warning_message);
  77.205 +     png_warning(png_ptr, msg);
  77.206 +   }
  77.207 +}
  77.208 +#endif /* PNG_NO_WARNINGS */
  77.209 +
  77.210 +
  77.211 +/* This is the default error handling function.  Note that replacements for
  77.212 + * this function MUST NOT RETURN, or the program will likely crash.  This
  77.213 + * function is used by default, or if the program supplies NULL for the
  77.214 + * error function pointer in png_set_error_fn().
  77.215 + */
  77.216 +static void /* PRIVATE */
  77.217 +png_default_error(png_structp png_ptr, png_const_charp error_message)
  77.218 +{
  77.219 +#ifndef PNG_NO_CONSOLE_IO
  77.220 +#ifdef PNG_ERROR_NUMBERS_SUPPORTED
  77.221 +   if (*error_message == '#')
  77.222 +   {
  77.223 +     /* Strip "#nnnn " from beginning of warning message. */
  77.224 +     int offset;
  77.225 +     char error_number[16];
  77.226 +     for (offset = 0; offset<15; offset++)
  77.227 +     {
  77.228 +         error_number[offset] = error_message[offset + 1];
  77.229 +         if (error_message[offset] == ' ')
  77.230 +             break;
  77.231 +     }
  77.232 +     if ((offset > 1) && (offset < 15))
  77.233 +     {
  77.234 +       error_number[offset - 1] = '\0';
  77.235 +       fprintf(stderr, "libpng error no. %s: %s\n", error_number,
  77.236 +          error_message + offset + 1);
  77.237 +     }
  77.238 +     else
  77.239 +       fprintf(stderr, "libpng error: %s, offset=%d\n", error_message, offset);
  77.240 +   }
  77.241 +   else
  77.242 +#endif
  77.243 +   fprintf(stderr, "libpng error: %s\n", error_message);
  77.244 +#endif
  77.245 +
  77.246 +#ifdef PNG_SETJMP_SUPPORTED
  77.247 +   if (png_ptr)
  77.248 +   {
  77.249 +#  ifdef USE_FAR_KEYWORD
  77.250 +   {
  77.251 +      jmp_buf jmpbuf;
  77.252 +      png_memcpy(jmpbuf, png_ptr->jmpbuf, png_sizeof(jmp_buf));
  77.253 +      longjmp(jmpbuf, 1);
  77.254 +   }
  77.255 +#  else
  77.256 +   longjmp(png_ptr->jmpbuf, 1);
  77.257 +#  endif
  77.258 +   }
  77.259 +#else
  77.260 +   PNG_ABORT();
  77.261 +#endif
  77.262 +#ifdef PNG_NO_CONSOLE_IO
  77.263 +   error_message = error_message; /* make compiler happy */
  77.264 +#endif
  77.265 +}
  77.266 +
  77.267 +#ifndef PNG_NO_WARNINGS
  77.268 +/* This function is called when there is a warning, but the library thinks
  77.269 + * it can continue anyway.  Replacement functions don't have to do anything
  77.270 + * here if you don't want them to.  In the default configuration, png_ptr is
  77.271 + * not used, but it is passed in case it may be useful.
  77.272 + */
  77.273 +static void /* PRIVATE */
  77.274 +png_default_warning(png_structp png_ptr, png_const_charp warning_message)
  77.275 +{
  77.276 +#ifndef PNG_NO_CONSOLE_IO
  77.277 +#  ifdef PNG_ERROR_NUMBERS_SUPPORTED
  77.278 +   if (*warning_message == '#')
  77.279 +   {
  77.280 +     int offset;
  77.281 +     char warning_number[16];
  77.282 +     for (offset = 0; offset < 15; offset++)
  77.283 +     {
  77.284 +        warning_number[offset] = warning_message[offset + 1];
  77.285 +        if (warning_message[offset] == ' ')
  77.286 +            break;
  77.287 +     }
  77.288 +     if ((offset > 1) && (offset < 15))
  77.289 +     {
  77.290 +       warning_number[offset + 1] = '\0';
  77.291 +       fprintf(stderr, "libpng warning no. %s: %s\n", warning_number,
  77.292 +          warning_message + offset);
  77.293 +     }
  77.294 +     else
  77.295 +       fprintf(stderr, "libpng warning: %s\n", warning_message);
  77.296 +   }
  77.297 +   else
  77.298 +#  endif
  77.299 +     fprintf(stderr, "libpng warning: %s\n", warning_message);
  77.300 +#else
  77.301 +   warning_message = warning_message; /* make compiler happy */
  77.302 +#endif
  77.303 +   png_ptr = png_ptr; /* make compiler happy */
  77.304 +}
  77.305 +#endif /* PNG_NO_WARNINGS */
  77.306 +
  77.307 +/* This function is called when the application wants to use another method
  77.308 + * of handling errors and warnings.  Note that the error function MUST NOT
  77.309 + * return to the calling routine or serious problems will occur.  The return
  77.310 + * method used in the default routine calls longjmp(png_ptr->jmpbuf, 1)
  77.311 + */
  77.312 +void PNGAPI
  77.313 +png_set_error_fn(png_structp png_ptr, png_voidp error_ptr,
  77.314 +   png_error_ptr error_fn, png_error_ptr warning_fn)
  77.315 +{
  77.316 +   if (png_ptr == NULL)
  77.317 +      return;
  77.318 +   png_ptr->error_ptr = error_ptr;
  77.319 +   png_ptr->error_fn = error_fn;
  77.320 +   png_ptr->warning_fn = warning_fn;
  77.321 +}
  77.322 +
  77.323 +
  77.324 +/* This function returns a pointer to the error_ptr associated with the user
  77.325 + * functions.  The application should free any memory associated with this
  77.326 + * pointer before png_write_destroy and png_read_destroy are called.
  77.327 + */
  77.328 +png_voidp PNGAPI
  77.329 +png_get_error_ptr(png_structp png_ptr)
  77.330 +{
  77.331 +   if (png_ptr == NULL)
  77.332 +      return NULL;
  77.333 +   return ((png_voidp)png_ptr->error_ptr);
  77.334 +}
  77.335 +
  77.336 +
  77.337 +#ifdef PNG_ERROR_NUMBERS_SUPPORTED
  77.338 +void PNGAPI
  77.339 +png_set_strip_error_numbers(png_structp png_ptr, png_uint_32 strip_mode)
  77.340 +{
  77.341 +   if (png_ptr != NULL)
  77.342 +   {
  77.343 +     png_ptr->flags &=
  77.344 +       ((~(PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT))&strip_mode);
  77.345 +   }
  77.346 +}
  77.347 +#endif
  77.348 +#endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */
    78.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    78.2 +++ b/libs/libpng/pnggccrd.c	Sun Nov 01 00:36:56 2015 +0200
    78.3 @@ -0,0 +1,103 @@
    78.4 +/* pnggccrd.c was removed from libpng-1.2.20. */
    78.5 +
    78.6 +/* This code snippet is for use by configure's compilation test. */
    78.7 +
    78.8 +#if (!defined _MSC_VER) && \
    78.9 +    defined(PNG_ASSEMBLER_CODE_SUPPORTED) && \
   78.10 +    defined(PNG_MMX_CODE_SUPPORTED)
   78.11 +
   78.12 +int PNGAPI png_dummy_mmx_support(void);
   78.13 +
   78.14 +static int _mmx_supported = 2; // 0: no MMX; 1: MMX supported; 2: not tested
   78.15 +
   78.16 +int PNGAPI
   78.17 +png_dummy_mmx_support(void) __attribute__((noinline));
   78.18 +
   78.19 +int PNGAPI
   78.20 +png_dummy_mmx_support(void)
   78.21 +{
   78.22 +   int result;
   78.23 +#if defined(PNG_MMX_CODE_SUPPORTED)  // superfluous, but what the heck
   78.24 +    __asm__ __volatile__ (
   78.25 +#if defined(__x86_64__)
   78.26 +        "pushq %%rbx          \n\t"  // rbx gets clobbered by CPUID instruction
   78.27 +        "pushq %%rcx          \n\t"  // so does rcx...
   78.28 +        "pushq %%rdx          \n\t"  // ...and rdx (but rcx & rdx safe on Linux)
   78.29 +        "pushfq               \n\t"  // save Eflag to stack
   78.30 +        "popq %%rax           \n\t"  // get Eflag from stack into rax
   78.31 +        "movq %%rax, %%rcx    \n\t"  // make another copy of Eflag in rcx
   78.32 +        "xorl $0x200000, %%eax \n\t" // toggle ID bit in Eflag (i.e., bit 21)
   78.33 +        "pushq %%rax          \n\t"  // save modified Eflag back to stack
   78.34 +        "popfq                \n\t"  // restore modified value to Eflag reg
   78.35 +        "pushfq               \n\t"  // save Eflag to stack
   78.36 +        "popq %%rax           \n\t"  // get Eflag from stack
   78.37 +        "pushq %%rcx          \n\t"  // save original Eflag to stack
   78.38 +        "popfq                \n\t"  // restore original Eflag
   78.39 +#else
   78.40 +        "pushl %%ebx          \n\t"  // ebx gets clobbered by CPUID instruction
   78.41 +        "pushl %%ecx          \n\t"  // so does ecx...
   78.42 +        "pushl %%edx          \n\t"  // ...and edx (but ecx & edx safe on Linux)
   78.43 +        "pushfl               \n\t"  // save Eflag to stack
   78.44 +        "popl %%eax           \n\t"  // get Eflag from stack into eax
   78.45 +        "movl %%eax, %%ecx    \n\t"  // make another copy of Eflag in ecx
   78.46 +        "xorl $0x200000, %%eax \n\t" // toggle ID bit in Eflag (i.e., bit 21)
   78.47 +        "pushl %%eax          \n\t"  // save modified Eflag back to stack
   78.48 +        "popfl                \n\t"  // restore modified value to Eflag reg
   78.49 +        "pushfl               \n\t"  // save Eflag to stack
   78.50 +        "popl %%eax           \n\t"  // get Eflag from stack
   78.51 +        "pushl %%ecx          \n\t"  // save original Eflag to stack
   78.52 +        "popfl                \n\t"  // restore original Eflag
   78.53 +#endif
   78.54 +        "xorl %%ecx, %%eax    \n\t"  // compare new Eflag with original Eflag
   78.55 +        "jz 0f                \n\t"  // if same, CPUID instr. is not supported
   78.56 +
   78.57 +        "xorl %%eax, %%eax    \n\t"  // set eax to zero
   78.58 +//      ".byte  0x0f, 0xa2    \n\t"  // CPUID instruction (two-byte opcode)
   78.59 +        "cpuid                \n\t"  // get the CPU identification info
   78.60 +        "cmpl $1, %%eax       \n\t"  // make sure eax return non-zero value
   78.61 +        "jl 0f                \n\t"  // if eax is zero, MMX is not supported
   78.62 +
   78.63 +        "xorl %%eax, %%eax    \n\t"  // set eax to zero and...
   78.64 +        "incl %%eax           \n\t"  // ...increment eax to 1.  This pair is
   78.65 +                                     // faster than the instruction "mov eax, 1"
   78.66 +        "cpuid                \n\t"  // get the CPU identification info again
   78.67 +        "andl $0x800000, %%edx \n\t" // mask out all bits but MMX bit (23)
   78.68 +        "cmpl $0, %%edx       \n\t"  // 0 = MMX not supported
   78.69 +        "jz 0f                \n\t"  // non-zero = yes, MMX IS supported
   78.70 +
   78.71 +        "movl $1, %%eax       \n\t"  // set return value to 1
   78.72 +        "jmp  1f              \n\t"  // DONE:  have MMX support
   78.73 +
   78.74 +    "0:                       \n\t"  // .NOT_SUPPORTED: target label for jump instructions
   78.75 +        "movl $0, %%eax       \n\t"  // set return value to 0
   78.76 +    "1:                       \n\t"  // .RETURN: target label for jump instructions
   78.77 +#if defined(__x86_64__)
   78.78 +        "popq %%rdx           \n\t"  // restore rdx
   78.79 +        "popq %%rcx           \n\t"  // restore rcx
   78.80 +        "popq %%rbx           \n\t"  // restore rbx
   78.81 +#else
   78.82 +        "popl %%edx           \n\t"  // restore edx
   78.83 +        "popl %%ecx           \n\t"  // restore ecx
   78.84 +        "popl %%ebx           \n\t"  // restore ebx
   78.85 +#endif
   78.86 +
   78.87 +//      "ret                  \n\t"  // DONE:  no MMX support
   78.88 +                                     // (fall through to standard C "ret")
   78.89 +
   78.90 +        : "=a" (result)              // output list
   78.91 +
   78.92 +        :                            // any variables used on input (none)
   78.93 +
   78.94 +                                     // no clobber list
   78.95 +//      , "%ebx", "%ecx", "%edx"     // GRR:  we handle these manually
   78.96 +//      , "memory"   // if write to a variable gcc thought was in a reg
   78.97 +//      , "cc"       // "condition codes" (flag bits)
   78.98 +    );
   78.99 +    _mmx_supported = result;
  78.100 +#else
  78.101 +    _mmx_supported = 0;
  78.102 +#endif /* PNG_MMX_CODE_SUPPORTED */
  78.103 +
  78.104 +    return _mmx_supported;
  78.105 +}
  78.106 +#endif
    79.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    79.2 +++ b/libs/libpng/pngget.c	Sun Nov 01 00:36:56 2015 +0200
    79.3 @@ -0,0 +1,900 @@
    79.4 +
    79.5 +/* pngget.c - retrieval of values from info struct
    79.6 + *
    79.7 + * Last changed in libpng 1.2.30 [August 15, 2008]
    79.8 + * For conditions of distribution and use, see copyright notice in png.h
    79.9 + * Copyright (c) 1998-2008 Glenn Randers-Pehrson
   79.10 + * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
   79.11 + * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
   79.12 + */
   79.13 +
   79.14 +#define PNG_INTERNAL
   79.15 +#include "png.h"
   79.16 +#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
   79.17 +
   79.18 +png_uint_32 PNGAPI
   79.19 +png_get_valid(png_structp png_ptr, png_infop info_ptr, png_uint_32 flag)
   79.20 +{
   79.21 +   if (png_ptr != NULL && info_ptr != NULL)
   79.22 +      return(info_ptr->valid & flag);
   79.23 +   else
   79.24 +      return(0);
   79.25 +}
   79.26 +
   79.27 +png_uint_32 PNGAPI
   79.28 +png_get_rowbytes(png_structp png_ptr, png_infop info_ptr)
   79.29 +{
   79.30 +   if (png_ptr != NULL && info_ptr != NULL)
   79.31 +      return(info_ptr->rowbytes);
   79.32 +   else
   79.33 +      return(0);
   79.34 +}
   79.35 +
   79.36 +#if defined(PNG_INFO_IMAGE_SUPPORTED)
   79.37 +png_bytepp PNGAPI
   79.38 +png_get_rows(png_structp png_ptr, png_infop info_ptr)
   79.39 +{
   79.40 +   if (png_ptr != NULL && info_ptr != NULL)
   79.41 +      return(info_ptr->row_pointers);
   79.42 +   else
   79.43 +      return(0);
   79.44 +}
   79.45 +#endif
   79.46 +
   79.47 +#ifdef PNG_EASY_ACCESS_SUPPORTED
   79.48 +/* easy access to info, added in libpng-0.99 */
   79.49 +png_uint_32 PNGAPI
   79.50 +png_get_image_width(png_structp png_ptr, png_infop info_ptr)
   79.51 +{
   79.52 +   if (png_ptr != NULL && info_ptr != NULL)
   79.53 +   {
   79.54 +      return info_ptr->width;
   79.55 +   }
   79.56 +   return (0);
   79.57 +}
   79.58 +
   79.59 +png_uint_32 PNGAPI
   79.60 +png_get_image_height(png_structp png_ptr, png_infop info_ptr)
   79.61 +{
   79.62 +   if (png_ptr != NULL && info_ptr != NULL)
   79.63 +   {
   79.64 +      return info_ptr->height;
   79.65 +   }
   79.66 +   return (0);
   79.67 +}
   79.68 +
   79.69 +png_byte PNGAPI
   79.70 +png_get_bit_depth(png_structp png_ptr, png_infop info_ptr)
   79.71 +{
   79.72 +   if (png_ptr != NULL && info_ptr != NULL)
   79.73 +   {
   79.74 +      return info_ptr->bit_depth;
   79.75 +   }
   79.76 +   return (0);
   79.77 +}
   79.78 +
   79.79 +png_byte PNGAPI
   79.80 +png_get_color_type(png_structp png_ptr, png_infop info_ptr)
   79.81 +{
   79.82 +   if (png_ptr != NULL && info_ptr != NULL)
   79.83 +   {
   79.84 +      return info_ptr->color_type;
   79.85 +   }
   79.86 +   return (0);
   79.87 +}
   79.88 +
   79.89 +png_byte PNGAPI
   79.90 +png_get_filter_type(png_structp png_ptr, png_infop info_ptr)
   79.91 +{
   79.92 +   if (png_ptr != NULL && info_ptr != NULL)
   79.93 +   {
   79.94 +      return info_ptr->filter_type;
   79.95 +   }
   79.96 +   return (0);
   79.97 +}
   79.98 +
   79.99 +png_byte PNGAPI
  79.100 +png_get_interlace_type(png_structp png_ptr, png_infop info_ptr)
  79.101 +{
  79.102 +   if (png_ptr != NULL && info_ptr != NULL)
  79.103 +   {
  79.104 +      return info_ptr->interlace_type;
  79.105 +   }
  79.106 +   return (0);
  79.107 +}
  79.108 +
  79.109 +png_byte PNGAPI
  79.110 +png_get_compression_type(png_structp png_ptr, png_infop info_ptr)
  79.111 +{
  79.112 +   if (png_ptr != NULL && info_ptr != NULL)
  79.113 +   {
  79.114 +      return info_ptr->compression_type;
  79.115 +   }
  79.116 +   return (0);
  79.117 +}
  79.118 +
  79.119 +png_uint_32 PNGAPI
  79.120 +png_get_x_pixels_per_meter(png_structp png_ptr, png_infop info_ptr)
  79.121 +{
  79.122 +   if (png_ptr != NULL && info_ptr != NULL)
  79.123 +#if defined(PNG_pHYs_SUPPORTED)
  79.124 +   if (info_ptr->valid & PNG_INFO_pHYs)
  79.125 +   {
  79.126 +      png_debug1(1, "in %s retrieval function\n", "png_get_x_pixels_per_meter");
  79.127 +      if (info_ptr->phys_unit_type != PNG_RESOLUTION_METER)
  79.128 +          return (0);
  79.129 +      else return (info_ptr->x_pixels_per_unit);
  79.130 +   }
  79.131 +#else
  79.132 +   return (0);
  79.133 +#endif
  79.134 +   return (0);
  79.135 +}
  79.136 +
  79.137 +png_uint_32 PNGAPI
  79.138 +png_get_y_pixels_per_meter(png_structp png_ptr, png_infop info_ptr)
  79.139 +{
  79.140 +   if (png_ptr != NULL && info_ptr != NULL)
  79.141 +#if defined(PNG_pHYs_SUPPORTED)
  79.142 +   if (info_ptr->valid & PNG_INFO_pHYs)
  79.143 +   {
  79.144 +      png_debug1(1, "in %s retrieval function\n", "png_get_y_pixels_per_meter");
  79.145 +      if (info_ptr->phys_unit_type != PNG_RESOLUTION_METER)
  79.146 +          return (0);
  79.147 +      else return (info_ptr->y_pixels_per_unit);
  79.148 +   }
  79.149 +#else
  79.150 +   return (0);
  79.151 +#endif
  79.152 +   return (0);
  79.153 +}
  79.154 +
  79.155 +png_uint_32 PNGAPI
  79.156 +png_get_pixels_per_meter(png_structp png_ptr, png_infop info_ptr)
  79.157 +{
  79.158 +   if (png_ptr != NULL && info_ptr != NULL)
  79.159 +#if defined(PNG_pHYs_SUPPORTED)
  79.160 +   if (info_ptr->valid & PNG_INFO_pHYs)
  79.161 +   {
  79.162 +      png_debug1(1, "in %s retrieval function\n", "png_get_pixels_per_meter");
  79.163 +      if (info_ptr->phys_unit_type != PNG_RESOLUTION_METER ||
  79.164 +         info_ptr->x_pixels_per_unit != info_ptr->y_pixels_per_unit)
  79.165 +          return (0);
  79.166 +      else return (info_ptr->x_pixels_per_unit);
  79.167 +   }
  79.168 +#else
  79.169 +   return (0);
  79.170 +#endif
  79.171 +   return (0);
  79.172 +}
  79.173 +
  79.174 +#ifdef PNG_FLOATING_POINT_SUPPORTED
  79.175 +float PNGAPI
  79.176 +png_get_pixel_aspect_ratio(png_structp png_ptr, png_infop info_ptr)
  79.177 +   {
  79.178 +   if (png_ptr != NULL && info_ptr != NULL)
  79.179 +#if defined(PNG_pHYs_SUPPORTED)
  79.180 +   if (info_ptr->valid & PNG_INFO_pHYs)
  79.181 +   {
  79.182 +      png_debug1(1, "in %s retrieval function\n", "png_get_aspect_ratio");
  79.183 +      if (info_ptr->x_pixels_per_unit == 0)
  79.184 +         return ((float)0.0);
  79.185 +      else
  79.186 +         return ((float)((float)info_ptr->y_pixels_per_unit
  79.187 +            /(float)info_ptr->x_pixels_per_unit));
  79.188 +   }
  79.189 +#else
  79.190 +   return (0.0);
  79.191 +#endif
  79.192 +   return ((float)0.0);
  79.193 +}
  79.194 +#endif
  79.195 +
  79.196 +png_int_32 PNGAPI
  79.197 +png_get_x_offset_microns(png_structp png_ptr, png_infop info_ptr)
  79.198 +{
  79.199 +   if (png_ptr != NULL && info_ptr != NULL)
  79.200 +#if defined(PNG_oFFs_SUPPORTED)
  79.201 +   if (info_ptr->valid & PNG_INFO_oFFs)
  79.202 +   {
  79.203 +      png_debug1(1, "in %s retrieval function\n", "png_get_x_offset_microns");
  79.204 +      if (info_ptr->offset_unit_type != PNG_OFFSET_MICROMETER)
  79.205 +          return (0);
  79.206 +      else return (info_ptr->x_offset);
  79.207 +   }
  79.208 +#else
  79.209 +   return (0);
  79.210 +#endif
  79.211 +   return (0);
  79.212 +}
  79.213 +
  79.214 +png_int_32 PNGAPI
  79.215 +png_get_y_offset_microns(png_structp png_ptr, png_infop info_ptr)
  79.216 +{
  79.217 +   if (png_ptr != NULL && info_ptr != NULL)
  79.218 +#if defined(PNG_oFFs_SUPPORTED)
  79.219 +   if (info_ptr->valid & PNG_INFO_oFFs)
  79.220 +   {
  79.221 +      png_debug1(1, "in %s retrieval function\n", "png_get_y_offset_microns");
  79.222 +      if (info_ptr->offset_unit_type != PNG_OFFSET_MICROMETER)
  79.223 +          return (0);
  79.224 +      else return (info_ptr->y_offset);
  79.225 +   }
  79.226 +#else
  79.227 +   return (0);
  79.228 +#endif
  79.229 +   return (0);
  79.230 +}
  79.231 +
  79.232 +png_int_32 PNGAPI
  79.233 +png_get_x_offset_pixels(png_structp png_ptr, png_infop info_ptr)
  79.234 +{
  79.235 +   if (png_ptr != NULL && info_ptr != NULL)
  79.236 +#if defined(PNG_oFFs_SUPPORTED)
  79.237 +   if (info_ptr->valid & PNG_INFO_oFFs)
  79.238 +   {
  79.239 +      png_debug1(1, "in %s retrieval function\n", "png_get_x_offset_microns");
  79.240 +      if (info_ptr->offset_unit_type != PNG_OFFSET_PIXEL)
  79.241 +          return (0);
  79.242 +      else return (info_ptr->x_offset);
  79.243 +   }
  79.244 +#else
  79.245 +   return (0);
  79.246 +#endif
  79.247 +   return (0);
  79.248 +}
  79.249 +
  79.250 +png_int_32 PNGAPI
  79.251 +png_get_y_offset_pixels(png_structp png_ptr, png_infop info_ptr)
  79.252 +{
  79.253 +   if (png_ptr != NULL && info_ptr != NULL)
  79.254 +#if defined(PNG_oFFs_SUPPORTED)
  79.255 +   if (info_ptr->valid & PNG_INFO_oFFs)
  79.256 +   {
  79.257 +      png_debug1(1, "in %s retrieval function\n", "png_get_y_offset_microns");
  79.258 +      if (info_ptr->offset_unit_type != PNG_OFFSET_PIXEL)
  79.259 +          return (0);
  79.260 +      else return (info_ptr->y_offset);
  79.261 +   }
  79.262 +#else
  79.263 +   return (0);
  79.264 +#endif
  79.265 +   return (0);
  79.266 +}
  79.267 +
  79.268 +#if defined(PNG_INCH_CONVERSIONS) && defined(PNG_FLOATING_POINT_SUPPORTED)
  79.269 +png_uint_32 PNGAPI
  79.270 +png_get_pixels_per_inch(png_structp png_ptr, png_infop info_ptr)
  79.271 +{
  79.272 +   return ((png_uint_32)((float)png_get_pixels_per_meter(png_ptr, info_ptr)
  79.273 +     *.0254 +.5));
  79.274 +}
  79.275 +
  79.276 +png_uint_32 PNGAPI
  79.277 +png_get_x_pixels_per_inch(png_structp png_ptr, png_infop info_ptr)
  79.278 +{
  79.279 +   return ((png_uint_32)((float)png_get_x_pixels_per_meter(png_ptr, info_ptr)
  79.280 +     *.0254 +.5));
  79.281 +}
  79.282 +
  79.283 +png_uint_32 PNGAPI
  79.284 +png_get_y_pixels_per_inch(png_structp png_ptr, png_infop info_ptr)
  79.285 +{
  79.286 +   return ((png_uint_32)((float)png_get_y_pixels_per_meter(png_ptr, info_ptr)
  79.287 +     *.0254 +.5));
  79.288 +}
  79.289 +
  79.290 +float PNGAPI
  79.291 +png_get_x_offset_inches(png_structp png_ptr, png_infop info_ptr)
  79.292 +{
  79.293 +   return ((float)png_get_x_offset_microns(png_ptr, info_ptr)
  79.294 +     *.00003937);
  79.295 +}
  79.296 +
  79.297 +float PNGAPI
  79.298 +png_get_y_offset_inches(png_structp png_ptr, png_infop info_ptr)
  79.299 +{
  79.300 +   return ((float)png_get_y_offset_microns(png_ptr, info_ptr)
  79.301 +     *.00003937);
  79.302 +}
  79.303 +
  79.304 +#if defined(PNG_pHYs_SUPPORTED)
  79.305 +png_uint_32 PNGAPI
  79.306 +png_get_pHYs_dpi(png_structp png_ptr, png_infop info_ptr,
  79.307 +   png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type)
  79.308 +{
  79.309 +   png_uint_32 retval = 0;
  79.310 +
  79.311 +   if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_pHYs))
  79.312 +   {
  79.313 +      png_debug1(1, "in %s retrieval function\n", "pHYs");
  79.314 +      if (res_x != NULL)
  79.315 +      {
  79.316 +         *res_x = info_ptr->x_pixels_per_unit;
  79.317 +         retval |= PNG_INFO_pHYs;
  79.318 +      }
  79.319 +      if (res_y != NULL)
  79.320 +      {
  79.321 +         *res_y = info_ptr->y_pixels_per_unit;
  79.322 +         retval |= PNG_INFO_pHYs;
  79.323 +      }
  79.324 +      if (unit_type != NULL)
  79.325 +      {
  79.326 +         *unit_type = (int)info_ptr->phys_unit_type;
  79.327 +         retval |= PNG_INFO_pHYs;
  79.328 +         if (*unit_type == 1)
  79.329 +         {
  79.330 +            if (res_x != NULL) *res_x = (png_uint_32)(*res_x * .0254 + .50);
  79.331 +            if (res_y != NULL) *res_y = (png_uint_32)(*res_y * .0254 + .50);
  79.332 +         }
  79.333 +      }
  79.334 +   }
  79.335 +   return (retval);
  79.336 +}
  79.337 +#endif /* PNG_pHYs_SUPPORTED */
  79.338 +#endif  /* PNG_INCH_CONVERSIONS && PNG_FLOATING_POINT_SUPPORTED */
  79.339 +
  79.340 +/* png_get_channels really belongs in here, too, but it's been around longer */
  79.341 +
  79.342 +#endif  /* PNG_EASY_ACCESS_SUPPORTED */
  79.343 +
  79.344 +png_byte PNGAPI
  79.345 +png_get_channels(png_structp png_ptr, png_infop info_ptr)
  79.346 +{
  79.347 +   if (png_ptr != NULL && info_ptr != NULL)
  79.348 +      return(info_ptr->channels);
  79.349 +   else
  79.350 +      return (0);
  79.351 +}
  79.352 +
  79.353 +png_bytep PNGAPI
  79.354 +png_get_signature(png_structp png_ptr, png_infop info_ptr)
  79.355 +{
  79.356 +   if (png_ptr != NULL && info_ptr != NULL)
  79.357 +      return(info_ptr->signature);
  79.358 +   else
  79.359 +      return (NULL);
  79.360 +}
  79.361 +
  79.362 +#if defined(PNG_bKGD_SUPPORTED)
  79.363 +png_uint_32 PNGAPI
  79.364 +png_get_bKGD(png_structp png_ptr, png_infop info_ptr,
  79.365 +   png_color_16p *background)
  79.366 +{
  79.367 +   if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_bKGD)
  79.368 +      && background != NULL)
  79.369 +   {
  79.370 +      png_debug1(1, "in %s retrieval function\n", "bKGD");
  79.371 +      *background = &(info_ptr->background);
  79.372 +      return (PNG_INFO_bKGD);
  79.373 +   }
  79.374 +   return (0);
  79.375 +}
  79.376 +#endif
  79.377 +
  79.378 +#if defined(PNG_cHRM_SUPPORTED)
  79.379 +#ifdef PNG_FLOATING_POINT_SUPPORTED
  79.380 +png_uint_32 PNGAPI
  79.381 +png_get_cHRM(png_structp png_ptr, png_infop info_ptr,
  79.382 +   double *white_x, double *white_y, double *red_x, double *red_y,
  79.383 +   double *green_x, double *green_y, double *blue_x, double *blue_y)
  79.384 +{
  79.385 +   if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_cHRM))
  79.386 +   {
  79.387 +      png_debug1(1, "in %s retrieval function\n", "cHRM");
  79.388 +      if (white_x != NULL)
  79.389 +         *white_x = (double)info_ptr->x_white;
  79.390 +      if (white_y != NULL)
  79.391 +         *white_y = (double)info_ptr->y_white;
  79.392 +      if (red_x != NULL)
  79.393 +         *red_x = (double)info_ptr->x_red;
  79.394 +      if (red_y != NULL)
  79.395 +         *red_y = (double)info_ptr->y_red;
  79.396 +      if (green_x != NULL)
  79.397 +         *green_x = (double)info_ptr->x_green;
  79.398 +      if (green_y != NULL)
  79.399 +         *green_y = (double)info_ptr->y_green;
  79.400 +      if (blue_x != NULL)
  79.401 +         *blue_x = (double)info_ptr->x_blue;
  79.402 +      if (blue_y != NULL)
  79.403 +         *blue_y = (double)info_ptr->y_blue;
  79.404 +      return (PNG_INFO_cHRM);
  79.405 +   }
  79.406 +   return (0);
  79.407 +}
  79.408 +#endif
  79.409 +#ifdef PNG_FIXED_POINT_SUPPORTED
  79.410 +png_uint_32 PNGAPI
  79.411 +png_get_cHRM_fixed(png_structp png_ptr, png_infop info_ptr,
  79.412 +   png_fixed_point *white_x, png_fixed_point *white_y, png_fixed_point *red_x,
  79.413 +   png_fixed_point *red_y, png_fixed_point *green_x, png_fixed_point *green_y,
  79.414 +   png_fixed_point *blue_x, png_fixed_point *blue_y)
  79.415 +{
  79.416 +   if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_cHRM))
  79.417 +   {
  79.418 +      png_debug1(1, "in %s retrieval function\n", "cHRM");
  79.419 +      if (white_x != NULL)
  79.420 +         *white_x = info_ptr->int_x_white;
  79.421 +      if (white_y != NULL)
  79.422 +         *white_y = info_ptr->int_y_white;
  79.423 +      if (red_x != NULL)
  79.424 +         *red_x = info_ptr->int_x_red;
  79.425 +      if (red_y != NULL)
  79.426 +         *red_y = info_ptr->int_y_red;
  79.427 +      if (green_x != NULL)
  79.428 +         *green_x = info_ptr->int_x_green;
  79.429 +      if (green_y != NULL)
  79.430 +         *green_y = info_ptr->int_y_green;
  79.431 +      if (blue_x != NULL)
  79.432 +         *blue_x = info_ptr->int_x_blue;
  79.433 +      if (blue_y != NULL)
  79.434 +         *blue_y = info_ptr->int_y_blue;
  79.435 +      return (PNG_INFO_cHRM);
  79.436 +   }
  79.437 +   return (0);
  79.438 +}
  79.439 +#endif
  79.440 +#endif
  79.441 +
  79.442 +#if defined(PNG_gAMA_SUPPORTED)
  79.443 +#ifdef PNG_FLOATING_POINT_SUPPORTED
  79.444 +png_uint_32 PNGAPI
  79.445 +png_get_gAMA(png_structp png_ptr, png_infop info_ptr, double *file_gamma)
  79.446 +{
  79.447 +   if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_gAMA)
  79.448 +      && file_gamma != NULL)
  79.449 +   {
  79.450 +      png_debug1(1, "in %s retrieval function\n", "gAMA");
  79.451 +      *file_gamma = (double)info_ptr->gamma;
  79.452 +      return (PNG_INFO_gAMA);
  79.453 +   }
  79.454 +   return (0);
  79.455 +}
  79.456 +#endif
  79.457 +#ifdef PNG_FIXED_POINT_SUPPORTED
  79.458 +png_uint_32 PNGAPI
  79.459 +png_get_gAMA_fixed(png_structp png_ptr, png_infop info_ptr,
  79.460 +    png_fixed_point *int_file_gamma)
  79.461 +{
  79.462 +   if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_gAMA)
  79.463 +      && int_file_gamma != NULL)
  79.464 +   {
  79.465 +      png_debug1(1, "in %s retrieval function\n", "gAMA");
  79.466 +      *int_file_gamma = info_ptr->int_gamma;
  79.467 +      return (PNG_INFO_gAMA);
  79.468 +   }
  79.469 +   return (0);
  79.470 +}
  79.471 +#endif
  79.472 +#endif
  79.473 +
  79.474 +#if defined(PNG_sRGB_SUPPORTED)
  79.475 +png_uint_32 PNGAPI
  79.476 +png_get_sRGB(png_structp png_ptr, png_infop info_ptr, int *file_srgb_intent)
  79.477 +{
  79.478 +   if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_sRGB)
  79.479 +      && file_srgb_intent != NULL)
  79.480 +   {
  79.481 +      png_debug1(1, "in %s retrieval function\n", "sRGB");
  79.482 +      *file_srgb_intent = (int)info_ptr->srgb_intent;
  79.483 +      return (PNG_INFO_sRGB);
  79.484 +   }
  79.485 +   return (0);
  79.486 +}
  79.487 +#endif
  79.488 +
  79.489 +#if defined(PNG_iCCP_SUPPORTED)
  79.490 +png_uint_32 PNGAPI
  79.491 +png_get_iCCP(png_structp png_ptr, png_infop info_ptr,
  79.492 +             png_charpp name, int *compression_type,
  79.493 +             png_charpp profile, png_uint_32 *proflen)
  79.494 +{
  79.495 +   if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_iCCP)
  79.496 +      && name != NULL && profile != NULL && proflen != NULL)
  79.497 +   {
  79.498 +      png_debug1(1, "in %s retrieval function\n", "iCCP");
  79.499 +      *name = info_ptr->iccp_name;
  79.500 +      *profile = info_ptr->iccp_profile;
  79.501 +      /* compression_type is a dummy so the API won't have to change
  79.502 +         if we introduce multiple compression types later. */
  79.503 +      *proflen = (int)info_ptr->iccp_proflen;
  79.504 +      *compression_type = (int)info_ptr->iccp_compression;
  79.505 +      return (PNG_INFO_iCCP);
  79.506 +   }
  79.507 +   return (0);
  79.508 +}
  79.509 +#endif
  79.510 +
  79.511 +#if defined(PNG_sPLT_SUPPORTED)
  79.512 +png_uint_32 PNGAPI
  79.513 +png_get_sPLT(png_structp png_ptr, png_infop info_ptr,
  79.514 +             png_sPLT_tpp spalettes)
  79.515 +{
  79.516 +   if (png_ptr != NULL && info_ptr != NULL && spalettes != NULL)
  79.517 +   {
  79.518 +     *spalettes = info_ptr->splt_palettes;
  79.519 +     return ((png_uint_32)info_ptr->splt_palettes_num);
  79.520 +   }
  79.521 +   return (0);
  79.522 +}
  79.523 +#endif
  79.524 +
  79.525 +#if defined(PNG_hIST_SUPPORTED)
  79.526 +png_uint_32 PNGAPI
  79.527 +png_get_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_16p *hist)
  79.528 +{
  79.529 +   if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_hIST)
  79.530 +      && hist != NULL)
  79.531 +   {
  79.532 +      png_debug1(1, "in %s retrieval function\n", "hIST");
  79.533 +      *hist = info_ptr->hist;
  79.534 +      return (PNG_INFO_hIST);
  79.535 +   }
  79.536 +   return (0);
  79.537 +}
  79.538 +#endif
  79.539 +
  79.540 +png_uint_32 PNGAPI
  79.541 +png_get_IHDR(png_structp png_ptr, png_infop info_ptr,
  79.542 +   png_uint_32 *width, png_uint_32 *height, int *bit_depth,
  79.543 +   int *color_type, int *interlace_type, int *compression_type,
  79.544 +   int *filter_type)
  79.545 +
  79.546 +{
  79.547 +   if (png_ptr != NULL && info_ptr != NULL && width != NULL && height != NULL &&
  79.548 +      bit_depth != NULL && color_type != NULL)
  79.549 +   {
  79.550 +      png_debug1(1, "in %s retrieval function\n", "IHDR");
  79.551 +      *width = info_ptr->width;
  79.552 +      *height = info_ptr->height;
  79.553 +      *bit_depth = info_ptr->bit_depth;
  79.554 +      if (info_ptr->bit_depth < 1 || info_ptr->bit_depth > 16)
  79.555 +        png_error(png_ptr, "Invalid bit depth");
  79.556 +      *color_type = info_ptr->color_type;
  79.557 +      if (info_ptr->color_type > 6)
  79.558 +        png_error(png_ptr, "Invalid color type");
  79.559 +      if (compression_type != NULL)
  79.560 +         *compression_type = info_ptr->compression_type;
  79.561 +      if (filter_type != NULL)
  79.562 +         *filter_type = info_ptr->filter_type;
  79.563 +      if (interlace_type != NULL)
  79.564 +         *interlace_type = info_ptr->interlace_type;
  79.565 +
  79.566 +      /* check for potential overflow of rowbytes */
  79.567 +      if (*width == 0 || *width > PNG_UINT_31_MAX)
  79.568 +        png_error(png_ptr, "Invalid image width");
  79.569 +      if (*height == 0 || *height > PNG_UINT_31_MAX)
  79.570 +        png_error(png_ptr, "Invalid image height");
  79.571 +      if (info_ptr->width > (PNG_UINT_32_MAX
  79.572 +                 >> 3)      /* 8-byte RGBA pixels */
  79.573 +                 - 64       /* bigrowbuf hack */
  79.574 +                 - 1        /* filter byte */
  79.575 +                 - 7*8      /* rounding of width to multiple of 8 pixels */
  79.576 +                 - 8)       /* extra max_pixel_depth pad */
  79.577 +      {
  79.578 +         png_warning(png_ptr,
  79.579 +            "Width too large for libpng to process image data.");
  79.580 +      }
  79.581 +      return (1);
  79.582 +   }
  79.583 +   return (0);
  79.584 +}
  79.585 +
  79.586 +#if defined(PNG_oFFs_SUPPORTED)
  79.587 +png_uint_32 PNGAPI
  79.588 +png_get_oFFs(png_structp png_ptr, png_infop info_ptr,
  79.589 +   png_int_32 *offset_x, png_int_32 *offset_y, int *unit_type)
  79.590 +{
  79.591 +   if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_oFFs)
  79.592 +      && offset_x != NULL && offset_y != NULL && unit_type != NULL)
  79.593 +   {
  79.594 +      png_debug1(1, "in %s retrieval function\n", "oFFs");
  79.595 +      *offset_x = info_ptr->x_offset;
  79.596 +      *offset_y = info_ptr->y_offset;
  79.597 +      *unit_type = (int)info_ptr->offset_unit_type;
  79.598 +      return (PNG_INFO_oFFs);
  79.599 +   }
  79.600 +   return (0);
  79.601 +}
  79.602 +#endif
  79.603 +
  79.604 +#if defined(PNG_pCAL_SUPPORTED)
  79.605 +png_uint_32 PNGAPI
  79.606 +png_get_pCAL(png_structp png_ptr, png_infop info_ptr,
  79.607 +   png_charp *purpose, png_int_32 *X0, png_int_32 *X1, int *type, int *nparams,
  79.608 +   png_charp *units, png_charpp *params)
  79.609 +{
  79.610 +   if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_pCAL)
  79.611 +      && purpose != NULL && X0 != NULL && X1 != NULL && type != NULL &&
  79.612 +      nparams != NULL && units != NULL && params != NULL)
  79.613 +   {
  79.614 +      png_debug1(1, "in %s retrieval function\n", "pCAL");
  79.615 +      *purpose = info_ptr->pcal_purpose;
  79.616 +      *X0 = info_ptr->pcal_X0;
  79.617 +      *X1 = info_ptr->pcal_X1;
  79.618 +      *type = (int)info_ptr->pcal_type;
  79.619 +      *nparams = (int)info_ptr->pcal_nparams;
  79.620 +      *units = info_ptr->pcal_units;
  79.621 +      *params = info_ptr->pcal_params;
  79.622 +      return (PNG_INFO_pCAL);
  79.623 +   }
  79.624 +   return (0);
  79.625 +}
  79.626 +#endif
  79.627 +
  79.628 +#if defined(PNG_sCAL_SUPPORTED)
  79.629 +#ifdef PNG_FLOATING_POINT_SUPPORTED
  79.630 +png_uint_32 PNGAPI
  79.631 +png_get_sCAL(png_structp png_ptr, png_infop info_ptr,
  79.632 +             int *unit, double *width, double *height)
  79.633 +{
  79.634 +    if (png_ptr != NULL && info_ptr != NULL &&
  79.635 +       (info_ptr->valid & PNG_INFO_sCAL))
  79.636 +    {
  79.637 +        *unit = info_ptr->scal_unit;
  79.638 +        *width = info_ptr->scal_pixel_width;
  79.639 +        *height = info_ptr->scal_pixel_height;
  79.640 +        return (PNG_INFO_sCAL);
  79.641 +    }
  79.642 +    return(0);
  79.643 +}
  79.644 +#else
  79.645 +#ifdef PNG_FIXED_POINT_SUPPORTED
  79.646 +png_uint_32 PNGAPI
  79.647 +png_get_sCAL_s(png_structp png_ptr, png_infop info_ptr,
  79.648 +             int *unit, png_charpp width, png_charpp height)
  79.649 +{
  79.650 +    if (png_ptr != NULL && info_ptr != NULL &&
  79.651 +       (info_ptr->valid & PNG_INFO_sCAL))
  79.652 +    {
  79.653 +        *unit = info_ptr->scal_unit;
  79.654 +        *width = info_ptr->scal_s_width;
  79.655 +        *height = info_ptr->scal_s_height;
  79.656 +        return (PNG_INFO_sCAL);
  79.657 +    }
  79.658 +    return(0);
  79.659 +}
  79.660 +#endif
  79.661 +#endif
  79.662 +#endif
  79.663 +
  79.664 +#if defined(PNG_pHYs_SUPPORTED)
  79.665 +png_uint_32 PNGAPI
  79.666 +png_get_pHYs(png_structp png_ptr, png_infop info_ptr,
  79.667 +   png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type)
  79.668 +{
  79.669 +   png_uint_32 retval = 0;
  79.670 +
  79.671 +   if (png_ptr != NULL && info_ptr != NULL &&
  79.672 +      (info_ptr->valid & PNG_INFO_pHYs))
  79.673 +   {
  79.674 +      png_debug1(1, "in %s retrieval function\n", "pHYs");
  79.675 +      if (res_x != NULL)
  79.676 +      {
  79.677 +         *res_x = info_ptr->x_pixels_per_unit;
  79.678 +         retval |= PNG_INFO_pHYs;
  79.679 +      }
  79.680 +      if (res_y != NULL)
  79.681 +      {
  79.682 +         *res_y = info_ptr->y_pixels_per_unit;
  79.683 +         retval |= PNG_INFO_pHYs;
  79.684 +      }
  79.685 +      if (unit_type != NULL)
  79.686 +      {
  79.687 +         *unit_type = (int)info_ptr->phys_unit_type;
  79.688 +         retval |= PNG_INFO_pHYs;
  79.689 +      }
  79.690 +   }
  79.691 +   return (retval);
  79.692 +}
  79.693 +#endif
  79.694 +
  79.695 +png_uint_32 PNGAPI
  79.696 +png_get_PLTE(png_structp png_ptr, png_infop info_ptr, png_colorp *palette,
  79.697 +   int *num_palette)
  79.698 +{
  79.699 +   if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_PLTE)
  79.700 +       && palette != NULL)
  79.701 +   {
  79.702 +      png_debug1(1, "in %s retrieval function\n", "PLTE");
  79.703 +      *palette = info_ptr->palette;
  79.704 +      *num_palette = info_ptr->num_palette;
  79.705 +      png_debug1(3, "num_palette = %d\n", *num_palette);
  79.706 +      return (PNG_INFO_PLTE);
  79.707 +   }
  79.708 +   return (0);
  79.709 +}
  79.710 +
  79.711 +#if defined(PNG_sBIT_SUPPORTED)
  79.712 +png_uint_32 PNGAPI
  79.713 +png_get_sBIT(png_structp png_ptr, png_infop info_ptr, png_color_8p *sig_bit)
  79.714 +{
  79.715 +   if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_sBIT)
  79.716 +      && sig_bit != NULL)
  79.717 +   {
  79.718 +      png_debug1(1, "in %s retrieval function\n", "sBIT");
  79.719 +      *sig_bit = &(info_ptr->sig_bit);
  79.720 +      return (PNG_INFO_sBIT);
  79.721 +   }
  79.722 +   return (0);
  79.723 +}
  79.724 +#endif
  79.725 +
  79.726 +#if defined(PNG_TEXT_SUPPORTED)
  79.727 +png_uint_32 PNGAPI
  79.728 +png_get_text(png_structp png_ptr, png_infop info_ptr, png_textp *text_ptr,
  79.729 +   int *num_text)
  79.730 +{
  79.731 +   if (png_ptr != NULL && info_ptr != NULL && info_ptr->num_text > 0)
  79.732 +   {
  79.733 +      png_debug1(1, "in %s retrieval function\n",
  79.734 +         (png_ptr->chunk_name[0] == '\0' ? "text"
  79.735 +             : (png_const_charp)png_ptr->chunk_name));
  79.736 +      if (text_ptr != NULL)
  79.737 +         *text_ptr = info_ptr->text;
  79.738 +      if (num_text != NULL)
  79.739 +         *num_text = info_ptr->num_text;
  79.740 +      return ((png_uint_32)info_ptr->num_text);
  79.741 +   }
  79.742 +   if (num_text != NULL)
  79.743 +     *num_text = 0;
  79.744 +   return(0);
  79.745 +}
  79.746 +#endif
  79.747 +
  79.748 +#if defined(PNG_tIME_SUPPORTED)
  79.749 +png_uint_32 PNGAPI
  79.750 +png_get_tIME(png_structp png_ptr, png_infop info_ptr, png_timep *mod_time)
  79.751 +{
  79.752 +   if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_tIME)
  79.753 +       && mod_time != NULL)
  79.754 +   {
  79.755 +      png_debug1(1, "in %s retrieval function\n", "tIME");
  79.756 +      *mod_time = &(info_ptr->mod_time);
  79.757 +      return (PNG_INFO_tIME);
  79.758 +   }
  79.759 +   return (0);
  79.760 +}
  79.761 +#endif
  79.762 +
  79.763 +#if defined(PNG_tRNS_SUPPORTED)
  79.764 +png_uint_32 PNGAPI
  79.765 +png_get_tRNS(png_structp png_ptr, png_infop info_ptr,
  79.766 +   png_bytep *trans, int *num_trans, png_color_16p *trans_values)
  79.767 +{
  79.768 +   png_uint_32 retval = 0;
  79.769 +   if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_tRNS))
  79.770 +   {
  79.771 +      png_debug1(1, "in %s retrieval function\n", "tRNS");
  79.772 +      if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
  79.773 +      {
  79.774 +          if (trans != NULL)
  79.775 +          {
  79.776 +             *trans = info_ptr->trans;
  79.777 +             retval |= PNG_INFO_tRNS;
  79.778 +          }
  79.779 +          if (trans_values != NULL)
  79.780 +             *trans_values = &(info_ptr->trans_values);
  79.781 +      }
  79.782 +      else /* if (info_ptr->color_type != PNG_COLOR_TYPE_PALETTE) */
  79.783 +      {
  79.784 +          if (trans_values != NULL)
  79.785 +          {
  79.786 +             *trans_values = &(info_ptr->trans_values);
  79.787 +             retval |= PNG_INFO_tRNS;
  79.788 +          }
  79.789 +          if (trans != NULL)
  79.790 +             *trans = NULL;
  79.791 +      }
  79.792 +      if (num_trans != NULL)
  79.793 +      {
  79.794 +         *num_trans = info_ptr->num_trans;
  79.795 +         retval |= PNG_INFO_tRNS;
  79.796 +      }
  79.797 +   }
  79.798 +   return (retval);
  79.799 +}
  79.800 +#endif
  79.801 +
  79.802 +#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
  79.803 +png_uint_32 PNGAPI
  79.804 +png_get_unknown_chunks(png_structp png_ptr, png_infop info_ptr,
  79.805 +             png_unknown_chunkpp unknowns)
  79.806 +{
  79.807 +   if (png_ptr != NULL && info_ptr != NULL && unknowns != NULL)
  79.808 +   {
  79.809 +     *unknowns = info_ptr->unknown_chunks;
  79.810 +     return ((png_uint_32)info_ptr->unknown_chunks_num);
  79.811 +   }
  79.812 +   return (0);
  79.813 +}
  79.814 +#endif
  79.815 +
  79.816 +#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED)
  79.817 +png_byte PNGAPI
  79.818 +png_get_rgb_to_gray_status (png_structp png_ptr)
  79.819 +{
  79.820 +   return (png_byte)(png_ptr? png_ptr->rgb_to_gray_status : 0);
  79.821 +}
  79.822 +#endif
  79.823 +
  79.824 +#if defined(PNG_USER_CHUNKS_SUPPORTED)
  79.825 +png_voidp PNGAPI
  79.826 +png_get_user_chunk_ptr(png_structp png_ptr)
  79.827 +{
  79.828 +   return (png_ptr? png_ptr->user_chunk_ptr : NULL);
  79.829 +}
  79.830 +#endif
  79.831 +
  79.832 +#ifdef PNG_WRITE_SUPPORTED
  79.833 +png_uint_32 PNGAPI
  79.834 +png_get_compression_buffer_size(png_structp png_ptr)
  79.835 +{
  79.836 +   return (png_uint_32)(png_ptr? png_ptr->zbuf_size : 0L);
  79.837 +}
  79.838 +#endif
  79.839 +
  79.840 +#ifdef PNG_ASSEMBLER_CODE_SUPPORTED
  79.841 +#ifndef PNG_1_0_X
  79.842 +/* this function was added to libpng 1.2.0 and should exist by default */
  79.843 +png_uint_32 PNGAPI
  79.844 +png_get_asm_flags (png_structp png_ptr)
  79.845 +{
  79.846 +    /* obsolete, to be removed from libpng-1.4.0 */
  79.847 +    return (png_ptr? 0L: 0L);
  79.848 +}
  79.849 +
  79.850 +/* this function was added to libpng 1.2.0 and should exist by default */
  79.851 +png_uint_32 PNGAPI
  79.852 +png_get_asm_flagmask (int flag_select)
  79.853 +{
  79.854 +    /* obsolete, to be removed from libpng-1.4.0 */
  79.855 +    flag_select=flag_select;
  79.856 +    return 0L;
  79.857 +}
  79.858 +
  79.859 +    /* GRR:  could add this:   && defined(PNG_MMX_CODE_SUPPORTED) */
  79.860 +/* this function was added to libpng 1.2.0 */
  79.861 +png_uint_32 PNGAPI
  79.862 +png_get_mmx_flagmask (int flag_select, int *compilerID)
  79.863 +{
  79.864 +    /* obsolete, to be removed from libpng-1.4.0 */
  79.865 +    flag_select=flag_select;
  79.866 +    *compilerID = -1;   /* unknown (i.e., no asm/MMX code compiled) */
  79.867 +    return 0L;
  79.868 +}
  79.869 +
  79.870 +/* this function was added to libpng 1.2.0 */
  79.871 +png_byte PNGAPI
  79.872 +png_get_mmx_bitdepth_threshold (png_structp png_ptr)
  79.873 +{
  79.874 +    /* obsolete, to be removed from libpng-1.4.0 */
  79.875 +    return (png_ptr? 0: 0);
  79.876 +}
  79.877 +
  79.878 +/* this function was added to libpng 1.2.0 */
  79.879 +png_uint_32 PNGAPI
  79.880 +png_get_mmx_rowbytes_threshold (png_structp png_ptr)
  79.881 +{
  79.882 +    /* obsolete, to be removed from libpng-1.4.0 */
  79.883 +    return (png_ptr? 0L: 0L);
  79.884 +}
  79.885 +#endif /* ?PNG_1_0_X */
  79.886 +#endif /* ?PNG_ASSEMBLER_CODE_SUPPORTED */
  79.887 +
  79.888 +#ifdef PNG_SET_USER_LIMITS_SUPPORTED
  79.889 +/* these functions were added to libpng 1.2.6 */
  79.890 +png_uint_32 PNGAPI
  79.891 +png_get_user_width_max (png_structp png_ptr)
  79.892 +{
  79.893 +    return (png_ptr? png_ptr->user_width_max : 0);
  79.894 +}
  79.895 +png_uint_32 PNGAPI
  79.896 +png_get_user_height_max (png_structp png_ptr)
  79.897 +{
  79.898 +    return (png_ptr? png_ptr->user_height_max : 0);
  79.899 +}
  79.900 +#endif /* ?PNG_SET_USER_LIMITS_SUPPORTED */
  79.901 + 
  79.902 +
  79.903 +#endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */
    80.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    80.2 +++ b/libs/libpng/pngmem.c	Sun Nov 01 00:36:56 2015 +0200
    80.3 @@ -0,0 +1,609 @@
    80.4 +
    80.5 +/* pngmem.c - stub functions for memory allocation
    80.6 + *
    80.7 + * Last changed in libpng 1.2.30 [August 15, 2008]
    80.8 + * For conditions of distribution and use, see copyright notice in png.h
    80.9 + * Copyright (c) 1998-2008 Glenn Randers-Pehrson
   80.10 + * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
   80.11 + * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
   80.12 + *
   80.13 + * This file provides a location for all memory allocation.  Users who
   80.14 + * need special memory handling are expected to supply replacement
   80.15 + * functions for png_malloc() and png_free(), and to use
   80.16 + * png_create_read_struct_2() and png_create_write_struct_2() to
   80.17 + * identify the replacement functions.
   80.18 + */
   80.19 +
   80.20 +#define PNG_INTERNAL
   80.21 +#include "png.h"
   80.22 +#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
   80.23 +
   80.24 +/* Borland DOS special memory handler */
   80.25 +#if defined(__TURBOC__) && !defined(_Windows) && !defined(__FLAT__)
   80.26 +/* if you change this, be sure to change the one in png.h also */
   80.27 +
   80.28 +/* Allocate memory for a png_struct.  The malloc and memset can be replaced
   80.29 +   by a single call to calloc() if this is thought to improve performance. */
   80.30 +png_voidp /* PRIVATE */
   80.31 +png_create_struct(int type)
   80.32 +{
   80.33 +#ifdef PNG_USER_MEM_SUPPORTED
   80.34 +   return (png_create_struct_2(type, png_malloc_ptr_NULL, png_voidp_NULL));
   80.35 +}
   80.36 +
   80.37 +/* Alternate version of png_create_struct, for use with user-defined malloc. */
   80.38 +png_voidp /* PRIVATE */
   80.39 +png_create_struct_2(int type, png_malloc_ptr malloc_fn, png_voidp mem_ptr)
   80.40 +{
   80.41 +#endif /* PNG_USER_MEM_SUPPORTED */
   80.42 +   png_size_t size;
   80.43 +   png_voidp struct_ptr;
   80.44 +
   80.45 +   if (type == PNG_STRUCT_INFO)
   80.46 +     size = png_sizeof(png_info);
   80.47 +   else if (type == PNG_STRUCT_PNG)
   80.48 +     size = png_sizeof(png_struct);
   80.49 +   else
   80.50 +     return (png_get_copyright(NULL));
   80.51 +
   80.52 +#ifdef PNG_USER_MEM_SUPPORTED
   80.53 +   if (malloc_fn != NULL)
   80.54 +   {
   80.55 +      png_struct dummy_struct;
   80.56 +      png_structp png_ptr = &dummy_struct;
   80.57 +      png_ptr->mem_ptr=mem_ptr;
   80.58 +      struct_ptr = (*(malloc_fn))(png_ptr, (png_uint_32)size);
   80.59 +   }
   80.60 +   else
   80.61 +#endif /* PNG_USER_MEM_SUPPORTED */
   80.62 +      struct_ptr = (png_voidp)farmalloc(size);
   80.63 +   if (struct_ptr != NULL)
   80.64 +      png_memset(struct_ptr, 0, size);
   80.65 +   return (struct_ptr);
   80.66 +}
   80.67 +
   80.68 +/* Free memory allocated by a png_create_struct() call */
   80.69 +void /* PRIVATE */
   80.70 +png_destroy_struct(png_voidp struct_ptr)
   80.71 +{
   80.72 +#ifdef PNG_USER_MEM_SUPPORTED
   80.73 +   png_destroy_struct_2(struct_ptr, png_free_ptr_NULL, png_voidp_NULL);
   80.74 +}
   80.75 +
   80.76 +/* Free memory allocated by a png_create_struct() call */
   80.77 +void /* PRIVATE */
   80.78 +png_destroy_struct_2(png_voidp struct_ptr, png_free_ptr free_fn,
   80.79 +    png_voidp mem_ptr)
   80.80 +{
   80.81 +#endif
   80.82 +   if (struct_ptr != NULL)
   80.83 +   {
   80.84 +#ifdef PNG_USER_MEM_SUPPORTED
   80.85 +      if (free_fn != NULL)
   80.86 +      {
   80.87 +         png_struct dummy_struct;
   80.88 +         png_structp png_ptr = &dummy_struct;
   80.89 +         png_ptr->mem_ptr=mem_ptr;
   80.90 +         (*(free_fn))(png_ptr, struct_ptr);
   80.91 +         return;
   80.92 +      }
   80.93 +#endif /* PNG_USER_MEM_SUPPORTED */
   80.94 +      farfree (struct_ptr);
   80.95 +   }
   80.96 +}
   80.97 +
   80.98 +/* Allocate memory.  For reasonable files, size should never exceed
   80.99 + * 64K.  However, zlib may allocate more then 64K if you don't tell
  80.100 + * it not to.  See zconf.h and png.h for more information. zlib does
  80.101 + * need to allocate exactly 64K, so whatever you call here must
  80.102 + * have the ability to do that.
  80.103 + *
  80.104 + * Borland seems to have a problem in DOS mode for exactly 64K.
  80.105 + * It gives you a segment with an offset of 8 (perhaps to store its
  80.106 + * memory stuff).  zlib doesn't like this at all, so we have to
  80.107 + * detect and deal with it.  This code should not be needed in
  80.108 + * Windows or OS/2 modes, and only in 16 bit mode.  This code has
  80.109 + * been updated by Alexander Lehmann for version 0.89 to waste less
  80.110 + * memory.
  80.111 + *
  80.112 + * Note that we can't use png_size_t for the "size" declaration,
  80.113 + * since on some systems a png_size_t is a 16-bit quantity, and as a
  80.114 + * result, we would be truncating potentially larger memory requests
  80.115 + * (which should cause a fatal error) and introducing major problems.
  80.116 + */
  80.117 +
  80.118 +png_voidp PNGAPI
  80.119 +png_malloc(png_structp png_ptr, png_uint_32 size)
  80.120 +{
  80.121 +   png_voidp ret;
  80.122 +
  80.123 +   if (png_ptr == NULL || size == 0)
  80.124 +      return (NULL);
  80.125 +
  80.126 +#ifdef PNG_USER_MEM_SUPPORTED
  80.127 +   if (png_ptr->malloc_fn != NULL)
  80.128 +       ret = ((png_voidp)(*(png_ptr->malloc_fn))(png_ptr, (png_size_t)size));
  80.129 +   else
  80.130 +       ret = (png_malloc_default(png_ptr, size));
  80.131 +   if (ret == NULL && (png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0)
  80.132 +       png_error(png_ptr, "Out of memory!");
  80.133 +   return (ret);
  80.134 +}
  80.135 +
  80.136 +png_voidp PNGAPI
  80.137 +png_malloc_default(png_structp png_ptr, png_uint_32 size)
  80.138 +{
  80.139 +   png_voidp ret;
  80.140 +#endif /* PNG_USER_MEM_SUPPORTED */
  80.141 +
  80.142 +   if (png_ptr == NULL || size == 0)
  80.143 +      return (NULL);
  80.144 +
  80.145 +#ifdef PNG_MAX_MALLOC_64K
  80.146 +   if (size > (png_uint_32)65536L)
  80.147 +   {
  80.148 +      png_warning(png_ptr, "Cannot Allocate > 64K");
  80.149 +      ret = NULL;
  80.150 +   }
  80.151 +   else
  80.152 +#endif
  80.153 +
  80.154 +   if (size != (size_t)size)
  80.155 +     ret = NULL;
  80.156 +   else if (size == (png_uint_32)65536L)
  80.157 +   {
  80.158 +      if (png_ptr->offset_table == NULL)
  80.159 +      {
  80.160 +         /* try to see if we need to do any of this fancy stuff */
  80.161 +         ret = farmalloc(size);
  80.162 +         if (ret == NULL || ((png_size_t)ret & 0xffff))
  80.163 +         {
  80.164 +            int num_blocks;
  80.165 +            png_uint_32 total_size;
  80.166 +            png_bytep table;
  80.167 +            int i;
  80.168 +            png_byte huge * hptr;
  80.169 +
  80.170 +            if (ret != NULL)
  80.171 +            {
  80.172 +               farfree(ret);
  80.173 +               ret = NULL;
  80.174 +            }
  80.175 +
  80.176 +            if (png_ptr->zlib_window_bits > 14)
  80.177 +               num_blocks = (int)(1 << (png_ptr->zlib_window_bits - 14));
  80.178 +            else
  80.179 +               num_blocks = 1;
  80.180 +            if (png_ptr->zlib_mem_level >= 7)
  80.181 +               num_blocks += (int)(1 << (png_ptr->zlib_mem_level - 7));
  80.182 +            else
  80.183 +               num_blocks++;
  80.184 +
  80.185 +            total_size = ((png_uint_32)65536L) * (png_uint_32)num_blocks+16;
  80.186 +
  80.187 +            table = farmalloc(total_size);
  80.188 +
  80.189 +            if (table == NULL)
  80.190 +            {
  80.191 +#ifndef PNG_USER_MEM_SUPPORTED
  80.192 +               if ((png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0)
  80.193 +                  png_error(png_ptr, "Out Of Memory."); /* Note "O" and "M" */
  80.194 +               else
  80.195 +                  png_warning(png_ptr, "Out Of Memory.");
  80.196 +#endif
  80.197 +               return (NULL);
  80.198 +            }
  80.199 +
  80.200 +            if ((png_size_t)table & 0xfff0)
  80.201 +            {
  80.202 +#ifndef PNG_USER_MEM_SUPPORTED
  80.203 +               if ((png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0)
  80.204 +                  png_error(png_ptr,
  80.205 +                    "Farmalloc didn't return normalized pointer");
  80.206 +               else
  80.207 +                  png_warning(png_ptr,
  80.208 +                    "Farmalloc didn't return normalized pointer");
  80.209 +#endif
  80.210 +               return (NULL);
  80.211 +            }
  80.212 +
  80.213 +            png_ptr->offset_table = table;
  80.214 +            png_ptr->offset_table_ptr = farmalloc(num_blocks *
  80.215 +               png_sizeof(png_bytep));
  80.216 +
  80.217 +            if (png_ptr->offset_table_ptr == NULL)
  80.218 +            {
  80.219 +#ifndef PNG_USER_MEM_SUPPORTED
  80.220 +               if ((png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0)
  80.221 +                  png_error(png_ptr, "Out Of memory."); /* Note "O" and "M" */
  80.222 +               else
  80.223 +                  png_warning(png_ptr, "Out Of memory.");
  80.224 +#endif
  80.225 +               return (NULL);
  80.226 +            }
  80.227 +
  80.228 +            hptr = (png_byte huge *)table;
  80.229 +            if ((png_size_t)hptr & 0xf)
  80.230 +            {
  80.231 +               hptr = (png_byte huge *)((long)(hptr) & 0xfffffff0L);
  80.232 +               hptr = hptr + 16L;  /* "hptr += 16L" fails on Turbo C++ 3.0 */
  80.233 +            }
  80.234 +            for (i = 0; i < num_blocks; i++)
  80.235 +            {
  80.236 +               png_ptr->offset_table_ptr[i] = (png_bytep)hptr;
  80.237 +               hptr = hptr + (png_uint_32)65536L;  /* "+=" fails on TC++3.0 */
  80.238 +            }
  80.239 +
  80.240 +            png_ptr->offset_table_number = num_blocks;
  80.241 +            png_ptr->offset_table_count = 0;
  80.242 +            png_ptr->offset_table_count_free = 0;
  80.243 +         }
  80.244 +      }
  80.245 +
  80.246 +      if (png_ptr->offset_table_count >= png_ptr->offset_table_number)
  80.247 +      {
  80.248 +#ifndef PNG_USER_MEM_SUPPORTED
  80.249 +         if ((png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0)
  80.250 +            png_error(png_ptr, "Out of Memory."); /* Note "o" and "M" */
  80.251 +         else
  80.252 +            png_warning(png_ptr, "Out of Memory.");
  80.253 +#endif
  80.254 +         return (NULL);
  80.255 +      }
  80.256 +
  80.257 +      ret = png_ptr->offset_table_ptr[png_ptr->offset_table_count++];
  80.258 +   }
  80.259 +   else
  80.260 +      ret = farmalloc(size);
  80.261 +
  80.262 +#ifndef PNG_USER_MEM_SUPPORTED
  80.263 +   if (ret == NULL)
  80.264 +   {
  80.265 +      if ((png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0)
  80.266 +         png_error(png_ptr, "Out of memory."); /* Note "o" and "m" */
  80.267 +      else
  80.268 +         png_warning(png_ptr, "Out of memory."); /* Note "o" and "m" */
  80.269 +   }
  80.270 +#endif
  80.271 +
  80.272 +   return (ret);
  80.273 +}
  80.274 +
  80.275 +/* free a pointer allocated by png_malloc().  In the default
  80.276 +   configuration, png_ptr is not used, but is passed in case it
  80.277 +   is needed.  If ptr is NULL, return without taking any action. */
  80.278 +
  80.279 +void PNGAPI
  80.280 +png_free(png_structp png_ptr, png_voidp ptr)
  80.281 +{
  80.282 +   if (png_ptr == NULL || ptr == NULL)
  80.283 +      return;
  80.284 +
  80.285 +#ifdef PNG_USER_MEM_SUPPORTED
  80.286 +   if (png_ptr->free_fn != NULL)
  80.287 +   {
  80.288 +      (*(png_ptr->free_fn))(png_ptr, ptr);
  80.289 +      return;
  80.290 +   }
  80.291 +   else png_free_default(png_ptr, ptr);
  80.292 +}
  80.293 +
  80.294 +void PNGAPI
  80.295 +png_free_default(png_structp png_ptr, png_voidp ptr)
  80.296 +{
  80.297 +#endif /* PNG_USER_MEM_SUPPORTED */
  80.298 +
  80.299 +   if (png_ptr == NULL || ptr == NULL) return;
  80.300 +
  80.301 +   if (png_ptr->offset_table != NULL)
  80.302 +   {
  80.303 +      int i;
  80.304 +
  80.305 +      for (i = 0; i < png_ptr->offset_table_count; i++)
  80.306 +      {
  80.307 +         if (ptr == png_ptr->offset_table_ptr[i])
  80.308 +         {
  80.309 +            ptr = NULL;
  80.310 +            png_ptr->offset_table_count_free++;
  80.311 +            break;
  80.312 +         }
  80.313 +      }
  80.314 +      if (png_ptr->offset_table_count_free == png_ptr->offset_table_count)
  80.315 +      {
  80.316 +         farfree(png_ptr->offset_table);
  80.317 +         farfree(png_ptr->offset_table_ptr);
  80.318 +         png_ptr->offset_table = NULL;
  80.319 +         png_ptr->offset_table_ptr = NULL;
  80.320 +      }
  80.321 +   }
  80.322 +
  80.323 +   if (ptr != NULL)
  80.324 +   {
  80.325 +      farfree(ptr);
  80.326 +   }
  80.327 +}
  80.328 +
  80.329 +#else /* Not the Borland DOS special memory handler */
  80.330 +
  80.331 +/* Allocate memory for a png_struct or a png_info.  The malloc and
  80.332 +   memset can be replaced by a single call to calloc() if this is thought
  80.333 +   to improve performance noticably. */
  80.334 +png_voidp /* PRIVATE */
  80.335 +png_create_struct(int type)
  80.336 +{
  80.337 +#ifdef PNG_USER_MEM_SUPPORTED
  80.338 +   return (png_create_struct_2(type, png_malloc_ptr_NULL, png_voidp_NULL));
  80.339 +}
  80.340 +
  80.341 +/* Allocate memory for a png_struct or a png_info.  The malloc and
  80.342 +   memset can be replaced by a single call to calloc() if this is thought
  80.343 +   to improve performance noticably. */
  80.344 +png_voidp /* PRIVATE */
  80.345 +png_create_struct_2(int type, png_malloc_ptr malloc_fn, png_voidp mem_ptr)
  80.346 +{
  80.347 +#endif /* PNG_USER_MEM_SUPPORTED */
  80.348 +   png_size_t size;
  80.349 +   png_voidp struct_ptr;
  80.350 +
  80.351 +   if (type == PNG_STRUCT_INFO)
  80.352 +      size = png_sizeof(png_info);
  80.353 +   else if (type == PNG_STRUCT_PNG)
  80.354 +      size = png_sizeof(png_struct);
  80.355 +   else
  80.356 +      return (NULL);
  80.357 +
  80.358 +#ifdef PNG_USER_MEM_SUPPORTED
  80.359 +   if (malloc_fn != NULL)
  80.360 +   {
  80.361 +      png_struct dummy_struct;
  80.362 +      png_structp png_ptr = &dummy_struct;
  80.363 +      png_ptr->mem_ptr=mem_ptr;
  80.364 +      struct_ptr = (*(malloc_fn))(png_ptr, size);
  80.365 +      if (struct_ptr != NULL)
  80.366 +         png_memset(struct_ptr, 0, size);
  80.367 +      return (struct_ptr);
  80.368 +   }
  80.369 +#endif /* PNG_USER_MEM_SUPPORTED */
  80.370 +
  80.371 +#if defined(__TURBOC__) && !defined(__FLAT__)
  80.372 +   struct_ptr = (png_voidp)farmalloc(size);
  80.373 +#else
  80.374 +# if defined(_MSC_VER) && defined(MAXSEG_64K)
  80.375 +   struct_ptr = (png_voidp)halloc(size, 1);
  80.376 +# else
  80.377 +   struct_ptr = (png_voidp)malloc(size);
  80.378 +# endif
  80.379 +#endif
  80.380 +   if (struct_ptr != NULL)
  80.381 +      png_memset(struct_ptr, 0, size);
  80.382 +
  80.383 +   return (struct_ptr);
  80.384 +}
  80.385 +
  80.386 +
  80.387 +/* Free memory allocated by a png_create_struct() call */
  80.388 +void /* PRIVATE */
  80.389 +png_destroy_struct(png_voidp struct_ptr)
  80.390 +{
  80.391 +#ifdef PNG_USER_MEM_SUPPORTED
  80.392 +   png_destroy_struct_2(struct_ptr, png_free_ptr_NULL, png_voidp_NULL);
  80.393 +}
  80.394 +
  80.395 +/* Free memory allocated by a png_create_struct() call */
  80.396 +void /* PRIVATE */
  80.397 +png_destroy_struct_2(png_voidp struct_ptr, png_free_ptr free_fn,
  80.398 +    png_voidp mem_ptr)
  80.399 +{
  80.400 +#endif /* PNG_USER_MEM_SUPPORTED */
  80.401 +   if (struct_ptr != NULL)
  80.402 +   {
  80.403 +#ifdef PNG_USER_MEM_SUPPORTED
  80.404 +      if (free_fn != NULL)
  80.405 +      {
  80.406 +         png_struct dummy_struct;
  80.407 +         png_structp png_ptr = &dummy_struct;
  80.408 +         png_ptr->mem_ptr=mem_ptr;
  80.409 +         (*(free_fn))(png_ptr, struct_ptr);
  80.410 +         return;
  80.411 +      }
  80.412 +#endif /* PNG_USER_MEM_SUPPORTED */
  80.413 +#if defined(__TURBOC__) && !defined(__FLAT__)
  80.414 +      farfree(struct_ptr);
  80.415 +#else
  80.416 +# if defined(_MSC_VER) && defined(MAXSEG_64K)
  80.417 +      hfree(struct_ptr);
  80.418 +# else
  80.419 +      free(struct_ptr);
  80.420 +# endif
  80.421 +#endif
  80.422 +   }
  80.423 +}
  80.424 +
  80.425 +/* Allocate memory.  For reasonable files, size should never exceed
  80.426 +   64K.  However, zlib may allocate more then 64K if you don't tell
  80.427 +   it not to.  See zconf.h and png.h for more information.  zlib does
  80.428 +   need to allocate exactly 64K, so whatever you call here must
  80.429 +   have the ability to do that. */
  80.430 +
  80.431 +png_voidp PNGAPI
  80.432 +png_malloc(png_structp png_ptr, png_uint_32 size)
  80.433 +{
  80.434 +   png_voidp ret;
  80.435 +
  80.436 +#ifdef PNG_USER_MEM_SUPPORTED
  80.437 +   if (png_ptr == NULL || size == 0)
  80.438 +      return (NULL);
  80.439 +
  80.440 +   if (png_ptr->malloc_fn != NULL)
  80.441 +       ret = ((png_voidp)(*(png_ptr->malloc_fn))(png_ptr, (png_size_t)size));
  80.442 +   else
  80.443 +       ret = (png_malloc_default(png_ptr, size));
  80.444 +   if (ret == NULL && (png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0)
  80.445 +       png_error(png_ptr, "Out of Memory!");
  80.446 +   return (ret);
  80.447 +}
  80.448 +
  80.449 +png_voidp PNGAPI
  80.450 +png_malloc_default(png_structp png_ptr, png_uint_32 size)
  80.451 +{
  80.452 +   png_voidp ret;
  80.453 +#endif /* PNG_USER_MEM_SUPPORTED */
  80.454 +
  80.455 +   if (png_ptr == NULL || size == 0)
  80.456 +      return (NULL);
  80.457 +
  80.458 +#ifdef PNG_MAX_MALLOC_64K
  80.459 +   if (size > (png_uint_32)65536L)
  80.460 +   {
  80.461 +#ifndef PNG_USER_MEM_SUPPORTED
  80.462 +      if ((png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0)
  80.463 +         png_error(png_ptr, "Cannot Allocate > 64K");
  80.464 +      else
  80.465 +#endif
  80.466 +         return NULL;
  80.467 +   }
  80.468 +#endif
  80.469 +
  80.470 + /* Check for overflow */
  80.471 +#if defined(__TURBOC__) && !defined(__FLAT__)
  80.472 + if (size != (unsigned long)size)
  80.473 +   ret = NULL;
  80.474 + else
  80.475 +   ret = farmalloc(size);
  80.476 +#else
  80.477 +# if defined(_MSC_VER) && defined(MAXSEG_64K)
  80.478 + if (size != (unsigned long)size)
  80.479 +   ret = NULL;
  80.480 + else
  80.481 +   ret = halloc(size, 1);
  80.482 +# else
  80.483 + if (size != (size_t)size)
  80.484 +   ret = NULL;
  80.485 + else
  80.486 +   ret = malloc((size_t)size);
  80.487 +# endif
  80.488 +#endif
  80.489 +
  80.490 +#ifndef PNG_USER_MEM_SUPPORTED
  80.491 +   if (ret == NULL && (png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0)
  80.492 +      png_error(png_ptr, "Out of Memory");
  80.493 +#endif
  80.494 +
  80.495 +   return (ret);
  80.496 +}
  80.497 +
  80.498 +/* Free a pointer allocated by png_malloc().  If ptr is NULL, return
  80.499 +   without taking any action. */
  80.500 +void PNGAPI
  80.501 +png_free(png_structp png_ptr, png_voidp ptr)
  80.502 +{
  80.503 +   if (png_ptr == NULL || ptr == NULL)
  80.504 +      return;
  80.505 +
  80.506 +#ifdef PNG_USER_MEM_SUPPORTED
  80.507 +   if (png_ptr->free_fn != NULL)
  80.508 +   {
  80.509 +      (*(png_ptr->free_fn))(png_ptr, ptr);
  80.510 +      return;
  80.511 +   }
  80.512 +   else png_free_default(png_ptr, ptr);
  80.513 +}
  80.514 +void PNGAPI
  80.515 +png_free_default(png_structp png_ptr, png_voidp ptr)
  80.516 +{
  80.517 +   if (png_ptr == NULL || ptr == NULL)
  80.518 +      return;
  80.519 +
  80.520 +#endif /* PNG_USER_MEM_SUPPORTED */
  80.521 +
  80.522 +#if defined(__TURBOC__) && !defined(__FLAT__)
  80.523 +   farfree(ptr);
  80.524 +#else
  80.525 +# if defined(_MSC_VER) && defined(MAXSEG_64K)
  80.526 +   hfree(ptr);
  80.527 +# else
  80.528 +   free(ptr);
  80.529 +# endif
  80.530 +#endif
  80.531 +}
  80.532 +
  80.533 +#endif /* Not Borland DOS special memory handler */
  80.534 +
  80.535 +#if defined(PNG_1_0_X)
  80.536 +#  define png_malloc_warn png_malloc
  80.537 +#else
  80.538 +/* This function was added at libpng version 1.2.3.  The png_malloc_warn()
  80.539 + * function will set up png_malloc() to issue a png_warning and return NULL
  80.540 + * instead of issuing a png_error, if it fails to allocate the requested
  80.541 + * memory.
  80.542 + */
  80.543 +png_voidp PNGAPI
  80.544 +png_malloc_warn(png_structp png_ptr, png_uint_32 size)
  80.545 +{
  80.546 +   png_voidp ptr;
  80.547 +   png_uint_32 save_flags;
  80.548 +   if (png_ptr == NULL) return (NULL);
  80.549 +
  80.550 +   save_flags = png_ptr->flags;
  80.551 +   png_ptr->flags|=PNG_FLAG_MALLOC_NULL_MEM_OK;
  80.552 +   ptr = (png_voidp)png_malloc((png_structp)png_ptr, size);
  80.553 +   png_ptr->flags=save_flags;
  80.554 +   return(ptr);
  80.555 +}
  80.556 +#endif
  80.557 +
  80.558 +png_voidp PNGAPI
  80.559 +png_memcpy_check (png_structp png_ptr, png_voidp s1, png_voidp s2,
  80.560 +   png_uint_32 length)
  80.561 +{
  80.562 +   png_size_t size;
  80.563 +
  80.564 +   size = (png_size_t)length;
  80.565 +   if ((png_uint_32)size != length)
  80.566 +      png_error(png_ptr, "Overflow in png_memcpy_check.");
  80.567 +
  80.568 +   return(png_memcpy (s1, s2, size));
  80.569 +}
  80.570 +
  80.571 +png_voidp PNGAPI
  80.572 +png_memset_check (png_structp png_ptr, png_voidp s1, int value,
  80.573 +   png_uint_32 length)
  80.574 +{
  80.575 +   png_size_t size;
  80.576 +
  80.577 +   size = (png_size_t)length;
  80.578 +   if ((png_uint_32)size != length)
  80.579 +      png_error(png_ptr, "Overflow in png_memset_check.");
  80.580 +
  80.581 +   return (png_memset (s1, value, size));
  80.582 +
  80.583 +}
  80.584 +
  80.585 +#ifdef PNG_USER_MEM_SUPPORTED
  80.586 +/* This function is called when the application wants to use another method
  80.587 + * of allocating and freeing memory.
  80.588 + */
  80.589 +void PNGAPI
  80.590 +png_set_mem_fn(png_structp png_ptr, png_voidp mem_ptr, png_malloc_ptr
  80.591 +  malloc_fn, png_free_ptr free_fn)
  80.592 +{
  80.593 +   if (png_ptr != NULL)
  80.594 +   {
  80.595 +      png_ptr->mem_ptr = mem_ptr;
  80.596 +      png_ptr->malloc_fn = malloc_fn;
  80.597 +      png_ptr->free_fn = free_fn;
  80.598 +   }
  80.599 +}
  80.600 +
  80.601 +/* This function returns a pointer to the mem_ptr associated with the user
  80.602 + * functions.  The application should free any memory associated with this
  80.603 + * pointer before png_write_destroy and png_read_destroy are called.
  80.604 + */
  80.605 +png_voidp PNGAPI
  80.606 +png_get_mem_ptr(png_structp png_ptr)
  80.607 +{
  80.608 +   if (png_ptr == NULL) return (NULL);
  80.609 +   return ((png_voidp)png_ptr->mem_ptr);
  80.610 +}
  80.611 +#endif /* PNG_USER_MEM_SUPPORTED */
  80.612 +#endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */
    81.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    81.2 +++ b/libs/libpng/pngpread.c	Sun Nov 01 00:36:56 2015 +0200
    81.3 @@ -0,0 +1,1594 @@
    81.4 +
    81.5 +/* pngpread.c - read a png file in push mode
    81.6 + *
    81.7 + * Last changed in libpng 1.2.32 [September 18, 2008]
    81.8 + * For conditions of distribution and use, see copyright notice in png.h
    81.9 + * Copyright (c) 1998-2008 Glenn Randers-Pehrson
   81.10 + * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
   81.11 + * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
   81.12 + */
   81.13 +
   81.14 +#define PNG_INTERNAL
   81.15 +#include "png.h"
   81.16 +#ifdef PNG_PROGRESSIVE_READ_SUPPORTED
   81.17 +
   81.18 +/* push model modes */
   81.19 +#define PNG_READ_SIG_MODE   0
   81.20 +#define PNG_READ_CHUNK_MODE 1
   81.21 +#define PNG_READ_IDAT_MODE  2
   81.22 +#define PNG_SKIP_MODE       3
   81.23 +#define PNG_READ_tEXt_MODE  4
   81.24 +#define PNG_READ_zTXt_MODE  5
   81.25 +#define PNG_READ_DONE_MODE  6
   81.26 +#define PNG_READ_iTXt_MODE  7
   81.27 +#define PNG_ERROR_MODE      8
   81.28 +
   81.29 +void PNGAPI
   81.30 +png_process_data(png_structp png_ptr, png_infop info_ptr,
   81.31 +   png_bytep buffer, png_size_t buffer_size)
   81.32 +{
   81.33 +   if (png_ptr == NULL || info_ptr == NULL) return;
   81.34 +   png_push_restore_buffer(png_ptr, buffer, buffer_size);
   81.35 +
   81.36 +   while (png_ptr->buffer_size)
   81.37 +   {
   81.38 +      png_process_some_data(png_ptr, info_ptr);
   81.39 +   }
   81.40 +}
   81.41 +
   81.42 +/* What we do with the incoming data depends on what we were previously
   81.43 + * doing before we ran out of data...
   81.44 + */
   81.45 +void /* PRIVATE */
   81.46 +png_process_some_data(png_structp png_ptr, png_infop info_ptr)
   81.47 +{
   81.48 +   if (png_ptr == NULL) return;
   81.49 +   switch (png_ptr->process_mode)
   81.50 +   {
   81.51 +      case PNG_READ_SIG_MODE:
   81.52 +      {
   81.53 +         png_push_read_sig(png_ptr, info_ptr);
   81.54 +         break;
   81.55 +      }
   81.56 +      case PNG_READ_CHUNK_MODE:
   81.57 +      {
   81.58 +         png_push_read_chunk(png_ptr, info_ptr);
   81.59 +         break;
   81.60 +      }
   81.61 +      case PNG_READ_IDAT_MODE:
   81.62 +      {
   81.63 +         png_push_read_IDAT(png_ptr);
   81.64 +         break;
   81.65 +      }
   81.66 +#if defined(PNG_READ_tEXt_SUPPORTED)
   81.67 +      case PNG_READ_tEXt_MODE:
   81.68 +      {
   81.69 +         png_push_read_tEXt(png_ptr, info_ptr);
   81.70 +         break;
   81.71 +      }
   81.72 +#endif
   81.73 +#if defined(PNG_READ_zTXt_SUPPORTED)
   81.74 +      case PNG_READ_zTXt_MODE:
   81.75 +      {
   81.76 +         png_push_read_zTXt(png_ptr, info_ptr);
   81.77 +         break;
   81.78 +      }
   81.79 +#endif
   81.80 +#if defined(PNG_READ_iTXt_SUPPORTED)
   81.81 +      case PNG_READ_iTXt_MODE:
   81.82 +      {
   81.83 +         png_push_read_iTXt(png_ptr, info_ptr);
   81.84 +         break;
   81.85 +      }
   81.86 +#endif
   81.87 +      case PNG_SKIP_MODE:
   81.88 +      {
   81.89 +         png_push_crc_finish(png_ptr);
   81.90 +         break;
   81.91 +      }
   81.92 +      default:
   81.93 +      {
   81.94 +         png_ptr->buffer_size = 0;
   81.95 +         break;
   81.96 +      }
   81.97 +   }
   81.98 +}
   81.99 +
  81.100 +/* Read any remaining signature bytes from the stream and compare them with
  81.101 + * the correct PNG signature.  It is possible that this routine is called
  81.102 + * with bytes already read from the signature, either because they have been
  81.103 + * checked by the calling application, or because of multiple calls to this
  81.104 + * routine.
  81.105 + */
  81.106 +void /* PRIVATE */
  81.107 +png_push_read_sig(png_structp png_ptr, png_infop info_ptr)
  81.108 +{
  81.109 +   png_size_t num_checked = png_ptr->sig_bytes,
  81.110 +             num_to_check = 8 - num_checked;
  81.111 +
  81.112 +   if (png_ptr->buffer_size < num_to_check)
  81.113 +   {
  81.114 +      num_to_check = png_ptr->buffer_size;
  81.115 +   }
  81.116 +
  81.117 +   png_push_fill_buffer(png_ptr, &(info_ptr->signature[num_checked]),
  81.118 +      num_to_check);
  81.119 +   png_ptr->sig_bytes = (png_byte)(png_ptr->sig_bytes + num_to_check);
  81.120 +
  81.121 +   if (png_sig_cmp(info_ptr->signature, num_checked, num_to_check))
  81.122 +   {
  81.123 +      if (num_checked < 4 &&
  81.124 +          png_sig_cmp(info_ptr->signature, num_checked, num_to_check - 4))
  81.125 +         png_error(png_ptr, "Not a PNG file");
  81.126 +      else
  81.127 +         png_error(png_ptr, "PNG file corrupted by ASCII conversion");
  81.128 +   }
  81.129 +   else
  81.130 +   {
  81.131 +      if (png_ptr->sig_bytes >= 8)
  81.132 +      {
  81.133 +         png_ptr->process_mode = PNG_READ_CHUNK_MODE;
  81.134 +      }
  81.135 +   }
  81.136 +}
  81.137 +
  81.138 +void /* PRIVATE */
  81.139 +png_push_read_chunk(png_structp png_ptr, png_infop info_ptr)
  81.140 +{
  81.141 +#ifdef PNG_USE_LOCAL_ARRAYS
  81.142 +      PNG_CONST PNG_IHDR;
  81.143 +      PNG_CONST PNG_IDAT;
  81.144 +      PNG_CONST PNG_IEND;
  81.145 +      PNG_CONST PNG_PLTE;
  81.146 +#if defined(PNG_READ_bKGD_SUPPORTED)
  81.147 +      PNG_CONST PNG_bKGD;
  81.148 +#endif
  81.149 +#if defined(PNG_READ_cHRM_SUPPORTED)
  81.150 +      PNG_CONST PNG_cHRM;
  81.151 +#endif
  81.152 +#if defined(PNG_READ_gAMA_SUPPORTED)
  81.153 +      PNG_CONST PNG_gAMA;
  81.154 +#endif
  81.155 +#if defined(PNG_READ_hIST_SUPPORTED)
  81.156 +      PNG_CONST PNG_hIST;
  81.157 +#endif
  81.158 +#if defined(PNG_READ_iCCP_SUPPORTED)
  81.159 +      PNG_CONST PNG_iCCP;
  81.160 +#endif
  81.161 +#if defined(PNG_READ_iTXt_SUPPORTED)
  81.162 +      PNG_CONST PNG_iTXt;
  81.163 +#endif
  81.164 +#if defined(PNG_READ_oFFs_SUPPORTED)
  81.165 +      PNG_CONST PNG_oFFs;
  81.166 +#endif
  81.167 +#if defined(PNG_READ_pCAL_SUPPORTED)
  81.168 +      PNG_CONST PNG_pCAL;
  81.169 +#endif
  81.170 +#if defined(PNG_READ_pHYs_SUPPORTED)
  81.171 +      PNG_CONST PNG_pHYs;
  81.172 +#endif
  81.173 +#if defined(PNG_READ_sBIT_SUPPORTED)
  81.174 +      PNG_CONST PNG_sBIT;
  81.175 +#endif
  81.176 +#if defined(PNG_READ_sCAL_SUPPORTED)
  81.177 +      PNG_CONST PNG_sCAL;
  81.178 +#endif
  81.179 +#if defined(PNG_READ_sRGB_SUPPORTED)
  81.180 +      PNG_CONST PNG_sRGB;
  81.181 +#endif
  81.182 +#if defined(PNG_READ_sPLT_SUPPORTED)
  81.183 +      PNG_CONST PNG_sPLT;
  81.184 +#endif
  81.185 +#if defined(PNG_READ_tEXt_SUPPORTED)
  81.186 +      PNG_CONST PNG_tEXt;
  81.187 +#endif
  81.188 +#if defined(PNG_READ_tIME_SUPPORTED)
  81.189 +      PNG_CONST PNG_tIME;
  81.190 +#endif
  81.191 +#if defined(PNG_READ_tRNS_SUPPORTED)
  81.192 +      PNG_CONST PNG_tRNS;
  81.193 +#endif
  81.194 +#if defined(PNG_READ_zTXt_SUPPORTED)
  81.195 +      PNG_CONST PNG_zTXt;
  81.196 +#endif
  81.197 +#endif /* PNG_USE_LOCAL_ARRAYS */
  81.198 +   /* First we make sure we have enough data for the 4 byte chunk name
  81.199 +    * and the 4 byte chunk length before proceeding with decoding the
  81.200 +    * chunk data.  To fully decode each of these chunks, we also make
  81.201 +    * sure we have enough data in the buffer for the 4 byte CRC at the
  81.202 +    * end of every chunk (except IDAT, which is handled separately).
  81.203 +    */
  81.204 +   if (!(png_ptr->mode & PNG_HAVE_CHUNK_HEADER))
  81.205 +   {
  81.206 +      png_byte chunk_length[4];
  81.207 +
  81.208 +      if (png_ptr->buffer_size < 8)
  81.209 +      {
  81.210 +         png_push_save_buffer(png_ptr);
  81.211 +         return;
  81.212 +      }
  81.213 +
  81.214 +      png_push_fill_buffer(png_ptr, chunk_length, 4);
  81.215 +      png_ptr->push_length = png_get_uint_31(png_ptr, chunk_length);
  81.216 +      png_reset_crc(png_ptr);
  81.217 +      png_crc_read(png_ptr, png_ptr->chunk_name, 4);
  81.218 +      png_check_chunk_name(png_ptr, png_ptr->chunk_name);
  81.219 +      png_ptr->mode |= PNG_HAVE_CHUNK_HEADER;
  81.220 +   }
  81.221 +
  81.222 +   if (!png_memcmp(png_ptr->chunk_name, png_IDAT, 4))
  81.223 +     if (png_ptr->mode & PNG_AFTER_IDAT)
  81.224 +        png_ptr->mode |= PNG_HAVE_CHUNK_AFTER_IDAT;
  81.225 +
  81.226 +   if (!png_memcmp(png_ptr->chunk_name, png_IHDR, 4))
  81.227 +   {
  81.228 +      if (png_ptr->push_length != 13)
  81.229 +         png_error(png_ptr, "Invalid IHDR length");
  81.230 +      if (png_ptr->push_length + 4 > png_ptr->buffer_size)
  81.231 +      {
  81.232 +         png_push_save_buffer(png_ptr);
  81.233 +         return;
  81.234 +      }
  81.235 +      png_handle_IHDR(png_ptr, info_ptr, png_ptr->push_length);
  81.236 +   }
  81.237 +   else if (!png_memcmp(png_ptr->chunk_name, png_IEND, 4))
  81.238 +   {
  81.239 +      if (png_ptr->push_length + 4 > png_ptr->buffer_size)
  81.240 +      {
  81.241 +         png_push_save_buffer(png_ptr);
  81.242 +         return;
  81.243 +      }
  81.244 +      png_handle_IEND(png_ptr, info_ptr, png_ptr->push_length);
  81.245 +
  81.246 +      png_ptr->process_mode = PNG_READ_DONE_MODE;
  81.247 +      png_push_have_end(png_ptr, info_ptr);
  81.248 +   }
  81.249 +#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
  81.250 +   else if (png_handle_as_unknown(png_ptr, png_ptr->chunk_name))
  81.251 +   {
  81.252 +      if (png_ptr->push_length + 4 > png_ptr->buffer_size)
  81.253 +      {
  81.254 +         png_push_save_buffer(png_ptr);
  81.255 +         return;
  81.256 +      }
  81.257 +      if (!png_memcmp(png_ptr->chunk_name, png_IDAT, 4))
  81.258 +         png_ptr->mode |= PNG_HAVE_IDAT;
  81.259 +      png_handle_unknown(png_ptr, info_ptr, png_ptr->push_length);
  81.260 +      if (!png_memcmp(png_ptr->chunk_name, png_PLTE, 4))
  81.261 +         png_ptr->mode |= PNG_HAVE_PLTE;
  81.262 +      else if (!png_memcmp(png_ptr->chunk_name, png_IDAT, 4))
  81.263 +      {
  81.264 +         if (!(png_ptr->mode & PNG_HAVE_IHDR))
  81.265 +            png_error(png_ptr, "Missing IHDR before IDAT");
  81.266 +         else if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE &&
  81.267 +                  !(png_ptr->mode & PNG_HAVE_PLTE))
  81.268 +            png_error(png_ptr, "Missing PLTE before IDAT");
  81.269 +      }
  81.270 +   }
  81.271 +#endif
  81.272 +   else if (!png_memcmp(png_ptr->chunk_name, png_PLTE, 4))
  81.273 +   {
  81.274 +      if (png_ptr->push_length + 4 > png_ptr->buffer_size)
  81.275 +      {
  81.276 +         png_push_save_buffer(png_ptr);
  81.277 +         return;
  81.278 +      }
  81.279 +      png_handle_PLTE(png_ptr, info_ptr, png_ptr->push_length);
  81.280 +   }
  81.281 +   else if (!png_memcmp(png_ptr->chunk_name, png_IDAT, 4))
  81.282 +   {
  81.283 +      /* If we reach an IDAT chunk, this means we have read all of the
  81.284 +       * header chunks, and we can start reading the image (or if this
  81.285 +       * is called after the image has been read - we have an error).
  81.286 +       */
  81.287 +     if (!(png_ptr->mode & PNG_HAVE_IHDR))
  81.288 +       png_error(png_ptr, "Missing IHDR before IDAT");
  81.289 +     else if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE &&
  81.290 +         !(png_ptr->mode & PNG_HAVE_PLTE))
  81.291 +       png_error(png_ptr, "Missing PLTE before IDAT");
  81.292 +
  81.293 +      if (png_ptr->mode & PNG_HAVE_IDAT)
  81.294 +      {
  81.295 +         if (!(png_ptr->mode & PNG_HAVE_CHUNK_AFTER_IDAT))
  81.296 +           if (png_ptr->push_length == 0)
  81.297 +              return;
  81.298 +
  81.299 +         if (png_ptr->mode & PNG_AFTER_IDAT)
  81.300 +            png_error(png_ptr, "Too many IDAT's found");
  81.301 +      }
  81.302 +
  81.303 +      png_ptr->idat_size = png_ptr->push_length;
  81.304 +      png_ptr->mode |= PNG_HAVE_IDAT;
  81.305 +      png_ptr->process_mode = PNG_READ_IDAT_MODE;
  81.306 +      png_push_have_info(png_ptr, info_ptr);
  81.307 +      png_ptr->zstream.avail_out = (uInt)png_ptr->irowbytes;
  81.308 +      png_ptr->zstream.next_out = png_ptr->row_buf;
  81.309 +      return;
  81.310 +   }
  81.311 +#if defined(PNG_READ_gAMA_SUPPORTED)
  81.312 +   else if (!png_memcmp(png_ptr->chunk_name, png_gAMA, 4))
  81.313 +   {
  81.314 +      if (png_ptr->push_length + 4 > png_ptr->buffer_size)
  81.315 +      {
  81.316 +         png_push_save_buffer(png_ptr);
  81.317 +         return;
  81.318 +      }
  81.319 +      png_handle_gAMA(png_ptr, info_ptr, png_ptr->push_length);
  81.320 +   }
  81.321 +#endif
  81.322 +#if defined(PNG_READ_sBIT_SUPPORTED)
  81.323 +   else if (!png_memcmp(png_ptr->chunk_name, png_sBIT, 4))
  81.324 +   {
  81.325 +      if (png_ptr->push_length + 4 > png_ptr->buffer_size)
  81.326 +      {
  81.327 +         png_push_save_buffer(png_ptr);
  81.328 +         return;
  81.329 +      }
  81.330 +      png_handle_sBIT(png_ptr, info_ptr, png_ptr->push_length);
  81.331 +   }
  81.332 +#endif
  81.333 +#if defined(PNG_READ_cHRM_SUPPORTED)
  81.334 +   else if (!png_memcmp(png_ptr->chunk_name, png_cHRM, 4))
  81.335 +   {
  81.336 +      if (png_ptr->push_length + 4 > png_ptr->buffer_size)
  81.337 +      {
  81.338 +         png_push_save_buffer(png_ptr);
  81.339 +         return;
  81.340 +      }
  81.341 +      png_handle_cHRM(png_ptr, info_ptr, png_ptr->push_length);
  81.342 +   }
  81.343 +#endif
  81.344 +#if defined(PNG_READ_sRGB_SUPPORTED)
  81.345 +   else if (!png_memcmp(png_ptr->chunk_name, png_sRGB, 4))
  81.346 +   {
  81.347 +      if (png_ptr->push_length + 4 > png_ptr->buffer_size)
  81.348 +      {
  81.349 +         png_push_save_buffer(png_ptr);
  81.350 +         return;
  81.351 +      }
  81.352 +      png_handle_sRGB(png_ptr, info_ptr, png_ptr->push_length);
  81.353 +   }
  81.354 +#endif
  81.355 +#if defined(PNG_READ_iCCP_SUPPORTED)
  81.356 +   else if (!png_memcmp(png_ptr->chunk_name, png_iCCP, 4))
  81.357 +   {
  81.358 +      if (png_ptr->push_length + 4 > png_ptr->buffer_size)
  81.359 +      {
  81.360 +         png_push_save_buffer(png_ptr);
  81.361 +         return;
  81.362 +      }
  81.363 +      png_handle_iCCP(png_ptr, info_ptr, png_ptr->push_length);
  81.364 +   }
  81.365 +#endif
  81.366 +#if defined(PNG_READ_sPLT_SUPPORTED)
  81.367 +   else if (!png_memcmp(png_ptr->chunk_name, png_sPLT, 4))
  81.368 +   {
  81.369 +      if (png_ptr->push_length + 4 > png_ptr->buffer_size)
  81.370 +      {
  81.371 +         png_push_save_buffer(png_ptr);
  81.372 +         return;
  81.373 +      }
  81.374 +      png_handle_sPLT(png_ptr, info_ptr, png_ptr->push_length);
  81.375 +   }
  81.376 +#endif
  81.377 +#if defined(PNG_READ_tRNS_SUPPORTED)
  81.378 +   else if (!png_memcmp(png_ptr->chunk_name, png_tRNS, 4))
  81.379 +   {
  81.380 +      if (png_ptr->push_length + 4 > png_ptr->buffer_size)
  81.381 +      {
  81.382 +         png_push_save_buffer(png_ptr);
  81.383 +         return;
  81.384 +      }
  81.385 +      png_handle_tRNS(png_ptr, info_ptr, png_ptr->push_length);
  81.386 +   }
  81.387 +#endif
  81.388 +#if defined(PNG_READ_bKGD_SUPPORTED)
  81.389 +   else if (!png_memcmp(png_ptr->chunk_name, png_bKGD, 4))
  81.390 +   {
  81.391 +      if (png_ptr->push_length + 4 > png_ptr->buffer_size)
  81.392 +      {
  81.393 +         png_push_save_buffer(png_ptr);
  81.394 +         return;
  81.395 +      }
  81.396 +      png_handle_bKGD(png_ptr, info_ptr, png_ptr->push_length);
  81.397 +   }
  81.398 +#endif
  81.399 +#if defined(PNG_READ_hIST_SUPPORTED)
  81.400 +   else if (!png_memcmp(png_ptr->chunk_name, png_hIST, 4))
  81.401 +   {
  81.402 +      if (png_ptr->push_length + 4 > png_ptr->buffer_size)
  81.403 +      {
  81.404 +         png_push_save_buffer(png_ptr);
  81.405 +         return;
  81.406 +      }
  81.407 +      png_handle_hIST(png_ptr, info_ptr, png_ptr->push_length);
  81.408 +   }
  81.409 +#endif
  81.410 +#if defined(PNG_READ_pHYs_SUPPORTED)
  81.411 +   else if (!png_memcmp(png_ptr->chunk_name, png_pHYs, 4))
  81.412 +   {
  81.413 +      if (png_ptr->push_length + 4 > png_ptr->buffer_size)
  81.414 +      {
  81.415 +         png_push_save_buffer(png_ptr);
  81.416 +         return;
  81.417 +      }
  81.418 +      png_handle_pHYs(png_ptr, info_ptr, png_ptr->push_length);
  81.419 +   }
  81.420 +#endif
  81.421 +#if defined(PNG_READ_oFFs_SUPPORTED)
  81.422 +   else if (!png_memcmp(png_ptr->chunk_name, png_oFFs, 4))
  81.423 +   {
  81.424 +      if (png_ptr->push_length + 4 > png_ptr->buffer_size)
  81.425 +      {
  81.426 +         png_push_save_buffer(png_ptr);
  81.427 +         return;
  81.428 +      }
  81.429 +      png_handle_oFFs(png_ptr, info_ptr, png_ptr->push_length);
  81.430 +   }
  81.431 +#endif
  81.432 +#if defined(PNG_READ_pCAL_SUPPORTED)
  81.433 +   else if (!png_memcmp(png_ptr->chunk_name, png_pCAL, 4))
  81.434 +   {
  81.435 +      if (png_ptr->push_length + 4 > png_ptr->buffer_size)
  81.436 +      {
  81.437 +         png_push_save_buffer(png_ptr);
  81.438 +         return;
  81.439 +      }
  81.440 +      png_handle_pCAL(png_ptr, info_ptr, png_ptr->push_length);
  81.441 +   }
  81.442 +#endif
  81.443 +#if defined(PNG_READ_sCAL_SUPPORTED)
  81.444 +   else if (!png_memcmp(png_ptr->chunk_name, png_sCAL, 4))
  81.445 +   {
  81.446 +      if (png_ptr->push_length + 4 > png_ptr->buffer_size)
  81.447 +      {
  81.448 +         png_push_save_buffer(png_ptr);
  81.449 +         return;
  81.450 +      }
  81.451 +      png_handle_sCAL(png_ptr, info_ptr, png_ptr->push_length);
  81.452 +   }
  81.453 +#endif
  81.454 +#if defined(PNG_READ_tIME_SUPPORTED)
  81.455 +   else if (!png_memcmp(png_ptr->chunk_name, png_tIME, 4))
  81.456 +   {
  81.457 +      if (png_ptr->push_length + 4 > png_ptr->buffer_size)
  81.458 +      {
  81.459 +         png_push_save_buffer(png_ptr);
  81.460 +         return;
  81.461 +      }
  81.462 +      png_handle_tIME(png_ptr, info_ptr, png_ptr->push_length);
  81.463 +   }
  81.464 +#endif
  81.465 +#if defined(PNG_READ_tEXt_SUPPORTED)
  81.466 +   else if (!png_memcmp(png_ptr->chunk_name, png_tEXt, 4))
  81.467 +   {
  81.468 +      if (png_ptr->push_length + 4 > png_ptr->buffer_size)
  81.469 +      {
  81.470 +         png_push_save_buffer(png_ptr);
  81.471 +         return;
  81.472 +      }
  81.473 +      png_push_handle_tEXt(png_ptr, info_ptr, png_ptr->push_length);
  81.474 +   }
  81.475 +#endif
  81.476 +#if defined(PNG_READ_zTXt_SUPPORTED)
  81.477 +   else if (!png_memcmp(png_ptr->chunk_name, png_zTXt, 4))
  81.478 +   {
  81.479 +      if (png_ptr->push_length + 4 > png_ptr->buffer_size)
  81.480 +      {
  81.481 +         png_push_save_buffer(png_ptr);
  81.482 +         return;
  81.483 +      }
  81.484 +      png_push_handle_zTXt(png_ptr, info_ptr, png_ptr->push_length);
  81.485 +   }
  81.486 +#endif
  81.487 +#if defined(PNG_READ_iTXt_SUPPORTED)
  81.488 +   else if (!png_memcmp(png_ptr->chunk_name, png_iTXt, 4))
  81.489 +   {
  81.490 +      if (png_ptr->push_length + 4 > png_ptr->buffer_size)
  81.491 +      {
  81.492 +         png_push_save_buffer(png_ptr);
  81.493 +         return;
  81.494 +      }
  81.495 +      png_push_handle_iTXt(png_ptr, info_ptr, png_ptr->push_length);
  81.496 +   }
  81.497 +#endif
  81.498 +   else
  81.499 +   {
  81.500 +      if (png_ptr->push_length + 4 > png_ptr->buffer_size)
  81.501 +      {
  81.502 +         png_push_save_buffer(png_ptr);
  81.503 +         return;
  81.504 +      }
  81.505 +      png_push_handle_unknown(png_ptr, info_ptr, png_ptr->push_length);
  81.506 +   }
  81.507 +
  81.508 +   png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER;
  81.509 +}
  81.510 +
  81.511 +void /* PRIVATE */
  81.512 +png_push_crc_skip(png_structp png_ptr, png_uint_32 skip)
  81.513 +{
  81.514 +   png_ptr->process_mode = PNG_SKIP_MODE;
  81.515 +   png_ptr->skip_length = skip;
  81.516 +}
  81.517 +
  81.518 +void /* PRIVATE */
  81.519 +png_push_crc_finish(png_structp png_ptr)
  81.520 +{
  81.521 +   if (png_ptr->skip_length && png_ptr->save_buffer_size)
  81.522 +   {
  81.523 +      png_size_t save_size;
  81.524 +
  81.525 +      if (png_ptr->skip_length < (png_uint_32)png_ptr->save_buffer_size)
  81.526 +         save_size = (png_size_t)png_ptr->skip_length;
  81.527 +      else
  81.528 +         save_size = png_ptr->save_buffer_size;
  81.529 +
  81.530 +      png_calculate_crc(png_ptr, png_ptr->save_buffer_ptr, save_size);
  81.531 +
  81.532 +      png_ptr->skip_length -= save_size;
  81.533 +      png_ptr->buffer_size -= save_size;
  81.534 +      png_ptr->save_buffer_size -= save_size;
  81.535 +      png_ptr->save_buffer_ptr += save_size;
  81.536 +   }
  81.537 +   if (png_ptr->skip_length && png_ptr->current_buffer_size)
  81.538 +   {
  81.539 +      png_size_t save_size;
  81.540 +
  81.541 +      if (png_ptr->skip_length < (png_uint_32)png_ptr->current_buffer_size)
  81.542 +         save_size = (png_size_t)png_ptr->skip_length;
  81.543 +      else
  81.544 +         save_size = png_ptr->current_buffer_size;
  81.545 +
  81.546 +      png_calculate_crc(png_ptr, png_ptr->current_buffer_ptr, save_size);
  81.547 +
  81.548 +      png_ptr->skip_length -= save_size;
  81.549 +      png_ptr->buffer_size -= save_size;
  81.550 +      png_ptr->current_buffer_size -= save_size;
  81.551 +      png_ptr->current_buffer_ptr += save_size;
  81.552 +   }
  81.553 +   if (!png_ptr->skip_length)
  81.554 +   {
  81.555 +      if (png_ptr->buffer_size < 4)
  81.556 +      {
  81.557 +         png_push_save_buffer(png_ptr);
  81.558 +         return;
  81.559 +      }
  81.560 +
  81.561 +      png_crc_finish(png_ptr, 0);
  81.562 +      png_ptr->process_mode = PNG_READ_CHUNK_MODE;
  81.563 +   }
  81.564 +}
  81.565 +
  81.566 +void PNGAPI
  81.567 +png_push_fill_buffer(png_structp png_ptr, png_bytep buffer, png_size_t length)
  81.568 +{
  81.569 +   png_bytep ptr;
  81.570 +
  81.571 +   if (png_ptr == NULL) return;
  81.572 +   ptr = buffer;
  81.573 +   if (png_ptr->save_buffer_size)
  81.574 +   {
  81.575 +      png_size_t save_size;
  81.576 +
  81.577 +      if (length < png_ptr->save_buffer_size)
  81.578 +         save_size = length;
  81.579 +      else
  81.580 +         save_size = png_ptr->save_buffer_size;
  81.581 +
  81.582 +      png_memcpy(ptr, png_ptr->save_buffer_ptr, save_size);
  81.583 +      length -= save_size;
  81.584 +      ptr += save_size;
  81.585 +      png_ptr->buffer_size -= save_size;
  81.586 +      png_ptr->save_buffer_size -= save_size;
  81.587 +      png_ptr->save_buffer_ptr += save_size;
  81.588 +   }
  81.589 +   if (length && png_ptr->current_buffer_size)
  81.590 +   {
  81.591 +      png_size_t save_size;
  81.592 +
  81.593 +      if (length < png_ptr->current_buffer_size)
  81.594 +         save_size = length;
  81.595 +      else
  81.596 +         save_size = png_ptr->current_buffer_size;
  81.597 +
  81.598 +      png_memcpy(ptr, png_ptr->current_buffer_ptr, save_size);
  81.599 +      png_ptr->buffer_size -= save_size;
  81.600 +      png_ptr->current_buffer_size -= save_size;
  81.601 +      png_ptr->current_buffer_ptr += save_size;
  81.602 +   }
  81.603 +}
  81.604 +
  81.605 +void /* PRIVATE */
  81.606 +png_push_save_buffer(png_structp png_ptr)
  81.607 +{
  81.608 +   if (png_ptr->save_buffer_size)
  81.609 +   {
  81.610 +      if (png_ptr->save_buffer_ptr != png_ptr->save_buffer)
  81.611 +      {
  81.612 +         png_size_t i, istop;
  81.613 +         png_bytep sp;
  81.614 +         png_bytep dp;
  81.615 +
  81.616 +         istop = png_ptr->save_buffer_size;
  81.617 +         for (i = 0, sp = png_ptr->save_buffer_ptr, dp = png_ptr->save_buffer;
  81.618 +            i < istop; i++, sp++, dp++)
  81.619 +         {
  81.620 +            *dp = *sp;
  81.621 +         }
  81.622 +      }
  81.623 +   }
  81.624 +   if (png_ptr->save_buffer_size + png_ptr->current_buffer_size >
  81.625 +      png_ptr->save_buffer_max)
  81.626 +   {
  81.627 +      png_size_t new_max;
  81.628 +      png_bytep old_buffer;
  81.629 +
  81.630 +      if (png_ptr->save_buffer_size > PNG_SIZE_MAX -
  81.631 +         (png_ptr->current_buffer_size + 256))
  81.632 +      {
  81.633 +        png_error(png_ptr, "Potential overflow of save_buffer");
  81.634 +      }
  81.635 +      new_max = png_ptr->save_buffer_size + png_ptr->current_buffer_size + 256;
  81.636 +      old_buffer = png_ptr->save_buffer;
  81.637 +      png_ptr->save_buffer = (png_bytep)png_malloc(png_ptr,
  81.638 +         (png_uint_32)new_max);
  81.639 +      png_memcpy(png_ptr->save_buffer, old_buffer, png_ptr->save_buffer_size);
  81.640 +      png_free(png_ptr, old_buffer);
  81.641 +      png_ptr->save_buffer_max = new_max;
  81.642 +   }
  81.643 +   if (png_ptr->current_buffer_size)
  81.644 +   {
  81.645 +      png_memcpy(png_ptr->save_buffer + png_ptr->save_buffer_size,
  81.646 +         png_ptr->current_buffer_ptr, png_ptr->current_buffer_size);
  81.647 +      png_ptr->save_buffer_size += png_ptr->current_buffer_size;
  81.648 +      png_ptr->current_buffer_size = 0;
  81.649 +   }
  81.650 +   png_ptr->save_buffer_ptr = png_ptr->save_buffer;
  81.651 +   png_ptr->buffer_size = 0;
  81.652 +}
  81.653 +
  81.654 +void /* PRIVATE */
  81.655 +png_push_restore_buffer(png_structp png_ptr, png_bytep buffer,
  81.656 +   png_size_t buffer_length)
  81.657 +{
  81.658 +   png_ptr->current_buffer = buffer;
  81.659 +   png_ptr->current_buffer_size = buffer_length;
  81.660 +   png_ptr->buffer_size = buffer_length + png_ptr->save_buffer_size;
  81.661 +   png_ptr->current_buffer_ptr = png_ptr->current_buffer;
  81.662 +}
  81.663 +
  81.664 +void /* PRIVATE */
  81.665 +png_push_read_IDAT(png_structp png_ptr)
  81.666 +{
  81.667 +#ifdef PNG_USE_LOCAL_ARRAYS
  81.668 +   PNG_CONST PNG_IDAT;
  81.669 +#endif
  81.670 +   if (!(png_ptr->mode & PNG_HAVE_CHUNK_HEADER))
  81.671 +   {
  81.672 +      png_byte chunk_length[4];
  81.673 +
  81.674 +      if (png_ptr->buffer_size < 8)
  81.675 +      {
  81.676 +         png_push_save_buffer(png_ptr);
  81.677 +         return;
  81.678 +      }
  81.679 +
  81.680 +      png_push_fill_buffer(png_ptr, chunk_length, 4);
  81.681 +      png_ptr->push_length = png_get_uint_31(png_ptr, chunk_length);
  81.682 +      png_reset_crc(png_ptr);
  81.683 +      png_crc_read(png_ptr, png_ptr->chunk_name, 4);
  81.684 +      png_ptr->mode |= PNG_HAVE_CHUNK_HEADER;
  81.685 +
  81.686 +      if (png_memcmp(png_ptr->chunk_name, png_IDAT, 4))
  81.687 +      {
  81.688 +         png_ptr->process_mode = PNG_READ_CHUNK_MODE;
  81.689 +         if (!(png_ptr->flags & PNG_FLAG_ZLIB_FINISHED))
  81.690 +            png_error(png_ptr, "Not enough compressed data");
  81.691 +         return;
  81.692 +      }
  81.693 +
  81.694 +      png_ptr->idat_size = png_ptr->push_length;
  81.695 +   }
  81.696 +   if (png_ptr->idat_size && png_ptr->save_buffer_size)
  81.697 +   {
  81.698 +      png_size_t save_size;
  81.699 +
  81.700 +      if (png_ptr->idat_size < (png_uint_32)png_ptr->save_buffer_size)
  81.701 +      {
  81.702 +         save_size = (png_size_t)png_ptr->idat_size;
  81.703 +         /* check for overflow */
  81.704 +         if ((png_uint_32)save_size != png_ptr->idat_size)
  81.705 +            png_error(png_ptr, "save_size overflowed in pngpread");
  81.706 +      }
  81.707 +      else
  81.708 +         save_size = png_ptr->save_buffer_size;
  81.709 +
  81.710 +      png_calculate_crc(png_ptr, png_ptr->save_buffer_ptr, save_size);
  81.711 +      if (!(png_ptr->flags & PNG_FLAG_ZLIB_FINISHED))
  81.712 +         png_process_IDAT_data(png_ptr, png_ptr->save_buffer_ptr, save_size);
  81.713 +      png_ptr->idat_size -= save_size;
  81.714 +      png_ptr->buffer_size -= save_size;
  81.715 +      png_ptr->save_buffer_size -= save_size;
  81.716 +      png_ptr->save_buffer_ptr += save_size;
  81.717 +   }
  81.718 +   if (png_ptr->idat_size && png_ptr->current_buffer_size)
  81.719 +   {
  81.720 +      png_size_t save_size;
  81.721 +
  81.722 +      if (png_ptr->idat_size < (png_uint_32)png_ptr->current_buffer_size)
  81.723 +      {
  81.724 +         save_size = (png_size_t)png_ptr->idat_size;
  81.725 +         /* check for overflow */
  81.726 +         if ((png_uint_32)save_size != png_ptr->idat_size)
  81.727 +            png_error(png_ptr, "save_size overflowed in pngpread");
  81.728 +      }
  81.729 +      else
  81.730 +         save_size = png_ptr->current_buffer_size;
  81.731 +
  81.732 +      png_calculate_crc(png_ptr, png_ptr->current_buffer_ptr, save_size);
  81.733 +      if (!(png_ptr->flags & PNG_FLAG_ZLIB_FINISHED))
  81.734 +        png_process_IDAT_data(png_ptr, png_ptr->current_buffer_ptr, save_size);
  81.735 +
  81.736 +      png_ptr->idat_size -= save_size;
  81.737 +      png_ptr->buffer_size -= save_size;
  81.738 +      png_ptr->current_buffer_size -= save_size;
  81.739 +      png_ptr->current_buffer_ptr += save_size;
  81.740 +   }
  81.741 +   if (!png_ptr->idat_size)
  81.742 +   {
  81.743 +      if (png_ptr->buffer_size < 4)
  81.744 +      {
  81.745 +         png_push_save_buffer(png_ptr);
  81.746 +         return;
  81.747 +      }
  81.748 +
  81.749 +      png_crc_finish(png_ptr, 0);
  81.750 +      png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER;
  81.751 +      png_ptr->mode |= PNG_AFTER_IDAT;
  81.752 +   }
  81.753 +}
  81.754 +
  81.755 +void /* PRIVATE */
  81.756 +png_process_IDAT_data(png_structp png_ptr, png_bytep buffer,
  81.757 +   png_size_t buffer_length)
  81.758 +{
  81.759 +   int ret;
  81.760 +
  81.761 +   if ((png_ptr->flags & PNG_FLAG_ZLIB_FINISHED) && buffer_length)
  81.762 +      png_error(png_ptr, "Extra compression data");
  81.763 +
  81.764 +   png_ptr->zstream.next_in = buffer;
  81.765 +   png_ptr->zstream.avail_in = (uInt)buffer_length;
  81.766 +   for (;;)
  81.767 +   {
  81.768 +      ret = inflate(&png_ptr->zstream, Z_PARTIAL_FLUSH);
  81.769 +      if (ret != Z_OK)
  81.770 +      {
  81.771 +         if (ret == Z_STREAM_END)
  81.772 +         {
  81.773 +            if (png_ptr->zstream.avail_in)
  81.774 +               png_error(png_ptr, "Extra compressed data");
  81.775 +            if (!(png_ptr->zstream.avail_out))
  81.776 +            {
  81.777 +               png_push_process_row(png_ptr);
  81.778 +            }
  81.779 +
  81.780 +            png_ptr->mode |= PNG_AFTER_IDAT;
  81.781 +            png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED;
  81.782 +            break;
  81.783 +         }
  81.784 +         else if (ret == Z_BUF_ERROR)
  81.785 +            break;
  81.786 +         else
  81.787 +            png_error(png_ptr, "Decompression Error");
  81.788 +      }
  81.789 +      if (!(png_ptr->zstream.avail_out))
  81.790 +      {
  81.791 +         if ((
  81.792 +#if defined(PNG_READ_INTERLACING_SUPPORTED)
  81.793 +             png_ptr->interlaced && png_ptr->pass > 6) ||
  81.794 +             (!png_ptr->interlaced &&
  81.795 +#endif
  81.796 +             png_ptr->row_number == png_ptr->num_rows))
  81.797 +         {
  81.798 +           if (png_ptr->zstream.avail_in)
  81.799 +             png_warning(png_ptr, "Too much data in IDAT chunks");
  81.800 +           png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED;
  81.801 +           break;
  81.802 +         }
  81.803 +         png_push_process_row(png_ptr);
  81.804 +         png_ptr->zstream.avail_out = (uInt)png_ptr->irowbytes;
  81.805 +         png_ptr->zstream.next_out = png_ptr->row_buf;
  81.806 +      }
  81.807 +      else
  81.808 +         break;
  81.809 +   }
  81.810 +}
  81.811 +
  81.812 +void /* PRIVATE */
  81.813 +png_push_process_row(png_structp png_ptr)
  81.814 +{
  81.815 +   png_ptr->row_info.color_type = png_ptr->color_type;
  81.816 +   png_ptr->row_info.width = png_ptr->iwidth;
  81.817 +   png_ptr->row_info.channels = png_ptr->channels;
  81.818 +   png_ptr->row_info.bit_depth = png_ptr->bit_depth;
  81.819 +   png_ptr->row_info.pixel_depth = png_ptr->pixel_depth;
  81.820 +
  81.821 +   png_ptr->row_info.rowbytes = PNG_ROWBYTES(png_ptr->row_info.pixel_depth,
  81.822 +       png_ptr->row_info.width);
  81.823 +
  81.824 +   png_read_filter_row(png_ptr, &(png_ptr->row_info),
  81.825 +      png_ptr->row_buf + 1, png_ptr->prev_row + 1,
  81.826 +      (int)(png_ptr->row_buf[0]));
  81.827 +
  81.828 +   png_memcpy_check(png_ptr, png_ptr->prev_row, png_ptr->row_buf,
  81.829 +      png_ptr->rowbytes + 1);
  81.830 +
  81.831 +   if (png_ptr->transformations || (png_ptr->flags&PNG_FLAG_STRIP_ALPHA))
  81.832 +      png_do_read_transformations(png_ptr);
  81.833 +
  81.834 +#if defined(PNG_READ_INTERLACING_SUPPORTED)
  81.835 +   /* blow up interlaced rows to full size */
  81.836 +   if (png_ptr->interlaced && (png_ptr->transformations & PNG_INTERLACE))
  81.837 +   {
  81.838 +      if (png_ptr->pass < 6)
  81.839 +/*       old interface (pre-1.0.9):
  81.840 +         png_do_read_interlace(&(png_ptr->row_info),
  81.841 +            png_ptr->row_buf + 1, png_ptr->pass, png_ptr->transformations);
  81.842 + */
  81.843 +         png_do_read_interlace(png_ptr);
  81.844 +
  81.845 +    switch (png_ptr->pass)
  81.846 +    {
  81.847 +         case 0:
  81.848 +         {
  81.849 +            int i;
  81.850 +            for (i = 0; i < 8 && png_ptr->pass == 0; i++)
  81.851 +            {
  81.852 +               png_push_have_row(png_ptr, png_ptr->row_buf + 1);
  81.853 +               png_read_push_finish_row(png_ptr); /* updates png_ptr->pass */
  81.854 +            }
  81.855 +            if (png_ptr->pass == 2) /* pass 1 might be empty */
  81.856 +            {
  81.857 +               for (i = 0; i < 4 && png_ptr->pass == 2; i++)
  81.858 +               {
  81.859 +                  png_push_have_row(png_ptr, png_bytep_NULL);
  81.860 +                  png_read_push_finish_row(png_ptr);
  81.861 +               }
  81.862 +            }
  81.863 +            if (png_ptr->pass == 4 && png_ptr->height <= 4)
  81.864 +            {
  81.865 +               for (i = 0; i < 2 && png_ptr->pass == 4; i++)
  81.866 +               {
  81.867 +                  png_push_have_row(png_ptr, png_bytep_NULL);
  81.868 +                  png_read_push_finish_row(png_ptr);
  81.869 +               }
  81.870 +            }
  81.871 +            if (png_ptr->pass == 6 && png_ptr->height <= 4)
  81.872 +            {
  81.873 +                png_push_have_row(png_ptr, png_bytep_NULL);
  81.874 +                png_read_push_finish_row(png_ptr);
  81.875 +            }
  81.876 +            break;
  81.877 +         }
  81.878 +         case 1:
  81.879 +         {
  81.880 +            int i;
  81.881 +            for (i = 0; i < 8 && png_ptr->pass == 1; i++)
  81.882 +            {
  81.883 +               png_push_have_row(png_ptr, png_ptr->row_buf + 1);
  81.884 +               png_read_push_finish_row(png_ptr);
  81.885 +            }
  81.886 +            if (png_ptr->pass == 2) /* skip top 4 generated rows */
  81.887 +            {
  81.888 +               for (i = 0; i < 4 && png_ptr->pass == 2; i++)
  81.889 +               {
  81.890 +                  png_push_have_row(png_ptr, png_bytep_NULL);
  81.891 +                  png_read_push_finish_row(png_ptr);
  81.892 +               }
  81.893 +            }
  81.894 +            break;
  81.895 +         }
  81.896 +         case 2:
  81.897 +         {
  81.898 +            int i;
  81.899 +            for (i = 0; i < 4 && png_ptr->pass == 2; i++)
  81.900 +            {
  81.901 +               png_push_have_row(png_ptr, png_ptr->row_buf + 1);
  81.902 +               png_read_push_finish_row(png_ptr);
  81.903 +            }
  81.904 +            for (i = 0; i < 4 && png_ptr->pass == 2; i++)
  81.905 +            {
  81.906 +               png_push_have_row(png_ptr, png_bytep_NULL);
  81.907 +               png_read_push_finish_row(png_ptr);
  81.908 +            }
  81.909 +            if (png_ptr->pass == 4) /* pass 3 might be empty */
  81.910 +            {
  81.911 +               for (i = 0; i < 2 && png_ptr->pass == 4; i++)
  81.912 +               {
  81.913 +                  png_push_have_row(png_ptr, png_bytep_NULL);
  81.914 +                  png_read_push_finish_row(png_ptr);
  81.915 +               }
  81.916 +            }
  81.917 +            break;
  81.918 +         }
  81.919 +         case 3:
  81.920 +         {
  81.921 +            int i;
  81.922 +            for (i = 0; i < 4 && png_ptr->pass == 3; i++)
  81.923 +            {
  81.924 +               png_push_have_row(png_ptr, png_ptr->row_buf + 1);
  81.925 +               png_read_push_finish_row(png_ptr);
  81.926 +            }
  81.927 +            if (png_ptr->pass == 4) /* skip top two generated rows */
  81.928 +            {
  81.929 +               for (i = 0; i < 2 && png_ptr->pass == 4; i++)
  81.930 +               {
  81.931 +                  png_push_have_row(png_ptr, png_bytep_NULL);
  81.932 +                  png_read_push_finish_row(png_ptr);
  81.933 +               }
  81.934 +            }
  81.935 +            break;
  81.936 +         }
  81.937 +         case 4:
  81.938 +         {
  81.939 +            int i;
  81.940 +            for (i = 0; i < 2 && png_ptr->pass == 4; i++)
  81.941 +            {
  81.942 +               png_push_have_row(png_ptr, png_ptr->row_buf + 1);
  81.943 +               png_read_push_finish_row(png_ptr);
  81.944 +            }
  81.945 +            for (i = 0; i < 2 && png_ptr->pass == 4; i++)
  81.946 +            {
  81.947 +               png_push_have_row(png_ptr, png_bytep_NULL);
  81.948 +               png_read_push_finish_row(png_ptr);
  81.949 +            }
  81.950 +            if (png_ptr->pass == 6) /* pass 5 might be empty */
  81.951 +            {
  81.952 +               png_push_have_row(png_ptr, png_bytep_NULL);
  81.953 +               png_read_push_finish_row(png_ptr);
  81.954 +            }
  81.955 +            break;
  81.956 +         }
  81.957 +         case 5:
  81.958 +         {
  81.959 +            int i;
  81.960 +            for (i = 0; i < 2 && png_ptr->pass == 5; i++)
  81.961 +            {
  81.962 +               png_push_have_row(png_ptr, png_ptr->row_buf + 1);
  81.963 +               png_read_push_finish_row(png_ptr);
  81.964 +            }
  81.965 +            if (png_ptr->pass == 6) /* skip top generated row */
  81.966 +            {
  81.967 +               png_push_have_row(png_ptr, png_bytep_NULL);
  81.968 +               png_read_push_finish_row(png_ptr);
  81.969 +            }
  81.970 +            break;
  81.971 +         }
  81.972 +         case 6:
  81.973 +         {
  81.974 +            png_push_have_row(png_ptr, png_ptr->row_buf + 1);
  81.975 +            png_read_push_finish_row(png_ptr);
  81.976 +            if (png_ptr->pass != 6)
  81.977 +               break;
  81.978 +            png_push_have_row(png_ptr, png_bytep_NULL);
  81.979 +            png_read_push_finish_row(png_ptr);
  81.980 +         }
  81.981 +      }
  81.982 +   }
  81.983 +   else
  81.984 +#endif
  81.985 +   {
  81.986 +      png_push_have_row(png_ptr, png_ptr->row_buf + 1);
  81.987 +      png_read_push_finish_row(png_ptr);
  81.988 +   }
  81.989 +}
  81.990 +
  81.991 +void /* PRIVATE */
  81.992 +png_read_push_finish_row(png_structp png_ptr)
  81.993 +{
  81.994 +#ifdef PNG_USE_LOCAL_ARRAYS
  81.995 +   /* arrays to facilitate easy interlacing - use pass (0 - 6) as index */
  81.996 +
  81.997 +   /* start of interlace block */
  81.998 +   PNG_CONST int FARDATA png_pass_start[] = {0, 4, 0, 2, 0, 1, 0};
  81.999 +
 81.1000 +   /* offset to next interlace block */
 81.1001 +   PNG_CONST int FARDATA png_pass_inc[] = {8, 8, 4, 4, 2, 2, 1};
 81.1002 +
 81.1003 +   /* start of interlace block in the y direction */
 81.1004 +   PNG_CONST int FARDATA png_pass_ystart[] = {0, 0, 4, 0, 2, 0, 1};
 81.1005 +
 81.1006 +   /* offset to next interlace block in the y direction */
 81.1007 +   PNG_CONST int FARDATA png_pass_yinc[] = {8, 8, 8, 4, 4, 2, 2};
 81.1008 +
 81.1009 +   /* Height of interlace block.  This is not currently used - if you need
 81.1010 +    * it, uncomment it here and in png.h
 81.1011 +   PNG_CONST int FARDATA png_pass_height[] = {8, 8, 4, 4, 2, 2, 1};
 81.1012 +   */
 81.1013 +#endif
 81.1014 +
 81.1015 +   png_ptr->row_number++;
 81.1016 +   if (png_ptr->row_number < png_ptr->num_rows)
 81.1017 +      return;
 81.1018 +
 81.1019 +   if (png_ptr->interlaced)
 81.1020 +   {
 81.1021 +      png_ptr->row_number = 0;
 81.1022 +      png_memset_check(png_ptr, png_ptr->prev_row, 0,
 81.1023 +         png_ptr->rowbytes + 1);
 81.1024 +      do
 81.1025 +      {
 81.1026 +         png_ptr->pass++;
 81.1027 +         if ((png_ptr->pass == 1 && png_ptr->width < 5) ||
 81.1028 +             (png_ptr->pass == 3 && png_ptr->width < 3) ||
 81.1029 +             (png_ptr->pass == 5 && png_ptr->width < 2))
 81.1030 +           png_ptr->pass++;
 81.1031 +
 81.1032 +         if (png_ptr->pass > 7)
 81.1033 +            png_ptr->pass--;
 81.1034 +         if (png_ptr->pass >= 7)
 81.1035 +            break;
 81.1036 +
 81.1037 +         png_ptr->iwidth = (png_ptr->width +
 81.1038 +            png_pass_inc[png_ptr->pass] - 1 -
 81.1039 +            png_pass_start[png_ptr->pass]) /
 81.1040 +            png_pass_inc[png_ptr->pass];
 81.1041 +
 81.1042 +         png_ptr->irowbytes = PNG_ROWBYTES(png_ptr->pixel_depth,
 81.1043 +            png_ptr->iwidth) + 1;
 81.1044 +
 81.1045 +         if (png_ptr->transformations & PNG_INTERLACE)
 81.1046 +            break;
 81.1047 +
 81.1048 +         png_ptr->num_rows = (png_ptr->height +
 81.1049 +            png_pass_yinc[png_ptr->pass] - 1 -
 81.1050 +            png_pass_ystart[png_ptr->pass]) /
 81.1051 +            png_pass_yinc[png_ptr->pass];
 81.1052 +
 81.1053 +      } while (png_ptr->iwidth == 0 || png_ptr->num_rows == 0);
 81.1054 +   }
 81.1055 +}
 81.1056 +
 81.1057 +#if defined(PNG_READ_tEXt_SUPPORTED)
 81.1058 +void /* PRIVATE */
 81.1059 +png_push_handle_tEXt(png_structp png_ptr, png_infop info_ptr, png_uint_32
 81.1060 +   length)
 81.1061 +{
 81.1062 +   if (!(png_ptr->mode & PNG_HAVE_IHDR) || (png_ptr->mode & PNG_HAVE_IEND))
 81.1063 +      {
 81.1064 +         png_error(png_ptr, "Out of place tEXt");
 81.1065 +         info_ptr = info_ptr; /* to quiet some compiler warnings */
 81.1066 +      }
 81.1067 +
 81.1068 +#ifdef PNG_MAX_MALLOC_64K
 81.1069 +   png_ptr->skip_length = 0;  /* This may not be necessary */
 81.1070 +
 81.1071 +   if (length > (png_uint_32)65535L) /* Can't hold entire string in memory */
 81.1072 +   {
 81.1073 +      png_warning(png_ptr, "tEXt chunk too large to fit in memory");
 81.1074 +      png_ptr->skip_length = length - (png_uint_32)65535L;
 81.1075 +      length = (png_uint_32)65535L;
 81.1076 +   }
 81.1077 +#endif
 81.1078 +
 81.1079 +   png_ptr->current_text = (png_charp)png_malloc(png_ptr,
 81.1080 +      (png_uint_32)(length + 1));
 81.1081 +   png_ptr->current_text[length] = '\0';
 81.1082 +   png_ptr->current_text_ptr = png_ptr->current_text;
 81.1083 +   png_ptr->current_text_size = (png_size_t)length;
 81.1084 +   png_ptr->current_text_left = (png_size_t)length;
 81.1085 +   png_ptr->process_mode = PNG_READ_tEXt_MODE;
 81.1086 +}
 81.1087 +
 81.1088 +void /* PRIVATE */
 81.1089 +png_push_read_tEXt(png_structp png_ptr, png_infop info_ptr)
 81.1090 +{
 81.1091 +   if (png_ptr->buffer_size && png_ptr->current_text_left)
 81.1092 +   {
 81.1093 +      png_size_t text_size;
 81.1094 +
 81.1095 +      if (png_ptr->buffer_size < png_ptr->current_text_left)
 81.1096 +         text_size = png_ptr->buffer_size;
 81.1097 +      else
 81.1098 +         text_size = png_ptr->current_text_left;
 81.1099 +      png_crc_read(png_ptr, (png_bytep)png_ptr->current_text_ptr, text_size);
 81.1100 +      png_ptr->current_text_left -= text_size;
 81.1101 +      png_ptr->current_text_ptr += text_size;
 81.1102 +   }
 81.1103 +   if (!(png_ptr->current_text_left))
 81.1104 +   {
 81.1105 +      png_textp text_ptr;
 81.1106 +      png_charp text;
 81.1107 +      png_charp key;
 81.1108 +      int ret;
 81.1109 +
 81.1110 +      if (png_ptr->buffer_size < 4)
 81.1111 +      {
 81.1112 +         png_push_save_buffer(png_ptr);
 81.1113 +         return;
 81.1114 +      }
 81.1115 +
 81.1116 +      png_push_crc_finish(png_ptr);
 81.1117 +
 81.1118 +#if defined(PNG_MAX_MALLOC_64K)
 81.1119 +      if (png_ptr->skip_length)
 81.1120 +         return;
 81.1121 +#endif
 81.1122 +
 81.1123 +      key = png_ptr->current_text;
 81.1124 +
 81.1125 +      for (text = key; *text; text++)
 81.1126 +         /* empty loop */ ;
 81.1127 +
 81.1128 +      if (text < key + png_ptr->current_text_size)
 81.1129 +         text++;
 81.1130 +
 81.1131 +      text_ptr = (png_textp)png_malloc(png_ptr,
 81.1132 +         (png_uint_32)png_sizeof(png_text));
 81.1133 +      text_ptr->compression = PNG_TEXT_COMPRESSION_NONE;
 81.1134 +      text_ptr->key = key;
 81.1135 +#ifdef PNG_iTXt_SUPPORTED
 81.1136 +      text_ptr->lang = NULL;
 81.1137 +      text_ptr->lang_key = NULL;
 81.1138 +#endif
 81.1139 +      text_ptr->text = text;
 81.1140 +
 81.1141 +      ret = png_set_text_2(png_ptr, info_ptr, text_ptr, 1);
 81.1142 +
 81.1143 +      png_free(png_ptr, key);
 81.1144 +      png_free(png_ptr, text_ptr);
 81.1145 +      png_ptr->current_text = NULL;
 81.1146 +
 81.1147 +      if (ret)
 81.1148 +        png_warning(png_ptr, "Insufficient memory to store text chunk.");
 81.1149 +   }
 81.1150 +}
 81.1151 +#endif
 81.1152 +
 81.1153 +#if defined(PNG_READ_zTXt_SUPPORTED)
 81.1154 +void /* PRIVATE */
 81.1155 +png_push_handle_zTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32
 81.1156 +   length)
 81.1157 +{
 81.1158 +   if (!(png_ptr->mode & PNG_HAVE_IHDR) || (png_ptr->mode & PNG_HAVE_IEND))
 81.1159 +      {
 81.1160 +         png_error(png_ptr, "Out of place zTXt");
 81.1161 +         info_ptr = info_ptr; /* to quiet some compiler warnings */
 81.1162 +      }
 81.1163 +
 81.1164 +#ifdef PNG_MAX_MALLOC_64K
 81.1165 +   /* We can't handle zTXt chunks > 64K, since we don't have enough space
 81.1166 +    * to be able to store the uncompressed data.  Actually, the threshold
 81.1167 +    * is probably around 32K, but it isn't as definite as 64K is.
 81.1168 +    */
 81.1169 +   if (length > (png_uint_32)65535L)
 81.1170 +   {
 81.1171 +      png_warning(png_ptr, "zTXt chunk too large to fit in memory");
 81.1172 +      png_push_crc_skip(png_ptr, length);
 81.1173 +      return;
 81.1174 +   }
 81.1175 +#endif
 81.1176 +
 81.1177 +   png_ptr->current_text = (png_charp)png_malloc(png_ptr,
 81.1178 +      (png_uint_32)(length + 1));
 81.1179 +   png_ptr->current_text[length] = '\0';
 81.1180 +   png_ptr->current_text_ptr = png_ptr->current_text;
 81.1181 +   png_ptr->current_text_size = (png_size_t)length;
 81.1182 +   png_ptr->current_text_left = (png_size_t)length;
 81.1183 +   png_ptr->process_mode = PNG_READ_zTXt_MODE;
 81.1184 +}
 81.1185 +
 81.1186 +void /* PRIVATE */
 81.1187 +png_push_read_zTXt(png_structp png_ptr, png_infop info_ptr)
 81.1188 +{
 81.1189 +   if (png_ptr->buffer_size && png_ptr->current_text_left)
 81.1190 +   {
 81.1191 +      png_size_t text_size;
 81.1192 +
 81.1193 +      if (png_ptr->buffer_size < (png_uint_32)png_ptr->current_text_left)
 81.1194 +         text_size = png_ptr->buffer_size;
 81.1195 +      else
 81.1196 +         text_size = png_ptr->current_text_left;
 81.1197 +      png_crc_read(png_ptr, (png_bytep)png_ptr->current_text_ptr, text_size);
 81.1198 +      png_ptr->current_text_left -= text_size;
 81.1199 +      png_ptr->current_text_ptr += text_size;
 81.1200 +   }
 81.1201 +   if (!(png_ptr->current_text_left))
 81.1202 +   {
 81.1203 +      png_textp text_ptr;
 81.1204 +      png_charp text;
 81.1205 +      png_charp key;
 81.1206 +      int ret;
 81.1207 +      png_size_t text_size, key_size;
 81.1208 +
 81.1209 +      if (png_ptr->buffer_size < 4)
 81.1210 +      {
 81.1211 +         png_push_save_buffer(png_ptr);
 81.1212 +         return;
 81.1213 +      }
 81.1214 +
 81.1215 +      png_push_crc_finish(png_ptr);
 81.1216 +
 81.1217 +      key = png_ptr->current_text;
 81.1218 +
 81.1219 +      for (text = key; *text; text++)
 81.1220 +         /* empty loop */ ;
 81.1221 +
 81.1222 +      /* zTXt can't have zero text */
 81.1223 +      if (text >= key + png_ptr->current_text_size)
 81.1224 +      {
 81.1225 +         png_ptr->current_text = NULL;
 81.1226 +         png_free(png_ptr, key);
 81.1227 +         return;
 81.1228 +      }
 81.1229 +
 81.1230 +      text++;
 81.1231 +
 81.1232 +      if (*text != PNG_TEXT_COMPRESSION_zTXt) /* check compression byte */
 81.1233 +      {
 81.1234 +         png_ptr->current_text = NULL;
 81.1235 +         png_free(png_ptr, key);
 81.1236 +         return;
 81.1237 +      }
 81.1238 +
 81.1239 +      text++;
 81.1240 +
 81.1241 +      png_ptr->zstream.next_in = (png_bytep )text;
 81.1242 +      png_ptr->zstream.avail_in = (uInt)(png_ptr->current_text_size -
 81.1243 +         (text - key));
 81.1244 +      png_ptr->zstream.next_out = png_ptr->zbuf;
 81.1245 +      png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
 81.1246 +
 81.1247 +      key_size = text - key;
 81.1248 +      text_size = 0;
 81.1249 +      text = NULL;
 81.1250 +      ret = Z_STREAM_END;
 81.1251 +
 81.1252 +      while (png_ptr->zstream.avail_in)
 81.1253 +      {
 81.1254 +         ret = inflate(&png_ptr->zstream, Z_PARTIAL_FLUSH);
 81.1255 +         if (ret != Z_OK && ret != Z_STREAM_END)
 81.1256 +         {
 81.1257 +            inflateReset(&png_ptr->zstream);
 81.1258 +            png_ptr->zstream.avail_in = 0;
 81.1259 +            png_ptr->current_text = NULL;
 81.1260 +            png_free(png_ptr, key);
 81.1261 +            png_free(png_ptr, text);
 81.1262 +            return;
 81.1263 +         }
 81.1264 +         if (!(png_ptr->zstream.avail_out) || ret == Z_STREAM_END)
 81.1265 +         {
 81.1266 +            if (text == NULL)
 81.1267 +            {
 81.1268 +               text = (png_charp)png_malloc(png_ptr,
 81.1269 +                     (png_uint_32)(png_ptr->zbuf_size
 81.1270 +                     - png_ptr->zstream.avail_out + key_size + 1));
 81.1271 +               png_memcpy(text + key_size, png_ptr->zbuf,
 81.1272 +                  png_ptr->zbuf_size - png_ptr->zstream.avail_out);
 81.1273 +               png_memcpy(text, key, key_size);
 81.1274 +               text_size = key_size + png_ptr->zbuf_size -
 81.1275 +                  png_ptr->zstream.avail_out;
 81.1276 +               *(text + text_size) = '\0';
 81.1277 +            }
 81.1278 +            else
 81.1279 +            {
 81.1280 +               png_charp tmp;
 81.1281 +
 81.1282 +               tmp = text;
 81.1283 +               text = (png_charp)png_malloc(png_ptr, text_size +
 81.1284 +                  (png_uint_32)(png_ptr->zbuf_size 
 81.1285 +                  - png_ptr->zstream.avail_out + 1));
 81.1286 +               png_memcpy(text, tmp, text_size);
 81.1287 +               png_free(png_ptr, tmp);
 81.1288 +               png_memcpy(text + text_size, png_ptr->zbuf,
 81.1289 +                  png_ptr->zbuf_size - png_ptr->zstream.avail_out);
 81.1290 +               text_size += png_ptr->zbuf_size - png_ptr->zstream.avail_out;
 81.1291 +               *(text + text_size) = '\0';
 81.1292 +            }
 81.1293 +            if (ret != Z_STREAM_END)
 81.1294 +            {
 81.1295 +               png_ptr->zstream.next_out = png_ptr->zbuf;
 81.1296 +               png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
 81.1297 +            }
 81.1298 +         }
 81.1299 +         else
 81.1300 +         {
 81.1301 +            break;
 81.1302 +         }
 81.1303 +
 81.1304 +         if (ret == Z_STREAM_END)
 81.1305 +            break;
 81.1306 +      }
 81.1307 +
 81.1308 +      inflateReset(&png_ptr->zstream);
 81.1309 +      png_ptr->zstream.avail_in = 0;
 81.1310 +
 81.1311 +      if (ret != Z_STREAM_END)
 81.1312 +      {
 81.1313 +         png_ptr->current_text = NULL;
 81.1314 +         png_free(png_ptr, key);
 81.1315 +         png_free(png_ptr, text);
 81.1316 +         return;
 81.1317 +      }
 81.1318 +
 81.1319 +      png_ptr->current_text = NULL;
 81.1320 +      png_free(png_ptr, key);
 81.1321 +      key = text;
 81.1322 +      text += key_size;
 81.1323 +
 81.1324 +      text_ptr = (png_textp)png_malloc(png_ptr,
 81.1325 +          (png_uint_32)png_sizeof(png_text));
 81.1326 +      text_ptr->compression = PNG_TEXT_COMPRESSION_zTXt;
 81.1327 +      text_ptr->key = key;
 81.1328 +#ifdef PNG_iTXt_SUPPORTED
 81.1329 +      text_ptr->lang = NULL;
 81.1330 +      text_ptr->lang_key = NULL;
 81.1331 +#endif
 81.1332 +      text_ptr->text = text;
 81.1333 +
 81.1334 +      ret = png_set_text_2(png_ptr, info_ptr, text_ptr, 1);
 81.1335 +
 81.1336 +      png_free(png_ptr, key);
 81.1337 +      png_free(png_ptr, text_ptr);
 81.1338 +
 81.1339 +      if (ret)
 81.1340 +        png_warning(png_ptr, "Insufficient memory to store text chunk.");
 81.1341 +   }
 81.1342 +}
 81.1343 +#endif
 81.1344 +
 81.1345 +#if defined(PNG_READ_iTXt_SUPPORTED)
 81.1346 +void /* PRIVATE */
 81.1347 +png_push_handle_iTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32
 81.1348 +   length)
 81.1349 +{
 81.1350 +   if (!(png_ptr->mode & PNG_HAVE_IHDR) || (png_ptr->mode & PNG_HAVE_IEND))
 81.1351 +      {
 81.1352 +         png_error(png_ptr, "Out of place iTXt");
 81.1353 +         info_ptr = info_ptr; /* to quiet some compiler warnings */
 81.1354 +      }
 81.1355 +
 81.1356 +#ifdef PNG_MAX_MALLOC_64K
 81.1357 +   png_ptr->skip_length = 0;  /* This may not be necessary */
 81.1358 +
 81.1359 +   if (length > (png_uint_32)65535L) /* Can't hold entire string in memory */
 81.1360 +   {
 81.1361 +      png_warning(png_ptr, "iTXt chunk too large to fit in memory");
 81.1362 +      png_ptr->skip_length = length - (png_uint_32)65535L;
 81.1363 +      length = (png_uint_32)65535L;
 81.1364 +   }
 81.1365 +#endif
 81.1366 +
 81.1367 +   png_ptr->current_text = (png_charp)png_malloc(png_ptr,
 81.1368 +      (png_uint_32)(length + 1));
 81.1369 +   png_ptr->current_text[length] = '\0';
 81.1370 +   png_ptr->current_text_ptr = png_ptr->current_text;
 81.1371 +   png_ptr->current_text_size = (png_size_t)length;
 81.1372 +   png_ptr->current_text_left = (png_size_t)length;
 81.1373 +   png_ptr->process_mode = PNG_READ_iTXt_MODE;
 81.1374 +}
 81.1375 +
 81.1376 +void /* PRIVATE */
 81.1377 +png_push_read_iTXt(png_structp png_ptr, png_infop info_ptr)
 81.1378 +{
 81.1379 +
 81.1380 +   if (png_ptr->buffer_size && png_ptr->current_text_left)
 81.1381 +   {
 81.1382 +      png_size_t text_size;
 81.1383 +
 81.1384 +      if (png_ptr->buffer_size < png_ptr->current_text_left)
 81.1385 +         text_size = png_ptr->buffer_size;
 81.1386 +      else
 81.1387 +         text_size = png_ptr->current_text_left;
 81.1388 +      png_crc_read(png_ptr, (png_bytep)png_ptr->current_text_ptr, text_size);
 81.1389 +      png_ptr->current_text_left -= text_size;
 81.1390 +      png_ptr->current_text_ptr += text_size;
 81.1391 +   }
 81.1392 +   if (!(png_ptr->current_text_left))
 81.1393 +   {
 81.1394 +      png_textp text_ptr;
 81.1395 +      png_charp key;
 81.1396 +      int comp_flag;
 81.1397 +      png_charp lang;
 81.1398 +      png_charp lang_key;
 81.1399 +      png_charp text;
 81.1400 +      int ret;
 81.1401 +
 81.1402 +      if (png_ptr->buffer_size < 4)
 81.1403 +      {
 81.1404 +         png_push_save_buffer(png_ptr);
 81.1405 +         return;
 81.1406 +      }
 81.1407 +
 81.1408 +      png_push_crc_finish(png_ptr);
 81.1409 +
 81.1410 +#if defined(PNG_MAX_MALLOC_64K)
 81.1411 +      if (png_ptr->skip_length)
 81.1412 +         return;
 81.1413 +#endif
 81.1414 +
 81.1415 +      key = png_ptr->current_text;
 81.1416 +
 81.1417 +      for (lang = key; *lang; lang++)
 81.1418 +         /* empty loop */ ;
 81.1419 +
 81.1420 +      if (lang < key + png_ptr->current_text_size - 3)
 81.1421 +         lang++;
 81.1422 +
 81.1423 +      comp_flag = *lang++;
 81.1424 +      lang++;     /* skip comp_type, always zero */
 81.1425 +
 81.1426 +      for (lang_key = lang; *lang_key; lang_key++)
 81.1427 +         /* empty loop */ ;
 81.1428 +      lang_key++;        /* skip NUL separator */
 81.1429 +
 81.1430 +      text=lang_key;
 81.1431 +      if (lang_key < key + png_ptr->current_text_size - 1)
 81.1432 +      {
 81.1433 +        for (; *text; text++)
 81.1434 +           /* empty loop */ ;
 81.1435 +      }
 81.1436 +
 81.1437 +      if (text < key + png_ptr->current_text_size)
 81.1438 +         text++;
 81.1439 +
 81.1440 +      text_ptr = (png_textp)png_malloc(png_ptr,
 81.1441 +         (png_uint_32)png_sizeof(png_text));
 81.1442 +      text_ptr->compression = comp_flag + 2;
 81.1443 +      text_ptr->key = key;
 81.1444 +      text_ptr->lang = lang;
 81.1445 +      text_ptr->lang_key = lang_key;
 81.1446 +      text_ptr->text = text;
 81.1447 +      text_ptr->text_length = 0;
 81.1448 +      text_ptr->itxt_length = png_strlen(text);
 81.1449 +
 81.1450 +      ret = png_set_text_2(png_ptr, info_ptr, text_ptr, 1);
 81.1451 +
 81.1452 +      png_ptr->current_text = NULL;
 81.1453 +
 81.1454 +      png_free(png_ptr, text_ptr);
 81.1455 +      if (ret)
 81.1456 +        png_warning(png_ptr, "Insufficient memory to store iTXt chunk.");
 81.1457 +   }
 81.1458 +}
 81.1459 +#endif
 81.1460 +
 81.1461 +/* This function is called when we haven't found a handler for this
 81.1462 + * chunk.  If there isn't a problem with the chunk itself (ie a bad chunk
 81.1463 + * name or a critical chunk), the chunk is (currently) silently ignored.
 81.1464 + */
 81.1465 +void /* PRIVATE */
 81.1466 +png_push_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32
 81.1467 +   length)
 81.1468 +{
 81.1469 +   png_uint_32 skip = 0;
 81.1470 +
 81.1471 +   if (!(png_ptr->chunk_name[0] & 0x20))
 81.1472 +   {
 81.1473 +#if defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED)
 81.1474 +      if (png_handle_as_unknown(png_ptr, png_ptr->chunk_name) !=
 81.1475 +         PNG_HANDLE_CHUNK_ALWAYS
 81.1476 +#if defined(PNG_READ_USER_CHUNKS_SUPPORTED)
 81.1477 +         && png_ptr->read_user_chunk_fn == NULL
 81.1478 +#endif
 81.1479 +         )
 81.1480 +#endif
 81.1481 +         png_chunk_error(png_ptr, "unknown critical chunk");
 81.1482 +
 81.1483 +      info_ptr = info_ptr; /* to quiet some compiler warnings */
 81.1484 +   }
 81.1485 +
 81.1486 +#if defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED)
 81.1487 +   if (png_ptr->flags & PNG_FLAG_KEEP_UNKNOWN_CHUNKS)
 81.1488 +   {
 81.1489 +#ifdef PNG_MAX_MALLOC_64K
 81.1490 +      if (length > (png_uint_32)65535L)
 81.1491 +      {
 81.1492 +          png_warning(png_ptr, "unknown chunk too large to fit in memory");
 81.1493 +          skip = length - (png_uint_32)65535L;
 81.1494 +          length = (png_uint_32)65535L;
 81.1495 +      }
 81.1496 +#endif
 81.1497 +      png_memcpy((png_charp)png_ptr->unknown_chunk.name,
 81.1498 +                 (png_charp)png_ptr->chunk_name, 
 81.1499 +                 png_sizeof(png_ptr->unknown_chunk.name));
 81.1500 +      png_ptr->unknown_chunk.name[png_sizeof(png_ptr->unknown_chunk.name) - 1]
 81.1501 +        = '\0';
 81.1502 +
 81.1503 +      png_ptr->unknown_chunk.size = (png_size_t)length;
 81.1504 +      if (length == 0)
 81.1505 +         png_ptr->unknown_chunk.data = NULL;
 81.1506 +      else
 81.1507 +      {
 81.1508 +         png_ptr->unknown_chunk.data = (png_bytep)png_malloc(png_ptr,
 81.1509 +       (png_uint_32)length);
 81.1510 +         png_crc_read(png_ptr, (png_bytep)png_ptr->unknown_chunk.data, length);
 81.1511 +      }
 81.1512 +#if defined(PNG_READ_USER_CHUNKS_SUPPORTED)
 81.1513 +      if (png_ptr->read_user_chunk_fn != NULL)
 81.1514 +      {
 81.1515 +         /* callback to user unknown chunk handler */
 81.1516 +         int ret;
 81.1517 +         ret = (*(png_ptr->read_user_chunk_fn))
 81.1518 +           (png_ptr, &png_ptr->unknown_chunk);
 81.1519 +         if (ret < 0)
 81.1520 +            png_chunk_error(png_ptr, "error in user chunk");
 81.1521 +         if (ret == 0)
 81.1522 +         {
 81.1523 +            if (!(png_ptr->chunk_name[0] & 0x20))
 81.1524 +               if (png_handle_as_unknown(png_ptr, png_ptr->chunk_name) !=
 81.1525 +                    PNG_HANDLE_CHUNK_ALWAYS)
 81.1526 +                  png_chunk_error(png_ptr, "unknown critical chunk");
 81.1527 +            png_set_unknown_chunks(png_ptr, info_ptr,
 81.1528 +               &png_ptr->unknown_chunk, 1);
 81.1529 +         }
 81.1530 +      }
 81.1531 +      else
 81.1532 +#endif
 81.1533 +        png_set_unknown_chunks(png_ptr, info_ptr, &png_ptr->unknown_chunk, 1);
 81.1534 +      png_free(png_ptr, png_ptr->unknown_chunk.data);
 81.1535 +      png_ptr->unknown_chunk.data = NULL;
 81.1536 +   }
 81.1537 +   else
 81.1538 +#endif
 81.1539 +      skip=length;
 81.1540 +   png_push_crc_skip(png_ptr, skip);
 81.1541 +}
 81.1542 +
 81.1543 +void /* PRIVATE */
 81.1544 +png_push_have_info(png_structp png_ptr, png_infop info_ptr)
 81.1545 +{
 81.1546 +   if (png_ptr->info_fn != NULL)
 81.1547 +      (*(png_ptr->info_fn))(png_ptr, info_ptr);
 81.1548 +}
 81.1549 +
 81.1550 +void /* PRIVATE */
 81.1551 +png_push_have_end(png_structp png_ptr, png_infop info_ptr)
 81.1552 +{
 81.1553 +   if (png_ptr->end_fn != NULL)
 81.1554 +      (*(png_ptr->end_fn))(png_ptr, info_ptr);
 81.1555 +}
 81.1556 +
 81.1557 +void /* PRIVATE */
 81.1558 +png_push_have_row(png_structp png_ptr, png_bytep row)
 81.1559 +{
 81.1560 +   if (png_ptr->row_fn != NULL)
 81.1561 +      (*(png_ptr->row_fn))(png_ptr, row, png_ptr->row_number,
 81.1562 +         (int)png_ptr->pass);
 81.1563 +}
 81.1564 +
 81.1565 +void PNGAPI
 81.1566 +png_progressive_combine_row (png_structp png_ptr,
 81.1567 +   png_bytep old_row, png_bytep new_row)
 81.1568 +{
 81.1569 +#ifdef PNG_USE_LOCAL_ARRAYS
 81.1570 +   PNG_CONST int FARDATA png_pass_dsp_mask[7] =
 81.1571 +      {0xff, 0x0f, 0xff, 0x33, 0xff, 0x55, 0xff};
 81.1572 +#endif
 81.1573 +   if (png_ptr == NULL) return;
 81.1574 +   if (new_row != NULL)    /* new_row must == png_ptr->row_buf here. */
 81.1575 +      png_combine_row(png_ptr, old_row, png_pass_dsp_mask[png_ptr->pass]);
 81.1576 +}
 81.1577 +
 81.1578 +void PNGAPI
 81.1579 +png_set_progressive_read_fn(png_structp png_ptr, png_voidp progressive_ptr,
 81.1580 +   png_progressive_info_ptr info_fn, png_progressive_row_ptr row_fn,
 81.1581 +   png_progressive_end_ptr end_fn)
 81.1582 +{
 81.1583 +   if (png_ptr == NULL) return;
 81.1584 +   png_ptr->info_fn = info_fn;
 81.1585 +   png_ptr->row_fn = row_fn;
 81.1586 +   png_ptr->end_fn = end_fn;
 81.1587 +
 81.1588 +   png_set_read_fn(png_ptr, progressive_ptr, png_push_fill_buffer);
 81.1589 +}
 81.1590 +
 81.1591 +png_voidp PNGAPI
 81.1592 +png_get_progressive_ptr(png_structp png_ptr)
 81.1593 +{
 81.1594 +   if (png_ptr == NULL) return (NULL);
 81.1595 +   return png_ptr->io_ptr;
 81.1596 +}
 81.1597 +#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */
    82.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    82.2 +++ b/libs/libpng/pngread.c	Sun Nov 01 00:36:56 2015 +0200
    82.3 @@ -0,0 +1,1459 @@
    82.4 +
    82.5 +/* pngread.c - read a PNG file
    82.6 + *
    82.7 + * Last changed in libpng 1.2.30 [August 15, 2008]
    82.8 + * For conditions of distribution and use, see copyright notice in png.h
    82.9 + * Copyright (c) 1998-2008 Glenn Randers-Pehrson
   82.10 + * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
   82.11 + * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
   82.12 + *
   82.13 + * This file contains routines that an application calls directly to
   82.14 + * read a PNG file or stream.
   82.15 + */
   82.16 +
   82.17 +#define PNG_INTERNAL
   82.18 +#include "png.h"
   82.19 +#if defined(PNG_READ_SUPPORTED)
   82.20 +
   82.21 +/* Create a PNG structure for reading, and allocate any memory needed. */
   82.22 +png_structp PNGAPI
   82.23 +png_create_read_struct(png_const_charp user_png_ver, png_voidp error_ptr,
   82.24 +   png_error_ptr error_fn, png_error_ptr warn_fn)
   82.25 +{
   82.26 +
   82.27 +#ifdef PNG_USER_MEM_SUPPORTED
   82.28 +   return (png_create_read_struct_2(user_png_ver, error_ptr, error_fn,
   82.29 +      warn_fn, png_voidp_NULL, png_malloc_ptr_NULL, png_free_ptr_NULL));
   82.30 +}
   82.31 +
   82.32 +/* Alternate create PNG structure for reading, and allocate any memory needed. */
   82.33 +png_structp PNGAPI
   82.34 +png_create_read_struct_2(png_const_charp user_png_ver, png_voidp error_ptr,
   82.35 +   png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr,
   82.36 +   png_malloc_ptr malloc_fn, png_free_ptr free_fn)
   82.37 +{
   82.38 +#endif /* PNG_USER_MEM_SUPPORTED */
   82.39 +
   82.40 +#ifdef PNG_SETJMP_SUPPORTED
   82.41 +   volatile
   82.42 +#endif
   82.43 +   png_structp png_ptr;
   82.44 +
   82.45 +#ifdef PNG_SETJMP_SUPPORTED
   82.46 +#ifdef USE_FAR_KEYWORD
   82.47 +   jmp_buf jmpbuf;
   82.48 +#endif
   82.49 +#endif
   82.50 +
   82.51 +   int i;
   82.52 +
   82.53 +   png_debug(1, "in png_create_read_struct\n");
   82.54 +#ifdef PNG_USER_MEM_SUPPORTED
   82.55 +   png_ptr = (png_structp)png_create_struct_2(PNG_STRUCT_PNG,
   82.56 +      (png_malloc_ptr)malloc_fn, (png_voidp)mem_ptr);
   82.57 +#else
   82.58 +   png_ptr = (png_structp)png_create_struct(PNG_STRUCT_PNG);
   82.59 +#endif
   82.60 +   if (png_ptr == NULL)
   82.61 +      return (NULL);
   82.62 +
   82.63 +   /* added at libpng-1.2.6 */
   82.64 +#ifdef PNG_SET_USER_LIMITS_SUPPORTED
   82.65 +   png_ptr->user_width_max=PNG_USER_WIDTH_MAX;
   82.66 +   png_ptr->user_height_max=PNG_USER_HEIGHT_MAX;
   82.67 +#endif
   82.68 +
   82.69 +#ifdef PNG_SETJMP_SUPPORTED
   82.70 +#ifdef USE_FAR_KEYWORD
   82.71 +   if (setjmp(jmpbuf))
   82.72 +#else
   82.73 +   if (setjmp(png_ptr->jmpbuf))
   82.74 +#endif
   82.75 +   {
   82.76 +      png_free(png_ptr, png_ptr->zbuf);
   82.77 +      png_ptr->zbuf = NULL;
   82.78 +#ifdef PNG_USER_MEM_SUPPORTED
   82.79 +      png_destroy_struct_2((png_voidp)png_ptr,
   82.80 +         (png_free_ptr)free_fn, (png_voidp)mem_ptr);
   82.81 +#else
   82.82 +      png_destroy_struct((png_voidp)png_ptr);
   82.83 +#endif
   82.84 +      return (NULL);
   82.85 +   }
   82.86 +#ifdef USE_FAR_KEYWORD
   82.87 +   png_memcpy(png_ptr->jmpbuf, jmpbuf, png_sizeof(jmp_buf));
   82.88 +#endif
   82.89 +#endif
   82.90 +
   82.91 +#ifdef PNG_USER_MEM_SUPPORTED
   82.92 +   png_set_mem_fn(png_ptr, mem_ptr, malloc_fn, free_fn);
   82.93 +#endif
   82.94 +
   82.95 +   png_set_error_fn(png_ptr, error_ptr, error_fn, warn_fn);
   82.96 +
   82.97 +   if (user_png_ver)
   82.98 +   {
   82.99 +     i = 0;
  82.100 +     do
  82.101 +     {
  82.102 +       if (user_png_ver[i] != png_libpng_ver[i])
  82.103 +          png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH;
  82.104 +     } while (png_libpng_ver[i++]);
  82.105 +   }
  82.106 +   else
  82.107 +        png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH;
  82.108 +   
  82.109 +
  82.110 +   if (png_ptr->flags & PNG_FLAG_LIBRARY_MISMATCH)
  82.111 +   {
  82.112 +     /* Libpng 0.90 and later are binary incompatible with libpng 0.89, so
  82.113 +      * we must recompile any applications that use any older library version.
  82.114 +      * For versions after libpng 1.0, we will be compatible, so we need
  82.115 +      * only check the first digit.
  82.116 +      */
  82.117 +     if (user_png_ver == NULL || user_png_ver[0] != png_libpng_ver[0] ||
  82.118 +         (user_png_ver[0] == '1' && user_png_ver[2] != png_libpng_ver[2]) ||
  82.119 +         (user_png_ver[0] == '0' && user_png_ver[2] < '9'))
  82.120 +     {
  82.121 +#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE)
  82.122 +        char msg[80];
  82.123 +        if (user_png_ver)
  82.124 +        {
  82.125 +          png_snprintf(msg, 80,
  82.126 +             "Application was compiled with png.h from libpng-%.20s",
  82.127 +             user_png_ver);
  82.128 +          png_warning(png_ptr, msg);
  82.129 +        }
  82.130 +        png_snprintf(msg, 80,
  82.131 +             "Application  is  running with png.c from libpng-%.20s",
  82.132 +           png_libpng_ver);
  82.133 +        png_warning(png_ptr, msg);
  82.134 +#endif
  82.135 +#ifdef PNG_ERROR_NUMBERS_SUPPORTED
  82.136 +        png_ptr->flags = 0;
  82.137 +#endif
  82.138 +        png_error(png_ptr,
  82.139 +           "Incompatible libpng version in application and library");
  82.140 +     }
  82.141 +   }
  82.142 +
  82.143 +   /* initialize zbuf - compression buffer */
  82.144 +   png_ptr->zbuf_size = PNG_ZBUF_SIZE;
  82.145 +   png_ptr->zbuf = (png_bytep)png_malloc(png_ptr,
  82.146 +     (png_uint_32)png_ptr->zbuf_size);
  82.147 +   png_ptr->zstream.zalloc = png_zalloc;
  82.148 +   png_ptr->zstream.zfree = png_zfree;
  82.149 +   png_ptr->zstream.opaque = (voidpf)png_ptr;
  82.150 +
  82.151 +   switch (inflateInit(&png_ptr->zstream))
  82.152 +   {
  82.153 +     case Z_OK: /* Do nothing */ break;
  82.154 +     case Z_MEM_ERROR:
  82.155 +     case Z_STREAM_ERROR: png_error(png_ptr, "zlib memory error"); break;
  82.156 +     case Z_VERSION_ERROR: png_error(png_ptr, "zlib version error"); break;
  82.157 +     default: png_error(png_ptr, "Unknown zlib error");
  82.158 +   }
  82.159 +
  82.160 +   png_ptr->zstream.next_out = png_ptr->zbuf;
  82.161 +   png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
  82.162 +
  82.163 +   png_set_read_fn(png_ptr, png_voidp_NULL, png_rw_ptr_NULL);
  82.164 +
  82.165 +#ifdef PNG_SETJMP_SUPPORTED
  82.166 +/* Applications that neglect to set up their own setjmp() and then encounter
  82.167 +   a png_error() will longjmp here.  Since the jmpbuf is then meaningless we
  82.168 +   abort instead of returning. */
  82.169 +#ifdef USE_FAR_KEYWORD
  82.170 +   if (setjmp(jmpbuf))
  82.171 +      PNG_ABORT();
  82.172 +   png_memcpy(png_ptr->jmpbuf, jmpbuf, png_sizeof(jmp_buf));
  82.173 +#else
  82.174 +   if (setjmp(png_ptr->jmpbuf))
  82.175 +      PNG_ABORT();
  82.176 +#endif
  82.177 +#endif
  82.178 +   return (png_ptr);
  82.179 +}
  82.180 +
  82.181 +#if defined(PNG_1_0_X) || defined(PNG_1_2_X)
  82.182 +/* Initialize PNG structure for reading, and allocate any memory needed.
  82.183 +   This interface is deprecated in favour of the png_create_read_struct(),
  82.184 +   and it will disappear as of libpng-1.3.0. */
  82.185 +#undef png_read_init
  82.186 +void PNGAPI
  82.187 +png_read_init(png_structp png_ptr)
  82.188 +{
  82.189 +   /* We only come here via pre-1.0.7-compiled applications */
  82.190 +   png_read_init_2(png_ptr, "1.0.6 or earlier", 0, 0);
  82.191 +}
  82.192 +
  82.193 +void PNGAPI
  82.194 +png_read_init_2(png_structp png_ptr, png_const_charp user_png_ver,
  82.195 +   png_size_t png_struct_size, png_size_t png_info_size)
  82.196 +{
  82.197 +   /* We only come here via pre-1.0.12-compiled applications */
  82.198 +   if (png_ptr == NULL) return;
  82.199 +#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE)
  82.200 +   if (png_sizeof(png_struct) > png_struct_size ||
  82.201 +      png_sizeof(png_info) > png_info_size)
  82.202 +   {
  82.203 +      char msg[80];
  82.204 +      png_ptr->warning_fn = NULL;
  82.205 +      if (user_png_ver)
  82.206 +      {
  82.207 +        png_snprintf(msg, 80,
  82.208 +           "Application was compiled with png.h from libpng-%.20s",
  82.209 +           user_png_ver);
  82.210 +        png_warning(png_ptr, msg);
  82.211 +      }
  82.212 +      png_snprintf(msg, 80,
  82.213 +         "Application  is  running with png.c from libpng-%.20s",
  82.214 +         png_libpng_ver);
  82.215 +      png_warning(png_ptr, msg);
  82.216 +   }
  82.217 +#endif
  82.218 +   if (png_sizeof(png_struct) > png_struct_size)
  82.219 +     {
  82.220 +       png_ptr->error_fn = NULL;
  82.221 +#ifdef PNG_ERROR_NUMBERS_SUPPORTED
  82.222 +       png_ptr->flags = 0;
  82.223 +#endif
  82.224 +       png_error(png_ptr,
  82.225 +       "The png struct allocated by the application for reading is too small.");
  82.226 +     }
  82.227 +   if (png_sizeof(png_info) > png_info_size)
  82.228 +     {
  82.229 +       png_ptr->error_fn = NULL;
  82.230 +#ifdef PNG_ERROR_NUMBERS_SUPPORTED
  82.231 +       png_ptr->flags = 0;
  82.232 +#endif
  82.233 +       png_error(png_ptr,
  82.234 +         "The info struct allocated by application for reading is too small.");
  82.235 +     }
  82.236 +   png_read_init_3(&png_ptr, user_png_ver, png_struct_size);
  82.237 +}
  82.238 +#endif /* PNG_1_0_X || PNG_1_2_X */
  82.239 +
  82.240 +void PNGAPI
  82.241 +png_read_init_3(png_structpp ptr_ptr, png_const_charp user_png_ver,
  82.242 +   png_size_t png_struct_size)
  82.243 +{
  82.244 +#ifdef PNG_SETJMP_SUPPORTED
  82.245 +   jmp_buf tmp_jmp;  /* to save current jump buffer */
  82.246 +#endif
  82.247 +
  82.248 +   int i = 0;
  82.249 +
  82.250 +   png_structp png_ptr=*ptr_ptr;
  82.251 +
  82.252 +   if (png_ptr == NULL) return;
  82.253 +
  82.254 +   do
  82.255 +   {
  82.256 +     if (user_png_ver[i] != png_libpng_ver[i])
  82.257 +     {
  82.258 +#ifdef PNG_LEGACY_SUPPORTED
  82.259 +       png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH;
  82.260 +#else
  82.261 +       png_ptr->warning_fn = NULL;
  82.262 +       png_warning(png_ptr,
  82.263 +        "Application uses deprecated png_read_init() and should be recompiled.");
  82.264 +       break;
  82.265 +#endif
  82.266 +     }
  82.267 +   } while (png_libpng_ver[i++]);
  82.268 +
  82.269 +   png_debug(1, "in png_read_init_3\n");
  82.270 +
  82.271 +#ifdef PNG_SETJMP_SUPPORTED
  82.272 +   /* save jump buffer and error functions */
  82.273 +   png_memcpy(tmp_jmp, png_ptr->jmpbuf, png_sizeof(jmp_buf));
  82.274 +#endif
  82.275 +
  82.276 +   if (png_sizeof(png_struct) > png_struct_size)
  82.277 +   {
  82.278 +      png_destroy_struct(png_ptr);
  82.279 +      *ptr_ptr = (png_structp)png_create_struct(PNG_STRUCT_PNG);
  82.280 +      png_ptr = *ptr_ptr;
  82.281 +   }
  82.282 +
  82.283 +   /* reset all variables to 0 */
  82.284 +   png_memset(png_ptr, 0, png_sizeof(png_struct));
  82.285 +
  82.286 +#ifdef PNG_SETJMP_SUPPORTED
  82.287 +   /* restore jump buffer */
  82.288 +   png_memcpy(png_ptr->jmpbuf, tmp_jmp, png_sizeof(jmp_buf));
  82.289 +#endif
  82.290 +
  82.291 +   /* added at libpng-1.2.6 */
  82.292 +#ifdef PNG_SET_USER_LIMITS_SUPPORTED
  82.293 +   png_ptr->user_width_max=PNG_USER_WIDTH_MAX;
  82.294 +   png_ptr->user_height_max=PNG_USER_HEIGHT_MAX;
  82.295 +#endif
  82.296 +
  82.297 +   /* initialize zbuf - compression buffer */
  82.298 +   png_ptr->zbuf_size = PNG_ZBUF_SIZE;
  82.299 +   png_ptr->zbuf = (png_bytep)png_malloc(png_ptr,
  82.300 +     (png_uint_32)png_ptr->zbuf_size);
  82.301 +   png_ptr->zstream.zalloc = png_zalloc;
  82.302 +   png_ptr->zstream.zfree = png_zfree;
  82.303 +   png_ptr->zstream.opaque = (voidpf)png_ptr;
  82.304 +
  82.305 +   switch (inflateInit(&png_ptr->zstream))
  82.306 +   {
  82.307 +     case Z_OK: /* Do nothing */ break;
  82.308 +     case Z_MEM_ERROR:
  82.309 +     case Z_STREAM_ERROR: png_error(png_ptr, "zlib memory"); break;
  82.310 +     case Z_VERSION_ERROR: png_error(png_ptr, "zlib version"); break;
  82.311 +     default: png_error(png_ptr, "Unknown zlib error");
  82.312 +   }
  82.313 +
  82.314 +   png_ptr->zstream.next_out = png_ptr->zbuf;
  82.315 +   png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
  82.316 +
  82.317 +   png_set_read_fn(png_ptr, png_voidp_NULL, png_rw_ptr_NULL);
  82.318 +}
  82.319 +
  82.320 +#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED
  82.321 +/* Read the information before the actual image data.  This has been
  82.322 + * changed in v0.90 to allow reading a file that already has the magic
  82.323 + * bytes read from the stream.  You can tell libpng how many bytes have
  82.324 + * been read from the beginning of the stream (up to the maximum of 8)
  82.325 + * via png_set_sig_bytes(), and we will only check the remaining bytes
  82.326 + * here.  The application can then have access to the signature bytes we
  82.327 + * read if it is determined that this isn't a valid PNG file.
  82.328 + */
  82.329 +void PNGAPI
  82.330 +png_read_info(png_structp png_ptr, png_infop info_ptr)
  82.331 +{
  82.332 +   if (png_ptr == NULL || info_ptr == NULL) return;
  82.333 +   png_debug(1, "in png_read_info\n");
  82.334 +   /* If we haven't checked all of the PNG signature bytes, do so now. */
  82.335 +   if (png_ptr->sig_bytes < 8)
  82.336 +   {
  82.337 +      png_size_t num_checked = png_ptr->sig_bytes,
  82.338 +                 num_to_check = 8 - num_checked;
  82.339 +
  82.340 +      png_read_data(png_ptr, &(info_ptr->signature[num_checked]), num_to_check);
  82.341 +      png_ptr->sig_bytes = 8;
  82.342 +
  82.343 +      if (png_sig_cmp(info_ptr->signature, num_checked, num_to_check))
  82.344 +      {
  82.345 +         if (num_checked < 4 &&
  82.346 +             png_sig_cmp(info_ptr->signature, num_checked, num_to_check - 4))
  82.347 +            png_error(png_ptr, "Not a PNG file");
  82.348 +         else
  82.349 +            png_error(png_ptr, "PNG file corrupted by ASCII conversion");
  82.350 +      }
  82.351 +      if (num_checked < 3)
  82.352 +         png_ptr->mode |= PNG_HAVE_PNG_SIGNATURE;
  82.353 +   }
  82.354 +
  82.355 +   for (;;)
  82.356 +   {
  82.357 +#ifdef PNG_USE_LOCAL_ARRAYS
  82.358 +      PNG_CONST PNG_IHDR;
  82.359 +      PNG_CONST PNG_IDAT;
  82.360 +      PNG_CONST PNG_IEND;
  82.361 +      PNG_CONST PNG_PLTE;
  82.362 +#if defined(PNG_READ_bKGD_SUPPORTED)
  82.363 +      PNG_CONST PNG_bKGD;
  82.364 +#endif
  82.365 +#if defined(PNG_READ_cHRM_SUPPORTED)
  82.366 +      PNG_CONST PNG_cHRM;
  82.367 +#endif
  82.368 +#if defined(PNG_READ_gAMA_SUPPORTED)
  82.369 +      PNG_CONST PNG_gAMA;
  82.370 +#endif
  82.371 +#if defined(PNG_READ_hIST_SUPPORTED)
  82.372 +      PNG_CONST PNG_hIST;
  82.373 +#endif
  82.374 +#if defined(PNG_READ_iCCP_SUPPORTED)
  82.375 +      PNG_CONST PNG_iCCP;
  82.376 +#endif
  82.377 +#if defined(PNG_READ_iTXt_SUPPORTED)
  82.378 +      PNG_CONST PNG_iTXt;
  82.379 +#endif
  82.380 +#if defined(PNG_READ_oFFs_SUPPORTED)
  82.381 +      PNG_CONST PNG_oFFs;
  82.382 +#endif
  82.383 +#if defined(PNG_READ_pCAL_SUPPORTED)
  82.384 +      PNG_CONST PNG_pCAL;
  82.385 +#endif
  82.386 +#if defined(PNG_READ_pHYs_SUPPORTED)
  82.387 +      PNG_CONST PNG_pHYs;
  82.388 +#endif
  82.389 +#if defined(PNG_READ_sBIT_SUPPORTED)
  82.390 +      PNG_CONST PNG_sBIT;
  82.391 +#endif
  82.392 +#if defined(PNG_READ_sCAL_SUPPORTED)
  82.393 +      PNG_CONST PNG_sCAL;
  82.394 +#endif
  82.395 +#if defined(PNG_READ_sPLT_SUPPORTED)
  82.396 +      PNG_CONST PNG_sPLT;
  82.397 +#endif
  82.398 +#if defined(PNG_READ_sRGB_SUPPORTED)
  82.399 +      PNG_CONST PNG_sRGB;
  82.400 +#endif
  82.401 +#if defined(PNG_READ_tEXt_SUPPORTED)
  82.402 +      PNG_CONST PNG_tEXt;
  82.403 +#endif
  82.404 +#if defined(PNG_READ_tIME_SUPPORTED)
  82.405 +      PNG_CONST PNG_tIME;
  82.406 +#endif
  82.407 +#if defined(PNG_READ_tRNS_SUPPORTED)
  82.408 +      PNG_CONST PNG_tRNS;
  82.409 +#endif
  82.410 +#if defined(PNG_READ_zTXt_SUPPORTED)
  82.411 +      PNG_CONST PNG_zTXt;
  82.412 +#endif
  82.413 +#endif /* PNG_USE_LOCAL_ARRAYS */
  82.414 +      png_uint_32 length = png_read_chunk_header(png_ptr);
  82.415 +      PNG_CONST png_bytep chunk_name = png_ptr->chunk_name;
  82.416 +
  82.417 +      /* This should be a binary subdivision search or a hash for
  82.418 +       * matching the chunk name rather than a linear search.
  82.419 +       */
  82.420 +      if (!png_memcmp(chunk_name, png_IDAT, 4))
  82.421 +        if (png_ptr->mode & PNG_AFTER_IDAT)
  82.422 +          png_ptr->mode |= PNG_HAVE_CHUNK_AFTER_IDAT;
  82.423 +
  82.424 +      if (!png_memcmp(chunk_name, png_IHDR, 4))
  82.425 +         png_handle_IHDR(png_ptr, info_ptr, length);
  82.426 +      else if (!png_memcmp(chunk_name, png_IEND, 4))
  82.427 +         png_handle_IEND(png_ptr, info_ptr, length);
  82.428 +#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
  82.429 +      else if (png_handle_as_unknown(png_ptr, chunk_name))
  82.430 +      {
  82.431 +         if (!png_memcmp(chunk_name, png_IDAT, 4))
  82.432 +            png_ptr->mode |= PNG_HAVE_IDAT;
  82.433 +         png_handle_unknown(png_ptr, info_ptr, length);
  82.434 +         if (!png_memcmp(chunk_name, png_PLTE, 4))
  82.435 +            png_ptr->mode |= PNG_HAVE_PLTE;
  82.436 +         else if (!png_memcmp(chunk_name, png_IDAT, 4))
  82.437 +         {
  82.438 +            if (!(png_ptr->mode & PNG_HAVE_IHDR))
  82.439 +               png_error(png_ptr, "Missing IHDR before IDAT");
  82.440 +            else if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE &&
  82.441 +                     !(png_ptr->mode & PNG_HAVE_PLTE))
  82.442 +               png_error(png_ptr, "Missing PLTE before IDAT");
  82.443 +            break;
  82.444 +         }
  82.445 +      }
  82.446 +#endif
  82.447 +      else if (!png_memcmp(chunk_name, png_PLTE, 4))
  82.448 +         png_handle_PLTE(png_ptr, info_ptr, length);
  82.449 +      else if (!png_memcmp(chunk_name, png_IDAT, 4))
  82.450 +      {
  82.451 +         if (!(png_ptr->mode & PNG_HAVE_IHDR))
  82.452 +            png_error(png_ptr, "Missing IHDR before IDAT");
  82.453 +         else if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE &&
  82.454 +                  !(png_ptr->mode & PNG_HAVE_PLTE))
  82.455 +            png_error(png_ptr, "Missing PLTE before IDAT");
  82.456 +
  82.457 +         png_ptr->idat_size = length;
  82.458 +         png_ptr->mode |= PNG_HAVE_IDAT;
  82.459 +         break;
  82.460 +      }
  82.461 +#if defined(PNG_READ_bKGD_SUPPORTED)
  82.462 +      else if (!png_memcmp(chunk_name, png_bKGD, 4))
  82.463 +         png_handle_bKGD(png_ptr, info_ptr, length);
  82.464 +#endif
  82.465 +#if defined(PNG_READ_cHRM_SUPPORTED)
  82.466 +      else if (!png_memcmp(chunk_name, png_cHRM, 4))
  82.467 +         png_handle_cHRM(png_ptr, info_ptr, length);
  82.468 +#endif
  82.469 +#if defined(PNG_READ_gAMA_SUPPORTED)
  82.470 +      else if (!png_memcmp(chunk_name, png_gAMA, 4))
  82.471 +         png_handle_gAMA(png_ptr, info_ptr, length);
  82.472 +#endif
  82.473 +#if defined(PNG_READ_hIST_SUPPORTED)
  82.474 +      else if (!png_memcmp(chunk_name, png_hIST, 4))
  82.475 +         png_handle_hIST(png_ptr, info_ptr, length);
  82.476 +#endif
  82.477 +#if defined(PNG_READ_oFFs_SUPPORTED)
  82.478 +      else if (!png_memcmp(chunk_name, png_oFFs, 4))
  82.479 +         png_handle_oFFs(png_ptr, info_ptr, length);
  82.480 +#endif
  82.481 +#if defined(PNG_READ_pCAL_SUPPORTED)
  82.482 +      else if (!png_memcmp(chunk_name, png_pCAL, 4))
  82.483 +         png_handle_pCAL(png_ptr, info_ptr, length);
  82.484 +#endif
  82.485 +#if defined(PNG_READ_sCAL_SUPPORTED)
  82.486 +      else if (!png_memcmp(chunk_name, png_sCAL, 4))
  82.487 +         png_handle_sCAL(png_ptr, info_ptr, length);
  82.488 +#endif
  82.489 +#if defined(PNG_READ_pHYs_SUPPORTED)
  82.490 +      else if (!png_memcmp(chunk_name, png_pHYs, 4))
  82.491 +         png_handle_pHYs(png_ptr, info_ptr, length);
  82.492 +#endif
  82.493 +#if defined(PNG_READ_sBIT_SUPPORTED)
  82.494 +      else if (!png_memcmp(chunk_name, png_sBIT, 4))
  82.495 +         png_handle_sBIT(png_ptr, info_ptr, length);
  82.496 +#endif
  82.497 +#if defined(PNG_READ_sRGB_SUPPORTED)
  82.498 +      else if (!png_memcmp(chunk_name, png_sRGB, 4))
  82.499 +         png_handle_sRGB(png_ptr, info_ptr, length);
  82.500 +#endif
  82.501 +#if defined(PNG_READ_iCCP_SUPPORTED)
  82.502 +      else if (!png_memcmp(chunk_name, png_iCCP, 4))
  82.503 +         png_handle_iCCP(png_ptr, info_ptr, length);
  82.504 +#endif
  82.505 +#if defined(PNG_READ_sPLT_SUPPORTED)
  82.506 +      else if (!png_memcmp(chunk_name, png_sPLT, 4))
  82.507 +         png_handle_sPLT(png_ptr, info_ptr, length);
  82.508 +#endif
  82.509 +#if defined(PNG_READ_tEXt_SUPPORTED)
  82.510 +      else if (!png_memcmp(chunk_name, png_tEXt, 4))
  82.511 +         png_handle_tEXt(png_ptr, info_ptr, length);
  82.512 +#endif
  82.513 +#if defined(PNG_READ_tIME_SUPPORTED)
  82.514 +      else if (!png_memcmp(chunk_name, png_tIME, 4))
  82.515 +         png_handle_tIME(png_ptr, info_ptr, length);
  82.516 +#endif
  82.517 +#if defined(PNG_READ_tRNS_SUPPORTED)
  82.518 +      else if (!png_memcmp(chunk_name, png_tRNS, 4))
  82.519 +         png_handle_tRNS(png_ptr, info_ptr, length);
  82.520 +#endif
  82.521 +#if defined(PNG_READ_zTXt_SUPPORTED)
  82.522 +      else if (!png_memcmp(chunk_name, png_zTXt, 4))
  82.523 +         png_handle_zTXt(png_ptr, info_ptr, length);
  82.524 +#endif
  82.525 +#if defined(PNG_READ_iTXt_SUPPORTED)
  82.526 +      else if (!png_memcmp(chunk_name, png_iTXt, 4))
  82.527 +         png_handle_iTXt(png_ptr, info_ptr, length);
  82.528 +#endif
  82.529 +      else
  82.530 +         png_handle_unknown(png_ptr, info_ptr, length);
  82.531 +   }
  82.532 +}
  82.533 +#endif /* PNG_NO_SEQUENTIAL_READ_SUPPORTED */
  82.534 +
  82.535 +/* optional call to update the users info_ptr structure */
  82.536 +void PNGAPI
  82.537 +png_read_update_info(png_structp png_ptr, png_infop info_ptr)
  82.538 +{
  82.539 +   png_debug(1, "in png_read_update_info\n");
  82.540 +   if (png_ptr == NULL) return;
  82.541 +   if (!(png_ptr->flags & PNG_FLAG_ROW_INIT))
  82.542 +      png_read_start_row(png_ptr);
  82.543 +   else
  82.544 +      png_warning(png_ptr,
  82.545 +      "Ignoring extra png_read_update_info() call; row buffer not reallocated");
  82.546 +   png_read_transform_info(png_ptr, info_ptr);
  82.547 +}
  82.548 +
  82.549 +#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED
  82.550 +/* Initialize palette, background, etc, after transformations
  82.551 + * are set, but before any reading takes place.  This allows
  82.552 + * the user to obtain a gamma-corrected palette, for example.
  82.553 + * If the user doesn't call this, we will do it ourselves.
  82.554 + */
  82.555 +void PNGAPI
  82.556 +png_start_read_image(png_structp png_ptr)
  82.557 +{
  82.558 +   png_debug(1, "in png_start_read_image\n");
  82.559 +   if (png_ptr == NULL) return;
  82.560 +   if (!(png_ptr->flags & PNG_FLAG_ROW_INIT))
  82.561 +      png_read_start_row(png_ptr);
  82.562 +}
  82.563 +#endif /* PNG_NO_SEQUENTIAL_READ_SUPPORTED */
  82.564 +
  82.565 +#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED
  82.566 +void PNGAPI
  82.567 +png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row)
  82.568 +{
  82.569 +#ifdef PNG_USE_LOCAL_ARRAYS
  82.570 +   PNG_CONST PNG_IDAT;
  82.571 +   PNG_CONST int png_pass_dsp_mask[7] = {0xff, 0x0f, 0xff, 0x33, 0xff, 0x55,
  82.572 +      0xff};
  82.573 +   PNG_CONST int png_pass_mask[7] = {0x80, 0x08, 0x88, 0x22, 0xaa, 0x55, 0xff};
  82.574 +#endif
  82.575 +   int ret;
  82.576 +   if (png_ptr == NULL) return;
  82.577 +   png_debug2(1, "in png_read_row (row %lu, pass %d)\n",
  82.578 +      png_ptr->row_number, png_ptr->pass);
  82.579 +   if (!(png_ptr->flags & PNG_FLAG_ROW_INIT))
  82.580 +      png_read_start_row(png_ptr);
  82.581 +   if (png_ptr->row_number == 0 && png_ptr->pass == 0)
  82.582 +   {
  82.583 +   /* check for transforms that have been set but were defined out */
  82.584 +#if defined(PNG_WRITE_INVERT_SUPPORTED) && !defined(PNG_READ_INVERT_SUPPORTED)
  82.585 +   if (png_ptr->transformations & PNG_INVERT_MONO)
  82.586 +      png_warning(png_ptr, "PNG_READ_INVERT_SUPPORTED is not defined.");
  82.587 +#endif
  82.588 +#if defined(PNG_WRITE_FILLER_SUPPORTED) && !defined(PNG_READ_FILLER_SUPPORTED)
  82.589 +   if (png_ptr->transformations & PNG_FILLER)
  82.590 +      png_warning(png_ptr, "PNG_READ_FILLER_SUPPORTED is not defined.");
  82.591 +#endif
  82.592 +#if defined(PNG_WRITE_PACKSWAP_SUPPORTED) && !defined(PNG_READ_PACKSWAP_SUPPORTED)
  82.593 +   if (png_ptr->transformations & PNG_PACKSWAP)
  82.594 +      png_warning(png_ptr, "PNG_READ_PACKSWAP_SUPPORTED is not defined.");
  82.595 +#endif
  82.596 +#if defined(PNG_WRITE_PACK_SUPPORTED) && !defined(PNG_READ_PACK_SUPPORTED)
  82.597 +   if (png_ptr->transformations & PNG_PACK)
  82.598 +      png_warning(png_ptr, "PNG_READ_PACK_SUPPORTED is not defined.");
  82.599 +#endif
  82.600 +#if defined(PNG_WRITE_SHIFT_SUPPORTED) && !defined(PNG_READ_SHIFT_SUPPORTED)
  82.601 +   if (png_ptr->transformations & PNG_SHIFT)
  82.602 +      png_warning(png_ptr, "PNG_READ_SHIFT_SUPPORTED is not defined.");
  82.603 +#endif
  82.604 +#if defined(PNG_WRITE_BGR_SUPPORTED) && !defined(PNG_READ_BGR_SUPPORTED)
  82.605 +   if (png_ptr->transformations & PNG_BGR)
  82.606 +      png_warning(png_ptr, "PNG_READ_BGR_SUPPORTED is not defined.");
  82.607 +#endif
  82.608 +#if defined(PNG_WRITE_SWAP_SUPPORTED) && !defined(PNG_READ_SWAP_SUPPORTED)
  82.609 +   if (png_ptr->transformations & PNG_SWAP_BYTES)
  82.610 +      png_warning(png_ptr, "PNG_READ_SWAP_SUPPORTED is not defined.");
  82.611 +#endif
  82.612 +   }
  82.613 +
  82.614 +#if defined(PNG_READ_INTERLACING_SUPPORTED)
  82.615 +   /* if interlaced and we do not need a new row, combine row and return */
  82.616 +   if (png_ptr->interlaced && (png_ptr->transformations & PNG_INTERLACE))
  82.617 +   {
  82.618 +      switch (png_ptr->pass)
  82.619 +      {
  82.620 +         case 0:
  82.621 +            if (png_ptr->row_number & 0x07)
  82.622 +            {
  82.623 +               if (dsp_row != NULL)
  82.624 +                  png_combine_row(png_ptr, dsp_row,
  82.625 +                     png_pass_dsp_mask[png_ptr->pass]);
  82.626 +               png_read_finish_row(png_ptr);
  82.627 +               return;
  82.628 +            }
  82.629 +            break;
  82.630 +         case 1:
  82.631 +            if ((png_ptr->row_number & 0x07) || png_ptr->width < 5)
  82.632 +            {
  82.633 +               if (dsp_row != NULL)
  82.634 +                  png_combine_row(png_ptr, dsp_row,
  82.635 +                     png_pass_dsp_mask[png_ptr->pass]);
  82.636 +               png_read_finish_row(png_ptr);
  82.637 +               return;
  82.638 +            }
  82.639 +            break;
  82.640 +         case 2:
  82.641 +            if ((png_ptr->row_number & 0x07) != 4)
  82.642 +            {
  82.643 +               if (dsp_row != NULL && (png_ptr->row_number & 4))
  82.644 +                  png_combine_row(png_ptr, dsp_row,
  82.645 +                     png_pass_dsp_mask[png_ptr->pass]);
  82.646 +               png_read_finish_row(png_ptr);
  82.647 +               return;
  82.648 +            }
  82.649 +            break;
  82.650 +         case 3:
  82.651 +            if ((png_ptr->row_number & 3) || png_ptr->width < 3)
  82.652 +            {
  82.653 +               if (dsp_row != NULL)
  82.654 +                  png_combine_row(png_ptr, dsp_row,
  82.655 +                     png_pass_dsp_mask[png_ptr->pass]);
  82.656 +               png_read_finish_row(png_ptr);
  82.657 +               return;
  82.658 +            }
  82.659 +            break;
  82.660 +         case 4:
  82.661 +            if ((png_ptr->row_number & 3) != 2)
  82.662 +            {
  82.663 +               if (dsp_row != NULL && (png_ptr->row_number & 2))
  82.664 +                  png_combine_row(png_ptr, dsp_row,
  82.665 +                     png_pass_dsp_mask[png_ptr->pass]);
  82.666 +               png_read_finish_row(png_ptr);
  82.667 +               return;
  82.668 +            }
  82.669 +            break;
  82.670 +         case 5:
  82.671 +            if ((png_ptr->row_number & 1) || png_ptr->width < 2)
  82.672 +            {
  82.673 +               if (dsp_row != NULL)
  82.674 +                  png_combine_row(png_ptr, dsp_row,
  82.675 +                     png_pass_dsp_mask[png_ptr->pass]);
  82.676 +               png_read_finish_row(png_ptr);
  82.677 +               return;
  82.678 +            }
  82.679 +            break;
  82.680 +         case 6:
  82.681 +            if (!(png_ptr->row_number & 1))
  82.682 +            {
  82.683 +               png_read_finish_row(png_ptr);
  82.684 +               return;
  82.685 +            }
  82.686 +            break;
  82.687 +      }
  82.688 +   }
  82.689 +#endif
  82.690 +
  82.691 +   if (!(png_ptr->mode & PNG_HAVE_IDAT))
  82.692 +      png_error(png_ptr, "Invalid attempt to read row data");
  82.693 +
  82.694 +   png_ptr->zstream.next_out = png_ptr->row_buf;
  82.695 +   png_ptr->zstream.avail_out = (uInt)png_ptr->irowbytes;
  82.696 +   do
  82.697 +   {
  82.698 +      if (!(png_ptr->zstream.avail_in))
  82.699 +      {
  82.700 +         while (!png_ptr->idat_size)
  82.701 +         {
  82.702 +            png_crc_finish(png_ptr, 0);
  82.703 +
  82.704 +            png_ptr->idat_size = png_read_chunk_header(png_ptr);
  82.705 +            if (png_memcmp(png_ptr->chunk_name, png_IDAT, 4))
  82.706 +               png_error(png_ptr, "Not enough image data");
  82.707 +         }
  82.708 +         png_ptr->zstream.avail_in = (uInt)png_ptr->zbuf_size;
  82.709 +         png_ptr->zstream.next_in = png_ptr->zbuf;
  82.710 +         if (png_ptr->zbuf_size > png_ptr->idat_size)
  82.711 +            png_ptr->zstream.avail_in = (uInt)png_ptr->idat_size;
  82.712 +         png_crc_read(png_ptr, png_ptr->zbuf,
  82.713 +            (png_size_t)png_ptr->zstream.avail_in);
  82.714 +         png_ptr->idat_size -= png_ptr->zstream.avail_in;
  82.715 +      }
  82.716 +      ret = inflate(&png_ptr->zstream, Z_PARTIAL_FLUSH);
  82.717 +      if (ret == Z_STREAM_END)
  82.718 +      {
  82.719 +         if (png_ptr->zstream.avail_out || png_ptr->zstream.avail_in ||
  82.720 +            png_ptr->idat_size)
  82.721 +            png_error(png_ptr, "Extra compressed data");
  82.722 +         png_ptr->mode |= PNG_AFTER_IDAT;
  82.723 +         png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED;
  82.724 +         break;
  82.725 +      }
  82.726 +      if (ret != Z_OK)
  82.727 +         png_error(png_ptr, png_ptr->zstream.msg ? png_ptr->zstream.msg :
  82.728 +                   "Decompression error");
  82.729 +
  82.730 +   } while (png_ptr->zstream.avail_out);
  82.731 +
  82.732 +   png_ptr->row_info.color_type = png_ptr->color_type;
  82.733 +   png_ptr->row_info.width = png_ptr->iwidth;
  82.734 +   png_ptr->row_info.channels = png_ptr->channels;
  82.735 +   png_ptr->row_info.bit_depth = png_ptr->bit_depth;
  82.736 +   png_ptr->row_info.pixel_depth = png_ptr->pixel_depth;
  82.737 +   png_ptr->row_info.rowbytes = PNG_ROWBYTES(png_ptr->row_info.pixel_depth,
  82.738 +       png_ptr->row_info.width);
  82.739 +
  82.740 +   if (png_ptr->row_buf[0])
  82.741 +   png_read_filter_row(png_ptr, &(png_ptr->row_info),
  82.742 +      png_ptr->row_buf + 1, png_ptr->prev_row + 1,
  82.743 +      (int)(png_ptr->row_buf[0]));
  82.744 +
  82.745 +   png_memcpy_check(png_ptr, png_ptr->prev_row, png_ptr->row_buf,
  82.746 +      png_ptr->rowbytes + 1);
  82.747 +
  82.748 +#if defined(PNG_MNG_FEATURES_SUPPORTED)
  82.749 +   if ((png_ptr->mng_features_permitted & PNG_FLAG_MNG_FILTER_64) &&
  82.750 +      (png_ptr->filter_type == PNG_INTRAPIXEL_DIFFERENCING))
  82.751 +   {
  82.752 +      /* Intrapixel differencing */
  82.753 +      png_do_read_intrapixel(&(png_ptr->row_info), png_ptr->row_buf + 1);
  82.754 +   }
  82.755 +#endif
  82.756 +
  82.757 +
  82.758 +   if (png_ptr->transformations || (png_ptr->flags&PNG_FLAG_STRIP_ALPHA))
  82.759 +      png_do_read_transformations(png_ptr);
  82.760 +
  82.761 +#if defined(PNG_READ_INTERLACING_SUPPORTED)
  82.762 +   /* blow up interlaced rows to full size */
  82.763 +   if (png_ptr->interlaced &&
  82.764 +      (png_ptr->transformations & PNG_INTERLACE))
  82.765 +   {
  82.766 +      if (png_ptr->pass < 6)
  82.767 +/*       old interface (pre-1.0.9):
  82.768 +         png_do_read_interlace(&(png_ptr->row_info),
  82.769 +            png_ptr->row_buf + 1, png_ptr->pass, png_ptr->transformations);
  82.770 + */
  82.771 +         png_do_read_interlace(png_ptr);
  82.772 +
  82.773 +      if (dsp_row != NULL)
  82.774 +         png_combine_row(png_ptr, dsp_row,
  82.775 +            png_pass_dsp_mask[png_ptr->pass]);
  82.776 +      if (row != NULL)
  82.777 +         png_combine_row(png_ptr, row,
  82.778 +            png_pass_mask[png_ptr->pass]);
  82.779 +   }
  82.780 +   else
  82.781 +#endif
  82.782 +   {
  82.783 +      if (row != NULL)
  82.784 +         png_combine_row(png_ptr, row, 0xff);
  82.785 +      if (dsp_row != NULL)
  82.786 +         png_combine_row(png_ptr, dsp_row, 0xff);
  82.787 +   }
  82.788 +   png_read_finish_row(png_ptr);
  82.789 +
  82.790 +   if (png_ptr->read_row_fn != NULL)
  82.791 +      (*(png_ptr->read_row_fn))(png_ptr, png_ptr->row_number, png_ptr->pass);
  82.792 +}
  82.793 +#endif /* PNG_NO_SEQUENTIAL_READ_SUPPORTED */
  82.794 +
  82.795 +#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED
  82.796 +/* Read one or more rows of image data.  If the image is interlaced,
  82.797 + * and png_set_interlace_handling() has been called, the rows need to
  82.798 + * contain the contents of the rows from the previous pass.  If the
  82.799 + * image has alpha or transparency, and png_handle_alpha()[*] has been
  82.800 + * called, the rows contents must be initialized to the contents of the
  82.801 + * screen.
  82.802 + *
  82.803 + * "row" holds the actual image, and pixels are placed in it
  82.804 + * as they arrive.  If the image is displayed after each pass, it will
  82.805 + * appear to "sparkle" in.  "display_row" can be used to display a
  82.806 + * "chunky" progressive image, with finer detail added as it becomes
  82.807 + * available.  If you do not want this "chunky" display, you may pass
  82.808 + * NULL for display_row.  If you do not want the sparkle display, and
  82.809 + * you have not called png_handle_alpha(), you may pass NULL for rows.
  82.810 + * If you have called png_handle_alpha(), and the image has either an
  82.811 + * alpha channel or a transparency chunk, you must provide a buffer for
  82.812 + * rows.  In this case, you do not have to provide a display_row buffer
  82.813 + * also, but you may.  If the image is not interlaced, or if you have
  82.814 + * not called png_set_interlace_handling(), the display_row buffer will
  82.815 + * be ignored, so pass NULL to it.
  82.816 + *
  82.817 + * [*] png_handle_alpha() does not exist yet, as of this version of libpng
  82.818 + */
  82.819 +
  82.820 +void PNGAPI
  82.821 +png_read_rows(png_structp png_ptr, png_bytepp row,
  82.822 +   png_bytepp display_row, png_uint_32 num_rows)
  82.823 +{
  82.824 +   png_uint_32 i;
  82.825 +   png_bytepp rp;
  82.826 +   png_bytepp dp;
  82.827 +
  82.828 +   png_debug(1, "in png_read_rows\n");
  82.829 +   if (png_ptr == NULL) return;
  82.830 +   rp = row;
  82.831 +   dp = display_row;
  82.832 +   if (rp != NULL && dp != NULL)
  82.833 +      for (i = 0; i < num_rows; i++)
  82.834 +      {
  82.835 +         png_bytep rptr = *rp++;
  82.836 +         png_bytep dptr = *dp++;
  82.837 +
  82.838 +         png_read_row(png_ptr, rptr, dptr);
  82.839 +      }
  82.840 +   else if (rp != NULL)
  82.841 +      for (i = 0; i < num_rows; i++)
  82.842 +      {
  82.843 +         png_bytep rptr = *rp;
  82.844 +         png_read_row(png_ptr, rptr, png_bytep_NULL);
  82.845 +         rp++;
  82.846 +      }
  82.847 +   else if (dp != NULL)
  82.848 +      for (i = 0; i < num_rows; i++)
  82.849 +      {
  82.850 +         png_bytep dptr = *dp;
  82.851 +         png_read_row(png_ptr, png_bytep_NULL, dptr);
  82.852 +         dp++;
  82.853 +      }
  82.854 +}
  82.855 +#endif /* PNG_NO_SEQUENTIAL_READ_SUPPORTED */
  82.856 +
  82.857 +#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED
  82.858 +/* Read the entire image.  If the image has an alpha channel or a tRNS
  82.859 + * chunk, and you have called png_handle_alpha()[*], you will need to
  82.860 + * initialize the image to the current image that PNG will be overlaying.
  82.861 + * We set the num_rows again here, in case it was incorrectly set in
  82.862 + * png_read_start_row() by a call to png_read_update_info() or
  82.863 + * png_start_read_image() if png_set_interlace_handling() wasn't called
  82.864 + * prior to either of these functions like it should have been.  You can
  82.865 + * only call this function once.  If you desire to have an image for
  82.866 + * each pass of a interlaced image, use png_read_rows() instead.
  82.867 + *
  82.868 + * [*] png_handle_alpha() does not exist yet, as of this version of libpng
  82.869 + */
  82.870 +void PNGAPI
  82.871 +png_read_image(png_structp png_ptr, png_bytepp image)
  82.872 +{
  82.873 +   png_uint_32 i, image_height;
  82.874 +   int pass, j;
  82.875 +   png_bytepp rp;
  82.876 +
  82.877 +   png_debug(1, "in png_read_image\n");
  82.878 +   if (png_ptr == NULL) return;
  82.879 +
  82.880 +#ifdef PNG_READ_INTERLACING_SUPPORTED
  82.881 +   pass = png_set_interlace_handling(png_ptr);
  82.882 +#else
  82.883 +   if (png_ptr->interlaced)
  82.884 +      png_error(png_ptr,
  82.885 +        "Cannot read interlaced image -- interlace handler disabled.");
  82.886 +   pass = 1;
  82.887 +#endif
  82.888 +
  82.889 +
  82.890 +   image_height=png_ptr->height;
  82.891 +   png_ptr->num_rows = image_height; /* Make sure this is set correctly */
  82.892 +
  82.893 +   for (j = 0; j < pass; j++)
  82.894 +   {
  82.895 +      rp = image;
  82.896 +      for (i = 0; i < image_height; i++)
  82.897 +      {
  82.898 +         png_read_row(png_ptr, *rp, png_bytep_NULL);
  82.899 +         rp++;
  82.900 +      }
  82.901 +   }
  82.902 +}
  82.903 +#endif /* PNG_NO_SEQUENTIAL_READ_SUPPORTED */
  82.904 +
  82.905 +#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED
  82.906 +/* Read the end of the PNG file.  Will not read past the end of the
  82.907 + * file, will verify the end is accurate, and will read any comments
  82.908 + * or time information at the end of the file, if info is not NULL.
  82.909 + */
  82.910 +void PNGAPI
  82.911 +png_read_end(png_structp png_ptr, png_infop info_ptr)
  82.912 +{
  82.913 +   png_debug(1, "in png_read_end\n");
  82.914 +   if (png_ptr == NULL) return;
  82.915 +   png_crc_finish(png_ptr, 0); /* Finish off CRC from last IDAT chunk */
  82.916 +
  82.917 +   do
  82.918 +   {
  82.919 +#ifdef PNG_USE_LOCAL_ARRAYS
  82.920 +      PNG_CONST PNG_IHDR;
  82.921 +      PNG_CONST PNG_IDAT;
  82.922 +      PNG_CONST PNG_IEND;
  82.923 +      PNG_CONST PNG_PLTE;
  82.924 +#if defined(PNG_READ_bKGD_SUPPORTED)
  82.925 +      PNG_CONST PNG_bKGD;
  82.926 +#endif
  82.927 +#if defined(PNG_READ_cHRM_SUPPORTED)
  82.928 +      PNG_CONST PNG_cHRM;
  82.929 +#endif
  82.930 +#if defined(PNG_READ_gAMA_SUPPORTED)
  82.931 +      PNG_CONST PNG_gAMA;
  82.932 +#endif
  82.933 +#if defined(PNG_READ_hIST_SUPPORTED)
  82.934 +      PNG_CONST PNG_hIST;
  82.935 +#endif
  82.936 +#if defined(PNG_READ_iCCP_SUPPORTED)
  82.937 +      PNG_CONST PNG_iCCP;
  82.938 +#endif
  82.939 +#if defined(PNG_READ_iTXt_SUPPORTED)
  82.940 +      PNG_CONST PNG_iTXt;
  82.941 +#endif
  82.942 +#if defined(PNG_READ_oFFs_SUPPORTED)
  82.943 +      PNG_CONST PNG_oFFs;
  82.944 +#endif
  82.945 +#if defined(PNG_READ_pCAL_SUPPORTED)
  82.946 +      PNG_CONST PNG_pCAL;
  82.947 +#endif
  82.948 +#if defined(PNG_READ_pHYs_SUPPORTED)
  82.949 +      PNG_CONST PNG_pHYs;
  82.950 +#endif
  82.951 +#if defined(PNG_READ_sBIT_SUPPORTED)
  82.952 +      PNG_CONST PNG_sBIT;
  82.953 +#endif
  82.954 +#if defined(PNG_READ_sCAL_SUPPORTED)
  82.955 +      PNG_CONST PNG_sCAL;
  82.956 +#endif
  82.957 +#if defined(PNG_READ_sPLT_SUPPORTED)
  82.958 +      PNG_CONST PNG_sPLT;
  82.959 +#endif
  82.960 +#if defined(PNG_READ_sRGB_SUPPORTED)
  82.961 +      PNG_CONST PNG_sRGB;
  82.962 +#endif
  82.963 +#if defined(PNG_READ_tEXt_SUPPORTED)
  82.964 +      PNG_CONST PNG_tEXt;
  82.965 +#endif
  82.966 +#if defined(PNG_READ_tIME_SUPPORTED)
  82.967 +      PNG_CONST PNG_tIME;
  82.968 +#endif
  82.969 +#if defined(PNG_READ_tRNS_SUPPORTED)
  82.970 +      PNG_CONST PNG_tRNS;
  82.971 +#endif
  82.972 +#if defined(PNG_READ_zTXt_SUPPORTED)
  82.973 +      PNG_CONST PNG_zTXt;
  82.974 +#endif
  82.975 +#endif /* PNG_USE_LOCAL_ARRAYS */
  82.976 +      png_uint_32 length = png_read_chunk_header(png_ptr);
  82.977 +      PNG_CONST png_bytep chunk_name = png_ptr->chunk_name;
  82.978 +
  82.979 +      if (!png_memcmp(chunk_name, png_IHDR, 4))
  82.980 +         png_handle_IHDR(png_ptr, info_ptr, length);
  82.981 +      else if (!png_memcmp(chunk_name, png_IEND, 4))
  82.982 +         png_handle_IEND(png_ptr, info_ptr, length);
  82.983 +#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
  82.984 +      else if (png_handle_as_unknown(png_ptr, chunk_name))
  82.985 +      {
  82.986 +         if (!png_memcmp(chunk_name, png_IDAT, 4))
  82.987 +         {
  82.988 +            if ((length > 0) || (png_ptr->mode & PNG_HAVE_CHUNK_AFTER_IDAT))
  82.989 +               png_error(png_ptr, "Too many IDAT's found");
  82.990 +         }
  82.991 +         png_handle_unknown(png_ptr, info_ptr, length);
  82.992 +         if (!png_memcmp(chunk_name, png_PLTE, 4))
  82.993 +            png_ptr->mode |= PNG_HAVE_PLTE;
  82.994 +      }
  82.995 +#endif
  82.996 +      else if (!png_memcmp(chunk_name, png_IDAT, 4))
  82.997 +      {
  82.998 +         /* Zero length IDATs are legal after the last IDAT has been
  82.999 +          * read, but not after other chunks have been read.
 82.1000 +          */
 82.1001 +         if ((length > 0) || (png_ptr->mode & PNG_HAVE_CHUNK_AFTER_IDAT))
 82.1002 +            png_error(png_ptr, "Too many IDAT's found");
 82.1003 +         png_crc_finish(png_ptr, length);
 82.1004 +      }
 82.1005 +      else if (!png_memcmp(chunk_name, png_PLTE, 4))
 82.1006 +         png_handle_PLTE(png_ptr, info_ptr, length);
 82.1007 +#if defined(PNG_READ_bKGD_SUPPORTED)
 82.1008 +      else if (!png_memcmp(chunk_name, png_bKGD, 4))
 82.1009 +         png_handle_bKGD(png_ptr, info_ptr, length);
 82.1010 +#endif
 82.1011 +#if defined(PNG_READ_cHRM_SUPPORTED)
 82.1012 +      else if (!png_memcmp(chunk_name, png_cHRM, 4))
 82.1013 +         png_handle_cHRM(png_ptr, info_ptr, length);
 82.1014 +#endif
 82.1015 +#if defined(PNG_READ_gAMA_SUPPORTED)
 82.1016 +      else if (!png_memcmp(chunk_name, png_gAMA, 4))
 82.1017 +         png_handle_gAMA(png_ptr, info_ptr, length);
 82.1018 +#endif
 82.1019 +#if defined(PNG_READ_hIST_SUPPORTED)
 82.1020 +      else if (!png_memcmp(chunk_name, png_hIST, 4))
 82.1021 +         png_handle_hIST(png_ptr, info_ptr, length);
 82.1022 +#endif
 82.1023 +#if defined(PNG_READ_oFFs_SUPPORTED)
 82.1024 +      else if (!png_memcmp(chunk_name, png_oFFs, 4))
 82.1025 +         png_handle_oFFs(png_ptr, info_ptr, length);
 82.1026 +#endif
 82.1027 +#if defined(PNG_READ_pCAL_SUPPORTED)
 82.1028 +      else if (!png_memcmp(chunk_name, png_pCAL, 4))
 82.1029 +         png_handle_pCAL(png_ptr, info_ptr, length);
 82.1030 +#endif
 82.1031 +#if defined(PNG_READ_sCAL_SUPPORTED)
 82.1032 +      else if (!png_memcmp(chunk_name, png_sCAL, 4))
 82.1033 +         png_handle_sCAL(png_ptr, info_ptr, length);
 82.1034 +#endif
 82.1035 +#if defined(PNG_READ_pHYs_SUPPORTED)
 82.1036 +      else if (!png_memcmp(chunk_name, png_pHYs, 4))
 82.1037 +         png_handle_pHYs(png_ptr, info_ptr, length);
 82.1038 +#endif
 82.1039 +#if defined(PNG_READ_sBIT_SUPPORTED)
 82.1040 +      else if (!png_memcmp(chunk_name, png_sBIT, 4))
 82.1041 +         png_handle_sBIT(png_ptr, info_ptr, length);
 82.1042 +#endif
 82.1043 +#if defined(PNG_READ_sRGB_SUPPORTED)
 82.1044 +      else if (!png_memcmp(chunk_name, png_sRGB, 4))
 82.1045 +         png_handle_sRGB(png_ptr, info_ptr, length);
 82.1046 +#endif
 82.1047 +#if defined(PNG_READ_iCCP_SUPPORTED)
 82.1048 +      else if (!png_memcmp(chunk_name, png_iCCP, 4))
 82.1049 +         png_handle_iCCP(png_ptr, info_ptr, length);
 82.1050 +#endif
 82.1051 +#if defined(PNG_READ_sPLT_SUPPORTED)
 82.1052 +      else if (!png_memcmp(chunk_name, png_sPLT, 4))
 82.1053 +         png_handle_sPLT(png_ptr, info_ptr, length);
 82.1054 +#endif
 82.1055 +#if defined(PNG_READ_tEXt_SUPPORTED)
 82.1056 +      else if (!png_memcmp(chunk_name, png_tEXt, 4))
 82.1057 +         png_handle_tEXt(png_ptr, info_ptr, length);
 82.1058 +#endif
 82.1059 +#if defined(PNG_READ_tIME_SUPPORTED)
 82.1060 +      else if (!png_memcmp(chunk_name, png_tIME, 4))
 82.1061 +         png_handle_tIME(png_ptr, info_ptr, length);
 82.1062 +#endif
 82.1063 +#if defined(PNG_READ_tRNS_SUPPORTED)
 82.1064 +      else if (!png_memcmp(chunk_name, png_tRNS, 4))
 82.1065 +         png_handle_tRNS(png_ptr, info_ptr, length);
 82.1066 +#endif
 82.1067 +#if defined(PNG_READ_zTXt_SUPPORTED)
 82.1068 +      else if (!png_memcmp(chunk_name, png_zTXt, 4))
 82.1069 +         png_handle_zTXt(png_ptr, info_ptr, length);
 82.1070 +#endif
 82.1071 +#if defined(PNG_READ_iTXt_SUPPORTED)
 82.1072 +      else if (!png_memcmp(chunk_name, png_iTXt, 4))
 82.1073 +         png_handle_iTXt(png_ptr, info_ptr, length);
 82.1074 +#endif
 82.1075 +      else
 82.1076 +         png_handle_unknown(png_ptr, info_ptr, length);
 82.1077 +   } while (!(png_ptr->mode & PNG_HAVE_IEND));
 82.1078 +}
 82.1079 +#endif /* PNG_NO_SEQUENTIAL_READ_SUPPORTED */
 82.1080 +
 82.1081 +/* free all memory used by the read */
 82.1082 +void PNGAPI
 82.1083 +png_destroy_read_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr,
 82.1084 +   png_infopp end_info_ptr_ptr)
 82.1085 +{
 82.1086 +   png_structp png_ptr = NULL;
 82.1087 +   png_infop info_ptr = NULL, end_info_ptr = NULL;
 82.1088 +#ifdef PNG_USER_MEM_SUPPORTED
 82.1089 +   png_free_ptr free_fn = NULL;
 82.1090 +   png_voidp mem_ptr = NULL;
 82.1091 +#endif
 82.1092 +
 82.1093 +   png_debug(1, "in png_destroy_read_struct\n");
 82.1094 +   if (png_ptr_ptr != NULL)
 82.1095 +      png_ptr = *png_ptr_ptr;
 82.1096 +   if (png_ptr == NULL)
 82.1097 +      return;
 82.1098 +
 82.1099 +#ifdef PNG_USER_MEM_SUPPORTED
 82.1100 +   free_fn = png_ptr->free_fn;
 82.1101 +   mem_ptr = png_ptr->mem_ptr;
 82.1102 +#endif
 82.1103 +
 82.1104 +   if (info_ptr_ptr != NULL)
 82.1105 +      info_ptr = *info_ptr_ptr;
 82.1106 +
 82.1107 +   if (end_info_ptr_ptr != NULL)
 82.1108 +      end_info_ptr = *end_info_ptr_ptr;
 82.1109 +
 82.1110 +   png_read_destroy(png_ptr, info_ptr, end_info_ptr);
 82.1111 +
 82.1112 +   if (info_ptr != NULL)
 82.1113 +   {
 82.1114 +#if defined(PNG_TEXT_SUPPORTED)
 82.1115 +      png_free_data(png_ptr, info_ptr, PNG_FREE_TEXT, -1);
 82.1116 +#endif
 82.1117 +
 82.1118 +#ifdef PNG_USER_MEM_SUPPORTED
 82.1119 +      png_destroy_struct_2((png_voidp)info_ptr, (png_free_ptr)free_fn,
 82.1120 +          (png_voidp)mem_ptr);
 82.1121 +#else
 82.1122 +      png_destroy_struct((png_voidp)info_ptr);
 82.1123 +#endif
 82.1124 +      *info_ptr_ptr = NULL;
 82.1125 +   }
 82.1126 +
 82.1127 +   if (end_info_ptr != NULL)
 82.1128 +   {
 82.1129 +#if defined(PNG_READ_TEXT_SUPPORTED)
 82.1130 +      png_free_data(png_ptr, end_info_ptr, PNG_FREE_TEXT, -1);
 82.1131 +#endif
 82.1132 +#ifdef PNG_USER_MEM_SUPPORTED
 82.1133 +      png_destroy_struct_2((png_voidp)end_info_ptr, (png_free_ptr)free_fn,
 82.1134 +         (png_voidp)mem_ptr);
 82.1135 +#else
 82.1136 +      png_destroy_struct((png_voidp)end_info_ptr);
 82.1137 +#endif
 82.1138 +      *end_info_ptr_ptr = NULL;
 82.1139 +   }
 82.1140 +
 82.1141 +   if (png_ptr != NULL)
 82.1142 +   {
 82.1143 +#ifdef PNG_USER_MEM_SUPPORTED
 82.1144 +      png_destroy_struct_2((png_voidp)png_ptr, (png_free_ptr)free_fn,
 82.1145 +          (png_voidp)mem_ptr);
 82.1146 +#else
 82.1147 +      png_destroy_struct((png_voidp)png_ptr);
 82.1148 +#endif
 82.1149 +      *png_ptr_ptr = NULL;
 82.1150 +   }
 82.1151 +}
 82.1152 +
 82.1153 +/* free all memory used by the read (old method) */
 82.1154 +void /* PRIVATE */
 82.1155 +png_read_destroy(png_structp png_ptr, png_infop info_ptr, png_infop end_info_ptr)
 82.1156 +{
 82.1157 +#ifdef PNG_SETJMP_SUPPORTED
 82.1158 +   jmp_buf tmp_jmp;
 82.1159 +#endif
 82.1160 +   png_error_ptr error_fn;
 82.1161 +   png_error_ptr warning_fn;
 82.1162 +   png_voidp error_ptr;
 82.1163 +#ifdef PNG_USER_MEM_SUPPORTED
 82.1164 +   png_free_ptr free_fn;
 82.1165 +#endif
 82.1166 +
 82.1167 +   png_debug(1, "in png_read_destroy\n");
 82.1168 +   if (info_ptr != NULL)
 82.1169 +      png_info_destroy(png_ptr, info_ptr);
 82.1170 +
 82.1171 +   if (end_info_ptr != NULL)
 82.1172 +      png_info_destroy(png_ptr, end_info_ptr);
 82.1173 +
 82.1174 +   png_free(png_ptr, png_ptr->zbuf);
 82.1175 +   png_free(png_ptr, png_ptr->big_row_buf);
 82.1176 +   png_free(png_ptr, png_ptr->prev_row);
 82.1177 +   png_free(png_ptr, png_ptr->chunkdata);
 82.1178 +#if defined(PNG_READ_DITHER_SUPPORTED)
 82.1179 +   png_free(png_ptr, png_ptr->palette_lookup);
 82.1180 +   png_free(png_ptr, png_ptr->dither_index);
 82.1181 +#endif
 82.1182 +#if defined(PNG_READ_GAMMA_SUPPORTED)
 82.1183 +   png_free(png_ptr, png_ptr->gamma_table);
 82.1184 +#endif
 82.1185 +#if defined(PNG_READ_BACKGROUND_SUPPORTED)
 82.1186 +   png_free(png_ptr, png_ptr->gamma_from_1);
 82.1187 +   png_free(png_ptr, png_ptr->gamma_to_1);
 82.1188 +#endif
 82.1189 +#ifdef PNG_FREE_ME_SUPPORTED
 82.1190 +   if (png_ptr->free_me & PNG_FREE_PLTE)
 82.1191 +      png_zfree(png_ptr, png_ptr->palette);
 82.1192 +   png_ptr->free_me &= ~PNG_FREE_PLTE;
 82.1193 +#else
 82.1194 +   if (png_ptr->flags & PNG_FLAG_FREE_PLTE)
 82.1195 +      png_zfree(png_ptr, png_ptr->palette);
 82.1196 +   png_ptr->flags &= ~PNG_FLAG_FREE_PLTE;
 82.1197 +#endif
 82.1198 +#if defined(PNG_tRNS_SUPPORTED) || \
 82.1199 +    defined(PNG_READ_EXPAND_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED)
 82.1200 +#ifdef PNG_FREE_ME_SUPPORTED
 82.1201 +   if (png_ptr->free_me & PNG_FREE_TRNS)
 82.1202 +      png_free(png_ptr, png_ptr->trans);
 82.1203 +   png_ptr->free_me &= ~PNG_FREE_TRNS;
 82.1204 +#else
 82.1205 +   if (png_ptr->flags & PNG_FLAG_FREE_TRNS)
 82.1206 +      png_free(png_ptr, png_ptr->trans);
 82.1207 +   png_ptr->flags &= ~PNG_FLAG_FREE_TRNS;
 82.1208 +#endif
 82.1209 +#endif
 82.1210 +#if defined(PNG_READ_hIST_SUPPORTED)
 82.1211 +#ifdef PNG_FREE_ME_SUPPORTED
 82.1212 +   if (png_ptr->free_me & PNG_FREE_HIST)
 82.1213 +      png_free(png_ptr, png_ptr->hist);
 82.1214 +   png_ptr->free_me &= ~PNG_FREE_HIST;
 82.1215 +#else
 82.1216 +   if (png_ptr->flags & PNG_FLAG_FREE_HIST)
 82.1217 +      png_free(png_ptr, png_ptr->hist);
 82.1218 +   png_ptr->flags &= ~PNG_FLAG_FREE_HIST;
 82.1219 +#endif
 82.1220 +#endif
 82.1221 +#if defined(PNG_READ_GAMMA_SUPPORTED)
 82.1222 +   if (png_ptr->gamma_16_table != NULL)
 82.1223 +   {
 82.1224 +      int i;
 82.1225 +      int istop = (1 << (8 - png_ptr->gamma_shift));
 82.1226 +      for (i = 0; i < istop; i++)
 82.1227 +      {
 82.1228 +         png_free(png_ptr, png_ptr->gamma_16_table[i]);
 82.1229 +      }
 82.1230 +   png_free(png_ptr, png_ptr->gamma_16_table);
 82.1231 +   }
 82.1232 +#if defined(PNG_READ_BACKGROUND_SUPPORTED)
 82.1233 +   if (png_ptr->gamma_16_from_1 != NULL)
 82.1234 +   {
 82.1235 +      int i;
 82.1236 +      int istop = (1 << (8 - png_ptr->gamma_shift));
 82.1237 +      for (i = 0; i < istop; i++)
 82.1238 +      {
 82.1239 +         png_free(png_ptr, png_ptr->gamma_16_from_1[i]);
 82.1240 +      }
 82.1241 +   png_free(png_ptr, png_ptr->gamma_16_from_1);
 82.1242 +   }
 82.1243 +   if (png_ptr->gamma_16_to_1 != NULL)
 82.1244 +   {
 82.1245 +      int i;
 82.1246 +      int istop = (1 << (8 - png_ptr->gamma_shift));
 82.1247 +      for (i = 0; i < istop; i++)
 82.1248 +      {
 82.1249 +         png_free(png_ptr, png_ptr->gamma_16_to_1[i]);
 82.1250 +      }
 82.1251 +   png_free(png_ptr, png_ptr->gamma_16_to_1);
 82.1252 +   }
 82.1253 +#endif
 82.1254 +#endif
 82.1255 +#if defined(PNG_TIME_RFC1123_SUPPORTED)
 82.1256 +   png_free(png_ptr, png_ptr->time_buffer);
 82.1257 +#endif
 82.1258 +
 82.1259 +   inflateEnd(&png_ptr->zstream);
 82.1260 +#ifdef PNG_PROGRESSIVE_READ_SUPPORTED
 82.1261 +   png_free(png_ptr, png_ptr->save_buffer);
 82.1262 +#endif
 82.1263 +
 82.1264 +#ifdef PNG_PROGRESSIVE_READ_SUPPORTED
 82.1265 +#ifdef PNG_TEXT_SUPPORTED
 82.1266 +   png_free(png_ptr, png_ptr->current_text);
 82.1267 +#endif /* PNG_TEXT_SUPPORTED */
 82.1268 +#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */
 82.1269 +
 82.1270 +   /* Save the important info out of the png_struct, in case it is
 82.1271 +    * being used again.
 82.1272 +    */
 82.1273 +#ifdef PNG_SETJMP_SUPPORTED
 82.1274 +   png_memcpy(tmp_jmp, png_ptr->jmpbuf, png_sizeof(jmp_buf));
 82.1275 +#endif
 82.1276 +
 82.1277 +   error_fn = png_ptr->error_fn;
 82.1278 +   warning_fn = png_ptr->warning_fn;
 82.1279 +   error_ptr = png_ptr->error_ptr;
 82.1280 +#ifdef PNG_USER_MEM_SUPPORTED
 82.1281 +   free_fn = png_ptr->free_fn;
 82.1282 +#endif
 82.1283 +
 82.1284 +   png_memset(png_ptr, 0, png_sizeof(png_struct));
 82.1285 +
 82.1286 +   png_ptr->error_fn = error_fn;
 82.1287 +   png_ptr->warning_fn = warning_fn;
 82.1288 +   png_ptr->error_ptr = error_ptr;
 82.1289 +#ifdef PNG_USER_MEM_SUPPORTED
 82.1290 +   png_ptr->free_fn = free_fn;
 82.1291 +#endif
 82.1292 +
 82.1293 +#ifdef PNG_SETJMP_SUPPORTED
 82.1294 +   png_memcpy(png_ptr->jmpbuf, tmp_jmp, png_sizeof(jmp_buf));
 82.1295 +#endif
 82.1296 +
 82.1297 +}
 82.1298 +
 82.1299 +void PNGAPI
 82.1300 +png_set_read_status_fn(png_structp png_ptr, png_read_status_ptr read_row_fn)
 82.1301 +{
 82.1302 +   if (png_ptr == NULL) return;
 82.1303 +   png_ptr->read_row_fn = read_row_fn;
 82.1304 +}
 82.1305 +
 82.1306 +
 82.1307 +#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED
 82.1308 +#if defined(PNG_INFO_IMAGE_SUPPORTED)
 82.1309 +void PNGAPI
 82.1310 +png_read_png(png_structp png_ptr, png_infop info_ptr,
 82.1311 +                           int transforms,
 82.1312 +                           voidp params)
 82.1313 +{
 82.1314 +   int row;
 82.1315 +
 82.1316 +   if (png_ptr == NULL) return;
 82.1317 +#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED)
 82.1318 +   /* invert the alpha channel from opacity to transparency
 82.1319 +    */
 82.1320 +   if (transforms & PNG_TRANSFORM_INVERT_ALPHA)
 82.1321 +       png_set_invert_alpha(png_ptr);
 82.1322 +#endif
 82.1323 +
 82.1324 +   /* png_read_info() gives us all of the information from the
 82.1325 +    * PNG file before the first IDAT (image data chunk).
 82.1326 +    */
 82.1327 +   png_read_info(png_ptr, info_ptr);
 82.1328 +   if (info_ptr->height > PNG_UINT_32_MAX/png_sizeof(png_bytep))
 82.1329 +      png_error(png_ptr, "Image is too high to process with png_read_png()");
 82.1330 +
 82.1331 +   /* -------------- image transformations start here ------------------- */
 82.1332 +
 82.1333 +#if defined(PNG_READ_16_TO_8_SUPPORTED)
 82.1334 +   /* tell libpng to strip 16 bit/color files down to 8 bits per color
 82.1335 +    */
 82.1336 +   if (transforms & PNG_TRANSFORM_STRIP_16)
 82.1337 +       png_set_strip_16(png_ptr);
 82.1338 +#endif
 82.1339 +
 82.1340 +#if defined(PNG_READ_STRIP_ALPHA_SUPPORTED)
 82.1341 +   /* Strip alpha bytes from the input data without combining with
 82.1342 +    * the background (not recommended).
 82.1343 +    */
 82.1344 +   if (transforms & PNG_TRANSFORM_STRIP_ALPHA)
 82.1345 +       png_set_strip_alpha(png_ptr);
 82.1346 +#endif
 82.1347 +
 82.1348 +#if defined(PNG_READ_PACK_SUPPORTED) && !defined(PNG_READ_EXPAND_SUPPORTED)
 82.1349 +   /* Extract multiple pixels with bit depths of 1, 2, or 4 from a single
 82.1350 +    * byte into separate bytes (useful for paletted and grayscale images).
 82.1351 +    */
 82.1352 +   if (transforms & PNG_TRANSFORM_PACKING)
 82.1353 +       png_set_packing(png_ptr);
 82.1354 +#endif
 82.1355 +
 82.1356 +#if defined(PNG_READ_PACKSWAP_SUPPORTED)
 82.1357 +   /* Change the order of packed pixels to least significant bit first
 82.1358 +    * (not useful if you are using png_set_packing).
 82.1359 +    */
 82.1360 +   if (transforms & PNG_TRANSFORM_PACKSWAP)
 82.1361 +       png_set_packswap(png_ptr);
 82.1362 +#endif
 82.1363 +
 82.1364 +#if defined(PNG_READ_EXPAND_SUPPORTED)
 82.1365 +   /* Expand paletted colors into true RGB triplets
 82.1366 +    * Expand grayscale images to full 8 bits from 1, 2, or 4 bits/pixel
 82.1367 +    * Expand paletted or RGB images with transparency to full alpha
 82.1368 +    * channels so the data will be available as RGBA quartets.
 82.1369 +    */
 82.1370 +   if (transforms & PNG_TRANSFORM_EXPAND)
 82.1371 +       if ((png_ptr->bit_depth < 8) ||
 82.1372 +           (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) ||
 82.1373 +           (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)))
 82.1374 +         png_set_expand(png_ptr);
 82.1375 +#endif
 82.1376 +
 82.1377 +   /* We don't handle background color or gamma transformation or dithering.
 82.1378 +    */
 82.1379 +
 82.1380 +#if defined(PNG_READ_INVERT_SUPPORTED)
 82.1381 +   /* invert monochrome files to have 0 as white and 1 as black
 82.1382 +    */
 82.1383 +   if (transforms & PNG_TRANSFORM_INVERT_MONO)
 82.1384 +       png_set_invert_mono(png_ptr);
 82.1385 +#endif
 82.1386 +
 82.1387 +#if defined(PNG_READ_SHIFT_SUPPORTED)
 82.1388 +   /* If you want to shift the pixel values from the range [0,255] or
 82.1389 +    * [0,65535] to the original [0,7] or [0,31], or whatever range the
 82.1390 +    * colors were originally in:
 82.1391 +    */
 82.1392 +   if ((transforms & PNG_TRANSFORM_SHIFT)
 82.1393 +       && png_get_valid(png_ptr, info_ptr, PNG_INFO_sBIT))
 82.1394 +   {
 82.1395 +      png_color_8p sig_bit;
 82.1396 +
 82.1397 +      png_get_sBIT(png_ptr, info_ptr, &sig_bit);
 82.1398 +      png_set_shift(png_ptr, sig_bit);
 82.1399 +   }
 82.1400 +#endif
 82.1401 +
 82.1402 +#if defined(PNG_READ_BGR_SUPPORTED)
 82.1403 +   /* flip the RGB pixels to BGR (or RGBA to BGRA)
 82.1404 +    */
 82.1405 +   if (transforms & PNG_TRANSFORM_BGR)
 82.1406 +       png_set_bgr(png_ptr);
 82.1407 +#endif
 82.1408 +
 82.1409 +#if defined(PNG_READ_SWAP_ALPHA_SUPPORTED)
 82.1410 +   /* swap the RGBA or GA data to ARGB or AG (or BGRA to ABGR)
 82.1411 +    */
 82.1412 +   if (transforms & PNG_TRANSFORM_SWAP_ALPHA)
 82.1413 +       png_set_swap_alpha(png_ptr);
 82.1414 +#endif
 82.1415 +
 82.1416 +#if defined(PNG_READ_SWAP_SUPPORTED)
 82.1417 +   /* swap bytes of 16 bit files to least significant byte first
 82.1418 +    */
 82.1419 +   if (transforms & PNG_TRANSFORM_SWAP_ENDIAN)
 82.1420 +       png_set_swap(png_ptr);
 82.1421 +#endif
 82.1422 +
 82.1423 +   /* We don't handle adding filler bytes */
 82.1424 +
 82.1425 +   /* Optional call to gamma correct and add the background to the palette
 82.1426 +    * and update info structure.  REQUIRED if you are expecting libpng to
 82.1427 +    * update the palette for you (i.e., you selected such a transform above).
 82.1428 +    */
 82.1429 +   png_read_update_info(png_ptr, info_ptr);
 82.1430 +
 82.1431 +   /* -------------- image transformations end here ------------------- */
 82.1432 +
 82.1433 +#ifdef PNG_FREE_ME_SUPPORTED
 82.1434 +   png_free_data(png_ptr, info_ptr, PNG_FREE_ROWS, 0);
 82.1435 +#endif
 82.1436 +   if (info_ptr->row_pointers == NULL)
 82.1437 +   {
 82.1438 +      info_ptr->row_pointers = (png_bytepp)png_malloc(png_ptr,
 82.1439 +         info_ptr->height * png_sizeof(png_bytep));
 82.1440 +#ifdef PNG_FREE_ME_SUPPORTED
 82.1441 +      info_ptr->free_me |= PNG_FREE_ROWS;
 82.1442 +#endif
 82.1443 +      for (row = 0; row < (int)info_ptr->height; row++)
 82.1444 +      {
 82.1445 +         info_ptr->row_pointers[row] = (png_bytep)png_malloc(png_ptr,
 82.1446 +            png_get_rowbytes(png_ptr, info_ptr));
 82.1447 +      }
 82.1448 +   }
 82.1449 +
 82.1450 +   png_read_image(png_ptr, info_ptr->row_pointers);
 82.1451 +   info_ptr->valid |= PNG_INFO_IDAT;
 82.1452 +
 82.1453 +   /* read rest of file, and get additional chunks in info_ptr - REQUIRED */
 82.1454 +   png_read_end(png_ptr, info_ptr);
 82.1455 +
 82.1456 +   transforms = transforms; /* quiet compiler warnings */
 82.1457 +   params = params;
 82.1458 +
 82.1459 +}
 82.1460 +#endif /* PNG_INFO_IMAGE_SUPPORTED */
 82.1461 +#endif /* PNG_NO_SEQUENTIAL_READ_SUPPORTED */
 82.1462 +#endif /* PNG_READ_SUPPORTED */
    83.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    83.2 +++ b/libs/libpng/pngrio.c	Sun Nov 01 00:36:56 2015 +0200
    83.3 @@ -0,0 +1,166 @@
    83.4 +
    83.5 +/* pngrio.c - functions for data input
    83.6 + *
    83.7 + * Last changed in libpng 1.2.30 [August 15, 2008]
    83.8 + * For conditions of distribution and use, see copyright notice in png.h
    83.9 + * Copyright (c) 1998-2008 Glenn Randers-Pehrson
   83.10 + * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
   83.11 + * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
   83.12 + *
   83.13 + * This file provides a location for all input.  Users who need
   83.14 + * special handling are expected to write a function that has the same
   83.15 + * arguments as this and performs a similar function, but that possibly
   83.16 + * has a different input method.  Note that you shouldn't change this
   83.17 + * function, but rather write a replacement function and then make
   83.18 + * libpng use it at run time with png_set_read_fn(...).
   83.19 + */
   83.20 +
   83.21 +#define PNG_INTERNAL
   83.22 +#include "png.h"
   83.23 +#if defined(PNG_READ_SUPPORTED)
   83.24 +
   83.25 +/* Read the data from whatever input you are using.  The default routine
   83.26 +   reads from a file pointer.  Note that this routine sometimes gets called
   83.27 +   with very small lengths, so you should implement some kind of simple
   83.28 +   buffering if you are using unbuffered reads.  This should never be asked
   83.29 +   to read more then 64K on a 16 bit machine. */
   83.30 +void /* PRIVATE */
   83.31 +png_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
   83.32 +{
   83.33 +   png_debug1(4, "reading %d bytes\n", (int)length);
   83.34 +   if (png_ptr->read_data_fn != NULL)
   83.35 +      (*(png_ptr->read_data_fn))(png_ptr, data, length);
   83.36 +   else
   83.37 +      png_error(png_ptr, "Call to NULL read function");
   83.38 +}
   83.39 +
   83.40 +#if !defined(PNG_NO_STDIO)
   83.41 +/* This is the function that does the actual reading of data.  If you are
   83.42 +   not reading from a standard C stream, you should create a replacement
   83.43 +   read_data function and use it at run time with png_set_read_fn(), rather
   83.44 +   than changing the library. */
   83.45 +#ifndef USE_FAR_KEYWORD
   83.46 +void PNGAPI
   83.47 +png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
   83.48 +{
   83.49 +   png_size_t check;
   83.50 +
   83.51 +   if (png_ptr == NULL) return;
   83.52 +   /* fread() returns 0 on error, so it is OK to store this in a png_size_t
   83.53 +    * instead of an int, which is what fread() actually returns.
   83.54 +    */
   83.55 +#if defined(_WIN32_WCE)
   83.56 +   if ( !ReadFile((HANDLE)(png_ptr->io_ptr), data, length, &check, NULL) )
   83.57 +      check = 0;
   83.58 +#else
   83.59 +   check = (png_size_t)fread(data, (png_size_t)1, length,
   83.60 +      (png_FILE_p)png_ptr->io_ptr);
   83.61 +#endif
   83.62 +
   83.63 +   if (check != length)
   83.64 +      png_error(png_ptr, "Read Error");
   83.65 +}
   83.66 +#else
   83.67 +/* this is the model-independent version. Since the standard I/O library
   83.68 +   can't handle far buffers in the medium and small models, we have to copy
   83.69 +   the data.
   83.70 +*/
   83.71 +
   83.72 +#define NEAR_BUF_SIZE 1024
   83.73 +#define MIN(a,b) (a <= b ? a : b)
   83.74 +
   83.75 +static void PNGAPI
   83.76 +png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
   83.77 +{
   83.78 +   int check;
   83.79 +   png_byte *n_data;
   83.80 +   png_FILE_p io_ptr;
   83.81 +
   83.82 +   if (png_ptr == NULL) return;
   83.83 +   /* Check if data really is near. If so, use usual code. */
   83.84 +   n_data = (png_byte *)CVT_PTR_NOCHECK(data);
   83.85 +   io_ptr = (png_FILE_p)CVT_PTR(png_ptr->io_ptr);
   83.86 +   if ((png_bytep)n_data == data)
   83.87 +   {
   83.88 +#if defined(_WIN32_WCE)
   83.89 +      if ( !ReadFile((HANDLE)(png_ptr->io_ptr), data, length, &check, NULL) )
   83.90 +         check = 0;
   83.91 +#else
   83.92 +      check = fread(n_data, 1, length, io_ptr);
   83.93 +#endif
   83.94 +   }
   83.95 +   else
   83.96 +   {
   83.97 +      png_byte buf[NEAR_BUF_SIZE];
   83.98 +      png_size_t read, remaining, err;
   83.99 +      check = 0;
  83.100 +      remaining = length;
  83.101 +      do
  83.102 +      {
  83.103 +         read = MIN(NEAR_BUF_SIZE, remaining);
  83.104 +#if defined(_WIN32_WCE)
  83.105 +         if ( !ReadFile((HANDLE)(io_ptr), buf, read, &err, NULL) )
  83.106 +            err = 0;
  83.107 +#else
  83.108 +         err = fread(buf, (png_size_t)1, read, io_ptr);
  83.109 +#endif
  83.110 +         png_memcpy(data, buf, read); /* copy far buffer to near buffer */
  83.111 +         if (err != read)
  83.112 +            break;
  83.113 +         else
  83.114 +            check += err;
  83.115 +         data += read;
  83.116 +         remaining -= read;
  83.117 +      }
  83.118 +      while (remaining != 0);
  83.119 +   }
  83.120 +   if ((png_uint_32)check != (png_uint_32)length)
  83.121 +      png_error(png_ptr, "read Error");
  83.122 +}
  83.123 +#endif
  83.124 +#endif
  83.125 +
  83.126 +/* This function allows the application to supply a new input function
  83.127 +   for libpng if standard C streams aren't being used.
  83.128 +
  83.129 +   This function takes as its arguments:
  83.130 +   png_ptr      - pointer to a png input data structure
  83.131 +   io_ptr       - pointer to user supplied structure containing info about
  83.132 +                  the input functions.  May be NULL.
  83.133 +   read_data_fn - pointer to a new input function that takes as its
  83.134 +                  arguments a pointer to a png_struct, a pointer to
  83.135 +                  a location where input data can be stored, and a 32-bit
  83.136 +                  unsigned int that is the number of bytes to be read.
  83.137 +                  To exit and output any fatal error messages the new write
  83.138 +                  function should call png_error(png_ptr, "Error msg"). */
  83.139 +void PNGAPI
  83.140 +png_set_read_fn(png_structp png_ptr, png_voidp io_ptr,
  83.141 +   png_rw_ptr read_data_fn)
  83.142 +{
  83.143 +   if (png_ptr == NULL) return;
  83.144 +   png_ptr->io_ptr = io_ptr;
  83.145 +
  83.146 +#if !defined(PNG_NO_STDIO)
  83.147 +   if (read_data_fn != NULL)
  83.148 +      png_ptr->read_data_fn = read_data_fn;
  83.149 +   else
  83.150 +      png_ptr->read_data_fn = png_default_read_data;
  83.151 +#else
  83.152 +   png_ptr->read_data_fn = read_data_fn;
  83.153 +#endif
  83.154 +
  83.155 +   /* It is an error to write to a read device */
  83.156 +   if (png_ptr->write_data_fn != NULL)
  83.157 +   {
  83.158 +      png_ptr->write_data_fn = NULL;
  83.159 +      png_warning(png_ptr,
  83.160 +         "It's an error to set both read_data_fn and write_data_fn in the ");
  83.161 +      png_warning(png_ptr,
  83.162 +         "same structure.  Resetting write_data_fn to NULL.");
  83.163 +   }
  83.164 +
  83.165 +#if defined(PNG_WRITE_FLUSH_SUPPORTED)
  83.166 +   png_ptr->output_flush_fn = NULL;
  83.167 +#endif
  83.168 +}
  83.169 +#endif /* PNG_READ_SUPPORTED */
    84.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    84.2 +++ b/libs/libpng/pngrtran.c	Sun Nov 01 00:36:56 2015 +0200
    84.3 @@ -0,0 +1,4296 @@
    84.4 +
    84.5 +/* pngrtran.c - transforms the data in a row for PNG readers
    84.6 + *
    84.7 + * Last changed in libpng 1.2.30 [August 15, 2008]
    84.8 + * For conditions of distribution and use, see copyright notice in png.h
    84.9 + * Copyright (c) 1998-2008 Glenn Randers-Pehrson
   84.10 + * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
   84.11 + * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
   84.12 + *
   84.13 + * This file contains functions optionally called by an application
   84.14 + * in order to tell libpng how to handle data when reading a PNG.
   84.15 + * Transformations that are used in both reading and writing are
   84.16 + * in pngtrans.c.
   84.17 + */
   84.18 +
   84.19 +#define PNG_INTERNAL
   84.20 +#include "png.h"
   84.21 +#if defined(PNG_READ_SUPPORTED)
   84.22 +
   84.23 +/* Set the action on getting a CRC error for an ancillary or critical chunk. */
   84.24 +void PNGAPI
   84.25 +png_set_crc_action(png_structp png_ptr, int crit_action, int ancil_action)
   84.26 +{
   84.27 +   png_debug(1, "in png_set_crc_action\n");
   84.28 +   /* Tell libpng how we react to CRC errors in critical chunks */
   84.29 +   if (png_ptr == NULL) return;
   84.30 +   switch (crit_action)
   84.31 +   {
   84.32 +      case PNG_CRC_NO_CHANGE:                        /* leave setting as is */
   84.33 +         break;
   84.34 +      case PNG_CRC_WARN_USE:                               /* warn/use data */
   84.35 +         png_ptr->flags &= ~PNG_FLAG_CRC_CRITICAL_MASK;
   84.36 +         png_ptr->flags |= PNG_FLAG_CRC_CRITICAL_USE;
   84.37 +         break;
   84.38 +      case PNG_CRC_QUIET_USE:                             /* quiet/use data */
   84.39 +         png_ptr->flags &= ~PNG_FLAG_CRC_CRITICAL_MASK;
   84.40 +         png_ptr->flags |= PNG_FLAG_CRC_CRITICAL_USE |
   84.41 +                           PNG_FLAG_CRC_CRITICAL_IGNORE;
   84.42 +         break;
   84.43 +      case PNG_CRC_WARN_DISCARD:    /* not a valid action for critical data */
   84.44 +         png_warning(png_ptr,
   84.45 +            "Can't discard critical data on CRC error.");
   84.46 +      case PNG_CRC_ERROR_QUIT:                                /* error/quit */
   84.47 +      case PNG_CRC_DEFAULT:
   84.48 +      default:
   84.49 +         png_ptr->flags &= ~PNG_FLAG_CRC_CRITICAL_MASK;
   84.50 +         break;
   84.51 +   }
   84.52 +
   84.53 +   switch (ancil_action)
   84.54 +   {
   84.55 +      case PNG_CRC_NO_CHANGE:                       /* leave setting as is */
   84.56 +         break;
   84.57 +      case PNG_CRC_WARN_USE:                              /* warn/use data */
   84.58 +         png_ptr->flags &= ~PNG_FLAG_CRC_ANCILLARY_MASK;
   84.59 +         png_ptr->flags |= PNG_FLAG_CRC_ANCILLARY_USE;
   84.60 +         break;
   84.61 +      case PNG_CRC_QUIET_USE:                            /* quiet/use data */
   84.62 +         png_ptr->flags &= ~PNG_FLAG_CRC_ANCILLARY_MASK;
   84.63 +         png_ptr->flags |= PNG_FLAG_CRC_ANCILLARY_USE |
   84.64 +                           PNG_FLAG_CRC_ANCILLARY_NOWARN;
   84.65 +         break;
   84.66 +      case PNG_CRC_ERROR_QUIT:                               /* error/quit */
   84.67 +         png_ptr->flags &= ~PNG_FLAG_CRC_ANCILLARY_MASK;
   84.68 +         png_ptr->flags |= PNG_FLAG_CRC_ANCILLARY_NOWARN;
   84.69 +         break;
   84.70 +      case PNG_CRC_WARN_DISCARD:                      /* warn/discard data */
   84.71 +      case PNG_CRC_DEFAULT:
   84.72 +      default:
   84.73 +         png_ptr->flags &= ~PNG_FLAG_CRC_ANCILLARY_MASK;
   84.74 +         break;
   84.75 +   }
   84.76 +}
   84.77 +
   84.78 +#if defined(PNG_READ_BACKGROUND_SUPPORTED) && \
   84.79 +    defined(PNG_FLOATING_POINT_SUPPORTED)
   84.80 +/* handle alpha and tRNS via a background color */
   84.81 +void PNGAPI
   84.82 +png_set_background(png_structp png_ptr,
   84.83 +   png_color_16p background_color, int background_gamma_code,
   84.84 +   int need_expand, double background_gamma)
   84.85 +{
   84.86 +   png_debug(1, "in png_set_background\n");
   84.87 +   if (png_ptr == NULL) return;
   84.88 +   if (background_gamma_code == PNG_BACKGROUND_GAMMA_UNKNOWN)
   84.89 +   {
   84.90 +      png_warning(png_ptr, "Application must supply a known background gamma");
   84.91 +      return;
   84.92 +   }
   84.93 +
   84.94 +   png_ptr->transformations |= PNG_BACKGROUND;
   84.95 +   png_memcpy(&(png_ptr->background), background_color,
   84.96 +      png_sizeof(png_color_16));
   84.97 +   png_ptr->background_gamma = (float)background_gamma;
   84.98 +   png_ptr->background_gamma_type = (png_byte)(background_gamma_code);
   84.99 +   png_ptr->transformations |= (need_expand ? PNG_BACKGROUND_EXPAND : 0);
  84.100 +}
  84.101 +#endif
  84.102 +
  84.103 +#if defined(PNG_READ_16_TO_8_SUPPORTED)
  84.104 +/* strip 16 bit depth files to 8 bit depth */
  84.105 +void PNGAPI
  84.106 +png_set_strip_16(png_structp png_ptr)
  84.107 +{
  84.108 +   png_debug(1, "in png_set_strip_16\n");
  84.109 +   if (png_ptr == NULL) return;
  84.110 +   png_ptr->transformations |= PNG_16_TO_8;
  84.111 +}
  84.112 +#endif
  84.113 +
  84.114 +#if defined(PNG_READ_STRIP_ALPHA_SUPPORTED)
  84.115 +void PNGAPI
  84.116 +png_set_strip_alpha(png_structp png_ptr)
  84.117 +{
  84.118 +   png_debug(1, "in png_set_strip_alpha\n");
  84.119 +   if (png_ptr == NULL) return;
  84.120 +   png_ptr->flags |= PNG_FLAG_STRIP_ALPHA;
  84.121 +}
  84.122 +#endif
  84.123 +
  84.124 +#if defined(PNG_READ_DITHER_SUPPORTED)
  84.125 +/* Dither file to 8 bit.  Supply a palette, the current number
  84.126 + * of elements in the palette, the maximum number of elements
  84.127 + * allowed, and a histogram if possible.  If the current number
  84.128 + * of colors is greater then the maximum number, the palette will be
  84.129 + * modified to fit in the maximum number.  "full_dither" indicates
  84.130 + * whether we need a dithering cube set up for RGB images, or if we
  84.131 + * simply are reducing the number of colors in a paletted image.
  84.132 + */
  84.133 +
  84.134 +typedef struct png_dsort_struct
  84.135 +{
  84.136 +   struct png_dsort_struct FAR * next;
  84.137 +   png_byte left;
  84.138 +   png_byte right;
  84.139 +} png_dsort;
  84.140 +typedef png_dsort FAR *       png_dsortp;
  84.141 +typedef png_dsort FAR * FAR * png_dsortpp;
  84.142 +
  84.143 +void PNGAPI
  84.144 +png_set_dither(png_structp png_ptr, png_colorp palette,
  84.145 +   int num_palette, int maximum_colors, png_uint_16p histogram,
  84.146 +   int full_dither)
  84.147 +{
  84.148 +   png_debug(1, "in png_set_dither\n");
  84.149 +   if (png_ptr == NULL) return;
  84.150 +   png_ptr->transformations |= PNG_DITHER;
  84.151 +
  84.152 +   if (!full_dither)
  84.153 +   {
  84.154 +      int i;
  84.155 +
  84.156 +      png_ptr->dither_index = (png_bytep)png_malloc(png_ptr,
  84.157 +         (png_uint_32)(num_palette * png_sizeof(png_byte)));
  84.158 +      for (i = 0; i < num_palette; i++)
  84.159 +         png_ptr->dither_index[i] = (png_byte)i;
  84.160 +   }
  84.161 +
  84.162 +   if (num_palette > maximum_colors)
  84.163 +   {
  84.164 +      if (histogram != NULL)
  84.165 +      {
  84.166 +         /* This is easy enough, just throw out the least used colors.
  84.167 +            Perhaps not the best solution, but good enough. */
  84.168 +
  84.169 +         int i;
  84.170 +
  84.171 +         /* initialize an array to sort colors */
  84.172 +         png_ptr->dither_sort = (png_bytep)png_malloc(png_ptr,
  84.173 +            (png_uint_32)(num_palette * png_sizeof(png_byte)));
  84.174 +
  84.175 +         /* initialize the dither_sort array */
  84.176 +         for (i = 0; i < num_palette; i++)
  84.177 +            png_ptr->dither_sort[i] = (png_byte)i;
  84.178 +
  84.179 +         /* Find the least used palette entries by starting a
  84.180 +            bubble sort, and running it until we have sorted
  84.181 +            out enough colors.  Note that we don't care about
  84.182 +            sorting all the colors, just finding which are
  84.183 +            least used. */
  84.184 +
  84.185 +         for (i = num_palette - 1; i >= maximum_colors; i--)
  84.186 +         {
  84.187 +            int done; /* to stop early if the list is pre-sorted */
  84.188 +            int j;
  84.189 +
  84.190 +            done = 1;
  84.191 +            for (j = 0; j < i; j++)
  84.192 +            {
  84.193 +               if (histogram[png_ptr->dither_sort[j]]
  84.194 +                   < histogram[png_ptr->dither_sort[j + 1]])
  84.195 +               {
  84.196 +                  png_byte t;
  84.197 +
  84.198 +                  t = png_ptr->dither_sort[j];
  84.199 +                  png_ptr->dither_sort[j] = png_ptr->dither_sort[j + 1];
  84.200 +                  png_ptr->dither_sort[j + 1] = t;
  84.201 +                  done = 0;
  84.202 +               }
  84.203 +            }
  84.204 +            if (done)
  84.205 +               break;
  84.206 +         }
  84.207 +
  84.208 +         /* swap the palette around, and set up a table, if necessary */
  84.209 +         if (full_dither)
  84.210 +         {
  84.211 +            int j = num_palette;
  84.212 +
  84.213 +            /* put all the useful colors within the max, but don't
  84.214 +               move the others */
  84.215 +            for (i = 0; i < maximum_colors; i++)
  84.216 +            {
  84.217 +               if ((int)png_ptr->dither_sort[i] >= maximum_colors)
  84.218 +               {
  84.219 +                  do
  84.220 +                     j--;
  84.221 +                  while ((int)png_ptr->dither_sort[j] >= maximum_colors);
  84.222 +                  palette[i] = palette[j];
  84.223 +               }
  84.224 +            }
  84.225 +         }
  84.226 +         else
  84.227 +         {
  84.228 +            int j = num_palette;
  84.229 +
  84.230 +            /* move all the used colors inside the max limit, and
  84.231 +               develop a translation table */
  84.232 +            for (i = 0; i < maximum_colors; i++)
  84.233 +            {
  84.234 +               /* only move the colors we need to */
  84.235 +               if ((int)png_ptr->dither_sort[i] >= maximum_colors)
  84.236 +               {
  84.237 +                  png_color tmp_color;
  84.238 +
  84.239 +                  do
  84.240 +                     j--;
  84.241 +                  while ((int)png_ptr->dither_sort[j] >= maximum_colors);
  84.242 +
  84.243 +                  tmp_color = palette[j];
  84.244 +                  palette[j] = palette[i];
  84.245 +                  palette[i] = tmp_color;
  84.246 +                  /* indicate where the color went */
  84.247 +                  png_ptr->dither_index[j] = (png_byte)i;
  84.248 +                  png_ptr->dither_index[i] = (png_byte)j;
  84.249 +               }
  84.250 +            }
  84.251 +
  84.252 +            /* find closest color for those colors we are not using */
  84.253 +            for (i = 0; i < num_palette; i++)
  84.254 +            {
  84.255 +               if ((int)png_ptr->dither_index[i] >= maximum_colors)
  84.256 +               {
  84.257 +                  int min_d, k, min_k, d_index;
  84.258 +
  84.259 +                  /* find the closest color to one we threw out */
  84.260 +                  d_index = png_ptr->dither_index[i];
  84.261 +                  min_d = PNG_COLOR_DIST(palette[d_index], palette[0]);
  84.262 +                  for (k = 1, min_k = 0; k < maximum_colors; k++)
  84.263 +                  {
  84.264 +                     int d;
  84.265 +
  84.266 +                     d = PNG_COLOR_DIST(palette[d_index], palette[k]);
  84.267 +
  84.268 +                     if (d < min_d)
  84.269 +                     {
  84.270 +                        min_d = d;
  84.271 +                        min_k = k;
  84.272 +                     }
  84.273 +                  }
  84.274 +                  /* point to closest color */
  84.275 +                  png_ptr->dither_index[i] = (png_byte)min_k;
  84.276 +               }
  84.277 +            }
  84.278 +         }
  84.279 +         png_free(png_ptr, png_ptr->dither_sort);
  84.280 +         png_ptr->dither_sort = NULL;
  84.281 +      }
  84.282 +      else
  84.283 +      {
  84.284 +         /* This is much harder to do simply (and quickly).  Perhaps
  84.285 +            we need to go through a median cut routine, but those
  84.286 +            don't always behave themselves with only a few colors
  84.287 +            as input.  So we will just find the closest two colors,
  84.288 +            and throw out one of them (chosen somewhat randomly).
  84.289 +            [We don't understand this at all, so if someone wants to
  84.290 +             work on improving it, be our guest - AED, GRP]
  84.291 +            */
  84.292 +         int i;
  84.293 +         int max_d;
  84.294 +         int num_new_palette;
  84.295 +         png_dsortp t;
  84.296 +         png_dsortpp hash;
  84.297 +
  84.298 +         t = NULL;
  84.299 +
  84.300 +         /* initialize palette index arrays */
  84.301 +         png_ptr->index_to_palette = (png_bytep)png_malloc(png_ptr,
  84.302 +            (png_uint_32)(num_palette * png_sizeof(png_byte)));
  84.303 +         png_ptr->palette_to_index = (png_bytep)png_malloc(png_ptr,
  84.304 +            (png_uint_32)(num_palette * png_sizeof(png_byte)));
  84.305 +
  84.306 +         /* initialize the sort array */
  84.307 +         for (i = 0; i < num_palette; i++)
  84.308 +         {
  84.309 +            png_ptr->index_to_palette[i] = (png_byte)i;
  84.310 +            png_ptr->palette_to_index[i] = (png_byte)i;
  84.311 +         }
  84.312 +
  84.313 +         hash = (png_dsortpp)png_malloc(png_ptr, (png_uint_32)(769 *
  84.314 +            png_sizeof(png_dsortp)));
  84.315 +         for (i = 0; i < 769; i++)
  84.316 +            hash[i] = NULL;
  84.317 +/*         png_memset(hash, 0, 769 * png_sizeof(png_dsortp)); */
  84.318 +
  84.319 +         num_new_palette = num_palette;
  84.320 +
  84.321 +         /* initial wild guess at how far apart the farthest pixel
  84.322 +            pair we will be eliminating will be.  Larger
  84.323 +            numbers mean more areas will be allocated, Smaller
  84.324 +            numbers run the risk of not saving enough data, and
  84.325 +            having to do this all over again.
  84.326 +
  84.327 +            I have not done extensive checking on this number.
  84.328 +            */
  84.329 +         max_d = 96;
  84.330 +
  84.331 +         while (num_new_palette > maximum_colors)
  84.332 +         {
  84.333 +            for (i = 0; i < num_new_palette - 1; i++)
  84.334 +            {
  84.335 +               int j;
  84.336 +
  84.337 +               for (j = i + 1; j < num_new_palette; j++)
  84.338 +               {
  84.339 +                  int d;
  84.340 +
  84.341 +                  d = PNG_COLOR_DIST(palette[i], palette[j]);
  84.342 +
  84.343 +                  if (d <= max_d)
  84.344 +                  {
  84.345 +
  84.346 +                     t = (png_dsortp)png_malloc_warn(png_ptr,
  84.347 +                         (png_uint_32)(png_sizeof(png_dsort)));
  84.348 +                     if (t == NULL)
  84.349 +                         break;
  84.350 +                     t->next = hash[d];
  84.351 +                     t->left = (png_byte)i;
  84.352 +                     t->right = (png_byte)j;
  84.353 +                     hash[d] = t;
  84.354 +                  }
  84.355 +               }
  84.356 +               if (t == NULL)
  84.357 +                  break;
  84.358 +            }
  84.359 +
  84.360 +            if (t != NULL)
  84.361 +            for (i = 0; i <= max_d; i++)
  84.362 +            {
  84.363 +               if (hash[i] != NULL)
  84.364 +               {
  84.365 +                  png_dsortp p;
  84.366 +
  84.367 +                  for (p = hash[i]; p; p = p->next)
  84.368 +                  {
  84.369 +                     if ((int)png_ptr->index_to_palette[p->left]
  84.370 +                        < num_new_palette &&
  84.371 +                        (int)png_ptr->index_to_palette[p->right]
  84.372 +                        < num_new_palette)
  84.373 +                     {
  84.374 +                        int j, next_j;
  84.375 +
  84.376 +                        if (num_new_palette & 0x01)
  84.377 +                        {
  84.378 +                           j = p->left;
  84.379 +                           next_j = p->right;
  84.380 +                        }
  84.381 +                        else
  84.382 +                        {
  84.383 +                           j = p->right;
  84.384 +                           next_j = p->left;
  84.385 +                        }
  84.386 +
  84.387 +                        num_new_palette--;
  84.388 +                        palette[png_ptr->index_to_palette[j]]
  84.389 +                          = palette[num_new_palette];
  84.390 +                        if (!full_dither)
  84.391 +                        {
  84.392 +                           int k;
  84.393 +
  84.394 +                           for (k = 0; k < num_palette; k++)
  84.395 +                           {
  84.396 +                              if (png_ptr->dither_index[k] ==
  84.397 +                                 png_ptr->index_to_palette[j])
  84.398 +                                 png_ptr->dither_index[k] =
  84.399 +                                    png_ptr->index_to_palette[next_j];
  84.400 +                              if ((int)png_ptr->dither_index[k] ==
  84.401 +                                 num_new_palette)
  84.402 +                                 png_ptr->dither_index[k] =
  84.403 +                                    png_ptr->index_to_palette[j];
  84.404 +                           }
  84.405 +                        }
  84.406 +
  84.407 +                        png_ptr->index_to_palette[png_ptr->palette_to_index
  84.408 +                           [num_new_palette]] = png_ptr->index_to_palette[j];
  84.409 +                        png_ptr->palette_to_index[png_ptr->index_to_palette[j]]
  84.410 +                           = png_ptr->palette_to_index[num_new_palette];
  84.411 +
  84.412 +                        png_ptr->index_to_palette[j] = (png_byte)num_new_palette;
  84.413 +                        png_ptr->palette_to_index[num_new_palette] = (png_byte)j;
  84.414 +                     }
  84.415 +                     if (num_new_palette <= maximum_colors)
  84.416 +                        break;
  84.417 +                  }
  84.418 +                  if (num_new_palette <= maximum_colors)
  84.419 +                     break;
  84.420 +               }
  84.421 +            }
  84.422 +
  84.423 +            for (i = 0; i < 769; i++)
  84.424 +            {
  84.425 +               if (hash[i] != NULL)
  84.426 +               {
  84.427 +                  png_dsortp p = hash[i];
  84.428 +                  while (p)
  84.429 +                  {
  84.430 +                     t = p->next;
  84.431 +                     png_free(png_ptr, p);
  84.432 +                     p = t;
  84.433 +                  }
  84.434 +               }
  84.435 +               hash[i] = 0;
  84.436 +            }
  84.437 +            max_d += 96;
  84.438 +         }
  84.439 +         png_free(png_ptr, hash);
  84.440 +         png_free(png_ptr, png_ptr->palette_to_index);
  84.441 +         png_free(png_ptr, png_ptr->index_to_palette);
  84.442 +         png_ptr->palette_to_index = NULL;
  84.443 +         png_ptr->index_to_palette = NULL;
  84.444 +      }
  84.445 +      num_palette = maximum_colors;
  84.446 +   }
  84.447 +   if (png_ptr->palette == NULL)
  84.448 +   {
  84.449 +      png_ptr->palette = palette;
  84.450 +   }
  84.451 +   png_ptr->num_palette = (png_uint_16)num_palette;
  84.452 +
  84.453 +   if (full_dither)
  84.454 +   {
  84.455 +      int i;
  84.456 +      png_bytep distance;
  84.457 +      int total_bits = PNG_DITHER_RED_BITS + PNG_DITHER_GREEN_BITS +
  84.458 +         PNG_DITHER_BLUE_BITS;
  84.459 +      int num_red = (1 << PNG_DITHER_RED_BITS);
  84.460 +      int num_green = (1 << PNG_DITHER_GREEN_BITS);
  84.461 +      int num_blue = (1 << PNG_DITHER_BLUE_BITS);
  84.462 +      png_size_t num_entries = ((png_size_t)1 << total_bits);
  84.463 +
  84.464 +      png_ptr->palette_lookup = (png_bytep )png_malloc(png_ptr,
  84.465 +         (png_uint_32)(num_entries * png_sizeof(png_byte)));
  84.466 +
  84.467 +      png_memset(png_ptr->palette_lookup, 0, num_entries *
  84.468 +         png_sizeof(png_byte));
  84.469 +
  84.470 +      distance = (png_bytep)png_malloc(png_ptr, (png_uint_32)(num_entries *
  84.471 +         png_sizeof(png_byte)));
  84.472 +
  84.473 +      png_memset(distance, 0xff, num_entries * png_sizeof(png_byte));
  84.474 +
  84.475 +      for (i = 0; i < num_palette; i++)
  84.476 +      {
  84.477 +         int ir, ig, ib;
  84.478 +         int r = (palette[i].red >> (8 - PNG_DITHER_RED_BITS));
  84.479 +         int g = (palette[i].green >> (8 - PNG_DITHER_GREEN_BITS));
  84.480 +         int b = (palette[i].blue >> (8 - PNG_DITHER_BLUE_BITS));
  84.481 +
  84.482 +         for (ir = 0; ir < num_red; ir++)
  84.483 +         {
  84.484 +            /* int dr = abs(ir - r); */
  84.485 +            int dr = ((ir > r) ? ir - r : r - ir);
  84.486 +            int index_r = (ir << (PNG_DITHER_BLUE_BITS + PNG_DITHER_GREEN_BITS));
  84.487 +
  84.488 +            for (ig = 0; ig < num_green; ig++)
  84.489 +            {
  84.490 +               /* int dg = abs(ig - g); */
  84.491 +               int dg = ((ig > g) ? ig - g : g - ig);
  84.492 +               int dt = dr + dg;
  84.493 +               int dm = ((dr > dg) ? dr : dg);
  84.494 +               int index_g = index_r | (ig << PNG_DITHER_BLUE_BITS);
  84.495 +
  84.496 +               for (ib = 0; ib < num_blue; ib++)
  84.497 +               {
  84.498 +                  int d_index = index_g | ib;
  84.499 +                  /* int db = abs(ib - b); */
  84.500 +                  int db = ((ib > b) ? ib - b : b - ib);
  84.501 +                  int dmax = ((dm > db) ? dm : db);
  84.502 +                  int d = dmax + dt + db;
  84.503 +
  84.504 +                  if (d < (int)distance[d_index])
  84.505 +                  {
  84.506 +                     distance[d_index] = (png_byte)d;
  84.507 +                     png_ptr->palette_lookup[d_index] = (png_byte)i;
  84.508 +                  }
  84.509 +               }
  84.510 +            }
  84.511 +         }
  84.512 +      }
  84.513 +
  84.514 +      png_free(png_ptr, distance);
  84.515 +   }
  84.516 +}
  84.517 +#endif
  84.518 +
  84.519 +#if defined(PNG_READ_GAMMA_SUPPORTED) && defined(PNG_FLOATING_POINT_SUPPORTED)
  84.520 +/* Transform the image from the file_gamma to the screen_gamma.  We
  84.521 + * only do transformations on images where the file_gamma and screen_gamma
  84.522 + * are not close reciprocals, otherwise it slows things down slightly, and
  84.523 + * also needlessly introduces small errors.
  84.524 + *
  84.525 + * We will turn off gamma transformation later if no semitransparent entries
  84.526 + * are present in the tRNS array for palette images.  We can't do it here
  84.527 + * because we don't necessarily have the tRNS chunk yet.
  84.528 + */
  84.529 +void PNGAPI
  84.530 +png_set_gamma(png_structp png_ptr, double scrn_gamma, double file_gamma)
  84.531 +{
  84.532 +   png_debug(1, "in png_set_gamma\n");
  84.533 +   if (png_ptr == NULL) return;
  84.534 +   if ((fabs(scrn_gamma * file_gamma - 1.0) > PNG_GAMMA_THRESHOLD) ||
  84.535 +       (png_ptr->color_type & PNG_COLOR_MASK_ALPHA) ||
  84.536 +       (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE))
  84.537 +     png_ptr->transformations |= PNG_GAMMA;
  84.538 +   png_ptr->gamma = (float)file_gamma;
  84.539 +   png_ptr->screen_gamma = (float)scrn_gamma;
  84.540 +}
  84.541 +#endif
  84.542 +
  84.543 +#if defined(PNG_READ_EXPAND_SUPPORTED)
  84.544 +/* Expand paletted images to RGB, expand grayscale images of
  84.545 + * less than 8-bit depth to 8-bit depth, and expand tRNS chunks
  84.546 + * to alpha channels.
  84.547 + */
  84.548 +void PNGAPI
  84.549 +png_set_expand(png_structp png_ptr)
  84.550 +{
  84.551 +   png_debug(1, "in png_set_expand\n");
  84.552 +   if (png_ptr == NULL) return;
  84.553 +   png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS);
  84.554 +   png_ptr->flags &= ~PNG_FLAG_ROW_INIT;
  84.555 +}
  84.556 +
  84.557 +/* GRR 19990627:  the following three functions currently are identical
  84.558 + *  to png_set_expand().  However, it is entirely reasonable that someone
  84.559 + *  might wish to expand an indexed image to RGB but *not* expand a single,
  84.560 + *  fully transparent palette entry to a full alpha channel--perhaps instead
  84.561 + *  convert tRNS to the grayscale/RGB format (16-bit RGB value), or replace
  84.562 + *  the transparent color with a particular RGB value, or drop tRNS entirely.
  84.563 + *  IOW, a future version of the library may make the transformations flag
  84.564 + *  a bit more fine-grained, with separate bits for each of these three
  84.565 + *  functions.
  84.566 + *
  84.567 + *  More to the point, these functions make it obvious what libpng will be
  84.568 + *  doing, whereas "expand" can (and does) mean any number of things.
  84.569 + *
  84.570 + *  GRP 20060307: In libpng-1.4.0, png_set_gray_1_2_4_to_8() was modified
  84.571 + *  to expand only the sample depth but not to expand the tRNS to alpha.
  84.572 + */
  84.573 +
  84.574 +/* Expand paletted images to RGB. */
  84.575 +void PNGAPI
  84.576 +png_set_palette_to_rgb(png_structp png_ptr)
  84.577 +{
  84.578 +   png_debug(1, "in png_set_palette_to_rgb\n");
  84.579 +   if (png_ptr == NULL) return;
  84.580 +   png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS);
  84.581 +   png_ptr->flags &= ~PNG_FLAG_ROW_INIT;
  84.582 +}
  84.583 +
  84.584 +#if !defined(PNG_1_0_X)
  84.585 +/* Expand grayscale images of less than 8-bit depth to 8 bits. */
  84.586 +void PNGAPI
  84.587 +png_set_expand_gray_1_2_4_to_8(png_structp png_ptr)
  84.588 +{
  84.589 +   png_debug(1, "in png_set_expand_gray_1_2_4_to_8\n");
  84.590 +   if (png_ptr == NULL) return;
  84.591 +   png_ptr->transformations |= PNG_EXPAND;
  84.592 +   png_ptr->flags &= ~PNG_FLAG_ROW_INIT;
  84.593 +}
  84.594 +#endif
  84.595 +
  84.596 +#if defined(PNG_1_0_X) || defined(PNG_1_2_X)
  84.597 +/* Expand grayscale images of less than 8-bit depth to 8 bits. */
  84.598 +/* Deprecated as of libpng-1.2.9 */
  84.599 +void PNGAPI
  84.600 +png_set_gray_1_2_4_to_8(png_structp png_ptr)
  84.601 +{
  84.602 +   png_debug(1, "in png_set_gray_1_2_4_to_8\n");
  84.603 +   if (png_ptr == NULL) return;
  84.604 +   png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS);
  84.605 +}
  84.606 +#endif
  84.607 +
  84.608 +
  84.609 +/* Expand tRNS chunks to alpha channels. */
  84.610 +void PNGAPI
  84.611 +png_set_tRNS_to_alpha(png_structp png_ptr)
  84.612 +{
  84.613 +   png_debug(1, "in png_set_tRNS_to_alpha\n");
  84.614 +   png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS);
  84.615 +   png_ptr->flags &= ~PNG_FLAG_ROW_INIT;
  84.616 +}
  84.617 +#endif /* defined(PNG_READ_EXPAND_SUPPORTED) */
  84.618 +
  84.619 +#if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED)
  84.620 +void PNGAPI
  84.621 +png_set_gray_to_rgb(png_structp png_ptr)
  84.622 +{
  84.623 +   png_debug(1, "in png_set_gray_to_rgb\n");
  84.624 +   png_ptr->transformations |= PNG_GRAY_TO_RGB;
  84.625 +   png_ptr->flags &= ~PNG_FLAG_ROW_INIT;
  84.626 +}
  84.627 +#endif
  84.628 +
  84.629 +#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED)
  84.630 +#if defined(PNG_FLOATING_POINT_SUPPORTED)
  84.631 +/* Convert a RGB image to a grayscale of the same width.  This allows us,
  84.632 + * for example, to convert a 24 bpp RGB image into an 8 bpp grayscale image.
  84.633 + */
  84.634 +
  84.635 +void PNGAPI
  84.636 +png_set_rgb_to_gray(png_structp png_ptr, int error_action, double red,
  84.637 +   double green)
  84.638 +{
  84.639 +      int red_fixed = (int)((float)red*100000.0 + 0.5);
  84.640 +      int green_fixed = (int)((float)green*100000.0 + 0.5);
  84.641 +      if (png_ptr == NULL) return;
  84.642 +      png_set_rgb_to_gray_fixed(png_ptr, error_action, red_fixed, green_fixed);
  84.643 +}
  84.644 +#endif
  84.645 +
  84.646 +void PNGAPI
  84.647 +png_set_rgb_to_gray_fixed(png_structp png_ptr, int error_action,
  84.648 +   png_fixed_point red, png_fixed_point green)
  84.649 +{
  84.650 +   png_debug(1, "in png_set_rgb_to_gray\n");
  84.651 +   if (png_ptr == NULL) return;
  84.652 +   switch(error_action)
  84.653 +   {
  84.654 +      case 1: png_ptr->transformations |= PNG_RGB_TO_GRAY;
  84.655 +              break;
  84.656 +      case 2: png_ptr->transformations |= PNG_RGB_TO_GRAY_WARN;
  84.657 +              break;
  84.658 +      case 3: png_ptr->transformations |= PNG_RGB_TO_GRAY_ERR;
  84.659 +   }
  84.660 +   if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
  84.661 +#if defined(PNG_READ_EXPAND_SUPPORTED)
  84.662 +      png_ptr->transformations |= PNG_EXPAND;
  84.663 +#else
  84.664 +   {
  84.665 +      png_warning(png_ptr,
  84.666 +        "Cannot do RGB_TO_GRAY without EXPAND_SUPPORTED.");
  84.667 +      png_ptr->transformations &= ~PNG_RGB_TO_GRAY;
  84.668 +   }
  84.669 +#endif
  84.670 +   {
  84.671 +      png_uint_16 red_int, green_int;
  84.672 +      if (red < 0 || green < 0)
  84.673 +      {
  84.674 +         red_int   =  6968; /* .212671 * 32768 + .5 */
  84.675 +         green_int = 23434; /* .715160 * 32768 + .5 */
  84.676 +      }
  84.677 +      else if (red + green < 100000L)
  84.678 +      {
  84.679 +        red_int = (png_uint_16)(((png_uint_32)red*32768L)/100000L);
  84.680 +        green_int = (png_uint_16)(((png_uint_32)green*32768L)/100000L);
  84.681 +      }
  84.682 +      else
  84.683 +      {
  84.684 +         png_warning(png_ptr, "ignoring out of range rgb_to_gray coefficients");
  84.685 +         red_int   =  6968;
  84.686 +         green_int = 23434;
  84.687 +      }
  84.688 +      png_ptr->rgb_to_gray_red_coeff   = red_int;
  84.689 +      png_ptr->rgb_to_gray_green_coeff = green_int;
  84.690 +      png_ptr->rgb_to_gray_blue_coeff  = 
  84.691 +         (png_uint_16)(32768 - red_int - green_int);
  84.692 +   }
  84.693 +}
  84.694 +#endif
  84.695 +
  84.696 +#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \
  84.697 +    defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) || \
  84.698 +    defined(PNG_LEGACY_SUPPORTED)
  84.699 +void PNGAPI
  84.700 +png_set_read_user_transform_fn(png_structp png_ptr, png_user_transform_ptr
  84.701 +   read_user_transform_fn)
  84.702 +{
  84.703 +   png_debug(1, "in png_set_read_user_transform_fn\n");
  84.704 +   if (png_ptr == NULL) return;
  84.705 +#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED)
  84.706 +   png_ptr->transformations |= PNG_USER_TRANSFORM;
  84.707 +   png_ptr->read_user_transform_fn = read_user_transform_fn;
  84.708 +#endif
  84.709 +#ifdef PNG_LEGACY_SUPPORTED
  84.710 +   if (read_user_transform_fn)
  84.711 +      png_warning(png_ptr,
  84.712 +        "This version of libpng does not support user transforms");
  84.713 +#endif
  84.714 +}
  84.715 +#endif
  84.716 +
  84.717 +/* Initialize everything needed for the read.  This includes modifying
  84.718 + * the palette.
  84.719 + */
  84.720 +void /* PRIVATE */
  84.721 +png_init_read_transformations(png_structp png_ptr)
  84.722 +{
  84.723 +   png_debug(1, "in png_init_read_transformations\n");
  84.724 +#if defined(PNG_USELESS_TESTS_SUPPORTED)
  84.725 +   if (png_ptr != NULL)
  84.726 +#endif
  84.727 +  {
  84.728 +#if defined(PNG_READ_BACKGROUND_SUPPORTED) || defined(PNG_READ_SHIFT_SUPPORTED) \
  84.729 + || defined(PNG_READ_GAMMA_SUPPORTED)
  84.730 +   int color_type = png_ptr->color_type;
  84.731 +#endif
  84.732 +
  84.733 +#if defined(PNG_READ_EXPAND_SUPPORTED) && defined(PNG_READ_BACKGROUND_SUPPORTED)
  84.734 +
  84.735 +#if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED)
  84.736 +   /* Detect gray background and attempt to enable optimization
  84.737 +    * for gray --> RGB case */
  84.738 +   /* Note:  if PNG_BACKGROUND_EXPAND is set and color_type is either RGB or
  84.739 +    * RGB_ALPHA (in which case need_expand is superfluous anyway), the
  84.740 +    * background color might actually be gray yet not be flagged as such.
  84.741 +    * This is not a problem for the current code, which uses
  84.742 +    * PNG_BACKGROUND_IS_GRAY only to decide when to do the
  84.743 +    * png_do_gray_to_rgb() transformation.
  84.744 +    */
  84.745 +   if ((png_ptr->transformations & PNG_BACKGROUND_EXPAND) &&
  84.746 +       !(color_type & PNG_COLOR_MASK_COLOR))
  84.747 +   {
  84.748 +          png_ptr->mode |= PNG_BACKGROUND_IS_GRAY;
  84.749 +   } else if ((png_ptr->transformations & PNG_BACKGROUND) &&
  84.750 +              !(png_ptr->transformations & PNG_BACKGROUND_EXPAND) &&
  84.751 +              (png_ptr->transformations & PNG_GRAY_TO_RGB) &&
  84.752 +              png_ptr->background.red == png_ptr->background.green &&
  84.753 +              png_ptr->background.red == png_ptr->background.blue)
  84.754 +   {
  84.755 +          png_ptr->mode |= PNG_BACKGROUND_IS_GRAY;
  84.756 +          png_ptr->background.gray = png_ptr->background.red;
  84.757 +   }
  84.758 +#endif
  84.759 +
  84.760 +   if ((png_ptr->transformations & PNG_BACKGROUND_EXPAND) &&
  84.761 +       (png_ptr->transformations & PNG_EXPAND))
  84.762 +   {
  84.763 +      if (!(color_type & PNG_COLOR_MASK_COLOR))  /* i.e., GRAY or GRAY_ALPHA */
  84.764 +      {
  84.765 +         /* expand background and tRNS chunks */
  84.766 +         switch (png_ptr->bit_depth)
  84.767 +         {
  84.768 +            case 1:
  84.769 +               png_ptr->background.gray *= (png_uint_16)0xff;
  84.770 +               png_ptr->background.red = png_ptr->background.green
  84.771 +                 =  png_ptr->background.blue = png_ptr->background.gray;
  84.772 +               if (!(png_ptr->transformations & PNG_EXPAND_tRNS))
  84.773 +               {
  84.774 +                 png_ptr->trans_values.gray *= (png_uint_16)0xff;
  84.775 +                 png_ptr->trans_values.red = png_ptr->trans_values.green
  84.776 +                   = png_ptr->trans_values.blue = png_ptr->trans_values.gray;
  84.777 +               }
  84.778 +               break;
  84.779 +            case 2:
  84.780 +               png_ptr->background.gray *= (png_uint_16)0x55;
  84.781 +               png_ptr->background.red = png_ptr->background.green
  84.782 +                 = png_ptr->background.blue = png_ptr->background.gray;
  84.783 +               if (!(png_ptr->transformations & PNG_EXPAND_tRNS))
  84.784 +               {
  84.785 +                 png_ptr->trans_values.gray *= (png_uint_16)0x55;
  84.786 +                 png_ptr->trans_values.red = png_ptr->trans_values.green
  84.787 +                   = png_ptr->trans_values.blue = png_ptr->trans_values.gray;
  84.788 +               }
  84.789 +               break;
  84.790 +            case 4:
  84.791 +               png_ptr->background.gray *= (png_uint_16)0x11;
  84.792 +               png_ptr->background.red = png_ptr->background.green
  84.793 +                 = png_ptr->background.blue = png_ptr->background.gray;
  84.794 +               if (!(png_ptr->transformations & PNG_EXPAND_tRNS))
  84.795 +               {
  84.796 +                 png_ptr->trans_values.gray *= (png_uint_16)0x11;
  84.797 +                 png_ptr->trans_values.red = png_ptr->trans_values.green
  84.798 +                   = png_ptr->trans_values.blue = png_ptr->trans_values.gray;
  84.799 +               }
  84.800 +               break;
  84.801 +            case 8:
  84.802 +            case 16:
  84.803 +               png_ptr->background.red = png_ptr->background.green
  84.804 +                 = png_ptr->background.blue = png_ptr->background.gray;
  84.805 +               break;
  84.806 +         }
  84.807 +      }
  84.808 +      else if (color_type == PNG_COLOR_TYPE_PALETTE)
  84.809 +      {
  84.810 +         png_ptr->background.red   =
  84.811 +            png_ptr->palette[png_ptr->background.index].red;
  84.812 +         png_ptr->background.green =
  84.813 +            png_ptr->palette[png_ptr->background.index].green;
  84.814 +         png_ptr->background.blue  =
  84.815 +            png_ptr->palette[png_ptr->background.index].blue;
  84.816 +
  84.817 +#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED)
  84.818 +        if (png_ptr->transformations & PNG_INVERT_ALPHA)
  84.819 +        {
  84.820 +#if defined(PNG_READ_EXPAND_SUPPORTED)
  84.821 +           if (!(png_ptr->transformations & PNG_EXPAND_tRNS))
  84.822 +#endif
  84.823 +           {
  84.824 +           /* invert the alpha channel (in tRNS) unless the pixels are
  84.825 +              going to be expanded, in which case leave it for later */
  84.826 +              int i, istop;
  84.827 +              istop=(int)png_ptr->num_trans;
  84.828 +              for (i=0; i<istop; i++)
  84.829 +                 png_ptr->trans[i] = (png_byte)(255 - png_ptr->trans[i]);
  84.830 +           }
  84.831 +        }
  84.832 +#endif
  84.833 +
  84.834 +      }
  84.835 +   }
  84.836 +#endif
  84.837 +
  84.838 +#if defined(PNG_READ_BACKGROUND_SUPPORTED) && defined(PNG_READ_GAMMA_SUPPORTED)
  84.839 +   png_ptr->background_1 = png_ptr->background;
  84.840 +#endif
  84.841 +#if defined(PNG_READ_GAMMA_SUPPORTED) && defined(PNG_FLOATING_POINT_SUPPORTED)
  84.842 +
  84.843 +   if ((color_type == PNG_COLOR_TYPE_PALETTE && png_ptr->num_trans != 0)
  84.844 +       && (fabs(png_ptr->screen_gamma * png_ptr->gamma - 1.0)
  84.845 +         < PNG_GAMMA_THRESHOLD))
  84.846 +   {
  84.847 +    int i, k;
  84.848 +    k=0;
  84.849 +    for (i=0; i<png_ptr->num_trans; i++)
  84.850 +    {
  84.851 +      if (png_ptr->trans[i] != 0 && png_ptr->trans[i] != 0xff)
  84.852 +        k=1; /* partial transparency is present */
  84.853 +    }
  84.854 +    if (k == 0)
  84.855 +      png_ptr->transformations &= ~PNG_GAMMA;
  84.856 +   }
  84.857 +
  84.858 +   if ((png_ptr->transformations & (PNG_GAMMA | PNG_RGB_TO_GRAY)) &&
  84.859 +        png_ptr->gamma != 0.0)
  84.860 +   {
  84.861 +      png_build_gamma_table(png_ptr);
  84.862 +#if defined(PNG_READ_BACKGROUND_SUPPORTED)
  84.863 +      if (png_ptr->transformations & PNG_BACKGROUND)
  84.864 +      {
  84.865 +         if (color_type == PNG_COLOR_TYPE_PALETTE)
  84.866 +         {
  84.867 +           /* could skip if no transparency and
  84.868 +           */
  84.869 +            png_color back, back_1;
  84.870 +            png_colorp palette = png_ptr->palette;
  84.871 +            int num_palette = png_ptr->num_palette;
  84.872 +            int i;
  84.873 +            if (png_ptr->background_gamma_type == PNG_BACKGROUND_GAMMA_FILE)
  84.874 +            {
  84.875 +               back.red = png_ptr->gamma_table[png_ptr->background.red];
  84.876 +               back.green = png_ptr->gamma_table[png_ptr->background.green];
  84.877 +               back.blue = png_ptr->gamma_table[png_ptr->background.blue];
  84.878 +
  84.879 +               back_1.red = png_ptr->gamma_to_1[png_ptr->background.red];
  84.880 +               back_1.green = png_ptr->gamma_to_1[png_ptr->background.green];
  84.881 +               back_1.blue = png_ptr->gamma_to_1[png_ptr->background.blue];
  84.882 +            }
  84.883 +            else
  84.884 +            {
  84.885 +               double g, gs;
  84.886 +
  84.887 +               switch (png_ptr->background_gamma_type)
  84.888 +               {
  84.889 +                  case PNG_BACKGROUND_GAMMA_SCREEN:
  84.890 +                     g = (png_ptr->screen_gamma);
  84.891 +                     gs = 1.0;
  84.892 +                     break;
  84.893 +                  case PNG_BACKGROUND_GAMMA_FILE:
  84.894 +                     g = 1.0 / (png_ptr->gamma);
  84.895 +                     gs = 1.0 / (png_ptr->gamma * png_ptr->screen_gamma);
  84.896 +                     break;
  84.897 +                  case PNG_BACKGROUND_GAMMA_UNIQUE:
  84.898 +                     g = 1.0 / (png_ptr->background_gamma);
  84.899 +                     gs = 1.0 / (png_ptr->background_gamma *
  84.900 +                                 png_ptr->screen_gamma);
  84.901 +                     break;
  84.902 +                  default:
  84.903 +                     g = 1.0;    /* back_1 */
  84.904 +                     gs = 1.0;   /* back */
  84.905 +               }
  84.906 +
  84.907 +               if ( fabs(gs - 1.0) < PNG_GAMMA_THRESHOLD)
  84.908 +               {
  84.909 +                  back.red   = (png_byte)png_ptr->background.red;
  84.910 +                  back.green = (png_byte)png_ptr->background.green;
  84.911 +                  back.blue  = (png_byte)png_ptr->background.blue;
  84.912 +               }
  84.913 +               else
  84.914 +               {
  84.915 +                  back.red = (png_byte)(pow(
  84.916 +                     (double)png_ptr->background.red/255, gs) * 255.0 + .5);
  84.917 +                  back.green = (png_byte)(pow(
  84.918 +                     (double)png_ptr->background.green/255, gs) * 255.0 + .5);
  84.919 +                  back.blue = (png_byte)(pow(
  84.920 +                     (double)png_ptr->background.blue/255, gs) * 255.0 + .5);
  84.921 +               }
  84.922 +
  84.923 +               back_1.red = (png_byte)(pow(
  84.924 +                  (double)png_ptr->background.red/255, g) * 255.0 + .5);
  84.925 +               back_1.green = (png_byte)(pow(
  84.926 +                  (double)png_ptr->background.green/255, g) * 255.0 + .5);
  84.927 +               back_1.blue = (png_byte)(pow(
  84.928 +                  (double)png_ptr->background.blue/255, g) * 255.0 + .5);
  84.929 +            }
  84.930 +            for (i = 0; i < num_palette; i++)
  84.931 +            {
  84.932 +               if (i < (int)png_ptr->num_trans && png_ptr->trans[i] != 0xff)
  84.933 +               {
  84.934 +                  if (png_ptr->trans[i] == 0)
  84.935 +                  {
  84.936 +                     palette[i] = back;
  84.937 +                  }
  84.938 +                  else /* if (png_ptr->trans[i] != 0xff) */
  84.939 +                  {
  84.940 +                     png_byte v, w;
  84.941 +
  84.942 +                     v = png_ptr->gamma_to_1[palette[i].red];
  84.943 +                     png_composite(w, v, png_ptr->trans[i], back_1.red);
  84.944 +                     palette[i].red = png_ptr->gamma_from_1[w];
  84.945 +
  84.946 +                     v = png_ptr->gamma_to_1[palette[i].green];
  84.947 +                     png_composite(w, v, png_ptr->trans[i], back_1.green);
  84.948 +                     palette[i].green = png_ptr->gamma_from_1[w];
  84.949 +
  84.950 +                     v = png_ptr->gamma_to_1[palette[i].blue];
  84.951 +                     png_composite(w, v, png_ptr->trans[i], back_1.blue);
  84.952 +                     palette[i].blue = png_ptr->gamma_from_1[w];
  84.953 +                  }
  84.954 +               }
  84.955 +               else
  84.956 +               {
  84.957 +                  palette[i].red = png_ptr->gamma_table[palette[i].red];
  84.958 +                  palette[i].green = png_ptr->gamma_table[palette[i].green];
  84.959 +                  palette[i].blue = png_ptr->gamma_table[palette[i].blue];
  84.960 +               }
  84.961 +            }
  84.962 +	    /* Prevent the transformations being done again, and make sure
  84.963 +	     * that the now spurious alpha channel is stripped - the code
  84.964 +	     * has just reduced background composition and gamma correction
  84.965 +	     * to a simple alpha channel strip.
  84.966 +	     */
  84.967 +	    png_ptr->transformations &= ~PNG_BACKGROUND;
  84.968 +	    png_ptr->transformations &= ~PNG_GAMMA;
  84.969 +	    png_ptr->transformations |= PNG_STRIP_ALPHA;
  84.970 +         }
  84.971 +         /* if (png_ptr->background_gamma_type!=PNG_BACKGROUND_GAMMA_UNKNOWN) */
  84.972 +         else
  84.973 +         /* color_type != PNG_COLOR_TYPE_PALETTE */
  84.974 +         {
  84.975 +            double m = (double)(((png_uint_32)1 << png_ptr->bit_depth) - 1);
  84.976 +            double g = 1.0;
  84.977 +            double gs = 1.0;
  84.978 +
  84.979 +            switch (png_ptr->background_gamma_type)
  84.980 +            {
  84.981 +               case PNG_BACKGROUND_GAMMA_SCREEN:
  84.982 +                  g = (png_ptr->screen_gamma);
  84.983 +                  gs = 1.0;
  84.984 +                  break;
  84.985 +               case PNG_BACKGROUND_GAMMA_FILE:
  84.986 +                  g = 1.0 / (png_ptr->gamma);
  84.987 +                  gs = 1.0 / (png_ptr->gamma * png_ptr->screen_gamma);
  84.988 +                  break;
  84.989 +               case PNG_BACKGROUND_GAMMA_UNIQUE:
  84.990 +                  g = 1.0 / (png_ptr->background_gamma);
  84.991 +                  gs = 1.0 / (png_ptr->background_gamma *
  84.992 +                     png_ptr->screen_gamma);
  84.993 +                  break;
  84.994 +            }
  84.995 +
  84.996 +            png_ptr->background_1.gray = (png_uint_16)(pow(
  84.997 +               (double)png_ptr->background.gray / m, g) * m + .5);
  84.998 +            png_ptr->background.gray = (png_uint_16)(pow(
  84.999 +               (double)png_ptr->background.gray / m, gs) * m + .5);
 84.1000 +
 84.1001 +            if ((png_ptr->background.red != png_ptr->background.green) ||
 84.1002 +                (png_ptr->background.red != png_ptr->background.blue) ||
 84.1003 +                (png_ptr->background.red != png_ptr->background.gray))
 84.1004 +            {
 84.1005 +               /* RGB or RGBA with color background */
 84.1006 +               png_ptr->background_1.red = (png_uint_16)(pow(
 84.1007 +                  (double)png_ptr->background.red / m, g) * m + .5);
 84.1008 +               png_ptr->background_1.green = (png_uint_16)(pow(
 84.1009 +                  (double)png_ptr->background.green / m, g) * m + .5);
 84.1010 +               png_ptr->background_1.blue = (png_uint_16)(pow(
 84.1011 +                  (double)png_ptr->background.blue / m, g) * m + .5);
 84.1012 +               png_ptr->background.red = (png_uint_16)(pow(
 84.1013 +                  (double)png_ptr->background.red / m, gs) * m + .5);
 84.1014 +               png_ptr->background.green = (png_uint_16)(pow(
 84.1015 +                  (double)png_ptr->background.green / m, gs) * m + .5);
 84.1016 +               png_ptr->background.blue = (png_uint_16)(pow(
 84.1017 +                  (double)png_ptr->background.blue / m, gs) * m + .5);
 84.1018 +            }
 84.1019 +            else
 84.1020 +            {
 84.1021 +               /* GRAY, GRAY ALPHA, RGB, or RGBA with gray background */
 84.1022 +               png_ptr->background_1.red = png_ptr->background_1.green
 84.1023 +                 = png_ptr->background_1.blue = png_ptr->background_1.gray;
 84.1024 +               png_ptr->background.red = png_ptr->background.green
 84.1025 +                 = png_ptr->background.blue = png_ptr->background.gray;
 84.1026 +            }
 84.1027 +         }
 84.1028 +      }
 84.1029 +      else
 84.1030 +      /* transformation does not include PNG_BACKGROUND */
 84.1031 +#endif /* PNG_READ_BACKGROUND_SUPPORTED */
 84.1032 +      if (color_type == PNG_COLOR_TYPE_PALETTE)
 84.1033 +      {
 84.1034 +         png_colorp palette = png_ptr->palette;
 84.1035 +         int num_palette = png_ptr->num_palette;
 84.1036 +         int i;
 84.1037 +
 84.1038 +         for (i = 0; i < num_palette; i++)
 84.1039 +         {
 84.1040 +            palette[i].red = png_ptr->gamma_table[palette[i].red];
 84.1041 +            palette[i].green = png_ptr->gamma_table[palette[i].green];
 84.1042 +            palette[i].blue = png_ptr->gamma_table[palette[i].blue];
 84.1043 +         }
 84.1044 +
 84.1045 +	 /* Done the gamma correction. */
 84.1046 +	 png_ptr->transformations &= ~PNG_GAMMA;
 84.1047 +      }
 84.1048 +   }
 84.1049 +#if defined(PNG_READ_BACKGROUND_SUPPORTED)
 84.1050 +   else
 84.1051 +#endif
 84.1052 +#endif /* PNG_READ_GAMMA_SUPPORTED && PNG_FLOATING_POINT_SUPPORTED */
 84.1053 +#if defined(PNG_READ_BACKGROUND_SUPPORTED)
 84.1054 +   /* No GAMMA transformation */
 84.1055 +   if ((png_ptr->transformations & PNG_BACKGROUND) &&
 84.1056 +       (color_type == PNG_COLOR_TYPE_PALETTE))
 84.1057 +   {
 84.1058 +      int i;
 84.1059 +      int istop = (int)png_ptr->num_trans;
 84.1060 +      png_color back;
 84.1061 +      png_colorp palette = png_ptr->palette;
 84.1062 +
 84.1063 +      back.red   = (png_byte)png_ptr->background.red;
 84.1064 +      back.green = (png_byte)png_ptr->background.green;
 84.1065 +      back.blue  = (png_byte)png_ptr->background.blue;
 84.1066 +
 84.1067 +      for (i = 0; i < istop; i++)
 84.1068 +      {
 84.1069 +         if (png_ptr->trans[i] == 0)
 84.1070 +         {
 84.1071 +            palette[i] = back;
 84.1072 +         }
 84.1073 +         else if (png_ptr->trans[i] != 0xff)
 84.1074 +         {
 84.1075 +            /* The png_composite() macro is defined in png.h */
 84.1076 +            png_composite(palette[i].red, palette[i].red,
 84.1077 +               png_ptr->trans[i], back.red);
 84.1078 +            png_composite(palette[i].green, palette[i].green,
 84.1079 +               png_ptr->trans[i], back.green);
 84.1080 +            png_composite(palette[i].blue, palette[i].blue,
 84.1081 +               png_ptr->trans[i], back.blue);
 84.1082 +         }
 84.1083 +      }
 84.1084 +
 84.1085 +      /* Handled alpha, still need to strip the channel. */
 84.1086 +      png_ptr->transformations &= ~PNG_BACKGROUND;
 84.1087 +      png_ptr->transformations |= PNG_STRIP_ALPHA;
 84.1088 +   }
 84.1089 +#endif /* PNG_READ_BACKGROUND_SUPPORTED */
 84.1090 +
 84.1091 +#if defined(PNG_READ_SHIFT_SUPPORTED)
 84.1092 +   if ((png_ptr->transformations & PNG_SHIFT) &&
 84.1093 +      (color_type == PNG_COLOR_TYPE_PALETTE))
 84.1094 +   {
 84.1095 +      png_uint_16 i;
 84.1096 +      png_uint_16 istop = png_ptr->num_palette;
 84.1097 +      int sr = 8 - png_ptr->sig_bit.red;
 84.1098 +      int sg = 8 - png_ptr->sig_bit.green;
 84.1099 +      int sb = 8 - png_ptr->sig_bit.blue;
 84.1100 +
 84.1101 +      if (sr < 0 || sr > 8)
 84.1102 +         sr = 0;
 84.1103 +      if (sg < 0 || sg > 8)
 84.1104 +         sg = 0;
 84.1105 +      if (sb < 0 || sb > 8)
 84.1106 +         sb = 0;
 84.1107 +      for (i = 0; i < istop; i++)
 84.1108 +      {
 84.1109 +         png_ptr->palette[i].red >>= sr;
 84.1110 +         png_ptr->palette[i].green >>= sg;
 84.1111 +         png_ptr->palette[i].blue >>= sb;
 84.1112 +      }
 84.1113 +   }
 84.1114 +#endif  /* PNG_READ_SHIFT_SUPPORTED */
 84.1115 + }
 84.1116 +#if !defined(PNG_READ_GAMMA_SUPPORTED) && !defined(PNG_READ_SHIFT_SUPPORTED) \
 84.1117 + && !defined(PNG_READ_BACKGROUND_SUPPORTED)
 84.1118 +   if (png_ptr)
 84.1119 +      return;
 84.1120 +#endif
 84.1121 +}
 84.1122 +
 84.1123 +/* Modify the info structure to reflect the transformations.  The
 84.1124 + * info should be updated so a PNG file could be written with it,
 84.1125 + * assuming the transformations result in valid PNG data.
 84.1126 + */
 84.1127 +void /* PRIVATE */
 84.1128 +png_read_transform_info(png_structp png_ptr, png_infop info_ptr)
 84.1129 +{
 84.1130 +   png_debug(1, "in png_read_transform_info\n");
 84.1131 +#if defined(PNG_READ_EXPAND_SUPPORTED)
 84.1132 +   if (png_ptr->transformations & PNG_EXPAND)
 84.1133 +   {
 84.1134 +      if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
 84.1135 +      {
 84.1136 +         if (png_ptr->num_trans &&
 84.1137 +              (png_ptr->transformations & PNG_EXPAND_tRNS))
 84.1138 +            info_ptr->color_type = PNG_COLOR_TYPE_RGB_ALPHA;
 84.1139 +         else
 84.1140 +            info_ptr->color_type = PNG_COLOR_TYPE_RGB;
 84.1141 +         info_ptr->bit_depth = 8;
 84.1142 +         info_ptr->num_trans = 0;
 84.1143 +      }
 84.1144 +      else
 84.1145 +      {
 84.1146 +         if (png_ptr->num_trans)
 84.1147 +         {
 84.1148 +            if (png_ptr->transformations & PNG_EXPAND_tRNS)
 84.1149 +              info_ptr->color_type |= PNG_COLOR_MASK_ALPHA;
 84.1150 +#if 0 /* Removed from libpng-1.2.27 */
 84.1151 +            else
 84.1152 +              info_ptr->color_type |= PNG_COLOR_MASK_COLOR;
 84.1153 +#endif
 84.1154 +         }
 84.1155 +         if (info_ptr->bit_depth < 8)
 84.1156 +            info_ptr->bit_depth = 8;
 84.1157 +         info_ptr->num_trans = 0;
 84.1158 +      }
 84.1159 +   }
 84.1160 +#endif
 84.1161 +
 84.1162 +#if defined(PNG_READ_BACKGROUND_SUPPORTED)
 84.1163 +   if (png_ptr->transformations & PNG_BACKGROUND)
 84.1164 +   {
 84.1165 +      info_ptr->color_type &= ~PNG_COLOR_MASK_ALPHA;
 84.1166 +      info_ptr->num_trans = 0;
 84.1167 +      info_ptr->background = png_ptr->background;
 84.1168 +   }
 84.1169 +#endif
 84.1170 +
 84.1171 +#if defined(PNG_READ_GAMMA_SUPPORTED)
 84.1172 +   if (png_ptr->transformations & PNG_GAMMA)
 84.1173 +   {
 84.1174 +#ifdef PNG_FLOATING_POINT_SUPPORTED
 84.1175 +      info_ptr->gamma = png_ptr->gamma;
 84.1176 +#endif
 84.1177 +#ifdef PNG_FIXED_POINT_SUPPORTED
 84.1178 +      info_ptr->int_gamma = png_ptr->int_gamma;
 84.1179 +#endif
 84.1180 +   }
 84.1181 +#endif
 84.1182 +
 84.1183 +#if defined(PNG_READ_16_TO_8_SUPPORTED)
 84.1184 +   if ((png_ptr->transformations & PNG_16_TO_8) && (info_ptr->bit_depth == 16))
 84.1185 +      info_ptr->bit_depth = 8;
 84.1186 +#endif
 84.1187 +
 84.1188 +#if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED)
 84.1189 +   if (png_ptr->transformations & PNG_GRAY_TO_RGB)
 84.1190 +      info_ptr->color_type |= PNG_COLOR_MASK_COLOR;
 84.1191 +#endif
 84.1192 +
 84.1193 +#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED)
 84.1194 +   if (png_ptr->transformations & PNG_RGB_TO_GRAY)
 84.1195 +      info_ptr->color_type &= ~PNG_COLOR_MASK_COLOR;
 84.1196 +#endif
 84.1197 +
 84.1198 +#if defined(PNG_READ_DITHER_SUPPORTED)
 84.1199 +   if (png_ptr->transformations & PNG_DITHER)
 84.1200 +   {
 84.1201 +      if (((info_ptr->color_type == PNG_COLOR_TYPE_RGB) ||
 84.1202 +         (info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA)) &&
 84.1203 +         png_ptr->palette_lookup && info_ptr->bit_depth == 8)
 84.1204 +      {
 84.1205 +         info_ptr->color_type = PNG_COLOR_TYPE_PALETTE;
 84.1206 +      }
 84.1207 +   }
 84.1208 +#endif
 84.1209 +
 84.1210 +#if defined(PNG_READ_PACK_SUPPORTED)
 84.1211 +   if ((png_ptr->transformations & PNG_PACK) && (info_ptr->bit_depth < 8))
 84.1212 +      info_ptr->bit_depth = 8;
 84.1213 +#endif
 84.1214 +
 84.1215 +   if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
 84.1216 +      info_ptr->channels = 1;
 84.1217 +   else if (info_ptr->color_type & PNG_COLOR_MASK_COLOR)
 84.1218 +      info_ptr->channels = 3;
 84.1219 +   else
 84.1220 +      info_ptr->channels = 1;
 84.1221 +
 84.1222 +#if defined(PNG_READ_STRIP_ALPHA_SUPPORTED)
 84.1223 +   if (png_ptr->flags & PNG_FLAG_STRIP_ALPHA)
 84.1224 +      info_ptr->color_type &= ~PNG_COLOR_MASK_ALPHA;
 84.1225 +#endif
 84.1226 +
 84.1227 +   if (info_ptr->color_type & PNG_COLOR_MASK_ALPHA)
 84.1228 +      info_ptr->channels++;
 84.1229 +
 84.1230 +#if defined(PNG_READ_FILLER_SUPPORTED)
 84.1231 +   /* STRIP_ALPHA and FILLER allowed:  MASK_ALPHA bit stripped above */
 84.1232 +   if ((png_ptr->transformations & PNG_FILLER) &&
 84.1233 +       ((info_ptr->color_type == PNG_COLOR_TYPE_RGB) ||
 84.1234 +       (info_ptr->color_type == PNG_COLOR_TYPE_GRAY)))
 84.1235 +   {
 84.1236 +      info_ptr->channels++;
 84.1237 +      /* if adding a true alpha channel not just filler */
 84.1238 +#if !defined(PNG_1_0_X)
 84.1239 +      if (png_ptr->transformations & PNG_ADD_ALPHA)
 84.1240 +        info_ptr->color_type |= PNG_COLOR_MASK_ALPHA;
 84.1241 +#endif
 84.1242 +   }
 84.1243 +#endif
 84.1244 +
 84.1245 +#if defined(PNG_USER_TRANSFORM_PTR_SUPPORTED) && \
 84.1246 +defined(PNG_READ_USER_TRANSFORM_SUPPORTED)
 84.1247 +   if (png_ptr->transformations & PNG_USER_TRANSFORM)
 84.1248 +     {
 84.1249 +       if (info_ptr->bit_depth < png_ptr->user_transform_depth)
 84.1250 +         info_ptr->bit_depth = png_ptr->user_transform_depth;
 84.1251 +       if (info_ptr->channels < png_ptr->user_transform_channels)
 84.1252 +         info_ptr->channels = png_ptr->user_transform_channels;
 84.1253 +     }
 84.1254 +#endif
 84.1255 +
 84.1256 +   info_ptr->pixel_depth = (png_byte)(info_ptr->channels *
 84.1257 +      info_ptr->bit_depth);
 84.1258 +
 84.1259 +   info_ptr->rowbytes = PNG_ROWBYTES(info_ptr->pixel_depth, info_ptr->width);
 84.1260 +
 84.1261 +#if !defined(PNG_READ_EXPAND_SUPPORTED)
 84.1262 +   if (png_ptr)
 84.1263 +      return;
 84.1264 +#endif
 84.1265 +}
 84.1266 +
 84.1267 +/* Transform the row.  The order of transformations is significant,
 84.1268 + * and is very touchy.  If you add a transformation, take care to
 84.1269 + * decide how it fits in with the other transformations here.
 84.1270 + */
 84.1271 +void /* PRIVATE */
 84.1272 +png_do_read_transformations(png_structp png_ptr)
 84.1273 +{
 84.1274 +   png_debug(1, "in png_do_read_transformations\n");
 84.1275 +   if (png_ptr->row_buf == NULL)
 84.1276 +   {
 84.1277 +#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE)
 84.1278 +      char msg[50];
 84.1279 +
 84.1280 +      png_snprintf2(msg, 50,
 84.1281 +         "NULL row buffer for row %ld, pass %d", (long)png_ptr->row_number,
 84.1282 +         png_ptr->pass);
 84.1283 +      png_error(png_ptr, msg);
 84.1284 +#else
 84.1285 +      png_error(png_ptr, "NULL row buffer");
 84.1286 +#endif
 84.1287 +   }
 84.1288 +#ifdef PNG_WARN_UNINITIALIZED_ROW
 84.1289 +   if (!(png_ptr->flags & PNG_FLAG_ROW_INIT))
 84.1290 +      /* Application has failed to call either png_read_start_image()
 84.1291 +       * or png_read_update_info() after setting transforms that expand
 84.1292 +       * pixels.  This check added to libpng-1.2.19 */
 84.1293 +#if (PNG_WARN_UNINITIALIZED_ROW==1)
 84.1294 +      png_error(png_ptr, "Uninitialized row");
 84.1295 +#else
 84.1296 +      png_warning(png_ptr, "Uninitialized row");
 84.1297 +#endif
 84.1298 +#endif
 84.1299 +
 84.1300 +#if defined(PNG_READ_EXPAND_SUPPORTED)
 84.1301 +   if (png_ptr->transformations & PNG_EXPAND)
 84.1302 +   {
 84.1303 +      if (png_ptr->row_info.color_type == PNG_COLOR_TYPE_PALETTE)
 84.1304 +      {
 84.1305 +         png_do_expand_palette(&(png_ptr->row_info), png_ptr->row_buf + 1,
 84.1306 +            png_ptr->palette, png_ptr->trans, png_ptr->num_trans);
 84.1307 +      }
 84.1308 +      else
 84.1309 +      {
 84.1310 +         if (png_ptr->num_trans &&
 84.1311 +             (png_ptr->transformations & PNG_EXPAND_tRNS))
 84.1312 +            png_do_expand(&(png_ptr->row_info), png_ptr->row_buf + 1,
 84.1313 +               &(png_ptr->trans_values));
 84.1314 +         else
 84.1315 +            png_do_expand(&(png_ptr->row_info), png_ptr->row_buf + 1,
 84.1316 +               NULL);
 84.1317 +      }
 84.1318 +   }
 84.1319 +#endif
 84.1320 +
 84.1321 +#if defined(PNG_READ_STRIP_ALPHA_SUPPORTED)
 84.1322 +   if (png_ptr->flags & PNG_FLAG_STRIP_ALPHA)
 84.1323 +      png_do_strip_filler(&(png_ptr->row_info), png_ptr->row_buf + 1,
 84.1324 +         PNG_FLAG_FILLER_AFTER | (png_ptr->flags & PNG_FLAG_STRIP_ALPHA));
 84.1325 +#endif
 84.1326 +
 84.1327 +#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED)
 84.1328 +   if (png_ptr->transformations & PNG_RGB_TO_GRAY)
 84.1329 +   {
 84.1330 +      int rgb_error =
 84.1331 +         png_do_rgb_to_gray(png_ptr, &(png_ptr->row_info), png_ptr->row_buf + 1);
 84.1332 +      if (rgb_error)
 84.1333 +      {
 84.1334 +         png_ptr->rgb_to_gray_status=1;
 84.1335 +         if ((png_ptr->transformations & PNG_RGB_TO_GRAY) == 
 84.1336 +             PNG_RGB_TO_GRAY_WARN)
 84.1337 +            png_warning(png_ptr, "png_do_rgb_to_gray found nongray pixel");
 84.1338 +         if ((png_ptr->transformations & PNG_RGB_TO_GRAY) ==
 84.1339 +             PNG_RGB_TO_GRAY_ERR)
 84.1340 +            png_error(png_ptr, "png_do_rgb_to_gray found nongray pixel");
 84.1341 +      }
 84.1342 +   }
 84.1343 +#endif
 84.1344 +
 84.1345 +/*
 84.1346 +From Andreas Dilger e-mail to png-implement, 26 March 1998:
 84.1347 +
 84.1348 +  In most cases, the "simple transparency" should be done prior to doing
 84.1349 +  gray-to-RGB, or you will have to test 3x as many bytes to check if a
 84.1350 +  pixel is transparent.  You would also need to make sure that the
 84.1351 +  transparency information is upgraded to RGB.
 84.1352 +
 84.1353 +  To summarize, the current flow is:
 84.1354 +  - Gray + simple transparency -> compare 1 or 2 gray bytes and composite
 84.1355 +                                  with background "in place" if transparent,
 84.1356 +                                  convert to RGB if necessary
 84.1357 +  - Gray + alpha -> composite with gray background and remove alpha bytes,
 84.1358 +                                  convert to RGB if necessary
 84.1359 +
 84.1360 +  To support RGB backgrounds for gray images we need:
 84.1361 +  - Gray + simple transparency -> convert to RGB + simple transparency, compare
 84.1362 +                                  3 or 6 bytes and composite with background
 84.1363 +                                  "in place" if transparent (3x compare/pixel
 84.1364 +                                  compared to doing composite with gray bkgrnd)
 84.1365 +  - Gray + alpha -> convert to RGB + alpha, composite with background and
 84.1366 +                                  remove alpha bytes (3x float operations/pixel
 84.1367 +                                  compared with composite on gray background)
 84.1368 +
 84.1369 +  Greg's change will do this.  The reason it wasn't done before is for
 84.1370 +  performance, as this increases the per-pixel operations.  If we would check
 84.1371 +  in advance if the background was gray or RGB, and position the gray-to-RGB
 84.1372 +  transform appropriately, then it would save a lot of work/time.
 84.1373 + */
 84.1374 +
 84.1375 +#if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED)
 84.1376 +   /* if gray -> RGB, do so now only if background is non-gray; else do later
 84.1377 +    * for performance reasons */
 84.1378 +   if ((png_ptr->transformations & PNG_GRAY_TO_RGB) &&
 84.1379 +       !(png_ptr->mode & PNG_BACKGROUND_IS_GRAY))
 84.1380 +      png_do_gray_to_rgb(&(png_ptr->row_info), png_ptr->row_buf + 1);
 84.1381 +#endif
 84.1382 +
 84.1383 +#if defined(PNG_READ_BACKGROUND_SUPPORTED)
 84.1384 +   if ((png_ptr->transformations & PNG_BACKGROUND) &&
 84.1385 +      ((png_ptr->num_trans != 0 ) ||
 84.1386 +      (png_ptr->color_type & PNG_COLOR_MASK_ALPHA)))
 84.1387 +      png_do_background(&(png_ptr->row_info), png_ptr->row_buf + 1,
 84.1388 +         &(png_ptr->trans_values), &(png_ptr->background)
 84.1389 +#if defined(PNG_READ_GAMMA_SUPPORTED)
 84.1390 +         , &(png_ptr->background_1),
 84.1391 +         png_ptr->gamma_table, png_ptr->gamma_from_1,
 84.1392 +         png_ptr->gamma_to_1, png_ptr->gamma_16_table,
 84.1393 +         png_ptr->gamma_16_from_1, png_ptr->gamma_16_to_1,
 84.1394 +         png_ptr->gamma_shift
 84.1395 +#endif
 84.1396 +);
 84.1397 +#endif
 84.1398 +
 84.1399 +#if defined(PNG_READ_GAMMA_SUPPORTED)
 84.1400 +   if ((png_ptr->transformations & PNG_GAMMA) &&
 84.1401 +#if defined(PNG_READ_BACKGROUND_SUPPORTED)
 84.1402 +      !((png_ptr->transformations & PNG_BACKGROUND) &&
 84.1403 +      ((png_ptr->num_trans != 0) ||
 84.1404 +      (png_ptr->color_type & PNG_COLOR_MASK_ALPHA))) &&
 84.1405 +#endif
 84.1406 +      (png_ptr->color_type != PNG_COLOR_TYPE_PALETTE))
 84.1407 +      png_do_gamma(&(png_ptr->row_info), png_ptr->row_buf + 1,
 84.1408 +         png_ptr->gamma_table, png_ptr->gamma_16_table,
 84.1409 +         png_ptr->gamma_shift);
 84.1410 +#endif
 84.1411 +
 84.1412 +#if defined(PNG_READ_16_TO_8_SUPPORTED)
 84.1413 +   if (png_ptr->transformations & PNG_16_TO_8)
 84.1414 +      png_do_chop(&(png_ptr->row_info), png_ptr->row_buf + 1);
 84.1415 +#endif
 84.1416 +
 84.1417 +#if defined(PNG_READ_DITHER_SUPPORTED)
 84.1418 +   if (png_ptr->transformations & PNG_DITHER)
 84.1419 +   {
 84.1420 +      png_do_dither((png_row_infop)&(png_ptr->row_info), png_ptr->row_buf + 1,
 84.1421 +         png_ptr->palette_lookup, png_ptr->dither_index);
 84.1422 +      if (png_ptr->row_info.rowbytes == (png_uint_32)0)
 84.1423 +         png_error(png_ptr, "png_do_dither returned rowbytes=0");
 84.1424 +   }
 84.1425 +#endif
 84.1426 +
 84.1427 +#if defined(PNG_READ_INVERT_SUPPORTED)
 84.1428 +   if (png_ptr->transformations & PNG_INVERT_MONO)
 84.1429 +      png_do_invert(&(png_ptr->row_info), png_ptr->row_buf + 1);
 84.1430 +#endif
 84.1431 +
 84.1432 +#if defined(PNG_READ_SHIFT_SUPPORTED)
 84.1433 +   if (png_ptr->transformations & PNG_SHIFT)
 84.1434 +      png_do_unshift(&(png_ptr->row_info), png_ptr->row_buf + 1,
 84.1435 +         &(png_ptr->shift));
 84.1436 +#endif
 84.1437 +
 84.1438 +#if defined(PNG_READ_PACK_SUPPORTED)
 84.1439 +   if (png_ptr->transformations & PNG_PACK)
 84.1440 +      png_do_unpack(&(png_ptr->row_info), png_ptr->row_buf + 1);
 84.1441 +#endif
 84.1442 +
 84.1443 +#if defined(PNG_READ_BGR_SUPPORTED)
 84.1444 +   if (png_ptr->transformations & PNG_BGR)
 84.1445 +      png_do_bgr(&(png_ptr->row_info), png_ptr->row_buf + 1);
 84.1446 +#endif
 84.1447 +
 84.1448 +#if defined(PNG_READ_PACKSWAP_SUPPORTED)
 84.1449 +   if (png_ptr->transformations & PNG_PACKSWAP)
 84.1450 +      png_do_packswap(&(png_ptr->row_info), png_ptr->row_buf + 1);
 84.1451 +#endif
 84.1452 +
 84.1453 +#if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED)
 84.1454 +   /* if gray -> RGB, do so now only if we did not do so above */
 84.1455 +   if ((png_ptr->transformations & PNG_GRAY_TO_RGB) &&
 84.1456 +       (png_ptr->mode & PNG_BACKGROUND_IS_GRAY))
 84.1457 +      png_do_gray_to_rgb(&(png_ptr->row_info), png_ptr->row_buf + 1);
 84.1458 +#endif
 84.1459 +
 84.1460 +#if defined(PNG_READ_FILLER_SUPPORTED)
 84.1461 +   if (png_ptr->transformations & PNG_FILLER)
 84.1462 +      png_do_read_filler(&(png_ptr->row_info), png_ptr->row_buf + 1,
 84.1463 +         (png_uint_32)png_ptr->filler, png_ptr->flags);
 84.1464 +#endif
 84.1465 +
 84.1466 +#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED)
 84.1467 +   if (png_ptr->transformations & PNG_INVERT_ALPHA)
 84.1468 +      png_do_read_invert_alpha(&(png_ptr->row_info), png_ptr->row_buf + 1);
 84.1469 +#endif
 84.1470 +
 84.1471 +#if defined(PNG_READ_SWAP_ALPHA_SUPPORTED)
 84.1472 +   if (png_ptr->transformations & PNG_SWAP_ALPHA)
 84.1473 +      png_do_read_swap_alpha(&(png_ptr->row_info), png_ptr->row_buf + 1);
 84.1474 +#endif
 84.1475 +
 84.1476 +#if defined(PNG_READ_SWAP_SUPPORTED)
 84.1477 +   if (png_ptr->transformations & PNG_SWAP_BYTES)
 84.1478 +      png_do_swap(&(png_ptr->row_info), png_ptr->row_buf + 1);
 84.1479 +#endif
 84.1480 +
 84.1481 +#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED)
 84.1482 +   if (png_ptr->transformations & PNG_USER_TRANSFORM)
 84.1483 +    {
 84.1484 +      if (png_ptr->read_user_transform_fn != NULL)
 84.1485 +        (*(png_ptr->read_user_transform_fn)) /* user read transform function */
 84.1486 +          (png_ptr,                    /* png_ptr */
 84.1487 +           &(png_ptr->row_info),       /* row_info:     */
 84.1488 +             /*  png_uint_32 width;          width of row */
 84.1489 +             /*  png_uint_32 rowbytes;       number of bytes in row */
 84.1490 +             /*  png_byte color_type;        color type of pixels */
 84.1491 +             /*  png_byte bit_depth;         bit depth of samples */
 84.1492 +             /*  png_byte channels;          number of channels (1-4) */
 84.1493 +             /*  png_byte pixel_depth;       bits per pixel (depth*channels) */
 84.1494 +           png_ptr->row_buf + 1);      /* start of pixel data for row */
 84.1495 +#if defined(PNG_USER_TRANSFORM_PTR_SUPPORTED)
 84.1496 +      if (png_ptr->user_transform_depth)
 84.1497 +         png_ptr->row_info.bit_depth = png_ptr->user_transform_depth;
 84.1498 +      if (png_ptr->user_transform_channels)
 84.1499 +         png_ptr->row_info.channels = png_ptr->user_transform_channels;
 84.1500 +#endif
 84.1501 +      png_ptr->row_info.pixel_depth = (png_byte)(png_ptr->row_info.bit_depth *
 84.1502 +         png_ptr->row_info.channels);
 84.1503 +      png_ptr->row_info.rowbytes = PNG_ROWBYTES(png_ptr->row_info.pixel_depth,
 84.1504 +         png_ptr->row_info.width);
 84.1505 +   }
 84.1506 +#endif
 84.1507 +
 84.1508 +}
 84.1509 +
 84.1510 +#if defined(PNG_READ_PACK_SUPPORTED)
 84.1511 +/* Unpack pixels of 1, 2, or 4 bits per pixel into 1 byte per pixel,
 84.1512 + * without changing the actual values.  Thus, if you had a row with
 84.1513 + * a bit depth of 1, you would end up with bytes that only contained
 84.1514 + * the numbers 0 or 1.  If you would rather they contain 0 and 255, use
 84.1515 + * png_do_shift() after this.
 84.1516 + */
 84.1517 +void /* PRIVATE */
 84.1518 +png_do_unpack(png_row_infop row_info, png_bytep row)
 84.1519 +{
 84.1520 +   png_debug(1, "in png_do_unpack\n");
 84.1521 +#if defined(PNG_USELESS_TESTS_SUPPORTED)
 84.1522 +   if (row != NULL && row_info != NULL && row_info->bit_depth < 8)
 84.1523 +#else
 84.1524 +   if (row_info->bit_depth < 8)
 84.1525 +#endif
 84.1526 +   {
 84.1527 +      png_uint_32 i;
 84.1528 +      png_uint_32 row_width=row_info->width;
 84.1529 +
 84.1530 +      switch (row_info->bit_depth)
 84.1531 +      {
 84.1532 +         case 1:
 84.1533 +         {
 84.1534 +            png_bytep sp = row + (png_size_t)((row_width - 1) >> 3);
 84.1535 +            png_bytep dp = row + (png_size_t)row_width - 1;
 84.1536 +            png_uint_32 shift = 7 - (int)((row_width + 7) & 0x07);
 84.1537 +            for (i = 0; i < row_width; i++)
 84.1538 +            {
 84.1539 +               *dp = (png_byte)((*sp >> shift) & 0x01);
 84.1540 +               if (shift == 7)
 84.1541 +               {
 84.1542 +                  shift = 0;
 84.1543 +                  sp--;
 84.1544 +               }
 84.1545 +               else
 84.1546 +                  shift++;
 84.1547 +
 84.1548 +               dp--;
 84.1549 +            }
 84.1550 +            break;
 84.1551 +         }
 84.1552 +         case 2:
 84.1553 +         {
 84.1554 +
 84.1555 +            png_bytep sp = row + (png_size_t)((row_width - 1) >> 2);
 84.1556 +            png_bytep dp = row + (png_size_t)row_width - 1;
 84.1557 +            png_uint_32 shift = (int)((3 - ((row_width + 3) & 0x03)) << 1);
 84.1558 +            for (i = 0; i < row_width; i++)
 84.1559 +            {
 84.1560 +               *dp = (png_byte)((*sp >> shift) & 0x03);
 84.1561 +               if (shift == 6)
 84.1562 +               {
 84.1563 +                  shift = 0;
 84.1564 +                  sp--;
 84.1565 +               }
 84.1566 +               else
 84.1567 +                  shift += 2;
 84.1568 +
 84.1569 +               dp--;
 84.1570 +            }
 84.1571 +            break;
 84.1572 +         }
 84.1573 +         case 4:
 84.1574 +         {
 84.1575 +            png_bytep sp = row + (png_size_t)((row_width - 1) >> 1);
 84.1576 +            png_bytep dp = row + (png_size_t)row_width - 1;
 84.1577 +            png_uint_32 shift = (int)((1 - ((row_width + 1) & 0x01)) << 2);
 84.1578 +            for (i = 0; i < row_width; i++)
 84.1579 +            {
 84.1580 +               *dp = (png_byte)((*sp >> shift) & 0x0f);
 84.1581 +               if (shift == 4)
 84.1582 +               {
 84.1583 +                  shift = 0;
 84.1584 +                  sp--;
 84.1585 +               }
 84.1586 +               else
 84.1587 +                  shift = 4;
 84.1588 +
 84.1589 +               dp--;
 84.1590 +            }
 84.1591 +            break;
 84.1592 +         }
 84.1593 +      }
 84.1594 +      row_info->bit_depth = 8;
 84.1595 +      row_info->pixel_depth = (png_byte)(8 * row_info->channels);
 84.1596 +      row_info->rowbytes = row_width * row_info->channels;
 84.1597 +   }
 84.1598 +}
 84.1599 +#endif
 84.1600 +
 84.1601 +#if defined(PNG_READ_SHIFT_SUPPORTED)
 84.1602 +/* Reverse the effects of png_do_shift.  This routine merely shifts the
 84.1603 + * pixels back to their significant bits values.  Thus, if you have
 84.1604 + * a row of bit depth 8, but only 5 are significant, this will shift
 84.1605 + * the values back to 0 through 31.
 84.1606 + */
 84.1607 +void /* PRIVATE */
 84.1608 +png_do_unshift(png_row_infop row_info, png_bytep row, png_color_8p sig_bits)
 84.1609 +{
 84.1610 +   png_debug(1, "in png_do_unshift\n");
 84.1611 +   if (
 84.1612 +#if defined(PNG_USELESS_TESTS_SUPPORTED)
 84.1613 +       row != NULL && row_info != NULL && sig_bits != NULL &&
 84.1614 +#endif
 84.1615 +       row_info->color_type != PNG_COLOR_TYPE_PALETTE)
 84.1616 +   {
 84.1617 +      int shift[4];
 84.1618 +      int channels = 0;
 84.1619 +      int c;
 84.1620 +      png_uint_16 value = 0;
 84.1621 +      png_uint_32 row_width = row_info->width;
 84.1622 +
 84.1623 +      if (row_info->color_type & PNG_COLOR_MASK_COLOR)
 84.1624 +      {
 84.1625 +         shift[channels++] = row_info->bit_depth - sig_bits->red;
 84.1626 +         shift[channels++] = row_info->bit_depth - sig_bits->green;
 84.1627 +         shift[channels++] = row_info->bit_depth - sig_bits->blue;
 84.1628 +      }
 84.1629 +      else
 84.1630 +      {
 84.1631 +         shift[channels++] = row_info->bit_depth - sig_bits->gray;
 84.1632 +      }
 84.1633 +      if (row_info->color_type & PNG_COLOR_MASK_ALPHA)
 84.1634 +      {
 84.1635 +         shift[channels++] = row_info->bit_depth - sig_bits->alpha;
 84.1636 +      }
 84.1637 +
 84.1638 +      for (c = 0; c < channels; c++)
 84.1639 +      {
 84.1640 +         if (shift[c] <= 0)
 84.1641 +            shift[c] = 0;
 84.1642 +         else
 84.1643 +            value = 1;
 84.1644 +      }
 84.1645 +
 84.1646 +      if (!value)
 84.1647 +         return;
 84.1648 +
 84.1649 +      switch (row_info->bit_depth)
 84.1650 +      {
 84.1651 +         case 2:
 84.1652 +         {
 84.1653 +            png_bytep bp;
 84.1654 +            png_uint_32 i;
 84.1655 +            png_uint_32 istop = row_info->rowbytes;
 84.1656 +
 84.1657 +            for (bp = row, i = 0; i < istop; i++)
 84.1658 +            {
 84.1659 +               *bp >>= 1;
 84.1660 +               *bp++ &= 0x55;
 84.1661 +            }
 84.1662 +            break;
 84.1663 +         }
 84.1664 +         case 4:
 84.1665 +         {
 84.1666 +            png_bytep bp = row;
 84.1667 +            png_uint_32 i;
 84.1668 +            png_uint_32 istop = row_info->rowbytes;
 84.1669 +            png_byte mask = (png_byte)((((int)0xf0 >> shift[0]) & (int)0xf0) |
 84.1670 +               (png_byte)((int)0xf >> shift[0]));
 84.1671 +
 84.1672 +            for (i = 0; i < istop; i++)
 84.1673 +            {
 84.1674 +               *bp >>= shift[0];
 84.1675 +               *bp++ &= mask;
 84.1676 +            }
 84.1677 +            break;
 84.1678 +         }
 84.1679 +         case 8:
 84.1680 +         {
 84.1681 +            png_bytep bp = row;
 84.1682 +            png_uint_32 i;
 84.1683 +            png_uint_32 istop = row_width * channels;
 84.1684 +
 84.1685 +            for (i = 0; i < istop; i++)
 84.1686 +            {
 84.1687 +               *bp++ >>= shift[i%channels];
 84.1688 +            }
 84.1689 +            break;
 84.1690 +         }
 84.1691 +         case 16:
 84.1692 +         {
 84.1693 +            png_bytep bp = row;
 84.1694 +            png_uint_32 i;
 84.1695 +            png_uint_32 istop = channels * row_width;
 84.1696 +
 84.1697 +            for (i = 0; i < istop; i++)
 84.1698 +            {
 84.1699 +               value = (png_uint_16)((*bp << 8) + *(bp + 1));
 84.1700 +               value >>= shift[i%channels];
 84.1701 +               *bp++ = (png_byte)(value >> 8);
 84.1702 +               *bp++ = (png_byte)(value & 0xff);
 84.1703 +            }
 84.1704 +            break;
 84.1705 +         }
 84.1706 +      }
 84.1707 +   }
 84.1708 +}
 84.1709 +#endif
 84.1710 +
 84.1711 +#if defined(PNG_READ_16_TO_8_SUPPORTED)
 84.1712 +/* chop rows of bit depth 16 down to 8 */
 84.1713 +void /* PRIVATE */
 84.1714 +png_do_chop(png_row_infop row_info, png_bytep row)
 84.1715 +{
 84.1716 +   png_debug(1, "in png_do_chop\n");
 84.1717 +#if defined(PNG_USELESS_TESTS_SUPPORTED)
 84.1718 +   if (row != NULL && row_info != NULL && row_info->bit_depth == 16)
 84.1719 +#else
 84.1720 +   if (row_info->bit_depth == 16)
 84.1721 +#endif
 84.1722 +   {
 84.1723 +      png_bytep sp = row;
 84.1724 +      png_bytep dp = row;
 84.1725 +      png_uint_32 i;
 84.1726 +      png_uint_32 istop = row_info->width * row_info->channels;
 84.1727 +
 84.1728 +      for (i = 0; i<istop; i++, sp += 2, dp++)
 84.1729 +      {
 84.1730 +#if defined(PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED)
 84.1731 +      /* This does a more accurate scaling of the 16-bit color
 84.1732 +       * value, rather than a simple low-byte truncation.
 84.1733 +       *
 84.1734 +       * What the ideal calculation should be:
 84.1735 +       *   *dp = (((((png_uint_32)(*sp) << 8) |
 84.1736 +       *          (png_uint_32)(*(sp + 1))) * 255 + 127) / (png_uint_32)65535L;
 84.1737 +       *
 84.1738 +       * GRR: no, I think this is what it really should be:
 84.1739 +       *   *dp = (((((png_uint_32)(*sp) << 8) |
 84.1740 +       *           (png_uint_32)(*(sp + 1))) + 128L) / (png_uint_32)257L;
 84.1741 +       *
 84.1742 +       * GRR: here's the exact calculation with shifts:
 84.1743 +       *   temp = (((png_uint_32)(*sp) << 8) | (png_uint_32)(*(sp + 1))) + 128L;
 84.1744 +       *   *dp = (temp - (temp >> 8)) >> 8;
 84.1745 +       *
 84.1746 +       * Approximate calculation with shift/add instead of multiply/divide:
 84.1747 +       *   *dp = ((((png_uint_32)(*sp) << 8) |
 84.1748 +       *          (png_uint_32)((int)(*(sp + 1)) - *sp)) + 128) >> 8;
 84.1749 +       *
 84.1750 +       * What we actually do to avoid extra shifting and conversion:
 84.1751 +       */
 84.1752 +
 84.1753 +         *dp = *sp + ((((int)(*(sp + 1)) - *sp) > 128) ? 1 : 0);
 84.1754 +#else
 84.1755 +       /* Simply discard the low order byte */
 84.1756 +         *dp = *sp;
 84.1757 +#endif
 84.1758 +      }
 84.1759 +      row_info->bit_depth = 8;
 84.1760 +      row_info->pixel_depth = (png_byte)(8 * row_info->channels);
 84.1761 +      row_info->rowbytes = row_info->width * row_info->channels;
 84.1762 +   }
 84.1763 +}
 84.1764 +#endif
 84.1765 +
 84.1766 +#if defined(PNG_READ_SWAP_ALPHA_SUPPORTED)
 84.1767 +void /* PRIVATE */
 84.1768 +png_do_read_swap_alpha(png_row_infop row_info, png_bytep row)
 84.1769 +{
 84.1770 +   png_debug(1, "in png_do_read_swap_alpha\n");
 84.1771 +#if defined(PNG_USELESS_TESTS_SUPPORTED)
 84.1772 +   if (row != NULL && row_info != NULL)
 84.1773 +#endif
 84.1774 +   {
 84.1775 +      png_uint_32 row_width = row_info->width;
 84.1776 +      if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
 84.1777 +      {
 84.1778 +         /* This converts from RGBA to ARGB */
 84.1779 +         if (row_info->bit_depth == 8)
 84.1780 +         {
 84.1781 +            png_bytep sp = row + row_info->rowbytes;
 84.1782 +            png_bytep dp = sp;
 84.1783 +            png_byte save;
 84.1784 +            png_uint_32 i;
 84.1785 +
 84.1786 +            for (i = 0; i < row_width; i++)
 84.1787 +            {
 84.1788 +               save = *(--sp);
 84.1789 +               *(--dp) = *(--sp);
 84.1790 +               *(--dp) = *(--sp);
 84.1791 +               *(--dp) = *(--sp);
 84.1792 +               *(--dp) = save;
 84.1793 +            }
 84.1794 +         }
 84.1795 +         /* This converts from RRGGBBAA to AARRGGBB */
 84.1796 +         else
 84.1797 +         {
 84.1798 +            png_bytep sp = row + row_info->rowbytes;
 84.1799 +            png_bytep dp = sp;
 84.1800 +            png_byte save[2];
 84.1801 +            png_uint_32 i;
 84.1802 +
 84.1803 +            for (i = 0; i < row_width; i++)
 84.1804 +            {
 84.1805 +               save[0] = *(--sp);
 84.1806 +               save[1] = *(--sp);
 84.1807 +               *(--dp) = *(--sp);
 84.1808 +               *(--dp) = *(--sp);
 84.1809 +               *(--dp) = *(--sp);
 84.1810 +               *(--dp) = *(--sp);
 84.1811 +               *(--dp) = *(--sp);
 84.1812 +               *(--dp) = *(--sp);
 84.1813 +               *(--dp) = save[0];
 84.1814 +               *(--dp) = save[1];
 84.1815 +            }
 84.1816 +         }
 84.1817 +      }
 84.1818 +      else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
 84.1819 +      {
 84.1820 +         /* This converts from GA to AG */
 84.1821 +         if (row_info->bit_depth == 8)
 84.1822 +         {
 84.1823 +            png_bytep sp = row + row_info->rowbytes;
 84.1824 +            png_bytep dp = sp;
 84.1825 +            png_byte save;
 84.1826 +            png_uint_32 i;
 84.1827 +
 84.1828 +            for (i = 0; i < row_width; i++)
 84.1829 +            {
 84.1830 +               save = *(--sp);
 84.1831 +               *(--dp) = *(--sp);
 84.1832 +               *(--dp) = save;
 84.1833 +            }
 84.1834 +         }
 84.1835 +         /* This converts from GGAA to AAGG */
 84.1836 +         else
 84.1837 +         {
 84.1838 +            png_bytep sp = row + row_info->rowbytes;
 84.1839 +            png_bytep dp = sp;
 84.1840 +            png_byte save[2];
 84.1841 +            png_uint_32 i;
 84.1842 +
 84.1843 +            for (i = 0; i < row_width; i++)
 84.1844 +            {
 84.1845 +               save[0] = *(--sp);
 84.1846 +               save[1] = *(--sp);
 84.1847 +               *(--dp) = *(--sp);
 84.1848 +               *(--dp) = *(--sp);
 84.1849 +               *(--dp) = save[0];
 84.1850 +               *(--dp) = save[1];
 84.1851 +            }
 84.1852 +         }
 84.1853 +      }
 84.1854 +   }
 84.1855 +}
 84.1856 +#endif
 84.1857 +
 84.1858 +#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED)
 84.1859 +void /* PRIVATE */
 84.1860 +png_do_read_invert_alpha(png_row_infop row_info, png_bytep row)
 84.1861 +{
 84.1862 +   png_debug(1, "in png_do_read_invert_alpha\n");
 84.1863 +#if defined(PNG_USELESS_TESTS_SUPPORTED)
 84.1864 +   if (row != NULL && row_info != NULL)
 84.1865 +#endif
 84.1866 +   {
 84.1867 +      png_uint_32 row_width = row_info->width;
 84.1868 +      if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
 84.1869 +      {
 84.1870 +         /* This inverts the alpha channel in RGBA */
 84.1871 +         if (row_info->bit_depth == 8)
 84.1872 +         {
 84.1873 +            png_bytep sp = row + row_info->rowbytes;
 84.1874 +            png_bytep dp = sp;
 84.1875 +            png_uint_32 i;
 84.1876 +
 84.1877 +            for (i = 0; i < row_width; i++)
 84.1878 +            {
 84.1879 +               *(--dp) = (png_byte)(255 - *(--sp));
 84.1880 +
 84.1881 +/*             This does nothing:
 84.1882 +               *(--dp) = *(--sp);
 84.1883 +               *(--dp) = *(--sp);
 84.1884 +               *(--dp) = *(--sp);
 84.1885 +               We can replace it with:
 84.1886 +*/
 84.1887 +               sp-=3;
 84.1888 +               dp=sp;
 84.1889 +            }
 84.1890 +         }
 84.1891 +         /* This inverts the alpha channel in RRGGBBAA */
 84.1892 +         else
 84.1893 +         {
 84.1894 +            png_bytep sp = row + row_info->rowbytes;
 84.1895 +            png_bytep dp = sp;
 84.1896 +            png_uint_32 i;
 84.1897 +
 84.1898 +            for (i = 0; i < row_width; i++)
 84.1899 +            {
 84.1900 +               *(--dp) = (png_byte)(255 - *(--sp));
 84.1901 +               *(--dp) = (png_byte)(255 - *(--sp));
 84.1902 +
 84.1903 +/*             This does nothing:
 84.1904 +               *(--dp) = *(--sp);
 84.1905 +               *(--dp) = *(--sp);
 84.1906 +               *(--dp) = *(--sp);
 84.1907 +               *(--dp) = *(--sp);
 84.1908 +               *(--dp) = *(--sp);
 84.1909 +               *(--dp) = *(--sp);
 84.1910 +               We can replace it with:
 84.1911 +*/
 84.1912 +               sp-=6;
 84.1913 +               dp=sp;
 84.1914 +            }
 84.1915 +         }
 84.1916 +      }
 84.1917 +      else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
 84.1918 +      {
 84.1919 +         /* This inverts the alpha channel in GA */
 84.1920 +         if (row_info->bit_depth == 8)
 84.1921 +         {
 84.1922 +            png_bytep sp = row + row_info->rowbytes;
 84.1923 +            png_bytep dp = sp;
 84.1924 +            png_uint_32 i;
 84.1925 +
 84.1926 +            for (i = 0; i < row_width; i++)
 84.1927 +            {
 84.1928 +               *(--dp) = (png_byte)(255 - *(--sp));
 84.1929 +               *(--dp) = *(--sp);
 84.1930 +            }
 84.1931 +         }
 84.1932 +         /* This inverts the alpha channel in GGAA */
 84.1933 +         else
 84.1934 +         {
 84.1935 +            png_bytep sp  = row + row_info->rowbytes;
 84.1936 +            png_bytep dp = sp;
 84.1937 +            png_uint_32 i;
 84.1938 +
 84.1939 +            for (i = 0; i < row_width; i++)
 84.1940 +            {
 84.1941 +               *(--dp) = (png_byte)(255 - *(--sp));
 84.1942 +               *(--dp) = (png_byte)(255 - *(--sp));
 84.1943 +/*
 84.1944 +               *(--dp) = *(--sp);
 84.1945 +               *(--dp) = *(--sp);
 84.1946 +*/
 84.1947 +               sp-=2;
 84.1948 +               dp=sp;
 84.1949 +            }
 84.1950 +         }
 84.1951 +      }
 84.1952 +   }
 84.1953 +}
 84.1954 +#endif
 84.1955 +
 84.1956 +#if defined(PNG_READ_FILLER_SUPPORTED)
 84.1957 +/* Add filler channel if we have RGB color */
 84.1958 +void /* PRIVATE */
 84.1959 +png_do_read_filler(png_row_infop row_info, png_bytep row,
 84.1960 +   png_uint_32 filler, png_uint_32 flags)
 84.1961 +{
 84.1962 +   png_uint_32 i;
 84.1963 +   png_uint_32 row_width = row_info->width;
 84.1964 +
 84.1965 +   png_byte hi_filler = (png_byte)((filler>>8) & 0xff);
 84.1966 +   png_byte lo_filler = (png_byte)(filler & 0xff);
 84.1967 +
 84.1968 +   png_debug(1, "in png_do_read_filler\n");
 84.1969 +   if (
 84.1970 +#if defined(PNG_USELESS_TESTS_SUPPORTED)
 84.1971 +       row != NULL  && row_info != NULL &&
 84.1972 +#endif
 84.1973 +       row_info->color_type == PNG_COLOR_TYPE_GRAY)
 84.1974 +   {
 84.1975 +      if (row_info->bit_depth == 8)
 84.1976 +      {
 84.1977 +         /* This changes the data from G to GX */
 84.1978 +         if (flags & PNG_FLAG_FILLER_AFTER)
 84.1979 +         {
 84.1980 +            png_bytep sp = row + (png_size_t)row_width;
 84.1981 +            png_bytep dp =  sp + (png_size_t)row_width;
 84.1982 +            for (i = 1; i < row_width; i++)
 84.1983 +            {
 84.1984 +               *(--dp) = lo_filler;
 84.1985 +               *(--dp) = *(--sp);
 84.1986 +            }
 84.1987 +            *(--dp) = lo_filler;
 84.1988 +            row_info->channels = 2;
 84.1989 +            row_info->pixel_depth = 16;
 84.1990 +            row_info->rowbytes = row_width * 2;
 84.1991 +         }
 84.1992 +      /* This changes the data from G to XG */
 84.1993 +         else
 84.1994 +         {
 84.1995 +            png_bytep sp = row + (png_size_t)row_width;
 84.1996 +            png_bytep dp = sp  + (png_size_t)row_width;
 84.1997 +            for (i = 0; i < row_width; i++)
 84.1998 +            {
 84.1999 +               *(--dp) = *(--sp);
 84.2000 +               *(--dp) = lo_filler;
 84.2001 +            }
 84.2002 +            row_info->channels = 2;
 84.2003 +            row_info->pixel_depth = 16;
 84.2004 +            row_info->rowbytes = row_width * 2;
 84.2005 +         }
 84.2006 +      }
 84.2007 +      else if (row_info->bit_depth == 16)
 84.2008 +      {
 84.2009 +         /* This changes the data from GG to GGXX */
 84.2010 +         if (flags & PNG_FLAG_FILLER_AFTER)
 84.2011 +         {
 84.2012 +            png_bytep sp = row + (png_size_t)row_width * 2;
 84.2013 +            png_bytep dp = sp  + (png_size_t)row_width * 2;
 84.2014 +            for (i = 1; i < row_width; i++)
 84.2015 +            {
 84.2016 +               *(--dp) = hi_filler;
 84.2017 +               *(--dp) = lo_filler;
 84.2018 +               *(--dp) = *(--sp);
 84.2019 +               *(--dp) = *(--sp);
 84.2020 +            }
 84.2021 +            *(--dp) = hi_filler;
 84.2022 +            *(--dp) = lo_filler;
 84.2023 +            row_info->channels = 2;
 84.2024 +            row_info->pixel_depth = 32;
 84.2025 +            row_info->rowbytes = row_width * 4;
 84.2026 +         }
 84.2027 +         /* This changes the data from GG to XXGG */
 84.2028 +         else
 84.2029 +         {
 84.2030 +            png_bytep sp = row + (png_size_t)row_width * 2;
 84.2031 +            png_bytep dp = sp  + (png_size_t)row_width * 2;
 84.2032 +            for (i = 0; i < row_width; i++)
 84.2033 +            {
 84.2034 +               *(--dp) = *(--sp);
 84.2035 +               *(--dp) = *(--sp);
 84.2036 +               *(--dp) = hi_filler;
 84.2037 +               *(--dp) = lo_filler;
 84.2038 +            }
 84.2039 +            row_info->channels = 2;
 84.2040 +            row_info->pixel_depth = 32;
 84.2041 +            row_info->rowbytes = row_width * 4;
 84.2042 +         }
 84.2043 +      }
 84.2044 +   } /* COLOR_TYPE == GRAY */
 84.2045 +   else if (row_info->color_type == PNG_COLOR_TYPE_RGB)
 84.2046 +   {
 84.2047 +      if (row_info->bit_depth == 8)
 84.2048 +      {
 84.2049 +         /* This changes the data from RGB to RGBX */
 84.2050 +         if (flags & PNG_FLAG_FILLER_AFTER)
 84.2051 +         {
 84.2052 +            png_bytep sp = row + (png_size_t)row_width * 3;
 84.2053 +            png_bytep dp = sp  + (png_size_t)row_width;
 84.2054 +            for (i = 1; i < row_width; i++)
 84.2055 +            {
 84.2056 +               *(--dp) = lo_filler;
 84.2057 +               *(--dp) = *(--sp);
 84.2058 +               *(--dp) = *(--sp);
 84.2059 +               *(--dp) = *(--sp);
 84.2060 +            }
 84.2061 +            *(--dp) = lo_filler;
 84.2062 +            row_info->channels = 4;
 84.2063 +            row_info->pixel_depth = 32;
 84.2064 +            row_info->rowbytes = row_width * 4;
 84.2065 +         }
 84.2066 +      /* This changes the data from RGB to XRGB */
 84.2067 +         else
 84.2068 +         {
 84.2069 +            png_bytep sp = row + (png_size_t)row_width * 3;
 84.2070 +            png_bytep dp = sp + (png_size_t)row_width;
 84.2071 +            for (i = 0; i < row_width; i++)
 84.2072 +            {
 84.2073 +               *(--dp) = *(--sp);
 84.2074 +               *(--dp) = *(--sp);
 84.2075 +               *(--dp) = *(--sp);
 84.2076 +               *(--dp) = lo_filler;
 84.2077 +            }
 84.2078 +            row_info->channels = 4;
 84.2079 +            row_info->pixel_depth = 32;
 84.2080 +            row_info->rowbytes = row_width * 4;
 84.2081 +         }
 84.2082 +      }
 84.2083 +      else if (row_info->bit_depth == 16)
 84.2084 +      {
 84.2085 +         /* This changes the data from RRGGBB to RRGGBBXX */
 84.2086 +         if (flags & PNG_FLAG_FILLER_AFTER)
 84.2087 +         {
 84.2088 +            png_bytep sp = row + (png_size_t)row_width * 6;
 84.2089 +            png_bytep dp = sp  + (png_size_t)row_width * 2;
 84.2090 +            for (i = 1; i < row_width; i++)
 84.2091 +            {
 84.2092 +               *(--dp) = hi_filler;
 84.2093 +               *(--dp) = lo_filler;
 84.2094 +               *(--dp) = *(--sp);
 84.2095 +               *(--dp) = *(--sp);
 84.2096 +               *(--dp) = *(--sp);
 84.2097 +               *(--dp) = *(--sp);
 84.2098 +               *(--dp) = *(--sp);
 84.2099 +               *(--dp) = *(--sp);
 84.2100 +            }
 84.2101 +            *(--dp) = hi_filler;
 84.2102 +            *(--dp) = lo_filler;
 84.2103 +            row_info->channels = 4;
 84.2104 +            row_info->pixel_depth = 64;
 84.2105 +            row_info->rowbytes = row_width * 8;
 84.2106 +         }
 84.2107 +         /* This changes the data from RRGGBB to XXRRGGBB */
 84.2108 +         else
 84.2109 +         {
 84.2110 +            png_bytep sp = row + (png_size_t)row_width * 6;
 84.2111 +            png_bytep dp = sp  + (png_size_t)row_width * 2;
 84.2112 +            for (i = 0; i < row_width; i++)
 84.2113 +            {
 84.2114 +               *(--dp) = *(--sp);
 84.2115 +               *(--dp) = *(--sp);
 84.2116 +               *(--dp) = *(--sp);
 84.2117 +               *(--dp) = *(--sp);
 84.2118 +               *(--dp) = *(--sp);
 84.2119 +               *(--dp) = *(--sp);
 84.2120 +               *(--dp) = hi_filler;
 84.2121 +               *(--dp) = lo_filler;
 84.2122 +            }
 84.2123 +            row_info->channels = 4;
 84.2124 +            row_info->pixel_depth = 64;
 84.2125 +            row_info->rowbytes = row_width * 8;
 84.2126 +         }
 84.2127 +      }
 84.2128 +   } /* COLOR_TYPE == RGB */
 84.2129 +}
 84.2130 +#endif
 84.2131 +
 84.2132 +#if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED)
 84.2133 +/* expand grayscale files to RGB, with or without alpha */
 84.2134 +void /* PRIVATE */
 84.2135 +png_do_gray_to_rgb(png_row_infop row_info, png_bytep row)
 84.2136 +{
 84.2137 +   png_uint_32 i;
 84.2138 +   png_uint_32 row_width = row_info->width;
 84.2139 +
 84.2140 +   png_debug(1, "in png_do_gray_to_rgb\n");
 84.2141 +   if (row_info->bit_depth >= 8 &&
 84.2142 +#if defined(PNG_USELESS_TESTS_SUPPORTED)
 84.2143 +       row != NULL && row_info != NULL &&
 84.2144 +#endif
 84.2145 +      !(row_info->color_type & PNG_COLOR_MASK_COLOR))
 84.2146 +   {
 84.2147 +      if (row_info->color_type == PNG_COLOR_TYPE_GRAY)
 84.2148 +      {
 84.2149 +         if (row_info->bit_depth == 8)
 84.2150 +         {
 84.2151 +            png_bytep sp = row + (png_size_t)row_width - 1;
 84.2152 +            png_bytep dp = sp  + (png_size_t)row_width * 2;
 84.2153 +            for (i = 0; i < row_width; i++)
 84.2154 +            {
 84.2155 +               *(dp--) = *sp;
 84.2156 +               *(dp--) = *sp;
 84.2157 +               *(dp--) = *(sp--);
 84.2158 +            }
 84.2159 +         }
 84.2160 +         else
 84.2161 +         {
 84.2162 +            png_bytep sp = row + (png_size_t)row_width * 2 - 1;
 84.2163 +            png_bytep dp = sp  + (png_size_t)row_width * 4;
 84.2164 +            for (i = 0; i < row_width; i++)
 84.2165 +            {
 84.2166 +               *(dp--) = *sp;
 84.2167 +               *(dp--) = *(sp - 1);
 84.2168 +               *(dp--) = *sp;
 84.2169 +               *(dp--) = *(sp - 1);
 84.2170 +               *(dp--) = *(sp--);
 84.2171 +               *(dp--) = *(sp--);
 84.2172 +            }
 84.2173 +         }
 84.2174 +      }
 84.2175 +      else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
 84.2176 +      {
 84.2177 +         if (row_info->bit_depth == 8)
 84.2178 +         {
 84.2179 +            png_bytep sp = row + (png_size_t)row_width * 2 - 1;
 84.2180 +            png_bytep dp = sp  + (png_size_t)row_width * 2;
 84.2181 +            for (i = 0; i < row_width; i++)
 84.2182 +            {
 84.2183 +               *(dp--) = *(sp--);
 84.2184 +               *(dp--) = *sp;
 84.2185 +               *(dp--) = *sp;
 84.2186 +               *(dp--) = *(sp--);
 84.2187 +            }
 84.2188 +         }
 84.2189 +         else
 84.2190 +         {
 84.2191 +            png_bytep sp = row + (png_size_t)row_width * 4 - 1;
 84.2192 +            png_bytep dp = sp  + (png_size_t)row_width * 4;
 84.2193 +            for (i = 0; i < row_width; i++)
 84.2194 +            {
 84.2195 +               *(dp--) = *(sp--);
 84.2196 +               *(dp--) = *(sp--);
 84.2197 +               *(dp--) = *sp;
 84.2198 +               *(dp--) = *(sp - 1);
 84.2199 +               *(dp--) = *sp;
 84.2200 +               *(dp--) = *(sp - 1);
 84.2201 +               *(dp--) = *(sp--);
 84.2202 +               *(dp--) = *(sp--);
 84.2203 +            }
 84.2204 +         }
 84.2205 +      }
 84.2206 +      row_info->channels += (png_byte)2;
 84.2207 +      row_info->color_type |= PNG_COLOR_MASK_COLOR;
 84.2208 +      row_info->pixel_depth = (png_byte)(row_info->channels *
 84.2209 +         row_info->bit_depth);
 84.2210 +      row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, row_width);
 84.2211 +   }
 84.2212 +}
 84.2213 +#endif
 84.2214 +
 84.2215 +#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED)
 84.2216 +/* reduce RGB files to grayscale, with or without alpha
 84.2217 + * using the equation given in Poynton's ColorFAQ at
 84.2218 + * <http://www.inforamp.net/~poynton/>  (THIS LINK IS DEAD June 2008)
 84.2219 + * New link:
 84.2220 + * <http://www.poynton.com/notes/colour_and_gamma/>
 84.2221 + * Charles Poynton poynton at poynton.com
 84.2222 + *
 84.2223 + *     Y = 0.212671 * R + 0.715160 * G + 0.072169 * B
 84.2224 + *
 84.2225 + *  We approximate this with
 84.2226 + *
 84.2227 + *     Y = 0.21268 * R    + 0.7151 * G    + 0.07217 * B
 84.2228 + *
 84.2229 + *  which can be expressed with integers as
 84.2230 + *
 84.2231 + *     Y = (6969 * R + 23434 * G + 2365 * B)/32768
 84.2232 + *
 84.2233 + *  The calculation is to be done in a linear colorspace.
 84.2234 + *
 84.2235 + *  Other integer coefficents can be used via png_set_rgb_to_gray().
 84.2236 + */
 84.2237 +int /* PRIVATE */
 84.2238 +png_do_rgb_to_gray(png_structp png_ptr, png_row_infop row_info, png_bytep row)
 84.2239 +
 84.2240 +{
 84.2241 +   png_uint_32 i;
 84.2242 +
 84.2243 +   png_uint_32 row_width = row_info->width;
 84.2244 +   int rgb_error = 0;
 84.2245 +
 84.2246 +   png_debug(1, "in png_do_rgb_to_gray\n");
 84.2247 +   if (
 84.2248 +#if defined(PNG_USELESS_TESTS_SUPPORTED)
 84.2249 +       row != NULL && row_info != NULL &&
 84.2250 +#endif
 84.2251 +      (row_info->color_type & PNG_COLOR_MASK_COLOR))
 84.2252 +   {
 84.2253 +      png_uint_32 rc = png_ptr->rgb_to_gray_red_coeff;
 84.2254 +      png_uint_32 gc = png_ptr->rgb_to_gray_green_coeff;
 84.2255 +      png_uint_32 bc = png_ptr->rgb_to_gray_blue_coeff;
 84.2256 +
 84.2257 +      if (row_info->color_type == PNG_COLOR_TYPE_RGB)
 84.2258 +      {
 84.2259 +         if (row_info->bit_depth == 8)
 84.2260 +         {
 84.2261 +#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED)
 84.2262 +            if (png_ptr->gamma_from_1 != NULL && png_ptr->gamma_to_1 != NULL)
 84.2263 +            {
 84.2264 +               png_bytep sp = row;
 84.2265 +               png_bytep dp = row;
 84.2266 +
 84.2267 +               for (i = 0; i < row_width; i++)
 84.2268 +               {
 84.2269 +                  png_byte red   = png_ptr->gamma_to_1[*(sp++)];
 84.2270 +                  png_byte green = png_ptr->gamma_to_1[*(sp++)];
 84.2271 +                  png_byte blue  = png_ptr->gamma_to_1[*(sp++)];
 84.2272 +                  if (red != green || red != blue)
 84.2273 +                  {
 84.2274 +                     rgb_error |= 1;
 84.2275 +                     *(dp++) = png_ptr->gamma_from_1[
 84.2276 +                       (rc*red + gc*green + bc*blue)>>15];
 84.2277 +                  }
 84.2278 +                  else
 84.2279 +                     *(dp++) = *(sp - 1);
 84.2280 +               }
 84.2281 +            }
 84.2282 +            else
 84.2283 +#endif
 84.2284 +            {
 84.2285 +               png_bytep sp = row;
 84.2286 +               png_bytep dp = row;
 84.2287 +               for (i = 0; i < row_width; i++)
 84.2288 +               {
 84.2289 +                  png_byte red   = *(sp++);
 84.2290 +                  png_byte green = *(sp++);
 84.2291 +                  png_byte blue  = *(sp++);
 84.2292 +                  if (red != green || red != blue)
 84.2293 +                  {
 84.2294 +                     rgb_error |= 1;
 84.2295 +                     *(dp++) = (png_byte)((rc*red + gc*green + bc*blue)>>15);
 84.2296 +                  }
 84.2297 +                  else
 84.2298 +                     *(dp++) = *(sp - 1);
 84.2299 +               }
 84.2300 +            }
 84.2301 +         }
 84.2302 +
 84.2303 +         else /* RGB bit_depth == 16 */
 84.2304 +         {
 84.2305 +#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED)
 84.2306 +            if (png_ptr->gamma_16_to_1 != NULL &&
 84.2307 +                png_ptr->gamma_16_from_1 != NULL)
 84.2308 +            {
 84.2309 +               png_bytep sp = row;
 84.2310 +               png_bytep dp = row;
 84.2311 +               for (i = 0; i < row_width; i++)
 84.2312 +               {
 84.2313 +                  png_uint_16 red, green, blue, w;
 84.2314 +
 84.2315 +                  red   = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2;
 84.2316 +                  green = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2;
 84.2317 +                  blue  = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2;
 84.2318 +
 84.2319 +                  if (red == green && red == blue)
 84.2320 +                     w = red;
 84.2321 +                  else
 84.2322 +                  {
 84.2323 +                     png_uint_16 red_1   = png_ptr->gamma_16_to_1[(red&0xff) >>
 84.2324 +                                  png_ptr->gamma_shift][red>>8];
 84.2325 +                     png_uint_16 green_1 = png_ptr->gamma_16_to_1[(green&0xff) >>
 84.2326 +                                  png_ptr->gamma_shift][green>>8];
 84.2327 +                     png_uint_16 blue_1  = png_ptr->gamma_16_to_1[(blue&0xff) >>
 84.2328 +                                  png_ptr->gamma_shift][blue>>8];
 84.2329 +                     png_uint_16 gray16  = (png_uint_16)((rc*red_1 + gc*green_1
 84.2330 +                                  + bc*blue_1)>>15);
 84.2331 +                     w = png_ptr->gamma_16_from_1[(gray16&0xff) >>
 84.2332 +                         png_ptr->gamma_shift][gray16 >> 8];
 84.2333 +                     rgb_error |= 1;
 84.2334 +                  }
 84.2335 +
 84.2336 +                  *(dp++) = (png_byte)((w>>8) & 0xff);
 84.2337 +                  *(dp++) = (png_byte)(w & 0xff);
 84.2338 +               }
 84.2339 +            }
 84.2340 +            else
 84.2341 +#endif
 84.2342 +            {
 84.2343 +               png_bytep sp = row;
 84.2344 +               png_bytep dp = row;
 84.2345 +               for (i = 0; i < row_width; i++)
 84.2346 +               {
 84.2347 +                  png_uint_16 red, green, blue, gray16;
 84.2348 +
 84.2349 +                  red   = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2;
 84.2350 +                  green = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2;
 84.2351 +                  blue  = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2;
 84.2352 +
 84.2353 +                  if (red != green || red != blue)
 84.2354 +                     rgb_error |= 1;
 84.2355 +                  gray16  = (png_uint_16)((rc*red + gc*green + bc*blue)>>15);
 84.2356 +                  *(dp++) = (png_byte)((gray16>>8) & 0xff);
 84.2357 +                  *(dp++) = (png_byte)(gray16 & 0xff);
 84.2358 +               }
 84.2359 +            }
 84.2360 +         }
 84.2361 +      }
 84.2362 +      if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
 84.2363 +      {
 84.2364 +         if (row_info->bit_depth == 8)
 84.2365 +         {
 84.2366 +#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED)
 84.2367 +            if (png_ptr->gamma_from_1 != NULL && png_ptr->gamma_to_1 != NULL)
 84.2368 +            {
 84.2369 +               png_bytep sp = row;
 84.2370 +               png_bytep dp = row;
 84.2371 +               for (i = 0; i < row_width; i++)
 84.2372 +               {
 84.2373 +                  png_byte red   = png_ptr->gamma_to_1[*(sp++)];
 84.2374 +                  png_byte green = png_ptr->gamma_to_1[*(sp++)];
 84.2375 +                  png_byte blue  = png_ptr->gamma_to_1[*(sp++)];
 84.2376 +                  if (red != green || red != blue)
 84.2377 +                     rgb_error |= 1;
 84.2378 +                  *(dp++) =  png_ptr->gamma_from_1
 84.2379 +                             [(rc*red + gc*green + bc*blue)>>15];
 84.2380 +                  *(dp++) = *(sp++);  /* alpha */
 84.2381 +               }
 84.2382 +            }
 84.2383 +            else
 84.2384 +#endif
 84.2385 +            {
 84.2386 +               png_bytep sp = row;
 84.2387 +               png_bytep dp = row;
 84.2388 +               for (i = 0; i < row_width; i++)
 84.2389 +               {
 84.2390 +                  png_byte red   = *(sp++);
 84.2391 +                  png_byte green = *(sp++);
 84.2392 +                  png_byte blue  = *(sp++);
 84.2393 +                  if (red != green || red != blue)
 84.2394 +                     rgb_error |= 1;
 84.2395 +                  *(dp++) =  (png_byte)((rc*red + gc*green + bc*blue)>>15);
 84.2396 +                  *(dp++) = *(sp++);  /* alpha */
 84.2397 +               }
 84.2398 +            }
 84.2399 +         }
 84.2400 +         else /* RGBA bit_depth == 16 */
 84.2401 +         {
 84.2402 +#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED)
 84.2403 +            if (png_ptr->gamma_16_to_1 != NULL &&
 84.2404 +                png_ptr->gamma_16_from_1 != NULL)
 84.2405 +            {
 84.2406 +               png_bytep sp = row;
 84.2407 +               png_bytep dp = row;
 84.2408 +               for (i = 0; i < row_width; i++)
 84.2409 +               {
 84.2410 +                  png_uint_16 red, green, blue, w;
 84.2411 +
 84.2412 +                  red   = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2;
 84.2413 +                  green = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2;
 84.2414 +                  blue  = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2;
 84.2415 +
 84.2416 +                  if (red == green && red == blue)
 84.2417 +                     w = red;
 84.2418 +                  else
 84.2419 +                  {
 84.2420 +                     png_uint_16 red_1   = png_ptr->gamma_16_to_1[(red&0xff) >>
 84.2421 +                                  png_ptr->gamma_shift][red>>8];
 84.2422 +                     png_uint_16 green_1 = png_ptr->gamma_16_to_1[(green&0xff) >>
 84.2423 +                                  png_ptr->gamma_shift][green>>8];
 84.2424 +                     png_uint_16 blue_1  = png_ptr->gamma_16_to_1[(blue&0xff) >>
 84.2425 +                                  png_ptr->gamma_shift][blue>>8];
 84.2426 +                     png_uint_16 gray16  = (png_uint_16)((rc * red_1
 84.2427 +                                  + gc * green_1 + bc * blue_1)>>15);
 84.2428 +                     w = png_ptr->gamma_16_from_1[(gray16&0xff) >>
 84.2429 +                         png_ptr->gamma_shift][gray16 >> 8];
 84.2430 +                     rgb_error |= 1;
 84.2431 +                  }
 84.2432 +
 84.2433 +                  *(dp++) = (png_byte)((w>>8) & 0xff);
 84.2434 +                  *(dp++) = (png_byte)(w & 0xff);
 84.2435 +                  *(dp++) = *(sp++);  /* alpha */
 84.2436 +                  *(dp++) = *(sp++);
 84.2437 +               }
 84.2438 +            }
 84.2439 +            else
 84.2440 +#endif
 84.2441 +            {
 84.2442 +               png_bytep sp = row;
 84.2443 +               png_bytep dp = row;
 84.2444 +               for (i = 0; i < row_width; i++)
 84.2445 +               {
 84.2446 +                  png_uint_16 red, green, blue, gray16;
 84.2447 +                  red   = (png_uint_16)((*(sp)<<8) | *(sp+1)); sp+=2;
 84.2448 +                  green = (png_uint_16)((*(sp)<<8) | *(sp+1)); sp+=2;
 84.2449 +                  blue  = (png_uint_16)((*(sp)<<8) | *(sp+1)); sp+=2;
 84.2450 +                  if (red != green || red != blue)
 84.2451 +                     rgb_error |= 1;
 84.2452 +                  gray16  = (png_uint_16)((rc*red + gc*green + bc*blue)>>15);
 84.2453 +                  *(dp++) = (png_byte)((gray16>>8) & 0xff);
 84.2454 +                  *(dp++) = (png_byte)(gray16 & 0xff);
 84.2455 +                  *(dp++) = *(sp++);  /* alpha */
 84.2456 +                  *(dp++) = *(sp++);
 84.2457 +               }
 84.2458 +            }
 84.2459 +         }
 84.2460 +      }
 84.2461 +   row_info->channels -= (png_byte)2;
 84.2462 +      row_info->color_type &= ~PNG_COLOR_MASK_COLOR;
 84.2463 +      row_info->pixel_depth = (png_byte)(row_info->channels *
 84.2464 +         row_info->bit_depth);
 84.2465 +      row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, row_width);
 84.2466 +   }
 84.2467 +   return rgb_error;
 84.2468 +}
 84.2469 +#endif
 84.2470 +
 84.2471 +/* Build a grayscale palette.  Palette is assumed to be 1 << bit_depth
 84.2472 + * large of png_color.  This lets grayscale images be treated as
 84.2473 + * paletted.  Most useful for gamma correction and simplification
 84.2474 + * of code.
 84.2475 + */
 84.2476 +void PNGAPI
 84.2477 +png_build_grayscale_palette(int bit_depth, png_colorp palette)
 84.2478 +{
 84.2479 +   int num_palette;
 84.2480 +   int color_inc;
 84.2481 +   int i;
 84.2482 +   int v;
 84.2483 +
 84.2484 +   png_debug(1, "in png_do_build_grayscale_palette\n");
 84.2485 +   if (palette == NULL)
 84.2486 +      return;
 84.2487 +
 84.2488 +   switch (bit_depth)
 84.2489 +   {
 84.2490 +      case 1:
 84.2491 +         num_palette = 2;
 84.2492 +         color_inc = 0xff;
 84.2493 +         break;
 84.2494 +      case 2:
 84.2495 +         num_palette = 4;
 84.2496 +         color_inc = 0x55;
 84.2497 +         break;
 84.2498 +      case 4:
 84.2499 +         num_palette = 16;
 84.2500 +         color_inc = 0x11;
 84.2501 +         break;
 84.2502 +      case 8:
 84.2503 +         num_palette = 256;
 84.2504 +         color_inc = 1;
 84.2505 +         break;
 84.2506 +      default:
 84.2507 +         num_palette = 0;
 84.2508 +         color_inc = 0;
 84.2509 +         break;
 84.2510 +   }
 84.2511 +
 84.2512 +   for (i = 0, v = 0; i < num_palette; i++, v += color_inc)
 84.2513 +   {
 84.2514 +      palette[i].red = (png_byte)v;
 84.2515 +      palette[i].green = (png_byte)v;
 84.2516 +      palette[i].blue = (png_byte)v;
 84.2517 +   }
 84.2518 +}
 84.2519 +
 84.2520 +/* This function is currently unused.  Do we really need it? */
 84.2521 +#if defined(PNG_READ_DITHER_SUPPORTED) && defined(PNG_CORRECT_PALETTE_SUPPORTED)
 84.2522 +void /* PRIVATE */
 84.2523 +png_correct_palette(png_structp png_ptr, png_colorp palette,
 84.2524 +   int num_palette)
 84.2525 +{
 84.2526 +   png_debug(1, "in png_correct_palette\n");
 84.2527 +#if defined(PNG_READ_BACKGROUND_SUPPORTED) && \
 84.2528 +    defined(PNG_READ_GAMMA_SUPPORTED) && defined(PNG_FLOATING_POINT_SUPPORTED)
 84.2529 +   if (png_ptr->transformations & (PNG_GAMMA | PNG_BACKGROUND))
 84.2530 +   {
 84.2531 +      png_color back, back_1;
 84.2532 +
 84.2533 +      if (png_ptr->background_gamma_type == PNG_BACKGROUND_GAMMA_FILE)
 84.2534 +      {
 84.2535 +         back.red = png_ptr->gamma_table[png_ptr->background.red];
 84.2536 +         back.green = png_ptr->gamma_table[png_ptr->background.green];
 84.2537 +         back.blue = png_ptr->gamma_table[png_ptr->background.blue];
 84.2538 +
 84.2539 +         back_1.red = png_ptr->gamma_to_1[png_ptr->background.red];
 84.2540 +         back_1.green = png_ptr->gamma_to_1[png_ptr->background.green];
 84.2541 +         back_1.blue = png_ptr->gamma_to_1[png_ptr->background.blue];
 84.2542 +      }
 84.2543 +      else
 84.2544 +      {
 84.2545 +         double g;
 84.2546 +
 84.2547 +         g = 1.0 / (png_ptr->background_gamma * png_ptr->screen_gamma);
 84.2548 +
 84.2549 +         if (png_ptr->background_gamma_type == PNG_BACKGROUND_GAMMA_SCREEN ||
 84.2550 +             fabs(g - 1.0) < PNG_GAMMA_THRESHOLD)
 84.2551 +         {
 84.2552 +            back.red = png_ptr->background.red;
 84.2553 +            back.green = png_ptr->background.green;
 84.2554 +            back.blue = png_ptr->background.blue;
 84.2555 +         }
 84.2556 +         else
 84.2557 +         {
 84.2558 +            back.red =
 84.2559 +               (png_byte)(pow((double)png_ptr->background.red/255, g) *
 84.2560 +                255.0 + 0.5);
 84.2561 +            back.green =
 84.2562 +               (png_byte)(pow((double)png_ptr->background.green/255, g) *
 84.2563 +                255.0 + 0.5);
 84.2564 +            back.blue =
 84.2565 +               (png_byte)(pow((double)png_ptr->background.blue/255, g) *
 84.2566 +                255.0 + 0.5);
 84.2567 +         }
 84.2568 +
 84.2569 +         g = 1.0 / png_ptr->background_gamma;
 84.2570 +
 84.2571 +         back_1.red =
 84.2572 +            (png_byte)(pow((double)png_ptr->background.red/255, g) *
 84.2573 +             255.0 + 0.5);
 84.2574 +         back_1.green =
 84.2575 +            (png_byte)(pow((double)png_ptr->background.green/255, g) *
 84.2576 +             255.0 + 0.5);
 84.2577 +         back_1.blue =
 84.2578 +            (png_byte)(pow((double)png_ptr->background.blue/255, g) *
 84.2579 +             255.0 + 0.5);
 84.2580 +      }
 84.2581 +
 84.2582 +      if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
 84.2583 +      {
 84.2584 +         png_uint_32 i;
 84.2585 +
 84.2586 +         for (i = 0; i < (png_uint_32)num_palette; i++)
 84.2587 +         {
 84.2588 +            if (i < png_ptr->num_trans && png_ptr->trans[i] == 0)
 84.2589 +            {
 84.2590 +               palette[i] = back;
 84.2591 +            }
 84.2592 +            else if (i < png_ptr->num_trans && png_ptr->trans[i] != 0xff)
 84.2593 +            {
 84.2594 +               png_byte v, w;
 84.2595 +
 84.2596 +               v = png_ptr->gamma_to_1[png_ptr->palette[i].red];
 84.2597 +               png_composite(w, v, png_ptr->trans[i], back_1.red);
 84.2598 +               palette[i].red = png_ptr->gamma_from_1[w];
 84.2599 +
 84.2600 +               v = png_ptr->gamma_to_1[png_ptr->palette[i].green];
 84.2601 +               png_composite(w, v, png_ptr->trans[i], back_1.green);
 84.2602 +               palette[i].green = png_ptr->gamma_from_1[w];
 84.2603 +
 84.2604 +               v = png_ptr->gamma_to_1[png_ptr->palette[i].blue];
 84.2605 +               png_composite(w, v, png_ptr->trans[i], back_1.blue);
 84.2606 +               palette[i].blue = png_ptr->gamma_from_1[w];
 84.2607 +            }
 84.2608 +            else
 84.2609 +            {
 84.2610 +               palette[i].red = png_ptr->gamma_table[palette[i].red];
 84.2611 +               palette[i].green = png_ptr->gamma_table[palette[i].green];
 84.2612 +               palette[i].blue = png_ptr->gamma_table[palette[i].blue];
 84.2613 +            }
 84.2614 +         }
 84.2615 +      }
 84.2616 +      else
 84.2617 +      {
 84.2618 +         int i;
 84.2619 +
 84.2620 +         for (i = 0; i < num_palette; i++)
 84.2621 +         {
 84.2622 +            if (palette[i].red == (png_byte)png_ptr->trans_values.gray)
 84.2623 +            {
 84.2624 +               palette[i] = back;
 84.2625 +            }
 84.2626 +            else
 84.2627 +            {
 84.2628 +               palette[i].red = png_ptr->gamma_table[palette[i].red];
 84.2629 +               palette[i].green = png_ptr->gamma_table[palette[i].green];
 84.2630 +               palette[i].blue = png_ptr->gamma_table[palette[i].blue];
 84.2631 +            }
 84.2632 +         }
 84.2633 +      }
 84.2634 +   }
 84.2635 +   else
 84.2636 +#endif
 84.2637 +#if defined(PNG_READ_GAMMA_SUPPORTED)
 84.2638 +   if (png_ptr->transformations & PNG_GAMMA)
 84.2639 +   {
 84.2640 +      int i;
 84.2641 +
 84.2642 +      for (i = 0; i < num_palette; i++)
 84.2643 +      {
 84.2644 +         palette[i].red = png_ptr->gamma_table[palette[i].red];
 84.2645 +         palette[i].green = png_ptr->gamma_table[palette[i].green];
 84.2646 +         palette[i].blue = png_ptr->gamma_table[palette[i].blue];
 84.2647 +      }
 84.2648 +   }
 84.2649 +#if defined(PNG_READ_BACKGROUND_SUPPORTED)
 84.2650 +   else
 84.2651 +#endif
 84.2652 +#endif
 84.2653 +#if defined(PNG_READ_BACKGROUND_SUPPORTED)
 84.2654 +   if (png_ptr->transformations & PNG_BACKGROUND)
 84.2655 +   {
 84.2656 +      if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
 84.2657 +      {
 84.2658 +         png_color back;
 84.2659 +
 84.2660 +         back.red   = (png_byte)png_ptr->background.red;
 84.2661 +         back.green = (png_byte)png_ptr->background.green;
 84.2662 +         back.blue  = (png_byte)png_ptr->background.blue;
 84.2663 +
 84.2664 +         for (i = 0; i < (int)png_ptr->num_trans; i++)
 84.2665 +         {
 84.2666 +            if (png_ptr->trans[i] == 0)
 84.2667 +            {
 84.2668 +               palette[i].red = back.red;
 84.2669 +               palette[i].green = back.green;
 84.2670 +               palette[i].blue = back.blue;
 84.2671 +            }
 84.2672 +            else if (png_ptr->trans[i] != 0xff)
 84.2673 +            {
 84.2674 +               png_composite(palette[i].red, png_ptr->palette[i].red,
 84.2675 +                  png_ptr->trans[i], back.red);
 84.2676 +               png_composite(palette[i].green, png_ptr->palette[i].green,
 84.2677 +                  png_ptr->trans[i], back.green);
 84.2678 +               png_composite(palette[i].blue, png_ptr->palette[i].blue,
 84.2679 +                  png_ptr->trans[i], back.blue);
 84.2680 +            }
 84.2681 +         }
 84.2682 +      }
 84.2683 +      else /* assume grayscale palette (what else could it be?) */
 84.2684 +      {
 84.2685 +         int i;
 84.2686 +
 84.2687 +         for (i = 0; i < num_palette; i++)
 84.2688 +         {
 84.2689 +            if (i == (png_byte)png_ptr->trans_values.gray)
 84.2690 +            {
 84.2691 +               palette[i].red = (png_byte)png_ptr->background.red;
 84.2692 +               palette[i].green = (png_byte)png_ptr->background.green;
 84.2693 +               palette[i].blue = (png_byte)png_ptr->background.blue;
 84.2694 +            }
 84.2695 +         }
 84.2696 +      }
 84.2697 +   }
 84.2698 +#endif
 84.2699 +}
 84.2700 +#endif
 84.2701 +
 84.2702 +#if defined(PNG_READ_BACKGROUND_SUPPORTED)
 84.2703 +/* Replace any alpha or transparency with the supplied background color.
 84.2704 + * "background" is already in the screen gamma, while "background_1" is
 84.2705 + * at a gamma of 1.0.  Paletted files have already been taken care of.
 84.2706 + */
 84.2707 +void /* PRIVATE */
 84.2708 +png_do_background(png_row_infop row_info, png_bytep row,
 84.2709 +   png_color_16p trans_values, png_color_16p background
 84.2710 +#if defined(PNG_READ_GAMMA_SUPPORTED)
 84.2711 +   , png_color_16p background_1,
 84.2712 +   png_bytep gamma_table, png_bytep gamma_from_1, png_bytep gamma_to_1,
 84.2713 +   png_uint_16pp gamma_16, png_uint_16pp gamma_16_from_1,
 84.2714 +   png_uint_16pp gamma_16_to_1, int gamma_shift
 84.2715 +#endif
 84.2716 +   )
 84.2717 +{
 84.2718 +   png_bytep sp, dp;
 84.2719 +   png_uint_32 i;
 84.2720 +   png_uint_32 row_width=row_info->width;
 84.2721 +   int shift;
 84.2722 +
 84.2723 +   png_debug(1, "in png_do_background\n");
 84.2724 +   if (background != NULL &&
 84.2725 +#if defined(PNG_USELESS_TESTS_SUPPORTED)
 84.2726 +       row != NULL && row_info != NULL &&
 84.2727 +#endif
 84.2728 +      (!(row_info->color_type & PNG_COLOR_MASK_ALPHA) ||
 84.2729 +      (row_info->color_type != PNG_COLOR_TYPE_PALETTE && trans_values)))
 84.2730 +   {
 84.2731 +      switch (row_info->color_type)
 84.2732 +      {
 84.2733 +         case PNG_COLOR_TYPE_GRAY:
 84.2734 +         {
 84.2735 +            switch (row_info->bit_depth)
 84.2736 +            {
 84.2737 +               case 1:
 84.2738 +               {
 84.2739 +                  sp = row;
 84.2740 +                  shift = 7;
 84.2741 +                  for (i = 0; i < row_width; i++)
 84.2742 +                  {
 84.2743 +                     if ((png_uint_16)((*sp >> shift) & 0x01)
 84.2744 +                        == trans_values->gray)
 84.2745 +                     {
 84.2746 +                        *sp &= (png_byte)((0x7f7f >> (7 - shift)) & 0xff);
 84.2747 +                        *sp |= (png_byte)(background->gray << shift);
 84.2748 +                     }
 84.2749 +                     if (!shift)
 84.2750 +                     {
 84.2751 +                        shift = 7;
 84.2752 +                        sp++;
 84.2753 +                     }
 84.2754 +                     else
 84.2755 +                        shift--;
 84.2756 +                  }
 84.2757 +                  break;
 84.2758 +               }
 84.2759 +               case 2:
 84.2760 +               {
 84.2761 +#if defined(PNG_READ_GAMMA_SUPPORTED)
 84.2762 +                  if (gamma_table != NULL)
 84.2763 +                  {
 84.2764 +                     sp = row;
 84.2765 +                     shift = 6;
 84.2766 +                     for (i = 0; i < row_width; i++)
 84.2767 +                     {
 84.2768 +                        if ((png_uint_16)((*sp >> shift) & 0x03)
 84.2769 +                            == trans_values->gray)
 84.2770 +                        {
 84.2771 +                           *sp &= (png_byte)((0x3f3f >> (6 - shift)) & 0xff);
 84.2772 +                           *sp |= (png_byte)(background->gray << shift);
 84.2773 +                        }
 84.2774 +                        else
 84.2775 +                        {
 84.2776 +                           png_byte p = (png_byte)((*sp >> shift) & 0x03);
 84.2777 +                           png_byte g = (png_byte)((gamma_table [p | (p << 2) |
 84.2778 +                               (p << 4) | (p << 6)] >> 6) & 0x03);
 84.2779 +                           *sp &= (png_byte)((0x3f3f >> (6 - shift)) & 0xff);
 84.2780 +                           *sp |= (png_byte)(g << shift);
 84.2781 +                        }
 84.2782 +                        if (!shift)
 84.2783 +                        {
 84.2784 +                           shift = 6;
 84.2785 +                           sp++;
 84.2786 +                        }
 84.2787 +                        else
 84.2788 +                           shift -= 2;
 84.2789 +                     }
 84.2790 +                  }
 84.2791 +                  else
 84.2792 +#endif
 84.2793 +                  {
 84.2794 +                     sp = row;
 84.2795 +                     shift = 6;
 84.2796 +                     for (i = 0; i < row_width; i++)
 84.2797 +                     {
 84.2798 +                        if ((png_uint_16)((*sp >> shift) & 0x03)
 84.2799 +                            == trans_values->gray)
 84.2800 +                        {
 84.2801 +                           *sp &= (png_byte)((0x3f3f >> (6 - shift)) & 0xff);
 84.2802 +                           *sp |= (png_byte)(background->gray << shift);
 84.2803 +                        }
 84.2804 +                        if (!shift)
 84.2805 +                        {
 84.2806 +                           shift = 6;
 84.2807 +                           sp++;
 84.2808 +                        }
 84.2809 +                        else
 84.2810 +                           shift -= 2;
 84.2811 +                     }
 84.2812 +                  }
 84.2813 +                  break;
 84.2814 +               }
 84.2815 +               case 4:
 84.2816 +               {
 84.2817 +#if defined(PNG_READ_GAMMA_SUPPORTED)
 84.2818 +                  if (gamma_table != NULL)
 84.2819 +                  {
 84.2820 +                     sp = row;
 84.2821 +                     shift = 4;
 84.2822 +                     for (i = 0; i < row_width; i++)
 84.2823 +                     {
 84.2824 +                        if ((png_uint_16)((*sp >> shift) & 0x0f)
 84.2825 +                            == trans_values->gray)
 84.2826 +                        {
 84.2827 +                           *sp &= (png_byte)((0xf0f >> (4 - shift)) & 0xff);
 84.2828 +                           *sp |= (png_byte)(background->gray << shift);
 84.2829 +                        }
 84.2830 +                        else
 84.2831 +                        {
 84.2832 +                           png_byte p = (png_byte)((*sp >> shift) & 0x0f);
 84.2833 +                           png_byte g = (png_byte)((gamma_table[p |
 84.2834 +                             (p << 4)] >> 4) & 0x0f);
 84.2835 +                           *sp &= (png_byte)((0xf0f >> (4 - shift)) & 0xff);
 84.2836 +                           *sp |= (png_byte)(g << shift);
 84.2837 +                        }
 84.2838 +                        if (!shift)
 84.2839 +                        {
 84.2840 +                           shift = 4;
 84.2841 +                           sp++;
 84.2842 +                        }
 84.2843 +                        else
 84.2844 +                           shift -= 4;
 84.2845 +                     }
 84.2846 +                  }
 84.2847 +                  else
 84.2848 +#endif
 84.2849 +                  {
 84.2850 +                     sp = row;
 84.2851 +                     shift = 4;
 84.2852 +                     for (i = 0; i < row_width; i++)
 84.2853 +                     {
 84.2854 +                        if ((png_uint_16)((*sp >> shift) & 0x0f)
 84.2855 +                            == trans_values->gray)
 84.2856 +                        {
 84.2857 +                           *sp &= (png_byte)((0xf0f >> (4 - shift)) & 0xff);
 84.2858 +                           *sp |= (png_byte)(background->gray << shift);
 84.2859 +                        }
 84.2860 +                        if (!shift)
 84.2861 +                        {
 84.2862 +                           shift = 4;
 84.2863 +                           sp++;
 84.2864 +                        }
 84.2865 +                        else
 84.2866 +                           shift -= 4;
 84.2867 +                     }
 84.2868 +                  }
 84.2869 +                  break;
 84.2870 +               }
 84.2871 +               case 8:
 84.2872 +               {
 84.2873 +#if defined(PNG_READ_GAMMA_SUPPORTED)
 84.2874 +                  if (gamma_table != NULL)
 84.2875 +                  {
 84.2876 +                     sp = row;
 84.2877 +                     for (i = 0; i < row_width; i++, sp++)
 84.2878 +                     {
 84.2879 +                        if (*sp == trans_values->gray)
 84.2880 +                        {
 84.2881 +                           *sp = (png_byte)background->gray;
 84.2882 +                        }
 84.2883 +                        else
 84.2884 +                        {
 84.2885 +                           *sp = gamma_table[*sp];
 84.2886 +                        }
 84.2887 +                     }
 84.2888 +                  }
 84.2889 +                  else
 84.2890 +#endif
 84.2891 +                  {
 84.2892 +                     sp = row;
 84.2893 +                     for (i = 0; i < row_width; i++, sp++)
 84.2894 +                     {
 84.2895 +                        if (*sp == trans_values->gray)
 84.2896 +                        {
 84.2897 +                           *sp = (png_byte)background->gray;
 84.2898 +                        }
 84.2899 +                     }
 84.2900 +                  }
 84.2901 +                  break;
 84.2902 +               }
 84.2903 +               case 16:
 84.2904 +               {
 84.2905 +#if defined(PNG_READ_GAMMA_SUPPORTED)
 84.2906 +                  if (gamma_16 != NULL)
 84.2907 +                  {
 84.2908 +                     sp = row;
 84.2909 +                     for (i = 0; i < row_width; i++, sp += 2)
 84.2910 +                     {
 84.2911 +                        png_uint_16 v;
 84.2912 +
 84.2913 +                        v = (png_uint_16)(((*sp) << 8) + *(sp + 1));
 84.2914 +                        if (v == trans_values->gray)
 84.2915 +                        {
 84.2916 +                           /* background is already in screen gamma */
 84.2917 +                           *sp = (png_byte)((background->gray >> 8) & 0xff);
 84.2918 +                           *(sp + 1) = (png_byte)(background->gray & 0xff);
 84.2919 +                        }
 84.2920 +                        else
 84.2921 +                        {
 84.2922 +                           v = gamma_16[*(sp + 1) >> gamma_shift][*sp];
 84.2923 +                           *sp = (png_byte)((v >> 8) & 0xff);
 84.2924 +                           *(sp + 1) = (png_byte)(v & 0xff);
 84.2925 +                        }
 84.2926 +                     }
 84.2927 +                  }
 84.2928 +                  else
 84.2929 +#endif
 84.2930 +                  {
 84.2931 +                     sp = row;
 84.2932 +                     for (i = 0; i < row_width; i++, sp += 2)
 84.2933 +                     {
 84.2934 +                        png_uint_16 v;
 84.2935 +
 84.2936 +                        v = (png_uint_16)(((*sp) << 8) + *(sp + 1));
 84.2937 +                        if (v == trans_values->gray)
 84.2938 +                        {
 84.2939 +                           *sp = (png_byte)((background->gray >> 8) & 0xff);
 84.2940 +                           *(sp + 1) = (png_byte)(background->gray & 0xff);
 84.2941 +                        }
 84.2942 +                     }
 84.2943 +                  }
 84.2944 +                  break;
 84.2945 +               }
 84.2946 +            }
 84.2947 +            break;
 84.2948 +         }
 84.2949 +         case PNG_COLOR_TYPE_RGB:
 84.2950 +         {
 84.2951 +            if (row_info->bit_depth == 8)
 84.2952 +            {
 84.2953 +#if defined(PNG_READ_GAMMA_SUPPORTED)
 84.2954 +               if (gamma_table != NULL)
 84.2955 +               {
 84.2956 +                  sp = row;
 84.2957 +                  for (i = 0; i < row_width; i++, sp += 3)
 84.2958 +                  {
 84.2959 +                     if (*sp == trans_values->red &&
 84.2960 +                        *(sp + 1) == trans_values->green &&
 84.2961 +                        *(sp + 2) == trans_values->blue)
 84.2962 +                     {
 84.2963 +                        *sp = (png_byte)background->red;
 84.2964 +                        *(sp + 1) = (png_byte)background->green;
 84.2965 +                        *(sp + 2) = (png_byte)background->blue;
 84.2966 +                     }
 84.2967 +                     else
 84.2968 +                     {
 84.2969 +                        *sp = gamma_table[*sp];
 84.2970 +                        *(sp + 1) = gamma_table[*(sp + 1)];
 84.2971 +                        *(sp + 2) = gamma_table[*(sp + 2)];
 84.2972 +                     }
 84.2973 +                  }
 84.2974 +               }
 84.2975 +               else
 84.2976 +#endif
 84.2977 +               {
 84.2978 +                  sp = row;
 84.2979 +                  for (i = 0; i < row_width; i++, sp += 3)
 84.2980 +                  {
 84.2981 +                     if (*sp == trans_values->red &&
 84.2982 +                        *(sp + 1) == trans_values->green &&
 84.2983 +                        *(sp + 2) == trans_values->blue)
 84.2984 +                     {
 84.2985 +                        *sp = (png_byte)background->red;
 84.2986 +                        *(sp + 1) = (png_byte)background->green;
 84.2987 +                        *(sp + 2) = (png_byte)background->blue;
 84.2988 +                     }
 84.2989 +                  }
 84.2990 +               }
 84.2991 +            }
 84.2992 +            else /* if (row_info->bit_depth == 16) */
 84.2993 +            {
 84.2994 +#if defined(PNG_READ_GAMMA_SUPPORTED)
 84.2995 +               if (gamma_16 != NULL)
 84.2996 +               {
 84.2997 +                  sp = row;
 84.2998 +                  for (i = 0; i < row_width; i++, sp += 6)
 84.2999 +                  {
 84.3000 +                     png_uint_16 r = (png_uint_16)(((*sp) << 8) + *(sp + 1));
 84.3001 +                     png_uint_16 g = (png_uint_16)(((*(sp+2)) << 8) + *(sp+3));
 84.3002 +                     png_uint_16 b = (png_uint_16)(((*(sp+4)) << 8) + *(sp+5));
 84.3003 +                     if (r == trans_values->red && g == trans_values->green &&
 84.3004 +                        b == trans_values->blue)
 84.3005 +                     {
 84.3006 +                        /* background is already in screen gamma */
 84.3007 +                        *sp = (png_byte)((background->red >> 8) & 0xff);
 84.3008 +                        *(sp + 1) = (png_byte)(background->red & 0xff);
 84.3009 +                        *(sp + 2) = (png_byte)((background->green >> 8) & 0xff);
 84.3010 +                        *(sp + 3) = (png_byte)(background->green & 0xff);
 84.3011 +                        *(sp + 4) = (png_byte)((background->blue >> 8) & 0xff);
 84.3012 +                        *(sp + 5) = (png_byte)(background->blue & 0xff);
 84.3013 +                     }
 84.3014 +                     else
 84.3015 +                     {
 84.3016 +                        png_uint_16 v = gamma_16[*(sp + 1) >> gamma_shift][*sp];
 84.3017 +                        *sp = (png_byte)((v >> 8) & 0xff);
 84.3018 +                        *(sp + 1) = (png_byte)(v & 0xff);
 84.3019 +                        v = gamma_16[*(sp + 3) >> gamma_shift][*(sp + 2)];
 84.3020 +                        *(sp + 2) = (png_byte)((v >> 8) & 0xff);
 84.3021 +                        *(sp + 3) = (png_byte)(v & 0xff);
 84.3022 +                        v = gamma_16[*(sp + 5) >> gamma_shift][*(sp + 4)];
 84.3023 +                        *(sp + 4) = (png_byte)((v >> 8) & 0xff);
 84.3024 +                        *(sp + 5) = (png_byte)(v & 0xff);
 84.3025 +                     }
 84.3026 +                  }
 84.3027 +               }
 84.3028 +               else
 84.3029 +#endif
 84.3030 +               {
 84.3031 +                  sp = row;
 84.3032 +                  for (i = 0; i < row_width; i++, sp += 6)
 84.3033 +                  {
 84.3034 +                     png_uint_16 r = (png_uint_16)(((*sp) << 8) + *(sp+1));
 84.3035 +                     png_uint_16 g = (png_uint_16)(((*(sp+2)) << 8) + *(sp+3));
 84.3036 +                     png_uint_16 b = (png_uint_16)(((*(sp+4)) << 8) + *(sp+5));
 84.3037 +
 84.3038 +                     if (r == trans_values->red && g == trans_values->green &&
 84.3039 +                        b == trans_values->blue)
 84.3040 +                     {
 84.3041 +                        *sp = (png_byte)((background->red >> 8) & 0xff);
 84.3042 +                        *(sp + 1) = (png_byte)(background->red & 0xff);
 84.3043 +                        *(sp + 2) = (png_byte)((background->green >> 8) & 0xff);
 84.3044 +                        *(sp + 3) = (png_byte)(background->green & 0xff);
 84.3045 +                        *(sp + 4) = (png_byte)((background->blue >> 8) & 0xff);
 84.3046 +                        *(sp + 5) = (png_byte)(background->blue & 0xff);
 84.3047 +                     }
 84.3048 +                  }
 84.3049 +               }
 84.3050 +            }
 84.3051 +            break;
 84.3052 +         }
 84.3053 +         case PNG_COLOR_TYPE_GRAY_ALPHA:
 84.3054 +         {
 84.3055 +            if (row_info->bit_depth == 8)
 84.3056 +            {
 84.3057 +#if defined(PNG_READ_GAMMA_SUPPORTED)
 84.3058 +               if (gamma_to_1 != NULL && gamma_from_1 != NULL &&
 84.3059 +                   gamma_table != NULL)
 84.3060 +               {
 84.3061 +                  sp = row;
 84.3062 +                  dp = row;
 84.3063 +                  for (i = 0; i < row_width; i++, sp += 2, dp++)
 84.3064 +                  {
 84.3065 +                     png_uint_16 a = *(sp + 1);
 84.3066 +
 84.3067 +                     if (a == 0xff)
 84.3068 +                     {
 84.3069 +                        *dp = gamma_table[*sp];
 84.3070 +                     }
 84.3071 +                     else if (a == 0)
 84.3072 +                     {
 84.3073 +                        /* background is already in screen gamma */
 84.3074 +                        *dp = (png_byte)background->gray;
 84.3075 +                     }
 84.3076 +                     else
 84.3077 +                     {
 84.3078 +                        png_byte v, w;
 84.3079 +
 84.3080 +                        v = gamma_to_1[*sp];
 84.3081 +                        png_composite(w, v, a, background_1->gray);
 84.3082 +                        *dp = gamma_from_1[w];
 84.3083 +                     }
 84.3084 +                  }
 84.3085 +               }
 84.3086 +               else
 84.3087 +#endif
 84.3088 +               {
 84.3089 +                  sp = row;
 84.3090 +                  dp = row;
 84.3091 +                  for (i = 0; i < row_width; i++, sp += 2, dp++)
 84.3092 +                  {
 84.3093 +                     png_byte a = *(sp + 1);
 84.3094 +
 84.3095 +                     if (a == 0xff)
 84.3096 +                     {
 84.3097 +                        *dp = *sp;
 84.3098 +                     }
 84.3099 +#if defined(PNG_READ_GAMMA_SUPPORTED)
 84.3100 +                     else if (a == 0)
 84.3101 +                     {
 84.3102 +                        *dp = (png_byte)background->gray;
 84.3103 +                     }
 84.3104 +                     else
 84.3105 +                     {
 84.3106 +                        png_composite(*dp, *sp, a, background_1->gray);
 84.3107 +                     }
 84.3108 +#else
 84.3109 +                     *dp = (png_byte)background->gray;
 84.3110 +#endif
 84.3111 +                  }
 84.3112 +               }
 84.3113 +            }
 84.3114 +            else /* if (png_ptr->bit_depth == 16) */
 84.3115 +            {
 84.3116 +#if defined(PNG_READ_GAMMA_SUPPORTED)
 84.3117 +               if (gamma_16 != NULL && gamma_16_from_1 != NULL &&
 84.3118 +                   gamma_16_to_1 != NULL)
 84.3119 +               {
 84.3120 +                  sp = row;
 84.3121 +                  dp = row;
 84.3122 +                  for (i = 0; i < row_width; i++, sp += 4, dp += 2)
 84.3123 +                  {
 84.3124 +                     png_uint_16 a = (png_uint_16)(((*(sp+2)) << 8) + *(sp+3));
 84.3125 +
 84.3126 +                     if (a == (png_uint_16)0xffff)
 84.3127 +                     {
 84.3128 +                        png_uint_16 v;
 84.3129 +
 84.3130 +                        v = gamma_16[*(sp + 1) >> gamma_shift][*sp];
 84.3131 +                        *dp = (png_byte)((v >> 8) & 0xff);
 84.3132 +                        *(dp + 1) = (png_byte)(v & 0xff);
 84.3133 +                     }
 84.3134 +#if defined(PNG_READ_GAMMA_SUPPORTED)
 84.3135 +                     else if (a == 0)
 84.3136 +#else
 84.3137 +                     else
 84.3138 +#endif
 84.3139 +                     {
 84.3140 +                        /* background is already in screen gamma */
 84.3141 +                        *dp = (png_byte)((background->gray >> 8) & 0xff);
 84.3142 +                        *(dp + 1) = (png_byte)(background->gray & 0xff);
 84.3143 +                     }
 84.3144 +#if defined(PNG_READ_GAMMA_SUPPORTED)
 84.3145 +                     else
 84.3146 +                     {
 84.3147 +                        png_uint_16 g, v, w;
 84.3148 +
 84.3149 +                        g = gamma_16_to_1[*(sp + 1) >> gamma_shift][*sp];
 84.3150 +                        png_composite_16(v, g, a, background_1->gray);
 84.3151 +                        w = gamma_16_from_1[(v&0xff) >> gamma_shift][v >> 8];
 84.3152 +                        *dp = (png_byte)((w >> 8) & 0xff);
 84.3153 +                        *(dp + 1) = (png_byte)(w & 0xff);
 84.3154 +                     }
 84.3155 +#endif
 84.3156 +                  }
 84.3157 +               }
 84.3158 +               else
 84.3159 +#endif
 84.3160 +               {
 84.3161 +                  sp = row;
 84.3162 +                  dp = row;
 84.3163 +                  for (i = 0; i < row_width; i++, sp += 4, dp += 2)
 84.3164 +                  {
 84.3165 +                     png_uint_16 a = (png_uint_16)(((*(sp+2)) << 8) + *(sp+3));
 84.3166 +                     if (a == (png_uint_16)0xffff)
 84.3167 +                     {
 84.3168 +                        png_memcpy(dp, sp, 2);
 84.3169 +                     }
 84.3170 +#if defined(PNG_READ_GAMMA_SUPPORTED)
 84.3171 +                     else if (a == 0)
 84.3172 +#else
 84.3173 +                     else
 84.3174 +#endif
 84.3175 +                     {
 84.3176 +                        *dp = (png_byte)((background->gray >> 8) & 0xff);
 84.3177 +                        *(dp + 1) = (png_byte)(background->gray & 0xff);
 84.3178 +                     }
 84.3179 +#if defined(PNG_READ_GAMMA_SUPPORTED)
 84.3180 +                     else
 84.3181 +                     {
 84.3182 +                        png_uint_16 g, v;
 84.3183 +
 84.3184 +                        g = (png_uint_16)(((*sp) << 8) + *(sp + 1));
 84.3185 +                        png_composite_16(v, g, a, background_1->gray);
 84.3186 +                        *dp = (png_byte)((v >> 8) & 0xff);
 84.3187 +                        *(dp + 1) = (png_byte)(v & 0xff);
 84.3188 +                     }
 84.3189 +#endif
 84.3190 +                  }
 84.3191 +               }
 84.3192 +            }
 84.3193 +            break;
 84.3194 +         }
 84.3195 +         case PNG_COLOR_TYPE_RGB_ALPHA:
 84.3196 +         {
 84.3197 +            if (row_info->bit_depth == 8)
 84.3198 +            {
 84.3199 +#if defined(PNG_READ_GAMMA_SUPPORTED)
 84.3200 +               if (gamma_to_1 != NULL && gamma_from_1 != NULL &&
 84.3201 +                   gamma_table != NULL)
 84.3202 +               {
 84.3203 +                  sp = row;
 84.3204 +                  dp = row;
 84.3205 +                  for (i = 0; i < row_width; i++, sp += 4, dp += 3)
 84.3206 +                  {
 84.3207 +                     png_byte a = *(sp + 3);
 84.3208 +
 84.3209 +                     if (a == 0xff)
 84.3210 +                     {
 84.3211 +                        *dp = gamma_table[*sp];
 84.3212 +                        *(dp + 1) = gamma_table[*(sp + 1)];
 84.3213 +                        *(dp + 2) = gamma_table[*(sp + 2)];
 84.3214 +                     }
 84.3215 +                     else if (a == 0)
 84.3216 +                     {
 84.3217 +                        /* background is already in screen gamma */
 84.3218 +                        *dp = (png_byte)background->red;
 84.3219 +                        *(dp + 1) = (png_byte)background->green;
 84.3220 +                        *(dp + 2) = (png_byte)background->blue;
 84.3221 +                     }
 84.3222 +                     else
 84.3223 +                     {
 84.3224 +                        png_byte v, w;
 84.3225 +
 84.3226 +                        v = gamma_to_1[*sp];
 84.3227 +                        png_composite(w, v, a, background_1->red);
 84.3228 +                        *dp = gamma_from_1[w];
 84.3229 +                        v = gamma_to_1[*(sp + 1)];
 84.3230 +                        png_composite(w, v, a, background_1->green);
 84.3231 +                        *(dp + 1) = gamma_from_1[w];
 84.3232 +                        v = gamma_to_1[*(sp + 2)];
 84.3233 +                        png_composite(w, v, a, background_1->blue);
 84.3234 +                        *(dp + 2) = gamma_from_1[w];
 84.3235 +                     }
 84.3236 +                  }
 84.3237 +               }
 84.3238 +               else
 84.3239 +#endif
 84.3240 +               {
 84.3241 +                  sp = row;
 84.3242 +                  dp = row;
 84.3243 +                  for (i = 0; i < row_width; i++, sp += 4, dp += 3)
 84.3244 +                  {
 84.3245 +                     png_byte a = *(sp + 3);
 84.3246 +
 84.3247 +                     if (a == 0xff)
 84.3248 +                     {
 84.3249 +                        *dp = *sp;
 84.3250 +                        *(dp + 1) = *(sp + 1);
 84.3251 +                        *(dp + 2) = *(sp + 2);
 84.3252 +                     }
 84.3253 +                     else if (a == 0)
 84.3254 +                     {
 84.3255 +                        *dp = (png_byte)background->red;
 84.3256 +                        *(dp + 1) = (png_byte)background->green;
 84.3257 +                        *(dp + 2) = (png_byte)background->blue;
 84.3258 +                     }
 84.3259 +                     else
 84.3260 +                     {
 84.3261 +                        png_composite(*dp, *sp, a, background->red);
 84.3262 +                        png_composite(*(dp + 1), *(sp + 1), a,
 84.3263 +                           background->green);
 84.3264 +                        png_composite(*(dp + 2), *(sp + 2), a,
 84.3265 +                           background->blue);
 84.3266 +                     }
 84.3267 +                  }
 84.3268 +               }
 84.3269 +            }
 84.3270 +            else /* if (row_info->bit_depth == 16) */
 84.3271 +            {
 84.3272 +#if defined(PNG_READ_GAMMA_SUPPORTED)
 84.3273 +               if (gamma_16 != NULL && gamma_16_from_1 != NULL &&
 84.3274 +                   gamma_16_to_1 != NULL)
 84.3275 +               {
 84.3276 +                  sp = row;
 84.3277 +                  dp = row;
 84.3278 +                  for (i = 0; i < row_width; i++, sp += 8, dp += 6)
 84.3279 +                  {
 84.3280 +                     png_uint_16 a = (png_uint_16)(((png_uint_16)(*(sp + 6))
 84.3281 +                         << 8) + (png_uint_16)(*(sp + 7)));
 84.3282 +                     if (a == (png_uint_16)0xffff)
 84.3283 +                     {
 84.3284 +                        png_uint_16 v;
 84.3285 +
 84.3286 +                        v = gamma_16[*(sp + 1) >> gamma_shift][*sp];
 84.3287 +                        *dp = (png_byte)((v >> 8) & 0xff);
 84.3288 +                        *(dp + 1) = (png_byte)(v & 0xff);
 84.3289 +                        v = gamma_16[*(sp + 3) >> gamma_shift][*(sp + 2)];
 84.3290 +                        *(dp + 2) = (png_byte)((v >> 8) & 0xff);
 84.3291 +                        *(dp + 3) = (png_byte)(v & 0xff);
 84.3292 +                        v = gamma_16[*(sp + 5) >> gamma_shift][*(sp + 4)];
 84.3293 +                        *(dp + 4) = (png_byte)((v >> 8) & 0xff);
 84.3294 +                        *(dp + 5) = (png_byte)(v & 0xff);
 84.3295 +                     }
 84.3296 +                     else if (a == 0)
 84.3297 +                     {
 84.3298 +                        /* background is already in screen gamma */
 84.3299 +                        *dp = (png_byte)((background->red >> 8) & 0xff);
 84.3300 +                        *(dp + 1) = (png_byte)(background->red & 0xff);
 84.3301 +                        *(dp + 2) = (png_byte)((background->green >> 8) & 0xff);
 84.3302 +                        *(dp + 3) = (png_byte)(background->green & 0xff);
 84.3303 +                        *(dp + 4) = (png_byte)((background->blue >> 8) & 0xff);
 84.3304 +                        *(dp + 5) = (png_byte)(background->blue & 0xff);
 84.3305 +                     }
 84.3306 +                     else
 84.3307 +                     {
 84.3308 +                        png_uint_16 v, w, x;
 84.3309 +
 84.3310 +                        v = gamma_16_to_1[*(sp + 1) >> gamma_shift][*sp];
 84.3311 +                        png_composite_16(w, v, a, background_1->red);
 84.3312 +                        x = gamma_16_from_1[((w&0xff) >> gamma_shift)][w >> 8];
 84.3313 +                        *dp = (png_byte)((x >> 8) & 0xff);
 84.3314 +                        *(dp + 1) = (png_byte)(x & 0xff);
 84.3315 +                        v = gamma_16_to_1[*(sp + 3) >> gamma_shift][*(sp + 2)];
 84.3316 +                        png_composite_16(w, v, a, background_1->green);
 84.3317 +                        x = gamma_16_from_1[((w&0xff) >> gamma_shift)][w >> 8];
 84.3318 +                        *(dp + 2) = (png_byte)((x >> 8) & 0xff);
 84.3319 +                        *(dp + 3) = (png_byte)(x & 0xff);
 84.3320 +                        v = gamma_16_to_1[*(sp + 5) >> gamma_shift][*(sp + 4)];
 84.3321 +                        png_composite_16(w, v, a, background_1->blue);
 84.3322 +                        x = gamma_16_from_1[(w & 0xff) >> gamma_shift][w >> 8];
 84.3323 +                        *(dp + 4) = (png_byte)((x >> 8) & 0xff);
 84.3324 +                        *(dp + 5) = (png_byte)(x & 0xff);
 84.3325 +                     }
 84.3326 +                  }
 84.3327 +               }
 84.3328 +               else
 84.3329 +#endif
 84.3330 +               {
 84.3331 +                  sp = row;
 84.3332 +                  dp = row;
 84.3333 +                  for (i = 0; i < row_width; i++, sp += 8, dp += 6)
 84.3334 +                  {
 84.3335 +                     png_uint_16 a = (png_uint_16)(((png_uint_16)(*(sp + 6))
 84.3336 +                        << 8) + (png_uint_16)(*(sp + 7)));
 84.3337 +                     if (a == (png_uint_16)0xffff)
 84.3338 +                     {
 84.3339 +                        png_memcpy(dp, sp, 6);
 84.3340 +                     }
 84.3341 +                     else if (a == 0)
 84.3342 +                     {
 84.3343 +                        *dp = (png_byte)((background->red >> 8) & 0xff);
 84.3344 +                        *(dp + 1) = (png_byte)(background->red & 0xff);
 84.3345 +                        *(dp + 2) = (png_byte)((background->green >> 8) & 0xff);
 84.3346 +                        *(dp + 3) = (png_byte)(background->green & 0xff);
 84.3347 +                        *(dp + 4) = (png_byte)((background->blue >> 8) & 0xff);
 84.3348 +                        *(dp + 5) = (png_byte)(background->blue & 0xff);
 84.3349 +                     }
 84.3350 +                     else
 84.3351 +                     {
 84.3352 +                        png_uint_16 v;
 84.3353 +
 84.3354 +                        png_uint_16 r = (png_uint_16)(((*sp) << 8) + *(sp + 1));
 84.3355 +                        png_uint_16 g = (png_uint_16)(((*(sp + 2)) << 8)
 84.3356 +                            + *(sp + 3));
 84.3357 +                        png_uint_16 b = (png_uint_16)(((*(sp + 4)) << 8)
 84.3358 +                            + *(sp + 5));
 84.3359 +
 84.3360 +                        png_composite_16(v, r, a, background->red);
 84.3361 +                        *dp = (png_byte)((v >> 8) & 0xff);
 84.3362 +                        *(dp + 1) = (png_byte)(v & 0xff);
 84.3363 +                        png_composite_16(v, g, a, background->green);
 84.3364 +                        *(dp + 2) = (png_byte)((v >> 8) & 0xff);
 84.3365 +                        *(dp + 3) = (png_byte)(v & 0xff);
 84.3366 +                        png_composite_16(v, b, a, background->blue);
 84.3367 +                        *(dp + 4) = (png_byte)((v >> 8) & 0xff);
 84.3368 +                        *(dp + 5) = (png_byte)(v & 0xff);
 84.3369 +                     }
 84.3370 +                  }
 84.3371 +               }
 84.3372 +            }
 84.3373 +            break;
 84.3374 +         }
 84.3375 +      }
 84.3376 +
 84.3377 +      if (row_info->color_type & PNG_COLOR_MASK_ALPHA)
 84.3378 +      {
 84.3379 +         row_info->color_type &= ~PNG_COLOR_MASK_ALPHA;
 84.3380 +         row_info->channels--;
 84.3381 +         row_info->pixel_depth = (png_byte)(row_info->channels *
 84.3382 +            row_info->bit_depth);
 84.3383 +         row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, row_width);
 84.3384 +      }
 84.3385 +   }
 84.3386 +}
 84.3387 +#endif
 84.3388 +
 84.3389 +#if defined(PNG_READ_GAMMA_SUPPORTED)
 84.3390 +/* Gamma correct the image, avoiding the alpha channel.  Make sure
 84.3391 + * you do this after you deal with the transparency issue on grayscale
 84.3392 + * or RGB images. If your bit depth is 8, use gamma_table, if it
 84.3393 + * is 16, use gamma_16_table and gamma_shift.  Build these with
 84.3394 + * build_gamma_table().
 84.3395 + */
 84.3396 +void /* PRIVATE */
 84.3397 +png_do_gamma(png_row_infop row_info, png_bytep row,
 84.3398 +   png_bytep gamma_table, png_uint_16pp gamma_16_table,
 84.3399 +   int gamma_shift)
 84.3400 +{
 84.3401 +   png_bytep sp;
 84.3402 +   png_uint_32 i;
 84.3403 +   png_uint_32 row_width=row_info->width;
 84.3404 +
 84.3405 +   png_debug(1, "in png_do_gamma\n");
 84.3406 +   if (
 84.3407 +#if defined(PNG_USELESS_TESTS_SUPPORTED)
 84.3408 +       row != NULL && row_info != NULL &&
 84.3409 +#endif
 84.3410 +       ((row_info->bit_depth <= 8 && gamma_table != NULL) ||
 84.3411 +        (row_info->bit_depth == 16 && gamma_16_table != NULL)))
 84.3412 +   {
 84.3413 +      switch (row_info->color_type)
 84.3414 +      {
 84.3415 +         case PNG_COLOR_TYPE_RGB:
 84.3416 +         {
 84.3417 +            if (row_info->bit_depth == 8)
 84.3418 +            {
 84.3419 +               sp = row;
 84.3420 +               for (i = 0; i < row_width; i++)
 84.3421 +               {
 84.3422 +                  *sp = gamma_table[*sp];
 84.3423 +                  sp++;
 84.3424 +                  *sp = gamma_table[*sp];
 84.3425 +                  sp++;
 84.3426 +                  *sp = gamma_table[*sp];
 84.3427 +                  sp++;
 84.3428 +               }
 84.3429 +            }
 84.3430 +            else /* if (row_info->bit_depth == 16) */
 84.3431 +            {
 84.3432 +               sp = row;
 84.3433 +               for (i = 0; i < row_width; i++)
 84.3434 +               {
 84.3435 +                  png_uint_16 v;
 84.3436 +
 84.3437 +                  v = gamma_16_table[*(sp + 1) >> gamma_shift][*sp];
 84.3438 +                  *sp = (png_byte)((v >> 8) & 0xff);
 84.3439 +                  *(sp + 1) = (png_byte)(v & 0xff);
 84.3440 +                  sp += 2;
 84.3441 +                  v = gamma_16_table[*(sp + 1) >> gamma_shift][*sp];
 84.3442 +                  *sp = (png_byte)((v >> 8) & 0xff);
 84.3443 +                  *(sp + 1) = (png_byte)(v & 0xff);
 84.3444 +                  sp += 2;
 84.3445 +                  v = gamma_16_table[*(sp + 1) >> gamma_shift][*sp];
 84.3446 +                  *sp = (png_byte)((v >> 8) & 0xff);
 84.3447 +                  *(sp + 1) = (png_byte)(v & 0xff);
 84.3448 +                  sp += 2;
 84.3449 +               }
 84.3450 +            }
 84.3451 +            break;
 84.3452 +         }
 84.3453 +         case PNG_COLOR_TYPE_RGB_ALPHA:
 84.3454 +         {
 84.3455 +            if (row_info->bit_depth == 8)
 84.3456 +            {
 84.3457 +               sp = row;
 84.3458 +               for (i = 0; i < row_width; i++)
 84.3459 +               {
 84.3460 +                  *sp = gamma_table[*sp];
 84.3461 +                  sp++;
 84.3462 +                  *sp = gamma_table[*sp];
 84.3463 +                  sp++;
 84.3464 +                  *sp = gamma_table[*sp];
 84.3465 +                  sp++;
 84.3466 +                  sp++;
 84.3467 +               }
 84.3468 +            }
 84.3469 +            else /* if (row_info->bit_depth == 16) */
 84.3470 +            {
 84.3471 +               sp = row;
 84.3472 +               for (i = 0; i < row_width; i++)
 84.3473 +               {
 84.3474 +                  png_uint_16 v = gamma_16_table[*(sp + 1) >> gamma_shift][*sp];
 84.3475 +                  *sp = (png_byte)((v >> 8) & 0xff);
 84.3476 +                  *(sp + 1) = (png_byte)(v & 0xff);
 84.3477 +                  sp += 2;
 84.3478 +                  v = gamma_16_table[*(sp + 1) >> gamma_shift][*sp];
 84.3479 +                  *sp = (png_byte)((v >> 8) & 0xff);
 84.3480 +                  *(sp + 1) = (png_byte)(v & 0xff);
 84.3481 +                  sp += 2;
 84.3482 +                  v = gamma_16_table[*(sp + 1) >> gamma_shift][*sp];
 84.3483 +                  *sp = (png_byte)((v >> 8) & 0xff);
 84.3484 +                  *(sp + 1) = (png_byte)(v & 0xff);
 84.3485 +                  sp += 4;
 84.3486 +               }
 84.3487 +            }
 84.3488 +            break;
 84.3489 +         }
 84.3490 +         case PNG_COLOR_TYPE_GRAY_ALPHA:
 84.3491 +         {
 84.3492 +            if (row_info->bit_depth == 8)
 84.3493 +            {
 84.3494 +               sp = row;
 84.3495 +               for (i = 0; i < row_width; i++)
 84.3496 +               {
 84.3497 +                  *sp = gamma_table[*sp];
 84.3498 +                  sp += 2;
 84.3499 +               }
 84.3500 +            }
 84.3501 +            else /* if (row_info->bit_depth == 16) */
 84.3502 +            {
 84.3503 +               sp = row;
 84.3504 +               for (i = 0; i < row_width; i++)
 84.3505 +               {
 84.3506 +                  png_uint_16 v = gamma_16_table[*(sp + 1) >> gamma_shift][*sp];
 84.3507 +                  *sp = (png_byte)((v >> 8) & 0xff);
 84.3508 +                  *(sp + 1) = (png_byte)(v & 0xff);
 84.3509 +                  sp += 4;
 84.3510 +               }
 84.3511 +            }
 84.3512 +            break;
 84.3513 +         }
 84.3514 +         case PNG_COLOR_TYPE_GRAY:
 84.3515 +         {
 84.3516 +            if (row_info->bit_depth == 2)
 84.3517 +            {
 84.3518 +               sp = row;
 84.3519 +               for (i = 0; i < row_width; i += 4)
 84.3520 +               {
 84.3521 +                  int a = *sp & 0xc0;
 84.3522 +                  int b = *sp & 0x30;
 84.3523 +                  int c = *sp & 0x0c;
 84.3524 +                  int d = *sp & 0x03;
 84.3525 +
 84.3526 +                  *sp = (png_byte)(
 84.3527 +                        ((((int)gamma_table[a|(a>>2)|(a>>4)|(a>>6)])   ) & 0xc0)|
 84.3528 +                        ((((int)gamma_table[(b<<2)|b|(b>>2)|(b>>4)])>>2) & 0x30)|
 84.3529 +                        ((((int)gamma_table[(c<<4)|(c<<2)|c|(c>>2)])>>4) & 0x0c)|
 84.3530 +                        ((((int)gamma_table[(d<<6)|(d<<4)|(d<<2)|d])>>6) ));
 84.3531 +                  sp++;
 84.3532 +               }
 84.3533 +            }
 84.3534 +            if (row_info->bit_depth == 4)
 84.3535 +            {
 84.3536 +               sp = row;
 84.3537 +               for (i = 0; i < row_width; i += 2)
 84.3538 +               {
 84.3539 +                  int msb = *sp & 0xf0;
 84.3540 +                  int lsb = *sp & 0x0f;
 84.3541 +
 84.3542 +                  *sp = (png_byte)((((int)gamma_table[msb | (msb >> 4)]) & 0xf0)
 84.3543 +                          | (((int)gamma_table[(lsb << 4) | lsb]) >> 4));
 84.3544 +                  sp++;
 84.3545 +               }
 84.3546 +            }
 84.3547 +            else if (row_info->bit_depth == 8)
 84.3548 +            {
 84.3549 +               sp = row;
 84.3550 +               for (i = 0; i < row_width; i++)
 84.3551 +               {
 84.3552 +                  *sp = gamma_table[*sp];
 84.3553 +                  sp++;
 84.3554 +               }
 84.3555 +            }
 84.3556 +            else if (row_info->bit_depth == 16)
 84.3557 +            {
 84.3558 +               sp = row;
 84.3559 +               for (i = 0; i < row_width; i++)
 84.3560 +               {
 84.3561 +                  png_uint_16 v = gamma_16_table[*(sp + 1) >> gamma_shift][*sp];
 84.3562 +                  *sp = (png_byte)((v >> 8) & 0xff);
 84.3563 +                  *(sp + 1) = (png_byte)(v & 0xff);
 84.3564 +                  sp += 2;
 84.3565 +               }
 84.3566 +            }
 84.3567 +            break;
 84.3568 +         }
 84.3569 +      }
 84.3570 +   }
 84.3571 +}
 84.3572 +#endif
 84.3573 +
 84.3574 +#if defined(PNG_READ_EXPAND_SUPPORTED)
 84.3575 +/* Expands a palette row to an RGB or RGBA row depending
 84.3576 + * upon whether you supply trans and num_trans.
 84.3577 + */
 84.3578 +void /* PRIVATE */
 84.3579 +png_do_expand_palette(png_row_infop row_info, png_bytep row,
 84.3580 +   png_colorp palette, png_bytep trans, int num_trans)
 84.3581 +{
 84.3582 +   int shift, value;
 84.3583 +   png_bytep sp, dp;
 84.3584 +   png_uint_32 i;
 84.3585 +   png_uint_32 row_width=row_info->width;
 84.3586 +
 84.3587 +   png_debug(1, "in png_do_expand_palette\n");
 84.3588 +   if (
 84.3589 +#if defined(PNG_USELESS_TESTS_SUPPORTED)
 84.3590 +       row != NULL && row_info != NULL &&
 84.3591 +#endif
 84.3592 +       row_info->color_type == PNG_COLOR_TYPE_PALETTE)
 84.3593 +   {
 84.3594 +      if (row_info->bit_depth < 8)
 84.3595 +      {
 84.3596 +         switch (row_info->bit_depth)
 84.3597 +         {
 84.3598 +            case 1:
 84.3599 +            {
 84.3600 +               sp = row + (png_size_t)((row_width - 1) >> 3);
 84.3601 +               dp = row + (png_size_t)row_width - 1;
 84.3602 +               shift = 7 - (int)((row_width + 7) & 0x07);
 84.3603 +               for (i = 0; i < row_width; i++)
 84.3604 +               {
 84.3605 +                  if ((*sp >> shift) & 0x01)
 84.3606 +                     *dp = 1;
 84.3607 +                  else
 84.3608 +                     *dp = 0;
 84.3609 +                  if (shift == 7)
 84.3610 +                  {
 84.3611 +                     shift = 0;
 84.3612 +                     sp--;
 84.3613 +                  }
 84.3614 +                  else
 84.3615 +                     shift++;
 84.3616 +
 84.3617 +                  dp--;
 84.3618 +               }
 84.3619 +               break;
 84.3620 +            }
 84.3621 +            case 2:
 84.3622 +            {
 84.3623 +               sp = row + (png_size_t)((row_width - 1) >> 2);
 84.3624 +               dp = row + (png_size_t)row_width - 1;
 84.3625 +               shift = (int)((3 - ((row_width + 3) & 0x03)) << 1);
 84.3626 +               for (i = 0; i < row_width; i++)
 84.3627 +               {
 84.3628 +                  value = (*sp >> shift) & 0x03;
 84.3629 +                  *dp = (png_byte)value;
 84.3630 +                  if (shift == 6)
 84.3631 +                  {
 84.3632 +                     shift = 0;
 84.3633 +                     sp--;
 84.3634 +                  }
 84.3635 +                  else
 84.3636 +                     shift += 2;
 84.3637 +
 84.3638 +                  dp--;
 84.3639 +               }
 84.3640 +               break;
 84.3641 +            }
 84.3642 +            case 4:
 84.3643 +            {
 84.3644 +               sp = row + (png_size_t)((row_width - 1) >> 1);
 84.3645 +               dp = row + (png_size_t)row_width - 1;
 84.3646 +               shift = (int)((row_width & 0x01) << 2);
 84.3647 +               for (i = 0; i < row_width; i++)
 84.3648 +               {
 84.3649 +                  value = (*sp >> shift) & 0x0f;
 84.3650 +                  *dp = (png_byte)value;
 84.3651 +                  if (shift == 4)
 84.3652 +                  {
 84.3653 +                     shift = 0;
 84.3654 +                     sp--;
 84.3655 +                  }
 84.3656 +                  else
 84.3657 +                     shift += 4;
 84.3658 +
 84.3659 +                  dp--;
 84.3660 +               }
 84.3661 +               break;
 84.3662 +            }
 84.3663 +         }
 84.3664 +         row_info->bit_depth = 8;
 84.3665 +         row_info->pixel_depth = 8;
 84.3666 +         row_info->rowbytes = row_width;
 84.3667 +      }
 84.3668 +      switch (row_info->bit_depth)
 84.3669 +      {
 84.3670 +         case 8:
 84.3671 +         {
 84.3672 +            if (trans != NULL)
 84.3673 +            {
 84.3674 +               sp = row + (png_size_t)row_width - 1;
 84.3675 +               dp = row + (png_size_t)(row_width << 2) - 1;
 84.3676 +
 84.3677 +               for (i = 0; i < row_width; i++)
 84.3678 +               {
 84.3679 +                  if ((int)(*sp) >= num_trans)
 84.3680 +                     *dp-- = 0xff;
 84.3681 +                  else
 84.3682 +                     *dp-- = trans[*sp];
 84.3683 +                  *dp-- = palette[*sp].blue;
 84.3684 +                  *dp-- = palette[*sp].green;
 84.3685 +                  *dp-- = palette[*sp].red;
 84.3686 +                  sp--;
 84.3687 +               }
 84.3688 +               row_info->bit_depth = 8;
 84.3689 +               row_info->pixel_depth = 32;
 84.3690 +               row_info->rowbytes = row_width * 4;
 84.3691 +               row_info->color_type = 6;
 84.3692 +               row_info->channels = 4;
 84.3693 +            }
 84.3694 +            else
 84.3695 +            {
 84.3696 +               sp = row + (png_size_t)row_width - 1;
 84.3697 +               dp = row + (png_size_t)(row_width * 3) - 1;
 84.3698 +
 84.3699 +               for (i = 0; i < row_width; i++)
 84.3700 +               {
 84.3701 +                  *dp-- = palette[*sp].blue;
 84.3702 +                  *dp-- = palette[*sp].green;
 84.3703 +                  *dp-- = palette[*sp].red;
 84.3704 +                  sp--;
 84.3705 +               }
 84.3706 +               row_info->bit_depth = 8;
 84.3707 +               row_info->pixel_depth = 24;
 84.3708 +               row_info->rowbytes = row_width * 3;
 84.3709 +               row_info->color_type = 2;
 84.3710 +               row_info->channels = 3;
 84.3711 +            }
 84.3712 +            break;
 84.3713 +         }
 84.3714 +      }
 84.3715 +   }
 84.3716 +}
 84.3717 +
 84.3718 +/* If the bit depth < 8, it is expanded to 8.  Also, if the already
 84.3719 + * expanded transparency value is supplied, an alpha channel is built.
 84.3720 + */
 84.3721 +void /* PRIVATE */
 84.3722 +png_do_expand(png_row_infop row_info, png_bytep row,
 84.3723 +   png_color_16p trans_value)
 84.3724 +{
 84.3725 +   int shift, value;
 84.3726 +   png_bytep sp, dp;
 84.3727 +   png_uint_32 i;
 84.3728 +   png_uint_32 row_width=row_info->width;
 84.3729 +
 84.3730 +   png_debug(1, "in png_do_expand\n");
 84.3731 +#if defined(PNG_USELESS_TESTS_SUPPORTED)
 84.3732 +   if (row != NULL && row_info != NULL)
 84.3733 +#endif
 84.3734 +   {
 84.3735 +      if (row_info->color_type == PNG_COLOR_TYPE_GRAY)
 84.3736 +      {
 84.3737 +         png_uint_16 gray = (png_uint_16)(trans_value ? trans_value->gray : 0);
 84.3738 +
 84.3739 +         if (row_info->bit_depth < 8)
 84.3740 +         {
 84.3741 +            switch (row_info->bit_depth)
 84.3742 +            {
 84.3743 +               case 1:
 84.3744 +               {
 84.3745 +                  gray = (png_uint_16)((gray&0x01)*0xff);
 84.3746 +                  sp = row + (png_size_t)((row_width - 1) >> 3);
 84.3747 +                  dp = row + (png_size_t)row_width - 1;
 84.3748 +                  shift = 7 - (int)((row_width + 7) & 0x07);
 84.3749 +                  for (i = 0; i < row_width; i++)
 84.3750 +                  {
 84.3751 +                     if ((*sp >> shift) & 0x01)
 84.3752 +                        *dp = 0xff;
 84.3753 +                     else
 84.3754 +                        *dp = 0;
 84.3755 +                     if (shift == 7)
 84.3756 +                     {
 84.3757 +                        shift = 0;
 84.3758 +                        sp--;
 84.3759 +                     }
 84.3760 +                     else
 84.3761 +                        shift++;
 84.3762 +
 84.3763 +                     dp--;
 84.3764 +                  }
 84.3765 +                  break;
 84.3766 +               }
 84.3767 +               case 2:
 84.3768 +               {
 84.3769 +                  gray = (png_uint_16)((gray&0x03)*0x55);
 84.3770 +                  sp = row + (png_size_t)((row_width - 1) >> 2);
 84.3771 +                  dp = row + (png_size_t)row_width - 1;
 84.3772 +                  shift = (int)((3 - ((row_width + 3) & 0x03)) << 1);
 84.3773 +                  for (i = 0; i < row_width; i++)
 84.3774 +                  {
 84.3775 +                     value = (*sp >> shift) & 0x03;
 84.3776 +                     *dp = (png_byte)(value | (value << 2) | (value << 4) |
 84.3777 +                        (value << 6));
 84.3778 +                     if (shift == 6)
 84.3779 +                     {
 84.3780 +                        shift = 0;
 84.3781 +                        sp--;
 84.3782 +                     }
 84.3783 +                     else
 84.3784 +                        shift += 2;
 84.3785 +
 84.3786 +                     dp--;
 84.3787 +                  }
 84.3788 +                  break;
 84.3789 +               }
 84.3790 +               case 4:
 84.3791 +               {
 84.3792 +                  gray = (png_uint_16)((gray&0x0f)*0x11);
 84.3793 +                  sp = row + (png_size_t)((row_width - 1) >> 1);
 84.3794 +                  dp = row + (png_size_t)row_width - 1;
 84.3795 +                  shift = (int)((1 - ((row_width + 1) & 0x01)) << 2);
 84.3796 +                  for (i = 0; i < row_width; i++)
 84.3797 +                  {
 84.3798 +                     value = (*sp >> shift) & 0x0f;
 84.3799 +                     *dp = (png_byte)(value | (value << 4));
 84.3800 +                     if (shift == 4)
 84.3801 +                     {
 84.3802 +                        shift = 0;
 84.3803 +                        sp--;
 84.3804 +                     }
 84.3805 +                     else
 84.3806 +                        shift = 4;
 84.3807 +
 84.3808 +                     dp--;
 84.3809 +                  }
 84.3810 +                  break;
 84.3811 +               }
 84.3812 +            }
 84.3813 +            row_info->bit_depth = 8;
 84.3814 +            row_info->pixel_depth = 8;
 84.3815 +            row_info->rowbytes = row_width;
 84.3816 +         }
 84.3817 +
 84.3818 +         if (trans_value != NULL)
 84.3819 +         {
 84.3820 +            if (row_info->bit_depth == 8)
 84.3821 +            {
 84.3822 +               gray = gray & 0xff;
 84.3823 +               sp = row + (png_size_t)row_width - 1;
 84.3824 +               dp = row + (png_size_t)(row_width << 1) - 1;
 84.3825 +               for (i = 0; i < row_width; i++)
 84.3826 +               {
 84.3827 +                  if (*sp == gray)
 84.3828 +                     *dp-- = 0;
 84.3829 +                  else
 84.3830 +                     *dp-- = 0xff;
 84.3831 +                  *dp-- = *sp--;
 84.3832 +               }
 84.3833 +            }
 84.3834 +            else if (row_info->bit_depth == 16)
 84.3835 +            {
 84.3836 +               png_byte gray_high = (gray >> 8) & 0xff;
 84.3837 +               png_byte gray_low = gray & 0xff;
 84.3838 +               sp = row + row_info->rowbytes - 1;
 84.3839 +               dp = row + (row_info->rowbytes << 1) - 1;
 84.3840 +               for (i = 0; i < row_width; i++)
 84.3841 +               {
 84.3842 +                  if (*(sp - 1) == gray_high && *(sp) == gray_low) 
 84.3843 +                  {
 84.3844 +                     *dp-- = 0;
 84.3845 +                     *dp-- = 0;
 84.3846 +                  }
 84.3847 +                  else
 84.3848 +                  {
 84.3849 +                     *dp-- = 0xff;
 84.3850 +                     *dp-- = 0xff;
 84.3851 +                  }
 84.3852 +                  *dp-- = *sp--;
 84.3853 +                  *dp-- = *sp--;
 84.3854 +               }
 84.3855 +            }
 84.3856 +            row_info->color_type = PNG_COLOR_TYPE_GRAY_ALPHA;
 84.3857 +            row_info->channels = 2;
 84.3858 +            row_info->pixel_depth = (png_byte)(row_info->bit_depth << 1);
 84.3859 +            row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth,
 84.3860 +               row_width);
 84.3861 +         }
 84.3862 +      }
 84.3863 +      else if (row_info->color_type == PNG_COLOR_TYPE_RGB && trans_value)
 84.3864 +      {
 84.3865 +         if (row_info->bit_depth == 8)
 84.3866 +         {
 84.3867 +            png_byte red = trans_value->red & 0xff;
 84.3868 +            png_byte green = trans_value->green & 0xff;
 84.3869 +            png_byte blue = trans_value->blue & 0xff;
 84.3870 +            sp = row + (png_size_t)row_info->rowbytes - 1;
 84.3871 +            dp = row + (png_size_t)(row_width << 2) - 1;
 84.3872 +            for (i = 0; i < row_width; i++)
 84.3873 +            {
 84.3874 +               if (*(sp - 2) == red && *(sp - 1) == green && *(sp) == blue)
 84.3875 +                  *dp-- = 0;
 84.3876 +               else
 84.3877 +                  *dp-- = 0xff;
 84.3878 +               *dp-- = *sp--;
 84.3879 +               *dp-- = *sp--;
 84.3880 +               *dp-- = *sp--;
 84.3881 +            }
 84.3882 +         }
 84.3883 +         else if (row_info->bit_depth == 16)
 84.3884 +         {
 84.3885 +            png_byte red_high = (trans_value->red >> 8) & 0xff;
 84.3886 +            png_byte green_high = (trans_value->green >> 8) & 0xff;
 84.3887 +            png_byte blue_high = (trans_value->blue >> 8) & 0xff;
 84.3888 +            png_byte red_low = trans_value->red & 0xff;
 84.3889 +            png_byte green_low = trans_value->green & 0xff;
 84.3890 +            png_byte blue_low = trans_value->blue & 0xff;
 84.3891 +            sp = row + row_info->rowbytes - 1;
 84.3892 +            dp = row + (png_size_t)(row_width << 3) - 1;
 84.3893 +            for (i = 0; i < row_width; i++)
 84.3894 +            {
 84.3895 +               if (*(sp - 5) == red_high &&
 84.3896 +                  *(sp - 4) == red_low &&
 84.3897 +                  *(sp - 3) == green_high &&
 84.3898 +                  *(sp - 2) == green_low &&
 84.3899 +                  *(sp - 1) == blue_high &&
 84.3900 +                  *(sp    ) == blue_low)
 84.3901 +               {
 84.3902 +                  *dp-- = 0;
 84.3903 +                  *dp-- = 0;
 84.3904 +               }
 84.3905 +               else
 84.3906 +               {
 84.3907 +                  *dp-- = 0xff;
 84.3908 +                  *dp-- = 0xff;
 84.3909 +               }
 84.3910 +               *dp-- = *sp--;
 84.3911 +               *dp-- = *sp--;
 84.3912 +               *dp-- = *sp--;
 84.3913 +               *dp-- = *sp--;
 84.3914 +               *dp-- = *sp--;
 84.3915 +               *dp-- = *sp--;
 84.3916 +            }
 84.3917 +         }
 84.3918 +         row_info->color_type = PNG_COLOR_TYPE_RGB_ALPHA;
 84.3919 +         row_info->channels = 4;
 84.3920 +         row_info->pixel_depth = (png_byte)(row_info->bit_depth << 2);
 84.3921 +         row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, row_width);
 84.3922 +      }
 84.3923 +   }
 84.3924 +}
 84.3925 +#endif
 84.3926 +
 84.3927 +#if defined(PNG_READ_DITHER_SUPPORTED)
 84.3928 +void /* PRIVATE */
 84.3929 +png_do_dither(png_row_infop row_info, png_bytep row,
 84.3930 +    png_bytep palette_lookup, png_bytep dither_lookup)
 84.3931 +{
 84.3932 +   png_bytep sp, dp;
 84.3933 +   png_uint_32 i;
 84.3934 +   png_uint_32 row_width=row_info->width;
 84.3935 +
 84.3936 +   png_debug(1, "in png_do_dither\n");
 84.3937 +#if defined(PNG_USELESS_TESTS_SUPPORTED)
 84.3938 +   if (row != NULL && row_info != NULL)
 84.3939 +#endif
 84.3940 +   {
 84.3941 +      if (row_info->color_type == PNG_COLOR_TYPE_RGB &&
 84.3942 +         palette_lookup && row_info->bit_depth == 8)
 84.3943 +      {
 84.3944 +         int r, g, b, p;
 84.3945 +         sp = row;
 84.3946 +         dp = row;
 84.3947 +         for (i = 0; i < row_width; i++)
 84.3948 +         {
 84.3949 +            r = *sp++;
 84.3950 +            g = *sp++;
 84.3951 +            b = *sp++;
 84.3952 +
 84.3953 +            /* this looks real messy, but the compiler will reduce
 84.3954 +               it down to a reasonable formula.  For example, with
 84.3955 +               5 bits per color, we get:
 84.3956 +               p = (((r >> 3) & 0x1f) << 10) |
 84.3957 +                  (((g >> 3) & 0x1f) << 5) |
 84.3958 +                  ((b >> 3) & 0x1f);
 84.3959 +               */
 84.3960 +            p = (((r >> (8 - PNG_DITHER_RED_BITS)) &
 84.3961 +               ((1 << PNG_DITHER_RED_BITS) - 1)) <<
 84.3962 +               (PNG_DITHER_GREEN_BITS + PNG_DITHER_BLUE_BITS)) |
 84.3963 +               (((g >> (8 - PNG_DITHER_GREEN_BITS)) &
 84.3964 +               ((1 << PNG_DITHER_GREEN_BITS) - 1)) <<
 84.3965 +               (PNG_DITHER_BLUE_BITS)) |
 84.3966 +               ((b >> (8 - PNG_DITHER_BLUE_BITS)) &
 84.3967 +               ((1 << PNG_DITHER_BLUE_BITS) - 1));
 84.3968 +
 84.3969 +            *dp++ = palette_lookup[p];
 84.3970 +         }
 84.3971 +         row_info->color_type = PNG_COLOR_TYPE_PALETTE;
 84.3972 +         row_info->channels = 1;
 84.3973 +         row_info->pixel_depth = row_info->bit_depth;
 84.3974 +         row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, row_width);
 84.3975 +      }
 84.3976 +      else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA &&
 84.3977 +         palette_lookup != NULL && row_info->bit_depth == 8)
 84.3978 +      {
 84.3979 +         int r, g, b, p;
 84.3980 +         sp = row;
 84.3981 +         dp = row;
 84.3982 +         for (i = 0; i < row_width; i++)
 84.3983 +         {
 84.3984 +            r = *sp++;
 84.3985 +            g = *sp++;
 84.3986 +            b = *sp++;
 84.3987 +            sp++;
 84.3988 +
 84.3989 +            p = (((r >> (8 - PNG_DITHER_RED_BITS)) &
 84.3990 +               ((1 << PNG_DITHER_RED_BITS) - 1)) <<
 84.3991 +               (PNG_DITHER_GREEN_BITS + PNG_DITHER_BLUE_BITS)) |
 84.3992 +               (((g >> (8 - PNG_DITHER_GREEN_BITS)) &
 84.3993 +               ((1 << PNG_DITHER_GREEN_BITS) - 1)) <<
 84.3994 +               (PNG_DITHER_BLUE_BITS)) |
 84.3995 +               ((b >> (8 - PNG_DITHER_BLUE_BITS)) &
 84.3996 +               ((1 << PNG_DITHER_BLUE_BITS) - 1));
 84.3997 +
 84.3998 +            *dp++ = palette_lookup[p];
 84.3999 +         }
 84.4000 +         row_info->color_type = PNG_COLOR_TYPE_PALETTE;
 84.4001 +         row_info->channels = 1;
 84.4002 +         row_info->pixel_depth = row_info->bit_depth;
 84.4003 +         row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, row_width);
 84.4004 +      }
 84.4005 +      else if (row_info->color_type == PNG_COLOR_TYPE_PALETTE &&
 84.4006 +         dither_lookup && row_info->bit_depth == 8)
 84.4007 +      {
 84.4008 +         sp = row;
 84.4009 +         for (i = 0; i < row_width; i++, sp++)
 84.4010 +         {
 84.4011 +            *sp = dither_lookup[*sp];
 84.4012 +         }
 84.4013 +      }
 84.4014 +   }
 84.4015 +}
 84.4016 +#endif
 84.4017 +
 84.4018 +#ifdef PNG_FLOATING_POINT_SUPPORTED
 84.4019 +#if defined(PNG_READ_GAMMA_SUPPORTED)
 84.4020 +static PNG_CONST int png_gamma_shift[] =
 84.4021 +   {0x10, 0x21, 0x42, 0x84, 0x110, 0x248, 0x550, 0xff0, 0x00};
 84.4022 +
 84.4023 +/* We build the 8- or 16-bit gamma tables here.  Note that for 16-bit
 84.4024 + * tables, we don't make a full table if we are reducing to 8-bit in
 84.4025 + * the future.  Note also how the gamma_16 tables are segmented so that
 84.4026 + * we don't need to allocate > 64K chunks for a full 16-bit table.
 84.4027 + */
 84.4028 +void /* PRIVATE */
 84.4029 +png_build_gamma_table(png_structp png_ptr)
 84.4030 +{
 84.4031 +  png_debug(1, "in png_build_gamma_table\n");
 84.4032 +
 84.4033 +  if (png_ptr->bit_depth <= 8)
 84.4034 +  {
 84.4035 +     int i;
 84.4036 +     double g;
 84.4037 +
 84.4038 +     if (png_ptr->screen_gamma > .000001)
 84.4039 +        g = 1.0 / (png_ptr->gamma * png_ptr->screen_gamma);
 84.4040 +     else
 84.4041 +        g = 1.0;
 84.4042 +
 84.4043 +     png_ptr->gamma_table = (png_bytep)png_malloc(png_ptr,
 84.4044 +        (png_uint_32)256);
 84.4045 +
 84.4046 +     for (i = 0; i < 256; i++)
 84.4047 +     {
 84.4048 +        png_ptr->gamma_table[i] = (png_byte)(pow((double)i / 255.0,
 84.4049 +           g) * 255.0 + .5);
 84.4050 +     }
 84.4051 +
 84.4052 +#if defined(PNG_READ_BACKGROUND_SUPPORTED) || \
 84.4053 +   defined(PNG_READ_RGB_TO_GRAY_SUPPORTED)
 84.4054 +     if (png_ptr->transformations & ((PNG_BACKGROUND) | PNG_RGB_TO_GRAY))
 84.4055 +     {
 84.4056 +
 84.4057 +        g = 1.0 / (png_ptr->gamma);
 84.4058 +
 84.4059 +        png_ptr->gamma_to_1 = (png_bytep)png_malloc(png_ptr,
 84.4060 +           (png_uint_32)256);
 84.4061 +
 84.4062 +        for (i = 0; i < 256; i++)
 84.4063 +        {
 84.4064 +           png_ptr->gamma_to_1[i] = (png_byte)(pow((double)i / 255.0,
 84.4065 +              g) * 255.0 + .5);
 84.4066 +        }
 84.4067 +
 84.4068 +
 84.4069 +        png_ptr->gamma_from_1 = (png_bytep)png_malloc(png_ptr,
 84.4070 +           (png_uint_32)256);
 84.4071 +
 84.4072 +        if (png_ptr->screen_gamma > 0.000001)
 84.4073 +           g = 1.0 / png_ptr->screen_gamma;
 84.4074 +        else
 84.4075 +           g = png_ptr->gamma;   /* probably doing rgb_to_gray */
 84.4076 +
 84.4077 +        for (i = 0; i < 256; i++)
 84.4078 +        {
 84.4079 +           png_ptr->gamma_from_1[i] = (png_byte)(pow((double)i / 255.0,
 84.4080 +              g) * 255.0 + .5);
 84.4081 +
 84.4082 +        }
 84.4083 +     }
 84.4084 +#endif /* PNG_READ_BACKGROUND_SUPPORTED || PNG_RGB_TO_GRAY_SUPPORTED */
 84.4085 +  }
 84.4086 +  else
 84.4087 +  {
 84.4088 +     double g;
 84.4089 +     int i, j, shift, num;
 84.4090 +     int sig_bit;
 84.4091 +     png_uint_32 ig;
 84.4092 +
 84.4093 +     if (png_ptr->color_type & PNG_COLOR_MASK_COLOR)
 84.4094 +     {
 84.4095 +        sig_bit = (int)png_ptr->sig_bit.red;
 84.4096 +        if ((int)png_ptr->sig_bit.green > sig_bit)
 84.4097 +           sig_bit = png_ptr->sig_bit.green;
 84.4098 +        if ((int)png_ptr->sig_bit.blue > sig_bit)
 84.4099 +           sig_bit = png_ptr->sig_bit.blue;
 84.4100 +     }
 84.4101 +     else
 84.4102 +     {
 84.4103 +        sig_bit = (int)png_ptr->sig_bit.gray;
 84.4104 +     }
 84.4105 +
 84.4106 +     if (sig_bit > 0)
 84.4107 +        shift = 16 - sig_bit;
 84.4108 +     else
 84.4109 +        shift = 0;
 84.4110 +
 84.4111 +     if (png_ptr->transformations & PNG_16_TO_8)
 84.4112 +     {
 84.4113 +        if (shift < (16 - PNG_MAX_GAMMA_8))
 84.4114 +           shift = (16 - PNG_MAX_GAMMA_8);
 84.4115 +     }
 84.4116 +
 84.4117 +     if (shift > 8)
 84.4118 +        shift = 8;
 84.4119 +     if (shift < 0)
 84.4120 +        shift = 0;
 84.4121 +
 84.4122 +     png_ptr->gamma_shift = (png_byte)shift;
 84.4123 +
 84.4124 +     num = (1 << (8 - shift));
 84.4125 +
 84.4126 +     if (png_ptr->screen_gamma > .000001)
 84.4127 +        g = 1.0 / (png_ptr->gamma * png_ptr->screen_gamma);
 84.4128 +     else
 84.4129 +        g = 1.0;
 84.4130 +
 84.4131 +     png_ptr->gamma_16_table = (png_uint_16pp)png_malloc(png_ptr,
 84.4132 +        (png_uint_32)(num * png_sizeof(png_uint_16p)));
 84.4133 +
 84.4134 +     if (png_ptr->transformations & (PNG_16_TO_8 | PNG_BACKGROUND))
 84.4135 +     {
 84.4136 +        double fin, fout;
 84.4137 +        png_uint_32 last, max;
 84.4138 +
 84.4139 +        for (i = 0; i < num; i++)
 84.4140 +        {
 84.4141 +           png_ptr->gamma_16_table[i] = (png_uint_16p)png_malloc(png_ptr,
 84.4142 +              (png_uint_32)(256 * png_sizeof(png_uint_16)));
 84.4143 +        }
 84.4144 +
 84.4145 +        g = 1.0 / g;
 84.4146 +        last = 0;
 84.4147 +        for (i = 0; i < 256; i++)
 84.4148 +        {
 84.4149 +           fout = ((double)i + 0.5) / 256.0;
 84.4150 +           fin = pow(fout, g);
 84.4151 +           max = (png_uint_32)(fin * (double)((png_uint_32)num << 8));
 84.4152 +           while (last <= max)
 84.4153 +           {
 84.4154 +              png_ptr->gamma_16_table[(int)(last & (0xff >> shift))]
 84.4155 +                 [(int)(last >> (8 - shift))] = (png_uint_16)(
 84.4156 +                 (png_uint_16)i | ((png_uint_16)i << 8));
 84.4157 +              last++;
 84.4158 +           }
 84.4159 +        }
 84.4160 +        while (last < ((png_uint_32)num << 8))
 84.4161 +        {
 84.4162 +           png_ptr->gamma_16_table[(int)(last & (0xff >> shift))]
 84.4163 +              [(int)(last >> (8 - shift))] = (png_uint_16)65535L;
 84.4164 +           last++;
 84.4165 +        }
 84.4166 +     }
 84.4167 +     else
 84.4168 +     {
 84.4169 +        for (i = 0; i < num; i++)
 84.4170 +        {
 84.4171 +           png_ptr->gamma_16_table[i] = (png_uint_16p)png_malloc(png_ptr,
 84.4172 +              (png_uint_32)(256 * png_sizeof(png_uint_16)));
 84.4173 +
 84.4174 +           ig = (((png_uint_32)i * (png_uint_32)png_gamma_shift[shift]) >> 4);
 84.4175 +           for (j = 0; j < 256; j++)
 84.4176 +           {
 84.4177 +              png_ptr->gamma_16_table[i][j] =
 84.4178 +                 (png_uint_16)(pow((double)(ig + ((png_uint_32)j << 8)) /
 84.4179 +                    65535.0, g) * 65535.0 + .5);
 84.4180 +           }
 84.4181 +        }
 84.4182 +     }
 84.4183 +
 84.4184 +#if defined(PNG_READ_BACKGROUND_SUPPORTED) || \
 84.4185 +   defined(PNG_READ_RGB_TO_GRAY_SUPPORTED)
 84.4186 +     if (png_ptr->transformations & (PNG_BACKGROUND | PNG_RGB_TO_GRAY))
 84.4187 +     {
 84.4188 +
 84.4189 +        g = 1.0 / (png_ptr->gamma);
 84.4190 +
 84.4191 +        png_ptr->gamma_16_to_1 = (png_uint_16pp)png_malloc(png_ptr,
 84.4192 +           (png_uint_32)(num * png_sizeof(png_uint_16p )));
 84.4193 +
 84.4194 +        for (i = 0; i < num; i++)
 84.4195 +        {
 84.4196 +           png_ptr->gamma_16_to_1[i] = (png_uint_16p)png_malloc(png_ptr,
 84.4197 +              (png_uint_32)(256 * png_sizeof(png_uint_16)));
 84.4198 +
 84.4199 +           ig = (((png_uint_32)i *
 84.4200 +              (png_uint_32)png_gamma_shift[shift]) >> 4);
 84.4201 +           for (j = 0; j < 256; j++)
 84.4202 +           {
 84.4203 +              png_ptr->gamma_16_to_1[i][j] =
 84.4204 +                 (png_uint_16)(pow((double)(ig + ((png_uint_32)j << 8)) /
 84.4205 +                    65535.0, g) * 65535.0 + .5);
 84.4206 +           }
 84.4207 +        }
 84.4208 +
 84.4209 +        if (png_ptr->screen_gamma > 0.000001)
 84.4210 +           g = 1.0 / png_ptr->screen_gamma;
 84.4211 +        else
 84.4212 +           g = png_ptr->gamma;   /* probably doing rgb_to_gray */
 84.4213 +
 84.4214 +        png_ptr->gamma_16_from_1 = (png_uint_16pp)png_malloc(png_ptr,
 84.4215 +           (png_uint_32)(num * png_sizeof(png_uint_16p)));
 84.4216 +
 84.4217 +        for (i = 0; i < num; i++)
 84.4218 +        {
 84.4219 +           png_ptr->gamma_16_from_1[i] = (png_uint_16p)png_malloc(png_ptr,
 84.4220 +              (png_uint_32)(256 * png_sizeof(png_uint_16)));
 84.4221 +
 84.4222 +           ig = (((png_uint_32)i *
 84.4223 +              (png_uint_32)png_gamma_shift[shift]) >> 4);
 84.4224 +           for (j = 0; j < 256; j++)
 84.4225 +           {
 84.4226 +              png_ptr->gamma_16_from_1[i][j] =
 84.4227 +                 (png_uint_16)(pow((double)(ig + ((png_uint_32)j << 8)) /
 84.4228 +                    65535.0, g) * 65535.0 + .5);
 84.4229 +           }
 84.4230 +        }
 84.4231 +     }
 84.4232 +#endif /* PNG_READ_BACKGROUND_SUPPORTED || PNG_RGB_TO_GRAY_SUPPORTED */
 84.4233 +  }
 84.4234 +}
 84.4235 +#endif
 84.4236 +/* To do: install integer version of png_build_gamma_table here */
 84.4237 +#endif
 84.4238 +
 84.4239 +#if defined(PNG_MNG_FEATURES_SUPPORTED)
 84.4240 +/* undoes intrapixel differencing  */
 84.4241 +void /* PRIVATE */
 84.4242 +png_do_read_intrapixel(png_row_infop row_info, png_bytep row)
 84.4243 +{
 84.4244 +   png_debug(1, "in png_do_read_intrapixel\n");
 84.4245 +   if (
 84.4246 +#if defined(PNG_USELESS_TESTS_SUPPORTED)
 84.4247 +       row != NULL && row_info != NULL &&
 84.4248 +#endif
 84.4249 +       (row_info->color_type & PNG_COLOR_MASK_COLOR))
 84.4250 +   {
 84.4251 +      int bytes_per_pixel;
 84.4252 +      png_uint_32 row_width = row_info->width;
 84.4253 +      if (row_info->bit_depth == 8)
 84.4254 +      {
 84.4255 +         png_bytep rp;
 84.4256 +         png_uint_32 i;
 84.4257 +
 84.4258 +         if (row_info->color_type == PNG_COLOR_TYPE_RGB)
 84.4259 +            bytes_per_pixel = 3;
 84.4260 +         else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
 84.4261 +            bytes_per_pixel = 4;
 84.4262 +         else
 84.4263 +            return;
 84.4264 +
 84.4265 +         for (i = 0, rp = row; i < row_width; i++, rp += bytes_per_pixel)
 84.4266 +         {
 84.4267 +            *(rp) = (png_byte)((256 + *rp + *(rp+1))&0xff);
 84.4268 +            *(rp+2) = (png_byte)((256 + *(rp+2) + *(rp+1))&0xff);
 84.4269 +         }
 84.4270 +      }
 84.4271 +      else if (row_info->bit_depth == 16)
 84.4272 +      {
 84.4273 +         png_bytep rp;
 84.4274 +         png_uint_32 i;
 84.4275 +
 84.4276 +         if (row_info->color_type == PNG_COLOR_TYPE_RGB)
 84.4277 +            bytes_per_pixel = 6;
 84.4278 +         else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
 84.4279 +            bytes_per_pixel = 8;
 84.4280 +         else
 84.4281 +            return;
 84.4282 +
 84.4283 +         for (i = 0, rp = row; i < row_width; i++, rp += bytes_per_pixel)
 84.4284 +         {
 84.4285 +            png_uint_32 s0   = (*(rp    ) << 8) | *(rp + 1);
 84.4286 +            png_uint_32 s1   = (*(rp + 2) << 8) | *(rp + 3);
 84.4287 +            png_uint_32 s2   = (*(rp + 4) << 8) | *(rp + 5);
 84.4288 +            png_uint_32 red  = (png_uint_32)((s0 + s1 + 65536L) & 0xffffL);
 84.4289 +            png_uint_32 blue = (png_uint_32)((s2 + s1 + 65536L) & 0xffffL);
 84.4290 +            *(rp  ) = (png_byte)((red >> 8) & 0xff);
 84.4291 +            *(rp+1) = (png_byte)(red & 0xff);
 84.4292 +            *(rp+4) = (png_byte)((blue >> 8) & 0xff);
 84.4293 +            *(rp+5) = (png_byte)(blue & 0xff);
 84.4294 +         }
 84.4295 +      }
 84.4296 +   }
 84.4297 +}
 84.4298 +#endif /* PNG_MNG_FEATURES_SUPPORTED */
 84.4299 +#endif /* PNG_READ_SUPPORTED */
    85.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    85.2 +++ b/libs/libpng/pngrutil.c	Sun Nov 01 00:36:56 2015 +0200
    85.3 @@ -0,0 +1,3234 @@
    85.4 +
    85.5 +/* pngrutil.c - utilities to read a PNG file
    85.6 + *
    85.7 + * Last changed in libpng 1.2.33 [October 31, 2008]
    85.8 + * For conditions of distribution and use, see copyright notice in png.h
    85.9 + * Copyright (c) 1998-2008 Glenn Randers-Pehrson
   85.10 + * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
   85.11 + * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
   85.12 + *
   85.13 + * This file contains routines that are only called from within
   85.14 + * libpng itself during the course of reading an image.
   85.15 + */
   85.16 +
   85.17 +#define PNG_INTERNAL
   85.18 +#include "png.h"
   85.19 +#if defined(PNG_READ_SUPPORTED)
   85.20 +
   85.21 +#if defined(_WIN32_WCE) && (_WIN32_WCE<0x500)
   85.22 +#  define WIN32_WCE_OLD
   85.23 +#endif
   85.24 +
   85.25 +#ifdef PNG_FLOATING_POINT_SUPPORTED
   85.26 +#  if defined(WIN32_WCE_OLD)
   85.27 +/* strtod() function is not supported on WindowsCE */
   85.28 +__inline double png_strtod(png_structp png_ptr, PNG_CONST char *nptr, char **endptr)
   85.29 +{
   85.30 +   double result = 0;
   85.31 +   int len;
   85.32 +   wchar_t *str, *end;
   85.33 +
   85.34 +   len = MultiByteToWideChar(CP_ACP, 0, nptr, -1, NULL, 0);
   85.35 +   str = (wchar_t *)png_malloc(png_ptr, len * png_sizeof(wchar_t));
   85.36 +   if ( NULL != str )
   85.37 +   {
   85.38 +      MultiByteToWideChar(CP_ACP, 0, nptr, -1, str, len);
   85.39 +      result = wcstod(str, &end);
   85.40 +      len = WideCharToMultiByte(CP_ACP, 0, end, -1, NULL, 0, NULL, NULL);
   85.41 +      *endptr = (char *)nptr + (png_strlen(nptr) - len + 1);
   85.42 +      png_free(png_ptr, str);
   85.43 +   }
   85.44 +   return result;
   85.45 +}
   85.46 +#  else
   85.47 +#    define png_strtod(p,a,b) strtod(a,b)
   85.48 +#  endif
   85.49 +#endif
   85.50 +
   85.51 +png_uint_32 PNGAPI
   85.52 +png_get_uint_31(png_structp png_ptr, png_bytep buf)
   85.53 +{
   85.54 +#ifdef PNG_READ_BIG_ENDIAN_SUPPORTED
   85.55 +   png_uint_32 i = png_get_uint_32(buf);
   85.56 +#else
   85.57 +   /* Avoid an extra function call by inlining the result. */
   85.58 +   png_uint_32 i = ((png_uint_32)(*buf) << 24) +
   85.59 +      ((png_uint_32)(*(buf + 1)) << 16) +
   85.60 +      ((png_uint_32)(*(buf + 2)) << 8) +
   85.61 +      (png_uint_32)(*(buf + 3));
   85.62 +#endif
   85.63 +   if (i > PNG_UINT_31_MAX)
   85.64 +     png_error(png_ptr, "PNG unsigned integer out of range.");
   85.65 +   return (i);
   85.66 +}
   85.67 +#ifndef PNG_READ_BIG_ENDIAN_SUPPORTED
   85.68 +/* Grab an unsigned 32-bit integer from a buffer in big-endian format. */
   85.69 +png_uint_32 PNGAPI
   85.70 +png_get_uint_32(png_bytep buf)
   85.71 +{
   85.72 +   png_uint_32 i = ((png_uint_32)(*buf) << 24) +
   85.73 +      ((png_uint_32)(*(buf + 1)) << 16) +
   85.74 +      ((png_uint_32)(*(buf + 2)) << 8) +
   85.75 +      (png_uint_32)(*(buf + 3));
   85.76 +
   85.77 +   return (i);
   85.78 +}
   85.79 +
   85.80 +/* Grab a signed 32-bit integer from a buffer in big-endian format.  The
   85.81 + * data is stored in the PNG file in two's complement format, and it is
   85.82 + * assumed that the machine format for signed integers is the same. */
   85.83 +png_int_32 PNGAPI
   85.84 +png_get_int_32(png_bytep buf)
   85.85 +{
   85.86 +   png_int_32 i = ((png_int_32)(*buf) << 24) +
   85.87 +      ((png_int_32)(*(buf + 1)) << 16) +
   85.88 +      ((png_int_32)(*(buf + 2)) << 8) +
   85.89 +      (png_int_32)(*(buf + 3));
   85.90 +
   85.91 +   return (i);
   85.92 +}
   85.93 +
   85.94 +/* Grab an unsigned 16-bit integer from a buffer in big-endian format. */
   85.95 +png_uint_16 PNGAPI
   85.96 +png_get_uint_16(png_bytep buf)
   85.97 +{
   85.98 +   png_uint_16 i = (png_uint_16)(((png_uint_16)(*buf) << 8) +
   85.99 +      (png_uint_16)(*(buf + 1)));
  85.100 +
  85.101 +   return (i);
  85.102 +}
  85.103 +#endif /* PNG_READ_BIG_ENDIAN_SUPPORTED */
  85.104 +
  85.105 +/* Read the chunk header (length + type name).
  85.106 + * Put the type name into png_ptr->chunk_name, and return the length.
  85.107 + */
  85.108 +png_uint_32 /* PRIVATE */
  85.109 +png_read_chunk_header(png_structp png_ptr)
  85.110 +{
  85.111 +   png_byte buf[8];
  85.112 +   png_uint_32 length;
  85.113 +
  85.114 +   /* read the length and the chunk name */
  85.115 +   png_read_data(png_ptr, buf, 8);
  85.116 +   length = png_get_uint_31(png_ptr, buf);
  85.117 +
  85.118 +   /* put the chunk name into png_ptr->chunk_name */
  85.119 +   png_memcpy(png_ptr->chunk_name, buf + 4, 4);
  85.120 +
  85.121 +   png_debug2(0, "Reading %s chunk, length = %lu\n",
  85.122 +      png_ptr->chunk_name, length);
  85.123 +
  85.124 +   /* reset the crc and run it over the chunk name */
  85.125 +   png_reset_crc(png_ptr);
  85.126 +   png_calculate_crc(png_ptr, png_ptr->chunk_name, 4);
  85.127 +
  85.128 +   /* check to see if chunk name is valid */
  85.129 +   png_check_chunk_name(png_ptr, png_ptr->chunk_name);
  85.130 +
  85.131 +   return length;
  85.132 +}
  85.133 +
  85.134 +/* Read data, and (optionally) run it through the CRC. */
  85.135 +void /* PRIVATE */
  85.136 +png_crc_read(png_structp png_ptr, png_bytep buf, png_size_t length)
  85.137 +{
  85.138 +   if (png_ptr == NULL) return;
  85.139 +   png_read_data(png_ptr, buf, length);
  85.140 +   png_calculate_crc(png_ptr, buf, length);
  85.141 +}
  85.142 +
  85.143 +/* Optionally skip data and then check the CRC.  Depending on whether we
  85.144 +   are reading a ancillary or critical chunk, and how the program has set
  85.145 +   things up, we may calculate the CRC on the data and print a message.
  85.146 +   Returns '1' if there was a CRC error, '0' otherwise. */
  85.147 +int /* PRIVATE */
  85.148 +png_crc_finish(png_structp png_ptr, png_uint_32 skip)
  85.149 +{
  85.150 +   png_size_t i;
  85.151 +   png_size_t istop = png_ptr->zbuf_size;
  85.152 +
  85.153 +   for (i = (png_size_t)skip; i > istop; i -= istop)
  85.154 +   {
  85.155 +      png_crc_read(png_ptr, png_ptr->zbuf, png_ptr->zbuf_size);
  85.156 +   }
  85.157 +   if (i)
  85.158 +   {
  85.159 +      png_crc_read(png_ptr, png_ptr->zbuf, i);
  85.160 +   }
  85.161 +
  85.162 +   if (png_crc_error(png_ptr))
  85.163 +   {
  85.164 +      if (((png_ptr->chunk_name[0] & 0x20) &&                /* Ancillary */
  85.165 +           !(png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_NOWARN)) ||
  85.166 +          (!(png_ptr->chunk_name[0] & 0x20) &&             /* Critical  */
  85.167 +          (png_ptr->flags & PNG_FLAG_CRC_CRITICAL_USE)))
  85.168 +      {
  85.169 +         png_chunk_warning(png_ptr, "CRC error");
  85.170 +      }
  85.171 +      else
  85.172 +      {
  85.173 +         png_chunk_error(png_ptr, "CRC error");
  85.174 +      }
  85.175 +      return (1);
  85.176 +   }
  85.177 +
  85.178 +   return (0);
  85.179 +}
  85.180 +
  85.181 +/* Compare the CRC stored in the PNG file with that calculated by libpng from
  85.182 +   the data it has read thus far. */
  85.183 +int /* PRIVATE */
  85.184 +png_crc_error(png_structp png_ptr)
  85.185 +{
  85.186 +   png_byte crc_bytes[4];
  85.187 +   png_uint_32 crc;
  85.188 +   int need_crc = 1;
  85.189 +
  85.190 +   if (png_ptr->chunk_name[0] & 0x20)                     /* ancillary */
  85.191 +   {
  85.192 +      if ((png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_MASK) ==
  85.193 +          (PNG_FLAG_CRC_ANCILLARY_USE | PNG_FLAG_CRC_ANCILLARY_NOWARN))
  85.194 +         need_crc = 0;
  85.195 +   }
  85.196 +   else                                                    /* critical */
  85.197 +   {
  85.198 +      if (png_ptr->flags & PNG_FLAG_CRC_CRITICAL_IGNORE)
  85.199 +         need_crc = 0;
  85.200 +   }
  85.201 +
  85.202 +   png_read_data(png_ptr, crc_bytes, 4);
  85.203 +
  85.204 +   if (need_crc)
  85.205 +   {
  85.206 +      crc = png_get_uint_32(crc_bytes);
  85.207 +      return ((int)(crc != png_ptr->crc));
  85.208 +   }
  85.209 +   else
  85.210 +      return (0);
  85.211 +}
  85.212 +
  85.213 +#if defined(PNG_READ_zTXt_SUPPORTED) || defined(PNG_READ_iTXt_SUPPORTED) || \
  85.214 +    defined(PNG_READ_iCCP_SUPPORTED)
  85.215 +/*
  85.216 + * Decompress trailing data in a chunk.  The assumption is that chunkdata
  85.217 + * points at an allocated area holding the contents of a chunk with a
  85.218 + * trailing compressed part.  What we get back is an allocated area
  85.219 + * holding the original prefix part and an uncompressed version of the
  85.220 + * trailing part (the malloc area passed in is freed).
  85.221 + */
  85.222 +void /* PRIVATE */
  85.223 +png_decompress_chunk(png_structp png_ptr, int comp_type,
  85.224 +                              png_size_t chunklength,
  85.225 +                              png_size_t prefix_size, png_size_t *newlength)
  85.226 +{
  85.227 +   static PNG_CONST char msg[] = "Error decoding compressed text";
  85.228 +   png_charp text;
  85.229 +   png_size_t text_size;
  85.230 +
  85.231 +   if (comp_type == PNG_COMPRESSION_TYPE_BASE)
  85.232 +   {
  85.233 +      int ret = Z_OK;
  85.234 +      png_ptr->zstream.next_in = (png_bytep)(png_ptr->chunkdata + prefix_size);
  85.235 +      png_ptr->zstream.avail_in = (uInt)(chunklength - prefix_size);
  85.236 +      png_ptr->zstream.next_out = png_ptr->zbuf;
  85.237 +      png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
  85.238 +
  85.239 +      text_size = 0;
  85.240 +      text = NULL;
  85.241 +
  85.242 +      while (png_ptr->zstream.avail_in)
  85.243 +      {
  85.244 +         ret = inflate(&png_ptr->zstream, Z_PARTIAL_FLUSH);
  85.245 +         if (ret != Z_OK && ret != Z_STREAM_END)
  85.246 +         {
  85.247 +            if (png_ptr->zstream.msg != NULL)
  85.248 +               png_warning(png_ptr, png_ptr->zstream.msg);
  85.249 +            else
  85.250 +               png_warning(png_ptr, msg);
  85.251 +            inflateReset(&png_ptr->zstream);
  85.252 +            png_ptr->zstream.avail_in = 0;
  85.253 +
  85.254 +            if (text ==  NULL)
  85.255 +            {
  85.256 +               text_size = prefix_size + png_sizeof(msg) + 1;
  85.257 +               text = (png_charp)png_malloc_warn(png_ptr, text_size);
  85.258 +               if (text ==  NULL)
  85.259 +                 {
  85.260 +                    png_free(png_ptr, png_ptr->chunkdata);
  85.261 +                    png_ptr->chunkdata = NULL;
  85.262 +                    png_error(png_ptr, "Not enough memory to decompress chunk");
  85.263 +                 }
  85.264 +               png_memcpy(text, png_ptr->chunkdata, prefix_size);
  85.265 +            }
  85.266 +
  85.267 +            text[text_size - 1] = 0x00;
  85.268 +
  85.269 +            /* Copy what we can of the error message into the text chunk */
  85.270 +            text_size = (png_size_t)(chunklength -
  85.271 +              (text - png_ptr->chunkdata) - 1);
  85.272 +            if (text_size > png_sizeof(msg))
  85.273 +               text_size = png_sizeof(msg);
  85.274 +            png_memcpy(text + prefix_size, msg, text_size);
  85.275 +            break;
  85.276 +         }
  85.277 +         if (!png_ptr->zstream.avail_out || ret == Z_STREAM_END)
  85.278 +         {
  85.279 +            if (text == NULL)
  85.280 +            {
  85.281 +               text_size = prefix_size +
  85.282 +                   png_ptr->zbuf_size - png_ptr->zstream.avail_out;
  85.283 +               text = (png_charp)png_malloc_warn(png_ptr, text_size + 1);
  85.284 +               if (text ==  NULL)
  85.285 +               {
  85.286 +                  png_free(png_ptr, png_ptr->chunkdata);
  85.287 +                  png_ptr->chunkdata = NULL;
  85.288 +                  png_error(png_ptr,
  85.289 +                    "Not enough memory to decompress chunk.");
  85.290 +               }
  85.291 +               png_memcpy(text + prefix_size, png_ptr->zbuf,
  85.292 +                    text_size - prefix_size);
  85.293 +               png_memcpy(text, png_ptr->chunkdata, prefix_size);
  85.294 +               *(text + text_size) = 0x00;
  85.295 +            }
  85.296 +            else
  85.297 +            {
  85.298 +               png_charp tmp;
  85.299 +
  85.300 +               tmp = text;
  85.301 +               text = (png_charp)png_malloc_warn(png_ptr,
  85.302 +                  (png_uint_32)(text_size +
  85.303 +                  png_ptr->zbuf_size - png_ptr->zstream.avail_out + 1));
  85.304 +               if (text == NULL)
  85.305 +               {
  85.306 +                  png_free(png_ptr, tmp);
  85.307 +                  png_free(png_ptr, png_ptr->chunkdata);
  85.308 +                  png_ptr->chunkdata = NULL;
  85.309 +                  png_error(png_ptr,
  85.310 +                    "Not enough memory to decompress chunk..");
  85.311 +               }
  85.312 +               png_memcpy(text, tmp, text_size);
  85.313 +               png_free(png_ptr, tmp);
  85.314 +               png_memcpy(text + text_size, png_ptr->zbuf,
  85.315 +                  (png_ptr->zbuf_size - png_ptr->zstream.avail_out));
  85.316 +               text_size += png_ptr->zbuf_size - png_ptr->zstream.avail_out;
  85.317 +               *(text + text_size) = 0x00;
  85.318 +            }
  85.319 +            if (ret == Z_STREAM_END)
  85.320 +               break;
  85.321 +            else
  85.322 +            {
  85.323 +               png_ptr->zstream.next_out = png_ptr->zbuf;
  85.324 +               png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
  85.325 +            }
  85.326 +         }
  85.327 +      }
  85.328 +      if (ret != Z_STREAM_END)
  85.329 +      {
  85.330 +#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE)
  85.331 +         char umsg[52];
  85.332 +
  85.333 +         if (ret == Z_BUF_ERROR)
  85.334 +            png_snprintf(umsg, 52,
  85.335 +                "Buffer error in compressed datastream in %s chunk",
  85.336 +                png_ptr->chunk_name);
  85.337 +         else if (ret == Z_DATA_ERROR)
  85.338 +            png_snprintf(umsg, 52,
  85.339 +                "Data error in compressed datastream in %s chunk",
  85.340 +                png_ptr->chunk_name);
  85.341 +         else
  85.342 +            png_snprintf(umsg, 52,
  85.343 +                "Incomplete compressed datastream in %s chunk",
  85.344 +                png_ptr->chunk_name);
  85.345 +         png_warning(png_ptr, umsg);
  85.346 +#else
  85.347 +         png_warning(png_ptr,
  85.348 +            "Incomplete compressed datastream in chunk other than IDAT");
  85.349 +#endif
  85.350 +         text_size = prefix_size;
  85.351 +         if (text ==  NULL)
  85.352 +         {
  85.353 +            text = (png_charp)png_malloc_warn(png_ptr, text_size+1);
  85.354 +            if (text == NULL)
  85.355 +              {
  85.356 +                png_free(png_ptr, png_ptr->chunkdata);
  85.357 +                png_ptr->chunkdata = NULL;
  85.358 +                png_error(png_ptr, "Not enough memory for text.");
  85.359 +              }
  85.360 +            png_memcpy(text, png_ptr->chunkdata, prefix_size);
  85.361 +         }
  85.362 +         *(text + text_size) = 0x00;
  85.363 +      }
  85.364 +
  85.365 +      inflateReset(&png_ptr->zstream);
  85.366 +      png_ptr->zstream.avail_in = 0;
  85.367 +
  85.368 +      png_free(png_ptr, png_ptr->chunkdata);
  85.369 +      png_ptr->chunkdata = text;
  85.370 +      *newlength=text_size;
  85.371 +   }
  85.372 +   else /* if (comp_type != PNG_COMPRESSION_TYPE_BASE) */
  85.373 +   {
  85.374 +#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE)
  85.375 +      char umsg[50];
  85.376 +
  85.377 +      png_snprintf(umsg, 50, "Unknown zTXt compression type %d", comp_type);
  85.378 +      png_warning(png_ptr, umsg);
  85.379 +#else
  85.380 +      png_warning(png_ptr, "Unknown zTXt compression type");
  85.381 +#endif
  85.382 +
  85.383 +      *(png_ptr->chunkdata + prefix_size) = 0x00;
  85.384 +      *newlength = prefix_size;
  85.385 +   }
  85.386 +}
  85.387 +#endif
  85.388 +
  85.389 +/* read and check the IDHR chunk */
  85.390 +void /* PRIVATE */
  85.391 +png_handle_IHDR(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
  85.392 +{
  85.393 +   png_byte buf[13];
  85.394 +   png_uint_32 width, height;
  85.395 +   int bit_depth, color_type, compression_type, filter_type;
  85.396 +   int interlace_type;
  85.397 +
  85.398 +   png_debug(1, "in png_handle_IHDR\n");
  85.399 +
  85.400 +   if (png_ptr->mode & PNG_HAVE_IHDR)
  85.401 +      png_error(png_ptr, "Out of place IHDR");
  85.402 +
  85.403 +   /* check the length */
  85.404 +   if (length != 13)
  85.405 +      png_error(png_ptr, "Invalid IHDR chunk");
  85.406 +
  85.407 +   png_ptr->mode |= PNG_HAVE_IHDR;
  85.408 +
  85.409 +   png_crc_read(png_ptr, buf, 13);
  85.410 +   png_crc_finish(png_ptr, 0);
  85.411 +
  85.412 +   width = png_get_uint_31(png_ptr, buf);
  85.413 +   height = png_get_uint_31(png_ptr, buf + 4);
  85.414 +   bit_depth = buf[8];
  85.415 +   color_type = buf[9];
  85.416 +   compression_type = buf[10];
  85.417 +   filter_type = buf[11];
  85.418 +   interlace_type = buf[12];
  85.419 +
  85.420 +   /* set internal variables */
  85.421 +   png_ptr->width = width;
  85.422 +   png_ptr->height = height;
  85.423 +   png_ptr->bit_depth = (png_byte)bit_depth;
  85.424 +   png_ptr->interlaced = (png_byte)interlace_type;
  85.425 +   png_ptr->color_type = (png_byte)color_type;
  85.426 +#if defined(PNG_MNG_FEATURES_SUPPORTED)
  85.427 +   png_ptr->filter_type = (png_byte)filter_type;
  85.428 +#endif
  85.429 +   png_ptr->compression_type = (png_byte)compression_type;
  85.430 +
  85.431 +   /* find number of channels */
  85.432 +   switch (png_ptr->color_type)
  85.433 +   {
  85.434 +      case PNG_COLOR_TYPE_GRAY:
  85.435 +      case PNG_COLOR_TYPE_PALETTE:
  85.436 +         png_ptr->channels = 1;
  85.437 +         break;
  85.438 +      case PNG_COLOR_TYPE_RGB:
  85.439 +         png_ptr->channels = 3;
  85.440 +         break;
  85.441 +      case PNG_COLOR_TYPE_GRAY_ALPHA:
  85.442 +         png_ptr->channels = 2;
  85.443 +         break;
  85.444 +      case PNG_COLOR_TYPE_RGB_ALPHA:
  85.445 +         png_ptr->channels = 4;
  85.446 +         break;
  85.447 +   }
  85.448 +
  85.449 +   /* set up other useful info */
  85.450 +   png_ptr->pixel_depth = (png_byte)(png_ptr->bit_depth *
  85.451 +   png_ptr->channels);
  85.452 +   png_ptr->rowbytes = PNG_ROWBYTES(png_ptr->pixel_depth, png_ptr->width);
  85.453 +   png_debug1(3, "bit_depth = %d\n", png_ptr->bit_depth);
  85.454 +   png_debug1(3, "channels = %d\n", png_ptr->channels);
  85.455 +   png_debug1(3, "rowbytes = %lu\n", png_ptr->rowbytes);
  85.456 +   png_set_IHDR(png_ptr, info_ptr, width, height, bit_depth,
  85.457 +      color_type, interlace_type, compression_type, filter_type);
  85.458 +}
  85.459 +
  85.460 +/* read and check the palette */
  85.461 +void /* PRIVATE */
  85.462 +png_handle_PLTE(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
  85.463 +{
  85.464 +   png_color palette[PNG_MAX_PALETTE_LENGTH];
  85.465 +   int num, i;
  85.466 +#ifndef PNG_NO_POINTER_INDEXING
  85.467 +   png_colorp pal_ptr;
  85.468 +#endif
  85.469 +
  85.470 +   png_debug(1, "in png_handle_PLTE\n");
  85.471 +
  85.472 +   if (!(png_ptr->mode & PNG_HAVE_IHDR))
  85.473 +      png_error(png_ptr, "Missing IHDR before PLTE");
  85.474 +   else if (png_ptr->mode & PNG_HAVE_IDAT)
  85.475 +   {
  85.476 +      png_warning(png_ptr, "Invalid PLTE after IDAT");
  85.477 +      png_crc_finish(png_ptr, length);
  85.478 +      return;
  85.479 +   }
  85.480 +   else if (png_ptr->mode & PNG_HAVE_PLTE)
  85.481 +      png_error(png_ptr, "Duplicate PLTE chunk");
  85.482 +
  85.483 +   png_ptr->mode |= PNG_HAVE_PLTE;
  85.484 +
  85.485 +   if (!(png_ptr->color_type&PNG_COLOR_MASK_COLOR))
  85.486 +   {
  85.487 +      png_warning(png_ptr,
  85.488 +        "Ignoring PLTE chunk in grayscale PNG");
  85.489 +      png_crc_finish(png_ptr, length);
  85.490 +      return;
  85.491 +   }
  85.492 +#if !defined(PNG_READ_OPT_PLTE_SUPPORTED)
  85.493 +   if (png_ptr->color_type != PNG_COLOR_TYPE_PALETTE)
  85.494 +   {
  85.495 +      png_crc_finish(png_ptr, length);
  85.496 +      return;
  85.497 +   }
  85.498 +#endif
  85.499 +
  85.500 +   if (length > 3*PNG_MAX_PALETTE_LENGTH || length % 3)
  85.501 +   {
  85.502 +      if (png_ptr->color_type != PNG_COLOR_TYPE_PALETTE)
  85.503 +      {
  85.504 +         png_warning(png_ptr, "Invalid palette chunk");
  85.505 +         png_crc_finish(png_ptr, length);
  85.506 +         return;
  85.507 +      }
  85.508 +      else
  85.509 +      {
  85.510 +         png_error(png_ptr, "Invalid palette chunk");
  85.511 +      }
  85.512 +   }
  85.513 +
  85.514 +   num = (int)length / 3;
  85.515 +
  85.516 +#ifndef PNG_NO_POINTER_INDEXING
  85.517 +   for (i = 0, pal_ptr = palette; i < num; i++, pal_ptr++)
  85.518 +   {
  85.519 +      png_byte buf[3];
  85.520 +
  85.521 +      png_crc_read(png_ptr, buf, 3);
  85.522 +      pal_ptr->red = buf[0];
  85.523 +      pal_ptr->green = buf[1];
  85.524 +      pal_ptr->blue = buf[2];
  85.525 +   }
  85.526 +#else
  85.527 +   for (i = 0; i < num; i++)
  85.528 +   {
  85.529 +      png_byte buf[3];
  85.530 +
  85.531 +      png_crc_read(png_ptr, buf, 3);
  85.532 +      /* don't depend upon png_color being any order */
  85.533 +      palette[i].red = buf[0];
  85.534 +      palette[i].green = buf[1];
  85.535 +      palette[i].blue = buf[2];
  85.536 +   }
  85.537 +#endif
  85.538 +
  85.539 +   /* If we actually NEED the PLTE chunk (ie for a paletted image), we do
  85.540 +      whatever the normal CRC configuration tells us.  However, if we
  85.541 +      have an RGB image, the PLTE can be considered ancillary, so
  85.542 +      we will act as though it is. */
  85.543 +#if !defined(PNG_READ_OPT_PLTE_SUPPORTED)
  85.544 +   if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
  85.545 +#endif
  85.546 +   {
  85.547 +      png_crc_finish(png_ptr, 0);
  85.548 +   }
  85.549 +#if !defined(PNG_READ_OPT_PLTE_SUPPORTED)
  85.550 +   else if (png_crc_error(png_ptr))  /* Only if we have a CRC error */
  85.551 +   {
  85.552 +      /* If we don't want to use the data from an ancillary chunk,
  85.553 +         we have two options: an error abort, or a warning and we
  85.554 +         ignore the data in this chunk (which should be OK, since
  85.555 +         it's considered ancillary for a RGB or RGBA image). */
  85.556 +      if (!(png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_USE))
  85.557 +      {
  85.558 +         if (png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_NOWARN)
  85.559 +         {
  85.560 +            png_chunk_error(png_ptr, "CRC error");
  85.561 +         }
  85.562 +         else
  85.563 +         {
  85.564 +            png_chunk_warning(png_ptr, "CRC error");
  85.565 +            return;
  85.566 +         }
  85.567 +      }
  85.568 +      /* Otherwise, we (optionally) emit a warning and use the chunk. */
  85.569 +      else if (!(png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_NOWARN))
  85.570 +      {
  85.571 +         png_chunk_warning(png_ptr, "CRC error");
  85.572 +      }
  85.573 +   }
  85.574 +#endif
  85.575 +
  85.576 +   png_set_PLTE(png_ptr, info_ptr, palette, num);
  85.577 +
  85.578 +#if defined(PNG_READ_tRNS_SUPPORTED)
  85.579 +   if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
  85.580 +   {
  85.581 +      if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_tRNS))
  85.582 +      {
  85.583 +         if (png_ptr->num_trans > (png_uint_16)num)
  85.584 +         {
  85.585 +            png_warning(png_ptr, "Truncating incorrect tRNS chunk length");
  85.586 +            png_ptr->num_trans = (png_uint_16)num;
  85.587 +         }
  85.588 +         if (info_ptr->num_trans > (png_uint_16)num)
  85.589 +         {
  85.590 +            png_warning(png_ptr, "Truncating incorrect info tRNS chunk length");
  85.591 +            info_ptr->num_trans = (png_uint_16)num;
  85.592 +         }
  85.593 +      }
  85.594 +   }
  85.595 +#endif
  85.596 +
  85.597 +}
  85.598 +
  85.599 +void /* PRIVATE */
  85.600 +png_handle_IEND(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
  85.601 +{
  85.602 +   png_debug(1, "in png_handle_IEND\n");
  85.603 +
  85.604 +   if (!(png_ptr->mode & PNG_HAVE_IHDR) || !(png_ptr->mode & PNG_HAVE_IDAT))
  85.605 +   {
  85.606 +      png_error(png_ptr, "No image in file");
  85.607 +   }
  85.608 +
  85.609 +   png_ptr->mode |= (PNG_AFTER_IDAT | PNG_HAVE_IEND);
  85.610 +
  85.611 +   if (length != 0)
  85.612 +   {
  85.613 +      png_warning(png_ptr, "Incorrect IEND chunk length");
  85.614 +   }
  85.615 +   png_crc_finish(png_ptr, length);
  85.616 +
  85.617 +   info_ptr = info_ptr; /* quiet compiler warnings about unused info_ptr */
  85.618 +}
  85.619 +
  85.620 +#if defined(PNG_READ_gAMA_SUPPORTED)
  85.621 +void /* PRIVATE */
  85.622 +png_handle_gAMA(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
  85.623 +{
  85.624 +   png_fixed_point igamma;
  85.625 +#ifdef PNG_FLOATING_POINT_SUPPORTED
  85.626 +   float file_gamma;
  85.627 +#endif
  85.628 +   png_byte buf[4];
  85.629 +
  85.630 +   png_debug(1, "in png_handle_gAMA\n");
  85.631 +
  85.632 +   if (!(png_ptr->mode & PNG_HAVE_IHDR))
  85.633 +      png_error(png_ptr, "Missing IHDR before gAMA");
  85.634 +   else if (png_ptr->mode & PNG_HAVE_IDAT)
  85.635 +   {
  85.636 +      png_warning(png_ptr, "Invalid gAMA after IDAT");
  85.637 +      png_crc_finish(png_ptr, length);
  85.638 +      return;
  85.639 +   }
  85.640 +   else if (png_ptr->mode & PNG_HAVE_PLTE)
  85.641 +      /* Should be an error, but we can cope with it */
  85.642 +      png_warning(png_ptr, "Out of place gAMA chunk");
  85.643 +
  85.644 +   if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_gAMA)
  85.645 +#if defined(PNG_READ_sRGB_SUPPORTED)
  85.646 +      && !(info_ptr->valid & PNG_INFO_sRGB)
  85.647 +#endif
  85.648 +      )
  85.649 +   {
  85.650 +      png_warning(png_ptr, "Duplicate gAMA chunk");
  85.651 +      png_crc_finish(png_ptr, length);
  85.652 +      return;
  85.653 +   }
  85.654 +
  85.655 +   if (length != 4)
  85.656 +   {
  85.657 +      png_warning(png_ptr, "Incorrect gAMA chunk length");
  85.658 +      png_crc_finish(png_ptr, length);
  85.659 +      return;
  85.660 +   }
  85.661 +
  85.662 +   png_crc_read(png_ptr, buf, 4);
  85.663 +   if (png_crc_finish(png_ptr, 0))
  85.664 +      return;
  85.665 +
  85.666 +   igamma = (png_fixed_point)png_get_uint_32(buf);
  85.667 +   /* check for zero gamma */
  85.668 +   if (igamma == 0)
  85.669 +      {
  85.670 +         png_warning(png_ptr,
  85.671 +           "Ignoring gAMA chunk with gamma=0");
  85.672 +         return;
  85.673 +      }
  85.674 +
  85.675 +#if defined(PNG_READ_sRGB_SUPPORTED)
  85.676 +   if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_sRGB))
  85.677 +      if (PNG_OUT_OF_RANGE(igamma, 45500L, 500))
  85.678 +      {
  85.679 +         png_warning(png_ptr,
  85.680 +           "Ignoring incorrect gAMA value when sRGB is also present");
  85.681 +#ifndef PNG_NO_CONSOLE_IO
  85.682 +         fprintf(stderr, "gamma = (%d/100000)\n", (int)igamma);
  85.683 +#endif
  85.684 +         return;
  85.685 +      }
  85.686 +#endif /* PNG_READ_sRGB_SUPPORTED */
  85.687 +
  85.688 +#ifdef PNG_FLOATING_POINT_SUPPORTED
  85.689 +   file_gamma = (float)igamma / (float)100000.0;
  85.690 +#  ifdef PNG_READ_GAMMA_SUPPORTED
  85.691 +     png_ptr->gamma = file_gamma;
  85.692 +#  endif
  85.693 +     png_set_gAMA(png_ptr, info_ptr, file_gamma);
  85.694 +#endif
  85.695 +#ifdef PNG_FIXED_POINT_SUPPORTED
  85.696 +   png_set_gAMA_fixed(png_ptr, info_ptr, igamma);
  85.697 +#endif
  85.698 +}
  85.699 +#endif
  85.700 +
  85.701 +#if defined(PNG_READ_sBIT_SUPPORTED)
  85.702 +void /* PRIVATE */
  85.703 +png_handle_sBIT(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
  85.704 +{
  85.705 +   png_size_t truelen;
  85.706 +   png_byte buf[4];
  85.707 +
  85.708 +   png_debug(1, "in png_handle_sBIT\n");
  85.709 +
  85.710 +   buf[0] = buf[1] = buf[2] = buf[3] = 0;
  85.711 +
  85.712 +   if (!(png_ptr->mode & PNG_HAVE_IHDR))
  85.713 +      png_error(png_ptr, "Missing IHDR before sBIT");
  85.714 +   else if (png_ptr->mode & PNG_HAVE_IDAT)
  85.715 +   {
  85.716 +      png_warning(png_ptr, "Invalid sBIT after IDAT");
  85.717 +      png_crc_finish(png_ptr, length);
  85.718 +      return;
  85.719 +   }
  85.720 +   else if (png_ptr->mode & PNG_HAVE_PLTE)
  85.721 +   {
  85.722 +      /* Should be an error, but we can cope with it */
  85.723 +      png_warning(png_ptr, "Out of place sBIT chunk");
  85.724 +   }
  85.725 +   if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_sBIT))
  85.726 +   {
  85.727 +      png_warning(png_ptr, "Duplicate sBIT chunk");
  85.728 +      png_crc_finish(png_ptr, length);
  85.729 +      return;
  85.730 +   }
  85.731 +
  85.732 +   if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
  85.733 +      truelen = 3;
  85.734 +   else
  85.735 +      truelen = (png_size_t)png_ptr->channels;
  85.736 +
  85.737 +   if (length != truelen || length > 4)
  85.738 +   {
  85.739 +      png_warning(png_ptr, "Incorrect sBIT chunk length");
  85.740 +      png_crc_finish(png_ptr, length);
  85.741 +      return;
  85.742 +   }
  85.743 +
  85.744 +   png_crc_read(png_ptr, buf, truelen);
  85.745 +   if (png_crc_finish(png_ptr, 0))
  85.746 +      return;
  85.747 +
  85.748 +   if (png_ptr->color_type & PNG_COLOR_MASK_COLOR)
  85.749 +   {
  85.750 +      png_ptr->sig_bit.red = buf[0];
  85.751 +      png_ptr->sig_bit.green = buf[1];
  85.752 +      png_ptr->sig_bit.blue = buf[2];
  85.753 +      png_ptr->sig_bit.alpha = buf[3];
  85.754 +   }
  85.755 +   else
  85.756 +   {
  85.757 +      png_ptr->sig_bit.gray = buf[0];
  85.758 +      png_ptr->sig_bit.red = buf[0];
  85.759 +      png_ptr->sig_bit.green = buf[0];
  85.760 +      png_ptr->sig_bit.blue = buf[0];
  85.761 +      png_ptr->sig_bit.alpha = buf[1];
  85.762 +   }
  85.763 +   png_set_sBIT(png_ptr, info_ptr, &(png_ptr->sig_bit));
  85.764 +}
  85.765 +#endif
  85.766 +
  85.767 +#if defined(PNG_READ_cHRM_SUPPORTED)
  85.768 +void /* PRIVATE */
  85.769 +png_handle_cHRM(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
  85.770 +{
  85.771 +   png_byte buf[32];
  85.772 +#ifdef PNG_FLOATING_POINT_SUPPORTED
  85.773 +   float white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y;
  85.774 +#endif
  85.775 +   png_fixed_point int_x_white, int_y_white, int_x_red, int_y_red, int_x_green,
  85.776 +      int_y_green, int_x_blue, int_y_blue;
  85.777 +
  85.778 +   png_uint_32 uint_x, uint_y;
  85.779 +
  85.780 +   png_debug(1, "in png_handle_cHRM\n");
  85.781 +
  85.782 +   if (!(png_ptr->mode & PNG_HAVE_IHDR))
  85.783 +      png_error(png_ptr, "Missing IHDR before cHRM");
  85.784 +   else if (png_ptr->mode & PNG_HAVE_IDAT)
  85.785 +   {
  85.786 +      png_warning(png_ptr, "Invalid cHRM after IDAT");
  85.787 +      png_crc_finish(png_ptr, length);
  85.788 +      return;
  85.789 +   }
  85.790 +   else if (png_ptr->mode & PNG_HAVE_PLTE)
  85.791 +      /* Should be an error, but we can cope with it */
  85.792 +      png_warning(png_ptr, "Missing PLTE before cHRM");
  85.793 +
  85.794 +   if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_cHRM)
  85.795 +#if defined(PNG_READ_sRGB_SUPPORTED)
  85.796 +      && !(info_ptr->valid & PNG_INFO_sRGB)
  85.797 +#endif
  85.798 +      )
  85.799 +   {
  85.800 +      png_warning(png_ptr, "Duplicate cHRM chunk");
  85.801 +      png_crc_finish(png_ptr, length);
  85.802 +      return;
  85.803 +   }
  85.804 +
  85.805 +   if (length != 32)
  85.806 +   {
  85.807 +      png_warning(png_ptr, "Incorrect cHRM chunk length");
  85.808 +      png_crc_finish(png_ptr, length);
  85.809 +      return;
  85.810 +   }
  85.811 +
  85.812 +   png_crc_read(png_ptr, buf, 32);
  85.813 +   if (png_crc_finish(png_ptr, 0))
  85.814 +      return;
  85.815 +
  85.816 +   uint_x = png_get_uint_32(buf);
  85.817 +   uint_y = png_get_uint_32(buf + 4);
  85.818 +   if (uint_x > 80000L || uint_y > 80000L ||
  85.819 +      uint_x + uint_y > 100000L)
  85.820 +   {
  85.821 +      png_warning(png_ptr, "Invalid cHRM white point");
  85.822 +      return;
  85.823 +   }
  85.824 +   int_x_white = (png_fixed_point)uint_x;
  85.825 +   int_y_white = (png_fixed_point)uint_y;
  85.826 +
  85.827 +   uint_x = png_get_uint_32(buf + 8);
  85.828 +   uint_y = png_get_uint_32(buf + 12);
  85.829 +   if (uint_x + uint_y > 100000L)
  85.830 +   {
  85.831 +      png_warning(png_ptr, "Invalid cHRM red point");
  85.832 +      return;
  85.833 +   }
  85.834 +   int_x_red = (png_fixed_point)uint_x;
  85.835 +   int_y_red = (png_fixed_point)uint_y;
  85.836 +
  85.837 +   uint_x = png_get_uint_32(buf + 16);
  85.838 +   uint_y = png_get_uint_32(buf + 20);
  85.839 +   if (uint_x + uint_y > 100000L)
  85.840 +   {
  85.841 +      png_warning(png_ptr, "Invalid cHRM green point");
  85.842 +      return;
  85.843 +   }
  85.844 +   int_x_green = (png_fixed_point)uint_x;
  85.845 +   int_y_green = (png_fixed_point)uint_y;
  85.846 +
  85.847 +   uint_x = png_get_uint_32(buf + 24);
  85.848 +   uint_y = png_get_uint_32(buf + 28);
  85.849 +   if (uint_x + uint_y > 100000L)
  85.850 +   {
  85.851 +      png_warning(png_ptr, "Invalid cHRM blue point");
  85.852 +      return;
  85.853 +   }
  85.854 +   int_x_blue = (png_fixed_point)uint_x;
  85.855 +   int_y_blue = (png_fixed_point)uint_y;
  85.856 +
  85.857 +#ifdef PNG_FLOATING_POINT_SUPPORTED
  85.858 +   white_x = (float)int_x_white / (float)100000.0;
  85.859 +   white_y = (float)int_y_white / (float)100000.0;
  85.860 +   red_x   = (float)int_x_red   / (float)100000.0;
  85.861 +   red_y   = (float)int_y_red   / (float)100000.0;
  85.862 +   green_x = (float)int_x_green / (float)100000.0;
  85.863 +   green_y = (float)int_y_green / (float)100000.0;
  85.864 +   blue_x  = (float)int_x_blue  / (float)100000.0;
  85.865 +   blue_y  = (float)int_y_blue  / (float)100000.0;
  85.866 +#endif
  85.867 +
  85.868 +#if defined(PNG_READ_sRGB_SUPPORTED)
  85.869 +   if ((info_ptr != NULL) && (info_ptr->valid & PNG_INFO_sRGB))
  85.870 +      {
  85.871 +      if (PNG_OUT_OF_RANGE(int_x_white, 31270,  1000) ||
  85.872 +          PNG_OUT_OF_RANGE(int_y_white, 32900,  1000) ||
  85.873 +          PNG_OUT_OF_RANGE(int_x_red,   64000L, 1000) ||
  85.874 +          PNG_OUT_OF_RANGE(int_y_red,   33000,  1000) ||
  85.875 +          PNG_OUT_OF_RANGE(int_x_green, 30000,  1000) ||
  85.876 +          PNG_OUT_OF_RANGE(int_y_green, 60000L, 1000) ||
  85.877 +          PNG_OUT_OF_RANGE(int_x_blue,  15000,  1000) ||
  85.878 +          PNG_OUT_OF_RANGE(int_y_blue,   6000,  1000))
  85.879 +         {
  85.880 +            png_warning(png_ptr,
  85.881 +              "Ignoring incorrect cHRM value when sRGB is also present");
  85.882 +#ifndef PNG_NO_CONSOLE_IO
  85.883 +#ifdef PNG_FLOATING_POINT_SUPPORTED
  85.884 +            fprintf(stderr, "wx=%f, wy=%f, rx=%f, ry=%f\n",
  85.885 +               white_x, white_y, red_x, red_y);
  85.886 +            fprintf(stderr, "gx=%f, gy=%f, bx=%f, by=%f\n",
  85.887 +               green_x, green_y, blue_x, blue_y);
  85.888 +#else
  85.889 +            fprintf(stderr, "wx=%ld, wy=%ld, rx=%ld, ry=%ld\n",
  85.890 +               int_x_white, int_y_white, int_x_red, int_y_red);
  85.891 +            fprintf(stderr, "gx=%ld, gy=%ld, bx=%ld, by=%ld\n",
  85.892 +               int_x_green, int_y_green, int_x_blue, int_y_blue);
  85.893 +#endif
  85.894 +#endif /* PNG_NO_CONSOLE_IO */
  85.895 +         }
  85.896 +         return;
  85.897 +      }
  85.898 +#endif /* PNG_READ_sRGB_SUPPORTED */
  85.899 +
  85.900 +#ifdef PNG_FLOATING_POINT_SUPPORTED
  85.901 +   png_set_cHRM(png_ptr, info_ptr,
  85.902 +      white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y);
  85.903 +#endif
  85.904 +#ifdef PNG_FIXED_POINT_SUPPORTED
  85.905 +   png_set_cHRM_fixed(png_ptr, info_ptr,
  85.906 +      int_x_white, int_y_white, int_x_red, int_y_red, int_x_green,
  85.907 +      int_y_green, int_x_blue, int_y_blue);
  85.908 +#endif
  85.909 +}
  85.910 +#endif
  85.911 +
  85.912 +#if defined(PNG_READ_sRGB_SUPPORTED)
  85.913 +void /* PRIVATE */
  85.914 +png_handle_sRGB(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
  85.915 +{
  85.916 +   int intent;
  85.917 +   png_byte buf[1];
  85.918 +
  85.919 +   png_debug(1, "in png_handle_sRGB\n");
  85.920 +
  85.921 +   if (!(png_ptr->mode & PNG_HAVE_IHDR))
  85.922 +      png_error(png_ptr, "Missing IHDR before sRGB");
  85.923 +   else if (png_ptr->mode & PNG_HAVE_IDAT)
  85.924 +   {
  85.925 +      png_warning(png_ptr, "Invalid sRGB after IDAT");
  85.926 +      png_crc_finish(png_ptr, length);
  85.927 +      return;
  85.928 +   }
  85.929 +   else if (png_ptr->mode & PNG_HAVE_PLTE)
  85.930 +      /* Should be an error, but we can cope with it */
  85.931 +      png_warning(png_ptr, "Out of place sRGB chunk");
  85.932 +
  85.933 +   if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_sRGB))
  85.934 +   {
  85.935 +      png_warning(png_ptr, "Duplicate sRGB chunk");
  85.936 +      png_crc_finish(png_ptr, length);
  85.937 +      return;
  85.938 +   }
  85.939 +
  85.940 +   if (length != 1)
  85.941 +   {
  85.942 +      png_warning(png_ptr, "Incorrect sRGB chunk length");
  85.943 +      png_crc_finish(png_ptr, length);
  85.944 +      return;
  85.945 +   }
  85.946 +
  85.947 +   png_crc_read(png_ptr, buf, 1);
  85.948 +   if (png_crc_finish(png_ptr, 0))
  85.949 +      return;
  85.950 +
  85.951 +   intent = buf[0];
  85.952 +   /* check for bad intent */
  85.953 +   if (intent >= PNG_sRGB_INTENT_LAST)
  85.954 +   {
  85.955 +      png_warning(png_ptr, "Unknown sRGB intent");
  85.956 +      return;
  85.957 +   }
  85.958 +
  85.959 +#if defined(PNG_READ_gAMA_SUPPORTED) && defined(PNG_READ_GAMMA_SUPPORTED)
  85.960 +   if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_gAMA))
  85.961 +   {
  85.962 +   png_fixed_point igamma;
  85.963 +#ifdef PNG_FIXED_POINT_SUPPORTED
  85.964 +      igamma=info_ptr->int_gamma;
  85.965 +#else
  85.966 +#  ifdef PNG_FLOATING_POINT_SUPPORTED
  85.967 +      igamma=(png_fixed_point)(info_ptr->gamma * 100000.);
  85.968 +#  endif
  85.969 +#endif
  85.970 +      if (PNG_OUT_OF_RANGE(igamma, 45500L, 500))
  85.971 +      {
  85.972 +         png_warning(png_ptr,
  85.973 +           "Ignoring incorrect gAMA value when sRGB is also present");
  85.974 +#ifndef PNG_NO_CONSOLE_IO
  85.975 +#  ifdef PNG_FIXED_POINT_SUPPORTED
  85.976 +         fprintf(stderr, "incorrect gamma=(%d/100000)\n",
  85.977 +            (int)png_ptr->int_gamma);
  85.978 +#  else
  85.979 +#    ifdef PNG_FLOATING_POINT_SUPPORTED
  85.980 +         fprintf(stderr, "incorrect gamma=%f\n", png_ptr->gamma);
  85.981 +#    endif
  85.982 +#  endif
  85.983 +#endif
  85.984 +      }
  85.985 +   }
  85.986 +#endif /* PNG_READ_gAMA_SUPPORTED */
  85.987 +
  85.988 +#ifdef PNG_READ_cHRM_SUPPORTED
  85.989 +#ifdef PNG_FIXED_POINT_SUPPORTED
  85.990 +   if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_cHRM))
  85.991 +      if (PNG_OUT_OF_RANGE(info_ptr->int_x_white, 31270,  1000) ||
  85.992 +          PNG_OUT_OF_RANGE(info_ptr->int_y_white, 32900,  1000) ||
  85.993 +          PNG_OUT_OF_RANGE(info_ptr->int_x_red,   64000L, 1000) ||
  85.994 +          PNG_OUT_OF_RANGE(info_ptr->int_y_red,   33000,  1000) ||
  85.995 +          PNG_OUT_OF_RANGE(info_ptr->int_x_green, 30000,  1000) ||
  85.996 +          PNG_OUT_OF_RANGE(info_ptr->int_y_green, 60000L, 1000) ||
  85.997 +          PNG_OUT_OF_RANGE(info_ptr->int_x_blue,  15000,  1000) ||
  85.998 +          PNG_OUT_OF_RANGE(info_ptr->int_y_blue,   6000,  1000))
  85.999 +         {
 85.1000 +            png_warning(png_ptr,
 85.1001 +              "Ignoring incorrect cHRM value when sRGB is also present");
 85.1002 +         }
 85.1003 +#endif /* PNG_FIXED_POINT_SUPPORTED */
 85.1004 +#endif /* PNG_READ_cHRM_SUPPORTED */
 85.1005 +
 85.1006 +   png_set_sRGB_gAMA_and_cHRM(png_ptr, info_ptr, intent);
 85.1007 +}
 85.1008 +#endif /* PNG_READ_sRGB_SUPPORTED */
 85.1009 +
 85.1010 +#if defined(PNG_READ_iCCP_SUPPORTED)
 85.1011 +void /* PRIVATE */
 85.1012 +png_handle_iCCP(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
 85.1013 +/* Note: this does not properly handle chunks that are > 64K under DOS */
 85.1014 +{
 85.1015 +   png_byte compression_type;
 85.1016 +   png_bytep pC;
 85.1017 +   png_charp profile;
 85.1018 +   png_uint_32 skip = 0;
 85.1019 +   png_uint_32 profile_size, profile_length;
 85.1020 +   png_size_t slength, prefix_length, data_length;
 85.1021 +
 85.1022 +   png_debug(1, "in png_handle_iCCP\n");
 85.1023 +
 85.1024 +   if (!(png_ptr->mode & PNG_HAVE_IHDR))
 85.1025 +      png_error(png_ptr, "Missing IHDR before iCCP");
 85.1026 +   else if (png_ptr->mode & PNG_HAVE_IDAT)
 85.1027 +   {
 85.1028 +      png_warning(png_ptr, "Invalid iCCP after IDAT");
 85.1029 +      png_crc_finish(png_ptr, length);
 85.1030 +      return;
 85.1031 +   }
 85.1032 +   else if (png_ptr->mode & PNG_HAVE_PLTE)
 85.1033 +      /* Should be an error, but we can cope with it */
 85.1034 +      png_warning(png_ptr, "Out of place iCCP chunk");
 85.1035 +
 85.1036 +   if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_iCCP))
 85.1037 +   {
 85.1038 +      png_warning(png_ptr, "Duplicate iCCP chunk");
 85.1039 +      png_crc_finish(png_ptr, length);
 85.1040 +      return;
 85.1041 +   }
 85.1042 +
 85.1043 +#ifdef PNG_MAX_MALLOC_64K
 85.1044 +   if (length > (png_uint_32)65535L)
 85.1045 +   {
 85.1046 +      png_warning(png_ptr, "iCCP chunk too large to fit in memory");
 85.1047 +      skip = length - (png_uint_32)65535L;
 85.1048 +      length = (png_uint_32)65535L;
 85.1049 +   }
 85.1050 +#endif
 85.1051 +
 85.1052 +   png_free(png_ptr, png_ptr->chunkdata);
 85.1053 +   png_ptr->chunkdata = (png_charp)png_malloc(png_ptr, length + 1);
 85.1054 +   slength = (png_size_t)length;
 85.1055 +   png_crc_read(png_ptr, (png_bytep)png_ptr->chunkdata, slength);
 85.1056 +
 85.1057 +   if (png_crc_finish(png_ptr, skip))
 85.1058 +   {
 85.1059 +      png_free(png_ptr, png_ptr->chunkdata);
 85.1060 +      png_ptr->chunkdata = NULL;
 85.1061 +      return;
 85.1062 +   }
 85.1063 +
 85.1064 +   png_ptr->chunkdata[slength] = 0x00;
 85.1065 +
 85.1066 +   for (profile = png_ptr->chunkdata; *profile; profile++)
 85.1067 +      /* empty loop to find end of name */ ;
 85.1068 +
 85.1069 +   ++profile;
 85.1070 +
 85.1071 +   /* there should be at least one zero (the compression type byte)
 85.1072 +      following the separator, and we should be on it  */
 85.1073 +   if ( profile >= png_ptr->chunkdata + slength - 1)
 85.1074 +   {
 85.1075 +      png_free(png_ptr, png_ptr->chunkdata);
 85.1076 +      png_ptr->chunkdata = NULL;
 85.1077 +      png_warning(png_ptr, "Malformed iCCP chunk");
 85.1078 +      return;
 85.1079 +   }
 85.1080 +
 85.1081 +   /* compression_type should always be zero */
 85.1082 +   compression_type = *profile++;
 85.1083 +   if (compression_type)
 85.1084 +   {
 85.1085 +      png_warning(png_ptr, "Ignoring nonzero compression type in iCCP chunk");
 85.1086 +      compression_type = 0x00;  /* Reset it to zero (libpng-1.0.6 through 1.0.8
 85.1087 +                                 wrote nonzero) */
 85.1088 +   }
 85.1089 +
 85.1090 +   prefix_length = profile - png_ptr->chunkdata;
 85.1091 +   png_decompress_chunk(png_ptr, compression_type,
 85.1092 +     slength, prefix_length, &data_length);
 85.1093 +
 85.1094 +   profile_length = data_length - prefix_length;
 85.1095 +
 85.1096 +   if ( prefix_length > data_length || profile_length < 4)
 85.1097 +   {
 85.1098 +      png_free(png_ptr, png_ptr->chunkdata);
 85.1099 +      png_ptr->chunkdata = NULL;
 85.1100 +      png_warning(png_ptr, "Profile size field missing from iCCP chunk");
 85.1101 +      return;
 85.1102 +   }
 85.1103 +
 85.1104 +   /* Check the profile_size recorded in the first 32 bits of the ICC profile */
 85.1105 +   pC = (png_bytep)(png_ptr->chunkdata + prefix_length);
 85.1106 +   profile_size = ((*(pC    ))<<24) |
 85.1107 +                  ((*(pC + 1))<<16) |
 85.1108 +                  ((*(pC + 2))<< 8) |
 85.1109 +                  ((*(pC + 3))    );
 85.1110 +
 85.1111 +   if (profile_size < profile_length)
 85.1112 +      profile_length = profile_size;
 85.1113 +
 85.1114 +   if (profile_size > profile_length)
 85.1115 +   {
 85.1116 +      png_free(png_ptr, png_ptr->chunkdata);
 85.1117 +      png_ptr->chunkdata = NULL;
 85.1118 +      png_warning(png_ptr, "Ignoring truncated iCCP profile.");
 85.1119 +      return;
 85.1120 +   }
 85.1121 +
 85.1122 +   png_set_iCCP(png_ptr, info_ptr, png_ptr->chunkdata,
 85.1123 +     compression_type, png_ptr->chunkdata + prefix_length, profile_length);
 85.1124 +   png_free(png_ptr, png_ptr->chunkdata);
 85.1125 +   png_ptr->chunkdata = NULL;
 85.1126 +}
 85.1127 +#endif /* PNG_READ_iCCP_SUPPORTED */
 85.1128 +
 85.1129 +#if defined(PNG_READ_sPLT_SUPPORTED)
 85.1130 +void /* PRIVATE */
 85.1131 +png_handle_sPLT(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
 85.1132 +/* Note: this does not properly handle chunks that are > 64K under DOS */
 85.1133 +{
 85.1134 +   png_bytep entry_start;
 85.1135 +   png_sPLT_t new_palette;
 85.1136 +#ifdef PNG_NO_POINTER_INDEXING
 85.1137 +   png_sPLT_entryp pp;
 85.1138 +#endif
 85.1139 +   int data_length, entry_size, i;
 85.1140 +   png_uint_32 skip = 0;
 85.1141 +   png_size_t slength;
 85.1142 +
 85.1143 +   png_debug(1, "in png_handle_sPLT\n");
 85.1144 +
 85.1145 +   if (!(png_ptr->mode & PNG_HAVE_IHDR))
 85.1146 +      png_error(png_ptr, "Missing IHDR before sPLT");
 85.1147 +   else if (png_ptr->mode & PNG_HAVE_IDAT)
 85.1148 +   {
 85.1149 +      png_warning(png_ptr, "Invalid sPLT after IDAT");
 85.1150 +      png_crc_finish(png_ptr, length);
 85.1151 +      return;
 85.1152 +   }
 85.1153 +
 85.1154 +#ifdef PNG_MAX_MALLOC_64K
 85.1155 +   if (length > (png_uint_32)65535L)
 85.1156 +   {
 85.1157 +      png_warning(png_ptr, "sPLT chunk too large to fit in memory");
 85.1158 +      skip = length - (png_uint_32)65535L;
 85.1159 +      length = (png_uint_32)65535L;
 85.1160 +   }
 85.1161 +#endif
 85.1162 +
 85.1163 +   png_free(png_ptr, png_ptr->chunkdata);
 85.1164 +   png_ptr->chunkdata = (png_charp)png_malloc(png_ptr, length + 1);
 85.1165 +   slength = (png_size_t)length;
 85.1166 +   png_crc_read(png_ptr, (png_bytep)png_ptr->chunkdata, slength);
 85.1167 +
 85.1168 +   if (png_crc_finish(png_ptr, skip))
 85.1169 +   {
 85.1170 +      png_free(png_ptr, png_ptr->chunkdata);
 85.1171 +      png_ptr->chunkdata = NULL;
 85.1172 +      return;
 85.1173 +   }
 85.1174 +
 85.1175 +   png_ptr->chunkdata[slength] = 0x00;
 85.1176 +
 85.1177 +   for (entry_start = (png_bytep)png_ptr->chunkdata; *entry_start; entry_start++)
 85.1178 +      /* empty loop to find end of name */ ;
 85.1179 +   ++entry_start;
 85.1180 +
 85.1181 +   /* a sample depth should follow the separator, and we should be on it  */
 85.1182 +   if (entry_start > (png_bytep)png_ptr->chunkdata + slength - 2)
 85.1183 +   {
 85.1184 +      png_free(png_ptr, png_ptr->chunkdata);
 85.1185 +      png_ptr->chunkdata = NULL;
 85.1186 +      png_warning(png_ptr, "malformed sPLT chunk");
 85.1187 +      return;
 85.1188 +   }
 85.1189 +
 85.1190 +   new_palette.depth = *entry_start++;
 85.1191 +   entry_size = (new_palette.depth == 8 ? 6 : 10);
 85.1192 +   data_length = (slength - (entry_start - (png_bytep)png_ptr->chunkdata));
 85.1193 +
 85.1194 +   /* integrity-check the data length */
 85.1195 +   if (data_length % entry_size)
 85.1196 +   {
 85.1197 +      png_free(png_ptr, png_ptr->chunkdata);
 85.1198 +      png_ptr->chunkdata = NULL;
 85.1199 +      png_warning(png_ptr, "sPLT chunk has bad length");
 85.1200 +      return;
 85.1201 +   }
 85.1202 +
 85.1203 +   new_palette.nentries = (png_int_32) ( data_length / entry_size);
 85.1204 +   if ((png_uint_32) new_palette.nentries >
 85.1205 +       (png_uint_32) (PNG_SIZE_MAX / png_sizeof(png_sPLT_entry)))
 85.1206 +   {
 85.1207 +       png_warning(png_ptr, "sPLT chunk too long");
 85.1208 +       return;
 85.1209 +   }
 85.1210 +   new_palette.entries = (png_sPLT_entryp)png_malloc_warn(
 85.1211 +       png_ptr, new_palette.nentries * png_sizeof(png_sPLT_entry));
 85.1212 +   if (new_palette.entries == NULL)
 85.1213 +   {
 85.1214 +       png_warning(png_ptr, "sPLT chunk requires too much memory");
 85.1215 +       return;
 85.1216 +   }
 85.1217 +
 85.1218 +#ifndef PNG_NO_POINTER_INDEXING
 85.1219 +   for (i = 0; i < new_palette.nentries; i++)
 85.1220 +   {
 85.1221 +      png_sPLT_entryp pp = new_palette.entries + i;
 85.1222 +
 85.1223 +      if (new_palette.depth == 8)
 85.1224 +      {
 85.1225 +          pp->red = *entry_start++;
 85.1226 +          pp->green = *entry_start++;
 85.1227 +          pp->blue = *entry_start++;
 85.1228 +          pp->alpha = *entry_start++;
 85.1229 +      }
 85.1230 +      else
 85.1231 +      {
 85.1232 +          pp->red   = png_get_uint_16(entry_start); entry_start += 2;
 85.1233 +          pp->green = png_get_uint_16(entry_start); entry_start += 2;
 85.1234 +          pp->blue  = png_get_uint_16(entry_start); entry_start += 2;
 85.1235 +          pp->alpha = png_get_uint_16(entry_start); entry_start += 2;
 85.1236 +      }
 85.1237 +      pp->frequency = png_get_uint_16(entry_start); entry_start += 2;
 85.1238 +   }
 85.1239 +#else
 85.1240 +   pp = new_palette.entries;
 85.1241 +   for (i = 0; i < new_palette.nentries; i++)
 85.1242 +   {
 85.1243 +
 85.1244 +      if (new_palette.depth == 8)
 85.1245 +      {
 85.1246 +          pp[i].red   = *entry_start++;
 85.1247 +          pp[i].green = *entry_start++;
 85.1248 +          pp[i].blue  = *entry_start++;
 85.1249 +          pp[i].alpha = *entry_start++;
 85.1250 +      }
 85.1251 +      else
 85.1252 +      {
 85.1253 +          pp[i].red   = png_get_uint_16(entry_start); entry_start += 2;
 85.1254 +          pp[i].green = png_get_uint_16(entry_start); entry_start += 2;
 85.1255 +          pp[i].blue  = png_get_uint_16(entry_start); entry_start += 2;
 85.1256 +          pp[i].alpha = png_get_uint_16(entry_start); entry_start += 2;
 85.1257 +      }
 85.1258 +      pp->frequency = png_get_uint_16(entry_start); entry_start += 2;
 85.1259 +   }
 85.1260 +#endif
 85.1261 +
 85.1262 +   /* discard all chunk data except the name and stash that */
 85.1263 +   new_palette.name = png_ptr->chunkdata;
 85.1264 +
 85.1265 +   png_set_sPLT(png_ptr, info_ptr, &new_palette, 1);
 85.1266 +
 85.1267 +   png_free(png_ptr, png_ptr->chunkdata);
 85.1268 +   png_ptr->chunkdata = NULL;
 85.1269 +   png_free(png_ptr, new_palette.entries);
 85.1270 +}
 85.1271 +#endif /* PNG_READ_sPLT_SUPPORTED */
 85.1272 +
 85.1273 +#if defined(PNG_READ_tRNS_SUPPORTED)
 85.1274 +void /* PRIVATE */
 85.1275 +png_handle_tRNS(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
 85.1276 +{
 85.1277 +   png_byte readbuf[PNG_MAX_PALETTE_LENGTH];
 85.1278 +
 85.1279 +   png_debug(1, "in png_handle_tRNS\n");
 85.1280 +
 85.1281 +   if (!(png_ptr->mode & PNG_HAVE_IHDR))
 85.1282 +      png_error(png_ptr, "Missing IHDR before tRNS");
 85.1283 +   else if (png_ptr->mode & PNG_HAVE_IDAT)
 85.1284 +   {
 85.1285 +      png_warning(png_ptr, "Invalid tRNS after IDAT");
 85.1286 +      png_crc_finish(png_ptr, length);
 85.1287 +      return;
 85.1288 +   }
 85.1289 +   else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_tRNS))
 85.1290 +   {
 85.1291 +      png_warning(png_ptr, "Duplicate tRNS chunk");
 85.1292 +      png_crc_finish(png_ptr, length);
 85.1293 +      return;
 85.1294 +   }
 85.1295 +
 85.1296 +   if (png_ptr->color_type == PNG_COLOR_TYPE_GRAY)
 85.1297 +   {
 85.1298 +      png_byte buf[2];
 85.1299 +
 85.1300 +      if (length != 2)
 85.1301 +      {
 85.1302 +         png_warning(png_ptr, "Incorrect tRNS chunk length");
 85.1303 +         png_crc_finish(png_ptr, length);
 85.1304 +         return;
 85.1305 +      }
 85.1306 +
 85.1307 +      png_crc_read(png_ptr, buf, 2);
 85.1308 +      png_ptr->num_trans = 1;
 85.1309 +      png_ptr->trans_values.gray = png_get_uint_16(buf);
 85.1310 +   }
 85.1311 +   else if (png_ptr->color_type == PNG_COLOR_TYPE_RGB)
 85.1312 +   {
 85.1313 +      png_byte buf[6];
 85.1314 +
 85.1315 +      if (length != 6)
 85.1316 +      {
 85.1317 +         png_warning(png_ptr, "Incorrect tRNS chunk length");
 85.1318 +         png_crc_finish(png_ptr, length);
 85.1319 +         return;
 85.1320 +      }
 85.1321 +      png_crc_read(png_ptr, buf, (png_size_t)length);
 85.1322 +      png_ptr->num_trans = 1;
 85.1323 +      png_ptr->trans_values.red = png_get_uint_16(buf);
 85.1324 +      png_ptr->trans_values.green = png_get_uint_16(buf + 2);
 85.1325 +      png_ptr->trans_values.blue = png_get_uint_16(buf + 4);
 85.1326 +   }
 85.1327 +   else if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
 85.1328 +   {
 85.1329 +      if (!(png_ptr->mode & PNG_HAVE_PLTE))
 85.1330 +      {
 85.1331 +         /* Should be an error, but we can cope with it. */
 85.1332 +         png_warning(png_ptr, "Missing PLTE before tRNS");
 85.1333 +      }
 85.1334 +      if (length > (png_uint_32)png_ptr->num_palette ||
 85.1335 +          length > PNG_MAX_PALETTE_LENGTH)
 85.1336 +      {
 85.1337 +         png_warning(png_ptr, "Incorrect tRNS chunk length");
 85.1338 +         png_crc_finish(png_ptr, length);
 85.1339 +         return;
 85.1340 +      }
 85.1341 +      if (length == 0)
 85.1342 +      {
 85.1343 +         png_warning(png_ptr, "Zero length tRNS chunk");
 85.1344 +         png_crc_finish(png_ptr, length);
 85.1345 +         return;
 85.1346 +      }
 85.1347 +      png_crc_read(png_ptr, readbuf, (png_size_t)length);
 85.1348 +      png_ptr->num_trans = (png_uint_16)length;
 85.1349 +   }
 85.1350 +   else
 85.1351 +   {
 85.1352 +      png_warning(png_ptr, "tRNS chunk not allowed with alpha channel");
 85.1353 +      png_crc_finish(png_ptr, length);
 85.1354 +      return;
 85.1355 +   }
 85.1356 +
 85.1357 +   if (png_crc_finish(png_ptr, 0))
 85.1358 +   {
 85.1359 +      png_ptr->num_trans = 0;
 85.1360 +      return;
 85.1361 +   }
 85.1362 +
 85.1363 +   png_set_tRNS(png_ptr, info_ptr, readbuf, png_ptr->num_trans,
 85.1364 +      &(png_ptr->trans_values));
 85.1365 +}
 85.1366 +#endif
 85.1367 +
 85.1368 +#if defined(PNG_READ_bKGD_SUPPORTED)
 85.1369 +void /* PRIVATE */
 85.1370 +png_handle_bKGD(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
 85.1371 +{
 85.1372 +   png_size_t truelen;
 85.1373 +   png_byte buf[6];
 85.1374 +
 85.1375 +   png_debug(1, "in png_handle_bKGD\n");
 85.1376 +
 85.1377 +   if (!(png_ptr->mode & PNG_HAVE_IHDR))
 85.1378 +      png_error(png_ptr, "Missing IHDR before bKGD");
 85.1379 +   else if (png_ptr->mode & PNG_HAVE_IDAT)
 85.1380 +   {
 85.1381 +      png_warning(png_ptr, "Invalid bKGD after IDAT");
 85.1382 +      png_crc_finish(png_ptr, length);
 85.1383 +      return;
 85.1384 +   }
 85.1385 +   else if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE &&
 85.1386 +            !(png_ptr->mode & PNG_HAVE_PLTE))
 85.1387 +   {
 85.1388 +      png_warning(png_ptr, "Missing PLTE before bKGD");
 85.1389 +      png_crc_finish(png_ptr, length);
 85.1390 +      return;
 85.1391 +   }
 85.1392 +   else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_bKGD))
 85.1393 +   {
 85.1394 +      png_warning(png_ptr, "Duplicate bKGD chunk");
 85.1395 +      png_crc_finish(png_ptr, length);
 85.1396 +      return;
 85.1397 +   }
 85.1398 +
 85.1399 +   if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
 85.1400 +      truelen = 1;
 85.1401 +   else if (png_ptr->color_type & PNG_COLOR_MASK_COLOR)
 85.1402 +      truelen = 6;
 85.1403 +   else
 85.1404 +      truelen = 2;
 85.1405 +
 85.1406 +   if (length != truelen)
 85.1407 +   {
 85.1408 +      png_warning(png_ptr, "Incorrect bKGD chunk length");
 85.1409 +      png_crc_finish(png_ptr, length);
 85.1410 +      return;
 85.1411 +   }
 85.1412 +
 85.1413 +   png_crc_read(png_ptr, buf, truelen);
 85.1414 +   if (png_crc_finish(png_ptr, 0))
 85.1415 +      return;
 85.1416 +
 85.1417 +   /* We convert the index value into RGB components so that we can allow
 85.1418 +    * arbitrary RGB values for background when we have transparency, and
 85.1419 +    * so it is easy to determine the RGB values of the background color
 85.1420 +    * from the info_ptr struct. */
 85.1421 +   if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
 85.1422 +   {
 85.1423 +      png_ptr->background.index = buf[0];
 85.1424 +      if (info_ptr && info_ptr->num_palette)
 85.1425 +      {
 85.1426 +          if (buf[0] > info_ptr->num_palette)
 85.1427 +          {
 85.1428 +             png_warning(png_ptr, "Incorrect bKGD chunk index value");
 85.1429 +             return;
 85.1430 +          }
 85.1431 +          png_ptr->background.red =
 85.1432 +             (png_uint_16)png_ptr->palette[buf[0]].red;
 85.1433 +          png_ptr->background.green =
 85.1434 +             (png_uint_16)png_ptr->palette[buf[0]].green;
 85.1435 +          png_ptr->background.blue =
 85.1436 +             (png_uint_16)png_ptr->palette[buf[0]].blue;
 85.1437 +      }
 85.1438 +   }
 85.1439 +   else if (!(png_ptr->color_type & PNG_COLOR_MASK_COLOR)) /* GRAY */
 85.1440 +   {
 85.1441 +      png_ptr->background.red =
 85.1442 +      png_ptr->background.green =
 85.1443 +      png_ptr->background.blue =
 85.1444 +      png_ptr->background.gray = png_get_uint_16(buf);
 85.1445 +   }
 85.1446 +   else
 85.1447 +   {
 85.1448 +      png_ptr->background.red = png_get_uint_16(buf);
 85.1449 +      png_ptr->background.green = png_get_uint_16(buf + 2);
 85.1450 +      png_ptr->background.blue = png_get_uint_16(buf + 4);
 85.1451 +   }
 85.1452 +
 85.1453 +   png_set_bKGD(png_ptr, info_ptr, &(png_ptr->background));
 85.1454 +}
 85.1455 +#endif
 85.1456 +
 85.1457 +#if defined(PNG_READ_hIST_SUPPORTED)
 85.1458 +void /* PRIVATE */
 85.1459 +png_handle_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
 85.1460 +{
 85.1461 +   unsigned int num, i;
 85.1462 +   png_uint_16 readbuf[PNG_MAX_PALETTE_LENGTH];
 85.1463 +
 85.1464 +   png_debug(1, "in png_handle_hIST\n");
 85.1465 +
 85.1466 +   if (!(png_ptr->mode & PNG_HAVE_IHDR))
 85.1467 +      png_error(png_ptr, "Missing IHDR before hIST");
 85.1468 +   else if (png_ptr->mode & PNG_HAVE_IDAT)
 85.1469 +   {
 85.1470 +      png_warning(png_ptr, "Invalid hIST after IDAT");
 85.1471 +      png_crc_finish(png_ptr, length);
 85.1472 +      return;
 85.1473 +   }
 85.1474 +   else if (!(png_ptr->mode & PNG_HAVE_PLTE))
 85.1475 +   {
 85.1476 +      png_warning(png_ptr, "Missing PLTE before hIST");
 85.1477 +      png_crc_finish(png_ptr, length);
 85.1478 +      return;
 85.1479 +   }
 85.1480 +   else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_hIST))
 85.1481 +   {
 85.1482 +      png_warning(png_ptr, "Duplicate hIST chunk");
 85.1483 +      png_crc_finish(png_ptr, length);
 85.1484 +      return;
 85.1485 +   }
 85.1486 +
 85.1487 +   num = length / 2 ;
 85.1488 +   if (num != (unsigned int) png_ptr->num_palette || num >
 85.1489 +      (unsigned int) PNG_MAX_PALETTE_LENGTH)
 85.1490 +   {
 85.1491 +      png_warning(png_ptr, "Incorrect hIST chunk length");
 85.1492 +      png_crc_finish(png_ptr, length);
 85.1493 +      return;
 85.1494 +   }
 85.1495 +
 85.1496 +   for (i = 0; i < num; i++)
 85.1497 +   {
 85.1498 +      png_byte buf[2];
 85.1499 +
 85.1500 +      png_crc_read(png_ptr, buf, 2);
 85.1501 +      readbuf[i] = png_get_uint_16(buf);
 85.1502 +   }
 85.1503 +
 85.1504 +   if (png_crc_finish(png_ptr, 0))
 85.1505 +      return;
 85.1506 +
 85.1507 +   png_set_hIST(png_ptr, info_ptr, readbuf);
 85.1508 +}
 85.1509 +#endif
 85.1510 +
 85.1511 +#if defined(PNG_READ_pHYs_SUPPORTED)
 85.1512 +void /* PRIVATE */
 85.1513 +png_handle_pHYs(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
 85.1514 +{
 85.1515 +   png_byte buf[9];
 85.1516 +   png_uint_32 res_x, res_y;
 85.1517 +   int unit_type;
 85.1518 +
 85.1519 +   png_debug(1, "in png_handle_pHYs\n");
 85.1520 +
 85.1521 +   if (!(png_ptr->mode & PNG_HAVE_IHDR))
 85.1522 +      png_error(png_ptr, "Missing IHDR before pHYs");
 85.1523 +   else if (png_ptr->mode & PNG_HAVE_IDAT)
 85.1524 +   {
 85.1525 +      png_warning(png_ptr, "Invalid pHYs after IDAT");
 85.1526 +      png_crc_finish(png_ptr, length);
 85.1527 +      return;
 85.1528 +   }
 85.1529 +   else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_pHYs))
 85.1530 +   {
 85.1531 +      png_warning(png_ptr, "Duplicate pHYs chunk");
 85.1532 +      png_crc_finish(png_ptr, length);
 85.1533 +      return;
 85.1534 +   }
 85.1535 +
 85.1536 +   if (length != 9)
 85.1537 +   {
 85.1538 +      png_warning(png_ptr, "Incorrect pHYs chunk length");
 85.1539 +      png_crc_finish(png_ptr, length);
 85.1540 +      return;
 85.1541 +   }
 85.1542 +
 85.1543 +   png_crc_read(png_ptr, buf, 9);
 85.1544 +   if (png_crc_finish(png_ptr, 0))
 85.1545 +      return;
 85.1546 +
 85.1547 +   res_x = png_get_uint_32(buf);
 85.1548 +   res_y = png_get_uint_32(buf + 4);
 85.1549 +   unit_type = buf[8];
 85.1550 +   png_set_pHYs(png_ptr, info_ptr, res_x, res_y, unit_type);
 85.1551 +}
 85.1552 +#endif
 85.1553 +
 85.1554 +#if defined(PNG_READ_oFFs_SUPPORTED)
 85.1555 +void /* PRIVATE */
 85.1556 +png_handle_oFFs(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
 85.1557 +{
 85.1558 +   png_byte buf[9];
 85.1559 +   png_int_32 offset_x, offset_y;
 85.1560 +   int unit_type;
 85.1561 +
 85.1562 +   png_debug(1, "in png_handle_oFFs\n");
 85.1563 +
 85.1564 +   if (!(png_ptr->mode & PNG_HAVE_IHDR))
 85.1565 +      png_error(png_ptr, "Missing IHDR before oFFs");
 85.1566 +   else if (png_ptr->mode & PNG_HAVE_IDAT)
 85.1567 +   {
 85.1568 +      png_warning(png_ptr, "Invalid oFFs after IDAT");
 85.1569 +      png_crc_finish(png_ptr, length);
 85.1570 +      return;
 85.1571 +   }
 85.1572 +   else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_oFFs))
 85.1573 +   {
 85.1574 +      png_warning(png_ptr, "Duplicate oFFs chunk");
 85.1575 +      png_crc_finish(png_ptr, length);
 85.1576 +      return;
 85.1577 +   }
 85.1578 +
 85.1579 +   if (length != 9)
 85.1580 +   {
 85.1581 +      png_warning(png_ptr, "Incorrect oFFs chunk length");
 85.1582 +      png_crc_finish(png_ptr, length);
 85.1583 +      return;
 85.1584 +   }
 85.1585 +
 85.1586 +   png_crc_read(png_ptr, buf, 9);
 85.1587 +   if (png_crc_finish(png_ptr, 0))
 85.1588 +      return;
 85.1589 +
 85.1590 +   offset_x = png_get_int_32(buf);
 85.1591 +   offset_y = png_get_int_32(buf + 4);
 85.1592 +   unit_type = buf[8];
 85.1593 +   png_set_oFFs(png_ptr, info_ptr, offset_x, offset_y, unit_type);
 85.1594 +}
 85.1595 +#endif
 85.1596 +
 85.1597 +#if defined(PNG_READ_pCAL_SUPPORTED)
 85.1598 +/* read the pCAL chunk (described in the PNG Extensions document) */
 85.1599 +void /* PRIVATE */
 85.1600 +png_handle_pCAL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
 85.1601 +{
 85.1602 +   png_int_32 X0, X1;
 85.1603 +   png_byte type, nparams;
 85.1604 +   png_charp buf, units, endptr;
 85.1605 +   png_charpp params;
 85.1606 +   png_size_t slength;
 85.1607 +   int i;
 85.1608 +
 85.1609 +   png_debug(1, "in png_handle_pCAL\n");
 85.1610 +
 85.1611 +   if (!(png_ptr->mode & PNG_HAVE_IHDR))
 85.1612 +      png_error(png_ptr, "Missing IHDR before pCAL");
 85.1613 +   else if (png_ptr->mode & PNG_HAVE_IDAT)
 85.1614 +   {
 85.1615 +      png_warning(png_ptr, "Invalid pCAL after IDAT");
 85.1616 +      png_crc_finish(png_ptr, length);
 85.1617 +      return;
 85.1618 +   }
 85.1619 +   else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_pCAL))
 85.1620 +   {
 85.1621 +      png_warning(png_ptr, "Duplicate pCAL chunk");
 85.1622 +      png_crc_finish(png_ptr, length);
 85.1623 +      return;
 85.1624 +   }
 85.1625 +
 85.1626 +   png_debug1(2, "Allocating and reading pCAL chunk data (%lu bytes)\n",
 85.1627 +      length + 1);
 85.1628 +   png_free(png_ptr, png_ptr->chunkdata);
 85.1629 +   png_ptr->chunkdata = (png_charp)png_malloc_warn(png_ptr, length + 1);
 85.1630 +   if (png_ptr->chunkdata == NULL)
 85.1631 +     {
 85.1632 +       png_warning(png_ptr, "No memory for pCAL purpose.");
 85.1633 +       return;
 85.1634 +     }
 85.1635 +   slength = (png_size_t)length;
 85.1636 +   png_crc_read(png_ptr, (png_bytep)png_ptr->chunkdata, slength);
 85.1637 +
 85.1638 +   if (png_crc_finish(png_ptr, 0))
 85.1639 +   {
 85.1640 +      png_free(png_ptr, png_ptr->chunkdata);
 85.1641 +      png_ptr->chunkdata = NULL;
 85.1642 +      return;
 85.1643 +   }
 85.1644 +
 85.1645 +   png_ptr->chunkdata[slength] = 0x00; /* null terminate the last string */
 85.1646 +
 85.1647 +   png_debug(3, "Finding end of pCAL purpose string\n");
 85.1648 +   for (buf = png_ptr->chunkdata; *buf; buf++)
 85.1649 +      /* empty loop */ ;
 85.1650 +
 85.1651 +   endptr = png_ptr->chunkdata + slength;
 85.1652 +
 85.1653 +   /* We need to have at least 12 bytes after the purpose string
 85.1654 +      in order to get the parameter information. */
 85.1655 +   if (endptr <= buf + 12)
 85.1656 +   {
 85.1657 +      png_warning(png_ptr, "Invalid pCAL data");
 85.1658 +      png_free(png_ptr, png_ptr->chunkdata);
 85.1659 +      png_ptr->chunkdata = NULL;
 85.1660 +      return;
 85.1661 +   }
 85.1662 +
 85.1663 +   png_debug(3, "Reading pCAL X0, X1, type, nparams, and units\n");
 85.1664 +   X0 = png_get_int_32((png_bytep)buf+1);
 85.1665 +   X1 = png_get_int_32((png_bytep)buf+5);
 85.1666 +   type = buf[9];
 85.1667 +   nparams = buf[10];
 85.1668 +   units = buf + 11;
 85.1669 +
 85.1670 +   png_debug(3, "Checking pCAL equation type and number of parameters\n");
 85.1671 +   /* Check that we have the right number of parameters for known
 85.1672 +      equation types. */
 85.1673 +   if ((type == PNG_EQUATION_LINEAR && nparams != 2) ||
 85.1674 +       (type == PNG_EQUATION_BASE_E && nparams != 3) ||
 85.1675 +       (type == PNG_EQUATION_ARBITRARY && nparams != 3) ||
 85.1676 +       (type == PNG_EQUATION_HYPERBOLIC && nparams != 4))
 85.1677 +   {
 85.1678 +      png_warning(png_ptr, "Invalid pCAL parameters for equation type");
 85.1679 +      png_free(png_ptr, png_ptr->chunkdata);
 85.1680 +      png_ptr->chunkdata = NULL;
 85.1681 +      return;
 85.1682 +   }
 85.1683 +   else if (type >= PNG_EQUATION_LAST)
 85.1684 +   {
 85.1685 +      png_warning(png_ptr, "Unrecognized equation type for pCAL chunk");
 85.1686 +   }
 85.1687 +
 85.1688 +   for (buf = units; *buf; buf++)
 85.1689 +      /* Empty loop to move past the units string. */ ;
 85.1690 +
 85.1691 +   png_debug(3, "Allocating pCAL parameters array\n");
 85.1692 +   params = (png_charpp)png_malloc_warn(png_ptr,
 85.1693 +      (png_uint_32)(nparams * png_sizeof(png_charp))) ;
 85.1694 +   if (params == NULL)
 85.1695 +     {
 85.1696 +       png_free(png_ptr, png_ptr->chunkdata);
 85.1697 +       png_ptr->chunkdata = NULL;
 85.1698 +       png_warning(png_ptr, "No memory for pCAL params.");
 85.1699 +       return;
 85.1700 +     }
 85.1701 +
 85.1702 +   /* Get pointers to the start of each parameter string. */
 85.1703 +   for (i = 0; i < (int)nparams; i++)
 85.1704 +   {
 85.1705 +      buf++; /* Skip the null string terminator from previous parameter. */
 85.1706 +
 85.1707 +      png_debug1(3, "Reading pCAL parameter %d\n", i);
 85.1708 +      for (params[i] = buf; buf <= endptr && *buf != 0x00; buf++)
 85.1709 +         /* Empty loop to move past each parameter string */ ;
 85.1710 +
 85.1711 +      /* Make sure we haven't run out of data yet */
 85.1712 +      if (buf > endptr)
 85.1713 +      {
 85.1714 +         png_warning(png_ptr, "Invalid pCAL data");
 85.1715 +         png_free(png_ptr, png_ptr->chunkdata);
 85.1716 +         png_ptr->chunkdata = NULL;
 85.1717 +         png_free(png_ptr, params);
 85.1718 +         return;
 85.1719 +      }
 85.1720 +   }
 85.1721 +
 85.1722 +   png_set_pCAL(png_ptr, info_ptr, png_ptr->chunkdata, X0, X1, type, nparams,
 85.1723 +      units, params);
 85.1724 +
 85.1725 +   png_free(png_ptr, png_ptr->chunkdata);
 85.1726 +   png_ptr->chunkdata = NULL;
 85.1727 +   png_free(png_ptr, params);
 85.1728 +}
 85.1729 +#endif
 85.1730 +
 85.1731 +#if defined(PNG_READ_sCAL_SUPPORTED)
 85.1732 +/* read the sCAL chunk */
 85.1733 +void /* PRIVATE */
 85.1734 +png_handle_sCAL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
 85.1735 +{
 85.1736 +   png_charp ep;
 85.1737 +#ifdef PNG_FLOATING_POINT_SUPPORTED
 85.1738 +   double width, height;
 85.1739 +   png_charp vp;
 85.1740 +#else
 85.1741 +#ifdef PNG_FIXED_POINT_SUPPORTED
 85.1742 +   png_charp swidth, sheight;
 85.1743 +#endif
 85.1744 +#endif
 85.1745 +   png_size_t slength;
 85.1746 +
 85.1747 +   png_debug(1, "in png_handle_sCAL\n");
 85.1748 +
 85.1749 +   if (!(png_ptr->mode & PNG_HAVE_IHDR))
 85.1750 +      png_error(png_ptr, "Missing IHDR before sCAL");
 85.1751 +   else if (png_ptr->mode & PNG_HAVE_IDAT)
 85.1752 +   {
 85.1753 +      png_warning(png_ptr, "Invalid sCAL after IDAT");
 85.1754 +      png_crc_finish(png_ptr, length);
 85.1755 +      return;
 85.1756 +   }
 85.1757 +   else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_sCAL))
 85.1758 +   {
 85.1759 +      png_warning(png_ptr, "Duplicate sCAL chunk");
 85.1760 +      png_crc_finish(png_ptr, length);
 85.1761 +      return;
 85.1762 +   }
 85.1763 +
 85.1764 +   png_debug1(2, "Allocating and reading sCAL chunk data (%lu bytes)\n",
 85.1765 +      length + 1);
 85.1766 +   png_ptr->chunkdata = (png_charp)png_malloc_warn(png_ptr, length + 1);
 85.1767 +   if (png_ptr->chunkdata == NULL)
 85.1768 +   {
 85.1769 +      png_warning(png_ptr, "Out of memory while processing sCAL chunk");
 85.1770 +      return;
 85.1771 +   }
 85.1772 +   slength = (png_size_t)length;
 85.1773 +   png_crc_read(png_ptr, (png_bytep)png_ptr->chunkdata, slength);
 85.1774 +
 85.1775 +   if (png_crc_finish(png_ptr, 0))
 85.1776 +   {
 85.1777 +      png_free(png_ptr, png_ptr->chunkdata);
 85.1778 +      png_ptr->chunkdata = NULL;
 85.1779 +      return;
 85.1780 +   }
 85.1781 +
 85.1782 +   png_ptr->chunkdata[slength] = 0x00; /* null terminate the last string */
 85.1783 +
 85.1784 +   ep = png_ptr->chunkdata + 1;        /* skip unit byte */
 85.1785 +
 85.1786 +#ifdef PNG_FLOATING_POINT_SUPPORTED
 85.1787 +   width = png_strtod(png_ptr, ep, &vp);
 85.1788 +   if (*vp)
 85.1789 +   {
 85.1790 +      png_warning(png_ptr, "malformed width string in sCAL chunk");
 85.1791 +      return;
 85.1792 +   }
 85.1793 +#else
 85.1794 +#ifdef PNG_FIXED_POINT_SUPPORTED
 85.1795 +   swidth = (png_charp)png_malloc_warn(png_ptr, png_strlen(ep) + 1);
 85.1796 +   if (swidth == NULL)
 85.1797 +   {
 85.1798 +      png_warning(png_ptr, "Out of memory while processing sCAL chunk width");
 85.1799 +      return;
 85.1800 +   }
 85.1801 +   png_memcpy(swidth, ep, (png_size_t)png_strlen(ep));
 85.1802 +#endif
 85.1803 +#endif
 85.1804 +
 85.1805 +   for (ep = png_ptr->chunkdata; *ep; ep++)
 85.1806 +      /* empty loop */ ;
 85.1807 +   ep++;
 85.1808 +
 85.1809 +   if (png_ptr->chunkdata + slength < ep)
 85.1810 +   {
 85.1811 +      png_warning(png_ptr, "Truncated sCAL chunk");
 85.1812 +#if defined(PNG_FIXED_POINT_SUPPORTED) && \
 85.1813 +    !defined(PNG_FLOATING_POINT_SUPPORTED)
 85.1814 +      png_free(png_ptr, swidth);
 85.1815 +#endif
 85.1816 +      png_free(png_ptr, png_ptr->chunkdata);
 85.1817 +      png_ptr->chunkdata = NULL;
 85.1818 +      return;
 85.1819 +   }
 85.1820 +
 85.1821 +#ifdef PNG_FLOATING_POINT_SUPPORTED
 85.1822 +   height = png_strtod(png_ptr, ep, &vp);
 85.1823 +   if (*vp)
 85.1824 +   {
 85.1825 +      png_warning(png_ptr, "malformed height string in sCAL chunk");
 85.1826 +      return;
 85.1827 +   }
 85.1828 +#else
 85.1829 +#ifdef PNG_FIXED_POINT_SUPPORTED
 85.1830 +   sheight = (png_charp)png_malloc_warn(png_ptr, png_strlen(ep) + 1);
 85.1831 +   if (sheight == NULL)
 85.1832 +   {
 85.1833 +      png_warning(png_ptr, "Out of memory while processing sCAL chunk height");
 85.1834 +      return;
 85.1835 +   }
 85.1836 +   png_memcpy(sheight, ep, (png_size_t)png_strlen(ep));
 85.1837 +#endif
 85.1838 +#endif
 85.1839 +
 85.1840 +   if (png_ptr->chunkdata + slength < ep
 85.1841 +#ifdef PNG_FLOATING_POINT_SUPPORTED
 85.1842 +      || width <= 0. || height <= 0.
 85.1843 +#endif
 85.1844 +      )
 85.1845 +   {
 85.1846 +      png_warning(png_ptr, "Invalid sCAL data");
 85.1847 +      png_free(png_ptr, png_ptr->chunkdata);
 85.1848 +      png_ptr->chunkdata = NULL;
 85.1849 +#if defined(PNG_FIXED_POINT_SUPPORTED) && !defined(PNG_FLOATING_POINT_SUPPORTED)
 85.1850 +      png_free(png_ptr, swidth);
 85.1851 +      png_free(png_ptr, sheight);
 85.1852 +#endif
 85.1853 +      return;
 85.1854 +   }
 85.1855 +
 85.1856 +
 85.1857 +#ifdef PNG_FLOATING_POINT_SUPPORTED
 85.1858 +   png_set_sCAL(png_ptr, info_ptr, png_ptr->chunkdata[0], width, height);
 85.1859 +#else
 85.1860 +#ifdef PNG_FIXED_POINT_SUPPORTED
 85.1861 +   png_set_sCAL_s(png_ptr, info_ptr, png_ptr->chunkdata[0], swidth, sheight);
 85.1862 +#endif
 85.1863 +#endif
 85.1864 +
 85.1865 +   png_free(png_ptr, png_ptr->chunkdata);
 85.1866 +   png_ptr->chunkdata = NULL;
 85.1867 +#if defined(PNG_FIXED_POINT_SUPPORTED) && !defined(PNG_FLOATING_POINT_SUPPORTED)
 85.1868 +   png_free(png_ptr, swidth);
 85.1869 +   png_free(png_ptr, sheight);
 85.1870 +#endif
 85.1871 +}
 85.1872 +#endif
 85.1873 +
 85.1874 +#if defined(PNG_READ_tIME_SUPPORTED)
 85.1875 +void /* PRIVATE */
 85.1876 +png_handle_tIME(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
 85.1877 +{
 85.1878 +   png_byte buf[7];
 85.1879 +   png_time mod_time;
 85.1880 +
 85.1881 +   png_debug(1, "in png_handle_tIME\n");
 85.1882 +
 85.1883 +   if (!(png_ptr->mode & PNG_HAVE_IHDR))
 85.1884 +      png_error(png_ptr, "Out of place tIME chunk");
 85.1885 +   else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_tIME))
 85.1886 +   {
 85.1887 +      png_warning(png_ptr, "Duplicate tIME chunk");
 85.1888 +      png_crc_finish(png_ptr, length);
 85.1889 +      return;
 85.1890 +   }
 85.1891 +
 85.1892 +   if (png_ptr->mode & PNG_HAVE_IDAT)
 85.1893 +      png_ptr->mode |= PNG_AFTER_IDAT;
 85.1894 +
 85.1895 +   if (length != 7)
 85.1896 +   {
 85.1897 +      png_warning(png_ptr, "Incorrect tIME chunk length");
 85.1898 +      png_crc_finish(png_ptr, length);
 85.1899 +      return;
 85.1900 +   }
 85.1901 +
 85.1902 +   png_crc_read(png_ptr, buf, 7);
 85.1903 +   if (png_crc_finish(png_ptr, 0))
 85.1904 +      return;
 85.1905 +
 85.1906 +   mod_time.second = buf[6];
 85.1907 +   mod_time.minute = buf[5];
 85.1908 +   mod_time.hour = buf[4];
 85.1909 +   mod_time.day = buf[3];
 85.1910 +   mod_time.month = buf[2];
 85.1911 +   mod_time.year = png_get_uint_16(buf);
 85.1912 +
 85.1913 +   png_set_tIME(png_ptr, info_ptr, &mod_time);
 85.1914 +}
 85.1915 +#endif
 85.1916 +
 85.1917 +#if defined(PNG_READ_tEXt_SUPPORTED)
 85.1918 +/* Note: this does not properly handle chunks that are > 64K under DOS */
 85.1919 +void /* PRIVATE */
 85.1920 +png_handle_tEXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
 85.1921 +{
 85.1922 +   png_textp text_ptr;
 85.1923 +   png_charp key;
 85.1924 +   png_charp text;
 85.1925 +   png_uint_32 skip = 0;
 85.1926 +   png_size_t slength;
 85.1927 +   int ret;
 85.1928 +
 85.1929 +   png_debug(1, "in png_handle_tEXt\n");
 85.1930 +
 85.1931 +   if (!(png_ptr->mode & PNG_HAVE_IHDR))
 85.1932 +      png_error(png_ptr, "Missing IHDR before tEXt");
 85.1933 +
 85.1934 +   if (png_ptr->mode & PNG_HAVE_IDAT)
 85.1935 +      png_ptr->mode |= PNG_AFTER_IDAT;
 85.1936 +
 85.1937 +#ifdef PNG_MAX_MALLOC_64K
 85.1938 +   if (length > (png_uint_32)65535L)
 85.1939 +   {
 85.1940 +      png_warning(png_ptr, "tEXt chunk too large to fit in memory");
 85.1941 +      skip = length - (png_uint_32)65535L;
 85.1942 +      length = (png_uint_32)65535L;
 85.1943 +   }
 85.1944 +#endif
 85.1945 +
 85.1946 +   png_free(png_ptr, png_ptr->chunkdata);
 85.1947 +   png_ptr->chunkdata = (png_charp)png_malloc_warn(png_ptr, length + 1);
 85.1948 +   if (png_ptr->chunkdata == NULL)
 85.1949 +   {
 85.1950 +     png_warning(png_ptr, "No memory to process text chunk.");
 85.1951 +     return;
 85.1952 +   }
 85.1953 +   slength = (png_size_t)length;
 85.1954 +   png_crc_read(png_ptr, (png_bytep)png_ptr->chunkdata, slength);
 85.1955 +
 85.1956 +   if (png_crc_finish(png_ptr, skip))
 85.1957 +   {
 85.1958 +      png_free(png_ptr, png_ptr->chunkdata);
 85.1959 +      png_ptr->chunkdata = NULL;
 85.1960 +      return;
 85.1961 +   }
 85.1962 +
 85.1963 +   key = png_ptr->chunkdata;
 85.1964 +   key[slength] = 0x00;
 85.1965 +
 85.1966 +   for (text = key; *text; text++)
 85.1967 +      /* empty loop to find end of key */ ;
 85.1968 +
 85.1969 +   if (text != key + slength)
 85.1970 +      text++;
 85.1971 +
 85.1972 +   text_ptr = (png_textp)png_malloc_warn(png_ptr,
 85.1973 +      (png_uint_32)png_sizeof(png_text));
 85.1974 +   if (text_ptr == NULL)
 85.1975 +   {
 85.1976 +     png_warning(png_ptr, "Not enough memory to process text chunk.");
 85.1977 +     png_free(png_ptr, png_ptr->chunkdata);
 85.1978 +     png_ptr->chunkdata = NULL;
 85.1979 +     return;
 85.1980 +   }
 85.1981 +   text_ptr->compression = PNG_TEXT_COMPRESSION_NONE;
 85.1982 +   text_ptr->key = key;
 85.1983 +#ifdef PNG_iTXt_SUPPORTED
 85.1984 +   text_ptr->lang = NULL;
 85.1985 +   text_ptr->lang_key = NULL;
 85.1986 +   text_ptr->itxt_length = 0;
 85.1987 +#endif
 85.1988 +   text_ptr->text = text;
 85.1989 +   text_ptr->text_length = png_strlen(text);
 85.1990 +
 85.1991 +   ret = png_set_text_2(png_ptr, info_ptr, text_ptr, 1);
 85.1992 +
 85.1993 +   png_free(png_ptr, png_ptr->chunkdata);
 85.1994 +   png_ptr->chunkdata = NULL;
 85.1995 +   png_free(png_ptr, text_ptr);
 85.1996 +   if (ret)
 85.1997 +     png_warning(png_ptr, "Insufficient memory to process text chunk.");
 85.1998 +}
 85.1999 +#endif
 85.2000 +
 85.2001 +#if defined(PNG_READ_zTXt_SUPPORTED)
 85.2002 +/* note: this does not correctly handle chunks that are > 64K under DOS */
 85.2003 +void /* PRIVATE */
 85.2004 +png_handle_zTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
 85.2005 +{
 85.2006 +   png_textp text_ptr;
 85.2007 +   png_charp text;
 85.2008 +   int comp_type;
 85.2009 +   int ret;
 85.2010 +   png_size_t slength, prefix_len, data_len;
 85.2011 +
 85.2012 +   png_debug(1, "in png_handle_zTXt\n");
 85.2013 +   if (!(png_ptr->mode & PNG_HAVE_IHDR))
 85.2014 +      png_error(png_ptr, "Missing IHDR before zTXt");
 85.2015 +
 85.2016 +   if (png_ptr->mode & PNG_HAVE_IDAT)
 85.2017 +      png_ptr->mode |= PNG_AFTER_IDAT;
 85.2018 +
 85.2019 +#ifdef PNG_MAX_MALLOC_64K
 85.2020 +   /* We will no doubt have problems with chunks even half this size, but
 85.2021 +      there is no hard and fast rule to tell us where to stop. */
 85.2022 +   if (length > (png_uint_32)65535L)
 85.2023 +   {
 85.2024 +     png_warning(png_ptr, "zTXt chunk too large to fit in memory");
 85.2025 +     png_crc_finish(png_ptr, length);
 85.2026 +     return;
 85.2027 +   }
 85.2028 +#endif
 85.2029 +
 85.2030 +   png_free(png_ptr, png_ptr->chunkdata);
 85.2031 +   png_ptr->chunkdata = (png_charp)png_malloc_warn(png_ptr, length + 1);
 85.2032 +   if (png_ptr->chunkdata == NULL)
 85.2033 +   {
 85.2034 +     png_warning(png_ptr, "Out of memory processing zTXt chunk.");
 85.2035 +     return;
 85.2036 +   }
 85.2037 +   slength = (png_size_t)length;
 85.2038 +   png_crc_read(png_ptr, (png_bytep)png_ptr->chunkdata, slength);
 85.2039 +   if (png_crc_finish(png_ptr, 0))
 85.2040 +   {
 85.2041 +      png_free(png_ptr, png_ptr->chunkdata);
 85.2042 +      png_ptr->chunkdata = NULL;
 85.2043 +      return;
 85.2044 +   }
 85.2045 +
 85.2046 +   png_ptr->chunkdata[slength] = 0x00;
 85.2047 +
 85.2048 +   for (text = png_ptr->chunkdata; *text; text++)
 85.2049 +      /* empty loop */ ;
 85.2050 +
 85.2051 +   /* zTXt must have some text after the chunkdataword */
 85.2052 +   if (text >= png_ptr->chunkdata + slength - 2)
 85.2053 +   {
 85.2054 +      png_warning(png_ptr, "Truncated zTXt chunk");
 85.2055 +      png_free(png_ptr, png_ptr->chunkdata);
 85.2056 +      png_ptr->chunkdata = NULL;
 85.2057 +      return;
 85.2058 +   }
 85.2059 +   else
 85.2060 +   {
 85.2061 +       comp_type = *(++text);
 85.2062 +       if (comp_type != PNG_TEXT_COMPRESSION_zTXt)
 85.2063 +       {
 85.2064 +          png_warning(png_ptr, "Unknown compression type in zTXt chunk");
 85.2065 +          comp_type = PNG_TEXT_COMPRESSION_zTXt;
 85.2066 +       }
 85.2067 +       text++;        /* skip the compression_method byte */
 85.2068 +   }
 85.2069 +   prefix_len = text - png_ptr->chunkdata;
 85.2070 +
 85.2071 +   png_decompress_chunk(png_ptr, comp_type,
 85.2072 +     (png_size_t)length, prefix_len, &data_len);
 85.2073 +
 85.2074 +   text_ptr = (png_textp)png_malloc_warn(png_ptr,
 85.2075 +      (png_uint_32)png_sizeof(png_text));
 85.2076 +   if (text_ptr == NULL)
 85.2077 +   {
 85.2078 +     png_warning(png_ptr, "Not enough memory to process zTXt chunk.");
 85.2079 +     png_free(png_ptr, png_ptr->chunkdata);
 85.2080 +     png_ptr->chunkdata = NULL;
 85.2081 +     return;
 85.2082 +   }
 85.2083 +   text_ptr->compression = comp_type;
 85.2084 +   text_ptr->key = png_ptr->chunkdata;
 85.2085 +#ifdef PNG_iTXt_SUPPORTED
 85.2086 +   text_ptr->lang = NULL;
 85.2087 +   text_ptr->lang_key = NULL;
 85.2088 +   text_ptr->itxt_length = 0;
 85.2089 +#endif
 85.2090 +   text_ptr->text = png_ptr->chunkdata + prefix_len;
 85.2091 +   text_ptr->text_length = data_len;
 85.2092 +
 85.2093 +   ret = png_set_text_2(png_ptr, info_ptr, text_ptr, 1);
 85.2094 +
 85.2095 +   png_free(png_ptr, text_ptr);
 85.2096 +   png_free(png_ptr, png_ptr->chunkdata);
 85.2097 +   png_ptr->chunkdata = NULL;
 85.2098 +   if (ret)
 85.2099 +     png_error(png_ptr, "Insufficient memory to store zTXt chunk.");
 85.2100 +}
 85.2101 +#endif
 85.2102 +
 85.2103 +#if defined(PNG_READ_iTXt_SUPPORTED)
 85.2104 +/* note: this does not correctly handle chunks that are > 64K under DOS */
 85.2105 +void /* PRIVATE */
 85.2106 +png_handle_iTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
 85.2107 +{
 85.2108 +   png_textp text_ptr;
 85.2109 +   png_charp key, lang, text, lang_key;
 85.2110 +   int comp_flag;
 85.2111 +   int comp_type = 0;
 85.2112 +   int ret;
 85.2113 +   png_size_t slength, prefix_len, data_len;
 85.2114 +
 85.2115 +   png_debug(1, "in png_handle_iTXt\n");
 85.2116 +
 85.2117 +   if (!(png_ptr->mode & PNG_HAVE_IHDR))
 85.2118 +      png_error(png_ptr, "Missing IHDR before iTXt");
 85.2119 +
 85.2120 +   if (png_ptr->mode & PNG_HAVE_IDAT)
 85.2121 +      png_ptr->mode |= PNG_AFTER_IDAT;
 85.2122 +
 85.2123 +#ifdef PNG_MAX_MALLOC_64K
 85.2124 +   /* We will no doubt have problems with chunks even half this size, but
 85.2125 +      there is no hard and fast rule to tell us where to stop. */
 85.2126 +   if (length > (png_uint_32)65535L)
 85.2127 +   {
 85.2128 +     png_warning(png_ptr, "iTXt chunk too large to fit in memory");
 85.2129 +     png_crc_finish(png_ptr, length);
 85.2130 +     return;
 85.2131 +   }
 85.2132 +#endif
 85.2133 +
 85.2134 +   png_free(png_ptr, png_ptr->chunkdata);
 85.2135 +   png_ptr->chunkdata = (png_charp)png_malloc_warn(png_ptr, length + 1);
 85.2136 +   if (png_ptr->chunkdata == NULL)
 85.2137 +   {
 85.2138 +     png_warning(png_ptr, "No memory to process iTXt chunk.");
 85.2139 +     return;
 85.2140 +   }
 85.2141 +   slength = (png_size_t)length;
 85.2142 +   png_crc_read(png_ptr, (png_bytep)png_ptr->chunkdata, slength);
 85.2143 +   if (png_crc_finish(png_ptr, 0))
 85.2144 +   {
 85.2145 +      png_free(png_ptr, png_ptr->chunkdata);
 85.2146 +      png_ptr->chunkdata = NULL;
 85.2147 +      return;
 85.2148 +   }
 85.2149 +
 85.2150 +   png_ptr->chunkdata[slength] = 0x00;
 85.2151 +
 85.2152 +   for (lang = png_ptr->chunkdata; *lang; lang++)
 85.2153 +      /* empty loop */ ;
 85.2154 +   lang++;        /* skip NUL separator */
 85.2155 +
 85.2156 +   /* iTXt must have a language tag (possibly empty), two compression bytes,
 85.2157 +      translated keyword (possibly empty), and possibly some text after the
 85.2158 +      keyword */
 85.2159 +
 85.2160 +   if (lang >= png_ptr->chunkdata + slength - 3)
 85.2161 +   {
 85.2162 +      png_warning(png_ptr, "Truncated iTXt chunk");
 85.2163 +      png_free(png_ptr, png_ptr->chunkdata);
 85.2164 +      png_ptr->chunkdata = NULL;
 85.2165 +      return;
 85.2166 +   }
 85.2167 +   else
 85.2168 +   {
 85.2169 +       comp_flag = *lang++;
 85.2170 +       comp_type = *lang++;
 85.2171 +   }
 85.2172 +
 85.2173 +   for (lang_key = lang; *lang_key; lang_key++)
 85.2174 +      /* empty loop */ ;
 85.2175 +   lang_key++;        /* skip NUL separator */
 85.2176 +
 85.2177 +   if (lang_key >= png_ptr->chunkdata + slength)
 85.2178 +   {
 85.2179 +      png_warning(png_ptr, "Truncated iTXt chunk");
 85.2180 +      png_free(png_ptr, png_ptr->chunkdata);
 85.2181 +      png_ptr->chunkdata = NULL;
 85.2182 +      return;
 85.2183 +   }
 85.2184 +
 85.2185 +   for (text = lang_key; *text; text++)
 85.2186 +      /* empty loop */ ;
 85.2187 +   text++;        /* skip NUL separator */
 85.2188 +   if (text >= png_ptr->chunkdata + slength)
 85.2189 +   {
 85.2190 +      png_warning(png_ptr, "Malformed iTXt chunk");
 85.2191 +      png_free(png_ptr, png_ptr->chunkdata);
 85.2192 +      png_ptr->chunkdata = NULL;
 85.2193 +      return;
 85.2194 +   }
 85.2195 +
 85.2196 +   prefix_len = text - png_ptr->chunkdata;
 85.2197 +
 85.2198 +   key=png_ptr->chunkdata;
 85.2199 +   if (comp_flag)
 85.2200 +       png_decompress_chunk(png_ptr, comp_type,
 85.2201 +         (size_t)length, prefix_len, &data_len);
 85.2202 +   else
 85.2203 +       data_len = png_strlen(png_ptr->chunkdata + prefix_len);
 85.2204 +   text_ptr = (png_textp)png_malloc_warn(png_ptr,
 85.2205 +      (png_uint_32)png_sizeof(png_text));
 85.2206 +   if (text_ptr == NULL)
 85.2207 +   {
 85.2208 +     png_warning(png_ptr, "Not enough memory to process iTXt chunk.");
 85.2209 +     png_free(png_ptr, png_ptr->chunkdata);
 85.2210 +     png_ptr->chunkdata = NULL;
 85.2211 +     return;
 85.2212 +   }
 85.2213 +   text_ptr->compression = (int)comp_flag + 1;
 85.2214 +   text_ptr->lang_key = png_ptr->chunkdata + (lang_key - key);
 85.2215 +   text_ptr->lang = png_ptr->chunkdata + (lang - key);
 85.2216 +   text_ptr->itxt_length = data_len;
 85.2217 +   text_ptr->text_length = 0;
 85.2218 +   text_ptr->key = png_ptr->chunkdata;
 85.2219 +   text_ptr->text = png_ptr->chunkdata + prefix_len;
 85.2220 +
 85.2221 +   ret = png_set_text_2(png_ptr, info_ptr, text_ptr, 1);
 85.2222 +
 85.2223 +   png_free(png_ptr, text_ptr);
 85.2224 +   png_free(png_ptr, png_ptr->chunkdata);
 85.2225 +   png_ptr->chunkdata = NULL;
 85.2226 +   if (ret)
 85.2227 +     png_error(png_ptr, "Insufficient memory to store iTXt chunk.");
 85.2228 +}
 85.2229 +#endif
 85.2230 +
 85.2231 +/* This function is called when we haven't found a handler for a
 85.2232 +   chunk.  If there isn't a problem with the chunk itself (ie bad
 85.2233 +   chunk name, CRC, or a critical chunk), the chunk is silently ignored
 85.2234 +   -- unless the PNG_FLAG_UNKNOWN_CHUNKS_SUPPORTED flag is on in which
 85.2235 +   case it will be saved away to be written out later. */
 85.2236 +void /* PRIVATE */
 85.2237 +png_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
 85.2238 +{
 85.2239 +   png_uint_32 skip = 0;
 85.2240 +
 85.2241 +   png_debug(1, "in png_handle_unknown\n");
 85.2242 +
 85.2243 +   if (png_ptr->mode & PNG_HAVE_IDAT)
 85.2244 +   {
 85.2245 +#ifdef PNG_USE_LOCAL_ARRAYS
 85.2246 +      PNG_CONST PNG_IDAT;
 85.2247 +#endif
 85.2248 +      if (png_memcmp(png_ptr->chunk_name, png_IDAT, 4))  /* not an IDAT */
 85.2249 +         png_ptr->mode |= PNG_AFTER_IDAT;
 85.2250 +   }
 85.2251 +
 85.2252 +   if (!(png_ptr->chunk_name[0] & 0x20))
 85.2253 +   {
 85.2254 +#if defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED)
 85.2255 +      if (png_handle_as_unknown(png_ptr, png_ptr->chunk_name) !=
 85.2256 +           PNG_HANDLE_CHUNK_ALWAYS
 85.2257 +#if defined(PNG_READ_USER_CHUNKS_SUPPORTED)
 85.2258 +           && png_ptr->read_user_chunk_fn == NULL
 85.2259 +#endif
 85.2260 +        )
 85.2261 +#endif
 85.2262 +          png_chunk_error(png_ptr, "unknown critical chunk");
 85.2263 +   }
 85.2264 +
 85.2265 +#if defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED)
 85.2266 +   if ((png_ptr->flags & PNG_FLAG_KEEP_UNKNOWN_CHUNKS) ||
 85.2267 +       (png_ptr->read_user_chunk_fn != NULL))
 85.2268 +   {
 85.2269 +#ifdef PNG_MAX_MALLOC_64K
 85.2270 +       if (length > (png_uint_32)65535L)
 85.2271 +       {
 85.2272 +           png_warning(png_ptr, "unknown chunk too large to fit in memory");
 85.2273 +           skip = length - (png_uint_32)65535L;
 85.2274 +           length = (png_uint_32)65535L;
 85.2275 +       }
 85.2276 +#endif
 85.2277 +       png_memcpy((png_charp)png_ptr->unknown_chunk.name,
 85.2278 +                  (png_charp)png_ptr->chunk_name, 
 85.2279 +                  png_sizeof(png_ptr->unknown_chunk.name));
 85.2280 +       png_ptr->unknown_chunk.name[png_sizeof(png_ptr->unknown_chunk.name)-1] = '\0';
 85.2281 +       png_ptr->unknown_chunk.size = (png_size_t)length;
 85.2282 +       if (length == 0)
 85.2283 +         png_ptr->unknown_chunk.data = NULL;
 85.2284 +       else
 85.2285 +       {
 85.2286 +         png_ptr->unknown_chunk.data = (png_bytep)png_malloc(png_ptr, length);
 85.2287 +         png_crc_read(png_ptr, (png_bytep)png_ptr->unknown_chunk.data, length);
 85.2288 +       }
 85.2289 +#if defined(PNG_READ_USER_CHUNKS_SUPPORTED)
 85.2290 +       if (png_ptr->read_user_chunk_fn != NULL)
 85.2291 +       {
 85.2292 +          /* callback to user unknown chunk handler */
 85.2293 +          int ret;
 85.2294 +          ret = (*(png_ptr->read_user_chunk_fn))
 85.2295 +            (png_ptr, &png_ptr->unknown_chunk);
 85.2296 +          if (ret < 0)
 85.2297 +             png_chunk_error(png_ptr, "error in user chunk");
 85.2298 +          if (ret == 0)
 85.2299 +          {
 85.2300 +             if (!(png_ptr->chunk_name[0] & 0x20))
 85.2301 +                if (png_handle_as_unknown(png_ptr, png_ptr->chunk_name) !=
 85.2302 +                     PNG_HANDLE_CHUNK_ALWAYS)
 85.2303 +                   png_chunk_error(png_ptr, "unknown critical chunk");
 85.2304 +             png_set_unknown_chunks(png_ptr, info_ptr,
 85.2305 +               &png_ptr->unknown_chunk, 1);
 85.2306 +          }
 85.2307 +       }
 85.2308 +       else
 85.2309 +#endif
 85.2310 +       png_set_unknown_chunks(png_ptr, info_ptr, &png_ptr->unknown_chunk, 1);
 85.2311 +       png_free(png_ptr, png_ptr->unknown_chunk.data);
 85.2312 +       png_ptr->unknown_chunk.data = NULL;
 85.2313 +   }
 85.2314 +   else
 85.2315 +#endif
 85.2316 +      skip = length;
 85.2317 +
 85.2318 +   png_crc_finish(png_ptr, skip);
 85.2319 +
 85.2320 +#if !defined(PNG_READ_USER_CHUNKS_SUPPORTED)
 85.2321 +   info_ptr = info_ptr; /* quiet compiler warnings about unused info_ptr */
 85.2322 +#endif
 85.2323 +}
 85.2324 +
 85.2325 +/* This function is called to verify that a chunk name is valid.
 85.2326 +   This function can't have the "critical chunk check" incorporated
 85.2327 +   into it, since in the future we will need to be able to call user
 85.2328 +   functions to handle unknown critical chunks after we check that
 85.2329 +   the chunk name itself is valid. */
 85.2330 +
 85.2331 +#define isnonalpha(c) ((c) < 65 || (c) > 122 || ((c) > 90 && (c) < 97))
 85.2332 +
 85.2333 +void /* PRIVATE */
 85.2334 +png_check_chunk_name(png_structp png_ptr, png_bytep chunk_name)
 85.2335 +{
 85.2336 +   png_debug(1, "in png_check_chunk_name\n");
 85.2337 +   if (isnonalpha(chunk_name[0]) || isnonalpha(chunk_name[1]) ||
 85.2338 +       isnonalpha(chunk_name[2]) || isnonalpha(chunk_name[3]))
 85.2339 +   {
 85.2340 +      png_chunk_error(png_ptr, "invalid chunk type");
 85.2341 +   }
 85.2342 +}
 85.2343 +
 85.2344 +/* Combines the row recently read in with the existing pixels in the
 85.2345 +   row.  This routine takes care of alpha and transparency if requested.
 85.2346 +   This routine also handles the two methods of progressive display
 85.2347 +   of interlaced images, depending on the mask value.
 85.2348 +   The mask value describes which pixels are to be combined with
 85.2349 +   the row.  The pattern always repeats every 8 pixels, so just 8
 85.2350 +   bits are needed.  A one indicates the pixel is to be combined,
 85.2351 +   a zero indicates the pixel is to be skipped.  This is in addition
 85.2352 +   to any alpha or transparency value associated with the pixel.  If
 85.2353 +   you want all pixels to be combined, pass 0xff (255) in mask.  */
 85.2354 +
 85.2355 +void /* PRIVATE */
 85.2356 +png_combine_row(png_structp png_ptr, png_bytep row, int mask)
 85.2357 +{
 85.2358 +   png_debug(1, "in png_combine_row\n");
 85.2359 +   if (mask == 0xff)
 85.2360 +   {
 85.2361 +      png_memcpy(row, png_ptr->row_buf + 1,
 85.2362 +         PNG_ROWBYTES(png_ptr->row_info.pixel_depth, png_ptr->width));
 85.2363 +   }
 85.2364 +   else
 85.2365 +   {
 85.2366 +      switch (png_ptr->row_info.pixel_depth)
 85.2367 +      {
 85.2368 +         case 1:
 85.2369 +         {
 85.2370 +            png_bytep sp = png_ptr->row_buf + 1;
 85.2371 +            png_bytep dp = row;
 85.2372 +            int s_inc, s_start, s_end;
 85.2373 +            int m = 0x80;
 85.2374 +            int shift;
 85.2375 +            png_uint_32 i;
 85.2376 +            png_uint_32 row_width = png_ptr->width;
 85.2377 +
 85.2378 +#if defined(PNG_READ_PACKSWAP_SUPPORTED)
 85.2379 +            if (png_ptr->transformations & PNG_PACKSWAP)
 85.2380 +            {
 85.2381 +                s_start = 0;
 85.2382 +                s_end = 7;
 85.2383 +                s_inc = 1;
 85.2384 +            }
 85.2385 +            else
 85.2386 +#endif
 85.2387 +            {
 85.2388 +                s_start = 7;
 85.2389 +                s_end = 0;
 85.2390 +                s_inc = -1;
 85.2391 +            }
 85.2392 +
 85.2393 +            shift = s_start;
 85.2394 +
 85.2395 +            for (i = 0; i < row_width; i++)
 85.2396 +            {
 85.2397 +               if (m & mask)
 85.2398 +               {
 85.2399 +                  int value;
 85.2400 +
 85.2401 +                  value = (*sp >> shift) & 0x01;
 85.2402 +                  *dp &= (png_byte)((0x7f7f >> (7 - shift)) & 0xff);
 85.2403 +                  *dp |= (png_byte)(value << shift);
 85.2404 +               }
 85.2405 +
 85.2406 +               if (shift == s_end)
 85.2407 +               {
 85.2408 +                  shift = s_start;
 85.2409 +                  sp++;
 85.2410 +                  dp++;
 85.2411 +               }
 85.2412 +               else
 85.2413 +                  shift += s_inc;
 85.2414 +
 85.2415 +               if (m == 1)
 85.2416 +                  m = 0x80;
 85.2417 +               else
 85.2418 +                  m >>= 1;
 85.2419 +            }
 85.2420 +            break;
 85.2421 +         }
 85.2422 +         case 2:
 85.2423 +         {
 85.2424 +            png_bytep sp = png_ptr->row_buf + 1;
 85.2425 +            png_bytep dp = row;
 85.2426 +            int s_start, s_end, s_inc;
 85.2427 +            int m = 0x80;
 85.2428 +            int shift;
 85.2429 +            png_uint_32 i;
 85.2430 +            png_uint_32 row_width = png_ptr->width;
 85.2431 +            int value;
 85.2432 +
 85.2433 +#if defined(PNG_READ_PACKSWAP_SUPPORTED)
 85.2434 +            if (png_ptr->transformations & PNG_PACKSWAP)
 85.2435 +            {
 85.2436 +               s_start = 0;
 85.2437 +               s_end = 6;
 85.2438 +               s_inc = 2;
 85.2439 +            }
 85.2440 +            else
 85.2441 +#endif
 85.2442 +            {
 85.2443 +               s_start = 6;
 85.2444 +               s_end = 0;
 85.2445 +               s_inc = -2;
 85.2446 +            }
 85.2447 +
 85.2448 +            shift = s_start;
 85.2449 +
 85.2450 +            for (i = 0; i < row_width; i++)
 85.2451 +            {
 85.2452 +               if (m & mask)
 85.2453 +               {
 85.2454 +                  value = (*sp >> shift) & 0x03;
 85.2455 +                  *dp &= (png_byte)((0x3f3f >> (6 - shift)) & 0xff);
 85.2456 +                  *dp |= (png_byte)(value << shift);
 85.2457 +               }
 85.2458 +
 85.2459 +               if (shift == s_end)
 85.2460 +               {
 85.2461 +                  shift = s_start;
 85.2462 +                  sp++;
 85.2463 +                  dp++;
 85.2464 +               }
 85.2465 +               else
 85.2466 +                  shift += s_inc;
 85.2467 +               if (m == 1)
 85.2468 +                  m = 0x80;
 85.2469 +               else
 85.2470 +                  m >>= 1;
 85.2471 +            }
 85.2472 +            break;
 85.2473 +         }
 85.2474 +         case 4:
 85.2475 +         {
 85.2476 +            png_bytep sp = png_ptr->row_buf + 1;
 85.2477 +            png_bytep dp = row;
 85.2478 +            int s_start, s_end, s_inc;
 85.2479 +            int m = 0x80;
 85.2480 +            int shift;
 85.2481 +            png_uint_32 i;
 85.2482 +            png_uint_32 row_width = png_ptr->width;
 85.2483 +            int value;
 85.2484 +
 85.2485 +#if defined(PNG_READ_PACKSWAP_SUPPORTED)
 85.2486 +            if (png_ptr->transformations & PNG_PACKSWAP)
 85.2487 +            {
 85.2488 +               s_start = 0;
 85.2489 +               s_end = 4;
 85.2490 +               s_inc = 4;
 85.2491 +            }
 85.2492 +            else
 85.2493 +#endif
 85.2494 +            {
 85.2495 +               s_start = 4;
 85.2496 +               s_end = 0;
 85.2497 +               s_inc = -4;
 85.2498 +            }
 85.2499 +            shift = s_start;
 85.2500 +
 85.2501 +            for (i = 0; i < row_width; i++)
 85.2502 +            {
 85.2503 +               if (m & mask)
 85.2504 +               {
 85.2505 +                  value = (*sp >> shift) & 0xf;
 85.2506 +                  *dp &= (png_byte)((0xf0f >> (4 - shift)) & 0xff);
 85.2507 +                  *dp |= (png_byte)(value << shift);
 85.2508 +               }
 85.2509 +
 85.2510 +               if (shift == s_end)
 85.2511 +               {
 85.2512 +                  shift = s_start;
 85.2513 +                  sp++;
 85.2514 +                  dp++;
 85.2515 +               }
 85.2516 +               else
 85.2517 +                  shift += s_inc;
 85.2518 +               if (m == 1)
 85.2519 +                  m = 0x80;
 85.2520 +               else
 85.2521 +                  m >>= 1;
 85.2522 +            }
 85.2523 +            break;
 85.2524 +         }
 85.2525 +         default:
 85.2526 +         {
 85.2527 +            png_bytep sp = png_ptr->row_buf + 1;
 85.2528 +            png_bytep dp = row;
 85.2529 +            png_size_t pixel_bytes = (png_ptr->row_info.pixel_depth >> 3);
 85.2530 +            png_uint_32 i;
 85.2531 +            png_uint_32 row_width = png_ptr->width;
 85.2532 +            png_byte m = 0x80;
 85.2533 +
 85.2534 +
 85.2535 +            for (i = 0; i < row_width; i++)
 85.2536 +            {
 85.2537 +               if (m & mask)
 85.2538 +               {
 85.2539 +                  png_memcpy(dp, sp, pixel_bytes);
 85.2540 +               }
 85.2541 +
 85.2542 +               sp += pixel_bytes;
 85.2543 +               dp += pixel_bytes;
 85.2544 +
 85.2545 +               if (m == 1)
 85.2546 +                  m = 0x80;
 85.2547 +               else
 85.2548 +                  m >>= 1;
 85.2549 +            }
 85.2550 +            break;
 85.2551 +         }
 85.2552 +      }
 85.2553 +   }
 85.2554 +}
 85.2555 +
 85.2556 +#ifdef PNG_READ_INTERLACING_SUPPORTED
 85.2557 +/* OLD pre-1.0.9 interface:
 85.2558 +void png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
 85.2559 +   png_uint_32 transformations)
 85.2560 + */
 85.2561 +void /* PRIVATE */
 85.2562 +png_do_read_interlace(png_structp png_ptr)
 85.2563 +{
 85.2564 +   png_row_infop row_info = &(png_ptr->row_info);
 85.2565 +   png_bytep row = png_ptr->row_buf + 1;
 85.2566 +   int pass = png_ptr->pass;
 85.2567 +   png_uint_32 transformations = png_ptr->transformations;
 85.2568 +#ifdef PNG_USE_LOCAL_ARRAYS
 85.2569 +   /* arrays to facilitate easy interlacing - use pass (0 - 6) as index */
 85.2570 +   /* offset to next interlace block */
 85.2571 +   PNG_CONST int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
 85.2572 +#endif
 85.2573 +
 85.2574 +   png_debug(1, "in png_do_read_interlace\n");
 85.2575 +   if (row != NULL && row_info != NULL)
 85.2576 +   {
 85.2577 +      png_uint_32 final_width;
 85.2578 +
 85.2579 +      final_width = row_info->width * png_pass_inc[pass];
 85.2580 +
 85.2581 +      switch (row_info->pixel_depth)
 85.2582 +      {
 85.2583 +         case 1:
 85.2584 +         {
 85.2585 +            png_bytep sp = row + (png_size_t)((row_info->width - 1) >> 3);
 85.2586 +            png_bytep dp = row + (png_size_t)((final_width - 1) >> 3);
 85.2587 +            int sshift, dshift;
 85.2588 +            int s_start, s_end, s_inc;
 85.2589 +            int jstop = png_pass_inc[pass];
 85.2590 +            png_byte v;
 85.2591 +            png_uint_32 i;
 85.2592 +            int j;
 85.2593 +
 85.2594 +#if defined(PNG_READ_PACKSWAP_SUPPORTED)
 85.2595 +            if (transformations & PNG_PACKSWAP)
 85.2596 +            {
 85.2597 +                sshift = (int)((row_info->width + 7) & 0x07);
 85.2598 +                dshift = (int)((final_width + 7) & 0x07);
 85.2599 +                s_start = 7;
 85.2600 +                s_end = 0;
 85.2601 +                s_inc = -1;
 85.2602 +            }
 85.2603 +            else
 85.2604 +#endif
 85.2605 +            {
 85.2606 +                sshift = 7 - (int)((row_info->width + 7) & 0x07);
 85.2607 +                dshift = 7 - (int)((final_width + 7) & 0x07);
 85.2608 +                s_start = 0;
 85.2609 +                s_end = 7;
 85.2610 +                s_inc = 1;
 85.2611 +            }
 85.2612 +
 85.2613 +            for (i = 0; i < row_info->width; i++)
 85.2614 +            {
 85.2615 +               v = (png_byte)((*sp >> sshift) & 0x01);
 85.2616 +               for (j = 0; j < jstop; j++)
 85.2617 +               {
 85.2618 +                  *dp &= (png_byte)((0x7f7f >> (7 - dshift)) & 0xff);
 85.2619 +                  *dp |= (png_byte)(v << dshift);
 85.2620 +                  if (dshift == s_end)
 85.2621 +                  {
 85.2622 +                     dshift = s_start;
 85.2623 +                     dp--;
 85.2624 +                  }
 85.2625 +                  else
 85.2626 +                     dshift += s_inc;
 85.2627 +               }
 85.2628 +               if (sshift == s_end)
 85.2629 +               {
 85.2630 +                  sshift = s_start;
 85.2631 +                  sp--;
 85.2632 +               }
 85.2633 +               else
 85.2634 +                  sshift += s_inc;
 85.2635 +            }
 85.2636 +            break;
 85.2637 +         }
 85.2638 +         case 2:
 85.2639 +         {
 85.2640 +            png_bytep sp = row + (png_uint_32)((row_info->width - 1) >> 2);
 85.2641 +            png_bytep dp = row + (png_uint_32)((final_width - 1) >> 2);
 85.2642 +            int sshift, dshift;
 85.2643 +            int s_start, s_end, s_inc;
 85.2644 +            int jstop = png_pass_inc[pass];
 85.2645 +            png_uint_32 i;
 85.2646 +
 85.2647 +#if defined(PNG_READ_PACKSWAP_SUPPORTED)
 85.2648 +            if (transformations & PNG_PACKSWAP)
 85.2649 +            {
 85.2650 +               sshift = (int)(((row_info->width + 3) & 0x03) << 1);
 85.2651 +               dshift = (int)(((final_width + 3) & 0x03) << 1);
 85.2652 +               s_start = 6;
 85.2653 +               s_end = 0;
 85.2654 +               s_inc = -2;
 85.2655 +            }
 85.2656 +            else
 85.2657 +#endif
 85.2658 +            {
 85.2659 +               sshift = (int)((3 - ((row_info->width + 3) & 0x03)) << 1);
 85.2660 +               dshift = (int)((3 - ((final_width + 3) & 0x03)) << 1);
 85.2661 +               s_start = 0;
 85.2662 +               s_end = 6;
 85.2663 +               s_inc = 2;
 85.2664 +            }
 85.2665 +
 85.2666 +            for (i = 0; i < row_info->width; i++)
 85.2667 +            {
 85.2668 +               png_byte v;
 85.2669 +               int j;
 85.2670 +
 85.2671 +               v = (png_byte)((*sp >> sshift) & 0x03);
 85.2672 +               for (j = 0; j < jstop; j++)
 85.2673 +               {
 85.2674 +                  *dp &= (png_byte)((0x3f3f >> (6 - dshift)) & 0xff);
 85.2675 +                  *dp |= (png_byte)(v << dshift);
 85.2676 +                  if (dshift == s_end)
 85.2677 +                  {
 85.2678 +                     dshift = s_start;
 85.2679 +                     dp--;
 85.2680 +                  }
 85.2681 +                  else
 85.2682 +                     dshift += s_inc;
 85.2683 +               }
 85.2684 +               if (sshift == s_end)
 85.2685 +               {
 85.2686 +                  sshift = s_start;
 85.2687 +                  sp--;
 85.2688 +               }
 85.2689 +               else
 85.2690 +                  sshift += s_inc;
 85.2691 +            }
 85.2692 +            break;
 85.2693 +         }
 85.2694 +         case 4:
 85.2695 +         {
 85.2696 +            png_bytep sp = row + (png_size_t)((row_info->width - 1) >> 1);
 85.2697 +            png_bytep dp = row + (png_size_t)((final_width - 1) >> 1);
 85.2698 +            int sshift, dshift;
 85.2699 +            int s_start, s_end, s_inc;
 85.2700 +            png_uint_32 i;
 85.2701 +            int jstop = png_pass_inc[pass];
 85.2702 +
 85.2703 +#if defined(PNG_READ_PACKSWAP_SUPPORTED)
 85.2704 +            if (transformations & PNG_PACKSWAP)
 85.2705 +            {
 85.2706 +               sshift = (int)(((row_info->width + 1) & 0x01) << 2);
 85.2707 +               dshift = (int)(((final_width + 1) & 0x01) << 2);
 85.2708 +               s_start = 4;
 85.2709 +               s_end = 0;
 85.2710 +               s_inc = -4;
 85.2711 +            }
 85.2712 +            else
 85.2713 +#endif
 85.2714 +            {
 85.2715 +               sshift = (int)((1 - ((row_info->width + 1) & 0x01)) << 2);
 85.2716 +               dshift = (int)((1 - ((final_width + 1) & 0x01)) << 2);
 85.2717 +               s_start = 0;
 85.2718 +               s_end = 4;
 85.2719 +               s_inc = 4;
 85.2720 +            }
 85.2721 +
 85.2722 +            for (i = 0; i < row_info->width; i++)
 85.2723 +            {
 85.2724 +               png_byte v = (png_byte)((*sp >> sshift) & 0xf);
 85.2725 +               int j;
 85.2726 +
 85.2727 +               for (j = 0; j < jstop; j++)
 85.2728 +               {
 85.2729 +                  *dp &= (png_byte)((0xf0f >> (4 - dshift)) & 0xff);
 85.2730 +                  *dp |= (png_byte)(v << dshift);
 85.2731 +                  if (dshift == s_end)
 85.2732 +                  {
 85.2733 +                     dshift = s_start;
 85.2734 +                     dp--;
 85.2735 +                  }
 85.2736 +                  else
 85.2737 +                     dshift += s_inc;
 85.2738 +               }
 85.2739 +               if (sshift == s_end)
 85.2740 +               {
 85.2741 +                  sshift = s_start;
 85.2742 +                  sp--;
 85.2743 +               }
 85.2744 +               else
 85.2745 +                  sshift += s_inc;
 85.2746 +            }
 85.2747 +            break;
 85.2748 +         }
 85.2749 +         default:
 85.2750 +         {
 85.2751 +            png_size_t pixel_bytes = (row_info->pixel_depth >> 3);
 85.2752 +            png_bytep sp = row + (png_size_t)(row_info->width - 1) * pixel_bytes;
 85.2753 +            png_bytep dp = row + (png_size_t)(final_width - 1) * pixel_bytes;
 85.2754 +
 85.2755 +            int jstop = png_pass_inc[pass];
 85.2756 +            png_uint_32 i;
 85.2757 +
 85.2758 +            for (i = 0; i < row_info->width; i++)
 85.2759 +            {
 85.2760 +               png_byte v[8];
 85.2761 +               int j;
 85.2762 +
 85.2763 +               png_memcpy(v, sp, pixel_bytes);
 85.2764 +               for (j = 0; j < jstop; j++)
 85.2765 +               {
 85.2766 +                  png_memcpy(dp, v, pixel_bytes);
 85.2767 +                  dp -= pixel_bytes;
 85.2768 +               }
 85.2769 +               sp -= pixel_bytes;
 85.2770 +            }
 85.2771 +            break;
 85.2772 +         }
 85.2773 +      }
 85.2774 +      row_info->width = final_width;
 85.2775 +      row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, final_width);
 85.2776 +   }
 85.2777 +#if !defined(PNG_READ_PACKSWAP_SUPPORTED)
 85.2778 +   transformations = transformations; /* silence compiler warning */
 85.2779 +#endif
 85.2780 +}
 85.2781 +#endif /* PNG_READ_INTERLACING_SUPPORTED */
 85.2782 +
 85.2783 +void /* PRIVATE */
 85.2784 +png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep row,
 85.2785 +   png_bytep prev_row, int filter)
 85.2786 +{
 85.2787 +   png_debug(1, "in png_read_filter_row\n");
 85.2788 +   png_debug2(2, "row = %lu, filter = %d\n", png_ptr->row_number, filter);
 85.2789 +   switch (filter)
 85.2790 +   {
 85.2791 +      case PNG_FILTER_VALUE_NONE:
 85.2792 +         break;
 85.2793 +      case PNG_FILTER_VALUE_SUB:
 85.2794 +      {
 85.2795 +         png_uint_32 i;
 85.2796 +         png_uint_32 istop = row_info->rowbytes;
 85.2797 +         png_uint_32 bpp = (row_info->pixel_depth + 7) >> 3;
 85.2798 +         png_bytep rp = row + bpp;
 85.2799 +         png_bytep lp = row;
 85.2800 +
 85.2801 +         for (i = bpp; i < istop; i++)
 85.2802 +         {
 85.2803 +            *rp = (png_byte)(((int)(*rp) + (int)(*lp++)) & 0xff);
 85.2804 +            rp++;
 85.2805 +         }
 85.2806 +         break;
 85.2807 +      }
 85.2808 +      case PNG_FILTER_VALUE_UP:
 85.2809 +      {
 85.2810 +         png_uint_32 i;
 85.2811 +         png_uint_32 istop = row_info->rowbytes;
 85.2812 +         png_bytep rp = row;
 85.2813 +         png_bytep pp = prev_row;
 85.2814 +
 85.2815 +         for (i = 0; i < istop; i++)
 85.2816 +         {
 85.2817 +            *rp = (png_byte)(((int)(*rp) + (int)(*pp++)) & 0xff);
 85.2818 +            rp++;
 85.2819 +         }
 85.2820 +         break;
 85.2821 +      }
 85.2822 +      case PNG_FILTER_VALUE_AVG:
 85.2823 +      {
 85.2824 +         png_uint_32 i;
 85.2825 +         png_bytep rp = row;
 85.2826 +         png_bytep pp = prev_row;
 85.2827 +         png_bytep lp = row;
 85.2828 +         png_uint_32 bpp = (row_info->pixel_depth + 7) >> 3;
 85.2829 +         png_uint_32 istop = row_info->rowbytes - bpp;
 85.2830 +
 85.2831 +         for (i = 0; i < bpp; i++)
 85.2832 +         {
 85.2833 +            *rp = (png_byte)(((int)(*rp) +
 85.2834 +               ((int)(*pp++) / 2 )) & 0xff);
 85.2835 +            rp++;
 85.2836 +         }
 85.2837 +
 85.2838 +         for (i = 0; i < istop; i++)
 85.2839 +         {
 85.2840 +            *rp = (png_byte)(((int)(*rp) +
 85.2841 +               (int)(*pp++ + *lp++) / 2 ) & 0xff);
 85.2842 +            rp++;
 85.2843 +         }
 85.2844 +         break;
 85.2845 +      }
 85.2846 +      case PNG_FILTER_VALUE_PAETH:
 85.2847 +      {
 85.2848 +         png_uint_32 i;
 85.2849 +         png_bytep rp = row;
 85.2850 +         png_bytep pp = prev_row;
 85.2851 +         png_bytep lp = row;
 85.2852 +         png_bytep cp = prev_row;
 85.2853 +         png_uint_32 bpp = (row_info->pixel_depth + 7) >> 3;
 85.2854 +         png_uint_32 istop=row_info->rowbytes - bpp;
 85.2855 +
 85.2856 +         for (i = 0; i < bpp; i++)
 85.2857 +         {
 85.2858 +            *rp = (png_byte)(((int)(*rp) + (int)(*pp++)) & 0xff);
 85.2859 +            rp++;
 85.2860 +         }
 85.2861 +
 85.2862 +         for (i = 0; i < istop; i++)   /* use leftover rp,pp */
 85.2863 +         {
 85.2864 +            int a, b, c, pa, pb, pc, p;
 85.2865 +
 85.2866 +            a = *lp++;
 85.2867 +            b = *pp++;
 85.2868 +            c = *cp++;
 85.2869 +
 85.2870 +            p = b - c;
 85.2871 +            pc = a - c;
 85.2872 +
 85.2873 +#ifdef PNG_USE_ABS
 85.2874 +            pa = abs(p);
 85.2875 +            pb = abs(pc);
 85.2876 +            pc = abs(p + pc);
 85.2877 +#else
 85.2878 +            pa = p < 0 ? -p : p;
 85.2879 +            pb = pc < 0 ? -pc : pc;
 85.2880 +            pc = (p + pc) < 0 ? -(p + pc) : p + pc;
 85.2881 +#endif
 85.2882 +
 85.2883 +            /*
 85.2884 +               if (pa <= pb && pa <= pc)
 85.2885 +                  p = a;
 85.2886 +               else if (pb <= pc)
 85.2887 +                  p = b;
 85.2888 +               else
 85.2889 +                  p = c;
 85.2890 +             */
 85.2891 +
 85.2892 +            p = (pa <= pb && pa <= pc) ? a : (pb <= pc) ? b : c;
 85.2893 +
 85.2894 +            *rp = (png_byte)(((int)(*rp) + p) & 0xff);
 85.2895 +            rp++;
 85.2896 +         }
 85.2897 +         break;
 85.2898 +      }
 85.2899 +      default:
 85.2900 +         png_warning(png_ptr, "Ignoring bad adaptive filter type");
 85.2901 +         *row = 0;
 85.2902 +         break;
 85.2903 +   }
 85.2904 +}
 85.2905 +
 85.2906 +void /* PRIVATE */
 85.2907 +png_read_finish_row(png_structp png_ptr)
 85.2908 +{
 85.2909 +#ifdef PNG_USE_LOCAL_ARRAYS
 85.2910 +#ifdef PNG_READ_INTERLACING_SUPPORTED
 85.2911 +   /* arrays to facilitate easy interlacing - use pass (0 - 6) as index */
 85.2912 +
 85.2913 +   /* start of interlace block */
 85.2914 +   PNG_CONST int png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0};
 85.2915 +
 85.2916 +   /* offset to next interlace block */
 85.2917 +   PNG_CONST int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
 85.2918 +
 85.2919 +   /* start of interlace block in the y direction */
 85.2920 +   PNG_CONST int png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1};
 85.2921 +
 85.2922 +   /* offset to next interlace block in the y direction */
 85.2923 +   PNG_CONST int png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2};
 85.2924 +#endif /* PNG_READ_INTERLACING_SUPPORTED */
 85.2925 +#endif
 85.2926 +
 85.2927 +   png_debug(1, "in png_read_finish_row\n");
 85.2928 +   png_ptr->row_number++;
 85.2929 +   if (png_ptr->row_number < png_ptr->num_rows)
 85.2930 +      return;
 85.2931 +
 85.2932 +#ifdef PNG_READ_INTERLACING_SUPPORTED
 85.2933 +   if (png_ptr->interlaced)
 85.2934 +   {
 85.2935 +      png_ptr->row_number = 0;
 85.2936 +      png_memset_check(png_ptr, png_ptr->prev_row, 0,
 85.2937 +         png_ptr->rowbytes + 1);
 85.2938 +      do
 85.2939 +      {
 85.2940 +         png_ptr->pass++;
 85.2941 +         if (png_ptr->pass >= 7)
 85.2942 +            break;
 85.2943 +         png_ptr->iwidth = (png_ptr->width +
 85.2944 +            png_pass_inc[png_ptr->pass] - 1 -
 85.2945 +            png_pass_start[png_ptr->pass]) /
 85.2946 +            png_pass_inc[png_ptr->pass];
 85.2947 +
 85.2948 +         png_ptr->irowbytes = PNG_ROWBYTES(png_ptr->pixel_depth,
 85.2949 +            png_ptr->iwidth) + 1;
 85.2950 +
 85.2951 +         if (!(png_ptr->transformations & PNG_INTERLACE))
 85.2952 +         {
 85.2953 +            png_ptr->num_rows = (png_ptr->height +
 85.2954 +               png_pass_yinc[png_ptr->pass] - 1 -
 85.2955 +               png_pass_ystart[png_ptr->pass]) /
 85.2956 +               png_pass_yinc[png_ptr->pass];
 85.2957 +            if (!(png_ptr->num_rows))
 85.2958 +               continue;
 85.2959 +         }
 85.2960 +         else  /* if (png_ptr->transformations & PNG_INTERLACE) */
 85.2961 +            break;
 85.2962 +      } while (png_ptr->iwidth == 0);
 85.2963 +
 85.2964 +      if (png_ptr->pass < 7)
 85.2965 +         return;
 85.2966 +   }
 85.2967 +#endif /* PNG_READ_INTERLACING_SUPPORTED */
 85.2968 +
 85.2969 +   if (!(png_ptr->flags & PNG_FLAG_ZLIB_FINISHED))
 85.2970 +   {
 85.2971 +#ifdef PNG_USE_LOCAL_ARRAYS
 85.2972 +      PNG_CONST PNG_IDAT;
 85.2973 +#endif
 85.2974 +      char extra;
 85.2975 +      int ret;
 85.2976 +
 85.2977 +      png_ptr->zstream.next_out = (Byte *)&extra;
 85.2978 +      png_ptr->zstream.avail_out = (uInt)1;
 85.2979 +      for (;;)
 85.2980 +      {
 85.2981 +         if (!(png_ptr->zstream.avail_in))
 85.2982 +         {
 85.2983 +            while (!png_ptr->idat_size)
 85.2984 +            {
 85.2985 +               png_byte chunk_length[4];
 85.2986 +
 85.2987 +               png_crc_finish(png_ptr, 0);
 85.2988 +
 85.2989 +               png_read_data(png_ptr, chunk_length, 4);
 85.2990 +               png_ptr->idat_size = png_get_uint_31(png_ptr, chunk_length);
 85.2991 +               png_reset_crc(png_ptr);
 85.2992 +               png_crc_read(png_ptr, png_ptr->chunk_name, 4);
 85.2993 +               if (png_memcmp(png_ptr->chunk_name, png_IDAT, 4))
 85.2994 +                  png_error(png_ptr, "Not enough image data");
 85.2995 +
 85.2996 +            }
 85.2997 +            png_ptr->zstream.avail_in = (uInt)png_ptr->zbuf_size;
 85.2998 +            png_ptr->zstream.next_in = png_ptr->zbuf;
 85.2999 +            if (png_ptr->zbuf_size > png_ptr->idat_size)
 85.3000 +               png_ptr->zstream.avail_in = (uInt)png_ptr->idat_size;
 85.3001 +            png_crc_read(png_ptr, png_ptr->zbuf, png_ptr->zstream.avail_in);
 85.3002 +            png_ptr->idat_size -= png_ptr->zstream.avail_in;
 85.3003 +         }
 85.3004 +         ret = inflate(&png_ptr->zstream, Z_PARTIAL_FLUSH);
 85.3005 +         if (ret == Z_STREAM_END)
 85.3006 +         {
 85.3007 +            if (!(png_ptr->zstream.avail_out) || png_ptr->zstream.avail_in ||
 85.3008 +               png_ptr->idat_size)
 85.3009 +               png_warning(png_ptr, "Extra compressed data");
 85.3010 +            png_ptr->mode |= PNG_AFTER_IDAT;
 85.3011 +            png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED;
 85.3012 +            break;
 85.3013 +         }
 85.3014 +         if (ret != Z_OK)
 85.3015 +            png_error(png_ptr, png_ptr->zstream.msg ? png_ptr->zstream.msg :
 85.3016 +                      "Decompression Error");
 85.3017 +
 85.3018 +         if (!(png_ptr->zstream.avail_out))
 85.3019 +         {
 85.3020 +            png_warning(png_ptr, "Extra compressed data.");
 85.3021 +            png_ptr->mode |= PNG_AFTER_IDAT;
 85.3022 +            png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED;
 85.3023 +            break;
 85.3024 +         }
 85.3025 +
 85.3026 +      }
 85.3027 +      png_ptr->zstream.avail_out = 0;
 85.3028 +   }
 85.3029 +
 85.3030 +   if (png_ptr->idat_size || png_ptr->zstream.avail_in)
 85.3031 +      png_warning(png_ptr, "Extra compression data");
 85.3032 +
 85.3033 +   inflateReset(&png_ptr->zstream);
 85.3034 +
 85.3035 +   png_ptr->mode |= PNG_AFTER_IDAT;
 85.3036 +}
 85.3037 +
 85.3038 +void /* PRIVATE */
 85.3039 +png_read_start_row(png_structp png_ptr)
 85.3040 +{
 85.3041 +#ifdef PNG_USE_LOCAL_ARRAYS
 85.3042 +#ifdef PNG_READ_INTERLACING_SUPPORTED
 85.3043 +   /* arrays to facilitate easy interlacing - use pass (0 - 6) as index */
 85.3044 +
 85.3045 +   /* start of interlace block */
 85.3046 +   PNG_CONST int png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0};
 85.3047 +
 85.3048 +   /* offset to next interlace block */
 85.3049 +   PNG_CONST int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
 85.3050 +
 85.3051 +   /* start of interlace block in the y direction */
 85.3052 +   PNG_CONST int png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1};
 85.3053 +
 85.3054 +   /* offset to next interlace block in the y direction */
 85.3055 +   PNG_CONST int png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2};
 85.3056 +#endif
 85.3057 +#endif
 85.3058 +
 85.3059 +   int max_pixel_depth;
 85.3060 +   png_size_t row_bytes;
 85.3061 +
 85.3062 +   png_debug(1, "in png_read_start_row\n");
 85.3063 +   png_ptr->zstream.avail_in = 0;
 85.3064 +   png_init_read_transformations(png_ptr);
 85.3065 +#ifdef PNG_READ_INTERLACING_SUPPORTED
 85.3066 +   if (png_ptr->interlaced)
 85.3067 +   {
 85.3068 +      if (!(png_ptr->transformations & PNG_INTERLACE))
 85.3069 +         png_ptr->num_rows = (png_ptr->height + png_pass_yinc[0] - 1 -
 85.3070 +            png_pass_ystart[0]) / png_pass_yinc[0];
 85.3071 +      else
 85.3072 +         png_ptr->num_rows = png_ptr->height;
 85.3073 +
 85.3074 +      png_ptr->iwidth = (png_ptr->width +
 85.3075 +         png_pass_inc[png_ptr->pass] - 1 -
 85.3076 +         png_pass_start[png_ptr->pass]) /
 85.3077 +         png_pass_inc[png_ptr->pass];
 85.3078 +
 85.3079 +         png_ptr->irowbytes =
 85.3080 +            PNG_ROWBYTES(png_ptr->pixel_depth, png_ptr->iwidth) + 1;
 85.3081 +   }
 85.3082 +   else
 85.3083 +#endif /* PNG_READ_INTERLACING_SUPPORTED */
 85.3084 +   {
 85.3085 +      png_ptr->num_rows = png_ptr->height;
 85.3086 +      png_ptr->iwidth = png_ptr->width;
 85.3087 +      png_ptr->irowbytes = png_ptr->rowbytes + 1;
 85.3088 +   }
 85.3089 +   max_pixel_depth = png_ptr->pixel_depth;
 85.3090 +
 85.3091 +#if defined(PNG_READ_PACK_SUPPORTED)
 85.3092 +   if ((png_ptr->transformations & PNG_PACK) && png_ptr->bit_depth < 8)
 85.3093 +      max_pixel_depth = 8;
 85.3094 +#endif
 85.3095 +
 85.3096 +#if defined(PNG_READ_EXPAND_SUPPORTED)
 85.3097 +   if (png_ptr->transformations & PNG_EXPAND)
 85.3098 +   {
 85.3099 +      if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
 85.3100 +      {
 85.3101 +         if (png_ptr->num_trans)
 85.3102 +            max_pixel_depth = 32;
 85.3103 +         else
 85.3104 +            max_pixel_depth = 24;
 85.3105 +      }
 85.3106 +      else if (png_ptr->color_type == PNG_COLOR_TYPE_GRAY)
 85.3107 +      {
 85.3108 +         if (max_pixel_depth < 8)
 85.3109 +            max_pixel_depth = 8;
 85.3110 +         if (png_ptr->num_trans)
 85.3111 +            max_pixel_depth *= 2;
 85.3112 +      }
 85.3113 +      else if (png_ptr->color_type == PNG_COLOR_TYPE_RGB)
 85.3114 +      {
 85.3115 +         if (png_ptr->num_trans)
 85.3116 +         {
 85.3117 +            max_pixel_depth *= 4;
 85.3118 +            max_pixel_depth /= 3;
 85.3119 +         }
 85.3120 +      }
 85.3121 +   }
 85.3122 +#endif
 85.3123 +
 85.3124 +#if defined(PNG_READ_FILLER_SUPPORTED)
 85.3125 +   if (png_ptr->transformations & (PNG_FILLER))
 85.3126 +   {
 85.3127 +      if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
 85.3128 +         max_pixel_depth = 32;
 85.3129 +      else if (png_ptr->color_type == PNG_COLOR_TYPE_GRAY)
 85.3130 +      {
 85.3131 +         if (max_pixel_depth <= 8)
 85.3132 +            max_pixel_depth = 16;
 85.3133 +         else
 85.3134 +            max_pixel_depth = 32;
 85.3135 +      }
 85.3136 +      else if (png_ptr->color_type == PNG_COLOR_TYPE_RGB)
 85.3137 +      {
 85.3138 +         if (max_pixel_depth <= 32)
 85.3139 +            max_pixel_depth = 32;
 85.3140 +         else
 85.3141 +            max_pixel_depth = 64;
 85.3142 +      }
 85.3143 +   }
 85.3144 +#endif
 85.3145 +
 85.3146 +#if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED)
 85.3147 +   if (png_ptr->transformations & PNG_GRAY_TO_RGB)
 85.3148 +   {
 85.3149 +      if (
 85.3150 +#if defined(PNG_READ_EXPAND_SUPPORTED)
 85.3151 +        (png_ptr->num_trans && (png_ptr->transformations & PNG_EXPAND)) ||
 85.3152 +#endif
 85.3153 +#if defined(PNG_READ_FILLER_SUPPORTED)
 85.3154 +        (png_ptr->transformations & (PNG_FILLER)) ||
 85.3155 +#endif
 85.3156 +        png_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
 85.3157 +      {
 85.3158 +         if (max_pixel_depth <= 16)
 85.3159 +            max_pixel_depth = 32;
 85.3160 +         else
 85.3161 +            max_pixel_depth = 64;
 85.3162 +      }
 85.3163 +      else
 85.3164 +      {
 85.3165 +         if (max_pixel_depth <= 8)
 85.3166 +           {
 85.3167 +             if (png_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
 85.3168 +               max_pixel_depth = 32;
 85.3169 +             else
 85.3170 +               max_pixel_depth = 24;
 85.3171 +           }
 85.3172 +         else if (png_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
 85.3173 +            max_pixel_depth = 64;
 85.3174 +         else
 85.3175 +            max_pixel_depth = 48;
 85.3176 +      }
 85.3177 +   }
 85.3178 +#endif
 85.3179 +
 85.3180 +#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) && \
 85.3181 +defined(PNG_USER_TRANSFORM_PTR_SUPPORTED)
 85.3182 +   if (png_ptr->transformations & PNG_USER_TRANSFORM)
 85.3183 +     {
 85.3184 +       int user_pixel_depth = png_ptr->user_transform_depth*
 85.3185 +         png_ptr->user_transform_channels;
 85.3186 +       if (user_pixel_depth > max_pixel_depth)
 85.3187 +         max_pixel_depth=user_pixel_depth;
 85.3188 +     }
 85.3189 +#endif
 85.3190 +
 85.3191 +   /* align the width on the next larger 8 pixels.  Mainly used
 85.3192 +      for interlacing */
 85.3193 +   row_bytes = ((png_ptr->width + 7) & ~((png_uint_32)7));
 85.3194 +   /* calculate the maximum bytes needed, adding a byte and a pixel
 85.3195 +      for safety's sake */
 85.3196 +   row_bytes = PNG_ROWBYTES(max_pixel_depth, row_bytes) +
 85.3197 +      1 + ((max_pixel_depth + 7) >> 3);
 85.3198 +#ifdef PNG_MAX_MALLOC_64K
 85.3199 +   if (row_bytes > (png_uint_32)65536L)
 85.3200 +      png_error(png_ptr, "This image requires a row greater than 64KB");
 85.3201 +#endif
 85.3202 +
 85.3203 +   if (row_bytes + 64 > png_ptr->old_big_row_buf_size)
 85.3204 +   {
 85.3205 +     png_free(png_ptr, png_ptr->big_row_buf);
 85.3206 +     png_ptr->big_row_buf = (png_bytep)png_malloc(png_ptr, row_bytes+64);
 85.3207 +     png_ptr->row_buf = png_ptr->big_row_buf+32;
 85.3208 +     png_ptr->old_big_row_buf_size = row_bytes+64;
 85.3209 +   }
 85.3210 +
 85.3211 +#ifdef PNG_MAX_MALLOC_64K
 85.3212 +   if ((png_uint_32)png_ptr->rowbytes + 1 > (png_uint_32)65536L)
 85.3213 +      png_error(png_ptr, "This image requires a row greater than 64KB");
 85.3214 +#endif
 85.3215 +   if ((png_uint_32)png_ptr->rowbytes > (png_uint_32)(PNG_SIZE_MAX - 1))
 85.3216 +      png_error(png_ptr, "Row has too many bytes to allocate in memory.");
 85.3217 +
 85.3218 +   if (png_ptr->rowbytes+1 > png_ptr->old_prev_row_size)
 85.3219 +   {
 85.3220 +     png_free(png_ptr, png_ptr->prev_row);
 85.3221 +     png_ptr->prev_row = (png_bytep)png_malloc(png_ptr, (png_uint_32)(
 85.3222 +        png_ptr->rowbytes + 1));
 85.3223 +     png_ptr->old_prev_row_size = png_ptr->rowbytes+1;
 85.3224 +   }
 85.3225 +
 85.3226 +   png_memset_check(png_ptr, png_ptr->prev_row, 0, png_ptr->rowbytes + 1);
 85.3227 +
 85.3228 +   png_debug1(3, "width = %lu,\n", png_ptr->width);
 85.3229 +   png_debug1(3, "height = %lu,\n", png_ptr->height);
 85.3230 +   png_debug1(3, "iwidth = %lu,\n", png_ptr->iwidth);
 85.3231 +   png_debug1(3, "num_rows = %lu\n", png_ptr->num_rows);
 85.3232 +   png_debug1(3, "rowbytes = %lu,\n", png_ptr->rowbytes);
 85.3233 +   png_debug1(3, "irowbytes = %lu,\n", png_ptr->irowbytes);
 85.3234 +
 85.3235 +   png_ptr->flags |= PNG_FLAG_ROW_INIT;
 85.3236 +}
 85.3237 +#endif /* PNG_READ_SUPPORTED */
    86.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    86.2 +++ b/libs/libpng/pngset.c	Sun Nov 01 00:36:56 2015 +0200
    86.3 @@ -0,0 +1,1293 @@
    86.4 +
    86.5 +/* pngset.c - storage of image information into info struct
    86.6 + *
    86.7 + * Last changed in libpng 1.2.30 [August 15, 2008]
    86.8 + * For conditions of distribution and use, see copyright notice in png.h
    86.9 + * Copyright (c) 1998-2008 Glenn Randers-Pehrson
   86.10 + * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
   86.11 + * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
   86.12 + *
   86.13 + * The functions here are used during reads to store data from the file
   86.14 + * into the info struct, and during writes to store application data
   86.15 + * into the info struct for writing into the file.  This abstracts the
   86.16 + * info struct and allows us to change the structure in the future.
   86.17 + */
   86.18 +
   86.19 +#define PNG_INTERNAL
   86.20 +#include "png.h"
   86.21 +#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
   86.22 +
   86.23 +#if defined(PNG_bKGD_SUPPORTED)
   86.24 +void PNGAPI
   86.25 +png_set_bKGD(png_structp png_ptr, png_infop info_ptr, png_color_16p background)
   86.26 +{
   86.27 +   png_debug1(1, "in %s storage function\n", "bKGD");
   86.28 +   if (png_ptr == NULL || info_ptr == NULL)
   86.29 +      return;
   86.30 +
   86.31 +   png_memcpy(&(info_ptr->background), background, png_sizeof(png_color_16));
   86.32 +   info_ptr->valid |= PNG_INFO_bKGD;
   86.33 +}
   86.34 +#endif
   86.35 +
   86.36 +#if defined(PNG_cHRM_SUPPORTED)
   86.37 +#ifdef PNG_FLOATING_POINT_SUPPORTED
   86.38 +void PNGAPI
   86.39 +png_set_cHRM(png_structp png_ptr, png_infop info_ptr,
   86.40 +   double white_x, double white_y, double red_x, double red_y,
   86.41 +   double green_x, double green_y, double blue_x, double blue_y)
   86.42 +{
   86.43 +   png_debug1(1, "in %s storage function\n", "cHRM");
   86.44 +   if (png_ptr == NULL || info_ptr == NULL)
   86.45 +      return;
   86.46 +   if (!(white_x || white_y || red_x || red_y || green_x || green_y ||
   86.47 +       blue_x || blue_y))
   86.48 +   {
   86.49 +      png_warning(png_ptr,
   86.50 +        "Ignoring attempt to set all-zero chromaticity values");
   86.51 +      return;
   86.52 +   }
   86.53 +   if (white_x < 0.0 || white_y < 0.0 ||
   86.54 +         red_x < 0.0 ||   red_y < 0.0 ||
   86.55 +       green_x < 0.0 || green_y < 0.0 ||
   86.56 +        blue_x < 0.0 ||  blue_y < 0.0)
   86.57 +   {
   86.58 +      png_warning(png_ptr,
   86.59 +        "Ignoring attempt to set negative chromaticity value");
   86.60 +      return;
   86.61 +   }
   86.62 +   if (white_x > 21474.83 || white_y > 21474.83 ||
   86.63 +         red_x > 21474.83 ||   red_y > 21474.83 ||
   86.64 +       green_x > 21474.83 || green_y > 21474.83 ||
   86.65 +        blue_x > 21474.83 ||  blue_y > 21474.83)
   86.66 +   {
   86.67 +      png_warning(png_ptr,
   86.68 +        "Ignoring attempt to set chromaticity value exceeding 21474.83");
   86.69 +      return;
   86.70 +   }
   86.71 +
   86.72 +   info_ptr->x_white = (float)white_x;
   86.73 +   info_ptr->y_white = (float)white_y;
   86.74 +   info_ptr->x_red   = (float)red_x;
   86.75 +   info_ptr->y_red   = (float)red_y;
   86.76 +   info_ptr->x_green = (float)green_x;
   86.77 +   info_ptr->y_green = (float)green_y;
   86.78 +   info_ptr->x_blue  = (float)blue_x;
   86.79 +   info_ptr->y_blue  = (float)blue_y;
   86.80 +#ifdef PNG_FIXED_POINT_SUPPORTED
   86.81 +   info_ptr->int_x_white = (png_fixed_point)(white_x*100000.+0.5);
   86.82 +   info_ptr->int_y_white = (png_fixed_point)(white_y*100000.+0.5);
   86.83 +   info_ptr->int_x_red   = (png_fixed_point)(  red_x*100000.+0.5);
   86.84 +   info_ptr->int_y_red   = (png_fixed_point)(  red_y*100000.+0.5);
   86.85 +   info_ptr->int_x_green = (png_fixed_point)(green_x*100000.+0.5);
   86.86 +   info_ptr->int_y_green = (png_fixed_point)(green_y*100000.+0.5);
   86.87 +   info_ptr->int_x_blue  = (png_fixed_point)( blue_x*100000.+0.5);
   86.88 +   info_ptr->int_y_blue  = (png_fixed_point)( blue_y*100000.+0.5);
   86.89 +#endif
   86.90 +   info_ptr->valid |= PNG_INFO_cHRM;
   86.91 +}
   86.92 +#endif
   86.93 +#ifdef PNG_FIXED_POINT_SUPPORTED
   86.94 +void PNGAPI
   86.95 +png_set_cHRM_fixed(png_structp png_ptr, png_infop info_ptr,
   86.96 +   png_fixed_point white_x, png_fixed_point white_y, png_fixed_point red_x,
   86.97 +   png_fixed_point red_y, png_fixed_point green_x, png_fixed_point green_y,
   86.98 +   png_fixed_point blue_x, png_fixed_point blue_y)
   86.99 +{
  86.100 +   png_debug1(1, "in %s storage function\n", "cHRM");
  86.101 +   if (png_ptr == NULL || info_ptr == NULL)
  86.102 +      return;
  86.103 +
  86.104 +   if (!(white_x || white_y || red_x || red_y || green_x || green_y ||
  86.105 +       blue_x || blue_y))
  86.106 +   {
  86.107 +      png_warning(png_ptr,
  86.108 +        "Ignoring attempt to set all-zero chromaticity values");
  86.109 +      return;
  86.110 +   }
  86.111 +   if (white_x < 0 || white_y < 0 ||
  86.112 +         red_x < 0 ||   red_y < 0 ||
  86.113 +       green_x < 0 || green_y < 0 ||
  86.114 +        blue_x < 0 ||  blue_y < 0)
  86.115 +   {
  86.116 +      png_warning(png_ptr,
  86.117 +        "Ignoring attempt to set negative chromaticity value");
  86.118 +      return;
  86.119 +   }
  86.120 +   if (white_x > (png_fixed_point) PNG_UINT_31_MAX ||
  86.121 +       white_y > (png_fixed_point) PNG_UINT_31_MAX ||
  86.122 +         red_x > (png_fixed_point) PNG_UINT_31_MAX ||
  86.123 +         red_y > (png_fixed_point) PNG_UINT_31_MAX ||
  86.124 +       green_x > (png_fixed_point) PNG_UINT_31_MAX ||
  86.125 +       green_y > (png_fixed_point) PNG_UINT_31_MAX ||
  86.126 +        blue_x > (png_fixed_point) PNG_UINT_31_MAX ||
  86.127 +        blue_y > (png_fixed_point) PNG_UINT_31_MAX )
  86.128 +   {
  86.129 +      png_warning(png_ptr,
  86.130 +        "Ignoring attempt to set chromaticity value exceeding 21474.83");
  86.131 +      return;
  86.132 +   }
  86.133 +   info_ptr->int_x_white = white_x;
  86.134 +   info_ptr->int_y_white = white_y;
  86.135 +   info_ptr->int_x_red   = red_x;
  86.136 +   info_ptr->int_y_red   = red_y;
  86.137 +   info_ptr->int_x_green = green_x;
  86.138 +   info_ptr->int_y_green = green_y;
  86.139 +   info_ptr->int_x_blue  = blue_x;
  86.140 +   info_ptr->int_y_blue  = blue_y;
  86.141 +#ifdef PNG_FLOATING_POINT_SUPPORTED
  86.142 +   info_ptr->x_white = (float)(white_x/100000.);
  86.143 +   info_ptr->y_white = (float)(white_y/100000.);
  86.144 +   info_ptr->x_red   = (float)(  red_x/100000.);
  86.145 +   info_ptr->y_red   = (float)(  red_y/100000.);
  86.146 +   info_ptr->x_green = (float)(green_x/100000.);
  86.147 +   info_ptr->y_green = (float)(green_y/100000.);
  86.148 +   info_ptr->x_blue  = (float)( blue_x/100000.);
  86.149 +   info_ptr->y_blue  = (float)( blue_y/100000.);
  86.150 +#endif
  86.151 +   info_ptr->valid |= PNG_INFO_cHRM;
  86.152 +}
  86.153 +#endif
  86.154 +#endif
  86.155 +
  86.156 +#if defined(PNG_gAMA_SUPPORTED)
  86.157 +#ifdef PNG_FLOATING_POINT_SUPPORTED
  86.158 +void PNGAPI
  86.159 +png_set_gAMA(png_structp png_ptr, png_infop info_ptr, double file_gamma)
  86.160 +{
  86.161 +   double gamma;
  86.162 +   png_debug1(1, "in %s storage function\n", "gAMA");
  86.163 +   if (png_ptr == NULL || info_ptr == NULL)
  86.164 +      return;
  86.165 +
  86.166 +   /* Check for overflow */
  86.167 +   if (file_gamma > 21474.83)
  86.168 +   {
  86.169 +      png_warning(png_ptr, "Limiting gamma to 21474.83");
  86.170 +      gamma=21474.83;
  86.171 +   }
  86.172 +   else
  86.173 +      gamma = file_gamma;
  86.174 +   info_ptr->gamma = (float)gamma;
  86.175 +#ifdef PNG_FIXED_POINT_SUPPORTED
  86.176 +   info_ptr->int_gamma = (int)(gamma*100000.+.5);
  86.177 +#endif
  86.178 +   info_ptr->valid |= PNG_INFO_gAMA;
  86.179 +   if (gamma == 0.0)
  86.180 +      png_warning(png_ptr, "Setting gamma=0");
  86.181 +}
  86.182 +#endif
  86.183 +void PNGAPI
  86.184 +png_set_gAMA_fixed(png_structp png_ptr, png_infop info_ptr, png_fixed_point
  86.185 +   int_gamma)
  86.186 +{
  86.187 +   png_fixed_point gamma;
  86.188 +
  86.189 +   png_debug1(1, "in %s storage function\n", "gAMA");
  86.190 +   if (png_ptr == NULL || info_ptr == NULL)
  86.191 +      return;
  86.192 +
  86.193 +   if (int_gamma > (png_fixed_point) PNG_UINT_31_MAX)
  86.194 +   {
  86.195 +     png_warning(png_ptr, "Limiting gamma to 21474.83");
  86.196 +     gamma=PNG_UINT_31_MAX;
  86.197 +   }
  86.198 +   else
  86.199 +   {
  86.200 +     if (int_gamma < 0)
  86.201 +     {
  86.202 +       png_warning(png_ptr, "Setting negative gamma to zero");
  86.203 +       gamma = 0;
  86.204 +     }
  86.205 +     else
  86.206 +       gamma = int_gamma;
  86.207 +   }
  86.208 +#ifdef PNG_FLOATING_POINT_SUPPORTED
  86.209 +   info_ptr->gamma = (float)(gamma/100000.);
  86.210 +#endif
  86.211 +#ifdef PNG_FIXED_POINT_SUPPORTED
  86.212 +   info_ptr->int_gamma = gamma;
  86.213 +#endif
  86.214 +   info_ptr->valid |= PNG_INFO_gAMA;
  86.215 +   if (gamma == 0)
  86.216 +      png_warning(png_ptr, "Setting gamma=0");
  86.217 +}
  86.218 +#endif
  86.219 +
  86.220 +#if defined(PNG_hIST_SUPPORTED)
  86.221 +void PNGAPI
  86.222 +png_set_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_16p hist)
  86.223 +{
  86.224 +   int i;
  86.225 +
  86.226 +   png_debug1(1, "in %s storage function\n", "hIST");
  86.227 +   if (png_ptr == NULL || info_ptr == NULL)
  86.228 +      return;
  86.229 +   if (info_ptr->num_palette == 0 || info_ptr->num_palette
  86.230 +       > PNG_MAX_PALETTE_LENGTH)
  86.231 +   {
  86.232 +       png_warning(png_ptr,
  86.233 +          "Invalid palette size, hIST allocation skipped.");
  86.234 +       return;
  86.235 +   }
  86.236 +
  86.237 +#ifdef PNG_FREE_ME_SUPPORTED
  86.238 +   png_free_data(png_ptr, info_ptr, PNG_FREE_HIST, 0);
  86.239 +#endif
  86.240 +   /* Changed from info->num_palette to PNG_MAX_PALETTE_LENGTH in version
  86.241 +      1.2.1 */
  86.242 +   png_ptr->hist = (png_uint_16p)png_malloc_warn(png_ptr,
  86.243 +      (png_uint_32)(PNG_MAX_PALETTE_LENGTH * png_sizeof(png_uint_16)));
  86.244 +   if (png_ptr->hist == NULL)
  86.245 +     {
  86.246 +       png_warning(png_ptr, "Insufficient memory for hIST chunk data.");
  86.247 +       return;
  86.248 +     }
  86.249 +
  86.250 +   for (i = 0; i < info_ptr->num_palette; i++)
  86.251 +       png_ptr->hist[i] = hist[i];
  86.252 +   info_ptr->hist = png_ptr->hist;
  86.253 +   info_ptr->valid |= PNG_INFO_hIST;
  86.254 +
  86.255 +#ifdef PNG_FREE_ME_SUPPORTED
  86.256 +   info_ptr->free_me |= PNG_FREE_HIST;
  86.257 +#else
  86.258 +   png_ptr->flags |= PNG_FLAG_FREE_HIST;
  86.259 +#endif
  86.260 +}
  86.261 +#endif
  86.262 +
  86.263 +void PNGAPI
  86.264 +png_set_IHDR(png_structp png_ptr, png_infop info_ptr,
  86.265 +   png_uint_32 width, png_uint_32 height, int bit_depth,
  86.266 +   int color_type, int interlace_type, int compression_type,
  86.267 +   int filter_type)
  86.268 +{
  86.269 +   png_debug1(1, "in %s storage function\n", "IHDR");
  86.270 +   if (png_ptr == NULL || info_ptr == NULL)
  86.271 +      return;
  86.272 +
  86.273 +   /* check for width and height valid values */
  86.274 +   if (width == 0 || height == 0)
  86.275 +      png_error(png_ptr, "Image width or height is zero in IHDR");
  86.276 +#ifdef PNG_SET_USER_LIMITS_SUPPORTED
  86.277 +   if (width > png_ptr->user_width_max || height > png_ptr->user_height_max)
  86.278 +      png_error(png_ptr, "image size exceeds user limits in IHDR");
  86.279 +#else
  86.280 +   if (width > PNG_USER_WIDTH_MAX || height > PNG_USER_HEIGHT_MAX)
  86.281 +      png_error(png_ptr, "image size exceeds user limits in IHDR");
  86.282 +#endif
  86.283 +   if (width > PNG_UINT_31_MAX || height > PNG_UINT_31_MAX)
  86.284 +      png_error(png_ptr, "Invalid image size in IHDR");
  86.285 +   if ( width > (PNG_UINT_32_MAX
  86.286 +                 >> 3)      /* 8-byte RGBA pixels */
  86.287 +                 - 64       /* bigrowbuf hack */
  86.288 +                 - 1        /* filter byte */
  86.289 +                 - 7*8      /* rounding of width to multiple of 8 pixels */
  86.290 +                 - 8)       /* extra max_pixel_depth pad */
  86.291 +      png_warning(png_ptr, "Width is too large for libpng to process pixels");
  86.292 +
  86.293 +   /* check other values */
  86.294 +   if (bit_depth != 1 && bit_depth != 2 && bit_depth != 4 &&
  86.295 +      bit_depth != 8 && bit_depth != 16)
  86.296 +      png_error(png_ptr, "Invalid bit depth in IHDR");
  86.297 +
  86.298 +   if (color_type < 0 || color_type == 1 ||
  86.299 +      color_type == 5 || color_type > 6)
  86.300 +      png_error(png_ptr, "Invalid color type in IHDR");
  86.301 +
  86.302 +   if (((color_type == PNG_COLOR_TYPE_PALETTE) && bit_depth > 8) ||
  86.303 +       ((color_type == PNG_COLOR_TYPE_RGB ||
  86.304 +         color_type == PNG_COLOR_TYPE_GRAY_ALPHA ||
  86.305 +         color_type == PNG_COLOR_TYPE_RGB_ALPHA) && bit_depth < 8))
  86.306 +      png_error(png_ptr, "Invalid color type/bit depth combination in IHDR");
  86.307 +
  86.308 +   if (interlace_type >= PNG_INTERLACE_LAST)
  86.309 +      png_error(png_ptr, "Unknown interlace method in IHDR");
  86.310 +
  86.311 +   if (compression_type != PNG_COMPRESSION_TYPE_BASE)
  86.312 +      png_error(png_ptr, "Unknown compression method in IHDR");
  86.313 +
  86.314 +#if defined(PNG_MNG_FEATURES_SUPPORTED)
  86.315 +   /* Accept filter_method 64 (intrapixel differencing) only if
  86.316 +    * 1. Libpng was compiled with PNG_MNG_FEATURES_SUPPORTED and
  86.317 +    * 2. Libpng did not read a PNG signature (this filter_method is only
  86.318 +    *    used in PNG datastreams that are embedded in MNG datastreams) and
  86.319 +    * 3. The application called png_permit_mng_features with a mask that
  86.320 +    *    included PNG_FLAG_MNG_FILTER_64 and
  86.321 +    * 4. The filter_method is 64 and
  86.322 +    * 5. The color_type is RGB or RGBA
  86.323 +    */
  86.324 +   if ((png_ptr->mode&PNG_HAVE_PNG_SIGNATURE)&&png_ptr->mng_features_permitted)
  86.325 +      png_warning(png_ptr, "MNG features are not allowed in a PNG datastream");
  86.326 +   if (filter_type != PNG_FILTER_TYPE_BASE)
  86.327 +   {
  86.328 +     if (!((png_ptr->mng_features_permitted & PNG_FLAG_MNG_FILTER_64) &&
  86.329 +        (filter_type == PNG_INTRAPIXEL_DIFFERENCING) &&
  86.330 +        ((png_ptr->mode&PNG_HAVE_PNG_SIGNATURE) == 0) &&
  86.331 +        (color_type == PNG_COLOR_TYPE_RGB ||
  86.332 +         color_type == PNG_COLOR_TYPE_RGB_ALPHA)))
  86.333 +        png_error(png_ptr, "Unknown filter method in IHDR");
  86.334 +     if (png_ptr->mode&PNG_HAVE_PNG_SIGNATURE)
  86.335 +        png_warning(png_ptr, "Invalid filter method in IHDR");
  86.336 +   }
  86.337 +#else
  86.338 +   if (filter_type != PNG_FILTER_TYPE_BASE)
  86.339 +      png_error(png_ptr, "Unknown filter method in IHDR");
  86.340 +#endif
  86.341 +
  86.342 +   info_ptr->width = width;
  86.343 +   info_ptr->height = height;
  86.344 +   info_ptr->bit_depth = (png_byte)bit_depth;
  86.345 +   info_ptr->color_type =(png_byte) color_type;
  86.346 +   info_ptr->compression_type = (png_byte)compression_type;
  86.347 +   info_ptr->filter_type = (png_byte)filter_type;
  86.348 +   info_ptr->interlace_type = (png_byte)interlace_type;
  86.349 +   if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
  86.350 +      info_ptr->channels = 1;
  86.351 +   else if (info_ptr->color_type & PNG_COLOR_MASK_COLOR)
  86.352 +      info_ptr->channels = 3;
  86.353 +   else
  86.354 +      info_ptr->channels = 1;
  86.355 +   if (info_ptr->color_type & PNG_COLOR_MASK_ALPHA)
  86.356 +      info_ptr->channels++;
  86.357 +   info_ptr->pixel_depth = (png_byte)(info_ptr->channels * info_ptr->bit_depth);
  86.358 +
  86.359 +   /* check for potential overflow */
  86.360 +   if (width > (PNG_UINT_32_MAX
  86.361 +                 >> 3)      /* 8-byte RGBA pixels */
  86.362 +                 - 64       /* bigrowbuf hack */
  86.363 +                 - 1        /* filter byte */
  86.364 +                 - 7*8      /* rounding of width to multiple of 8 pixels */
  86.365 +                 - 8)       /* extra max_pixel_depth pad */
  86.366 +      info_ptr->rowbytes = (png_size_t)0;
  86.367 +   else
  86.368 +      info_ptr->rowbytes = PNG_ROWBYTES(info_ptr->pixel_depth, width);
  86.369 +}
  86.370 +
  86.371 +#if defined(PNG_oFFs_SUPPORTED)
  86.372 +void PNGAPI
  86.373 +png_set_oFFs(png_structp png_ptr, png_infop info_ptr,
  86.374 +   png_int_32 offset_x, png_int_32 offset_y, int unit_type)
  86.375 +{
  86.376 +   png_debug1(1, "in %s storage function\n", "oFFs");
  86.377 +   if (png_ptr == NULL || info_ptr == NULL)
  86.378 +      return;
  86.379 +
  86.380 +   info_ptr->x_offset = offset_x;
  86.381 +   info_ptr->y_offset = offset_y;
  86.382 +   info_ptr->offset_unit_type = (png_byte)unit_type;
  86.383 +   info_ptr->valid |= PNG_INFO_oFFs;
  86.384 +}
  86.385 +#endif
  86.386 +
  86.387 +#if defined(PNG_pCAL_SUPPORTED)
  86.388 +void PNGAPI
  86.389 +png_set_pCAL(png_structp png_ptr, png_infop info_ptr,
  86.390 +   png_charp purpose, png_int_32 X0, png_int_32 X1, int type, int nparams,
  86.391 +   png_charp units, png_charpp params)
  86.392 +{
  86.393 +   png_uint_32 length;
  86.394 +   int i;
  86.395 +
  86.396 +   png_debug1(1, "in %s storage function\n", "pCAL");
  86.397 +   if (png_ptr == NULL || info_ptr == NULL)
  86.398 +      return;
  86.399 +
  86.400 +   length = png_strlen(purpose) + 1;
  86.401 +   png_debug1(3, "allocating purpose for info (%lu bytes)\n",
  86.402 +     (unsigned long)length);
  86.403 +   info_ptr->pcal_purpose = (png_charp)png_malloc_warn(png_ptr, length);
  86.404 +   if (info_ptr->pcal_purpose == NULL)
  86.405 +   {
  86.406 +       png_warning(png_ptr, "Insufficient memory for pCAL purpose.");
  86.407 +      return;
  86.408 +   }
  86.409 +   png_memcpy(info_ptr->pcal_purpose, purpose, (png_size_t)length);
  86.410 +
  86.411 +   png_debug(3, "storing X0, X1, type, and nparams in info\n");
  86.412 +   info_ptr->pcal_X0 = X0;
  86.413 +   info_ptr->pcal_X1 = X1;
  86.414 +   info_ptr->pcal_type = (png_byte)type;
  86.415 +   info_ptr->pcal_nparams = (png_byte)nparams;
  86.416 +
  86.417 +   length = png_strlen(units) + 1;
  86.418 +   png_debug1(3, "allocating units for info (%lu bytes)\n",
  86.419 +     (unsigned long)length);
  86.420 +   info_ptr->pcal_units = (png_charp)png_malloc_warn(png_ptr, length);
  86.421 +   if (info_ptr->pcal_units == NULL)
  86.422 +   {
  86.423 +       png_warning(png_ptr, "Insufficient memory for pCAL units.");
  86.424 +      return;
  86.425 +   }
  86.426 +   png_memcpy(info_ptr->pcal_units, units, (png_size_t)length);
  86.427 +
  86.428 +   info_ptr->pcal_params = (png_charpp)png_malloc_warn(png_ptr,
  86.429 +      (png_uint_32)((nparams + 1) * png_sizeof(png_charp)));
  86.430 +   if (info_ptr->pcal_params == NULL)
  86.431 +   {
  86.432 +       png_warning(png_ptr, "Insufficient memory for pCAL params.");
  86.433 +      return;
  86.434 +   }
  86.435 +
  86.436 +   info_ptr->pcal_params[nparams] = NULL;
  86.437 +
  86.438 +   for (i = 0; i < nparams; i++)
  86.439 +   {
  86.440 +      length = png_strlen(params[i]) + 1;
  86.441 +      png_debug2(3, "allocating parameter %d for info (%lu bytes)\n", i,
  86.442 +        (unsigned long)length);
  86.443 +      info_ptr->pcal_params[i] = (png_charp)png_malloc_warn(png_ptr, length);
  86.444 +      if (info_ptr->pcal_params[i] == NULL)
  86.445 +      {
  86.446 +          png_warning(png_ptr, "Insufficient memory for pCAL parameter.");
  86.447 +          return;
  86.448 +      }
  86.449 +      png_memcpy(info_ptr->pcal_params[i], params[i], (png_size_t)length);
  86.450 +   }
  86.451 +
  86.452 +   info_ptr->valid |= PNG_INFO_pCAL;
  86.453 +#ifdef PNG_FREE_ME_SUPPORTED
  86.454 +   info_ptr->free_me |= PNG_FREE_PCAL;
  86.455 +#endif
  86.456 +}
  86.457 +#endif
  86.458 +
  86.459 +#if defined(PNG_READ_sCAL_SUPPORTED) || defined(PNG_WRITE_sCAL_SUPPORTED)
  86.460 +#ifdef PNG_FLOATING_POINT_SUPPORTED
  86.461 +void PNGAPI
  86.462 +png_set_sCAL(png_structp png_ptr, png_infop info_ptr,
  86.463 +             int unit, double width, double height)
  86.464 +{
  86.465 +   png_debug1(1, "in %s storage function\n", "sCAL");
  86.466 +   if (png_ptr == NULL || info_ptr == NULL)
  86.467 +      return;
  86.468 +
  86.469 +   info_ptr->scal_unit = (png_byte)unit;
  86.470 +   info_ptr->scal_pixel_width = width;
  86.471 +   info_ptr->scal_pixel_height = height;
  86.472 +
  86.473 +   info_ptr->valid |= PNG_INFO_sCAL;
  86.474 +}
  86.475 +#else
  86.476 +#ifdef PNG_FIXED_POINT_SUPPORTED
  86.477 +void PNGAPI
  86.478 +png_set_sCAL_s(png_structp png_ptr, png_infop info_ptr,
  86.479 +             int unit, png_charp swidth, png_charp sheight)
  86.480 +{
  86.481 +   png_uint_32 length;
  86.482 +
  86.483 +   png_debug1(1, "in %s storage function\n", "sCAL");
  86.484 +   if (png_ptr == NULL || info_ptr == NULL)
  86.485 +      return;
  86.486 +
  86.487 +   info_ptr->scal_unit = (png_byte)unit;
  86.488 +
  86.489 +   length = png_strlen(swidth) + 1;
  86.490 +   png_debug1(3, "allocating unit for info (%u bytes)\n",
  86.491 +      (unsigned int)length);
  86.492 +   info_ptr->scal_s_width = (png_charp)png_malloc_warn(png_ptr, length);
  86.493 +   if (info_ptr->scal_s_width == NULL)
  86.494 +   {
  86.495 +      png_warning(png_ptr,
  86.496 +       "Memory allocation failed while processing sCAL.");
  86.497 +      return;
  86.498 +   }
  86.499 +   png_memcpy(info_ptr->scal_s_width, swidth, (png_size_t)length);
  86.500 +
  86.501 +   length = png_strlen(sheight) + 1;
  86.502 +   png_debug1(3, "allocating unit for info (%u bytes)\n",
  86.503 +      (unsigned int)length);
  86.504 +   info_ptr->scal_s_height = (png_charp)png_malloc_warn(png_ptr, length);
  86.505 +   if (info_ptr->scal_s_height == NULL)
  86.506 +   {
  86.507 +      png_free (png_ptr, info_ptr->scal_s_width);
  86.508 +      info_ptr->scal_s_width = NULL;
  86.509 +      png_warning(png_ptr,
  86.510 +       "Memory allocation failed while processing sCAL.");
  86.511 +      return;
  86.512 +   }
  86.513 +   png_memcpy(info_ptr->scal_s_height, sheight, (png_size_t)length);
  86.514 +   info_ptr->valid |= PNG_INFO_sCAL;
  86.515 +#ifdef PNG_FREE_ME_SUPPORTED
  86.516 +   info_ptr->free_me |= PNG_FREE_SCAL;
  86.517 +#endif
  86.518 +}
  86.519 +#endif
  86.520 +#endif
  86.521 +#endif
  86.522 +
  86.523 +#if defined(PNG_pHYs_SUPPORTED)
  86.524 +void PNGAPI
  86.525 +png_set_pHYs(png_structp png_ptr, png_infop info_ptr,
  86.526 +   png_uint_32 res_x, png_uint_32 res_y, int unit_type)
  86.527 +{
  86.528 +   png_debug1(1, "in %s storage function\n", "pHYs");
  86.529 +   if (png_ptr == NULL || info_ptr == NULL)
  86.530 +      return;
  86.531 +
  86.532 +   info_ptr->x_pixels_per_unit = res_x;
  86.533 +   info_ptr->y_pixels_per_unit = res_y;
  86.534 +   info_ptr->phys_unit_type = (png_byte)unit_type;
  86.535 +   info_ptr->valid |= PNG_INFO_pHYs;
  86.536 +}
  86.537 +#endif
  86.538 +
  86.539 +void PNGAPI
  86.540 +png_set_PLTE(png_structp png_ptr, png_infop info_ptr,
  86.541 +   png_colorp palette, int num_palette)
  86.542 +{
  86.543 +
  86.544 +   png_debug1(1, "in %s storage function\n", "PLTE");
  86.545 +   if (png_ptr == NULL || info_ptr == NULL)
  86.546 +      return;
  86.547 +
  86.548 +   if (num_palette < 0 || num_palette > PNG_MAX_PALETTE_LENGTH)
  86.549 +     {
  86.550 +       if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
  86.551 +         png_error(png_ptr, "Invalid palette length");
  86.552 +       else
  86.553 +       {
  86.554 +         png_warning(png_ptr, "Invalid palette length");
  86.555 +         return;
  86.556 +       }
  86.557 +     }
  86.558 +
  86.559 +   /*
  86.560 +    * It may not actually be necessary to set png_ptr->palette here;
  86.561 +    * we do it for backward compatibility with the way the png_handle_tRNS
  86.562 +    * function used to do the allocation.
  86.563 +    */
  86.564 +#ifdef PNG_FREE_ME_SUPPORTED
  86.565 +   png_free_data(png_ptr, info_ptr, PNG_FREE_PLTE, 0);
  86.566 +#endif
  86.567 +
  86.568 +   /* Changed in libpng-1.2.1 to allocate PNG_MAX_PALETTE_LENGTH instead
  86.569 +      of num_palette entries,
  86.570 +      in case of an invalid PNG file that has too-large sample values. */
  86.571 +   png_ptr->palette = (png_colorp)png_malloc(png_ptr,
  86.572 +      PNG_MAX_PALETTE_LENGTH * png_sizeof(png_color));
  86.573 +   png_memset(png_ptr->palette, 0, PNG_MAX_PALETTE_LENGTH *
  86.574 +      png_sizeof(png_color));
  86.575 +   png_memcpy(png_ptr->palette, palette, num_palette * png_sizeof(png_color));
  86.576 +   info_ptr->palette = png_ptr->palette;
  86.577 +   info_ptr->num_palette = png_ptr->num_palette = (png_uint_16)num_palette;
  86.578 +
  86.579 +#ifdef PNG_FREE_ME_SUPPORTED
  86.580 +   info_ptr->free_me |= PNG_FREE_PLTE;
  86.581 +#else
  86.582 +   png_ptr->flags |= PNG_FLAG_FREE_PLTE;
  86.583 +#endif
  86.584 +
  86.585 +   info_ptr->valid |= PNG_INFO_PLTE;
  86.586 +}
  86.587 +
  86.588 +#if defined(PNG_sBIT_SUPPORTED)
  86.589 +void PNGAPI
  86.590 +png_set_sBIT(png_structp png_ptr, png_infop info_ptr,
  86.591 +   png_color_8p sig_bit)
  86.592 +{
  86.593 +   png_debug1(1, "in %s storage function\n", "sBIT");
  86.594 +   if (png_ptr == NULL || info_ptr == NULL)
  86.595 +      return;
  86.596 +
  86.597 +   png_memcpy(&(info_ptr->sig_bit), sig_bit, png_sizeof(png_color_8));
  86.598 +   info_ptr->valid |= PNG_INFO_sBIT;
  86.599 +}
  86.600 +#endif
  86.601 +
  86.602 +#if defined(PNG_sRGB_SUPPORTED)
  86.603 +void PNGAPI
  86.604 +png_set_sRGB(png_structp png_ptr, png_infop info_ptr, int intent)
  86.605 +{
  86.606 +   png_debug1(1, "in %s storage function\n", "sRGB");
  86.607 +   if (png_ptr == NULL || info_ptr == NULL)
  86.608 +      return;
  86.609 +
  86.610 +   info_ptr->srgb_intent = (png_byte)intent;
  86.611 +   info_ptr->valid |= PNG_INFO_sRGB;
  86.612 +}
  86.613 +
  86.614 +void PNGAPI
  86.615 +png_set_sRGB_gAMA_and_cHRM(png_structp png_ptr, png_infop info_ptr,
  86.616 +   int intent)
  86.617 +{
  86.618 +#if defined(PNG_gAMA_SUPPORTED)
  86.619 +#ifdef PNG_FLOATING_POINT_SUPPORTED
  86.620 +   float file_gamma;
  86.621 +#endif
  86.622 +#ifdef PNG_FIXED_POINT_SUPPORTED
  86.623 +   png_fixed_point int_file_gamma;
  86.624 +#endif
  86.625 +#endif
  86.626 +#if defined(PNG_cHRM_SUPPORTED)
  86.627 +#ifdef PNG_FLOATING_POINT_SUPPORTED
  86.628 +   float white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y;
  86.629 +#endif
  86.630 +#ifdef PNG_FIXED_POINT_SUPPORTED
  86.631 +   png_fixed_point int_white_x, int_white_y, int_red_x, int_red_y, int_green_x,
  86.632 +      int_green_y, int_blue_x, int_blue_y;
  86.633 +#endif
  86.634 +#endif
  86.635 +   png_debug1(1, "in %s storage function\n", "sRGB_gAMA_and_cHRM");
  86.636 +   if (png_ptr == NULL || info_ptr == NULL)
  86.637 +      return;
  86.638 +
  86.639 +   png_set_sRGB(png_ptr, info_ptr, intent);
  86.640 +
  86.641 +#if defined(PNG_gAMA_SUPPORTED)
  86.642 +#ifdef PNG_FLOATING_POINT_SUPPORTED
  86.643 +   file_gamma = (float).45455;
  86.644 +   png_set_gAMA(png_ptr, info_ptr, file_gamma);
  86.645 +#endif
  86.646 +#ifdef PNG_FIXED_POINT_SUPPORTED
  86.647 +   int_file_gamma = 45455L;
  86.648 +   png_set_gAMA_fixed(png_ptr, info_ptr, int_file_gamma);
  86.649 +#endif
  86.650 +#endif
  86.651 +
  86.652 +#if defined(PNG_cHRM_SUPPORTED)
  86.653 +#ifdef PNG_FIXED_POINT_SUPPORTED
  86.654 +   int_white_x = 31270L;
  86.655 +   int_white_y = 32900L;
  86.656 +   int_red_x   = 64000L;
  86.657 +   int_red_y   = 33000L;
  86.658 +   int_green_x = 30000L;
  86.659 +   int_green_y = 60000L;
  86.660 +   int_blue_x  = 15000L;
  86.661 +   int_blue_y  =  6000L;
  86.662 +
  86.663 +   png_set_cHRM_fixed(png_ptr, info_ptr,
  86.664 +      int_white_x, int_white_y, int_red_x, int_red_y, int_green_x, int_green_y,
  86.665 +      int_blue_x, int_blue_y);
  86.666 +#endif
  86.667 +#ifdef PNG_FLOATING_POINT_SUPPORTED
  86.668 +   white_x = (float).3127;
  86.669 +   white_y = (float).3290;
  86.670 +   red_x   = (float).64;
  86.671 +   red_y   = (float).33;
  86.672 +   green_x = (float).30;
  86.673 +   green_y = (float).60;
  86.674 +   blue_x  = (float).15;
  86.675 +   blue_y  = (float).06;
  86.676 +
  86.677 +   png_set_cHRM(png_ptr, info_ptr,
  86.678 +      white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y);
  86.679 +#endif
  86.680 +#endif
  86.681 +}
  86.682 +#endif
  86.683 +
  86.684 +
  86.685 +#if defined(PNG_iCCP_SUPPORTED)
  86.686 +void PNGAPI
  86.687 +png_set_iCCP(png_structp png_ptr, png_infop info_ptr,
  86.688 +             png_charp name, int compression_type,
  86.689 +             png_charp profile, png_uint_32 proflen)
  86.690 +{
  86.691 +   png_charp new_iccp_name;
  86.692 +   png_charp new_iccp_profile;
  86.693 +   png_uint_32 length;
  86.694 +
  86.695 +   png_debug1(1, "in %s storage function\n", "iCCP");
  86.696 +   if (png_ptr == NULL || info_ptr == NULL || name == NULL || profile == NULL)
  86.697 +      return;
  86.698 +
  86.699 +   length = png_strlen(name)+1;
  86.700 +   new_iccp_name = (png_charp)png_malloc_warn(png_ptr, length);
  86.701 +   if (new_iccp_name == NULL)
  86.702 +   {
  86.703 +      png_warning(png_ptr, "Insufficient memory to process iCCP chunk.");
  86.704 +      return;
  86.705 +   }
  86.706 +   png_memcpy(new_iccp_name, name, length);
  86.707 +   new_iccp_profile = (png_charp)png_malloc_warn(png_ptr, proflen);
  86.708 +   if (new_iccp_profile == NULL)
  86.709 +   {
  86.710 +      png_free (png_ptr, new_iccp_name);
  86.711 +      png_warning(png_ptr,
  86.712 +      "Insufficient memory to process iCCP profile.");
  86.713 +      return;
  86.714 +   }
  86.715 +   png_memcpy(new_iccp_profile, profile, (png_size_t)proflen);
  86.716 +
  86.717 +   png_free_data(png_ptr, info_ptr, PNG_FREE_ICCP, 0);
  86.718 +
  86.719 +   info_ptr->iccp_proflen = proflen;
  86.720 +   info_ptr->iccp_name = new_iccp_name;
  86.721 +   info_ptr->iccp_profile = new_iccp_profile;
  86.722 +   /* Compression is always zero but is here so the API and info structure
  86.723 +    * does not have to change if we introduce multiple compression types */
  86.724 +   info_ptr->iccp_compression = (png_byte)compression_type;
  86.725 +#ifdef PNG_FREE_ME_SUPPORTED
  86.726 +   info_ptr->free_me |= PNG_FREE_ICCP;
  86.727 +#endif
  86.728 +   info_ptr->valid |= PNG_INFO_iCCP;
  86.729 +}
  86.730 +#endif
  86.731 +
  86.732 +#if defined(PNG_TEXT_SUPPORTED)
  86.733 +void PNGAPI
  86.734 +png_set_text(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr,
  86.735 +   int num_text)
  86.736 +{
  86.737 +   int ret;
  86.738 +   ret = png_set_text_2(png_ptr, info_ptr, text_ptr, num_text);
  86.739 +   if (ret)
  86.740 +     png_error(png_ptr, "Insufficient memory to store text");
  86.741 +}
  86.742 +
  86.743 +int /* PRIVATE */
  86.744 +png_set_text_2(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr,
  86.745 +   int num_text)
  86.746 +{
  86.747 +   int i;
  86.748 +
  86.749 +   png_debug1(1, "in %s storage function\n", (png_ptr->chunk_name[0] == '\0' ?
  86.750 +      "text" : (png_const_charp)png_ptr->chunk_name));
  86.751 +
  86.752 +   if (png_ptr == NULL || info_ptr == NULL || num_text == 0)
  86.753 +      return(0);
  86.754 +
  86.755 +   /* Make sure we have enough space in the "text" array in info_struct
  86.756 +    * to hold all of the incoming text_ptr objects.
  86.757 +    */
  86.758 +   if (info_ptr->num_text + num_text > info_ptr->max_text)
  86.759 +   {
  86.760 +      if (info_ptr->text != NULL)
  86.761 +      {
  86.762 +         png_textp old_text;
  86.763 +         int old_max;
  86.764 +
  86.765 +         old_max = info_ptr->max_text;
  86.766 +         info_ptr->max_text = info_ptr->num_text + num_text + 8;
  86.767 +         old_text = info_ptr->text;
  86.768 +         info_ptr->text = (png_textp)png_malloc_warn(png_ptr,
  86.769 +            (png_uint_32)(info_ptr->max_text * png_sizeof(png_text)));
  86.770 +         if (info_ptr->text == NULL)
  86.771 +           {
  86.772 +             png_free(png_ptr, old_text);
  86.773 +             return(1);
  86.774 +           }
  86.775 +         png_memcpy(info_ptr->text, old_text, (png_size_t)(old_max *
  86.776 +            png_sizeof(png_text)));
  86.777 +         png_free(png_ptr, old_text);
  86.778 +      }
  86.779 +      else
  86.780 +      {
  86.781 +         info_ptr->max_text = num_text + 8;
  86.782 +         info_ptr->num_text = 0;
  86.783 +         info_ptr->text = (png_textp)png_malloc_warn(png_ptr,
  86.784 +            (png_uint_32)(info_ptr->max_text * png_sizeof(png_text)));
  86.785 +         if (info_ptr->text == NULL)
  86.786 +           return(1);
  86.787 +#ifdef PNG_FREE_ME_SUPPORTED
  86.788 +         info_ptr->free_me |= PNG_FREE_TEXT;
  86.789 +#endif
  86.790 +      }
  86.791 +      png_debug1(3, "allocated %d entries for info_ptr->text\n",
  86.792 +         info_ptr->max_text);
  86.793 +   }
  86.794 +   for (i = 0; i < num_text; i++)
  86.795 +   {
  86.796 +      png_size_t text_length, key_len;
  86.797 +      png_size_t lang_len, lang_key_len;
  86.798 +      png_textp textp = &(info_ptr->text[info_ptr->num_text]);
  86.799 +
  86.800 +      if (text_ptr[i].key == NULL)
  86.801 +          continue;
  86.802 +
  86.803 +      key_len = png_strlen(text_ptr[i].key);
  86.804 +
  86.805 +      if (text_ptr[i].compression <= 0)
  86.806 +      {
  86.807 +        lang_len = 0;
  86.808 +        lang_key_len = 0;
  86.809 +      }
  86.810 +      else
  86.811 +#ifdef PNG_iTXt_SUPPORTED
  86.812 +      {
  86.813 +        /* set iTXt data */
  86.814 +        if (text_ptr[i].lang != NULL)
  86.815 +          lang_len = png_strlen(text_ptr[i].lang);
  86.816 +        else
  86.817 +          lang_len = 0;
  86.818 +        if (text_ptr[i].lang_key != NULL)
  86.819 +          lang_key_len = png_strlen(text_ptr[i].lang_key);
  86.820 +        else
  86.821 +          lang_key_len = 0;
  86.822 +      }
  86.823 +#else
  86.824 +      {
  86.825 +        png_warning(png_ptr, "iTXt chunk not supported.");
  86.826 +        continue;
  86.827 +      }
  86.828 +#endif
  86.829 +
  86.830 +      if (text_ptr[i].text == NULL || text_ptr[i].text[0] == '\0')
  86.831 +      {
  86.832 +         text_length = 0;
  86.833 +#ifdef PNG_iTXt_SUPPORTED
  86.834 +         if (text_ptr[i].compression > 0)
  86.835 +            textp->compression = PNG_ITXT_COMPRESSION_NONE;
  86.836 +         else
  86.837 +#endif
  86.838 +            textp->compression = PNG_TEXT_COMPRESSION_NONE;
  86.839 +      }
  86.840 +      else
  86.841 +      {
  86.842 +         text_length = png_strlen(text_ptr[i].text);
  86.843 +         textp->compression = text_ptr[i].compression;
  86.844 +      }
  86.845 +
  86.846 +      textp->key = (png_charp)png_malloc_warn(png_ptr,
  86.847 +         (png_uint_32)
  86.848 +         (key_len + text_length + lang_len + lang_key_len + 4));
  86.849 +      if (textp->key == NULL)
  86.850 +        return(1);
  86.851 +      png_debug2(2, "Allocated %lu bytes at %x in png_set_text\n",
  86.852 +         (png_uint_32)
  86.853 +         (key_len + lang_len + lang_key_len + text_length + 4),
  86.854 +         (int)textp->key);
  86.855 +
  86.856 +      png_memcpy(textp->key, text_ptr[i].key,
  86.857 +         (png_size_t)(key_len));
  86.858 +      *(textp->key + key_len) = '\0';
  86.859 +#ifdef PNG_iTXt_SUPPORTED
  86.860 +      if (text_ptr[i].compression > 0)
  86.861 +      {
  86.862 +         textp->lang = textp->key + key_len + 1;
  86.863 +         png_memcpy(textp->lang, text_ptr[i].lang, lang_len);
  86.864 +         *(textp->lang + lang_len) = '\0';
  86.865 +         textp->lang_key = textp->lang + lang_len + 1;
  86.866 +         png_memcpy(textp->lang_key, text_ptr[i].lang_key, lang_key_len);
  86.867 +         *(textp->lang_key + lang_key_len) = '\0';
  86.868 +         textp->text = textp->lang_key + lang_key_len + 1;
  86.869 +      }
  86.870 +      else
  86.871 +#endif
  86.872 +      {
  86.873 +#ifdef PNG_iTXt_SUPPORTED
  86.874 +         textp->lang=NULL;
  86.875 +         textp->lang_key=NULL;
  86.876 +#endif
  86.877 +         textp->text = textp->key + key_len + 1;
  86.878 +      }
  86.879 +      if (text_length)
  86.880 +         png_memcpy(textp->text, text_ptr[i].text,
  86.881 +            (png_size_t)(text_length));
  86.882 +      *(textp->text + text_length) = '\0';
  86.883 +
  86.884 +#ifdef PNG_iTXt_SUPPORTED
  86.885 +      if (textp->compression > 0)
  86.886 +      {
  86.887 +         textp->text_length = 0;
  86.888 +         textp->itxt_length = text_length;
  86.889 +      }
  86.890 +      else
  86.891 +#endif
  86.892 +      {
  86.893 +         textp->text_length = text_length;
  86.894 +#ifdef PNG_iTXt_SUPPORTED
  86.895 +         textp->itxt_length = 0;
  86.896 +#endif
  86.897 +      }
  86.898 +      info_ptr->num_text++;
  86.899 +      png_debug1(3, "transferred text chunk %d\n", info_ptr->num_text);
  86.900 +   }
  86.901 +   return(0);
  86.902 +}
  86.903 +#endif
  86.904 +
  86.905 +#if defined(PNG_tIME_SUPPORTED)
  86.906 +void PNGAPI
  86.907 +png_set_tIME(png_structp png_ptr, png_infop info_ptr, png_timep mod_time)
  86.908 +{
  86.909 +   png_debug1(1, "in %s storage function\n", "tIME");
  86.910 +   if (png_ptr == NULL || info_ptr == NULL ||
  86.911 +       (png_ptr->mode & PNG_WROTE_tIME))
  86.912 +      return;
  86.913 +
  86.914 +   png_memcpy(&(info_ptr->mod_time), mod_time, png_sizeof(png_time));
  86.915 +   info_ptr->valid |= PNG_INFO_tIME;
  86.916 +}
  86.917 +#endif
  86.918 +
  86.919 +#if defined(PNG_tRNS_SUPPORTED)
  86.920 +void PNGAPI
  86.921 +png_set_tRNS(png_structp png_ptr, png_infop info_ptr,
  86.922 +   png_bytep trans, int num_trans, png_color_16p trans_values)
  86.923 +{
  86.924 +   png_debug1(1, "in %s storage function\n", "tRNS");
  86.925 +   if (png_ptr == NULL || info_ptr == NULL)
  86.926 +      return;
  86.927 +
  86.928 +   if (trans != NULL)
  86.929 +   {
  86.930 +       /*
  86.931 +        * It may not actually be necessary to set png_ptr->trans here;
  86.932 +        * we do it for backward compatibility with the way the png_handle_tRNS
  86.933 +        * function used to do the allocation.
  86.934 +        */
  86.935 +
  86.936 +#ifdef PNG_FREE_ME_SUPPORTED
  86.937 +       png_free_data(png_ptr, info_ptr, PNG_FREE_TRNS, 0);
  86.938 +#endif
  86.939 +
  86.940 +       /* Changed from num_trans to PNG_MAX_PALETTE_LENGTH in version 1.2.1 */
  86.941 +       png_ptr->trans = info_ptr->trans = (png_bytep)png_malloc(png_ptr,
  86.942 +           (png_uint_32)PNG_MAX_PALETTE_LENGTH);
  86.943 +       if (num_trans > 0 && num_trans <= PNG_MAX_PALETTE_LENGTH)
  86.944 +         png_memcpy(info_ptr->trans, trans, (png_size_t)num_trans);
  86.945 +   }
  86.946 +
  86.947 +   if (trans_values != NULL)
  86.948 +   {
  86.949 +      int sample_max = (1 << info_ptr->bit_depth);
  86.950 +      if ((info_ptr->color_type == PNG_COLOR_TYPE_GRAY &&
  86.951 +          (int)trans_values->gray > sample_max) ||
  86.952 +          (info_ptr->color_type == PNG_COLOR_TYPE_RGB &&
  86.953 +          ((int)trans_values->red > sample_max ||
  86.954 +          (int)trans_values->green > sample_max ||
  86.955 +          (int)trans_values->blue > sample_max)))
  86.956 +        png_warning(png_ptr,
  86.957 +           "tRNS chunk has out-of-range samples for bit_depth");
  86.958 +      png_memcpy(&(info_ptr->trans_values), trans_values,
  86.959 +         png_sizeof(png_color_16));
  86.960 +      if (num_trans == 0)
  86.961 +        num_trans = 1;
  86.962 +   }
  86.963 +
  86.964 +   info_ptr->num_trans = (png_uint_16)num_trans;
  86.965 +   if (num_trans != 0)
  86.966 +   {
  86.967 +      info_ptr->valid |= PNG_INFO_tRNS;
  86.968 +#ifdef PNG_FREE_ME_SUPPORTED
  86.969 +      info_ptr->free_me |= PNG_FREE_TRNS;
  86.970 +#else
  86.971 +      png_ptr->flags |= PNG_FLAG_FREE_TRNS;
  86.972 +#endif
  86.973 +   }
  86.974 +}
  86.975 +#endif
  86.976 +
  86.977 +#if defined(PNG_sPLT_SUPPORTED)
  86.978 +void PNGAPI
  86.979 +png_set_sPLT(png_structp png_ptr,
  86.980 +             png_infop info_ptr, png_sPLT_tp entries, int nentries)
  86.981 +/*
  86.982 + *  entries        - array of png_sPLT_t structures
  86.983 + *                   to be added to the list of palettes
  86.984 + *                   in the info structure.
  86.985 + *  nentries       - number of palette structures to be
  86.986 + *                   added.
  86.987 + */
  86.988 +{
  86.989 +    png_sPLT_tp np;
  86.990 +    int i;
  86.991 +
  86.992 +    if (png_ptr == NULL || info_ptr == NULL)
  86.993 +       return;
  86.994 +
  86.995 +    np = (png_sPLT_tp)png_malloc_warn(png_ptr,
  86.996 +        (info_ptr->splt_palettes_num + nentries) *
  86.997 +        (png_uint_32)png_sizeof(png_sPLT_t));
  86.998 +    if (np == NULL)
  86.999 +    {
 86.1000 +      png_warning(png_ptr, "No memory for sPLT palettes.");
 86.1001 +      return;
 86.1002 +    }
 86.1003 +
 86.1004 +    png_memcpy(np, info_ptr->splt_palettes,
 86.1005 +           info_ptr->splt_palettes_num * png_sizeof(png_sPLT_t));
 86.1006 +    png_free(png_ptr, info_ptr->splt_palettes);
 86.1007 +    info_ptr->splt_palettes=NULL;
 86.1008 +
 86.1009 +    for (i = 0; i < nentries; i++)
 86.1010 +    {
 86.1011 +        png_sPLT_tp to = np + info_ptr->splt_palettes_num + i;
 86.1012 +        png_sPLT_tp from = entries + i;
 86.1013 +        png_uint_32 length;
 86.1014 +
 86.1015 +        length = png_strlen(from->name) + 1;
 86.1016 +        to->name = (png_charp)png_malloc_warn(png_ptr, length);
 86.1017 +        if (to->name == NULL)
 86.1018 +        {
 86.1019 +           png_warning(png_ptr,
 86.1020 +             "Out of memory while processing sPLT chunk");
 86.1021 +           continue;
 86.1022 +        }
 86.1023 +        png_memcpy(to->name, from->name, length);
 86.1024 +        to->entries = (png_sPLT_entryp)png_malloc_warn(png_ptr,
 86.1025 +            (png_uint_32)(from->nentries * png_sizeof(png_sPLT_entry)));
 86.1026 +        if (to->entries == NULL)
 86.1027 +        {
 86.1028 +           png_warning(png_ptr,
 86.1029 +             "Out of memory while processing sPLT chunk");
 86.1030 +           png_free(png_ptr, to->name);
 86.1031 +           to->name = NULL;
 86.1032 +           continue;
 86.1033 +        }
 86.1034 +        png_memcpy(to->entries, from->entries,
 86.1035 +            from->nentries * png_sizeof(png_sPLT_entry));
 86.1036 +        to->nentries = from->nentries;
 86.1037 +        to->depth = from->depth;
 86.1038 +    }
 86.1039 +
 86.1040 +    info_ptr->splt_palettes = np;
 86.1041 +    info_ptr->splt_palettes_num += nentries;
 86.1042 +    info_ptr->valid |= PNG_INFO_sPLT;
 86.1043 +#ifdef PNG_FREE_ME_SUPPORTED
 86.1044 +    info_ptr->free_me |= PNG_FREE_SPLT;
 86.1045 +#endif
 86.1046 +}
 86.1047 +#endif /* PNG_sPLT_SUPPORTED */
 86.1048 +
 86.1049 +#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
 86.1050 +void PNGAPI
 86.1051 +png_set_unknown_chunks(png_structp png_ptr,
 86.1052 +   png_infop info_ptr, png_unknown_chunkp unknowns, int num_unknowns)
 86.1053 +{
 86.1054 +    png_unknown_chunkp np;
 86.1055 +    int i;
 86.1056 +
 86.1057 +    if (png_ptr == NULL || info_ptr == NULL || num_unknowns == 0)
 86.1058 +        return;
 86.1059 +
 86.1060 +    np = (png_unknown_chunkp)png_malloc_warn(png_ptr,
 86.1061 +        (png_uint_32)((info_ptr->unknown_chunks_num + num_unknowns) *
 86.1062 +        png_sizeof(png_unknown_chunk)));
 86.1063 +    if (np == NULL)
 86.1064 +    {
 86.1065 +       png_warning(png_ptr,
 86.1066 +          "Out of memory while processing unknown chunk.");
 86.1067 +       return;
 86.1068 +    }
 86.1069 +
 86.1070 +    png_memcpy(np, info_ptr->unknown_chunks,
 86.1071 +           info_ptr->unknown_chunks_num * png_sizeof(png_unknown_chunk));
 86.1072 +    png_free(png_ptr, info_ptr->unknown_chunks);
 86.1073 +    info_ptr->unknown_chunks=NULL;
 86.1074 +
 86.1075 +    for (i = 0; i < num_unknowns; i++)
 86.1076 +    {
 86.1077 +       png_unknown_chunkp to = np + info_ptr->unknown_chunks_num + i;
 86.1078 +       png_unknown_chunkp from = unknowns + i;
 86.1079 +
 86.1080 +       png_memcpy((png_charp)to->name, 
 86.1081 +                  (png_charp)from->name, 
 86.1082 +                  png_sizeof(from->name));
 86.1083 +       to->name[png_sizeof(to->name)-1] = '\0';
 86.1084 +       to->size = from->size;
 86.1085 +       /* note our location in the read or write sequence */
 86.1086 +       to->location = (png_byte)(png_ptr->mode & 0xff);
 86.1087 +
 86.1088 +       if (from->size == 0)
 86.1089 +          to->data=NULL;
 86.1090 +       else
 86.1091 +       {
 86.1092 +          to->data = (png_bytep)png_malloc_warn(png_ptr,
 86.1093 +            (png_uint_32)from->size);
 86.1094 +          if (to->data == NULL)
 86.1095 +          {
 86.1096 +             png_warning(png_ptr,
 86.1097 +              "Out of memory while processing unknown chunk.");
 86.1098 +             to->size = 0;
 86.1099 +          }
 86.1100 +          else
 86.1101 +             png_memcpy(to->data, from->data, from->size);
 86.1102 +       }
 86.1103 +    }
 86.1104 +
 86.1105 +    info_ptr->unknown_chunks = np;
 86.1106 +    info_ptr->unknown_chunks_num += num_unknowns;
 86.1107 +#ifdef PNG_FREE_ME_SUPPORTED
 86.1108 +    info_ptr->free_me |= PNG_FREE_UNKN;
 86.1109 +#endif
 86.1110 +}
 86.1111 +void PNGAPI
 86.1112 +png_set_unknown_chunk_location(png_structp png_ptr, png_infop info_ptr,
 86.1113 +   int chunk, int location)
 86.1114 +{
 86.1115 +   if (png_ptr != NULL && info_ptr != NULL && chunk >= 0 && chunk <
 86.1116 +         (int)info_ptr->unknown_chunks_num)
 86.1117 +      info_ptr->unknown_chunks[chunk].location = (png_byte)location;
 86.1118 +}
 86.1119 +#endif
 86.1120 +
 86.1121 +#if defined(PNG_1_0_X) || defined(PNG_1_2_X)
 86.1122 +#if defined(PNG_READ_EMPTY_PLTE_SUPPORTED) || \
 86.1123 +    defined(PNG_WRITE_EMPTY_PLTE_SUPPORTED)
 86.1124 +void PNGAPI
 86.1125 +png_permit_empty_plte (png_structp png_ptr, int empty_plte_permitted)
 86.1126 +{
 86.1127 +   /* This function is deprecated in favor of png_permit_mng_features()
 86.1128 +      and will be removed from libpng-1.3.0 */
 86.1129 +   png_debug(1, "in png_permit_empty_plte, DEPRECATED.\n");
 86.1130 +   if (png_ptr == NULL)
 86.1131 +      return;
 86.1132 +   png_ptr->mng_features_permitted = (png_byte)
 86.1133 +     ((png_ptr->mng_features_permitted & (~PNG_FLAG_MNG_EMPTY_PLTE)) |
 86.1134 +     ((empty_plte_permitted & PNG_FLAG_MNG_EMPTY_PLTE)));
 86.1135 +}
 86.1136 +#endif
 86.1137 +#endif
 86.1138 +
 86.1139 +#if defined(PNG_MNG_FEATURES_SUPPORTED)
 86.1140 +png_uint_32 PNGAPI
 86.1141 +png_permit_mng_features (png_structp png_ptr, png_uint_32 mng_features)
 86.1142 +{
 86.1143 +   png_debug(1, "in png_permit_mng_features\n");
 86.1144 +   if (png_ptr == NULL)
 86.1145 +      return (png_uint_32)0;
 86.1146 +   png_ptr->mng_features_permitted =
 86.1147 +     (png_byte)(mng_features & PNG_ALL_MNG_FEATURES);
 86.1148 +   return (png_uint_32)png_ptr->mng_features_permitted;
 86.1149 +}
 86.1150 +#endif
 86.1151 +
 86.1152 +#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
 86.1153 +void PNGAPI
 86.1154 +png_set_keep_unknown_chunks(png_structp png_ptr, int keep, png_bytep
 86.1155 +   chunk_list, int num_chunks)
 86.1156 +{
 86.1157 +    png_bytep new_list, p;
 86.1158 +    int i, old_num_chunks;
 86.1159 +    if (png_ptr == NULL)
 86.1160 +       return;
 86.1161 +    if (num_chunks == 0)
 86.1162 +    {
 86.1163 +      if (keep == PNG_HANDLE_CHUNK_ALWAYS || keep == PNG_HANDLE_CHUNK_IF_SAFE)
 86.1164 +        png_ptr->flags |= PNG_FLAG_KEEP_UNKNOWN_CHUNKS;
 86.1165 +      else
 86.1166 +        png_ptr->flags &= ~PNG_FLAG_KEEP_UNKNOWN_CHUNKS;
 86.1167 +
 86.1168 +      if (keep == PNG_HANDLE_CHUNK_ALWAYS)
 86.1169 +        png_ptr->flags |= PNG_FLAG_KEEP_UNSAFE_CHUNKS;
 86.1170 +      else
 86.1171 +        png_ptr->flags &= ~PNG_FLAG_KEEP_UNSAFE_CHUNKS;
 86.1172 +      return;
 86.1173 +    }
 86.1174 +    if (chunk_list == NULL)
 86.1175 +      return;
 86.1176 +    old_num_chunks = png_ptr->num_chunk_list;
 86.1177 +    new_list=(png_bytep)png_malloc(png_ptr,
 86.1178 +       (png_uint_32)
 86.1179 +       (5*(num_chunks + old_num_chunks)));
 86.1180 +    if (png_ptr->chunk_list != NULL)
 86.1181 +    {
 86.1182 +       png_memcpy(new_list, png_ptr->chunk_list,
 86.1183 +          (png_size_t)(5*old_num_chunks));
 86.1184 +       png_free(png_ptr, png_ptr->chunk_list);
 86.1185 +       png_ptr->chunk_list=NULL;
 86.1186 +    }
 86.1187 +    png_memcpy(new_list + 5*old_num_chunks, chunk_list,
 86.1188 +       (png_size_t)(5*num_chunks));
 86.1189 +    for (p = new_list + 5*old_num_chunks + 4, i = 0; i<num_chunks; i++, p += 5)
 86.1190 +       *p=(png_byte)keep;
 86.1191 +    png_ptr->num_chunk_list = old_num_chunks + num_chunks;
 86.1192 +    png_ptr->chunk_list = new_list;
 86.1193 +#ifdef PNG_FREE_ME_SUPPORTED
 86.1194 +    png_ptr->free_me |= PNG_FREE_LIST;
 86.1195 +#endif
 86.1196 +}
 86.1197 +#endif
 86.1198 +
 86.1199 +#if defined(PNG_READ_USER_CHUNKS_SUPPORTED)
 86.1200 +void PNGAPI
 86.1201 +png_set_read_user_chunk_fn(png_structp png_ptr, png_voidp user_chunk_ptr,
 86.1202 +   png_user_chunk_ptr read_user_chunk_fn)
 86.1203 +{
 86.1204 +   png_debug(1, "in png_set_read_user_chunk_fn\n");
 86.1205 +   if (png_ptr == NULL)
 86.1206 +      return;
 86.1207 +   png_ptr->read_user_chunk_fn = read_user_chunk_fn;
 86.1208 +   png_ptr->user_chunk_ptr = user_chunk_ptr;
 86.1209 +}
 86.1210 +#endif
 86.1211 +
 86.1212 +#if defined(PNG_INFO_IMAGE_SUPPORTED)
 86.1213 +void PNGAPI
 86.1214 +png_set_rows(png_structp png_ptr, png_infop info_ptr, png_bytepp row_pointers)
 86.1215 +{
 86.1216 +   png_debug1(1, "in %s storage function\n", "rows");
 86.1217 +
 86.1218 +   if (png_ptr == NULL || info_ptr == NULL)
 86.1219 +      return;
 86.1220 +
 86.1221 +   if (info_ptr->row_pointers && (info_ptr->row_pointers != row_pointers))
 86.1222 +      png_free_data(png_ptr, info_ptr, PNG_FREE_ROWS, 0);
 86.1223 +   info_ptr->row_pointers = row_pointers;
 86.1224 +   if (row_pointers)
 86.1225 +      info_ptr->valid |= PNG_INFO_IDAT;
 86.1226 +}
 86.1227 +#endif
 86.1228 +
 86.1229 +#ifdef PNG_WRITE_SUPPORTED
 86.1230 +void PNGAPI
 86.1231 +png_set_compression_buffer_size(png_structp png_ptr,
 86.1232 +    png_uint_32 size)
 86.1233 +{
 86.1234 +    if (png_ptr == NULL)
 86.1235 +       return;
 86.1236 +    png_free(png_ptr, png_ptr->zbuf);
 86.1237 +    png_ptr->zbuf_size = (png_size_t)size;
 86.1238 +    png_ptr->zbuf = (png_bytep)png_malloc(png_ptr, size);
 86.1239 +    png_ptr->zstream.next_out = png_ptr->zbuf;
 86.1240 +    png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
 86.1241 +}
 86.1242 +#endif
 86.1243 +
 86.1244 +void PNGAPI
 86.1245 +png_set_invalid(png_structp png_ptr, png_infop info_ptr, int mask)
 86.1246 +{
 86.1247 +   if (png_ptr && info_ptr)
 86.1248 +      info_ptr->valid &= ~mask;
 86.1249 +}
 86.1250 +
 86.1251 +
 86.1252 +#ifndef PNG_1_0_X
 86.1253 +#ifdef PNG_ASSEMBLER_CODE_SUPPORTED
 86.1254 +/* function was added to libpng 1.2.0 and should always exist by default */
 86.1255 +void PNGAPI
 86.1256 +png_set_asm_flags (png_structp png_ptr, png_uint_32 asm_flags)
 86.1257 +{
 86.1258 +/* Obsolete as of libpng-1.2.20 and will be removed from libpng-1.4.0 */
 86.1259 +    if (png_ptr != NULL)
 86.1260 +    png_ptr->asm_flags = 0;
 86.1261 +    asm_flags = asm_flags; /* Quiet the compiler */
 86.1262 +}
 86.1263 +
 86.1264 +/* this function was added to libpng 1.2.0 */
 86.1265 +void PNGAPI
 86.1266 +png_set_mmx_thresholds (png_structp png_ptr,
 86.1267 +                        png_byte mmx_bitdepth_threshold,
 86.1268 +                        png_uint_32 mmx_rowbytes_threshold)
 86.1269 +{
 86.1270 +/* Obsolete as of libpng-1.2.20 and will be removed from libpng-1.4.0 */
 86.1271 +    if (png_ptr == NULL)
 86.1272 +       return;
 86.1273 +    /* Quiet the compiler */
 86.1274 +    mmx_bitdepth_threshold = mmx_bitdepth_threshold;
 86.1275 +    mmx_rowbytes_threshold = mmx_rowbytes_threshold;
 86.1276 +}
 86.1277 +#endif /* ?PNG_ASSEMBLER_CODE_SUPPORTED */
 86.1278 +
 86.1279 +#ifdef PNG_SET_USER_LIMITS_SUPPORTED
 86.1280 +/* this function was added to libpng 1.2.6 */
 86.1281 +void PNGAPI
 86.1282 +png_set_user_limits (png_structp png_ptr, png_uint_32 user_width_max,
 86.1283 +    png_uint_32 user_height_max)
 86.1284 +{
 86.1285 +    /* Images with dimensions larger than these limits will be
 86.1286 +     * rejected by png_set_IHDR().  To accept any PNG datastream
 86.1287 +     * regardless of dimensions, set both limits to 0x7ffffffL.
 86.1288 +     */
 86.1289 +    if (png_ptr == NULL) return;
 86.1290 +    png_ptr->user_width_max = user_width_max;
 86.1291 +    png_ptr->user_height_max = user_height_max;
 86.1292 +}
 86.1293 +#endif /* ?PNG_SET_USER_LIMITS_SUPPORTED */
 86.1294 +
 86.1295 +#endif /* ?PNG_1_0_X */
 86.1296 +#endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */
    87.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    87.2 +++ b/libs/libpng/pngtrans.c	Sun Nov 01 00:36:56 2015 +0200
    87.3 @@ -0,0 +1,662 @@
    87.4 +
    87.5 +/* pngtrans.c - transforms the data in a row (used by both readers and writers)
    87.6 + *
    87.7 + * Last changed in libpng 1.2.30 [August 15, 2008]
    87.8 + * For conditions of distribution and use, see copyright notice in png.h
    87.9 + * Copyright (c) 1998-2008 Glenn Randers-Pehrson
   87.10 + * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
   87.11 + * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
   87.12 + */
   87.13 +
   87.14 +#define PNG_INTERNAL
   87.15 +#include "png.h"
   87.16 +#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
   87.17 +
   87.18 +#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED)
   87.19 +/* turn on BGR-to-RGB mapping */
   87.20 +void PNGAPI
   87.21 +png_set_bgr(png_structp png_ptr)
   87.22 +{
   87.23 +   png_debug(1, "in png_set_bgr\n");
   87.24 +   if (png_ptr == NULL) return;
   87.25 +   png_ptr->transformations |= PNG_BGR;
   87.26 +}
   87.27 +#endif
   87.28 +
   87.29 +#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED)
   87.30 +/* turn on 16 bit byte swapping */
   87.31 +void PNGAPI
   87.32 +png_set_swap(png_structp png_ptr)
   87.33 +{
   87.34 +   png_debug(1, "in png_set_swap\n");
   87.35 +   if (png_ptr == NULL) return;
   87.36 +   if (png_ptr->bit_depth == 16)
   87.37 +      png_ptr->transformations |= PNG_SWAP_BYTES;
   87.38 +}
   87.39 +#endif
   87.40 +
   87.41 +#if defined(PNG_READ_PACK_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED)
   87.42 +/* turn on pixel packing */
   87.43 +void PNGAPI
   87.44 +png_set_packing(png_structp png_ptr)
   87.45 +{
   87.46 +   png_debug(1, "in png_set_packing\n");
   87.47 +   if (png_ptr == NULL) return;
   87.48 +   if (png_ptr->bit_depth < 8)
   87.49 +   {
   87.50 +      png_ptr->transformations |= PNG_PACK;
   87.51 +      png_ptr->usr_bit_depth = 8;
   87.52 +   }
   87.53 +}
   87.54 +#endif
   87.55 +
   87.56 +#if defined(PNG_READ_PACKSWAP_SUPPORTED)||defined(PNG_WRITE_PACKSWAP_SUPPORTED)
   87.57 +/* turn on packed pixel swapping */
   87.58 +void PNGAPI
   87.59 +png_set_packswap(png_structp png_ptr)
   87.60 +{
   87.61 +   png_debug(1, "in png_set_packswap\n");
   87.62 +   if (png_ptr == NULL) return;
   87.63 +   if (png_ptr->bit_depth < 8)
   87.64 +      png_ptr->transformations |= PNG_PACKSWAP;
   87.65 +}
   87.66 +#endif
   87.67 +
   87.68 +#if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED)
   87.69 +void PNGAPI
   87.70 +png_set_shift(png_structp png_ptr, png_color_8p true_bits)
   87.71 +{
   87.72 +   png_debug(1, "in png_set_shift\n");
   87.73 +   if (png_ptr == NULL) return;
   87.74 +   png_ptr->transformations |= PNG_SHIFT;
   87.75 +   png_ptr->shift = *true_bits;
   87.76 +}
   87.77 +#endif
   87.78 +
   87.79 +#if defined(PNG_READ_INTERLACING_SUPPORTED) || \
   87.80 +    defined(PNG_WRITE_INTERLACING_SUPPORTED)
   87.81 +int PNGAPI
   87.82 +png_set_interlace_handling(png_structp png_ptr)
   87.83 +{
   87.84 +   png_debug(1, "in png_set_interlace handling\n");
   87.85 +   if (png_ptr && png_ptr->interlaced)
   87.86 +   {
   87.87 +      png_ptr->transformations |= PNG_INTERLACE;
   87.88 +      return (7);
   87.89 +   }
   87.90 +
   87.91 +   return (1);
   87.92 +}
   87.93 +#endif
   87.94 +
   87.95 +#if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED)
   87.96 +/* Add a filler byte on read, or remove a filler or alpha byte on write.
   87.97 + * The filler type has changed in v0.95 to allow future 2-byte fillers
   87.98 + * for 48-bit input data, as well as to avoid problems with some compilers
   87.99 + * that don't like bytes as parameters.
  87.100 + */
  87.101 +void PNGAPI
  87.102 +png_set_filler(png_structp png_ptr, png_uint_32 filler, int filler_loc)
  87.103 +{
  87.104 +   png_debug(1, "in png_set_filler\n");
  87.105 +   if (png_ptr == NULL) return;
  87.106 +   png_ptr->transformations |= PNG_FILLER;
  87.107 +   png_ptr->filler = (png_byte)filler;
  87.108 +   if (filler_loc == PNG_FILLER_AFTER)
  87.109 +      png_ptr->flags |= PNG_FLAG_FILLER_AFTER;
  87.110 +   else
  87.111 +      png_ptr->flags &= ~PNG_FLAG_FILLER_AFTER;
  87.112 +
  87.113 +   /* This should probably go in the "do_read_filler" routine.
  87.114 +    * I attempted to do that in libpng-1.0.1a but that caused problems
  87.115 +    * so I restored it in libpng-1.0.2a
  87.116 +   */
  87.117 +
  87.118 +   if (png_ptr->color_type == PNG_COLOR_TYPE_RGB)
  87.119 +   {
  87.120 +      png_ptr->usr_channels = 4;
  87.121 +   }
  87.122 +
  87.123 +   /* Also I added this in libpng-1.0.2a (what happens when we expand
  87.124 +    * a less-than-8-bit grayscale to GA? */
  87.125 +
  87.126 +   if (png_ptr->color_type == PNG_COLOR_TYPE_GRAY && png_ptr->bit_depth >= 8)
  87.127 +   {
  87.128 +      png_ptr->usr_channels = 2;
  87.129 +   }
  87.130 +}
  87.131 +
  87.132 +#if !defined(PNG_1_0_X)
  87.133 +/* Added to libpng-1.2.7 */
  87.134 +void PNGAPI
  87.135 +png_set_add_alpha(png_structp png_ptr, png_uint_32 filler, int filler_loc)
  87.136 +{
  87.137 +   png_debug(1, "in png_set_add_alpha\n");
  87.138 +   if (png_ptr == NULL) return;
  87.139 +   png_set_filler(png_ptr, filler, filler_loc);
  87.140 +   png_ptr->transformations |= PNG_ADD_ALPHA;
  87.141 +}
  87.142 +#endif
  87.143 +
  87.144 +#endif
  87.145 +
  87.146 +#if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) || \
  87.147 +    defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED)
  87.148 +void PNGAPI
  87.149 +png_set_swap_alpha(png_structp png_ptr)
  87.150 +{
  87.151 +   png_debug(1, "in png_set_swap_alpha\n");
  87.152 +   if (png_ptr == NULL) return;
  87.153 +   png_ptr->transformations |= PNG_SWAP_ALPHA;
  87.154 +}
  87.155 +#endif
  87.156 +
  87.157 +#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) || \
  87.158 +    defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED)
  87.159 +void PNGAPI
  87.160 +png_set_invert_alpha(png_structp png_ptr)
  87.161 +{
  87.162 +   png_debug(1, "in png_set_invert_alpha\n");
  87.163 +   if (png_ptr == NULL) return;
  87.164 +   png_ptr->transformations |= PNG_INVERT_ALPHA;
  87.165 +}
  87.166 +#endif
  87.167 +
  87.168 +#if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED)
  87.169 +void PNGAPI
  87.170 +png_set_invert_mono(png_structp png_ptr)
  87.171 +{
  87.172 +   png_debug(1, "in png_set_invert_mono\n");
  87.173 +   if (png_ptr == NULL) return;
  87.174 +   png_ptr->transformations |= PNG_INVERT_MONO;
  87.175 +}
  87.176 +
  87.177 +/* invert monochrome grayscale data */
  87.178 +void /* PRIVATE */
  87.179 +png_do_invert(png_row_infop row_info, png_bytep row)
  87.180 +{
  87.181 +   png_debug(1, "in png_do_invert\n");
  87.182 +  /* This test removed from libpng version 1.0.13 and 1.2.0:
  87.183 +   *   if (row_info->bit_depth == 1 &&
  87.184 +   */
  87.185 +#if defined(PNG_USELESS_TESTS_SUPPORTED)
  87.186 +   if (row == NULL || row_info == NULL)
  87.187 +     return;
  87.188 +#endif
  87.189 +   if (row_info->color_type == PNG_COLOR_TYPE_GRAY)
  87.190 +   {
  87.191 +      png_bytep rp = row;
  87.192 +      png_uint_32 i;
  87.193 +      png_uint_32 istop = row_info->rowbytes;
  87.194 +
  87.195 +      for (i = 0; i < istop; i++)
  87.196 +      {
  87.197 +         *rp = (png_byte)(~(*rp));
  87.198 +         rp++;
  87.199 +      }
  87.200 +   }
  87.201 +   else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA &&
  87.202 +      row_info->bit_depth == 8)
  87.203 +   {
  87.204 +      png_bytep rp = row;
  87.205 +      png_uint_32 i;
  87.206 +      png_uint_32 istop = row_info->rowbytes;
  87.207 +
  87.208 +      for (i = 0; i < istop; i+=2)
  87.209 +      {
  87.210 +         *rp = (png_byte)(~(*rp));
  87.211 +         rp+=2;
  87.212 +      }
  87.213 +   }
  87.214 +   else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA &&
  87.215 +      row_info->bit_depth == 16)
  87.216 +   {
  87.217 +      png_bytep rp = row;
  87.218 +      png_uint_32 i;
  87.219 +      png_uint_32 istop = row_info->rowbytes;
  87.220 +
  87.221 +      for (i = 0; i < istop; i+=4)
  87.222 +      {
  87.223 +         *rp = (png_byte)(~(*rp));
  87.224 +         *(rp+1) = (png_byte)(~(*(rp+1)));
  87.225 +         rp+=4;
  87.226 +      }
  87.227 +   }
  87.228 +}
  87.229 +#endif
  87.230 +
  87.231 +#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED)
  87.232 +/* swaps byte order on 16 bit depth images */
  87.233 +void /* PRIVATE */
  87.234 +png_do_swap(png_row_infop row_info, png_bytep row)
  87.235 +{
  87.236 +   png_debug(1, "in png_do_swap\n");
  87.237 +   if (
  87.238 +#if defined(PNG_USELESS_TESTS_SUPPORTED)
  87.239 +       row != NULL && row_info != NULL &&
  87.240 +#endif
  87.241 +       row_info->bit_depth == 16)
  87.242 +   {
  87.243 +      png_bytep rp = row;
  87.244 +      png_uint_32 i;
  87.245 +      png_uint_32 istop= row_info->width * row_info->channels;
  87.246 +
  87.247 +      for (i = 0; i < istop; i++, rp += 2)
  87.248 +      {
  87.249 +         png_byte t = *rp;
  87.250 +         *rp = *(rp + 1);
  87.251 +         *(rp + 1) = t;
  87.252 +      }
  87.253 +   }
  87.254 +}
  87.255 +#endif
  87.256 +
  87.257 +#if defined(PNG_READ_PACKSWAP_SUPPORTED)||defined(PNG_WRITE_PACKSWAP_SUPPORTED)
  87.258 +static PNG_CONST png_byte onebppswaptable[256] = {
  87.259 +   0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0,
  87.260 +   0x10, 0x90, 0x50, 0xD0, 0x30, 0xB0, 0x70, 0xF0,
  87.261 +   0x08, 0x88, 0x48, 0xC8, 0x28, 0xA8, 0x68, 0xE8,
  87.262 +   0x18, 0x98, 0x58, 0xD8, 0x38, 0xB8, 0x78, 0xF8,
  87.263 +   0x04, 0x84, 0x44, 0xC4, 0x24, 0xA4, 0x64, 0xE4,
  87.264 +   0x14, 0x94, 0x54, 0xD4, 0x34, 0xB4, 0x74, 0xF4,
  87.265 +   0x0C, 0x8C, 0x4C, 0xCC, 0x2C, 0xAC, 0x6C, 0xEC,
  87.266 +   0x1C, 0x9C, 0x5C, 0xDC, 0x3C, 0xBC, 0x7C, 0xFC,
  87.267 +   0x02, 0x82, 0x42, 0xC2, 0x22, 0xA2, 0x62, 0xE2,
  87.268 +   0x12, 0x92, 0x52, 0xD2, 0x32, 0xB2, 0x72, 0xF2,
  87.269 +   0x0A, 0x8A, 0x4A, 0xCA, 0x2A, 0xAA, 0x6A, 0xEA,
  87.270 +   0x1A, 0x9A, 0x5A, 0xDA, 0x3A, 0xBA, 0x7A, 0xFA,
  87.271 +   0x06, 0x86, 0x46, 0xC6, 0x26, 0xA6, 0x66, 0xE6,
  87.272 +   0x16, 0x96, 0x56, 0xD6, 0x36, 0xB6, 0x76, 0xF6,
  87.273 +   0x0E, 0x8E, 0x4E, 0xCE, 0x2E, 0xAE, 0x6E, 0xEE,
  87.274 +   0x1E, 0x9E, 0x5E, 0xDE, 0x3E, 0xBE, 0x7E, 0xFE,
  87.275 +   0x01, 0x81, 0x41, 0xC1, 0x21, 0xA1, 0x61, 0xE1,
  87.276 +   0x11, 0x91, 0x51, 0xD1, 0x31, 0xB1, 0x71, 0xF1,
  87.277 +   0x09, 0x89, 0x49, 0xC9, 0x29, 0xA9, 0x69, 0xE9,
  87.278 +   0x19, 0x99, 0x59, 0xD9, 0x39, 0xB9, 0x79, 0xF9,
  87.279 +   0x05, 0x85, 0x45, 0xC5, 0x25, 0xA5, 0x65, 0xE5,
  87.280 +   0x15, 0x95, 0x55, 0xD5, 0x35, 0xB5, 0x75, 0xF5,
  87.281 +   0x0D, 0x8D, 0x4D, 0xCD, 0x2D, 0xAD, 0x6D, 0xED,
  87.282 +   0x1D, 0x9D, 0x5D, 0xDD, 0x3D, 0xBD, 0x7D, 0xFD,
  87.283 +   0x03, 0x83, 0x43, 0xC3, 0x23, 0xA3, 0x63, 0xE3,
  87.284 +   0x13, 0x93, 0x53, 0xD3, 0x33, 0xB3, 0x73, 0xF3,
  87.285 +   0x0B, 0x8B, 0x4B, 0xCB, 0x2B, 0xAB, 0x6B, 0xEB,
  87.286 +   0x1B, 0x9B, 0x5B, 0xDB, 0x3B, 0xBB, 0x7B, 0xFB,
  87.287 +   0x07, 0x87, 0x47, 0xC7, 0x27, 0xA7, 0x67, 0xE7,
  87.288 +   0x17, 0x97, 0x57, 0xD7, 0x37, 0xB7, 0x77, 0xF7,
  87.289 +   0x0F, 0x8F, 0x4F, 0xCF, 0x2F, 0xAF, 0x6F, 0xEF,
  87.290 +   0x1F, 0x9F, 0x5F, 0xDF, 0x3F, 0xBF, 0x7F, 0xFF
  87.291 +};
  87.292 +
  87.293 +static PNG_CONST png_byte twobppswaptable[256] = {
  87.294 +   0x00, 0x40, 0x80, 0xC0, 0x10, 0x50, 0x90, 0xD0,
  87.295 +   0x20, 0x60, 0xA0, 0xE0, 0x30, 0x70, 0xB0, 0xF0,
  87.296 +   0x04, 0x44, 0x84, 0xC4, 0x14, 0x54, 0x94, 0xD4,
  87.297 +   0x24, 0x64, 0xA4, 0xE4, 0x34, 0x74, 0xB4, 0xF4,
  87.298 +   0x08, 0x48, 0x88, 0xC8, 0x18, 0x58, 0x98, 0xD8,
  87.299 +   0x28, 0x68, 0xA8, 0xE8, 0x38, 0x78, 0xB8, 0xF8,
  87.300 +   0x0C, 0x4C, 0x8C, 0xCC, 0x1C, 0x5C, 0x9C, 0xDC,
  87.301 +   0x2C, 0x6C, 0xAC, 0xEC, 0x3C, 0x7C, 0xBC, 0xFC,
  87.302 +   0x01, 0x41, 0x81, 0xC1, 0x11, 0x51, 0x91, 0xD1,
  87.303 +   0x21, 0x61, 0xA1, 0xE1, 0x31, 0x71, 0xB1, 0xF1,
  87.304 +   0x05, 0x45, 0x85, 0xC5, 0x15, 0x55, 0x95, 0xD5,
  87.305 +   0x25, 0x65, 0xA5, 0xE5, 0x35, 0x75, 0xB5, 0xF5,
  87.306 +   0x09, 0x49, 0x89, 0xC9, 0x19, 0x59, 0x99, 0xD9,
  87.307 +   0x29, 0x69, 0xA9, 0xE9, 0x39, 0x79, 0xB9, 0xF9,
  87.308 +   0x0D, 0x4D, 0x8D, 0xCD, 0x1D, 0x5D, 0x9D, 0xDD,
  87.309 +   0x2D, 0x6D, 0xAD, 0xED, 0x3D, 0x7D, 0xBD, 0xFD,
  87.310 +   0x02, 0x42, 0x82, 0xC2, 0x12, 0x52, 0x92, 0xD2,
  87.311 +   0x22, 0x62, 0xA2, 0xE2, 0x32, 0x72, 0xB2, 0xF2,
  87.312 +   0x06, 0x46, 0x86, 0xC6, 0x16, 0x56, 0x96, 0xD6,
  87.313 +   0x26, 0x66, 0xA6, 0xE6, 0x36, 0x76, 0xB6, 0xF6,
  87.314 +   0x0A, 0x4A, 0x8A, 0xCA, 0x1A, 0x5A, 0x9A, 0xDA,
  87.315 +   0x2A, 0x6A, 0xAA, 0xEA, 0x3A, 0x7A, 0xBA, 0xFA,
  87.316 +   0x0E, 0x4E, 0x8E, 0xCE, 0x1E, 0x5E, 0x9E, 0xDE,
  87.317 +   0x2E, 0x6E, 0xAE, 0xEE, 0x3E, 0x7E, 0xBE, 0xFE,
  87.318 +   0x03, 0x43, 0x83, 0xC3, 0x13, 0x53, 0x93, 0xD3,
  87.319 +   0x23, 0x63, 0xA3, 0xE3, 0x33, 0x73, 0xB3, 0xF3,
  87.320 +   0x07, 0x47, 0x87, 0xC7, 0x17, 0x57, 0x97, 0xD7,
  87.321 +   0x27, 0x67, 0xA7, 0xE7, 0x37, 0x77, 0xB7, 0xF7,
  87.322 +   0x0B, 0x4B, 0x8B, 0xCB, 0x1B, 0x5B, 0x9B, 0xDB,
  87.323 +   0x2B, 0x6B, 0xAB, 0xEB, 0x3B, 0x7B, 0xBB, 0xFB,
  87.324 +   0x0F, 0x4F, 0x8F, 0xCF, 0x1F, 0x5F, 0x9F, 0xDF,
  87.325 +   0x2F, 0x6F, 0xAF, 0xEF, 0x3F, 0x7F, 0xBF, 0xFF
  87.326 +};
  87.327 +
  87.328 +static PNG_CONST png_byte fourbppswaptable[256] = {
  87.329 +   0x00, 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70,
  87.330 +   0x80, 0x90, 0xA0, 0xB0, 0xC0, 0xD0, 0xE0, 0xF0,
  87.331 +   0x01, 0x11, 0x21, 0x31, 0x41, 0x51, 0x61, 0x71,
  87.332 +   0x81, 0x91, 0xA1, 0xB1, 0xC1, 0xD1, 0xE1, 0xF1,
  87.333 +   0x02, 0x12, 0x22, 0x32, 0x42, 0x52, 0x62, 0x72,
  87.334 +   0x82, 0x92, 0xA2, 0xB2, 0xC2, 0xD2, 0xE2, 0xF2,
  87.335 +   0x03, 0x13, 0x23, 0x33, 0x43, 0x53, 0x63, 0x73,
  87.336 +   0x83, 0x93, 0xA3, 0xB3, 0xC3, 0xD3, 0xE3, 0xF3,
  87.337 +   0x04, 0x14, 0x24, 0x34, 0x44, 0x54, 0x64, 0x74,
  87.338 +   0x84, 0x94, 0xA4, 0xB4, 0xC4, 0xD4, 0xE4, 0xF4,
  87.339 +   0x05, 0x15, 0x25, 0x35, 0x45, 0x55, 0x65, 0x75,
  87.340 +   0x85, 0x95, 0xA5, 0xB5, 0xC5, 0xD5, 0xE5, 0xF5,
  87.341 +   0x06, 0x16, 0x26, 0x36, 0x46, 0x56, 0x66, 0x76,
  87.342 +   0x86, 0x96, 0xA6, 0xB6, 0xC6, 0xD6, 0xE6, 0xF6,
  87.343 +   0x07, 0x17, 0x27, 0x37, 0x47, 0x57, 0x67, 0x77,
  87.344 +   0x87, 0x97, 0xA7, 0xB7, 0xC7, 0xD7, 0xE7, 0xF7,
  87.345 +   0x08, 0x18, 0x28, 0x38, 0x48, 0x58, 0x68, 0x78,
  87.346 +   0x88, 0x98, 0xA8, 0xB8, 0xC8, 0xD8, 0xE8, 0xF8,
  87.347 +   0x09, 0x19, 0x29, 0x39, 0x49, 0x59, 0x69, 0x79,
  87.348 +   0x89, 0x99, 0xA9, 0xB9, 0xC9, 0xD9, 0xE9, 0xF9,
  87.349 +   0x0A, 0x1A, 0x2A, 0x3A, 0x4A, 0x5A, 0x6A, 0x7A,
  87.350 +   0x8A, 0x9A, 0xAA, 0xBA, 0xCA, 0xDA, 0xEA, 0xFA,
  87.351 +   0x0B, 0x1B, 0x2B, 0x3B, 0x4B, 0x5B, 0x6B, 0x7B,
  87.352 +   0x8B, 0x9B, 0xAB, 0xBB, 0xCB, 0xDB, 0xEB, 0xFB,
  87.353 +   0x0C, 0x1C, 0x2C, 0x3C, 0x4C, 0x5C, 0x6C, 0x7C,
  87.354 +   0x8C, 0x9C, 0xAC, 0xBC, 0xCC, 0xDC, 0xEC, 0xFC,
  87.355 +   0x0D, 0x1D, 0x2D, 0x3D, 0x4D, 0x5D, 0x6D, 0x7D,
  87.356 +   0x8D, 0x9D, 0xAD, 0xBD, 0xCD, 0xDD, 0xED, 0xFD,
  87.357 +   0x0E, 0x1E, 0x2E, 0x3E, 0x4E, 0x5E, 0x6E, 0x7E,
  87.358 +   0x8E, 0x9E, 0xAE, 0xBE, 0xCE, 0xDE, 0xEE, 0xFE,
  87.359 +   0x0F, 0x1F, 0x2F, 0x3F, 0x4F, 0x5F, 0x6F, 0x7F,
  87.360 +   0x8F, 0x9F, 0xAF, 0xBF, 0xCF, 0xDF, 0xEF, 0xFF
  87.361 +};
  87.362 +
  87.363 +/* swaps pixel packing order within bytes */
  87.364 +void /* PRIVATE */
  87.365 +png_do_packswap(png_row_infop row_info, png_bytep row)
  87.366 +{
  87.367 +   png_debug(1, "in png_do_packswap\n");
  87.368 +   if (
  87.369 +#if defined(PNG_USELESS_TESTS_SUPPORTED)
  87.370 +       row != NULL && row_info != NULL &&
  87.371 +#endif
  87.372 +       row_info->bit_depth < 8)
  87.373 +   {
  87.374 +      png_bytep rp, end, table;
  87.375 +
  87.376 +      end = row + row_info->rowbytes;
  87.377 +
  87.378 +      if (row_info->bit_depth == 1)
  87.379 +         table = (png_bytep)onebppswaptable;
  87.380 +      else if (row_info->bit_depth == 2)
  87.381 +         table = (png_bytep)twobppswaptable;
  87.382 +      else if (row_info->bit_depth == 4)
  87.383 +         table = (png_bytep)fourbppswaptable;
  87.384 +      else
  87.385 +         return;
  87.386 +
  87.387 +      for (rp = row; rp < end; rp++)
  87.388 +         *rp = table[*rp];
  87.389 +   }
  87.390 +}
  87.391 +#endif /* PNG_READ_PACKSWAP_SUPPORTED or PNG_WRITE_PACKSWAP_SUPPORTED */
  87.392 +
  87.393 +#if defined(PNG_WRITE_FILLER_SUPPORTED) || \
  87.394 +    defined(PNG_READ_STRIP_ALPHA_SUPPORTED)
  87.395 +/* remove filler or alpha byte(s) */
  87.396 +void /* PRIVATE */
  87.397 +png_do_strip_filler(png_row_infop row_info, png_bytep row, png_uint_32 flags)
  87.398 +{
  87.399 +   png_debug(1, "in png_do_strip_filler\n");
  87.400 +#if defined(PNG_USELESS_TESTS_SUPPORTED)
  87.401 +   if (row != NULL && row_info != NULL)
  87.402 +#endif
  87.403 +   {
  87.404 +      png_bytep sp=row;
  87.405 +      png_bytep dp=row;
  87.406 +      png_uint_32 row_width=row_info->width;
  87.407 +      png_uint_32 i;
  87.408 +
  87.409 +      if ((row_info->color_type == PNG_COLOR_TYPE_RGB ||
  87.410 +         (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA &&
  87.411 +         (flags & PNG_FLAG_STRIP_ALPHA))) &&
  87.412 +         row_info->channels == 4)
  87.413 +      {
  87.414 +         if (row_info->bit_depth == 8)
  87.415 +         {
  87.416 +            /* This converts from RGBX or RGBA to RGB */
  87.417 +            if (flags & PNG_FLAG_FILLER_AFTER)
  87.418 +            {
  87.419 +               dp+=3; sp+=4;
  87.420 +               for (i = 1; i < row_width; i++)
  87.421 +               {
  87.422 +                  *dp++ = *sp++;
  87.423 +                  *dp++ = *sp++;
  87.424 +                  *dp++ = *sp++;
  87.425 +                  sp++;
  87.426 +               }
  87.427 +            }
  87.428 +            /* This converts from XRGB or ARGB to RGB */
  87.429 +            else
  87.430 +            {
  87.431 +               for (i = 0; i < row_width; i++)
  87.432 +               {
  87.433 +                  sp++;
  87.434 +                  *dp++ = *sp++;
  87.435 +                  *dp++ = *sp++;
  87.436 +                  *dp++ = *sp++;
  87.437 +               }
  87.438 +            }
  87.439 +            row_info->pixel_depth = 24;
  87.440 +            row_info->rowbytes = row_width * 3;
  87.441 +         }
  87.442 +         else /* if (row_info->bit_depth == 16) */
  87.443 +         {
  87.444 +            if (flags & PNG_FLAG_FILLER_AFTER)
  87.445 +            {
  87.446 +               /* This converts from RRGGBBXX or RRGGBBAA to RRGGBB */
  87.447 +               sp += 8; dp += 6;
  87.448 +               for (i = 1; i < row_width; i++)
  87.449 +               {
  87.450 +                  /* This could be (although png_memcpy is probably slower):
  87.451 +                  png_memcpy(dp, sp, 6);
  87.452 +                  sp += 8;
  87.453 +                  dp += 6;
  87.454 +                  */
  87.455 +
  87.456 +                  *dp++ = *sp++;
  87.457 +                  *dp++ = *sp++;
  87.458 +                  *dp++ = *sp++;
  87.459 +                  *dp++ = *sp++;
  87.460 +                  *dp++ = *sp++;
  87.461 +                  *dp++ = *sp++;
  87.462 +                  sp += 2;
  87.463 +               }
  87.464 +            }
  87.465 +            else
  87.466 +            {
  87.467 +               /* This converts from XXRRGGBB or AARRGGBB to RRGGBB */
  87.468 +               for (i = 0; i < row_width; i++)
  87.469 +               {
  87.470 +                  /* This could be (although png_memcpy is probably slower):
  87.471 +                  png_memcpy(dp, sp, 6);
  87.472 +                  sp += 8;
  87.473 +                  dp += 6;
  87.474 +                  */
  87.475 +
  87.476 +                  sp+=2;
  87.477 +                  *dp++ = *sp++;
  87.478 +                  *dp++ = *sp++;
  87.479 +                  *dp++ = *sp++;
  87.480 +                  *dp++ = *sp++;
  87.481 +                  *dp++ = *sp++;
  87.482 +                  *dp++ = *sp++;
  87.483 +               }
  87.484 +            }
  87.485 +            row_info->pixel_depth = 48;
  87.486 +            row_info->rowbytes = row_width * 6;
  87.487 +         }
  87.488 +         row_info->channels = 3;
  87.489 +      }
  87.490 +      else if ((row_info->color_type == PNG_COLOR_TYPE_GRAY ||
  87.491 +         (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA &&
  87.492 +         (flags & PNG_FLAG_STRIP_ALPHA))) &&
  87.493 +          row_info->channels == 2)
  87.494 +      {
  87.495 +         if (row_info->bit_depth == 8)
  87.496 +         {
  87.497 +            /* This converts from GX or GA to G */
  87.498 +            if (flags & PNG_FLAG_FILLER_AFTER)
  87.499 +            {
  87.500 +               for (i = 0; i < row_width; i++)
  87.501 +               {
  87.502 +                  *dp++ = *sp++;
  87.503 +                  sp++;
  87.504 +               }
  87.505 +            }
  87.506 +            /* This converts from XG or AG to G */
  87.507 +            else
  87.508 +            {
  87.509 +               for (i = 0; i < row_width; i++)
  87.510 +               {
  87.511 +                  sp++;
  87.512 +                  *dp++ = *sp++;
  87.513 +               }
  87.514 +            }
  87.515 +            row_info->pixel_depth = 8;
  87.516 +            row_info->rowbytes = row_width;
  87.517 +         }
  87.518 +         else /* if (row_info->bit_depth == 16) */
  87.519 +         {
  87.520 +            if (flags & PNG_FLAG_FILLER_AFTER)
  87.521 +            {
  87.522 +               /* This converts from GGXX or GGAA to GG */
  87.523 +               sp += 4; dp += 2;
  87.524 +               for (i = 1; i < row_width; i++)
  87.525 +               {
  87.526 +                  *dp++ = *sp++;
  87.527 +                  *dp++ = *sp++;
  87.528 +                  sp += 2;
  87.529 +               }
  87.530 +            }
  87.531 +            else
  87.532 +            {
  87.533 +               /* This converts from XXGG or AAGG to GG */
  87.534 +               for (i = 0; i < row_width; i++)
  87.535 +               {
  87.536 +                  sp += 2;
  87.537 +                  *dp++ = *sp++;
  87.538 +                  *dp++ = *sp++;
  87.539 +               }
  87.540 +            }
  87.541 +            row_info->pixel_depth = 16;
  87.542 +            row_info->rowbytes = row_width * 2;
  87.543 +         }
  87.544 +         row_info->channels = 1;
  87.545 +      }
  87.546 +      if (flags & PNG_FLAG_STRIP_ALPHA)
  87.547 +        row_info->color_type &= ~PNG_COLOR_MASK_ALPHA;
  87.548 +   }
  87.549 +}
  87.550 +#endif
  87.551 +
  87.552 +#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED)
  87.553 +/* swaps red and blue bytes within a pixel */
  87.554 +void /* PRIVATE */
  87.555 +png_do_bgr(png_row_infop row_info, png_bytep row)
  87.556 +{
  87.557 +   png_debug(1, "in png_do_bgr\n");
  87.558 +   if (
  87.559 +#if defined(PNG_USELESS_TESTS_SUPPORTED)
  87.560 +       row != NULL && row_info != NULL &&
  87.561 +#endif
  87.562 +       (row_info->color_type & PNG_COLOR_MASK_COLOR))
  87.563 +   {
  87.564 +      png_uint_32 row_width = row_info->width;
  87.565 +      if (row_info->bit_depth == 8)
  87.566 +      {
  87.567 +         if (row_info->color_type == PNG_COLOR_TYPE_RGB)
  87.568 +         {
  87.569 +            png_bytep rp;
  87.570 +            png_uint_32 i;
  87.571 +
  87.572 +            for (i = 0, rp = row; i < row_width; i++, rp += 3)
  87.573 +            {
  87.574 +               png_byte save = *rp;
  87.575 +               *rp = *(rp + 2);
  87.576 +               *(rp + 2) = save;
  87.577 +            }
  87.578 +         }
  87.579 +         else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
  87.580 +         {
  87.581 +            png_bytep rp;
  87.582 +            png_uint_32 i;
  87.583 +
  87.584 +            for (i = 0, rp = row; i < row_width; i++, rp += 4)
  87.585 +            {
  87.586 +               png_byte save = *rp;
  87.587 +               *rp = *(rp + 2);
  87.588 +               *(rp + 2) = save;
  87.589 +            }
  87.590 +         }
  87.591 +      }
  87.592 +      else if (row_info->bit_depth == 16)
  87.593 +      {
  87.594 +         if (row_info->color_type == PNG_COLOR_TYPE_RGB)
  87.595 +         {
  87.596 +            png_bytep rp;
  87.597 +            png_uint_32 i;
  87.598 +
  87.599 +            for (i = 0, rp = row; i < row_width; i++, rp += 6)
  87.600 +            {
  87.601 +               png_byte save = *rp;
  87.602 +               *rp = *(rp + 4);
  87.603 +               *(rp + 4) = save;
  87.604 +               save = *(rp + 1);
  87.605 +               *(rp + 1) = *(rp + 5);
  87.606 +               *(rp + 5) = save;
  87.607 +            }
  87.608 +         }
  87.609 +         else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
  87.610 +         {
  87.611 +            png_bytep rp;
  87.612 +            png_uint_32 i;
  87.613 +
  87.614 +            for (i = 0, rp = row; i < row_width; i++, rp += 8)
  87.615 +            {
  87.616 +               png_byte save = *rp;
  87.617 +               *rp = *(rp + 4);
  87.618 +               *(rp + 4) = save;
  87.619 +               save = *(rp + 1);
  87.620 +               *(rp + 1) = *(rp + 5);
  87.621 +               *(rp + 5) = save;
  87.622 +            }
  87.623 +         }
  87.624 +      }
  87.625 +   }
  87.626 +}
  87.627 +#endif /* PNG_READ_BGR_SUPPORTED or PNG_WRITE_BGR_SUPPORTED */
  87.628 +
  87.629 +#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \
  87.630 +    defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) || \
  87.631 +    defined(PNG_LEGACY_SUPPORTED)
  87.632 +void PNGAPI
  87.633 +png_set_user_transform_info(png_structp png_ptr, png_voidp
  87.634 +   user_transform_ptr, int user_transform_depth, int user_transform_channels)
  87.635 +{
  87.636 +   png_debug(1, "in png_set_user_transform_info\n");
  87.637 +   if (png_ptr == NULL) return;
  87.638 +#if defined(PNG_USER_TRANSFORM_PTR_SUPPORTED)
  87.639 +   png_ptr->user_transform_ptr = user_transform_ptr;
  87.640 +   png_ptr->user_transform_depth = (png_byte)user_transform_depth;
  87.641 +   png_ptr->user_transform_channels = (png_byte)user_transform_channels;
  87.642 +#else
  87.643 +   if (user_transform_ptr || user_transform_depth || user_transform_channels)
  87.644 +      png_warning(png_ptr,
  87.645 +        "This version of libpng does not support user transform info");
  87.646 +#endif
  87.647 +}
  87.648 +#endif
  87.649 +
  87.650 +/* This function returns a pointer to the user_transform_ptr associated with
  87.651 + * the user transform functions.  The application should free any memory
  87.652 + * associated with this pointer before png_write_destroy and png_read_destroy
  87.653 + * are called.
  87.654 + */
  87.655 +png_voidp PNGAPI
  87.656 +png_get_user_transform_ptr(png_structp png_ptr)
  87.657 +{
  87.658 +   if (png_ptr == NULL) return (NULL);
  87.659 +#if defined(PNG_USER_TRANSFORM_PTR_SUPPORTED)
  87.660 +   return ((png_voidp)png_ptr->user_transform_ptr);
  87.661 +#else
  87.662 +   return (NULL);
  87.663 +#endif
  87.664 +}
  87.665 +#endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */
    88.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    88.2 +++ b/libs/libpng/pngvcrd.c	Sun Nov 01 00:36:56 2015 +0200
    88.3 @@ -0,0 +1,1 @@
    88.4 +/* pnggvrd.c was removed from libpng-1.2.20. */
    89.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    89.2 +++ b/libs/libpng/pngwio.c	Sun Nov 01 00:36:56 2015 +0200
    89.3 @@ -0,0 +1,234 @@
    89.4 +
    89.5 +/* pngwio.c - functions for data output
    89.6 + *
    89.7 + * Last changed in libpng 1.2.30 [August 15, 2008]
    89.8 + * For conditions of distribution and use, see copyright notice in png.h
    89.9 + * Copyright (c) 1998-2008 Glenn Randers-Pehrson
   89.10 + * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
   89.11 + * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
   89.12 + *
   89.13 + * This file provides a location for all output.  Users who need
   89.14 + * special handling are expected to write functions that have the same
   89.15 + * arguments as these and perform similar functions, but that possibly
   89.16 + * use different output methods.  Note that you shouldn't change these
   89.17 + * functions, but rather write replacement functions and then change
   89.18 + * them at run time with png_set_write_fn(...).
   89.19 + */
   89.20 +
   89.21 +#define PNG_INTERNAL
   89.22 +#include "png.h"
   89.23 +#ifdef PNG_WRITE_SUPPORTED
   89.24 +
   89.25 +/* Write the data to whatever output you are using.  The default routine
   89.26 +   writes to a file pointer.  Note that this routine sometimes gets called
   89.27 +   with very small lengths, so you should implement some kind of simple
   89.28 +   buffering if you are using unbuffered writes.  This should never be asked
   89.29 +   to write more than 64K on a 16 bit machine.  */
   89.30 +
   89.31 +void /* PRIVATE */
   89.32 +png_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
   89.33 +{
   89.34 +   if (png_ptr->write_data_fn != NULL )
   89.35 +      (*(png_ptr->write_data_fn))(png_ptr, data, length);
   89.36 +   else
   89.37 +      png_error(png_ptr, "Call to NULL write function");
   89.38 +}
   89.39 +
   89.40 +#if !defined(PNG_NO_STDIO)
   89.41 +/* This is the function that does the actual writing of data.  If you are
   89.42 +   not writing to a standard C stream, you should create a replacement
   89.43 +   write_data function and use it at run time with png_set_write_fn(), rather
   89.44 +   than changing the library. */
   89.45 +#ifndef USE_FAR_KEYWORD
   89.46 +void PNGAPI
   89.47 +png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
   89.48 +{
   89.49 +   png_uint_32 check;
   89.50 +
   89.51 +   if (png_ptr == NULL) return;
   89.52 +#if defined(_WIN32_WCE)
   89.53 +   if ( !WriteFile((HANDLE)(png_ptr->io_ptr), data, length, &check, NULL) )
   89.54 +      check = 0;
   89.55 +#else
   89.56 +   check = fwrite(data, 1, length, (png_FILE_p)(png_ptr->io_ptr));
   89.57 +#endif
   89.58 +   if (check != length)
   89.59 +      png_error(png_ptr, "Write Error");
   89.60 +}
   89.61 +#else
   89.62 +/* this is the model-independent version. Since the standard I/O library
   89.63 +   can't handle far buffers in the medium and small models, we have to copy
   89.64 +   the data.
   89.65 +*/
   89.66 +
   89.67 +#define NEAR_BUF_SIZE 1024
   89.68 +#define MIN(a,b) (a <= b ? a : b)
   89.69 +
   89.70 +void PNGAPI
   89.71 +png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
   89.72 +{
   89.73 +   png_uint_32 check;
   89.74 +   png_byte *near_data;  /* Needs to be "png_byte *" instead of "png_bytep" */
   89.75 +   png_FILE_p io_ptr;
   89.76 +
   89.77 +   if (png_ptr == NULL) return;
   89.78 +   /* Check if data really is near. If so, use usual code. */
   89.79 +   near_data = (png_byte *)CVT_PTR_NOCHECK(data);
   89.80 +   io_ptr = (png_FILE_p)CVT_PTR(png_ptr->io_ptr);
   89.81 +   if ((png_bytep)near_data == data)
   89.82 +   {
   89.83 +#if defined(_WIN32_WCE)
   89.84 +      if ( !WriteFile(io_ptr, near_data, length, &check, NULL) )
   89.85 +         check = 0;
   89.86 +#else
   89.87 +      check = fwrite(near_data, 1, length, io_ptr);
   89.88 +#endif
   89.89 +   }
   89.90 +   else
   89.91 +   {
   89.92 +      png_byte buf[NEAR_BUF_SIZE];
   89.93 +      png_size_t written, remaining, err;
   89.94 +      check = 0;
   89.95 +      remaining = length;
   89.96 +      do
   89.97 +      {
   89.98 +         written = MIN(NEAR_BUF_SIZE, remaining);
   89.99 +         png_memcpy(buf, data, written); /* copy far buffer to near buffer */
  89.100 +#if defined(_WIN32_WCE)
  89.101 +         if ( !WriteFile(io_ptr, buf, written, &err, NULL) )
  89.102 +            err = 0;
  89.103 +#else
  89.104 +         err = fwrite(buf, 1, written, io_ptr);
  89.105 +#endif
  89.106 +         if (err != written)
  89.107 +            break;
  89.108 +         else
  89.109 +            check += err;
  89.110 +         data += written;
  89.111 +         remaining -= written;
  89.112 +      }
  89.113 +      while (remaining != 0);
  89.114 +   }
  89.115 +   if (check != length)
  89.116 +      png_error(png_ptr, "Write Error");
  89.117 +}
  89.118 +
  89.119 +#endif
  89.120 +#endif
  89.121 +
  89.122 +/* This function is called to output any data pending writing (normally
  89.123 +   to disk).  After png_flush is called, there should be no data pending
  89.124 +   writing in any buffers. */
  89.125 +#if defined(PNG_WRITE_FLUSH_SUPPORTED)
  89.126 +void /* PRIVATE */
  89.127 +png_flush(png_structp png_ptr)
  89.128 +{
  89.129 +   if (png_ptr->output_flush_fn != NULL)
  89.130 +      (*(png_ptr->output_flush_fn))(png_ptr);
  89.131 +}
  89.132 +
  89.133 +#if !defined(PNG_NO_STDIO)
  89.134 +void PNGAPI
  89.135 +png_default_flush(png_structp png_ptr)
  89.136 +{
  89.137 +#if !defined(_WIN32_WCE)
  89.138 +   png_FILE_p io_ptr;
  89.139 +#endif
  89.140 +   if (png_ptr == NULL) return;
  89.141 +#if !defined(_WIN32_WCE)
  89.142 +   io_ptr = (png_FILE_p)CVT_PTR((png_ptr->io_ptr));
  89.143 +   if (io_ptr != NULL)
  89.144 +      fflush(io_ptr);
  89.145 +#endif
  89.146 +}
  89.147 +#endif
  89.148 +#endif
  89.149 +
  89.150 +/* This function allows the application to supply new output functions for
  89.151 +   libpng if standard C streams aren't being used.
  89.152 +
  89.153 +   This function takes as its arguments:
  89.154 +   png_ptr       - pointer to a png output data structure
  89.155 +   io_ptr        - pointer to user supplied structure containing info about
  89.156 +                   the output functions.  May be NULL.
  89.157 +   write_data_fn - pointer to a new output function that takes as its
  89.158 +                   arguments a pointer to a png_struct, a pointer to
  89.159 +                   data to be written, and a 32-bit unsigned int that is
  89.160 +                   the number of bytes to be written.  The new write
  89.161 +                   function should call png_error(png_ptr, "Error msg")
  89.162 +                   to exit and output any fatal error messages.
  89.163 +   flush_data_fn - pointer to a new flush function that takes as its
  89.164 +                   arguments a pointer to a png_struct.  After a call to
  89.165 +                   the flush function, there should be no data in any buffers
  89.166 +                   or pending transmission.  If the output method doesn't do
  89.167 +                   any buffering of ouput, a function prototype must still be
  89.168 +                   supplied although it doesn't have to do anything.  If
  89.169 +                   PNG_WRITE_FLUSH_SUPPORTED is not defined at libpng compile
  89.170 +                   time, output_flush_fn will be ignored, although it must be
  89.171 +                   supplied for compatibility. */
  89.172 +void PNGAPI
  89.173 +png_set_write_fn(png_structp png_ptr, png_voidp io_ptr,
  89.174 +   png_rw_ptr write_data_fn, png_flush_ptr output_flush_fn)
  89.175 +{
  89.176 +   if (png_ptr == NULL) return;
  89.177 +   png_ptr->io_ptr = io_ptr;
  89.178 +
  89.179 +#if !defined(PNG_NO_STDIO)
  89.180 +   if (write_data_fn != NULL)
  89.181 +      png_ptr->write_data_fn = write_data_fn;
  89.182 +   else
  89.183 +      png_ptr->write_data_fn = png_default_write_data;
  89.184 +#else
  89.185 +   png_ptr->write_data_fn = write_data_fn;
  89.186 +#endif
  89.187 +
  89.188 +#if defined(PNG_WRITE_FLUSH_SUPPORTED)
  89.189 +#if !defined(PNG_NO_STDIO)
  89.190 +   if (output_flush_fn != NULL)
  89.191 +      png_ptr->output_flush_fn = output_flush_fn;
  89.192 +   else
  89.193 +      png_ptr->output_flush_fn = png_default_flush;
  89.194 +#else
  89.195 +   png_ptr->output_flush_fn = output_flush_fn;
  89.196 +#endif
  89.197 +#endif /* PNG_WRITE_FLUSH_SUPPORTED */
  89.198 +
  89.199 +   /* It is an error to read while writing a png file */
  89.200 +   if (png_ptr->read_data_fn != NULL)
  89.201 +   {
  89.202 +      png_ptr->read_data_fn = NULL;
  89.203 +      png_warning(png_ptr,
  89.204 +         "Attempted to set both read_data_fn and write_data_fn in");
  89.205 +      png_warning(png_ptr,
  89.206 +         "the same structure.  Resetting read_data_fn to NULL.");
  89.207 +   }
  89.208 +}
  89.209 +
  89.210 +#if defined(USE_FAR_KEYWORD)
  89.211 +#if defined(_MSC_VER)
  89.212 +void *png_far_to_near(png_structp png_ptr, png_voidp ptr, int check)
  89.213 +{
  89.214 +   void *near_ptr;
  89.215 +   void FAR *far_ptr;
  89.216 +   FP_OFF(near_ptr) = FP_OFF(ptr);
  89.217 +   far_ptr = (void FAR *)near_ptr;
  89.218 +   if (check != 0)
  89.219 +      if (FP_SEG(ptr) != FP_SEG(far_ptr))
  89.220 +         png_error(png_ptr, "segment lost in conversion");
  89.221 +   return(near_ptr);
  89.222 +}
  89.223 +#  else
  89.224 +void *png_far_to_near(png_structp png_ptr, png_voidp ptr, int check)
  89.225 +{
  89.226 +   void *near_ptr;
  89.227 +   void FAR *far_ptr;
  89.228 +   near_ptr = (void FAR *)ptr;
  89.229 +   far_ptr = (void FAR *)near_ptr;
  89.230 +   if (check != 0)
  89.231 +      if (far_ptr != ptr)
  89.232 +         png_error(png_ptr, "segment lost in conversion");
  89.233 +   return(near_ptr);
  89.234 +}
  89.235 +#   endif
  89.236 +#   endif
  89.237 +#endif /* PNG_WRITE_SUPPORTED */
    90.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    90.2 +++ b/libs/libpng/pngwrite.c	Sun Nov 01 00:36:56 2015 +0200
    90.3 @@ -0,0 +1,1547 @@
    90.4 +
    90.5 +/* pngwrite.c - general routines to write a PNG file
    90.6 + *
    90.7 + * Last changed in libpng 1.2.31 [August 19, 2008]
    90.8 + * For conditions of distribution and use, see copyright notice in png.h
    90.9 + * Copyright (c) 1998-2008 Glenn Randers-Pehrson
   90.10 + * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
   90.11 + * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
   90.12 + */
   90.13 +
   90.14 +/* get internal access to png.h */
   90.15 +#define PNG_INTERNAL
   90.16 +#include "png.h"
   90.17 +#ifdef PNG_WRITE_SUPPORTED
   90.18 +
   90.19 +/* Writes all the PNG information.  This is the suggested way to use the
   90.20 + * library.  If you have a new chunk to add, make a function to write it,
   90.21 + * and put it in the correct location here.  If you want the chunk written
   90.22 + * after the image data, put it in png_write_end().  I strongly encourage
   90.23 + * you to supply a PNG_INFO_ flag, and check info_ptr->valid before writing
   90.24 + * the chunk, as that will keep the code from breaking if you want to just
   90.25 + * write a plain PNG file.  If you have long comments, I suggest writing
   90.26 + * them in png_write_end(), and compressing them.
   90.27 + */
   90.28 +void PNGAPI
   90.29 +png_write_info_before_PLTE(png_structp png_ptr, png_infop info_ptr)
   90.30 +{
   90.31 +   png_debug(1, "in png_write_info_before_PLTE\n");
   90.32 +   if (png_ptr == NULL || info_ptr == NULL)
   90.33 +      return;
   90.34 +   if (!(png_ptr->mode & PNG_WROTE_INFO_BEFORE_PLTE))
   90.35 +   {
   90.36 +   png_write_sig(png_ptr); /* write PNG signature */
   90.37 +#if defined(PNG_MNG_FEATURES_SUPPORTED)
   90.38 +   if ((png_ptr->mode&PNG_HAVE_PNG_SIGNATURE)&&(png_ptr->mng_features_permitted))
   90.39 +   {
   90.40 +      png_warning(png_ptr, "MNG features are not allowed in a PNG datastream");
   90.41 +      png_ptr->mng_features_permitted=0;
   90.42 +   }
   90.43 +#endif
   90.44 +   /* write IHDR information. */
   90.45 +   png_write_IHDR(png_ptr, info_ptr->width, info_ptr->height,
   90.46 +      info_ptr->bit_depth, info_ptr->color_type, info_ptr->compression_type,
   90.47 +      info_ptr->filter_type,
   90.48 +#if defined(PNG_WRITE_INTERLACING_SUPPORTED)
   90.49 +      info_ptr->interlace_type);
   90.50 +#else
   90.51 +      0);
   90.52 +#endif
   90.53 +   /* the rest of these check to see if the valid field has the appropriate
   90.54 +      flag set, and if it does, writes the chunk. */
   90.55 +#if defined(PNG_WRITE_gAMA_SUPPORTED)
   90.56 +   if (info_ptr->valid & PNG_INFO_gAMA)
   90.57 +   {
   90.58 +#  ifdef PNG_FLOATING_POINT_SUPPORTED
   90.59 +      png_write_gAMA(png_ptr, info_ptr->gamma);
   90.60 +#else
   90.61 +#ifdef PNG_FIXED_POINT_SUPPORTED
   90.62 +      png_write_gAMA_fixed(png_ptr, info_ptr->int_gamma);
   90.63 +#  endif
   90.64 +#endif
   90.65 +   }
   90.66 +#endif
   90.67 +#if defined(PNG_WRITE_sRGB_SUPPORTED)
   90.68 +   if (info_ptr->valid & PNG_INFO_sRGB)
   90.69 +      png_write_sRGB(png_ptr, (int)info_ptr->srgb_intent);
   90.70 +#endif
   90.71 +#if defined(PNG_WRITE_iCCP_SUPPORTED)
   90.72 +   if (info_ptr->valid & PNG_INFO_iCCP)
   90.73 +      png_write_iCCP(png_ptr, info_ptr->iccp_name, PNG_COMPRESSION_TYPE_BASE,
   90.74 +                     info_ptr->iccp_profile, (int)info_ptr->iccp_proflen);
   90.75 +#endif
   90.76 +#if defined(PNG_WRITE_sBIT_SUPPORTED)
   90.77 +   if (info_ptr->valid & PNG_INFO_sBIT)
   90.78 +      png_write_sBIT(png_ptr, &(info_ptr->sig_bit), info_ptr->color_type);
   90.79 +#endif
   90.80 +#if defined(PNG_WRITE_cHRM_SUPPORTED)
   90.81 +   if (info_ptr->valid & PNG_INFO_cHRM)
   90.82 +   {
   90.83 +#ifdef PNG_FLOATING_POINT_SUPPORTED
   90.84 +      png_write_cHRM(png_ptr,
   90.85 +         info_ptr->x_white, info_ptr->y_white,
   90.86 +         info_ptr->x_red, info_ptr->y_red,
   90.87 +         info_ptr->x_green, info_ptr->y_green,
   90.88 +         info_ptr->x_blue, info_ptr->y_blue);
   90.89 +#else
   90.90 +#  ifdef PNG_FIXED_POINT_SUPPORTED
   90.91 +      png_write_cHRM_fixed(png_ptr,
   90.92 +         info_ptr->int_x_white, info_ptr->int_y_white,
   90.93 +         info_ptr->int_x_red, info_ptr->int_y_red,
   90.94 +         info_ptr->int_x_green, info_ptr->int_y_green,
   90.95 +         info_ptr->int_x_blue, info_ptr->int_y_blue);
   90.96 +#  endif
   90.97 +#endif
   90.98 +   }
   90.99 +#endif
  90.100 +#if defined(PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED)
  90.101 +   if (info_ptr->unknown_chunks_num)
  90.102 +   {
  90.103 +       png_unknown_chunk *up;
  90.104 +
  90.105 +       png_debug(5, "writing extra chunks\n");
  90.106 +
  90.107 +       for (up = info_ptr->unknown_chunks;
  90.108 +            up < info_ptr->unknown_chunks + info_ptr->unknown_chunks_num;
  90.109 +            up++)
  90.110 +       {
  90.111 +         int keep=png_handle_as_unknown(png_ptr, up->name);
  90.112 +         if (keep != PNG_HANDLE_CHUNK_NEVER &&
  90.113 +            up->location && !(up->location & PNG_HAVE_PLTE) &&
  90.114 +            !(up->location & PNG_HAVE_IDAT) &&
  90.115 +            ((up->name[3] & 0x20) || keep == PNG_HANDLE_CHUNK_ALWAYS ||
  90.116 +            (png_ptr->flags & PNG_FLAG_KEEP_UNSAFE_CHUNKS)))
  90.117 +         {
  90.118 +            if (up->size == 0)
  90.119 +               png_warning(png_ptr, "Writing zero-length unknown chunk");
  90.120 +            png_write_chunk(png_ptr, up->name, up->data, up->size);
  90.121 +         }
  90.122 +       }
  90.123 +   }
  90.124 +#endif
  90.125 +      png_ptr->mode |= PNG_WROTE_INFO_BEFORE_PLTE;
  90.126 +   }
  90.127 +}
  90.128 +
  90.129 +void PNGAPI
  90.130 +png_write_info(png_structp png_ptr, png_infop info_ptr)
  90.131 +{
  90.132 +#if defined(PNG_WRITE_TEXT_SUPPORTED) || defined(PNG_WRITE_sPLT_SUPPORTED)
  90.133 +   int i;
  90.134 +#endif
  90.135 +
  90.136 +   png_debug(1, "in png_write_info\n");
  90.137 +
  90.138 +   if (png_ptr == NULL || info_ptr == NULL)
  90.139 +      return;
  90.140 +
  90.141 +   png_write_info_before_PLTE(png_ptr, info_ptr);
  90.142 +
  90.143 +   if (info_ptr->valid & PNG_INFO_PLTE)
  90.144 +      png_write_PLTE(png_ptr, info_ptr->palette,
  90.145 +         (png_uint_32)info_ptr->num_palette);
  90.146 +   else if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
  90.147 +      png_error(png_ptr, "Valid palette required for paletted images");
  90.148 +
  90.149 +#if defined(PNG_WRITE_tRNS_SUPPORTED)
  90.150 +   if (info_ptr->valid & PNG_INFO_tRNS)
  90.151 +      {
  90.152 +#if defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED)
  90.153 +         /* invert the alpha channel (in tRNS) */
  90.154 +         if ((png_ptr->transformations & PNG_INVERT_ALPHA) &&
  90.155 +            info_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
  90.156 +         {
  90.157 +            int j;
  90.158 +            for (j=0; j<(int)info_ptr->num_trans; j++)
  90.159 +               info_ptr->trans[j] = (png_byte)(255 - info_ptr->trans[j]);
  90.160 +         }
  90.161 +#endif
  90.162 +      png_write_tRNS(png_ptr, info_ptr->trans, &(info_ptr->trans_values),
  90.163 +         info_ptr->num_trans, info_ptr->color_type);
  90.164 +      }
  90.165 +#endif
  90.166 +#if defined(PNG_WRITE_bKGD_SUPPORTED)
  90.167 +   if (info_ptr->valid & PNG_INFO_bKGD)
  90.168 +      png_write_bKGD(png_ptr, &(info_ptr->background), info_ptr->color_type);
  90.169 +#endif
  90.170 +#if defined(PNG_WRITE_hIST_SUPPORTED)
  90.171 +   if (info_ptr->valid & PNG_INFO_hIST)
  90.172 +      png_write_hIST(png_ptr, info_ptr->hist, info_ptr->num_palette);
  90.173 +#endif
  90.174 +#if defined(PNG_WRITE_oFFs_SUPPORTED)
  90.175 +   if (info_ptr->valid & PNG_INFO_oFFs)
  90.176 +      png_write_oFFs(png_ptr, info_ptr->x_offset, info_ptr->y_offset,
  90.177 +         info_ptr->offset_unit_type);
  90.178 +#endif
  90.179 +#if defined(PNG_WRITE_pCAL_SUPPORTED)
  90.180 +   if (info_ptr->valid & PNG_INFO_pCAL)
  90.181 +      png_write_pCAL(png_ptr, info_ptr->pcal_purpose, info_ptr->pcal_X0,
  90.182 +         info_ptr->pcal_X1, info_ptr->pcal_type, info_ptr->pcal_nparams,
  90.183 +         info_ptr->pcal_units, info_ptr->pcal_params);
  90.184 +#endif
  90.185 +#if defined(PNG_WRITE_sCAL_SUPPORTED)
  90.186 +   if (info_ptr->valid & PNG_INFO_sCAL)
  90.187 +#if defined(PNG_FLOATING_POINT_SUPPORTED) && !defined(PNG_NO_STDIO)
  90.188 +      png_write_sCAL(png_ptr, (int)info_ptr->scal_unit,
  90.189 +          info_ptr->scal_pixel_width, info_ptr->scal_pixel_height);
  90.190 +#else
  90.191 +#ifdef PNG_FIXED_POINT_SUPPORTED
  90.192 +      png_write_sCAL_s(png_ptr, (int)info_ptr->scal_unit,
  90.193 +          info_ptr->scal_s_width, info_ptr->scal_s_height);
  90.194 +#else
  90.195 +      png_warning(png_ptr,
  90.196 +          "png_write_sCAL not supported; sCAL chunk not written.");
  90.197 +#endif
  90.198 +#endif
  90.199 +#endif
  90.200 +#if defined(PNG_WRITE_pHYs_SUPPORTED)
  90.201 +   if (info_ptr->valid & PNG_INFO_pHYs)
  90.202 +      png_write_pHYs(png_ptr, info_ptr->x_pixels_per_unit,
  90.203 +         info_ptr->y_pixels_per_unit, info_ptr->phys_unit_type);
  90.204 +#endif
  90.205 +#if defined(PNG_WRITE_tIME_SUPPORTED)
  90.206 +   if (info_ptr->valid & PNG_INFO_tIME)
  90.207 +   {
  90.208 +      png_write_tIME(png_ptr, &(info_ptr->mod_time));
  90.209 +      png_ptr->mode |= PNG_WROTE_tIME;
  90.210 +   }
  90.211 +#endif
  90.212 +#if defined(PNG_WRITE_sPLT_SUPPORTED)
  90.213 +   if (info_ptr->valid & PNG_INFO_sPLT)
  90.214 +     for (i = 0; i < (int)info_ptr->splt_palettes_num; i++)
  90.215 +       png_write_sPLT(png_ptr, info_ptr->splt_palettes + i);
  90.216 +#endif
  90.217 +#if defined(PNG_WRITE_TEXT_SUPPORTED)
  90.218 +   /* Check to see if we need to write text chunks */
  90.219 +   for (i = 0; i < info_ptr->num_text; i++)
  90.220 +   {
  90.221 +      png_debug2(2, "Writing header text chunk %d, type %d\n", i,
  90.222 +         info_ptr->text[i].compression);
  90.223 +      /* an internationalized chunk? */
  90.224 +      if (info_ptr->text[i].compression > 0)
  90.225 +      {
  90.226 +#if defined(PNG_WRITE_iTXt_SUPPORTED)
  90.227 +          /* write international chunk */
  90.228 +          png_write_iTXt(png_ptr,
  90.229 +                         info_ptr->text[i].compression,
  90.230 +                         info_ptr->text[i].key,
  90.231 +                         info_ptr->text[i].lang,
  90.232 +                         info_ptr->text[i].lang_key,
  90.233 +                         info_ptr->text[i].text);
  90.234 +#else
  90.235 +          png_warning(png_ptr, "Unable to write international text");
  90.236 +#endif
  90.237 +          /* Mark this chunk as written */
  90.238 +          info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_NONE_WR;
  90.239 +      }
  90.240 +      /* If we want a compressed text chunk */
  90.241 +      else if (info_ptr->text[i].compression == PNG_TEXT_COMPRESSION_zTXt)
  90.242 +      {
  90.243 +#if defined(PNG_WRITE_zTXt_SUPPORTED)
  90.244 +         /* write compressed chunk */
  90.245 +         png_write_zTXt(png_ptr, info_ptr->text[i].key,
  90.246 +            info_ptr->text[i].text, 0,
  90.247 +            info_ptr->text[i].compression);
  90.248 +#else
  90.249 +         png_warning(png_ptr, "Unable to write compressed text");
  90.250 +#endif
  90.251 +         /* Mark this chunk as written */
  90.252 +         info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_zTXt_WR;
  90.253 +      }
  90.254 +      else if (info_ptr->text[i].compression == PNG_TEXT_COMPRESSION_NONE)
  90.255 +      {
  90.256 +#if defined(PNG_WRITE_tEXt_SUPPORTED)
  90.257 +         /* write uncompressed chunk */
  90.258 +         png_write_tEXt(png_ptr, info_ptr->text[i].key,
  90.259 +                         info_ptr->text[i].text,
  90.260 +                         0);
  90.261 +#else
  90.262 +         png_warning(png_ptr, "Unable to write uncompressed text");
  90.263 +#endif
  90.264 +         /* Mark this chunk as written */
  90.265 +         info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_NONE_WR;
  90.266 +      }
  90.267 +   }
  90.268 +#endif
  90.269 +#if defined(PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED)
  90.270 +   if (info_ptr->unknown_chunks_num)
  90.271 +   {
  90.272 +       png_unknown_chunk *up;
  90.273 +
  90.274 +       png_debug(5, "writing extra chunks\n");
  90.275 +
  90.276 +       for (up = info_ptr->unknown_chunks;
  90.277 +            up < info_ptr->unknown_chunks + info_ptr->unknown_chunks_num;
  90.278 +            up++)
  90.279 +       {
  90.280 +         int keep=png_handle_as_unknown(png_ptr, up->name);
  90.281 +         if (keep != PNG_HANDLE_CHUNK_NEVER &&
  90.282 +            up->location && (up->location & PNG_HAVE_PLTE) &&
  90.283 +            !(up->location & PNG_HAVE_IDAT) &&
  90.284 +            ((up->name[3] & 0x20) || keep == PNG_HANDLE_CHUNK_ALWAYS ||
  90.285 +            (png_ptr->flags & PNG_FLAG_KEEP_UNSAFE_CHUNKS)))
  90.286 +         {
  90.287 +            png_write_chunk(png_ptr, up->name, up->data, up->size);
  90.288 +         }
  90.289 +       }
  90.290 +   }
  90.291 +#endif
  90.292 +}
  90.293 +
  90.294 +/* Writes the end of the PNG file.  If you don't want to write comments or
  90.295 + * time information, you can pass NULL for info.  If you already wrote these
  90.296 + * in png_write_info(), do not write them again here.  If you have long
  90.297 + * comments, I suggest writing them here, and compressing them.
  90.298 + */
  90.299 +void PNGAPI
  90.300 +png_write_end(png_structp png_ptr, png_infop info_ptr)
  90.301 +{
  90.302 +   png_debug(1, "in png_write_end\n");
  90.303 +   if (png_ptr == NULL)
  90.304 +      return;
  90.305 +   if (!(png_ptr->mode & PNG_HAVE_IDAT))
  90.306 +      png_error(png_ptr, "No IDATs written into file");
  90.307 +
  90.308 +   /* see if user wants us to write information chunks */
  90.309 +   if (info_ptr != NULL)
  90.310 +   {
  90.311 +#if defined(PNG_WRITE_TEXT_SUPPORTED)
  90.312 +      int i; /* local index variable */
  90.313 +#endif
  90.314 +#if defined(PNG_WRITE_tIME_SUPPORTED)
  90.315 +      /* check to see if user has supplied a time chunk */
  90.316 +      if ((info_ptr->valid & PNG_INFO_tIME) &&
  90.317 +         !(png_ptr->mode & PNG_WROTE_tIME))
  90.318 +         png_write_tIME(png_ptr, &(info_ptr->mod_time));
  90.319 +#endif
  90.320 +#if defined(PNG_WRITE_TEXT_SUPPORTED)
  90.321 +      /* loop through comment chunks */
  90.322 +      for (i = 0; i < info_ptr->num_text; i++)
  90.323 +      {
  90.324 +         png_debug2(2, "Writing trailer text chunk %d, type %d\n", i,
  90.325 +            info_ptr->text[i].compression);
  90.326 +         /* an internationalized chunk? */
  90.327 +         if (info_ptr->text[i].compression > 0)
  90.328 +         {
  90.329 +#if defined(PNG_WRITE_iTXt_SUPPORTED)
  90.330 +             /* write international chunk */
  90.331 +             png_write_iTXt(png_ptr,
  90.332 +                         info_ptr->text[i].compression,
  90.333 +                         info_ptr->text[i].key,
  90.334 +                         info_ptr->text[i].lang,
  90.335 +                         info_ptr->text[i].lang_key,
  90.336 +                         info_ptr->text[i].text);
  90.337 +#else
  90.338 +             png_warning(png_ptr, "Unable to write international text");
  90.339 +#endif
  90.340 +             /* Mark this chunk as written */
  90.341 +             info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_NONE_WR;
  90.342 +         }
  90.343 +         else if (info_ptr->text[i].compression >= PNG_TEXT_COMPRESSION_zTXt)
  90.344 +         {
  90.345 +#if defined(PNG_WRITE_zTXt_SUPPORTED)
  90.346 +            /* write compressed chunk */
  90.347 +            png_write_zTXt(png_ptr, info_ptr->text[i].key,
  90.348 +               info_ptr->text[i].text, 0,
  90.349 +               info_ptr->text[i].compression);
  90.350 +#else
  90.351 +            png_warning(png_ptr, "Unable to write compressed text");
  90.352 +#endif
  90.353 +            /* Mark this chunk as written */
  90.354 +            info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_zTXt_WR;
  90.355 +         }
  90.356 +         else if (info_ptr->text[i].compression == PNG_TEXT_COMPRESSION_NONE)
  90.357 +         {
  90.358 +#if defined(PNG_WRITE_tEXt_SUPPORTED)
  90.359 +            /* write uncompressed chunk */
  90.360 +            png_write_tEXt(png_ptr, info_ptr->text[i].key,
  90.361 +               info_ptr->text[i].text, 0);
  90.362 +#else
  90.363 +            png_warning(png_ptr, "Unable to write uncompressed text");
  90.364 +#endif
  90.365 +
  90.366 +            /* Mark this chunk as written */
  90.367 +            info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_NONE_WR;
  90.368 +         }
  90.369 +      }
  90.370 +#endif
  90.371 +#if defined(PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED)
  90.372 +   if (info_ptr->unknown_chunks_num)
  90.373 +   {
  90.374 +       png_unknown_chunk *up;
  90.375 +
  90.376 +       png_debug(5, "writing extra chunks\n");
  90.377 +
  90.378 +       for (up = info_ptr->unknown_chunks;
  90.379 +            up < info_ptr->unknown_chunks + info_ptr->unknown_chunks_num;
  90.380 +            up++)
  90.381 +       {
  90.382 +         int keep=png_handle_as_unknown(png_ptr, up->name);
  90.383 +         if (keep != PNG_HANDLE_CHUNK_NEVER &&
  90.384 +            up->location && (up->location & PNG_AFTER_IDAT) &&
  90.385 +            ((up->name[3] & 0x20) || keep == PNG_HANDLE_CHUNK_ALWAYS ||
  90.386 +            (png_ptr->flags & PNG_FLAG_KEEP_UNSAFE_CHUNKS)))
  90.387 +         {
  90.388 +            png_write_chunk(png_ptr, up->name, up->data, up->size);
  90.389 +         }
  90.390 +       }
  90.391 +   }
  90.392 +#endif
  90.393 +   }
  90.394 +
  90.395 +   png_ptr->mode |= PNG_AFTER_IDAT;
  90.396 +
  90.397 +   /* write end of PNG file */
  90.398 +   png_write_IEND(png_ptr);
  90.399 +   /* This flush, added in libpng-1.0.8, removed from libpng-1.0.9beta03,
  90.400 +    * and restored again in libpng-1.2.30, may cause some applications that
  90.401 +    * do not set png_ptr->output_flush_fn to crash.  If your application
  90.402 +    * experiences a problem, please try building libpng with
  90.403 +    * PNG_WRITE_FLUSH_AFTER_IEND_SUPPORTED defined, and report the event to
  90.404 +    * png-mng-implement at lists.sf.net .  This kludge will be removed
  90.405 +    * from libpng-1.4.0.
  90.406 +    */
  90.407 +#if defined(PNG_WRITE_FLUSH_SUPPORTED) && \
  90.408 +    defined(PNG_WRITE_FLUSH_AFTER_IEND_SUPPORTED)
  90.409 +   png_flush(png_ptr);
  90.410 +#endif
  90.411 +}
  90.412 +
  90.413 +#if defined(PNG_WRITE_tIME_SUPPORTED)
  90.414 +#if !defined(_WIN32_WCE)
  90.415 +/* "time.h" functions are not supported on WindowsCE */
  90.416 +void PNGAPI
  90.417 +png_convert_from_struct_tm(png_timep ptime, struct tm FAR * ttime)
  90.418 +{
  90.419 +   png_debug(1, "in png_convert_from_struct_tm\n");
  90.420 +   ptime->year = (png_uint_16)(1900 + ttime->tm_year);
  90.421 +   ptime->month = (png_byte)(ttime->tm_mon + 1);
  90.422 +   ptime->day = (png_byte)ttime->tm_mday;
  90.423 +   ptime->hour = (png_byte)ttime->tm_hour;
  90.424 +   ptime->minute = (png_byte)ttime->tm_min;
  90.425 +   ptime->second = (png_byte)ttime->tm_sec;
  90.426 +}
  90.427 +
  90.428 +void PNGAPI
  90.429 +png_convert_from_time_t(png_timep ptime, time_t ttime)
  90.430 +{
  90.431 +   struct tm *tbuf;
  90.432 +
  90.433 +   png_debug(1, "in png_convert_from_time_t\n");
  90.434 +   tbuf = gmtime(&ttime);
  90.435 +   png_convert_from_struct_tm(ptime, tbuf);
  90.436 +}
  90.437 +#endif
  90.438 +#endif
  90.439 +
  90.440 +/* Initialize png_ptr structure, and allocate any memory needed */
  90.441 +png_structp PNGAPI
  90.442 +png_create_write_struct(png_const_charp user_png_ver, png_voidp error_ptr,
  90.443 +   png_error_ptr error_fn, png_error_ptr warn_fn)
  90.444 +{
  90.445 +#ifdef PNG_USER_MEM_SUPPORTED
  90.446 +   return (png_create_write_struct_2(user_png_ver, error_ptr, error_fn,
  90.447 +      warn_fn, png_voidp_NULL, png_malloc_ptr_NULL, png_free_ptr_NULL));
  90.448 +}
  90.449 +
  90.450 +/* Alternate initialize png_ptr structure, and allocate any memory needed */
  90.451 +png_structp PNGAPI
  90.452 +png_create_write_struct_2(png_const_charp user_png_ver, png_voidp error_ptr,
  90.453 +   png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr,
  90.454 +   png_malloc_ptr malloc_fn, png_free_ptr free_fn)
  90.455 +{
  90.456 +#endif /* PNG_USER_MEM_SUPPORTED */
  90.457 +#ifdef PNG_SETJMP_SUPPORTED
  90.458 +    volatile
  90.459 +#endif
  90.460 +    png_structp png_ptr;
  90.461 +#ifdef PNG_SETJMP_SUPPORTED
  90.462 +#ifdef USE_FAR_KEYWORD
  90.463 +   jmp_buf jmpbuf;
  90.464 +#endif
  90.465 +#endif
  90.466 +   int i;
  90.467 +   png_debug(1, "in png_create_write_struct\n");
  90.468 +#ifdef PNG_USER_MEM_SUPPORTED
  90.469 +   png_ptr = (png_structp)png_create_struct_2(PNG_STRUCT_PNG,
  90.470 +      (png_malloc_ptr)malloc_fn, (png_voidp)mem_ptr);
  90.471 +#else
  90.472 +   png_ptr = (png_structp)png_create_struct(PNG_STRUCT_PNG);
  90.473 +#endif /* PNG_USER_MEM_SUPPORTED */
  90.474 +   if (png_ptr == NULL)
  90.475 +      return (NULL);
  90.476 +
  90.477 +   /* added at libpng-1.2.6 */
  90.478 +#ifdef PNG_SET_USER_LIMITS_SUPPORTED
  90.479 +   png_ptr->user_width_max=PNG_USER_WIDTH_MAX;
  90.480 +   png_ptr->user_height_max=PNG_USER_HEIGHT_MAX;
  90.481 +#endif
  90.482 +
  90.483 +#ifdef PNG_SETJMP_SUPPORTED
  90.484 +#ifdef USE_FAR_KEYWORD
  90.485 +   if (setjmp(jmpbuf))
  90.486 +#else
  90.487 +   if (setjmp(png_ptr->jmpbuf))
  90.488 +#endif
  90.489 +   {
  90.490 +      png_free(png_ptr, png_ptr->zbuf);
  90.491 +       png_ptr->zbuf=NULL;
  90.492 +      png_destroy_struct(png_ptr);
  90.493 +      return (NULL);
  90.494 +   }
  90.495 +#ifdef USE_FAR_KEYWORD
  90.496 +   png_memcpy(png_ptr->jmpbuf, jmpbuf, png_sizeof(jmp_buf));
  90.497 +#endif
  90.498 +#endif
  90.499 +
  90.500 +#ifdef PNG_USER_MEM_SUPPORTED
  90.501 +   png_set_mem_fn(png_ptr, mem_ptr, malloc_fn, free_fn);
  90.502 +#endif /* PNG_USER_MEM_SUPPORTED */
  90.503 +   png_set_error_fn(png_ptr, error_ptr, error_fn, warn_fn);
  90.504 +
  90.505 +   if (user_png_ver)
  90.506 +   {
  90.507 +     i=0;
  90.508 +     do
  90.509 +     {
  90.510 +       if (user_png_ver[i] != png_libpng_ver[i])
  90.511 +          png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH;
  90.512 +     } while (png_libpng_ver[i++]);
  90.513 +   }
  90.514 +
  90.515 +   if (png_ptr->flags & PNG_FLAG_LIBRARY_MISMATCH)
  90.516 +   {
  90.517 +     /* Libpng 0.90 and later are binary incompatible with libpng 0.89, so
  90.518 +      * we must recompile any applications that use any older library version.
  90.519 +      * For versions after libpng 1.0, we will be compatible, so we need
  90.520 +      * only check the first digit.
  90.521 +      */
  90.522 +     if (user_png_ver == NULL || user_png_ver[0] != png_libpng_ver[0] ||
  90.523 +         (user_png_ver[0] == '1' && user_png_ver[2] != png_libpng_ver[2]) ||
  90.524 +         (user_png_ver[0] == '0' && user_png_ver[2] < '9'))
  90.525 +     {
  90.526 +#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE)
  90.527 +        char msg[80];
  90.528 +        if (user_png_ver)
  90.529 +        {
  90.530 +          png_snprintf(msg, 80,
  90.531 +             "Application was compiled with png.h from libpng-%.20s",
  90.532 +             user_png_ver);
  90.533 +          png_warning(png_ptr, msg);
  90.534 +        }
  90.535 +        png_snprintf(msg, 80,
  90.536 +           "Application  is  running with png.c from libpng-%.20s",
  90.537 +           png_libpng_ver);
  90.538 +        png_warning(png_ptr, msg);
  90.539 +#endif
  90.540 +#ifdef PNG_ERROR_NUMBERS_SUPPORTED
  90.541 +        png_ptr->flags=0;
  90.542 +#endif
  90.543 +        png_error(png_ptr,
  90.544 +           "Incompatible libpng version in application and library");
  90.545 +     }
  90.546 +   }
  90.547 +
  90.548 +   /* initialize zbuf - compression buffer */
  90.549 +   png_ptr->zbuf_size = PNG_ZBUF_SIZE;
  90.550 +   png_ptr->zbuf = (png_bytep)png_malloc(png_ptr,
  90.551 +      (png_uint_32)png_ptr->zbuf_size);
  90.552 +
  90.553 +   png_set_write_fn(png_ptr, png_voidp_NULL, png_rw_ptr_NULL,
  90.554 +      png_flush_ptr_NULL);
  90.555 +
  90.556 +#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED)
  90.557 +   png_set_filter_heuristics(png_ptr, PNG_FILTER_HEURISTIC_DEFAULT,
  90.558 +      1, png_doublep_NULL, png_doublep_NULL);
  90.559 +#endif
  90.560 +
  90.561 +#ifdef PNG_SETJMP_SUPPORTED
  90.562 +/* Applications that neglect to set up their own setjmp() and then encounter
  90.563 +   a png_error() will longjmp here.  Since the jmpbuf is then meaningless we
  90.564 +   abort instead of returning. */
  90.565 +#ifdef USE_FAR_KEYWORD
  90.566 +   if (setjmp(jmpbuf))
  90.567 +      PNG_ABORT();
  90.568 +   png_memcpy(png_ptr->jmpbuf, jmpbuf, png_sizeof(jmp_buf));
  90.569 +#else
  90.570 +   if (setjmp(png_ptr->jmpbuf))
  90.571 +      PNG_ABORT();
  90.572 +#endif
  90.573 +#endif
  90.574 +   return (png_ptr);
  90.575 +}
  90.576 +
  90.577 +/* Initialize png_ptr structure, and allocate any memory needed */
  90.578 +#if defined(PNG_1_0_X) || defined(PNG_1_2_X)
  90.579 +/* Deprecated. */
  90.580 +#undef png_write_init
  90.581 +void PNGAPI
  90.582 +png_write_init(png_structp png_ptr)
  90.583 +{
  90.584 +   /* We only come here via pre-1.0.7-compiled applications */
  90.585 +   png_write_init_2(png_ptr, "1.0.6 or earlier", 0, 0);
  90.586 +}
  90.587 +
  90.588 +void PNGAPI
  90.589 +png_write_init_2(png_structp png_ptr, png_const_charp user_png_ver,
  90.590 +   png_size_t png_struct_size, png_size_t png_info_size)
  90.591 +{
  90.592 +   /* We only come here via pre-1.0.12-compiled applications */
  90.593 +   if (png_ptr == NULL) return;
  90.594 +#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE)
  90.595 +   if (png_sizeof(png_struct) > png_struct_size ||
  90.596 +      png_sizeof(png_info) > png_info_size)
  90.597 +   {
  90.598 +      char msg[80];
  90.599 +      png_ptr->warning_fn=NULL;
  90.600 +      if (user_png_ver)
  90.601 +      {
  90.602 +        png_snprintf(msg, 80,
  90.603 +           "Application was compiled with png.h from libpng-%.20s",
  90.604 +           user_png_ver);
  90.605 +        png_warning(png_ptr, msg);
  90.606 +      }
  90.607 +      png_snprintf(msg, 80,
  90.608 +         "Application  is  running with png.c from libpng-%.20s",
  90.609 +         png_libpng_ver);
  90.610 +      png_warning(png_ptr, msg);
  90.611 +   }
  90.612 +#endif
  90.613 +   if (png_sizeof(png_struct) > png_struct_size)
  90.614 +     {
  90.615 +       png_ptr->error_fn=NULL;
  90.616 +#ifdef PNG_ERROR_NUMBERS_SUPPORTED
  90.617 +       png_ptr->flags=0;
  90.618 +#endif
  90.619 +       png_error(png_ptr,
  90.620 +       "The png struct allocated by the application for writing is too small.");
  90.621 +     }
  90.622 +   if (png_sizeof(png_info) > png_info_size)
  90.623 +     {
  90.624 +       png_ptr->error_fn=NULL;
  90.625 +#ifdef PNG_ERROR_NUMBERS_SUPPORTED
  90.626 +       png_ptr->flags=0;
  90.627 +#endif
  90.628 +       png_error(png_ptr,
  90.629 +       "The info struct allocated by the application for writing is too small.");
  90.630 +     }
  90.631 +   png_write_init_3(&png_ptr, user_png_ver, png_struct_size);
  90.632 +}
  90.633 +#endif /* PNG_1_0_X || PNG_1_2_X */
  90.634 +
  90.635 +
  90.636 +void PNGAPI
  90.637 +png_write_init_3(png_structpp ptr_ptr, png_const_charp user_png_ver,
  90.638 +   png_size_t png_struct_size)
  90.639 +{
  90.640 +   png_structp png_ptr=*ptr_ptr;
  90.641 +#ifdef PNG_SETJMP_SUPPORTED
  90.642 +   jmp_buf tmp_jmp; /* to save current jump buffer */
  90.643 +#endif
  90.644 +
  90.645 +   int i = 0;
  90.646 +
  90.647 +   if (png_ptr == NULL)
  90.648 +      return;
  90.649 +
  90.650 +   do
  90.651 +   {
  90.652 +     if (user_png_ver[i] != png_libpng_ver[i])
  90.653 +     {
  90.654 +#ifdef PNG_LEGACY_SUPPORTED
  90.655 +       png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH;
  90.656 +#else
  90.657 +       png_ptr->warning_fn=NULL;
  90.658 +       png_warning(png_ptr,
  90.659 + "Application uses deprecated png_write_init() and should be recompiled.");
  90.660 +       break;
  90.661 +#endif
  90.662 +     }
  90.663 +   } while (png_libpng_ver[i++]);
  90.664 +
  90.665 +   png_debug(1, "in png_write_init_3\n");
  90.666 +
  90.667 +#ifdef PNG_SETJMP_SUPPORTED
  90.668 +   /* save jump buffer and error functions */
  90.669 +   png_memcpy(tmp_jmp, png_ptr->jmpbuf, png_sizeof(jmp_buf));
  90.670 +#endif
  90.671 +
  90.672 +   if (png_sizeof(png_struct) > png_struct_size)
  90.673 +     {
  90.674 +       png_destroy_struct(png_ptr);
  90.675 +       png_ptr = (png_structp)png_create_struct(PNG_STRUCT_PNG);
  90.676 +       *ptr_ptr = png_ptr;
  90.677 +     }
  90.678 +
  90.679 +   /* reset all variables to 0 */
  90.680 +   png_memset(png_ptr, 0, png_sizeof(png_struct));
  90.681 +
  90.682 +   /* added at libpng-1.2.6 */
  90.683 +#ifdef PNG_SET_USER_LIMITS_SUPPORTED
  90.684 +   png_ptr->user_width_max=PNG_USER_WIDTH_MAX;
  90.685 +   png_ptr->user_height_max=PNG_USER_HEIGHT_MAX;
  90.686 +#endif
  90.687 +
  90.688 +#ifdef PNG_SETJMP_SUPPORTED
  90.689 +   /* restore jump buffer */
  90.690 +   png_memcpy(png_ptr->jmpbuf, tmp_jmp, png_sizeof(jmp_buf));
  90.691 +#endif
  90.692 +
  90.693 +   png_set_write_fn(png_ptr, png_voidp_NULL, png_rw_ptr_NULL,
  90.694 +      png_flush_ptr_NULL);
  90.695 +
  90.696 +   /* initialize zbuf - compression buffer */
  90.697 +   png_ptr->zbuf_size = PNG_ZBUF_SIZE;
  90.698 +   png_ptr->zbuf = (png_bytep)png_malloc(png_ptr,
  90.699 +      (png_uint_32)png_ptr->zbuf_size);
  90.700 +
  90.701 +#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED)
  90.702 +   png_set_filter_heuristics(png_ptr, PNG_FILTER_HEURISTIC_DEFAULT,
  90.703 +      1, png_doublep_NULL, png_doublep_NULL);
  90.704 +#endif
  90.705 +}
  90.706 +
  90.707 +/* Write a few rows of image data.  If the image is interlaced,
  90.708 + * either you will have to write the 7 sub images, or, if you
  90.709 + * have called png_set_interlace_handling(), you will have to
  90.710 + * "write" the image seven times.
  90.711 + */
  90.712 +void PNGAPI
  90.713 +png_write_rows(png_structp png_ptr, png_bytepp row,
  90.714 +   png_uint_32 num_rows)
  90.715 +{
  90.716 +   png_uint_32 i; /* row counter */
  90.717 +   png_bytepp rp; /* row pointer */
  90.718 +
  90.719 +   png_debug(1, "in png_write_rows\n");
  90.720 +
  90.721 +   if (png_ptr == NULL)
  90.722 +      return;
  90.723 +
  90.724 +   /* loop through the rows */
  90.725 +   for (i = 0, rp = row; i < num_rows; i++, rp++)
  90.726 +   {
  90.727 +      png_write_row(png_ptr, *rp);
  90.728 +   }
  90.729 +}
  90.730 +
  90.731 +/* Write the image.  You only need to call this function once, even
  90.732 + * if you are writing an interlaced image.
  90.733 + */
  90.734 +void PNGAPI
  90.735 +png_write_image(png_structp png_ptr, png_bytepp image)
  90.736 +{
  90.737 +   png_uint_32 i; /* row index */
  90.738 +   int pass, num_pass; /* pass variables */
  90.739 +   png_bytepp rp; /* points to current row */
  90.740 +
  90.741 +   if (png_ptr == NULL)
  90.742 +      return;
  90.743 +
  90.744 +   png_debug(1, "in png_write_image\n");
  90.745 +#if defined(PNG_WRITE_INTERLACING_SUPPORTED)
  90.746 +   /* intialize interlace handling.  If image is not interlaced,
  90.747 +      this will set pass to 1 */
  90.748 +   num_pass = png_set_interlace_handling(png_ptr);
  90.749 +#else
  90.750 +   num_pass = 1;
  90.751 +#endif
  90.752 +   /* loop through passes */
  90.753 +   for (pass = 0; pass < num_pass; pass++)
  90.754 +   {
  90.755 +      /* loop through image */
  90.756 +      for (i = 0, rp = image; i < png_ptr->height; i++, rp++)
  90.757 +      {
  90.758 +         png_write_row(png_ptr, *rp);
  90.759 +      }
  90.760 +   }
  90.761 +}
  90.762 +
  90.763 +/* called by user to write a row of image data */
  90.764 +void PNGAPI
  90.765 +png_write_row(png_structp png_ptr, png_bytep row)
  90.766 +{
  90.767 +   if (png_ptr == NULL)
  90.768 +      return;
  90.769 +   png_debug2(1, "in png_write_row (row %ld, pass %d)\n",
  90.770 +      png_ptr->row_number, png_ptr->pass);
  90.771 +
  90.772 +   /* initialize transformations and other stuff if first time */
  90.773 +   if (png_ptr->row_number == 0 && png_ptr->pass == 0)
  90.774 +   {
  90.775 +   /* make sure we wrote the header info */
  90.776 +   if (!(png_ptr->mode & PNG_WROTE_INFO_BEFORE_PLTE))
  90.777 +      png_error(png_ptr,
  90.778 +         "png_write_info was never called before png_write_row.");
  90.779 +
  90.780 +   /* check for transforms that have been set but were defined out */
  90.781 +#if !defined(PNG_WRITE_INVERT_SUPPORTED) && defined(PNG_READ_INVERT_SUPPORTED)
  90.782 +   if (png_ptr->transformations & PNG_INVERT_MONO)
  90.783 +      png_warning(png_ptr, "PNG_WRITE_INVERT_SUPPORTED is not defined.");
  90.784 +#endif
  90.785 +#if !defined(PNG_WRITE_FILLER_SUPPORTED) && defined(PNG_READ_FILLER_SUPPORTED)
  90.786 +   if (png_ptr->transformations & PNG_FILLER)
  90.787 +      png_warning(png_ptr, "PNG_WRITE_FILLER_SUPPORTED is not defined.");
  90.788 +#endif
  90.789 +#if !defined(PNG_WRITE_PACKSWAP_SUPPORTED) && defined(PNG_READ_PACKSWAP_SUPPORTED)
  90.790 +   if (png_ptr->transformations & PNG_PACKSWAP)
  90.791 +      png_warning(png_ptr, "PNG_WRITE_PACKSWAP_SUPPORTED is not defined.");
  90.792 +#endif
  90.793 +#if !defined(PNG_WRITE_PACK_SUPPORTED) && defined(PNG_READ_PACK_SUPPORTED)
  90.794 +   if (png_ptr->transformations & PNG_PACK)
  90.795 +      png_warning(png_ptr, "PNG_WRITE_PACK_SUPPORTED is not defined.");
  90.796 +#endif
  90.797 +#if !defined(PNG_WRITE_SHIFT_SUPPORTED) && defined(PNG_READ_SHIFT_SUPPORTED)
  90.798 +   if (png_ptr->transformations & PNG_SHIFT)
  90.799 +      png_warning(png_ptr, "PNG_WRITE_SHIFT_SUPPORTED is not defined.");
  90.800 +#endif
  90.801 +#if !defined(PNG_WRITE_BGR_SUPPORTED) && defined(PNG_READ_BGR_SUPPORTED)
  90.802 +   if (png_ptr->transformations & PNG_BGR)
  90.803 +      png_warning(png_ptr, "PNG_WRITE_BGR_SUPPORTED is not defined.");
  90.804 +#endif
  90.805 +#if !defined(PNG_WRITE_SWAP_SUPPORTED) && defined(PNG_READ_SWAP_SUPPORTED)
  90.806 +   if (png_ptr->transformations & PNG_SWAP_BYTES)
  90.807 +      png_warning(png_ptr, "PNG_WRITE_SWAP_SUPPORTED is not defined.");
  90.808 +#endif
  90.809 +
  90.810 +      png_write_start_row(png_ptr);
  90.811 +   }
  90.812 +
  90.813 +#if defined(PNG_WRITE_INTERLACING_SUPPORTED)
  90.814 +   /* if interlaced and not interested in row, return */
  90.815 +   if (png_ptr->interlaced && (png_ptr->transformations & PNG_INTERLACE))
  90.816 +   {
  90.817 +      switch (png_ptr->pass)
  90.818 +      {
  90.819 +         case 0:
  90.820 +            if (png_ptr->row_number & 0x07)
  90.821 +            {
  90.822 +               png_write_finish_row(png_ptr);
  90.823 +               return;
  90.824 +            }
  90.825 +            break;
  90.826 +         case 1:
  90.827 +            if ((png_ptr->row_number & 0x07) || png_ptr->width < 5)
  90.828 +            {
  90.829 +               png_write_finish_row(png_ptr);
  90.830 +               return;
  90.831 +            }
  90.832 +            break;
  90.833 +         case 2:
  90.834 +            if ((png_ptr->row_number & 0x07) != 4)
  90.835 +            {
  90.836 +               png_write_finish_row(png_ptr);
  90.837 +               return;
  90.838 +            }
  90.839 +            break;
  90.840 +         case 3:
  90.841 +            if ((png_ptr->row_number & 0x03) || png_ptr->width < 3)
  90.842 +            {
  90.843 +               png_write_finish_row(png_ptr);
  90.844 +               return;
  90.845 +            }
  90.846 +            break;
  90.847 +         case 4:
  90.848 +            if ((png_ptr->row_number & 0x03) != 2)
  90.849 +            {
  90.850 +               png_write_finish_row(png_ptr);
  90.851 +               return;
  90.852 +            }
  90.853 +            break;
  90.854 +         case 5:
  90.855 +            if ((png_ptr->row_number & 0x01) || png_ptr->width < 2)
  90.856 +            {
  90.857 +               png_write_finish_row(png_ptr);
  90.858 +               return;
  90.859 +            }
  90.860 +            break;
  90.861 +         case 6:
  90.862 +            if (!(png_ptr->row_number & 0x01))
  90.863 +            {
  90.864 +               png_write_finish_row(png_ptr);
  90.865 +               return;
  90.866 +            }
  90.867 +            break;
  90.868 +      }
  90.869 +   }
  90.870 +#endif
  90.871 +
  90.872 +   /* set up row info for transformations */
  90.873 +   png_ptr->row_info.color_type = png_ptr->color_type;
  90.874 +   png_ptr->row_info.width = png_ptr->usr_width;
  90.875 +   png_ptr->row_info.channels = png_ptr->usr_channels;
  90.876 +   png_ptr->row_info.bit_depth = png_ptr->usr_bit_depth;
  90.877 +   png_ptr->row_info.pixel_depth = (png_byte)(png_ptr->row_info.bit_depth *
  90.878 +      png_ptr->row_info.channels);
  90.879 +
  90.880 +   png_ptr->row_info.rowbytes = PNG_ROWBYTES(png_ptr->row_info.pixel_depth,
  90.881 +      png_ptr->row_info.width);
  90.882 +
  90.883 +   png_debug1(3, "row_info->color_type = %d\n", png_ptr->row_info.color_type);
  90.884 +   png_debug1(3, "row_info->width = %lu\n", png_ptr->row_info.width);
  90.885 +   png_debug1(3, "row_info->channels = %d\n", png_ptr->row_info.channels);
  90.886 +   png_debug1(3, "row_info->bit_depth = %d\n", png_ptr->row_info.bit_depth);
  90.887 +   png_debug1(3, "row_info->pixel_depth = %d\n", png_ptr->row_info.pixel_depth);
  90.888 +   png_debug1(3, "row_info->rowbytes = %lu\n", png_ptr->row_info.rowbytes);
  90.889 +
  90.890 +   /* Copy user's row into buffer, leaving room for filter byte. */
  90.891 +   png_memcpy_check(png_ptr, png_ptr->row_buf + 1, row,
  90.892 +      png_ptr->row_info.rowbytes);
  90.893 +
  90.894 +#if defined(PNG_WRITE_INTERLACING_SUPPORTED)
  90.895 +   /* handle interlacing */
  90.896 +   if (png_ptr->interlaced && png_ptr->pass < 6 &&
  90.897 +      (png_ptr->transformations & PNG_INTERLACE))
  90.898 +   {
  90.899 +      png_do_write_interlace(&(png_ptr->row_info),
  90.900 +         png_ptr->row_buf + 1, png_ptr->pass);
  90.901 +      /* this should always get caught above, but still ... */
  90.902 +      if (!(png_ptr->row_info.width))
  90.903 +      {
  90.904 +         png_write_finish_row(png_ptr);
  90.905 +         return;
  90.906 +      }
  90.907 +   }
  90.908 +#endif
  90.909 +
  90.910 +   /* handle other transformations */
  90.911 +   if (png_ptr->transformations)
  90.912 +      png_do_write_transformations(png_ptr);
  90.913 +
  90.914 +#if defined(PNG_MNG_FEATURES_SUPPORTED)
  90.915 +   /* Write filter_method 64 (intrapixel differencing) only if
  90.916 +    * 1. Libpng was compiled with PNG_MNG_FEATURES_SUPPORTED and
  90.917 +    * 2. Libpng did not write a PNG signature (this filter_method is only
  90.918 +    *    used in PNG datastreams that are embedded in MNG datastreams) and
  90.919 +    * 3. The application called png_permit_mng_features with a mask that
  90.920 +    *    included PNG_FLAG_MNG_FILTER_64 and
  90.921 +    * 4. The filter_method is 64 and
  90.922 +    * 5. The color_type is RGB or RGBA
  90.923 +    */
  90.924 +   if ((png_ptr->mng_features_permitted & PNG_FLAG_MNG_FILTER_64) &&
  90.925 +      (png_ptr->filter_type == PNG_INTRAPIXEL_DIFFERENCING))
  90.926 +   {
  90.927 +      /* Intrapixel differencing */
  90.928 +      png_do_write_intrapixel(&(png_ptr->row_info), png_ptr->row_buf + 1);
  90.929 +   }
  90.930 +#endif
  90.931 +
  90.932 +   /* Find a filter if necessary, filter the row and write it out. */
  90.933 +   png_write_find_filter(png_ptr, &(png_ptr->row_info));
  90.934 +
  90.935 +   if (png_ptr->write_row_fn != NULL)
  90.936 +      (*(png_ptr->write_row_fn))(png_ptr, png_ptr->row_number, png_ptr->pass);
  90.937 +}
  90.938 +
  90.939 +#if defined(PNG_WRITE_FLUSH_SUPPORTED)
  90.940 +/* Set the automatic flush interval or 0 to turn flushing off */
  90.941 +void PNGAPI
  90.942 +png_set_flush(png_structp png_ptr, int nrows)
  90.943 +{
  90.944 +   png_debug(1, "in png_set_flush\n");
  90.945 +   if (png_ptr == NULL)
  90.946 +      return;
  90.947 +   png_ptr->flush_dist = (nrows < 0 ? 0 : nrows);
  90.948 +}
  90.949 +
  90.950 +/* flush the current output buffers now */
  90.951 +void PNGAPI
  90.952 +png_write_flush(png_structp png_ptr)
  90.953 +{
  90.954 +   int wrote_IDAT;
  90.955 +
  90.956 +   png_debug(1, "in png_write_flush\n");
  90.957 +   if (png_ptr == NULL)
  90.958 +      return;
  90.959 +   /* We have already written out all of the data */
  90.960 +   if (png_ptr->row_number >= png_ptr->num_rows)
  90.961 +     return;
  90.962 +
  90.963 +   do
  90.964 +   {
  90.965 +      int ret;
  90.966 +
  90.967 +      /* compress the data */
  90.968 +      ret = deflate(&png_ptr->zstream, Z_SYNC_FLUSH);
  90.969 +      wrote_IDAT = 0;
  90.970 +
  90.971 +      /* check for compression errors */
  90.972 +      if (ret != Z_OK)
  90.973 +      {
  90.974 +         if (png_ptr->zstream.msg != NULL)
  90.975 +            png_error(png_ptr, png_ptr->zstream.msg);
  90.976 +         else
  90.977 +            png_error(png_ptr, "zlib error");
  90.978 +      }
  90.979 +
  90.980 +      if (!(png_ptr->zstream.avail_out))
  90.981 +      {
  90.982 +         /* write the IDAT and reset the zlib output buffer */
  90.983 +         png_write_IDAT(png_ptr, png_ptr->zbuf,
  90.984 +                        png_ptr->zbuf_size);
  90.985 +         png_ptr->zstream.next_out = png_ptr->zbuf;
  90.986 +         png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
  90.987 +         wrote_IDAT = 1;
  90.988 +      }
  90.989 +   } while(wrote_IDAT == 1);
  90.990 +
  90.991 +   /* If there is any data left to be output, write it into a new IDAT */
  90.992 +   if (png_ptr->zbuf_size != png_ptr->zstream.avail_out)
  90.993 +   {
  90.994 +      /* write the IDAT and reset the zlib output buffer */
  90.995 +      png_write_IDAT(png_ptr, png_ptr->zbuf,
  90.996 +                     png_ptr->zbuf_size - png_ptr->zstream.avail_out);
  90.997 +      png_ptr->zstream.next_out = png_ptr->zbuf;
  90.998 +      png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
  90.999 +   }
 90.1000 +   png_ptr->flush_rows = 0;
 90.1001 +   png_flush(png_ptr);
 90.1002 +}
 90.1003 +#endif /* PNG_WRITE_FLUSH_SUPPORTED */
 90.1004 +
 90.1005 +/* free all memory used by the write */
 90.1006 +void PNGAPI
 90.1007 +png_destroy_write_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr)
 90.1008 +{
 90.1009 +   png_structp png_ptr = NULL;
 90.1010 +   png_infop info_ptr = NULL;
 90.1011 +#ifdef PNG_USER_MEM_SUPPORTED
 90.1012 +   png_free_ptr free_fn = NULL;
 90.1013 +   png_voidp mem_ptr = NULL;
 90.1014 +#endif
 90.1015 +
 90.1016 +   png_debug(1, "in png_destroy_write_struct\n");
 90.1017 +   if (png_ptr_ptr != NULL)
 90.1018 +   {
 90.1019 +      png_ptr = *png_ptr_ptr;
 90.1020 +#ifdef PNG_USER_MEM_SUPPORTED
 90.1021 +      free_fn = png_ptr->free_fn;
 90.1022 +      mem_ptr = png_ptr->mem_ptr;
 90.1023 +#endif
 90.1024 +   }
 90.1025 +
 90.1026 +#ifdef PNG_USER_MEM_SUPPORTED
 90.1027 +   if (png_ptr != NULL)
 90.1028 +   {
 90.1029 +      free_fn = png_ptr->free_fn;
 90.1030 +      mem_ptr = png_ptr->mem_ptr;
 90.1031 +   }
 90.1032 +#endif
 90.1033 +
 90.1034 +   if (info_ptr_ptr != NULL)
 90.1035 +      info_ptr = *info_ptr_ptr;
 90.1036 +
 90.1037 +   if (info_ptr != NULL)
 90.1038 +   {
 90.1039 +      if (png_ptr != NULL)
 90.1040 +      {
 90.1041 +        png_free_data(png_ptr, info_ptr, PNG_FREE_ALL, -1);
 90.1042 +
 90.1043 +#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
 90.1044 +        if (png_ptr->num_chunk_list)
 90.1045 +        {
 90.1046 +           png_free(png_ptr, png_ptr->chunk_list);
 90.1047 +           png_ptr->chunk_list=NULL;
 90.1048 +           png_ptr->num_chunk_list = 0;
 90.1049 +        }
 90.1050 +#endif
 90.1051 +      }
 90.1052 +
 90.1053 +#ifdef PNG_USER_MEM_SUPPORTED
 90.1054 +      png_destroy_struct_2((png_voidp)info_ptr, (png_free_ptr)free_fn,
 90.1055 +         (png_voidp)mem_ptr);
 90.1056 +#else
 90.1057 +      png_destroy_struct((png_voidp)info_ptr);
 90.1058 +#endif
 90.1059 +      *info_ptr_ptr = NULL;
 90.1060 +   }
 90.1061 +
 90.1062 +   if (png_ptr != NULL)
 90.1063 +   {
 90.1064 +      png_write_destroy(png_ptr);
 90.1065 +#ifdef PNG_USER_MEM_SUPPORTED
 90.1066 +      png_destroy_struct_2((png_voidp)png_ptr, (png_free_ptr)free_fn,
 90.1067 +         (png_voidp)mem_ptr);
 90.1068 +#else
 90.1069 +      png_destroy_struct((png_voidp)png_ptr);
 90.1070 +#endif
 90.1071 +      *png_ptr_ptr = NULL;
 90.1072 +   }
 90.1073 +}
 90.1074 +
 90.1075 +
 90.1076 +/* Free any memory used in png_ptr struct (old method) */
 90.1077 +void /* PRIVATE */
 90.1078 +png_write_destroy(png_structp png_ptr)
 90.1079 +{
 90.1080 +#ifdef PNG_SETJMP_SUPPORTED
 90.1081 +   jmp_buf tmp_jmp; /* save jump buffer */
 90.1082 +#endif
 90.1083 +   png_error_ptr error_fn;
 90.1084 +   png_error_ptr warning_fn;
 90.1085 +   png_voidp error_ptr;
 90.1086 +#ifdef PNG_USER_MEM_SUPPORTED
 90.1087 +   png_free_ptr free_fn;
 90.1088 +#endif
 90.1089 +
 90.1090 +   png_debug(1, "in png_write_destroy\n");
 90.1091 +   /* free any memory zlib uses */
 90.1092 +   deflateEnd(&png_ptr->zstream);
 90.1093 +
 90.1094 +   /* free our memory.  png_free checks NULL for us. */
 90.1095 +   png_free(png_ptr, png_ptr->zbuf);
 90.1096 +   png_free(png_ptr, png_ptr->row_buf);
 90.1097 +#ifndef PNG_NO_WRITE_FILTER
 90.1098 +   png_free(png_ptr, png_ptr->prev_row);
 90.1099 +   png_free(png_ptr, png_ptr->sub_row);
 90.1100 +   png_free(png_ptr, png_ptr->up_row);
 90.1101 +   png_free(png_ptr, png_ptr->avg_row);
 90.1102 +   png_free(png_ptr, png_ptr->paeth_row);
 90.1103 +#endif
 90.1104 +
 90.1105 +#if defined(PNG_TIME_RFC1123_SUPPORTED)
 90.1106 +   png_free(png_ptr, png_ptr->time_buffer);
 90.1107 +#endif
 90.1108 +
 90.1109 +#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED)
 90.1110 +   png_free(png_ptr, png_ptr->prev_filters);
 90.1111 +   png_free(png_ptr, png_ptr->filter_weights);
 90.1112 +   png_free(png_ptr, png_ptr->inv_filter_weights);
 90.1113 +   png_free(png_ptr, png_ptr->filter_costs);
 90.1114 +   png_free(png_ptr, png_ptr->inv_filter_costs);
 90.1115 +#endif
 90.1116 +
 90.1117 +#ifdef PNG_SETJMP_SUPPORTED
 90.1118 +   /* reset structure */
 90.1119 +   png_memcpy(tmp_jmp, png_ptr->jmpbuf, png_sizeof(jmp_buf));
 90.1120 +#endif
 90.1121 +
 90.1122 +   error_fn = png_ptr->error_fn;
 90.1123 +   warning_fn = png_ptr->warning_fn;
 90.1124 +   error_ptr = png_ptr->error_ptr;
 90.1125 +#ifdef PNG_USER_MEM_SUPPORTED
 90.1126 +   free_fn = png_ptr->free_fn;
 90.1127 +#endif
 90.1128 +
 90.1129 +   png_memset(png_ptr, 0, png_sizeof(png_struct));
 90.1130 +
 90.1131 +   png_ptr->error_fn = error_fn;
 90.1132 +   png_ptr->warning_fn = warning_fn;
 90.1133 +   png_ptr->error_ptr = error_ptr;
 90.1134 +#ifdef PNG_USER_MEM_SUPPORTED
 90.1135 +   png_ptr->free_fn = free_fn;
 90.1136 +#endif
 90.1137 +
 90.1138 +#ifdef PNG_SETJMP_SUPPORTED
 90.1139 +   png_memcpy(png_ptr->jmpbuf, tmp_jmp, png_sizeof(jmp_buf));
 90.1140 +#endif
 90.1141 +}
 90.1142 +
 90.1143 +/* Allow the application to select one or more row filters to use. */
 90.1144 +void PNGAPI
 90.1145 +png_set_filter(png_structp png_ptr, int method, int filters)
 90.1146 +{
 90.1147 +   png_debug(1, "in png_set_filter\n");
 90.1148 +   if (png_ptr == NULL)
 90.1149 +      return;
 90.1150 +#if defined(PNG_MNG_FEATURES_SUPPORTED)
 90.1151 +   if ((png_ptr->mng_features_permitted & PNG_FLAG_MNG_FILTER_64) &&
 90.1152 +      (method == PNG_INTRAPIXEL_DIFFERENCING))
 90.1153 +         method = PNG_FILTER_TYPE_BASE;
 90.1154 +#endif
 90.1155 +   if (method == PNG_FILTER_TYPE_BASE)
 90.1156 +   {
 90.1157 +      switch (filters & (PNG_ALL_FILTERS | 0x07))
 90.1158 +      {
 90.1159 +#ifndef PNG_NO_WRITE_FILTER
 90.1160 +         case 5:
 90.1161 +         case 6:
 90.1162 +         case 7: png_warning(png_ptr, "Unknown row filter for method 0");
 90.1163 +#endif /* PNG_NO_WRITE_FILTER */
 90.1164 +         case PNG_FILTER_VALUE_NONE:
 90.1165 +              png_ptr->do_filter=PNG_FILTER_NONE; break;
 90.1166 +#ifndef PNG_NO_WRITE_FILTER
 90.1167 +         case PNG_FILTER_VALUE_SUB:
 90.1168 +              png_ptr->do_filter=PNG_FILTER_SUB; break;
 90.1169 +         case PNG_FILTER_VALUE_UP:
 90.1170 +              png_ptr->do_filter=PNG_FILTER_UP; break;
 90.1171 +         case PNG_FILTER_VALUE_AVG:
 90.1172 +              png_ptr->do_filter=PNG_FILTER_AVG; break;
 90.1173 +         case PNG_FILTER_VALUE_PAETH:
 90.1174 +              png_ptr->do_filter=PNG_FILTER_PAETH; break;
 90.1175 +         default: png_ptr->do_filter = (png_byte)filters; break;
 90.1176 +#else
 90.1177 +         default: png_warning(png_ptr, "Unknown row filter for method 0");
 90.1178 +#endif /* PNG_NO_WRITE_FILTER */
 90.1179 +      }
 90.1180 +
 90.1181 +      /* If we have allocated the row_buf, this means we have already started
 90.1182 +       * with the image and we should have allocated all of the filter buffers
 90.1183 +       * that have been selected.  If prev_row isn't already allocated, then
 90.1184 +       * it is too late to start using the filters that need it, since we
 90.1185 +       * will be missing the data in the previous row.  If an application
 90.1186 +       * wants to start and stop using particular filters during compression,
 90.1187 +       * it should start out with all of the filters, and then add and
 90.1188 +       * remove them after the start of compression.
 90.1189 +       */
 90.1190 +      if (png_ptr->row_buf != NULL)
 90.1191 +      {
 90.1192 +#ifndef PNG_NO_WRITE_FILTER
 90.1193 +         if ((png_ptr->do_filter & PNG_FILTER_SUB) && png_ptr->sub_row == NULL)
 90.1194 +         {
 90.1195 +            png_ptr->sub_row = (png_bytep)png_malloc(png_ptr,
 90.1196 +              (png_ptr->rowbytes + 1));
 90.1197 +            png_ptr->sub_row[0] = PNG_FILTER_VALUE_SUB;
 90.1198 +         }
 90.1199 +
 90.1200 +         if ((png_ptr->do_filter & PNG_FILTER_UP) && png_ptr->up_row == NULL)
 90.1201 +         {
 90.1202 +            if (png_ptr->prev_row == NULL)
 90.1203 +            {
 90.1204 +               png_warning(png_ptr, "Can't add Up filter after starting");
 90.1205 +               png_ptr->do_filter &= ~PNG_FILTER_UP;
 90.1206 +            }
 90.1207 +            else
 90.1208 +            {
 90.1209 +               png_ptr->up_row = (png_bytep)png_malloc(png_ptr,
 90.1210 +                  (png_ptr->rowbytes + 1));
 90.1211 +               png_ptr->up_row[0] = PNG_FILTER_VALUE_UP;
 90.1212 +            }
 90.1213 +         }
 90.1214 +
 90.1215 +         if ((png_ptr->do_filter & PNG_FILTER_AVG) && png_ptr->avg_row == NULL)
 90.1216 +         {
 90.1217 +            if (png_ptr->prev_row == NULL)
 90.1218 +            {
 90.1219 +               png_warning(png_ptr, "Can't add Average filter after starting");
 90.1220 +               png_ptr->do_filter &= ~PNG_FILTER_AVG;
 90.1221 +            }
 90.1222 +            else
 90.1223 +            {
 90.1224 +               png_ptr->avg_row = (png_bytep)png_malloc(png_ptr,
 90.1225 +                  (png_ptr->rowbytes + 1));
 90.1226 +               png_ptr->avg_row[0] = PNG_FILTER_VALUE_AVG;
 90.1227 +            }
 90.1228 +         }
 90.1229 +
 90.1230 +         if ((png_ptr->do_filter & PNG_FILTER_PAETH) &&
 90.1231 +             png_ptr->paeth_row == NULL)
 90.1232 +         {
 90.1233 +            if (png_ptr->prev_row == NULL)
 90.1234 +            {
 90.1235 +               png_warning(png_ptr, "Can't add Paeth filter after starting");
 90.1236 +               png_ptr->do_filter &= (png_byte)(~PNG_FILTER_PAETH);
 90.1237 +            }
 90.1238 +            else
 90.1239 +            {
 90.1240 +               png_ptr->paeth_row = (png_bytep)png_malloc(png_ptr,
 90.1241 +                  (png_ptr->rowbytes + 1));
 90.1242 +               png_ptr->paeth_row[0] = PNG_FILTER_VALUE_PAETH;
 90.1243 +            }
 90.1244 +         }
 90.1245 +
 90.1246 +         if (png_ptr->do_filter == PNG_NO_FILTERS)
 90.1247 +#endif /* PNG_NO_WRITE_FILTER */
 90.1248 +            png_ptr->do_filter = PNG_FILTER_NONE;
 90.1249 +      }
 90.1250 +   }
 90.1251 +   else
 90.1252 +      png_error(png_ptr, "Unknown custom filter method");
 90.1253 +}
 90.1254 +
 90.1255 +/* This allows us to influence the way in which libpng chooses the "best"
 90.1256 + * filter for the current scanline.  While the "minimum-sum-of-absolute-
 90.1257 + * differences metric is relatively fast and effective, there is some
 90.1258 + * question as to whether it can be improved upon by trying to keep the
 90.1259 + * filtered data going to zlib more consistent, hopefully resulting in
 90.1260 + * better compression.
 90.1261 + */
 90.1262 +#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED)      /* GRR 970116 */
 90.1263 +void PNGAPI
 90.1264 +png_set_filter_heuristics(png_structp png_ptr, int heuristic_method,
 90.1265 +   int num_weights, png_doublep filter_weights,
 90.1266 +   png_doublep filter_costs)
 90.1267 +{
 90.1268 +   int i;
 90.1269 +
 90.1270 +   png_debug(1, "in png_set_filter_heuristics\n");
 90.1271 +   if (png_ptr == NULL)
 90.1272 +      return;
 90.1273 +   if (heuristic_method >= PNG_FILTER_HEURISTIC_LAST)
 90.1274 +   {
 90.1275 +      png_warning(png_ptr, "Unknown filter heuristic method");
 90.1276 +      return;
 90.1277 +   }
 90.1278 +
 90.1279 +   if (heuristic_method == PNG_FILTER_HEURISTIC_DEFAULT)
 90.1280 +   {
 90.1281 +      heuristic_method = PNG_FILTER_HEURISTIC_UNWEIGHTED;
 90.1282 +   }
 90.1283 +
 90.1284 +   if (num_weights < 0 || filter_weights == NULL ||
 90.1285 +      heuristic_method == PNG_FILTER_HEURISTIC_UNWEIGHTED)
 90.1286 +   {
 90.1287 +      num_weights = 0;
 90.1288 +   }
 90.1289 +
 90.1290 +   png_ptr->num_prev_filters = (png_byte)num_weights;
 90.1291 +   png_ptr->heuristic_method = (png_byte)heuristic_method;
 90.1292 +
 90.1293 +   if (num_weights > 0)
 90.1294 +   {
 90.1295 +      if (png_ptr->prev_filters == NULL)
 90.1296 +      {
 90.1297 +         png_ptr->prev_filters = (png_bytep)png_malloc(png_ptr,
 90.1298 +            (png_uint_32)(png_sizeof(png_byte) * num_weights));
 90.1299 +
 90.1300 +         /* To make sure that the weighting starts out fairly */
 90.1301 +         for (i = 0; i < num_weights; i++)
 90.1302 +         {
 90.1303 +            png_ptr->prev_filters[i] = 255;
 90.1304 +         }
 90.1305 +      }
 90.1306 +
 90.1307 +      if (png_ptr->filter_weights == NULL)
 90.1308 +      {
 90.1309 +         png_ptr->filter_weights = (png_uint_16p)png_malloc(png_ptr,
 90.1310 +            (png_uint_32)(png_sizeof(png_uint_16) * num_weights));
 90.1311 +
 90.1312 +         png_ptr->inv_filter_weights = (png_uint_16p)png_malloc(png_ptr,
 90.1313 +            (png_uint_32)(png_sizeof(png_uint_16) * num_weights));
 90.1314 +         for (i = 0; i < num_weights; i++)
 90.1315 +         {
 90.1316 +            png_ptr->inv_filter_weights[i] =
 90.1317 +            png_ptr->filter_weights[i] = PNG_WEIGHT_FACTOR;
 90.1318 +         }
 90.1319 +      }
 90.1320 +
 90.1321 +      for (i = 0; i < num_weights; i++)
 90.1322 +      {
 90.1323 +         if (filter_weights[i] < 0.0)
 90.1324 +         {
 90.1325 +            png_ptr->inv_filter_weights[i] =
 90.1326 +            png_ptr->filter_weights[i] = PNG_WEIGHT_FACTOR;
 90.1327 +         }
 90.1328 +         else
 90.1329 +         {
 90.1330 +            png_ptr->inv_filter_weights[i] =
 90.1331 +               (png_uint_16)((double)PNG_WEIGHT_FACTOR*filter_weights[i]+0.5);
 90.1332 +            png_ptr->filter_weights[i] =
 90.1333 +               (png_uint_16)((double)PNG_WEIGHT_FACTOR/filter_weights[i]+0.5);
 90.1334 +         }
 90.1335 +      }
 90.1336 +   }
 90.1337 +
 90.1338 +   /* If, in the future, there are other filter methods, this would
 90.1339 +    * need to be based on png_ptr->filter.
 90.1340 +    */
 90.1341 +   if (png_ptr->filter_costs == NULL)
 90.1342 +   {
 90.1343 +      png_ptr->filter_costs = (png_uint_16p)png_malloc(png_ptr,
 90.1344 +         (png_uint_32)(png_sizeof(png_uint_16) * PNG_FILTER_VALUE_LAST));
 90.1345 +
 90.1346 +      png_ptr->inv_filter_costs = (png_uint_16p)png_malloc(png_ptr,
 90.1347 +         (png_uint_32)(png_sizeof(png_uint_16) * PNG_FILTER_VALUE_LAST));
 90.1348 +
 90.1349 +      for (i = 0; i < PNG_FILTER_VALUE_LAST; i++)
 90.1350 +      {
 90.1351 +         png_ptr->inv_filter_costs[i] =
 90.1352 +         png_ptr->filter_costs[i] = PNG_COST_FACTOR;
 90.1353 +      }
 90.1354 +   }
 90.1355 +
 90.1356 +   /* Here is where we set the relative costs of the different filters.  We
 90.1357 +    * should take the desired compression level into account when setting
 90.1358 +    * the costs, so that Paeth, for instance, has a high relative cost at low
 90.1359 +    * compression levels, while it has a lower relative cost at higher
 90.1360 +    * compression settings.  The filter types are in order of increasing
 90.1361 +    * relative cost, so it would be possible to do this with an algorithm.
 90.1362 +    */
 90.1363 +   for (i = 0; i < PNG_FILTER_VALUE_LAST; i++)
 90.1364 +   {
 90.1365 +      if (filter_costs == NULL || filter_costs[i] < 0.0)
 90.1366 +      {
 90.1367 +         png_ptr->inv_filter_costs[i] =
 90.1368 +         png_ptr->filter_costs[i] = PNG_COST_FACTOR;
 90.1369 +      }
 90.1370 +      else if (filter_costs[i] >= 1.0)
 90.1371 +      {
 90.1372 +         png_ptr->inv_filter_costs[i] =
 90.1373 +            (png_uint_16)((double)PNG_COST_FACTOR / filter_costs[i] + 0.5);
 90.1374 +         png_ptr->filter_costs[i] =
 90.1375 +            (png_uint_16)((double)PNG_COST_FACTOR * filter_costs[i] + 0.5);
 90.1376 +      }
 90.1377 +   }
 90.1378 +}
 90.1379 +#endif /* PNG_WRITE_WEIGHTED_FILTER_SUPPORTED */
 90.1380 +
 90.1381 +void PNGAPI
 90.1382 +png_set_compression_level(png_structp png_ptr, int level)
 90.1383 +{
 90.1384 +   png_debug(1, "in png_set_compression_level\n");
 90.1385 +   if (png_ptr == NULL)
 90.1386 +      return;
 90.1387 +   png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_LEVEL;
 90.1388 +   png_ptr->zlib_level = level;
 90.1389 +}
 90.1390 +
 90.1391 +void PNGAPI
 90.1392 +png_set_compression_mem_level(png_structp png_ptr, int mem_level)
 90.1393 +{
 90.1394 +   png_debug(1, "in png_set_compression_mem_level\n");
 90.1395 +   if (png_ptr == NULL)
 90.1396 +      return;
 90.1397 +   png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_MEM_LEVEL;
 90.1398 +   png_ptr->zlib_mem_level = mem_level;
 90.1399 +}
 90.1400 +
 90.1401 +void PNGAPI
 90.1402 +png_set_compression_strategy(png_structp png_ptr, int strategy)
 90.1403 +{
 90.1404 +   png_debug(1, "in png_set_compression_strategy\n");
 90.1405 +   if (png_ptr == NULL)
 90.1406 +      return;
 90.1407 +   png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_STRATEGY;
 90.1408 +   png_ptr->zlib_strategy = strategy;
 90.1409 +}
 90.1410 +
 90.1411 +void PNGAPI
 90.1412 +png_set_compression_window_bits(png_structp png_ptr, int window_bits)
 90.1413 +{
 90.1414 +   if (png_ptr == NULL)
 90.1415 +      return;
 90.1416 +   if (window_bits > 15)
 90.1417 +      png_warning(png_ptr, "Only compression windows <= 32k supported by PNG");
 90.1418 +   else if (window_bits < 8)
 90.1419 +      png_warning(png_ptr, "Only compression windows >= 256 supported by PNG");
 90.1420 +#ifndef WBITS_8_OK
 90.1421 +   /* avoid libpng bug with 256-byte windows */
 90.1422 +   if (window_bits == 8)
 90.1423 +     {
 90.1424 +       png_warning(png_ptr, "Compression window is being reset to 512");
 90.1425 +       window_bits=9;
 90.1426 +     }
 90.1427 +#endif
 90.1428 +   png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_WINDOW_BITS;
 90.1429 +   png_ptr->zlib_window_bits = window_bits;
 90.1430 +}
 90.1431 +
 90.1432 +void PNGAPI
 90.1433 +png_set_compression_method(png_structp png_ptr, int method)
 90.1434 +{
 90.1435 +   png_debug(1, "in png_set_compression_method\n");
 90.1436 +   if (png_ptr == NULL)
 90.1437 +      return;
 90.1438 +   if (method != 8)
 90.1439 +      png_warning(png_ptr, "Only compression method 8 is supported by PNG");
 90.1440 +   png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_METHOD;
 90.1441 +   png_ptr->zlib_method = method;
 90.1442 +}
 90.1443 +
 90.1444 +void PNGAPI
 90.1445 +png_set_write_status_fn(png_structp png_ptr, png_write_status_ptr write_row_fn)
 90.1446 +{
 90.1447 +   if (png_ptr == NULL)
 90.1448 +      return;
 90.1449 +   png_ptr->write_row_fn = write_row_fn;
 90.1450 +}
 90.1451 +
 90.1452 +#if defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)
 90.1453 +void PNGAPI
 90.1454 +png_set_write_user_transform_fn(png_structp png_ptr, png_user_transform_ptr
 90.1455 +   write_user_transform_fn)
 90.1456 +{
 90.1457 +   png_debug(1, "in png_set_write_user_transform_fn\n");
 90.1458 +   if (png_ptr == NULL)
 90.1459 +      return;
 90.1460 +   png_ptr->transformations |= PNG_USER_TRANSFORM;
 90.1461 +   png_ptr->write_user_transform_fn = write_user_transform_fn;
 90.1462 +}
 90.1463 +#endif
 90.1464 +
 90.1465 +
 90.1466 +#if defined(PNG_INFO_IMAGE_SUPPORTED)
 90.1467 +void PNGAPI
 90.1468 +png_write_png(png_structp png_ptr, png_infop info_ptr,
 90.1469 +              int transforms, voidp params)
 90.1470 +{
 90.1471 +   if (png_ptr == NULL || info_ptr == NULL)
 90.1472 +      return;
 90.1473 +#if defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED)
 90.1474 +   /* invert the alpha channel from opacity to transparency */
 90.1475 +   if (transforms & PNG_TRANSFORM_INVERT_ALPHA)
 90.1476 +       png_set_invert_alpha(png_ptr);
 90.1477 +#endif
 90.1478 +
 90.1479 +   /* Write the file header information. */
 90.1480 +   png_write_info(png_ptr, info_ptr);
 90.1481 +
 90.1482 +   /* ------ these transformations don't touch the info structure ------- */
 90.1483 +
 90.1484 +#if defined(PNG_WRITE_INVERT_SUPPORTED)
 90.1485 +   /* invert monochrome pixels */
 90.1486 +   if (transforms & PNG_TRANSFORM_INVERT_MONO)
 90.1487 +       png_set_invert_mono(png_ptr);
 90.1488 +#endif
 90.1489 +
 90.1490 +#if defined(PNG_WRITE_SHIFT_SUPPORTED)
 90.1491 +   /* Shift the pixels up to a legal bit depth and fill in
 90.1492 +    * as appropriate to correctly scale the image.
 90.1493 +    */
 90.1494 +   if ((transforms & PNG_TRANSFORM_SHIFT)
 90.1495 +               && (info_ptr->valid & PNG_INFO_sBIT))
 90.1496 +       png_set_shift(png_ptr, &info_ptr->sig_bit);
 90.1497 +#endif
 90.1498 +
 90.1499 +#if defined(PNG_WRITE_PACK_SUPPORTED)
 90.1500 +   /* pack pixels into bytes */
 90.1501 +   if (transforms & PNG_TRANSFORM_PACKING)
 90.1502 +       png_set_packing(png_ptr);
 90.1503 +#endif
 90.1504 +
 90.1505 +#if defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED)
 90.1506 +   /* swap location of alpha bytes from ARGB to RGBA */
 90.1507 +   if (transforms & PNG_TRANSFORM_SWAP_ALPHA)
 90.1508 +       png_set_swap_alpha(png_ptr);
 90.1509 +#endif
 90.1510 +
 90.1511 +#if defined(PNG_WRITE_FILLER_SUPPORTED)
 90.1512 +   /* Get rid of filler (OR ALPHA) bytes, pack XRGB/RGBX/ARGB/RGBA into
 90.1513 +    * RGB (4 channels -> 3 channels). The second parameter is not used.
 90.1514 +    */
 90.1515 +   if (transforms & PNG_TRANSFORM_STRIP_FILLER)
 90.1516 +       png_set_filler(png_ptr, 0, PNG_FILLER_BEFORE);
 90.1517 +#endif
 90.1518 +
 90.1519 +#if defined(PNG_WRITE_BGR_SUPPORTED)
 90.1520 +   /* flip BGR pixels to RGB */
 90.1521 +   if (transforms & PNG_TRANSFORM_BGR)
 90.1522 +       png_set_bgr(png_ptr);
 90.1523 +#endif
 90.1524 +
 90.1525 +#if defined(PNG_WRITE_SWAP_SUPPORTED)
 90.1526 +   /* swap bytes of 16-bit files to most significant byte first */
 90.1527 +   if (transforms & PNG_TRANSFORM_SWAP_ENDIAN)
 90.1528 +       png_set_swap(png_ptr);
 90.1529 +#endif
 90.1530 +
 90.1531 +#if defined(PNG_WRITE_PACKSWAP_SUPPORTED)
 90.1532 +   /* swap bits of 1, 2, 4 bit packed pixel formats */
 90.1533 +   if (transforms & PNG_TRANSFORM_PACKSWAP)
 90.1534 +       png_set_packswap(png_ptr);
 90.1535 +#endif
 90.1536 +
 90.1537 +   /* ----------------------- end of transformations ------------------- */
 90.1538 +
 90.1539 +   /* write the bits */
 90.1540 +   if (info_ptr->valid & PNG_INFO_IDAT)
 90.1541 +       png_write_image(png_ptr, info_ptr->row_pointers);
 90.1542 +
 90.1543 +   /* It is REQUIRED to call this to finish writing the rest of the file */
 90.1544 +   png_write_end(png_ptr, info_ptr);
 90.1545 +
 90.1546 +   transforms = transforms; /* quiet compiler warnings */
 90.1547 +   params = params;
 90.1548 +}
 90.1549 +#endif
 90.1550 +#endif /* PNG_WRITE_SUPPORTED */
    91.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    91.2 +++ b/libs/libpng/pngwtran.c	Sun Nov 01 00:36:56 2015 +0200
    91.3 @@ -0,0 +1,572 @@
    91.4 +
    91.5 +/* pngwtran.c - transforms the data in a row for PNG writers
    91.6 + *
    91.7 + * Last changed in libpng 1.2.9 April 14, 2006
    91.8 + * For conditions of distribution and use, see copyright notice in png.h
    91.9 + * Copyright (c) 1998-2006 Glenn Randers-Pehrson
   91.10 + * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
   91.11 + * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
   91.12 + */
   91.13 +
   91.14 +#define PNG_INTERNAL
   91.15 +#include "png.h"
   91.16 +#ifdef PNG_WRITE_SUPPORTED
   91.17 +
   91.18 +/* Transform the data according to the user's wishes.  The order of
   91.19 + * transformations is significant.
   91.20 + */
   91.21 +void /* PRIVATE */
   91.22 +png_do_write_transformations(png_structp png_ptr)
   91.23 +{
   91.24 +   png_debug(1, "in png_do_write_transformations\n");
   91.25 +
   91.26 +   if (png_ptr == NULL)
   91.27 +      return;
   91.28 +
   91.29 +#if defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)
   91.30 +   if (png_ptr->transformations & PNG_USER_TRANSFORM)
   91.31 +      if (png_ptr->write_user_transform_fn != NULL)
   91.32 +        (*(png_ptr->write_user_transform_fn)) /* user write transform function */
   91.33 +          (png_ptr,                    /* png_ptr */
   91.34 +           &(png_ptr->row_info),       /* row_info:     */
   91.35 +             /*  png_uint_32 width;          width of row */
   91.36 +             /*  png_uint_32 rowbytes;       number of bytes in row */
   91.37 +             /*  png_byte color_type;        color type of pixels */
   91.38 +             /*  png_byte bit_depth;         bit depth of samples */
   91.39 +             /*  png_byte channels;          number of channels (1-4) */
   91.40 +             /*  png_byte pixel_depth;       bits per pixel (depth*channels) */
   91.41 +           png_ptr->row_buf + 1);      /* start of pixel data for row */
   91.42 +#endif
   91.43 +#if defined(PNG_WRITE_FILLER_SUPPORTED)
   91.44 +   if (png_ptr->transformations & PNG_FILLER)
   91.45 +      png_do_strip_filler(&(png_ptr->row_info), png_ptr->row_buf + 1,
   91.46 +         png_ptr->flags);
   91.47 +#endif
   91.48 +#if defined(PNG_WRITE_PACKSWAP_SUPPORTED)
   91.49 +   if (png_ptr->transformations & PNG_PACKSWAP)
   91.50 +      png_do_packswap(&(png_ptr->row_info), png_ptr->row_buf + 1);
   91.51 +#endif
   91.52 +#if defined(PNG_WRITE_PACK_SUPPORTED)
   91.53 +   if (png_ptr->transformations & PNG_PACK)
   91.54 +      png_do_pack(&(png_ptr->row_info), png_ptr->row_buf + 1,
   91.55 +         (png_uint_32)png_ptr->bit_depth);
   91.56 +#endif
   91.57 +#if defined(PNG_WRITE_SWAP_SUPPORTED)
   91.58 +   if (png_ptr->transformations & PNG_SWAP_BYTES)
   91.59 +      png_do_swap(&(png_ptr->row_info), png_ptr->row_buf + 1);
   91.60 +#endif
   91.61 +#if defined(PNG_WRITE_SHIFT_SUPPORTED)
   91.62 +   if (png_ptr->transformations & PNG_SHIFT)
   91.63 +      png_do_shift(&(png_ptr->row_info), png_ptr->row_buf + 1,
   91.64 +         &(png_ptr->shift));
   91.65 +#endif
   91.66 +#if defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED)
   91.67 +   if (png_ptr->transformations & PNG_SWAP_ALPHA)
   91.68 +      png_do_write_swap_alpha(&(png_ptr->row_info), png_ptr->row_buf + 1);
   91.69 +#endif
   91.70 +#if defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED)
   91.71 +   if (png_ptr->transformations & PNG_INVERT_ALPHA)
   91.72 +      png_do_write_invert_alpha(&(png_ptr->row_info), png_ptr->row_buf + 1);
   91.73 +#endif
   91.74 +#if defined(PNG_WRITE_BGR_SUPPORTED)
   91.75 +   if (png_ptr->transformations & PNG_BGR)
   91.76 +      png_do_bgr(&(png_ptr->row_info), png_ptr->row_buf + 1);
   91.77 +#endif
   91.78 +#if defined(PNG_WRITE_INVERT_SUPPORTED)
   91.79 +   if (png_ptr->transformations & PNG_INVERT_MONO)
   91.80 +      png_do_invert(&(png_ptr->row_info), png_ptr->row_buf + 1);
   91.81 +#endif
   91.82 +}
   91.83 +
   91.84 +#if defined(PNG_WRITE_PACK_SUPPORTED)
   91.85 +/* Pack pixels into bytes.  Pass the true bit depth in bit_depth.  The
   91.86 + * row_info bit depth should be 8 (one pixel per byte).  The channels
   91.87 + * should be 1 (this only happens on grayscale and paletted images).
   91.88 + */
   91.89 +void /* PRIVATE */
   91.90 +png_do_pack(png_row_infop row_info, png_bytep row, png_uint_32 bit_depth)
   91.91 +{
   91.92 +   png_debug(1, "in png_do_pack\n");
   91.93 +   if (row_info->bit_depth == 8 &&
   91.94 +#if defined(PNG_USELESS_TESTS_SUPPORTED)
   91.95 +       row != NULL && row_info != NULL &&
   91.96 +#endif
   91.97 +      row_info->channels == 1)
   91.98 +   {
   91.99 +      switch ((int)bit_depth)
  91.100 +      {
  91.101 +         case 1:
  91.102 +         {
  91.103 +            png_bytep sp, dp;
  91.104 +            int mask, v;
  91.105 +            png_uint_32 i;
  91.106 +            png_uint_32 row_width = row_info->width;
  91.107 +
  91.108 +            sp = row;
  91.109 +            dp = row;
  91.110 +            mask = 0x80;
  91.111 +            v = 0;
  91.112 +
  91.113 +            for (i = 0; i < row_width; i++)
  91.114 +            {
  91.115 +               if (*sp != 0)
  91.116 +                  v |= mask;
  91.117 +               sp++;
  91.118 +               if (mask > 1)
  91.119 +                  mask >>= 1;
  91.120 +               else
  91.121 +               {
  91.122 +                  mask = 0x80;
  91.123 +                  *dp = (png_byte)v;
  91.124 +                  dp++;
  91.125 +                  v = 0;
  91.126 +               }
  91.127 +            }
  91.128 +            if (mask != 0x80)
  91.129 +               *dp = (png_byte)v;
  91.130 +            break;
  91.131 +         }
  91.132 +         case 2:
  91.133 +         {
  91.134 +            png_bytep sp, dp;
  91.135 +            int shift, v;
  91.136 +            png_uint_32 i;
  91.137 +            png_uint_32 row_width = row_info->width;
  91.138 +
  91.139 +            sp = row;
  91.140 +            dp = row;
  91.141 +            shift = 6;
  91.142 +            v = 0;
  91.143 +            for (i = 0; i < row_width; i++)
  91.144 +            {
  91.145 +               png_byte value;
  91.146 +
  91.147 +               value = (png_byte)(*sp & 0x03);
  91.148 +               v |= (value << shift);
  91.149 +               if (shift == 0)
  91.150 +               {
  91.151 +                  shift = 6;
  91.152 +                  *dp = (png_byte)v;
  91.153 +                  dp++;
  91.154 +                  v = 0;
  91.155 +               }
  91.156 +               else
  91.157 +                  shift -= 2;
  91.158 +               sp++;
  91.159 +            }
  91.160 +            if (shift != 6)
  91.161 +               *dp = (png_byte)v;
  91.162 +            break;
  91.163 +         }
  91.164 +         case 4:
  91.165 +         {
  91.166 +            png_bytep sp, dp;
  91.167 +            int shift, v;
  91.168 +            png_uint_32 i;
  91.169 +            png_uint_32 row_width = row_info->width;
  91.170 +
  91.171 +            sp = row;
  91.172 +            dp = row;
  91.173 +            shift = 4;
  91.174 +            v = 0;
  91.175 +            for (i = 0; i < row_width; i++)
  91.176 +            {
  91.177 +               png_byte value;
  91.178 +
  91.179 +               value = (png_byte)(*sp & 0x0f);
  91.180 +               v |= (value << shift);
  91.181 +
  91.182 +               if (shift == 0)
  91.183 +               {
  91.184 +                  shift = 4;
  91.185 +                  *dp = (png_byte)v;
  91.186 +                  dp++;
  91.187 +                  v = 0;
  91.188 +               }
  91.189 +               else
  91.190 +                  shift -= 4;
  91.191 +
  91.192 +               sp++;
  91.193 +            }
  91.194 +            if (shift != 4)
  91.195 +               *dp = (png_byte)v;
  91.196 +            break;
  91.197 +         }
  91.198 +      }
  91.199 +      row_info->bit_depth = (png_byte)bit_depth;
  91.200 +      row_info->pixel_depth = (png_byte)(bit_depth * row_info->channels);
  91.201 +      row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth,
  91.202 +         row_info->width);
  91.203 +   }
  91.204 +}
  91.205 +#endif
  91.206 +
  91.207 +#if defined(PNG_WRITE_SHIFT_SUPPORTED)
  91.208 +/* Shift pixel values to take advantage of whole range.  Pass the
  91.209 + * true number of bits in bit_depth.  The row should be packed
  91.210 + * according to row_info->bit_depth.  Thus, if you had a row of
  91.211 + * bit depth 4, but the pixels only had values from 0 to 7, you
  91.212 + * would pass 3 as bit_depth, and this routine would translate the
  91.213 + * data to 0 to 15.
  91.214 + */
  91.215 +void /* PRIVATE */
  91.216 +png_do_shift(png_row_infop row_info, png_bytep row, png_color_8p bit_depth)
  91.217 +{
  91.218 +   png_debug(1, "in png_do_shift\n");
  91.219 +#if defined(PNG_USELESS_TESTS_SUPPORTED)
  91.220 +   if (row != NULL && row_info != NULL &&
  91.221 +#else
  91.222 +   if (
  91.223 +#endif
  91.224 +      row_info->color_type != PNG_COLOR_TYPE_PALETTE)
  91.225 +   {
  91.226 +      int shift_start[4], shift_dec[4];
  91.227 +      int channels = 0;
  91.228 +
  91.229 +      if (row_info->color_type & PNG_COLOR_MASK_COLOR)
  91.230 +      {
  91.231 +         shift_start[channels] = row_info->bit_depth - bit_depth->red;
  91.232 +         shift_dec[channels] = bit_depth->red;
  91.233 +         channels++;
  91.234 +         shift_start[channels] = row_info->bit_depth - bit_depth->green;
  91.235 +         shift_dec[channels] = bit_depth->green;
  91.236 +         channels++;
  91.237 +         shift_start[channels] = row_info->bit_depth - bit_depth->blue;
  91.238 +         shift_dec[channels] = bit_depth->blue;
  91.239 +         channels++;
  91.240 +      }
  91.241 +      else
  91.242 +      {
  91.243 +         shift_start[channels] = row_info->bit_depth - bit_depth->gray;
  91.244 +         shift_dec[channels] = bit_depth->gray;
  91.245 +         channels++;
  91.246 +      }
  91.247 +      if (row_info->color_type & PNG_COLOR_MASK_ALPHA)
  91.248 +      {
  91.249 +         shift_start[channels] = row_info->bit_depth - bit_depth->alpha;
  91.250 +         shift_dec[channels] = bit_depth->alpha;
  91.251 +         channels++;
  91.252 +      }
  91.253 +
  91.254 +      /* with low row depths, could only be grayscale, so one channel */
  91.255 +      if (row_info->bit_depth < 8)
  91.256 +      {
  91.257 +         png_bytep bp = row;
  91.258 +         png_uint_32 i;
  91.259 +         png_byte mask;
  91.260 +         png_uint_32 row_bytes = row_info->rowbytes;
  91.261 +
  91.262 +         if (bit_depth->gray == 1 && row_info->bit_depth == 2)
  91.263 +            mask = 0x55;
  91.264 +         else if (row_info->bit_depth == 4 && bit_depth->gray == 3)
  91.265 +            mask = 0x11;
  91.266 +         else
  91.267 +            mask = 0xff;
  91.268 +
  91.269 +         for (i = 0; i < row_bytes; i++, bp++)
  91.270 +         {
  91.271 +            png_uint_16 v;
  91.272 +            int j;
  91.273 +
  91.274 +            v = *bp;
  91.275 +            *bp = 0;
  91.276 +            for (j = shift_start[0]; j > -shift_dec[0]; j -= shift_dec[0])
  91.277 +            {
  91.278 +               if (j > 0)
  91.279 +                  *bp |= (png_byte)((v << j) & 0xff);
  91.280 +               else
  91.281 +                  *bp |= (png_byte)((v >> (-j)) & mask);
  91.282 +            }
  91.283 +         }
  91.284 +      }
  91.285 +      else if (row_info->bit_depth == 8)
  91.286 +      {
  91.287 +         png_bytep bp = row;
  91.288 +         png_uint_32 i;
  91.289 +         png_uint_32 istop = channels * row_info->width;
  91.290 +
  91.291 +         for (i = 0; i < istop; i++, bp++)
  91.292 +         {
  91.293 +
  91.294 +            png_uint_16 v;
  91.295 +            int j;
  91.296 +            int c = (int)(i%channels);
  91.297 +
  91.298 +            v = *bp;
  91.299 +            *bp = 0;
  91.300 +            for (j = shift_start[c]; j > -shift_dec[c]; j -= shift_dec[c])
  91.301 +            {
  91.302 +               if (j > 0)
  91.303 +                  *bp |= (png_byte)((v << j) & 0xff);
  91.304 +               else
  91.305 +                  *bp |= (png_byte)((v >> (-j)) & 0xff);
  91.306 +            }
  91.307 +         }
  91.308 +      }
  91.309 +      else
  91.310 +      {
  91.311 +         png_bytep bp;
  91.312 +         png_uint_32 i;
  91.313 +         png_uint_32 istop = channels * row_info->width;
  91.314 +
  91.315 +         for (bp = row, i = 0; i < istop; i++)
  91.316 +         {
  91.317 +            int c = (int)(i%channels);
  91.318 +            png_uint_16 value, v;
  91.319 +            int j;
  91.320 +
  91.321 +            v = (png_uint_16)(((png_uint_16)(*bp) << 8) + *(bp + 1));
  91.322 +            value = 0;
  91.323 +            for (j = shift_start[c]; j > -shift_dec[c]; j -= shift_dec[c])
  91.324 +            {
  91.325 +               if (j > 0)
  91.326 +                  value |= (png_uint_16)((v << j) & (png_uint_16)0xffff);
  91.327 +               else
  91.328 +                  value |= (png_uint_16)((v >> (-j)) & (png_uint_16)0xffff);
  91.329 +            }
  91.330 +            *bp++ = (png_byte)(value >> 8);
  91.331 +            *bp++ = (png_byte)(value & 0xff);
  91.332 +         }
  91.333 +      }
  91.334 +   }
  91.335 +}
  91.336 +#endif
  91.337 +
  91.338 +#if defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED)
  91.339 +void /* PRIVATE */
  91.340 +png_do_write_swap_alpha(png_row_infop row_info, png_bytep row)
  91.341 +{
  91.342 +   png_debug(1, "in png_do_write_swap_alpha\n");
  91.343 +#if defined(PNG_USELESS_TESTS_SUPPORTED)
  91.344 +   if (row != NULL && row_info != NULL)
  91.345 +#endif
  91.346 +   {
  91.347 +      if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
  91.348 +      {
  91.349 +         /* This converts from ARGB to RGBA */
  91.350 +         if (row_info->bit_depth == 8)
  91.351 +         {
  91.352 +            png_bytep sp, dp;
  91.353 +            png_uint_32 i;
  91.354 +            png_uint_32 row_width = row_info->width;
  91.355 +            for (i = 0, sp = dp = row; i < row_width; i++)
  91.356 +            {
  91.357 +               png_byte save = *(sp++);
  91.358 +               *(dp++) = *(sp++);
  91.359 +               *(dp++) = *(sp++);
  91.360 +               *(dp++) = *(sp++);
  91.361 +               *(dp++) = save;
  91.362 +            }
  91.363 +         }
  91.364 +         /* This converts from AARRGGBB to RRGGBBAA */
  91.365 +         else
  91.366 +         {
  91.367 +            png_bytep sp, dp;
  91.368 +            png_uint_32 i;
  91.369 +            png_uint_32 row_width = row_info->width;
  91.370 +
  91.371 +            for (i = 0, sp = dp = row; i < row_width; i++)
  91.372 +            {
  91.373 +               png_byte save[2];
  91.374 +               save[0] = *(sp++);
  91.375 +               save[1] = *(sp++);
  91.376 +               *(dp++) = *(sp++);
  91.377 +               *(dp++) = *(sp++);
  91.378 +               *(dp++) = *(sp++);
  91.379 +               *(dp++) = *(sp++);
  91.380 +               *(dp++) = *(sp++);
  91.381 +               *(dp++) = *(sp++);
  91.382 +               *(dp++) = save[0];
  91.383 +               *(dp++) = save[1];
  91.384 +            }
  91.385 +         }
  91.386 +      }
  91.387 +      else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
  91.388 +      {
  91.389 +         /* This converts from AG to GA */
  91.390 +         if (row_info->bit_depth == 8)
  91.391 +         {
  91.392 +            png_bytep sp, dp;
  91.393 +            png_uint_32 i;
  91.394 +            png_uint_32 row_width = row_info->width;
  91.395 +
  91.396 +            for (i = 0, sp = dp = row; i < row_width; i++)
  91.397 +            {
  91.398 +               png_byte save = *(sp++);
  91.399 +               *(dp++) = *(sp++);
  91.400 +               *(dp++) = save;
  91.401 +            }
  91.402 +         }
  91.403 +         /* This converts from AAGG to GGAA */
  91.404 +         else
  91.405 +         {
  91.406 +            png_bytep sp, dp;
  91.407 +            png_uint_32 i;
  91.408 +            png_uint_32 row_width = row_info->width;
  91.409 +
  91.410 +            for (i = 0, sp = dp = row; i < row_width; i++)
  91.411 +            {
  91.412 +               png_byte save[2];
  91.413 +               save[0] = *(sp++);
  91.414 +               save[1] = *(sp++);
  91.415 +               *(dp++) = *(sp++);
  91.416 +               *(dp++) = *(sp++);
  91.417 +               *(dp++) = save[0];
  91.418 +               *(dp++) = save[1];
  91.419 +            }
  91.420 +         }
  91.421 +      }
  91.422 +   }
  91.423 +}
  91.424 +#endif
  91.425 +
  91.426 +#if defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED)
  91.427 +void /* PRIVATE */
  91.428 +png_do_write_invert_alpha(png_row_infop row_info, png_bytep row)
  91.429 +{
  91.430 +   png_debug(1, "in png_do_write_invert_alpha\n");
  91.431 +#if defined(PNG_USELESS_TESTS_SUPPORTED)
  91.432 +   if (row != NULL && row_info != NULL)
  91.433 +#endif
  91.434 +   {
  91.435 +      if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
  91.436 +      {
  91.437 +         /* This inverts the alpha channel in RGBA */
  91.438 +         if (row_info->bit_depth == 8)
  91.439 +         {
  91.440 +            png_bytep sp, dp;
  91.441 +            png_uint_32 i;
  91.442 +            png_uint_32 row_width = row_info->width;
  91.443 +            for (i = 0, sp = dp = row; i < row_width; i++)
  91.444 +            {
  91.445 +               /* does nothing
  91.446 +               *(dp++) = *(sp++);
  91.447 +               *(dp++) = *(sp++);
  91.448 +               *(dp++) = *(sp++);
  91.449 +               */
  91.450 +               sp+=3; dp = sp;
  91.451 +               *(dp++) = (png_byte)(255 - *(sp++));
  91.452 +            }
  91.453 +         }
  91.454 +         /* This inverts the alpha channel in RRGGBBAA */
  91.455 +         else
  91.456 +         {
  91.457 +            png_bytep sp, dp;
  91.458 +            png_uint_32 i;
  91.459 +            png_uint_32 row_width = row_info->width;
  91.460 +
  91.461 +            for (i = 0, sp = dp = row; i < row_width; i++)
  91.462 +            {
  91.463 +               /* does nothing
  91.464 +               *(dp++) = *(sp++);
  91.465 +               *(dp++) = *(sp++);
  91.466 +               *(dp++) = *(sp++);
  91.467 +               *(dp++) = *(sp++);
  91.468 +               *(dp++) = *(sp++);
  91.469 +               *(dp++) = *(sp++);
  91.470 +               */
  91.471 +               sp+=6; dp = sp;
  91.472 +               *(dp++) = (png_byte)(255 - *(sp++));
  91.473 +               *(dp++) = (png_byte)(255 - *(sp++));
  91.474 +            }
  91.475 +         }
  91.476 +      }
  91.477 +      else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
  91.478 +      {
  91.479 +         /* This inverts the alpha channel in GA */
  91.480 +         if (row_info->bit_depth == 8)
  91.481 +         {
  91.482 +            png_bytep sp, dp;
  91.483 +            png_uint_32 i;
  91.484 +            png_uint_32 row_width = row_info->width;
  91.485 +
  91.486 +            for (i = 0, sp = dp = row; i < row_width; i++)
  91.487 +            {
  91.488 +               *(dp++) = *(sp++);
  91.489 +               *(dp++) = (png_byte)(255 - *(sp++));
  91.490 +            }
  91.491 +         }
  91.492 +         /* This inverts the alpha channel in GGAA */
  91.493 +         else
  91.494 +         {
  91.495 +            png_bytep sp, dp;
  91.496 +            png_uint_32 i;
  91.497 +            png_uint_32 row_width = row_info->width;
  91.498 +
  91.499 +            for (i = 0, sp = dp = row; i < row_width; i++)
  91.500 +            {
  91.501 +               /* does nothing
  91.502 +               *(dp++) = *(sp++);
  91.503 +               *(dp++) = *(sp++);
  91.504 +               */
  91.505 +               sp+=2; dp = sp;
  91.506 +               *(dp++) = (png_byte)(255 - *(sp++));
  91.507 +               *(dp++) = (png_byte)(255 - *(sp++));
  91.508 +            }
  91.509 +         }
  91.510 +      }
  91.511 +   }
  91.512 +}
  91.513 +#endif
  91.514 +
  91.515 +#if defined(PNG_MNG_FEATURES_SUPPORTED)
  91.516 +/* undoes intrapixel differencing  */
  91.517 +void /* PRIVATE */
  91.518 +png_do_write_intrapixel(png_row_infop row_info, png_bytep row)
  91.519 +{
  91.520 +   png_debug(1, "in png_do_write_intrapixel\n");
  91.521 +   if (
  91.522 +#if defined(PNG_USELESS_TESTS_SUPPORTED)
  91.523 +       row != NULL && row_info != NULL &&
  91.524 +#endif
  91.525 +       (row_info->color_type & PNG_COLOR_MASK_COLOR))
  91.526 +   {
  91.527 +      int bytes_per_pixel;
  91.528 +      png_uint_32 row_width = row_info->width;
  91.529 +      if (row_info->bit_depth == 8)
  91.530 +      {
  91.531 +         png_bytep rp;
  91.532 +         png_uint_32 i;
  91.533 +
  91.534 +         if (row_info->color_type == PNG_COLOR_TYPE_RGB)
  91.535 +            bytes_per_pixel = 3;
  91.536 +         else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
  91.537 +            bytes_per_pixel = 4;
  91.538 +         else
  91.539 +            return;
  91.540 +
  91.541 +         for (i = 0, rp = row; i < row_width; i++, rp += bytes_per_pixel)
  91.542 +         {
  91.543 +            *(rp)   = (png_byte)((*rp     - *(rp+1))&0xff);
  91.544 +            *(rp+2) = (png_byte)((*(rp+2) - *(rp+1))&0xff);
  91.545 +         }
  91.546 +      }
  91.547 +      else if (row_info->bit_depth == 16)
  91.548 +      {
  91.549 +         png_bytep rp;
  91.550 +         png_uint_32 i;
  91.551 +
  91.552 +         if (row_info->color_type == PNG_COLOR_TYPE_RGB)
  91.553 +            bytes_per_pixel = 6;
  91.554 +         else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
  91.555 +            bytes_per_pixel = 8;
  91.556 +         else
  91.557 +            return;
  91.558 +
  91.559 +         for (i = 0, rp = row; i < row_width; i++, rp += bytes_per_pixel)
  91.560 +         {
  91.561 +            png_uint_32 s0   = (*(rp  ) << 8) | *(rp+1);
  91.562 +            png_uint_32 s1   = (*(rp+2) << 8) | *(rp+3);
  91.563 +            png_uint_32 s2   = (*(rp+4) << 8) | *(rp+5);
  91.564 +            png_uint_32 red  = (png_uint_32)((s0 - s1) & 0xffffL);
  91.565 +            png_uint_32 blue = (png_uint_32)((s2 - s1) & 0xffffL);
  91.566 +            *(rp  ) = (png_byte)((red >> 8) & 0xff);
  91.567 +            *(rp+1) = (png_byte)(red & 0xff);
  91.568 +            *(rp+4) = (png_byte)((blue >> 8) & 0xff);
  91.569 +            *(rp+5) = (png_byte)(blue & 0xff);
  91.570 +         }
  91.571 +      }
  91.572 +   }
  91.573 +}
  91.574 +#endif /* PNG_MNG_FEATURES_SUPPORTED */
  91.575 +#endif /* PNG_WRITE_SUPPORTED */
    92.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    92.2 +++ b/libs/libpng/pngwutil.c	Sun Nov 01 00:36:56 2015 +0200
    92.3 @@ -0,0 +1,2827 @@
    92.4 +
    92.5 +/* pngwutil.c - utilities to write a PNG file
    92.6 + *
    92.7 + * Last changed in libpng 1.2.30 [August 15, 2008]
    92.8 + * For conditions of distribution and use, see copyright notice in png.h
    92.9 + * Copyright (c) 1998-2008 Glenn Randers-Pehrson
   92.10 + * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
   92.11 + * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
   92.12 + */
   92.13 +
   92.14 +#define PNG_INTERNAL
   92.15 +#include "png.h"
   92.16 +#ifdef PNG_WRITE_SUPPORTED
   92.17 +
   92.18 +/* Place a 32-bit number into a buffer in PNG byte order.  We work
   92.19 + * with unsigned numbers for convenience, although one supported
   92.20 + * ancillary chunk uses signed (two's complement) numbers.
   92.21 + */
   92.22 +void PNGAPI
   92.23 +png_save_uint_32(png_bytep buf, png_uint_32 i)
   92.24 +{
   92.25 +   buf[0] = (png_byte)((i >> 24) & 0xff);
   92.26 +   buf[1] = (png_byte)((i >> 16) & 0xff);
   92.27 +   buf[2] = (png_byte)((i >> 8) & 0xff);
   92.28 +   buf[3] = (png_byte)(i & 0xff);
   92.29 +}
   92.30 +
   92.31 +/* The png_save_int_32 function assumes integers are stored in two's
   92.32 + * complement format.  If this isn't the case, then this routine needs to
   92.33 + * be modified to write data in two's complement format.
   92.34 + */
   92.35 +void PNGAPI
   92.36 +png_save_int_32(png_bytep buf, png_int_32 i)
   92.37 +{
   92.38 +   buf[0] = (png_byte)((i >> 24) & 0xff);
   92.39 +   buf[1] = (png_byte)((i >> 16) & 0xff);
   92.40 +   buf[2] = (png_byte)((i >> 8) & 0xff);
   92.41 +   buf[3] = (png_byte)(i & 0xff);
   92.42 +}
   92.43 +
   92.44 +/* Place a 16-bit number into a buffer in PNG byte order.
   92.45 + * The parameter is declared unsigned int, not png_uint_16,
   92.46 + * just to avoid potential problems on pre-ANSI C compilers.
   92.47 + */
   92.48 +void PNGAPI
   92.49 +png_save_uint_16(png_bytep buf, unsigned int i)
   92.50 +{
   92.51 +   buf[0] = (png_byte)((i >> 8) & 0xff);
   92.52 +   buf[1] = (png_byte)(i & 0xff);
   92.53 +}
   92.54 +
   92.55 +/* Simple function to write the signature.  If we have already written
   92.56 + * the magic bytes of the signature, or more likely, the PNG stream is
   92.57 + * being embedded into another stream and doesn't need its own signature,
   92.58 + * we should call png_set_sig_bytes() to tell libpng how many of the
   92.59 + * bytes have already been written.
   92.60 + */
   92.61 +void /* PRIVATE */
   92.62 +png_write_sig(png_structp png_ptr)
   92.63 +{
   92.64 +   png_byte png_signature[8] = {137, 80, 78, 71, 13, 10, 26, 10};
   92.65 +
   92.66 +   /* write the rest of the 8 byte signature */
   92.67 +   png_write_data(png_ptr, &png_signature[png_ptr->sig_bytes],
   92.68 +      (png_size_t)(8 - png_ptr->sig_bytes));
   92.69 +   if (png_ptr->sig_bytes < 3)
   92.70 +      png_ptr->mode |= PNG_HAVE_PNG_SIGNATURE;
   92.71 +}
   92.72 +
   92.73 +/* Write a PNG chunk all at once.  The type is an array of ASCII characters
   92.74 + * representing the chunk name.  The array must be at least 4 bytes in
   92.75 + * length, and does not need to be null terminated.  To be safe, pass the
   92.76 + * pre-defined chunk names here, and if you need a new one, define it
   92.77 + * where the others are defined.  The length is the length of the data.
   92.78 + * All the data must be present.  If that is not possible, use the
   92.79 + * png_write_chunk_start(), png_write_chunk_data(), and png_write_chunk_end()
   92.80 + * functions instead.
   92.81 + */
   92.82 +void PNGAPI
   92.83 +png_write_chunk(png_structp png_ptr, png_bytep chunk_name,
   92.84 +   png_bytep data, png_size_t length)
   92.85 +{
   92.86 +   if (png_ptr == NULL) return;
   92.87 +   png_write_chunk_start(png_ptr, chunk_name, (png_uint_32)length);
   92.88 +   png_write_chunk_data(png_ptr, data, (png_size_t)length);
   92.89 +   png_write_chunk_end(png_ptr);
   92.90 +}
   92.91 +
   92.92 +/* Write the start of a PNG chunk.  The type is the chunk type.
   92.93 + * The total_length is the sum of the lengths of all the data you will be
   92.94 + * passing in png_write_chunk_data().
   92.95 + */
   92.96 +void PNGAPI
   92.97 +png_write_chunk_start(png_structp png_ptr, png_bytep chunk_name,
   92.98 +   png_uint_32 length)
   92.99 +{
  92.100 +   png_byte buf[8];
  92.101 +
  92.102 +   png_debug2(0, "Writing %s chunk, length = %lu\n", chunk_name,
  92.103 +      (unsigned long)length);
  92.104 +   if (png_ptr == NULL) return;
  92.105 +
  92.106 +   /* write the length and the chunk name */
  92.107 +   png_save_uint_32(buf, length);
  92.108 +   png_memcpy(buf + 4, chunk_name, 4);
  92.109 +   png_write_data(png_ptr, buf, (png_size_t)8);
  92.110 +   /* put the chunk name into png_ptr->chunk_name */
  92.111 +   png_memcpy(png_ptr->chunk_name, chunk_name, 4);
  92.112 +   /* reset the crc and run it over the chunk name */
  92.113 +   png_reset_crc(png_ptr);
  92.114 +   png_calculate_crc(png_ptr, chunk_name, (png_size_t)4);
  92.115 +}
  92.116 +
  92.117 +/* Write the data of a PNG chunk started with png_write_chunk_start().
  92.118 + * Note that multiple calls to this function are allowed, and that the
  92.119 + * sum of the lengths from these calls *must* add up to the total_length
  92.120 + * given to png_write_chunk_start().
  92.121 + */
  92.122 +void PNGAPI
  92.123 +png_write_chunk_data(png_structp png_ptr, png_bytep data, png_size_t length)
  92.124 +{
  92.125 +   /* write the data, and run the CRC over it */
  92.126 +   if (png_ptr == NULL) return;
  92.127 +   if (data != NULL && length > 0)
  92.128 +   {
  92.129 +      png_write_data(png_ptr, data, length);
  92.130 +      /* update the CRC after writing the data,
  92.131 +       * in case that the user I/O routine alters it.
  92.132 +       */
  92.133 +      png_calculate_crc(png_ptr, data, length);
  92.134 +   }
  92.135 +}
  92.136 +
  92.137 +/* Finish a chunk started with png_write_chunk_start(). */
  92.138 +void PNGAPI
  92.139 +png_write_chunk_end(png_structp png_ptr)
  92.140 +{
  92.141 +   png_byte buf[4];
  92.142 +
  92.143 +   if (png_ptr == NULL) return;
  92.144 +
  92.145 +   /* write the crc in a single operation */
  92.146 +   png_save_uint_32(buf, png_ptr->crc);
  92.147 +
  92.148 +   png_write_data(png_ptr, buf, (png_size_t)4);
  92.149 +}
  92.150 +
  92.151 +#if defined(PNG_WRITE_TEXT_SUPPORTED) || defined(PNG_WRITE_iCCP_SUPPORTED)
  92.152 +/*
  92.153 + * This pair of functions encapsulates the operation of (a) compressing a
  92.154 + * text string, and (b) issuing it later as a series of chunk data writes.
  92.155 + * The compression_state structure is shared context for these functions
  92.156 + * set up by the caller in order to make the whole mess thread-safe.
  92.157 + */
  92.158 +
  92.159 +typedef struct
  92.160 +{
  92.161 +    char *input;   /* the uncompressed input data */
  92.162 +    int input_len;   /* its length */
  92.163 +    int num_output_ptr; /* number of output pointers used */
  92.164 +    int max_output_ptr; /* size of output_ptr */
  92.165 +    png_charpp output_ptr; /* array of pointers to output */
  92.166 +} compression_state;
  92.167 +
  92.168 +/* compress given text into storage in the png_ptr structure */
  92.169 +static int /* PRIVATE */
  92.170 +png_text_compress(png_structp png_ptr,
  92.171 +        png_charp text, png_size_t text_len, int compression,
  92.172 +        compression_state *comp)
  92.173 +{
  92.174 +   int ret;
  92.175 +
  92.176 +   comp->num_output_ptr = 0;
  92.177 +   comp->max_output_ptr = 0;
  92.178 +   comp->output_ptr = NULL;
  92.179 +   comp->input = NULL;
  92.180 +   comp->input_len = 0;
  92.181 +
  92.182 +   /* we may just want to pass the text right through */
  92.183 +   if (compression == PNG_TEXT_COMPRESSION_NONE)
  92.184 +   {
  92.185 +       comp->input = text;
  92.186 +       comp->input_len = text_len;
  92.187 +       return((int)text_len);
  92.188 +   }
  92.189 +
  92.190 +   if (compression >= PNG_TEXT_COMPRESSION_LAST)
  92.191 +   {
  92.192 +#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE)
  92.193 +      char msg[50];
  92.194 +      png_snprintf(msg, 50, "Unknown compression type %d", compression);
  92.195 +      png_warning(png_ptr, msg);
  92.196 +#else
  92.197 +      png_warning(png_ptr, "Unknown compression type");
  92.198 +#endif
  92.199 +   }
  92.200 +
  92.201 +   /* We can't write the chunk until we find out how much data we have,
  92.202 +    * which means we need to run the compressor first and save the
  92.203 +    * output.  This shouldn't be a problem, as the vast majority of
  92.204 +    * comments should be reasonable, but we will set up an array of
  92.205 +    * malloc'd pointers to be sure.
  92.206 +    *
  92.207 +    * If we knew the application was well behaved, we could simplify this
  92.208 +    * greatly by assuming we can always malloc an output buffer large
  92.209 +    * enough to hold the compressed text ((1001 * text_len / 1000) + 12)
  92.210 +    * and malloc this directly.  The only time this would be a bad idea is
  92.211 +    * if we can't malloc more than 64K and we have 64K of random input
  92.212 +    * data, or if the input string is incredibly large (although this
  92.213 +    * wouldn't cause a failure, just a slowdown due to swapping).
  92.214 +    */
  92.215 +
  92.216 +   /* set up the compression buffers */
  92.217 +   png_ptr->zstream.avail_in = (uInt)text_len;
  92.218 +   png_ptr->zstream.next_in = (Bytef *)text;
  92.219 +   png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
  92.220 +   png_ptr->zstream.next_out = (Bytef *)png_ptr->zbuf;
  92.221 +
  92.222 +   /* this is the same compression loop as in png_write_row() */
  92.223 +   do
  92.224 +   {
  92.225 +      /* compress the data */
  92.226 +      ret = deflate(&png_ptr->zstream, Z_NO_FLUSH);
  92.227 +      if (ret != Z_OK)
  92.228 +      {
  92.229 +         /* error */
  92.230 +         if (png_ptr->zstream.msg != NULL)
  92.231 +            png_error(png_ptr, png_ptr->zstream.msg);
  92.232 +         else
  92.233 +            png_error(png_ptr, "zlib error");
  92.234 +      }
  92.235 +      /* check to see if we need more room */
  92.236 +      if (!(png_ptr->zstream.avail_out))
  92.237 +      {
  92.238 +         /* make sure the output array has room */
  92.239 +         if (comp->num_output_ptr >= comp->max_output_ptr)
  92.240 +         {
  92.241 +            int old_max;
  92.242 +
  92.243 +            old_max = comp->max_output_ptr;
  92.244 +            comp->max_output_ptr = comp->num_output_ptr + 4;
  92.245 +            if (comp->output_ptr != NULL)
  92.246 +            {
  92.247 +               png_charpp old_ptr;
  92.248 +
  92.249 +               old_ptr = comp->output_ptr;
  92.250 +               comp->output_ptr = (png_charpp)png_malloc(png_ptr,
  92.251 +                  (png_uint_32)
  92.252 +                  (comp->max_output_ptr * png_sizeof(png_charpp)));
  92.253 +               png_memcpy(comp->output_ptr, old_ptr, old_max
  92.254 +                  * png_sizeof(png_charp));
  92.255 +               png_free(png_ptr, old_ptr);
  92.256 +            }
  92.257 +            else
  92.258 +               comp->output_ptr = (png_charpp)png_malloc(png_ptr,
  92.259 +                  (png_uint_32)
  92.260 +                  (comp->max_output_ptr * png_sizeof(png_charp)));
  92.261 +         }
  92.262 +
  92.263 +         /* save the data */
  92.264 +         comp->output_ptr[comp->num_output_ptr] =
  92.265 +            (png_charp)png_malloc(png_ptr,
  92.266 +            (png_uint_32)png_ptr->zbuf_size);
  92.267 +         png_memcpy(comp->output_ptr[comp->num_output_ptr], png_ptr->zbuf,
  92.268 +            png_ptr->zbuf_size);
  92.269 +         comp->num_output_ptr++;
  92.270 +
  92.271 +         /* and reset the buffer */
  92.272 +         png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
  92.273 +         png_ptr->zstream.next_out = png_ptr->zbuf;
  92.274 +      }
  92.275 +   /* continue until we don't have any more to compress */
  92.276 +   } while (png_ptr->zstream.avail_in);
  92.277 +
  92.278 +   /* finish the compression */
  92.279 +   do
  92.280 +   {
  92.281 +      /* tell zlib we are finished */
  92.282 +      ret = deflate(&png_ptr->zstream, Z_FINISH);
  92.283 +
  92.284 +      if (ret == Z_OK)
  92.285 +      {
  92.286 +         /* check to see if we need more room */
  92.287 +         if (!(png_ptr->zstream.avail_out))
  92.288 +         {
  92.289 +            /* check to make sure our output array has room */
  92.290 +            if (comp->num_output_ptr >= comp->max_output_ptr)
  92.291 +            {
  92.292 +               int old_max;
  92.293 +
  92.294 +               old_max = comp->max_output_ptr;
  92.295 +               comp->max_output_ptr = comp->num_output_ptr + 4;
  92.296 +               if (comp->output_ptr != NULL)
  92.297 +               {
  92.298 +                  png_charpp old_ptr;
  92.299 +
  92.300 +                  old_ptr = comp->output_ptr;
  92.301 +                  /* This could be optimized to realloc() */
  92.302 +                  comp->output_ptr = (png_charpp)png_malloc(png_ptr,
  92.303 +                     (png_uint_32)(comp->max_output_ptr *
  92.304 +                     png_sizeof(png_charp)));
  92.305 +                  png_memcpy(comp->output_ptr, old_ptr,
  92.306 +                     old_max * png_sizeof(png_charp));
  92.307 +                  png_free(png_ptr, old_ptr);
  92.308 +               }
  92.309 +               else
  92.310 +                  comp->output_ptr = (png_charpp)png_malloc(png_ptr,
  92.311 +                     (png_uint_32)(comp->max_output_ptr *
  92.312 +                     png_sizeof(png_charp)));
  92.313 +            }
  92.314 +
  92.315 +            /* save off the data */
  92.316 +            comp->output_ptr[comp->num_output_ptr] =
  92.317 +               (png_charp)png_malloc(png_ptr,
  92.318 +               (png_uint_32)png_ptr->zbuf_size);
  92.319 +            png_memcpy(comp->output_ptr[comp->num_output_ptr], png_ptr->zbuf,
  92.320 +               png_ptr->zbuf_size);
  92.321 +            comp->num_output_ptr++;
  92.322 +
  92.323 +            /* and reset the buffer pointers */
  92.324 +            png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
  92.325 +            png_ptr->zstream.next_out = png_ptr->zbuf;
  92.326 +         }
  92.327 +      }
  92.328 +      else if (ret != Z_STREAM_END)
  92.329 +      {
  92.330 +         /* we got an error */
  92.331 +         if (png_ptr->zstream.msg != NULL)
  92.332 +            png_error(png_ptr, png_ptr->zstream.msg);
  92.333 +         else
  92.334 +            png_error(png_ptr, "zlib error");
  92.335 +      }
  92.336 +   } while (ret != Z_STREAM_END);
  92.337 +
  92.338 +   /* text length is number of buffers plus last buffer */
  92.339 +   text_len = png_ptr->zbuf_size * comp->num_output_ptr;
  92.340 +   if (png_ptr->zstream.avail_out < png_ptr->zbuf_size)
  92.341 +      text_len += png_ptr->zbuf_size - (png_size_t)png_ptr->zstream.avail_out;
  92.342 +
  92.343 +   return((int)text_len);
  92.344 +}
  92.345 +
  92.346 +/* ship the compressed text out via chunk writes */
  92.347 +static void /* PRIVATE */
  92.348 +png_write_compressed_data_out(png_structp png_ptr, compression_state *comp)
  92.349 +{
  92.350 +   int i;
  92.351 +
  92.352 +   /* handle the no-compression case */
  92.353 +   if (comp->input)
  92.354 +   {
  92.355 +       png_write_chunk_data(png_ptr, (png_bytep)comp->input,
  92.356 +                            (png_size_t)comp->input_len);
  92.357 +       return;
  92.358 +   }
  92.359 +
  92.360 +   /* write saved output buffers, if any */
  92.361 +   for (i = 0; i < comp->num_output_ptr; i++)
  92.362 +   {
  92.363 +      png_write_chunk_data(png_ptr, (png_bytep)comp->output_ptr[i],
  92.364 +         (png_size_t)png_ptr->zbuf_size);
  92.365 +      png_free(png_ptr, comp->output_ptr[i]);
  92.366 +       comp->output_ptr[i]=NULL;
  92.367 +   }
  92.368 +   if (comp->max_output_ptr != 0)
  92.369 +      png_free(png_ptr, comp->output_ptr);
  92.370 +       comp->output_ptr=NULL;
  92.371 +   /* write anything left in zbuf */
  92.372 +   if (png_ptr->zstream.avail_out < (png_uint_32)png_ptr->zbuf_size)
  92.373 +      png_write_chunk_data(png_ptr, png_ptr->zbuf,
  92.374 +         (png_size_t)(png_ptr->zbuf_size - png_ptr->zstream.avail_out));
  92.375 +
  92.376 +   /* reset zlib for another zTXt/iTXt or image data */
  92.377 +   deflateReset(&png_ptr->zstream);
  92.378 +   png_ptr->zstream.data_type = Z_BINARY;
  92.379 +}
  92.380 +#endif
  92.381 +
  92.382 +/* Write the IHDR chunk, and update the png_struct with the necessary
  92.383 + * information.  Note that the rest of this code depends upon this
  92.384 + * information being correct.
  92.385 + */
  92.386 +void /* PRIVATE */
  92.387 +png_write_IHDR(png_structp png_ptr, png_uint_32 width, png_uint_32 height,
  92.388 +   int bit_depth, int color_type, int compression_type, int filter_type,
  92.389 +   int interlace_type)
  92.390 +{
  92.391 +#ifdef PNG_USE_LOCAL_ARRAYS
  92.392 +   PNG_IHDR;
  92.393 +#endif
  92.394 +   int ret;
  92.395 +
  92.396 +   png_byte buf[13]; /* buffer to store the IHDR info */
  92.397 +
  92.398 +   png_debug(1, "in png_write_IHDR\n");
  92.399 +   /* Check that we have valid input data from the application info */
  92.400 +   switch (color_type)
  92.401 +   {
  92.402 +      case PNG_COLOR_TYPE_GRAY:
  92.403 +         switch (bit_depth)
  92.404 +         {
  92.405 +            case 1:
  92.406 +            case 2:
  92.407 +            case 4:
  92.408 +            case 8:
  92.409 +            case 16: png_ptr->channels = 1; break;
  92.410 +            default: png_error(png_ptr, "Invalid bit depth for grayscale image");
  92.411 +         }
  92.412 +         break;
  92.413 +      case PNG_COLOR_TYPE_RGB:
  92.414 +         if (bit_depth != 8 && bit_depth != 16)
  92.415 +            png_error(png_ptr, "Invalid bit depth for RGB image");
  92.416 +         png_ptr->channels = 3;
  92.417 +         break;
  92.418 +      case PNG_COLOR_TYPE_PALETTE:
  92.419 +         switch (bit_depth)
  92.420 +         {
  92.421 +            case 1:
  92.422 +            case 2:
  92.423 +            case 4:
  92.424 +            case 8: png_ptr->channels = 1; break;
  92.425 +            default: png_error(png_ptr, "Invalid bit depth for paletted image");
  92.426 +         }
  92.427 +         break;
  92.428 +      case PNG_COLOR_TYPE_GRAY_ALPHA:
  92.429 +         if (bit_depth != 8 && bit_depth != 16)
  92.430 +            png_error(png_ptr, "Invalid bit depth for grayscale+alpha image");
  92.431 +         png_ptr->channels = 2;
  92.432 +         break;
  92.433 +      case PNG_COLOR_TYPE_RGB_ALPHA:
  92.434 +         if (bit_depth != 8 && bit_depth != 16)
  92.435 +            png_error(png_ptr, "Invalid bit depth for RGBA image");
  92.436 +         png_ptr->channels = 4;
  92.437 +         break;
  92.438 +      default:
  92.439 +         png_error(png_ptr, "Invalid image color type specified");
  92.440 +   }
  92.441 +
  92.442 +   if (compression_type != PNG_COMPRESSION_TYPE_BASE)
  92.443 +   {
  92.444 +      png_warning(png_ptr, "Invalid compression type specified");
  92.445 +      compression_type = PNG_COMPRESSION_TYPE_BASE;
  92.446 +   }
  92.447 +
  92.448 +   /* Write filter_method 64 (intrapixel differencing) only if
  92.449 +    * 1. Libpng was compiled with PNG_MNG_FEATURES_SUPPORTED and
  92.450 +    * 2. Libpng did not write a PNG signature (this filter_method is only
  92.451 +    *    used in PNG datastreams that are embedded in MNG datastreams) and
  92.452 +    * 3. The application called png_permit_mng_features with a mask that
  92.453 +    *    included PNG_FLAG_MNG_FILTER_64 and
  92.454 +    * 4. The filter_method is 64 and
  92.455 +    * 5. The color_type is RGB or RGBA
  92.456 +    */
  92.457 +   if (
  92.458 +#if defined(PNG_MNG_FEATURES_SUPPORTED)
  92.459 +      !((png_ptr->mng_features_permitted & PNG_FLAG_MNG_FILTER_64) &&
  92.460 +      ((png_ptr->mode&PNG_HAVE_PNG_SIGNATURE) == 0) &&
  92.461 +      (color_type == PNG_COLOR_TYPE_RGB ||
  92.462 +       color_type == PNG_COLOR_TYPE_RGB_ALPHA) &&
  92.463 +      (filter_type == PNG_INTRAPIXEL_DIFFERENCING)) &&
  92.464 +#endif
  92.465 +      filter_type != PNG_FILTER_TYPE_BASE)
  92.466 +   {
  92.467 +      png_warning(png_ptr, "Invalid filter type specified");
  92.468 +      filter_type = PNG_FILTER_TYPE_BASE;
  92.469 +   }
  92.470 +
  92.471 +#ifdef PNG_WRITE_INTERLACING_SUPPORTED
  92.472 +   if (interlace_type != PNG_INTERLACE_NONE &&
  92.473 +      interlace_type != PNG_INTERLACE_ADAM7)
  92.474 +   {
  92.475 +      png_warning(png_ptr, "Invalid interlace type specified");
  92.476 +      interlace_type = PNG_INTERLACE_ADAM7;
  92.477 +   }
  92.478 +#else
  92.479 +   interlace_type=PNG_INTERLACE_NONE;
  92.480 +#endif
  92.481 +
  92.482 +   /* save off the relevent information */
  92.483 +   png_ptr->bit_depth = (png_byte)bit_depth;
  92.484 +   png_ptr->color_type = (png_byte)color_type;
  92.485 +   png_ptr->interlaced = (png_byte)interlace_type;
  92.486 +#if defined(PNG_MNG_FEATURES_SUPPORTED)
  92.487 +   png_ptr->filter_type = (png_byte)filter_type;
  92.488 +#endif
  92.489 +   png_ptr->compression_type = (png_byte)compression_type;
  92.490 +   png_ptr->width = width;
  92.491 +   png_ptr->height = height;
  92.492 +
  92.493 +   png_ptr->pixel_depth = (png_byte)(bit_depth * png_ptr->channels);
  92.494 +   png_ptr->rowbytes = PNG_ROWBYTES(png_ptr->pixel_depth, width);
  92.495 +   /* set the usr info, so any transformations can modify it */
  92.496 +   png_ptr->usr_width = png_ptr->width;
  92.497 +   png_ptr->usr_bit_depth = png_ptr->bit_depth;
  92.498 +   png_ptr->usr_channels = png_ptr->channels;
  92.499 +
  92.500 +   /* pack the header information into the buffer */
  92.501 +   png_save_uint_32(buf, width);
  92.502 +   png_save_uint_32(buf + 4, height);
  92.503 +   buf[8] = (png_byte)bit_depth;
  92.504 +   buf[9] = (png_byte)color_type;
  92.505 +   buf[10] = (png_byte)compression_type;
  92.506 +   buf[11] = (png_byte)filter_type;
  92.507 +   buf[12] = (png_byte)interlace_type;
  92.508 +
  92.509 +   /* write the chunk */
  92.510 +   png_write_chunk(png_ptr, (png_bytep)png_IHDR, buf, (png_size_t)13);
  92.511 +
  92.512 +   /* initialize zlib with PNG info */
  92.513 +   png_ptr->zstream.zalloc = png_zalloc;
  92.514 +   png_ptr->zstream.zfree = png_zfree;
  92.515 +   png_ptr->zstream.opaque = (voidpf)png_ptr;
  92.516 +   if (!(png_ptr->do_filter))
  92.517 +   {
  92.518 +      if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE ||
  92.519 +         png_ptr->bit_depth < 8)
  92.520 +         png_ptr->do_filter = PNG_FILTER_NONE;
  92.521 +      else
  92.522 +         png_ptr->do_filter = PNG_ALL_FILTERS;
  92.523 +   }
  92.524 +   if (!(png_ptr->flags & PNG_FLAG_ZLIB_CUSTOM_STRATEGY))
  92.525 +   {
  92.526 +      if (png_ptr->do_filter != PNG_FILTER_NONE)
  92.527 +         png_ptr->zlib_strategy = Z_FILTERED;
  92.528 +      else
  92.529 +         png_ptr->zlib_strategy = Z_DEFAULT_STRATEGY;
  92.530 +   }
  92.531 +   if (!(png_ptr->flags & PNG_FLAG_ZLIB_CUSTOM_LEVEL))
  92.532 +      png_ptr->zlib_level = Z_DEFAULT_COMPRESSION;
  92.533 +   if (!(png_ptr->flags & PNG_FLAG_ZLIB_CUSTOM_MEM_LEVEL))
  92.534 +      png_ptr->zlib_mem_level = 8;
  92.535 +   if (!(png_ptr->flags & PNG_FLAG_ZLIB_CUSTOM_WINDOW_BITS))
  92.536 +      png_ptr->zlib_window_bits = 15;
  92.537 +   if (!(png_ptr->flags & PNG_FLAG_ZLIB_CUSTOM_METHOD))
  92.538 +      png_ptr->zlib_method = 8;
  92.539 +   ret = deflateInit2(&png_ptr->zstream, png_ptr->zlib_level,
  92.540 +         png_ptr->zlib_method, png_ptr->zlib_window_bits,
  92.541 +         png_ptr->zlib_mem_level, png_ptr->zlib_strategy);
  92.542 +   if (ret != Z_OK)
  92.543 +   {
  92.544 +      if (ret == Z_VERSION_ERROR) png_error(png_ptr,
  92.545 +          "zlib failed to initialize compressor -- version error");
  92.546 +      if (ret == Z_STREAM_ERROR) png_error(png_ptr,
  92.547 +           "zlib failed to initialize compressor -- stream error");
  92.548 +      if (ret == Z_MEM_ERROR) png_error(png_ptr,
  92.549 +           "zlib failed to initialize compressor -- mem error");
  92.550 +      png_error(png_ptr, "zlib failed to initialize compressor");
  92.551 +   }
  92.552 +   png_ptr->zstream.next_out = png_ptr->zbuf;
  92.553 +   png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
  92.554 +   /* libpng is not interested in zstream.data_type */
  92.555 +   /* set it to a predefined value, to avoid its evaluation inside zlib */
  92.556 +   png_ptr->zstream.data_type = Z_BINARY;
  92.557 +
  92.558 +   png_ptr->mode = PNG_HAVE_IHDR;
  92.559 +}
  92.560 +
  92.561 +/* write the palette.  We are careful not to trust png_color to be in the
  92.562 + * correct order for PNG, so people can redefine it to any convenient
  92.563 + * structure.
  92.564 + */
  92.565 +void /* PRIVATE */
  92.566 +png_write_PLTE(png_structp png_ptr, png_colorp palette, png_uint_32 num_pal)
  92.567 +{
  92.568 +#ifdef PNG_USE_LOCAL_ARRAYS
  92.569 +   PNG_PLTE;
  92.570 +#endif
  92.571 +   png_uint_32 i;
  92.572 +   png_colorp pal_ptr;
  92.573 +   png_byte buf[3];
  92.574 +
  92.575 +   png_debug(1, "in png_write_PLTE\n");
  92.576 +   if ((
  92.577 +#if defined(PNG_MNG_FEATURES_SUPPORTED)
  92.578 +        !(png_ptr->mng_features_permitted & PNG_FLAG_MNG_EMPTY_PLTE) &&
  92.579 +#endif
  92.580 +        num_pal == 0) || num_pal > 256)
  92.581 +   {
  92.582 +     if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
  92.583 +     {
  92.584 +        png_error(png_ptr, "Invalid number of colors in palette");
  92.585 +     }
  92.586 +     else
  92.587 +     {
  92.588 +        png_warning(png_ptr, "Invalid number of colors in palette");
  92.589 +        return;
  92.590 +     }
  92.591 +   }
  92.592 +
  92.593 +   if (!(png_ptr->color_type&PNG_COLOR_MASK_COLOR))
  92.594 +   {
  92.595 +      png_warning(png_ptr,
  92.596 +        "Ignoring request to write a PLTE chunk in grayscale PNG");
  92.597 +      return;
  92.598 +   }
  92.599 +
  92.600 +   png_ptr->num_palette = (png_uint_16)num_pal;
  92.601 +   png_debug1(3, "num_palette = %d\n", png_ptr->num_palette);
  92.602 +
  92.603 +   png_write_chunk_start(png_ptr, (png_bytep)png_PLTE,
  92.604 +     (png_uint_32)(num_pal * 3));
  92.605 +#ifndef PNG_NO_POINTER_INDEXING
  92.606 +   for (i = 0, pal_ptr = palette; i < num_pal; i++, pal_ptr++)
  92.607 +   {
  92.608 +      buf[0] = pal_ptr->red;
  92.609 +      buf[1] = pal_ptr->green;
  92.610 +      buf[2] = pal_ptr->blue;
  92.611 +      png_write_chunk_data(png_ptr, buf, (png_size_t)3);
  92.612 +   }
  92.613 +#else
  92.614 +   /* This is a little slower but some buggy compilers need to do this instead */
  92.615 +   pal_ptr=palette;
  92.616 +   for (i = 0; i < num_pal; i++)
  92.617 +   {
  92.618 +      buf[0] = pal_ptr[i].red;
  92.619 +      buf[1] = pal_ptr[i].green;
  92.620 +      buf[2] = pal_ptr[i].blue;
  92.621 +      png_write_chunk_data(png_ptr, buf, (png_size_t)3);
  92.622 +   }
  92.623 +#endif
  92.624 +   png_write_chunk_end(png_ptr);
  92.625 +   png_ptr->mode |= PNG_HAVE_PLTE;
  92.626 +}
  92.627 +
  92.628 +/* write an IDAT chunk */
  92.629 +void /* PRIVATE */
  92.630 +png_write_IDAT(png_structp png_ptr, png_bytep data, png_size_t length)
  92.631 +{
  92.632 +#ifdef PNG_USE_LOCAL_ARRAYS
  92.633 +   PNG_IDAT;
  92.634 +#endif
  92.635 +   png_debug(1, "in png_write_IDAT\n");
  92.636 +
  92.637 +   /* Optimize the CMF field in the zlib stream. */
  92.638 +   /* This hack of the zlib stream is compliant to the stream specification. */
  92.639 +   if (!(png_ptr->mode & PNG_HAVE_IDAT) &&
  92.640 +       png_ptr->compression_type == PNG_COMPRESSION_TYPE_BASE)
  92.641 +   {
  92.642 +      unsigned int z_cmf = data[0];  /* zlib compression method and flags */
  92.643 +      if ((z_cmf & 0x0f) == 8 && (z_cmf & 0xf0) <= 0x70)
  92.644 +      {
  92.645 +         /* Avoid memory underflows and multiplication overflows. */
  92.646 +         /* The conditions below are practically always satisfied;
  92.647 +            however, they still must be checked. */
  92.648 +         if (length >= 2 &&
  92.649 +             png_ptr->height < 16384 && png_ptr->width < 16384)
  92.650 +         {
  92.651 +            png_uint_32 uncompressed_idat_size = png_ptr->height *
  92.652 +               ((png_ptr->width *
  92.653 +               png_ptr->channels * png_ptr->bit_depth + 15) >> 3);
  92.654 +            unsigned int z_cinfo = z_cmf >> 4;
  92.655 +            unsigned int half_z_window_size = 1 << (z_cinfo + 7);
  92.656 +            while (uncompressed_idat_size <= half_z_window_size &&
  92.657 +                   half_z_window_size >= 256)
  92.658 +            {
  92.659 +               z_cinfo--;
  92.660 +               half_z_window_size >>= 1;
  92.661 +            }
  92.662 +            z_cmf = (z_cmf & 0x0f) | (z_cinfo << 4);
  92.663 +            if (data[0] != (png_byte)z_cmf)
  92.664 +            {
  92.665 +               data[0] = (png_byte)z_cmf;
  92.666 +               data[1] &= 0xe0;
  92.667 +               data[1] += (png_byte)(0x1f - ((z_cmf << 8) + data[1]) % 0x1f);
  92.668 +            }
  92.669 +         }
  92.670 +      }
  92.671 +      else
  92.672 +         png_error(png_ptr,
  92.673 +            "Invalid zlib compression method or flags in IDAT");
  92.674 +   }
  92.675 +
  92.676 +   png_write_chunk(png_ptr, (png_bytep)png_IDAT, data, length);
  92.677 +   png_ptr->mode |= PNG_HAVE_IDAT;
  92.678 +}
  92.679 +
  92.680 +/* write an IEND chunk */
  92.681 +void /* PRIVATE */
  92.682 +png_write_IEND(png_structp png_ptr)
  92.683 +{
  92.684 +#ifdef PNG_USE_LOCAL_ARRAYS
  92.685 +   PNG_IEND;
  92.686 +#endif
  92.687 +   png_debug(1, "in png_write_IEND\n");
  92.688 +   png_write_chunk(png_ptr, (png_bytep)png_IEND, png_bytep_NULL,
  92.689 +     (png_size_t)0);
  92.690 +   png_ptr->mode |= PNG_HAVE_IEND;
  92.691 +}
  92.692 +
  92.693 +#if defined(PNG_WRITE_gAMA_SUPPORTED)
  92.694 +/* write a gAMA chunk */
  92.695 +#ifdef PNG_FLOATING_POINT_SUPPORTED
  92.696 +void /* PRIVATE */
  92.697 +png_write_gAMA(png_structp png_ptr, double file_gamma)
  92.698 +{
  92.699 +#ifdef PNG_USE_LOCAL_ARRAYS
  92.700 +   PNG_gAMA;
  92.701 +#endif
  92.702 +   png_uint_32 igamma;
  92.703 +   png_byte buf[4];
  92.704 +
  92.705 +   png_debug(1, "in png_write_gAMA\n");
  92.706 +   /* file_gamma is saved in 1/100,000ths */
  92.707 +   igamma = (png_uint_32)(file_gamma * 100000.0 + 0.5);
  92.708 +   png_save_uint_32(buf, igamma);
  92.709 +   png_write_chunk(png_ptr, (png_bytep)png_gAMA, buf, (png_size_t)4);
  92.710 +}
  92.711 +#endif
  92.712 +#ifdef PNG_FIXED_POINT_SUPPORTED
  92.713 +void /* PRIVATE */
  92.714 +png_write_gAMA_fixed(png_structp png_ptr, png_fixed_point file_gamma)
  92.715 +{
  92.716 +#ifdef PNG_USE_LOCAL_ARRAYS
  92.717 +   PNG_gAMA;
  92.718 +#endif
  92.719 +   png_byte buf[4];
  92.720 +
  92.721 +   png_debug(1, "in png_write_gAMA\n");
  92.722 +   /* file_gamma is saved in 1/100,000ths */
  92.723 +   png_save_uint_32(buf, (png_uint_32)file_gamma);
  92.724 +   png_write_chunk(png_ptr, (png_bytep)png_gAMA, buf, (png_size_t)4);
  92.725 +}
  92.726 +#endif
  92.727 +#endif
  92.728 +
  92.729 +#if defined(PNG_WRITE_sRGB_SUPPORTED)
  92.730 +/* write a sRGB chunk */
  92.731 +void /* PRIVATE */
  92.732 +png_write_sRGB(png_structp png_ptr, int srgb_intent)
  92.733 +{
  92.734 +#ifdef PNG_USE_LOCAL_ARRAYS
  92.735 +   PNG_sRGB;
  92.736 +#endif
  92.737 +   png_byte buf[1];
  92.738 +
  92.739 +   png_debug(1, "in png_write_sRGB\n");
  92.740 +   if (srgb_intent >= PNG_sRGB_INTENT_LAST)
  92.741 +         png_warning(png_ptr,
  92.742 +            "Invalid sRGB rendering intent specified");
  92.743 +   buf[0]=(png_byte)srgb_intent;
  92.744 +   png_write_chunk(png_ptr, (png_bytep)png_sRGB, buf, (png_size_t)1);
  92.745 +}
  92.746 +#endif
  92.747 +
  92.748 +#if defined(PNG_WRITE_iCCP_SUPPORTED)
  92.749 +/* write an iCCP chunk */
  92.750 +void /* PRIVATE */
  92.751 +png_write_iCCP(png_structp png_ptr, png_charp name, int compression_type,
  92.752 +   png_charp profile, int profile_len)
  92.753 +{
  92.754 +#ifdef PNG_USE_LOCAL_ARRAYS
  92.755 +   PNG_iCCP;
  92.756 +#endif
  92.757 +   png_size_t name_len;
  92.758 +   png_charp new_name;
  92.759 +   compression_state comp;
  92.760 +   int embedded_profile_len = 0;
  92.761 +
  92.762 +   png_debug(1, "in png_write_iCCP\n");
  92.763 +
  92.764 +   comp.num_output_ptr = 0;
  92.765 +   comp.max_output_ptr = 0;
  92.766 +   comp.output_ptr = NULL;
  92.767 +   comp.input = NULL;
  92.768 +   comp.input_len = 0;
  92.769 +
  92.770 +   if (name == NULL || (name_len = png_check_keyword(png_ptr, name,
  92.771 +      &new_name)) == 0)
  92.772 +   {
  92.773 +      png_warning(png_ptr, "Empty keyword in iCCP chunk");
  92.774 +      return;
  92.775 +   }
  92.776 +
  92.777 +   if (compression_type != PNG_COMPRESSION_TYPE_BASE)
  92.778 +      png_warning(png_ptr, "Unknown compression type in iCCP chunk");
  92.779 +
  92.780 +   if (profile == NULL)
  92.781 +      profile_len = 0;
  92.782 +
  92.783 +   if (profile_len > 3)
  92.784 +      embedded_profile_len =
  92.785 +          ((*( (png_bytep)profile    ))<<24) |
  92.786 +          ((*( (png_bytep)profile + 1))<<16) |
  92.787 +          ((*( (png_bytep)profile + 2))<< 8) |
  92.788 +          ((*( (png_bytep)profile + 3))    );
  92.789 +
  92.790 +   if (profile_len < embedded_profile_len)
  92.791 +   {
  92.792 +      png_warning(png_ptr,
  92.793 +        "Embedded profile length too large in iCCP chunk");
  92.794 +      return;
  92.795 +   }
  92.796 +
  92.797 +   if (profile_len > embedded_profile_len)
  92.798 +   {
  92.799 +      png_warning(png_ptr,
  92.800 +        "Truncating profile to actual length in iCCP chunk");
  92.801 +      profile_len = embedded_profile_len;
  92.802 +   }
  92.803 +
  92.804 +   if (profile_len)
  92.805 +      profile_len = png_text_compress(png_ptr, profile,
  92.806 +        (png_size_t)profile_len, PNG_COMPRESSION_TYPE_BASE, &comp);
  92.807 +
  92.808 +   /* make sure we include the NULL after the name and the compression type */
  92.809 +   png_write_chunk_start(png_ptr, (png_bytep)png_iCCP,
  92.810 +          (png_uint_32)(name_len + profile_len + 2));
  92.811 +   new_name[name_len + 1] = 0x00;
  92.812 +   png_write_chunk_data(png_ptr, (png_bytep)new_name,
  92.813 +     (png_size_t)(name_len + 2));
  92.814 +
  92.815 +   if (profile_len)
  92.816 +      png_write_compressed_data_out(png_ptr, &comp);
  92.817 +
  92.818 +   png_write_chunk_end(png_ptr);
  92.819 +   png_free(png_ptr, new_name);
  92.820 +}
  92.821 +#endif
  92.822 +
  92.823 +#if defined(PNG_WRITE_sPLT_SUPPORTED)
  92.824 +/* write a sPLT chunk */
  92.825 +void /* PRIVATE */
  92.826 +png_write_sPLT(png_structp png_ptr, png_sPLT_tp spalette)
  92.827 +{
  92.828 +#ifdef PNG_USE_LOCAL_ARRAYS
  92.829 +   PNG_sPLT;
  92.830 +#endif
  92.831 +   png_size_t name_len;
  92.832 +   png_charp new_name;
  92.833 +   png_byte entrybuf[10];
  92.834 +   int entry_size = (spalette->depth == 8 ? 6 : 10);
  92.835 +   int palette_size = entry_size * spalette->nentries;
  92.836 +   png_sPLT_entryp ep;
  92.837 +#ifdef PNG_NO_POINTER_INDEXING
  92.838 +   int i;
  92.839 +#endif
  92.840 +
  92.841 +   png_debug(1, "in png_write_sPLT\n");
  92.842 +   if (spalette->name == NULL || (name_len = png_check_keyword(png_ptr,
  92.843 +      spalette->name, &new_name))==0)
  92.844 +   {
  92.845 +      png_warning(png_ptr, "Empty keyword in sPLT chunk");
  92.846 +      return;
  92.847 +   }
  92.848 +
  92.849 +   /* make sure we include the NULL after the name */
  92.850 +   png_write_chunk_start(png_ptr, (png_bytep)png_sPLT,
  92.851 +     (png_uint_32)(name_len + 2 + palette_size));
  92.852 +   png_write_chunk_data(png_ptr, (png_bytep)new_name,
  92.853 +     (png_size_t)(name_len + 1));
  92.854 +   png_write_chunk_data(png_ptr, (png_bytep)&spalette->depth, (png_size_t)1);
  92.855 +
  92.856 +   /* loop through each palette entry, writing appropriately */
  92.857 +#ifndef PNG_NO_POINTER_INDEXING
  92.858 +   for (ep = spalette->entries; ep<spalette->entries + spalette->nentries; ep++)
  92.859 +   {
  92.860 +      if (spalette->depth == 8)
  92.861 +      {
  92.862 +          entrybuf[0] = (png_byte)ep->red;
  92.863 +          entrybuf[1] = (png_byte)ep->green;
  92.864 +          entrybuf[2] = (png_byte)ep->blue;
  92.865 +          entrybuf[3] = (png_byte)ep->alpha;
  92.866 +          png_save_uint_16(entrybuf + 4, ep->frequency);
  92.867 +      }
  92.868 +      else
  92.869 +      {
  92.870 +          png_save_uint_16(entrybuf + 0, ep->red);
  92.871 +          png_save_uint_16(entrybuf + 2, ep->green);
  92.872 +          png_save_uint_16(entrybuf + 4, ep->blue);
  92.873 +          png_save_uint_16(entrybuf + 6, ep->alpha);
  92.874 +          png_save_uint_16(entrybuf + 8, ep->frequency);
  92.875 +      }
  92.876 +      png_write_chunk_data(png_ptr, entrybuf, (png_size_t)entry_size);
  92.877 +   }
  92.878 +#else
  92.879 +   ep=spalette->entries;
  92.880 +   for (i=0; i>spalette->nentries; i++)
  92.881 +   {
  92.882 +      if (spalette->depth == 8)
  92.883 +      {
  92.884 +          entrybuf[0] = (png_byte)ep[i].red;
  92.885 +          entrybuf[1] = (png_byte)ep[i].green;
  92.886 +          entrybuf[2] = (png_byte)ep[i].blue;
  92.887 +          entrybuf[3] = (png_byte)ep[i].alpha;
  92.888 +          png_save_uint_16(entrybuf + 4, ep[i].frequency);
  92.889 +      }
  92.890 +      else
  92.891 +      {
  92.892 +          png_save_uint_16(entrybuf + 0, ep[i].red);
  92.893 +          png_save_uint_16(entrybuf + 2, ep[i].green);
  92.894 +          png_save_uint_16(entrybuf + 4, ep[i].blue);
  92.895 +          png_save_uint_16(entrybuf + 6, ep[i].alpha);
  92.896 +          png_save_uint_16(entrybuf + 8, ep[i].frequency);
  92.897 +      }
  92.898 +      png_write_chunk_data(png_ptr, entrybuf, (png_size_t)entry_size);
  92.899 +   }
  92.900 +#endif
  92.901 +
  92.902 +   png_write_chunk_end(png_ptr);
  92.903 +   png_free(png_ptr, new_name);
  92.904 +}
  92.905 +#endif
  92.906 +
  92.907 +#if defined(PNG_WRITE_sBIT_SUPPORTED)
  92.908 +/* write the sBIT chunk */
  92.909 +void /* PRIVATE */
  92.910 +png_write_sBIT(png_structp png_ptr, png_color_8p sbit, int color_type)
  92.911 +{
  92.912 +#ifdef PNG_USE_LOCAL_ARRAYS
  92.913 +   PNG_sBIT;
  92.914 +#endif
  92.915 +   png_byte buf[4];
  92.916 +   png_size_t size;
  92.917 +
  92.918 +   png_debug(1, "in png_write_sBIT\n");
  92.919 +   /* make sure we don't depend upon the order of PNG_COLOR_8 */
  92.920 +   if (color_type & PNG_COLOR_MASK_COLOR)
  92.921 +   {
  92.922 +      png_byte maxbits;
  92.923 +
  92.924 +      maxbits = (png_byte)(color_type==PNG_COLOR_TYPE_PALETTE ? 8 :
  92.925 +                png_ptr->usr_bit_depth);
  92.926 +      if (sbit->red == 0 || sbit->red > maxbits ||
  92.927 +          sbit->green == 0 || sbit->green > maxbits ||
  92.928 +          sbit->blue == 0 || sbit->blue > maxbits)
  92.929 +      {
  92.930 +         png_warning(png_ptr, "Invalid sBIT depth specified");
  92.931 +         return;
  92.932 +      }
  92.933 +      buf[0] = sbit->red;
  92.934 +      buf[1] = sbit->green;
  92.935 +      buf[2] = sbit->blue;
  92.936 +      size = 3;
  92.937 +   }
  92.938 +   else
  92.939 +   {
  92.940 +      if (sbit->gray == 0 || sbit->gray > png_ptr->usr_bit_depth)
  92.941 +      {
  92.942 +         png_warning(png_ptr, "Invalid sBIT depth specified");
  92.943 +         return;
  92.944 +      }
  92.945 +      buf[0] = sbit->gray;
  92.946 +      size = 1;
  92.947 +   }
  92.948 +
  92.949 +   if (color_type & PNG_COLOR_MASK_ALPHA)
  92.950 +   {
  92.951 +      if (sbit->alpha == 0 || sbit->alpha > png_ptr->usr_bit_depth)
  92.952 +      {
  92.953 +         png_warning(png_ptr, "Invalid sBIT depth specified");
  92.954 +         return;
  92.955 +      }
  92.956 +      buf[size++] = sbit->alpha;
  92.957 +   }
  92.958 +
  92.959 +   png_write_chunk(png_ptr, (png_bytep)png_sBIT, buf, size);
  92.960 +}
  92.961 +#endif
  92.962 +
  92.963 +#if defined(PNG_WRITE_cHRM_SUPPORTED)
  92.964 +/* write the cHRM chunk */
  92.965 +#ifdef PNG_FLOATING_POINT_SUPPORTED
  92.966 +void /* PRIVATE */
  92.967 +png_write_cHRM(png_structp png_ptr, double white_x, double white_y,
  92.968 +   double red_x, double red_y, double green_x, double green_y,
  92.969 +   double blue_x, double blue_y)
  92.970 +{
  92.971 +#ifdef PNG_USE_LOCAL_ARRAYS
  92.972 +   PNG_cHRM;
  92.973 +#endif
  92.974 +   png_byte buf[32];
  92.975 +   png_uint_32 itemp;
  92.976 +
  92.977 +   png_debug(1, "in png_write_cHRM\n");
  92.978 +   /* each value is saved in 1/100,000ths */
  92.979 +   if (white_x < 0 || white_x > 0.8 || white_y < 0 || white_y > 0.8 ||
  92.980 +       white_x + white_y > 1.0)
  92.981 +   {
  92.982 +      png_warning(png_ptr, "Invalid cHRM white point specified");
  92.983 +#if !defined(PNG_NO_CONSOLE_IO)
  92.984 +      fprintf(stderr, "white_x=%f, white_y=%f\n", white_x, white_y);
  92.985 +#endif
  92.986 +      return;
  92.987 +   }
  92.988 +   itemp = (png_uint_32)(white_x * 100000.0 + 0.5);
  92.989 +   png_save_uint_32(buf, itemp);
  92.990 +   itemp = (png_uint_32)(white_y * 100000.0 + 0.5);
  92.991 +   png_save_uint_32(buf + 4, itemp);
  92.992 +
  92.993 +   if (red_x < 0 ||  red_y < 0 || red_x + red_y > 1.0)
  92.994 +   {
  92.995 +      png_warning(png_ptr, "Invalid cHRM red point specified");
  92.996 +      return;
  92.997 +   }
  92.998 +   itemp = (png_uint_32)(red_x * 100000.0 + 0.5);
  92.999 +   png_save_uint_32(buf + 8, itemp);
 92.1000 +   itemp = (png_uint_32)(red_y * 100000.0 + 0.5);
 92.1001 +   png_save_uint_32(buf + 12, itemp);
 92.1002 +
 92.1003 +   if (green_x < 0 || green_y < 0 || green_x + green_y > 1.0)
 92.1004 +   {
 92.1005 +      png_warning(png_ptr, "Invalid cHRM green point specified");
 92.1006 +      return;
 92.1007 +   }
 92.1008 +   itemp = (png_uint_32)(green_x * 100000.0 + 0.5);
 92.1009 +   png_save_uint_32(buf + 16, itemp);
 92.1010 +   itemp = (png_uint_32)(green_y * 100000.0 + 0.5);
 92.1011 +   png_save_uint_32(buf + 20, itemp);
 92.1012 +
 92.1013 +   if (blue_x < 0 || blue_y < 0 || blue_x + blue_y > 1.0)
 92.1014 +   {
 92.1015 +      png_warning(png_ptr, "Invalid cHRM blue point specified");
 92.1016 +      return;
 92.1017 +   }
 92.1018 +   itemp = (png_uint_32)(blue_x * 100000.0 + 0.5);
 92.1019 +   png_save_uint_32(buf + 24, itemp);
 92.1020 +   itemp = (png_uint_32)(blue_y * 100000.0 + 0.5);
 92.1021 +   png_save_uint_32(buf + 28, itemp);
 92.1022 +
 92.1023 +   png_write_chunk(png_ptr, (png_bytep)png_cHRM, buf, (png_size_t)32);
 92.1024 +}
 92.1025 +#endif
 92.1026 +#ifdef PNG_FIXED_POINT_SUPPORTED
 92.1027 +void /* PRIVATE */
 92.1028 +png_write_cHRM_fixed(png_structp png_ptr, png_fixed_point white_x,
 92.1029 +   png_fixed_point white_y, png_fixed_point red_x, png_fixed_point red_y,
 92.1030 +   png_fixed_point green_x, png_fixed_point green_y, png_fixed_point blue_x,
 92.1031 +   png_fixed_point blue_y)
 92.1032 +{
 92.1033 +#ifdef PNG_USE_LOCAL_ARRAYS
 92.1034 +   PNG_cHRM;
 92.1035 +#endif
 92.1036 +   png_byte buf[32];
 92.1037 +
 92.1038 +   png_debug(1, "in png_write_cHRM\n");
 92.1039 +   /* each value is saved in 1/100,000ths */
 92.1040 +   if (white_x > 80000L || white_y > 80000L || white_x + white_y > 100000L)
 92.1041 +   {
 92.1042 +      png_warning(png_ptr, "Invalid fixed cHRM white point specified");
 92.1043 +#if !defined(PNG_NO_CONSOLE_IO)
 92.1044 +      fprintf(stderr, "white_x=%ld, white_y=%ld\n", (unsigned long)white_x,
 92.1045 +        (unsigned long)white_y);
 92.1046 +#endif
 92.1047 +      return;
 92.1048 +   }
 92.1049 +   png_save_uint_32(buf, (png_uint_32)white_x);
 92.1050 +   png_save_uint_32(buf + 4, (png_uint_32)white_y);
 92.1051 +
 92.1052 +   if (red_x + red_y > 100000L)
 92.1053 +   {
 92.1054 +      png_warning(png_ptr, "Invalid cHRM fixed red point specified");
 92.1055 +      return;
 92.1056 +   }
 92.1057 +   png_save_uint_32(buf + 8, (png_uint_32)red_x);
 92.1058 +   png_save_uint_32(buf + 12, (png_uint_32)red_y);
 92.1059 +
 92.1060 +   if (green_x + green_y > 100000L)
 92.1061 +   {
 92.1062 +      png_warning(png_ptr, "Invalid fixed cHRM green point specified");
 92.1063 +      return;
 92.1064 +   }
 92.1065 +   png_save_uint_32(buf + 16, (png_uint_32)green_x);
 92.1066 +   png_save_uint_32(buf + 20, (png_uint_32)green_y);
 92.1067 +
 92.1068 +   if (blue_x + blue_y > 100000L)
 92.1069 +   {
 92.1070 +      png_warning(png_ptr, "Invalid fixed cHRM blue point specified");
 92.1071 +      return;
 92.1072 +   }
 92.1073 +   png_save_uint_32(buf + 24, (png_uint_32)blue_x);
 92.1074 +   png_save_uint_32(buf + 28, (png_uint_32)blue_y);
 92.1075 +
 92.1076 +   png_write_chunk(png_ptr, (png_bytep)png_cHRM, buf, (png_size_t)32);
 92.1077 +}
 92.1078 +#endif
 92.1079 +#endif
 92.1080 +
 92.1081 +#if defined(PNG_WRITE_tRNS_SUPPORTED)
 92.1082 +/* write the tRNS chunk */
 92.1083 +void /* PRIVATE */
 92.1084 +png_write_tRNS(png_structp png_ptr, png_bytep trans, png_color_16p tran,
 92.1085 +   int num_trans, int color_type)
 92.1086 +{
 92.1087 +#ifdef PNG_USE_LOCAL_ARRAYS
 92.1088 +   PNG_tRNS;
 92.1089 +#endif
 92.1090 +   png_byte buf[6];
 92.1091 +
 92.1092 +   png_debug(1, "in png_write_tRNS\n");
 92.1093 +   if (color_type == PNG_COLOR_TYPE_PALETTE)
 92.1094 +   {
 92.1095 +      if (num_trans <= 0 || num_trans > (int)png_ptr->num_palette)
 92.1096 +      {
 92.1097 +         png_warning(png_ptr, "Invalid number of transparent colors specified");
 92.1098 +         return;
 92.1099 +      }
 92.1100 +      /* write the chunk out as it is */
 92.1101 +      png_write_chunk(png_ptr, (png_bytep)png_tRNS, trans,
 92.1102 +        (png_size_t)num_trans);
 92.1103 +   }
 92.1104 +   else if (color_type == PNG_COLOR_TYPE_GRAY)
 92.1105 +   {
 92.1106 +      /* one 16 bit value */
 92.1107 +      if (tran->gray >= (1 << png_ptr->bit_depth))
 92.1108 +      {
 92.1109 +         png_warning(png_ptr,
 92.1110 +           "Ignoring attempt to write tRNS chunk out-of-range for bit_depth");
 92.1111 +         return;
 92.1112 +      }
 92.1113 +      png_save_uint_16(buf, tran->gray);
 92.1114 +      png_write_chunk(png_ptr, (png_bytep)png_tRNS, buf, (png_size_t)2);
 92.1115 +   }
 92.1116 +   else if (color_type == PNG_COLOR_TYPE_RGB)
 92.1117 +   {
 92.1118 +      /* three 16 bit values */
 92.1119 +      png_save_uint_16(buf, tran->red);
 92.1120 +      png_save_uint_16(buf + 2, tran->green);
 92.1121 +      png_save_uint_16(buf + 4, tran->blue);
 92.1122 +      if (png_ptr->bit_depth == 8 && (buf[0] | buf[2] | buf[4]))
 92.1123 +      {
 92.1124 +         png_warning(png_ptr,
 92.1125 +           "Ignoring attempt to write 16-bit tRNS chunk when bit_depth is 8");
 92.1126 +         return;
 92.1127 +      }
 92.1128 +      png_write_chunk(png_ptr, (png_bytep)png_tRNS, buf, (png_size_t)6);
 92.1129 +   }
 92.1130 +   else
 92.1131 +   {
 92.1132 +      png_warning(png_ptr, "Can't write tRNS with an alpha channel");
 92.1133 +   }
 92.1134 +}
 92.1135 +#endif
 92.1136 +
 92.1137 +#if defined(PNG_WRITE_bKGD_SUPPORTED)
 92.1138 +/* write the background chunk */
 92.1139 +void /* PRIVATE */
 92.1140 +png_write_bKGD(png_structp png_ptr, png_color_16p back, int color_type)
 92.1141 +{
 92.1142 +#ifdef PNG_USE_LOCAL_ARRAYS
 92.1143 +   PNG_bKGD;
 92.1144 +#endif
 92.1145 +   png_byte buf[6];
 92.1146 +
 92.1147 +   png_debug(1, "in png_write_bKGD\n");
 92.1148 +   if (color_type == PNG_COLOR_TYPE_PALETTE)
 92.1149 +   {
 92.1150 +      if (
 92.1151 +#if defined(PNG_MNG_FEATURES_SUPPORTED)
 92.1152 +          (png_ptr->num_palette ||
 92.1153 +          (!(png_ptr->mng_features_permitted & PNG_FLAG_MNG_EMPTY_PLTE))) &&
 92.1154 +#endif
 92.1155 +         back->index > png_ptr->num_palette)
 92.1156 +      {
 92.1157 +         png_warning(png_ptr, "Invalid background palette index");
 92.1158 +         return;
 92.1159 +      }
 92.1160 +      buf[0] = back->index;
 92.1161 +      png_write_chunk(png_ptr, (png_bytep)png_bKGD, buf, (png_size_t)1);
 92.1162 +   }
 92.1163 +   else if (color_type & PNG_COLOR_MASK_COLOR)
 92.1164 +   {
 92.1165 +      png_save_uint_16(buf, back->red);
 92.1166 +      png_save_uint_16(buf + 2, back->green);
 92.1167 +      png_save_uint_16(buf + 4, back->blue);
 92.1168 +      if (png_ptr->bit_depth == 8 && (buf[0] | buf[2] | buf[4]))
 92.1169 +      {
 92.1170 +         png_warning(png_ptr,
 92.1171 +           "Ignoring attempt to write 16-bit bKGD chunk when bit_depth is 8");
 92.1172 +         return;
 92.1173 +      }
 92.1174 +      png_write_chunk(png_ptr, (png_bytep)png_bKGD, buf, (png_size_t)6);
 92.1175 +   }
 92.1176 +   else
 92.1177 +   {
 92.1178 +      if (back->gray >= (1 << png_ptr->bit_depth))
 92.1179 +      {
 92.1180 +         png_warning(png_ptr,
 92.1181 +           "Ignoring attempt to write bKGD chunk out-of-range for bit_depth");
 92.1182 +         return;
 92.1183 +      }
 92.1184 +      png_save_uint_16(buf, back->gray);
 92.1185 +      png_write_chunk(png_ptr, (png_bytep)png_bKGD, buf, (png_size_t)2);
 92.1186 +   }
 92.1187 +}
 92.1188 +#endif
 92.1189 +
 92.1190 +#if defined(PNG_WRITE_hIST_SUPPORTED)
 92.1191 +/* write the histogram */
 92.1192 +void /* PRIVATE */
 92.1193 +png_write_hIST(png_structp png_ptr, png_uint_16p hist, int num_hist)
 92.1194 +{
 92.1195 +#ifdef PNG_USE_LOCAL_ARRAYS
 92.1196 +   PNG_hIST;
 92.1197 +#endif
 92.1198 +   int i;
 92.1199 +   png_byte buf[3];
 92.1200 +
 92.1201 +   png_debug(1, "in png_write_hIST\n");
 92.1202 +   if (num_hist > (int)png_ptr->num_palette)
 92.1203 +   {
 92.1204 +      png_debug2(3, "num_hist = %d, num_palette = %d\n", num_hist,
 92.1205 +         png_ptr->num_palette);
 92.1206 +      png_warning(png_ptr, "Invalid number of histogram entries specified");
 92.1207 +      return;
 92.1208 +   }
 92.1209 +
 92.1210 +   png_write_chunk_start(png_ptr, (png_bytep)png_hIST,
 92.1211 +     (png_uint_32)(num_hist * 2));
 92.1212 +   for (i = 0; i < num_hist; i++)
 92.1213 +   {
 92.1214 +      png_save_uint_16(buf, hist[i]);
 92.1215 +      png_write_chunk_data(png_ptr, buf, (png_size_t)2);
 92.1216 +   }
 92.1217 +   png_write_chunk_end(png_ptr);
 92.1218 +}
 92.1219 +#endif
 92.1220 +
 92.1221 +#if defined(PNG_WRITE_TEXT_SUPPORTED) || defined(PNG_WRITE_pCAL_SUPPORTED) || \
 92.1222 +    defined(PNG_WRITE_iCCP_SUPPORTED) || defined(PNG_WRITE_sPLT_SUPPORTED)
 92.1223 +/* Check that the tEXt or zTXt keyword is valid per PNG 1.0 specification,
 92.1224 + * and if invalid, correct the keyword rather than discarding the entire
 92.1225 + * chunk.  The PNG 1.0 specification requires keywords 1-79 characters in
 92.1226 + * length, forbids leading or trailing whitespace, multiple internal spaces,
 92.1227 + * and the non-break space (0x80) from ISO 8859-1.  Returns keyword length.
 92.1228 + *
 92.1229 + * The new_key is allocated to hold the corrected keyword and must be freed
 92.1230 + * by the calling routine.  This avoids problems with trying to write to
 92.1231 + * static keywords without having to have duplicate copies of the strings.
 92.1232 + */
 92.1233 +png_size_t /* PRIVATE */
 92.1234 +png_check_keyword(png_structp png_ptr, png_charp key, png_charpp new_key)
 92.1235 +{
 92.1236 +   png_size_t key_len;
 92.1237 +   png_charp kp, dp;
 92.1238 +   int kflag;
 92.1239 +   int kwarn=0;
 92.1240 +
 92.1241 +   png_debug(1, "in png_check_keyword\n");
 92.1242 +   *new_key = NULL;
 92.1243 +
 92.1244 +   if (key == NULL || (key_len = png_strlen(key)) == 0)
 92.1245 +   {
 92.1246 +      png_warning(png_ptr, "zero length keyword");
 92.1247 +      return ((png_size_t)0);
 92.1248 +   }
 92.1249 +
 92.1250 +   png_debug1(2, "Keyword to be checked is '%s'\n", key);
 92.1251 +
 92.1252 +   *new_key = (png_charp)png_malloc_warn(png_ptr, (png_uint_32)(key_len + 2));
 92.1253 +   if (*new_key == NULL)
 92.1254 +   {
 92.1255 +      png_warning(png_ptr, "Out of memory while procesing keyword");
 92.1256 +      return ((png_size_t)0);
 92.1257 +   }
 92.1258 +
 92.1259 +   /* Replace non-printing characters with a blank and print a warning */
 92.1260 +   for (kp = key, dp = *new_key; *kp != '\0'; kp++, dp++)
 92.1261 +   {
 92.1262 +      if ((png_byte)*kp < 0x20 ||
 92.1263 +         ((png_byte)*kp > 0x7E && (png_byte)*kp < 0xA1))
 92.1264 +      {
 92.1265 +#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE)
 92.1266 +         char msg[40];
 92.1267 +
 92.1268 +         png_snprintf(msg, 40,
 92.1269 +           "invalid keyword character 0x%02X", (png_byte)*kp);
 92.1270 +         png_warning(png_ptr, msg);
 92.1271 +#else
 92.1272 +         png_warning(png_ptr, "invalid character in keyword");
 92.1273 +#endif
 92.1274 +         *dp = ' ';
 92.1275 +      }
 92.1276 +      else
 92.1277 +      {
 92.1278 +         *dp = *kp;
 92.1279 +      }
 92.1280 +   }
 92.1281 +   *dp = '\0';
 92.1282 +
 92.1283 +   /* Remove any trailing white space. */
 92.1284 +   kp = *new_key + key_len - 1;
 92.1285 +   if (*kp == ' ')
 92.1286 +   {
 92.1287 +      png_warning(png_ptr, "trailing spaces removed from keyword");
 92.1288 +
 92.1289 +      while (*kp == ' ')
 92.1290 +      {
 92.1291 +        *(kp--) = '\0';
 92.1292 +        key_len--;
 92.1293 +      }
 92.1294 +   }
 92.1295 +
 92.1296 +   /* Remove any leading white space. */
 92.1297 +   kp = *new_key;
 92.1298 +   if (*kp == ' ')
 92.1299 +   {
 92.1300 +      png_warning(png_ptr, "leading spaces removed from keyword");
 92.1301 +
 92.1302 +      while (*kp == ' ')
 92.1303 +      {
 92.1304 +        kp++;
 92.1305 +        key_len--;
 92.1306 +      }
 92.1307 +   }
 92.1308 +
 92.1309 +   png_debug1(2, "Checking for multiple internal spaces in '%s'\n", kp);
 92.1310 +
 92.1311 +   /* Remove multiple internal spaces. */
 92.1312 +   for (kflag = 0, dp = *new_key; *kp != '\0'; kp++)
 92.1313 +   {
 92.1314 +      if (*kp == ' ' && kflag == 0)
 92.1315 +      {
 92.1316 +         *(dp++) = *kp;
 92.1317 +         kflag = 1;
 92.1318 +      }
 92.1319 +      else if (*kp == ' ')
 92.1320 +      {
 92.1321 +         key_len--;
 92.1322 +         kwarn=1;
 92.1323 +      }
 92.1324 +      else
 92.1325 +      {
 92.1326 +         *(dp++) = *kp;
 92.1327 +         kflag = 0;
 92.1328 +      }
 92.1329 +   }
 92.1330 +   *dp = '\0';
 92.1331 +   if (kwarn)
 92.1332 +      png_warning(png_ptr, "extra interior spaces removed from keyword");
 92.1333 +
 92.1334 +   if (key_len == 0)
 92.1335 +   {
 92.1336 +      png_free(png_ptr, *new_key);
 92.1337 +       *new_key=NULL;
 92.1338 +      png_warning(png_ptr, "Zero length keyword");
 92.1339 +   }
 92.1340 +
 92.1341 +   if (key_len > 79)
 92.1342 +   {
 92.1343 +      png_warning(png_ptr, "keyword length must be 1 - 79 characters");
 92.1344 +      new_key[79] = '\0';
 92.1345 +      key_len = 79;
 92.1346 +   }
 92.1347 +
 92.1348 +   return (key_len);
 92.1349 +}
 92.1350 +#endif
 92.1351 +
 92.1352 +#if defined(PNG_WRITE_tEXt_SUPPORTED)
 92.1353 +/* write a tEXt chunk */
 92.1354 +void /* PRIVATE */
 92.1355 +png_write_tEXt(png_structp png_ptr, png_charp key, png_charp text,
 92.1356 +   png_size_t text_len)
 92.1357 +{
 92.1358 +#ifdef PNG_USE_LOCAL_ARRAYS
 92.1359 +   PNG_tEXt;
 92.1360 +#endif
 92.1361 +   png_size_t key_len;
 92.1362 +   png_charp new_key;
 92.1363 +
 92.1364 +   png_debug(1, "in png_write_tEXt\n");
 92.1365 +   if (key == NULL || (key_len = png_check_keyword(png_ptr, key, &new_key))==0)
 92.1366 +   {
 92.1367 +      png_warning(png_ptr, "Empty keyword in tEXt chunk");
 92.1368 +      return;
 92.1369 +   }
 92.1370 +
 92.1371 +   if (text == NULL || *text == '\0')
 92.1372 +      text_len = 0;
 92.1373 +   else
 92.1374 +      text_len = png_strlen(text);
 92.1375 +
 92.1376 +   /* make sure we include the 0 after the key */
 92.1377 +   png_write_chunk_start(png_ptr, (png_bytep)png_tEXt,
 92.1378 +      (png_uint_32)(key_len + text_len + 1));
 92.1379 +   /*
 92.1380 +    * We leave it to the application to meet PNG-1.0 requirements on the
 92.1381 +    * contents of the text.  PNG-1.0 through PNG-1.2 discourage the use of
 92.1382 +    * any non-Latin-1 characters except for NEWLINE.  ISO PNG will forbid them.
 92.1383 +    * The NUL character is forbidden by PNG-1.0 through PNG-1.2 and ISO PNG.
 92.1384 +    */
 92.1385 +   png_write_chunk_data(png_ptr, (png_bytep)new_key,
 92.1386 +     (png_size_t)(key_len + 1));
 92.1387 +   if (text_len)
 92.1388 +      png_write_chunk_data(png_ptr, (png_bytep)text, (png_size_t)text_len);
 92.1389 +
 92.1390 +   png_write_chunk_end(png_ptr);
 92.1391 +   png_free(png_ptr, new_key);
 92.1392 +}
 92.1393 +#endif
 92.1394 +
 92.1395 +#if defined(PNG_WRITE_zTXt_SUPPORTED)
 92.1396 +/* write a compressed text chunk */
 92.1397 +void /* PRIVATE */
 92.1398 +png_write_zTXt(png_structp png_ptr, png_charp key, png_charp text,
 92.1399 +   png_size_t text_len, int compression)
 92.1400 +{
 92.1401 +#ifdef PNG_USE_LOCAL_ARRAYS
 92.1402 +   PNG_zTXt;
 92.1403 +#endif
 92.1404 +   png_size_t key_len;
 92.1405 +   char buf[1];
 92.1406 +   png_charp new_key;
 92.1407 +   compression_state comp;
 92.1408 +
 92.1409 +   png_debug(1, "in png_write_zTXt\n");
 92.1410 +
 92.1411 +   comp.num_output_ptr = 0;
 92.1412 +   comp.max_output_ptr = 0;
 92.1413 +   comp.output_ptr = NULL;
 92.1414 +   comp.input = NULL;
 92.1415 +   comp.input_len = 0;
 92.1416 +
 92.1417 +   if (key == NULL || (key_len = png_check_keyword(png_ptr, key, &new_key))==0)
 92.1418 +   {
 92.1419 +      png_warning(png_ptr, "Empty keyword in zTXt chunk");
 92.1420 +      png_free(png_ptr, new_key);
 92.1421 +      return;
 92.1422 +   }
 92.1423 +
 92.1424 +   if (text == NULL || *text == '\0' || compression==PNG_TEXT_COMPRESSION_NONE)
 92.1425 +   {
 92.1426 +      png_write_tEXt(png_ptr, new_key, text, (png_size_t)0);
 92.1427 +      png_free(png_ptr, new_key);
 92.1428 +      return;
 92.1429 +   }
 92.1430 +
 92.1431 +   text_len = png_strlen(text);
 92.1432 +
 92.1433 +   /* compute the compressed data; do it now for the length */
 92.1434 +   text_len = png_text_compress(png_ptr, text, text_len, compression,
 92.1435 +       &comp);
 92.1436 +
 92.1437 +   /* write start of chunk */
 92.1438 +   png_write_chunk_start(png_ptr, (png_bytep)png_zTXt,
 92.1439 +     (png_uint_32)(key_len+text_len + 2));
 92.1440 +   /* write key */
 92.1441 +   png_write_chunk_data(png_ptr, (png_bytep)new_key,
 92.1442 +     (png_size_t)(key_len + 1));
 92.1443 +   png_free(png_ptr, new_key);
 92.1444 +
 92.1445 +   buf[0] = (png_byte)compression;
 92.1446 +   /* write compression */
 92.1447 +   png_write_chunk_data(png_ptr, (png_bytep)buf, (png_size_t)1);
 92.1448 +   /* write the compressed data */
 92.1449 +   png_write_compressed_data_out(png_ptr, &comp);
 92.1450 +
 92.1451 +   /* close the chunk */
 92.1452 +   png_write_chunk_end(png_ptr);
 92.1453 +}
 92.1454 +#endif
 92.1455 +
 92.1456 +#if defined(PNG_WRITE_iTXt_SUPPORTED)
 92.1457 +/* write an iTXt chunk */
 92.1458 +void /* PRIVATE */
 92.1459 +png_write_iTXt(png_structp png_ptr, int compression, png_charp key,
 92.1460 +    png_charp lang, png_charp lang_key, png_charp text)
 92.1461 +{
 92.1462 +#ifdef PNG_USE_LOCAL_ARRAYS
 92.1463 +   PNG_iTXt;
 92.1464 +#endif
 92.1465 +   png_size_t lang_len, key_len, lang_key_len, text_len;
 92.1466 +   png_charp new_lang, new_key;
 92.1467 +   png_byte cbuf[2];
 92.1468 +   compression_state comp;
 92.1469 +
 92.1470 +   png_debug(1, "in png_write_iTXt\n");
 92.1471 +
 92.1472 +   comp.num_output_ptr = 0;
 92.1473 +   comp.max_output_ptr = 0;
 92.1474 +   comp.output_ptr = NULL;
 92.1475 +   comp.input = NULL;
 92.1476 +
 92.1477 +   if (key == NULL || (key_len = png_check_keyword(png_ptr, key, &new_key))==0)
 92.1478 +   {
 92.1479 +      png_warning(png_ptr, "Empty keyword in iTXt chunk");
 92.1480 +      return;
 92.1481 +   }
 92.1482 +   if (lang == NULL || (lang_len = png_check_keyword(png_ptr, lang, &new_lang))==0)
 92.1483 +   {
 92.1484 +      png_warning(png_ptr, "Empty language field in iTXt chunk");
 92.1485 +      new_lang = NULL;
 92.1486 +      lang_len = 0;
 92.1487 +   }
 92.1488 +
 92.1489 +   if (lang_key == NULL)
 92.1490 +     lang_key_len = 0;
 92.1491 +   else
 92.1492 +     lang_key_len = png_strlen(lang_key);
 92.1493 +
 92.1494 +   if (text == NULL)
 92.1495 +      text_len = 0;
 92.1496 +   else
 92.1497 +     text_len = png_strlen(text);
 92.1498 +
 92.1499 +   /* compute the compressed data; do it now for the length */
 92.1500 +   text_len = png_text_compress(png_ptr, text, text_len, compression-2,
 92.1501 +      &comp);
 92.1502 +
 92.1503 +
 92.1504 +   /* make sure we include the compression flag, the compression byte,
 92.1505 +    * and the NULs after the key, lang, and lang_key parts */
 92.1506 +
 92.1507 +   png_write_chunk_start(png_ptr, (png_bytep)png_iTXt,
 92.1508 +          (png_uint_32)(
 92.1509 +        5 /* comp byte, comp flag, terminators for key, lang and lang_key */
 92.1510 +        + key_len
 92.1511 +        + lang_len
 92.1512 +        + lang_key_len
 92.1513 +        + text_len));
 92.1514 +
 92.1515 +   /*
 92.1516 +    * We leave it to the application to meet PNG-1.0 requirements on the
 92.1517 +    * contents of the text.  PNG-1.0 through PNG-1.2 discourage the use of
 92.1518 +    * any non-Latin-1 characters except for NEWLINE.  ISO PNG will forbid them.
 92.1519 +    * The NUL character is forbidden by PNG-1.0 through PNG-1.2 and ISO PNG.
 92.1520 +    */
 92.1521 +   png_write_chunk_data(png_ptr, (png_bytep)new_key,
 92.1522 +     (png_size_t)(key_len + 1));
 92.1523 +
 92.1524 +   /* set the compression flag */
 92.1525 +   if (compression == PNG_ITXT_COMPRESSION_NONE || \
 92.1526 +       compression == PNG_TEXT_COMPRESSION_NONE)
 92.1527 +       cbuf[0] = 0;
 92.1528 +   else /* compression == PNG_ITXT_COMPRESSION_zTXt */
 92.1529 +       cbuf[0] = 1;
 92.1530 +   /* set the compression method */
 92.1531 +   cbuf[1] = 0;
 92.1532 +   png_write_chunk_data(png_ptr, cbuf, (png_size_t)2);
 92.1533 +
 92.1534 +   cbuf[0] = 0;
 92.1535 +   png_write_chunk_data(png_ptr, (new_lang ? (png_bytep)new_lang : cbuf),
 92.1536 +     (png_size_t)(lang_len + 1));
 92.1537 +   png_write_chunk_data(png_ptr, (lang_key ? (png_bytep)lang_key : cbuf),
 92.1538 +     (png_size_t)(lang_key_len + 1));
 92.1539 +   png_write_compressed_data_out(png_ptr, &comp);
 92.1540 +
 92.1541 +   png_write_chunk_end(png_ptr);
 92.1542 +   png_free(png_ptr, new_key);
 92.1543 +   png_free(png_ptr, new_lang);
 92.1544 +}
 92.1545 +#endif
 92.1546 +
 92.1547 +#if defined(PNG_WRITE_oFFs_SUPPORTED)
 92.1548 +/* write the oFFs chunk */
 92.1549 +void /* PRIVATE */
 92.1550 +png_write_oFFs(png_structp png_ptr, png_int_32 x_offset, png_int_32 y_offset,
 92.1551 +   int unit_type)
 92.1552 +{
 92.1553 +#ifdef PNG_USE_LOCAL_ARRAYS
 92.1554 +   PNG_oFFs;
 92.1555 +#endif
 92.1556 +   png_byte buf[9];
 92.1557 +
 92.1558 +   png_debug(1, "in png_write_oFFs\n");
 92.1559 +   if (unit_type >= PNG_OFFSET_LAST)
 92.1560 +      png_warning(png_ptr, "Unrecognized unit type for oFFs chunk");
 92.1561 +
 92.1562 +   png_save_int_32(buf, x_offset);
 92.1563 +   png_save_int_32(buf + 4, y_offset);
 92.1564 +   buf[8] = (png_byte)unit_type;
 92.1565 +
 92.1566 +   png_write_chunk(png_ptr, (png_bytep)png_oFFs, buf, (png_size_t)9);
 92.1567 +}
 92.1568 +#endif
 92.1569 +#if defined(PNG_WRITE_pCAL_SUPPORTED)
 92.1570 +/* write the pCAL chunk (described in the PNG extensions document) */
 92.1571 +void /* PRIVATE */
 92.1572 +png_write_pCAL(png_structp png_ptr, png_charp purpose, png_int_32 X0,
 92.1573 +   png_int_32 X1, int type, int nparams, png_charp units, png_charpp params)
 92.1574 +{
 92.1575 +#ifdef PNG_USE_LOCAL_ARRAYS
 92.1576 +   PNG_pCAL;
 92.1577 +#endif
 92.1578 +   png_size_t purpose_len, units_len, total_len;
 92.1579 +   png_uint_32p params_len;
 92.1580 +   png_byte buf[10];
 92.1581 +   png_charp new_purpose;
 92.1582 +   int i;
 92.1583 +
 92.1584 +   png_debug1(1, "in png_write_pCAL (%d parameters)\n", nparams);
 92.1585 +   if (type >= PNG_EQUATION_LAST)
 92.1586 +      png_warning(png_ptr, "Unrecognized equation type for pCAL chunk");
 92.1587 +
 92.1588 +   purpose_len = png_check_keyword(png_ptr, purpose, &new_purpose) + 1;
 92.1589 +   png_debug1(3, "pCAL purpose length = %d\n", (int)purpose_len);
 92.1590 +   units_len = png_strlen(units) + (nparams == 0 ? 0 : 1);
 92.1591 +   png_debug1(3, "pCAL units length = %d\n", (int)units_len);
 92.1592 +   total_len = purpose_len + units_len + 10;
 92.1593 +
 92.1594 +   params_len = (png_uint_32p)png_malloc(png_ptr,
 92.1595 +      (png_uint_32)(nparams * png_sizeof(png_uint_32)));
 92.1596 +
 92.1597 +   /* Find the length of each parameter, making sure we don't count the
 92.1598 +      null terminator for the last parameter. */
 92.1599 +   for (i = 0; i < nparams; i++)
 92.1600 +   {
 92.1601 +      params_len[i] = png_strlen(params[i]) + (i == nparams - 1 ? 0 : 1);
 92.1602 +      png_debug2(3, "pCAL parameter %d length = %lu\n", i,
 92.1603 +        (unsigned long) params_len[i]);
 92.1604 +      total_len += (png_size_t)params_len[i];
 92.1605 +   }
 92.1606 +
 92.1607 +   png_debug1(3, "pCAL total length = %d\n", (int)total_len);
 92.1608 +   png_write_chunk_start(png_ptr, (png_bytep)png_pCAL, (png_uint_32)total_len);
 92.1609 +   png_write_chunk_data(png_ptr, (png_bytep)new_purpose,
 92.1610 +     (png_size_t)purpose_len);
 92.1611 +   png_save_int_32(buf, X0);
 92.1612 +   png_save_int_32(buf + 4, X1);
 92.1613 +   buf[8] = (png_byte)type;
 92.1614 +   buf[9] = (png_byte)nparams;
 92.1615 +   png_write_chunk_data(png_ptr, buf, (png_size_t)10);
 92.1616 +   png_write_chunk_data(png_ptr, (png_bytep)units, (png_size_t)units_len);
 92.1617 +
 92.1618 +   png_free(png_ptr, new_purpose);
 92.1619 +
 92.1620 +   for (i = 0; i < nparams; i++)
 92.1621 +   {
 92.1622 +      png_write_chunk_data(png_ptr, (png_bytep)params[i],
 92.1623 +         (png_size_t)params_len[i]);
 92.1624 +   }
 92.1625 +
 92.1626 +   png_free(png_ptr, params_len);
 92.1627 +   png_write_chunk_end(png_ptr);
 92.1628 +}
 92.1629 +#endif
 92.1630 +
 92.1631 +#if defined(PNG_WRITE_sCAL_SUPPORTED)
 92.1632 +/* write the sCAL chunk */
 92.1633 +#if defined(PNG_FLOATING_POINT_SUPPORTED) && !defined(PNG_NO_STDIO)
 92.1634 +void /* PRIVATE */
 92.1635 +png_write_sCAL(png_structp png_ptr, int unit, double width, double height)
 92.1636 +{
 92.1637 +#ifdef PNG_USE_LOCAL_ARRAYS
 92.1638 +   PNG_sCAL;
 92.1639 +#endif
 92.1640 +   char buf[64];
 92.1641 +   png_size_t total_len;
 92.1642 +
 92.1643 +   png_debug(1, "in png_write_sCAL\n");
 92.1644 +
 92.1645 +   buf[0] = (char)unit;
 92.1646 +#if defined(_WIN32_WCE)
 92.1647 +/* sprintf() function is not supported on WindowsCE */
 92.1648 +   {
 92.1649 +      wchar_t wc_buf[32];
 92.1650 +      size_t wc_len;
 92.1651 +      swprintf(wc_buf, TEXT("%12.12e"), width);
 92.1652 +      wc_len = wcslen(wc_buf);
 92.1653 +      WideCharToMultiByte(CP_ACP, 0, wc_buf, -1, buf + 1, wc_len, NULL, NULL);
 92.1654 +      total_len = wc_len + 2;
 92.1655 +      swprintf(wc_buf, TEXT("%12.12e"), height);
 92.1656 +      wc_len = wcslen(wc_buf);
 92.1657 +      WideCharToMultiByte(CP_ACP, 0, wc_buf, -1, buf + total_len, wc_len,
 92.1658 +         NULL, NULL);
 92.1659 +      total_len += wc_len;
 92.1660 +   }
 92.1661 +#else
 92.1662 +   png_snprintf(buf + 1, 63, "%12.12e", width);
 92.1663 +   total_len = 1 + png_strlen(buf + 1) + 1;
 92.1664 +   png_snprintf(buf + total_len, 64-total_len, "%12.12e", height);
 92.1665 +   total_len += png_strlen(buf + total_len);
 92.1666 +#endif
 92.1667 +
 92.1668 +   png_debug1(3, "sCAL total length = %u\n", (unsigned int)total_len);
 92.1669 +   png_write_chunk(png_ptr, (png_bytep)png_sCAL, (png_bytep)buf, total_len);
 92.1670 +}
 92.1671 +#else
 92.1672 +#ifdef PNG_FIXED_POINT_SUPPORTED
 92.1673 +void /* PRIVATE */
 92.1674 +png_write_sCAL_s(png_structp png_ptr, int unit, png_charp width,
 92.1675 +   png_charp height)
 92.1676 +{
 92.1677 +#ifdef PNG_USE_LOCAL_ARRAYS
 92.1678 +   PNG_sCAL;
 92.1679 +#endif
 92.1680 +   png_byte buf[64];
 92.1681 +   png_size_t wlen, hlen, total_len;
 92.1682 +
 92.1683 +   png_debug(1, "in png_write_sCAL_s\n");
 92.1684 +
 92.1685 +   wlen = png_strlen(width);
 92.1686 +   hlen = png_strlen(height);
 92.1687 +   total_len = wlen + hlen + 2;
 92.1688 +   if (total_len > 64)
 92.1689 +   {
 92.1690 +      png_warning(png_ptr, "Can't write sCAL (buffer too small)");
 92.1691 +      return;
 92.1692 +   }
 92.1693 +
 92.1694 +   buf[0] = (png_byte)unit;
 92.1695 +   png_memcpy(buf + 1, width, wlen + 1);      /* append the '\0' here */
 92.1696 +   png_memcpy(buf + wlen + 2, height, hlen);  /* do NOT append the '\0' here */
 92.1697 +
 92.1698 +   png_debug1(3, "sCAL total length = %u\n", (unsigned int)total_len);
 92.1699 +   png_write_chunk(png_ptr, (png_bytep)png_sCAL, buf, total_len);
 92.1700 +}
 92.1701 +#endif
 92.1702 +#endif
 92.1703 +#endif
 92.1704 +
 92.1705 +#if defined(PNG_WRITE_pHYs_SUPPORTED)
 92.1706 +/* write the pHYs chunk */
 92.1707 +void /* PRIVATE */
 92.1708 +png_write_pHYs(png_structp png_ptr, png_uint_32 x_pixels_per_unit,
 92.1709 +   png_uint_32 y_pixels_per_unit,
 92.1710 +   int unit_type)
 92.1711 +{
 92.1712 +#ifdef PNG_USE_LOCAL_ARRAYS
 92.1713 +   PNG_pHYs;
 92.1714 +#endif
 92.1715 +   png_byte buf[9];
 92.1716 +
 92.1717 +   png_debug(1, "in png_write_pHYs\n");
 92.1718 +   if (unit_type >= PNG_RESOLUTION_LAST)
 92.1719 +      png_warning(png_ptr, "Unrecognized unit type for pHYs chunk");
 92.1720 +
 92.1721 +   png_save_uint_32(buf, x_pixels_per_unit);
 92.1722 +   png_save_uint_32(buf + 4, y_pixels_per_unit);
 92.1723 +   buf[8] = (png_byte)unit_type;
 92.1724 +
 92.1725 +   png_write_chunk(png_ptr, (png_bytep)png_pHYs, buf, (png_size_t)9);
 92.1726 +}
 92.1727 +#endif
 92.1728 +
 92.1729 +#if defined(PNG_WRITE_tIME_SUPPORTED)
 92.1730 +/* Write the tIME chunk.  Use either png_convert_from_struct_tm()
 92.1731 + * or png_convert_from_time_t(), or fill in the structure yourself.
 92.1732 + */
 92.1733 +void /* PRIVATE */
 92.1734 +png_write_tIME(png_structp png_ptr, png_timep mod_time)
 92.1735 +{
 92.1736 +#ifdef PNG_USE_LOCAL_ARRAYS
 92.1737 +   PNG_tIME;
 92.1738 +#endif
 92.1739 +   png_byte buf[7];
 92.1740 +
 92.1741 +   png_debug(1, "in png_write_tIME\n");
 92.1742 +   if (mod_time->month  > 12 || mod_time->month  < 1 ||
 92.1743 +       mod_time->day    > 31 || mod_time->day    < 1 ||
 92.1744 +       mod_time->hour   > 23 || mod_time->second > 60)
 92.1745 +   {
 92.1746 +      png_warning(png_ptr, "Invalid time specified for tIME chunk");
 92.1747 +      return;
 92.1748 +   }
 92.1749 +
 92.1750 +   png_save_uint_16(buf, mod_time->year);
 92.1751 +   buf[2] = mod_time->month;
 92.1752 +   buf[3] = mod_time->day;
 92.1753 +   buf[4] = mod_time->hour;
 92.1754 +   buf[5] = mod_time->minute;
 92.1755 +   buf[6] = mod_time->second;
 92.1756 +
 92.1757 +   png_write_chunk(png_ptr, (png_bytep)png_tIME, buf, (png_size_t)7);
 92.1758 +}
 92.1759 +#endif
 92.1760 +
 92.1761 +/* initializes the row writing capability of libpng */
 92.1762 +void /* PRIVATE */
 92.1763 +png_write_start_row(png_structp png_ptr)
 92.1764 +{
 92.1765 +#ifdef PNG_WRITE_INTERLACING_SUPPORTED
 92.1766 +#ifdef PNG_USE_LOCAL_ARRAYS
 92.1767 +   /* arrays to facilitate easy interlacing - use pass (0 - 6) as index */
 92.1768 +
 92.1769 +   /* start of interlace block */
 92.1770 +   int png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0};
 92.1771 +
 92.1772 +   /* offset to next interlace block */
 92.1773 +   int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
 92.1774 +
 92.1775 +   /* start of interlace block in the y direction */
 92.1776 +   int png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1};
 92.1777 +
 92.1778 +   /* offset to next interlace block in the y direction */
 92.1779 +   int png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2};
 92.1780 +#endif
 92.1781 +#endif
 92.1782 +
 92.1783 +   png_size_t buf_size;
 92.1784 +
 92.1785 +   png_debug(1, "in png_write_start_row\n");
 92.1786 +   buf_size = (png_size_t)(PNG_ROWBYTES(
 92.1787 +      png_ptr->usr_channels*png_ptr->usr_bit_depth, png_ptr->width) + 1);
 92.1788 +
 92.1789 +   /* set up row buffer */
 92.1790 +   png_ptr->row_buf = (png_bytep)png_malloc(png_ptr,
 92.1791 +     (png_uint_32)buf_size);
 92.1792 +   png_ptr->row_buf[0] = PNG_FILTER_VALUE_NONE;
 92.1793 +
 92.1794 +#ifndef PNG_NO_WRITE_FILTER
 92.1795 +   /* set up filtering buffer, if using this filter */
 92.1796 +   if (png_ptr->do_filter & PNG_FILTER_SUB)
 92.1797 +   {
 92.1798 +      png_ptr->sub_row = (png_bytep)png_malloc(png_ptr,
 92.1799 +         (png_uint_32)(png_ptr->rowbytes + 1));
 92.1800 +      png_ptr->sub_row[0] = PNG_FILTER_VALUE_SUB;
 92.1801 +   }
 92.1802 +
 92.1803 +   /* We only need to keep the previous row if we are using one of these. */
 92.1804 +   if (png_ptr->do_filter & (PNG_FILTER_AVG | PNG_FILTER_UP | PNG_FILTER_PAETH))
 92.1805 +   {
 92.1806 +     /* set up previous row buffer */
 92.1807 +      png_ptr->prev_row = (png_bytep)png_malloc(png_ptr,
 92.1808 +        (png_uint_32)buf_size);
 92.1809 +      png_memset(png_ptr->prev_row, 0, buf_size);
 92.1810 +
 92.1811 +      if (png_ptr->do_filter & PNG_FILTER_UP)
 92.1812 +      {
 92.1813 +         png_ptr->up_row = (png_bytep)png_malloc(png_ptr,
 92.1814 +           (png_uint_32)(png_ptr->rowbytes + 1));
 92.1815 +         png_ptr->up_row[0] = PNG_FILTER_VALUE_UP;
 92.1816 +      }
 92.1817 +
 92.1818 +      if (png_ptr->do_filter & PNG_FILTER_AVG)
 92.1819 +      {
 92.1820 +         png_ptr->avg_row = (png_bytep)png_malloc(png_ptr,
 92.1821 +           (png_uint_32)(png_ptr->rowbytes + 1));
 92.1822 +         png_ptr->avg_row[0] = PNG_FILTER_VALUE_AVG;
 92.1823 +      }
 92.1824 +
 92.1825 +      if (png_ptr->do_filter & PNG_FILTER_PAETH)
 92.1826 +      {
 92.1827 +         png_ptr->paeth_row = (png_bytep)png_malloc(png_ptr,
 92.1828 +           (png_uint_32)(png_ptr->rowbytes + 1));
 92.1829 +         png_ptr->paeth_row[0] = PNG_FILTER_VALUE_PAETH;
 92.1830 +      }
 92.1831 +   }
 92.1832 +#endif /* PNG_NO_WRITE_FILTER */
 92.1833 +
 92.1834 +#ifdef PNG_WRITE_INTERLACING_SUPPORTED
 92.1835 +   /* if interlaced, we need to set up width and height of pass */
 92.1836 +   if (png_ptr->interlaced)
 92.1837 +   {
 92.1838 +      if (!(png_ptr->transformations & PNG_INTERLACE))
 92.1839 +      {
 92.1840 +         png_ptr->num_rows = (png_ptr->height + png_pass_yinc[0] - 1 -
 92.1841 +            png_pass_ystart[0]) / png_pass_yinc[0];
 92.1842 +         png_ptr->usr_width = (png_ptr->width + png_pass_inc[0] - 1 -
 92.1843 +            png_pass_start[0]) / png_pass_inc[0];
 92.1844 +      }
 92.1845 +      else
 92.1846 +      {
 92.1847 +         png_ptr->num_rows = png_ptr->height;
 92.1848 +         png_ptr->usr_width = png_ptr->width;
 92.1849 +      }
 92.1850 +   }
 92.1851 +   else
 92.1852 +#endif
 92.1853 +   {
 92.1854 +      png_ptr->num_rows = png_ptr->height;
 92.1855 +      png_ptr->usr_width = png_ptr->width;
 92.1856 +   }
 92.1857 +   png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
 92.1858 +   png_ptr->zstream.next_out = png_ptr->zbuf;
 92.1859 +}
 92.1860 +
 92.1861 +/* Internal use only.  Called when finished processing a row of data. */
 92.1862 +void /* PRIVATE */
 92.1863 +png_write_finish_row(png_structp png_ptr)
 92.1864 +{
 92.1865 +#ifdef PNG_WRITE_INTERLACING_SUPPORTED
 92.1866 +#ifdef PNG_USE_LOCAL_ARRAYS
 92.1867 +   /* arrays to facilitate easy interlacing - use pass (0 - 6) as index */
 92.1868 +
 92.1869 +   /* start of interlace block */
 92.1870 +   int png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0};
 92.1871 +
 92.1872 +   /* offset to next interlace block */
 92.1873 +   int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
 92.1874 +
 92.1875 +   /* start of interlace block in the y direction */
 92.1876 +   int png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1};
 92.1877 +
 92.1878 +   /* offset to next interlace block in the y direction */
 92.1879 +   int png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2};
 92.1880 +#endif
 92.1881 +#endif
 92.1882 +
 92.1883 +   int ret;
 92.1884 +
 92.1885 +   png_debug(1, "in png_write_finish_row\n");
 92.1886 +   /* next row */
 92.1887 +   png_ptr->row_number++;
 92.1888 +
 92.1889 +   /* see if we are done */
 92.1890 +   if (png_ptr->row_number < png_ptr->num_rows)
 92.1891 +      return;
 92.1892 +
 92.1893 +#ifdef PNG_WRITE_INTERLACING_SUPPORTED
 92.1894 +   /* if interlaced, go to next pass */
 92.1895 +   if (png_ptr->interlaced)
 92.1896 +   {
 92.1897 +      png_ptr->row_number = 0;
 92.1898 +      if (png_ptr->transformations & PNG_INTERLACE)
 92.1899 +      {
 92.1900 +         png_ptr->pass++;
 92.1901 +      }
 92.1902 +      else
 92.1903 +      {
 92.1904 +         /* loop until we find a non-zero width or height pass */
 92.1905 +         do
 92.1906 +         {
 92.1907 +            png_ptr->pass++;
 92.1908 +            if (png_ptr->pass >= 7)
 92.1909 +               break;
 92.1910 +            png_ptr->usr_width = (png_ptr->width +
 92.1911 +               png_pass_inc[png_ptr->pass] - 1 -
 92.1912 +               png_pass_start[png_ptr->pass]) /
 92.1913 +               png_pass_inc[png_ptr->pass];
 92.1914 +            png_ptr->num_rows = (png_ptr->height +
 92.1915 +               png_pass_yinc[png_ptr->pass] - 1 -
 92.1916 +               png_pass_ystart[png_ptr->pass]) /
 92.1917 +               png_pass_yinc[png_ptr->pass];
 92.1918 +            if (png_ptr->transformations & PNG_INTERLACE)
 92.1919 +               break;
 92.1920 +         } while (png_ptr->usr_width == 0 || png_ptr->num_rows == 0);
 92.1921 +
 92.1922 +      }
 92.1923 +
 92.1924 +      /* reset the row above the image for the next pass */
 92.1925 +      if (png_ptr->pass < 7)
 92.1926 +      {
 92.1927 +         if (png_ptr->prev_row != NULL)
 92.1928 +            png_memset(png_ptr->prev_row, 0,
 92.1929 +               (png_size_t)(PNG_ROWBYTES(png_ptr->usr_channels*
 92.1930 +               png_ptr->usr_bit_depth, png_ptr->width)) + 1);
 92.1931 +         return;
 92.1932 +      }
 92.1933 +   }
 92.1934 +#endif
 92.1935 +
 92.1936 +   /* if we get here, we've just written the last row, so we need
 92.1937 +      to flush the compressor */
 92.1938 +   do
 92.1939 +   {
 92.1940 +      /* tell the compressor we are done */
 92.1941 +      ret = deflate(&png_ptr->zstream, Z_FINISH);
 92.1942 +      /* check for an error */
 92.1943 +      if (ret == Z_OK)
 92.1944 +      {
 92.1945 +         /* check to see if we need more room */
 92.1946 +         if (!(png_ptr->zstream.avail_out))
 92.1947 +         {
 92.1948 +            png_write_IDAT(png_ptr, png_ptr->zbuf, png_ptr->zbuf_size);
 92.1949 +            png_ptr->zstream.next_out = png_ptr->zbuf;
 92.1950 +            png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
 92.1951 +         }
 92.1952 +      }
 92.1953 +      else if (ret != Z_STREAM_END)
 92.1954 +      {
 92.1955 +         if (png_ptr->zstream.msg != NULL)
 92.1956 +            png_error(png_ptr, png_ptr->zstream.msg);
 92.1957 +         else
 92.1958 +            png_error(png_ptr, "zlib error");
 92.1959 +      }
 92.1960 +   } while (ret != Z_STREAM_END);
 92.1961 +
 92.1962 +   /* write any extra space */
 92.1963 +   if (png_ptr->zstream.avail_out < png_ptr->zbuf_size)
 92.1964 +   {
 92.1965 +      png_write_IDAT(png_ptr, png_ptr->zbuf, png_ptr->zbuf_size -
 92.1966 +         png_ptr->zstream.avail_out);
 92.1967 +   }
 92.1968 +
 92.1969 +   deflateReset(&png_ptr->zstream);
 92.1970 +   png_ptr->zstream.data_type = Z_BINARY;
 92.1971 +}
 92.1972 +
 92.1973 +#if defined(PNG_WRITE_INTERLACING_SUPPORTED)
 92.1974 +/* Pick out the correct pixels for the interlace pass.
 92.1975 + * The basic idea here is to go through the row with a source
 92.1976 + * pointer and a destination pointer (sp and dp), and copy the
 92.1977 + * correct pixels for the pass.  As the row gets compacted,
 92.1978 + * sp will always be >= dp, so we should never overwrite anything.
 92.1979 + * See the default: case for the easiest code to understand.
 92.1980 + */
 92.1981 +void /* PRIVATE */
 92.1982 +png_do_write_interlace(png_row_infop row_info, png_bytep row, int pass)
 92.1983 +{
 92.1984 +#ifdef PNG_USE_LOCAL_ARRAYS
 92.1985 +   /* arrays to facilitate easy interlacing - use pass (0 - 6) as index */
 92.1986 +
 92.1987 +   /* start of interlace block */
 92.1988 +   int png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0};
 92.1989 +
 92.1990 +   /* offset to next interlace block */
 92.1991 +   int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
 92.1992 +#endif
 92.1993 +
 92.1994 +   png_debug(1, "in png_do_write_interlace\n");
 92.1995 +   /* we don't have to do anything on the last pass (6) */
 92.1996 +#if defined(PNG_USELESS_TESTS_SUPPORTED)
 92.1997 +   if (row != NULL && row_info != NULL && pass < 6)
 92.1998 +#else
 92.1999 +   if (pass < 6)
 92.2000 +#endif
 92.2001 +   {
 92.2002 +      /* each pixel depth is handled separately */
 92.2003 +      switch (row_info->pixel_depth)
 92.2004 +      {
 92.2005 +         case 1:
 92.2006 +         {
 92.2007 +            png_bytep sp;
 92.2008 +            png_bytep dp;
 92.2009 +            int shift;
 92.2010 +            int d;
 92.2011 +            int value;
 92.2012 +            png_uint_32 i;
 92.2013 +            png_uint_32 row_width = row_info->width;
 92.2014 +
 92.2015 +            dp = row;
 92.2016 +            d = 0;
 92.2017 +            shift = 7;
 92.2018 +            for (i = png_pass_start[pass]; i < row_width;
 92.2019 +               i += png_pass_inc[pass])
 92.2020 +            {
 92.2021 +               sp = row + (png_size_t)(i >> 3);
 92.2022 +               value = (int)(*sp >> (7 - (int)(i & 0x07))) & 0x01;
 92.2023 +               d |= (value << shift);
 92.2024 +
 92.2025 +               if (shift == 0)
 92.2026 +               {
 92.2027 +                  shift = 7;
 92.2028 +                  *dp++ = (png_byte)d;
 92.2029 +                  d = 0;
 92.2030 +               }
 92.2031 +               else
 92.2032 +                  shift--;
 92.2033 +
 92.2034 +            }
 92.2035 +            if (shift != 7)
 92.2036 +               *dp = (png_byte)d;
 92.2037 +            break;
 92.2038 +         }
 92.2039 +         case 2:
 92.2040 +         {
 92.2041 +            png_bytep sp;
 92.2042 +            png_bytep dp;
 92.2043 +            int shift;
 92.2044 +            int d;
 92.2045 +            int value;
 92.2046 +            png_uint_32 i;
 92.2047 +            png_uint_32 row_width = row_info->width;
 92.2048 +
 92.2049 +            dp = row;
 92.2050 +            shift = 6;
 92.2051 +            d = 0;
 92.2052 +            for (i = png_pass_start[pass]; i < row_width;
 92.2053 +               i += png_pass_inc[pass])
 92.2054 +            {
 92.2055 +               sp = row + (png_size_t)(i >> 2);
 92.2056 +               value = (*sp >> ((3 - (int)(i & 0x03)) << 1)) & 0x03;
 92.2057 +               d |= (value << shift);
 92.2058 +
 92.2059 +               if (shift == 0)
 92.2060 +               {
 92.2061 +                  shift = 6;
 92.2062 +                  *dp++ = (png_byte)d;
 92.2063 +                  d = 0;
 92.2064 +               }
 92.2065 +               else
 92.2066 +                  shift -= 2;
 92.2067 +            }
 92.2068 +            if (shift != 6)
 92.2069 +                   *dp = (png_byte)d;
 92.2070 +            break;
 92.2071 +         }
 92.2072 +         case 4:
 92.2073 +         {
 92.2074 +            png_bytep sp;
 92.2075 +            png_bytep dp;
 92.2076 +            int shift;
 92.2077 +            int d;
 92.2078 +            int value;
 92.2079 +            png_uint_32 i;
 92.2080 +            png_uint_32 row_width = row_info->width;
 92.2081 +
 92.2082 +            dp = row;
 92.2083 +            shift = 4;
 92.2084 +            d = 0;
 92.2085 +            for (i = png_pass_start[pass]; i < row_width;
 92.2086 +               i += png_pass_inc[pass])
 92.2087 +            {
 92.2088 +               sp = row + (png_size_t)(i >> 1);
 92.2089 +               value = (*sp >> ((1 - (int)(i & 0x01)) << 2)) & 0x0f;
 92.2090 +               d |= (value << shift);
 92.2091 +
 92.2092 +               if (shift == 0)
 92.2093 +               {
 92.2094 +                  shift = 4;
 92.2095 +                  *dp++ = (png_byte)d;
 92.2096 +                  d = 0;
 92.2097 +               }
 92.2098 +               else
 92.2099 +                  shift -= 4;
 92.2100 +            }
 92.2101 +            if (shift != 4)
 92.2102 +               *dp = (png_byte)d;
 92.2103 +            break;
 92.2104 +         }
 92.2105 +         default:
 92.2106 +         {
 92.2107 +            png_bytep sp;
 92.2108 +            png_bytep dp;
 92.2109 +            png_uint_32 i;
 92.2110 +            png_uint_32 row_width = row_info->width;
 92.2111 +            png_size_t pixel_bytes;
 92.2112 +
 92.2113 +            /* start at the beginning */
 92.2114 +            dp = row;
 92.2115 +            /* find out how many bytes each pixel takes up */
 92.2116 +            pixel_bytes = (row_info->pixel_depth >> 3);
 92.2117 +            /* loop through the row, only looking at the pixels that
 92.2118 +               matter */
 92.2119 +            for (i = png_pass_start[pass]; i < row_width;
 92.2120 +               i += png_pass_inc[pass])
 92.2121 +            {
 92.2122 +               /* find out where the original pixel is */
 92.2123 +               sp = row + (png_size_t)i * pixel_bytes;
 92.2124 +               /* move the pixel */
 92.2125 +               if (dp != sp)
 92.2126 +                  png_memcpy(dp, sp, pixel_bytes);
 92.2127 +               /* next pixel */
 92.2128 +               dp += pixel_bytes;
 92.2129 +            }
 92.2130 +            break;
 92.2131 +         }
 92.2132 +      }
 92.2133 +      /* set new row width */
 92.2134 +      row_info->width = (row_info->width +
 92.2135 +         png_pass_inc[pass] - 1 -
 92.2136 +         png_pass_start[pass]) /
 92.2137 +         png_pass_inc[pass];
 92.2138 +         row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth,
 92.2139 +            row_info->width);
 92.2140 +   }
 92.2141 +}
 92.2142 +#endif
 92.2143 +
 92.2144 +/* This filters the row, chooses which filter to use, if it has not already
 92.2145 + * been specified by the application, and then writes the row out with the
 92.2146 + * chosen filter.
 92.2147 + */
 92.2148 +#define PNG_MAXSUM (((png_uint_32)(-1)) >> 1)
 92.2149 +#define PNG_HISHIFT 10
 92.2150 +#define PNG_LOMASK ((png_uint_32)0xffffL)
 92.2151 +#define PNG_HIMASK ((png_uint_32)(~PNG_LOMASK >> PNG_HISHIFT))
 92.2152 +void /* PRIVATE */
 92.2153 +png_write_find_filter(png_structp png_ptr, png_row_infop row_info)
 92.2154 +{
 92.2155 +   png_bytep best_row;
 92.2156 +#ifndef PNG_NO_WRITE_FILTER
 92.2157 +   png_bytep prev_row, row_buf;
 92.2158 +   png_uint_32 mins, bpp;
 92.2159 +   png_byte filter_to_do = png_ptr->do_filter;
 92.2160 +   png_uint_32 row_bytes = row_info->rowbytes;
 92.2161 +#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED)
 92.2162 +   int num_p_filters = (int)png_ptr->num_prev_filters;
 92.2163 +#endif
 92.2164 +
 92.2165 +   png_debug(1, "in png_write_find_filter\n");
 92.2166 +   /* find out how many bytes offset each pixel is */
 92.2167 +   bpp = (row_info->pixel_depth + 7) >> 3;
 92.2168 +
 92.2169 +   prev_row = png_ptr->prev_row;
 92.2170 +#endif
 92.2171 +   best_row = png_ptr->row_buf;
 92.2172 +#ifndef PNG_NO_WRITE_FILTER
 92.2173 +   row_buf = best_row;
 92.2174 +   mins = PNG_MAXSUM;
 92.2175 +
 92.2176 +   /* The prediction method we use is to find which method provides the
 92.2177 +    * smallest value when summing the absolute values of the distances
 92.2178 +    * from zero, using anything >= 128 as negative numbers.  This is known
 92.2179 +    * as the "minimum sum of absolute differences" heuristic.  Other
 92.2180 +    * heuristics are the "weighted minimum sum of absolute differences"
 92.2181 +    * (experimental and can in theory improve compression), and the "zlib
 92.2182 +    * predictive" method (not implemented yet), which does test compressions
 92.2183 +    * of lines using different filter methods, and then chooses the
 92.2184 +    * (series of) filter(s) that give minimum compressed data size (VERY
 92.2185 +    * computationally expensive).
 92.2186 +    *
 92.2187 +    * GRR 980525:  consider also
 92.2188 +    *   (1) minimum sum of absolute differences from running average (i.e.,
 92.2189 +    *       keep running sum of non-absolute differences & count of bytes)
 92.2190 +    *       [track dispersion, too?  restart average if dispersion too large?]
 92.2191 +    *  (1b) minimum sum of absolute differences from sliding average, probably
 92.2192 +    *       with window size <= deflate window (usually 32K)
 92.2193 +    *   (2) minimum sum of squared differences from zero or running average
 92.2194 +    *       (i.e., ~ root-mean-square approach)
 92.2195 +    */
 92.2196 +
 92.2197 +
 92.2198 +   /* We don't need to test the 'no filter' case if this is the only filter
 92.2199 +    * that has been chosen, as it doesn't actually do anything to the data.
 92.2200 +    */
 92.2201 +   if ((filter_to_do & PNG_FILTER_NONE) &&
 92.2202 +       filter_to_do != PNG_FILTER_NONE)
 92.2203 +   {
 92.2204 +      png_bytep rp;
 92.2205 +      png_uint_32 sum = 0;
 92.2206 +      png_uint_32 i;
 92.2207 +      int v;
 92.2208 +
 92.2209 +      for (i = 0, rp = row_buf + 1; i < row_bytes; i++, rp++)
 92.2210 +      {
 92.2211 +         v = *rp;
 92.2212 +         sum += (v < 128) ? v : 256 - v;
 92.2213 +      }
 92.2214 +
 92.2215 +#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED)
 92.2216 +      if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED)
 92.2217 +      {
 92.2218 +         png_uint_32 sumhi, sumlo;
 92.2219 +         int j;
 92.2220 +         sumlo = sum & PNG_LOMASK;
 92.2221 +         sumhi = (sum >> PNG_HISHIFT) & PNG_HIMASK; /* Gives us some footroom */
 92.2222 +
 92.2223 +         /* Reduce the sum if we match any of the previous rows */
 92.2224 +         for (j = 0; j < num_p_filters; j++)
 92.2225 +         {
 92.2226 +            if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_NONE)
 92.2227 +            {
 92.2228 +               sumlo = (sumlo * png_ptr->filter_weights[j]) >>
 92.2229 +                  PNG_WEIGHT_SHIFT;
 92.2230 +               sumhi = (sumhi * png_ptr->filter_weights[j]) >>
 92.2231 +                  PNG_WEIGHT_SHIFT;
 92.2232 +            }
 92.2233 +         }
 92.2234 +
 92.2235 +         /* Factor in the cost of this filter (this is here for completeness,
 92.2236 +          * but it makes no sense to have a "cost" for the NONE filter, as
 92.2237 +          * it has the minimum possible computational cost - none).
 92.2238 +          */
 92.2239 +         sumlo = (sumlo * png_ptr->filter_costs[PNG_FILTER_VALUE_NONE]) >>
 92.2240 +            PNG_COST_SHIFT;
 92.2241 +         sumhi = (sumhi * png_ptr->filter_costs[PNG_FILTER_VALUE_NONE]) >>
 92.2242 +            PNG_COST_SHIFT;
 92.2243 +
 92.2244 +         if (sumhi > PNG_HIMASK)
 92.2245 +            sum = PNG_MAXSUM;
 92.2246 +         else
 92.2247 +            sum = (sumhi << PNG_HISHIFT) + sumlo;
 92.2248 +      }
 92.2249 +#endif
 92.2250 +      mins = sum;
 92.2251 +   }
 92.2252 +
 92.2253 +   /* sub filter */
 92.2254 +   if (filter_to_do == PNG_FILTER_SUB)
 92.2255 +   /* it's the only filter so no testing is needed */
 92.2256 +   {
 92.2257 +      png_bytep rp, lp, dp;
 92.2258 +      png_uint_32 i;
 92.2259 +      for (i = 0, rp = row_buf + 1, dp = png_ptr->sub_row + 1; i < bpp;
 92.2260 +           i++, rp++, dp++)
 92.2261 +      {
 92.2262 +         *dp = *rp;
 92.2263 +      }
 92.2264 +      for (lp = row_buf + 1; i < row_bytes;
 92.2265 +         i++, rp++, lp++, dp++)
 92.2266 +      {
 92.2267 +         *dp = (png_byte)(((int)*rp - (int)*lp) & 0xff);
 92.2268 +      }
 92.2269 +      best_row = png_ptr->sub_row;
 92.2270 +   }
 92.2271 +
 92.2272 +   else if (filter_to_do & PNG_FILTER_SUB)
 92.2273 +   {
 92.2274 +      png_bytep rp, dp, lp;
 92.2275 +      png_uint_32 sum = 0, lmins = mins;
 92.2276 +      png_uint_32 i;
 92.2277 +      int v;
 92.2278 +
 92.2279 +#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED)
 92.2280 +      /* We temporarily increase the "minimum sum" by the factor we
 92.2281 +       * would reduce the sum of this filter, so that we can do the
 92.2282 +       * early exit comparison without scaling the sum each time.
 92.2283 +       */
 92.2284 +      if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED)
 92.2285 +      {
 92.2286 +         int j;
 92.2287 +         png_uint_32 lmhi, lmlo;
 92.2288 +         lmlo = lmins & PNG_LOMASK;
 92.2289 +         lmhi = (lmins >> PNG_HISHIFT) & PNG_HIMASK;
 92.2290 +
 92.2291 +         for (j = 0; j < num_p_filters; j++)
 92.2292 +         {
 92.2293 +            if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_SUB)
 92.2294 +            {
 92.2295 +               lmlo = (lmlo * png_ptr->inv_filter_weights[j]) >>
 92.2296 +                  PNG_WEIGHT_SHIFT;
 92.2297 +               lmhi = (lmhi * png_ptr->inv_filter_weights[j]) >>
 92.2298 +                  PNG_WEIGHT_SHIFT;
 92.2299 +            }
 92.2300 +         }
 92.2301 +
 92.2302 +         lmlo = (lmlo * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_SUB]) >>
 92.2303 +            PNG_COST_SHIFT;
 92.2304 +         lmhi = (lmhi * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_SUB]) >>
 92.2305 +            PNG_COST_SHIFT;
 92.2306 +
 92.2307 +         if (lmhi > PNG_HIMASK)
 92.2308 +            lmins = PNG_MAXSUM;
 92.2309 +         else
 92.2310 +            lmins = (lmhi << PNG_HISHIFT) + lmlo;
 92.2311 +      }
 92.2312 +#endif
 92.2313 +
 92.2314 +      for (i = 0, rp = row_buf + 1, dp = png_ptr->sub_row + 1; i < bpp;
 92.2315 +           i++, rp++, dp++)
 92.2316 +      {
 92.2317 +         v = *dp = *rp;
 92.2318 +
 92.2319 +         sum += (v < 128) ? v : 256 - v;
 92.2320 +      }
 92.2321 +      for (lp = row_buf + 1; i < row_bytes;
 92.2322 +         i++, rp++, lp++, dp++)
 92.2323 +      {
 92.2324 +         v = *dp = (png_byte)(((int)*rp - (int)*lp) & 0xff);
 92.2325 +
 92.2326 +         sum += (v < 128) ? v : 256 - v;
 92.2327 +
 92.2328 +         if (sum > lmins)  /* We are already worse, don't continue. */
 92.2329 +            break;
 92.2330 +      }
 92.2331 +
 92.2332 +#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED)
 92.2333 +      if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED)
 92.2334 +      {
 92.2335 +         int j;
 92.2336 +         png_uint_32 sumhi, sumlo;
 92.2337 +         sumlo = sum & PNG_LOMASK;
 92.2338 +         sumhi = (sum >> PNG_HISHIFT) & PNG_HIMASK;
 92.2339 +
 92.2340 +         for (j = 0; j < num_p_filters; j++)
 92.2341 +         {
 92.2342 +            if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_SUB)
 92.2343 +            {
 92.2344 +               sumlo = (sumlo * png_ptr->inv_filter_weights[j]) >>
 92.2345 +                  PNG_WEIGHT_SHIFT;
 92.2346 +               sumhi = (sumhi * png_ptr->inv_filter_weights[j]) >>
 92.2347 +                  PNG_WEIGHT_SHIFT;
 92.2348 +            }
 92.2349 +         }
 92.2350 +
 92.2351 +         sumlo = (sumlo * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_SUB]) >>
 92.2352 +            PNG_COST_SHIFT;
 92.2353 +         sumhi = (sumhi * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_SUB]) >>
 92.2354 +            PNG_COST_SHIFT;
 92.2355 +
 92.2356 +         if (sumhi > PNG_HIMASK)
 92.2357 +            sum = PNG_MAXSUM;
 92.2358 +         else
 92.2359 +            sum = (sumhi << PNG_HISHIFT) + sumlo;
 92.2360 +      }
 92.2361 +#endif
 92.2362 +
 92.2363 +      if (sum < mins)
 92.2364 +      {
 92.2365 +         mins = sum;
 92.2366 +         best_row = png_ptr->sub_row;
 92.2367 +      }
 92.2368 +   }
 92.2369 +
 92.2370 +   /* up filter */
 92.2371 +   if (filter_to_do == PNG_FILTER_UP)
 92.2372 +   {
 92.2373 +      png_bytep rp, dp, pp;
 92.2374 +      png_uint_32 i;
 92.2375 +
 92.2376 +      for (i = 0, rp = row_buf + 1, dp = png_ptr->up_row + 1,
 92.2377 +           pp = prev_row + 1; i < row_bytes;
 92.2378 +           i++, rp++, pp++, dp++)
 92.2379 +      {
 92.2380 +         *dp = (png_byte)(((int)*rp - (int)*pp) & 0xff);
 92.2381 +      }
 92.2382 +      best_row = png_ptr->up_row;
 92.2383 +   }
 92.2384 +
 92.2385 +   else if (filter_to_do & PNG_FILTER_UP)
 92.2386 +   {
 92.2387 +      png_bytep rp, dp, pp;
 92.2388 +      png_uint_32 sum = 0, lmins = mins;
 92.2389 +      png_uint_32 i;
 92.2390 +      int v;
 92.2391 +
 92.2392 +
 92.2393 +#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED)
 92.2394 +      if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED)
 92.2395 +      {
 92.2396 +         int j;
 92.2397 +         png_uint_32 lmhi, lmlo;
 92.2398 +         lmlo = lmins & PNG_LOMASK;
 92.2399 +         lmhi = (lmins >> PNG_HISHIFT) & PNG_HIMASK;
 92.2400 +
 92.2401 +         for (j = 0; j < num_p_filters; j++)
 92.2402 +         {
 92.2403 +            if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_UP)
 92.2404 +            {
 92.2405 +               lmlo = (lmlo * png_ptr->inv_filter_weights[j]) >>
 92.2406 +                  PNG_WEIGHT_SHIFT;
 92.2407 +               lmhi = (lmhi * png_ptr->inv_filter_weights[j]) >>
 92.2408 +                  PNG_WEIGHT_SHIFT;
 92.2409 +            }
 92.2410 +         }
 92.2411 +
 92.2412 +         lmlo = (lmlo * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_UP]) >>
 92.2413 +            PNG_COST_SHIFT;
 92.2414 +         lmhi = (lmhi * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_UP]) >>
 92.2415 +            PNG_COST_SHIFT;
 92.2416 +
 92.2417 +         if (lmhi > PNG_HIMASK)
 92.2418 +            lmins = PNG_MAXSUM;
 92.2419 +         else
 92.2420 +            lmins = (lmhi << PNG_HISHIFT) + lmlo;
 92.2421 +      }
 92.2422 +#endif
 92.2423 +
 92.2424 +      for (i = 0, rp = row_buf + 1, dp = png_ptr->up_row + 1,
 92.2425 +           pp = prev_row + 1; i < row_bytes; i++)
 92.2426 +      {
 92.2427 +         v = *dp++ = (png_byte)(((int)*rp++ - (int)*pp++) & 0xff);
 92.2428 +
 92.2429 +         sum += (v < 128) ? v : 256 - v;
 92.2430 +
 92.2431 +         if (sum > lmins)  /* We are already worse, don't continue. */
 92.2432 +            break;
 92.2433 +      }
 92.2434 +
 92.2435 +#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED)
 92.2436 +      if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED)
 92.2437 +      {
 92.2438 +         int j;
 92.2439 +         png_uint_32 sumhi, sumlo;
 92.2440 +         sumlo = sum & PNG_LOMASK;
 92.2441 +         sumhi = (sum >> PNG_HISHIFT) & PNG_HIMASK;
 92.2442 +
 92.2443 +         for (j = 0; j < num_p_filters; j++)
 92.2444 +         {
 92.2445 +            if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_UP)
 92.2446 +            {
 92.2447 +               sumlo = (sumlo * png_ptr->filter_weights[j]) >>
 92.2448 +                  PNG_WEIGHT_SHIFT;
 92.2449 +               sumhi = (sumhi * png_ptr->filter_weights[j]) >>
 92.2450 +                  PNG_WEIGHT_SHIFT;
 92.2451 +            }
 92.2452 +         }
 92.2453 +
 92.2454 +         sumlo = (sumlo * png_ptr->filter_costs[PNG_FILTER_VALUE_UP]) >>
 92.2455 +            PNG_COST_SHIFT;
 92.2456 +         sumhi = (sumhi * png_ptr->filter_costs[PNG_FILTER_VALUE_UP]) >>
 92.2457 +            PNG_COST_SHIFT;
 92.2458 +
 92.2459 +         if (sumhi > PNG_HIMASK)
 92.2460 +            sum = PNG_MAXSUM;
 92.2461 +         else
 92.2462 +            sum = (sumhi << PNG_HISHIFT) + sumlo;
 92.2463 +      }
 92.2464 +#endif
 92.2465 +
 92.2466 +      if (sum < mins)
 92.2467 +      {
 92.2468 +         mins = sum;
 92.2469 +         best_row = png_ptr->up_row;
 92.2470 +      }
 92.2471 +   }
 92.2472 +
 92.2473 +   /* avg filter */
 92.2474 +   if (filter_to_do == PNG_FILTER_AVG)
 92.2475 +   {
 92.2476 +      png_bytep rp, dp, pp, lp;
 92.2477 +      png_uint_32 i;
 92.2478 +      for (i = 0, rp = row_buf + 1, dp = png_ptr->avg_row + 1,
 92.2479 +           pp = prev_row + 1; i < bpp; i++)
 92.2480 +      {
 92.2481 +         *dp++ = (png_byte)(((int)*rp++ - ((int)*pp++ / 2)) & 0xff);
 92.2482 +      }
 92.2483 +      for (lp = row_buf + 1; i < row_bytes; i++)
 92.2484 +      {
 92.2485 +         *dp++ = (png_byte)(((int)*rp++ - (((int)*pp++ + (int)*lp++) / 2))
 92.2486 +                 & 0xff);
 92.2487 +      }
 92.2488 +      best_row = png_ptr->avg_row;
 92.2489 +   }
 92.2490 +
 92.2491 +   else if (filter_to_do & PNG_FILTER_AVG)
 92.2492 +   {
 92.2493 +      png_bytep rp, dp, pp, lp;
 92.2494 +      png_uint_32 sum = 0, lmins = mins;
 92.2495 +      png_uint_32 i;
 92.2496 +      int v;
 92.2497 +
 92.2498 +#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED)
 92.2499 +      if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED)
 92.2500 +      {
 92.2501 +         int j;
 92.2502 +         png_uint_32 lmhi, lmlo;
 92.2503 +         lmlo = lmins & PNG_LOMASK;
 92.2504 +         lmhi = (lmins >> PNG_HISHIFT) & PNG_HIMASK;
 92.2505 +
 92.2506 +         for (j = 0; j < num_p_filters; j++)
 92.2507 +         {
 92.2508 +            if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_AVG)
 92.2509 +            {
 92.2510 +               lmlo = (lmlo * png_ptr->inv_filter_weights[j]) >>
 92.2511 +                  PNG_WEIGHT_SHIFT;
 92.2512 +               lmhi = (lmhi * png_ptr->inv_filter_weights[j]) >>
 92.2513 +                  PNG_WEIGHT_SHIFT;
 92.2514 +            }
 92.2515 +         }
 92.2516 +
 92.2517 +         lmlo = (lmlo * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_AVG]) >>
 92.2518 +            PNG_COST_SHIFT;
 92.2519 +         lmhi = (lmhi * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_AVG]) >>
 92.2520 +            PNG_COST_SHIFT;
 92.2521 +
 92.2522 +         if (lmhi > PNG_HIMASK)
 92.2523 +            lmins = PNG_MAXSUM;
 92.2524 +         else
 92.2525 +            lmins = (lmhi << PNG_HISHIFT) + lmlo;
 92.2526 +      }
 92.2527 +#endif
 92.2528 +
 92.2529 +      for (i = 0, rp = row_buf + 1, dp = png_ptr->avg_row + 1,
 92.2530 +           pp = prev_row + 1; i < bpp; i++)
 92.2531 +      {
 92.2532 +         v = *dp++ = (png_byte)(((int)*rp++ - ((int)*pp++ / 2)) & 0xff);
 92.2533 +
 92.2534 +         sum += (v < 128) ? v : 256 - v;
 92.2535 +      }
 92.2536 +      for (lp = row_buf + 1; i < row_bytes; i++)
 92.2537 +      {
 92.2538 +         v = *dp++ =
 92.2539 +          (png_byte)(((int)*rp++ - (((int)*pp++ + (int)*lp++) / 2)) & 0xff);
 92.2540 +
 92.2541 +         sum += (v < 128) ? v : 256 - v;
 92.2542 +
 92.2543 +         if (sum > lmins)  /* We are already worse, don't continue. */
 92.2544 +            break;
 92.2545 +      }
 92.2546 +
 92.2547 +#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED)
 92.2548 +      if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED)
 92.2549 +      {
 92.2550 +         int j;
 92.2551 +         png_uint_32 sumhi, sumlo;
 92.2552 +         sumlo = sum & PNG_LOMASK;
 92.2553 +         sumhi = (sum >> PNG_HISHIFT) & PNG_HIMASK;
 92.2554 +
 92.2555 +         for (j = 0; j < num_p_filters; j++)
 92.2556 +         {
 92.2557 +            if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_NONE)
 92.2558 +            {
 92.2559 +               sumlo = (sumlo * png_ptr->filter_weights[j]) >>
 92.2560 +                  PNG_WEIGHT_SHIFT;
 92.2561 +               sumhi = (sumhi * png_ptr->filter_weights[j]) >>
 92.2562 +                  PNG_WEIGHT_SHIFT;
 92.2563 +            }
 92.2564 +         }
 92.2565 +
 92.2566 +         sumlo = (sumlo * png_ptr->filter_costs[PNG_FILTER_VALUE_AVG]) >>
 92.2567 +            PNG_COST_SHIFT;
 92.2568 +         sumhi = (sumhi * png_ptr->filter_costs[PNG_FILTER_VALUE_AVG]) >>
 92.2569 +            PNG_COST_SHIFT;
 92.2570 +
 92.2571 +         if (sumhi > PNG_HIMASK)
 92.2572 +            sum = PNG_MAXSUM;
 92.2573 +         else
 92.2574 +            sum = (sumhi << PNG_HISHIFT) + sumlo;
 92.2575 +      }
 92.2576 +#endif
 92.2577 +
 92.2578 +      if (sum < mins)
 92.2579 +      {
 92.2580 +         mins = sum;
 92.2581 +         best_row = png_ptr->avg_row;
 92.2582 +      }
 92.2583 +   }
 92.2584 +
 92.2585 +   /* Paeth filter */
 92.2586 +   if (filter_to_do == PNG_FILTER_PAETH)
 92.2587 +   {
 92.2588 +      png_bytep rp, dp, pp, cp, lp;
 92.2589 +      png_uint_32 i;
 92.2590 +      for (i = 0, rp = row_buf + 1, dp = png_ptr->paeth_row + 1,
 92.2591 +           pp = prev_row + 1; i < bpp; i++)
 92.2592 +      {
 92.2593 +         *dp++ = (png_byte)(((int)*rp++ - (int)*pp++) & 0xff);
 92.2594 +      }
 92.2595 +
 92.2596 +      for (lp = row_buf + 1, cp = prev_row + 1; i < row_bytes; i++)
 92.2597 +      {
 92.2598 +         int a, b, c, pa, pb, pc, p;
 92.2599 +
 92.2600 +         b = *pp++;
 92.2601 +         c = *cp++;
 92.2602 +         a = *lp++;
 92.2603 +
 92.2604 +         p = b - c;
 92.2605 +         pc = a - c;
 92.2606 +
 92.2607 +#ifdef PNG_USE_ABS
 92.2608 +         pa = abs(p);
 92.2609 +         pb = abs(pc);
 92.2610 +         pc = abs(p + pc);
 92.2611 +#else
 92.2612 +         pa = p < 0 ? -p : p;
 92.2613 +         pb = pc < 0 ? -pc : pc;
 92.2614 +         pc = (p + pc) < 0 ? -(p + pc) : p + pc;
 92.2615 +#endif
 92.2616 +
 92.2617 +         p = (pa <= pb && pa <=pc) ? a : (pb <= pc) ? b : c;
 92.2618 +
 92.2619 +         *dp++ = (png_byte)(((int)*rp++ - p) & 0xff);
 92.2620 +      }
 92.2621 +      best_row = png_ptr->paeth_row;
 92.2622 +   }
 92.2623 +
 92.2624 +   else if (filter_to_do & PNG_FILTER_PAETH)
 92.2625 +   {
 92.2626 +      png_bytep rp, dp, pp, cp, lp;
 92.2627 +      png_uint_32 sum = 0, lmins = mins;
 92.2628 +      png_uint_32 i;
 92.2629 +      int v;
 92.2630 +
 92.2631 +#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED)
 92.2632 +      if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED)
 92.2633 +      {
 92.2634 +         int j;
 92.2635 +         png_uint_32 lmhi, lmlo;
 92.2636 +         lmlo = lmins & PNG_LOMASK;
 92.2637 +         lmhi = (lmins >> PNG_HISHIFT) & PNG_HIMASK;
 92.2638 +
 92.2639 +         for (j = 0; j < num_p_filters; j++)
 92.2640 +         {
 92.2641 +            if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_PAETH)
 92.2642 +            {
 92.2643 +               lmlo = (lmlo * png_ptr->inv_filter_weights[j]) >>
 92.2644 +                  PNG_WEIGHT_SHIFT;
 92.2645 +               lmhi = (lmhi * png_ptr->inv_filter_weights[j]) >>
 92.2646 +                  PNG_WEIGHT_SHIFT;
 92.2647 +            }
 92.2648 +         }
 92.2649 +
 92.2650 +         lmlo = (lmlo * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_PAETH]) >>
 92.2651 +            PNG_COST_SHIFT;
 92.2652 +         lmhi = (lmhi * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_PAETH]) >>
 92.2653 +            PNG_COST_SHIFT;
 92.2654 +
 92.2655 +         if (lmhi > PNG_HIMASK)
 92.2656 +            lmins = PNG_MAXSUM;
 92.2657 +         else
 92.2658 +            lmins = (lmhi << PNG_HISHIFT) + lmlo;
 92.2659 +      }
 92.2660 +#endif
 92.2661 +
 92.2662 +      for (i = 0, rp = row_buf + 1, dp = png_ptr->paeth_row + 1,
 92.2663 +           pp = prev_row + 1; i < bpp; i++)
 92.2664 +      {
 92.2665 +         v = *dp++ = (png_byte)(((int)*rp++ - (int)*pp++) & 0xff);
 92.2666 +
 92.2667 +         sum += (v < 128) ? v : 256 - v;
 92.2668 +      }
 92.2669 +
 92.2670 +      for (lp = row_buf + 1, cp = prev_row + 1; i < row_bytes; i++)
 92.2671 +      {
 92.2672 +         int a, b, c, pa, pb, pc, p;
 92.2673 +
 92.2674 +         b = *pp++;
 92.2675 +         c = *cp++;
 92.2676 +         a = *lp++;
 92.2677 +
 92.2678 +#ifndef PNG_SLOW_PAETH
 92.2679 +         p = b - c;
 92.2680 +         pc = a - c;
 92.2681 +#ifdef PNG_USE_ABS
 92.2682 +         pa = abs(p);
 92.2683 +         pb = abs(pc);
 92.2684 +         pc = abs(p + pc);
 92.2685 +#else
 92.2686 +         pa = p < 0 ? -p : p;
 92.2687 +         pb = pc < 0 ? -pc : pc;
 92.2688 +         pc = (p + pc) < 0 ? -(p + pc) : p + pc;
 92.2689 +#endif
 92.2690 +         p = (pa <= pb && pa <=pc) ? a : (pb <= pc) ? b : c;
 92.2691 +#else /* PNG_SLOW_PAETH */
 92.2692 +         p = a + b - c;
 92.2693 +         pa = abs(p - a);
 92.2694 +         pb = abs(p - b);
 92.2695 +         pc = abs(p - c);
 92.2696 +         if (pa <= pb && pa <= pc)
 92.2697 +            p = a;
 92.2698 +         else if (pb <= pc)
 92.2699 +            p = b;
 92.2700 +         else
 92.2701 +            p = c;
 92.2702 +#endif /* PNG_SLOW_PAETH */
 92.2703 +
 92.2704 +         v = *dp++ = (png_byte)(((int)*rp++ - p) & 0xff);
 92.2705 +
 92.2706 +         sum += (v < 128) ? v : 256 - v;
 92.2707 +
 92.2708 +         if (sum > lmins)  /* We are already worse, don't continue. */
 92.2709 +            break;
 92.2710 +      }
 92.2711 +
 92.2712 +#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED)
 92.2713 +      if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED)
 92.2714 +      {
 92.2715 +         int j;
 92.2716 +         png_uint_32 sumhi, sumlo;
 92.2717 +         sumlo = sum & PNG_LOMASK;
 92.2718 +         sumhi = (sum >> PNG_HISHIFT) & PNG_HIMASK;
 92.2719 +
 92.2720 +         for (j = 0; j < num_p_filters; j++)
 92.2721 +         {
 92.2722 +            if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_PAETH)
 92.2723 +            {
 92.2724 +               sumlo = (sumlo * png_ptr->filter_weights[j]) >>
 92.2725 +                  PNG_WEIGHT_SHIFT;
 92.2726 +               sumhi = (sumhi * png_ptr->filter_weights[j]) >>
 92.2727 +                  PNG_WEIGHT_SHIFT;
 92.2728 +            }
 92.2729 +         }
 92.2730 +
 92.2731 +         sumlo = (sumlo * png_ptr->filter_costs[PNG_FILTER_VALUE_PAETH]) >>
 92.2732 +            PNG_COST_SHIFT;
 92.2733 +         sumhi = (sumhi * png_ptr->filter_costs[PNG_FILTER_VALUE_PAETH]) >>
 92.2734 +            PNG_COST_SHIFT;
 92.2735 +
 92.2736 +         if (sumhi > PNG_HIMASK)
 92.2737 +            sum = PNG_MAXSUM;
 92.2738 +         else
 92.2739 +            sum = (sumhi << PNG_HISHIFT) + sumlo;
 92.2740 +      }
 92.2741 +#endif
 92.2742 +
 92.2743 +      if (sum < mins)
 92.2744 +      {
 92.2745 +         best_row = png_ptr->paeth_row;
 92.2746 +      }
 92.2747 +   }
 92.2748 +#endif /* PNG_NO_WRITE_FILTER */
 92.2749 +   /* Do the actual writing of the filtered row data from the chosen filter. */
 92.2750 +
 92.2751 +   png_write_filtered_row(png_ptr, best_row);
 92.2752 +
 92.2753 +#ifndef PNG_NO_WRITE_FILTER
 92.2754 +#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED)
 92.2755 +   /* Save the type of filter we picked this time for future calculations */
 92.2756 +   if (png_ptr->num_prev_filters > 0)
 92.2757 +   {
 92.2758 +      int j;
 92.2759 +      for (j = 1; j < num_p_filters; j++)
 92.2760 +      {
 92.2761 +         png_ptr->prev_filters[j] = png_ptr->prev_filters[j - 1];
 92.2762 +      }
 92.2763 +      png_ptr->prev_filters[j] = best_row[0];
 92.2764 +   }
 92.2765 +#endif
 92.2766 +#endif /* PNG_NO_WRITE_FILTER */
 92.2767 +}
 92.2768 +
 92.2769 +
 92.2770 +/* Do the actual writing of a previously filtered row. */
 92.2771 +void /* PRIVATE */
 92.2772 +png_write_filtered_row(png_structp png_ptr, png_bytep filtered_row)
 92.2773 +{
 92.2774 +   png_debug(1, "in png_write_filtered_row\n");
 92.2775 +   png_debug1(2, "filter = %d\n", filtered_row[0]);
 92.2776 +   /* set up the zlib input buffer */
 92.2777 +
 92.2778 +   png_ptr->zstream.next_in = filtered_row;
 92.2779 +   png_ptr->zstream.avail_in = (uInt)png_ptr->row_info.rowbytes + 1;
 92.2780 +   /* repeat until we have compressed all the data */
 92.2781 +   do
 92.2782 +   {
 92.2783 +      int ret; /* return of zlib */
 92.2784 +
 92.2785 +      /* compress the data */
 92.2786 +      ret = deflate(&png_ptr->zstream, Z_NO_FLUSH);
 92.2787 +      /* check for compression errors */
 92.2788 +      if (ret != Z_OK)
 92.2789 +      {
 92.2790 +         if (png_ptr->zstream.msg != NULL)
 92.2791 +            png_error(png_ptr, png_ptr->zstream.msg);
 92.2792 +         else
 92.2793 +            png_error(png_ptr, "zlib error");
 92.2794 +      }
 92.2795 +
 92.2796 +      /* see if it is time to write another IDAT */
 92.2797 +      if (!(png_ptr->zstream.avail_out))
 92.2798 +      {
 92.2799 +         /* write the IDAT and reset the zlib output buffer */
 92.2800 +         png_write_IDAT(png_ptr, png_ptr->zbuf, png_ptr->zbuf_size);
 92.2801 +         png_ptr->zstream.next_out = png_ptr->zbuf;
 92.2802 +         png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
 92.2803 +      }
 92.2804 +   /* repeat until all data has been compressed */
 92.2805 +   } while (png_ptr->zstream.avail_in);
 92.2806 +
 92.2807 +   /* swap the current and previous rows */
 92.2808 +   if (png_ptr->prev_row != NULL)
 92.2809 +   {
 92.2810 +      png_bytep tptr;
 92.2811 +
 92.2812 +      tptr = png_ptr->prev_row;
 92.2813 +      png_ptr->prev_row = png_ptr->row_buf;
 92.2814 +      png_ptr->row_buf = tptr;
 92.2815 +   }
 92.2816 +
 92.2817 +   /* finish row - updates counters and flushes zlib if last row */
 92.2818 +   png_write_finish_row(png_ptr);
 92.2819 +
 92.2820 +#if defined(PNG_WRITE_FLUSH_SUPPORTED)
 92.2821 +   png_ptr->flush_rows++;
 92.2822 +
 92.2823 +   if (png_ptr->flush_dist > 0 &&
 92.2824 +       png_ptr->flush_rows >= png_ptr->flush_dist)
 92.2825 +   {
 92.2826 +      png_write_flush(png_ptr);
 92.2827 +   }
 92.2828 +#endif
 92.2829 +}
 92.2830 +#endif /* PNG_WRITE_SUPPORTED */
    93.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    93.2 +++ b/libs/ogg/AUTHORS	Sun Nov 01 00:36:56 2015 +0200
    93.3 @@ -0,0 +1,7 @@
    93.4 +Monty <monty@xiph.org>
    93.5 +Greg Maxwell <greg@xiph.org>
    93.6 +Ralph Giles <giles@xiph.org>
    93.7 +Cristian Adam <cristian.adam@gmail.com>
    93.8 +Tim Terriberry <tterribe@xiph.org>
    93.9 +
   93.10 +and the rest of the Xiph.Org Foundation.
    94.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    94.2 +++ b/libs/ogg/COPYING	Sun Nov 01 00:36:56 2015 +0200
    94.3 @@ -0,0 +1,28 @@
    94.4 +Copyright (c) 2002, Xiph.org Foundation
    94.5 +
    94.6 +Redistribution and use in source and binary forms, with or without
    94.7 +modification, are permitted provided that the following conditions
    94.8 +are met:
    94.9 +
   94.10 +- Redistributions of source code must retain the above copyright
   94.11 +notice, this list of conditions and the following disclaimer.
   94.12 +
   94.13 +- Redistributions in binary form must reproduce the above copyright
   94.14 +notice, this list of conditions and the following disclaimer in the
   94.15 +documentation and/or other materials provided with the distribution.
   94.16 +
   94.17 +- Neither the name of the Xiph.org Foundation nor the names of its
   94.18 +contributors may be used to endorse or promote products derived from
   94.19 +this software without specific prior written permission.
   94.20 +
   94.21 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   94.22 +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   94.23 +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
   94.24 +A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION
   94.25 +OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   94.26 +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   94.27 +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   94.28 +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   94.29 +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   94.30 +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   94.31 +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    95.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    95.2 +++ b/libs/ogg/bitwise.c	Sun Nov 01 00:36:56 2015 +0200
    95.3 @@ -0,0 +1,857 @@
    95.4 +/********************************************************************
    95.5 + *                                                                  *
    95.6 + * THIS FILE IS PART OF THE Ogg CONTAINER SOURCE CODE.              *
    95.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
    95.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
    95.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
   95.10 + *                                                                  *
   95.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2010             *
   95.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
   95.13 + *                                                                  *
   95.14 + ********************************************************************
   95.15 +
   95.16 +  function: packing variable sized words into an octet stream
   95.17 +  last mod: $Id: bitwise.c 18051 2011-08-04 17:56:39Z giles $
   95.18 +
   95.19 + ********************************************************************/
   95.20 +
   95.21 +/* We're 'LSb' endian; if we write a word but read individual bits,
   95.22 +   then we'll read the lsb first */
   95.23 +
   95.24 +#include <string.h>
   95.25 +#include <stdlib.h>
   95.26 +#include <limits.h>
   95.27 +#include <ogg/ogg.h>
   95.28 +
   95.29 +#define BUFFER_INCREMENT 256
   95.30 +
   95.31 +static const unsigned long mask[]=
   95.32 +{0x00000000,0x00000001,0x00000003,0x00000007,0x0000000f,
   95.33 + 0x0000001f,0x0000003f,0x0000007f,0x000000ff,0x000001ff,
   95.34 + 0x000003ff,0x000007ff,0x00000fff,0x00001fff,0x00003fff,
   95.35 + 0x00007fff,0x0000ffff,0x0001ffff,0x0003ffff,0x0007ffff,
   95.36 + 0x000fffff,0x001fffff,0x003fffff,0x007fffff,0x00ffffff,
   95.37 + 0x01ffffff,0x03ffffff,0x07ffffff,0x0fffffff,0x1fffffff,
   95.38 + 0x3fffffff,0x7fffffff,0xffffffff };
   95.39 +
   95.40 +static const unsigned int mask8B[]=
   95.41 +{0x00,0x80,0xc0,0xe0,0xf0,0xf8,0xfc,0xfe,0xff};
   95.42 +
   95.43 +void oggpack_writeinit(oggpack_buffer *b){
   95.44 +  memset(b,0,sizeof(*b));
   95.45 +  b->ptr=b->buffer=_ogg_malloc(BUFFER_INCREMENT);
   95.46 +  b->buffer[0]='\0';
   95.47 +  b->storage=BUFFER_INCREMENT;
   95.48 +}
   95.49 +
   95.50 +void oggpackB_writeinit(oggpack_buffer *b){
   95.51 +  oggpack_writeinit(b);
   95.52 +}
   95.53 +
   95.54 +int oggpack_writecheck(oggpack_buffer *b){
   95.55 +  if(!b->ptr || !b->storage)return -1;
   95.56 +  return 0;
   95.57 +}
   95.58 +
   95.59 +int oggpackB_writecheck(oggpack_buffer *b){
   95.60 +  return oggpack_writecheck(b);
   95.61 +}
   95.62 +
   95.63 +void oggpack_writetrunc(oggpack_buffer *b,long bits){
   95.64 +  long bytes=bits>>3;
   95.65 +  if(b->ptr){
   95.66 +    bits-=bytes*8;
   95.67 +    b->ptr=b->buffer+bytes;
   95.68 +    b->endbit=bits;
   95.69 +    b->endbyte=bytes;
   95.70 +    *b->ptr&=mask[bits];
   95.71 +  }
   95.72 +}
   95.73 +
   95.74 +void oggpackB_writetrunc(oggpack_buffer *b,long bits){
   95.75 +  long bytes=bits>>3;
   95.76 +  if(b->ptr){
   95.77 +    bits-=bytes*8;
   95.78 +    b->ptr=b->buffer+bytes;
   95.79 +    b->endbit=bits;
   95.80 +    b->endbyte=bytes;
   95.81 +    *b->ptr&=mask8B[bits];
   95.82 +  }
   95.83 +}
   95.84 +
   95.85 +/* Takes only up to 32 bits. */
   95.86 +void oggpack_write(oggpack_buffer *b,unsigned long value,int bits){
   95.87 +  if(bits<0 || bits>32) goto err;
   95.88 +  if(b->endbyte>=b->storage-4){
   95.89 +    void *ret;
   95.90 +    if(!b->ptr)return;
   95.91 +    if(b->storage>LONG_MAX-BUFFER_INCREMENT) goto err;
   95.92 +    ret=_ogg_realloc(b->buffer,b->storage+BUFFER_INCREMENT);
   95.93 +    if(!ret) goto err;
   95.94 +    b->buffer=ret;
   95.95 +    b->storage+=BUFFER_INCREMENT;
   95.96 +    b->ptr=b->buffer+b->endbyte;
   95.97 +  }
   95.98 +
   95.99 +  value&=mask[bits];
  95.100 +  bits+=b->endbit;
  95.101 +
  95.102 +  b->ptr[0]|=value<<b->endbit;
  95.103 +
  95.104 +  if(bits>=8){
  95.105 +    b->ptr[1]=(unsigned char)(value>>(8-b->endbit));
  95.106 +    if(bits>=16){
  95.107 +      b->ptr[2]=(unsigned char)(value>>(16-b->endbit));
  95.108 +      if(bits>=24){
  95.109 +        b->ptr[3]=(unsigned char)(value>>(24-b->endbit));
  95.110 +        if(bits>=32){
  95.111 +          if(b->endbit)
  95.112 +            b->ptr[4]=(unsigned char)(value>>(32-b->endbit));
  95.113 +          else
  95.114 +            b->ptr[4]=0;
  95.115 +        }
  95.116 +      }
  95.117 +    }
  95.118 +  }
  95.119 +
  95.120 +  b->endbyte+=bits/8;
  95.121 +  b->ptr+=bits/8;
  95.122 +  b->endbit=bits&7;
  95.123 +  return;
  95.124 + err:
  95.125 +  oggpack_writeclear(b);
  95.126 +}
  95.127 +
  95.128 +/* Takes only up to 32 bits. */
  95.129 +void oggpackB_write(oggpack_buffer *b,unsigned long value,int bits){
  95.130 +  if(bits<0 || bits>32) goto err;
  95.131 +  if(b->endbyte>=b->storage-4){
  95.132 +    void *ret;
  95.133 +    if(!b->ptr)return;
  95.134 +    if(b->storage>LONG_MAX-BUFFER_INCREMENT) goto err;
  95.135 +    ret=_ogg_realloc(b->buffer,b->storage+BUFFER_INCREMENT);
  95.136 +    if(!ret) goto err;
  95.137 +    b->buffer=ret;
  95.138 +    b->storage+=BUFFER_INCREMENT;
  95.139 +    b->ptr=b->buffer+b->endbyte;
  95.140 +  }
  95.141 +
  95.142 +  value=(value&mask[bits])<<(32-bits);
  95.143 +  bits+=b->endbit;
  95.144 +
  95.145 +  b->ptr[0]|=value>>(24+b->endbit);
  95.146 +
  95.147 +  if(bits>=8){
  95.148 +    b->ptr[1]=(unsigned char)(value>>(16+b->endbit));
  95.149 +    if(bits>=16){
  95.150 +      b->ptr[2]=(unsigned char)(value>>(8+b->endbit));
  95.151 +      if(bits>=24){
  95.152 +        b->ptr[3]=(unsigned char)(value>>(b->endbit));
  95.153 +        if(bits>=32){
  95.154 +          if(b->endbit)
  95.155 +            b->ptr[4]=(unsigned char)(value<<(8-b->endbit));
  95.156 +          else
  95.157 +            b->ptr[4]=0;
  95.158 +        }
  95.159 +      }
  95.160 +    }
  95.161 +  }
  95.162 +
  95.163 +  b->endbyte+=bits/8;
  95.164 +  b->ptr+=bits/8;
  95.165 +  b->endbit=bits&7;
  95.166 +  return;
  95.167 + err:
  95.168 +  oggpack_writeclear(b);
  95.169 +}
  95.170 +
  95.171 +void oggpack_writealign(oggpack_buffer *b){
  95.172 +  int bits=8-b->endbit;
  95.173 +  if(bits<8)
  95.174 +    oggpack_write(b,0,bits);
  95.175 +}
  95.176 +
  95.177 +void oggpackB_writealign(oggpack_buffer *b){
  95.178 +  int bits=8-b->endbit;
  95.179 +  if(bits<8)
  95.180 +    oggpackB_write(b,0,bits);
  95.181 +}
  95.182 +
  95.183 +static void oggpack_writecopy_helper(oggpack_buffer *b,
  95.184 +                                     void *source,
  95.185 +                                     long bits,
  95.186 +                                     void (*w)(oggpack_buffer *,
  95.187 +                                               unsigned long,
  95.188 +                                               int),
  95.189 +                                     int msb){
  95.190 +  unsigned char *ptr=(unsigned char *)source;
  95.191 +
  95.192 +  long bytes=bits/8;
  95.193 +  bits-=bytes*8;
  95.194 +
  95.195 +  if(b->endbit){
  95.196 +    int i;
  95.197 +    /* unaligned copy.  Do it the hard way. */
  95.198 +    for(i=0;i<bytes;i++)
  95.199 +      w(b,(unsigned long)(ptr[i]),8);
  95.200 +  }else{
  95.201 +    /* aligned block copy */
  95.202 +    if(b->endbyte+bytes+1>=b->storage){
  95.203 +      void *ret;
  95.204 +      if(!b->ptr) goto err;
  95.205 +      if(b->endbyte+bytes+BUFFER_INCREMENT>b->storage) goto err;
  95.206 +      b->storage=b->endbyte+bytes+BUFFER_INCREMENT;
  95.207 +      ret=_ogg_realloc(b->buffer,b->storage);
  95.208 +      if(!ret) goto err;
  95.209 +      b->buffer=ret;
  95.210 +      b->ptr=b->buffer+b->endbyte;
  95.211 +    }
  95.212 +
  95.213 +    memmove(b->ptr,source,bytes);
  95.214 +    b->ptr+=bytes;
  95.215 +    b->endbyte+=bytes;
  95.216 +    *b->ptr=0;
  95.217 +
  95.218 +  }
  95.219 +  if(bits){
  95.220 +    if(msb)
  95.221 +      w(b,(unsigned long)(ptr[bytes]>>(8-bits)),bits);
  95.222 +    else
  95.223 +      w(b,(unsigned long)(ptr[bytes]),bits);
  95.224 +  }
  95.225 +  return;
  95.226 + err:
  95.227 +  oggpack_writeclear(b);
  95.228 +}
  95.229 +
  95.230 +void oggpack_writecopy(oggpack_buffer *b,void *source,long bits){
  95.231 +  oggpack_writecopy_helper(b,source,bits,oggpack_write,0);
  95.232 +}
  95.233 +
  95.234 +void oggpackB_writecopy(oggpack_buffer *b,void *source,long bits){
  95.235 +  oggpack_writecopy_helper(b,source,bits,oggpackB_write,1);
  95.236 +}
  95.237 +
  95.238 +void oggpack_reset(oggpack_buffer *b){
  95.239 +  if(!b->ptr)return;
  95.240 +  b->ptr=b->buffer;
  95.241 +  b->buffer[0]=0;
  95.242 +  b->endbit=b->endbyte=0;
  95.243 +}
  95.244 +
  95.245 +void oggpackB_reset(oggpack_buffer *b){
  95.246 +  oggpack_reset(b);
  95.247 +}
  95.248 +
  95.249 +void oggpack_writeclear(oggpack_buffer *b){
  95.250 +  if(b->buffer)_ogg_free(b->buffer);
  95.251 +  memset(b,0,sizeof(*b));
  95.252 +}
  95.253 +
  95.254 +void oggpackB_writeclear(oggpack_buffer *b){
  95.255 +  oggpack_writeclear(b);
  95.256 +}
  95.257 +
  95.258 +void oggpack_readinit(oggpack_buffer *b,unsigned char *buf,int bytes){
  95.259 +  memset(b,0,sizeof(*b));
  95.260 +  b->buffer=b->ptr=buf;
  95.261 +  b->storage=bytes;
  95.262 +}
  95.263 +
  95.264 +void oggpackB_readinit(oggpack_buffer *b,unsigned char *buf,int bytes){
  95.265 +  oggpack_readinit(b,buf,bytes);
  95.266 +}
  95.267 +
  95.268 +/* Read in bits without advancing the bitptr; bits <= 32 */
  95.269 +long oggpack_look(oggpack_buffer *b,int bits){
  95.270 +  unsigned long ret;
  95.271 +  unsigned long m;
  95.272 +
  95.273 +  if(bits<0 || bits>32) return -1;
  95.274 +  m=mask[bits];
  95.275 +  bits+=b->endbit;
  95.276 +
  95.277 +  if(b->endbyte >= b->storage-4){
  95.278 +    /* not the main path */
  95.279 +    if(b->endbyte > b->storage-((bits+7)>>3)) return -1;
  95.280 +    /* special case to avoid reading b->ptr[0], which might be past the end of
  95.281 +        the buffer; also skips some useless accounting */
  95.282 +    else if(!bits)return(0L);
  95.283 +  }
  95.284 +
  95.285 +  ret=b->ptr[0]>>b->endbit;
  95.286 +  if(bits>8){
  95.287 +    ret|=b->ptr[1]<<(8-b->endbit);
  95.288 +    if(bits>16){
  95.289 +      ret|=b->ptr[2]<<(16-b->endbit);
  95.290 +      if(bits>24){
  95.291 +        ret|=b->ptr[3]<<(24-b->endbit);
  95.292 +        if(bits>32 && b->endbit)
  95.293 +          ret|=b->ptr[4]<<(32-b->endbit);
  95.294 +      }
  95.295 +    }
  95.296 +  }
  95.297 +  return(m&ret);
  95.298 +}
  95.299 +
  95.300 +/* Read in bits without advancing the bitptr; bits <= 32 */
  95.301 +long oggpackB_look(oggpack_buffer *b,int bits){
  95.302 +  unsigned long ret;
  95.303 +  int m=32-bits;
  95.304 +
  95.305 +  if(m<0 || m>32) return -1;
  95.306 +  bits+=b->endbit;
  95.307 +
  95.308 +  if(b->endbyte >= b->storage-4){
  95.309 +    /* not the main path */
  95.310 +    if(b->endbyte > b->storage-((bits+7)>>3)) return -1;
  95.311 +    /* special case to avoid reading b->ptr[0], which might be past the end of
  95.312 +        the buffer; also skips some useless accounting */
  95.313 +    else if(!bits)return(0L);
  95.314 +  }
  95.315 +
  95.316 +  ret=b->ptr[0]<<(24+b->endbit);
  95.317 +  if(bits>8){
  95.318 +    ret|=b->ptr[1]<<(16+b->endbit);
  95.319 +    if(bits>16){
  95.320 +      ret|=b->ptr[2]<<(8+b->endbit);
  95.321 +      if(bits>24){
  95.322 +        ret|=b->ptr[3]<<(b->endbit);
  95.323 +        if(bits>32 && b->endbit)
  95.324 +          ret|=b->ptr[4]>>(8-b->endbit);
  95.325 +      }
  95.326 +    }
  95.327 +  }
  95.328 +  return ((ret&0xffffffff)>>(m>>1))>>((m+1)>>1);
  95.329 +}
  95.330 +
  95.331 +long oggpack_look1(oggpack_buffer *b){
  95.332 +  if(b->endbyte>=b->storage)return(-1);
  95.333 +  return((b->ptr[0]>>b->endbit)&1);
  95.334 +}
  95.335 +
  95.336 +long oggpackB_look1(oggpack_buffer *b){
  95.337 +  if(b->endbyte>=b->storage)return(-1);
  95.338 +  return((b->ptr[0]>>(7-b->endbit))&1);
  95.339 +}
  95.340 +
  95.341 +void oggpack_adv(oggpack_buffer *b,int bits){
  95.342 +  bits+=b->endbit;
  95.343 +
  95.344 +  if(b->endbyte > b->storage-((bits+7)>>3)) goto overflow;
  95.345 +
  95.346 +  b->ptr+=bits/8;
  95.347 +  b->endbyte+=bits/8;
  95.348 +  b->endbit=bits&7;
  95.349 +  return;
  95.350 +
  95.351 + overflow:
  95.352 +  b->ptr=NULL;
  95.353 +  b->endbyte=b->storage;
  95.354 +  b->endbit=1;
  95.355 +}
  95.356 +
  95.357 +void oggpackB_adv(oggpack_buffer *b,int bits){
  95.358 +  oggpack_adv(b,bits);
  95.359 +}
  95.360 +
  95.361 +void oggpack_adv1(oggpack_buffer *b){
  95.362 +  if(++(b->endbit)>7){
  95.363 +    b->endbit=0;
  95.364 +    b->ptr++;
  95.365 +    b->endbyte++;
  95.366 +  }
  95.367 +}
  95.368 +
  95.369 +void oggpackB_adv1(oggpack_buffer *b){
  95.370 +  oggpack_adv1(b);
  95.371 +}
  95.372 +
  95.373 +/* bits <= 32 */
  95.374 +long oggpack_read(oggpack_buffer *b,int bits){
  95.375 +  long ret;
  95.376 +  unsigned long m;
  95.377 +
  95.378 +  if(bits<0 || bits>32) goto err;
  95.379 +  m=mask[bits];
  95.380 +  bits+=b->endbit;
  95.381 +
  95.382 +  if(b->endbyte >= b->storage-4){
  95.383 +    /* not the main path */
  95.384 +    if(b->endbyte > b->storage-((bits+7)>>3)) goto overflow;
  95.385 +    /* special case to avoid reading b->ptr[0], which might be past the end of
  95.386 +        the buffer; also skips some useless accounting */
  95.387 +    else if(!bits)return(0L);
  95.388 +  }
  95.389 +
  95.390 +  ret=b->ptr[0]>>b->endbit;
  95.391 +  if(bits>8){
  95.392 +    ret|=b->ptr[1]<<(8-b->endbit);
  95.393 +    if(bits>16){
  95.394 +      ret|=b->ptr[2]<<(16-b->endbit);
  95.395 +      if(bits>24){
  95.396 +        ret|=b->ptr[3]<<(24-b->endbit);
  95.397 +        if(bits>32 && b->endbit){
  95.398 +          ret|=b->ptr[4]<<(32-b->endbit);
  95.399 +        }
  95.400 +      }
  95.401 +    }
  95.402 +  }
  95.403 +  ret&=m;
  95.404 +  b->ptr+=bits/8;
  95.405 +  b->endbyte+=bits/8;
  95.406 +  b->endbit=bits&7;
  95.407 +  return ret;
  95.408 +
  95.409 + overflow:
  95.410 + err:
  95.411 +  b->ptr=NULL;
  95.412 +  b->endbyte=b->storage;
  95.413 +  b->endbit=1;
  95.414 +  return -1L;
  95.415 +}
  95.416 +
  95.417 +/* bits <= 32 */
  95.418 +long oggpackB_read(oggpack_buffer *b,int bits){
  95.419 +  long ret;
  95.420 +  long m=32-bits;
  95.421 +
  95.422 +  if(m<0 || m>32) goto err;
  95.423 +  bits+=b->endbit;
  95.424 +
  95.425 +  if(b->endbyte+4>=b->storage){
  95.426 +    /* not the main path */
  95.427 +    if(b->endbyte > b->storage-((bits+7)>>3)) goto overflow;
  95.428 +    /* special case to avoid reading b->ptr[0], which might be past the end of
  95.429 +        the buffer; also skips some useless accounting */
  95.430 +    else if(!bits)return(0L);
  95.431 +  }
  95.432 +
  95.433 +  ret=b->ptr[0]<<(24+b->endbit);
  95.434 +  if(bits>8){
  95.435 +    ret|=b->ptr[1]<<(16+b->endbit);
  95.436 +    if(bits>16){
  95.437 +      ret|=b->ptr[2]<<(8+b->endbit);
  95.438 +      if(bits>24){
  95.439 +        ret|=b->ptr[3]<<(b->endbit);
  95.440 +        if(bits>32 && b->endbit)
  95.441 +          ret|=b->ptr[4]>>(8-b->endbit);
  95.442 +      }
  95.443 +    }
  95.444 +  }
  95.445 +  ret=((ret&0xffffffffUL)>>(m>>1))>>((m+1)>>1);
  95.446 +
  95.447 +  b->ptr+=bits/8;
  95.448 +  b->endbyte+=bits/8;
  95.449 +  b->endbit=bits&7;
  95.450 +  return ret;
  95.451 +
  95.452 + overflow:
  95.453 + err:
  95.454 +  b->ptr=NULL;
  95.455 +  b->endbyte=b->storage;
  95.456 +  b->endbit=1;
  95.457 +  return -1L;
  95.458 +}
  95.459 +
  95.460 +long oggpack_read1(oggpack_buffer *b){
  95.461 +  long ret;
  95.462 +
  95.463 +  if(b->endbyte >= b->storage) goto overflow;
  95.464 +  ret=(b->ptr[0]>>b->endbit)&1;
  95.465 +
  95.466 +  b->endbit++;
  95.467 +  if(b->endbit>7){
  95.468 +    b->endbit=0;
  95.469 +    b->ptr++;
  95.470 +    b->endbyte++;
  95.471 +  }
  95.472 +  return ret;
  95.473 +
  95.474 + overflow:
  95.475 +  b->ptr=NULL;
  95.476 +  b->endbyte=b->storage;
  95.477 +  b->endbit=1;
  95.478 +  return -1L;
  95.479 +}
  95.480 +
  95.481 +long oggpackB_read1(oggpack_buffer *b){
  95.482 +  long ret;
  95.483 +
  95.484 +  if(b->endbyte >= b->storage) goto overflow;
  95.485 +  ret=(b->ptr[0]>>(7-b->endbit))&1;
  95.486 +
  95.487 +  b->endbit++;
  95.488 +  if(b->endbit>7){
  95.489 +    b->endbit=0;
  95.490 +    b->ptr++;
  95.491 +    b->endbyte++;
  95.492 +  }
  95.493 +  return ret;
  95.494 +
  95.495 + overflow:
  95.496 +  b->ptr=NULL;
  95.497 +  b->endbyte=b->storage;
  95.498 +  b->endbit=1;
  95.499 +  return -1L;
  95.500 +}
  95.501 +
  95.502 +long oggpack_bytes(oggpack_buffer *b){
  95.503 +  return(b->endbyte+(b->endbit+7)/8);
  95.504 +}
  95.505 +
  95.506 +long oggpack_bits(oggpack_buffer *b){
  95.507 +  return(b->endbyte*8+b->endbit);
  95.508 +}
  95.509 +
  95.510 +long oggpackB_bytes(oggpack_buffer *b){
  95.511 +  return oggpack_bytes(b);
  95.512 +}
  95.513 +
  95.514 +long oggpackB_bits(oggpack_buffer *b){
  95.515 +  return oggpack_bits(b);
  95.516 +}
  95.517 +
  95.518 +unsigned char *oggpack_get_buffer(oggpack_buffer *b){
  95.519 +  return(b->buffer);
  95.520 +}
  95.521 +
  95.522 +unsigned char *oggpackB_get_buffer(oggpack_buffer *b){
  95.523 +  return oggpack_get_buffer(b);
  95.524 +}
  95.525 +
  95.526 +/* Self test of the bitwise routines; everything else is based on
  95.527 +   them, so they damned well better be solid. */
  95.528 +
  95.529 +#ifdef _V_SELFTEST
  95.530 +#include <stdio.h>
  95.531 +
  95.532 +static int ilog(unsigned int v){
  95.533 +  int ret=0;
  95.534 +  while(v){
  95.535 +    ret++;
  95.536 +    v>>=1;
  95.537 +  }
  95.538 +  return(ret);
  95.539 +}
  95.540 +
  95.541 +oggpack_buffer o;
  95.542 +oggpack_buffer r;
  95.543 +
  95.544 +void report(char *in){
  95.545 +  fprintf(stderr,"%s",in);
  95.546 +  exit(1);
  95.547 +}
  95.548 +
  95.549 +void cliptest(unsigned long *b,int vals,int bits,int *comp,int compsize){
  95.550 +  long bytes,i;
  95.551 +  unsigned char *buffer;
  95.552 +
  95.553 +  oggpack_reset(&o);
  95.554 +  for(i=0;i<vals;i++)
  95.555 +    oggpack_write(&o,b[i],bits?bits:ilog(b[i]));
  95.556 +  buffer=oggpack_get_buffer(&o);
  95.557 +  bytes=oggpack_bytes(&o);
  95.558 +  if(bytes!=compsize)report("wrong number of bytes!\n");
  95.559 +  for(i=0;i<bytes;i++)if(buffer[i]!=comp[i]){
  95.560 +    for(i=0;i<bytes;i++)fprintf(stderr,"%x %x\n",(int)buffer[i],(int)comp[i]);
  95.561 +    report("wrote incorrect value!\n");
  95.562 +  }
  95.563 +  oggpack_readinit(&r,buffer,bytes);
  95.564 +  for(i=0;i<vals;i++){
  95.565 +    int tbit=bits?bits:ilog(b[i]);
  95.566 +    if(oggpack_look(&r,tbit)==-1)
  95.567 +      report("out of data!\n");
  95.568 +    if(oggpack_look(&r,tbit)!=(b[i]&mask[tbit]))
  95.569 +      report("looked at incorrect value!\n");
  95.570 +    if(tbit==1)
  95.571 +      if(oggpack_look1(&r)!=(b[i]&mask[tbit]))
  95.572 +        report("looked at single bit incorrect value!\n");
  95.573 +    if(tbit==1){
  95.574 +      if(oggpack_read1(&r)!=(b[i]&mask[tbit]))
  95.575 +        report("read incorrect single bit value!\n");
  95.576 +    }else{
  95.577 +    if(oggpack_read(&r,tbit)!=(b[i]&mask[tbit]))
  95.578 +      report("read incorrect value!\n");
  95.579 +    }
  95.580 +  }
  95.581 +  if(oggpack_bytes(&r)!=bytes)report("leftover bytes after read!\n");
  95.582 +}
  95.583 +
  95.584 +void cliptestB(unsigned long *b,int vals,int bits,int *comp,int compsize){
  95.585 +  long bytes,i;
  95.586 +  unsigned char *buffer;
  95.587 +
  95.588 +  oggpackB_reset(&o);
  95.589 +  for(i=0;i<vals;i++)
  95.590 +    oggpackB_write(&o,b[i],bits?bits:ilog(b[i]));
  95.591 +  buffer=oggpackB_get_buffer(&o);
  95.592 +  bytes=oggpackB_bytes(&o);
  95.593 +  if(bytes!=compsize)report("wrong number of bytes!\n");
  95.594 +  for(i=0;i<bytes;i++)if(buffer[i]!=comp[i]){
  95.595 +    for(i=0;i<bytes;i++)fprintf(stderr,"%x %x\n",(int)buffer[i],(int)comp[i]);
  95.596 +    report("wrote incorrect value!\n");
  95.597 +  }
  95.598 +  oggpackB_readinit(&r,buffer,bytes);
  95.599 +  for(i=0;i<vals;i++){
  95.600 +    int tbit=bits?bits:ilog(b[i]);
  95.601 +    if(oggpackB_look(&r,tbit)==-1)
  95.602 +      report("out of data!\n");
  95.603 +    if(oggpackB_look(&r,tbit)!=(b[i]&mask[tbit]))
  95.604 +      report("looked at incorrect value!\n");
  95.605 +    if(tbit==1)
  95.606 +      if(oggpackB_look1(&r)!=(b[i]&mask[tbit]))
  95.607 +        report("looked at single bit incorrect value!\n");
  95.608 +    if(tbit==1){
  95.609 +      if(oggpackB_read1(&r)!=(b[i]&mask[tbit]))
  95.610 +        report("read incorrect single bit value!\n");
  95.611 +    }else{
  95.612 +    if(oggpackB_read(&r,tbit)!=(b[i]&mask[tbit]))
  95.613 +      report("read incorrect value!\n");
  95.614 +    }
  95.615 +  }
  95.616 +  if(oggpackB_bytes(&r)!=bytes)report("leftover bytes after read!\n");
  95.617 +}
  95.618 +
  95.619 +int main(void){
  95.620 +  unsigned char *buffer;
  95.621 +  long bytes,i;
  95.622 +  static unsigned long testbuffer1[]=
  95.623 +    {18,12,103948,4325,543,76,432,52,3,65,4,56,32,42,34,21,1,23,32,546,456,7,
  95.624 +       567,56,8,8,55,3,52,342,341,4,265,7,67,86,2199,21,7,1,5,1,4};
  95.625 +  int test1size=43;
  95.626 +
  95.627 +  static unsigned long testbuffer2[]=
  95.628 +    {216531625L,1237861823,56732452,131,3212421,12325343,34547562,12313212,
  95.629 +       1233432,534,5,346435231,14436467,7869299,76326614,167548585,
  95.630 +       85525151,0,12321,1,349528352};
  95.631 +  int test2size=21;
  95.632 +
  95.633 +  static unsigned long testbuffer3[]=
  95.634 +    {1,0,14,0,1,0,12,0,1,0,0,0,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,1,1,1,1,0,0,1,
  95.635 +       0,1,30,1,1,1,0,0,1,0,0,0,12,0,11,0,1,0,0,1};
  95.636 +  int test3size=56;
  95.637 +
  95.638 +  static unsigned long large[]=
  95.639 +    {2136531625L,2137861823,56732452,131,3212421,12325343,34547562,12313212,
  95.640 +       1233432,534,5,2146435231,14436467,7869299,76326614,167548585,
  95.641 +       85525151,0,12321,1,2146528352};
  95.642 +
  95.643 +  int onesize=33;
  95.644 +  static int one[33]={146,25,44,151,195,15,153,176,233,131,196,65,85,172,47,40,
  95.645 +                    34,242,223,136,35,222,211,86,171,50,225,135,214,75,172,
  95.646 +                    223,4};
  95.647 +  static int oneB[33]={150,101,131,33,203,15,204,216,105,193,156,65,84,85,222,
  95.648 +                       8,139,145,227,126,34,55,244,171,85,100,39,195,173,18,
  95.649 +                       245,251,128};
  95.650 +
  95.651 +  int twosize=6;
  95.652 +  static int two[6]={61,255,255,251,231,29};
  95.653 +  static int twoB[6]={247,63,255,253,249,120};
  95.654 +
  95.655 +  int threesize=54;
  95.656 +  static int three[54]={169,2,232,252,91,132,156,36,89,13,123,176,144,32,254,
  95.657 +                      142,224,85,59,121,144,79,124,23,67,90,90,216,79,23,83,
  95.658 +                      58,135,196,61,55,129,183,54,101,100,170,37,127,126,10,
  95.659 +                      100,52,4,14,18,86,77,1};
  95.660 +  static int threeB[54]={206,128,42,153,57,8,183,251,13,89,36,30,32,144,183,
  95.661 +                         130,59,240,121,59,85,223,19,228,180,134,33,107,74,98,
  95.662 +                         233,253,196,135,63,2,110,114,50,155,90,127,37,170,104,
  95.663 +                         200,20,254,4,58,106,176,144,0};
  95.664 +
  95.665 +  int foursize=38;
  95.666 +  static int four[38]={18,6,163,252,97,194,104,131,32,1,7,82,137,42,129,11,72,
  95.667 +                     132,60,220,112,8,196,109,64,179,86,9,137,195,208,122,169,
  95.668 +                     28,2,133,0,1};
  95.669 +  static int fourB[38]={36,48,102,83,243,24,52,7,4,35,132,10,145,21,2,93,2,41,
  95.670 +                        1,219,184,16,33,184,54,149,170,132,18,30,29,98,229,67,
  95.671 +                        129,10,4,32};
  95.672 +
  95.673 +  int fivesize=45;
  95.674 +  static int five[45]={169,2,126,139,144,172,30,4,80,72,240,59,130,218,73,62,
  95.675 +                     241,24,210,44,4,20,0,248,116,49,135,100,110,130,181,169,
  95.676 +                     84,75,159,2,1,0,132,192,8,0,0,18,22};
  95.677 +  static int fiveB[45]={1,84,145,111,245,100,128,8,56,36,40,71,126,78,213,226,
  95.678 +                        124,105,12,0,133,128,0,162,233,242,67,152,77,205,77,
  95.679 +                        172,150,169,129,79,128,0,6,4,32,0,27,9,0};
  95.680 +
  95.681 +  int sixsize=7;
  95.682 +  static int six[7]={17,177,170,242,169,19,148};
  95.683 +  static int sixB[7]={136,141,85,79,149,200,41};
  95.684 +
  95.685 +  /* Test read/write together */
  95.686 +  /* Later we test against pregenerated bitstreams */
  95.687 +  oggpack_writeinit(&o);
  95.688 +
  95.689 +  fprintf(stderr,"\nSmall preclipped packing (LSb): ");
  95.690 +  cliptest(testbuffer1,test1size,0,one,onesize);
  95.691 +  fprintf(stderr,"ok.");
  95.692 +
  95.693 +  fprintf(stderr,"\nNull bit call (LSb): ");
  95.694 +  cliptest(testbuffer3,test3size,0,two,twosize);
  95.695 +  fprintf(stderr,"ok.");
  95.696 +
  95.697 +  fprintf(stderr,"\nLarge preclipped packing (LSb): ");
  95.698 +  cliptest(testbuffer2,test2size,0,three,threesize);
  95.699 +  fprintf(stderr,"ok.");
  95.700 +
  95.701 +  fprintf(stderr,"\n32 bit preclipped packing (LSb): ");
  95.702 +  oggpack_reset(&o);
  95.703 +  for(i=0;i<test2size;i++)
  95.704 +    oggpack_write(&o,large[i],32);
  95.705 +  buffer=oggpack_get_buffer(&o);
  95.706 +  bytes=oggpack_bytes(&o);
  95.707 +  oggpack_readinit(&r,buffer,bytes);
  95.708 +  for(i=0;i<test2size;i++){
  95.709 +    if(oggpack_look(&r,32)==-1)report("out of data. failed!");
  95.710 +    if(oggpack_look(&r,32)!=large[i]){
  95.711 +      fprintf(stderr,"%ld != %ld (%lx!=%lx):",oggpack_look(&r,32),large[i],
  95.712 +              oggpack_look(&r,32),large[i]);
  95.713 +      report("read incorrect value!\n");
  95.714 +    }
  95.715 +    oggpack_adv(&r,32);
  95.716 +  }
  95.717 +  if(oggpack_bytes(&r)!=bytes)report("leftover bytes after read!\n");
  95.718 +  fprintf(stderr,"ok.");
  95.719 +
  95.720 +  fprintf(stderr,"\nSmall unclipped packing (LSb): ");
  95.721 +  cliptest(testbuffer1,test1size,7,four,foursize);
  95.722 +  fprintf(stderr,"ok.");
  95.723 +
  95.724 +  fprintf(stderr,"\nLarge unclipped packing (LSb): ");
  95.725 +  cliptest(testbuffer2,test2size,17,five,fivesize);
  95.726 +  fprintf(stderr,"ok.");
  95.727 +
  95.728 +  fprintf(stderr,"\nSingle bit unclipped packing (LSb): ");
  95.729 +  cliptest(testbuffer3,test3size,1,six,sixsize);
  95.730 +  fprintf(stderr,"ok.");
  95.731 +
  95.732 +  fprintf(stderr,"\nTesting read past end (LSb): ");
  95.733 +  oggpack_readinit(&r,(unsigned char *)"\0\0\0\0\0\0\0\0",8);
  95.734 +  for(i=0;i<64;i++){
  95.735 +    if(oggpack_read(&r,1)!=0){
  95.736 +      fprintf(stderr,"failed; got -1 prematurely.\n");
  95.737 +      exit(1);
  95.738 +    }
  95.739 +  }
  95.740 +  if(oggpack_look(&r,1)!=-1 ||
  95.741 +     oggpack_read(&r,1)!=-1){
  95.742 +      fprintf(stderr,"failed; read past end without -1.\n");
  95.743 +      exit(1);
  95.744 +  }
  95.745 +  oggpack_readinit(&r,(unsigned char *)"\0\0\0\0\0\0\0\0",8);
  95.746 +  if(oggpack_read(&r,30)!=0 || oggpack_read(&r,16)!=0){
  95.747 +      fprintf(stderr,"failed 2; got -1 prematurely.\n");
  95.748 +      exit(1);
  95.749 +  }
  95.750 +
  95.751 +  if(oggpack_look(&r,18)!=0 ||
  95.752 +     oggpack_look(&r,18)!=0){
  95.753 +    fprintf(stderr,"failed 3; got -1 prematurely.\n");
  95.754 +      exit(1);
  95.755 +  }
  95.756 +  if(oggpack_look(&r,19)!=-1 ||
  95.757 +     oggpack_look(&r,19)!=-1){
  95.758 +    fprintf(stderr,"failed; read past end without -1.\n");
  95.759 +      exit(1);
  95.760 +  }
  95.761 +  if(oggpack_look(&r,32)!=-1 ||
  95.762 +     oggpack_look(&r,32)!=-1){
  95.763 +    fprintf(stderr,"failed; read past end without -1.\n");
  95.764 +      exit(1);
  95.765 +  }
  95.766 +  oggpack_writeclear(&o);
  95.767 +  fprintf(stderr,"ok.\n");
  95.768 +
  95.769 +  /********** lazy, cut-n-paste retest with MSb packing ***********/
  95.770 +
  95.771 +  /* Test read/write together */
  95.772 +  /* Later we test against pregenerated bitstreams */
  95.773 +  oggpackB_writeinit(&o);
  95.774 +
  95.775 +  fprintf(stderr,"\nSmall preclipped packing (MSb): ");
  95.776 +  cliptestB(testbuffer1,test1size,0,oneB,onesize);
  95.777 +  fprintf(stderr,"ok.");
  95.778 +
  95.779 +  fprintf(stderr,"\nNull bit call (MSb): ");
  95.780 +  cliptestB(testbuffer3,test3size,0,twoB,twosize);
  95.781 +  fprintf(stderr,"ok.");
  95.782 +
  95.783 +  fprintf(stderr,"\nLarge preclipped packing (MSb): ");
  95.784 +  cliptestB(testbuffer2,test2size,0,threeB,threesize);
  95.785 +  fprintf(stderr,"ok.");
  95.786 +
  95.787 +  fprintf(stderr,"\n32 bit preclipped packing (MSb): ");
  95.788 +  oggpackB_reset(&o);
  95.789 +  for(i=0;i<test2size;i++)
  95.790 +    oggpackB_write(&o,large[i],32);
  95.791 +  buffer=oggpackB_get_buffer(&o);
  95.792 +  bytes=oggpackB_bytes(&o);
  95.793 +  oggpackB_readinit(&r,buffer,bytes);
  95.794 +  for(i=0;i<test2size;i++){
  95.795 +    if(oggpackB_look(&r,32)==-1)report("out of data. failed!");
  95.796 +    if(oggpackB_look(&r,32)!=large[i]){
  95.797 +      fprintf(stderr,"%ld != %ld (%lx!=%lx):",oggpackB_look(&r,32),large[i],
  95.798 +              oggpackB_look(&r,32),large[i]);
  95.799 +      report("read incorrect value!\n");
  95.800 +    }
  95.801 +    oggpackB_adv(&r,32);
  95.802 +  }
  95.803 +  if(oggpackB_bytes(&r)!=bytes)report("leftover bytes after read!\n");
  95.804 +  fprintf(stderr,"ok.");
  95.805 +
  95.806 +  fprintf(stderr,"\nSmall unclipped packing (MSb): ");
  95.807 +  cliptestB(testbuffer1,test1size,7,fourB,foursize);
  95.808 +  fprintf(stderr,"ok.");
  95.809 +
  95.810 +  fprintf(stderr,"\nLarge unclipped packing (MSb): ");
  95.811 +  cliptestB(testbuffer2,test2size,17,fiveB,fivesize);
  95.812 +  fprintf(stderr,"ok.");
  95.813 +
  95.814 +  fprintf(stderr,"\nSingle bit unclipped packing (MSb): ");
  95.815 +  cliptestB(testbuffer3,test3size,1,sixB,sixsize);
  95.816 +  fprintf(stderr,"ok.");
  95.817 +
  95.818 +  fprintf(stderr,"\nTesting read past end (MSb): ");
  95.819 +  oggpackB_readinit(&r,(unsigned char *)"\0\0\0\0\0\0\0\0",8);
  95.820 +  for(i=0;i<64;i++){
  95.821 +    if(oggpackB_read(&r,1)!=0){
  95.822 +      fprintf(stderr,"failed; got -1 prematurely.\n");
  95.823 +      exit(1);
  95.824 +    }
  95.825 +  }
  95.826 +  if(oggpackB_look(&r,1)!=-1 ||
  95.827 +     oggpackB_read(&r,1)!=-1){
  95.828 +      fprintf(stderr,"failed; read past end without -1.\n");
  95.829 +      exit(1);
  95.830 +  }
  95.831 +  oggpackB_readinit(&r,(unsigned char *)"\0\0\0\0\0\0\0\0",8);
  95.832 +  if(oggpackB_read(&r,30)!=0 || oggpackB_read(&r,16)!=0){
  95.833 +      fprintf(stderr,"failed 2; got -1 prematurely.\n");
  95.834 +      exit(1);
  95.835 +  }
  95.836 +
  95.837 +  if(oggpackB_look(&r,18)!=0 ||
  95.838 +     oggpackB_look(&r,18)!=0){
  95.839 +    fprintf(stderr,"failed 3; got -1 prematurely.\n");
  95.840 +      exit(1);
  95.841 +  }
  95.842 +  if(oggpackB_look(&r,19)!=-1 ||
  95.843 +     oggpackB_look(&r,19)!=-1){
  95.844 +    fprintf(stderr,"failed; read past end without -1.\n");
  95.845 +      exit(1);
  95.846 +  }
  95.847 +  if(oggpackB_look(&r,32)!=-1 ||
  95.848 +     oggpackB_look(&r,32)!=-1){
  95.849 +    fprintf(stderr,"failed; read past end without -1.\n");
  95.850 +      exit(1);
  95.851 +  }
  95.852 +  oggpackB_writeclear(&o);
  95.853 +  fprintf(stderr,"ok.\n\n");
  95.854 +
  95.855 +
  95.856 +  return(0);
  95.857 +}
  95.858 +#endif  /* _V_SELFTEST */
  95.859 +
  95.860 +#undef BUFFER_INCREMENT
    96.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    96.2 +++ b/libs/ogg/config_types.h	Sun Nov 01 00:36:56 2015 +0200
    96.3 @@ -0,0 +1,25 @@
    96.4 +#ifndef __CONFIG_TYPES_H__
    96.5 +#define __CONFIG_TYPES_H__
    96.6 +
    96.7 +/* these are filled in by configure */
    96.8 +#define INCLUDE_INTTYPES_H 1
    96.9 +#define INCLUDE_STDINT_H 1
   96.10 +#define INCLUDE_SYS_TYPES_H 1
   96.11 +
   96.12 +#if INCLUDE_INTTYPES_H
   96.13 +#  include <inttypes.h>
   96.14 +#endif
   96.15 +#if INCLUDE_STDINT_H
   96.16 +#  include <stdint.h>
   96.17 +#endif
   96.18 +#if INCLUDE_SYS_TYPES_H
   96.19 +#  include <sys/types.h>
   96.20 +#endif
   96.21 +
   96.22 +typedef int16_t ogg_int16_t;
   96.23 +typedef uint16_t ogg_uint16_t;
   96.24 +typedef int32_t ogg_int32_t;
   96.25 +typedef uint32_t ogg_uint32_t;
   96.26 +typedef int64_t ogg_int64_t;
   96.27 +
   96.28 +#endif
    97.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    97.2 +++ b/libs/ogg/framing.c	Sun Nov 01 00:36:56 2015 +0200
    97.3 @@ -0,0 +1,2111 @@
    97.4 +/********************************************************************
    97.5 + *                                                                  *
    97.6 + * THIS FILE IS PART OF THE Ogg CONTAINER SOURCE CODE.              *
    97.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
    97.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
    97.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
   97.10 + *                                                                  *
   97.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2010             *
   97.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
   97.13 + *                                                                  *
   97.14 + ********************************************************************
   97.15 +
   97.16 + function: code raw packets into framed OggSquish stream and
   97.17 +           decode Ogg streams back into raw packets
   97.18 + last mod: $Id: framing.c 18758 2013-01-08 16:29:56Z tterribe $
   97.19 +
   97.20 + note: The CRC code is directly derived from public domain code by
   97.21 + Ross Williams (ross@guest.adelaide.edu.au).  See docs/framing.html
   97.22 + for details.
   97.23 +
   97.24 + ********************************************************************/
   97.25 +
   97.26 +#include <stdlib.h>
   97.27 +#include <limits.h>
   97.28 +#include <string.h>
   97.29 +#include <ogg/ogg.h>
   97.30 +
   97.31 +/* A complete description of Ogg framing exists in docs/framing.html */
   97.32 +
   97.33 +int ogg_page_version(const ogg_page *og){
   97.34 +  return((int)(og->header[4]));
   97.35 +}
   97.36 +
   97.37 +int ogg_page_continued(const ogg_page *og){
   97.38 +  return((int)(og->header[5]&0x01));
   97.39 +}
   97.40 +
   97.41 +int ogg_page_bos(const ogg_page *og){
   97.42 +  return((int)(og->header[5]&0x02));
   97.43 +}
   97.44 +
   97.45 +int ogg_page_eos(const ogg_page *og){
   97.46 +  return((int)(og->header[5]&0x04));
   97.47 +}
   97.48 +
   97.49 +ogg_int64_t ogg_page_granulepos(const ogg_page *og){
   97.50 +  unsigned char *page=og->header;
   97.51 +  ogg_int64_t granulepos=page[13]&(0xff);
   97.52 +  granulepos= (granulepos<<8)|(page[12]&0xff);
   97.53 +  granulepos= (granulepos<<8)|(page[11]&0xff);
   97.54 +  granulepos= (granulepos<<8)|(page[10]&0xff);
   97.55 +  granulepos= (granulepos<<8)|(page[9]&0xff);
   97.56 +  granulepos= (granulepos<<8)|(page[8]&0xff);
   97.57 +  granulepos= (granulepos<<8)|(page[7]&0xff);
   97.58 +  granulepos= (granulepos<<8)|(page[6]&0xff);
   97.59 +  return(granulepos);
   97.60 +}
   97.61 +
   97.62 +int ogg_page_serialno(const ogg_page *og){
   97.63 +  return(og->header[14] |
   97.64 +         (og->header[15]<<8) |
   97.65 +         (og->header[16]<<16) |
   97.66 +         (og->header[17]<<24));
   97.67 +}
   97.68 +
   97.69 +long ogg_page_pageno(const ogg_page *og){
   97.70 +  return(og->header[18] |
   97.71 +         (og->header[19]<<8) |
   97.72 +         (og->header[20]<<16) |
   97.73 +         (og->header[21]<<24));
   97.74 +}
   97.75 +
   97.76 +
   97.77 +
   97.78 +/* returns the number of packets that are completed on this page (if
   97.79 +   the leading packet is begun on a previous page, but ends on this
   97.80 +   page, it's counted */
   97.81 +
   97.82 +/* NOTE:
   97.83 +   If a page consists of a packet begun on a previous page, and a new
   97.84 +   packet begun (but not completed) on this page, the return will be:
   97.85 +     ogg_page_packets(page)   ==1,
   97.86 +     ogg_page_continued(page) !=0
   97.87 +
   97.88 +   If a page happens to be a single packet that was begun on a
   97.89 +   previous page, and spans to the next page (in the case of a three or
   97.90 +   more page packet), the return will be:
   97.91 +     ogg_page_packets(page)   ==0,
   97.92 +     ogg_page_continued(page) !=0
   97.93 +*/
   97.94 +
   97.95 +int ogg_page_packets(const ogg_page *og){
   97.96 +  int i,n=og->header[26],count=0;
   97.97 +  for(i=0;i<n;i++)
   97.98 +    if(og->header[27+i]<255)count++;
   97.99 +  return(count);
  97.100 +}
  97.101 +
  97.102 +
  97.103 +#if 0
  97.104 +/* helper to initialize lookup for direct-table CRC (illustrative; we
  97.105 +   use the static init below) */
  97.106 +
  97.107 +static ogg_uint32_t _ogg_crc_entry(unsigned long index){
  97.108 +  int           i;
  97.109 +  unsigned long r;
  97.110 +
  97.111 +  r = index << 24;
  97.112 +  for (i=0; i<8; i++)
  97.113 +    if (r & 0x80000000UL)
  97.114 +      r = (r << 1) ^ 0x04c11db7; /* The same as the ethernet generator
  97.115 +                                    polynomial, although we use an
  97.116 +                                    unreflected alg and an init/final
  97.117 +                                    of 0, not 0xffffffff */
  97.118 +    else
  97.119 +       r<<=1;
  97.120 + return (r & 0xffffffffUL);
  97.121 +}
  97.122 +#endif
  97.123 +
  97.124 +static const ogg_uint32_t crc_lookup[256]={
  97.125 +  0x00000000,0x04c11db7,0x09823b6e,0x0d4326d9,
  97.126 +  0x130476dc,0x17c56b6b,0x1a864db2,0x1e475005,
  97.127 +  0x2608edb8,0x22c9f00f,0x2f8ad6d6,0x2b4bcb61,
  97.128 +  0x350c9b64,0x31cd86d3,0x3c8ea00a,0x384fbdbd,
  97.129 +  0x4c11db70,0x48d0c6c7,0x4593e01e,0x4152fda9,
  97.130 +  0x5f15adac,0x5bd4b01b,0x569796c2,0x52568b75,
  97.131 +  0x6a1936c8,0x6ed82b7f,0x639b0da6,0x675a1011,
  97.132 +  0x791d4014,0x7ddc5da3,0x709f7b7a,0x745e66cd,
  97.133 +  0x9823b6e0,0x9ce2ab57,0x91a18d8e,0x95609039,
  97.134 +  0x8b27c03c,0x8fe6dd8b,0x82a5fb52,0x8664e6e5,
  97.135 +  0xbe2b5b58,0xbaea46ef,0xb7a96036,0xb3687d81,
  97.136 +  0xad2f2d84,0xa9ee3033,0xa4ad16ea,0xa06c0b5d,
  97.137 +  0xd4326d90,0xd0f37027,0xddb056fe,0xd9714b49,
  97.138 +  0xc7361b4c,0xc3f706fb,0xceb42022,0xca753d95,
  97.139 +  0xf23a8028,0xf6fb9d9f,0xfbb8bb46,0xff79a6f1,
  97.140 +  0xe13ef6f4,0xe5ffeb43,0xe8bccd9a,0xec7dd02d,
  97.141 +  0x34867077,0x30476dc0,0x3d044b19,0x39c556ae,
  97.142 +  0x278206ab,0x23431b1c,0x2e003dc5,0x2ac12072,
  97.143 +  0x128e9dcf,0x164f8078,0x1b0ca6a1,0x1fcdbb16,
  97.144 +  0x018aeb13,0x054bf6a4,0x0808d07d,0x0cc9cdca,
  97.145 +  0x7897ab07,0x7c56b6b0,0x71159069,0x75d48dde,
  97.146 +  0x6b93dddb,0x6f52c06c,0x6211e6b5,0x66d0fb02,
  97.147 +  0x5e9f46bf,0x5a5e5b08,0x571d7dd1,0x53dc6066,
  97.148 +  0x4d9b3063,0x495a2dd4,0x44190b0d,0x40d816ba,
  97.149 +  0xaca5c697,0xa864db20,0xa527fdf9,0xa1e6e04e,
  97.150 +  0xbfa1b04b,0xbb60adfc,0xb6238b25,0xb2e29692,
  97.151 +  0x8aad2b2f,0x8e6c3698,0x832f1041,0x87ee0df6,
  97.152 +  0x99a95df3,0x9d684044,0x902b669d,0x94ea7b2a,
  97.153 +  0xe0b41de7,0xe4750050,0xe9362689,0xedf73b3e,
  97.154 +  0xf3b06b3b,0xf771768c,0xfa325055,0xfef34de2,
  97.155 +  0xc6bcf05f,0xc27dede8,0xcf3ecb31,0xcbffd686,
  97.156 +  0xd5b88683,0xd1799b34,0xdc3abded,0xd8fba05a,
  97.157 +  0x690ce0ee,0x6dcdfd59,0x608edb80,0x644fc637,
  97.158 +  0x7a089632,0x7ec98b85,0x738aad5c,0x774bb0eb,
  97.159 +  0x4f040d56,0x4bc510e1,0x46863638,0x42472b8f,
  97.160 +  0x5c007b8a,0x58c1663d,0x558240e4,0x51435d53,
  97.161 +  0x251d3b9e,0x21dc2629,0x2c9f00f0,0x285e1d47,
  97.162 +  0x36194d42,0x32d850f5,0x3f9b762c,0x3b5a6b9b,
  97.163 +  0x0315d626,0x07d4cb91,0x0a97ed48,0x0e56f0ff,
  97.164 +  0x1011a0fa,0x14d0bd4d,0x19939b94,0x1d528623,
  97.165 +  0xf12f560e,0xf5ee4bb9,0xf8ad6d60,0xfc6c70d7,
  97.166 +  0xe22b20d2,0xe6ea3d65,0xeba91bbc,0xef68060b,
  97.167 +  0xd727bbb6,0xd3e6a601,0xdea580d8,0xda649d6f,
  97.168 +  0xc423cd6a,0xc0e2d0dd,0xcda1f604,0xc960ebb3,
  97.169 +  0xbd3e8d7e,0xb9ff90c9,0xb4bcb610,0xb07daba7,
  97.170 +  0xae3afba2,0xaafbe615,0xa7b8c0cc,0xa379dd7b,
  97.171 +  0x9b3660c6,0x9ff77d71,0x92b45ba8,0x9675461f,
  97.172 +  0x8832161a,0x8cf30bad,0x81b02d74,0x857130c3,
  97.173 +  0x5d8a9099,0x594b8d2e,0x5408abf7,0x50c9b640,
  97.174 +  0x4e8ee645,0x4a4ffbf2,0x470cdd2b,0x43cdc09c,
  97.175 +  0x7b827d21,0x7f436096,0x7200464f,0x76c15bf8,
  97.176 +  0x68860bfd,0x6c47164a,0x61043093,0x65c52d24,
  97.177 +  0x119b4be9,0x155a565e,0x18197087,0x1cd86d30,
  97.178 +  0x029f3d35,0x065e2082,0x0b1d065b,0x0fdc1bec,
  97.179 +  0x3793a651,0x3352bbe6,0x3e119d3f,0x3ad08088,
  97.180 +  0x2497d08d,0x2056cd3a,0x2d15ebe3,0x29d4f654,
  97.181 +  0xc5a92679,0xc1683bce,0xcc2b1d17,0xc8ea00a0,
  97.182 +  0xd6ad50a5,0xd26c4d12,0xdf2f6bcb,0xdbee767c,
  97.183 +  0xe3a1cbc1,0xe760d676,0xea23f0af,0xeee2ed18,
  97.184 +  0xf0a5bd1d,0xf464a0aa,0xf9278673,0xfde69bc4,
  97.185 +  0x89b8fd09,0x8d79e0be,0x803ac667,0x84fbdbd0,
  97.186 +  0x9abc8bd5,0x9e7d9662,0x933eb0bb,0x97ffad0c,
  97.187 +  0xafb010b1,0xab710d06,0xa6322bdf,0xa2f33668,
  97.188 +  0xbcb4666d,0xb8757bda,0xb5365d03,0xb1f740b4};
  97.189 +
  97.190 +/* init the encode/decode logical stream state */
  97.191 +
  97.192 +int ogg_stream_init(ogg_stream_state *os,int serialno){
  97.193 +  if(os){
  97.194 +    memset(os,0,sizeof(*os));
  97.195 +    os->body_storage=16*1024;
  97.196 +    os->lacing_storage=1024;
  97.197 +
  97.198 +    os->body_data=_ogg_malloc(os->body_storage*sizeof(*os->body_data));
  97.199 +    os->lacing_vals=_ogg_malloc(os->lacing_storage*sizeof(*os->lacing_vals));
  97.200 +    os->granule_vals=_ogg_malloc(os->lacing_storage*sizeof(*os->granule_vals));
  97.201 +
  97.202 +    if(!os->body_data || !os->lacing_vals || !os->granule_vals){
  97.203 +      ogg_stream_clear(os);
  97.204 +      return -1;
  97.205 +    }
  97.206 +
  97.207 +    os->serialno=serialno;
  97.208 +
  97.209 +    return(0);
  97.210 +  }
  97.211 +  return(-1);
  97.212 +}
  97.213 +
  97.214 +/* async/delayed error detection for the ogg_stream_state */
  97.215 +int ogg_stream_check(ogg_stream_state *os){
  97.216 +  if(!os || !os->body_data) return -1;
  97.217 +  return 0;
  97.218 +}
  97.219 +
  97.220 +/* _clear does not free os, only the non-flat storage within */
  97.221 +int ogg_stream_clear(ogg_stream_state *os){
  97.222 +  if(os){
  97.223 +    if(os->body_data)_ogg_free(os->body_data);
  97.224 +    if(os->lacing_vals)_ogg_free(os->lacing_vals);
  97.225 +    if(os->granule_vals)_ogg_free(os->granule_vals);
  97.226 +
  97.227 +    memset(os,0,sizeof(*os));
  97.228 +  }
  97.229 +  return(0);
  97.230 +}
  97.231 +
  97.232 +int ogg_stream_destroy(ogg_stream_state *os){
  97.233 +  if(os){
  97.234 +    ogg_stream_clear(os);
  97.235 +    _ogg_free(os);
  97.236 +  }
  97.237 +  return(0);
  97.238 +}
  97.239 +
  97.240 +/* Helpers for ogg_stream_encode; this keeps the structure and
  97.241 +   what's happening fairly clear */
  97.242 +
  97.243 +static int _os_body_expand(ogg_stream_state *os,long needed){
  97.244 +  if(os->body_storage-needed<=os->body_fill){
  97.245 +    long body_storage;
  97.246 +    void *ret;
  97.247 +    if(os->body_storage>LONG_MAX-needed){
  97.248 +      ogg_stream_clear(os);
  97.249 +      return -1;
  97.250 +    }
  97.251 +    body_storage=os->body_storage+needed;
  97.252 +    if(body_storage<LONG_MAX-1024)body_storage+=1024;
  97.253 +    ret=_ogg_realloc(os->body_data,body_storage*sizeof(*os->body_data));
  97.254 +    if(!ret){
  97.255 +      ogg_stream_clear(os);
  97.256 +      return -1;
  97.257 +    }
  97.258 +    os->body_storage=body_storage;
  97.259 +    os->body_data=ret;
  97.260 +  }
  97.261 +  return 0;
  97.262 +}
  97.263 +
  97.264 +static int _os_lacing_expand(ogg_stream_state *os,long needed){
  97.265 +  if(os->lacing_storage-needed<=os->lacing_fill){
  97.266 +    long lacing_storage;
  97.267 +    void *ret;
  97.268 +    if(os->lacing_storage>LONG_MAX-needed){
  97.269 +      ogg_stream_clear(os);
  97.270 +      return -1;
  97.271 +    }
  97.272 +    lacing_storage=os->lacing_storage+needed;
  97.273 +    if(lacing_storage<LONG_MAX-32)lacing_storage+=32;
  97.274 +    ret=_ogg_realloc(os->lacing_vals,lacing_storage*sizeof(*os->lacing_vals));
  97.275 +    if(!ret){
  97.276 +      ogg_stream_clear(os);
  97.277 +      return -1;
  97.278 +    }
  97.279 +    os->lacing_vals=ret;
  97.280 +    ret=_ogg_realloc(os->granule_vals,lacing_storage*
  97.281 +                     sizeof(*os->granule_vals));
  97.282 +    if(!ret){
  97.283 +      ogg_stream_clear(os);
  97.284 +      return -1;
  97.285 +    }
  97.286 +    os->granule_vals=ret;
  97.287 +    os->lacing_storage=lacing_storage;
  97.288 +  }
  97.289 +  return 0;
  97.290 +}
  97.291 +
  97.292 +/* checksum the page */
  97.293 +/* Direct table CRC; note that this will be faster in the future if we
  97.294 +   perform the checksum simultaneously with other copies */
  97.295 +
  97.296 +void ogg_page_checksum_set(ogg_page *og){
  97.297 +  if(og){
  97.298 +    ogg_uint32_t crc_reg=0;
  97.299 +    int i;
  97.300 +
  97.301 +    /* safety; needed for API behavior, but not framing code */
  97.302 +    og->header[22]=0;
  97.303 +    og->header[23]=0;
  97.304 +    og->header[24]=0;
  97.305 +    og->header[25]=0;
  97.306 +
  97.307 +    for(i=0;i<og->header_len;i++)
  97.308 +      crc_reg=(crc_reg<<8)^crc_lookup[((crc_reg >> 24)&0xff)^og->header[i]];
  97.309 +    for(i=0;i<og->body_len;i++)
  97.310 +      crc_reg=(crc_reg<<8)^crc_lookup[((crc_reg >> 24)&0xff)^og->body[i]];
  97.311 +
  97.312 +    og->header[22]=(unsigned char)(crc_reg&0xff);
  97.313 +    og->header[23]=(unsigned char)((crc_reg>>8)&0xff);
  97.314 +    og->header[24]=(unsigned char)((crc_reg>>16)&0xff);
  97.315 +    og->header[25]=(unsigned char)((crc_reg>>24)&0xff);
  97.316 +  }
  97.317 +}
  97.318 +
  97.319 +/* submit data to the internal buffer of the framing engine */
  97.320 +int ogg_stream_iovecin(ogg_stream_state *os, ogg_iovec_t *iov, int count,
  97.321 +                       long e_o_s, ogg_int64_t granulepos){
  97.322 +
  97.323 +  long bytes = 0, lacing_vals;
  97.324 +  int i;
  97.325 +
  97.326 +  if(ogg_stream_check(os)) return -1;
  97.327 +  if(!iov) return 0;
  97.328 +
  97.329 +  for (i = 0; i < count; ++i){
  97.330 +    if(iov[i].iov_len>LONG_MAX) return -1;
  97.331 +    if(bytes>LONG_MAX-(long)iov[i].iov_len) return -1;
  97.332 +    bytes += (long)iov[i].iov_len;
  97.333 +  }
  97.334 +  lacing_vals=bytes/255+1;
  97.335 +
  97.336 +  if(os->body_returned){
  97.337 +    /* advance packet data according to the body_returned pointer. We
  97.338 +       had to keep it around to return a pointer into the buffer last
  97.339 +       call */
  97.340 +
  97.341 +    os->body_fill-=os->body_returned;
  97.342 +    if(os->body_fill)
  97.343 +      memmove(os->body_data,os->body_data+os->body_returned,
  97.344 +              os->body_fill);
  97.345 +    os->body_returned=0;
  97.346 +  }
  97.347 +
  97.348 +  /* make sure we have the buffer storage */
  97.349 +  if(_os_body_expand(os,bytes) || _os_lacing_expand(os,lacing_vals))
  97.350 +    return -1;
  97.351 +
  97.352 +  /* Copy in the submitted packet.  Yes, the copy is a waste; this is
  97.353 +     the liability of overly clean abstraction for the time being.  It
  97.354 +     will actually be fairly easy to eliminate the extra copy in the
  97.355 +     future */
  97.356 +
  97.357 +  for (i = 0; i < count; ++i) {
  97.358 +    memcpy(os->body_data+os->body_fill, iov[i].iov_base, iov[i].iov_len);
  97.359 +    os->body_fill += (int)iov[i].iov_len;
  97.360 +  }
  97.361 +
  97.362 +  /* Store lacing vals for this packet */
  97.363 +  for(i=0;i<lacing_vals-1;i++){
  97.364 +    os->lacing_vals[os->lacing_fill+i]=255;
  97.365 +    os->granule_vals[os->lacing_fill+i]=os->granulepos;
  97.366 +  }
  97.367 +  os->lacing_vals[os->lacing_fill+i]=bytes%255;
  97.368 +  os->granulepos=os->granule_vals[os->lacing_fill+i]=granulepos;
  97.369 +
  97.370 +  /* flag the first segment as the beginning of the packet */
  97.371 +  os->lacing_vals[os->lacing_fill]|= 0x100;
  97.372 +
  97.373 +  os->lacing_fill+=lacing_vals;
  97.374 +
  97.375 +  /* for the sake of completeness */
  97.376 +  os->packetno++;
  97.377 +
  97.378 +  if(e_o_s)os->e_o_s=1;
  97.379 +
  97.380 +  return(0);
  97.381 +}
  97.382 +
  97.383 +int ogg_stream_packetin(ogg_stream_state *os,ogg_packet *op){
  97.384 +  ogg_iovec_t iov;
  97.385 +  iov.iov_base = op->packet;
  97.386 +  iov.iov_len = op->bytes;
  97.387 +  return ogg_stream_iovecin(os, &iov, 1, op->e_o_s, op->granulepos);
  97.388 +}
  97.389 +
  97.390 +/* Conditionally flush a page; force==0 will only flush nominal-size
  97.391 +   pages, force==1 forces us to flush a page regardless of page size
  97.392 +   so long as there's any data available at all. */
  97.393 +static int ogg_stream_flush_i(ogg_stream_state *os,ogg_page *og, int force, int nfill){
  97.394 +  int i;
  97.395 +  int vals=0;
  97.396 +  int maxvals=(os->lacing_fill>255?255:os->lacing_fill);
  97.397 +  int bytes=0;
  97.398 +  long acc=0;
  97.399 +  ogg_int64_t granule_pos=-1;
  97.400 +
  97.401 +  if(ogg_stream_check(os)) return(0);
  97.402 +  if(maxvals==0) return(0);
  97.403 +
  97.404 +  /* construct a page */
  97.405 +  /* decide how many segments to include */
  97.406 +
  97.407 +  /* If this is the initial header case, the first page must only include
  97.408 +     the initial header packet */
  97.409 +  if(os->b_o_s==0){  /* 'initial header page' case */
  97.410 +    granule_pos=0;
  97.411 +    for(vals=0;vals<maxvals;vals++){
  97.412 +      if((os->lacing_vals[vals]&0x0ff)<255){
  97.413 +        vals++;
  97.414 +        break;
  97.415 +      }
  97.416 +    }
  97.417 +  }else{
  97.418 +
  97.419 +    /* The extra packets_done, packet_just_done logic here attempts to do two things:
  97.420 +       1) Don't unneccessarily span pages.
  97.421 +       2) Unless necessary, don't flush pages if there are less than four packets on
  97.422 +          them; this expands page size to reduce unneccessary overhead if incoming packets
  97.423 +          are large.
  97.424 +       These are not necessary behaviors, just 'always better than naive flushing'
  97.425 +       without requiring an application to explicitly request a specific optimized
  97.426 +       behavior. We'll want an explicit behavior setup pathway eventually as well. */
  97.427 +
  97.428 +    int packets_done=0;
  97.429 +    int packet_just_done=0;
  97.430 +    for(vals=0;vals<maxvals;vals++){
  97.431 +      if(acc>nfill && packet_just_done>=4){
  97.432 +        force=1;
  97.433 +        break;
  97.434 +      }
  97.435 +      acc+=os->lacing_vals[vals]&0x0ff;
  97.436 +      if((os->lacing_vals[vals]&0xff)<255){
  97.437 +        granule_pos=os->granule_vals[vals];
  97.438 +        packet_just_done=++packets_done;
  97.439 +      }else
  97.440 +        packet_just_done=0;
  97.441 +    }
  97.442 +    if(vals==255)force=1;
  97.443 +  }
  97.444 +
  97.445 +  if(!force) return(0);
  97.446 +
  97.447 +  /* construct the header in temp storage */
  97.448 +  memcpy(os->header,"OggS",4);
  97.449 +
  97.450 +  /* stream structure version */
  97.451 +  os->header[4]=0x00;
  97.452 +
  97.453 +  /* continued packet flag? */
  97.454 +  os->header[5]=0x00;
  97.455 +  if((os->lacing_vals[0]&0x100)==0)os->header[5]|=0x01;
  97.456 +  /* first page flag? */
  97.457 +  if(os->b_o_s==0)os->header[5]|=0x02;
  97.458 +  /* last page flag? */
  97.459 +  if(os->e_o_s && os->lacing_fill==vals)os->header[5]|=0x04;
  97.460 +  os->b_o_s=1;
  97.461 +
  97.462 +  /* 64 bits of PCM position */
  97.463 +  for(i=6;i<14;i++){
  97.464 +    os->header[i]=(unsigned char)(granule_pos&0xff);
  97.465 +    granule_pos>>=8;
  97.466 +  }
  97.467 +
  97.468 +  /* 32 bits of stream serial number */
  97.469 +  {
  97.470 +    long serialno=os->serialno;
  97.471 +    for(i=14;i<18;i++){
  97.472 +      os->header[i]=(unsigned char)(serialno&0xff);
  97.473 +      serialno>>=8;
  97.474 +    }
  97.475 +  }
  97.476 +
  97.477 +  /* 32 bits of page counter (we have both counter and page header
  97.478 +     because this val can roll over) */
  97.479 +  if(os->pageno==-1)os->pageno=0; /* because someone called
  97.480 +                                     stream_reset; this would be a
  97.481 +                                     strange thing to do in an
  97.482 +                                     encode stream, but it has
  97.483 +                                     plausible uses */
  97.484 +  {
  97.485 +    long pageno=os->pageno++;
  97.486 +    for(i=18;i<22;i++){
  97.487 +      os->header[i]=(unsigned char)(pageno&0xff);
  97.488 +      pageno>>=8;
  97.489 +    }
  97.490 +  }
  97.491 +
  97.492 +  /* zero for computation; filled in later */
  97.493 +  os->header[22]=0;
  97.494 +  os->header[23]=0;
  97.495 +  os->header[24]=0;
  97.496 +  os->header[25]=0;
  97.497 +
  97.498 +  /* segment table */
  97.499 +  os->header[26]=(unsigned char)(vals&0xff);
  97.500 +  for(i=0;i<vals;i++)
  97.501 +    bytes+=os->header[i+27]=(unsigned char)(os->lacing_vals[i]&0xff);
  97.502 +
  97.503 +  /* set pointers in the ogg_page struct */
  97.504 +  og->header=os->header;
  97.505 +  og->header_len=os->header_fill=vals+27;
  97.506 +  og->body=os->body_data+os->body_returned;
  97.507 +  og->body_len=bytes;
  97.508 +
  97.509 +  /* advance the lacing data and set the body_returned pointer */
  97.510 +
  97.511 +  os->lacing_fill-=vals;
  97.512 +  memmove(os->lacing_vals,os->lacing_vals+vals,os->lacing_fill*sizeof(*os->lacing_vals));
  97.513 +  memmove(os->granule_vals,os->granule_vals+vals,os->lacing_fill*sizeof(*os->granule_vals));
  97.514 +  os->body_returned+=bytes;
  97.515 +
  97.516 +  /* calculate the checksum */
  97.517 +
  97.518 +  ogg_page_checksum_set(og);
  97.519 +
  97.520 +  /* done */
  97.521 +  return(1);
  97.522 +}
  97.523 +
  97.524 +/* This will flush remaining packets into a page (returning nonzero),
  97.525 +   even if there is not enough data to trigger a flush normally
  97.526 +   (undersized page). If there are no packets or partial packets to
  97.527 +   flush, ogg_stream_flush returns 0.  Note that ogg_stream_flush will
  97.528 +   try to flush a normal sized page like ogg_stream_pageout; a call to
  97.529 +   ogg_stream_flush does not guarantee that all packets have flushed.
  97.530 +   Only a return value of 0 from ogg_stream_flush indicates all packet
  97.531 +   data is flushed into pages.
  97.532 +
  97.533 +   since ogg_stream_flush will flush the last page in a stream even if
  97.534 +   it's undersized, you almost certainly want to use ogg_stream_pageout
  97.535 +   (and *not* ogg_stream_flush) unless you specifically need to flush
  97.536 +   a page regardless of size in the middle of a stream. */
  97.537 +
  97.538 +int ogg_stream_flush(ogg_stream_state *os,ogg_page *og){
  97.539 +  return ogg_stream_flush_i(os,og,1,4096);
  97.540 +}
  97.541 +
  97.542 +/* Like the above, but an argument is provided to adjust the nominal
  97.543 +   page size for applications which are smart enough to provide their
  97.544 +   own delay based flushing */
  97.545 +
  97.546 +int ogg_stream_flush_fill(ogg_stream_state *os,ogg_page *og, int nfill){
  97.547 +  return ogg_stream_flush_i(os,og,1,nfill);
  97.548 +}
  97.549 +
  97.550 +/* This constructs pages from buffered packet segments.  The pointers
  97.551 +returned are to static buffers; do not free. The returned buffers are
  97.552 +good only until the next call (using the same ogg_stream_state) */
  97.553 +
  97.554 +int ogg_stream_pageout(ogg_stream_state *os, ogg_page *og){
  97.555 +  int force=0;
  97.556 +  if(ogg_stream_check(os)) return 0;
  97.557 +
  97.558 +  if((os->e_o_s&&os->lacing_fill) ||          /* 'were done, now flush' case */
  97.559 +     (os->lacing_fill&&!os->b_o_s))           /* 'initial header page' case */
  97.560 +    force=1;
  97.561 +
  97.562 +  return(ogg_stream_flush_i(os,og,force,4096));
  97.563 +}
  97.564 +
  97.565 +/* Like the above, but an argument is provided to adjust the nominal
  97.566 +page size for applications which are smart enough to provide their
  97.567 +own delay based flushing */
  97.568 +
  97.569 +int ogg_stream_pageout_fill(ogg_stream_state *os, ogg_page *og, int nfill){
  97.570 +  int force=0;
  97.571 +  if(ogg_stream_check(os)) return 0;
  97.572 +
  97.573 +  if((os->e_o_s&&os->lacing_fill) ||          /* 'were done, now flush' case */
  97.574 +     (os->lacing_fill&&!os->b_o_s))           /* 'initial header page' case */
  97.575 +    force=1;
  97.576 +
  97.577 +  return(ogg_stream_flush_i(os,og,force,nfill));
  97.578 +}
  97.579 +
  97.580 +int ogg_stream_eos(ogg_stream_state *os){
  97.581 +  if(ogg_stream_check(os)) return 1;
  97.582 +  return os->e_o_s;
  97.583 +}
  97.584 +
  97.585 +/* DECODING PRIMITIVES: packet streaming layer **********************/
  97.586 +
  97.587 +/* This has two layers to place more of the multi-serialno and paging
  97.588 +   control in the application's hands.  First, we expose a data buffer
  97.589 +   using ogg_sync_buffer().  The app either copies into the
  97.590 +   buffer, or passes it directly to read(), etc.  We then call
  97.591 +   ogg_sync_wrote() to tell how many bytes we just added.
  97.592 +
  97.593 +   Pages are returned (pointers into the buffer in ogg_sync_state)
  97.594 +   by ogg_sync_pageout().  The page is then submitted to
  97.595 +   ogg_stream_pagein() along with the appropriate
  97.596 +   ogg_stream_state* (ie, matching serialno).  We then get raw
  97.597 +   packets out calling ogg_stream_packetout() with a
  97.598 +   ogg_stream_state. */
  97.599 +
  97.600 +/* initialize the struct to a known state */
  97.601 +int ogg_sync_init(ogg_sync_state *oy){
  97.602 +  if(oy){
  97.603 +    oy->storage = -1; /* used as a readiness flag */
  97.604 +    memset(oy,0,sizeof(*oy));
  97.605 +  }
  97.606 +  return(0);
  97.607 +}
  97.608 +
  97.609 +/* clear non-flat storage within */
  97.610 +int ogg_sync_clear(ogg_sync_state *oy){
  97.611 +  if(oy){
  97.612 +    if(oy->data)_ogg_free(oy->data);
  97.613 +    memset(oy,0,sizeof(*oy));
  97.614 +  }
  97.615 +  return(0);
  97.616 +}
  97.617 +
  97.618 +int ogg_sync_destroy(ogg_sync_state *oy){
  97.619 +  if(oy){
  97.620 +    ogg_sync_clear(oy);
  97.621 +    _ogg_free(oy);
  97.622 +  }
  97.623 +  return(0);
  97.624 +}
  97.625 +
  97.626 +int ogg_sync_check(ogg_sync_state *oy){
  97.627 +  if(oy->storage<0) return -1;
  97.628 +  return 0;
  97.629 +}
  97.630 +
  97.631 +char *ogg_sync_buffer(ogg_sync_state *oy, long size){
  97.632 +  if(ogg_sync_check(oy)) return NULL;
  97.633 +
  97.634 +  /* first, clear out any space that has been previously returned */
  97.635 +  if(oy->returned){
  97.636 +    oy->fill-=oy->returned;
  97.637 +    if(oy->fill>0)
  97.638 +      memmove(oy->data,oy->data+oy->returned,oy->fill);
  97.639 +    oy->returned=0;
  97.640 +  }
  97.641 +
  97.642 +  if(size>oy->storage-oy->fill){
  97.643 +    /* We need to extend the internal buffer */
  97.644 +    long newsize=size+oy->fill+4096; /* an extra page to be nice */
  97.645 +    void *ret;
  97.646 +
  97.647 +    if(oy->data)
  97.648 +      ret=_ogg_realloc(oy->data,newsize);
  97.649 +    else
  97.650 +      ret=_ogg_malloc(newsize);
  97.651 +    if(!ret){
  97.652 +      ogg_sync_clear(oy);
  97.653 +      return NULL;
  97.654 +    }
  97.655 +    oy->data=ret;
  97.656 +    oy->storage=newsize;
  97.657 +  }
  97.658 +
  97.659 +  /* expose a segment at least as large as requested at the fill mark */
  97.660 +  return((char *)oy->data+oy->fill);
  97.661 +}
  97.662 +
  97.663 +int ogg_sync_wrote(ogg_sync_state *oy, long bytes){
  97.664 +  if(ogg_sync_check(oy))return -1;
  97.665 +  if(oy->fill+bytes>oy->storage)return -1;
  97.666 +  oy->fill+=bytes;
  97.667 +  return(0);
  97.668 +}
  97.669 +
  97.670 +/* sync the stream.  This is meant to be useful for finding page
  97.671 +   boundaries.
  97.672 +
  97.673 +   return values for this:
  97.674 +  -n) skipped n bytes
  97.675 +   0) page not ready; more data (no bytes skipped)
  97.676 +   n) page synced at current location; page length n bytes
  97.677 +
  97.678 +*/
  97.679 +
  97.680 +long ogg_sync_pageseek(ogg_sync_state *oy,ogg_page *og){
  97.681 +  unsigned char *page=oy->data+oy->returned;
  97.682 +  unsigned char *next;
  97.683 +  long bytes=oy->fill-oy->returned;
  97.684 +
  97.685 +  if(ogg_sync_check(oy))return 0;
  97.686 +
  97.687 +  if(oy->headerbytes==0){
  97.688 +    int headerbytes,i;
  97.689 +    if(bytes<27)return(0); /* not enough for a header */
  97.690 +
  97.691 +    /* verify capture pattern */
  97.692 +    if(memcmp(page,"OggS",4))goto sync_fail;
  97.693 +
  97.694 +    headerbytes=page[26]+27;
  97.695 +    if(bytes<headerbytes)return(0); /* not enough for header + seg table */
  97.696 +
  97.697 +    /* count up body length in the segment table */
  97.698 +
  97.699 +    for(i=0;i<page[26];i++)
  97.700 +      oy->bodybytes+=page[27+i];
  97.701 +    oy->headerbytes=headerbytes;
  97.702 +  }
  97.703 +
  97.704 +  if(oy->bodybytes+oy->headerbytes>bytes)return(0);
  97.705 +
  97.706 +  /* The whole test page is buffered.  Verify the checksum */
  97.707 +  {
  97.708 +    /* Grab the checksum bytes, set the header field to zero */
  97.709 +    char chksum[4];
  97.710 +    ogg_page log;
  97.711 +
  97.712 +    memcpy(chksum,page+22,4);
  97.713 +    memset(page+22,0,4);
  97.714 +
  97.715 +    /* set up a temp page struct and recompute the checksum */
  97.716 +    log.header=page;
  97.717 +    log.header_len=oy->headerbytes;
  97.718 +    log.body=page+oy->headerbytes;
  97.719 +    log.body_len=oy->bodybytes;
  97.720 +    ogg_page_checksum_set(&log);
  97.721 +
  97.722 +    /* Compare */
  97.723 +    if(memcmp(chksum,page+22,4)){
  97.724 +      /* D'oh.  Mismatch! Corrupt page (or miscapture and not a page
  97.725 +         at all) */
  97.726 +      /* replace the computed checksum with the one actually read in */
  97.727 +      memcpy(page+22,chksum,4);
  97.728 +
  97.729 +      /* Bad checksum. Lose sync */
  97.730 +      goto sync_fail;
  97.731 +    }
  97.732 +  }
  97.733 +
  97.734 +  /* yes, have a whole page all ready to go */
  97.735 +  {
  97.736 +    unsigned char *page=oy->data+oy->returned;
  97.737 +    long bytes;
  97.738 +
  97.739 +    if(og){
  97.740 +      og->header=page;
  97.741 +      og->header_len=oy->headerbytes;
  97.742 +      og->body=page+oy->headerbytes;
  97.743 +      og->body_len=oy->bodybytes;
  97.744 +    }
  97.745 +
  97.746 +    oy->unsynced=0;
  97.747 +    oy->returned+=(bytes=oy->headerbytes+oy->bodybytes);
  97.748 +    oy->headerbytes=0;
  97.749 +    oy->bodybytes=0;
  97.750 +    return(bytes);
  97.751 +  }
  97.752 +
  97.753 + sync_fail:
  97.754 +
  97.755 +  oy->headerbytes=0;
  97.756 +  oy->bodybytes=0;
  97.757 +
  97.758 +  /* search for possible capture */
  97.759 +  next=memchr(page+1,'O',bytes-1);
  97.760 +  if(!next)
  97.761 +    next=oy->data+oy->fill;
  97.762 +
  97.763 +  oy->returned=(int)(next-oy->data);
  97.764 +  return((long)-(next-page));
  97.765 +}
  97.766 +
  97.767 +/* sync the stream and get a page.  Keep trying until we find a page.
  97.768 +   Suppress 'sync errors' after reporting the first.
  97.769 +
  97.770 +   return values:
  97.771 +   -1) recapture (hole in data)
  97.772 +    0) need more data
  97.773 +    1) page returned
  97.774 +
  97.775 +   Returns pointers into buffered data; invalidated by next call to
  97.776 +   _stream, _clear, _init, or _buffer */
  97.777 +
  97.778 +int ogg_sync_pageout(ogg_sync_state *oy, ogg_page *og){
  97.779 +
  97.780 +  if(ogg_sync_check(oy))return 0;
  97.781 +
  97.782 +  /* all we need to do is verify a page at the head of the stream
  97.783 +     buffer.  If it doesn't verify, we look for the next potential
  97.784 +     frame */
  97.785 +
  97.786 +  for(;;){
  97.787 +    long ret=ogg_sync_pageseek(oy,og);
  97.788 +    if(ret>0){
  97.789 +      /* have a page */
  97.790 +      return(1);
  97.791 +    }
  97.792 +    if(ret==0){
  97.793 +      /* need more data */
  97.794 +      return(0);
  97.795 +    }
  97.796 +
  97.797 +    /* head did not start a synced page... skipped some bytes */
  97.798 +    if(!oy->unsynced){
  97.799 +      oy->unsynced=1;
  97.800 +      return(-1);
  97.801 +    }
  97.802 +
  97.803 +    /* loop. keep looking */
  97.804 +
  97.805 +  }
  97.806 +}
  97.807 +
  97.808 +/* add the incoming page to the stream state; we decompose the page
  97.809 +   into packet segments here as well. */
  97.810 +
  97.811 +int ogg_stream_pagein(ogg_stream_state *os, ogg_page *og){
  97.812 +  unsigned char *header=og->header;
  97.813 +  unsigned char *body=og->body;
  97.814 +  long           bodysize=og->body_len;
  97.815 +  int            segptr=0;
  97.816 +
  97.817 +  int version=ogg_page_version(og);
  97.818 +  int continued=ogg_page_continued(og);
  97.819 +  int bos=ogg_page_bos(og);
  97.820 +  int eos=ogg_page_eos(og);
  97.821 +  ogg_int64_t granulepos=ogg_page_granulepos(og);
  97.822 +  int serialno=ogg_page_serialno(og);
  97.823 +  long pageno=ogg_page_pageno(og);
  97.824 +  int segments=header[26];
  97.825 +
  97.826 +  if(ogg_stream_check(os)) return -1;
  97.827 +
  97.828 +  /* clean up 'returned data' */
  97.829 +  {
  97.830 +    long lr=os->lacing_returned;
  97.831 +    long br=os->body_returned;
  97.832 +
  97.833 +    /* body data */
  97.834 +    if(br){
  97.835 +      os->body_fill-=br;
  97.836 +      if(os->body_fill)
  97.837 +        memmove(os->body_data,os->body_data+br,os->body_fill);
  97.838 +      os->body_returned=0;
  97.839 +    }
  97.840 +
  97.841 +    if(lr){
  97.842 +      /* segment table */
  97.843 +      if(os->lacing_fill-lr){
  97.844 +        memmove(os->lacing_vals,os->lacing_vals+lr,
  97.845 +                (os->lacing_fill-lr)*sizeof(*os->lacing_vals));
  97.846 +        memmove(os->granule_vals,os->granule_vals+lr,
  97.847 +                (os->lacing_fill-lr)*sizeof(*os->granule_vals));
  97.848 +      }
  97.849 +      os->lacing_fill-=lr;
  97.850 +      os->lacing_packet-=lr;
  97.851 +      os->lacing_returned=0;
  97.852 +    }
  97.853 +  }
  97.854 +
  97.855 +  /* check the serial number */
  97.856 +  if(serialno!=os->serialno)return(-1);
  97.857 +  if(version>0)return(-1);
  97.858 +
  97.859 +  if(_os_lacing_expand(os,segments+1)) return -1;
  97.860 +
  97.861 +  /* are we in sequence? */
  97.862 +  if(pageno!=os->pageno){
  97.863 +    int i;
  97.864 +
  97.865 +    /* unroll previous partial packet (if any) */
  97.866 +    for(i=os->lacing_packet;i<os->lacing_fill;i++)
  97.867 +      os->body_fill-=os->lacing_vals[i]&0xff;
  97.868 +    os->lacing_fill=os->lacing_packet;
  97.869 +
  97.870 +    /* make a note of dropped data in segment table */
  97.871 +    if(os->pageno!=-1){
  97.872 +      os->lacing_vals[os->lacing_fill++]=0x400;
  97.873 +      os->lacing_packet++;
  97.874 +    }
  97.875 +  }
  97.876 +
  97.877 +  /* are we a 'continued packet' page?  If so, we may need to skip
  97.878 +     some segments */
  97.879 +  if(continued){
  97.880 +    if(os->lacing_fill<1 ||
  97.881 +       os->lacing_vals[os->lacing_fill-1]==0x400){
  97.882 +      bos=0;
  97.883 +      for(;segptr<segments;segptr++){
  97.884 +        int val=header[27+segptr];
  97.885 +        body+=val;
  97.886 +        bodysize-=val;
  97.887 +        if(val<255){
  97.888 +          segptr++;
  97.889 +          break;
  97.890 +        }
  97.891 +      }
  97.892 +    }
  97.893 +  }
  97.894 +
  97.895 +  if(bodysize){
  97.896 +    if(_os_body_expand(os,bodysize)) return -1;
  97.897 +    memcpy(os->body_data+os->body_fill,body,bodysize);
  97.898 +    os->body_fill+=bodysize;
  97.899 +  }
  97.900 +
  97.901 +  {
  97.902 +    int saved=-1;
  97.903 +    while(segptr<segments){
  97.904 +      int val=header[27+segptr];
  97.905 +      os->lacing_vals[os->lacing_fill]=val;
  97.906 +      os->granule_vals[os->lacing_fill]=-1;
  97.907 +
  97.908 +      if(bos){
  97.909 +        os->lacing_vals[os->lacing_fill]|=0x100;
  97.910 +        bos=0;
  97.911 +      }
  97.912 +
  97.913 +      if(val<255)saved=os->lacing_fill;
  97.914 +
  97.915 +      os->lacing_fill++;
  97.916 +      segptr++;
  97.917 +
  97.918 +      if(val<255)os->lacing_packet=os->lacing_fill;
  97.919 +    }
  97.920 +
  97.921 +    /* set the granulepos on the last granuleval of the last full packet */
  97.922 +    if(saved!=-1){
  97.923 +      os->granule_vals[saved]=granulepos;
  97.924 +    }
  97.925 +
  97.926 +  }
  97.927 +
  97.928 +  if(eos){
  97.929 +    os->e_o_s=1;
  97.930 +    if(os->lacing_fill>0)
  97.931 +      os->lacing_vals[os->lacing_fill-1]|=0x200;
  97.932 +  }
  97.933 +
  97.934 +  os->pageno=pageno+1;
  97.935 +
  97.936 +  return(0);
  97.937 +}
  97.938 +
  97.939 +/* clear things to an initial state.  Good to call, eg, before seeking */
  97.940 +int ogg_sync_reset(ogg_sync_state *oy){
  97.941 +  if(ogg_sync_check(oy))return -1;
  97.942 +
  97.943 +  oy->fill=0;
  97.944 +  oy->returned=0;
  97.945 +  oy->unsynced=0;
  97.946 +  oy->headerbytes=0;
  97.947 +  oy->bodybytes=0;
  97.948 +  return(0);
  97.949 +}
  97.950 +
  97.951 +int ogg_stream_reset(ogg_stream_state *os){
  97.952 +  if(ogg_stream_check(os)) return -1;
  97.953 +
  97.954 +  os->body_fill=0;
  97.955 +  os->body_returned=0;
  97.956 +
  97.957 +  os->lacing_fill=0;
  97.958 +  os->lacing_packet=0;
  97.959 +  os->lacing_returned=0;
  97.960 +
  97.961 +  os->header_fill=0;
  97.962 +
  97.963 +  os->e_o_s=0;
  97.964 +  os->b_o_s=0;
  97.965 +  os->pageno=-1;
  97.966 +  os->packetno=0;
  97.967 +  os->granulepos=0;
  97.968 +
  97.969 +  return(0);
  97.970 +}
  97.971 +
  97.972 +int ogg_stream_reset_serialno(ogg_stream_state *os,int serialno){
  97.973 +  if(ogg_stream_check(os)) return -1;
  97.974 +  ogg_stream_reset(os);
  97.975 +  os->serialno=serialno;
  97.976 +  return(0);
  97.977 +}
  97.978 +
  97.979 +static int _packetout(ogg_stream_state *os,ogg_packet *op,int adv){
  97.980 +
  97.981 +  /* The last part of decode. We have the stream broken into packet
  97.982 +     segments.  Now we need to group them into packets (or return the
  97.983 +     out of sync markers) */
  97.984 +
  97.985 +  int ptr=os->lacing_returned;
  97.986 +
  97.987 +  if(os->lacing_packet<=ptr)return(0);
  97.988 +
  97.989 +  if(os->lacing_vals[ptr]&0x400){
  97.990 +    /* we need to tell the codec there's a gap; it might need to
  97.991 +       handle previous packet dependencies. */
  97.992 +    os->lacing_returned++;
  97.993 +    os->packetno++;
  97.994 +    return(-1);
  97.995 +  }
  97.996 +
  97.997 +  if(!op && !adv)return(1); /* just using peek as an inexpensive way
  97.998 +                               to ask if there's a whole packet
  97.999 +                               waiting */
 97.1000 +
 97.1001 +  /* Gather the whole packet. We'll have no holes or a partial packet */
 97.1002 +  {
 97.1003 +    int size=os->lacing_vals[ptr]&0xff;
 97.1004 +    long bytes=size;
 97.1005 +    int eos=os->lacing_vals[ptr]&0x200; /* last packet of the stream? */
 97.1006 +    int bos=os->lacing_vals[ptr]&0x100; /* first packet of the stream? */
 97.1007 +
 97.1008 +    while(size==255){
 97.1009 +      int val=os->lacing_vals[++ptr];
 97.1010 +      size=val&0xff;
 97.1011 +      if(val&0x200)eos=0x200;
 97.1012 +      bytes+=size;
 97.1013 +    }
 97.1014 +
 97.1015 +    if(op){
 97.1016 +      op->e_o_s=eos;
 97.1017 +      op->b_o_s=bos;
 97.1018 +      op->packet=os->body_data+os->body_returned;
 97.1019 +      op->packetno=os->packetno;
 97.1020 +      op->granulepos=os->granule_vals[ptr];
 97.1021 +      op->bytes=bytes;
 97.1022 +    }
 97.1023 +
 97.1024 +    if(adv){
 97.1025 +      os->body_returned+=bytes;
 97.1026 +      os->lacing_returned=ptr+1;
 97.1027 +      os->packetno++;
 97.1028 +    }
 97.1029 +  }
 97.1030 +  return(1);
 97.1031 +}
 97.1032 +
 97.1033 +int ogg_stream_packetout(ogg_stream_state *os,ogg_packet *op){
 97.1034 +  if(ogg_stream_check(os)) return 0;
 97.1035 +  return _packetout(os,op,1);
 97.1036 +}
 97.1037 +
 97.1038 +int ogg_stream_packetpeek(ogg_stream_state *os,ogg_packet *op){
 97.1039 +  if(ogg_stream_check(os)) return 0;
 97.1040 +  return _packetout(os,op,0);
 97.1041 +}
 97.1042 +
 97.1043 +void ogg_packet_clear(ogg_packet *op) {
 97.1044 +  _ogg_free(op->packet);
 97.1045 +  memset(op, 0, sizeof(*op));
 97.1046 +}
 97.1047 +
 97.1048 +#ifdef _V_SELFTEST
 97.1049 +#include <stdio.h>
 97.1050 +
 97.1051 +ogg_stream_state os_en, os_de;
 97.1052 +ogg_sync_state oy;
 97.1053 +
 97.1054 +void checkpacket(ogg_packet *op,long len, int no, long pos){
 97.1055 +  long j;
 97.1056 +  static int sequence=0;
 97.1057 +  static int lastno=0;
 97.1058 +
 97.1059 +  if(op->bytes!=len){
 97.1060 +    fprintf(stderr,"incorrect packet length (%ld != %ld)!\n",op->bytes,len);
 97.1061 +    exit(1);
 97.1062 +  }
 97.1063 +  if(op->granulepos!=pos){
 97.1064 +    fprintf(stderr,"incorrect packet granpos (%ld != %ld)!\n",(long)op->granulepos,pos);
 97.1065 +    exit(1);
 97.1066 +  }
 97.1067 +
 97.1068 +  /* packet number just follows sequence/gap; adjust the input number
 97.1069 +     for that */
 97.1070 +  if(no==0){
 97.1071 +    sequence=0;
 97.1072 +  }else{
 97.1073 +    sequence++;
 97.1074 +    if(no>lastno+1)
 97.1075 +      sequence++;
 97.1076 +  }
 97.1077 +  lastno=no;
 97.1078 +  if(op->packetno!=sequence){
 97.1079 +    fprintf(stderr,"incorrect packet sequence %ld != %d\n",
 97.1080 +            (long)(op->packetno),sequence);
 97.1081 +    exit(1);
 97.1082 +  }
 97.1083 +
 97.1084 +  /* Test data */
 97.1085 +  for(j=0;j<op->bytes;j++)
 97.1086 +    if(op->packet[j]!=((j+no)&0xff)){
 97.1087 +      fprintf(stderr,"body data mismatch (1) at pos %ld: %x!=%lx!\n\n",
 97.1088 +              j,op->packet[j],(j+no)&0xff);
 97.1089 +      exit(1);
 97.1090 +    }
 97.1091 +}
 97.1092 +
 97.1093 +void check_page(unsigned char *data,const int *header,ogg_page *og){
 97.1094 +  long j;
 97.1095 +  /* Test data */
 97.1096 +  for(j=0;j<og->body_len;j++)
 97.1097 +    if(og->body[j]!=data[j]){
 97.1098 +      fprintf(stderr,"body data mismatch (2) at pos %ld: %x!=%x!\n\n",
 97.1099 +              j,data[j],og->body[j]);
 97.1100 +      exit(1);
 97.1101 +    }
 97.1102 +
 97.1103 +  /* Test header */
 97.1104 +  for(j=0;j<og->header_len;j++){
 97.1105 +    if(og->header[j]!=header[j]){
 97.1106 +      fprintf(stderr,"header content mismatch at pos %ld:\n",j);
 97.1107 +      for(j=0;j<header[26]+27;j++)
 97.1108 +        fprintf(stderr," (%ld)%02x:%02x",j,header[j],og->header[j]);
 97.1109 +      fprintf(stderr,"\n");
 97.1110 +      exit(1);
 97.1111 +    }
 97.1112 +  }
 97.1113 +  if(og->header_len!=header[26]+27){
 97.1114 +    fprintf(stderr,"header length incorrect! (%ld!=%d)\n",
 97.1115 +            og->header_len,header[26]+27);
 97.1116 +    exit(1);
 97.1117 +  }
 97.1118 +}
 97.1119 +
 97.1120 +void print_header(ogg_page *og){
 97.1121 +  int j;
 97.1122 +  fprintf(stderr,"\nHEADER:\n");
 97.1123 +  fprintf(stderr,"  capture: %c %c %c %c  version: %d  flags: %x\n",
 97.1124 +          og->header[0],og->header[1],og->header[2],og->header[3],
 97.1125 +          (int)og->header[4],(int)og->header[5]);
 97.1126 +
 97.1127 +  fprintf(stderr,"  granulepos: %d  serialno: %d  pageno: %ld\n",
 97.1128 +          (og->header[9]<<24)|(og->header[8]<<16)|
 97.1129 +          (og->header[7]<<8)|og->header[6],
 97.1130 +          (og->header[17]<<24)|(og->header[16]<<16)|
 97.1131 +          (og->header[15]<<8)|og->header[14],
 97.1132 +          ((long)(og->header[21])<<24)|(og->header[20]<<16)|
 97.1133 +          (og->header[19]<<8)|og->header[18]);
 97.1134 +
 97.1135 +  fprintf(stderr,"  checksum: %02x:%02x:%02x:%02x\n  segments: %d (",
 97.1136 +          (int)og->header[22],(int)og->header[23],
 97.1137 +          (int)og->header[24],(int)og->header[25],
 97.1138 +          (int)og->header[26]);
 97.1139 +
 97.1140 +  for(j=27;j<og->header_len;j++)
 97.1141 +    fprintf(stderr,"%d ",(int)og->header[j]);
 97.1142 +  fprintf(stderr,")\n\n");
 97.1143 +}
 97.1144 +
 97.1145 +void copy_page(ogg_page *og){
 97.1146 +  unsigned char *temp=_ogg_malloc(og->header_len);
 97.1147 +  memcpy(temp,og->header,og->header_len);
 97.1148 +  og->header=temp;
 97.1149 +
 97.1150 +  temp=_ogg_malloc(og->body_len);
 97.1151 +  memcpy(temp,og->body,og->body_len);
 97.1152 +  og->body=temp;
 97.1153 +}
 97.1154 +
 97.1155 +void free_page(ogg_page *og){
 97.1156 +  _ogg_free (og->header);
 97.1157 +  _ogg_free (og->body);
 97.1158 +}
 97.1159 +
 97.1160 +void error(void){
 97.1161 +  fprintf(stderr,"error!\n");
 97.1162 +  exit(1);
 97.1163 +}
 97.1164 +
 97.1165 +/* 17 only */
 97.1166 +const int head1_0[] = {0x4f,0x67,0x67,0x53,0,0x06,
 97.1167 +                       0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 97.1168 +                       0x01,0x02,0x03,0x04,0,0,0,0,
 97.1169 +                       0x15,0xed,0xec,0x91,
 97.1170 +                       1,
 97.1171 +                       17};
 97.1172 +
 97.1173 +/* 17, 254, 255, 256, 500, 510, 600 byte, pad */
 97.1174 +const int head1_1[] = {0x4f,0x67,0x67,0x53,0,0x02,
 97.1175 +                       0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 97.1176 +                       0x01,0x02,0x03,0x04,0,0,0,0,
 97.1177 +                       0x59,0x10,0x6c,0x2c,
 97.1178 +                       1,
 97.1179 +                       17};
 97.1180 +const int head2_1[] = {0x4f,0x67,0x67,0x53,0,0x04,
 97.1181 +                       0x07,0x18,0x00,0x00,0x00,0x00,0x00,0x00,
 97.1182 +                       0x01,0x02,0x03,0x04,1,0,0,0,
 97.1183 +                       0x89,0x33,0x85,0xce,
 97.1184 +                       13,
 97.1185 +                       254,255,0,255,1,255,245,255,255,0,
 97.1186 +                       255,255,90};
 97.1187 +
 97.1188 +/* nil packets; beginning,middle,end */
 97.1189 +const int head1_2[] = {0x4f,0x67,0x67,0x53,0,0x02,
 97.1190 +                       0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 97.1191 +                       0x01,0x02,0x03,0x04,0,0,0,0,
 97.1192 +                       0xff,0x7b,0x23,0x17,
 97.1193 +                       1,
 97.1194 +                       0};
 97.1195 +const int head2_2[] = {0x4f,0x67,0x67,0x53,0,0x04,
 97.1196 +                       0x07,0x28,0x00,0x00,0x00,0x00,0x00,0x00,
 97.1197 +                       0x01,0x02,0x03,0x04,1,0,0,0,
 97.1198 +                       0x5c,0x3f,0x66,0xcb,
 97.1199 +                       17,
 97.1200 +                       17,254,255,0,0,255,1,0,255,245,255,255,0,
 97.1201 +                       255,255,90,0};
 97.1202 +
 97.1203 +/* large initial packet */
 97.1204 +const int head1_3[] = {0x4f,0x67,0x67,0x53,0,0x02,
 97.1205 +                       0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 97.1206 +                       0x01,0x02,0x03,0x04,0,0,0,0,
 97.1207 +                       0x01,0x27,0x31,0xaa,
 97.1208 +                       18,
 97.1209 +                       255,255,255,255,255,255,255,255,
 97.1210 +                       255,255,255,255,255,255,255,255,255,10};
 97.1211 +
 97.1212 +const int head2_3[] = {0x4f,0x67,0x67,0x53,0,0x04,
 97.1213 +                       0x07,0x08,0x00,0x00,0x00,0x00,0x00,0x00,
 97.1214 +                       0x01,0x02,0x03,0x04,1,0,0,0,
 97.1215 +                       0x7f,0x4e,0x8a,0xd2,
 97.1216 +                       4,
 97.1217 +                       255,4,255,0};
 97.1218 +
 97.1219 +
 97.1220 +/* continuing packet test */
 97.1221 +const int head1_4[] = {0x4f,0x67,0x67,0x53,0,0x02,
 97.1222 +                       0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 97.1223 +                       0x01,0x02,0x03,0x04,0,0,0,0,
 97.1224 +                       0xff,0x7b,0x23,0x17,
 97.1225 +                       1,
 97.1226 +                       0};
 97.1227 +
 97.1228 +const int head2_4[] = {0x4f,0x67,0x67,0x53,0,0x00,
 97.1229 +                       0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
 97.1230 +                       0x01,0x02,0x03,0x04,1,0,0,0,
 97.1231 +                       0xf8,0x3c,0x19,0x79,
 97.1232 +                       255,
 97.1233 +                       255,255,255,255,255,255,255,255,
 97.1234 +                       255,255,255,255,255,255,255,255,
 97.1235 +                       255,255,255,255,255,255,255,255,
 97.1236 +                       255,255,255,255,255,255,255,255,
 97.1237 +                       255,255,255,255,255,255,255,255,
 97.1238 +                       255,255,255,255,255,255,255,255,
 97.1239 +                       255,255,255,255,255,255,255,255,
 97.1240 +                       255,255,255,255,255,255,255,255,
 97.1241 +                       255,255,255,255,255,255,255,255,
 97.1242 +                       255,255,255,255,255,255,255,255,
 97.1243 +                       255,255,255,255,255,255,255,255,
 97.1244 +                       255,255,255,255,255,255,255,255,
 97.1245 +                       255,255,255,255,255,255,255,255,
 97.1246 +                       255,255,255,255,255,255,255,255,
 97.1247 +                       255,255,255,255,255,255,255,255,
 97.1248 +                       255,255,255,255,255,255,255,255,
 97.1249 +                       255,255,255,255,255,255,255,255,
 97.1250 +                       255,255,255,255,255,255,255,255,
 97.1251 +                       255,255,255,255,255,255,255,255,
 97.1252 +                       255,255,255,255,255,255,255,255,
 97.1253 +                       255,255,255,255,255,255,255,255,
 97.1254 +                       255,255,255,255,255,255,255,255,
 97.1255 +                       255,255,255,255,255,255,255,255,
 97.1256 +                       255,255,255,255,255,255,255,255,
 97.1257 +                       255,255,255,255,255,255,255,255,
 97.1258 +                       255,255,255,255,255,255,255,255,
 97.1259 +                       255,255,255,255,255,255,255,255,
 97.1260 +                       255,255,255,255,255,255,255,255,
 97.1261 +                       255,255,255,255,255,255,255,255,
 97.1262 +                       255,255,255,255,255,255,255,255,
 97.1263 +                       255,255,255,255,255,255,255,255,
 97.1264 +                       255,255,255,255,255,255,255};
 97.1265 +
 97.1266 +const int head3_4[] = {0x4f,0x67,0x67,0x53,0,0x05,
 97.1267 +                       0x07,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,
 97.1268 +                       0x01,0x02,0x03,0x04,2,0,0,0,
 97.1269 +                       0x38,0xe6,0xb6,0x28,
 97.1270 +                       6,
 97.1271 +                       255,220,255,4,255,0};
 97.1272 +
 97.1273 +
 97.1274 +/* spill expansion test */
 97.1275 +const int head1_4b[] = {0x4f,0x67,0x67,0x53,0,0x02,
 97.1276 +                        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 97.1277 +                        0x01,0x02,0x03,0x04,0,0,0,0,
 97.1278 +                        0xff,0x7b,0x23,0x17,
 97.1279 +                        1,
 97.1280 +                        0};
 97.1281 +
 97.1282 +const int head2_4b[] = {0x4f,0x67,0x67,0x53,0,0x00,
 97.1283 +                        0x07,0x10,0x00,0x00,0x00,0x00,0x00,0x00,
 97.1284 +                        0x01,0x02,0x03,0x04,1,0,0,0,
 97.1285 +                        0xce,0x8f,0x17,0x1a,
 97.1286 +                        23,
 97.1287 +                        255,255,255,255,255,255,255,255,
 97.1288 +                        255,255,255,255,255,255,255,255,255,10,255,4,255,0,0};
 97.1289 +
 97.1290 +
 97.1291 +const int head3_4b[] = {0x4f,0x67,0x67,0x53,0,0x04,
 97.1292 +                        0x07,0x14,0x00,0x00,0x00,0x00,0x00,0x00,
 97.1293 +                        0x01,0x02,0x03,0x04,2,0,0,0,
 97.1294 +                        0x9b,0xb2,0x50,0xa1,
 97.1295 +                        1,
 97.1296 +                        0};
 97.1297 +
 97.1298 +/* page with the 255 segment limit */
 97.1299 +const int head1_5[] = {0x4f,0x67,0x67,0x53,0,0x02,
 97.1300 +                       0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 97.1301 +                       0x01,0x02,0x03,0x04,0,0,0,0,
 97.1302 +                       0xff,0x7b,0x23,0x17,
 97.1303 +                       1,
 97.1304 +                       0};
 97.1305 +
 97.1306 +const int head2_5[] = {0x4f,0x67,0x67,0x53,0,0x00,
 97.1307 +                       0x07,0xfc,0x03,0x00,0x00,0x00,0x00,0x00,
 97.1308 +                       0x01,0x02,0x03,0x04,1,0,0,0,
 97.1309 +                       0xed,0x2a,0x2e,0xa7,
 97.1310 +                       255,
 97.1311 +                       10,10,10,10,10,10,10,10,
 97.1312 +                       10,10,10,10,10,10,10,10,
 97.1313 +                       10,10,10,10,10,10,10,10,
 97.1314 +                       10,10,10,10,10,10,10,10,
 97.1315 +                       10,10,10,10,10,10,10,10,
 97.1316 +                       10,10,10,10,10,10,10,10,
 97.1317 +                       10,10,10,10,10,10,10,10,
 97.1318 +                       10,10,10,10,10,10,10,10,
 97.1319 +                       10,10,10,10,10,10,10,10,
 97.1320 +                       10,10,10,10,10,10,10,10,
 97.1321 +                       10,10,10,10,10,10,10,10,
 97.1322 +                       10,10,10,10,10,10,10,10,
 97.1323 +                       10,10,10,10,10,10,10,10,
 97.1324 +                       10,10,10,10,10,10,10,10,
 97.1325 +                       10,10,10,10,10,10,10,10,
 97.1326 +                       10,10,10,10,10,10,10,10,
 97.1327 +                       10,10,10,10,10,10,10,10,
 97.1328 +                       10,10,10,10,10,10,10,10,
 97.1329 +                       10,10,10,10,10,10,10,10,
 97.1330 +                       10,10,10,10,10,10,10,10,
 97.1331 +                       10,10,10,10,10,10,10,10,
 97.1332 +                       10,10,10,10,10,10,10,10,
 97.1333 +                       10,10,10,10,10,10,10,10,
 97.1334 +                       10,10,10,10,10,10,10,10,
 97.1335 +                       10,10,10,10,10,10,10,10,
 97.1336 +                       10,10,10,10,10,10,10,10,
 97.1337 +                       10,10,10,10,10,10,10,10,
 97.1338 +                       10,10,10,10,10,10,10,10,
 97.1339 +                       10,10,10,10,10,10,10,10,
 97.1340 +                       10,10,10,10,10,10,10,10,
 97.1341 +                       10,10,10,10,10,10,10,10,
 97.1342 +                       10,10,10,10,10,10,10};
 97.1343 +
 97.1344 +const int head3_5[] = {0x4f,0x67,0x67,0x53,0,0x04,
 97.1345 +                       0x07,0x00,0x04,0x00,0x00,0x00,0x00,0x00,
 97.1346 +                       0x01,0x02,0x03,0x04,2,0,0,0,
 97.1347 +                       0x6c,0x3b,0x82,0x3d,
 97.1348 +                       1,
 97.1349 +                       50};
 97.1350 +
 97.1351 +
 97.1352 +/* packet that overspans over an entire page */
 97.1353 +const int head1_6[] = {0x4f,0x67,0x67,0x53,0,0x02,
 97.1354 +                       0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 97.1355 +                       0x01,0x02,0x03,0x04,0,0,0,0,
 97.1356 +                       0xff,0x7b,0x23,0x17,
 97.1357 +                       1,
 97.1358 +                       0};
 97.1359 +
 97.1360 +const int head2_6[] = {0x4f,0x67,0x67,0x53,0,0x00,
 97.1361 +                       0x07,0x04,0x00,0x00,0x00,0x00,0x00,0x00,
 97.1362 +                       0x01,0x02,0x03,0x04,1,0,0,0,
 97.1363 +                       0x68,0x22,0x7c,0x3d,
 97.1364 +                       255,
 97.1365 +                       100,
 97.1366 +                       255,255,255,255,255,255,255,255,
 97.1367 +                       255,255,255,255,255,255,255,255,
 97.1368 +                       255,255,255,255,255,255,255,255,
 97.1369 +                       255,255,255,255,255,255,255,255,
 97.1370 +                       255,255,255,255,255,255,255,255,
 97.1371 +                       255,255,255,255,255,255,255,255,
 97.1372 +                       255,255,255,255,255,255,255,255,
 97.1373 +                       255,255,255,255,255,255,255,255,
 97.1374 +                       255,255,255,255,255,255,255,255,
 97.1375 +                       255,255,255,255,255,255,255,255,
 97.1376 +                       255,255,255,255,255,255,255,255,
 97.1377 +                       255,255,255,255,255,255,255,255,
 97.1378 +                       255,255,255,255,255,255,255,255,
 97.1379 +                       255,255,255,255,255,255,255,255,
 97.1380 +                       255,255,255,255,255,255,255,255,
 97.1381 +                       255,255,255,255,255,255,255,255,
 97.1382 +                       255,255,255,255,255,255,255,255,
 97.1383 +                       255,255,255,255,255,255,255,255,
 97.1384 +                       255,255,255,255,255,255,255,255,
 97.1385 +                       255,255,255,255,255,255,255,255,
 97.1386 +                       255,255,255,255,255,255,255,255,
 97.1387 +                       255,255,255,255,255,255,255,255,
 97.1388 +                       255,255,255,255,255,255,255,255,
 97.1389 +                       255,255,255,255,255,255,255,255,
 97.1390 +                       255,255,255,255,255,255,255,255,
 97.1391 +                       255,255,255,255,255,255,255,255,
 97.1392 +                       255,255,255,255,255,255,255,255,
 97.1393 +                       255,255,255,255,255,255,255,255,
 97.1394 +                       255,255,255,255,255,255,255,255,
 97.1395 +                       255,255,255,255,255,255,255,255,
 97.1396 +                       255,255,255,255,255,255,255,255,
 97.1397 +                       255,255,255,255,255,255};
 97.1398 +
 97.1399 +const int head3_6[] = {0x4f,0x67,0x67,0x53,0,0x01,
 97.1400 +                       0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
 97.1401 +                       0x01,0x02,0x03,0x04,2,0,0,0,
 97.1402 +                       0xf4,0x87,0xba,0xf3,
 97.1403 +                       255,
 97.1404 +                       255,255,255,255,255,255,255,255,
 97.1405 +                       255,255,255,255,255,255,255,255,
 97.1406 +                       255,255,255,255,255,255,255,255,
 97.1407 +                       255,255,255,255,255,255,255,255,
 97.1408 +                       255,255,255,255,255,255,255,255,
 97.1409 +                       255,255,255,255,255,255,255,255,
 97.1410 +                       255,255,255,255,255,255,255,255,
 97.1411 +                       255,255,255,255,255,255,255,255,
 97.1412 +                       255,255,255,255,255,255,255,255,
 97.1413 +                       255,255,255,255,255,255,255,255,
 97.1414 +                       255,255,255,255,255,255,255,255,
 97.1415 +                       255,255,255,255,255,255,255,255,
 97.1416 +                       255,255,255,255,255,255,255,255,
 97.1417 +                       255,255,255,255,255,255,255,255,
 97.1418 +                       255,255,255,255,255,255,255,255,
 97.1419 +                       255,255,255,255,255,255,255,255,
 97.1420 +                       255,255,255,255,255,255,255,255,
 97.1421 +                       255,255,255,255,255,255,255,255,
 97.1422 +                       255,255,255,255,255,255,255,255,
 97.1423 +                       255,255,255,255,255,255,255,255,
 97.1424 +                       255,255,255,255,255,255,255,255,
 97.1425 +                       255,255,255,255,255,255,255,255,
 97.1426 +                       255,255,255,255,255,255,255,255,
 97.1427 +                       255,255,255,255,255,255,255,255,
 97.1428 +                       255,255,255,255,255,255,255,255,
 97.1429 +                       255,255,255,255,255,255,255,255,
 97.1430 +                       255,255,255,255,255,255,255,255,
 97.1431 +                       255,255,255,255,255,255,255,255,
 97.1432 +                       255,255,255,255,255,255,255,255,
 97.1433 +                       255,255,255,255,255,255,255,255,
 97.1434 +                       255,255,255,255,255,255,255,255,
 97.1435 +                       255,255,255,255,255,255,255};
 97.1436 +
 97.1437 +const int head4_6[] = {0x4f,0x67,0x67,0x53,0,0x05,
 97.1438 +                       0x07,0x10,0x00,0x00,0x00,0x00,0x00,0x00,
 97.1439 +                       0x01,0x02,0x03,0x04,3,0,0,0,
 97.1440 +                       0xf7,0x2f,0x6c,0x60,
 97.1441 +                       5,
 97.1442 +                       254,255,4,255,0};
 97.1443 +
 97.1444 +/* packet that overspans over an entire page */
 97.1445 +const int head1_7[] = {0x4f,0x67,0x67,0x53,0,0x02,
 97.1446 +                       0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 97.1447 +                       0x01,0x02,0x03,0x04,0,0,0,0,
 97.1448 +                       0xff,0x7b,0x23,0x17,
 97.1449 +                       1,
 97.1450 +                       0};
 97.1451 +
 97.1452 +const int head2_7[] = {0x4f,0x67,0x67,0x53,0,0x00,
 97.1453 +                       0x07,0x04,0x00,0x00,0x00,0x00,0x00,0x00,
 97.1454 +                       0x01,0x02,0x03,0x04,1,0,0,0,
 97.1455 +                       0x68,0x22,0x7c,0x3d,
 97.1456 +                       255,
 97.1457 +                       100,
 97.1458 +                       255,255,255,255,255,255,255,255,
 97.1459 +                       255,255,255,255,255,255,255,255,
 97.1460 +                       255,255,255,255,255,255,255,255,
 97.1461 +                       255,255,255,255,255,255,255,255,
 97.1462 +                       255,255,255,255,255,255,255,255,
 97.1463 +                       255,255,255,255,255,255,255,255,
 97.1464 +                       255,255,255,255,255,255,255,255,
 97.1465 +                       255,255,255,255,255,255,255,255,
 97.1466 +                       255,255,255,255,255,255,255,255,
 97.1467 +                       255,255,255,255,255,255,255,255,
 97.1468 +                       255,255,255,255,255,255,255,255,
 97.1469 +                       255,255,255,255,255,255,255,255,
 97.1470 +                       255,255,255,255,255,255,255,255,
 97.1471 +                       255,255,255,255,255,255,255,255,
 97.1472 +                       255,255,255,255,255,255,255,255,
 97.1473 +                       255,255,255,255,255,255,255,255,
 97.1474 +                       255,255,255,255,255,255,255,255,
 97.1475 +                       255,255,255,255,255,255,255,255,
 97.1476 +                       255,255,255,255,255,255,255,255,
 97.1477 +                       255,255,255,255,255,255,255,255,
 97.1478 +                       255,255,255,255,255,255,255,255,
 97.1479 +                       255,255,255,255,255,255,255,255,
 97.1480 +                       255,255,255,255,255,255,255,255,
 97.1481 +                       255,255,255,255,255,255,255,255,
 97.1482 +                       255,255,255,255,255,255,255,255,
 97.1483 +                       255,255,255,255,255,255,255,255,
 97.1484 +                       255,255,255,255,255,255,255,255,
 97.1485 +                       255,255,255,255,255,255,255,255,
 97.1486 +                       255,255,255,255,255,255,255,255,
 97.1487 +                       255,255,255,255,255,255,255,255,
 97.1488 +                       255,255,255,255,255,255,255,255,
 97.1489 +                       255,255,255,255,255,255};
 97.1490 +
 97.1491 +const int head3_7[] = {0x4f,0x67,0x67,0x53,0,0x05,
 97.1492 +                       0x07,0x08,0x00,0x00,0x00,0x00,0x00,0x00,
 97.1493 +                       0x01,0x02,0x03,0x04,2,0,0,0,
 97.1494 +                       0xd4,0xe0,0x60,0xe5,
 97.1495 +                       1,
 97.1496 +                       0};
 97.1497 +
 97.1498 +void test_pack(const int *pl, const int **headers, int byteskip,
 97.1499 +               int pageskip, int packetskip){
 97.1500 +  unsigned char *data=_ogg_malloc(1024*1024); /* for scripted test cases only */
 97.1501 +  long inptr=0;
 97.1502 +  long outptr=0;
 97.1503 +  long deptr=0;
 97.1504 +  long depacket=0;
 97.1505 +  long granule_pos=7,pageno=0;
 97.1506 +  int i,j,packets,pageout=pageskip;
 97.1507 +  int eosflag=0;
 97.1508 +  int bosflag=0;
 97.1509 +
 97.1510 +  int byteskipcount=0;
 97.1511 +
 97.1512 +  ogg_stream_reset(&os_en);
 97.1513 +  ogg_stream_reset(&os_de);
 97.1514 +  ogg_sync_reset(&oy);
 97.1515 +
 97.1516 +  for(packets=0;packets<packetskip;packets++)
 97.1517 +    depacket+=pl[packets];
 97.1518 +
 97.1519 +  for(packets=0;;packets++)if(pl[packets]==-1)break;
 97.1520 +
 97.1521 +  for(i=0;i<packets;i++){
 97.1522 +    /* construct a test packet */
 97.1523 +    ogg_packet op;
 97.1524 +    int len=pl[i];
 97.1525 +
 97.1526 +    op.packet=data+inptr;
 97.1527 +    op.bytes=len;
 97.1528 +    op.e_o_s=(pl[i+1]<0?1:0);
 97.1529 +    op.granulepos=granule_pos;
 97.1530 +
 97.1531 +    granule_pos+=1024;
 97.1532 +
 97.1533 +    for(j=0;j<len;j++)data[inptr++]=i+j;
 97.1534 +
 97.1535 +    /* submit the test packet */
 97.1536 +    ogg_stream_packetin(&os_en,&op);
 97.1537 +
 97.1538 +    /* retrieve any finished pages */
 97.1539 +    {
 97.1540 +      ogg_page og;
 97.1541 +
 97.1542 +      while(ogg_stream_pageout(&os_en,&og)){
 97.1543 +        /* We have a page.  Check it carefully */
 97.1544 +
 97.1545 +        fprintf(stderr,"%ld, ",pageno);
 97.1546 +
 97.1547 +        if(headers[pageno]==NULL){
 97.1548 +          fprintf(stderr,"coded too many pages!\n");
 97.1549 +          exit(1);
 97.1550 +        }
 97.1551 +
 97.1552 +        check_page(data+outptr,headers[pageno],&og);
 97.1553 +
 97.1554 +        outptr+=og.body_len;
 97.1555 +        pageno++;
 97.1556 +        if(pageskip){
 97.1557 +          bosflag=1;
 97.1558 +          pageskip--;
 97.1559 +          deptr+=og.body_len;
 97.1560 +        }
 97.1561 +
 97.1562 +        /* have a complete page; submit it to sync/decode */
 97.1563 +
 97.1564 +        {
 97.1565 +          ogg_page og_de;
 97.1566 +          ogg_packet op_de,op_de2;
 97.1567 +          char *buf=ogg_sync_buffer(&oy,og.header_len+og.body_len);
 97.1568 +          char *next=buf;
 97.1569 +          byteskipcount+=og.header_len;
 97.1570 +          if(byteskipcount>byteskip){
 97.1571 +            memcpy(next,og.header,byteskipcount-byteskip);
 97.1572 +            next+=byteskipcount-byteskip;
 97.1573 +            byteskipcount=byteskip;
 97.1574 +          }
 97.1575 +
 97.1576 +          byteskipcount+=og.body_len;
 97.1577 +          if(byteskipcount>byteskip){
 97.1578 +            memcpy(next,og.body,byteskipcount-byteskip);
 97.1579 +            next+=byteskipcount-byteskip;
 97.1580 +            byteskipcount=byteskip;
 97.1581 +          }
 97.1582 +
 97.1583 +          ogg_sync_wrote(&oy,next-buf);
 97.1584 +
 97.1585 +          while(1){
 97.1586 +            int ret=ogg_sync_pageout(&oy,&og_de);
 97.1587 +            if(ret==0)break;
 97.1588 +            if(ret<0)continue;
 97.1589 +            /* got a page.  Happy happy.  Verify that it's good. */
 97.1590 +
 97.1591 +            fprintf(stderr,"(%d), ",pageout);
 97.1592 +
 97.1593 +            check_page(data+deptr,headers[pageout],&og_de);
 97.1594 +            deptr+=og_de.body_len;
 97.1595 +            pageout++;
 97.1596 +
 97.1597 +            /* submit it to deconstitution */
 97.1598 +            ogg_stream_pagein(&os_de,&og_de);
 97.1599 +
 97.1600 +            /* packets out? */
 97.1601 +            while(ogg_stream_packetpeek(&os_de,&op_de2)>0){
 97.1602 +              ogg_stream_packetpeek(&os_de,NULL);
 97.1603 +              ogg_stream_packetout(&os_de,&op_de); /* just catching them all */
 97.1604 +
 97.1605 +              /* verify peek and out match */
 97.1606 +              if(memcmp(&op_de,&op_de2,sizeof(op_de))){
 97.1607 +                fprintf(stderr,"packetout != packetpeek! pos=%ld\n",
 97.1608 +                        depacket);
 97.1609 +                exit(1);
 97.1610 +              }
 97.1611 +
 97.1612 +              /* verify the packet! */
 97.1613 +              /* check data */
 97.1614 +              if(memcmp(data+depacket,op_de.packet,op_de.bytes)){
 97.1615 +                fprintf(stderr,"packet data mismatch in decode! pos=%ld\n",
 97.1616 +                        depacket);
 97.1617 +                exit(1);
 97.1618 +              }
 97.1619 +              /* check bos flag */
 97.1620 +              if(bosflag==0 && op_de.b_o_s==0){
 97.1621 +                fprintf(stderr,"b_o_s flag not set on packet!\n");
 97.1622 +                exit(1);
 97.1623 +              }
 97.1624 +              if(bosflag && op_de.b_o_s){
 97.1625 +                fprintf(stderr,"b_o_s flag incorrectly set on packet!\n");
 97.1626 +                exit(1);
 97.1627 +              }
 97.1628 +              bosflag=1;
 97.1629 +              depacket+=op_de.bytes;
 97.1630 +
 97.1631 +              /* check eos flag */
 97.1632 +              if(eosflag){
 97.1633 +                fprintf(stderr,"Multiple decoded packets with eos flag!\n");
 97.1634 +                exit(1);
 97.1635 +              }
 97.1636 +
 97.1637 +              if(op_de.e_o_s)eosflag=1;
 97.1638 +
 97.1639 +              /* check granulepos flag */
 97.1640 +              if(op_de.granulepos!=-1){
 97.1641 +                fprintf(stderr," granule:%ld ",(long)op_de.granulepos);
 97.1642 +              }
 97.1643 +            }
 97.1644 +          }
 97.1645 +        }
 97.1646 +      }
 97.1647 +    }
 97.1648 +  }
 97.1649 +  _ogg_free(data);
 97.1650 +  if(headers[pageno]!=NULL){
 97.1651 +    fprintf(stderr,"did not write last page!\n");
 97.1652 +    exit(1);
 97.1653 +  }
 97.1654 +  if(headers[pageout]!=NULL){
 97.1655 +    fprintf(stderr,"did not decode last page!\n");
 97.1656 +    exit(1);
 97.1657 +  }
 97.1658 +  if(inptr!=outptr){
 97.1659 +    fprintf(stderr,"encoded page data incomplete!\n");
 97.1660 +    exit(1);
 97.1661 +  }
 97.1662 +  if(inptr!=deptr){
 97.1663 +    fprintf(stderr,"decoded page data incomplete!\n");
 97.1664 +    exit(1);
 97.1665 +  }
 97.1666 +  if(inptr!=depacket){
 97.1667 +    fprintf(stderr,"decoded packet data incomplete!\n");
 97.1668 +    exit(1);
 97.1669 +  }
 97.1670 +  if(!eosflag){
 97.1671 +    fprintf(stderr,"Never got a packet with EOS set!\n");
 97.1672 +    exit(1);
 97.1673 +  }
 97.1674 +  fprintf(stderr,"ok.\n");
 97.1675 +}
 97.1676 +
 97.1677 +int main(void){
 97.1678 +
 97.1679 +  ogg_stream_init(&os_en,0x04030201);
 97.1680 +  ogg_stream_init(&os_de,0x04030201);
 97.1681 +  ogg_sync_init(&oy);
 97.1682 +
 97.1683 +  /* Exercise each code path in the framing code.  Also verify that
 97.1684 +     the checksums are working.  */
 97.1685 +
 97.1686 +  {
 97.1687 +    /* 17 only */
 97.1688 +    const int packets[]={17, -1};
 97.1689 +    const int *headret[]={head1_0,NULL};
 97.1690 +
 97.1691 +    fprintf(stderr,"testing single page encoding... ");
 97.1692 +    test_pack(packets,headret,0,0,0);
 97.1693 +  }
 97.1694 +
 97.1695 +  {
 97.1696 +    /* 17, 254, 255, 256, 500, 510, 600 byte, pad */
 97.1697 +    const int packets[]={17, 254, 255, 256, 500, 510, 600, -1};
 97.1698 +    const int *headret[]={head1_1,head2_1,NULL};
 97.1699 +
 97.1700 +    fprintf(stderr,"testing basic page encoding... ");
 97.1701 +    test_pack(packets,headret,0,0,0);
 97.1702 +  }
 97.1703 +
 97.1704 +  {
 97.1705 +    /* nil packets; beginning,middle,end */
 97.1706 +    const int packets[]={0,17, 254, 255, 0, 256, 0, 500, 510, 600, 0, -1};
 97.1707 +    const int *headret[]={head1_2,head2_2,NULL};
 97.1708 +
 97.1709 +    fprintf(stderr,"testing basic nil packets... ");
 97.1710 +    test_pack(packets,headret,0,0,0);
 97.1711 +  }
 97.1712 +
 97.1713 +  {
 97.1714 +    /* large initial packet */
 97.1715 +    const int packets[]={4345,259,255,-1};
 97.1716 +    const int *headret[]={head1_3,head2_3,NULL};
 97.1717 +
 97.1718 +    fprintf(stderr,"testing initial-packet lacing > 4k... ");
 97.1719 +    test_pack(packets,headret,0,0,0);
 97.1720 +  }
 97.1721 +
 97.1722 +  {
 97.1723 +    /* continuing packet test; with page spill expansion, we have to
 97.1724 +       overflow the lacing table. */
 97.1725 +    const int packets[]={0,65500,259,255,-1};
 97.1726 +    const int *headret[]={head1_4,head2_4,head3_4,NULL};
 97.1727 +
 97.1728 +    fprintf(stderr,"testing single packet page span... ");
 97.1729 +    test_pack(packets,headret,0,0,0);
 97.1730 +  }
 97.1731 +
 97.1732 +  {
 97.1733 +    /* spill expand packet test */
 97.1734 +    const int packets[]={0,4345,259,255,0,0,-1};
 97.1735 +    const int *headret[]={head1_4b,head2_4b,head3_4b,NULL};
 97.1736 +
 97.1737 +    fprintf(stderr,"testing page spill expansion... ");
 97.1738 +    test_pack(packets,headret,0,0,0);
 97.1739 +  }
 97.1740 +
 97.1741 +  /* page with the 255 segment limit */
 97.1742 +  {
 97.1743 +
 97.1744 +    const int packets[]={0,10,10,10,10,10,10,10,10,
 97.1745 +                   10,10,10,10,10,10,10,10,
 97.1746 +                   10,10,10,10,10,10,10,10,
 97.1747 +                   10,10,10,10,10,10,10,10,
 97.1748 +                   10,10,10,10,10,10,10,10,
 97.1749 +                   10,10,10,10,10,10,10,10,
 97.1750 +                   10,10,10,10,10,10,10,10,
 97.1751 +                   10,10,10,10,10,10,10,10,
 97.1752 +                   10,10,10,10,10,10,10,10,
 97.1753 +                   10,10,10,10,10,10,10,10,
 97.1754 +                   10,10,10,10,10,10,10,10,
 97.1755 +                   10,10,10,10,10,10,10,10,
 97.1756 +                   10,10,10,10,10,10,10,10,
 97.1757 +                   10,10,10,10,10,10,10,10,
 97.1758 +                   10,10,10,10,10,10,10,10,
 97.1759 +                   10,10,10,10,10,10,10,10,
 97.1760 +                   10,10,10,10,10,10,10,10,
 97.1761 +                   10,10,10,10,10,10,10,10,
 97.1762 +                   10,10,10,10,10,10,10,10,
 97.1763 +                   10,10,10,10,10,10,10,10,
 97.1764 +                   10,10,10,10,10,10,10,10,
 97.1765 +                   10,10,10,10,10,10,10,10,
 97.1766 +                   10,10,10,10,10,10,10,10,
 97.1767 +                   10,10,10,10,10,10,10,10,
 97.1768 +                   10,10,10,10,10,10,10,10,
 97.1769 +                   10,10,10,10,10,10,10,10,
 97.1770 +                   10,10,10,10,10,10,10,10,
 97.1771 +                   10,10,10,10,10,10,10,10,
 97.1772 +                   10,10,10,10,10,10,10,10,
 97.1773 +                   10,10,10,10,10,10,10,10,
 97.1774 +                   10,10,10,10,10,10,10,10,
 97.1775 +                   10,10,10,10,10,10,10,50,-1};
 97.1776 +    const int *headret[]={head1_5,head2_5,head3_5,NULL};
 97.1777 +
 97.1778 +    fprintf(stderr,"testing max packet segments... ");
 97.1779 +    test_pack(packets,headret,0,0,0);
 97.1780 +  }
 97.1781 +
 97.1782 +  {
 97.1783 +    /* packet that overspans over an entire page */
 97.1784 +    const int packets[]={0,100,130049,259,255,-1};
 97.1785 +    const int *headret[]={head1_6,head2_6,head3_6,head4_6,NULL};
 97.1786 +
 97.1787 +    fprintf(stderr,"testing very large packets... ");
 97.1788 +    test_pack(packets,headret,0,0,0);
 97.1789 +  }
 97.1790 +
 97.1791 +  {
 97.1792 +    /* test for the libogg 1.1.1 resync in large continuation bug
 97.1793 +       found by Josh Coalson)  */
 97.1794 +    const int packets[]={0,100,130049,259,255,-1};
 97.1795 +    const int *headret[]={head1_6,head2_6,head3_6,head4_6,NULL};
 97.1796 +
 97.1797 +    fprintf(stderr,"testing continuation resync in very large packets... ");
 97.1798 +    test_pack(packets,headret,100,2,3);
 97.1799 +  }
 97.1800 +
 97.1801 +  {
 97.1802 +    /* term only page.  why not? */
 97.1803 +    const int packets[]={0,100,64770,-1};
 97.1804 +    const int *headret[]={head1_7,head2_7,head3_7,NULL};
 97.1805 +
 97.1806 +    fprintf(stderr,"testing zero data page (1 nil packet)... ");
 97.1807 +    test_pack(packets,headret,0,0,0);
 97.1808 +  }
 97.1809 +
 97.1810 +
 97.1811 +
 97.1812 +  {
 97.1813 +    /* build a bunch of pages for testing */
 97.1814 +    unsigned char *data=_ogg_malloc(1024*1024);
 97.1815 +    int pl[]={0, 1,1,98,4079, 1,1,2954,2057, 76,34,912,0,234,1000,1000, 1000,300,-1};
 97.1816 +    int inptr=0,i,j;
 97.1817 +    ogg_page og[5];
 97.1818 +
 97.1819 +    ogg_stream_reset(&os_en);
 97.1820 +
 97.1821 +    for(i=0;pl[i]!=-1;i++){
 97.1822 +      ogg_packet op;
 97.1823 +      int len=pl[i];
 97.1824 +
 97.1825 +      op.packet=data+inptr;
 97.1826 +      op.bytes=len;
 97.1827 +      op.e_o_s=(pl[i+1]<0?1:0);
 97.1828 +      op.granulepos=(i+1)*1000;
 97.1829 +
 97.1830 +      for(j=0;j<len;j++)data[inptr++]=i+j;
 97.1831 +      ogg_stream_packetin(&os_en,&op);
 97.1832 +    }
 97.1833 +
 97.1834 +    _ogg_free(data);
 97.1835 +
 97.1836 +    /* retrieve finished pages */
 97.1837 +    for(i=0;i<5;i++){
 97.1838 +      if(ogg_stream_pageout(&os_en,&og[i])==0){
 97.1839 +        fprintf(stderr,"Too few pages output building sync tests!\n");
 97.1840 +        exit(1);
 97.1841 +      }
 97.1842 +      copy_page(&og[i]);
 97.1843 +    }
 97.1844 +
 97.1845 +    /* Test lost pages on pagein/packetout: no rollback */
 97.1846 +    {
 97.1847 +      ogg_page temp;
 97.1848 +      ogg_packet test;
 97.1849 +
 97.1850 +      fprintf(stderr,"Testing loss of pages... ");
 97.1851 +
 97.1852 +      ogg_sync_reset(&oy);
 97.1853 +      ogg_stream_reset(&os_de);
 97.1854 +      for(i=0;i<5;i++){
 97.1855 +        memcpy(ogg_sync_buffer(&oy,og[i].header_len),og[i].header,
 97.1856 +               og[i].header_len);
 97.1857 +        ogg_sync_wrote(&oy,og[i].header_len);
 97.1858 +        memcpy(ogg_sync_buffer(&oy,og[i].body_len),og[i].body,og[i].body_len);
 97.1859 +        ogg_sync_wrote(&oy,og[i].body_len);
 97.1860 +      }
 97.1861 +
 97.1862 +      ogg_sync_pageout(&oy,&temp);
 97.1863 +      ogg_stream_pagein(&os_de,&temp);
 97.1864 +      ogg_sync_pageout(&oy,&temp);
 97.1865 +      ogg_stream_pagein(&os_de,&temp);
 97.1866 +      ogg_sync_pageout(&oy,&temp);
 97.1867 +      /* skip */
 97.1868 +      ogg_sync_pageout(&oy,&temp);
 97.1869 +      ogg_stream_pagein(&os_de,&temp);
 97.1870 +
 97.1871 +      /* do we get the expected results/packets? */
 97.1872 +
 97.1873 +      if(ogg_stream_packetout(&os_de,&test)!=1)error();
 97.1874 +      checkpacket(&test,0,0,0);
 97.1875 +      if(ogg_stream_packetout(&os_de,&test)!=1)error();
 97.1876 +      checkpacket(&test,1,1,-1);
 97.1877 +      if(ogg_stream_packetout(&os_de,&test)!=1)error();
 97.1878 +      checkpacket(&test,1,2,-1);
 97.1879 +      if(ogg_stream_packetout(&os_de,&test)!=1)error();
 97.1880 +      checkpacket(&test,98,3,-1);
 97.1881 +      if(ogg_stream_packetout(&os_de,&test)!=1)error();
 97.1882 +      checkpacket(&test,4079,4,5000);
 97.1883 +      if(ogg_stream_packetout(&os_de,&test)!=-1){
 97.1884 +        fprintf(stderr,"Error: loss of page did not return error\n");
 97.1885 +        exit(1);
 97.1886 +      }
 97.1887 +      if(ogg_stream_packetout(&os_de,&test)!=1)error();
 97.1888 +      checkpacket(&test,76,9,-1);
 97.1889 +      if(ogg_stream_packetout(&os_de,&test)!=1)error();
 97.1890 +      checkpacket(&test,34,10,-1);
 97.1891 +      fprintf(stderr,"ok.\n");
 97.1892 +    }
 97.1893 +
 97.1894 +    /* Test lost pages on pagein/packetout: rollback with continuation */
 97.1895 +    {
 97.1896 +      ogg_page temp;
 97.1897 +      ogg_packet test;
 97.1898 +
 97.1899 +      fprintf(stderr,"Testing loss of pages (rollback required)... ");
 97.1900 +
 97.1901 +      ogg_sync_reset(&oy);
 97.1902 +      ogg_stream_reset(&os_de);
 97.1903 +      for(i=0;i<5;i++){
 97.1904 +        memcpy(ogg_sync_buffer(&oy,og[i].header_len),og[i].header,
 97.1905 +               og[i].header_len);
 97.1906 +        ogg_sync_wrote(&oy,og[i].header_len);
 97.1907 +        memcpy(ogg_sync_buffer(&oy,og[i].body_len),og[i].body,og[i].body_len);
 97.1908 +        ogg_sync_wrote(&oy,og[i].body_len);
 97.1909 +      }
 97.1910 +
 97.1911 +      ogg_sync_pageout(&oy,&temp);
 97.1912 +      ogg_stream_pagein(&os_de,&temp);
 97.1913 +      ogg_sync_pageout(&oy,&temp);
 97.1914 +      ogg_stream_pagein(&os_de,&temp);
 97.1915 +      ogg_sync_pageout(&oy,&temp);
 97.1916 +      ogg_stream_pagein(&os_de,&temp);
 97.1917 +      ogg_sync_pageout(&oy,&temp);
 97.1918 +      /* skip */
 97.1919 +      ogg_sync_pageout(&oy,&temp);
 97.1920 +      ogg_stream_pagein(&os_de,&temp);
 97.1921 +
 97.1922 +      /* do we get the expected results/packets? */
 97.1923 +
 97.1924 +      if(ogg_stream_packetout(&os_de,&test)!=1)error();
 97.1925 +      checkpacket(&test,0,0,0);
 97.1926 +      if(ogg_stream_packetout(&os_de,&test)!=1)error();
 97.1927 +      checkpacket(&test,1,1,-1);
 97.1928 +      if(ogg_stream_packetout(&os_de,&test)!=1)error();
 97.1929 +      checkpacket(&test,1,2,-1);
 97.1930 +      if(ogg_stream_packetout(&os_de,&test)!=1)error();
 97.1931 +      checkpacket(&test,98,3,-1);
 97.1932 +      if(ogg_stream_packetout(&os_de,&test)!=1)error();
 97.1933 +      checkpacket(&test,4079,4,5000);
 97.1934 +      if(ogg_stream_packetout(&os_de,&test)!=1)error();
 97.1935 +      checkpacket(&test,1,5,-1);
 97.1936 +      if(ogg_stream_packetout(&os_de,&test)!=1)error();
 97.1937 +      checkpacket(&test,1,6,-1);
 97.1938 +      if(ogg_stream_packetout(&os_de,&test)!=1)error();
 97.1939 +      checkpacket(&test,2954,7,-1);
 97.1940 +      if(ogg_stream_packetout(&os_de,&test)!=1)error();
 97.1941 +      checkpacket(&test,2057,8,9000);
 97.1942 +      if(ogg_stream_packetout(&os_de,&test)!=-1){
 97.1943 +        fprintf(stderr,"Error: loss of page did not return error\n");
 97.1944 +        exit(1);
 97.1945 +      }
 97.1946 +      if(ogg_stream_packetout(&os_de,&test)!=1)error();
 97.1947 +      checkpacket(&test,300,17,18000);
 97.1948 +      fprintf(stderr,"ok.\n");
 97.1949 +    }
 97.1950 +
 97.1951 +    /* the rest only test sync */
 97.1952 +    {
 97.1953 +      ogg_page og_de;
 97.1954 +      /* Test fractional page inputs: incomplete capture */
 97.1955 +      fprintf(stderr,"Testing sync on partial inputs... ");
 97.1956 +      ogg_sync_reset(&oy);
 97.1957 +      memcpy(ogg_sync_buffer(&oy,og[1].header_len),og[1].header,
 97.1958 +             3);
 97.1959 +      ogg_sync_wrote(&oy,3);
 97.1960 +      if(ogg_sync_pageout(&oy,&og_de)>0)error();
 97.1961 +
 97.1962 +      /* Test fractional page inputs: incomplete fixed header */
 97.1963 +      memcpy(ogg_sync_buffer(&oy,og[1].header_len),og[1].header+3,
 97.1964 +             20);
 97.1965 +      ogg_sync_wrote(&oy,20);
 97.1966 +      if(ogg_sync_pageout(&oy,&og_de)>0)error();
 97.1967 +
 97.1968 +      /* Test fractional page inputs: incomplete header */
 97.1969 +      memcpy(ogg_sync_buffer(&oy,og[1].header_len),og[1].header+23,
 97.1970 +             5);
 97.1971 +      ogg_sync_wrote(&oy,5);
 97.1972 +      if(ogg_sync_pageout(&oy,&og_de)>0)error();
 97.1973 +
 97.1974 +      /* Test fractional page inputs: incomplete body */
 97.1975 +
 97.1976 +      memcpy(ogg_sync_buffer(&oy,og[1].header_len),og[1].header+28,
 97.1977 +             og[1].header_len-28);
 97.1978 +      ogg_sync_wrote(&oy,og[1].header_len-28);
 97.1979 +      if(ogg_sync_pageout(&oy,&og_de)>0)error();
 97.1980 +
 97.1981 +      memcpy(ogg_sync_buffer(&oy,og[1].body_len),og[1].body,1000);
 97.1982 +      ogg_sync_wrote(&oy,1000);
 97.1983 +      if(ogg_sync_pageout(&oy,&og_de)>0)error();
 97.1984 +
 97.1985 +      memcpy(ogg_sync_buffer(&oy,og[1].body_len),og[1].body+1000,
 97.1986 +             og[1].body_len-1000);
 97.1987 +      ogg_sync_wrote(&oy,og[1].body_len-1000);
 97.1988 +      if(ogg_sync_pageout(&oy,&og_de)<=0)error();
 97.1989 +
 97.1990 +      fprintf(stderr,"ok.\n");
 97.1991 +    }
 97.1992 +
 97.1993 +    /* Test fractional page inputs: page + incomplete capture */
 97.1994 +    {
 97.1995 +      ogg_page og_de;
 97.1996 +      fprintf(stderr,"Testing sync on 1+partial inputs... ");
 97.1997 +      ogg_sync_reset(&oy);
 97.1998 +
 97.1999 +      memcpy(ogg_sync_buffer(&oy,og[1].header_len),og[1].header,
 97.2000 +             og[1].header_len);
 97.2001 +      ogg_sync_wrote(&oy,og[1].header_len);
 97.2002 +
 97.2003 +      memcpy(ogg_sync_buffer(&oy,og[1].body_len),og[1].body,
 97.2004 +             og[1].body_len);
 97.2005 +      ogg_sync_wrote(&oy,og[1].body_len);
 97.2006 +
 97.2007 +      memcpy(ogg_sync_buffer(&oy,og[1].header_len),og[1].header,
 97.2008 +             20);
 97.2009 +      ogg_sync_wrote(&oy,20);
 97.2010 +      if(ogg_sync_pageout(&oy,&og_de)<=0)error();
 97.2011 +      if(ogg_sync_pageout(&oy,&og_de)>0)error();
 97.2012 +
 97.2013 +      memcpy(ogg_sync_buffer(&oy,og[1].header_len),og[1].header+20,
 97.2014 +             og[1].header_len-20);
 97.2015 +      ogg_sync_wrote(&oy,og[1].header_len-20);
 97.2016 +      memcpy(ogg_sync_buffer(&oy,og[1].body_len),og[1].body,
 97.2017 +             og[1].body_len);
 97.2018 +      ogg_sync_wrote(&oy,og[1].body_len);
 97.2019 +      if(ogg_sync_pageout(&oy,&og_de)<=0)error();
 97.2020 +
 97.2021 +      fprintf(stderr,"ok.\n");
 97.2022 +    }
 97.2023 +
 97.2024 +    /* Test recapture: garbage + page */
 97.2025 +    {
 97.2026 +      ogg_page og_de;
 97.2027 +      fprintf(stderr,"Testing search for capture... ");
 97.2028 +      ogg_sync_reset(&oy);
 97.2029 +
 97.2030 +      /* 'garbage' */
 97.2031 +      memcpy(ogg_sync_buffer(&oy,og[1].body_len),og[1].body,
 97.2032 +             og[1].body_len);
 97.2033 +      ogg_sync_wrote(&oy,og[1].body_len);
 97.2034 +
 97.2035 +      memcpy(ogg_sync_buffer(&oy,og[1].header_len),og[1].header,
 97.2036 +             og[1].header_len);
 97.2037 +      ogg_sync_wrote(&oy,og[1].header_len);
 97.2038 +
 97.2039 +      memcpy(ogg_sync_buffer(&oy,og[1].body_len),og[1].body,
 97.2040 +             og[1].body_len);
 97.2041 +      ogg_sync_wrote(&oy,og[1].body_len);
 97.2042 +
 97.2043 +      memcpy(ogg_sync_buffer(&oy,og[2].header_len),og[2].header,
 97.2044 +             20);
 97.2045 +      ogg_sync_wrote(&oy,20);
 97.2046 +      if(ogg_sync_pageout(&oy,&og_de)>0)error();
 97.2047 +      if(ogg_sync_pageout(&oy,&og_de)<=0)error();
 97.2048 +      if(ogg_sync_pageout(&oy,&og_de)>0)error();
 97.2049 +
 97.2050 +      memcpy(ogg_sync_buffer(&oy,og[2].header_len),og[2].header+20,
 97.2051 +             og[2].header_len-20);
 97.2052 +      ogg_sync_wrote(&oy,og[2].header_len-20);
 97.2053 +      memcpy(ogg_sync_buffer(&oy,og[2].body_len),og[2].body,
 97.2054 +             og[2].body_len);
 97.2055 +      ogg_sync_wrote(&oy,og[2].body_len);
 97.2056 +      if(ogg_sync_pageout(&oy,&og_de)<=0)error();
 97.2057 +
 97.2058 +      fprintf(stderr,"ok.\n");
 97.2059 +    }
 97.2060 +
 97.2061 +    /* Test recapture: page + garbage + page */
 97.2062 +    {
 97.2063 +      ogg_page og_de;
 97.2064 +      fprintf(stderr,"Testing recapture... ");
 97.2065 +      ogg_sync_reset(&oy);
 97.2066 +
 97.2067 +      memcpy(ogg_sync_buffer(&oy,og[1].header_len),og[1].header,
 97.2068 +             og[1].header_len);
 97.2069 +      ogg_sync_wrote(&oy,og[1].header_len);
 97.2070 +
 97.2071 +      memcpy(ogg_sync_buffer(&oy,og[1].body_len),og[1].body,
 97.2072 +             og[1].body_len);
 97.2073 +      ogg_sync_wrote(&oy,og[1].body_len);
 97.2074 +
 97.2075 +      memcpy(ogg_sync_buffer(&oy,og[2].header_len),og[2].header,
 97.2076 +             og[2].header_len);
 97.2077 +      ogg_sync_wrote(&oy,og[2].header_len);
 97.2078 +
 97.2079 +      memcpy(ogg_sync_buffer(&oy,og[2].header_len),og[2].header,
 97.2080 +             og[2].header_len);
 97.2081 +      ogg_sync_wrote(&oy,og[2].header_len);
 97.2082 +
 97.2083 +      if(ogg_sync_pageout(&oy,&og_de)<=0)error();
 97.2084 +
 97.2085 +      memcpy(ogg_sync_buffer(&oy,og[2].body_len),og[2].body,
 97.2086 +             og[2].body_len-5);
 97.2087 +      ogg_sync_wrote(&oy,og[2].body_len-5);
 97.2088 +
 97.2089 +      memcpy(ogg_sync_buffer(&oy,og[3].header_len),og[3].header,
 97.2090 +             og[3].header_len);
 97.2091 +      ogg_sync_wrote(&oy,og[3].header_len);
 97.2092 +
 97.2093 +      memcpy(ogg_sync_buffer(&oy,og[3].body_len),og[3].body,
 97.2094 +             og[3].body_len);
 97.2095 +      ogg_sync_wrote(&oy,og[3].body_len);
 97.2096 +
 97.2097 +      if(ogg_sync_pageout(&oy,&og_de)>0)error();
 97.2098 +      if(ogg_sync_pageout(&oy,&og_de)<=0)error();
 97.2099 +
 97.2100 +      fprintf(stderr,"ok.\n");
 97.2101 +    }
 97.2102 +
 97.2103 +    /* Free page data that was previously copied */
 97.2104 +    {
 97.2105 +      for(i=0;i<5;i++){
 97.2106 +        free_page(&og[i]);
 97.2107 +      }
 97.2108 +    }
 97.2109 +  }
 97.2110 +
 97.2111 +  return(0);
 97.2112 +}
 97.2113 +
 97.2114 +#endif
    98.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    98.2 +++ b/libs/ogg/ogg.h	Sun Nov 01 00:36:56 2015 +0200
    98.3 @@ -0,0 +1,210 @@
    98.4 +/********************************************************************
    98.5 + *                                                                  *
    98.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
    98.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
    98.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
    98.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
   98.10 + *                                                                  *
   98.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007             *
   98.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
   98.13 + *                                                                  *
   98.14 + ********************************************************************
   98.15 +
   98.16 + function: toplevel libogg include
   98.17 + last mod: $Id: ogg.h 18044 2011-08-01 17:55:20Z gmaxwell $
   98.18 +
   98.19 + ********************************************************************/
   98.20 +#ifndef _OGG_H
   98.21 +#define _OGG_H
   98.22 +
   98.23 +#ifdef __cplusplus
   98.24 +extern "C" {
   98.25 +#endif
   98.26 +
   98.27 +#include <stddef.h>
   98.28 +#include <ogg/os_types.h>
   98.29 +
   98.30 +typedef struct {
   98.31 +  void *iov_base;
   98.32 +  size_t iov_len;
   98.33 +} ogg_iovec_t;
   98.34 +
   98.35 +typedef struct {
   98.36 +  long endbyte;
   98.37 +  int  endbit;
   98.38 +
   98.39 +  unsigned char *buffer;
   98.40 +  unsigned char *ptr;
   98.41 +  long storage;
   98.42 +} oggpack_buffer;
   98.43 +
   98.44 +/* ogg_page is used to encapsulate the data in one Ogg bitstream page *****/
   98.45 +
   98.46 +typedef struct {
   98.47 +  unsigned char *header;
   98.48 +  long header_len;
   98.49 +  unsigned char *body;
   98.50 +  long body_len;
   98.51 +} ogg_page;
   98.52 +
   98.53 +/* ogg_stream_state contains the current encode/decode state of a logical
   98.54 +   Ogg bitstream **********************************************************/
   98.55 +
   98.56 +typedef struct {
   98.57 +  unsigned char   *body_data;    /* bytes from packet bodies */
   98.58 +  long    body_storage;          /* storage elements allocated */
   98.59 +  long    body_fill;             /* elements stored; fill mark */
   98.60 +  long    body_returned;         /* elements of fill returned */
   98.61 +
   98.62 +
   98.63 +  int     *lacing_vals;      /* The values that will go to the segment table */
   98.64 +  ogg_int64_t *granule_vals; /* granulepos values for headers. Not compact
   98.65 +                                this way, but it is simple coupled to the
   98.66 +                                lacing fifo */
   98.67 +  long    lacing_storage;
   98.68 +  long    lacing_fill;
   98.69 +  long    lacing_packet;
   98.70 +  long    lacing_returned;
   98.71 +
   98.72 +  unsigned char    header[282];      /* working space for header encode */
   98.73 +  int              header_fill;
   98.74 +
   98.75 +  int     e_o_s;          /* set when we have buffered the last packet in the
   98.76 +                             logical bitstream */
   98.77 +  int     b_o_s;          /* set after we've written the initial page
   98.78 +                             of a logical bitstream */
   98.79 +  long    serialno;
   98.80 +  long    pageno;
   98.81 +  ogg_int64_t  packetno;  /* sequence number for decode; the framing
   98.82 +                             knows where there's a hole in the data,
   98.83 +                             but we need coupling so that the codec
   98.84 +                             (which is in a separate abstraction
   98.85 +                             layer) also knows about the gap */
   98.86 +  ogg_int64_t   granulepos;
   98.87 +
   98.88 +} ogg_stream_state;
   98.89 +
   98.90 +/* ogg_packet is used to encapsulate the data and metadata belonging
   98.91 +   to a single raw Ogg/Vorbis packet *************************************/
   98.92 +
   98.93 +typedef struct {
   98.94 +  unsigned char *packet;
   98.95 +  long  bytes;
   98.96 +  long  b_o_s;
   98.97 +  long  e_o_s;
   98.98 +
   98.99 +  ogg_int64_t  granulepos;
  98.100 +
  98.101 +  ogg_int64_t  packetno;     /* sequence number for decode; the framing
  98.102 +                                knows where there's a hole in the data,
  98.103 +                                but we need coupling so that the codec
  98.104 +                                (which is in a separate abstraction
  98.105 +                                layer) also knows about the gap */
  98.106 +} ogg_packet;
  98.107 +
  98.108 +typedef struct {
  98.109 +  unsigned char *data;
  98.110 +  int storage;
  98.111 +  int fill;
  98.112 +  int returned;
  98.113 +
  98.114 +  int unsynced;
  98.115 +  int headerbytes;
  98.116 +  int bodybytes;
  98.117 +} ogg_sync_state;
  98.118 +
  98.119 +/* Ogg BITSTREAM PRIMITIVES: bitstream ************************/
  98.120 +
  98.121 +extern void  oggpack_writeinit(oggpack_buffer *b);
  98.122 +extern int   oggpack_writecheck(oggpack_buffer *b);
  98.123 +extern void  oggpack_writetrunc(oggpack_buffer *b,long bits);
  98.124 +extern void  oggpack_writealign(oggpack_buffer *b);
  98.125 +extern void  oggpack_writecopy(oggpack_buffer *b,void *source,long bits);
  98.126 +extern void  oggpack_reset(oggpack_buffer *b);
  98.127 +extern void  oggpack_writeclear(oggpack_buffer *b);
  98.128 +extern void  oggpack_readinit(oggpack_buffer *b,unsigned char *buf,int bytes);
  98.129 +extern void  oggpack_write(oggpack_buffer *b,unsigned long value,int bits);
  98.130 +extern long  oggpack_look(oggpack_buffer *b,int bits);
  98.131 +extern long  oggpack_look1(oggpack_buffer *b);
  98.132 +extern void  oggpack_adv(oggpack_buffer *b,int bits);
  98.133 +extern void  oggpack_adv1(oggpack_buffer *b);
  98.134 +extern long  oggpack_read(oggpack_buffer *b,int bits);
  98.135 +extern long  oggpack_read1(oggpack_buffer *b);
  98.136 +extern long  oggpack_bytes(oggpack_buffer *b);
  98.137 +extern long  oggpack_bits(oggpack_buffer *b);
  98.138 +extern unsigned char *oggpack_get_buffer(oggpack_buffer *b);
  98.139 +
  98.140 +extern void  oggpackB_writeinit(oggpack_buffer *b);
  98.141 +extern int   oggpackB_writecheck(oggpack_buffer *b);
  98.142 +extern void  oggpackB_writetrunc(oggpack_buffer *b,long bits);
  98.143 +extern void  oggpackB_writealign(oggpack_buffer *b);
  98.144 +extern void  oggpackB_writecopy(oggpack_buffer *b,void *source,long bits);
  98.145 +extern void  oggpackB_reset(oggpack_buffer *b);
  98.146 +extern void  oggpackB_writeclear(oggpack_buffer *b);
  98.147 +extern void  oggpackB_readinit(oggpack_buffer *b,unsigned char *buf,int bytes);
  98.148 +extern void  oggpackB_write(oggpack_buffer *b,unsigned long value,int bits);
  98.149 +extern long  oggpackB_look(oggpack_buffer *b,int bits);
  98.150 +extern long  oggpackB_look1(oggpack_buffer *b);
  98.151 +extern void  oggpackB_adv(oggpack_buffer *b,int bits);
  98.152 +extern void  oggpackB_adv1(oggpack_buffer *b);
  98.153 +extern long  oggpackB_read(oggpack_buffer *b,int bits);
  98.154 +extern long  oggpackB_read1(oggpack_buffer *b);
  98.155 +extern long  oggpackB_bytes(oggpack_buffer *b);
  98.156 +extern long  oggpackB_bits(oggpack_buffer *b);
  98.157 +extern unsigned char *oggpackB_get_buffer(oggpack_buffer *b);
  98.158 +
  98.159 +/* Ogg BITSTREAM PRIMITIVES: encoding **************************/
  98.160 +
  98.161 +extern int      ogg_stream_packetin(ogg_stream_state *os, ogg_packet *op);
  98.162 +extern int      ogg_stream_iovecin(ogg_stream_state *os, ogg_iovec_t *iov,
  98.163 +                                   int count, long e_o_s, ogg_int64_t granulepos);
  98.164 +extern int      ogg_stream_pageout(ogg_stream_state *os, ogg_page *og);
  98.165 +extern int      ogg_stream_pageout_fill(ogg_stream_state *os, ogg_page *og, int nfill);
  98.166 +extern int      ogg_stream_flush(ogg_stream_state *os, ogg_page *og);
  98.167 +extern int      ogg_stream_flush_fill(ogg_stream_state *os, ogg_page *og, int nfill);
  98.168 +
  98.169 +/* Ogg BITSTREAM PRIMITIVES: decoding **************************/
  98.170 +
  98.171 +extern int      ogg_sync_init(ogg_sync_state *oy);
  98.172 +extern int      ogg_sync_clear(ogg_sync_state *oy);
  98.173 +extern int      ogg_sync_reset(ogg_sync_state *oy);
  98.174 +extern int      ogg_sync_destroy(ogg_sync_state *oy);
  98.175 +extern int      ogg_sync_check(ogg_sync_state *oy);
  98.176 +
  98.177 +extern char    *ogg_sync_buffer(ogg_sync_state *oy, long size);
  98.178 +extern int      ogg_sync_wrote(ogg_sync_state *oy, long bytes);
  98.179 +extern long     ogg_sync_pageseek(ogg_sync_state *oy,ogg_page *og);
  98.180 +extern int      ogg_sync_pageout(ogg_sync_state *oy, ogg_page *og);
  98.181 +extern int      ogg_stream_pagein(ogg_stream_state *os, ogg_page *og);
  98.182 +extern int      ogg_stream_packetout(ogg_stream_state *os,ogg_packet *op);
  98.183 +extern int      ogg_stream_packetpeek(ogg_stream_state *os,ogg_packet *op);
  98.184 +
  98.185 +/* Ogg BITSTREAM PRIMITIVES: general ***************************/
  98.186 +
  98.187 +extern int      ogg_stream_init(ogg_stream_state *os,int serialno);
  98.188 +extern int      ogg_stream_clear(ogg_stream_state *os);
  98.189 +extern int      ogg_stream_reset(ogg_stream_state *os);
  98.190 +extern int      ogg_stream_reset_serialno(ogg_stream_state *os,int serialno);
  98.191 +extern int      ogg_stream_destroy(ogg_stream_state *os);
  98.192 +extern int      ogg_stream_check(ogg_stream_state *os);
  98.193 +extern int      ogg_stream_eos(ogg_stream_state *os);
  98.194 +
  98.195 +extern void     ogg_page_checksum_set(ogg_page *og);
  98.196 +
  98.197 +extern int      ogg_page_version(const ogg_page *og);
  98.198 +extern int      ogg_page_continued(const ogg_page *og);
  98.199 +extern int      ogg_page_bos(const ogg_page *og);
  98.200 +extern int      ogg_page_eos(const ogg_page *og);
  98.201 +extern ogg_int64_t  ogg_page_granulepos(const ogg_page *og);
  98.202 +extern int      ogg_page_serialno(const ogg_page *og);
  98.203 +extern long     ogg_page_pageno(const ogg_page *og);
  98.204 +extern int      ogg_page_packets(const ogg_page *og);
  98.205 +
  98.206 +extern void     ogg_packet_clear(ogg_packet *op);
  98.207 +
  98.208 +
  98.209 +#ifdef __cplusplus
  98.210 +}
  98.211 +#endif
  98.212 +
  98.213 +#endif  /* _OGG_H */
    99.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    99.2 +++ b/libs/ogg/os_types.h	Sun Nov 01 00:36:56 2015 +0200
    99.3 @@ -0,0 +1,147 @@
    99.4 +/********************************************************************
    99.5 + *                                                                  *
    99.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
    99.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
    99.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
    99.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
   99.10 + *                                                                  *
   99.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2002             *
   99.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
   99.13 + *                                                                  *
   99.14 + ********************************************************************
   99.15 +
   99.16 + function: #ifdef jail to whip a few platforms into the UNIX ideal.
   99.17 + last mod: $Id: os_types.h 17712 2010-12-03 17:10:02Z xiphmont $
   99.18 +
   99.19 + ********************************************************************/
   99.20 +#ifndef _OS_TYPES_H
   99.21 +#define _OS_TYPES_H
   99.22 +
   99.23 +/* make it easy on the folks that want to compile the libs with a
   99.24 +   different malloc than stdlib */
   99.25 +#define _ogg_malloc  malloc
   99.26 +#define _ogg_calloc  calloc
   99.27 +#define _ogg_realloc realloc
   99.28 +#define _ogg_free    free
   99.29 +
   99.30 +#if defined(_WIN32) 
   99.31 +
   99.32 +#  if defined(__CYGWIN__)
   99.33 +#    include <stdint.h>
   99.34 +     typedef int16_t ogg_int16_t;
   99.35 +     typedef uint16_t ogg_uint16_t;
   99.36 +     typedef int32_t ogg_int32_t;
   99.37 +     typedef uint32_t ogg_uint32_t;
   99.38 +     typedef int64_t ogg_int64_t;
   99.39 +     typedef uint64_t ogg_uint64_t;
   99.40 +#  elif defined(__MINGW32__)
   99.41 +#    include <sys/types.h>
   99.42 +     typedef short ogg_int16_t;
   99.43 +     typedef unsigned short ogg_uint16_t;
   99.44 +     typedef int ogg_int32_t;
   99.45 +     typedef unsigned int ogg_uint32_t;
   99.46 +     typedef long long ogg_int64_t;
   99.47 +     typedef unsigned long long ogg_uint64_t;
   99.48 +#  elif defined(__MWERKS__)
   99.49 +     typedef long long ogg_int64_t;
   99.50 +     typedef int ogg_int32_t;
   99.51 +     typedef unsigned int ogg_uint32_t;
   99.52 +     typedef short ogg_int16_t;
   99.53 +     typedef unsigned short ogg_uint16_t;
   99.54 +#  else
   99.55 +     /* MSVC/Borland */
   99.56 +     typedef __int64 ogg_int64_t;
   99.57 +     typedef __int32 ogg_int32_t;
   99.58 +     typedef unsigned __int32 ogg_uint32_t;
   99.59 +     typedef __int16 ogg_int16_t;
   99.60 +     typedef unsigned __int16 ogg_uint16_t;
   99.61 +#  endif
   99.62 +
   99.63 +#elif defined(__MACOS__)
   99.64 +
   99.65 +#  include <sys/types.h>
   99.66 +   typedef SInt16 ogg_int16_t;
   99.67 +   typedef UInt16 ogg_uint16_t;
   99.68 +   typedef SInt32 ogg_int32_t;
   99.69 +   typedef UInt32 ogg_uint32_t;
   99.70 +   typedef SInt64 ogg_int64_t;
   99.71 +
   99.72 +#elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */
   99.73 +
   99.74 +#  include <inttypes.h>
   99.75 +   typedef int16_t ogg_int16_t;
   99.76 +   typedef uint16_t ogg_uint16_t;
   99.77 +   typedef int32_t ogg_int32_t;
   99.78 +   typedef uint32_t ogg_uint32_t;
   99.79 +   typedef int64_t ogg_int64_t;
   99.80 +
   99.81 +#elif defined(__HAIKU__)
   99.82 +
   99.83 +  /* Haiku */
   99.84 +#  include <sys/types.h>
   99.85 +   typedef short ogg_int16_t;
   99.86 +   typedef unsigned short ogg_uint16_t;
   99.87 +   typedef int ogg_int32_t;
   99.88 +   typedef unsigned int ogg_uint32_t;
   99.89 +   typedef long long ogg_int64_t;
   99.90 +
   99.91 +#elif defined(__BEOS__)
   99.92 +
   99.93 +   /* Be */
   99.94 +#  include <inttypes.h>
   99.95 +   typedef int16_t ogg_int16_t;
   99.96 +   typedef uint16_t ogg_uint16_t;
   99.97 +   typedef int32_t ogg_int32_t;
   99.98 +   typedef uint32_t ogg_uint32_t;
   99.99 +   typedef int64_t ogg_int64_t;
  99.100 +
  99.101 +#elif defined (__EMX__)
  99.102 +
  99.103 +   /* OS/2 GCC */
  99.104 +   typedef short ogg_int16_t;
  99.105 +   typedef unsigned short ogg_uint16_t;
  99.106 +   typedef int ogg_int32_t;
  99.107 +   typedef unsigned int ogg_uint32_t;
  99.108 +   typedef long long ogg_int64_t;
  99.109 +
  99.110 +#elif defined (DJGPP)
  99.111 +
  99.112 +   /* DJGPP */
  99.113 +   typedef short ogg_int16_t;
  99.114 +   typedef int ogg_int32_t;
  99.115 +   typedef unsigned int ogg_uint32_t;
  99.116 +   typedef long long ogg_int64_t;
  99.117 +
  99.118 +#elif defined(R5900)
  99.119 +
  99.120 +   /* PS2 EE */
  99.121 +   typedef long ogg_int64_t;
  99.122 +   typedef int ogg_int32_t;
  99.123 +   typedef unsigned ogg_uint32_t;
  99.124 +   typedef short ogg_int16_t;
  99.125 +
  99.126 +#elif defined(__SYMBIAN32__)
  99.127 +
  99.128 +   /* Symbian GCC */
  99.129 +   typedef signed short ogg_int16_t;
  99.130 +   typedef unsigned short ogg_uint16_t;
  99.131 +   typedef signed int ogg_int32_t;
  99.132 +   typedef unsigned int ogg_uint32_t;
  99.133 +   typedef long long int ogg_int64_t;
  99.134 +
  99.135 +#elif defined(__TMS320C6X__)
  99.136 +
  99.137 +   /* TI C64x compiler */
  99.138 +   typedef signed short ogg_int16_t;
  99.139 +   typedef unsigned short ogg_uint16_t;
  99.140 +   typedef signed int ogg_int32_t;
  99.141 +   typedef unsigned int ogg_uint32_t;
  99.142 +   typedef long long int ogg_int64_t;
  99.143 +
  99.144 +#else
  99.145 +
  99.146 +#  include <ogg/config_types.h>
  99.147 +
  99.148 +#endif
  99.149 +
  99.150 +#endif  /* _OS_TYPES_H */
   100.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   100.2 +++ b/libs/vmath/basis.cc	Sun Nov 01 00:36:56 2015 +0200
   100.3 @@ -0,0 +1,63 @@
   100.4 +#include "basis.h"
   100.5 +#include "vmath.h"
   100.6 +
   100.7 +Basis::Basis()
   100.8 +{
   100.9 +	i = Vector3(1, 0, 0);
  100.10 +	j = Vector3(0, 1, 0);
  100.11 +	k = Vector3(0, 0, 1);
  100.12 +}
  100.13 +
  100.14 +Basis::Basis(const Vector3 &i, const Vector3 &j, const Vector3 &k)
  100.15 +{
  100.16 +	this->i = i;
  100.17 +	this->j = j;
  100.18 +	this->k = k;
  100.19 +}
  100.20 +
  100.21 +Basis::Basis(const Vector3 &dir, bool left_handed)
  100.22 +{
  100.23 +	k = dir;
  100.24 +	j = Vector3(0, 1, 0);
  100.25 +	i = cross_product(j, k);
  100.26 +	j = cross_product(k, i);
  100.27 +}
  100.28 +
  100.29 +/** Rotate with euler angles */
  100.30 +void Basis::rotate(scalar_t x, scalar_t y, scalar_t z) {
  100.31 +	Matrix4x4 RotMat;
  100.32 +	RotMat.set_rotation(Vector3(x, y, z));
  100.33 +	i.transform(RotMat);
  100.34 +	j.transform(RotMat);
  100.35 +	k.transform(RotMat);
  100.36 +}
  100.37 +
  100.38 +/** Rotate by axis-angle specification */
  100.39 +void Basis::rotate(const Vector3 &axis, scalar_t angle) {
  100.40 +	Quaternion q;
  100.41 +	q.set_rotation(axis, angle);
  100.42 +	i.transform(q);
  100.43 +	j.transform(q);
  100.44 +	k.transform(q);
  100.45 +}
  100.46 +
  100.47 +/** Rotate with a 4x4 matrix */
  100.48 +void Basis::rotate(const Matrix4x4 &mat) {
  100.49 +	i.transform(mat);
  100.50 +	j.transform(mat);
  100.51 +	k.transform(mat);
  100.52 +}
  100.53 +
  100.54 +/** Rotate with a quaternion */
  100.55 +void Basis::rotate(const Quaternion &quat) {
  100.56 +	i.transform(quat);
  100.57 +	j.transform(quat);
  100.58 +	k.transform(quat);
  100.59 +}
  100.60 +
  100.61 +/** Extract a rotation matrix from the orthogonal basis */
  100.62 +Matrix3x3 Basis::create_rotation_matrix() const {
  100.63 +	return Matrix3x3(	i.x, j.x, k.x,
  100.64 +						i.y, j.y, k.y,
  100.65 +						i.z, j.z, k.z);
  100.66 +}
   101.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   101.2 +++ b/libs/vmath/basis.h	Sun Nov 01 00:36:56 2015 +0200
   101.3 @@ -0,0 +1,57 @@
   101.4 +/*
   101.5 +libvmath - a vector math library
   101.6 +Copyright (C) 2004-2011 John Tsiombikas <nuclear@member.fsf.org>
   101.7 +
   101.8 +This program is free software: you can redistribute it and/or modify
   101.9 +it under the terms of the GNU Lesser General Public License as published
  101.10 +by the Free Software Foundation, either version 3 of the License, or
  101.11 +(at your option) any later version.
  101.12 +
  101.13 +This program is distributed in the hope that it will be useful,
  101.14 +but WITHOUT ANY WARRANTY; without even the implied warranty of
  101.15 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  101.16 +GNU Lesser General Public License for more details.
  101.17 +
  101.18 +You should have received a copy of the GNU Lesser General Public License
  101.19 +along with this program.  If not, see <http://www.gnu.org/licenses/>.
  101.20 +*/
  101.21 +
  101.22 +#ifndef VMATH_BASIS_H_
  101.23 +#define VMATH_BASIS_H_
  101.24 +
  101.25 +#include "vector.h"
  101.26 +#include "matrix.h"
  101.27 +
  101.28 +enum {
  101.29 +	LEFT_HANDED,
  101.30 +	RIGHT_HANDED
  101.31 +};
  101.32 +
  101.33 +#ifdef __cplusplus
  101.34 +extern "C" {
  101.35 +#endif	/* __cplusplus */
  101.36 +
  101.37 +void basis_matrix(mat4_t res, vec3_t i, vec3_t j, vec3_t k);
  101.38 +void basis_matrix_dir(mat4_t res, vec3_t dir);
  101.39 +
  101.40 +#ifdef __cplusplus
  101.41 +}	/* extern "C" */
  101.42 +
  101.43 +class Basis {
  101.44 +public:
  101.45 +	Vector3 i, j, k;
  101.46 +
  101.47 +	Basis();
  101.48 +	Basis(const Vector3 &i, const Vector3 &j, const Vector3 &k);
  101.49 +	Basis(const Vector3 &dir, bool left_handed = true);
  101.50 +
  101.51 +	void rotate(scalar_t x, scalar_t y, scalar_t z);
  101.52 +	void rotate(const Vector3 &axis, scalar_t angle);
  101.53 +	void rotate(const Matrix4x4 &mat);
  101.54 +	void rotate(const Quaternion &quat);
  101.55 +
  101.56 +	Matrix3x3 create_rotation_matrix() const;
  101.57 +};
  101.58 +#endif	/* __cplusplus */
  101.59 +
  101.60 +#endif	/* VMATH_BASIS_H_ */
   102.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   102.2 +++ b/libs/vmath/basis_c.c	Sun Nov 01 00:36:56 2015 +0200
   102.3 @@ -0,0 +1,37 @@
   102.4 +/*
   102.5 +libvmath - a vector math library
   102.6 +Copyright (C) 2004-2011 John Tsiombikas <nuclear@member.fsf.org>
   102.7 +
   102.8 +This program is free software: you can redistribute it and/or modify
   102.9 +it under the terms of the GNU Lesser General Public License as published
  102.10 +by the Free Software Foundation, either version 3 of the License, or
  102.11 +(at your option) any later version.
  102.12 +
  102.13 +This program is distributed in the hope that it will be useful,
  102.14 +but WITHOUT ANY WARRANTY; without even the implied warranty of
  102.15 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  102.16 +GNU Lesser General Public License for more details.
  102.17 +
  102.18 +You should have received a copy of the GNU Lesser General Public License
  102.19 +along with this program.  If not, see <http://www.gnu.org/licenses/>.
  102.20 +*/
  102.21 +
  102.22 +#include "basis.h"
  102.23 +#include "matrix.h"
  102.24 +
  102.25 +void basis_matrix(mat4_t res, vec3_t i, vec3_t j, vec3_t k)
  102.26 +{
  102.27 +	m4_identity(res);
  102.28 +	m4_set_column(res, v4_cons(i.x, i.y, i.z, 1.0), 0);
  102.29 +	m4_set_column(res, v4_cons(j.x, j.y, j.z, 1.0), 1);
  102.30 +	m4_set_column(res, v4_cons(k.x, k.y, k.z, 1.0), 2);
  102.31 +}
  102.32 +
  102.33 +void basis_matrix_dir(mat4_t res, vec3_t dir)
  102.34 +{
  102.35 +	vec3_t k = v3_normalize(dir);
  102.36 +	vec3_t j = {0, 1, 0};
  102.37 +	vec3_t i = v3_cross(j, k);
  102.38 +	j = v3_cross(k, i);
  102.39 +	basis_matrix(res, i, j, k);
  102.40 +}
   103.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   103.2 +++ b/libs/vmath/geom.c	Sun Nov 01 00:36:56 2015 +0200
   103.3 @@ -0,0 +1,150 @@
   103.4 +/*
   103.5 +libvmath - a vector math library
   103.6 +Copyright (C) 2004-2011 John Tsiombikas <nuclear@member.fsf.org>
   103.7 +
   103.8 +This program is free software: you can redistribute it and/or modify
   103.9 +it under the terms of the GNU Lesser General Public License as published
  103.10 +by the Free Software Foundation, either version 3 of the License, or
  103.11 +(at your option) any later version.
  103.12 +
  103.13 +This program is distributed in the hope that it will be useful,
  103.14 +but WITHOUT ANY WARRANTY; without even the implied warranty of
  103.15 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  103.16 +GNU Lesser General Public License for more details.
  103.17 +
  103.18 +You should have received a copy of the GNU Lesser General Public License
  103.19 +along with this program.  If not, see <http://www.gnu.org/licenses/>.
  103.20 +*/
  103.21 +
  103.22 +
  103.23 +#include <math.h>
  103.24 +#include "geom.h"
  103.25 +#include "vector.h"
  103.26 +
  103.27 +plane_t plane_cons(scalar_t nx, scalar_t ny, scalar_t nz, scalar_t d)
  103.28 +{
  103.29 +	plane_t p;
  103.30 +	p.norm.x = nx;
  103.31 +	p.norm.y = ny;
  103.32 +	p.norm.z = nz;
  103.33 +	p.d = d;
  103.34 +	return p;
  103.35 +}
  103.36 +
  103.37 +plane_t plane_poly(vec3_t v0, vec3_t v1, vec3_t v2)
  103.38 +{
  103.39 +	vec3_t a, b, norm;
  103.40 +
  103.41 +	a = v3_sub(v1, v0);
  103.42 +	b = v3_sub(v2, v0);
  103.43 +	norm = v3_cross(a, b);
  103.44 +	norm = v3_normalize(norm);
  103.45 +
  103.46 +	return plane_ptnorm(v0, norm);
  103.47 +}
  103.48 +
  103.49 +plane_t plane_ptnorm(vec3_t pt, vec3_t normal)
  103.50 +{
  103.51 +	plane_t plane;
  103.52 +
  103.53 +	plane.norm = normal;
  103.54 +	plane.d = v3_dot(pt, normal);
  103.55 +
  103.56 +	return plane;
  103.57 +}
  103.58 +
  103.59 +plane_t plane_invert(plane_t p)
  103.60 +{
  103.61 +	p.norm = v3_neg(p.norm);
  103.62 +	p.d = -p.d;
  103.63 +	return p;
  103.64 +}
  103.65 +
  103.66 +scalar_t plane_signed_dist(plane_t plane, vec3_t pt)
  103.67 +{
  103.68 +	vec3_t pp = plane_point(plane);
  103.69 +	vec3_t pptopt = v3_sub(pt, pp);
  103.70 +	return v3_dot(pptopt, plane.norm);
  103.71 +}
  103.72 +
  103.73 +scalar_t plane_dist(plane_t plane, vec3_t pt)
  103.74 +{
  103.75 +	return fabs(plane_signed_dist(plane, pt));
  103.76 +}
  103.77 +
  103.78 +vec3_t plane_point(plane_t plane)
  103.79 +{
  103.80 +	return v3_scale(plane.norm, plane.d);
  103.81 +}
  103.82 +
  103.83 +int plane_ray_intersect(ray_t ray, plane_t plane, scalar_t *pos)
  103.84 +{
  103.85 +	vec3_t pt, orig_to_pt;
  103.86 +	scalar_t ndotdir;
  103.87 +
  103.88 +	pt = plane_point(plane);
  103.89 +	ndotdir = v3_dot(plane.norm, ray.dir);
  103.90 +
  103.91 +	if(fabs(ndotdir) < 1e-7) {
  103.92 +		return 0;
  103.93 +	}
  103.94 +
  103.95 +	if(pos) {
  103.96 +		orig_to_pt = v3_sub(pt, ray.origin);
  103.97 +		*pos = v3_dot(plane.norm, orig_to_pt) / ndotdir;
  103.98 +	}
  103.99 +	return 1;
 103.100 +}
 103.101 +
 103.102 +sphere_t sphere_cons(scalar_t x, scalar_t y, scalar_t z, scalar_t rad)
 103.103 +{
 103.104 +	sphere_t sph;
 103.105 +	sph.pos.x = x;
 103.106 +	sph.pos.y = y;
 103.107 +	sph.pos.z = z;
 103.108 +	sph.rad = rad;
 103.109 +	return sph;
 103.110 +}
 103.111 +
 103.112 +int sphere_ray_intersect(ray_t ray, sphere_t sph, scalar_t *pos)
 103.113 +{
 103.114 +	scalar_t a, b, c, d, sqrt_d, t1, t2, t;
 103.115 +
 103.116 +	a = v3_dot(ray.dir, ray.dir);
 103.117 +	b = 2.0 * ray.dir.x * (ray.origin.x - sph.pos.x) +
 103.118 +		2.0 * ray.dir.y * (ray.origin.y - sph.pos.y) +
 103.119 +		2.0 * ray.dir.z * (ray.origin.z - sph.pos.z);
 103.120 +	c = v3_dot(sph.pos, sph.pos) + v3_dot(ray.origin, ray.origin) +
 103.121 +		2.0 * v3_dot(v3_neg(sph.pos), ray.origin) - sph.rad * sph.rad;
 103.122 +
 103.123 +	d = b * b - 4.0 * a * c;
 103.124 +	if(d < 0.0) {
 103.125 +		return 0;
 103.126 +	}
 103.127 +
 103.128 +	sqrt_d = sqrt(d);
 103.129 +	t1 = (-b + sqrt_d) / (2.0 * a);
 103.130 +	t2 = (-b - sqrt_d) / (2.0 * a);
 103.131 +
 103.132 +	if(t1 < 1e-7 || t1 > 1.0) {
 103.133 +		t1 = t2;
 103.134 +	}
 103.135 +	if(t2 < 1e-7 || t2 > 1.0) {
 103.136 +		t2 = t1;
 103.137 +	}
 103.138 +	t = t1 < t2 ? t1 : t2;
 103.139 +
 103.140 +	if(t < 1e-7 || t > 1.0) {
 103.141 +		return 0;
 103.142 +	}
 103.143 +
 103.144 +	if(pos) {
 103.145 +		*pos = t;
 103.146 +	}
 103.147 +	return 1;
 103.148 +}
 103.149 +
 103.150 +int sphere_sphere_intersect(sphere_t sph1, sphere_t sph2, scalar_t *pos, scalar_t *rad)
 103.151 +{
 103.152 +	return -1;
 103.153 +}
   104.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   104.2 +++ b/libs/vmath/geom.h	Sun Nov 01 00:36:56 2015 +0200
   104.3 @@ -0,0 +1,72 @@
   104.4 +/*
   104.5 +libvmath - a vector math library
   104.6 +Copyright (C) 2004-2012 John Tsiombikas <nuclear@member.fsf.org>
   104.7 +
   104.8 +This program is free software: you can redistribute it and/or modify
   104.9 +it under the terms of the GNU Lesser General Public License as published
  104.10 +by the Free Software Foundation, either version 3 of the License, or
  104.11 +(at your option) any later version.
  104.12 +
  104.13 +This program is distributed in the hope that it will be useful,
  104.14 +but WITHOUT ANY WARRANTY; without even the implied warranty of
  104.15 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  104.16 +GNU Lesser General Public License for more details.
  104.17 +
  104.18 +You should have received a copy of the GNU Lesser General Public License
  104.19 +along with this program.  If not, see <http://www.gnu.org/licenses/>.
  104.20 +*/
  104.21 +#ifndef LIBVMATH_GEOM_H_
  104.22 +#define LIBVMATH_GEOM_H_
  104.23 +
  104.24 +#include "vector.h"
  104.25 +#include "ray.h"
  104.26 +
  104.27 +typedef struct {
  104.28 +	vec3_t norm;
  104.29 +	scalar_t d;
  104.30 +} plane_t;
  104.31 +
  104.32 +typedef struct {
  104.33 +	vec3_t pos;
  104.34 +	scalar_t rad;
  104.35 +} sphere_t;
  104.36 +
  104.37 +typedef struct {
  104.38 +	vec3_t min, max;
  104.39 +} aabox_t;
  104.40 +
  104.41 +#ifdef __cplusplus
  104.42 +extern "C" {
  104.43 +#endif
  104.44 +
  104.45 +/* planes are good... you need planes, yes you do */
  104.46 +plane_t plane_cons(scalar_t nx, scalar_t ny, scalar_t nz, scalar_t d);
  104.47 +plane_t plane_poly(vec3_t v0, vec3_t v1, vec3_t v2);
  104.48 +plane_t plane_ptnorm(vec3_t pt, vec3_t normal);
  104.49 +
  104.50 +plane_t plane_invert(plane_t p);
  104.51 +
  104.52 +scalar_t plane_signed_dist(plane_t plane, vec3_t pt);
  104.53 +scalar_t plane_dist(plane_t plane, vec3_t pt);
  104.54 +vec3_t plane_point(plane_t plane);
  104.55 +
  104.56 +int plane_ray_intersect(ray_t ray, plane_t plane, scalar_t *pos);
  104.57 +
  104.58 +/* spheres always come in handy */
  104.59 +sphere_t sphere_cons(scalar_t x, scalar_t y, scalar_t z, scalar_t rad);
  104.60 +
  104.61 +int sphere_ray_intersect(ray_t ray, sphere_t sph, scalar_t *pos);
  104.62 +int sphere_sphere_intersect(sphere_t sph1, sphere_t sph2, scalar_t *pos, scalar_t *rad);
  104.63 +
  104.64 +#ifdef __cplusplus
  104.65 +}
  104.66 +
  104.67 +/* TODO
  104.68 +class Plane : public plane_t {
  104.69 +public:
  104.70 +};
  104.71 +*/
  104.72 +
  104.73 +#endif
  104.74 +
  104.75 +#endif	/* LIBVMATH_GEOM_H_ */
   105.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   105.2 +++ b/libs/vmath/matrix.cc	Sun Nov 01 00:36:56 2015 +0200
   105.3 @@ -0,0 +1,853 @@
   105.4 +#include <cstdio>
   105.5 +#include <cmath>
   105.6 +#include "matrix.h"
   105.7 +#include "vector.h"
   105.8 +#include "quat.h"
   105.9 +
  105.10 +using namespace std;
  105.11 +
  105.12 +// ----------- Matrix3x3 --------------
  105.13 +
  105.14 +Matrix3x3 Matrix3x3::identity = Matrix3x3(1, 0, 0, 0, 1, 0, 0, 0, 1);
  105.15 +
  105.16 +Matrix3x3::Matrix3x3()
  105.17 +{
  105.18 +	*this = Matrix3x3(1, 0, 0, 0, 1, 0, 0, 0, 1);
  105.19 +}
  105.20 +
  105.21 +Matrix3x3::Matrix3x3(	scalar_t m11, scalar_t m12, scalar_t m13,
  105.22 +						scalar_t m21, scalar_t m22, scalar_t m23,
  105.23 +						scalar_t m31, scalar_t m32, scalar_t m33)
  105.24 +{
  105.25 +	m[0][0] = m11; m[0][1] = m12; m[0][2] = m13;
  105.26 +	m[1][0] = m21; m[1][1] = m22; m[1][2] = m23;
  105.27 +	m[2][0] = m31; m[2][1] = m32; m[2][2] = m33;
  105.28 +}
  105.29 +
  105.30 +Matrix3x3::Matrix3x3(const Vector3 &ivec, const Vector3 &jvec, const Vector3 &kvec)
  105.31 +{
  105.32 +	set_row_vector(ivec, 0);
  105.33 +	set_row_vector(jvec, 1);
  105.34 +	set_row_vector(kvec, 2);
  105.35 +}
  105.36 +
  105.37 +Matrix3x3::Matrix3x3(const mat3_t cmat)
  105.38 +{
  105.39 +	memcpy(m, cmat, sizeof(mat3_t));
  105.40 +}
  105.41 +
  105.42 +Matrix3x3::Matrix3x3(const Matrix4x4 &mat4x4)
  105.43 +{
  105.44 +	for(int i=0; i<3; i++) {
  105.45 +		for(int j=0; j<3; j++) {
  105.46 +			m[i][j] = mat4x4[i][j];
  105.47 +		}
  105.48 +	}
  105.49 +}
  105.50 +
  105.51 +Matrix3x3 operator +(const Matrix3x3 &m1, const Matrix3x3 &m2)
  105.52 +{
  105.53 +	Matrix3x3 res;
  105.54 +	const scalar_t *op1 = m1.m[0], *op2 = m2.m[0];
  105.55 +	scalar_t *dest = res.m[0];
  105.56 +
  105.57 +	for(int i=0; i<9; i++) {
  105.58 +		*dest++ = *op1++ + *op2++;
  105.59 +	}
  105.60 +	return res;
  105.61 +}
  105.62 +
  105.63 +Matrix3x3 operator -(const Matrix3x3 &m1, const Matrix3x3 &m2)
  105.64 +{
  105.65 +	Matrix3x3 res;
  105.66 +	const scalar_t *op1 = m1.m[0], *op2 = m2.m[0];
  105.67 +	scalar_t *dest = res.m[0];
  105.68 +
  105.69 +	for(int i=0; i<9; i++) {
  105.70 +		*dest++ = *op1++ - *op2++;
  105.71 +	}
  105.72 +	return res;
  105.73 +}
  105.74 +
  105.75 +Matrix3x3 operator *(const Matrix3x3 &m1, const Matrix3x3 &m2)
  105.76 +{
  105.77 +	Matrix3x3 res;
  105.78 +	for(int i=0; i<3; i++) {
  105.79 +		for(int j=0; j<3; j++) {
  105.80 +			res.m[i][j] = m1.m[i][0] * m2.m[0][j] + m1.m[i][1] * m2.m[1][j] + m1.m[i][2] * m2.m[2][j];
  105.81 +		}
  105.82 +	}
  105.83 +	return res;
  105.84 +}
  105.85 +
  105.86 +void operator +=(Matrix3x3 &m1, const Matrix3x3 &m2)
  105.87 +{
  105.88 +	scalar_t *op1 = m1.m[0];
  105.89 +	const scalar_t *op2 = m2.m[0];
  105.90 +
  105.91 +	for(int i=0; i<9; i++) {
  105.92 +		*op1++ += *op2++;
  105.93 +	}
  105.94 +}
  105.95 +
  105.96 +void operator -=(Matrix3x3 &m1, const Matrix3x3 &m2)
  105.97 +{
  105.98 +	scalar_t *op1 = m1.m[0];
  105.99 +	const scalar_t *op2 = m2.m[0];
 105.100 +
 105.101 +	for(int i=0; i<9; i++) {
 105.102 +		*op1++ -= *op2++;
 105.103 +	}
 105.104 +}
 105.105 +
 105.106 +void operator *=(Matrix3x3 &m1, const Matrix3x3 &m2)
 105.107 +{
 105.108 +	Matrix3x3 res;
 105.109 +	for(int i=0; i<3; i++) {
 105.110 +		for(int j=0; j<3; j++) {
 105.111 +			res.m[i][j] = m1.m[i][0] * m2.m[0][j] + m1.m[i][1] * m2.m[1][j] + m1.m[i][2] * m2.m[2][j];
 105.112 +		}
 105.113 +	}
 105.114 +	memcpy(m1.m, res.m, 9 * sizeof(scalar_t));
 105.115 +}
 105.116 +
 105.117 +Matrix3x3 operator *(const Matrix3x3 &mat, scalar_t scalar)
 105.118 +{
 105.119 +	Matrix3x3 res;
 105.120 +	const scalar_t *mptr = mat.m[0];
 105.121 +	scalar_t *dptr = res.m[0];
 105.122 +
 105.123 +	for(int i=0; i<9; i++) {
 105.124 +		*dptr++ = *mptr++ * scalar;
 105.125 +	}
 105.126 +	return res;
 105.127 +}
 105.128 +
 105.129 +Matrix3x3 operator *(scalar_t scalar, const Matrix3x3 &mat)
 105.130 +{
 105.131 +	Matrix3x3 res;
 105.132 +	const scalar_t *mptr = mat.m[0];
 105.133 +	scalar_t *dptr = res.m[0];
 105.134 +
 105.135 +	for(int i=0; i<9; i++) {
 105.136 +		*dptr++ = *mptr++ * scalar;
 105.137 +	}
 105.138 +	return res;
 105.139 +}
 105.140 +
 105.141 +void operator *=(Matrix3x3 &mat, scalar_t scalar)
 105.142 +{
 105.143 +	scalar_t *mptr = mat.m[0];
 105.144 +
 105.145 +	for(int i=0; i<9; i++) {
 105.146 +		*mptr++ *= scalar;
 105.147 +	}
 105.148 +}
 105.149 +
 105.150 +void Matrix3x3::translate(const Vector2 &trans)
 105.151 +{
 105.152 +	Matrix3x3 tmat(1, 0, trans.x, 0, 1, trans.y, 0, 0, 1);
 105.153 +	*this *= tmat;
 105.154 +}
 105.155 +
 105.156 +void Matrix3x3::set_translation(const Vector2 &trans)
 105.157 +{
 105.158 +	*this = Matrix3x3(1, 0, trans.x, 0, 1, trans.y, 0, 0, 1);
 105.159 +}
 105.160 +
 105.161 +void Matrix3x3::rotate(scalar_t angle)
 105.162 +{
 105.163 +	scalar_t cos_a = cos(angle);
 105.164 +	scalar_t sin_a = sin(angle);
 105.165 +	Matrix3x3 rmat(	cos_a,	-sin_a,		0,
 105.166 +					sin_a,	cos_a,		0,
 105.167 +					0,		0,			1);
 105.168 +	*this *= rmat;
 105.169 +}
 105.170 +
 105.171 +void Matrix3x3::set_rotation(scalar_t angle)
 105.172 +{
 105.173 +	scalar_t cos_a = cos(angle);
 105.174 +	scalar_t sin_a = sin(angle);
 105.175 +	*this = Matrix3x3(cos_a, -sin_a, 0, sin_a, cos_a, 0, 0, 0, 1);
 105.176 +}
 105.177 +
 105.178 +void Matrix3x3::rotate(const Vector3 &euler_angles)
 105.179 +{
 105.180 +	Matrix3x3 xrot, yrot, zrot;
 105.181 +
 105.182 +	xrot = Matrix3x3(	1,			0,					0,
 105.183 +						0,	cos(euler_angles.x),	-sin(euler_angles.x),
 105.184 +						0,	sin(euler_angles.x),	cos(euler_angles.x));
 105.185 +
 105.186 +	yrot = Matrix3x3(	cos(euler_angles.y),	0,	sin(euler_angles.y),
 105.187 +								0,				1,				0,
 105.188 +						-sin(euler_angles.y),	0,	cos(euler_angles.y));
 105.189 +
 105.190 +	zrot = Matrix3x3(	cos(euler_angles.z),	-sin(euler_angles.z),	0,
 105.191 +						sin(euler_angles.z),	cos(euler_angles.z),	0,
 105.192 +								0,						0,				1);
 105.193 +
 105.194 +	*this *= xrot * yrot * zrot;
 105.195 +}
 105.196 +
 105.197 +void Matrix3x3::set_rotation(const Vector3 &euler_angles)
 105.198 +{
 105.199 +	Matrix3x3 xrot, yrot, zrot;
 105.200 +
 105.201 +	xrot = Matrix3x3(	1,			0,					0,
 105.202 +						0,	cos(euler_angles.x),	-sin(euler_angles.x),
 105.203 +						0,	sin(euler_angles.x),	cos(euler_angles.x));
 105.204 +
 105.205 +	yrot = Matrix3x3(	cos(euler_angles.y),	0,	sin(euler_angles.y),
 105.206 +								0,				1,				0,
 105.207 +						-sin(euler_angles.y),	0,	cos(euler_angles.y));
 105.208 +
 105.209 +	zrot = Matrix3x3(	cos(euler_angles.z),	-sin(euler_angles.z),	0,
 105.210 +						sin(euler_angles.z),	cos(euler_angles.z),	0,
 105.211 +								0,						0,				1);
 105.212 +
 105.213 +	*this = xrot * yrot * zrot;
 105.214 +}
 105.215 +
 105.216 +void Matrix3x3::rotate(const Vector3 &axis, scalar_t angle)
 105.217 +{
 105.218 +	scalar_t sina = (scalar_t)sin(angle);
 105.219 +	scalar_t cosa = (scalar_t)cos(angle);
 105.220 +	scalar_t invcosa = 1-cosa;
 105.221 +	scalar_t nxsq = axis.x * axis.x;
 105.222 +	scalar_t nysq = axis.y * axis.y;
 105.223 +	scalar_t nzsq = axis.z * axis.z;
 105.224 +
 105.225 +	Matrix3x3 xform;
 105.226 +	xform.m[0][0] = nxsq + (1-nxsq) * cosa;
 105.227 +	xform.m[0][1] = axis.x * axis.y * invcosa - axis.z * sina;
 105.228 +	xform.m[0][2] = axis.x * axis.z * invcosa + axis.y * sina;
 105.229 +
 105.230 +	xform.m[1][0] = axis.x * axis.y * invcosa + axis.z * sina;
 105.231 +	xform.m[1][1] = nysq + (1-nysq) * cosa;
 105.232 +	xform.m[1][2] = axis.y * axis.z * invcosa - axis.x * sina;
 105.233 +
 105.234 +	xform.m[2][0] = axis.x * axis.z * invcosa - axis.y * sina;
 105.235 +	xform.m[2][1] = axis.y * axis.z * invcosa + axis.x * sina;
 105.236 +	xform.m[2][2] = nzsq + (1-nzsq) * cosa;
 105.237 +
 105.238 +	*this *= xform;
 105.239 +}
 105.240 +
 105.241 +void Matrix3x3::set_rotation(const Vector3 &axis, scalar_t angle)
 105.242 +{
 105.243 +	scalar_t sina = (scalar_t)sin(angle);
 105.244 +	scalar_t cosa = (scalar_t)cos(angle);
 105.245 +	scalar_t invcosa = 1-cosa;
 105.246 +	scalar_t nxsq = axis.x * axis.x;
 105.247 +	scalar_t nysq = axis.y * axis.y;
 105.248 +	scalar_t nzsq = axis.z * axis.z;
 105.249 +
 105.250 +	reset_identity();
 105.251 +	m[0][0] = nxsq + (1-nxsq) * cosa;
 105.252 +	m[0][1] = axis.x * axis.y * invcosa - axis.z * sina;
 105.253 +	m[0][2] = axis.x * axis.z * invcosa + axis.y * sina;
 105.254 +	m[1][0] = axis.x * axis.y * invcosa + axis.z * sina;
 105.255 +	m[1][1] = nysq + (1-nysq) * cosa;
 105.256 +	m[1][2] = axis.y * axis.z * invcosa - axis.x * sina;
 105.257 +	m[2][0] = axis.x * axis.z * invcosa - axis.y * sina;
 105.258 +	m[2][1] = axis.y * axis.z * invcosa + axis.x * sina;
 105.259 +	m[2][2] = nzsq + (1-nzsq) * cosa;
 105.260 +}
 105.261 +
 105.262 +// Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes
 105.263 +// article "Quaternion Calculus and Fast Animation".
 105.264 +// adapted from: http://www.geometrictools.com/LibMathematics/Algebra/Wm5Quaternion.inl
 105.265 +Quaternion Matrix3x3::get_rotation_quat() const
 105.266 +{
 105.267 +	static const int next[3] = {1, 2, 0};
 105.268 +
 105.269 +	float quat[4];
 105.270 +
 105.271 +	scalar_t trace = m[0][0] + m[1][1] + m[2][2];
 105.272 +	scalar_t root;
 105.273 +
 105.274 +	if(trace > 0.0f) {
 105.275 +		// |w| > 1/2
 105.276 +		root = sqrt(trace + 1.0f);	// 2w
 105.277 +		quat[0] = 0.5f * root;
 105.278 +		root = 0.5f / root;	// 1 / 4w
 105.279 +		quat[1] = (m[2][1] - m[1][2]) * root;
 105.280 +		quat[2] = (m[0][2] - m[2][0]) * root;
 105.281 +		quat[3] = (m[1][0] - m[0][1]) * root;
 105.282 +	} else {
 105.283 +		// |w| <= 1/2
 105.284 +		int i = 0;
 105.285 +		if(m[1][1] > m[0][0]) {
 105.286 +			i = 1;
 105.287 +		}
 105.288 +		if(m[2][2] > m[i][i]) {
 105.289 +			i = 2;
 105.290 +		}
 105.291 +		int j = next[i];
 105.292 +		int k = next[j];
 105.293 +
 105.294 +		root = sqrt(m[i][i] - m[j][j] - m[k][k] + 1.0f);
 105.295 +		quat[i + 1] = 0.5f * root;
 105.296 +		root = 0.5f / root;
 105.297 +		quat[0] = (m[k][j] - m[j][k]) * root;
 105.298 +		quat[j + 1] = (m[j][i] - m[i][j]) * root;
 105.299 +		quat[k + 1] = (m[k][i] - m[i][k]) * root;
 105.300 +	}
 105.301 +	return Quaternion(quat[0], quat[1], quat[2], quat[3]);
 105.302 +}
 105.303 +
 105.304 +void Matrix3x3::scale(const Vector3 &scale_vec)
 105.305 +{
 105.306 +	Matrix3x3 smat(	scale_vec.x, 0, 0,
 105.307 +					0, scale_vec.y, 0,
 105.308 +					0, 0, scale_vec.z);
 105.309 +	*this *= smat;
 105.310 +}
 105.311 +
 105.312 +void Matrix3x3::set_scaling(const Vector3 &scale_vec)
 105.313 +{
 105.314 +	*this = Matrix3x3(	scale_vec.x, 0, 0,
 105.315 +						0, scale_vec.y, 0,
 105.316 +						0, 0, scale_vec.z);
 105.317 +}
 105.318 +
 105.319 +void Matrix3x3::set_column_vector(const Vector3 &vec, unsigned int col_index)
 105.320 +{
 105.321 +	m[0][col_index] = vec.x;
 105.322 +	m[1][col_index] = vec.y;
 105.323 +	m[2][col_index] = vec.z;
 105.324 +}
 105.325 +
 105.326 +void Matrix3x3::set_row_vector(const Vector3 &vec, unsigned int row_index)
 105.327 +{
 105.328 +	m[row_index][0] = vec.x;
 105.329 +	m[row_index][1] = vec.y;
 105.330 +	m[row_index][2] = vec.z;
 105.331 +}
 105.332 +
 105.333 +Vector3 Matrix3x3::get_column_vector(unsigned int col_index) const
 105.334 +{
 105.335 +	return Vector3(m[0][col_index], m[1][col_index], m[2][col_index]);
 105.336 +}
 105.337 +
 105.338 +Vector3 Matrix3x3::get_row_vector(unsigned int row_index) const
 105.339 +{
 105.340 +	return Vector3(m[row_index][0], m[row_index][1], m[row_index][2]);
 105.341 +}
 105.342 +
 105.343 +void Matrix3x3::transpose()
 105.344 +{
 105.345 +	Matrix3x3 tmp = *this;
 105.346 +	for(int i=0; i<3; i++) {
 105.347 +		for(int j=0; j<3; j++) {
 105.348 +			m[i][j] = tmp[j][i];
 105.349 +		}
 105.350 +	}
 105.351 +}
 105.352 +
 105.353 +Matrix3x3 Matrix3x3::transposed() const
 105.354 +{
 105.355 +	Matrix3x3 res;
 105.356 +	for(int i=0; i<3; i++) {
 105.357 +		for(int j=0; j<3; j++) {
 105.358 +			res[i][j] = m[j][i];
 105.359 +		}
 105.360 +	}
 105.361 +	return res;
 105.362 +}
 105.363 +
 105.364 +scalar_t Matrix3x3::determinant() const
 105.365 +{
 105.366 +	return	m[0][0] * (m[1][1]*m[2][2] - m[1][2]*m[2][1]) -
 105.367 +			m[0][1] * (m[1][0]*m[2][2] - m[1][2]*m[2][0]) +
 105.368 +			m[0][2] * (m[1][0]*m[2][1] - m[1][1]*m[2][0]);
 105.369 +}
 105.370 +
 105.371 +Matrix3x3 Matrix3x3::inverse() const
 105.372 +{
 105.373 +	// TODO: implement 3x3 inverse
 105.374 +	return *this;
 105.375 +}
 105.376 +
 105.377 +ostream &operator <<(ostream &out, const Matrix3x3 &mat)
 105.378 +{
 105.379 +	for(int i=0; i<3; i++) {
 105.380 +		char str[100];
 105.381 +		sprintf(str, "[ %12.5f %12.5f %12.5f ]\n", (float)mat.m[i][0], (float)mat.m[i][1], (float)mat.m[i][2]);
 105.382 +		out << str;
 105.383 +	}
 105.384 +	return out;
 105.385 +}
 105.386 +
 105.387 +
 105.388 +
 105.389 +/* ----------------- Matrix4x4 implementation --------------- */
 105.390 +
 105.391 +Matrix4x4 Matrix4x4::identity = Matrix4x4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
 105.392 +
 105.393 +Matrix4x4::Matrix4x4()
 105.394 +{
 105.395 +	*this = Matrix4x4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
 105.396 +}
 105.397 +
 105.398 +Matrix4x4::Matrix4x4(	scalar_t m11, scalar_t m12, scalar_t m13, scalar_t m14,
 105.399 +						scalar_t m21, scalar_t m22, scalar_t m23, scalar_t m24,
 105.400 +						scalar_t m31, scalar_t m32, scalar_t m33, scalar_t m34,
 105.401 +						scalar_t m41, scalar_t m42, scalar_t m43, scalar_t m44)
 105.402 +{
 105.403 +	m[0][0] = m11; m[0][1] = m12; m[0][2] = m13; m[0][3] = m14;
 105.404 +	m[1][0] = m21; m[1][1] = m22; m[1][2] = m23; m[1][3] = m24;
 105.405 +	m[2][0] = m31; m[2][1] = m32; m[2][2] = m33; m[2][3] = m34;
 105.406 +	m[3][0] = m41; m[3][1] = m42; m[3][2] = m43; m[3][3] = m44;
 105.407 +}
 105.408 +
 105.409 +Matrix4x4::Matrix4x4(const mat4_t cmat)
 105.410 +{
 105.411 +	memcpy(m, cmat, sizeof(mat4_t));
 105.412 +}
 105.413 +
 105.414 +Matrix4x4::Matrix4x4(const Matrix3x3 &mat3x3)
 105.415 +{
 105.416 +	reset_identity();
 105.417 +	for(int i=0; i<3; i++) {
 105.418 +		for(int j=0; j<3; j++) {
 105.419 +			m[i][j] = mat3x3[i][j];
 105.420 +		}
 105.421 +	}
 105.422 +}
 105.423 +
 105.424 +Matrix4x4 operator +(const Matrix4x4 &m1, const Matrix4x4 &m2)
 105.425 +{
 105.426 +	Matrix4x4 res;
 105.427 +	const scalar_t *op1 = m1.m[0], *op2 = m2.m[0];
 105.428 +	scalar_t *dest = res.m[0];
 105.429 +
 105.430 +	for(int i=0; i<16; i++) {
 105.431 +		*dest++ = *op1++ + *op2++;
 105.432 +	}
 105.433 +	return res;
 105.434 +}
 105.435 +
 105.436 +Matrix4x4 operator -(const Matrix4x4 &m1, const Matrix4x4 &m2)
 105.437 +{
 105.438 +	Matrix4x4 res;
 105.439 +	const scalar_t *op1 = m1.m[0], *op2 = m2.m[0];
 105.440 +	scalar_t *dest = res.m[0];
 105.441 +
 105.442 +	for(int i=0; i<16; i++) {
 105.443 +		*dest++ = *op1++ - *op2++;
 105.444 +	}
 105.445 +	return res;
 105.446 +}
 105.447 +
 105.448 +void operator +=(Matrix4x4 &m1, const Matrix4x4 &m2)
 105.449 +{
 105.450 +	scalar_t *op1 = m1.m[0];
 105.451 +	const scalar_t *op2 = m2.m[0];
 105.452 +
 105.453 +	for(int i=0; i<16; i++) {
 105.454 +		*op1++ += *op2++;
 105.455 +	}
 105.456 +}
 105.457 +
 105.458 +void operator -=(Matrix4x4 &m1, const Matrix4x4 &m2)
 105.459 +{
 105.460 +	scalar_t *op1 = m1.m[0];
 105.461 +	const scalar_t *op2 = m2.m[0];
 105.462 +
 105.463 +	for(int i=0; i<16; i++) {
 105.464 +		*op1++ -= *op2++;
 105.465 +	}
 105.466 +}
 105.467 +
 105.468 +Matrix4x4 operator *(const Matrix4x4 &mat, scalar_t scalar)
 105.469 +{
 105.470 +	Matrix4x4 res;
 105.471 +	const scalar_t *mptr = mat.m[0];
 105.472 +	scalar_t *dptr = res.m[0];
 105.473 +
 105.474 +	for(int i=0; i<16; i++) {
 105.475 +		*dptr++ = *mptr++ * scalar;
 105.476 +	}
 105.477 +	return res;
 105.478 +}
 105.479 +
 105.480 +Matrix4x4 operator *(scalar_t scalar, const Matrix4x4 &mat)
 105.481 +{
 105.482 +	Matrix4x4 res;
 105.483 +	const scalar_t *mptr = mat.m[0];
 105.484 +	scalar_t *dptr = res.m[0];
 105.485 +
 105.486 +	for(int i=0; i<16; i++) {
 105.487 +		*dptr++ = *mptr++ * scalar;
 105.488 +	}
 105.489 +	return res;
 105.490 +}
 105.491 +
 105.492 +void operator *=(Matrix4x4 &mat, scalar_t scalar)
 105.493 +{
 105.494 +	scalar_t *mptr = mat.m[0];
 105.495 +
 105.496 +	for(int i=0; i<16; i++) {
 105.497 +		*mptr++ *= scalar;
 105.498 +	}
 105.499 +}
 105.500 +
 105.501 +void Matrix4x4::translate(const Vector3 &trans)
 105.502 +{
 105.503 +	Matrix4x4 tmat(1, 0, 0, trans.x, 0, 1, 0, trans.y, 0, 0, 1, trans.z, 0, 0, 0, 1);
 105.504 +	*this *= tmat;
 105.505 +}
 105.506 +
 105.507 +void Matrix4x4::set_translation(const Vector3 &trans)
 105.508 +{
 105.509 +	*this = Matrix4x4(1, 0, 0, trans.x, 0, 1, 0, trans.y, 0, 0, 1, trans.z, 0, 0, 0, 1);
 105.510 +}
 105.511 +
 105.512 +Vector3 Matrix4x4::get_translation() const
 105.513 +{
 105.514 +	return Vector3(m[0][3], m[1][3], m[2][3]);
 105.515 +}
 105.516 +
 105.517 +void Matrix4x4::rotate(const Vector3 &euler_angles)
 105.518 +{
 105.519 +	Matrix3x3 xrot, yrot, zrot;
 105.520 +
 105.521 +	xrot = Matrix3x3(	1,			0,					0,
 105.522 +						0,	cos(euler_angles.x),	-sin(euler_angles.x),
 105.523 +						0,	sin(euler_angles.x),	cos(euler_angles.x));
 105.524 +
 105.525 +	yrot = Matrix3x3(	cos(euler_angles.y),	0,	sin(euler_angles.y),
 105.526 +								0,				1,				0,
 105.527 +						-sin(euler_angles.y),	0,	cos(euler_angles.y));
 105.528 +
 105.529 +	zrot = Matrix3x3(	cos(euler_angles.z),	-sin(euler_angles.z),	0,
 105.530 +						sin(euler_angles.z),	cos(euler_angles.z),	0,
 105.531 +								0,						0,				1);
 105.532 +
 105.533 +	*this *= Matrix4x4(xrot * yrot * zrot);
 105.534 +}
 105.535 +
 105.536 +void Matrix4x4::set_rotation(const Vector3 &euler_angles)
 105.537 +{
 105.538 +	Matrix3x3 xrot, yrot, zrot;
 105.539 +
 105.540 +	xrot = Matrix3x3(	1,			0,					0,
 105.541 +						0,	cos(euler_angles.x),	-sin(euler_angles.x),
 105.542 +						0,	sin(euler_angles.x),	cos(euler_angles.x));
 105.543 +
 105.544 +	yrot = Matrix3x3(	cos(euler_angles.y),	0,	sin(euler_angles.y),
 105.545 +								0,				1,				0,
 105.546 +						-sin(euler_angles.y),	0,	cos(euler_angles.y));
 105.547 +
 105.548 +	zrot = Matrix3x3(	cos(euler_angles.z),	-sin(euler_angles.z),	0,
 105.549 +						sin(euler_angles.z),	cos(euler_angles.z),	0,
 105.550 +								0,						0,				1);
 105.551 +
 105.552 +	*this = Matrix4x4(xrot * yrot * zrot);
 105.553 +}
 105.554 +
 105.555 +void Matrix4x4::rotate(const Vector3 &axis, scalar_t angle)
 105.556 +{
 105.557 +	scalar_t sina = (scalar_t)sin(angle);
 105.558 +	scalar_t cosa = (scalar_t)cos(angle);
 105.559 +	scalar_t invcosa = 1-cosa;
 105.560 +	scalar_t nxsq = axis.x * axis.x;
 105.561 +	scalar_t nysq = axis.y * axis.y;
 105.562 +	scalar_t nzsq = axis.z * axis.z;
 105.563 +
 105.564 +	Matrix4x4 xform;
 105.565 +	xform[0][0] = nxsq + (1-nxsq) * cosa;
 105.566 +	xform[0][1] = axis.x * axis.y * invcosa - axis.z * sina;
 105.567 +	xform[0][2] = axis.x * axis.z * invcosa + axis.y * sina;
 105.568 +	xform[1][0] = axis.x * axis.y * invcosa + axis.z * sina;
 105.569 +	xform[1][1] = nysq + (1-nysq) * cosa;
 105.570 +	xform[1][2] = axis.y * axis.z * invcosa - axis.x * sina;
 105.571 +	xform[2][0] = axis.x * axis.z * invcosa - axis.y * sina;
 105.572 +	xform[2][1] = axis.y * axis.z * invcosa + axis.x * sina;
 105.573 +	xform[2][2] = nzsq + (1-nzsq) * cosa;
 105.574 +
 105.575 +	*this *= xform;
 105.576 +}
 105.577 +
 105.578 +void Matrix4x4::set_rotation(const Vector3 &axis, scalar_t angle)
 105.579 +{
 105.580 +	scalar_t sina = (scalar_t)sin(angle);
 105.581 +	scalar_t cosa = (scalar_t)cos(angle);
 105.582 +	scalar_t invcosa = 1-cosa;
 105.583 +	scalar_t nxsq = axis.x * axis.x;
 105.584 +	scalar_t nysq = axis.y * axis.y;
 105.585 +	scalar_t nzsq = axis.z * axis.z;
 105.586 +
 105.587 +	reset_identity();
 105.588 +	m[0][0] = nxsq + (1-nxsq) * cosa;
 105.589 +	m[0][1] = axis.x * axis.y * invcosa - axis.z * sina;
 105.590 +	m[0][2] = axis.x * axis.z * invcosa + axis.y * sina;
 105.591 +	m[1][0] = axis.x * axis.y * invcosa + axis.z * sina;
 105.592 +	m[1][1] = nysq + (1-nysq) * cosa;
 105.593 +	m[1][2] = axis.y * axis.z * invcosa - axis.x * sina;
 105.594 +	m[2][0] = axis.x * axis.z * invcosa - axis.y * sina;
 105.595 +	m[2][1] = axis.y * axis.z * invcosa + axis.x * sina;
 105.596 +	m[2][2] = nzsq + (1-nzsq) * cosa;
 105.597 +}
 105.598 +
 105.599 +void Matrix4x4::rotate(const Quaternion &quat)
 105.600 +{
 105.601 +	*this *= quat.get_rotation_matrix();
 105.602 +}
 105.603 +
 105.604 +void Matrix4x4::set_rotation(const Quaternion &quat)
 105.605 +{
 105.606 +	*this = quat.get_rotation_matrix();
 105.607 +}
 105.608 +
 105.609 +Quaternion Matrix4x4::get_rotation_quat() const
 105.610 +{
 105.611 +	Matrix3x3 mat3 = *this;
 105.612 +	return mat3.get_rotation_quat();
 105.613 +}
 105.614 +
 105.615 +void Matrix4x4::scale(const Vector4 &scale_vec)
 105.616 +{
 105.617 +	Matrix4x4 smat(	scale_vec.x, 0, 0, 0,
 105.618 +					0, scale_vec.y, 0, 0,
 105.619 +					0, 0, scale_vec.z, 0,
 105.620 +					0, 0, 0, scale_vec.w);
 105.621 +	*this *= smat;
 105.622 +}
 105.623 +
 105.624 +void Matrix4x4::set_scaling(const Vector4 &scale_vec)
 105.625 +{
 105.626 +	*this = Matrix4x4(	scale_vec.x, 0, 0, 0,
 105.627 +						0, scale_vec.y, 0, 0,
 105.628 +						0, 0, scale_vec.z, 0,
 105.629 +						0, 0, 0, scale_vec.w);
 105.630 +}
 105.631 +
 105.632 +Vector3 Matrix4x4::get_scaling() const
 105.633 +{
 105.634 +	Vector3 vi = get_row_vector(0);
 105.635 +	Vector3 vj = get_row_vector(1);
 105.636 +	Vector3 vk = get_row_vector(2);
 105.637 +
 105.638 +	return Vector3(vi.length(), vj.length(), vk.length());
 105.639 +}
 105.640 +
 105.641 +void Matrix4x4::set_frustum(float left, float right, float bottom, float top, float znear, float zfar)
 105.642 +{
 105.643 +	float dx = right - left;
 105.644 +	float dy = top - bottom;
 105.645 +	float dz = zfar - znear;
 105.646 +
 105.647 +	float a = (right + left) / dx;
 105.648 +	float b = (top + bottom) / dy;
 105.649 +	float c = -(zfar + znear) / dz;
 105.650 +	float d = -2.0 * zfar * znear / dz;
 105.651 +
 105.652 +	*this = Matrix4x4(2.0 * znear / dx, 0, a, 0,
 105.653 +			0, 2.0 * znear / dy, b, 0,
 105.654 +			0, 0, c, d,
 105.655 +			0, 0, -1, 0);
 105.656 +}
 105.657 +
 105.658 +void Matrix4x4::set_perspective(float vfov, float aspect, float znear, float zfar)
 105.659 +{
 105.660 +	float f = 1.0f / tan(vfov * 0.5f);
 105.661 +    float dz = znear - zfar;
 105.662 +
 105.663 +	reset_identity();
 105.664 +
 105.665 +	m[0][0] = f / aspect;
 105.666 +    m[1][1] = f;
 105.667 +    m[2][2] = (zfar + znear) / dz;
 105.668 +    m[3][2] = -1.0f;
 105.669 +    m[2][3] = 2.0f * zfar * znear / dz;
 105.670 +    m[3][3] = 0.0f;
 105.671 +}
 105.672 +
 105.673 +void Matrix4x4::set_orthographic(float left, float right, float bottom, float top, float znear, float zfar)
 105.674 +{
 105.675 +	float dx = right - left;
 105.676 +	float dy = top - bottom;
 105.677 +	float dz = zfar - znear;
 105.678 +
 105.679 +	reset_identity();
 105.680 +
 105.681 +	m[0][0] = 2.0 / dx;
 105.682 +	m[1][1] = 2.0 / dy;
 105.683 +	m[2][2] = -2.0 / dz;
 105.684 +	m[0][3] = -(right + left) / dx;
 105.685 +	m[1][3] = -(top + bottom) / dy;
 105.686 +	m[2][3] = -(zfar + znear) / dz;
 105.687 +}
 105.688 +
 105.689 +void Matrix4x4::set_lookat(const Vector3 &pos, const Vector3 &targ, const Vector3 &up)
 105.690 +{
 105.691 +	Vector3 vk = (targ - pos).normalized();
 105.692 +	Vector3 vj = up.normalized();
 105.693 +	Vector3 vi = cross_product(vk, vj).normalized();
 105.694 +	vj = cross_product(vi, vk);
 105.695 +
 105.696 +	*this = Matrix4x4(
 105.697 +			vi.x, vi.y, vi.z, 0,
 105.698 +			vj.x, vj.y, vj.z, 0,
 105.699 +			-vk.x, -vk.y, -vk.z, 0,
 105.700 +			0, 0, 0, 1);
 105.701 +	translate(-pos);
 105.702 +}
 105.703 +
 105.704 +void Matrix4x4::set_column_vector(const Vector4 &vec, unsigned int col_index)
 105.705 +{
 105.706 +	m[0][col_index] = vec.x;
 105.707 +	m[1][col_index] = vec.y;
 105.708 +	m[2][col_index] = vec.z;
 105.709 +	m[3][col_index] = vec.w;
 105.710 +}
 105.711 +
 105.712 +void Matrix4x4::set_row_vector(const Vector4 &vec, unsigned int row_index)
 105.713 +{
 105.714 +	m[row_index][0] = vec.x;
 105.715 +	m[row_index][1] = vec.y;
 105.716 +	m[row_index][2] = vec.z;
 105.717 +	m[row_index][3] = vec.w;
 105.718 +}
 105.719 +
 105.720 +Vector4 Matrix4x4::get_column_vector(unsigned int col_index) const
 105.721 +{
 105.722 +	return Vector4(m[0][col_index], m[1][col_index], m[2][col_index], m[3][col_index]);
 105.723 +}
 105.724 +
 105.725 +Vector4 Matrix4x4::get_row_vector(unsigned int row_index) const
 105.726 +{
 105.727 +	return Vector4(m[row_index][0], m[row_index][1], m[row_index][2], m[row_index][3]);
 105.728 +}
 105.729 +
 105.730 +void Matrix4x4::transpose()
 105.731 +{
 105.732 +	Matrix4x4 tmp = *this;
 105.733 +	for(int i=0; i<4; i++) {
 105.734 +		for(int j=0; j<4; j++) {
 105.735 +			m[i][j] = tmp[j][i];
 105.736 +		}
 105.737 +	}
 105.738 +}
 105.739 +
 105.740 +Matrix4x4 Matrix4x4::transposed() const
 105.741 +{
 105.742 +	Matrix4x4 res;
 105.743 +	for(int i=0; i<4; i++) {
 105.744 +		for(int j=0; j<4; j++) {
 105.745 +			res[i][j] = m[j][i];
 105.746 +		}
 105.747 +	}
 105.748 +	return res;
 105.749 +}
 105.750 +
 105.751 +scalar_t Matrix4x4::determinant() const
 105.752 +{
 105.753 +	scalar_t det11 =	(m[1][1] * (m[2][2] * m[3][3] - m[3][2] * m[2][3])) -
 105.754 +						(m[1][2] * (m[2][1] * m[3][3] - m[3][1] * m[2][3])) +
 105.755 +						(m[1][3] * (m[2][1] * m[3][2] - m[3][1] * m[2][2]));
 105.756 +
 105.757 +	scalar_t det12 =	(m[1][0] * (m[2][2] * m[3][3] - m[3][2] * m[2][3])) -
 105.758 +						(m[1][2] * (m[2][0] * m[3][3] - m[3][0] * m[2][3])) +
 105.759 +						(m[1][3] * (m[2][0] * m[3][2] - m[3][0] * m[2][2]));
 105.760 +
 105.761 +	scalar_t det13 =	(m[1][0] * (m[2][1] * m[3][3] - m[3][1] * m[2][3])) -
 105.762 +						(m[1][1] * (m[2][0] * m[3][3] - m[3][0] * m[2][3])) +
 105.763 +						(m[1][3] * (m[2][0] * m[3][1] - m[3][0] * m[2][1]));
 105.764 +
 105.765 +	scalar_t det14 =	(m[1][0] * (m[2][1] * m[3][2] - m[3][1] * m[2][2])) -
 105.766 +						(m[1][1] * (m[2][0] * m[3][2] - m[3][0] * m[2][2])) +
 105.767 +						(m[1][2] * (m[2][0] * m[3][1] - m[3][0] * m[2][1]));
 105.768 +
 105.769 +	return m[0][0] * det11 - m[0][1] * det12 + m[0][2] * det13 - m[0][3] * det14;
 105.770 +}
 105.771 +
 105.772 +
 105.773 +Matrix4x4 Matrix4x4::adjoint() const
 105.774 +{
 105.775 +	Matrix4x4 coef;
 105.776 +
 105.777 +	coef.m[0][0] =	(m[1][1] * (m[2][2] * m[3][3] - m[3][2] * m[2][3])) -
 105.778 +					(m[1][2] * (m[2][1] * m[3][3] - m[3][1] * m[2][3])) +
 105.779 +					(m[1][3] * (m[2][1] * m[3][2] - m[3][1] * m[2][2]));
 105.780 +	coef.m[0][1] =	(m[1][0] * (m[2][2] * m[3][3] - m[3][2] * m[2][3])) -
 105.781 +					(m[1][2] * (m[2][0] * m[3][3] - m[3][0] * m[2][3])) +
 105.782 +					(m[1][3] * (m[2][0] * m[3][2] - m[3][0] * m[2][2]));
 105.783 +	coef.m[0][2] =	(m[1][0] * (m[2][1] * m[3][3] - m[3][1] * m[2][3])) -
 105.784 +					(m[1][1] * (m[2][0] * m[3][3] - m[3][0] * m[2][3])) +
 105.785 +					(m[1][3] * (m[2][0] * m[3][1] - m[3][0] * m[2][1]));
 105.786 +	coef.m[0][3] =	(m[1][0] * (m[2][1] * m[3][2] - m[3][1] * m[2][2])) -
 105.787 +					(m[1][1] * (m[2][0] * m[3][2] - m[3][0] * m[2][2])) +
 105.788 +					(m[1][2] * (m[2][0] * m[3][1] - m[3][0] * m[2][1]));
 105.789 +
 105.790 +	coef.m[1][0] =	(m[0][1] * (m[2][2] * m[3][3] - m[3][2] * m[2][3])) -
 105.791 +					(m[0][2] * (m[2][1] * m[3][3] - m[3][1] * m[2][3])) +
 105.792 +					(m[0][3] * (m[2][1] * m[3][2] - m[3][1] * m[2][2]));
 105.793 +	coef.m[1][1] =	(m[0][0] * (m[2][2] * m[3][3] - m[3][2] * m[2][3])) -
 105.794 +					(m[0][2] * (m[2][0] * m[3][3] - m[3][0] * m[2][3])) +
 105.795 +					(m[0][3] * (m[2][0] * m[3][2] - m[3][0] * m[2][2]));
 105.796 +	coef.m[1][2] =	(m[0][0] * (m[2][1] * m[3][3] - m[3][1] * m[2][3])) -
 105.797 +					(m[0][1] * (m[2][0] * m[3][3] - m[3][0] * m[2][3])) +
 105.798 +					(m[0][3] * (m[2][0] * m[3][1] - m[3][0] * m[2][1]));
 105.799 +	coef.m[1][3] =	(m[0][0] * (m[2][1] * m[3][2] - m[3][1] * m[2][2])) -
 105.800 +					(m[0][1] * (m[2][0] * m[3][2] - m[3][0] * m[2][2])) +
 105.801 +					(m[0][2] * (m[2][0] * m[3][1] - m[3][0] * m[2][1]));
 105.802 +
 105.803 +	coef.m[2][0] =	(m[0][1] * (m[1][2] * m[3][3] - m[3][2] * m[1][3])) -
 105.804 +					(m[0][2] * (m[1][1] * m[3][3] - m[3][1] * m[1][3])) +
 105.805 +					(m[0][3] * (m[1][1] * m[3][2] - m[3][1] * m[1][2]));
 105.806 +	coef.m[2][1] =	(m[0][0] * (m[1][2] * m[3][3] - m[3][2] * m[1][3])) -
 105.807 +					(m[0][2] * (m[1][0] * m[3][3] - m[3][0] * m[1][3])) +
 105.808 +					(m[0][3] * (m[1][0] * m[3][2] - m[3][0] * m[1][2]));
 105.809 +	coef.m[2][2] =	(m[0][0] * (m[1][1] * m[3][3] - m[3][1] * m[1][3])) -
 105.810 +					(m[0][1] * (m[1][0] * m[3][3] - m[3][0] * m[1][3])) +
 105.811 +					(m[0][3] * (m[1][0] * m[3][1] - m[3][0] * m[1][1]));
 105.812 +	coef.m[2][3] =	(m[0][0] * (m[1][1] * m[3][2] - m[3][1] * m[1][2])) -
 105.813 +					(m[0][1] * (m[1][0] * m[3][2] - m[3][0] * m[1][2])) +
 105.814 +					(m[0][2] * (m[1][0] * m[3][1] - m[3][0] * m[1][1]));
 105.815 +
 105.816 +	coef.m[3][0] =	(m[0][1] * (m[1][2] * m[2][3] - m[2][2] * m[1][3])) -
 105.817 +					(m[0][2] * (m[1][1] * m[2][3] - m[2][1] * m[1][3])) +
 105.818 +					(m[0][3] * (m[1][1] * m[2][2] - m[2][1] * m[1][2]));
 105.819 +	coef.m[3][1] =	(m[0][0] * (m[1][2] * m[2][3] - m[2][2] * m[1][3])) -
 105.820 +					(m[0][2] * (m[1][0] * m[2][3] - m[2][0] * m[1][3])) +
 105.821 +					(m[0][3] * (m[1][0] * m[2][2] - m[2][0] * m[1][2]));
 105.822 +	coef.m[3][2] =	(m[0][0] * (m[1][1] * m[2][3] - m[2][1] * m[1][3])) -
 105.823 +					(m[0][1] * (m[1][0] * m[2][3] - m[2][0] * m[1][3])) +
 105.824 +					(m[0][3] * (m[1][0] * m[2][1] - m[2][0] * m[1][1]));
 105.825 +	coef.m[3][3] =	(m[0][0] * (m[1][1] * m[2][2] - m[2][1] * m[1][2])) -
 105.826 +					(m[0][1] * (m[1][0] * m[2][2] - m[2][0] * m[1][2])) +
 105.827 +					(m[0][2] * (m[1][0] * m[2][1] - m[2][0] * m[1][1]));
 105.828 +
 105.829 +	coef.transpose();
 105.830 +
 105.831 +	for(int i=0; i<4; i++) {
 105.832 +		for(int j=0; j<4; j++) {
 105.833 +			coef.m[i][j] = j%2 ? -coef.m[i][j] : coef.m[i][j];
 105.834 +			if(i%2) coef.m[i][j] = -coef.m[i][j];
 105.835 +		}
 105.836 +	}
 105.837 +
 105.838 +	return coef;
 105.839 +}
 105.840 +
 105.841 +Matrix4x4 Matrix4x4::inverse() const
 105.842 +{
 105.843 +	Matrix4x4 adj = adjoint();
 105.844 +
 105.845 +	return adj * (1.0f / determinant());
 105.846 +}
 105.847 +
 105.848 +ostream &operator <<(ostream &out, const Matrix4x4 &mat)
 105.849 +{
 105.850 +	for(int i=0; i<4; i++) {
 105.851 +		char str[100];
 105.852 +		sprintf(str, "[ %12.5f %12.5f %12.5f %12.5f ]\n", (float)mat.m[i][0], (float)mat.m[i][1], (float)mat.m[i][2], (float)mat.m[i][3]);
 105.853 +		out << str;
 105.854 +	}
 105.855 +	return out;
 105.856 +}
   106.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   106.2 +++ b/libs/vmath/matrix.h	Sun Nov 01 00:36:56 2015 +0200
   106.3 @@ -0,0 +1,264 @@
   106.4 +/*
   106.5 +libvmath - a vector math library
   106.6 +Copyright (C) 2004-2011 John Tsiombikas <nuclear@member.fsf.org>
   106.7 +
   106.8 +This program is free software: you can redistribute it and/or modify
   106.9 +it under the terms of the GNU Lesser General Public License as published
  106.10 +by the Free Software Foundation, either version 3 of the License, or
  106.11 +(at your option) any later version.
  106.12 +
  106.13 +This program is distributed in the hope that it will be useful,
  106.14 +but WITHOUT ANY WARRANTY; without even the implied warranty of
  106.15 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  106.16 +GNU Lesser General Public License for more details.
  106.17 +
  106.18 +You should have received a copy of the GNU Lesser General Public License
  106.19 +along with this program.  If not, see <http://www.gnu.org/licenses/>.
  106.20 +*/
  106.21 +
  106.22 +#ifndef VMATH_MATRIX_H_
  106.23 +#define VMATH_MATRIX_H_
  106.24 +
  106.25 +#include <stdio.h>
  106.26 +#include "vmath_types.h"
  106.27 +#include "vector.h"
  106.28 +
  106.29 +#ifdef __cplusplus
  106.30 +extern "C" {
  106.31 +#endif	/* __cplusplus */
  106.32 +
  106.33 +/* C matrix 3x3 functions */
  106.34 +static inline void m3_identity(mat3_t m);
  106.35 +static inline void m3_cons(mat3_t m,
  106.36 +		scalar_t m11, scalar_t m12, scalar_t m13,
  106.37 +		scalar_t m21, scalar_t m22, scalar_t m23,
  106.38 +		scalar_t m31, scalar_t m32, scalar_t m33);
  106.39 +static inline void m3_copy(mat3_t dest, mat3_t src);
  106.40 +void m3_to_m4(mat4_t dest, mat3_t src);
  106.41 +
  106.42 +void m3_print(FILE *fp, mat3_t m);
  106.43 +
  106.44 +/* C matrix 4x4 functions */
  106.45 +static inline void m4_identity(mat4_t m);
  106.46 +static inline void m4_cons(mat4_t m,
  106.47 +		scalar_t m11, scalar_t m12, scalar_t m13, scalar_t m14,
  106.48 +		scalar_t m21, scalar_t m22, scalar_t m23, scalar_t m24,
  106.49 +		scalar_t m31, scalar_t m32, scalar_t m33, scalar_t m34,
  106.50 +		scalar_t m41, scalar_t m42, scalar_t m43, scalar_t m44);
  106.51 +static inline void m4_copy(mat4_t dest, mat4_t src);
  106.52 +void m4_to_m3(mat3_t dest, mat4_t src);
  106.53 +
  106.54 +static inline void m4_mult(mat4_t res, mat4_t m1, mat4_t m2);
  106.55 +
  106.56 +void m4_set_translation(mat4_t m, scalar_t x, scalar_t y, scalar_t z);
  106.57 +void m4_translate(mat4_t m, scalar_t x, scalar_t y, scalar_t z);
  106.58 +
  106.59 +void m4_rotate(mat4_t m, scalar_t x, scalar_t y, scalar_t z);
  106.60 +
  106.61 +void m4_set_rotation_x(mat4_t m, scalar_t angle);
  106.62 +void m4_rotate_x(mat4_t m, scalar_t angle);
  106.63 +void m4_set_rotation_y(mat4_t m, scalar_t angle);
  106.64 +void m4_rotate_y(mat4_t m, scalar_t angle);
  106.65 +void m4_set_rotation_z(mat4_t m, scalar_t angle);
  106.66 +void m4_rotate_z(mat4_t m, scalar_t angle);
  106.67 +/* axis-angle rotation */
  106.68 +void m4_set_rotation_axis(mat4_t m, scalar_t angle, scalar_t x, scalar_t y, scalar_t z);
  106.69 +void m4_rotate_axis(mat4_t m, scalar_t angle, scalar_t x, scalar_t y, scalar_t z);
  106.70 +/* concatentate a rotation quaternion */
  106.71 +void m4_rotate_quat(mat4_t m, quat_t q);
  106.72 +
  106.73 +void m4_set_scaling(mat4_t m, scalar_t x, scalar_t y, scalar_t z);
  106.74 +void m4_scale(mat4_t m, scalar_t x, scalar_t y, scalar_t z);
  106.75 +
  106.76 +static inline void m4_set_column(mat4_t m, vec4_t v, int idx);
  106.77 +static inline void m4_set_row(mat4_t m, vec4_t v, int idx);
  106.78 +
  106.79 +void m4_transpose(mat4_t res, mat4_t m);
  106.80 +scalar_t m4_determinant(mat4_t m);
  106.81 +void m4_adjoint(mat4_t res, mat4_t m);
  106.82 +void m4_inverse(mat4_t res, mat4_t m);
  106.83 +
  106.84 +void m4_print(FILE *fp, mat4_t m);
  106.85 +
  106.86 +#ifdef __cplusplus
  106.87 +}
  106.88 +
  106.89 +/* when included from C++ source files, also define the matrix classes */
  106.90 +#include <iostream>
  106.91 +
  106.92 +/** 3x3 matrix */
  106.93 +class Matrix3x3 {
  106.94 +public:
  106.95 +	scalar_t m[3][3];
  106.96 +
  106.97 +	static Matrix3x3 identity;
  106.98 +
  106.99 +	Matrix3x3();
 106.100 +	Matrix3x3(	scalar_t m11, scalar_t m12, scalar_t m13,
 106.101 +				scalar_t m21, scalar_t m22, scalar_t m23,
 106.102 +				scalar_t m31, scalar_t m32, scalar_t m33);
 106.103 +	Matrix3x3(const Vector3 &ivec, const Vector3 &jvec, const Vector3 &kvec);
 106.104 +	Matrix3x3(const mat3_t cmat);
 106.105 +
 106.106 +	Matrix3x3(const Matrix4x4 &mat4x4);
 106.107 +
 106.108 +	/* binary operations matrix (op) matrix */
 106.109 +	friend Matrix3x3 operator +(const Matrix3x3 &m1, const Matrix3x3 &m2);
 106.110 +	friend Matrix3x3 operator -(const Matrix3x3 &m1, const Matrix3x3 &m2);
 106.111 +	friend Matrix3x3 operator *(const Matrix3x3 &m1, const Matrix3x3 &m2);
 106.112 +
 106.113 +	friend void operator +=(Matrix3x3 &m1, const Matrix3x3 &m2);
 106.114 +	friend void operator -=(Matrix3x3 &m1, const Matrix3x3 &m2);
 106.115 +	friend void operator *=(Matrix3x3 &m1, const Matrix3x3 &m2);
 106.116 +
 106.117 +	/* binary operations matrix (op) scalar and scalar (op) matrix */
 106.118 +	friend Matrix3x3 operator *(const Matrix3x3 &mat, scalar_t scalar);
 106.119 +	friend Matrix3x3 operator *(scalar_t scalar, const Matrix3x3 &mat);
 106.120 +
 106.121 +	friend void operator *=(Matrix3x3 &mat, scalar_t scalar);
 106.122 +
 106.123 +	inline scalar_t *operator [](int index);
 106.124 +	inline const scalar_t *operator [](int index) const;
 106.125 +
 106.126 +	inline void reset_identity();
 106.127 +
 106.128 +	void translate(const Vector2 &trans);
 106.129 +	void set_translation(const Vector2 &trans);
 106.130 +
 106.131 +	void rotate(scalar_t angle);						/* 2d rotation */
 106.132 +	void rotate(const Vector3 &euler_angles);			/* 3d rotation with euler angles */
 106.133 +	void rotate(const Vector3 &axis, scalar_t angle);	/* 3d axis/angle rotation */
 106.134 +	void set_rotation(scalar_t angle);
 106.135 +	void set_rotation(const Vector3 &euler_angles);
 106.136 +	void set_rotation(const Vector3 &axis, scalar_t angle);
 106.137 +	Quaternion get_rotation_quat() const;
 106.138 +
 106.139 +	void scale(const Vector3 &scale_vec);
 106.140 +	void set_scaling(const Vector3 &scale_vec);
 106.141 +
 106.142 +	void set_column_vector(const Vector3 &vec, unsigned int col_index);
 106.143 +	void set_row_vector(const Vector3 &vec, unsigned int row_index);
 106.144 +	Vector3 get_column_vector(unsigned int col_index) const;
 106.145 +	Vector3 get_row_vector(unsigned int row_index) const;
 106.146 +
 106.147 +	void transpose();
 106.148 +	Matrix3x3 transposed() const;
 106.149 +	scalar_t determinant() const;
 106.150 +	Matrix3x3 inverse() const;
 106.151 +
 106.152 +	friend std::ostream &operator <<(std::ostream &out, const Matrix3x3 &mat);
 106.153 +};
 106.154 +
 106.155 +/* binary operations matrix (op) matrix */
 106.156 +Matrix3x3 operator +(const Matrix3x3 &m1, const Matrix3x3 &m2);
 106.157 +Matrix3x3 operator -(const Matrix3x3 &m1, const Matrix3x3 &m2);
 106.158 +Matrix3x3 operator *(const Matrix3x3 &m1, const Matrix3x3 &m2);
 106.159 +
 106.160 +void operator +=(Matrix3x3 &m1, const Matrix3x3 &m2);
 106.161 +void operator -=(Matrix3x3 &m1, const Matrix3x3 &m2);
 106.162 +void operator *=(Matrix3x3 &m1, const Matrix3x3 &m2);
 106.163 +
 106.164 +/* binary operations matrix (op) scalar and scalar (op) matrix */
 106.165 +Matrix3x3 operator *(const Matrix3x3 &mat, scalar_t scalar);
 106.166 +Matrix3x3 operator *(scalar_t scalar, const Matrix3x3 &mat);
 106.167 +
 106.168 +void operator *=(Matrix3x3 &mat, scalar_t scalar);
 106.169 +
 106.170 +std::ostream &operator <<(std::ostream &out, const Matrix3x3 &mat);
 106.171 +
 106.172 +
 106.173 +
 106.174 +/** 4x4 matrix */
 106.175 +class Matrix4x4 {
 106.176 +public:
 106.177 +	scalar_t m[4][4];
 106.178 +
 106.179 +	static Matrix4x4 identity;
 106.180 +
 106.181 +	Matrix4x4();
 106.182 +	Matrix4x4(	scalar_t m11, scalar_t m12, scalar_t m13, scalar_t m14,
 106.183 +				scalar_t m21, scalar_t m22, scalar_t m23, scalar_t m24,
 106.184 +				scalar_t m31, scalar_t m32, scalar_t m33, scalar_t m34,
 106.185 +				scalar_t m41, scalar_t m42, scalar_t m43, scalar_t m44);
 106.186 +	Matrix4x4(const mat4_t cmat);
 106.187 +
 106.188 +	Matrix4x4(const Matrix3x3 &mat3x3);
 106.189 +
 106.190 +	/* binary operations matrix (op) matrix */
 106.191 +	friend Matrix4x4 operator +(const Matrix4x4 &m1, const Matrix4x4 &m2);
 106.192 +	friend Matrix4x4 operator -(const Matrix4x4 &m1, const Matrix4x4 &m2);
 106.193 +	friend Matrix4x4 operator *(const Matrix4x4 &m1, const Matrix4x4 &m2);
 106.194 +
 106.195 +	friend void operator +=(Matrix4x4 &m1, const Matrix4x4 &m2);
 106.196 +	friend void operator -=(Matrix4x4 &m1, const Matrix4x4 &m2);
 106.197 +	friend inline void operator *=(Matrix4x4 &m1, const Matrix4x4 &m2);
 106.198 +
 106.199 +	/* binary operations matrix (op) scalar and scalar (op) matrix */
 106.200 +	friend Matrix4x4 operator *(const Matrix4x4 &mat, scalar_t scalar);
 106.201 +	friend Matrix4x4 operator *(scalar_t scalar, const Matrix4x4 &mat);
 106.202 +
 106.203 +	friend void operator *=(Matrix4x4 &mat, scalar_t scalar);
 106.204 +
 106.205 +	inline scalar_t *operator [](int index);
 106.206 +	inline const scalar_t *operator [](int index) const;
 106.207 +
 106.208 +	inline void reset_identity();
 106.209 +
 106.210 +	void translate(const Vector3 &trans);
 106.211 +	void set_translation(const Vector3 &trans);
 106.212 +	Vector3 get_translation() const;	/* extract translation */
 106.213 +
 106.214 +	void rotate(const Vector3 &euler_angles);			/* 3d rotation with euler angles */
 106.215 +	void rotate(const Vector3 &axis, scalar_t angle);	/* 3d axis/angle rotation */
 106.216 +	void rotate(const Quaternion &quat);
 106.217 +	void set_rotation(const Vector3 &euler_angles);
 106.218 +	void set_rotation(const Vector3 &axis, scalar_t angle);
 106.219 +	void set_rotation(const Quaternion &quat);
 106.220 +	Quaternion get_rotation_quat() const;		/* extract rotation */
 106.221 +
 106.222 +	void scale(const Vector4 &scale_vec);
 106.223 +	void set_scaling(const Vector4 &scale_vec);
 106.224 +	Vector3 get_scaling() const;		/* extract scaling */
 106.225 +
 106.226 +	void set_frustum(float left, float right, float top, float bottom, float znear, float zfar);
 106.227 +	void set_perspective(float vfov, float aspect, float znear, float zfar);
 106.228 +	void set_orthographic(float left, float right, float bottom, float top, float znear = -1.0, float zfar = 1.0);
 106.229 +
 106.230 +	void set_lookat(const Vector3 &pos, const Vector3 &targ = Vector3(0, 0, 0), const Vector3 &up = Vector3(0, 1, 0));
 106.231 +
 106.232 +	void set_column_vector(const Vector4 &vec, unsigned int col_index);
 106.233 +	void set_row_vector(const Vector4 &vec, unsigned int row_index);
 106.234 +	Vector4 get_column_vector(unsigned int col_index) const;
 106.235 +	Vector4 get_row_vector(unsigned int row_index) const;
 106.236 +
 106.237 +	void transpose();
 106.238 +	Matrix4x4 transposed() const;
 106.239 +	scalar_t determinant() const;
 106.240 +	Matrix4x4 adjoint() const;
 106.241 +	Matrix4x4 inverse() const;
 106.242 +
 106.243 +	friend std::ostream &operator <<(std::ostream &out, const Matrix4x4 &mat);
 106.244 +};
 106.245 +
 106.246 +/* binary operations matrix (op) matrix */
 106.247 +Matrix4x4 operator +(const Matrix4x4 &m1, const Matrix4x4 &m2);
 106.248 +Matrix4x4 operator -(const Matrix4x4 &m1, const Matrix4x4 &m2);
 106.249 +inline Matrix4x4 operator *(const Matrix4x4 &m1, const Matrix4x4 &m2);
 106.250 +
 106.251 +void operator +=(Matrix4x4 &m1, const Matrix4x4 &m2);
 106.252 +void operator -=(Matrix4x4 &m1, const Matrix4x4 &m2);
 106.253 +inline void operator *=(Matrix4x4 &m1, const Matrix4x4 &m2);
 106.254 +
 106.255 +/* binary operations matrix (op) scalar and scalar (op) matrix */
 106.256 +Matrix4x4 operator *(const Matrix4x4 &mat, scalar_t scalar);
 106.257 +Matrix4x4 operator *(scalar_t scalar, const Matrix4x4 &mat);
 106.258 +
 106.259 +void operator *=(Matrix4x4 &mat, scalar_t scalar);
 106.260 +
 106.261 +std::ostream &operator <<(std::ostream &out, const Matrix4x4 &mat);
 106.262 +
 106.263 +#endif	/* __cplusplus */
 106.264 +
 106.265 +#include "matrix.inl"
 106.266 +
 106.267 +#endif	/* VMATH_MATRIX_H_ */
   107.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   107.2 +++ b/libs/vmath/matrix.inl	Sun Nov 01 00:36:56 2015 +0200
   107.3 @@ -0,0 +1,200 @@
   107.4 +/*
   107.5 +libvmath - a vector math library
   107.6 +Copyright (C) 2004-2011 John Tsiombikas <nuclear@member.fsf.org>
   107.7 +
   107.8 +This program is free software: you can redistribute it and/or modify
   107.9 +it under the terms of the GNU Lesser General Public License as published
  107.10 +by the Free Software Foundation, either version 3 of the License, or
  107.11 +(at your option) any later version.
  107.12 +
  107.13 +This program is distributed in the hope that it will be useful,
  107.14 +but WITHOUT ANY WARRANTY; without even the implied warranty of
  107.15 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  107.16 +GNU Lesser General Public License for more details.
  107.17 +
  107.18 +You should have received a copy of the GNU Lesser General Public License
  107.19 +along with this program.  If not, see <http://www.gnu.org/licenses/>.
  107.20 +*/
  107.21 +
  107.22 +#include <string.h>
  107.23 +
  107.24 +#ifdef __cplusplus
  107.25 +extern "C" {
  107.26 +#endif	/* __cplusplus */
  107.27 +
  107.28 +/* C matrix 3x3 functions */
  107.29 +static inline void m3_identity(mat3_t m)
  107.30 +{
  107.31 +	static const mat3_t id = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}};
  107.32 +	memcpy(m, id, sizeof id);
  107.33 +}
  107.34 +
  107.35 +static inline void m3_cons(mat3_t m,
  107.36 +		scalar_t m11, scalar_t m12, scalar_t m13,
  107.37 +		scalar_t m21, scalar_t m22, scalar_t m23,
  107.38 +		scalar_t m31, scalar_t m32, scalar_t m33)
  107.39 +{
  107.40 +	m[0][0] = m11; m[0][1] = m12; m[0][2] = m13;
  107.41 +	m[1][0] = m21; m[1][1] = m22; m[1][2] = m23;
  107.42 +	m[2][0] = m31; m[2][1] = m32; m[2][2] = m33;
  107.43 +}
  107.44 +
  107.45 +static inline void m3_copy(mat3_t dest, mat3_t src)
  107.46 +{
  107.47 +	memcpy(dest, src, sizeof(mat3_t));
  107.48 +}
  107.49 +
  107.50 +
  107.51 +/* C matrix 4x4 functions */
  107.52 +static inline void m4_identity(mat4_t m)
  107.53 +{
  107.54 +	static const mat4_t id = {{1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, 1, 0}, {0, 0, 0, 1}};
  107.55 +	memcpy(m, id, sizeof id);
  107.56 +}
  107.57 +
  107.58 +static inline void m4_cons(mat4_t m,
  107.59 +		scalar_t m11, scalar_t m12, scalar_t m13, scalar_t m14,
  107.60 +		scalar_t m21, scalar_t m22, scalar_t m23, scalar_t m24,
  107.61 +		scalar_t m31, scalar_t m32, scalar_t m33, scalar_t m34,
  107.62 +		scalar_t m41, scalar_t m42, scalar_t m43, scalar_t m44)
  107.63 +{
  107.64 +	m[0][0] = m11; m[0][1] = m12; m[0][2] = m13; m[0][3] = m14;
  107.65 +	m[1][0] = m21; m[1][1] = m22; m[1][2] = m23; m[1][3] = m24;
  107.66 +	m[2][0] = m31; m[2][1] = m32; m[2][2] = m33; m[2][3] = m34;
  107.67 +	m[3][0] = m41; m[3][1] = m42; m[3][2] = m43; m[3][3] = m44;
  107.68 +}
  107.69 +
  107.70 +static inline void m4_copy(mat4_t dest, mat4_t src)
  107.71 +{
  107.72 +	memcpy(dest, src, sizeof(mat4_t));
  107.73 +}
  107.74 +
  107.75 +static inline void m4_mult(mat4_t res, mat4_t m1, mat4_t m2)
  107.76 +{
  107.77 +	mat4_t tmp;
  107.78 +
  107.79 +	/*
  107.80 +	int i, j;
  107.81 +	for(i=0; i<4; i++) {
  107.82 +		for(j=0; j<4; j++) {
  107.83 +			tmp[i][j] = m1[i][0] * m2[0][j] + m1[i][1] * m2[1][j] + m1[i][2] * m2[2][j] + m1[i][3] * m2[3][j];
  107.84 +		}
  107.85 +	}
  107.86 +	*/
  107.87 +
  107.88 +	tmp[0][0] = m1[0][0] * m2[0][0] + m1[0][1] * m2[1][0] + m1[0][2] * m2[2][0] + m1[0][3] * m2[3][0];
  107.89 +	tmp[0][1] = m1[0][0] * m2[0][1] + m1[0][1] * m2[1][1] + m1[0][2] * m2[2][1] + m1[0][3] * m2[3][1];
  107.90 +	tmp[0][2] = m1[0][0] * m2[0][2] + m1[0][1] * m2[1][2] + m1[0][2] * m2[2][2] + m1[0][3] * m2[3][2];
  107.91 +	tmp[0][3] = m1[0][0] * m2[0][3] + m1[0][1] * m2[1][3] + m1[0][2] * m2[2][3] + m1[0][3] * m2[3][3];
  107.92 +
  107.93 +	tmp[1][0] = m1[1][0] * m2[0][0] + m1[1][1] * m2[1][0] + m1[1][2] * m2[2][0] + m1[1][3] * m2[3][0];
  107.94 +	tmp[1][1] = m1[1][0] * m2[0][1] + m1[1][1] * m2[1][1] + m1[1][2] * m2[2][1] + m1[1][3] * m2[3][1];
  107.95 +	tmp[1][2] = m1[1][0] * m2[0][2] + m1[1][1] * m2[1][2] + m1[1][2] * m2[2][2] + m1[1][3] * m2[3][2];
  107.96 +	tmp[1][3] = m1[1][0] * m2[0][3] + m1[1][1] * m2[1][3] + m1[1][2] * m2[2][3] + m1[1][3] * m2[3][3];
  107.97 +
  107.98 +	tmp[2][0] = m1[2][0] * m2[0][0] + m1[2][1] * m2[1][0] + m1[2][2] * m2[2][0] + m1[2][3] * m2[3][0];
  107.99 +	tmp[2][1] = m1[2][0] * m2[0][1] + m1[2][1] * m2[1][1] + m1[2][2] * m2[2][1] + m1[2][3] * m2[3][1];
 107.100 +	tmp[2][2] = m1[2][0] * m2[0][2] + m1[2][1] * m2[1][2] + m1[2][2] * m2[2][2] + m1[2][3] * m2[3][2];
 107.101 +	tmp[2][3] = m1[2][0] * m2[0][3] + m1[2][1] * m2[1][3] + m1[2][2] * m2[2][3] + m1[2][3] * m2[3][3];
 107.102 +
 107.103 +	tmp[3][0] = m1[3][0] * m2[0][0] + m1[3][1] * m2[1][0] + m1[3][2] * m2[2][0] + m1[3][3] * m2[3][0];
 107.104 +	tmp[3][1] = m1[3][0] * m2[0][1] + m1[3][1] * m2[1][1] + m1[3][2] * m2[2][1] + m1[3][3] * m2[3][1];
 107.105 +	tmp[3][2] = m1[3][0] * m2[0][2] + m1[3][1] * m2[1][2] + m1[3][2] * m2[2][2] + m1[3][3] * m2[3][2];
 107.106 +	tmp[3][3] = m1[3][0] * m2[0][3] + m1[3][1] * m2[1][3] + m1[3][2] * m2[2][3] + m1[3][3] * m2[3][3];
 107.107 +
 107.108 +	m4_copy(res, tmp);
 107.109 +}
 107.110 +
 107.111 +static inline void m4_set_column(mat4_t m, vec4_t v, int idx)
 107.112 +{
 107.113 +	m[0][idx] = v.x;
 107.114 +	m[1][idx] = v.y;
 107.115 +	m[2][idx] = v.z;
 107.116 +	m[3][idx] = v.w;
 107.117 +}
 107.118 +
 107.119 +static inline void m4_set_row(mat4_t m, vec4_t v, int idx)
 107.120 +{
 107.121 +	m[idx][0] = v.x;
 107.122 +	m[idx][1] = v.y;
 107.123 +	m[idx][2] = v.z;
 107.124 +	m[idx][3] = v.w;
 107.125 +}
 107.126 +
 107.127 +#ifdef __cplusplus
 107.128 +}	/* extern "C" */
 107.129 +
 107.130 +
 107.131 +/* unrolled to hell and inline */
 107.132 +inline Matrix4x4 operator *(const Matrix4x4 &m1, const Matrix4x4 &m2)
 107.133 +{
 107.134 +	Matrix4x4 res;
 107.135 +
 107.136 +	/*
 107.137 +	for(i=0; i<4; i++) {
 107.138 +		for(j=0; j<4; j++) {
 107.139 +			res.m[i][j] = m1.m[i][0] * m2.m[0][j] + m1.m[i][1] * m2.m[1][j] + m1.m[i][2] * m2.m[2][j] + m1.m[i][3] * m2.m[3][j];
 107.140 +		}
 107.141 +	}
 107.142 +	*/
 107.143 +
 107.144 +	res.m[0][0] = m1.m[0][0] * m2.m[0][0] + m1.m[0][1] * m2.m[1][0] + m1.m[0][2] * m2.m[2][0] + m1.m[0][3] * m2.m[3][0];
 107.145 +	res.m[0][1] = m1.m[0][0] * m2.m[0][1] + m1.m[0][1] * m2.m[1][1] + m1.m[0][2] * m2.m[2][1] + m1.m[0][3] * m2.m[3][1];
 107.146 +	res.m[0][2] = m1.m[0][0] * m2.m[0][2] + m1.m[0][1] * m2.m[1][2] + m1.m[0][2] * m2.m[2][2] + m1.m[0][3] * m2.m[3][2];
 107.147 +	res.m[0][3] = m1.m[0][0] * m2.m[0][3] + m1.m[0][1] * m2.m[1][3] + m1.m[0][2] * m2.m[2][3] + m1.m[0][3] * m2.m[3][3];
 107.148 +
 107.149 +	res.m[1][0] = m1.m[1][0] * m2.m[0][0] + m1.m[1][1] * m2.m[1][0] + m1.m[1][2] * m2.m[2][0] + m1.m[1][3] * m2.m[3][0];
 107.150 +	res.m[1][1] = m1.m[1][0] * m2.m[0][1] + m1.m[1][1] * m2.m[1][1] + m1.m[1][2] * m2.m[2][1] + m1.m[1][3] * m2.m[3][1];
 107.151 +	res.m[1][2] = m1.m[1][0] * m2.m[0][2] + m1.m[1][1] * m2.m[1][2] + m1.m[1][2] * m2.m[2][2] + m1.m[1][3] * m2.m[3][2];
 107.152 +	res.m[1][3] = m1.m[1][0] * m2.m[0][3] + m1.m[1][1] * m2.m[1][3] + m1.m[1][2] * m2.m[2][3] + m1.m[1][3] * m2.m[3][3];
 107.153 +
 107.154 +	res.m[2][0] = m1.m[2][0] * m2.m[0][0] + m1.m[2][1] * m2.m[1][0] + m1.m[2][2] * m2.m[2][0] + m1.m[2][3] * m2.m[3][0];
 107.155 +	res.m[2][1] = m1.m[2][0] * m2.m[0][1] + m1.m[2][1] * m2.m[1][1] + m1.m[2][2] * m2.m[2][1] + m1.m[2][3] * m2.m[3][1];
 107.156 +	res.m[2][2] = m1.m[2][0] * m2.m[0][2] + m1.m[2][1] * m2.m[1][2] + m1.m[2][2] * m2.m[2][2] + m1.m[2][3] * m2.m[3][2];
 107.157 +	res.m[2][3] = m1.m[2][0] * m2.m[0][3] + m1.m[2][1] * m2.m[1][3] + m1.m[2][2] * m2.m[2][3] + m1.m[2][3] * m2.m[3][3];
 107.158 +
 107.159 +	res.m[3][0] = m1.m[3][0] * m2.m[0][0] + m1.m[3][1] * m2.m[1][0] + m1.m[3][2] * m2.m[2][0] + m1.m[3][3] * m2.m[3][0];
 107.160 +	res.m[3][1] = m1.m[3][0] * m2.m[0][1] + m1.m[3][1] * m2.m[1][1] + m1.m[3][2] * m2.m[2][1] + m1.m[3][3] * m2.m[3][1];
 107.161 +	res.m[3][2] = m1.m[3][0] * m2.m[0][2] + m1.m[3][1] * m2.m[1][2] + m1.m[3][2] * m2.m[2][2] + m1.m[3][3] * m2.m[3][2];
 107.162 +	res.m[3][3] = m1.m[3][0] * m2.m[0][3] + m1.m[3][1] * m2.m[1][3] + m1.m[3][2] * m2.m[2][3] + m1.m[3][3] * m2.m[3][3];
 107.163 +
 107.164 +	return res;
 107.165 +}
 107.166 +
 107.167 +inline void operator *=(Matrix4x4 &m1, const Matrix4x4 &m2)
 107.168 +{
 107.169 +	Matrix4x4 res = m1 * m2;
 107.170 +	m1 = res;
 107.171 +}
 107.172 +
 107.173 +
 107.174 +inline scalar_t *Matrix3x3::operator [](int index)
 107.175 +{
 107.176 +	return m[index];
 107.177 +}
 107.178 +
 107.179 +inline const scalar_t *Matrix3x3::operator [](int index) const
 107.180 +{
 107.181 +	return m[index];
 107.182 +}
 107.183 +
 107.184 +inline void Matrix3x3::reset_identity()
 107.185 +{
 107.186 +	*this = identity;
 107.187 +}
 107.188 +
 107.189 +inline scalar_t *Matrix4x4::operator [](int index)
 107.190 +{
 107.191 +	return m[index];
 107.192 +}
 107.193 +
 107.194 +inline const scalar_t *Matrix4x4::operator [](int index) const
 107.195 +{
 107.196 +	return m[index];
 107.197 +}
 107.198 +
 107.199 +inline void Matrix4x4::reset_identity()
 107.200 +{
 107.201 +	*this = identity;
 107.202 +}
 107.203 +#endif	/* __cplusplus */
   108.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   108.2 +++ b/libs/vmath/matrix_c.c	Sun Nov 01 00:36:56 2015 +0200
   108.3 @@ -0,0 +1,292 @@
   108.4 +/*
   108.5 +libvmath - a vector math library
   108.6 +Copyright (C) 2004-2011 John Tsiombikas <nuclear@member.fsf.org>
   108.7 +
   108.8 +This program is free software: you can redistribute it and/or modify
   108.9 +it under the terms of the GNU Lesser General Public License as published
  108.10 +by the Free Software Foundation, either version 3 of the License, or
  108.11 +(at your option) any later version.
  108.12 +
  108.13 +This program is distributed in the hope that it will be useful,
  108.14 +but WITHOUT ANY WARRANTY; without even the implied warranty of
  108.15 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  108.16 +GNU Lesser General Public License for more details.
  108.17 +
  108.18 +You should have received a copy of the GNU Lesser General Public License
  108.19 +along with this program.  If not, see <http://www.gnu.org/licenses/>.
  108.20 +*/
  108.21 +
  108.22 +
  108.23 +#include <stdio.h>
  108.24 +#include "matrix.h"
  108.25 +#include "vector.h"
  108.26 +#include "quat.h"
  108.27 +
  108.28 +void m3_to_m4(mat4_t dest, mat3_t src)
  108.29 +{
  108.30 +	int i, j;
  108.31 +
  108.32 +	memset(dest, 0, sizeof(mat4_t));
  108.33 +	for(i=0; i<3; i++) {
  108.34 +		for(j=0; j<3; j++) {
  108.35 +			dest[i][j] = src[i][j];
  108.36 +		}
  108.37 +	}
  108.38 +	dest[3][3] = 1.0;
  108.39 +}
  108.40 +
  108.41 +void m3_print(FILE *fp, mat3_t m)
  108.42 +{
  108.43 +	int i;
  108.44 +	for(i=0; i<3; i++) {
  108.45 +		fprintf(fp, "[ %12.5f %12.5f %12.5f ]\n", (float)m[i][0], (float)m[i][1], (float)m[i][2]);
  108.46 +	}
  108.47 +}
  108.48 +
  108.49 +/* C matrix 4x4 functions */
  108.50 +void m4_to_m3(mat3_t dest, mat4_t src)
  108.51 +{
  108.52 +	int i, j;
  108.53 +	for(i=0; i<3; i++) {
  108.54 +		for(j=0; j<3; j++) {
  108.55 +			dest[i][j] = src[i][j];
  108.56 +		}
  108.57 +	}
  108.58 +}
  108.59 +
  108.60 +void m4_set_translation(mat4_t m, scalar_t x, scalar_t y, scalar_t z)
  108.61 +{
  108.62 +	m4_identity(m);
  108.63 +	m[0][3] = x;
  108.64 +	m[1][3] = y;
  108.65 +	m[2][3] = z;
  108.66 +}
  108.67 +
  108.68 +void m4_translate(mat4_t m, scalar_t x, scalar_t y, scalar_t z)
  108.69 +{
  108.70 +	mat4_t tm;
  108.71 +	m4_set_translation(tm, x, y, z);
  108.72 +	m4_mult(m, m, tm);
  108.73 +}
  108.74 +
  108.75 +void m4_rotate(mat4_t m, scalar_t x, scalar_t y, scalar_t z)
  108.76 +{
  108.77 +	m4_rotate_x(m, x);
  108.78 +	m4_rotate_y(m, y);
  108.79 +	m4_rotate_z(m, z);
  108.80 +}
  108.81 +
  108.82 +void m4_set_rotation_x(mat4_t m, scalar_t angle)
  108.83 +{
  108.84 +	m4_identity(m);
  108.85 +	m[1][1] = cos(angle); m[1][2] = -sin(angle);
  108.86 +	m[2][1] = sin(angle); m[2][2] = cos(angle);
  108.87 +}
  108.88 +
  108.89 +void m4_rotate_x(mat4_t m, scalar_t angle)
  108.90 +{
  108.91 +	mat4_t rm;
  108.92 +	m4_set_rotation_x(rm, angle);
  108.93 +	m4_mult(m, m, rm);
  108.94 +}
  108.95 +
  108.96 +void m4_set_rotation_y(mat4_t m, scalar_t angle)
  108.97 +{
  108.98 +	m4_identity(m);
  108.99 +	m[0][0] = cos(angle); m[0][2] = sin(angle);
 108.100 +	m[2][0] = -sin(angle); m[2][2] = cos(angle);
 108.101 +}
 108.102 +
 108.103 +void m4_rotate_y(mat4_t m, scalar_t angle)
 108.104 +{
 108.105 +	mat4_t rm;
 108.106 +	m4_set_rotation_y(rm, angle);
 108.107 +	m4_mult(m, m, rm);
 108.108 +}
 108.109 +
 108.110 +void m4_set_rotation_z(mat4_t m, scalar_t angle)
 108.111 +{
 108.112 +	m4_identity(m);
 108.113 +	m[0][0] = cos(angle); m[0][1] = -sin(angle);
 108.114 +	m[1][0] = sin(angle); m[1][1] = cos(angle);
 108.115 +}
 108.116 +
 108.117 +void m4_rotate_z(mat4_t m, scalar_t angle)
 108.118 +{
 108.119 +	mat4_t rm;
 108.120 +	m4_set_rotation_z(rm, angle);
 108.121 +	m4_mult(m, m, rm);
 108.122 +}
 108.123 +
 108.124 +void m4_set_rotation_axis(mat4_t m, scalar_t angle, scalar_t x, scalar_t y, scalar_t z)
 108.125 +{
 108.126 +	scalar_t sina = sin(angle);
 108.127 +	scalar_t cosa = cos(angle);
 108.128 +	scalar_t one_minus_cosa = 1.0 - cosa;
 108.129 +	scalar_t nxsq = x * x;
 108.130 +	scalar_t nysq = y * y;
 108.131 +	scalar_t nzsq = z * z;
 108.132 +
 108.133 +	m[0][0] = nxsq + (1.0 - nxsq) * cosa;
 108.134 +	m[0][1] = x * y * one_minus_cosa - z * sina;
 108.135 +	m[0][2] = x * z * one_minus_cosa + y * sina;
 108.136 +	m[1][0] = x * y * one_minus_cosa + z * sina;
 108.137 +	m[1][1] = nysq + (1.0 - nysq) * cosa;
 108.138 +	m[1][2] = y * z * one_minus_cosa - x * sina;
 108.139 +	m[2][0] = x * z * one_minus_cosa - y * sina;
 108.140 +	m[2][1] = y * z * one_minus_cosa + x * sina;
 108.141 +	m[2][2] = nzsq + (1.0 - nzsq) * cosa;
 108.142 +
 108.143 +	/* the rest are identity */
 108.144 +	m[3][0] = m[3][1] = m[3][2] = m[0][3] = m[1][3] = m[2][3] = 0.0;
 108.145 +	m[3][3] = 1.0;
 108.146 +}
 108.147 +
 108.148 +void m4_rotate_axis(mat4_t m, scalar_t angle, scalar_t x, scalar_t y, scalar_t z)
 108.149 +{
 108.150 +	mat4_t xform;
 108.151 +	m4_set_rotation_axis(xform, angle, x, y, z);
 108.152 +	m4_mult(m, m, xform);
 108.153 +}
 108.154 +
 108.155 +void m4_rotate_quat(mat4_t m, quat_t q)
 108.156 +{
 108.157 +	mat4_t rm;
 108.158 +	quat_to_mat4(rm, q);
 108.159 +	m4_mult(m, m, rm);
 108.160 +}
 108.161 +
 108.162 +void m4_scale(mat4_t m, scalar_t x, scalar_t y, scalar_t z)
 108.163 +{
 108.164 +	mat4_t sm;
 108.165 +	m4_identity(sm);
 108.166 +	sm[0][0] = x;
 108.167 +	sm[1][1] = y;
 108.168 +	sm[2][2] = z;
 108.169 +	m4_mult(m, m, sm);
 108.170 +}
 108.171 +
 108.172 +void m4_transpose(mat4_t res, mat4_t m)
 108.173 +{
 108.174 +	int i, j;
 108.175 +	mat4_t tmp;
 108.176 +	m4_copy(tmp, m);
 108.177 +
 108.178 +	for(i=0; i<4; i++) {
 108.179 +		for(j=0; j<4; j++) {
 108.180 +			res[i][j] = tmp[j][i];
 108.181 +		}
 108.182 +	}
 108.183 +}
 108.184 +
 108.185 +scalar_t m4_determinant(mat4_t m)
 108.186 +{
 108.187 +	scalar_t det11 =	(m[1][1] * (m[2][2] * m[3][3] - m[3][2] * m[2][3])) -
 108.188 +						(m[1][2] * (m[2][1] * m[3][3] - m[3][1] * m[2][3])) +
 108.189 +						(m[1][3] * (m[2][1] * m[3][2] - m[3][1] * m[2][2]));
 108.190 +
 108.191 +	scalar_t det12 =	(m[1][0] * (m[2][2] * m[3][3] - m[3][2] * m[2][3])) -
 108.192 +						(m[1][2] * (m[2][0] * m[3][3] - m[3][0] * m[2][3])) +
 108.193 +						(m[1][3] * (m[2][0] * m[3][2] - m[3][0] * m[2][2]));
 108.194 +
 108.195 +	scalar_t det13 =	(m[1][0] * (m[2][1] * m[3][3] - m[3][1] * m[2][3])) -
 108.196 +						(m[1][1] * (m[2][0] * m[3][3] - m[3][0] * m[2][3])) +
 108.197 +						(m[1][3] * (m[2][0] * m[3][1] - m[3][0] * m[2][1]));
 108.198 +
 108.199 +	scalar_t det14 =	(m[1][0] * (m[2][1] * m[3][2] - m[3][1] * m[2][2])) -
 108.200 +						(m[1][1] * (m[2][0] * m[3][2] - m[3][0] * m[2][2])) +
 108.201 +						(m[1][2] * (m[2][0] * m[3][1] - m[3][0] * m[2][1]));
 108.202 +
 108.203 +	return m[0][0] * det11 - m[0][1] * det12 + m[0][2] * det13 - m[0][3] * det14;
 108.204 +}
 108.205 +
 108.206 +void m4_adjoint(mat4_t res, mat4_t m)
 108.207 +{
 108.208 +	int i, j;
 108.209 +	mat4_t coef;
 108.210 +
 108.211 +	coef[0][0] =	(m[1][1] * (m[2][2] * m[3][3] - m[3][2] * m[2][3])) -
 108.212 +					(m[1][2] * (m[2][1] * m[3][3] - m[3][1] * m[2][3])) +
 108.213 +					(m[1][3] * (m[2][1] * m[3][2] - m[3][1] * m[2][2]));
 108.214 +	coef[0][1] =	(m[1][0] * (m[2][2] * m[3][3] - m[3][2] * m[2][3])) -
 108.215 +					(m[1][2] * (m[2][0] * m[3][3] - m[3][0] * m[2][3])) +
 108.216 +					(m[1][3] * (m[2][0] * m[3][2] - m[3][0] * m[2][2]));
 108.217 +	coef[0][2] =	(m[1][0] * (m[2][1] * m[3][3] - m[3][1] * m[2][3])) -
 108.218 +					(m[1][1] * (m[2][0] * m[3][3] - m[3][0] * m[2][3])) +
 108.219 +					(m[1][3] * (m[2][0] * m[3][1] - m[3][0] * m[2][1]));
 108.220 +	coef[0][3] =	(m[1][0] * (m[2][1] * m[3][2] - m[3][1] * m[2][2])) -
 108.221 +					(m[1][1] * (m[2][0] * m[3][2] - m[3][0] * m[2][2])) +
 108.222 +					(m[1][2] * (m[2][0] * m[3][1] - m[3][0] * m[2][1]));
 108.223 +
 108.224 +	coef[1][0] =	(m[0][1] * (m[2][2] * m[3][3] - m[3][2] * m[2][3])) -
 108.225 +					(m[0][2] * (m[2][1] * m[3][3] - m[3][1] * m[2][3])) +
 108.226 +					(m[0][3] * (m[2][1] * m[3][2] - m[3][1] * m[2][2]));
 108.227 +	coef[1][1] =	(m[0][0] * (m[2][2] * m[3][3] - m[3][2] * m[2][3])) -
 108.228 +					(m[0][2] * (m[2][0] * m[3][3] - m[3][0] * m[2][3])) +
 108.229 +					(m[0][3] * (m[2][0] * m[3][2] - m[3][0] * m[2][2]));
 108.230 +	coef[1][2] =	(m[0][0] * (m[2][1] * m[3][3] - m[3][1] * m[2][3])) -
 108.231 +					(m[0][1] * (m[2][0] * m[3][3] - m[3][0] * m[2][3])) +
 108.232 +					(m[0][3] * (m[2][0] * m[3][1] - m[3][0] * m[2][1]));
 108.233 +	coef[1][3] =	(m[0][0] * (m[2][1] * m[3][2] - m[3][1] * m[2][2])) -
 108.234 +					(m[0][1] * (m[2][0] * m[3][2] - m[3][0] * m[2][2])) +
 108.235 +					(m[0][2] * (m[2][0] * m[3][1] - m[3][0] * m[2][1]));
 108.236 +
 108.237 +	coef[2][0] =	(m[0][1] * (m[1][2] * m[3][3] - m[3][2] * m[1][3])) -
 108.238 +					(m[0][2] * (m[1][1] * m[3][3] - m[3][1] * m[1][3])) +
 108.239 +					(m[0][3] * (m[1][1] * m[3][2] - m[3][1] * m[1][2]));
 108.240 +	coef[2][1] =	(m[0][0] * (m[1][2] * m[3][3] - m[3][2] * m[1][3])) -
 108.241 +					(m[0][2] * (m[1][0] * m[3][3] - m[3][0] * m[1][3])) +
 108.242 +					(m[0][3] * (m[1][0] * m[3][2] - m[3][0] * m[1][2]));
 108.243 +	coef[2][2] =	(m[0][0] * (m[1][1] * m[3][3] - m[3][1] * m[1][3])) -
 108.244 +					(m[0][1] * (m[1][0] * m[3][3] - m[3][0] * m[1][3])) +
 108.245 +					(m[0][3] * (m[1][0] * m[3][1] - m[3][0] * m[1][1]));
 108.246 +	coef[2][3] =	(m[0][0] * (m[1][1] * m[3][2] - m[3][1] * m[1][2])) -
 108.247 +					(m[0][1] * (m[1][0] * m[3][2] - m[3][0] * m[1][2])) +
 108.248 +					(m[0][2] * (m[1][0] * m[3][1] - m[3][0] * m[1][1]));
 108.249 +
 108.250 +	coef[3][0] =	(m[0][1] * (m[1][2] * m[2][3] - m[2][2] * m[1][3])) -
 108.251 +					(m[0][2] * (m[1][1] * m[2][3] - m[2][1] * m[1][3])) +
 108.252 +					(m[0][3] * (m[1][1] * m[2][2] - m[2][1] * m[1][2]));
 108.253 +	coef[3][1] =	(m[0][0] * (m[1][2] * m[2][3] - m[2][2] * m[1][3])) -
 108.254 +					(m[0][2] * (m[1][0] * m[2][3] - m[2][0] * m[1][3])) +
 108.255 +					(m[0][3] * (m[1][0] * m[2][2] - m[2][0] * m[1][2]));
 108.256 +	coef[3][2] =	(m[0][0] * (m[1][1] * m[2][3] - m[2][1] * m[1][3])) -
 108.257 +					(m[0][1] * (m[1][0] * m[2][3] - m[2][0] * m[1][3])) +
 108.258 +					(m[0][3] * (m[1][0] * m[2][1] - m[2][0] * m[1][1]));
 108.259 +	coef[3][3] =	(m[0][0] * (m[1][1] * m[2][2] - m[2][1] * m[1][2])) -
 108.260 +					(m[0][1] * (m[1][0] * m[2][2] - m[2][0] * m[1][2])) +
 108.261 +					(m[0][2] * (m[1][0] * m[2][1] - m[2][0] * m[1][1]));
 108.262 +
 108.263 +	m4_transpose(res, coef);
 108.264 +
 108.265 +	for(i=0; i<4; i++) {
 108.266 +		for(j=0; j<4; j++) {
 108.267 +			res[i][j] = j % 2 ? -res[i][j] : res[i][j];
 108.268 +			if(i % 2) res[i][j] = -res[i][j];
 108.269 +		}
 108.270 +	}
 108.271 +}
 108.272 +
 108.273 +void m4_inverse(mat4_t res, mat4_t m)
 108.274 +{
 108.275 +	int i, j;
 108.276 +	mat4_t adj;
 108.277 +	scalar_t det;
 108.278 +
 108.279 +	m4_adjoint(adj, m);
 108.280 +	det = m4_determinant(m);
 108.281 +	
 108.282 +	for(i=0; i<4; i++) {
 108.283 +		for(j=0; j<4; j++) {
 108.284 +			res[i][j] = adj[i][j] / det;
 108.285 +		}
 108.286 +	}
 108.287 +}
 108.288 +
 108.289 +void m4_print(FILE *fp, mat4_t m)
 108.290 +{
 108.291 +	int i;
 108.292 +	for(i=0; i<4; i++) {
 108.293 +		fprintf(fp, "[ %12.5f %12.5f %12.5f %12.5f ]\n", (float)m[i][0], (float)m[i][1], (float)m[i][2], (float)m[i][3]);
 108.294 +	}
 108.295 +}
   109.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   109.2 +++ b/libs/vmath/quat.cc	Sun Nov 01 00:36:56 2015 +0200
   109.3 @@ -0,0 +1,212 @@
   109.4 +#include "quat.h"
   109.5 +#include "vmath.h"
   109.6 +
   109.7 +Quaternion::Quaternion()
   109.8 +{
   109.9 +	s = 1.0;
  109.10 +	v.x = v.y = v.z = 0.0;
  109.11 +}
  109.12 +
  109.13 +Quaternion::Quaternion(scalar_t s, const Vector3 &v)
  109.14 +{
  109.15 +	this->s = s;
  109.16 +	this->v = v;
  109.17 +}
  109.18 +
  109.19 +Quaternion::Quaternion(scalar_t s, scalar_t x, scalar_t y, scalar_t z)
  109.20 +{
  109.21 +	v.x = x;
  109.22 +	v.y = y;
  109.23 +	v.z = z;
  109.24 +	this->s = s;
  109.25 +}
  109.26 +
  109.27 +Quaternion::Quaternion(const Vector3 &axis, scalar_t angle)
  109.28 +{
  109.29 +	set_rotation(axis, angle);
  109.30 +}
  109.31 +
  109.32 +Quaternion::Quaternion(const quat_t &quat)
  109.33 +{
  109.34 +	v.x = quat.x;
  109.35 +	v.y = quat.y;
  109.36 +	v.z = quat.z;
  109.37 +	s = quat.w;
  109.38 +}
  109.39 +
  109.40 +Quaternion Quaternion::operator +(const Quaternion &quat) const
  109.41 +{
  109.42 +	return Quaternion(s + quat.s, v + quat.v);
  109.43 +}
  109.44 +
  109.45 +Quaternion Quaternion::operator -(const Quaternion &quat) const
  109.46 +{
  109.47 +	return Quaternion(s - quat.s, v - quat.v);
  109.48 +}
  109.49 +
  109.50 +Quaternion Quaternion::operator -() const
  109.51 +{
  109.52 +	return Quaternion(-s, -v);
  109.53 +}
  109.54 +
  109.55 +/** Quaternion Multiplication:
  109.56 + * Q1*Q2 = [s1*s2 - v1.v2,  s1*v2 + s2*v1 + v1(x)v2]
  109.57 + */
  109.58 +Quaternion Quaternion::operator *(const Quaternion &quat) const
  109.59 +{
  109.60 +	Quaternion newq;
  109.61 +	newq.s = s * quat.s - dot_product(v, quat.v);
  109.62 +	newq.v = quat.v * s + v * quat.s + cross_product(v, quat.v);
  109.63 +	return newq;
  109.64 +}
  109.65 +
  109.66 +void Quaternion::operator +=(const Quaternion &quat)
  109.67 +{
  109.68 +	*this = Quaternion(s + quat.s, v + quat.v);
  109.69 +}
  109.70 +
  109.71 +void Quaternion::operator -=(const Quaternion &quat)
  109.72 +{
  109.73 +	*this = Quaternion(s - quat.s, v - quat.v);
  109.74 +}
  109.75 +
  109.76 +void Quaternion::operator *=(const Quaternion &quat)
  109.77 +{
  109.78 +	*this = *this * quat;
  109.79 +}
  109.80 +
  109.81 +void Quaternion::reset_identity()
  109.82 +{
  109.83 +	s = 1.0;
  109.84 +	v.x = v.y = v.z = 0.0;
  109.85 +}
  109.86 +
  109.87 +Quaternion Quaternion::conjugate() const
  109.88 +{
  109.89 +	return Quaternion(s, -v);
  109.90 +}
  109.91 +
  109.92 +scalar_t Quaternion::length() const
  109.93 +{
  109.94 +	return (scalar_t)sqrt(v.x*v.x + v.y*v.y + v.z*v.z + s*s);
  109.95 +}
  109.96 +
  109.97 +/** Q * ~Q = ||Q||^2 */
  109.98 +scalar_t Quaternion::length_sq() const
  109.99 +{
 109.100 +	return v.x*v.x + v.y*v.y + v.z*v.z + s*s;
 109.101 +}
 109.102 +
 109.103 +void Quaternion::normalize()
 109.104 +{
 109.105 +	scalar_t len = (scalar_t)sqrt(v.x*v.x + v.y*v.y + v.z*v.z + s*s);
 109.106 +	v.x /= len;
 109.107 +	v.y /= len;
 109.108 +	v.z /= len;
 109.109 +	s /= len;
 109.110 +}
 109.111 +
 109.112 +Quaternion Quaternion::normalized() const
 109.113 +{
 109.114 +	Quaternion nq = *this;
 109.115 +	scalar_t len = (scalar_t)sqrt(v.x*v.x + v.y*v.y + v.z*v.z + s*s);
 109.116 +	nq.v.x /= len;
 109.117 +	nq.v.y /= len;
 109.118 +	nq.v.z /= len;
 109.119 +	nq.s /= len;
 109.120 +	return nq;
 109.121 +}
 109.122 +
 109.123 +/** Quaternion Inversion: Q^-1 = ~Q / ||Q||^2 */
 109.124 +Quaternion Quaternion::inverse() const
 109.125 +{
 109.126 +	Quaternion inv = conjugate();
 109.127 +	scalar_t lensq = length_sq();
 109.128 +	inv.v /= lensq;
 109.129 +	inv.s /= lensq;
 109.130 +
 109.131 +	return inv;
 109.132 +}
 109.133 +
 109.134 +
 109.135 +void Quaternion::set_rotation(const Vector3 &axis, scalar_t angle)
 109.136 +{
 109.137 +	scalar_t half_angle = angle / 2.0;
 109.138 +	s = cos(half_angle);
 109.139 +	v = axis * sin(half_angle);
 109.140 +}
 109.141 +
 109.142 +void Quaternion::rotate(const Vector3 &axis, scalar_t angle)
 109.143 +{
 109.144 +	Quaternion q;
 109.145 +	scalar_t half_angle = angle / 2.0;
 109.146 +	q.s = cos(half_angle);
 109.147 +	q.v = axis * sin(half_angle);
 109.148 +
 109.149 +	*this *= q;
 109.150 +}
 109.151 +
 109.152 +void Quaternion::rotate(const Quaternion &q)
 109.153 +{
 109.154 +	*this = q * *this * q.conjugate();
 109.155 +}
 109.156 +
 109.157 +Matrix3x3 Quaternion::get_rotation_matrix() const
 109.158 +{
 109.159 +	return Matrix3x3(
 109.160 +			1.0 - 2.0 * v.y*v.y - 2.0 * v.z*v.z,	2.0 * v.x * v.y - 2.0 * s * v.z,		2.0 * v.z * v.x + 2.0 * s * v.y,
 109.161 +			2.0 * v.x * v.y + 2.0 * s * v.z,		1.0 - 2.0 * v.x*v.x - 2.0 * v.z*v.z,	2.0 * v.y * v.z - 2.0 * s * v.x,
 109.162 +			2.0 * v.z * v.x - 2.0 * s * v.y,		2.0 * v.y * v.z + 2.0 * s * v.x,		1.0 - 2.0 * v.x*v.x - 2.0 * v.y*v.y);
 109.163 +}
 109.164 +
 109.165 +
 109.166 +/** Spherical linear interpolation (slerp) */
 109.167 +Quaternion slerp(const Quaternion &quat1, const Quaternion &q2, scalar_t t)
 109.168 +{
 109.169 +	Quaternion q1;
 109.170 +	scalar_t dot = q1.s * q2.s + q1.v.x * q2.v.x + q1.v.y * q2.v.y + q1.v.z * q2.v.z;
 109.171 +
 109.172 +	if(dot < 0.0) {
 109.173 +		/* make sure we interpolate across the shortest arc */
 109.174 +		q1 = -quat1;
 109.175 +		dot = -dot;
 109.176 +	} else {
 109.177 +		q1 = quat1;
 109.178 +	}
 109.179 +
 109.180 +	/* clamp dot to [-1, 1] in order to avoid domain errors in acos due to
 109.181 +	 * floating point imprecisions
 109.182 +	 */
 109.183 +	if(dot < -1.0) dot = -1.0;
 109.184 +	if(dot > 1.0) dot = 1.0;
 109.185 +
 109.186 +	scalar_t angle = acos(dot);
 109.187 +	scalar_t a, b;
 109.188 +
 109.189 +	scalar_t sin_angle = sin(angle);
 109.190 +	if(fabs(sin_angle) < SMALL_NUMBER) {
 109.191 +		/* for very small angles or completely opposite orientations
 109.192 +		 * use linear interpolation to avoid div/zero (in the first case it makes sense,
 109.193 +		 * the second case is pretty much undefined anyway I guess ...
 109.194 +		 */
 109.195 +		a = 1.0f - t;
 109.196 +		b = t;
 109.197 +	} else {
 109.198 +		a = sin((1.0f - t) * angle) / sin_angle;
 109.199 +		b = sin(t * angle) / sin_angle;
 109.200 +	}
 109.201 +
 109.202 +	scalar_t x = q1.v.x * a + q2.v.x * b;
 109.203 +	scalar_t y = q1.v.y * a + q2.v.y * b;
 109.204 +	scalar_t z = q1.v.z * a + q2.v.z * b;
 109.205 +	scalar_t s = q1.s * a + q2.s * b;
 109.206 +
 109.207 +	return Quaternion(s, Vector3(x, y, z));
 109.208 +}
 109.209 +
 109.210 +
 109.211 +std::ostream &operator <<(std::ostream &out, const Quaternion &q)
 109.212 +{
 109.213 +	out << "(" << q.s << ", " << q.v << ")";
 109.214 +	return out;
 109.215 +}
   110.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   110.2 +++ b/libs/vmath/quat.h	Sun Nov 01 00:36:56 2015 +0200
   110.3 @@ -0,0 +1,118 @@
   110.4 +/*
   110.5 +libvmath - a vector math library
   110.6 +Copyright (C) 2004-2011 John Tsiombikas <nuclear@member.fsf.org>
   110.7 +
   110.8 +This program is free software: you can redistribute it and/or modify
   110.9 +it under the terms of the GNU Lesser General Public License as published
  110.10 +by the Free Software Foundation, either version 3 of the License, or
  110.11 +(at your option) any later version.
  110.12 +
  110.13 +This program is distributed in the hope that it will be useful,
  110.14 +but WITHOUT ANY WARRANTY; without even the implied warranty of
  110.15 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  110.16 +GNU Lesser General Public License for more details.
  110.17 +
  110.18 +You should have received a copy of the GNU Lesser General Public License
  110.19 +along with this program.  If not, see <http://www.gnu.org/licenses/>.
  110.20 +*/
  110.21 +
  110.22 +#ifndef VMATH_QUATERNION_H_
  110.23 +#define VMATH_QUATERNION_H_
  110.24 +
  110.25 +#include <stdio.h>
  110.26 +#include "vmath_types.h"
  110.27 +#include "vector.h"
  110.28 +
  110.29 +#ifdef __cplusplus
  110.30 +extern "C" {
  110.31 +#endif	/* __cplusplus */
  110.32 +
  110.33 +#define quat_cons(s, x, y, z)	v4_cons(x, y, z, s)
  110.34 +#define quat_vec(q)				v3_cons((q).x, (q).y, (q).z)
  110.35 +#define quat_s(q)				((q).w)
  110.36 +#define quat_identity()			quat_cons(1.0, 0.0, 0.0, 0.0)
  110.37 +void quat_print(FILE *fp, quat_t q);
  110.38 +
  110.39 +#define quat_add		v4_add
  110.40 +#define quat_sub		v4_sub
  110.41 +#define quat_neg		v4_neg
  110.42 +
  110.43 +static inline quat_t quat_mul(quat_t q1, quat_t q2);
  110.44 +
  110.45 +static inline quat_t quat_conjugate(quat_t q);
  110.46 +
  110.47 +#define quat_length		v4_length
  110.48 +#define quat_length_sq	v4_length_sq
  110.49 +
  110.50 +#define quat_normalize	v4_normalize
  110.51 +static inline quat_t quat_inverse(quat_t q);
  110.52 +
  110.53 +quat_t quat_rotate(quat_t q, scalar_t angle, scalar_t x, scalar_t y, scalar_t z);
  110.54 +quat_t quat_rotate_quat(quat_t q, quat_t rotq);
  110.55 +
  110.56 +static inline void quat_to_mat3(mat3_t res, quat_t q);
  110.57 +static inline void quat_to_mat4(mat4_t res, quat_t q);
  110.58 +
  110.59 +#define quat_lerp quat_slerp
  110.60 +quat_t quat_slerp(quat_t q1, quat_t q2, scalar_t t);
  110.61 +
  110.62 +
  110.63 +#ifdef __cplusplus
  110.64 +}	/* extern "C" */
  110.65 +
  110.66 +#include <iostream>
  110.67 +
  110.68 +/* Quaternion */
  110.69 +class Quaternion {
  110.70 +public:
  110.71 +	scalar_t s;
  110.72 +	Vector3 v;
  110.73 +
  110.74 +	Quaternion();
  110.75 +	Quaternion(scalar_t s, const Vector3 &v);
  110.76 +	Quaternion(scalar_t s, scalar_t x, scalar_t y, scalar_t z);
  110.77 +	Quaternion(const Vector3 &axis, scalar_t angle);
  110.78 +	Quaternion(const quat_t &quat);
  110.79 +
  110.80 +	Quaternion operator +(const Quaternion &quat) const;
  110.81 +	Quaternion operator -(const Quaternion &quat) const;
  110.82 +	Quaternion operator -() const;
  110.83 +	Quaternion operator *(const Quaternion &quat) const;
  110.84 +
  110.85 +	void operator +=(const Quaternion &quat);
  110.86 +	void operator -=(const Quaternion &quat);
  110.87 +	void operator *=(const Quaternion &quat);
  110.88 +
  110.89 +	void reset_identity();
  110.90 +
  110.91 +	Quaternion conjugate() const;
  110.92 +
  110.93 +	scalar_t length() const;
  110.94 +	scalar_t length_sq() const;
  110.95 +
  110.96 +	void normalize();
  110.97 +	Quaternion normalized() const;
  110.98 +
  110.99 +	Quaternion inverse() const;
 110.100 +
 110.101 +	void set_rotation(const Vector3 &axis, scalar_t angle);
 110.102 +	void rotate(const Vector3 &axis, scalar_t angle);
 110.103 +	/* note: this is a totally different operation from the above
 110.104 +	 * this treats the quaternion as signifying direction and rotates
 110.105 +	 * it by a rotation quaternion by rot * q * rot'
 110.106 +	 */
 110.107 +	void rotate(const Quaternion &q);
 110.108 +
 110.109 +	Matrix3x3 get_rotation_matrix() const;
 110.110 +};
 110.111 +
 110.112 +Quaternion slerp(const Quaternion &q1, const Quaternion &q2, scalar_t t);
 110.113 +inline Quaternion lerp(const Quaternion &q1, const Quaternion &q2, scalar_t t);
 110.114 +
 110.115 +std::ostream &operator <<(std::ostream &out, const Quaternion &q);
 110.116 +
 110.117 +#endif	/* __cplusplus */
 110.118 +
 110.119 +#include "quat.inl"
 110.120 +
 110.121 +#endif	/* VMATH_QUATERNION_H_ */
   111.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   111.2 +++ b/libs/vmath/quat.inl	Sun Nov 01 00:36:56 2015 +0200
   111.3 @@ -0,0 +1,81 @@
   111.4 +/*
   111.5 +libvmath - a vector math library
   111.6 +Copyright (C) 2004-2011 John Tsiombikas <nuclear@member.fsf.org>
   111.7 +
   111.8 +This program is free software: you can redistribute it and/or modify
   111.9 +it under the terms of the GNU Lesser General Public License as published
  111.10 +by the Free Software Foundation, either version 3 of the License, or
  111.11 +(at your option) any later version.
  111.12 +
  111.13 +This program is distributed in the hope that it will be useful,
  111.14 +but WITHOUT ANY WARRANTY; without even the implied warranty of
  111.15 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  111.16 +GNU Lesser General Public License for more details.
  111.17 +
  111.18 +You should have received a copy of the GNU Lesser General Public License
  111.19 +along with this program.  If not, see <http://www.gnu.org/licenses/>.
  111.20 +*/
  111.21 +
  111.22 +#include "vector.h"
  111.23 +#include "matrix.h"
  111.24 +
  111.25 +#ifdef __cplusplus
  111.26 +extern "C" {
  111.27 +#endif	/* __cplusplus */
  111.28 +
  111.29 +static inline quat_t quat_mul(quat_t q1, quat_t q2)
  111.30 +{
  111.31 +	quat_t res;
  111.32 +	vec3_t v1 = quat_vec(q1);
  111.33 +	vec3_t v2 = quat_vec(q2);
  111.34 +
  111.35 +	res.w = q1.w * q2.w - v3_dot(v1, v2);
  111.36 +	/* resvec = v2 * q1 + v1 * q2 + cross(v1, v2) */
  111.37 +	res.x = v2.x * q1.w + v1.x * q2.w + (v1.y * v2.z - v1.z * v2.y);
  111.38 +	res.y = v2.y * q1.w + v1.y * q2.w + (v1.z * v2.x - v1.x * v2.z);
  111.39 +	res.z = v2.z * q1.w + v1.z * q2.w + (v1.x * v2.y - v1.y * v2.x);
  111.40 +	return res;
  111.41 +}
  111.42 +
  111.43 +static inline quat_t quat_conjugate(quat_t q)
  111.44 +{
  111.45 +	q.x = -q.x;
  111.46 +	q.y = -q.y;
  111.47 +	q.z = -q.z;
  111.48 +	return q;
  111.49 +}
  111.50 +
  111.51 +static inline quat_t quat_inverse(quat_t q)
  111.52 +{
  111.53 +	scalar_t lensq = quat_length_sq(q);
  111.54 +	q = quat_conjugate(q);
  111.55 +	q.x /= lensq;
  111.56 +	q.y /= lensq;
  111.57 +	q.z /= lensq;
  111.58 +	q.w /= lensq;
  111.59 +	return q;
  111.60 +}
  111.61 +
  111.62 +static inline void quat_to_mat3(mat3_t res, quat_t q)
  111.63 +{
  111.64 +	m3_cons(res, 1.0 - 2.0 * q.y*q.y - 2.0 * q.z*q.z, 2.0 * q.x * q.y - 2.0 * q.w * q.z,   2.0 * q.z * q.x + 2.0 * q.w * q.y,
  111.65 +				 2.0 * q.x * q.y + 2.0 * q.w * q.z,   1.0 - 2.0 * q.x*q.x - 2.0 * q.z*q.z, 2.0 * q.y * q.z - 2.0 * q.w * q.x,
  111.66 +				 2.0 * q.z * q.x - 2.0 * q.w * q.y,   2.0 * q.y * q.z + 2.0 * q.w * q.x,   1.0 - 2.0 * q.x*q.x - 2.0 * q.y*q.y);
  111.67 +}
  111.68 +
  111.69 +static inline void quat_to_mat4(mat4_t res, quat_t q)
  111.70 +{
  111.71 +	m4_cons(res, 1.0 - 2.0 * q.y*q.y - 2.0 * q.z*q.z, 2.0 * q.x * q.y - 2.0 * q.w * q.z,   2.0 * q.z * q.x + 2.0 * q.w * q.y,   0,
  111.72 +				 2.0 * q.x * q.y + 2.0 * q.w * q.z,   1.0 - 2.0 * q.x*q.x - 2.0 * q.z*q.z, 2.0 * q.y * q.z - 2.0 * q.w * q.x,   0,
  111.73 +				 2.0 * q.z * q.x - 2.0 * q.w * q.y,   2.0 * q.y * q.z + 2.0 * q.w * q.x,   1.0 - 2.0 * q.x*q.x - 2.0 * q.y*q.y, 0,
  111.74 +				 0, 0, 0, 1);
  111.75 +}
  111.76 +
  111.77 +#ifdef __cplusplus
  111.78 +}	/* extern "C" */
  111.79 +
  111.80 +inline Quaternion lerp(const Quaternion &a, const Quaternion &b, scalar_t t)
  111.81 +{
  111.82 +	return slerp(a, b, t);
  111.83 +}
  111.84 +#endif	/* __cplusplus */
   112.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   112.2 +++ b/libs/vmath/quat_c.c	Sun Nov 01 00:36:56 2015 +0200
   112.3 @@ -0,0 +1,89 @@
   112.4 +/*
   112.5 +libvmath - a vector math library
   112.6 +Copyright (C) 2004-2011 John Tsiombikas <nuclear@member.fsf.org>
   112.7 +
   112.8 +This program is free software: you can redistribute it and/or modify
   112.9 +it under the terms of the GNU Lesser General Public License as published
  112.10 +by the Free Software Foundation, either version 3 of the License, or
  112.11 +(at your option) any later version.
  112.12 +
  112.13 +This program is distributed in the hope that it will be useful,
  112.14 +but WITHOUT ANY WARRANTY; without even the implied warranty of
  112.15 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  112.16 +GNU Lesser General Public License for more details.
  112.17 +
  112.18 +You should have received a copy of the GNU Lesser General Public License
  112.19 +along with this program.  If not, see <http://www.gnu.org/licenses/>.
  112.20 +*/
  112.21 +
  112.22 +
  112.23 +#include <stdio.h>
  112.24 +#include <math.h>
  112.25 +#include "quat.h"
  112.26 +
  112.27 +void quat_print(FILE *fp, quat_t q)
  112.28 +{
  112.29 +	fprintf(fp, "([ %.4f %.4f %.4f ] %.4f)", q.x, q.y, q.z, q.w);
  112.30 +}
  112.31 +
  112.32 +quat_t quat_rotate(quat_t q, scalar_t angle, scalar_t x, scalar_t y, scalar_t z)
  112.33 +{
  112.34 +	quat_t rq;
  112.35 +	scalar_t half_angle = angle * 0.5;
  112.36 +	scalar_t sin_half = sin(half_angle);
  112.37 +
  112.38 +	rq.w = cos(half_angle);
  112.39 +	rq.x = x * sin_half;
  112.40 +	rq.y = y * sin_half;
  112.41 +	rq.z = z * sin_half;
  112.42 +
  112.43 +	return quat_mul(q, rq);
  112.44 +}
  112.45 +
  112.46 +quat_t quat_rotate_quat(quat_t q, quat_t rotq)
  112.47 +{
  112.48 +	return quat_mul(quat_mul(rotq, q), quat_conjugate(rotq));
  112.49 +}
  112.50 +
  112.51 +quat_t quat_slerp(quat_t q1, quat_t q2, scalar_t t)
  112.52 +{
  112.53 +	quat_t res;
  112.54 +	scalar_t a, b, angle, sin_angle, dot;
  112.55 +
  112.56 +	dot = q1.w * q2.w + q1.x * q2.x + q1.y * q2.y + q1.z * q2.z;
  112.57 +	if(dot < 0.0) {
  112.58 +		/* make sure we interpolate across the shortest arc */
  112.59 +		q1.x = -q1.x;
  112.60 +		q1.y = -q1.y;
  112.61 +		q1.z = -q1.z;
  112.62 +		q1.w = -q1.w;
  112.63 +		dot = -dot;
  112.64 +	}
  112.65 +
  112.66 +	/* clamp dot to [-1, 1] in order to avoid domain errors in acos due to
  112.67 +	 * floating point imprecisions
  112.68 +	 */
  112.69 +	if(dot < -1.0) dot = -1.0;
  112.70 +	if(dot > 1.0) dot = 1.0;
  112.71 +
  112.72 +	angle = acos(dot);
  112.73 +	sin_angle = sin(angle);
  112.74 +
  112.75 +	if(fabs(sin_angle) < SMALL_NUMBER) {
  112.76 +		/* for very small angles or completely opposite orientations
  112.77 +		 * use linear interpolation to avoid div/zero (in the first case it makes sense,
  112.78 +		 * the second case is pretty much undefined anyway I guess ...
  112.79 +		 */
  112.80 +		a = 1.0f - t;
  112.81 +		b = t;
  112.82 +	} else {
  112.83 +		a = sin((1.0f - t) * angle) / sin_angle;
  112.84 +		b = sin(t * angle) / sin_angle;
  112.85 +	}
  112.86 +
  112.87 +	res.x = q1.x * a + q2.x * b;
  112.88 +	res.y = q1.y * a + q2.y * b;
  112.89 +	res.z = q1.z * a + q2.z * b;
  112.90 +	res.w = q1.w * a + q2.w * b;
  112.91 +	return res;
  112.92 +}
   113.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   113.2 +++ b/libs/vmath/ray.cc	Sun Nov 01 00:36:56 2015 +0200
   113.3 @@ -0,0 +1,69 @@
   113.4 +#include "ray.h"
   113.5 +#include "vector.h"
   113.6 +
   113.7 +scalar_t Ray::env_ior = 1.0;
   113.8 +
   113.9 +Ray::Ray()
  113.10 +{
  113.11 +	ior = env_ior;
  113.12 +	energy = 1.0;
  113.13 +	time = 0;
  113.14 +	iter = 0;
  113.15 +}
  113.16 +
  113.17 +Ray::Ray(const Vector3 &origin, const Vector3 &dir)
  113.18 +{
  113.19 +	this->origin = origin;
  113.20 +	this->dir = dir;
  113.21 +	ior = env_ior;
  113.22 +	energy = 1.0;
  113.23 +	time = 0;
  113.24 +	iter = 0;
  113.25 +}
  113.26 +
  113.27 +#undef CORRECT_RAY_XFORM
  113.28 +
  113.29 +void Ray::transform(const Matrix4x4 &xform)
  113.30 +{
  113.31 +#ifndef CORRECT_RAY_XFORM
  113.32 +	Matrix4x4 upper = xform;
  113.33 +	upper[0][3] = upper[1][3] = upper[2][3] = upper[3][0] = upper[3][1] = upper[3][2] = 0.0;
  113.34 +	upper[3][3] = 1.0;
  113.35 +
  113.36 +	dir.transform(upper);
  113.37 +	origin.transform(xform);
  113.38 +#else
  113.39 +	Vector3 end = (origin + dir).transformed(xform);
  113.40 +	origin.transform(xform);
  113.41 +	dir = end - origin;
  113.42 +#endif
  113.43 +}
  113.44 +
  113.45 +Ray Ray::transformed(const Matrix4x4 &xform) const
  113.46 +{
  113.47 +	Ray foo = *this;
  113.48 +	foo.transform(xform);
  113.49 +	return foo;
  113.50 +}
  113.51 +
  113.52 +void Ray::enter(scalar_t new_ior)
  113.53 +{
  113.54 +	ior = new_ior;
  113.55 +}
  113.56 +
  113.57 +void Ray::leave()
  113.58 +{
  113.59 +}
  113.60 +
  113.61 +scalar_t Ray::calc_ior(bool entering, scalar_t mat_ior) const
  113.62 +{
  113.63 +	scalar_t from_ior = this->ior;
  113.64 +
  113.65 +	if(entering) {
  113.66 +		return from_ior / mat_ior;
  113.67 +	}
  113.68 +
  113.69 +	Ray tmp = *this;
  113.70 +	tmp.leave();
  113.71 +	return from_ior / tmp.ior;
  113.72 +}
   114.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   114.2 +++ b/libs/vmath/ray.h	Sun Nov 01 00:36:56 2015 +0200
   114.3 @@ -0,0 +1,68 @@
   114.4 +/*
   114.5 +libvmath - a vector math library
   114.6 +Copyright (C) 2004-2011 John Tsiombikas <nuclear@member.fsf.org>
   114.7 +
   114.8 +This program is free software: you can redistribute it and/or modify
   114.9 +it under the terms of the GNU Lesser General Public License as published
  114.10 +by the Free Software Foundation, either version 3 of the License, or
  114.11 +(at your option) any later version.
  114.12 +
  114.13 +This program is distributed in the hope that it will be useful,
  114.14 +but WITHOUT ANY WARRANTY; without even the implied warranty of
  114.15 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  114.16 +GNU Lesser General Public License for more details.
  114.17 +
  114.18 +You should have received a copy of the GNU Lesser General Public License
  114.19 +along with this program.  If not, see <http://www.gnu.org/licenses/>.
  114.20 +*/
  114.21 +
  114.22 +#ifndef VMATH_RAY_H_
  114.23 +#define VMATH_RAY_H_
  114.24 +
  114.25 +#include "matrix.h"
  114.26 +#include "vector.h"
  114.27 +
  114.28 +typedef struct {
  114.29 +	vec3_t origin, dir;
  114.30 +} ray_t;
  114.31 +
  114.32 +#ifdef __cplusplus
  114.33 +extern "C" {
  114.34 +#endif	/* __cplusplus */
  114.35 +
  114.36 +static inline ray_t ray_cons(vec3_t origin, vec3_t dir);
  114.37 +ray_t ray_transform(ray_t r, mat4_t m);
  114.38 +
  114.39 +#ifdef __cplusplus
  114.40 +}	/* __cplusplus */
  114.41 +
  114.42 +class Ray {
  114.43 +public:
  114.44 +	/* enviornmental index of refraction, normally 1.0 */
  114.45 +	static scalar_t env_ior;
  114.46 +
  114.47 +	Vector3 origin, dir;
  114.48 +	scalar_t energy;
  114.49 +	int iter;
  114.50 +	scalar_t ior;
  114.51 +	long time;
  114.52 +
  114.53 +	Ray();
  114.54 +	Ray(const Vector3 &origin, const Vector3 &dir);
  114.55 +
  114.56 +	void transform(const Matrix4x4 &xform);
  114.57 +	Ray transformed(const Matrix4x4 &xform) const;
  114.58 +
  114.59 +	void enter(scalar_t new_ior);
  114.60 +	void leave();
  114.61 +
  114.62 +	scalar_t calc_ior(bool entering, scalar_t mat_ior = 1.0) const;
  114.63 +};
  114.64 +
  114.65 +inline Ray reflect_ray(const Ray &inray, const Vector3 &norm);
  114.66 +inline Ray refract_ray(const Ray &inray, const Vector3 &norm, scalar_t ior, bool entering, scalar_t ray_mag = -1.0);
  114.67 +#endif	/* __cplusplus */
  114.68 +
  114.69 +#include "ray.inl"
  114.70 +
  114.71 +#endif	/* VMATH_RAY_H_ */
   115.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   115.2 +++ b/libs/vmath/ray.inl	Sun Nov 01 00:36:56 2015 +0200
   115.3 @@ -0,0 +1,70 @@
   115.4 +/*
   115.5 +libvmath - a vector math library
   115.6 +Copyright (C) 2004-2011 John Tsiombikas <nuclear@member.fsf.org>
   115.7 +
   115.8 +This program is free software: you can redistribute it and/or modify
   115.9 +it under the terms of the GNU Lesser General Public License as published
  115.10 +by the Free Software Foundation, either version 3 of the License, or
  115.11 +(at your option) any later version.
  115.12 +
  115.13 +This program is distributed in the hope that it will be useful,
  115.14 +but WITHOUT ANY WARRANTY; without even the implied warranty of
  115.15 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  115.16 +GNU Lesser General Public License for more details.
  115.17 +
  115.18 +You should have received a copy of the GNU Lesser General Public License
  115.19 +along with this program.  If not, see <http://www.gnu.org/licenses/>.
  115.20 +*/
  115.21 +
  115.22 +#ifdef __cplusplus
  115.23 +extern "C" {
  115.24 +#endif	/* __cplusplus */
  115.25 +
  115.26 +static inline ray_t ray_cons(vec3_t origin, vec3_t dir)
  115.27 +{
  115.28 +	ray_t r;
  115.29 +	r.origin = origin;
  115.30 +	r.dir = dir;
  115.31 +	return r;
  115.32 +}
  115.33 +
  115.34 +#ifdef __cplusplus
  115.35 +}
  115.36 +
  115.37 +inline Ray reflect_ray(const Ray &inray, const Vector3 &norm)
  115.38 +{
  115.39 +	Ray ray = inray;
  115.40 +	ray.iter--;
  115.41 +	ray.dir = ray.dir.reflection(norm);
  115.42 +	return ray;
  115.43 +}
  115.44 +
  115.45 +inline Ray refract_ray(const Ray &inray, const Vector3 &norm, scalar_t mat_ior, bool entering, scalar_t ray_mag)
  115.46 +{
  115.47 +	Ray ray = inray;
  115.48 +	ray.iter--;
  115.49 +
  115.50 +	scalar_t ior = ray.calc_ior(entering, mat_ior);
  115.51 +
  115.52 +	if(entering) {
  115.53 +		ray.enter(mat_ior);
  115.54 +	} else {
  115.55 +		ray.leave();
  115.56 +	}
  115.57 +
  115.58 +	if(ray_mag < 0.0) {
  115.59 +		ray_mag = ray.dir.length();
  115.60 +	}
  115.61 +	ray.dir = (ray.dir / ray_mag).refraction(norm, ior) * ray_mag;
  115.62 +
  115.63 +	/* check TIR */
  115.64 +	if(dot_product(ray.dir, norm) > 0.0) {
  115.65 +		if(entering) {
  115.66 +			ray.leave();
  115.67 +		} else {
  115.68 +			ray.enter(mat_ior);
  115.69 +		}
  115.70 +	}
  115.71 +	return ray;
  115.72 +}
  115.73 +#endif	/* __cplusplus */
   116.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   116.2 +++ b/libs/vmath/ray_c.c	Sun Nov 01 00:36:56 2015 +0200
   116.3 @@ -0,0 +1,36 @@
   116.4 +/*
   116.5 +libvmath - a vector math library
   116.6 +Copyright (C) 2004-2011 John Tsiombikas <nuclear@member.fsf.org>
   116.7 +
   116.8 +This program is free software: you can redistribute it and/or modify
   116.9 +it under the terms of the GNU Lesser General Public License as published
  116.10 +by the Free Software Foundation, either version 3 of the License, or
  116.11 +(at your option) any later version.
  116.12 +
  116.13 +This program is distributed in the hope that it will be useful,
  116.14 +but WITHOUT ANY WARRANTY; without even the implied warranty of
  116.15 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  116.16 +GNU Lesser General Public License for more details.
  116.17 +
  116.18 +You should have received a copy of the GNU Lesser General Public License
  116.19 +along with this program.  If not, see <http://www.gnu.org/licenses/>.
  116.20 +*/
  116.21 +
  116.22 +#include "ray.h"
  116.23 +#include "vector.h"
  116.24 +
  116.25 +ray_t ray_transform(ray_t r, mat4_t xform)
  116.26 +{
  116.27 +	mat4_t upper;
  116.28 +	vec3_t dir;
  116.29 +
  116.30 +	m4_copy(upper, xform);
  116.31 +	upper[0][3] = upper[1][3] = upper[2][3] = upper[3][0] = upper[3][1] = upper[3][2] = 0.0;
  116.32 +	upper[3][3] = 1.0;
  116.33 +
  116.34 +	dir = v3_sub(r.dir, r.origin);
  116.35 +	dir = v3_transform(dir, upper);
  116.36 +	r.origin = v3_transform(r.origin, xform);
  116.37 +	r.dir = v3_add(dir, r.origin);
  116.38 +	return r;
  116.39 +}
   117.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   117.2 +++ b/libs/vmath/sphvec.cc	Sun Nov 01 00:36:56 2015 +0200
   117.3 @@ -0,0 +1,27 @@
   117.4 +#include "sphvec.h"
   117.5 +#include "vector.h"
   117.6 +
   117.7 +/* theta: 0 <= theta <= 2pi, the angle around Y axis.
   117.8 + * phi: 0 <= phi <= pi, the angle from Y axis.
   117.9 + * r: radius.
  117.10 + */
  117.11 +SphVector::SphVector(scalar_t theta, scalar_t phi, scalar_t r) {
  117.12 +	this->theta = theta;
  117.13 +	this->phi = phi;
  117.14 +	this->r = r;
  117.15 +}
  117.16 +
  117.17 +/* Constructs a spherical coordinate vector from a cartesian vector */
  117.18 +SphVector::SphVector(const Vector3 &cvec) {
  117.19 +	*this = cvec;
  117.20 +}
  117.21 +
  117.22 +/* Assignment operator that converts cartesian to spherical coords */
  117.23 +SphVector &SphVector::operator =(const Vector3 &cvec) {
  117.24 +	r = cvec.length();
  117.25 +	//theta = atan2(cvec.y, cvec.x);
  117.26 +	theta = atan2(cvec.z, cvec.x);
  117.27 +	//phi = acos(cvec.z / r);
  117.28 +	phi = acos(cvec.y / r);
  117.29 +	return *this;
  117.30 +}
   118.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   118.2 +++ b/libs/vmath/sphvec.h	Sun Nov 01 00:36:56 2015 +0200
   118.3 @@ -0,0 +1,36 @@
   118.4 +/*
   118.5 +libvmath - a vector math library
   118.6 +Copyright (C) 2004-2011 John Tsiombikas <nuclear@member.fsf.org>
   118.7 +
   118.8 +This program is free software: you can redistribute it and/or modify
   118.9 +it under the terms of the GNU Lesser General Public License as published
  118.10 +by the Free Software Foundation, either version 3 of the License, or
  118.11 +(at your option) any later version.
  118.12 +
  118.13 +This program is distributed in the hope that it will be useful,
  118.14 +but WITHOUT ANY WARRANTY; without even the implied warranty of
  118.15 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  118.16 +GNU Lesser General Public License for more details.
  118.17 +
  118.18 +You should have received a copy of the GNU Lesser General Public License
  118.19 +along with this program.  If not, see <http://www.gnu.org/licenses/>.
  118.20 +*/
  118.21 +
  118.22 +#ifndef VMATH_SPHVEC_H_
  118.23 +#define VMATH_SPHVEC_H_
  118.24 +
  118.25 +#include "vmath_types.h"
  118.26 +
  118.27 +#ifdef __cplusplus
  118.28 +/* Vector in spherical coordinates */
  118.29 +class SphVector {
  118.30 +public:
  118.31 +	scalar_t theta, phi, r;
  118.32 +
  118.33 +	SphVector(scalar_t theta = 0.0, scalar_t phi = 0.0, scalar_t r = 1.0);
  118.34 +	SphVector(const Vector3 &cvec);
  118.35 +	SphVector &operator =(const Vector3 &cvec);
  118.36 +};
  118.37 +#endif	/* __cplusplus */
  118.38 +
  118.39 +#endif	/* VMATH_SPHVEC_H_ */
   119.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   119.2 +++ b/libs/vmath/vector.cc	Sun Nov 01 00:36:56 2015 +0200
   119.3 @@ -0,0 +1,326 @@
   119.4 +#include "vector.h"
   119.5 +#include "vmath.h"
   119.6 +
   119.7 +// ---------- Vector2 -----------
   119.8 +
   119.9 +Vector2::Vector2(scalar_t x, scalar_t y)
  119.10 +{
  119.11 +	this->x = x;
  119.12 +	this->y = y;
  119.13 +}
  119.14 +
  119.15 +Vector2::Vector2(const vec2_t &vec)
  119.16 +{
  119.17 +	x = vec.x;
  119.18 +	y = vec.y;
  119.19 +}
  119.20 +
  119.21 +Vector2::Vector2(const Vector3 &vec)
  119.22 +{
  119.23 +	x = vec.x;
  119.24 +	y = vec.y;
  119.25 +}
  119.26 +
  119.27 +Vector2::Vector2(const Vector4 &vec)
  119.28 +{
  119.29 +	x = vec.x;
  119.30 +	y = vec.y;
  119.31 +}
  119.32 +
  119.33 +void Vector2::normalize()
  119.34 +{
  119.35 +	scalar_t len = length();
  119.36 +	x /= len;
  119.37 +	y /= len;
  119.38 +}
  119.39 +
  119.40 +Vector2 Vector2::normalized() const
  119.41 +{
  119.42 +	scalar_t len = length();
  119.43 +	return Vector2(x / len, y / len);
  119.44 +}
  119.45 +
  119.46 +void Vector2::transform(const Matrix3x3 &mat)
  119.47 +{
  119.48 +	scalar_t nx = mat[0][0] * x + mat[0][1] * y + mat[0][2];
  119.49 +	y = mat[1][0] * x + mat[1][1] * y + mat[1][2];
  119.50 +	x = nx;
  119.51 +}
  119.52 +
  119.53 +Vector2 Vector2::transformed(const Matrix3x3 &mat) const
  119.54 +{
  119.55 +	Vector2 vec;
  119.56 +	vec.x = mat[0][0] * x + mat[0][1] * y + mat[0][2];
  119.57 +	vec.y = mat[1][0] * x + mat[1][1] * y + mat[1][2];
  119.58 +	return vec;
  119.59 +}
  119.60 +
  119.61 +void Vector2::rotate(scalar_t angle)
  119.62 +{
  119.63 +	*this = Vector2(cos(angle) * x - sin(angle) * y, sin(angle) * x + cos(angle) * y);
  119.64 +}
  119.65 +
  119.66 +Vector2 Vector2::rotated(scalar_t angle) const
  119.67 +{
  119.68 +	return Vector2(cos(angle) * x - sin(angle) * y, sin(angle) * x + cos(angle) * y);
  119.69 +}
  119.70 +
  119.71 +Vector2 Vector2::reflection(const Vector2 &normal) const
  119.72 +{
  119.73 +	return 2.0 * dot_product(*this, normal) * normal - *this;
  119.74 +}
  119.75 +
  119.76 +Vector2 Vector2::refraction(const Vector2 &normal, scalar_t src_ior, scalar_t dst_ior) const
  119.77 +{
  119.78 +	// quick and dirty implementation :)
  119.79 +	Vector3 v3refr = Vector3(this->x, this->y, 1.0).refraction(Vector3(this->x, this->y, 1), src_ior, dst_ior);
  119.80 +	return Vector2(v3refr.x, v3refr.y);
  119.81 +}
  119.82 +
  119.83 +std::ostream &operator <<(std::ostream &out, const Vector2 &vec)
  119.84 +{
  119.85 +	out << "[" << vec.x << " " << vec.y << "]";
  119.86 +	return out;
  119.87 +}
  119.88 +
  119.89 +
  119.90 +
  119.91 +// --------- Vector3 ----------
  119.92 +
  119.93 +Vector3::Vector3(scalar_t x, scalar_t y, scalar_t z)
  119.94 +{
  119.95 +	this->x = x;
  119.96 +	this->y = y;
  119.97 +	this->z = z;
  119.98 +}
  119.99 +
 119.100 +Vector3::Vector3(const vec3_t &vec)
 119.101 +{
 119.102 +	x = vec.x;
 119.103 +	y = vec.y;
 119.104 +	z = vec.z;
 119.105 +}
 119.106 +
 119.107 +Vector3::Vector3(const Vector2 &vec)
 119.108 +{
 119.109 +	x = vec.x;
 119.110 +	y = vec.y;
 119.111 +	z = 1;
 119.112 +}
 119.113 +
 119.114 +Vector3::Vector3(const Vector4 &vec)
 119.115 +{
 119.116 +	x = vec.x;
 119.117 +	y = vec.y;
 119.118 +	z = vec.z;
 119.119 +}
 119.120 +
 119.121 +Vector3::Vector3(const SphVector &sph)
 119.122 +{
 119.123 +	*this = sph;
 119.124 +}
 119.125 +
 119.126 +Vector3 &Vector3::operator =(const SphVector &sph)
 119.127 +{
 119.128 +	x = sph.r * cos(sph.theta) * sin(sph.phi);
 119.129 +	z = sph.r * sin(sph.theta) * sin(sph.phi);
 119.130 +	y = sph.r * cos(sph.phi);
 119.131 +	return *this;
 119.132 +}
 119.133 +
 119.134 +void Vector3::normalize()
 119.135 +{
 119.136 +	scalar_t len = length();
 119.137 +	x /= len;
 119.138 +	y /= len;
 119.139 +	z /= len;
 119.140 +}
 119.141 +
 119.142 +Vector3 Vector3::normalized() const
 119.143 +{
 119.144 +	scalar_t len = length();
 119.145 +	return Vector3(x / len, y / len, z / len);
 119.146 +}
 119.147 +
 119.148 +Vector3 Vector3::reflection(const Vector3 &normal) const
 119.149 +{
 119.150 +	return 2.0 * dot_product(*this, normal) * normal - *this;
 119.151 +}
 119.152 +
 119.153 +Vector3 Vector3::refraction(const Vector3 &normal, scalar_t src_ior, scalar_t dst_ior) const
 119.154 +{
 119.155 +	return refraction(normal, src_ior / dst_ior);
 119.156 +}
 119.157 +
 119.158 +Vector3 Vector3::refraction(const Vector3 &normal, scalar_t ior) const
 119.159 +{
 119.160 +	scalar_t cos_inc = dot_product(*this, -normal);
 119.161 +
 119.162 +	scalar_t radical = 1.0 + SQ(ior) * (SQ(cos_inc) - 1.0);
 119.163 +
 119.164 +	if(radical < 0.0) {		// total internal reflection
 119.165 +		return -reflection(normal);
 119.166 +	}
 119.167 +
 119.168 +	scalar_t beta = ior * cos_inc - sqrt(radical);
 119.169 +
 119.170 +	return *this * ior + normal * beta;
 119.171 +}
 119.172 +
 119.173 +void Vector3::transform(const Matrix3x3 &mat)
 119.174 +{
 119.175 +	scalar_t nx = mat[0][0] * x + mat[0][1] * y + mat[0][2] * z;
 119.176 +	scalar_t ny = mat[1][0] * x + mat[1][1] * y + mat[1][2] * z;
 119.177 +	z = mat[2][0] * x + mat[2][1] * y + mat[2][2] * z;
 119.178 +	x = nx;
 119.179 +	y = ny;
 119.180 +}
 119.181 +
 119.182 +Vector3 Vector3::transformed(const Matrix3x3 &mat) const
 119.183 +{
 119.184 +	Vector3 vec;
 119.185 +	vec.x = mat[0][0] * x + mat[0][1] * y + mat[0][2] * z;
 119.186 +	vec.y = mat[1][0] * x + mat[1][1] * y + mat[1][2] * z;
 119.187 +	vec.z = mat[2][0] * x + mat[2][1] * y + mat[2][2] * z;
 119.188 +	return vec;
 119.189 +}
 119.190 +
 119.191 +void Vector3::transform(const Matrix4x4 &mat)
 119.192 +{
 119.193 +	scalar_t nx = mat[0][0] * x + mat[0][1] * y + mat[0][2] * z + mat[0][3];
 119.194 +	scalar_t ny = mat[1][0] * x + mat[1][1] * y + mat[1][2] * z + mat[1][3];
 119.195 +	z = mat[2][0] * x + mat[2][1] * y + mat[2][2] * z + mat[2][3];
 119.196 +	x = nx;
 119.197 +	y = ny;
 119.198 +}
 119.199 +
 119.200 +Vector3 Vector3::transformed(const Matrix4x4 &mat) const
 119.201 +{
 119.202 +	Vector3 vec;
 119.203 +	vec.x = mat[0][0] * x + mat[0][1] * y + mat[0][2] * z + mat[0][3];
 119.204 +	vec.y = mat[1][0] * x + mat[1][1] * y + mat[1][2] * z + mat[1][3];
 119.205 +	vec.z = mat[2][0] * x + mat[2][1] * y + mat[2][2] * z + mat[2][3];
 119.206 +	return vec;
 119.207 +}
 119.208 +
 119.209 +void Vector3::transform(const Quaternion &quat)
 119.210 +{
 119.211 +	Quaternion vq(0.0f, *this);
 119.212 +	vq = quat * vq * quat.inverse();
 119.213 +	*this = vq.v;
 119.214 +}
 119.215 +
 119.216 +Vector3 Vector3::transformed(const Quaternion &quat) const
 119.217 +{
 119.218 +	Quaternion vq(0.0f, *this);
 119.219 +	vq = quat * vq * quat.inverse();
 119.220 +	return vq.v;
 119.221 +}
 119.222 +
 119.223 +void Vector3::rotate(const Vector3 &euler)
 119.224 +{
 119.225 +	Matrix4x4 rot;
 119.226 +	rot.set_rotation(euler);
 119.227 +	transform(rot);
 119.228 +}
 119.229 +
 119.230 +Vector3 Vector3::rotated(const Vector3 &euler) const
 119.231 +{
 119.232 +	Matrix4x4 rot;
 119.233 +	rot.set_rotation(euler);
 119.234 +	return transformed(rot);
 119.235 +}
 119.236 +
 119.237 +std::ostream &operator <<(std::ostream &out, const Vector3 &vec)
 119.238 +{
 119.239 +	out << "[" << vec.x << " " << vec.y << " " << vec.z << "]";
 119.240 +	return out;
 119.241 +}
 119.242 +
 119.243 +
 119.244 +// -------------- Vector4 --------------
 119.245 +Vector4::Vector4(scalar_t x, scalar_t y, scalar_t z, scalar_t w)
 119.246 +{
 119.247 +	this->x = x;
 119.248 +	this->y = y;
 119.249 +	this->z = z;
 119.250 +	this->w = w;
 119.251 +}
 119.252 +
 119.253 +Vector4::Vector4(const vec4_t &vec)
 119.254 +{
 119.255 +	x = vec.x;
 119.256 +	y = vec.y;
 119.257 +	z = vec.z;
 119.258 +	w = vec.w;
 119.259 +}
 119.260 +
 119.261 +Vector4::Vector4(const Vector2 &vec)
 119.262 +{
 119.263 +	x = vec.x;
 119.264 +	y = vec.y;
 119.265 +	z = 1;
 119.266 +	w = 1;
 119.267 +}
 119.268 +
 119.269 +Vector4::Vector4(const Vector3 &vec)
 119.270 +{
 119.271 +	x = vec.x;
 119.272 +	y = vec.y;
 119.273 +	z = vec.z;
 119.274 +	w = 1;
 119.275 +}
 119.276 +
 119.277 +void Vector4::normalize()
 119.278 +{
 119.279 +	scalar_t len = (scalar_t)sqrt(x*x + y*y + z*z + w*w);
 119.280 +	x /= len;
 119.281 +	y /= len;
 119.282 +	z /= len;
 119.283 +	w /= len;
 119.284 +}
 119.285 +
 119.286 +Vector4 Vector4::normalized() const
 119.287 +{
 119.288 +	scalar_t len = (scalar_t)sqrt(x*x + y*y + z*z + w*w);
 119.289 +	return Vector4(x / len, y / len, z / len, w / len);
 119.290 +}
 119.291 +
 119.292 +void Vector4::transform(const Matrix4x4 &mat)
 119.293 +{
 119.294 +	scalar_t nx = mat[0][0] * x + mat[0][1] * y + mat[0][2] * z + mat[0][3] * w;
 119.295 +	scalar_t ny = mat[1][0] * x + mat[1][1] * y + mat[1][2] * z + mat[1][3] * w;
 119.296 +	scalar_t nz = mat[2][0] * x + mat[2][1] * y + mat[2][2] * z + mat[2][3] * w;
 119.297 +	w = mat[3][0] * x + mat[3][1] * y + mat[3][2] * z + mat[3][3] * w;
 119.298 +	x = nx;
 119.299 +	y = ny;
 119.300 +	z = nz;
 119.301 +}
 119.302 +
 119.303 +Vector4 Vector4::transformed(const Matrix4x4 &mat) const
 119.304 +{
 119.305 +	Vector4 vec;
 119.306 +	vec.x = mat[0][0] * x + mat[0][1] * y + mat[0][2] * z + mat[0][3] * w;
 119.307 +	vec.y = mat[1][0] * x + mat[1][1] * y + mat[1][2] * z + mat[1][3] * w;
 119.308 +	vec.z = mat[2][0] * x + mat[2][1] * y + mat[2][2] * z + mat[2][3] * w;
 119.309 +	vec.w = mat[3][0] * x + mat[3][1] * y + mat[3][2] * z + mat[3][3] * w;
 119.310 +	return vec;
 119.311 +}
 119.312 +
 119.313 +// TODO: implement 4D vector reflection
 119.314 +Vector4 Vector4::reflection(const Vector4 &normal) const
 119.315 +{
 119.316 +	return *this;
 119.317 +}
 119.318 +
 119.319 +// TODO: implement 4D vector refraction
 119.320 +Vector4 Vector4::refraction(const Vector4 &normal, scalar_t src_ior, scalar_t dst_ior) const
 119.321 +{
 119.322 +	return *this;
 119.323 +}
 119.324 +
 119.325 +std::ostream &operator <<(std::ostream &out, const Vector4 &vec)
 119.326 +{
 119.327 +	out << "[" << vec.x << " " << vec.y << " " << vec.z << " " << vec.w << "]";
 119.328 +	return out;
 119.329 +}
   120.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   120.2 +++ b/libs/vmath/vector.h	Sun Nov 01 00:36:56 2015 +0200
   120.3 @@ -0,0 +1,298 @@
   120.4 +/*
   120.5 +libvmath - a vector math library
   120.6 +Copyright (C) 2004-2011 John Tsiombikas <nuclear@member.fsf.org>
   120.7 +
   120.8 +This program is free software: you can redistribute it and/or modify
   120.9 +it under the terms of the GNU Lesser General Public License as published
  120.10 +by the Free Software Foundation, either version 3 of the License, or
  120.11 +(at your option) any later version.
  120.12 +
  120.13 +This program is distributed in the hope that it will be useful,
  120.14 +but WITHOUT ANY WARRANTY; without even the implied warranty of
  120.15 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  120.16 +GNU Lesser General Public License for more details.
  120.17 +
  120.18 +You should have received a copy of the GNU Lesser General Public License
  120.19 +along with this program.  If not, see <http://www.gnu.org/licenses/>.
  120.20 +*/
  120.21 +
  120.22 +#ifndef VMATH_VECTOR_H_
  120.23 +#define VMATH_VECTOR_H_
  120.24 +
  120.25 +#include <stdio.h>
  120.26 +#include "vmath_types.h"
  120.27 +
  120.28 +#ifdef __cplusplus
  120.29 +extern "C" {
  120.30 +#endif	/* __cplusplus */
  120.31 +
  120.32 +/* C 2D vector functions */
  120.33 +static inline vec2_t v2_cons(scalar_t x, scalar_t y);
  120.34 +static inline void v2_print(FILE *fp, vec2_t v);
  120.35 +
  120.36 +static inline vec2_t v2_add(vec2_t v1, vec2_t v2);
  120.37 +static inline vec2_t v2_sub(vec2_t v1, vec2_t v2);
  120.38 +static inline vec2_t v2_scale(vec2_t v, scalar_t s);
  120.39 +static inline scalar_t v2_dot(vec2_t v1, vec2_t v2);
  120.40 +static inline scalar_t v2_length(vec2_t v);
  120.41 +static inline scalar_t v2_length_sq(vec2_t v);
  120.42 +static inline vec2_t v2_normalize(vec2_t v);
  120.43 +
  120.44 +static inline vec2_t v2_lerp(vec2_t v1, vec2_t v2, scalar_t t);
  120.45 +
  120.46 +/* C 3D vector functions */
  120.47 +static inline vec3_t v3_cons(scalar_t x, scalar_t y, scalar_t z);
  120.48 +static inline void v3_print(FILE *fp, vec3_t v);
  120.49 +
  120.50 +static inline vec3_t v3_add(vec3_t v1, vec3_t v2);
  120.51 +static inline vec3_t v3_sub(vec3_t v1, vec3_t v2);
  120.52 +static inline vec3_t v3_neg(vec3_t v);
  120.53 +static inline vec3_t v3_mul(vec3_t v1, vec3_t v2);
  120.54 +static inline vec3_t v3_scale(vec3_t v1, scalar_t s);
  120.55 +static inline scalar_t v3_dot(vec3_t v1, vec3_t v2);
  120.56 +static inline vec3_t v3_cross(vec3_t v1, vec3_t v2);
  120.57 +static inline scalar_t v3_length(vec3_t v);
  120.58 +static inline scalar_t v3_length_sq(vec3_t v);
  120.59 +static inline vec3_t v3_normalize(vec3_t v);
  120.60 +static inline vec3_t v3_transform(vec3_t v, mat4_t m);
  120.61 +
  120.62 +static inline vec3_t v3_rotate(vec3_t v, scalar_t x, scalar_t y, scalar_t z);
  120.63 +static inline vec3_t v3_rotate_axis(vec3_t v, scalar_t angle, scalar_t x, scalar_t y, scalar_t z);
  120.64 +static inline vec3_t v3_rotate_quat(vec3_t v, quat_t q);
  120.65 +
  120.66 +static inline vec3_t v3_reflect(vec3_t v, vec3_t n);
  120.67 +
  120.68 +static inline vec3_t v3_lerp(vec3_t v1, vec3_t v2, scalar_t t);
  120.69 +
  120.70 +/* C 4D vector functions */
  120.71 +static inline vec4_t v4_cons(scalar_t x, scalar_t y, scalar_t z, scalar_t w);
  120.72 +static inline void v4_print(FILE *fp, vec4_t v);
  120.73 +
  120.74 +static inline vec4_t v4_add(vec4_t v1, vec4_t v2);
  120.75 +static inline vec4_t v4_sub(vec4_t v1, vec4_t v2);
  120.76 +static inline vec4_t v4_neg(vec4_t v);
  120.77 +static inline vec4_t v4_mul(vec4_t v1, vec4_t v2);
  120.78 +static inline vec4_t v4_scale(vec4_t v, scalar_t s);
  120.79 +static inline scalar_t v4_dot(vec4_t v1, vec4_t v2);
  120.80 +static inline scalar_t v4_length(vec4_t v);
  120.81 +static inline scalar_t v4_length_sq(vec4_t v);
  120.82 +static inline vec4_t v4_normalize(vec4_t v);
  120.83 +static inline vec4_t v4_transform(vec4_t v, mat4_t m);
  120.84 +
  120.85 +#ifdef __cplusplus
  120.86 +}	/* extern "C" */
  120.87 +
  120.88 +/* when included from C++ source files, also define the vector classes */
  120.89 +#include <iostream>
  120.90 +
  120.91 +/** 2D Vector */
  120.92 +class Vector2 {
  120.93 +public:
  120.94 +	scalar_t x, y;
  120.95 +
  120.96 +	Vector2(scalar_t x = 0.0, scalar_t y = 0.0);
  120.97 +	Vector2(const vec2_t &vec);
  120.98 +	Vector2(const Vector3 &vec);
  120.99 +	Vector2(const Vector4 &vec);
 120.100 +
 120.101 +	inline scalar_t &operator [](int elem);
 120.102 +	inline const scalar_t &operator [](int elem) const;
 120.103 +
 120.104 +	inline scalar_t length() const;
 120.105 +	inline scalar_t length_sq() const;
 120.106 +	void normalize();
 120.107 +	Vector2 normalized() const;
 120.108 +
 120.109 +	void transform(const Matrix3x3 &mat);
 120.110 +	Vector2 transformed(const Matrix3x3 &mat) const;
 120.111 +
 120.112 +	void rotate(scalar_t angle);
 120.113 +	Vector2 rotated(scalar_t angle) const;
 120.114 +
 120.115 +	Vector2 reflection(const Vector2 &normal) const;
 120.116 +	Vector2 refraction(const Vector2 &normal, scalar_t src_ior, scalar_t dst_ior) const;
 120.117 +};
 120.118 +
 120.119 +/* unary operations */
 120.120 +inline Vector2 operator -(const Vector2 &vec);
 120.121 +
 120.122 +/* binary vector (op) vector operations */
 120.123 +inline scalar_t dot_product(const Vector2 &v1, const Vector2 &v2);
 120.124 +
 120.125 +inline Vector2 operator +(const Vector2 &v1, const Vector2 &v2);
 120.126 +inline Vector2 operator -(const Vector2 &v1, const Vector2 &v2);
 120.127 +inline Vector2 operator *(const Vector2 &v1, const Vector2 &v2);
 120.128 +inline Vector2 operator /(const Vector2 &v1, const Vector2 &v2);
 120.129 +inline bool operator ==(const Vector2 &v1, const Vector2 &v2);
 120.130 +
 120.131 +inline void operator +=(Vector2 &v1, const Vector2 &v2);
 120.132 +inline void operator -=(Vector2 &v1, const Vector2 &v2);
 120.133 +inline void operator *=(Vector2 &v1, const Vector2 &v2);
 120.134 +inline void operator /=(Vector2 &v1, const Vector2 &v2);
 120.135 +
 120.136 +/* binary vector (op) scalar and scalar (op) vector operations */
 120.137 +inline Vector2 operator +(const Vector2 &vec, scalar_t scalar);
 120.138 +inline Vector2 operator +(scalar_t scalar, const Vector2 &vec);
 120.139 +inline Vector2 operator -(const Vector2 &vec, scalar_t scalar);
 120.140 +inline Vector2 operator *(const Vector2 &vec, scalar_t scalar);
 120.141 +inline Vector2 operator *(scalar_t scalar, const Vector2 &vec);
 120.142 +inline Vector2 operator /(const Vector2 &vec, scalar_t scalar);
 120.143 +
 120.144 +inline void operator +=(Vector2 &vec, scalar_t scalar);
 120.145 +inline void operator -=(Vector2 &vec, scalar_t scalar);
 120.146 +inline void operator *=(Vector2 &vec, scalar_t scalar);
 120.147 +inline void operator /=(Vector2 &vec, scalar_t scalar);
 120.148 +
 120.149 +std::ostream &operator <<(std::ostream &out, const Vector2 &vec);
 120.150 +
 120.151 +inline Vector2 lerp(const Vector2 &a, const Vector2 &b, scalar_t t);
 120.152 +inline Vector2 catmull_rom_spline(const Vector2 &v0, const Vector2 &v1,
 120.153 +		const Vector2 &v2, const Vector2 &v3, scalar_t t);
 120.154 +inline Vector2 bspline(const Vector2 &v0, const Vector2 &v1,
 120.155 +		const Vector2 &v2, const Vector2 &v3, scalar_t t);
 120.156 +
 120.157 +/* 3D Vector */
 120.158 +class Vector3 {
 120.159 +public:
 120.160 +	scalar_t x, y, z;
 120.161 +
 120.162 +	Vector3(scalar_t x = 0.0, scalar_t y = 0.0, scalar_t z = 0.0);
 120.163 +	Vector3(const vec3_t &vec);
 120.164 +	Vector3(const Vector2 &vec);
 120.165 +	Vector3(const Vector4 &vec);
 120.166 +	Vector3(const SphVector &sph);
 120.167 +
 120.168 +	Vector3 &operator =(const SphVector &sph);
 120.169 +
 120.170 +	inline scalar_t &operator [](int elem);
 120.171 +	inline const scalar_t &operator [](int elem) const;
 120.172 +
 120.173 +	inline scalar_t length() const;
 120.174 +	inline scalar_t length_sq() const;
 120.175 +	void normalize();
 120.176 +	Vector3 normalized() const;
 120.177 +
 120.178 +	void transform(const Matrix3x3 &mat);
 120.179 +	Vector3 transformed(const Matrix3x3 &mat) const;
 120.180 +	void transform(const Matrix4x4 &mat);
 120.181 +	Vector3 transformed(const Matrix4x4 &mat) const;
 120.182 +	void transform(const Quaternion &quat);
 120.183 +	Vector3 transformed(const Quaternion &quat) const;
 120.184 +
 120.185 +	void rotate(const Vector3 &euler);
 120.186 +	Vector3 rotated(const Vector3 &euler) const;
 120.187 +
 120.188 +	Vector3 reflection(const Vector3 &normal) const;
 120.189 +	Vector3 refraction(const Vector3 &normal, scalar_t src_ior, scalar_t dst_ior) const;
 120.190 +	Vector3 refraction(const Vector3 &normal, scalar_t ior) const;
 120.191 +};
 120.192 +
 120.193 +/* unary operations */
 120.194 +inline Vector3 operator -(const Vector3 &vec);
 120.195 +
 120.196 +/* binary vector (op) vector operations */
 120.197 +inline scalar_t dot_product(const Vector3 &v1, const Vector3 &v2);
 120.198 +inline Vector3 cross_product(const Vector3 &v1, const Vector3 &v2);
 120.199 +
 120.200 +inline Vector3 operator +(const Vector3 &v1, const Vector3 &v2);
 120.201 +inline Vector3 operator -(const Vector3 &v1, const Vector3 &v2);
 120.202 +inline Vector3 operator *(const Vector3 &v1, const Vector3 &v2);
 120.203 +inline Vector3 operator /(const Vector3 &v1, const Vector3 &v2);
 120.204 +inline bool operator ==(const Vector3 &v1, const Vector3 &v2);
 120.205 +
 120.206 +inline void operator +=(Vector3 &v1, const Vector3 &v2);
 120.207 +inline void operator -=(Vector3 &v1, const Vector3 &v2);
 120.208 +inline void operator *=(Vector3 &v1, const Vector3 &v2);
 120.209 +inline void operator /=(Vector3 &v1, const Vector3 &v2);
 120.210 +
 120.211 +/* binary vector (op) scalar and scalar (op) vector operations */
 120.212 +inline Vector3 operator +(const Vector3 &vec, scalar_t scalar);
 120.213 +inline Vector3 operator +(scalar_t scalar, const Vector3 &vec);
 120.214 +inline Vector3 operator -(const Vector3 &vec, scalar_t scalar);
 120.215 +inline Vector3 operator *(const Vector3 &vec, scalar_t scalar);
 120.216 +inline Vector3 operator *(scalar_t scalar, const Vector3 &vec);
 120.217 +inline Vector3 operator /(const Vector3 &vec, scalar_t scalar);
 120.218 +
 120.219 +inline void operator +=(Vector3 &vec, scalar_t scalar);
 120.220 +inline void operator -=(Vector3 &vec, scalar_t scalar);
 120.221 +inline void operator *=(Vector3 &vec, scalar_t scalar);
 120.222 +inline void operator /=(Vector3 &vec, scalar_t scalar);
 120.223 +
 120.224 +std::ostream &operator <<(std::ostream &out, const Vector3 &vec);
 120.225 +
 120.226 +inline Vector3 lerp(const Vector3 &a, const Vector3 &b, scalar_t t);
 120.227 +inline Vector3 catmull_rom_spline(const Vector3 &v0, const Vector3 &v1,
 120.228 +		const Vector3 &v2, const Vector3 &v3, scalar_t t);
 120.229 +inline Vector3 bspline(const Vector3 &v0, const Vector3 &v1,
 120.230 +		const Vector3 &v2, const Vector3 &v3, scalar_t t);
 120.231 +
 120.232 +/* 4D Vector */
 120.233 +class Vector4 {
 120.234 +public:
 120.235 +	scalar_t x, y, z, w;
 120.236 +
 120.237 +	Vector4(scalar_t x = 0.0, scalar_t y = 0.0, scalar_t z = 0.0, scalar_t w = 0.0);
 120.238 +	Vector4(const vec4_t &vec);
 120.239 +	Vector4(const Vector2 &vec);
 120.240 +	Vector4(const Vector3 &vec);
 120.241 +
 120.242 +	inline scalar_t &operator [](int elem);
 120.243 +	inline const scalar_t &operator [](int elem) const;
 120.244 +
 120.245 +	inline scalar_t length() const;
 120.246 +	inline scalar_t length_sq() const;
 120.247 +	void normalize();
 120.248 +	Vector4 normalized() const;
 120.249 +
 120.250 +	void transform(const Matrix4x4 &mat);
 120.251 +	Vector4 transformed(const Matrix4x4 &mat) const;
 120.252 +
 120.253 +	Vector4 reflection(const Vector4 &normal) const;
 120.254 +	Vector4 refraction(const Vector4 &normal, scalar_t src_ior, scalar_t dst_ior) const;
 120.255 +};
 120.256 +
 120.257 +
 120.258 +/* unary operations */
 120.259 +inline Vector4 operator -(const Vector4 &vec);
 120.260 +
 120.261 +/* binary vector (op) vector operations */
 120.262 +inline scalar_t dot_product(const Vector4 &v1, const Vector4 &v2);
 120.263 +inline Vector4 cross_product(const Vector4 &v1, const Vector4 &v2, const Vector4 &v3);
 120.264 +
 120.265 +inline Vector4 operator +(const Vector4 &v1, const Vector4 &v2);
 120.266 +inline Vector4 operator -(const Vector4 &v1, const Vector4 &v2);
 120.267 +inline Vector4 operator *(const Vector4 &v1, const Vector4 &v2);
 120.268 +inline Vector4 operator /(const Vector4 &v1, const Vector4 &v2);
 120.269 +inline bool operator ==(const Vector4 &v1, const Vector4 &v2);
 120.270 +
 120.271 +inline void operator +=(Vector4 &v1, const Vector4 &v2);
 120.272 +inline void operator -=(Vector4 &v1, const Vector4 &v2);
 120.273 +inline void operator *=(Vector4 &v1, const Vector4 &v2);
 120.274 +inline void operator /=(Vector4 &v1, const Vector4 &v2);
 120.275 +
 120.276 +/* binary vector (op) scalar and scalar (op) vector operations */
 120.277 +inline Vector4 operator +(const Vector4 &vec, scalar_t scalar);
 120.278 +inline Vector4 operator +(scalar_t scalar, const Vector4 &vec);
 120.279 +inline Vector4 operator -(const Vector4 &vec, scalar_t scalar);
 120.280 +inline Vector4 operator *(const Vector4 &vec, scalar_t scalar);
 120.281 +inline Vector4 operator *(scalar_t scalar, const Vector4 &vec);
 120.282 +inline Vector4 operator /(const Vector4 &vec, scalar_t scalar);
 120.283 +
 120.284 +inline void operator +=(Vector4 &vec, scalar_t scalar);
 120.285 +inline void operator -=(Vector4 &vec, scalar_t scalar);
 120.286 +inline void operator *=(Vector4 &vec, scalar_t scalar);
 120.287 +inline void operator /=(Vector4 &vec, scalar_t scalar);
 120.288 +
 120.289 +std::ostream &operator <<(std::ostream &out, const Vector4 &vec);
 120.290 +
 120.291 +inline Vector4 lerp(const Vector4 &v0, const Vector4 &v1, scalar_t t);
 120.292 +inline Vector4 catmull_rom_spline(const Vector4 &v0, const Vector4 &v1,
 120.293 +		const Vector4 &v2, const Vector4 &v3, scalar_t t);
 120.294 +inline Vector4 bspline(const Vector4 &v0, const Vector4 &v1,
 120.295 +		const Vector4 &v2, const Vector4 &v3, scalar_t t);
 120.296 +
 120.297 +#endif	/* __cplusplus */
 120.298 +
 120.299 +#include "vector.inl"
 120.300 +
 120.301 +#endif	/* VMATH_VECTOR_H_ */
   121.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   121.2 +++ b/libs/vmath/vector.inl	Sun Nov 01 00:36:56 2015 +0200
   121.3 @@ -0,0 +1,812 @@
   121.4 +/*
   121.5 +libvmath - a vector math library
   121.6 +Copyright (C) 2004-2013 John Tsiombikas <nuclear@member.fsf.org>
   121.7 +
   121.8 +This program is free software: you can redistribute it and/or modify
   121.9 +it under the terms of the GNU Lesser General Public License as published
  121.10 +by the Free Software Foundation, either version 3 of the License, or
  121.11 +(at your option) any later version.
  121.12 +
  121.13 +This program is distributed in the hope that it will be useful,
  121.14 +but WITHOUT ANY WARRANTY; without even the implied warranty of
  121.15 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  121.16 +GNU Lesser General Public License for more details.
  121.17 +
  121.18 +You should have received a copy of the GNU Lesser General Public License
  121.19 +along with this program.  If not, see <http://www.gnu.org/licenses/>.
  121.20 +*/
  121.21 +
  121.22 +#include <math.h>
  121.23 +
  121.24 +#ifdef __cplusplus
  121.25 +extern "C" {
  121.26 +#endif	/* __cplusplus */
  121.27 +
  121.28 +scalar_t spline(scalar_t, scalar_t, scalar_t, scalar_t, scalar_t);
  121.29 +scalar_t bspline(scalar_t, scalar_t, scalar_t, scalar_t, scalar_t);
  121.30 +
  121.31 +/* C 2D vector functions */
  121.32 +static inline vec2_t v2_cons(scalar_t x, scalar_t y)
  121.33 +{
  121.34 +	vec2_t v;
  121.35 +	v.x = x;
  121.36 +	v.y = y;
  121.37 +	return v;
  121.38 +}
  121.39 +
  121.40 +static inline void v2_print(FILE *fp, vec2_t v)
  121.41 +{
  121.42 +	fprintf(fp, "[ %.4f %.4f ]", v.x, v.y);
  121.43 +}
  121.44 +
  121.45 +static inline vec2_t v2_add(vec2_t v1, vec2_t v2)
  121.46 +{
  121.47 +	vec2_t res;
  121.48 +	res.x = v1.x + v2.x;
  121.49 +	res.y = v1.y + v2.y;
  121.50 +	return res;
  121.51 +}
  121.52 +
  121.53 +static inline vec2_t v2_sub(vec2_t v1, vec2_t v2)
  121.54 +{
  121.55 +	vec2_t res;
  121.56 +	res.x = v1.x - v2.x;
  121.57 +	res.y = v1.y - v2.y;
  121.58 +	return res;
  121.59 +}
  121.60 +
  121.61 +static inline vec2_t v2_scale(vec2_t v, scalar_t s)
  121.62 +{
  121.63 +	vec2_t res;
  121.64 +	res.x = v.x * s;
  121.65 +	res.y = v.y * s;
  121.66 +	return res;
  121.67 +}
  121.68 +
  121.69 +static inline scalar_t v2_dot(vec2_t v1, vec2_t v2)
  121.70 +{
  121.71 +	return v1.x * v2.x + v1.y * v2.y;
  121.72 +}
  121.73 +
  121.74 +static inline scalar_t v2_length(vec2_t v)
  121.75 +{
  121.76 +	return sqrt(v.x * v.x + v.y * v.y);
  121.77 +}
  121.78 +
  121.79 +static inline scalar_t v2_length_sq(vec2_t v)
  121.80 +{
  121.81 +	return v.x * v.x + v.y * v.y;
  121.82 +}
  121.83 +
  121.84 +static inline vec2_t v2_normalize(vec2_t v)
  121.85 +{
  121.86 +	scalar_t len = (scalar_t)sqrt(v.x * v.x + v.y * v.y);
  121.87 +	v.x /= len;
  121.88 +	v.y /= len;
  121.89 +	return v;
  121.90 +}
  121.91 +
  121.92 +static inline vec2_t v2_lerp(vec2_t v1, vec2_t v2, scalar_t t)
  121.93 +{
  121.94 +	vec2_t res;
  121.95 +	res.x = v1.x + (v2.x - v1.x) * t;
  121.96 +	res.y = v1.y + (v2.y - v1.y) * t;
  121.97 +	return res;
  121.98 +}
  121.99 +
 121.100 +
 121.101 +/* C 3D vector functions */
 121.102 +static inline vec3_t v3_cons(scalar_t x, scalar_t y, scalar_t z)
 121.103 +{
 121.104 +	vec3_t v;
 121.105 +	v.x = x;
 121.106 +	v.y = y;
 121.107 +	v.z = z;
 121.108 +	return v;
 121.109 +}
 121.110 +
 121.111 +static inline void v3_print(FILE *fp, vec3_t v)
 121.112 +{
 121.113 +	fprintf(fp, "[ %.4f %.4f %.4f ]", v.x, v.y, v.z);
 121.114 +}
 121.115 +
 121.116 +static inline vec3_t v3_add(vec3_t v1, vec3_t v2)
 121.117 +{
 121.118 +	v1.x += v2.x;
 121.119 +	v1.y += v2.y;
 121.120 +	v1.z += v2.z;
 121.121 +	return v1;
 121.122 +}
 121.123 +
 121.124 +static inline vec3_t v3_sub(vec3_t v1, vec3_t v2)
 121.125 +{
 121.126 +	v1.x -= v2.x;
 121.127 +	v1.y -= v2.y;
 121.128 +	v1.z -= v2.z;
 121.129 +	return v1;
 121.130 +}
 121.131 +
 121.132 +static inline vec3_t v3_neg(vec3_t v)
 121.133 +{
 121.134 +	v.x = -v.x;
 121.135 +	v.y = -v.y;
 121.136 +	v.z = -v.z;
 121.137 +	return v;
 121.138 +}
 121.139 +
 121.140 +static inline vec3_t v3_mul(vec3_t v1, vec3_t v2)
 121.141 +{
 121.142 +	v1.x *= v2.x;
 121.143 +	v1.y *= v2.y;
 121.144 +	v1.z *= v2.z;
 121.145 +	return v1;
 121.146 +}
 121.147 +
 121.148 +static inline vec3_t v3_scale(vec3_t v1, scalar_t s)
 121.149 +{
 121.150 +	v1.x *= s;
 121.151 +	v1.y *= s;
 121.152 +	v1.z *= s;
 121.153 +	return v1;
 121.154 +}
 121.155 +
 121.156 +static inline scalar_t v3_dot(vec3_t v1, vec3_t v2)
 121.157 +{
 121.158 +	return v1.x * v2.x + v1.y * v2.y + v1.z * v2.z;
 121.159 +}
 121.160 +
 121.161 +static inline vec3_t v3_cross(vec3_t v1, vec3_t v2)
 121.162 +{
 121.163 +	vec3_t v;
 121.164 +	v.x = v1.y * v2.z - v1.z * v2.y;
 121.165 +	v.y = v1.z * v2.x - v1.x * v2.z;
 121.166 +	v.z = v1.x * v2.y - v1.y * v2.x;
 121.167 +	return v;
 121.168 +}
 121.169 +
 121.170 +static inline scalar_t v3_length(vec3_t v)
 121.171 +{
 121.172 +	return sqrt(v.x * v.x + v.y * v.y + v.z * v.z);
 121.173 +}
 121.174 +
 121.175 +static inline scalar_t v3_length_sq(vec3_t v)
 121.176 +{
 121.177 +	return v.x * v.x + v.y * v.y + v.z * v.z;
 121.178 +}
 121.179 +
 121.180 +static inline vec3_t v3_normalize(vec3_t v)
 121.181 +{
 121.182 +	scalar_t len = sqrt(v.x * v.x + v.y * v.y + v.z * v.z);
 121.183 +	v.x /= len;
 121.184 +	v.y /= len;
 121.185 +	v.z /= len;
 121.186 +	return v;
 121.187 +}
 121.188 +
 121.189 +static inline vec3_t v3_transform(vec3_t v, mat4_t m)
 121.190 +{
 121.191 +	vec3_t res;
 121.192 +	res.x = m[0][0] * v.x + m[0][1] * v.y + m[0][2] * v.z + m[0][3];
 121.193 +	res.y = m[1][0] * v.x + m[1][1] * v.y + m[1][2] * v.z + m[1][3];
 121.194 +	res.z = m[2][0] * v.x + m[2][1] * v.y + m[2][2] * v.z + m[2][3];
 121.195 +	return res;
 121.196 +}
 121.197 +
 121.198 +static inline vec3_t v3_rotate(vec3_t v, scalar_t x, scalar_t y, scalar_t z)
 121.199 +{
 121.200 +	void m4_rotate(mat4_t, scalar_t, scalar_t, scalar_t);
 121.201 +
 121.202 +	mat4_t m = {{1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, 1, 0}, {0, 0, 0, 1}};
 121.203 +	m4_rotate(m, x, y, z);
 121.204 +	return v3_transform(v, m);
 121.205 +}
 121.206 +
 121.207 +static inline vec3_t v3_rotate_axis(vec3_t v, scalar_t angle, scalar_t x, scalar_t y, scalar_t z)
 121.208 +{
 121.209 +	void m4_rotate_axis(mat4_t, scalar_t, scalar_t, scalar_t, scalar_t);
 121.210 +
 121.211 +	mat4_t m = {{1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, 1, 0}, {0, 0, 0, 1}};
 121.212 +	m4_rotate_axis(m, angle, x, y, z);
 121.213 +	return v3_transform(v, m);
 121.214 +}
 121.215 +
 121.216 +static inline vec3_t v3_rotate_quat(vec3_t v, quat_t q)
 121.217 +{
 121.218 +	quat_t quat_rotate_quat(quat_t, quat_t);
 121.219 +
 121.220 +	quat_t vq = v4_cons(v.x, v.y, v.z, 0.0);
 121.221 +	quat_t res = quat_rotate_quat(vq, q);
 121.222 +	return v3_cons(res.x, res.y, res.z);
 121.223 +}
 121.224 +
 121.225 +static inline vec3_t v3_reflect(vec3_t v, vec3_t n)
 121.226 +{
 121.227 +	scalar_t dot = v3_dot(v, n);
 121.228 +	return v3_sub(v3_scale(n, dot * 2.0), v);
 121.229 +}
 121.230 +
 121.231 +static inline vec3_t v3_lerp(vec3_t v1, vec3_t v2, scalar_t t)
 121.232 +{
 121.233 +	v1.x += (v2.x - v1.x) * t;
 121.234 +	v1.y += (v2.y - v1.y) * t;
 121.235 +	v1.z += (v2.z - v1.z) * t;
 121.236 +	return v1;
 121.237 +}
 121.238 +
 121.239 +/* C 4D vector functions */
 121.240 +static inline vec4_t v4_cons(scalar_t x, scalar_t y, scalar_t z, scalar_t w)
 121.241 +{
 121.242 +	vec4_t v;
 121.243 +	v.x = x;
 121.244 +	v.y = y;
 121.245 +	v.z = z;
 121.246 +	v.w = w;
 121.247 +	return v;
 121.248 +}
 121.249 +
 121.250 +static inline void v4_print(FILE *fp, vec4_t v)
 121.251 +{
 121.252 +	fprintf(fp, "[ %.4f %.4f %.4f %.4f ]", v.x, v.y, v.z, v.w);
 121.253 +}
 121.254 +
 121.255 +static inline vec4_t v4_add(vec4_t v1, vec4_t v2)
 121.256 +{
 121.257 +	v1.x += v2.x;
 121.258 +	v1.y += v2.y;
 121.259 +	v1.z += v2.z;
 121.260 +	v1.w += v2.w;
 121.261 +	return v1;
 121.262 +}
 121.263 +
 121.264 +static inline vec4_t v4_sub(vec4_t v1, vec4_t v2)
 121.265 +{
 121.266 +	v1.x -= v2.x;
 121.267 +	v1.y -= v2.y;
 121.268 +	v1.z -= v2.z;
 121.269 +	v1.w -= v2.w;
 121.270 +	return v1;
 121.271 +}
 121.272 +
 121.273 +static inline vec4_t v4_neg(vec4_t v)
 121.274 +{
 121.275 +	v.x = -v.x;
 121.276 +	v.y = -v.y;
 121.277 +	v.z = -v.z;
 121.278 +	v.w = -v.w;
 121.279 +	return v;
 121.280 +}
 121.281 +
 121.282 +static inline vec4_t v4_mul(vec4_t v1, vec4_t v2)
 121.283 +{
 121.284 +	v1.x *= v2.x;
 121.285 +	v1.y *= v2.y;
 121.286 +	v1.z *= v2.z;
 121.287 +	v1.w *= v2.w;
 121.288 +	return v1;
 121.289 +}
 121.290 +
 121.291 +static inline vec4_t v4_scale(vec4_t v, scalar_t s)
 121.292 +{
 121.293 +	v.x *= s;
 121.294 +	v.y *= s;
 121.295 +	v.z *= s;
 121.296 +	v.w *= s;
 121.297 +	return v;
 121.298 +}
 121.299 +
 121.300 +static inline scalar_t v4_dot(vec4_t v1, vec4_t v2)
 121.301 +{
 121.302 +	return v1.x * v2.x + v1.y * v2.y + v1.z * v2.z + v1.w * v2.w;
 121.303 +}
 121.304 +
 121.305 +static inline scalar_t v4_length(vec4_t v)
 121.306 +{
 121.307 +	return sqrt(v.x * v.x + v.y * v.y + v.z * v.z + v.w * v.w);
 121.308 +}
 121.309 +
 121.310 +static inline scalar_t v4_length_sq(vec4_t v)
 121.311 +{
 121.312 +	return v.x * v.x + v.y * v.y + v.z * v.z + v.w * v.w;
 121.313 +}
 121.314 +
 121.315 +static inline vec4_t v4_normalize(vec4_t v)
 121.316 +{
 121.317 +	scalar_t len = sqrt(v.x * v.x + v.y * v.y + v.z * v.z + v.w * v.w);
 121.318 +	v.x /= len;
 121.319 +	v.y /= len;
 121.320 +	v.z /= len;
 121.321 +	v.w /= len;
 121.322 +	return v;
 121.323 +}
 121.324 +
 121.325 +static inline vec4_t v4_transform(vec4_t v, mat4_t m)
 121.326 +{
 121.327 +	vec4_t res;
 121.328 +	res.x = m[0][0] * v.x + m[0][1] * v.y + m[0][2] * v.z + m[0][3] * v.w;
 121.329 +	res.y = m[1][0] * v.x + m[1][1] * v.y + m[1][2] * v.z + m[1][3] * v.w;
 121.330 +	res.z = m[2][0] * v.x + m[2][1] * v.y + m[2][2] * v.z + m[2][3] * v.w;
 121.331 +	res.w = m[3][0] * v.x + m[3][1] * v.y + m[3][2] * v.z + m[3][3] * v.w;
 121.332 +	return res;
 121.333 +}
 121.334 +
 121.335 +#ifdef __cplusplus
 121.336 +}	/* extern "C" */
 121.337 +
 121.338 +
 121.339 +/* --------------- C++ part -------------- */
 121.340 +
 121.341 +inline scalar_t &Vector2::operator [](int elem)
 121.342 +{
 121.343 +	return elem ? y : x;
 121.344 +}
 121.345 +
 121.346 +inline const scalar_t &Vector2::operator [](int elem) const
 121.347 +{
 121.348 +	return elem ? y : x;
 121.349 +}
 121.350 +
 121.351 +inline Vector2 operator -(const Vector2 &vec)
 121.352 +{
 121.353 +	return Vector2(-vec.x, -vec.y);
 121.354 +}
 121.355 +
 121.356 +inline scalar_t dot_product(const Vector2 &v1, const Vector2 &v2)
 121.357 +{
 121.358 +	return v1.x * v2.x + v1.y * v2.y;
 121.359 +}
 121.360 +
 121.361 +inline Vector2 operator +(const Vector2 &v1, const Vector2 &v2)
 121.362 +{
 121.363 +	return Vector2(v1.x + v2.x, v1.y + v2.y);
 121.364 +}
 121.365 +
 121.366 +inline Vector2 operator -(const Vector2 &v1, const Vector2 &v2)
 121.367 +{
 121.368 +	return Vector2(v1.x - v2.x, v1.y - v2.y);
 121.369 +}
 121.370 +
 121.371 +inline Vector2 operator *(const Vector2 &v1, const Vector2 &v2)
 121.372 +{
 121.373 +	return Vector2(v1.x * v2.x, v1.y * v2.y);
 121.374 +}
 121.375 +
 121.376 +inline Vector2 operator /(const Vector2 &v1, const Vector2 &v2)
 121.377 +{
 121.378 +	return Vector2(v1.x / v2.x, v1.y / v2.y);
 121.379 +}
 121.380 +
 121.381 +inline bool operator ==(const Vector2 &v1, const Vector2 &v2)
 121.382 +{
 121.383 +	return (fabs(v1.x - v2.x) < XSMALL_NUMBER) && (fabs(v1.y - v2.x) < XSMALL_NUMBER);
 121.384 +}
 121.385 +
 121.386 +inline void operator +=(Vector2 &v1, const Vector2 &v2)
 121.387 +{
 121.388 +	v1.x += v2.x;
 121.389 +	v1.y += v2.y;
 121.390 +}
 121.391 +
 121.392 +inline void operator -=(Vector2 &v1, const Vector2 &v2)
 121.393 +{
 121.394 +	v1.x -= v2.x;
 121.395 +	v1.y -= v2.y;
 121.396 +}
 121.397 +
 121.398 +inline void operator *=(Vector2 &v1, const Vector2 &v2)
 121.399 +{
 121.400 +	v1.x *= v2.x;
 121.401 +	v1.y *= v2.y;
 121.402 +}
 121.403 +
 121.404 +inline void operator /=(Vector2 &v1, const Vector2 &v2)
 121.405 +{
 121.406 +	v1.x /= v2.x;
 121.407 +	v1.y /= v2.y;
 121.408 +}
 121.409 +
 121.410 +inline Vector2 operator +(const Vector2 &vec, scalar_t scalar)
 121.411 +{
 121.412 +	return Vector2(vec.x + scalar, vec.y + scalar);
 121.413 +}
 121.414 +
 121.415 +inline Vector2 operator +(scalar_t scalar, const Vector2 &vec)
 121.416 +{
 121.417 +	return Vector2(vec.x + scalar, vec.y + scalar);
 121.418 +}
 121.419 +
 121.420 +inline Vector2 operator -(const Vector2 &vec, scalar_t scalar)
 121.421 +{
 121.422 +	return Vector2(vec.x - scalar, vec.y - scalar);
 121.423 +}
 121.424 +
 121.425 +inline Vector2 operator *(const Vector2 &vec, scalar_t scalar)
 121.426 +{
 121.427 +	return Vector2(vec.x * scalar, vec.y * scalar);
 121.428 +}
 121.429 +
 121.430 +inline Vector2 operator *(scalar_t scalar, const Vector2 &vec)
 121.431 +{
 121.432 +	return Vector2(vec.x * scalar, vec.y * scalar);
 121.433 +}
 121.434 +
 121.435 +inline Vector2 operator /(const Vector2 &vec, scalar_t scalar)
 121.436 +{
 121.437 +	return Vector2(vec.x / scalar, vec.y / scalar);
 121.438 +}
 121.439 +
 121.440 +inline void operator +=(Vector2 &vec, scalar_t scalar)
 121.441 +{
 121.442 +	vec.x += scalar;
 121.443 +	vec.y += scalar;
 121.444 +}
 121.445 +
 121.446 +inline void operator -=(Vector2 &vec, scalar_t scalar)
 121.447 +{
 121.448 +	vec.x -= scalar;
 121.449 +	vec.y -= scalar;
 121.450 +}
 121.451 +
 121.452 +inline void operator *=(Vector2 &vec, scalar_t scalar)
 121.453 +{
 121.454 +	vec.x *= scalar;
 121.455 +	vec.y *= scalar;
 121.456 +}
 121.457 +
 121.458 +inline void operator /=(Vector2 &vec, scalar_t scalar)
 121.459 +{
 121.460 +	vec.x /= scalar;
 121.461 +	vec.y /= scalar;
 121.462 +}
 121.463 +
 121.464 +inline scalar_t Vector2::length() const
 121.465 +{
 121.466 +	return sqrt(x*x + y*y);
 121.467 +}
 121.468 +
 121.469 +inline scalar_t Vector2::length_sq() const
 121.470 +{
 121.471 +	return x*x + y*y;
 121.472 +}
 121.473 +
 121.474 +inline Vector2 lerp(const Vector2 &a, const Vector2 &b, scalar_t t)
 121.475 +{
 121.476 +	return a + (b - a) * t;
 121.477 +}
 121.478 +
 121.479 +inline Vector2 catmull_rom_spline(const Vector2 &v0, const Vector2 &v1,
 121.480 +		const Vector2 &v2, const Vector2 &v3, scalar_t t)
 121.481 +{
 121.482 +	scalar_t x = spline(v0.x, v1.x, v2.x, v3.x, t);
 121.483 +	scalar_t y = spline(v0.y, v1.y, v2.y, v3.y, t);
 121.484 +	return Vector2(x, y);
 121.485 +}
 121.486 +
 121.487 +inline Vector2 bspline(const Vector2 &v0, const Vector2 &v1,
 121.488 +		const Vector2 &v2, const Vector2 &v3, scalar_t t)
 121.489 +{
 121.490 +	scalar_t x = bspline(v0.x, v1.x, v2.x, v3.x, t);
 121.491 +	scalar_t y = bspline(v0.y, v1.y, v2.y, v3.y, t);
 121.492 +	return Vector2(x, y);
 121.493 +}
 121.494 +
 121.495 +
 121.496 +/* ------------- Vector3 -------------- */
 121.497 +
 121.498 +inline scalar_t &Vector3::operator [](int elem) {
 121.499 +	return elem ? (elem == 1 ? y : z) : x;
 121.500 +}
 121.501 +
 121.502 +inline const scalar_t &Vector3::operator [](int elem) const {
 121.503 +	return elem ? (elem == 1 ? y : z) : x;
 121.504 +}
 121.505 +
 121.506 +/* unary operations */
 121.507 +inline Vector3 operator -(const Vector3 &vec) {
 121.508 +	return Vector3(-vec.x, -vec.y, -vec.z);
 121.509 +}
 121.510 +
 121.511 +/* binary vector (op) vector operations */
 121.512 +inline scalar_t dot_product(const Vector3 &v1, const Vector3 &v2) {
 121.513 +	return v1.x * v2.x + v1.y * v2.y + v1.z * v2.z;
 121.514 +}
 121.515 +
 121.516 +inline Vector3 cross_product(const Vector3 &v1, const Vector3 &v2) {
 121.517 +	return Vector3(v1.y * v2.z - v1.z * v2.y,  v1.z * v2.x - v1.x * v2.z,  v1.x * v2.y - v1.y * v2.x);
 121.518 +}
 121.519 +
 121.520 +
 121.521 +inline Vector3 operator +(const Vector3 &v1, const Vector3 &v2) {
 121.522 +	return Vector3(v1.x + v2.x, v1.y + v2.y, v1.z + v2.z);
 121.523 +}
 121.524 +
 121.525 +inline Vector3 operator -(const Vector3 &v1, const Vector3 &v2) {
 121.526 +	return Vector3(v1.x - v2.x, v1.y - v2.y, v1.z - v2.z);
 121.527 +}
 121.528 +
 121.529 +inline Vector3 operator *(const Vector3 &v1, const Vector3 &v2) {
 121.530 +	return Vector3(v1.x * v2.x, v1.y * v2.y, v1.z * v2.z);
 121.531 +}
 121.532 +
 121.533 +inline Vector3 operator /(const Vector3 &v1, const Vector3 &v2) {
 121.534 +	return Vector3(v1.x / v2.x, v1.y / v2.y, v1.z / v2.z);
 121.535 +}
 121.536 +
 121.537 +inline bool operator ==(const Vector3 &v1, const Vector3 &v2) {
 121.538 +	return (fabs(v1.x - v2.x) < XSMALL_NUMBER) && (fabs(v1.y - v2.y) < XSMALL_NUMBER) && (fabs(v1.z - v2.z) < XSMALL_NUMBER);
 121.539 +}
 121.540 +
 121.541 +inline void operator +=(Vector3 &v1, const Vector3 &v2) {
 121.542 +	v1.x += v2.x;
 121.543 +	v1.y += v2.y;
 121.544 +	v1.z += v2.z;
 121.545 +}
 121.546 +
 121.547 +inline void operator -=(Vector3 &v1, const Vector3 &v2) {
 121.548 +	v1.x -= v2.x;
 121.549 +	v1.y -= v2.y;
 121.550 +	v1.z -= v2.z;
 121.551 +}
 121.552 +
 121.553 +inline void operator *=(Vector3 &v1, const Vector3 &v2) {
 121.554 +	v1.x *= v2.x;
 121.555 +	v1.y *= v2.y;
 121.556 +	v1.z *= v2.z;
 121.557 +}
 121.558 +
 121.559 +inline void operator /=(Vector3 &v1, const Vector3 &v2) {
 121.560 +	v1.x /= v2.x;
 121.561 +	v1.y /= v2.y;
 121.562 +	v1.z /= v2.z;
 121.563 +}
 121.564 +/* binary vector (op) scalar and scalar (op) vector operations */
 121.565 +inline Vector3 operator +(const Vector3 &vec, scalar_t scalar) {
 121.566 +	return Vector3(vec.x + scalar, vec.y + scalar, vec.z + scalar);
 121.567 +}
 121.568 +
 121.569 +inline Vector3 operator +(scalar_t scalar, const Vector3 &vec) {
 121.570 +	return Vector3(vec.x + scalar, vec.y + scalar, vec.z + scalar);
 121.571 +}
 121.572 +
 121.573 +inline Vector3 operator -(const Vector3 &vec, scalar_t scalar) {
 121.574 +	return Vector3(vec.x - scalar, vec.y - scalar, vec.z - scalar);
 121.575 +}
 121.576 +
 121.577 +inline Vector3 operator *(const Vector3 &vec, scalar_t scalar) {
 121.578 +	return Vector3(vec.x * scalar, vec.y * scalar, vec.z * scalar);
 121.579 +}
 121.580 +
 121.581 +inline Vector3 operator *(scalar_t scalar, const Vector3 &vec) {
 121.582 +	return Vector3(vec.x * scalar, vec.y * scalar, vec.z * scalar);
 121.583 +}
 121.584 +
 121.585 +inline Vector3 operator /(const Vector3 &vec, scalar_t scalar) {
 121.586 +	return Vector3(vec.x / scalar, vec.y / scalar, vec.z / scalar);
 121.587 +}
 121.588 +
 121.589 +inline void operator +=(Vector3 &vec, scalar_t scalar) {
 121.590 +	vec.x += scalar;
 121.591 +	vec.y += scalar;
 121.592 +	vec.z += scalar;
 121.593 +}
 121.594 +
 121.595 +inline void operator -=(Vector3 &vec, scalar_t scalar) {
 121.596 +	vec.x -= scalar;
 121.597 +	vec.y -= scalar;
 121.598 +	vec.z -= scalar;
 121.599 +}
 121.600 +
 121.601 +inline void operator *=(Vector3 &vec, scalar_t scalar) {
 121.602 +	vec.x *= scalar;
 121.603 +	vec.y *= scalar;
 121.604 +	vec.z *= scalar;
 121.605 +}
 121.606 +
 121.607 +inline void operator /=(Vector3 &vec, scalar_t scalar) {
 121.608 +	vec.x /= scalar;
 121.609 +	vec.y /= scalar;
 121.610 +	vec.z /= scalar;
 121.611 +}
 121.612 +
 121.613 +inline scalar_t Vector3::length() const {
 121.614 +	return sqrt(x*x + y*y + z*z);
 121.615 +}
 121.616 +inline scalar_t Vector3::length_sq() const {
 121.617 +	return x*x + y*y + z*z;
 121.618 +}
 121.619 +
 121.620 +inline Vector3 lerp(const Vector3 &a, const Vector3 &b, scalar_t t) {
 121.621 +	return a + (b - a) * t;
 121.622 +}
 121.623 +
 121.624 +inline Vector3 catmull_rom_spline(const Vector3 &v0, const Vector3 &v1,
 121.625 +		const Vector3 &v2, const Vector3 &v3, scalar_t t)
 121.626 +{
 121.627 +	scalar_t x = spline(v0.x, v1.x, v2.x, v3.x, t);
 121.628 +	scalar_t y = spline(v0.y, v1.y, v2.y, v3.y, t);
 121.629 +	scalar_t z = spline(v0.z, v1.z, v2.z, v3.z, t);
 121.630 +	return Vector3(x, y, z);
 121.631 +}
 121.632 +
 121.633 +inline Vector3 bspline(const Vector3 &v0, const Vector3 &v1,
 121.634 +		const Vector3 &v2, const Vector3 &v3, scalar_t t)
 121.635 +{
 121.636 +	scalar_t x = bspline(v0.x, v1.x, v2.x, v3.x, t);
 121.637 +	scalar_t y = bspline(v0.y, v1.y, v2.y, v3.y, t);
 121.638 +	scalar_t z = bspline(v0.z, v1.z, v2.z, v3.z, t);
 121.639 +	return Vector3(x, y, z);
 121.640 +}
 121.641 +
 121.642 +/* ----------- Vector4 ----------------- */
 121.643 +
 121.644 +inline scalar_t &Vector4::operator [](int elem) {
 121.645 +	return elem ? (elem == 1 ? y : (elem == 2 ? z : w)) : x;
 121.646 +}
 121.647 +
 121.648 +inline const scalar_t &Vector4::operator [](int elem) const {
 121.649 +	return elem ? (elem == 1 ? y : (elem == 2 ? z : w)) : x;
 121.650 +}
 121.651 +
 121.652 +inline Vector4 operator -(const Vector4 &vec) {
 121.653 +	return Vector4(-vec.x, -vec.y, -vec.z, -vec.w);
 121.654 +}
 121.655 +
 121.656 +inline scalar_t dot_product(const Vector4 &v1, const Vector4 &v2) {
 121.657 +	return v1.x * v2.x + v1.y * v2.y + v1.z * v2.z + v1.w * v2.w;
 121.658 +}
 121.659 +
 121.660 +inline Vector4 cross_product(const Vector4 &v1, const Vector4 &v2, const Vector4 &v3) {
 121.661 +	scalar_t a, b, c, d, e, f;       /* Intermediate Values */
 121.662 +    Vector4 result;
 121.663 +
 121.664 +    /* Calculate intermediate values. */
 121.665 +    a = (v2.x * v3.y) - (v2.y * v3.x);
 121.666 +    b = (v2.x * v3.z) - (v2.z * v3.x);
 121.667 +    c = (v2.x * v3.w) - (v2.w * v3.x);
 121.668 +    d = (v2.y * v3.z) - (v2.z * v3.y);
 121.669 +    e = (v2.y * v3.w) - (v2.w * v3.y);
 121.670 +    f = (v2.z * v3.w) - (v2.w * v3.z);
 121.671 +
 121.672 +    /* Calculate the result-vector components. */
 121.673 +    result.x =   (v1.y * f) - (v1.z * e) + (v1.w * d);
 121.674 +    result.y = - (v1.x * f) + (v1.z * c) - (v1.w * b);
 121.675 +    result.z =   (v1.x * e) - (v1.y * c) + (v1.w * a);
 121.676 +    result.w = - (v1.x * d) + (v1.y * b) - (v1.z * a);
 121.677 +    return result;
 121.678 +}
 121.679 +
 121.680 +inline Vector4 operator +(const Vector4 &v1, const Vector4 &v2) {
 121.681 +	return Vector4(v1.x + v2.x, v1.y + v2.y, v1.z + v2.z, v1.w + v2.w);
 121.682 +}
 121.683 +
 121.684 +inline Vector4 operator -(const Vector4 &v1, const Vector4 &v2) {
 121.685 +	return Vector4(v1.x - v2.x, v1.y - v2.y, v1.z - v2.z, v1.w - v2.w);
 121.686 +}
 121.687 +
 121.688 +inline Vector4 operator *(const Vector4 &v1, const Vector4 &v2) {
 121.689 +	return Vector4(v1.x * v2.x, v1.y * v2.y, v1.z * v2.z, v1.w * v2.w);
 121.690 +}
 121.691 +
 121.692 +inline Vector4 operator /(const Vector4 &v1, const Vector4 &v2) {
 121.693 +	return Vector4(v1.x / v2.x, v1.y / v2.y, v1.z / v2.z, v1.w / v2.w);
 121.694 +}
 121.695 +
 121.696 +inline bool operator ==(const Vector4 &v1, const Vector4 &v2) {
 121.697 +	return	(fabs(v1.x - v2.x) < XSMALL_NUMBER) &&
 121.698 +			(fabs(v1.y - v2.y) < XSMALL_NUMBER) &&
 121.699 +			(fabs(v1.z - v2.z) < XSMALL_NUMBER) &&
 121.700 +			(fabs(v1.w - v2.w) < XSMALL_NUMBER);
 121.701 +}
 121.702 +
 121.703 +inline void operator +=(Vector4 &v1, const Vector4 &v2) {
 121.704 +	v1.x += v2.x;
 121.705 +	v1.y += v2.y;
 121.706 +	v1.z += v2.z;
 121.707 +	v1.w += v2.w;
 121.708 +}
 121.709 +
 121.710 +inline void operator -=(Vector4 &v1, const Vector4 &v2) {
 121.711 +	v1.x -= v2.x;
 121.712 +	v1.y -= v2.y;
 121.713 +	v1.z -= v2.z;
 121.714 +	v1.w -= v2.w;
 121.715 +}
 121.716 +
 121.717 +inline void operator *=(Vector4 &v1, const Vector4 &v2) {
 121.718 +	v1.x *= v2.x;
 121.719 +	v1.y *= v2.y;
 121.720 +	v1.z *= v2.z;
 121.721 +	v1.w *= v2.w;
 121.722 +}
 121.723 +
 121.724 +inline void operator /=(Vector4 &v1, const Vector4 &v2) {
 121.725 +	v1.x /= v2.x;
 121.726 +	v1.y /= v2.y;
 121.727 +	v1.z /= v2.z;
 121.728 +	v1.w /= v2.w;
 121.729 +}
 121.730 +
 121.731 +/* binary vector (op) scalar and scalar (op) vector operations */
 121.732 +inline Vector4 operator +(const Vector4 &vec, scalar_t scalar) {
 121.733 +	return Vector4(vec.x + scalar, vec.y + scalar, vec.z + scalar, vec.w + scalar);
 121.734 +}
 121.735 +
 121.736 +inline Vector4 operator +(scalar_t scalar, const Vector4 &vec) {
 121.737 +	return Vector4(vec.x + scalar, vec.y + scalar, vec.z + scalar, vec.w + scalar);
 121.738 +}
 121.739 +
 121.740 +inline Vector4 operator -(const Vector4 &vec, scalar_t scalar) {
 121.741 +	return Vector4(vec.x - scalar, vec.y - scalar, vec.z - scalar, vec.w - scalar);
 121.742 +}
 121.743 +
 121.744 +inline Vector4 operator *(const Vector4 &vec, scalar_t scalar) {
 121.745 +	return Vector4(vec.x * scalar, vec.y * scalar, vec.z * scalar, vec.w * scalar);
 121.746 +}
 121.747 +
 121.748 +inline Vector4 operator *(scalar_t scalar, const Vector4 &vec) {
 121.749 +	return Vector4(vec.x * scalar, vec.y * scalar, vec.z * scalar, vec.w * scalar);
 121.750 +}
 121.751 +
 121.752 +inline Vector4 operator /(const Vector4 &vec, scalar_t scalar) {
 121.753 +	return Vector4(vec.x / scalar, vec.y / scalar, vec.z / scalar, vec.w / scalar);
 121.754 +}
 121.755 +
 121.756 +inline void operator +=(Vector4 &vec, scalar_t scalar) {
 121.757 +	vec.x += scalar;
 121.758 +	vec.y += scalar;
 121.759 +	vec.z += scalar;
 121.760 +	vec.w += scalar;
 121.761 +}
 121.762 +
 121.763 +inline void operator -=(Vector4 &vec, scalar_t scalar) {
 121.764 +	vec.x -= scalar;
 121.765 +	vec.y -= scalar;
 121.766 +	vec.z -= scalar;
 121.767 +	vec.w -= scalar;
 121.768 +}
 121.769 +
 121.770 +inline void operator *=(Vector4 &vec, scalar_t scalar) {
 121.771 +	vec.x *= scalar;
 121.772 +	vec.y *= scalar;
 121.773 +	vec.z *= scalar;
 121.774 +	vec.w *= scalar;
 121.775 +}
 121.776 +
 121.777 +inline void operator /=(Vector4 &vec, scalar_t scalar) {
 121.778 +	vec.x /= scalar;
 121.779 +	vec.y /= scalar;
 121.780 +	vec.z /= scalar;
 121.781 +	vec.w /= scalar;
 121.782 +}
 121.783 +
 121.784 +inline scalar_t Vector4::length() const {
 121.785 +	return sqrt(x*x + y*y + z*z + w*w);
 121.786 +}
 121.787 +inline scalar_t Vector4::length_sq() const {
 121.788 +	return x*x + y*y + z*z + w*w;
 121.789 +}
 121.790 +
 121.791 +inline Vector4 lerp(const Vector4 &v0, const Vector4 &v1, scalar_t t)
 121.792 +{
 121.793 +	return v0 + (v1 - v0) * t;
 121.794 +}
 121.795 +
 121.796 +inline Vector4 catmull_rom_spline(const Vector4 &v0, const Vector4 &v1,
 121.797 +		const Vector4 &v2, const Vector4 &v3, scalar_t t)
 121.798 +{
 121.799 +	scalar_t x = spline(v0.x, v1.x, v2.x, v3.x, t);
 121.800 +	scalar_t y = spline(v0.y, v1.y, v2.y, v3.y, t);
 121.801 +	scalar_t z = spline(v0.z, v1.z, v2.z, v3.z, t);
 121.802 +	scalar_t w = spline(v0.w, v1.w, v2.w, v3.w, t);
 121.803 +	return Vector4(x, y, z, w);
 121.804 +}
 121.805 +
 121.806 +inline Vector4 bspline(const Vector4 &v0, const Vector4 &v1,
 121.807 +		const Vector4 &v2, const Vector4 &v3, scalar_t t)
 121.808 +{
 121.809 +	scalar_t x = bspline(v0.x, v1.x, v2.x, v3.x, t);
 121.810 +	scalar_t y = bspline(v0.y, v1.y, v2.y, v3.y, t);
 121.811 +	scalar_t z = bspline(v0.z, v1.z, v2.z, v3.z, t);
 121.812 +	scalar_t w = bspline(v0.w, v1.w, v2.w, v3.w, t);
 121.813 +	return Vector4(x, y, z, w);
 121.814 +}
 121.815 +#endif	/* __cplusplus */
   122.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   122.2 +++ b/libs/vmath/vmath.c	Sun Nov 01 00:36:56 2015 +0200
   122.3 @@ -0,0 +1,386 @@
   122.4 +/*
   122.5 +libvmath - a vector math library
   122.6 +Copyright (C) 2004-2011 John Tsiombikas <nuclear@member.fsf.org>
   122.7 +
   122.8 +This program is free software: you can redistribute it and/or modify
   122.9 +it under the terms of the GNU Lesser General Public License as published
  122.10 +by the Free Software Foundation, either version 3 of the License, or
  122.11 +(at your option) any later version.
  122.12 +
  122.13 +This program is distributed in the hope that it will be useful,
  122.14 +but WITHOUT ANY WARRANTY; without even the implied warranty of
  122.15 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  122.16 +GNU Lesser General Public License for more details.
  122.17 +
  122.18 +You should have received a copy of the GNU Lesser General Public License
  122.19 +along with this program.  If not, see <http://www.gnu.org/licenses/>.
  122.20 +*/
  122.21 +#include <stdlib.h>
  122.22 +#include <math.h>
  122.23 +#include "vmath.h"
  122.24 +
  122.25 +#if defined(__APPLE__) && !defined(TARGET_IPHONE)
  122.26 +#include <xmmintrin.h>
  122.27 +
  122.28 +void enable_fpexcept(void)
  122.29 +{
  122.30 +	unsigned int bits;
  122.31 +	bits = _MM_MASK_INVALID | _MM_MASK_DIV_ZERO | _MM_MASK_OVERFLOW | _MM_MASK_UNDERFLOW;
  122.32 +	_MM_SET_EXCEPTION_MASK(_MM_GET_EXCEPTION_MASK() & ~bits);
  122.33 +}
  122.34 +
  122.35 +void disable_fpexcept(void)
  122.36 +{
  122.37 +	unsigned int bits;
  122.38 +	bits = _MM_MASK_INVALID | _MM_MASK_DIV_ZERO | _MM_MASK_OVERFLOW | _MM_MASK_UNDERFLOW;
  122.39 +	_MM_SET_EXCEPTION_MASK(_MM_GET_EXCEPTION_MASK() | bits);
  122.40 +}
  122.41 +
  122.42 +#elif defined(__GNUC__) && !defined(TARGET_IPHONE)
  122.43 +#define __USE_GNU
  122.44 +#include <fenv.h>
  122.45 +
  122.46 +void enable_fpexcept(void)
  122.47 +{
  122.48 +	feenableexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW);
  122.49 +}
  122.50 +
  122.51 +void disable_fpexcept(void)
  122.52 +{
  122.53 +	fedisableexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW);
  122.54 +}
  122.55 +
  122.56 +#elif defined(_MSC_VER)
  122.57 +#include <float.h>
  122.58 +
  122.59 +void enable_fpexcept(void)
  122.60 +{
  122.61 +	_clearfp();
  122.62 +	_controlfp(_controlfp(0, 0) & ~(_EM_INVALID | _EM_ZERODIVIDE | _EM_OVERFLOW), _MCW_EM);
  122.63 +}
  122.64 +
  122.65 +void disable_fpexcept(void)
  122.66 +{
  122.67 +	_clearfp();
  122.68 +	_controlfp(_controlfp(0, 0) | (_EM_INVALID | _EM_ZERODIVIDE | _EM_OVERFLOW), _MCW_EM);
  122.69 +}
  122.70 +#else
  122.71 +void enable_fpexcept(void) {}
  122.72 +void disable_fpexcept(void) {}
  122.73 +#endif
  122.74 +
  122.75 +
  122.76 +/** Numerical calculation of integrals using simpson's rule */
  122.77 +scalar_t integral(scalar_t (*f)(scalar_t), scalar_t low, scalar_t high, int samples)
  122.78 +{
  122.79 +	int i;
  122.80 +	scalar_t h = (high - low) / (scalar_t)samples;
  122.81 +	scalar_t sum = 0.0;
  122.82 +
  122.83 +	for(i=0; i<samples+1; i++) {
  122.84 +		scalar_t y = f((scalar_t)i * h + low);
  122.85 +		sum += ((!i || i == samples) ? y : ((i % 2) ? 4.0 * y : 2.0 * y)) * (h / 3.0);
  122.86 +	}
  122.87 +	return sum;
  122.88 +}
  122.89 +
  122.90 +/** Gaussuan function */
  122.91 +scalar_t gaussian(scalar_t x, scalar_t mean, scalar_t sdev)
  122.92 +{
  122.93 +	scalar_t exponent = -SQ(x - mean) / (2.0 * SQ(sdev));
  122.94 +	return 1.0 - -pow(M_E, exponent) / (sdev * sqrt(TWO_PI));
  122.95 +}
  122.96 +
  122.97 +
  122.98 +/** b-spline approximation */
  122.99 +scalar_t bspline(scalar_t a, scalar_t b, scalar_t c, scalar_t d, scalar_t t)
 122.100 +{
 122.101 +	vec4_t tmp;
 122.102 +	scalar_t tsq = t * t;
 122.103 +
 122.104 +	static mat4_t bspline_mat = {
 122.105 +		{-1,  3, -3,  1},
 122.106 +		{3, -6,  3,  0},
 122.107 +		{-3,  0,  3,  0},
 122.108 +		{1,  4,  1,  0}
 122.109 +	};
 122.110 +
 122.111 +	tmp = v4_scale(v4_transform(v4_cons(a, b, c, d), bspline_mat), 1.0f / 6.0f);
 122.112 +	return v4_dot(v4_cons(tsq * t, tsq, t, 1.0), tmp);
 122.113 +}
 122.114 +
 122.115 +/** Catmull-rom spline interpolation */
 122.116 +scalar_t spline(scalar_t a, scalar_t b, scalar_t c, scalar_t d, scalar_t t)
 122.117 +{
 122.118 +	vec4_t tmp;
 122.119 +	scalar_t tsq = t * t;
 122.120 +
 122.121 +	static mat4_t crspline_mat = {
 122.122 +		{-1,  3, -3,  1},
 122.123 +		{2, -5,  4, -1},
 122.124 +		{-1,  0,  1,  0},
 122.125 +		{0,  2,  0,  0}
 122.126 +	};
 122.127 +
 122.128 +	tmp = v4_scale(v4_transform(v4_cons(a, b, c, d), crspline_mat), 0.5);
 122.129 +	return v4_dot(v4_cons(tsq * t, tsq, t, 1.0), tmp);
 122.130 +}
 122.131 +
 122.132 +/** Bezier interpolation */
 122.133 +scalar_t bezier(scalar_t a, scalar_t b, scalar_t c, scalar_t d, scalar_t t)
 122.134 +{
 122.135 +	scalar_t omt, omt3, t3, f;
 122.136 +	t3 = t * t * t;
 122.137 +	omt = 1.0f - t;
 122.138 +	omt3 = omt * omt * omt;
 122.139 +	f = 3 * t * omt;
 122.140 +
 122.141 +	return (a * omt3) + (b * f * omt) + (c * f * t) + (d * t3);
 122.142 +}
 122.143 +
 122.144 +/* ---- Ken Perlin's implementation of noise ---- */
 122.145 +
 122.146 +#define B	0x100
 122.147 +#define BM	0xff
 122.148 +#define N	0x1000
 122.149 +#define NP	12   /* 2^N */
 122.150 +#define NM	0xfff
 122.151 +
 122.152 +#define s_curve(t) (t * t * (3.0f - 2.0f * t))
 122.153 +
 122.154 +#define setup(elem, b0, b1, r0, r1) \
 122.155 +	do {							\
 122.156 +		scalar_t t = elem + N;		\
 122.157 +		b0 = ((int)t) & BM;			\
 122.158 +		b1 = (b0 + 1) & BM;			\
 122.159 +		r0 = t - (int)t;			\
 122.160 +		r1 = r0 - 1.0f;				\
 122.161 +	} while(0)
 122.162 +
 122.163 +
 122.164 +static int perm[B + B + 2];			/* permuted index from g_n onto themselves */
 122.165 +static vec3_t grad3[B + B + 2];		/* 3D random gradients */
 122.166 +static vec2_t grad2[B + B + 2];		/* 2D random gradients */
 122.167 +static scalar_t grad1[B + B + 2];	/* 1D random ... slopes */
 122.168 +static int tables_valid;
 122.169 +
 122.170 +static void init_noise()
 122.171 +{
 122.172 +	int i;
 122.173 +
 122.174 +	/* calculate random gradients */
 122.175 +	for(i=0; i<B; i++) {
 122.176 +		perm[i] = i;	/* .. and initialize permutation mapping to identity */
 122.177 +
 122.178 +		grad1[i] = (scalar_t)((rand() % (B + B)) - B) / B;
 122.179 +
 122.180 +		grad2[i].x = (scalar_t)((rand() % (B + B)) - B) / B;
 122.181 +		grad2[i].y = (scalar_t)((rand() % (B + B)) - B) / B;
 122.182 +		grad2[i] = v2_normalize(grad2[i]);
 122.183 +
 122.184 +		grad3[i].x = (scalar_t)((rand() % (B + B)) - B) / B;
 122.185 +		grad3[i].y = (scalar_t)((rand() % (B + B)) - B) / B;
 122.186 +		grad3[i].z = (scalar_t)((rand() % (B + B)) - B) / B;
 122.187 +		grad3[i] = v3_normalize(grad3[i]);
 122.188 +	}
 122.189 +
 122.190 +	/* permute indices by swapping them randomly */
 122.191 +	for(i=0; i<B; i++) {
 122.192 +		int rand_idx = rand() % B;
 122.193 +
 122.194 +		int tmp = perm[i];
 122.195 +		perm[i] = perm[rand_idx];
 122.196 +		perm[rand_idx] = tmp;
 122.197 +	}
 122.198 +
 122.199 +	/* fill up the rest of the arrays by duplicating the existing gradients */
 122.200 +	/* and permutations */
 122.201 +	for(i=0; i<B+2; i++) {
 122.202 +		perm[B + i] = perm[i];
 122.203 +		grad1[B + i] = grad1[i];
 122.204 +		grad2[B + i] = grad2[i];
 122.205 +		grad3[B + i] = grad3[i];
 122.206 +	}
 122.207 +}
 122.208 +
 122.209 +scalar_t noise1(scalar_t x)
 122.210 +{
 122.211 +	int bx0, bx1;
 122.212 +	scalar_t rx0, rx1, sx, u, v;
 122.213 +
 122.214 +	if(!tables_valid) {
 122.215 +		init_noise();
 122.216 +		tables_valid = 1;
 122.217 +	}
 122.218 +
 122.219 +	setup(x, bx0, bx1, rx0, rx1);
 122.220 +	sx = s_curve(rx0);
 122.221 +	u = rx0 * grad1[perm[bx0]];
 122.222 +	v = rx1 * grad1[perm[bx1]];
 122.223 +
 122.224 +	return lerp(u, v, sx);
 122.225 +}
 122.226 +
 122.227 +scalar_t noise2(scalar_t x, scalar_t y)
 122.228 +{
 122.229 +	int i, j, b00, b10, b01, b11;
 122.230 +	int bx0, bx1, by0, by1;
 122.231 +	scalar_t rx0, rx1, ry0, ry1;
 122.232 +	scalar_t sx, sy, u, v, a, b;
 122.233 +
 122.234 +	if(!tables_valid) {
 122.235 +		init_noise();
 122.236 +		tables_valid = 1;
 122.237 +	}
 122.238 +
 122.239 +	setup(x, bx0, bx1, rx0, rx1);
 122.240 +	setup(y, by0, by1, ry0, ry1);
 122.241 +
 122.242 +	i = perm[bx0];
 122.243 +	j = perm[bx1];
 122.244 +
 122.245 +	b00 = perm[i + by0];
 122.246 +	b10 = perm[j + by0];
 122.247 +	b01 = perm[i + by1];
 122.248 +	b11 = perm[j + by1];
 122.249 +
 122.250 +	/* calculate hermite inteprolating factors */
 122.251 +	sx = s_curve(rx0);
 122.252 +	sy = s_curve(ry0);
 122.253 +
 122.254 +	/* interpolate along the left edge */
 122.255 +	u = v2_dot(grad2[b00], v2_cons(rx0, ry0));
 122.256 +	v = v2_dot(grad2[b10], v2_cons(rx1, ry0));
 122.257 +	a = lerp(u, v, sx);
 122.258 +
 122.259 +	/* interpolate along the right edge */
 122.260 +	u = v2_dot(grad2[b01], v2_cons(rx0, ry1));
 122.261 +	v = v2_dot(grad2[b11], v2_cons(rx1, ry1));
 122.262 +	b = lerp(u, v, sx);
 122.263 +
 122.264 +	/* interpolate between them */
 122.265 +	return lerp(a, b, sy);
 122.266 +}
 122.267 +
 122.268 +scalar_t noise3(scalar_t x, scalar_t y, scalar_t z)
 122.269 +{
 122.270 +	int i, j;
 122.271 +	int bx0, bx1, by0, by1, bz0, bz1;
 122.272 +	int b00, b10, b01, b11;
 122.273 +	scalar_t rx0, rx1, ry0, ry1, rz0, rz1;
 122.274 +	scalar_t sx, sy, sz;
 122.275 +	scalar_t u, v, a, b, c, d;
 122.276 +
 122.277 +	if(!tables_valid) {
 122.278 +		init_noise();
 122.279 +		tables_valid = 1;
 122.280 +	}
 122.281 +
 122.282 +	setup(x, bx0, bx1, rx0, rx1);
 122.283 +	setup(y, by0, by1, ry0, ry1);
 122.284 +	setup(z, bz0, bz1, rz0, rz1);
 122.285 +
 122.286 +	i = perm[bx0];
 122.287 +	j = perm[bx1];
 122.288 +
 122.289 +	b00 = perm[i + by0];
 122.290 +	b10 = perm[j + by0];
 122.291 +	b01 = perm[i + by1];
 122.292 +	b11 = perm[j + by1];
 122.293 +
 122.294 +	/* calculate hermite interpolating factors */
 122.295 +	sx = s_curve(rx0);
 122.296 +	sy = s_curve(ry0);
 122.297 +	sz = s_curve(rz0);
 122.298 +
 122.299 +	/* interpolate along the top slice of the cell */
 122.300 +	u = v3_dot(grad3[b00 + bz0], v3_cons(rx0, ry0, rz0));
 122.301 +	v = v3_dot(grad3[b10 + bz0], v3_cons(rx1, ry0, rz0));
 122.302 +	a = lerp(u, v, sx);
 122.303 +
 122.304 +	u = v3_dot(grad3[b01 + bz0], v3_cons(rx0, ry1, rz0));
 122.305 +	v = v3_dot(grad3[b11 + bz0], v3_cons(rx1, ry1, rz0));
 122.306 +	b = lerp(u, v, sx);
 122.307 +
 122.308 +	c = lerp(a, b, sy);
 122.309 +
 122.310 +	/* interpolate along the bottom slice of the cell */
 122.311 +	u = v3_dot(grad3[b00 + bz0], v3_cons(rx0, ry0, rz1));
 122.312 +	v = v3_dot(grad3[b10 + bz0], v3_cons(rx1, ry0, rz1));
 122.313 +	a = lerp(u, v, sx);
 122.314 +
 122.315 +	u = v3_dot(grad3[b01 + bz0], v3_cons(rx0, ry1, rz1));
 122.316 +	v = v3_dot(grad3[b11 + bz0], v3_cons(rx1, ry1, rz1));
 122.317 +	b = lerp(u, v, sx);
 122.318 +
 122.319 +	d = lerp(a, b, sy);
 122.320 +
 122.321 +	/* interpolate between slices */
 122.322 +	return lerp(c, d, sz);
 122.323 +}
 122.324 +
 122.325 +scalar_t fbm1(scalar_t x, int octaves)
 122.326 +{
 122.327 +	int i;
 122.328 +	scalar_t res = 0.0f, freq = 1.0f;
 122.329 +	for(i=0; i<octaves; i++) {
 122.330 +		res += noise1(x * freq) / freq;
 122.331 +		freq *= 2.0f;
 122.332 +	}
 122.333 +	return res;
 122.334 +}
 122.335 +
 122.336 +scalar_t fbm2(scalar_t x, scalar_t y, int octaves)
 122.337 +{
 122.338 +	int i;
 122.339 +	scalar_t res = 0.0f, freq = 1.0f;
 122.340 +	for(i=0; i<octaves; i++) {
 122.341 +		res += noise2(x * freq, y * freq) / freq;
 122.342 +		freq *= 2.0f;
 122.343 +	}
 122.344 +	return res;
 122.345 +}
 122.346 +
 122.347 +scalar_t fbm3(scalar_t x, scalar_t y, scalar_t z, int octaves)
 122.348 +{
 122.349 +	int i;
 122.350 +	scalar_t res = 0.0f, freq = 1.0f;
 122.351 +	for(i=0; i<octaves; i++) {
 122.352 +		res += noise3(x * freq, y * freq, z * freq) / freq;
 122.353 +		freq *= 2.0f;
 122.354 +	}
 122.355 +	return res;
 122.356 +}
 122.357 +
 122.358 +scalar_t turbulence1(scalar_t x, int octaves)
 122.359 +{
 122.360 +	int i;
 122.361 +	scalar_t res = 0.0f, freq = 1.0f;
 122.362 +	for(i=0; i<octaves; i++) {
 122.363 +		res += fabs(noise1(x * freq) / freq);
 122.364 +		freq *= 2.0f;
 122.365 +	}
 122.366 +	return res;
 122.367 +}
 122.368 +
 122.369 +scalar_t turbulence2(scalar_t x, scalar_t y, int octaves)
 122.370 +{
 122.371 +	int i;
 122.372 +	scalar_t res = 0.0f, freq = 1.0f;
 122.373 +	for(i=0; i<octaves; i++) {
 122.374 +		res += fabs(noise2(x * freq, y * freq) / freq);
 122.375 +		freq *= 2.0f;
 122.376 +	}
 122.377 +	return res;
 122.378 +}
 122.379 +
 122.380 +scalar_t turbulence3(scalar_t x, scalar_t y, scalar_t z, int octaves)
 122.381 +{
 122.382 +	int i;
 122.383 +	scalar_t res = 0.0f, freq = 1.0f;
 122.384 +	for(i=0; i<octaves; i++) {
 122.385 +		res += fabs(noise3(x * freq, y * freq, z * freq) / freq);
 122.386 +		freq *= 2.0f;
 122.387 +	}
 122.388 +	return res;
 122.389 +}
   123.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   123.2 +++ b/libs/vmath/vmath.h	Sun Nov 01 00:36:56 2015 +0200
   123.3 @@ -0,0 +1,101 @@
   123.4 +/*
   123.5 +libvmath - a vector math library
   123.6 +Copyright (C) 2004-2013 John Tsiombikas <nuclear@member.fsf.org>
   123.7 +
   123.8 +This program is free software: you can redistribute it and/or modify
   123.9 +it under the terms of the GNU Lesser General Public License as published
  123.10 +by the Free Software Foundation, either version 3 of the License, or
  123.11 +(at your option) any later version.
  123.12 +
  123.13 +This program is distributed in the hope that it will be useful,
  123.14 +but WITHOUT ANY WARRANTY; without even the implied warranty of
  123.15 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  123.16 +GNU Lesser General Public License for more details.
  123.17 +
  123.18 +You should have received a copy of the GNU Lesser General Public License
  123.19 +along with this program.  If not, see <http://www.gnu.org/licenses/>.
  123.20 +*/
  123.21 +
  123.22 +#ifndef VMATH_H_
  123.23 +#define VMATH_H_
  123.24 +
  123.25 +#include <math.h>
  123.26 +#include "vmath_types.h"
  123.27 +
  123.28 +#ifndef M_PI
  123.29 +#define M_PI	PI
  123.30 +#endif
  123.31 +
  123.32 +#ifndef M_E
  123.33 +#define M_E				2.718281828459045
  123.34 +#endif
  123.35 +
  123.36 +#define PI				3.141592653589793
  123.37 +#define HALF_PI			1.570796326794897
  123.38 +#define QUARTER_PI		0.785398163397448
  123.39 +#define TWO_PI			6.283185307179586
  123.40 +
  123.41 +
  123.42 +#define RAD_TO_DEG(a) ((((scalar_t)a) * 360.0) / TWO_PI)
  123.43 +#define DEG_TO_RAD(a) (((scalar_t)a) * (PI / 180.0))
  123.44 +
  123.45 +#define SQ(x) ((x) * (x))
  123.46 +
  123.47 +#ifndef MIN
  123.48 +#define MIN(a, b)	((a) < (b) ? (a) : (b))
  123.49 +#endif
  123.50 +#ifndef MAX
  123.51 +#define MAX(a, b)	((a) > (b) ? (a) : (b))
  123.52 +#endif
  123.53 +
  123.54 +#ifndef __GNUC__
  123.55 +#define round(x)	((x) >= 0 ? (x) + 0.5 : (x) - 0.5)
  123.56 +#endif
  123.57 +
  123.58 +#ifdef __cplusplus
  123.59 +extern "C" {
  123.60 +#endif	/* __cplusplus */
  123.61 +
  123.62 +void enable_fpexcept(void);
  123.63 +void disable_fpexcept(void);
  123.64 +
  123.65 +static inline scalar_t smoothstep(float a, float b, float x);
  123.66 +
  123.67 +static inline scalar_t frand(scalar_t range);
  123.68 +static inline vec3_t sphrand(scalar_t rad);
  123.69 +
  123.70 +scalar_t integral(scalar_t (*f)(scalar_t), scalar_t low, scalar_t high, int samples);
  123.71 +scalar_t gaussian(scalar_t x, scalar_t mean, scalar_t sdev);
  123.72 +
  123.73 +static inline scalar_t lerp(scalar_t a, scalar_t b, scalar_t t);
  123.74 +
  123.75 +scalar_t bspline(scalar_t a, scalar_t b, scalar_t c, scalar_t d, scalar_t t);
  123.76 +scalar_t spline(scalar_t a, scalar_t b, scalar_t c, scalar_t d, scalar_t t);
  123.77 +scalar_t bezier(scalar_t a, scalar_t b, scalar_t c, scalar_t d, scalar_t t);
  123.78 +
  123.79 +scalar_t noise1(scalar_t x);
  123.80 +scalar_t noise2(scalar_t x, scalar_t y);
  123.81 +scalar_t noise3(scalar_t x, scalar_t y, scalar_t z);
  123.82 +
  123.83 +scalar_t fbm1(scalar_t x, int octaves);
  123.84 +scalar_t fbm2(scalar_t x, scalar_t y, int octaves);
  123.85 +scalar_t fbm3(scalar_t x, scalar_t y, scalar_t z, int octaves);
  123.86 +
  123.87 +scalar_t turbulence1(scalar_t x, int octaves);
  123.88 +scalar_t turbulence2(scalar_t x, scalar_t y, int octaves);
  123.89 +scalar_t turbulence3(scalar_t x, scalar_t y, scalar_t z, int octaves);
  123.90 +
  123.91 +#ifdef __cplusplus
  123.92 +}
  123.93 +#endif	/* __cplusplus */
  123.94 +
  123.95 +#include "vmath.inl"
  123.96 +
  123.97 +#include "vector.h"
  123.98 +#include "matrix.h"
  123.99 +#include "quat.h"
 123.100 +#include "sphvec.h"
 123.101 +#include "ray.h"
 123.102 +#include "geom.h"
 123.103 +
 123.104 +#endif	/* VMATH_H_ */
   124.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   124.2 +++ b/libs/vmath/vmath.inl	Sun Nov 01 00:36:56 2015 +0200
   124.3 @@ -0,0 +1,56 @@
   124.4 +/*
   124.5 +libvmath - a vector math library
   124.6 +Copyright (C) 2004-2011 John Tsiombikas <nuclear@member.fsf.org>
   124.7 +
   124.8 +This program is free software: you can redistribute it and/or modify
   124.9 +it under the terms of the GNU Lesser General Public License as published
  124.10 +by the Free Software Foundation, either version 3 of the License, or
  124.11 +(at your option) any later version.
  124.12 +
  124.13 +This program is distributed in the hope that it will be useful,
  124.14 +but WITHOUT ANY WARRANTY; without even the implied warranty of
  124.15 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  124.16 +GNU Lesser General Public License for more details.
  124.17 +
  124.18 +You should have received a copy of the GNU Lesser General Public License
  124.19 +along with this program.  If not, see <http://www.gnu.org/licenses/>.
  124.20 +*/
  124.21 +
  124.22 +#include <stdlib.h>
  124.23 +
  124.24 +static inline scalar_t smoothstep(float a, float b, float x)
  124.25 +{
  124.26 +	if(x < a) return 0.0;
  124.27 +	if(x >= b) return 1.0;
  124.28 +
  124.29 +	x = (x - a) / (b - a);
  124.30 +	return x * x * (3.0 - 2.0 * x);
  124.31 +}
  124.32 +
  124.33 +/** Generates a random number in [0, range) */
  124.34 +static inline scalar_t frand(scalar_t range)
  124.35 +{
  124.36 +	return range * (scalar_t)rand() / (scalar_t)RAND_MAX;
  124.37 +}
  124.38 +
  124.39 +/** Generates a random vector on the surface of a sphere */
  124.40 +static inline vec3_t sphrand(scalar_t rad)
  124.41 +{
  124.42 +	scalar_t u = (scalar_t)rand() / RAND_MAX;
  124.43 +	scalar_t v = (scalar_t)rand() / RAND_MAX;
  124.44 +
  124.45 +	scalar_t theta = 2.0 * M_PI * u;
  124.46 +	scalar_t phi = acos(2.0 * v - 1.0);
  124.47 +
  124.48 +	vec3_t res;
  124.49 +	res.x = rad * cos(theta) * sin(phi);
  124.50 +	res.y = rad * sin(theta) * sin(phi);
  124.51 +	res.z = rad * cos(phi);
  124.52 +	return res;
  124.53 +}
  124.54 +
  124.55 +/** linear interpolation */
  124.56 +static inline scalar_t lerp(scalar_t a, scalar_t b, scalar_t t)
  124.57 +{
  124.58 +	return a + (b - a) * t;
  124.59 +}
   125.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   125.2 +++ b/libs/vmath/vmath_config.h	Sun Nov 01 00:36:56 2015 +0200
   125.3 @@ -0,0 +1,19 @@
   125.4 +#ifndef VMATH_CONFIG_H_
   125.5 +#define VMATH_CONFIG_H_
   125.6 +
   125.7 +#if (__STDC_VERSION__ < 199999) && !defined(__cplusplus)
   125.8 +#if defined(__GNUC__) || defined(_MSC_VER)
   125.9 +#define inline __inline
  125.10 +#else
  125.11 +#define inline
  125.12 +
  125.13 +#ifdef VECTOR_H_
  125.14 +#warning "compiling vector operations without inline, performance might suffer"
  125.15 +#endif	/* VECTOR_H_ */
  125.16 +
  125.17 +#endif	/* gcc/msvc */
  125.18 +#endif	/* not C99 */
  125.19 +
  125.20 +#define SINGLE_PRECISION_MATH
  125.21 +
  125.22 +#endif	/* VMATH_CONFIG_H_ */
   126.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   126.2 +++ b/libs/vmath/vmath_types.h	Sun Nov 01 00:36:56 2015 +0200
   126.3 @@ -0,0 +1,58 @@
   126.4 +/*
   126.5 +libvmath - a vector math library
   126.6 +Copyright (C) 2004-2011 John Tsiombikas <nuclear@member.fsf.org>
   126.7 +
   126.8 +This program is free software: you can redistribute it and/or modify
   126.9 +it under the terms of the GNU Lesser General Public License as published
  126.10 +by the Free Software Foundation, either version 3 of the License, or
  126.11 +(at your option) any later version.
  126.12 +
  126.13 +This program is distributed in the hope that it will be useful,
  126.14 +but WITHOUT ANY WARRANTY; without even the implied warranty of
  126.15 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  126.16 +GNU Lesser General Public License for more details.
  126.17 +
  126.18 +You should have received a copy of the GNU Lesser General Public License
  126.19 +along with this program.  If not, see <http://www.gnu.org/licenses/>.
  126.20 +*/
  126.21 +
  126.22 +#ifndef VMATH_TYPES_H_
  126.23 +#define VMATH_TYPES_H_
  126.24 +
  126.25 +#include "vmath_config.h"
  126.26 +
  126.27 +#define SMALL_NUMBER	1.e-4
  126.28 +#define XSMALL_NUMBER	1.e-8
  126.29 +#define ERROR_MARGIN	1.e-6
  126.30 +
  126.31 +
  126.32 +#ifdef SINGLE_PRECISION_MATH
  126.33 +typedef float scalar_t;
  126.34 +#else
  126.35 +typedef double scalar_t;
  126.36 +#endif	/* floating point precision */
  126.37 +
  126.38 +/* vectors */
  126.39 +typedef struct { scalar_t x, y; } vec2_t;
  126.40 +typedef struct { scalar_t x, y, z; } vec3_t;
  126.41 +typedef struct { scalar_t x, y, z, w; } vec4_t;
  126.42 +
  126.43 +/* quaternions */
  126.44 +typedef vec4_t quat_t;
  126.45 +
  126.46 +/* matrices */
  126.47 +typedef scalar_t mat3_t[3][3];
  126.48 +typedef scalar_t mat4_t[4][4];
  126.49 +
  126.50 +
  126.51 +#ifdef __cplusplus
  126.52 +class Vector2;
  126.53 +class Vector3;
  126.54 +class Vector4;
  126.55 +class Quaternion;
  126.56 +class Matrix3x3;
  126.57 +class Matrix4x4;
  126.58 +class SphVector;
  126.59 +#endif	/* __cplusplus */
  126.60 +
  126.61 +#endif	/* VMATH_TYPES_H_ */
   127.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   127.2 +++ b/libs/vorbis/AUTHORS	Sun Nov 01 00:36:56 2015 +0200
   127.3 @@ -0,0 +1,3 @@
   127.4 +Monty <monty@xiph.org>
   127.5 +
   127.6 +and the rest of the Xiph.org Foundation.
   128.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   128.2 +++ b/libs/vorbis/COPYING	Sun Nov 01 00:36:56 2015 +0200
   128.3 @@ -0,0 +1,28 @@
   128.4 +Copyright (c) 2002-2008 Xiph.org Foundation
   128.5 +
   128.6 +Redistribution and use in source and binary forms, with or without
   128.7 +modification, are permitted provided that the following conditions
   128.8 +are met:
   128.9 +
  128.10 +- Redistributions of source code must retain the above copyright
  128.11 +notice, this list of conditions and the following disclaimer.
  128.12 +
  128.13 +- Redistributions in binary form must reproduce the above copyright
  128.14 +notice, this list of conditions and the following disclaimer in the
  128.15 +documentation and/or other materials provided with the distribution.
  128.16 +
  128.17 +- Neither the name of the Xiph.org Foundation nor the names of its
  128.18 +contributors may be used to endorse or promote products derived from
  128.19 +this software without specific prior written permission.
  128.20 +
  128.21 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  128.22 +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  128.23 +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  128.24 +A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION
  128.25 +OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  128.26 +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  128.27 +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  128.28 +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  128.29 +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  128.30 +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  128.31 +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   129.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   129.2 +++ b/libs/vorbis/analysis.c	Sun Nov 01 00:36:56 2015 +0200
   129.3 @@ -0,0 +1,120 @@
   129.4 +/********************************************************************
   129.5 + *                                                                  *
   129.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   129.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   129.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   129.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  129.10 + *                                                                  *
  129.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007             *
  129.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  129.13 + *                                                                  *
  129.14 + ********************************************************************
  129.15 +
  129.16 + function: single-block PCM analysis mode dispatch
  129.17 + last mod: $Id: analysis.c 16226 2009-07-08 06:43:49Z xiphmont $
  129.18 +
  129.19 + ********************************************************************/
  129.20 +
  129.21 +#include <stdio.h>
  129.22 +#include <string.h>
  129.23 +#include <math.h>
  129.24 +#include <ogg/ogg.h>
  129.25 +#include "vorbis/codec.h"
  129.26 +#include "codec_internal.h"
  129.27 +#include "registry.h"
  129.28 +#include "scales.h"
  129.29 +#include "os.h"
  129.30 +#include "misc.h"
  129.31 +
  129.32 +/* decides between modes, dispatches to the appropriate mapping. */
  129.33 +int vorbis_analysis(vorbis_block *vb, ogg_packet *op){
  129.34 +  int ret,i;
  129.35 +  vorbis_block_internal *vbi=vb->internal;
  129.36 +
  129.37 +  vb->glue_bits=0;
  129.38 +  vb->time_bits=0;
  129.39 +  vb->floor_bits=0;
  129.40 +  vb->res_bits=0;
  129.41 +
  129.42 +  /* first things first.  Make sure encode is ready */
  129.43 +  for(i=0;i<PACKETBLOBS;i++)
  129.44 +    oggpack_reset(vbi->packetblob[i]);
  129.45 +
  129.46 +  /* we only have one mapping type (0), and we let the mapping code
  129.47 +     itself figure out what soft mode to use.  This allows easier
  129.48 +     bitrate management */
  129.49 +
  129.50 +  if((ret=_mapping_P[0]->forward(vb)))
  129.51 +    return(ret);
  129.52 +
  129.53 +  if(op){
  129.54 +    if(vorbis_bitrate_managed(vb))
  129.55 +      /* The app is using a bitmanaged mode... but not using the
  129.56 +         bitrate management interface. */
  129.57 +      return(OV_EINVAL);
  129.58 +
  129.59 +    op->packet=oggpack_get_buffer(&vb->opb);
  129.60 +    op->bytes=oggpack_bytes(&vb->opb);
  129.61 +    op->b_o_s=0;
  129.62 +    op->e_o_s=vb->eofflag;
  129.63 +    op->granulepos=vb->granulepos;
  129.64 +    op->packetno=vb->sequence; /* for sake of completeness */
  129.65 +  }
  129.66 +  return(0);
  129.67 +}
  129.68 +
  129.69 +#ifdef ANALYSIS
  129.70 +int analysis_noisy=1;
  129.71 +
  129.72 +/* there was no great place to put this.... */
  129.73 +void _analysis_output_always(char *base,int i,float *v,int n,int bark,int dB,ogg_int64_t off){
  129.74 +  int j;
  129.75 +  FILE *of;
  129.76 +  char buffer[80];
  129.77 +
  129.78 +  sprintf(buffer,"%s_%d.m",base,i);
  129.79 +  of=fopen(buffer,"w");
  129.80 +
  129.81 +  if(!of)perror("failed to open data dump file");
  129.82 +
  129.83 +  for(j=0;j<n;j++){
  129.84 +    if(bark){
  129.85 +      float b=toBARK((4000.f*j/n)+.25);
  129.86 +      fprintf(of,"%f ",b);
  129.87 +    }else
  129.88 +      if(off!=0)
  129.89 +        fprintf(of,"%f ",(double)(j+off)/8000.);
  129.90 +      else
  129.91 +        fprintf(of,"%f ",(double)j);
  129.92 +
  129.93 +    if(dB){
  129.94 +      float val;
  129.95 +      if(v[j]==0.)
  129.96 +        val=-140.;
  129.97 +      else
  129.98 +        val=todB(v+j);
  129.99 +      fprintf(of,"%f\n",val);
 129.100 +    }else{
 129.101 +      fprintf(of,"%f\n",v[j]);
 129.102 +    }
 129.103 +  }
 129.104 +  fclose(of);
 129.105 +}
 129.106 +
 129.107 +void _analysis_output(char *base,int i,float *v,int n,int bark,int dB,
 129.108 +                      ogg_int64_t off){
 129.109 +  if(analysis_noisy)_analysis_output_always(base,i,v,n,bark,dB,off);
 129.110 +}
 129.111 +
 129.112 +#endif
 129.113 +
 129.114 +
 129.115 +
 129.116 +
 129.117 +
 129.118 +
 129.119 +
 129.120 +
 129.121 +
 129.122 +
 129.123 +
   130.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   130.2 +++ b/libs/vorbis/backends.h	Sun Nov 01 00:36:56 2015 +0200
   130.3 @@ -0,0 +1,144 @@
   130.4 +/********************************************************************
   130.5 + *                                                                  *
   130.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   130.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   130.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   130.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  130.10 + *                                                                  *
  130.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
  130.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  130.13 + *                                                                  *
  130.14 + ********************************************************************
  130.15 +
  130.16 + function: libvorbis backend and mapping structures; needed for
  130.17 +           static mode headers
  130.18 + last mod: $Id: backends.h 16962 2010-03-11 07:30:34Z xiphmont $
  130.19 +
  130.20 + ********************************************************************/
  130.21 +
  130.22 +/* this is exposed up here because we need it for static modes.
  130.23 +   Lookups for each backend aren't exposed because there's no reason
  130.24 +   to do so */
  130.25 +
  130.26 +#ifndef _vorbis_backend_h_
  130.27 +#define _vorbis_backend_h_
  130.28 +
  130.29 +#include "codec_internal.h"
  130.30 +
  130.31 +/* this would all be simpler/shorter with templates, but.... */
  130.32 +/* Floor backend generic *****************************************/
  130.33 +typedef struct{
  130.34 +  void                   (*pack)  (vorbis_info_floor *,oggpack_buffer *);
  130.35 +  vorbis_info_floor     *(*unpack)(vorbis_info *,oggpack_buffer *);
  130.36 +  vorbis_look_floor     *(*look)  (vorbis_dsp_state *,vorbis_info_floor *);
  130.37 +  void (*free_info) (vorbis_info_floor *);
  130.38 +  void (*free_look) (vorbis_look_floor *);
  130.39 +  void *(*inverse1)  (struct vorbis_block *,vorbis_look_floor *);
  130.40 +  int   (*inverse2)  (struct vorbis_block *,vorbis_look_floor *,
  130.41 +                     void *buffer,float *);
  130.42 +} vorbis_func_floor;
  130.43 +
  130.44 +typedef struct{
  130.45 +  int   order;
  130.46 +  long  rate;
  130.47 +  long  barkmap;
  130.48 +
  130.49 +  int   ampbits;
  130.50 +  int   ampdB;
  130.51 +
  130.52 +  int   numbooks; /* <= 16 */
  130.53 +  int   books[16];
  130.54 +
  130.55 +  float lessthan;     /* encode-only config setting hacks for libvorbis */
  130.56 +  float greaterthan;  /* encode-only config setting hacks for libvorbis */
  130.57 +
  130.58 +} vorbis_info_floor0;
  130.59 +
  130.60 +
  130.61 +#define VIF_POSIT 63
  130.62 +#define VIF_CLASS 16
  130.63 +#define VIF_PARTS 31
  130.64 +typedef struct{
  130.65 +  int   partitions;                /* 0 to 31 */
  130.66 +  int   partitionclass[VIF_PARTS]; /* 0 to 15 */
  130.67 +
  130.68 +  int   class_dim[VIF_CLASS];        /* 1 to 8 */
  130.69 +  int   class_subs[VIF_CLASS];       /* 0,1,2,3 (bits: 1<<n poss) */
  130.70 +  int   class_book[VIF_CLASS];       /* subs ^ dim entries */
  130.71 +  int   class_subbook[VIF_CLASS][8]; /* [VIF_CLASS][subs] */
  130.72 +
  130.73 +
  130.74 +  int   mult;                      /* 1 2 3 or 4 */
  130.75 +  int   postlist[VIF_POSIT+2];    /* first two implicit */
  130.76 +
  130.77 +
  130.78 +  /* encode side analysis parameters */
  130.79 +  float maxover;
  130.80 +  float maxunder;
  130.81 +  float maxerr;
  130.82 +
  130.83 +  float twofitweight;
  130.84 +  float twofitatten;
  130.85 +
  130.86 +  int   n;
  130.87 +
  130.88 +} vorbis_info_floor1;
  130.89 +
  130.90 +/* Residue backend generic *****************************************/
  130.91 +typedef struct{
  130.92 +  void                 (*pack)  (vorbis_info_residue *,oggpack_buffer *);
  130.93 +  vorbis_info_residue *(*unpack)(vorbis_info *,oggpack_buffer *);
  130.94 +  vorbis_look_residue *(*look)  (vorbis_dsp_state *,
  130.95 +                                 vorbis_info_residue *);
  130.96 +  void (*free_info)    (vorbis_info_residue *);
  130.97 +  void (*free_look)    (vorbis_look_residue *);
  130.98 +  long **(*class)      (struct vorbis_block *,vorbis_look_residue *,
  130.99 +                        int **,int *,int);
 130.100 +  int  (*forward)      (oggpack_buffer *,struct vorbis_block *,
 130.101 +                        vorbis_look_residue *,
 130.102 +                        int **,int *,int,long **,int);
 130.103 +  int  (*inverse)      (struct vorbis_block *,vorbis_look_residue *,
 130.104 +                        float **,int *,int);
 130.105 +} vorbis_func_residue;
 130.106 +
 130.107 +typedef struct vorbis_info_residue0{
 130.108 +/* block-partitioned VQ coded straight residue */
 130.109 +  long  begin;
 130.110 +  long  end;
 130.111 +
 130.112 +  /* first stage (lossless partitioning) */
 130.113 +  int    grouping;         /* group n vectors per partition */
 130.114 +  int    partitions;       /* possible codebooks for a partition */
 130.115 +  int    partvals;         /* partitions ^ groupbook dim */
 130.116 +  int    groupbook;        /* huffbook for partitioning */
 130.117 +  int    secondstages[64]; /* expanded out to pointers in lookup */
 130.118 +  int    booklist[512];    /* list of second stage books */
 130.119 +
 130.120 +  const int classmetric1[64];
 130.121 +  const int classmetric2[64];
 130.122 +} vorbis_info_residue0;
 130.123 +
 130.124 +/* Mapping backend generic *****************************************/
 130.125 +typedef struct{
 130.126 +  void                 (*pack)  (vorbis_info *,vorbis_info_mapping *,
 130.127 +                                 oggpack_buffer *);
 130.128 +  vorbis_info_mapping *(*unpack)(vorbis_info *,oggpack_buffer *);
 130.129 +  void (*free_info)    (vorbis_info_mapping *);
 130.130 +  int  (*forward)      (struct vorbis_block *vb);
 130.131 +  int  (*inverse)      (struct vorbis_block *vb,vorbis_info_mapping *);
 130.132 +} vorbis_func_mapping;
 130.133 +
 130.134 +typedef struct vorbis_info_mapping0{
 130.135 +  int   submaps;  /* <= 16 */
 130.136 +  int   chmuxlist[256];   /* up to 256 channels in a Vorbis stream */
 130.137 +
 130.138 +  int   floorsubmap[16];   /* [mux] submap to floors */
 130.139 +  int   residuesubmap[16]; /* [mux] submap to residue */
 130.140 +
 130.141 +  int   coupling_steps;
 130.142 +  int   coupling_mag[256];
 130.143 +  int   coupling_ang[256];
 130.144 +
 130.145 +} vorbis_info_mapping0;
 130.146 +
 130.147 +#endif
   131.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   131.2 +++ b/libs/vorbis/bitrate.c	Sun Nov 01 00:36:56 2015 +0200
   131.3 @@ -0,0 +1,253 @@
   131.4 +/********************************************************************
   131.5 + *                                                                  *
   131.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   131.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   131.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   131.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  131.10 + *                                                                  *
  131.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
  131.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  131.13 + *                                                                  *
  131.14 + ********************************************************************
  131.15 +
  131.16 + function: bitrate tracking and management
  131.17 + last mod: $Id: bitrate.c 16227 2009-07-08 06:58:46Z xiphmont $
  131.18 +
  131.19 + ********************************************************************/
  131.20 +
  131.21 +#include <stdlib.h>
  131.22 +#include <string.h>
  131.23 +#include <math.h>
  131.24 +#include <ogg/ogg.h>
  131.25 +#include "vorbis/codec.h"
  131.26 +#include "codec_internal.h"
  131.27 +#include "os.h"
  131.28 +#include "misc.h"
  131.29 +#include "bitrate.h"
  131.30 +
  131.31 +/* compute bitrate tracking setup  */
  131.32 +void vorbis_bitrate_init(vorbis_info *vi,bitrate_manager_state *bm){
  131.33 +  codec_setup_info *ci=vi->codec_setup;
  131.34 +  bitrate_manager_info *bi=&ci->bi;
  131.35 +
  131.36 +  memset(bm,0,sizeof(*bm));
  131.37 +
  131.38 +  if(bi && (bi->reservoir_bits>0)){
  131.39 +    long ratesamples=vi->rate;
  131.40 +    int  halfsamples=ci->blocksizes[0]>>1;
  131.41 +
  131.42 +    bm->short_per_long=ci->blocksizes[1]/ci->blocksizes[0];
  131.43 +    bm->managed=1;
  131.44 +
  131.45 +    bm->avg_bitsper= rint(1.*bi->avg_rate*halfsamples/ratesamples);
  131.46 +    bm->min_bitsper= rint(1.*bi->min_rate*halfsamples/ratesamples);
  131.47 +    bm->max_bitsper= rint(1.*bi->max_rate*halfsamples/ratesamples);
  131.48 +
  131.49 +    bm->avgfloat=PACKETBLOBS/2;
  131.50 +
  131.51 +    /* not a necessary fix, but one that leads to a more balanced
  131.52 +       typical initialization */
  131.53 +    {
  131.54 +      long desired_fill=bi->reservoir_bits*bi->reservoir_bias;
  131.55 +      bm->minmax_reservoir=desired_fill;
  131.56 +      bm->avg_reservoir=desired_fill;
  131.57 +    }
  131.58 +
  131.59 +  }
  131.60 +}
  131.61 +
  131.62 +void vorbis_bitrate_clear(bitrate_manager_state *bm){
  131.63 +  memset(bm,0,sizeof(*bm));
  131.64 +  return;
  131.65 +}
  131.66 +
  131.67 +int vorbis_bitrate_managed(vorbis_block *vb){
  131.68 +  vorbis_dsp_state      *vd=vb->vd;
  131.69 +  private_state         *b=vd->backend_state;
  131.70 +  bitrate_manager_state *bm=&b->bms;
  131.71 +
  131.72 +  if(bm && bm->managed)return(1);
  131.73 +  return(0);
  131.74 +}
  131.75 +
  131.76 +/* finish taking in the block we just processed */
  131.77 +int vorbis_bitrate_addblock(vorbis_block *vb){
  131.78 +  vorbis_block_internal *vbi=vb->internal;
  131.79 +  vorbis_dsp_state      *vd=vb->vd;
  131.80 +  private_state         *b=vd->backend_state;
  131.81 +  bitrate_manager_state *bm=&b->bms;
  131.82 +  vorbis_info           *vi=vd->vi;
  131.83 +  codec_setup_info      *ci=vi->codec_setup;
  131.84 +  bitrate_manager_info  *bi=&ci->bi;
  131.85 +
  131.86 +  int  choice=rint(bm->avgfloat);
  131.87 +  long this_bits=oggpack_bytes(vbi->packetblob[choice])*8;
  131.88 +  long min_target_bits=(vb->W?bm->min_bitsper*bm->short_per_long:bm->min_bitsper);
  131.89 +  long max_target_bits=(vb->W?bm->max_bitsper*bm->short_per_long:bm->max_bitsper);
  131.90 +  int  samples=ci->blocksizes[vb->W]>>1;
  131.91 +  long desired_fill=bi->reservoir_bits*bi->reservoir_bias;
  131.92 +  if(!bm->managed){
  131.93 +    /* not a bitrate managed stream, but for API simplicity, we'll
  131.94 +       buffer the packet to keep the code path clean */
  131.95 +
  131.96 +    if(bm->vb)return(-1); /* one has been submitted without
  131.97 +                             being claimed */
  131.98 +    bm->vb=vb;
  131.99 +    return(0);
 131.100 +  }
 131.101 +
 131.102 +  bm->vb=vb;
 131.103 +
 131.104 +  /* look ahead for avg floater */
 131.105 +  if(bm->avg_bitsper>0){
 131.106 +    double slew=0.;
 131.107 +    long avg_target_bits=(vb->W?bm->avg_bitsper*bm->short_per_long:bm->avg_bitsper);
 131.108 +    double slewlimit= 15./bi->slew_damp;
 131.109 +
 131.110 +    /* choosing a new floater:
 131.111 +       if we're over target, we slew down
 131.112 +       if we're under target, we slew up
 131.113 +
 131.114 +       choose slew as follows: look through packetblobs of this frame
 131.115 +       and set slew as the first in the appropriate direction that
 131.116 +       gives us the slew we want.  This may mean no slew if delta is
 131.117 +       already favorable.
 131.118 +
 131.119 +       Then limit slew to slew max */
 131.120 +
 131.121 +    if(bm->avg_reservoir+(this_bits-avg_target_bits)>desired_fill){
 131.122 +      while(choice>0 && this_bits>avg_target_bits &&
 131.123 +            bm->avg_reservoir+(this_bits-avg_target_bits)>desired_fill){
 131.124 +        choice--;
 131.125 +        this_bits=oggpack_bytes(vbi->packetblob[choice])*8;
 131.126 +      }
 131.127 +    }else if(bm->avg_reservoir+(this_bits-avg_target_bits)<desired_fill){
 131.128 +      while(choice+1<PACKETBLOBS && this_bits<avg_target_bits &&
 131.129 +            bm->avg_reservoir+(this_bits-avg_target_bits)<desired_fill){
 131.130 +        choice++;
 131.131 +        this_bits=oggpack_bytes(vbi->packetblob[choice])*8;
 131.132 +      }
 131.133 +    }
 131.134 +
 131.135 +    slew=rint(choice-bm->avgfloat)/samples*vi->rate;
 131.136 +    if(slew<-slewlimit)slew=-slewlimit;
 131.137 +    if(slew>slewlimit)slew=slewlimit;
 131.138 +    choice=rint(bm->avgfloat+= slew/vi->rate*samples);
 131.139 +    this_bits=oggpack_bytes(vbi->packetblob[choice])*8;
 131.140 +  }
 131.141 +
 131.142 +
 131.143 +
 131.144 +  /* enforce min(if used) on the current floater (if used) */
 131.145 +  if(bm->min_bitsper>0){
 131.146 +    /* do we need to force the bitrate up? */
 131.147 +    if(this_bits<min_target_bits){
 131.148 +      while(bm->minmax_reservoir-(min_target_bits-this_bits)<0){
 131.149 +        choice++;
 131.150 +        if(choice>=PACKETBLOBS)break;
 131.151 +        this_bits=oggpack_bytes(vbi->packetblob[choice])*8;
 131.152 +      }
 131.153 +    }
 131.154 +  }
 131.155 +
 131.156 +  /* enforce max (if used) on the current floater (if used) */
 131.157 +  if(bm->max_bitsper>0){
 131.158 +    /* do we need to force the bitrate down? */
 131.159 +    if(this_bits>max_target_bits){
 131.160 +      while(bm->minmax_reservoir+(this_bits-max_target_bits)>bi->reservoir_bits){
 131.161 +        choice--;
 131.162 +        if(choice<0)break;
 131.163 +        this_bits=oggpack_bytes(vbi->packetblob[choice])*8;
 131.164 +      }
 131.165 +    }
 131.166 +  }
 131.167 +
 131.168 +  /* Choice of packetblobs now made based on floater, and min/max
 131.169 +     requirements. Now boundary check extreme choices */
 131.170 +
 131.171 +  if(choice<0){
 131.172 +    /* choosing a smaller packetblob is insufficient to trim bitrate.
 131.173 +       frame will need to be truncated */
 131.174 +    long maxsize=(max_target_bits+(bi->reservoir_bits-bm->minmax_reservoir))/8;
 131.175 +    bm->choice=choice=0;
 131.176 +
 131.177 +    if(oggpack_bytes(vbi->packetblob[choice])>maxsize){
 131.178 +
 131.179 +      oggpack_writetrunc(vbi->packetblob[choice],maxsize*8);
 131.180 +      this_bits=oggpack_bytes(vbi->packetblob[choice])*8;
 131.181 +    }
 131.182 +  }else{
 131.183 +    long minsize=(min_target_bits-bm->minmax_reservoir+7)/8;
 131.184 +    if(choice>=PACKETBLOBS)
 131.185 +      choice=PACKETBLOBS-1;
 131.186 +
 131.187 +    bm->choice=choice;
 131.188 +
 131.189 +    /* prop up bitrate according to demand. pad this frame out with zeroes */
 131.190 +    minsize-=oggpack_bytes(vbi->packetblob[choice]);
 131.191 +    while(minsize-->0)oggpack_write(vbi->packetblob[choice],0,8);
 131.192 +    this_bits=oggpack_bytes(vbi->packetblob[choice])*8;
 131.193 +
 131.194 +  }
 131.195 +
 131.196 +  /* now we have the final packet and the final packet size.  Update statistics */
 131.197 +  /* min and max reservoir */
 131.198 +  if(bm->min_bitsper>0 || bm->max_bitsper>0){
 131.199 +
 131.200 +    if(max_target_bits>0 && this_bits>max_target_bits){
 131.201 +      bm->minmax_reservoir+=(this_bits-max_target_bits);
 131.202 +    }else if(min_target_bits>0 && this_bits<min_target_bits){
 131.203 +      bm->minmax_reservoir+=(this_bits-min_target_bits);
 131.204 +    }else{
 131.205 +      /* inbetween; we want to take reservoir toward but not past desired_fill */
 131.206 +      if(bm->minmax_reservoir>desired_fill){
 131.207 +        if(max_target_bits>0){ /* logical bulletproofing against initialization state */
 131.208 +          bm->minmax_reservoir+=(this_bits-max_target_bits);
 131.209 +          if(bm->minmax_reservoir<desired_fill)bm->minmax_reservoir=desired_fill;
 131.210 +        }else{
 131.211 +          bm->minmax_reservoir=desired_fill;
 131.212 +        }
 131.213 +      }else{
 131.214 +        if(min_target_bits>0){ /* logical bulletproofing against initialization state */
 131.215 +          bm->minmax_reservoir+=(this_bits-min_target_bits);
 131.216 +          if(bm->minmax_reservoir>desired_fill)bm->minmax_reservoir=desired_fill;
 131.217 +        }else{
 131.218 +          bm->minmax_reservoir=desired_fill;
 131.219 +        }
 131.220 +      }
 131.221 +    }
 131.222 +  }
 131.223 +
 131.224 +  /* avg reservoir */
 131.225 +  if(bm->avg_bitsper>0){
 131.226 +    long avg_target_bits=(vb->W?bm->avg_bitsper*bm->short_per_long:bm->avg_bitsper);
 131.227 +    bm->avg_reservoir+=this_bits-avg_target_bits;
 131.228 +  }
 131.229 +
 131.230 +  return(0);
 131.231 +}
 131.232 +
 131.233 +int vorbis_bitrate_flushpacket(vorbis_dsp_state *vd,ogg_packet *op){
 131.234 +  private_state         *b=vd->backend_state;
 131.235 +  bitrate_manager_state *bm=&b->bms;
 131.236 +  vorbis_block          *vb=bm->vb;
 131.237 +  int                    choice=PACKETBLOBS/2;
 131.238 +  if(!vb)return 0;
 131.239 +
 131.240 +  if(op){
 131.241 +    vorbis_block_internal *vbi=vb->internal;
 131.242 +
 131.243 +    if(vorbis_bitrate_managed(vb))
 131.244 +      choice=bm->choice;
 131.245 +
 131.246 +    op->packet=oggpack_get_buffer(vbi->packetblob[choice]);
 131.247 +    op->bytes=oggpack_bytes(vbi->packetblob[choice]);
 131.248 +    op->b_o_s=0;
 131.249 +    op->e_o_s=vb->eofflag;
 131.250 +    op->granulepos=vb->granulepos;
 131.251 +    op->packetno=vb->sequence; /* for sake of completeness */
 131.252 +  }
 131.253 +
 131.254 +  bm->vb=0;
 131.255 +  return(1);
 131.256 +}
   132.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   132.2 +++ b/libs/vorbis/bitrate.h	Sun Nov 01 00:36:56 2015 +0200
   132.3 @@ -0,0 +1,59 @@
   132.4 +/********************************************************************
   132.5 + *                                                                  *
   132.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   132.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   132.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   132.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  132.10 + *                                                                  *
  132.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007             *
  132.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  132.13 + *                                                                  *
  132.14 + ********************************************************************
  132.15 +
  132.16 + function: bitrate tracking and management
  132.17 + last mod: $Id: bitrate.h 13293 2007-07-24 00:09:47Z xiphmont $
  132.18 +
  132.19 + ********************************************************************/
  132.20 +
  132.21 +#ifndef _V_BITRATE_H_
  132.22 +#define _V_BITRATE_H_
  132.23 +
  132.24 +#include "vorbis/codec.h"
  132.25 +#include "codec_internal.h"
  132.26 +#include "os.h"
  132.27 +
  132.28 +/* encode side bitrate tracking */
  132.29 +typedef struct bitrate_manager_state {
  132.30 +  int            managed;
  132.31 +
  132.32 +  long           avg_reservoir;
  132.33 +  long           minmax_reservoir;
  132.34 +  long           avg_bitsper;
  132.35 +  long           min_bitsper;
  132.36 +  long           max_bitsper;
  132.37 +
  132.38 +  long           short_per_long;
  132.39 +  double         avgfloat;
  132.40 +
  132.41 +  vorbis_block  *vb;
  132.42 +  int            choice;
  132.43 +} bitrate_manager_state;
  132.44 +
  132.45 +typedef struct bitrate_manager_info{
  132.46 +  long           avg_rate;
  132.47 +  long           min_rate;
  132.48 +  long           max_rate;
  132.49 +  long           reservoir_bits;
  132.50 +  double         reservoir_bias;
  132.51 +
  132.52 +  double         slew_damp;
  132.53 +
  132.54 +} bitrate_manager_info;
  132.55 +
  132.56 +extern void vorbis_bitrate_init(vorbis_info *vi,bitrate_manager_state *bs);
  132.57 +extern void vorbis_bitrate_clear(bitrate_manager_state *bs);
  132.58 +extern int vorbis_bitrate_managed(vorbis_block *vb);
  132.59 +extern int vorbis_bitrate_addblock(vorbis_block *vb);
  132.60 +extern int vorbis_bitrate_flushpacket(vorbis_dsp_state *vd, ogg_packet *op);
  132.61 +
  132.62 +#endif
   133.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   133.2 +++ b/libs/vorbis/block.c	Sun Nov 01 00:36:56 2015 +0200
   133.3 @@ -0,0 +1,1046 @@
   133.4 +/********************************************************************
   133.5 + *                                                                  *
   133.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   133.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   133.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   133.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  133.10 + *                                                                  *
  133.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
  133.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  133.13 + *                                                                  *
  133.14 + ********************************************************************
  133.15 +
  133.16 + function: PCM data vector blocking, windowing and dis/reassembly
  133.17 + last mod: $Id: block.c 17561 2010-10-23 10:34:24Z xiphmont $
  133.18 +
  133.19 + Handle windowing, overlap-add, etc of the PCM vectors.  This is made
  133.20 + more amusing by Vorbis' current two allowed block sizes.
  133.21 +
  133.22 + ********************************************************************/
  133.23 +
  133.24 +#include <stdio.h>
  133.25 +#include <stdlib.h>
  133.26 +#include <string.h>
  133.27 +#include <ogg/ogg.h>
  133.28 +#include "vorbis/codec.h"
  133.29 +#include "codec_internal.h"
  133.30 +
  133.31 +#include "window.h"
  133.32 +#include "mdct.h"
  133.33 +#include "lpc.h"
  133.34 +#include "registry.h"
  133.35 +#include "misc.h"
  133.36 +
  133.37 +static int ilog2(unsigned int v){
  133.38 +  int ret=0;
  133.39 +  if(v)--v;
  133.40 +  while(v){
  133.41 +    ret++;
  133.42 +    v>>=1;
  133.43 +  }
  133.44 +  return(ret);
  133.45 +}
  133.46 +
  133.47 +/* pcm accumulator examples (not exhaustive):
  133.48 +
  133.49 + <-------------- lW ---------------->
  133.50 +                   <--------------- W ---------------->
  133.51 +:            .....|.....       _______________         |
  133.52 +:        .'''     |     '''_---      |       |\        |
  133.53 +:.....'''         |_____--- '''......|       | \_______|
  133.54 +:.................|__________________|_______|__|______|
  133.55 +                  |<------ Sl ------>|      > Sr <     |endW
  133.56 +                  |beginSl           |endSl  |  |endSr
  133.57 +                  |beginW            |endlW  |beginSr
  133.58 +
  133.59 +
  133.60 +                      |< lW >|
  133.61 +                   <--------------- W ---------------->
  133.62 +                  |   |  ..  ______________            |
  133.63 +                  |   | '  `/        |     ---_        |
  133.64 +                  |___.'___/`.       |         ---_____|
  133.65 +                  |_______|__|_______|_________________|
  133.66 +                  |      >|Sl|<      |<------ Sr ----->|endW
  133.67 +                  |       |  |endSl  |beginSr          |endSr
  133.68 +                  |beginW |  |endlW
  133.69 +                  mult[0] |beginSl                     mult[n]
  133.70 +
  133.71 + <-------------- lW ----------------->
  133.72 +                          |<--W-->|
  133.73 +:            ..............  ___  |   |
  133.74 +:        .'''             |`/   \ |   |
  133.75 +:.....'''                 |/`....\|...|
  133.76 +:.........................|___|___|___|
  133.77 +                          |Sl |Sr |endW
  133.78 +                          |   |   |endSr
  133.79 +                          |   |beginSr
  133.80 +                          |   |endSl
  133.81 +                          |beginSl
  133.82 +                          |beginW
  133.83 +*/
  133.84 +
  133.85 +/* block abstraction setup *********************************************/
  133.86 +
  133.87 +#ifndef WORD_ALIGN
  133.88 +#define WORD_ALIGN 8
  133.89 +#endif
  133.90 +
  133.91 +int vorbis_block_init(vorbis_dsp_state *v, vorbis_block *vb){
  133.92 +  int i;
  133.93 +  memset(vb,0,sizeof(*vb));
  133.94 +  vb->vd=v;
  133.95 +  vb->localalloc=0;
  133.96 +  vb->localstore=NULL;
  133.97 +  if(v->analysisp){
  133.98 +    vorbis_block_internal *vbi=
  133.99 +      vb->internal=_ogg_calloc(1,sizeof(vorbis_block_internal));
 133.100 +    vbi->ampmax=-9999;
 133.101 +
 133.102 +    for(i=0;i<PACKETBLOBS;i++){
 133.103 +      if(i==PACKETBLOBS/2){
 133.104 +        vbi->packetblob[i]=&vb->opb;
 133.105 +      }else{
 133.106 +        vbi->packetblob[i]=
 133.107 +          _ogg_calloc(1,sizeof(oggpack_buffer));
 133.108 +      }
 133.109 +      oggpack_writeinit(vbi->packetblob[i]);
 133.110 +    }
 133.111 +  }
 133.112 +
 133.113 +  return(0);
 133.114 +}
 133.115 +
 133.116 +void *_vorbis_block_alloc(vorbis_block *vb,long bytes){
 133.117 +  bytes=(bytes+(WORD_ALIGN-1)) & ~(WORD_ALIGN-1);
 133.118 +  if(bytes+vb->localtop>vb->localalloc){
 133.119 +    /* can't just _ogg_realloc... there are outstanding pointers */
 133.120 +    if(vb->localstore){
 133.121 +      struct alloc_chain *link=_ogg_malloc(sizeof(*link));
 133.122 +      vb->totaluse+=vb->localtop;
 133.123 +      link->next=vb->reap;
 133.124 +      link->ptr=vb->localstore;
 133.125 +      vb->reap=link;
 133.126 +    }
 133.127 +    /* highly conservative */
 133.128 +    vb->localalloc=bytes;
 133.129 +    vb->localstore=_ogg_malloc(vb->localalloc);
 133.130 +    vb->localtop=0;
 133.131 +  }
 133.132 +  {
 133.133 +    void *ret=(void *)(((char *)vb->localstore)+vb->localtop);
 133.134 +    vb->localtop+=bytes;
 133.135 +    return ret;
 133.136 +  }
 133.137 +}
 133.138 +
 133.139 +/* reap the chain, pull the ripcord */
 133.140 +void _vorbis_block_ripcord(vorbis_block *vb){
 133.141 +  /* reap the chain */
 133.142 +  struct alloc_chain *reap=vb->reap;
 133.143 +  while(reap){
 133.144 +    struct alloc_chain *next=reap->next;
 133.145 +    _ogg_free(reap->ptr);
 133.146 +    memset(reap,0,sizeof(*reap));
 133.147 +    _ogg_free(reap);
 133.148 +    reap=next;
 133.149 +  }
 133.150 +  /* consolidate storage */
 133.151 +  if(vb->totaluse){
 133.152 +    vb->localstore=_ogg_realloc(vb->localstore,vb->totaluse+vb->localalloc);
 133.153 +    vb->localalloc+=vb->totaluse;
 133.154 +    vb->totaluse=0;
 133.155 +  }
 133.156 +
 133.157 +  /* pull the ripcord */
 133.158 +  vb->localtop=0;
 133.159 +  vb->reap=NULL;
 133.160 +}
 133.161 +
 133.162 +int vorbis_block_clear(vorbis_block *vb){
 133.163 +  int i;
 133.164 +  vorbis_block_internal *vbi=vb->internal;
 133.165 +
 133.166 +  _vorbis_block_ripcord(vb);
 133.167 +  if(vb->localstore)_ogg_free(vb->localstore);
 133.168 +
 133.169 +  if(vbi){
 133.170 +    for(i=0;i<PACKETBLOBS;i++){
 133.171 +      oggpack_writeclear(vbi->packetblob[i]);
 133.172 +      if(i!=PACKETBLOBS/2)_ogg_free(vbi->packetblob[i]);
 133.173 +    }
 133.174 +    _ogg_free(vbi);
 133.175 +  }
 133.176 +  memset(vb,0,sizeof(*vb));
 133.177 +  return(0);
 133.178 +}
 133.179 +
 133.180 +/* Analysis side code, but directly related to blocking.  Thus it's
 133.181 +   here and not in analysis.c (which is for analysis transforms only).
 133.182 +   The init is here because some of it is shared */
 133.183 +
 133.184 +static int _vds_shared_init(vorbis_dsp_state *v,vorbis_info *vi,int encp){
 133.185 +  int i;
 133.186 +  codec_setup_info *ci=vi->codec_setup;
 133.187 +  private_state *b=NULL;
 133.188 +  int hs;
 133.189 +
 133.190 +  if(ci==NULL) return 1;
 133.191 +  hs=ci->halfrate_flag;
 133.192 +
 133.193 +  memset(v,0,sizeof(*v));
 133.194 +  b=v->backend_state=_ogg_calloc(1,sizeof(*b));
 133.195 +
 133.196 +  v->vi=vi;
 133.197 +  b->modebits=ilog2(ci->modes);
 133.198 +
 133.199 +  b->transform[0]=_ogg_calloc(VI_TRANSFORMB,sizeof(*b->transform[0]));
 133.200 +  b->transform[1]=_ogg_calloc(VI_TRANSFORMB,sizeof(*b->transform[1]));
 133.201 +
 133.202 +  /* MDCT is tranform 0 */
 133.203 +
 133.204 +  b->transform[0][0]=_ogg_calloc(1,sizeof(mdct_lookup));
 133.205 +  b->transform[1][0]=_ogg_calloc(1,sizeof(mdct_lookup));
 133.206 +  mdct_init(b->transform[0][0],ci->blocksizes[0]>>hs);
 133.207 +  mdct_init(b->transform[1][0],ci->blocksizes[1]>>hs);
 133.208 +
 133.209 +  /* Vorbis I uses only window type 0 */
 133.210 +  b->window[0]=ilog2(ci->blocksizes[0])-6;
 133.211 +  b->window[1]=ilog2(ci->blocksizes[1])-6;
 133.212 +
 133.213 +  if(encp){ /* encode/decode differ here */
 133.214 +
 133.215 +    /* analysis always needs an fft */
 133.216 +    drft_init(&b->fft_look[0],ci->blocksizes[0]);
 133.217 +    drft_init(&b->fft_look[1],ci->blocksizes[1]);
 133.218 +
 133.219 +    /* finish the codebooks */
 133.220 +    if(!ci->fullbooks){
 133.221 +      ci->fullbooks=_ogg_calloc(ci->books,sizeof(*ci->fullbooks));
 133.222 +      for(i=0;i<ci->books;i++)
 133.223 +        vorbis_book_init_encode(ci->fullbooks+i,ci->book_param[i]);
 133.224 +    }
 133.225 +
 133.226 +    b->psy=_ogg_calloc(ci->psys,sizeof(*b->psy));
 133.227 +    for(i=0;i<ci->psys;i++){
 133.228 +      _vp_psy_init(b->psy+i,
 133.229 +                   ci->psy_param[i],
 133.230 +                   &ci->psy_g_param,
 133.231 +                   ci->blocksizes[ci->psy_param[i]->blockflag]/2,
 133.232 +                   vi->rate);
 133.233 +    }
 133.234 +
 133.235 +    v->analysisp=1;
 133.236 +  }else{
 133.237 +    /* finish the codebooks */
 133.238 +    if(!ci->fullbooks){
 133.239 +      ci->fullbooks=_ogg_calloc(ci->books,sizeof(*ci->fullbooks));
 133.240 +      for(i=0;i<ci->books;i++){
 133.241 +        if(ci->book_param[i]==NULL)
 133.242 +          goto abort_books;
 133.243 +        if(vorbis_book_init_decode(ci->fullbooks+i,ci->book_param[i]))
 133.244 +          goto abort_books;
 133.245 +        /* decode codebooks are now standalone after init */
 133.246 +        vorbis_staticbook_destroy(ci->book_param[i]);
 133.247 +        ci->book_param[i]=NULL;
 133.248 +      }
 133.249 +    }
 133.250 +  }
 133.251 +
 133.252 +  /* initialize the storage vectors. blocksize[1] is small for encode,
 133.253 +     but the correct size for decode */
 133.254 +  v->pcm_storage=ci->blocksizes[1];
 133.255 +  v->pcm=_ogg_malloc(vi->channels*sizeof(*v->pcm));
 133.256 +  v->pcmret=_ogg_malloc(vi->channels*sizeof(*v->pcmret));
 133.257 +  {
 133.258 +    int i;
 133.259 +    for(i=0;i<vi->channels;i++)
 133.260 +      v->pcm[i]=_ogg_calloc(v->pcm_storage,sizeof(*v->pcm[i]));
 133.261 +  }
 133.262 +
 133.263 +  /* all 1 (large block) or 0 (small block) */
 133.264 +  /* explicitly set for the sake of clarity */
 133.265 +  v->lW=0; /* previous window size */
 133.266 +  v->W=0;  /* current window size */
 133.267 +
 133.268 +  /* all vector indexes */
 133.269 +  v->centerW=ci->blocksizes[1]/2;
 133.270 +
 133.271 +  v->pcm_current=v->centerW;
 133.272 +
 133.273 +  /* initialize all the backend lookups */
 133.274 +  b->flr=_ogg_calloc(ci->floors,sizeof(*b->flr));
 133.275 +  b->residue=_ogg_calloc(ci->residues,sizeof(*b->residue));
 133.276 +
 133.277 +  for(i=0;i<ci->floors;i++)
 133.278 +    b->flr[i]=_floor_P[ci->floor_type[i]]->
 133.279 +      look(v,ci->floor_param[i]);
 133.280 +
 133.281 +  for(i=0;i<ci->residues;i++)
 133.282 +    b->residue[i]=_residue_P[ci->residue_type[i]]->
 133.283 +      look(v,ci->residue_param[i]);
 133.284 +
 133.285 +  return 0;
 133.286 + abort_books:
 133.287 +  for(i=0;i<ci->books;i++){
 133.288 +    if(ci->book_param[i]!=NULL){
 133.289 +      vorbis_staticbook_destroy(ci->book_param[i]);
 133.290 +      ci->book_param[i]=NULL;
 133.291 +    }
 133.292 +  }
 133.293 +  vorbis_dsp_clear(v);
 133.294 +  return -1;
 133.295 +}
 133.296 +
 133.297 +/* arbitrary settings and spec-mandated numbers get filled in here */
 133.298 +int vorbis_analysis_init(vorbis_dsp_state *v,vorbis_info *vi){
 133.299 +  private_state *b=NULL;
 133.300 +
 133.301 +  if(_vds_shared_init(v,vi,1))return 1;
 133.302 +  b=v->backend_state;
 133.303 +  b->psy_g_look=_vp_global_look(vi);
 133.304 +
 133.305 +  /* Initialize the envelope state storage */
 133.306 +  b->ve=_ogg_calloc(1,sizeof(*b->ve));
 133.307 +  _ve_envelope_init(b->ve,vi);
 133.308 +
 133.309 +  vorbis_bitrate_init(vi,&b->bms);
 133.310 +
 133.311 +  /* compressed audio packets start after the headers
 133.312 +     with sequence number 3 */
 133.313 +  v->sequence=3;
 133.314 +
 133.315 +  return(0);
 133.316 +}
 133.317 +
 133.318 +void vorbis_dsp_clear(vorbis_dsp_state *v){
 133.319 +  int i;
 133.320 +  if(v){
 133.321 +    vorbis_info *vi=v->vi;
 133.322 +    codec_setup_info *ci=(vi?vi->codec_setup:NULL);
 133.323 +    private_state *b=v->backend_state;
 133.324 +
 133.325 +    if(b){
 133.326 +
 133.327 +      if(b->ve){
 133.328 +        _ve_envelope_clear(b->ve);
 133.329 +        _ogg_free(b->ve);
 133.330 +      }
 133.331 +
 133.332 +      if(b->transform[0]){
 133.333 +        mdct_clear(b->transform[0][0]);
 133.334 +        _ogg_free(b->transform[0][0]);
 133.335 +        _ogg_free(b->transform[0]);
 133.336 +      }
 133.337 +      if(b->transform[1]){
 133.338 +        mdct_clear(b->transform[1][0]);
 133.339 +        _ogg_free(b->transform[1][0]);
 133.340 +        _ogg_free(b->transform[1]);
 133.341 +      }
 133.342 +
 133.343 +      if(b->flr){
 133.344 +        if(ci)
 133.345 +          for(i=0;i<ci->floors;i++)
 133.346 +            _floor_P[ci->floor_type[i]]->
 133.347 +              free_look(b->flr[i]);
 133.348 +        _ogg_free(b->flr);
 133.349 +      }
 133.350 +      if(b->residue){
 133.351 +        if(ci)
 133.352 +          for(i=0;i<ci->residues;i++)
 133.353 +            _residue_P[ci->residue_type[i]]->
 133.354 +              free_look(b->residue[i]);
 133.355 +        _ogg_free(b->residue);
 133.356 +      }
 133.357 +      if(b->psy){
 133.358 +        if(ci)
 133.359 +          for(i=0;i<ci->psys;i++)
 133.360 +            _vp_psy_clear(b->psy+i);
 133.361 +        _ogg_free(b->psy);
 133.362 +      }
 133.363 +
 133.364 +      if(b->psy_g_look)_vp_global_free(b->psy_g_look);
 133.365 +      vorbis_bitrate_clear(&b->bms);
 133.366 +
 133.367 +      drft_clear(&b->fft_look[0]);
 133.368 +      drft_clear(&b->fft_look[1]);
 133.369 +
 133.370 +    }
 133.371 +
 133.372 +    if(v->pcm){
 133.373 +      if(vi)
 133.374 +        for(i=0;i<vi->channels;i++)
 133.375 +          if(v->pcm[i])_ogg_free(v->pcm[i]);
 133.376 +      _ogg_free(v->pcm);
 133.377 +      if(v->pcmret)_ogg_free(v->pcmret);
 133.378 +    }
 133.379 +
 133.380 +    if(b){
 133.381 +      /* free header, header1, header2 */
 133.382 +      if(b->header)_ogg_free(b->header);
 133.383 +      if(b->header1)_ogg_free(b->header1);
 133.384 +      if(b->header2)_ogg_free(b->header2);
 133.385 +      _ogg_free(b);
 133.386 +    }
 133.387 +
 133.388 +    memset(v,0,sizeof(*v));
 133.389 +  }
 133.390 +}
 133.391 +
 133.392 +float **vorbis_analysis_buffer(vorbis_dsp_state *v, int vals){
 133.393 +  int i;
 133.394 +  vorbis_info *vi=v->vi;
 133.395 +  private_state *b=v->backend_state;
 133.396 +
 133.397 +  /* free header, header1, header2 */
 133.398 +  if(b->header)_ogg_free(b->header);b->header=NULL;
 133.399 +  if(b->header1)_ogg_free(b->header1);b->header1=NULL;
 133.400 +  if(b->header2)_ogg_free(b->header2);b->header2=NULL;
 133.401 +
 133.402 +  /* Do we have enough storage space for the requested buffer? If not,
 133.403 +     expand the PCM (and envelope) storage */
 133.404 +
 133.405 +  if(v->pcm_current+vals>=v->pcm_storage){
 133.406 +    v->pcm_storage=v->pcm_current+vals*2;
 133.407 +
 133.408 +    for(i=0;i<vi->channels;i++){
 133.409 +      v->pcm[i]=_ogg_realloc(v->pcm[i],v->pcm_storage*sizeof(*v->pcm[i]));
 133.410 +    }
 133.411 +  }
 133.412 +
 133.413 +  for(i=0;i<vi->channels;i++)
 133.414 +    v->pcmret[i]=v->pcm[i]+v->pcm_current;
 133.415 +
 133.416 +  return(v->pcmret);
 133.417 +}
 133.418 +
 133.419 +static void _preextrapolate_helper(vorbis_dsp_state *v){
 133.420 +  int i;
 133.421 +  int order=16;
 133.422 +  float *lpc=alloca(order*sizeof(*lpc));
 133.423 +  float *work=alloca(v->pcm_current*sizeof(*work));
 133.424 +  long j;
 133.425 +  v->preextrapolate=1;
 133.426 +
 133.427 +  if(v->pcm_current-v->centerW>order*2){ /* safety */
 133.428 +    for(i=0;i<v->vi->channels;i++){
 133.429 +      /* need to run the extrapolation in reverse! */
 133.430 +      for(j=0;j<v->pcm_current;j++)
 133.431 +        work[j]=v->pcm[i][v->pcm_current-j-1];
 133.432 +
 133.433 +      /* prime as above */
 133.434 +      vorbis_lpc_from_data(work,lpc,v->pcm_current-v->centerW,order);
 133.435 +
 133.436 +#if 0
 133.437 +      if(v->vi->channels==2){
 133.438 +        if(i==0)
 133.439 +          _analysis_output("predataL",0,work,v->pcm_current-v->centerW,0,0,0);
 133.440 +        else
 133.441 +          _analysis_output("predataR",0,work,v->pcm_current-v->centerW,0,0,0);
 133.442 +      }else{
 133.443 +        _analysis_output("predata",0,work,v->pcm_current-v->centerW,0,0,0);
 133.444 +      }
 133.445 +#endif
 133.446 +
 133.447 +      /* run the predictor filter */
 133.448 +      vorbis_lpc_predict(lpc,work+v->pcm_current-v->centerW-order,
 133.449 +                         order,
 133.450 +                         work+v->pcm_current-v->centerW,
 133.451 +                         v->centerW);
 133.452 +
 133.453 +      for(j=0;j<v->pcm_current;j++)
 133.454 +        v->pcm[i][v->pcm_current-j-1]=work[j];
 133.455 +
 133.456 +    }
 133.457 +  }
 133.458 +}
 133.459 +
 133.460 +
 133.461 +/* call with val<=0 to set eof */
 133.462 +
 133.463 +int vorbis_analysis_wrote(vorbis_dsp_state *v, int vals){
 133.464 +  vorbis_info *vi=v->vi;
 133.465 +  codec_setup_info *ci=vi->codec_setup;
 133.466 +
 133.467 +  if(vals<=0){
 133.468 +    int order=32;
 133.469 +    int i;
 133.470 +    float *lpc=alloca(order*sizeof(*lpc));
 133.471 +
 133.472 +    /* if it wasn't done earlier (very short sample) */
 133.473 +    if(!v->preextrapolate)
 133.474 +      _preextrapolate_helper(v);
 133.475 +
 133.476 +    /* We're encoding the end of the stream.  Just make sure we have
 133.477 +       [at least] a few full blocks of zeroes at the end. */
 133.478 +    /* actually, we don't want zeroes; that could drop a large
 133.479 +       amplitude off a cliff, creating spread spectrum noise that will
 133.480 +       suck to encode.  Extrapolate for the sake of cleanliness. */
 133.481 +
 133.482 +    vorbis_analysis_buffer(v,ci->blocksizes[1]*3);
 133.483 +    v->eofflag=v->pcm_current;
 133.484 +    v->pcm_current+=ci->blocksizes[1]*3;
 133.485 +
 133.486 +    for(i=0;i<vi->channels;i++){
 133.487 +      if(v->eofflag>order*2){
 133.488 +        /* extrapolate with LPC to fill in */
 133.489 +        long n;
 133.490 +
 133.491 +        /* make a predictor filter */
 133.492 +        n=v->eofflag;
 133.493 +        if(n>ci->blocksizes[1])n=ci->blocksizes[1];
 133.494 +        vorbis_lpc_from_data(v->pcm[i]+v->eofflag-n,lpc,n,order);
 133.495 +
 133.496 +        /* run the predictor filter */
 133.497 +        vorbis_lpc_predict(lpc,v->pcm[i]+v->eofflag-order,order,
 133.498 +                           v->pcm[i]+v->eofflag,v->pcm_current-v->eofflag);
 133.499 +      }else{
 133.500 +        /* not enough data to extrapolate (unlikely to happen due to
 133.501 +           guarding the overlap, but bulletproof in case that
 133.502 +           assumtion goes away). zeroes will do. */
 133.503 +        memset(v->pcm[i]+v->eofflag,0,
 133.504 +               (v->pcm_current-v->eofflag)*sizeof(*v->pcm[i]));
 133.505 +
 133.506 +      }
 133.507 +    }
 133.508 +  }else{
 133.509 +
 133.510 +    if(v->pcm_current+vals>v->pcm_storage)
 133.511 +      return(OV_EINVAL);
 133.512 +
 133.513 +    v->pcm_current+=vals;
 133.514 +
 133.515 +    /* we may want to reverse extrapolate the beginning of a stream
 133.516 +       too... in case we're beginning on a cliff! */
 133.517 +    /* clumsy, but simple.  It only runs once, so simple is good. */
 133.518 +    if(!v->preextrapolate && v->pcm_current-v->centerW>ci->blocksizes[1])
 133.519 +      _preextrapolate_helper(v);
 133.520 +
 133.521 +  }
 133.522 +  return(0);
 133.523 +}
 133.524 +
 133.525 +/* do the deltas, envelope shaping, pre-echo and determine the size of
 133.526 +   the next block on which to continue analysis */
 133.527 +int vorbis_analysis_blockout(vorbis_dsp_state *v,vorbis_block *vb){
 133.528 +  int i;
 133.529 +  vorbis_info *vi=v->vi;
 133.530 +  codec_setup_info *ci=vi->codec_setup;
 133.531 +  private_state *b=v->backend_state;
 133.532 +  vorbis_look_psy_global *g=b->psy_g_look;
 133.533 +  long beginW=v->centerW-ci->blocksizes[v->W]/2,centerNext;
 133.534 +  vorbis_block_internal *vbi=(vorbis_block_internal *)vb->internal;
 133.535 +
 133.536 +  /* check to see if we're started... */
 133.537 +  if(!v->preextrapolate)return(0);
 133.538 +
 133.539 +  /* check to see if we're done... */
 133.540 +  if(v->eofflag==-1)return(0);
 133.541 +
 133.542 +  /* By our invariant, we have lW, W and centerW set.  Search for
 133.543 +     the next boundary so we can determine nW (the next window size)
 133.544 +     which lets us compute the shape of the current block's window */
 133.545 +
 133.546 +  /* we do an envelope search even on a single blocksize; we may still
 133.547 +     be throwing more bits at impulses, and envelope search handles
 133.548 +     marking impulses too. */
 133.549 +  {
 133.550 +    long bp=_ve_envelope_search(v);
 133.551 +    if(bp==-1){
 133.552 +
 133.553 +      if(v->eofflag==0)return(0); /* not enough data currently to search for a
 133.554 +                                     full long block */
 133.555 +      v->nW=0;
 133.556 +    }else{
 133.557 +
 133.558 +      if(ci->blocksizes[0]==ci->blocksizes[1])
 133.559 +        v->nW=0;
 133.560 +      else
 133.561 +        v->nW=bp;
 133.562 +    }
 133.563 +  }
 133.564 +
 133.565 +  centerNext=v->centerW+ci->blocksizes[v->W]/4+ci->blocksizes[v->nW]/4;
 133.566 +
 133.567 +  {
 133.568 +    /* center of next block + next block maximum right side. */
 133.569 +
 133.570 +    long blockbound=centerNext+ci->blocksizes[v->nW]/2;
 133.571 +    if(v->pcm_current<blockbound)return(0); /* not enough data yet;
 133.572 +                                               although this check is
 133.573 +                                               less strict that the
 133.574 +                                               _ve_envelope_search,
 133.575 +                                               the search is not run
 133.576 +                                               if we only use one
 133.577 +                                               block size */
 133.578 +
 133.579 +
 133.580 +  }
 133.581 +
 133.582 +  /* fill in the block.  Note that for a short window, lW and nW are *short*
 133.583 +     regardless of actual settings in the stream */
 133.584 +
 133.585 +  _vorbis_block_ripcord(vb);
 133.586 +  vb->lW=v->lW;
 133.587 +  vb->W=v->W;
 133.588 +  vb->nW=v->nW;
 133.589 +
 133.590 +  if(v->W){
 133.591 +    if(!v->lW || !v->nW){
 133.592 +      vbi->blocktype=BLOCKTYPE_TRANSITION;
 133.593 +      /*fprintf(stderr,"-");*/
 133.594 +    }else{
 133.595 +      vbi->blocktype=BLOCKTYPE_LONG;
 133.596 +      /*fprintf(stderr,"_");*/
 133.597 +    }
 133.598 +  }else{
 133.599 +    if(_ve_envelope_mark(v)){
 133.600 +      vbi->blocktype=BLOCKTYPE_IMPULSE;
 133.601 +      /*fprintf(stderr,"|");*/
 133.602 +
 133.603 +    }else{
 133.604 +      vbi->blocktype=BLOCKTYPE_PADDING;
 133.605 +      /*fprintf(stderr,".");*/
 133.606 +
 133.607 +    }
 133.608 +  }
 133.609 +
 133.610 +  vb->vd=v;
 133.611 +  vb->sequence=v->sequence++;
 133.612 +  vb->granulepos=v->granulepos;
 133.613 +  vb->pcmend=ci->blocksizes[v->W];
 133.614 +
 133.615 +  /* copy the vectors; this uses the local storage in vb */
 133.616 +
 133.617 +  /* this tracks 'strongest peak' for later psychoacoustics */
 133.618 +  /* moved to the global psy state; clean this mess up */
 133.619 +  if(vbi->ampmax>g->ampmax)g->ampmax=vbi->ampmax;
 133.620 +  g->ampmax=_vp_ampmax_decay(g->ampmax,v);
 133.621 +  vbi->ampmax=g->ampmax;
 133.622 +
 133.623 +  vb->pcm=_vorbis_block_alloc(vb,sizeof(*vb->pcm)*vi->channels);
 133.624 +  vbi->pcmdelay=_vorbis_block_alloc(vb,sizeof(*vbi->pcmdelay)*vi->channels);
 133.625 +  for(i=0;i<vi->channels;i++){
 133.626 +    vbi->pcmdelay[i]=
 133.627 +      _vorbis_block_alloc(vb,(vb->pcmend+beginW)*sizeof(*vbi->pcmdelay[i]));
 133.628 +    memcpy(vbi->pcmdelay[i],v->pcm[i],(vb->pcmend+beginW)*sizeof(*vbi->pcmdelay[i]));
 133.629 +    vb->pcm[i]=vbi->pcmdelay[i]+beginW;
 133.630 +
 133.631 +    /* before we added the delay
 133.632 +       vb->pcm[i]=_vorbis_block_alloc(vb,vb->pcmend*sizeof(*vb->pcm[i]));
 133.633 +       memcpy(vb->pcm[i],v->pcm[i]+beginW,ci->blocksizes[v->W]*sizeof(*vb->pcm[i]));
 133.634 +    */
 133.635 +
 133.636 +  }
 133.637 +
 133.638 +  /* handle eof detection: eof==0 means that we've not yet received EOF
 133.639 +                           eof>0  marks the last 'real' sample in pcm[]
 133.640 +                           eof<0  'no more to do'; doesn't get here */
 133.641 +
 133.642 +  if(v->eofflag){
 133.643 +    if(v->centerW>=v->eofflag){
 133.644 +      v->eofflag=-1;
 133.645 +      vb->eofflag=1;
 133.646 +      return(1);
 133.647 +    }
 133.648 +  }
 133.649 +
 133.650 +  /* advance storage vectors and clean up */
 133.651 +  {
 133.652 +    int new_centerNext=ci->blocksizes[1]/2;
 133.653 +    int movementW=centerNext-new_centerNext;
 133.654 +
 133.655 +    if(movementW>0){
 133.656 +
 133.657 +      _ve_envelope_shift(b->ve,movementW);
 133.658 +      v->pcm_current-=movementW;
 133.659 +
 133.660 +      for(i=0;i<vi->channels;i++)
 133.661 +        memmove(v->pcm[i],v->pcm[i]+movementW,
 133.662 +                v->pcm_current*sizeof(*v->pcm[i]));
 133.663 +
 133.664 +
 133.665 +      v->lW=v->W;
 133.666 +      v->W=v->nW;
 133.667 +      v->centerW=new_centerNext;
 133.668 +
 133.669 +      if(v->eofflag){
 133.670 +        v->eofflag-=movementW;
 133.671 +        if(v->eofflag<=0)v->eofflag=-1;
 133.672 +        /* do not add padding to end of stream! */
 133.673 +        if(v->centerW>=v->eofflag){
 133.674 +          v->granulepos+=movementW-(v->centerW-v->eofflag);
 133.675 +        }else{
 133.676 +          v->granulepos+=movementW;
 133.677 +        }
 133.678 +      }else{
 133.679 +        v->granulepos+=movementW;
 133.680 +      }
 133.681 +    }
 133.682 +  }
 133.683 +
 133.684 +  /* done */
 133.685 +  return(1);
 133.686 +}
 133.687 +
 133.688 +int vorbis_synthesis_restart(vorbis_dsp_state *v){
 133.689 +  vorbis_info *vi=v->vi;
 133.690 +  codec_setup_info *ci;
 133.691 +  int hs;
 133.692 +
 133.693 +  if(!v->backend_state)return -1;
 133.694 +  if(!vi)return -1;
 133.695 +  ci=vi->codec_setup;
 133.696 +  if(!ci)return -1;
 133.697 +  hs=ci->halfrate_flag;
 133.698 +
 133.699 +  v->centerW=ci->blocksizes[1]>>(hs+1);
 133.700 +  v->pcm_current=v->centerW>>hs;
 133.701 +
 133.702 +  v->pcm_returned=-1;
 133.703 +  v->granulepos=-1;
 133.704 +  v->sequence=-1;
 133.705 +  v->eofflag=0;
 133.706 +  ((private_state *)(v->backend_state))->sample_count=-1;
 133.707 +
 133.708 +  return(0);
 133.709 +}
 133.710 +
 133.711 +int vorbis_synthesis_init(vorbis_dsp_state *v,vorbis_info *vi){
 133.712 +  if(_vds_shared_init(v,vi,0)){
 133.713 +    vorbis_dsp_clear(v);
 133.714 +    return 1;
 133.715 +  }
 133.716 +  vorbis_synthesis_restart(v);
 133.717 +  return 0;
 133.718 +}
 133.719 +
 133.720 +/* Unlike in analysis, the window is only partially applied for each
 133.721 +   block.  The time domain envelope is not yet handled at the point of
 133.722 +   calling (as it relies on the previous block). */
 133.723 +
 133.724 +int vorbis_synthesis_blockin(vorbis_dsp_state *v,vorbis_block *vb){
 133.725 +  vorbis_info *vi=v->vi;
 133.726 +  codec_setup_info *ci=vi->codec_setup;
 133.727 +  private_state *b=v->backend_state;
 133.728 +  int hs=ci->halfrate_flag;
 133.729 +  int i,j;
 133.730 +
 133.731 +  if(!vb)return(OV_EINVAL);
 133.732 +  if(v->pcm_current>v->pcm_returned  && v->pcm_returned!=-1)return(OV_EINVAL);
 133.733 +
 133.734 +  v->lW=v->W;
 133.735 +  v->W=vb->W;
 133.736 +  v->nW=-1;
 133.737 +
 133.738 +  if((v->sequence==-1)||
 133.739 +     (v->sequence+1 != vb->sequence)){
 133.740 +    v->granulepos=-1; /* out of sequence; lose count */
 133.741 +    b->sample_count=-1;
 133.742 +  }
 133.743 +
 133.744 +  v->sequence=vb->sequence;
 133.745 +
 133.746 +  if(vb->pcm){  /* no pcm to process if vorbis_synthesis_trackonly
 133.747 +                   was called on block */
 133.748 +    int n=ci->blocksizes[v->W]>>(hs+1);
 133.749 +    int n0=ci->blocksizes[0]>>(hs+1);
 133.750 +    int n1=ci->blocksizes[1]>>(hs+1);
 133.751 +
 133.752 +    int thisCenter;
 133.753 +    int prevCenter;
 133.754 +
 133.755 +    v->glue_bits+=vb->glue_bits;
 133.756 +    v->time_bits+=vb->time_bits;
 133.757 +    v->floor_bits+=vb->floor_bits;
 133.758 +    v->res_bits+=vb->res_bits;
 133.759 +
 133.760 +    if(v->centerW){
 133.761 +      thisCenter=n1;
 133.762 +      prevCenter=0;
 133.763 +    }else{
 133.764 +      thisCenter=0;
 133.765 +      prevCenter=n1;
 133.766 +    }
 133.767 +
 133.768 +    /* v->pcm is now used like a two-stage double buffer.  We don't want
 133.769 +       to have to constantly shift *or* adjust memory usage.  Don't
 133.770 +       accept a new block until the old is shifted out */
 133.771 +
 133.772 +    for(j=0;j<vi->channels;j++){
 133.773 +      /* the overlap/add section */
 133.774 +      if(v->lW){
 133.775 +        if(v->W){
 133.776 +          /* large/large */
 133.777 +          float *w=_vorbis_window_get(b->window[1]-hs);
 133.778 +          float *pcm=v->pcm[j]+prevCenter;
 133.779 +          float *p=vb->pcm[j];
 133.780 +          for(i=0;i<n1;i++)
 133.781 +            pcm[i]=pcm[i]*w[n1-i-1] + p[i]*w[i];
 133.782 +        }else{
 133.783 +          /* large/small */
 133.784 +          float *w=_vorbis_window_get(b->window[0]-hs);
 133.785 +          float *pcm=v->pcm[j]+prevCenter+n1/2-n0/2;
 133.786 +          float *p=vb->pcm[j];
 133.787 +          for(i=0;i<n0;i++)
 133.788 +            pcm[i]=pcm[i]*w[n0-i-1] +p[i]*w[i];
 133.789 +        }
 133.790 +      }else{
 133.791 +        if(v->W){
 133.792 +          /* small/large */
 133.793 +          float *w=_vorbis_window_get(b->window[0]-hs);
 133.794 +          float *pcm=v->pcm[j]+prevCenter;
 133.795 +          float *p=vb->pcm[j]+n1/2-n0/2;
 133.796 +          for(i=0;i<n0;i++)
 133.797 +            pcm[i]=pcm[i]*w[n0-i-1] +p[i]*w[i];
 133.798 +          for(;i<n1/2+n0/2;i++)
 133.799 +            pcm[i]=p[i];
 133.800 +        }else{
 133.801 +          /* small/small */
 133.802 +          float *w=_vorbis_window_get(b->window[0]-hs);
 133.803 +          float *pcm=v->pcm[j]+prevCenter;
 133.804 +          float *p=vb->pcm[j];
 133.805 +          for(i=0;i<n0;i++)
 133.806 +            pcm[i]=pcm[i]*w[n0-i-1] +p[i]*w[i];
 133.807 +        }
 133.808 +      }
 133.809 +
 133.810 +      /* the copy section */
 133.811 +      {
 133.812 +        float *pcm=v->pcm[j]+thisCenter;
 133.813 +        float *p=vb->pcm[j]+n;
 133.814 +        for(i=0;i<n;i++)
 133.815 +          pcm[i]=p[i];
 133.816 +      }
 133.817 +    }
 133.818 +
 133.819 +    if(v->centerW)
 133.820 +      v->centerW=0;
 133.821 +    else
 133.822 +      v->centerW=n1;
 133.823 +
 133.824 +    /* deal with initial packet state; we do this using the explicit
 133.825 +       pcm_returned==-1 flag otherwise we're sensitive to first block
 133.826 +       being short or long */
 133.827 +
 133.828 +    if(v->pcm_returned==-1){
 133.829 +      v->pcm_returned=thisCenter;
 133.830 +      v->pcm_current=thisCenter;
 133.831 +    }else{
 133.832 +      v->pcm_returned=prevCenter;
 133.833 +      v->pcm_current=prevCenter+
 133.834 +        ((ci->blocksizes[v->lW]/4+
 133.835 +        ci->blocksizes[v->W]/4)>>hs);
 133.836 +    }
 133.837 +
 133.838 +  }
 133.839 +
 133.840 +  /* track the frame number... This is for convenience, but also
 133.841 +     making sure our last packet doesn't end with added padding.  If
 133.842 +     the last packet is partial, the number of samples we'll have to
 133.843 +     return will be past the vb->granulepos.
 133.844 +
 133.845 +     This is not foolproof!  It will be confused if we begin
 133.846 +     decoding at the last page after a seek or hole.  In that case,
 133.847 +     we don't have a starting point to judge where the last frame
 133.848 +     is.  For this reason, vorbisfile will always try to make sure
 133.849 +     it reads the last two marked pages in proper sequence */
 133.850 +
 133.851 +  if(b->sample_count==-1){
 133.852 +    b->sample_count=0;
 133.853 +  }else{
 133.854 +    b->sample_count+=ci->blocksizes[v->lW]/4+ci->blocksizes[v->W]/4;
 133.855 +  }
 133.856 +
 133.857 +  if(v->granulepos==-1){
 133.858 +    if(vb->granulepos!=-1){ /* only set if we have a position to set to */
 133.859 +
 133.860 +      v->granulepos=vb->granulepos;
 133.861 +
 133.862 +      /* is this a short page? */
 133.863 +      if(b->sample_count>v->granulepos){
 133.864 +        /* corner case; if this is both the first and last audio page,
 133.865 +           then spec says the end is cut, not beginning */
 133.866 +       long extra=b->sample_count-vb->granulepos;
 133.867 +
 133.868 +        /* we use ogg_int64_t for granule positions because a
 133.869 +           uint64 isn't universally available.  Unfortunately,
 133.870 +           that means granposes can be 'negative' and result in
 133.871 +           extra being negative */
 133.872 +        if(extra<0)
 133.873 +          extra=0;
 133.874 +
 133.875 +        if(vb->eofflag){
 133.876 +          /* trim the end */
 133.877 +          /* no preceding granulepos; assume we started at zero (we'd
 133.878 +             have to in a short single-page stream) */
 133.879 +          /* granulepos could be -1 due to a seek, but that would result
 133.880 +             in a long count, not short count */
 133.881 +
 133.882 +          /* Guard against corrupt/malicious frames that set EOP and
 133.883 +             a backdated granpos; don't rewind more samples than we
 133.884 +             actually have */
 133.885 +          if(extra > (v->pcm_current - v->pcm_returned)<<hs)
 133.886 +            extra = (v->pcm_current - v->pcm_returned)<<hs;
 133.887 +
 133.888 +          v->pcm_current-=extra>>hs;
 133.889 +        }else{
 133.890 +          /* trim the beginning */
 133.891 +          v->pcm_returned+=extra>>hs;
 133.892 +          if(v->pcm_returned>v->pcm_current)
 133.893 +            v->pcm_returned=v->pcm_current;
 133.894 +        }
 133.895 +
 133.896 +      }
 133.897 +
 133.898 +    }
 133.899 +  }else{
 133.900 +    v->granulepos+=ci->blocksizes[v->lW]/4+ci->blocksizes[v->W]/4;
 133.901 +    if(vb->granulepos!=-1 && v->granulepos!=vb->granulepos){
 133.902 +
 133.903 +      if(v->granulepos>vb->granulepos){
 133.904 +        long extra=v->granulepos-vb->granulepos;
 133.905 +
 133.906 +        if(extra)
 133.907 +          if(vb->eofflag){
 133.908 +            /* partial last frame.  Strip the extra samples off */
 133.909 +
 133.910 +            /* Guard against corrupt/malicious frames that set EOP and
 133.911 +               a backdated granpos; don't rewind more samples than we
 133.912 +               actually have */
 133.913 +            if(extra > (v->pcm_current - v->pcm_returned)<<hs)
 133.914 +              extra = (v->pcm_current - v->pcm_returned)<<hs;
 133.915 +
 133.916 +            /* we use ogg_int64_t for granule positions because a
 133.917 +               uint64 isn't universally available.  Unfortunately,
 133.918 +               that means granposes can be 'negative' and result in
 133.919 +               extra being negative */
 133.920 +            if(extra<0)
 133.921 +              extra=0;
 133.922 +
 133.923 +            v->pcm_current-=extra>>hs;
 133.924 +          } /* else {Shouldn't happen *unless* the bitstream is out of
 133.925 +               spec.  Either way, believe the bitstream } */
 133.926 +      } /* else {Shouldn't happen *unless* the bitstream is out of
 133.927 +           spec.  Either way, believe the bitstream } */
 133.928 +      v->granulepos=vb->granulepos;
 133.929 +    }
 133.930 +  }
 133.931 +
 133.932 +  /* Update, cleanup */
 133.933 +
 133.934 +  if(vb->eofflag)v->eofflag=1;
 133.935 +  return(0);
 133.936 +
 133.937 +}
 133.938 +
 133.939 +/* pcm==NULL indicates we just want the pending samples, no more */
 133.940 +int vorbis_synthesis_pcmout(vorbis_dsp_state *v,float ***pcm){
 133.941 +  vorbis_info *vi=v->vi;
 133.942 +
 133.943 +  if(v->pcm_returned>-1 && v->pcm_returned<v->pcm_current){
 133.944 +    if(pcm){
 133.945 +      int i;
 133.946 +      for(i=0;i<vi->channels;i++)
 133.947 +        v->pcmret[i]=v->pcm[i]+v->pcm_returned;
 133.948 +      *pcm=v->pcmret;
 133.949 +    }
 133.950 +    return(v->pcm_current-v->pcm_returned);
 133.951 +  }
 133.952 +  return(0);
 133.953 +}
 133.954 +
 133.955 +int vorbis_synthesis_read(vorbis_dsp_state *v,int n){
 133.956 +  if(n && v->pcm_returned+n>v->pcm_current)return(OV_EINVAL);
 133.957 +  v->pcm_returned+=n;
 133.958 +  return(0);
 133.959 +}
 133.960 +
 133.961 +/* intended for use with a specific vorbisfile feature; we want access
 133.962 +   to the [usually synthetic/postextrapolated] buffer and lapping at
 133.963 +   the end of a decode cycle, specifically, a half-short-block worth.
 133.964 +   This funtion works like pcmout above, except it will also expose
 133.965 +   this implicit buffer data not normally decoded. */
 133.966 +int vorbis_synthesis_lapout(vorbis_dsp_state *v,float ***pcm){
 133.967 +  vorbis_info *vi=v->vi;
 133.968 +  codec_setup_info *ci=vi->codec_setup;
 133.969 +  int hs=ci->halfrate_flag;
 133.970 +
 133.971 +  int n=ci->blocksizes[v->W]>>(hs+1);
 133.972 +  int n0=ci->blocksizes[0]>>(hs+1);
 133.973 +  int n1=ci->blocksizes[1]>>(hs+1);
 133.974 +  int i,j;
 133.975 +
 133.976 +  if(v->pcm_returned<0)return 0;
 133.977 +
 133.978 +  /* our returned data ends at pcm_returned; because the synthesis pcm
 133.979 +     buffer is a two-fragment ring, that means our data block may be
 133.980 +     fragmented by buffering, wrapping or a short block not filling
 133.981 +     out a buffer.  To simplify things, we unfragment if it's at all
 133.982 +     possibly needed. Otherwise, we'd need to call lapout more than
 133.983 +     once as well as hold additional dsp state.  Opt for
 133.984 +     simplicity. */
 133.985 +
 133.986 +  /* centerW was advanced by blockin; it would be the center of the
 133.987 +     *next* block */
 133.988 +  if(v->centerW==n1){
 133.989 +    /* the data buffer wraps; swap the halves */
 133.990 +    /* slow, sure, small */
 133.991 +    for(j=0;j<vi->channels;j++){
 133.992 +      float *p=v->pcm[j];
 133.993 +      for(i=0;i<n1;i++){
 133.994 +        float temp=p[i];
 133.995 +        p[i]=p[i+n1];
 133.996 +        p[i+n1]=temp;
 133.997 +      }
 133.998 +    }
 133.999 +
133.1000 +    v->pcm_current-=n1;
133.1001 +    v->pcm_returned-=n1;
133.1002 +    v->centerW=0;
133.1003 +  }
133.1004 +
133.1005 +  /* solidify buffer into contiguous space */
133.1006 +  if((v->lW^v->W)==1){
133.1007 +    /* long/short or short/long */
133.1008 +    for(j=0;j<vi->channels;j++){
133.1009 +      float *s=v->pcm[j];
133.1010 +      float *d=v->pcm[j]+(n1-n0)/2;
133.1011 +      for(i=(n1+n0)/2-1;i>=0;--i)
133.1012 +        d[i]=s[i];
133.1013 +    }
133.1014 +    v->pcm_returned+=(n1-n0)/2;
133.1015 +    v->pcm_current+=(n1-n0)/2;
133.1016 +  }else{
133.1017 +    if(v->lW==0){
133.1018 +      /* short/short */
133.1019 +      for(j=0;j<vi->channels;j++){
133.1020 +        float *s=v->pcm[j];
133.1021 +        float *d=v->pcm[j]+n1-n0;
133.1022 +        for(i=n0-1;i>=0;--i)
133.1023 +          d[i]=s[i];
133.1024 +      }
133.1025 +      v->pcm_returned+=n1-n0;
133.1026 +      v->pcm_current+=n1-n0;
133.1027 +    }
133.1028 +  }
133.1029 +
133.1030 +  if(pcm){
133.1031 +    int i;
133.1032 +    for(i=0;i<vi->channels;i++)
133.1033 +      v->pcmret[i]=v->pcm[i]+v->pcm_returned;
133.1034 +    *pcm=v->pcmret;
133.1035 +  }
133.1036 +
133.1037 +  return(n1+n-v->pcm_returned);
133.1038 +
133.1039 +}
133.1040 +
133.1041 +float *vorbis_window(vorbis_dsp_state *v,int W){
133.1042 +  vorbis_info *vi=v->vi;
133.1043 +  codec_setup_info *ci=vi->codec_setup;
133.1044 +  int hs=ci->halfrate_flag;
133.1045 +  private_state *b=v->backend_state;
133.1046 +
133.1047 +  if(b->window[W]-1<0)return NULL;
133.1048 +  return _vorbis_window_get(b->window[W]-hs);
133.1049 +}
   134.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   134.2 +++ b/libs/vorbis/books/coupled/res_books_51.h	Sun Nov 01 00:36:56 2015 +0200
   134.3 @@ -0,0 +1,12257 @@
   134.4 +static const long _vq_quantlist__44p0_l0_0[] = {
   134.5 +	6,
   134.6 +	5,
   134.7 +	7,
   134.8 +	4,
   134.9 +	8,
  134.10 +	3,
  134.11 +	9,
  134.12 +	2,
  134.13 +	10,
  134.14 +	1,
  134.15 +	11,
  134.16 +	0,
  134.17 +	12,
  134.18 +};
  134.19 +
  134.20 +static const long _vq_lengthlist__44p0_l0_0[] = {
  134.21 +	 1, 3, 4, 7, 7, 8, 8, 9, 9, 9,10,10,10, 5, 6, 5,
  134.22 +	 8, 7, 9, 8, 9, 9,10, 9,11,10, 5, 5, 7, 7, 8, 8,
  134.23 +	 9, 9, 9, 9,10,10,11, 8, 9, 8,10, 9,10, 9,10, 9,
  134.24 +	11,10,11,10, 8, 8, 9, 9,10, 9,10, 9,11,10,11,10,
  134.25 +	11,10,11,11,11,11,11,11,11,11,11,11,11,11,10,11,
  134.26 +	11,11,12,11,11,11,11,11,11,10,12,12,12,12,12,12,
  134.27 +	12,11,12,12,12,11,11,11,12,12,12,12,12,12,12,11,
  134.28 +	12,11,12,11,11,13,12,12,12,13,12,12,12,12,11,12,
  134.29 +	11,11,13,13,13,12,12,12,12,12,12,11,11,11,10,13,
  134.30 +	13,13,12,13,12,13,11,13,10,12,11,11,13,13,12,13,
  134.31 +	12,12,12,12,11,12,11,11,11,
  134.32 +};
  134.33 +
  134.34 +static const static_codebook _44p0_l0_0 = {
  134.35 +	2, 169,
  134.36 +	(long *)_vq_lengthlist__44p0_l0_0,
  134.37 +	1, -526516224, 1616117760, 4, 0,
  134.38 +	(long *)_vq_quantlist__44p0_l0_0,
  134.39 +	0
  134.40 +};
  134.41 +
  134.42 +static const long _vq_quantlist__44p0_l0_1[] = {
  134.43 +	2,
  134.44 +	1,
  134.45 +	3,
  134.46 +	0,
  134.47 +	4,
  134.48 +};
  134.49 +
  134.50 +static const long _vq_lengthlist__44p0_l0_1[] = {
  134.51 +	 1, 4, 4, 6, 6, 5, 5, 5, 7, 5, 5, 5, 5, 6, 7, 7,
  134.52 +	 6, 7, 7, 7, 6, 7, 7, 7, 7,
  134.53 +};
  134.54 +
  134.55 +static const static_codebook _44p0_l0_1 = {
  134.56 +	2, 25,
  134.57 +	(long *)_vq_lengthlist__44p0_l0_1,
  134.58 +	1, -533725184, 1611661312, 3, 0,
  134.59 +	(long *)_vq_quantlist__44p0_l0_1,
  134.60 +	0
  134.61 +};
  134.62 +
  134.63 +static const long _vq_quantlist__44p0_l1_0[] = {
  134.64 +	1,
  134.65 +	0,
  134.66 +	2,
  134.67 +};
  134.68 +
  134.69 +static const long _vq_lengthlist__44p0_l1_0[] = {
  134.70 +	 1, 4, 4, 4, 4, 4, 4, 4, 4,
  134.71 +};
  134.72 +
  134.73 +static const static_codebook _44p0_l1_0 = {
  134.74 +	2, 9,
  134.75 +	(long *)_vq_lengthlist__44p0_l1_0,
  134.76 +	1, -516716544, 1630767104, 2, 0,
  134.77 +	(long *)_vq_quantlist__44p0_l1_0,
  134.78 +	0
  134.79 +};
  134.80 +
  134.81 +static const long _huff_lengthlist__44p0_lfe[] = {
  134.82 +	 1, 3, 2, 3,
  134.83 +};
  134.84 +
  134.85 +static const static_codebook _huff_book__44p0_lfe = {
  134.86 +	2, 4,
  134.87 +	(long *)_huff_lengthlist__44p0_lfe,
  134.88 +	0, 0, 0, 0, 0,
  134.89 +	NULL,
  134.90 +	0
  134.91 +};
  134.92 +
  134.93 +static const long _huff_lengthlist__44p0_long[] = {
  134.94 +	 2, 3, 6, 7,10,14,16, 3, 2, 5, 7,11,14,17, 6, 5,
  134.95 +	 5, 7,10,12,14, 7, 7, 6, 6, 7, 9,13,10,11, 9, 6,
  134.96 +	 6, 9,11,15,15,13,10, 9,10,12,18,18,16,14,12,13,
  134.97 +	16,
  134.98 +};
  134.99 +
 134.100 +static const static_codebook _huff_book__44p0_long = {
 134.101 +	2, 49,
 134.102 +	(long *)_huff_lengthlist__44p0_long,
 134.103 +	0, 0, 0, 0, 0,
 134.104 +	NULL,
 134.105 +	0
 134.106 +};
 134.107 +
 134.108 +static const long _vq_quantlist__44p0_p1_0[] = {
 134.109 +	1,
 134.110 +	0,
 134.111 +	2,
 134.112 +};
 134.113 +
 134.114 +static const long _vq_lengthlist__44p0_p1_0[] = {
 134.115 +	 1, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 134.116 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 134.117 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 134.118 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 134.119 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 134.120 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 134.121 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 134.122 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 134.123 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 134.124 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 134.125 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 134.126 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 134.127 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 134.128 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 134.129 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 134.130 +	 0, 0, 0,
 134.131 +};
 134.132 +
 134.133 +static const static_codebook _44p0_p1_0 = {
 134.134 +	5, 243,
 134.135 +	(long *)_vq_lengthlist__44p0_p1_0,
 134.136 +	1, -535822336, 1611661312, 2, 0,
 134.137 +	(long *)_vq_quantlist__44p0_p1_0,
 134.138 +	0
 134.139 +};
 134.140 +
 134.141 +static const long _vq_quantlist__44p0_p2_0[] = {
 134.142 +	1,
 134.143 +	0,
 134.144 +	2,
 134.145 +};
 134.146 +
 134.147 +static const long _vq_lengthlist__44p0_p2_0[] = {
 134.148 +	 1, 5, 5, 0, 7, 7, 0, 8, 8, 0, 9, 9, 0,12,12, 0,
 134.149 +	 8, 8, 0, 9, 9, 0,12,12, 0, 8, 8, 0, 6, 6, 0,11,
 134.150 +	11, 0,12,12, 0,12,12, 0,15,15, 0,11,11, 0,12,12,
 134.151 +	 0,15,15, 0,12,12, 0, 5, 5, 0, 5, 5, 0, 6, 6, 0,
 134.152 +	 7, 7, 0,11,11, 0, 6, 6, 0, 7, 7, 0,10,11, 0, 6,
 134.153 +	 6, 0, 7, 7, 0,11,11, 0,12,12, 0,11,11, 0,15,15,
 134.154 +	 0,10,10, 0,12,12, 0,15,15, 0,12,12, 0, 6, 6, 0,
 134.155 +	12,12, 0,12,12, 0,12,12, 0,15,15, 0,11,11, 0,12,
 134.156 +	12, 0,15,15, 0,12,12, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 134.157 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 134.158 +	 0, 0, 0, 8, 8, 0,12,12, 0,12,12, 0,12,12, 0,15,
 134.159 +	15, 0,12,12, 0,11,12, 0,15,16, 0,11,11, 0, 6, 6,
 134.160 +	 0,11,12, 0,12,12, 0,12,12, 0,16,15, 0,12,12, 0,
 134.161 +	13,12, 0,15,14, 0,12,12, 0, 0, 0, 0, 0, 0, 0, 0,
 134.162 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 134.163 +	 0, 0, 0,
 134.164 +};
 134.165 +
 134.166 +static const static_codebook _44p0_p2_0 = {
 134.167 +	5, 243,
 134.168 +	(long *)_vq_lengthlist__44p0_p2_0,
 134.169 +	1, -533200896, 1614282752, 2, 0,
 134.170 +	(long *)_vq_quantlist__44p0_p2_0,
 134.171 +	0
 134.172 +};
 134.173 +
 134.174 +static const long _vq_quantlist__44p0_p2_1[] = {
 134.175 +	1,
 134.176 +	0,
 134.177 +	2,
 134.178 +};
 134.179 +
 134.180 +static const long _vq_lengthlist__44p0_p2_1[] = {
 134.181 +	 1, 3, 3, 0, 9, 9, 0, 9, 9, 0,10,10, 0, 9, 9, 0,
 134.182 +	10,10, 0,10,10, 0, 9, 9, 0,10,10, 0, 7, 7, 0, 7,
 134.183 +	 7, 0, 6, 6, 0, 8, 8, 0, 7, 7, 0, 8, 8, 0, 8, 9,
 134.184 +	 0, 8, 8, 0, 8, 8, 0, 7, 7, 0, 9, 9, 0, 8, 8, 0,
 134.185 +	10,10, 0, 9, 9, 0,10,10, 0,10,10, 0, 9, 9, 0,10,
 134.186 +	10, 0, 9, 9, 0,11,11, 0,11,11, 0,12,12, 0,11,11,
 134.187 +	 0,12,12, 0,13,13, 0,12,12, 0,13,12, 0, 8, 8, 0,
 134.188 +	12,12, 0,12,12, 0,13,13, 0,12,12, 0,13,13, 0,13,
 134.189 +	13, 0,13,13, 0,13,13, 0, 7, 7, 0, 0, 0, 0, 0, 0,
 134.190 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 134.191 +	 0, 0, 0, 9, 9, 0,11,11, 0,12,12, 0,13,13, 0,12,
 134.192 +	12, 0,13,13, 0,13,13, 0,12,12, 0,12,12, 0, 8, 8,
 134.193 +	 0,12,12, 0,12,12, 0,13,13, 0,13,13, 0,13,14, 0,
 134.194 +	14,13, 0,13,13, 0,13,13, 0, 7, 7, 0, 0, 0, 0, 0,
 134.195 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 134.196 +	 0, 0, 0,
 134.197 +};
 134.198 +
 134.199 +static const static_codebook _44p0_p2_1 = {
 134.200 +	5, 243,
 134.201 +	(long *)_vq_lengthlist__44p0_p2_1,
 134.202 +	1, -535822336, 1611661312, 2, 0,
 134.203 +	(long *)_vq_quantlist__44p0_p2_1,
 134.204 +	0
 134.205 +};
 134.206 +
 134.207 +static const long _vq_quantlist__44p0_p3_0[] = {
 134.208 +	1,
 134.209 +	0,
 134.210 +	2,
 134.211 +};
 134.212 +
 134.213 +static const long _vq_lengthlist__44p0_p3_0[] = {
 134.214 +	 1, 6, 6, 7, 8, 8, 7, 8, 8, 7, 9, 9,10,12,11, 9,
 134.215 +	 8, 8, 7, 9, 9,11,12,12, 9, 9, 9, 6, 7, 7,10,11,
 134.216 +	11,10,11,11,10,11,11,13,13,14,12,12,12,11,11,11,
 134.217 +	14,14,14,12,12,12, 6, 5, 5, 9, 6, 5, 9, 6, 6, 9,
 134.218 +	 7, 7,12,10,10,11, 6, 6,10, 7, 7,13,10,10,12, 7,
 134.219 +	 7, 7, 8, 8,12,10,10,12,10,10,11,10,10,15,13,13,
 134.220 +	13, 9, 9,12,11,11,16,13,13,15,11,11, 8, 7, 7,12,
 134.221 +	12,12,12,11,11,12,11,11,14,14,14,14,12,12,12,12,
 134.222 +	12,16,15,15,14,12,12, 0,10,10, 0,12,12, 0,12,12,
 134.223 +	 0,11,11, 0,14,14, 0,11,11, 0,12,12, 0,15,15, 0,
 134.224 +	11,11, 8, 8, 8,13,11,11,13,10,10,13,11,11,15,13,
 134.225 +	13,14,11,11,12,10,10,16,14,14,14,10,10, 9, 7, 7,
 134.226 +	13,11,11,13,11,11,12,11,11,16,14,14,14,12,12,13,
 134.227 +	12,12,15,14,14,15,13,12, 0,11,11, 0,12,12, 0,12,
 134.228 +	12, 0,12,12, 0,15,15, 0,12,12, 0,13,12, 0,14,15,
 134.229 +	 0,12,12,
 134.230 +};
 134.231 +
 134.232 +static const static_codebook _44p0_p3_0 = {
 134.233 +	5, 243,
 134.234 +	(long *)_vq_lengthlist__44p0_p3_0,
 134.235 +	1, -531365888, 1616117760, 2, 0,
 134.236 +	(long *)_vq_quantlist__44p0_p3_0,
 134.237 +	0
 134.238 +};
 134.239 +
 134.240 +static const long _vq_quantlist__44p0_p3_1[] = {
 134.241 +	2,
 134.242 +	1,
 134.243 +	3,
 134.244 +	0,
 134.245 +	4,
 134.246 +};
 134.247 +
 134.248 +static const long _vq_lengthlist__44p0_p3_1[] = {
 134.249 +	 2, 4, 4, 8, 8,10,12,12,11,11, 9,11,11,12,13,11,
 134.250 +	12,12,11,11,11,12,12,12,12,10,13,12,13,13,11,12,
 134.251 +	12,13,13,11,12,12,13,13,11,12,13,13,13,11,13,13,
 134.252 +	13,13,10,13,13,12,13,11,12,12,14,14,11,13,12,12,
 134.253 +	12,11,12,12,13,13,11,13,13,12,12,11,13,13,13,13,
 134.254 +	11,12,12,13,13,11,13,13,12,12,11,12,12,13,13,11,
 134.255 +	13,13,12,12,11,13,13,13,13,11,12,12,14,14,11,13,
 134.256 +	13,12,12,11,12,12,13,13,11,13,13,12,12,11,10,10,
 134.257 +	10,10,12,10,10,11,11,11, 8, 8,11,11,13,10,10,10,
 134.258 +	10,12,10,10,10,10,13,11,11,11,11,13,10,10,11,11,
 134.259 +	13,11,11,12,12,13,11,11,11,11,13,11,11,12,12,13,
 134.260 +	11,11,12,12,13,10,10,11,11,13,11,11,11,11,13,11,
 134.261 +	10,11,11,13,11,11,11,11,13,11,11,11,11,13,10,10,
 134.262 +	11,11,13,11,11,11,11,12,10,11,11,11,13,11,11,11,
 134.263 +	11,13,11,11,11,11,13,10,10,11,11,13,11,11,11,11,
 134.264 +	13,11,11,11,11,13,11,11,11,11,11,10,10,10,10,12,
 134.265 +	10,10, 9, 9,12,12,12,11,11,13,12,12, 9, 9,13,12,
 134.266 +	12,10,10,12,12,12,12,12,13,13,13,14,14,13,12,12,
 134.267 +	11,11,13,13,13,12,12,13,12,12,11,11,13,12,13,11,
 134.268 +	11,13,13,13,14,14,13,12,12,10,10,13,13,13,11,11,
 134.269 +	13,12,12,10,10,13,13,13,11,11,13,13,13,14,14,13,
 134.270 +	12,12,10,10,13,13,13,11,11,13,12,13,10,10,13,13,
 134.271 +	13,11,11,13,13,13,14,14,13,12,12,10,10,13,13,13,
 134.272 +	11,11,13,13,12,10,10,14,12,12, 8, 8,14,12,12, 9,
 134.273 +	 9,14,11,11, 9, 9,14,12,12, 8, 8,14,11,11, 7, 7,
 134.274 +	14,13,13,10,10,15,12,12,10,10,15,13,13,10,10,15,
 134.275 +	12,12, 9, 9,15,13,13,10,10,15,13,13,10,10,15,12,
 134.276 +	12,10,10,15,13,13,10,10,14,12,12, 9, 9,14,13,13,
 134.277 +	 9, 9,14,13,13, 9, 9,15,12,12, 9, 9,15,13,13, 9,
 134.278 +	 9,14,12,12, 9, 9,14,13,13, 9, 9,14,13,13, 9, 9,
 134.279 +	15,12,12, 9, 9,14,13,13, 9, 9,14,12,12, 9, 9,14,
 134.280 +	13,13, 9, 9,13,12,12, 8, 8,13,13,13, 8, 8,14,13,
 134.281 +	13, 9, 9,13,13,13, 7, 7,14,13,13, 8, 8,14,14,14,
 134.282 +	10,10,14,14,14,11,11,14,14,14, 9, 9,14,14,14,10,
 134.283 +	10,14,14,14, 9, 9,14,14,14,10, 9,15,14,14,11,11,
 134.284 +	14,14,14, 9, 9,14,14,14,10,10,14,14,14, 9, 9,14,
 134.285 +	14,14, 9, 9,15,14,14,11,11,14,14,14, 8, 8,14,14,
 134.286 +	14, 9, 9,14,14,14, 8, 8,14,14,14, 9, 9,15,14,14,
 134.287 +	11,11,14,14,14, 8, 8,14,14,14, 9, 9,14,14,14, 8,
 134.288 +	 8,12,12,12,13,13,16,15,15,11,11,16,15,16,12,12,
 134.289 +	17,16,16,11,11,17,15,15,12,11,16,16,16,12,13,16,
 134.290 +	15,15,13,13,16,16,16,12,12,16,16,15,13,13,16,16,
 134.291 +	16,12,12,16,16,16,13,13,17,16,16,14,14,17,17,16,
 134.292 +	12,12,17,16,16,13,13,17,17,16,12,13,16,16,17,13,
 134.293 +	12,17,16,16,14,13,17,16,16,12,12,17,16,16,12,12,
 134.294 +	17,16,17,12,12,17,17,17,13,13,16,16,16,13,14,17,
 134.295 +	17,16,12,12,16,16,16,13,13,17,17,17,12,12,13,14,
 134.296 +	14,10,10,16,14,14,12,12,16,15,15,14,14,16,14,14,
 134.297 +	12,12,15,14,14,13,13,17,15,15,14,13,16,16,15,15,
 134.298 +	15,16,15,15,14,14,16,15,15,14,14,17,15,15,14,14,
 134.299 +	16,15,15,14,14,16,16,15,15,15,17,15,15,13,13,16,
 134.300 +	15,15,14,14,17,15,15,13,13,17,15,15,14,14,16,15,
 134.301 +	15,15,15,16,14,14,13,13,16,15,15,14,14,16,14,14,
 134.302 +	13,13,17,15,15,14,14,16,16,15,15,15,17,14,14,13,
 134.303 +	13,16,15,15,14,14,17,14,14,13,13,13,11,11,10,10,
 134.304 +	16,14,14,13,13,15,14,14,13,13,16,14,14,12,12,16,
 134.305 +	14,14,12,12,15,15,15,14,14,16,14,14,14,14,16,15,
 134.306 +	14,14,14,16,14,14,14,14,16,15,15,14,13,16,15,15,
 134.307 +	14,14,16,14,14,14,14,17,15,15,14,14,16,14,14,14,
 134.308 +	14,16,15,15,13,14,16,15,15,14,14,16,14,14,14,14,
 134.309 +	16,15,15,13,13,16,14,14,13,13,16,15,15,13,13,16,
 134.310 +	15,15,14,14,16,14,14,14,14,17,15,15,13,13,16,15,
 134.311 +	14,13,13,17,15,15,13,13,14,14,14, 9, 9,14,14,14,
 134.312 +	17,17,14,15,15,18,18,14,14,14,18,19,14,14,14,18,
 134.313 +	18,15,15,15,19,18,15,16,15,18,20,15,15,15,18,19,
 134.314 +	15,15,15,19,19,15,15,15,18,20,15,15,15,18,19,15,
 134.315 +	15,16,20,18,15,15,15,18,18,15,15,15,19,19,15,15,
 134.316 +	15,18,19,15,15,15,18,19,15,15,15,19,19,14,15,14,
 134.317 +	19,19,15,15,15,20,19,15,14,14,19,18,14,15,15,18,
 134.318 +	19,15,15,16,20,20,14,14,14,18,19,15,15,15,19,18,
 134.319 +	14,14,14,18,18,14,12,12, 9, 9,13,14,14,18,18,14,
 134.320 +	13,13,18,19,14,14,14,18,18,14,14,14,18,18,15,15,
 134.321 +	15,19,19,15,14,14,19,18,14,15,15,19,18,15,14,14,
 134.322 +	18,18,15,15,15,19,18,14,15,15,19,19,15,14,14,19,
 134.323 +	18,14,15,15,19,18,15,14,14,19,18,14,15,15,19,18,
 134.324 +	15,15,15,21,18,15,14,14,19,18,14,15,15,18,19,14,
 134.325 +	15,14,20,19,14,15,15,18,19,14,15,15,19,19,15,14,
 134.326 +	14,19,20,14,15,15,18,18,14,14,14,19,19,14,15,15,
 134.327 +	19,18,12,12,12,13,13,16,15,15,11,11,16,15,15,12,
 134.328 +	12,16,16,16,11,11,16,15,15,11,11,16,16,16,13,13,
 134.329 +	17,16,16,13,13,17,17,17,12,12,16,16,16,13,13,17,
 134.330 +	16,17,13,12,15,16,16,12,12,16,15,15,13,13,17,16,
 134.331 +	16,12,12,16,16,15,12,12,16,16,16,12,12,17,17,16,
 134.332 +	13,12,16,16,16,13,13,17,16,16,12,12,17,16,16,12,
 134.333 +	12,17,17,16,12,12,16,17,16,12,12,17,15,15,13,13,
 134.334 +	17,16,16,12,12,16,16,16,12,12,16,16,16,12,12,13,
 134.335 +	13,13, 9, 9,15,14,14,13,13,16,15,14,14,14,16,14,
 134.336 +	14,13,13,15,14,14,13,13,17,15,15,14,14,16,15,15,
 134.337 +	15,15,16,15,15,14,14,16,15,15,15,15,17,15,15,14,
 134.338 +	14,16,15,15,14,14,16,15,15,15,15,17,14,15,14,14,
 134.339 +	16,15,15,14,14,17,15,15,13,14,17,15,15,14,14,16,
 134.340 +	15,15,15,15,17,14,14,13,13,16,15,15,14,14,17,14,
 134.341 +	14,13,13,17,15,15,14,14,16,15,16,15,15,17,14,14,
 134.342 +	13,13,16,15,15,14,14,18,14,14,13,13,13,11,11,11,
 134.343 +	11,15,14,14,12,12,15,14,14,13,13,16,14,14,12,12,
 134.344 +	16,13,14,12,12,16,15,15,13,13,16,14,14,14,14,16,
 134.345 +	15,15,13,13,16,14,14,13,13,16,14,15,13,13,15,15,
 134.346 +	15,13,13,16,14,14,14,13,16,14,14,13,13,16,14,14,
 134.347 +	13,13,16,15,15,13,13,16,15,15,13,13,16,14,14,14,
 134.348 +	14,16,15,15,12,12,16,14,14,13,13,16,15,15,12,12,
 134.349 +	16,15,15,13,13,16,14,14,14,14,17,15,14,12,12,16,
 134.350 +	14,14,13,13,16,15,15,12,12,14,14,14, 8, 8,14,14,
 134.351 +	14,17,18,14,15,15,17,18,14,14,14,17,18,14,14,14,
 134.352 +	18,18,14,15,15,18,18,14,16,15,19,19,15,15,15,18,
 134.353 +	19,15,16,15,20,19,15,15,15,18,18,14,15,15,18,19,
 134.354 +	15,16,16,20,19,15,15,15,19,17,14,15,15,20,18,14,
 134.355 +	15,15,18,18,14,15,15,18,19,14,15,15,19,20,14,14,
 134.356 +	14,18,18,14,15,15,18,19,14,14,14,18,19,14,15,15,
 134.357 +	19,18,15,16,16,20,21,14,14,15,19,19,14,15,15,19,
 134.358 +	19,14,14,14,19,18,13,12,12, 9, 9,13,14,14,18,19,
 134.359 +	14,14,14,18,19,14,14,14,18,18,14,14,14,18,18,14,
 134.360 +	15,15,19,19,15,14,14,19,18,15,15,15,19,19,15,14,
 134.361 +	14,19,20,14,15,15,18,19,14,15,15,20,18,15,14,14,
 134.362 +	18,18,14,15,15,18,18,14,14,14,19,19,14,15,15,18,
 134.363 +	18,14,15,15,19,18,15,14,14,19,19,14,15,15,19,18,
 134.364 +	15,14,14,19,18,14,14,15,18,19,14,15,15,19,18,15,
 134.365 +	14,14,18,19,14,15,14,19,20,14,14,14,19,19,14,15,
 134.366 +	15,19,19,12,12,12,13,13,16,16,16,11,11,16,16,16,
 134.367 +	12,12,17,16,16,11,11,17,15,15,11,11,16,16,16,13,
 134.368 +	13,17,15,16,13,13,16,16,16,12,12,17,16,16,13,13,
 134.369 +	17,17,16,12,12,17,17,16,13,13,17,16,16,13,13,17,
 134.370 +	17,17,12,12,17,16,16,13,13,17,17,17,12,12,16,16,
 134.371 +	16,12,12,17,15,15,13,13,17,16,16,11,11,17,16,16,
 134.372 +	12,12,16,16,16,11,11,16,17,16,12,12,17,16,16,13,
 134.373 +	13,17,17,16,12,12,17,17,16,12,12,17,16,16,11,11,
 134.374 +	13,14,14, 9, 9,16,14,14,13,13,16,14,15,14,14,16,
 134.375 +	14,14,12,12,16,14,14,13,13,17,15,15,14,14,16,15,
 134.376 +	15,15,15,17,15,15,14,14,16,15,15,14,14,17,15,15,
 134.377 +	14,14,16,15,15,14,14,16,15,15,15,16,17,14,15,14,
 134.378 +	14,16,15,15,14,14,17,15,15,14,14,16,15,15,14,14,
 134.379 +	16,15,15,15,15,17,14,14,13,13,16,15,15,14,14,16,
 134.380 +	14,14,13,13,17,15,15,14,14,16,16,15,15,15,17,14,
 134.381 +	14,13,13,16,15,15,14,14,17,14,14,13,13,13,11,11,
 134.382 +	10,10,16,14,14,12,12,15,13,13,13,12,16,14,14,11,
 134.383 +	11,16,14,14,11,11,16,14,15,13,14,16,14,14,13,13,
 134.384 +	16,15,15,13,13,16,14,14,13,13,16,15,15,13,13,16,
 134.385 +	15,15,13,13,17,14,14,14,14,17,15,15,13,13,16,14,
 134.386 +	15,13,13,16,15,15,13,13,16,15,15,13,13,16,14,14,
 134.387 +	13,13,17,15,15,12,12,16,14,14,12,12,16,15,15,12,
 134.388 +	12,16,15,15,13,13,16,14,14,13,13,17,15,15,12,12,
 134.389 +	17,14,14,12,12,16,15,15,12,12,13,14,14, 8, 8,13,
 134.390 +	14,14,18,18,13,15,15,17,18,14,14,14,18,19,14,14,
 134.391 +	14,19,18,14,15,15,19,18,15,15,16,21,18,15,15,15,
 134.392 +	19,19,14,16,16,19,19,14,15,15,18,19,14,15,15,19,
 134.393 +	20,14,16,16,19,18,15,15,15,18,19,14,15,15,19,18,
 134.394 +	15,15,15,18,18,15,15,15,20,18,15,16,16,20,19,14,
 134.395 +	15,14,18,19,14,15,16,19,20,14,15,15,19,18,15,15,
 134.396 +	15,19,18,15,16,16,20,19,15,14,14,18,18,14,15,15,
 134.397 +	19,19,14,15,15,18,18,13,12,12, 8, 8,13,14,14,19,
 134.398 +	18,14,13,13,20,18,14,14,14,19,18,14,13,13,18,19,
 134.399 +	14,15,15,20,19,15,14,14,19,19,14,15,15,19,18,15,
 134.400 +	14,14,20,20,15,15,15,19,18,14,15,15,19,18,15,14,
 134.401 +	14,19,18,14,15,15,20,19,14,14,14,20,19,14,15,15,
 134.402 +	19,18,15,15,15,18,18,15,14,14,18,18,14,15,15,19,
 134.403 +	19,14,14,14,19,19,14,15,15,19,19,15,15,15,19,18,
 134.404 +	15,14,14,20,19,15,15,15,19,19,14,14,14,20,19,14,
 134.405 +	15,15,20,20,12,12,12,13,13,17,16,16,11,11,16,16,
 134.406 +	15,12,12,17,16,16,11,11,17,15,15,11,11,17,17,17,
 134.407 +	13,13,17,16,16,13,13,17,17,17,12,12,17,16,16,13,
 134.408 +	13,17,17,16,12,13,16,17,16,13,13,17,16,15,13,13,
 134.409 +	17,16,16,12,12,17,16,16,12,13,17,16,17,12,12,17,
 134.410 +	17,17,12,12,17,16,15,13,13,17,16,16,12,12,17,16,
 134.411 +	16,12,12,17,16,16,11,11,16,16,16,12,12,17,15,15,
 134.412 +	13,13,17,16,15,11,11,16,16,16,12,12,17,16,16,11,
 134.413 +	11,13,14,14, 9, 9,16,14,14,13,13,16,14,15,14,14,
 134.414 +	16,14,14,12,12,16,14,14,13,13,17,15,15,14,15,16,
 134.415 +	15,15,15,15,17,15,15,14,14,16,15,15,15,14,16,15,
 134.416 +	15,14,14,16,15,15,14,14,16,15,16,15,15,17,15,14,
 134.417 +	14,14,16,15,15,14,14,17,15,15,13,13,16,15,15,14,
 134.418 +	14,16,16,16,15,15,17,14,14,13,13,16,15,15,14,14,
 134.419 +	18,14,15,13,13,16,15,15,14,14,16,16,15,15,15,16,
 134.420 +	14,14,13,13,16,15,15,14,14,17,14,15,13,13,13,11,
 134.421 +	11,10,10,15,14,14,12,12,15,14,14,13,13,16,14,14,
 134.422 +	12,12,16,13,14,12,12,16,14,15,14,13,16,14,14,14,
 134.423 +	14,16,15,15,13,13,16,14,14,13,13,16,15,15,13,13,
 134.424 +	15,15,15,13,13,16,14,14,14,14,17,15,15,13,13,16,
 134.425 +	14,14,13,13,16,15,15,13,13,16,15,15,13,13,16,14,
 134.426 +	14,13,13,17,15,15,12,12,16,14,14,12,12,16,14,15,
 134.427 +	12,12,16,15,15,13,13,16,14,14,13,13,17,15,15,12,
 134.428 +	12,16,14,14,12,12,16,15,15,12,12,14,14,14, 8, 8,
 134.429 +	14,14,14,17,17,14,15,15,18,18,14,14,14,18,17,14,
 134.430 +	14,14,18,18,14,15,15,18,20,15,16,15,19,18,15,15,
 134.431 +	15,19,18,15,15,16,19,18,15,15,15,18,18,14,15,15,
 134.432 +	18,18,15,16,16,18,19,15,15,15,18,18,15,15,15,19,
 134.433 +	20,15,15,15,18,18,15,15,15,18,18,15,16,16,19,19,
 134.434 +	15,14,15,19,19,15,15,15,19,20,14,14,15,18,18,15,
 134.435 +	15,15,19,19,15,16,16,19,19,15,15,14,18,19,15,15,
 134.436 +	15,20,20,15,15,14,18,18,13,12,12, 8, 8,13,14,14,
 134.437 +	18,18,14,14,14,18,18,14,14,14,18,20,14,14,14,18,
 134.438 +	18,14,15,15,19,18,15,14,14,18,19,15,15,15,18,19,
 134.439 +	15,14,14,18,19,15,15,15,18,18,14,15,14,18,19,15,
 134.440 +	14,14,21,19,15,15,15,19,18,14,14,14,19,18,14,15,
 134.441 +	15,19,18,15,15,15,20,19,15,14,14,20,18,14,15,15,
 134.442 +	18,19,14,14,14,19,18,14,15,15,18,19,15,15,15,18,
 134.443 +	19,15,14,14,19,19,15,15,15,19,19,14,14,14,19,20,
 134.444 +	14,15,15,18,19,
 134.445 +};
 134.446 +
 134.447 +static const static_codebook _44p0_p3_1 = {
 134.448 +	5, 3125,
 134.449 +	(long *)_vq_lengthlist__44p0_p3_1,
 134.450 +	1, -533725184, 1611661312, 3, 0,
 134.451 +	(long *)_vq_quantlist__44p0_p3_1,
 134.452 +	0
 134.453 +};
 134.454 +
 134.455 +static const long _vq_quantlist__44p0_p4_0[] = {
 134.456 +	2,
 134.457 +	1,
 134.458 +	3,
 134.459 +	0,
 134.460 +	4,
 134.461 +};
 134.462 +
 134.463 +static const long _vq_lengthlist__44p0_p4_0[] = {
 134.464 +	 2, 6, 6,14,14, 6, 8, 8,14,14, 7, 7, 7,14,14, 0,
 134.465 +	13,13,15,16, 0,13,13,15,15, 7, 8, 8,15,15, 9,10,
 134.466 +	10,16,16, 9, 8, 8,14,15, 0,13,13,17,17, 0,13,13,
 134.467 +	16,16, 8, 8, 8,15,15,12,11,11,16,16, 9, 8, 8,14,
 134.468 +	14, 0,13,13,17,17, 0,13,13,15,15, 0,14,14,16,16,
 134.469 +	 0, 0, 0,18,19, 0,12,12,16,15, 0,16,16, 0,20, 0,
 134.470 +	14,14,16,16, 0,14,14,17,17, 0, 0, 0,19,19, 0,12,
 134.471 +	12,15,15, 0,18,17,21,21, 0,14,14,16,16, 5, 7, 7,
 134.472 +	12,13, 9,10, 9,14,14,11,10,10,14,14, 0, 0, 0,18,
 134.473 +	17, 0,20,21,18,18, 9,10,10,14,14,12,12,12,17,16,
 134.474 +	12,10,10,14,14, 0,20,20,18,17, 0,21,21,17,17,11,
 134.475 +	10,10,14,14,15,13,13,18,18,13,11,11,14,14, 0,20,
 134.476 +	 0,18,18, 0,20,21,18,17, 0,21, 0,18,19, 0, 0, 0,
 134.477 +	 0,21, 0,21,20,16,17, 0, 0, 0,21,21, 0, 0, 0,20,
 134.478 +	18, 0,20, 0,17,18, 0, 0, 0, 0, 0, 0, 0,20,16,17,
 134.479 +	 0, 0, 0,20, 0, 0, 0, 0,18,18, 6, 6, 6,13,13, 8,
 134.480 +	 5, 5,11,11, 9, 6, 6,13,13, 0, 9, 9,12,12, 0,10,
 134.481 +	10,14,14, 9, 7, 7,13,13,12, 9, 9,13,13,10, 6, 6,
 134.482 +	13,13, 0,10,10,14,14, 0,10,10,13,13, 9, 7, 7,13,
 134.483 +	13,13,10,10,13,13,11, 6, 6,13,13, 0,10,10,15,15,
 134.484 +	 0,10,10,13,13, 0,12,11,15,15, 0,20,19,17,16, 0,
 134.485 +	 9, 9,13,13, 0,13,13,20,19, 0,11,11,13,13, 0,11,
 134.486 +	11,15,15, 0,20,19,17,17, 0,10,10,13,13, 0,14,15,
 134.487 +	 0,21, 0,12,12,13,13, 0,10,10,12,12, 0,11,11,15,
 134.488 +	15, 0,11,11,15,15, 0,15,15,20,20, 0,16,16, 0, 0,
 134.489 +	 0,11,11,15,15, 0,14,14,17,17, 0,11,11,15,15, 0,
 134.490 +	15,15,20,21, 0,16,16,21,21, 0,12,12,15,15, 0,15,
 134.491 +	15,18,20, 0,11,11,16,15, 0,15,15,21,21, 0,16,16,
 134.492 +	 0,21, 0,16,16, 0, 0, 0, 0, 0, 0, 0, 0,14,14,21,
 134.493 +	21, 0,17,18, 0, 0, 0,16,17,20, 0, 0,16,16, 0, 0,
 134.494 +	 0, 0, 0, 0, 0, 0,15,15,20,20, 0,19,18, 0,21, 0,
 134.495 +	18,17, 0, 0, 0,10,10,11,11, 0,10,10,10,10, 0,11,
 134.496 +	11,12,12, 0,11,11, 9, 9, 0,13,13,12,12, 0,11,11,
 134.497 +	12,12, 0,13,13,12,12, 0,10,10,12,12, 0,12,12,13,
 134.498 +	13, 0,12,12,12,12, 0,11,11,12,12, 0,13,13,12,12,
 134.499 +	 0,10,10,12,12, 0,13,13,13,13, 0,12,12,12,12, 0,
 134.500 +	14,13,13,13, 0,19,21,15,15, 0,12,11,12,12, 0,16,
 134.501 +	15,19,19, 0,13,13,11,11, 0,13,13,13,13, 0, 0,21,
 134.502 +	15,16, 0,12,12,12,12, 0,16,16,19,21, 0,13,13,12,
 134.503 +	12, 7, 7, 7,16,16,11, 9, 9,16,16,12, 9, 9,16,16,
 134.504 +	 0,13,13,16,16, 0,14,14,17,16,11, 9, 9,16,16,14,
 134.505 +	12,11,17,17,13, 8, 9,15,15, 0,13,13,19,19, 0,13,
 134.506 +	13,16,15,12,10,10,17,17,15,12,12,19,18,14, 9, 9,
 134.507 +	17,16, 0,14,14,18, 0, 0,14,13,16,16, 0,14,15,18,
 134.508 +	17, 0,21, 0,19,21, 0,12,12,16,16, 0,16,16, 0, 0,
 134.509 +	 0,14,14,16,16, 0,14,14,18,18, 0, 0,21,20, 0, 0,
 134.510 +	13,13,16,17, 0,18,18, 0, 0, 0,15,14,17,16, 8, 7,
 134.511 +	 7,14,14,11,10,10,15,15,13,10,10,15,15, 0,21,20,
 134.512 +	19,19, 0,21, 0,17,18,11,10,10,15,16,14,12,12,18,
 134.513 +	18,14,11,11,15,14, 0,21,20,18,19, 0, 0,21,18,18,
 134.514 +	12,11,11,16,16,16,14,14,18,20,14,11,11,16,15, 0,
 134.515 +	20,20,19,19, 0, 0,20,18,18, 0,21, 0,18,19, 0, 0,
 134.516 +	 0, 0, 0, 0,20,20,17,18, 0, 0, 0,20,20, 0, 0, 0,
 134.517 +	19,19, 0, 0, 0,20,18, 0, 0, 0, 0, 0, 0, 0,21,18,
 134.518 +	18, 0,21,21, 0,21, 0, 0, 0,19,20,11, 9, 9,14,14,
 134.519 +	13,10,10,14,14,13,11,11,15,15, 0,13,13,13,13, 0,
 134.520 +	14,14,16,16,13,11,11,15,15,16,12,12,15,15,14,10,
 134.521 +	10,14,14, 0,14,14,16,16, 0,14,14,15,15,13,10,10,
 134.522 +	15,15,17,13,14,15,16,15,10,10,15,15, 0,14,14,17,
 134.523 +	16, 0,14,14,15,15, 0,15,15,17,17, 0, 0,21,18,18,
 134.524 +	 0,13,13,15,15, 0,16,16,21,20, 0,14,14,15,14, 0,
 134.525 +	15,14,16,17, 0, 0,20,20,19, 0,13,13,15,15, 0,19,
 134.526 +	18, 0, 0, 0,15,15,15,15, 0,11,11,14,14, 0,12,12,
 134.527 +	16,16, 0,12,12,16,16, 0,15,16,21,21, 0,16,17,21,
 134.528 +	 0, 0,12,12,17,16, 0,14,14,18,19, 0,11,11,16,16,
 134.529 +	 0,15,15,20,21, 0,16,16,21, 0, 0,12,12,17,16, 0,
 134.530 +	15,15,19,19, 0,12,12,16,17, 0,16,15, 0, 0, 0,16,
 134.531 +	16, 0, 0, 0,17,17, 0,21, 0, 0, 0, 0, 0, 0,14,15,
 134.532 +	20, 0, 0,17,17, 0, 0, 0,17,17, 0, 0, 0,17,16, 0,
 134.533 +	 0, 0, 0, 0, 0, 0, 0,15,15, 0, 0, 0,18,18, 0, 0,
 134.534 +	 0,18,17, 0, 0, 0,11,11,14,14, 0,12,12,15,15, 0,
 134.535 +	12,12,15,15, 0,13,13,14,14, 0,14,14,17,17, 0,12,
 134.536 +	12,16,16, 0,14,14,16,16, 0,11,11,15,15, 0,13,13,
 134.537 +	16,17, 0,13,13,16,16, 0,12,12,15,15, 0,14,14,17,
 134.538 +	16, 0,11,11,15,15, 0,14,14,17,17, 0,13,13,16,16,
 134.539 +	 0,15,15,17,18, 0,21,20,20,21, 0,12,12,15,15, 0,
 134.540 +	16,16,20,21, 0,14,14,15,15, 0,14,14,17,17, 0, 0,
 134.541 +	 0,18,19, 0,12,13,15,15, 0,18,17,21, 0, 0,14,15,
 134.542 +	15,15, 8, 8, 8,16,16,12,10,10,16,16,13, 9, 9,16,
 134.543 +	16, 0,14,14,18,17, 0,14,14,16,17,12,10,10,18,17,
 134.544 +	14,12,11,18,18,14, 9, 9,16,16, 0,13,13,18,18, 0,
 134.545 +	13,13,17,16,12, 9, 9,16,17,17,13,13,17,17,14, 9,
 134.546 +	 9,15,15, 0,14,14,20,19, 0,13,13,16,16, 0,15,15,
 134.547 +	19,18, 0, 0, 0,20,19, 0,12,13,17,17, 0,16,16,20,
 134.548 +	 0, 0,14,14,16,17, 0,14,14,19,18, 0, 0, 0,20,20,
 134.549 +	 0,13,13,16,16, 0,18,17, 0, 0, 0,15,15,16,16, 9,
 134.550 +	 7, 7,14,14,12,10,10,15,15,13,10,10,15,15, 0,21,
 134.551 +	 0,18,19, 0,20,21,19,18,12,10,10,16,15,15,13,13,
 134.552 +	18,18,14,11,11,15,15, 0, 0, 0,19,18, 0, 0,21,18,
 134.553 +	18,13,11,11,15,15,16,14,14,17,19,15,11,11,15,15,
 134.554 +	 0,21,21,20,18, 0, 0,21,18,18, 0, 0,21,21,19, 0,
 134.555 +	 0, 0, 0, 0, 0,19,20,18,17, 0, 0, 0,21,21, 0,21,
 134.556 +	 0,20,18, 0, 0,21,19,19, 0, 0, 0, 0, 0, 0,20,21,
 134.557 +	17,17, 0, 0, 0, 0, 0, 0,21, 0,18,20, 0,10,10,14,
 134.558 +	14, 0,11,11,15,15, 0,11,11,15,15, 0,14,14,15,15,
 134.559 +	 0,15,15,16,16, 0,11,12,16,16, 0,13,13,16,16, 0,
 134.560 +	11,11,15,15, 0,14,14,17,17, 0,14,14,15,15, 0,11,
 134.561 +	11,16,15, 0,14,14,15,15, 0,11,11,15,15, 0,15,15,
 134.562 +	17,17, 0,14,14,15,15, 0,16,16,18,18, 0, 0, 0,20,
 134.563 +	19, 0,14,13,16,15, 0,17,17,21, 0, 0,15,15,15,15,
 134.564 +	 0,16,15,17,16, 0,20, 0,20,18, 0,13,14,15,15, 0,
 134.565 +	19,18, 0,21, 0,15,15,15,15, 0,11,11,14,14, 0,12,
 134.566 +	12,16,16, 0,12,12,16,16, 0,16,15,20,21, 0,17,16,
 134.567 +	 0, 0, 0,12,12,16,16, 0,14,14,18,18, 0,11,11,16,
 134.568 +	16, 0,15,15,21,20, 0,16,16, 0, 0, 0,12,12,16,17,
 134.569 +	 0,15,14,19,19, 0,11,12,16,16, 0,15,15,21, 0, 0,
 134.570 +	16,16, 0, 0, 0,16,17, 0, 0, 0, 0, 0, 0, 0, 0,15,
 134.571 +	15,21, 0, 0,17,17, 0, 0, 0,17,17, 0, 0, 0,17,16,
 134.572 +	 0, 0, 0, 0, 0, 0, 0, 0,15,15, 0,20, 0,19,20, 0,
 134.573 +	 0, 0,17,17, 0, 0, 0,12,12,15,15, 0,12,12,15,15,
 134.574 +	 0,12,12,16,16, 0,13,13,15,15, 0,15,15,17,17, 0,
 134.575 +	13,13,17,16, 0,14,14,17,17, 0,11,11,16,16, 0,14,
 134.576 +	14,17,17, 0,13,13,16,16, 0,12,12,16,16, 0,15,15,
 134.577 +	16,17, 0,11,11,15,16, 0,14,14,17,17, 0,13,14,16,
 134.578 +	16, 0,15,15,18,18, 0,21,20,20,19, 0,13,13,16,17,
 134.579 +	 0,16,16, 0, 0, 0,14,14,16,16, 0,15,15,18,18, 0,
 134.580 +	 0, 0,20,19, 0,13,13,16,16, 0,17,17, 0, 0, 0,14,
 134.581 +	14,16,16, 0,11,11,16,16, 0,13,13,18,17, 0,13,13,
 134.582 +	17,17, 0,16,16,17,17, 0,16,16,17,18, 0,12,12,17,
 134.583 +	17, 0,15,15,18,18, 0,12,12,16,16, 0,16,16,19,19,
 134.584 +	 0,15,15,16,17, 0,12,12,17,17, 0,17,17,18,18, 0,
 134.585 +	12,12,17,17, 0,16,16,19,19, 0,15,16,17,17, 0,16,
 134.586 +	16,18,17, 0, 0, 0,21,21, 0,13,13,16,16, 0,17,17,
 134.587 +	 0,20, 0,15,15,16,17, 0,16,16,19,18, 0, 0,21,20,
 134.588 +	21, 0,14,14,17,16, 0,20, 0, 0, 0, 0,15,16,16,17,
 134.589 +	 0, 9, 9,14,14, 0,13,13,16,16, 0,14,14,15,15, 0,
 134.590 +	 0,20,19,19, 0, 0, 0,19,19, 0,12,12,15,15, 0,15,
 134.591 +	16,19,18, 0,14,14,15,15, 0,21, 0,18,18, 0,20, 0,
 134.592 +	17,18, 0,13,13,16,16, 0,17,17,17,19, 0,14,14,16,
 134.593 +	15, 0,21,20,20,19, 0, 0, 0,19,19, 0, 0, 0,19,18,
 134.594 +	 0, 0, 0, 0, 0, 0,20,20,17,18, 0, 0, 0,21,21, 0,
 134.595 +	 0, 0,18,18, 0,21, 0,18,19, 0, 0, 0, 0, 0, 0,20,
 134.596 +	21,18,18, 0, 0, 0,20,21, 0, 0, 0,19,19, 0,18,18,
 134.597 +	15,15, 0,20,21,17,17, 0,19,21,17,17, 0, 0, 0,17,
 134.598 +	18, 0, 0, 0,20,19, 0,19,19,17,17, 0, 0, 0,18,18,
 134.599 +	 0,19,20,16,17, 0, 0,21,20,20, 0,19,20,19,18, 0,
 134.600 +	19,20,16,16, 0, 0, 0,18,19, 0,19,20,17,17, 0, 0,
 134.601 +	21, 0,20, 0,21,21,17,19, 0,20, 0,19,20, 0, 0, 0,
 134.602 +	20, 0, 0,19,18,17,16, 0, 0, 0, 0, 0, 0, 0,20,17,
 134.603 +	17, 0,20,21,18,20, 0, 0, 0, 0,21, 0,19,20,17,17,
 134.604 +	 0, 0, 0, 0, 0, 0,20,21,17,17, 0,11,11,14,14, 0,
 134.605 +	13,13,16,17, 0,13,13,16,16, 0,17,17, 0,21, 0,18,
 134.606 +	17,21, 0, 0,13,13,16,16, 0,15,15,18,18, 0,12,12,
 134.607 +	16,16, 0,17,16,21, 0, 0,17,17, 0, 0, 0,12,12,17,
 134.608 +	17, 0,17,17,19,21, 0,13,12,16,16, 0,17,17, 0, 0,
 134.609 +	 0,17,17, 0, 0, 0,18,17, 0,21, 0, 0, 0, 0, 0, 0,
 134.610 +	15,15,20, 0, 0,20,18, 0, 0, 0,17,18, 0, 0, 0,16,
 134.611 +	17, 0, 0, 0, 0, 0, 0, 0, 0,15,15, 0, 0, 0,19,19,
 134.612 +	 0, 0, 0,18,18, 0, 0, 0,14,14,18,18, 0,16,16, 0,
 134.613 +	21, 0,16,16,21,21, 0,17,17, 0,20, 0,17,17,20, 0,
 134.614 +	 0,16,15, 0, 0, 0,20,20, 0, 0, 0,15,15,20,20, 0,
 134.615 +	17,17,21, 0, 0,17,18,20,20, 0,15,15,20,20, 0,18,
 134.616 +	18, 0, 0, 0,15,15,19,20, 0,17,18, 0, 0, 0,17,17,
 134.617 +	20,20, 0,18,17,21, 0, 0, 0, 0, 0,21, 0,15,15,20,
 134.618 +	20, 0,19,19, 0, 0, 0,17,17,21, 0, 0,17,17, 0, 0,
 134.619 +	 0, 0, 0,21, 0, 0,15,15,19,19, 0,20,21, 0, 0, 0,
 134.620 +	18,17,21,21, 0,12,12,16,16, 0,14,14,17,17, 0,13,
 134.621 +	13,17,18, 0,16,16,18,17, 0,16,16,18,18, 0,13,13,
 134.622 +	18,18, 0,15,16,19,18, 0,13,13,16,16, 0,16,16,20,
 134.623 +	18, 0,16,16,17,17, 0,12,13,17,17, 0,17,16,18,18,
 134.624 +	 0,12,12,16,16, 0,17,16,20,19, 0,16,16,16,16, 0,
 134.625 +	16,17,18,20, 0, 0, 0,21,20, 0,14,14,17,16, 0,19,
 134.626 +	18, 0,20, 0,16,16,17,16, 0,16,16,17,18, 0, 0,21,
 134.627 +	21,21, 0,14,14,16,16, 0,20,20,21, 0, 0,16,16,16,
 134.628 +	16, 0,10,10,14,14, 0,14,14,15,16, 0,14,14,15,15,
 134.629 +	 0, 0,21,18,18, 0, 0,21,18,19, 0,13,13,16,16, 0,
 134.630 +	16,16,18,18, 0,14,14,15,15, 0,21, 0,18,18, 0,21,
 134.631 +	 0,18,18, 0,13,13,16,16, 0,17,17,19,20, 0,14,14,
 134.632 +	15,15, 0, 0, 0,18,20, 0, 0,21,18,18, 0, 0,21,19,
 134.633 +	18, 0, 0, 0, 0, 0, 0,20,21,18,17, 0, 0, 0,21,21,
 134.634 +	 0, 0, 0,19,19, 0,21, 0,18,19, 0, 0, 0, 0, 0, 0,
 134.635 +	21,20,17,17, 0, 0,21,20, 0, 0, 0, 0,19,19, 0,19,
 134.636 +	20,15,16, 0, 0,20,18,17, 0,20,21,17,18, 0,21, 0,
 134.637 +	18,18, 0, 0, 0,19,19, 0,20,20,17,18, 0, 0, 0,18,
 134.638 +	19, 0,20,20,18,17, 0, 0, 0, 0,20, 0, 0,21,17,18,
 134.639 +	 0,20,21,17,17, 0, 0, 0,18,18, 0,19,19,17,17, 0,
 134.640 +	 0, 0,21,21, 0,20,20,17,17, 0, 0, 0,21,19, 0, 0,
 134.641 +	 0,20,19, 0,21,20,17,18, 0, 0, 0, 0, 0, 0, 0,20,
 134.642 +	18,17, 0,21,20,18,18, 0, 0, 0,20,21, 0,20,20,17,
 134.643 +	17, 0, 0, 0, 0, 0, 0,20, 0,17,17, 0,11,11,13,14,
 134.644 +	 0,13,13,16,16, 0,13,13,16,16, 0,17,17, 0, 0, 0,
 134.645 +	17,18, 0, 0, 0,13,13,16,16, 0,15,16,18,18, 0,13,
 134.646 +	13,16,17, 0,16,17,20, 0, 0,17,18,20, 0, 0,13,13,
 134.647 +	17,17, 0,16,16,20,21, 0,13,13,16,16, 0,17,17,21,
 134.648 +	 0, 0,17,18, 0, 0, 0,17,18, 0,21, 0, 0, 0, 0, 0,
 134.649 +	 0,15,15,20, 0, 0,19,19, 0, 0, 0,17,17, 0, 0, 0,
 134.650 +	18,17,21,20, 0, 0, 0, 0, 0, 0,16,16,20,21, 0,21,
 134.651 +	20, 0,21, 0,19,21, 0, 0, 0,15,15, 0, 0, 0,16,17,
 134.652 +	 0,19, 0,16,16, 0, 0, 0,17,17, 0, 0, 0,19,18, 0,
 134.653 +	 0, 0,16,16,20,20, 0,20,18,21, 0, 0,15,15,21,21,
 134.654 +	 0,18,18, 0, 0, 0,18,19, 0, 0, 0,16,15, 0,21, 0,
 134.655 +	20,19, 0, 0, 0,16,16, 0, 0, 0,20,18, 0,21, 0,17,
 134.656 +	18,21, 0, 0,18,19, 0, 0, 0, 0, 0, 0, 0, 0,16,16,
 134.657 +	20,20, 0,19,20, 0, 0, 0,17,17, 0, 0, 0,18,17,20,
 134.658 +	21, 0, 0, 0, 0, 0, 0,16,16, 0,20, 0,20,22, 0, 0,
 134.659 +	 0,18,18, 0,22,
 134.660 +};
 134.661 +
 134.662 +static const static_codebook _44p0_p4_0 = {
 134.663 +	5, 3125,
 134.664 +	(long *)_vq_lengthlist__44p0_p4_0,
 134.665 +	1, -528744448, 1616642048, 3, 0,
 134.666 +	(long *)_vq_quantlist__44p0_p4_0,
 134.667 +	0
 134.668 +};
 134.669 +
 134.670 +static const long _vq_quantlist__44p0_p4_1[] = {
 134.671 +	3,
 134.672 +	2,
 134.673 +	4,
 134.674 +	1,
 134.675 +	5,
 134.676 +	0,
 134.677 +	6,
 134.678 +};
 134.679 +
 134.680 +static const long _vq_lengthlist__44p0_p4_1[] = {
 134.681 +	 2, 3, 3, 3, 3, 3, 3,
 134.682 +};
 134.683 +
 134.684 +static const static_codebook _44p0_p4_1 = {
 134.685 +	1, 7,
 134.686 +	(long *)_vq_lengthlist__44p0_p4_1,
 134.687 +	1, -533200896, 1611661312, 3, 0,
 134.688 +	(long *)_vq_quantlist__44p0_p4_1,
 134.689 +	0
 134.690 +};
 134.691 +
 134.692 +static const long _vq_quantlist__44p0_p5_0[] = {
 134.693 +	1,
 134.694 +	0,
 134.695 +	2,
 134.696 +};
 134.697 +
 134.698 +static const long _vq_lengthlist__44p0_p5_0[] = {
 134.699 +	 1, 6, 6, 6, 8, 8, 7, 8, 8, 7, 9, 8,10,11,11, 9,
 134.700 +	 8, 8, 7, 8, 8,11,11,11, 9, 8, 8, 6, 7, 7,10,10,
 134.701 +	10,10,10,10,10,10,10,14,13,13,12,11,11,10,10,10,
 134.702 +	14,14,13,13,11,11, 6, 6, 6, 8, 5, 5, 8, 7, 7, 8,
 134.703 +	 7, 7,11, 9, 9, 9, 7, 7, 8, 7, 7,12,10,10,10, 7,
 134.704 +	 7, 7, 8, 8,12,11,11,12,10,10,11,10,10,14,13,13,
 134.705 +	13,10,10,11,10,11,16,14,14,13,10,10, 7, 8, 7,12,
 134.706 +	12,12,12,11,11,12,11,11,16,14,15,13,12,12,11,11,
 134.707 +	11,17,15,14,14,13,13,10, 9, 9,13,11,11,13,11,11,
 134.708 +	12,11,11,16,14,13,14,11,11,12,11,11,16,15,14,14,
 134.709 +	11,11, 7, 8, 8,12,11,11,12,10,10,12,10,10,16,14,
 134.710 +	13,13,11,11,12,10,10,16,14,14,13,10,10, 8, 8, 8,
 134.711 +	12,12,12,12,11,11,12,11,11,16,14,15,14,12,12,12,
 134.712 +	11,11,16,15,15,14,12,12,10,10,10,13,11,11,13,11,
 134.713 +	11,12,12,12,16,14,14,14,11,11,12,11,11,17,14,15,
 134.714 +	14,11,11,
 134.715 +};
 134.716 +
 134.717 +static const static_codebook _44p0_p5_0 = {
 134.718 +	5, 243,
 134.719 +	(long *)_vq_lengthlist__44p0_p5_0,
 134.720 +	1, -527106048, 1620377600, 2, 0,
 134.721 +	(long *)_vq_quantlist__44p0_p5_0,
 134.722 +	0
 134.723 +};
 134.724 +
 134.725 +static const long _vq_quantlist__44p0_p5_1[] = {
 134.726 +	1,
 134.727 +	0,
 134.728 +	2,
 134.729 +};
 134.730 +
 134.731 +static const long _vq_lengthlist__44p0_p5_1[] = {
 134.732 +	 2, 7, 7, 7, 8, 8, 7, 7, 7, 7, 8, 8, 8, 8, 9, 8,
 134.733 +	 7, 7, 8, 8, 8, 9, 9, 9, 9, 7, 7, 6, 6, 6, 9, 7,
 134.734 +	 7, 9, 7, 7, 9, 8, 8,10, 8, 8,10, 8, 8,10, 8, 8,
 134.735 +	10, 8, 8,10, 8, 8, 7, 6, 6, 9, 6, 6, 9, 6, 6, 9,
 134.736 +	 7, 7,10, 8, 8, 9, 6, 6, 9, 7, 7,10, 8, 8, 9, 7,
 134.737 +	 7, 7, 8, 8,11, 9, 9,11, 9, 9,11, 9, 9,12, 9, 9,
 134.738 +	12, 8, 8,12, 9, 9,12,10, 9,12, 8, 8, 8, 7, 7,10,
 134.739 +	 9, 9,11, 9, 9,11, 9, 9,11,11,10,11, 9, 9,11,10,
 134.740 +	 9,11,10,11,11, 9, 9,10, 8, 8,11, 9, 9,11, 9, 9,
 134.741 +	11, 9, 9,11,10,10,11, 9, 9,11, 9, 9,11,10,10,11,
 134.742 +	 9, 9, 9, 8, 8,12, 9, 9,12, 9, 9,11, 9, 9,12, 9,
 134.743 +	 9,12, 8, 8,12, 9, 9,12, 9, 9,12, 8, 8, 9, 7, 7,
 134.744 +	11, 9,10,11,10, 9,11, 9, 9,11,11,11,11, 9, 9,11,
 134.745 +	10,10,11,11,11,11, 9, 9,10, 9, 9,11, 9, 9,11,10,
 134.746 +	10,11,10, 9,11,10,10,11, 9, 9,11,10,10,11,10,11,
 134.747 +	11, 9, 9,
 134.748 +};
 134.749 +
 134.750 +static const static_codebook _44p0_p5_1 = {
 134.751 +	5, 243,
 134.752 +	(long *)_vq_lengthlist__44p0_p5_1,
 134.753 +	1, -530841600, 1616642048, 2, 0,
 134.754 +	(long *)_vq_quantlist__44p0_p5_1,
 134.755 +	0
 134.756 +};
 134.757 +
 134.758 +static const long _vq_quantlist__44p0_p6_0[] = {
 134.759 +	1,
 134.760 +	0,
 134.761 +	2,
 134.762 +};
 134.763 +
 134.764 +static const long _vq_lengthlist__44p0_p6_0[] = {
 134.765 +	 1, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9,
 134.766 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 9, 9, 9, 9,
 134.767 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
 134.768 +	 9, 9, 9, 9, 9, 9, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9,
 134.769 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
 134.770 +	 9, 7, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
 134.771 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
 134.772 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
 134.773 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
 134.774 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
 134.775 +	 9, 9, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
 134.776 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
 134.777 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
 134.778 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
 134.779 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
 134.780 +	 9, 9, 9,
 134.781 +};
 134.782 +
 134.783 +static const static_codebook _44p0_p6_0 = {
 134.784 +	5, 243,
 134.785 +	(long *)_vq_lengthlist__44p0_p6_0,
 134.786 +	1, -516716544, 1630767104, 2, 0,
 134.787 +	(long *)_vq_quantlist__44p0_p6_0,
 134.788 +	0
 134.789 +};
 134.790 +
 134.791 +static const long _vq_quantlist__44p0_p6_1[] = {
 134.792 +	12,
 134.793 +	11,
 134.794 +	13,
 134.795 +	10,
 134.796 +	14,
 134.797 +	9,
 134.798 +	15,
 134.799 +	8,
 134.800 +	16,
 134.801 +	7,
 134.802 +	17,
 134.803 +	6,
 134.804 +	18,
 134.805 +	5,
 134.806 +	19,
 134.807 +	4,
 134.808 +	20,
 134.809 +	3,
 134.810 +	21,
 134.811 +	2,
 134.812 +	22,
 134.813 +	1,
 134.814 +	23,
 134.815 +	0,
 134.816 +	24,
 134.817 +};
 134.818 +
 134.819 +static const long _vq_lengthlist__44p0_p6_1[] = {
 134.820 +	 1, 3, 2, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9,10,10,11,
 134.821 +	11,12,12,12,14,14,14,15,15,
 134.822 +};
 134.823 +
 134.824 +static const static_codebook _44p0_p6_1 = {
 134.825 +	1, 25,
 134.826 +	(long *)_vq_lengthlist__44p0_p6_1,
 134.827 +	1, -518864896, 1620639744, 5, 0,
 134.828 +	(long *)_vq_quantlist__44p0_p6_1,
 134.829 +	0
 134.830 +};
 134.831 +
 134.832 +static const long _vq_quantlist__44p0_p6_2[] = {
 134.833 +	12,
 134.834 +	11,
 134.835 +	13,
 134.836 +	10,
 134.837 +	14,
 134.838 +	9,
 134.839 +	15,
 134.840 +	8,
 134.841 +	16,
 134.842 +	7,
 134.843 +	17,
 134.844 +	6,
 134.845 +	18,
 134.846 +	5,
 134.847 +	19,
 134.848 +	4,
 134.849 +	20,
 134.850 +	3,
 134.851 +	21,
 134.852 +	2,
 134.853 +	22,
 134.854 +	1,
 134.855 +	23,
 134.856 +	0,
 134.857 +	24,
 134.858 +};
 134.859 +
 134.860 +static const long _vq_lengthlist__44p0_p6_2[] = {
 134.861 +	 3, 4, 4, 5, 4, 5, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5,
 134.862 +	 5, 5, 5, 5, 5, 5, 5, 5, 5,
 134.863 +};
 134.864 +
 134.865 +static const static_codebook _44p0_p6_2 = {
 134.866 +	1, 25,
 134.867 +	(long *)_vq_lengthlist__44p0_p6_2,
 134.868 +	1, -529006592, 1611661312, 5, 0,
 134.869 +	(long *)_vq_quantlist__44p0_p6_2,
 134.870 +	0
 134.871 +};
 134.872 +
 134.873 +static const long _huff_lengthlist__44p0_short[] = {
 134.874 +	 3, 3, 7, 8,10,13,16, 3, 2, 5, 7, 9,13,16, 6, 4,
 134.875 +	 4, 6,10,14,15, 7, 5, 5, 7,10,13,14, 9, 8, 9, 9,
 134.876 +	 9,11,13,12,11,12, 9, 7, 8,11,14,12,10, 6, 5, 7,
 134.877 +	10,
 134.878 +};
 134.879 +
 134.880 +static const static_codebook _huff_book__44p0_short = {
 134.881 +	2, 49,
 134.882 +	(long *)_huff_lengthlist__44p0_short,
 134.883 +	0, 0, 0, 0, 0,
 134.884 +	NULL,
 134.885 +	0
 134.886 +};
 134.887 +
 134.888 +static const long _vq_quantlist__44p1_l0_0[] = {
 134.889 +	6,
 134.890 +	5,
 134.891 +	7,
 134.892 +	4,
 134.893 +	8,
 134.894 +	3,
 134.895 +	9,
 134.896 +	2,
 134.897 +	10,
 134.898 +	1,
 134.899 +	11,
 134.900 +	0,
 134.901 +	12,
 134.902 +};
 134.903 +
 134.904 +static const long _vq_lengthlist__44p1_l0_0[] = {
 134.905 +	 1, 4, 4, 7, 7, 8, 8, 9, 9,10,10,11,11, 4, 6, 5,
 134.906 +	 8, 6, 9, 8,10, 9,10,10,11,10, 5, 5, 6, 6, 8, 8,
 134.907 +	 9, 9,10,10,10,10,11, 7, 8, 8, 9, 8,10, 9,10, 9,
 134.908 +	11,10,11,10, 7, 8, 8, 8,10, 9,10,10,10,10,11,10,
 134.909 +	11, 9,10,10,11,11,11,11,12,11,12,11,12,11, 9,10,
 134.910 +	10,11,11,11,11,11,11,11,12,11,12,11,11,11,12,12,
 134.911 +	12,12,12,12,12,12,12,11,11,12,11,12,12,12,12,12,
 134.912 +	12,12,12,11,12,12,12,12,12,13,12,13,12,12,12,12,
 134.913 +	12,12,12,12,12,13,13,13,13,12,13,12,12,12,12,12,
 134.914 +	13,13,12,13,12,13,12,13,12,12,12,12,13,13,13,13,
 134.915 +	13,13,12,12,12,12,12,11,12,
 134.916 +};
 134.917 +
 134.918 +static const static_codebook _44p1_l0_0 = {
 134.919 +	2, 169,
 134.920 +	(long *)_vq_lengthlist__44p1_l0_0,
 134.921 +	1, -526516224, 1616117760, 4, 0,
 134.922 +	(long *)_vq_quantlist__44p1_l0_0,
 134.923 +	0
 134.924 +};
 134.925 +
 134.926 +static const long _vq_quantlist__44p1_l0_1[] = {
 134.927 +	2,
 134.928 +	1,
 134.929 +	3,
 134.930 +	0,
 134.931 +	4,
 134.932 +};
 134.933 +
 134.934 +static const long _vq_lengthlist__44p1_l0_1[] = {
 134.935 +	 1, 4, 4, 6, 6, 5, 5, 5, 6, 6, 5, 6, 5, 6, 6, 6,
 134.936 +	 6, 7, 7, 7, 6, 7, 6, 7, 7,
 134.937 +};
 134.938 +
 134.939 +static const static_codebook _44p1_l0_1 = {
 134.940 +	2, 25,
 134.941 +	(long *)_vq_lengthlist__44p1_l0_1,
 134.942 +	1, -533725184, 1611661312, 3, 0,
 134.943 +	(long *)_vq_quantlist__44p1_l0_1,
 134.944 +	0
 134.945 +};
 134.946 +
 134.947 +static const long _vq_quantlist__44p1_l1_0[] = {
 134.948 +	1,
 134.949 +	0,
 134.950 +	2,
 134.951 +};
 134.952 +
 134.953 +static const long _vq_lengthlist__44p1_l1_0[] = {
 134.954 +	 1, 4, 4, 4, 4, 4, 4, 4, 4,
 134.955 +};
 134.956 +
 134.957 +static const static_codebook _44p1_l1_0 = {
 134.958 +	2, 9,
 134.959 +	(long *)_vq_lengthlist__44p1_l1_0,
 134.960 +	1, -516716544, 1630767104, 2, 0,
 134.961 +	(long *)_vq_quantlist__44p1_l1_0,
 134.962 +	0
 134.963 +};
 134.964 +
 134.965 +static const long _huff_lengthlist__44p1_lfe[] = {
 134.966 +	 1, 3, 2, 3,
 134.967 +};
 134.968 +
 134.969 +static const static_codebook _huff_book__44p1_lfe = {
 134.970 +	2, 4,
 134.971 +	(long *)_huff_lengthlist__44p1_lfe,
 134.972 +	0, 0, 0, 0, 0,
 134.973 +	NULL,
 134.974 +	0
 134.975 +};
 134.976 +
 134.977 +static const long _huff_lengthlist__44p1_long[] = {
 134.978 +	 3, 3, 7, 7, 9,13,16, 3, 2, 4, 6,10,13,17, 7, 4,
 134.979 +	 4, 6, 9,12,14, 7, 6, 6, 5, 7, 9,12,10,10, 9, 6,
 134.980 +	 6, 9,12,14,14,13, 9, 8,10,11,18,18,15,13,11,10,
 134.981 +	11,
 134.982 +};
 134.983 +
 134.984 +static const static_codebook _huff_book__44p1_long = {
 134.985 +	2, 49,
 134.986 +	(long *)_huff_lengthlist__44p1_long,
 134.987 +	0, 0, 0, 0, 0,
 134.988 +	NULL,
 134.989 +	0
 134.990 +};
 134.991 +
 134.992 +static const long _vq_quantlist__44p1_p1_0[] = {
 134.993 +	1,
 134.994 +	0,
 134.995 +	2,
 134.996 +};
 134.997 +
 134.998 +static const long _vq_lengthlist__44p1_p1_0[] = {
 134.999 +	 1, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1000 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1001 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1002 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1003 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1004 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1005 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1006 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1007 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1008 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1009 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1010 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1011 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1012 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1013 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1014 +	 0, 0, 0,
134.1015 +};
134.1016 +
134.1017 +static const static_codebook _44p1_p1_0 = {
134.1018 +	5, 243,
134.1019 +	(long *)_vq_lengthlist__44p1_p1_0,
134.1020 +	1, -535822336, 1611661312, 2, 0,
134.1021 +	(long *)_vq_quantlist__44p1_p1_0,
134.1022 +	0
134.1023 +};
134.1024 +
134.1025 +static const long _vq_quantlist__44p1_p2_0[] = {
134.1026 +	1,
134.1027 +	0,
134.1028 +	2,
134.1029 +};
134.1030 +
134.1031 +static const long _vq_lengthlist__44p1_p2_0[] = {
134.1032 +	 1, 4, 4, 0, 7, 7, 0, 8, 8, 0, 9, 9, 0,12,12, 0,
134.1033 +	 8, 8, 0, 9, 9, 0,12,12, 0, 8, 8, 0, 6, 6, 0,11,
134.1034 +	11, 0,11,11, 0,12,12, 0,14,14, 0,11,11, 0,12,12,
134.1035 +	 0,14,14, 0,11,11, 0, 6, 6, 0, 6, 5, 0, 7, 6, 0,
134.1036 +	 7, 7, 0,10,10, 0, 6, 6, 0, 7, 7, 0,10,10, 0, 7,
134.1037 +	 7, 0, 7, 7, 0,10,10, 0,11,11, 0,11,11, 0,14,14,
134.1038 +	 0,10,10, 0,12,12, 0,14,14, 0,12,12, 0, 6, 6, 0,
134.1039 +	11,11, 0,11,11, 0,12,12, 0,14,14, 0,11,11, 0,12,
134.1040 +	12, 0,15,15, 0,11,11, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1041 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1042 +	 0, 0, 0, 8, 8, 0,11,11, 0,11,11, 0,12,12, 0,15,
134.1043 +	15, 0,12,12, 0,11,11, 0,15,15, 0,11,11, 0, 6, 6,
134.1044 +	 0,11,11, 0,12,12, 0,12,12, 0,15,15, 0,11,11, 0,
134.1045 +	12,12, 0,14,14, 0,12,12, 0, 0, 0, 0, 0, 0, 0, 0,
134.1046 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1047 +	 0, 0, 0,
134.1048 +};
134.1049 +
134.1050 +static const static_codebook _44p1_p2_0 = {
134.1051 +	5, 243,
134.1052 +	(long *)_vq_lengthlist__44p1_p2_0,
134.1053 +	1, -533200896, 1614282752, 2, 0,
134.1054 +	(long *)_vq_quantlist__44p1_p2_0,
134.1055 +	0
134.1056 +};
134.1057 +
134.1058 +static const long _vq_quantlist__44p1_p2_1[] = {
134.1059 +	1,
134.1060 +	0,
134.1061 +	2,
134.1062 +};
134.1063 +
134.1064 +static const long _vq_lengthlist__44p1_p2_1[] = {
134.1065 +	 1, 3, 3, 0, 8, 8, 0, 8, 8, 0,10,10, 0, 9, 9, 0,
134.1066 +	10,10, 0,10,10, 0, 9, 9, 0,10,10, 0, 7, 7, 0, 7,
134.1067 +	 7, 0, 7, 7, 0, 8, 8, 0, 8, 8, 0, 8, 8, 0, 9, 9,
134.1068 +	 0, 8, 8, 0, 8, 8, 0, 7, 7, 0, 8, 8, 0, 8, 8, 0,
134.1069 +	10,10, 0, 9, 9, 0, 9, 9, 0,10,10, 0, 9, 9, 0,10,
134.1070 +	10, 0, 8, 8, 0,11,11, 0,11,11, 0,12,12, 0,11,11,
134.1071 +	 0,12,12, 0,12,12, 0,12,12, 0,12,12, 0, 8, 8, 0,
134.1072 +	11,11, 0,11,11, 0,13,12, 0,12,12, 0,13,12, 0,13,
134.1073 +	13, 0,12,12, 0,13,13, 0, 7, 7, 0, 0, 0, 0, 0, 0,
134.1074 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1075 +	 0, 0, 0, 8, 8, 0,11,11, 0,11,11, 0,13,12, 0,12,
134.1076 +	12, 0,12,12, 0,12,12, 0,11,11, 0,12,12, 0, 8, 8,
134.1077 +	 0,12,12, 0,12,12, 0,13,13, 0,12,12, 0,13,13, 0,
134.1078 +	13,13, 0,12,13, 0,13,13, 0, 7, 7, 0, 0, 0, 0, 0,
134.1079 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1080 +	 0, 0, 0,
134.1081 +};
134.1082 +
134.1083 +static const static_codebook _44p1_p2_1 = {
134.1084 +	5, 243,
134.1085 +	(long *)_vq_lengthlist__44p1_p2_1,
134.1086 +	1, -535822336, 1611661312, 2, 0,
134.1087 +	(long *)_vq_quantlist__44p1_p2_1,
134.1088 +	0
134.1089 +};
134.1090 +
134.1091 +static const long _vq_quantlist__44p1_p3_0[] = {
134.1092 +	1,
134.1093 +	0,
134.1094 +	2,
134.1095 +};
134.1096 +
134.1097 +static const long _vq_lengthlist__44p1_p3_0[] = {
134.1098 +	 1, 6, 6, 6, 7, 7, 7, 8, 8, 7, 8, 8,10,11,11, 9,
134.1099 +	 8, 8, 7, 9, 9,11,12,12, 9, 8, 8, 6, 7, 7, 9,11,
134.1100 +	11,10,11,11,10,11,11,13,13,13,11,12,12,10,11,11,
134.1101 +	13,14,14,12,12,12, 6, 6, 6, 8, 6, 6, 8, 6, 6, 9,
134.1102 +	 7, 7,12,10,10,10, 6, 6, 9, 7, 7,12,10,10,11, 7,
134.1103 +	 6, 7, 8, 8,12,10,10,12,10,10,11,10,10,15,13,13,
134.1104 +	13,10,10,12,11,11,15,13,13,14,11,11, 8, 7, 7,12,
134.1105 +	11,11,12,11,11,11,11,11,14,14,14,13,12,12,12,11,
134.1106 +	11,16,15,15,14,12,12, 0,10,10, 0,11,11, 0,12,12,
134.1107 +	 0,11,11, 0,14,14, 0,11,11, 0,11,11, 0,15,15, 0,
134.1108 +	11,11, 7, 8, 8,13,10,10,12,10,10,12,11,11,15,13,
134.1109 +	13,14,11,11,12,10,10,16,14,14,14,10,10, 8, 7, 7,
134.1110 +	12,11,11,13,11,11,12,11,11,15,14,14,14,12,12,13,
134.1111 +	12,12,15,14,14,15,12,12, 0,11,11, 0,12,12, 0,12,
134.1112 +	12, 0,12,12, 0,15,15, 0,12,12, 0,12,12, 0,15,14,
134.1113 +	 0,12,12,
134.1114 +};
134.1115 +
134.1116 +static const static_codebook _44p1_p3_0 = {
134.1117 +	5, 243,
134.1118 +	(long *)_vq_lengthlist__44p1_p3_0,
134.1119 +	1, -531365888, 1616117760, 2, 0,
134.1120 +	(long *)_vq_quantlist__44p1_p3_0,
134.1121 +	0
134.1122 +};
134.1123 +
134.1124 +static const long _vq_quantlist__44p1_p3_1[] = {
134.1125 +	2,
134.1126 +	1,
134.1127 +	3,
134.1128 +	0,
134.1129 +	4,
134.1130 +};
134.1131 +
134.1132 +static const long _vq_lengthlist__44p1_p3_1[] = {
134.1133 +	 2, 3, 4, 7, 7,10,12,12,12,12,10,11,11,13,13,11,
134.1134 +	12,12,11,11,12,12,12,12,12,11,13,13,13,13,12,12,
134.1135 +	12,13,14,12,13,13,13,13,12,13,13,13,13,12,13,13,
134.1136 +	13,13,11,13,13,13,13,12,12,12,14,14,12,13,13,12,
134.1137 +	12,12,12,13,13,13,12,13,13,13,13,12,13,13,13,13,
134.1138 +	12,12,12,14,14,12,13,13,12,12,12,13,13,13,13,12,
134.1139 +	13,13,12,12,12,13,13,13,13,12,12,12,14,14,12,13,
134.1140 +	13,12,12,12,13,13,13,13,12,13,13,12,12,10,10,11,
134.1141 +	10,10,11,11,11,11,11,11, 9, 9,10,10,12,11,11,10,
134.1142 +	10,12,10,10,10,10,13,12,12,12,12,13,11,11,11,11,
134.1143 +	13,12,12,12,12,13,11,11,11,11,13,12,12,12,12,13,
134.1144 +	12,12,12,12,13,11,11,11,11,13,12,12,12,12,13,11,
134.1145 +	11,11,11,13,12,12,11,11,13,12,12,11,11,13,11,11,
134.1146 +	11,11,13,12,12,11,11,13,11,11,11,11,13,12,12,11,
134.1147 +	11,13,12,12,11,11,13,11,11,11,11,13,12,12,11,11,
134.1148 +	13,11,11,11,11,13,12,12,11,11,11,11,11,10,10,11,
134.1149 +	11,11, 9, 9,11,12,12,11,11,12,12,12, 9, 9,13,13,
134.1150 +	13,10,10,13,13,13,11,11,13,13,13,14,14,13,13,13,
134.1151 +	11,10,13,13,14,12,12,13,13,13,11,11,13,13,13,11,
134.1152 +	11,13,13,13,14,14,13,13,13,10,10,13,13,13,11,11,
134.1153 +	13,13,13,10,10,13,14,13,11,11,13,14,14,14,14,13,
134.1154 +	13,13,10,10,13,14,14,11,11,13,13,13,10,10,13,14,
134.1155 +	14,11,11,13,13,13,14,14,14,13,13,10,10,13,14,14,
134.1156 +	11,11,13,13,13,10,10,14,12,12, 9, 9,14,12,12, 9,
134.1157 +	 9,14,11,11, 9, 9,14,12,12, 8, 8,14,11,11, 7, 7,
134.1158 +	15,13,13,10,10,15,12,12,10,10,15,13,13,10,10,15,
134.1159 +	12,12,10,10,15,13,13,10,10,15,13,13,10,10,15,12,
134.1160 +	12,10,10,15,13,13,10,10,15,12,12,10,10,15,13,13,
134.1161 +	10,10,15,13,13,10,10,15,12,12,10,10,15,13,13, 9,
134.1162 +	 9,15,12,12, 9, 9,14,13,13, 9, 9,15,13,13,10,10,
134.1163 +	15,12,12,10,10,15,13,13, 9, 9,15,12,12, 9, 9,15,
134.1164 +	13,13, 9, 9,13,12,12, 9, 9,13,13,13, 8, 8,13,13,
134.1165 +	13, 9, 9,13,13,13, 7, 7,14,13,13, 8, 8,14,14,14,
134.1166 +	10,10,15,14,14,11,11,14,14,14, 9, 9,15,14,14,10,
134.1167 +	10,15,14,14, 9, 9,14,14,14,10,10,15,14,14,11,11,
134.1168 +	15,14,14, 9, 9,14,14,14,10,10,14,14,14, 9, 9,15,
134.1169 +	14,15,10,10,15,14,14,11,11,14,14,14, 9, 9,14,14,
134.1170 +	14, 9, 9,14,14,14, 8, 8,15,14,14,10,10,15,14,14,
134.1171 +	11,11,14,14,14, 9, 9,15,14,14, 9, 9,14,14,14, 8,
134.1172 +	 8,12,12,12,13,13,16,16,16,11,11,17,16,16,12,12,
134.1173 +	17,16,16,11,11,17,16,16,11,11,17,17,16,13,13,17,
134.1174 +	16,16,13,13,18,17,16,12,12,17,16,16,13,13,17,16,
134.1175 +	17,12,12,18,17,17,13,13,17,16,16,14,14,18,17,17,
134.1176 +	12,12,18,16,16,13,13,17,17,17,13,12,17,17,17,13,
134.1177 +	13,17,16,16,13,13,18,17,17,12,12,17,16,16,13,12,
134.1178 +	17,17,17,12,12,18,17,17,13,13,18,16,16,14,14,18,
134.1179 +	17,17,12,12,17,17,17,13,13,18,17,18,12,12,13,14,
134.1180 +	14,10,10,16,14,14,13,13,17,15,15,14,14,17,14,14,
134.1181 +	12,13,16,14,14,13,13,17,15,15,14,14,16,16,16,15,
134.1182 +	15,17,15,15,14,14,17,16,16,14,15,17,15,15,14,14,
134.1183 +	17,15,16,14,14,17,16,16,15,15,17,15,15,13,13,17,
134.1184 +	15,15,14,14,18,15,15,13,14,17,15,15,14,14,16,16,
134.1185 +	16,15,15,17,15,15,13,13,17,15,15,14,14,17,15,15,
134.1186 +	13,13,17,15,15,14,14,16,16,16,15,15,17,15,15,13,
134.1187 +	13,17,15,15,14,14,18,15,15,13,13,13,11,11,10,10,
134.1188 +	16,14,14,13,12,16,14,14,13,13,16,15,14,12,12,16,
134.1189 +	14,14,12,12,16,15,15,14,14,16,14,14,14,14,17,15,
134.1190 +	15,13,13,16,15,15,14,14,17,15,15,13,14,17,15,15,
134.1191 +	14,14,17,15,14,14,14,17,15,15,13,13,17,15,15,14,
134.1192 +	14,17,15,15,13,13,17,15,15,14,14,17,14,14,14,14,
134.1193 +	17,15,15,13,13,17,15,15,13,13,17,15,15,13,13,17,
134.1194 +	15,15,14,14,17,15,15,14,14,17,15,15,13,13,17,15,
134.1195 +	15,13,13,17,15,15,13,13,14,14,15, 8, 8,14,14,14,
134.1196 +	19,19,14,15,15,18,19,14,14,14,19,18,14,14,14,19,
134.1197 +	19,15,15,15,19,18,15,16,16,19,19,15,15,15,19,19,
134.1198 +	15,16,16,20,19,15,15,15,19,19,15,15,15,19,19,16,
134.1199 +	16,16,20,19,15,15,15,19,18,15,16,16,20,19,15,15,
134.1200 +	15,18,18,15,15,15,19,20,15,16,16,19,19,15,15,15,
134.1201 +	20,19,15,15,15,20,19,15,15,15,19,18,15,15,15,19,
134.1202 +	19,15,16,16,19,20,15,15,15,19,19,15,15,15,19,20,
134.1203 +	15,15,15,19,19,14,12,12, 9, 9,14,14,14,19,19,14,
134.1204 +	14,14,19,19,14,14,15,20,19,15,14,14,18,19,15,15,
134.1205 +	15,19,19,15,15,14,20,19,15,15,15,20,19,15,15,14,
134.1206 +	20,19,15,15,15,20,19,15,15,15,19,20,15,14,14,19,
134.1207 +	20,15,15,15,20,20,15,14,14,20,19,15,15,15,19,19,
134.1208 +	15,15,15,19,19,15,14,14,19,19,15,15,15,19,20,15,
134.1209 +	15,15,20,20,15,15,15,19,19,15,15,15,20,19,16,14,
134.1210 +	14,19,19,15,15,15,20,19,15,14,15,20,19,14,15,15,
134.1211 +	20,19,12,12,12,13,13,16,16,16,11,11,16,16,16,12,
134.1212 +	12,17,16,16,11,11,17,15,16,11,11,17,17,17,13,13,
134.1213 +	18,16,17,13,13,18,17,17,13,12,17,16,17,13,13,17,
134.1214 +	17,17,13,13,16,16,16,12,12,17,16,16,13,13,17,16,
134.1215 +	16,12,12,17,16,16,12,13,17,17,17,12,12,17,17,17,
134.1216 +	13,13,18,16,16,13,13,18,17,17,12,12,18,17,17,12,
134.1217 +	12,17,17,17,12,12,17,17,17,12,12,17,16,16,13,13,
134.1218 +	17,17,17,12,12,17,16,16,12,12,17,17,17,12,12,13,
134.1219 +	14,14, 9, 9,16,14,14,13,13,16,15,15,14,14,17,14,
134.1220 +	14,13,13,16,14,14,13,13,17,15,15,15,15,16,16,16,
134.1221 +	15,15,17,15,15,14,14,17,15,15,15,15,17,15,15,14,
134.1222 +	14,17,15,15,14,14,16,16,16,15,15,17,15,15,14,14,
134.1223 +	17,15,15,14,14,17,15,15,14,14,17,15,15,14,14,16,
134.1224 +	16,16,15,15,18,15,15,14,13,17,15,15,14,14,17,15,
134.1225 +	15,13,13,17,15,15,14,14,16,16,16,15,15,17,15,15,
134.1226 +	14,13,17,15,15,14,14,17,15,15,13,13,13,11,11,11,
134.1227 +	11,16,14,14,12,12,16,14,14,13,13,16,15,14,12,12,
134.1228 +	17,14,14,12,12,17,15,15,13,13,17,14,14,14,14,17,
134.1229 +	15,15,13,13,17,14,15,14,13,17,15,15,13,13,16,15,
134.1230 +	15,13,13,16,14,14,14,14,17,15,15,13,13,16,14,14,
134.1231 +	13,13,16,15,15,13,13,17,15,15,13,13,17,14,14,14,
134.1232 +	14,17,15,15,12,12,17,15,15,13,13,17,15,15,12,12,
134.1233 +	16,15,15,13,13,17,14,14,13,14,17,15,15,12,12,17,
134.1234 +	14,14,13,13,17,15,15,12,12,14,14,14, 8, 8,14,14,
134.1235 +	14,18,18,14,15,15,19,19,14,14,14,19,19,14,15,14,
134.1236 +	18,19,15,15,15,18,19,15,16,16,20,20,15,15,15,19,
134.1237 +	20,15,16,16,19,20,15,15,15,19,20,15,15,16,19,19,
134.1238 +	15,16,16,20,20,15,15,15,20,19,15,16,16,20,19,15,
134.1239 +	15,15,19,20,15,15,15,19,19,15,16,16,20,19,15,15,
134.1240 +	15,19,19,15,16,15,20,19,15,15,15,19,19,15,15,15,
134.1241 +	19,20,15,16,16,20,20,15,15,15,19,19,15,15,15,20,
134.1242 +	20,15,15,15,19,19,14,12,12, 9, 9,14,14,14,18,18,
134.1243 +	14,14,14,19,20,14,14,14,18,18,14,14,14,18,19,15,
134.1244 +	15,15,19,20,15,14,14,19,19,15,15,15,19,19,15,14,
134.1245 +	15,19,19,15,15,15,18,20,15,15,15,19,19,15,14,14,
134.1246 +	19,19,15,15,15,20,19,15,15,14,20,20,15,15,15,19,
134.1247 +	19,15,15,15,19,19,15,14,14,19,19,15,15,15,19,19,
134.1248 +	15,14,14,19,20,14,15,15,19,19,15,15,15,19,19,15,
134.1249 +	14,14,20,19,15,15,15,19,19,15,14,14,20,19,15,15,
134.1250 +	15,19,19,13,12,12,13,13,17,17,16,11,11,16,16,16,
134.1251 +	12,12,17,17,16,11,11,17,16,16,11,11,17,17,17,13,
134.1252 +	13,17,16,16,13,13,18,17,17,12,12,17,16,16,13,13,
134.1253 +	18,17,17,12,12,18,17,17,13,13,18,16,17,13,13,17,
134.1254 +	17,17,12,12,18,17,17,13,13,18,17,17,12,12,17,16,
134.1255 +	17,12,12,17,16,16,13,13,17,16,16,11,11,17,16,16,
134.1256 +	12,12,17,17,17,11,11,17,17,17,12,12,18,16,16,13,
134.1257 +	13,18,17,17,12,11,17,16,16,12,12,18,17,17,11,11,
134.1258 +	13,14,14, 9, 9,16,14,14,13,13,16,15,15,14,14,17,
134.1259 +	14,14,12,12,16,14,14,13,13,17,15,15,14,14,17,16,
134.1260 +	16,15,16,18,15,15,14,14,17,15,15,14,14,17,15,15,
134.1261 +	14,14,18,15,15,14,14,16,16,16,15,16,18,15,15,14,
134.1262 +	14,17,16,15,14,14,18,15,15,14,14,17,15,15,14,14,
134.1263 +	17,16,16,15,15,18,14,15,13,13,17,15,15,14,14,18,
134.1264 +	15,15,13,13,17,15,15,14,14,17,16,15,15,15,17,15,
134.1265 +	15,13,13,17,15,15,14,14,18,15,15,13,13,13,11,11,
134.1266 +	10,10,16,14,14,12,12,16,14,14,12,12,17,14,15,11,
134.1267 +	11,17,14,14,11,11,17,15,15,13,13,17,14,14,14,13,
134.1268 +	17,15,15,13,13,16,15,15,13,13,17,15,15,13,13,17,
134.1269 +	15,15,13,13,17,14,14,14,14,17,15,15,13,13,17,14,
134.1270 +	15,13,13,16,15,15,13,13,17,15,15,13,13,17,14,14,
134.1271 +	13,13,17,15,15,12,12,16,14,14,12,12,17,15,15,12,
134.1272 +	12,17,15,15,13,13,17,14,14,13,13,17,15,15,12,12,
134.1273 +	17,14,14,12,12,17,15,15,12,12,13,15,14, 8, 8,14,
134.1274 +	14,14,19,19,14,15,15,18,19,14,14,14,18,19,14,15,
134.1275 +	14,19,19,15,16,15,19,19,15,16,16,19,20,15,15,15,
134.1276 +	19,19,15,16,16,19,19,15,16,16,19,19,15,15,15,19,
134.1277 +	19,15,16,16,20,20,15,15,15,19,19,15,15,15,19,19,
134.1278 +	15,15,15,19,19,15,15,15,19,19,15,16,16,20,19,15,
134.1279 +	15,15,19,19,15,15,15,19,19,15,15,15,19,19,15,16,
134.1280 +	15,19,19,15,16,16,21,19,15,15,15,20,20,15,15,15,
134.1281 +	20,21,15,15,15,19,20,14,12,12, 8, 8,14,14,14,19,
134.1282 +	19,14,13,13,19,19,14,14,14,19,19,14,13,14,19,19,
134.1283 +	15,15,15,20,20,15,14,14,20,19,15,15,15,19,20,15,
134.1284 +	14,14,19,20,15,15,15,20,19,15,15,15,19,20,15,14,
134.1285 +	14,20,20,15,15,15,20,19,15,14,14,19,19,15,15,15,
134.1286 +	19,19,15,15,15,20,19,15,14,14,21,19,15,15,15,20,
134.1287 +	21,15,14,14,21,19,15,15,15,19,19,15,15,15,20,20,
134.1288 +	15,14,14,19,21,15,15,15,19,19,15,14,14,19,20,15,
134.1289 +	15,15,19,19,13,12,12,13,13,17,16,16,11,11,17,16,
134.1290 +	15,12,12,18,16,16,11,11,17,16,16,11,11,18,17,17,
134.1291 +	13,13,18,16,16,13,13,17,17,17,12,13,18,17,16,13,
134.1292 +	13,18,17,17,13,13,17,17,17,13,13,17,16,16,13,13,
134.1293 +	18,16,17,12,12,17,16,16,13,12,17,17,17,12,12,18,
134.1294 +	17,17,13,12,18,16,16,13,13,18,17,17,12,12,17,16,
134.1295 +	16,12,12,17,17,17,11,11,17,16,16,12,12,17,16,16,
134.1296 +	13,13,17,16,16,11,11,17,16,16,12,12,17,17,17,11,
134.1297 +	11,13,14,14, 9, 9,16,14,14,13,13,16,15,15,14,14,
134.1298 +	17,14,14,12,12,16,14,14,13,13,17,15,15,14,14,17,
134.1299 +	15,16,15,15,17,15,15,14,14,17,15,16,14,15,18,15,
134.1300 +	15,14,14,17,15,15,14,14,16,16,16,15,15,18,15,15,
134.1301 +	13,14,17,15,15,14,14,18,15,15,14,14,17,15,15,14,
134.1302 +	14,17,16,16,15,15,17,15,15,13,13,17,15,15,14,14,
134.1303 +	18,15,15,13,13,17,15,15,14,14,17,16,16,15,15,17,
134.1304 +	15,15,13,13,17,15,15,14,14,18,15,15,13,13,13,11,
134.1305 +	11,10,10,16,14,14,12,12,16,14,14,13,13,17,14,14,
134.1306 +	11,11,17,14,14,12,12,17,15,15,14,14,17,14,14,14,
134.1307 +	14,17,15,15,13,13,17,15,14,13,13,16,15,15,13,13,
134.1308 +	16,15,15,13,13,17,14,14,14,14,17,15,15,13,13,17,
134.1309 +	14,14,13,13,16,15,15,13,13,16,15,15,13,13,17,14,
134.1310 +	14,13,13,17,15,15,12,12,17,14,14,12,12,16,15,15,
134.1311 +	12,12,17,15,15,13,13,17,14,14,13,13,17,15,15,12,
134.1312 +	12,17,14,14,12,12,16,15,15,12,12,14,14,14, 8, 8,
134.1313 +	14,14,14,18,18,14,15,15,19,18,14,14,14,18,18,14,
134.1314 +	14,14,18,19,15,16,15,19,19,15,17,16,20,20,15,15,
134.1315 +	15,19,19,15,16,16,19,19,15,15,15,19,19,15,16,15,
134.1316 +	18,19,15,16,16,20,20,15,15,15,19,19,15,16,16,19,
134.1317 +	20,15,15,15,19,19,15,15,16,19,19,15,16,16,20,20,
134.1318 +	15,15,15,19,19,15,15,15,19,20,15,15,15,19,19,15,
134.1319 +	15,15,19,19,15,16,16,20,20,15,15,15,19,20,15,16,
134.1320 +	16,20,20,15,15,15,19,19,13,12,12, 8, 8,14,14,14,
134.1321 +	19,20,14,14,14,19,19,14,14,14,18,19,14,14,14,19,
134.1322 +	20,15,15,15,19,20,15,14,14,21,20,15,15,15,20,20,
134.1323 +	15,15,14,19,19,15,15,15,19,19,15,15,15,19,19,15,
134.1324 +	14,14,19,20,15,15,15,19,20,15,14,14,19,19,15,15,
134.1325 +	15,19,19,15,15,15,19,19,16,14,14,19,19,15,15,15,
134.1326 +	20,20,15,14,14,21,19,15,15,15,19,19,15,15,15,19,
134.1327 +	20,16,14,14,19,20,15,15,15,19,19,15,14,14,19,19,
134.1328 +	15,15,15,20,19,
134.1329 +};
134.1330 +
134.1331 +static const static_codebook _44p1_p3_1 = {
134.1332 +	5, 3125,
134.1333 +	(long *)_vq_lengthlist__44p1_p3_1,
134.1334 +	1, -533725184, 1611661312, 3, 0,
134.1335 +	(long *)_vq_quantlist__44p1_p3_1,
134.1336 +	0
134.1337 +};
134.1338 +
134.1339 +static const long _vq_quantlist__44p1_p4_0[] = {
134.1340 +	2,
134.1341 +	1,
134.1342 +	3,
134.1343 +	0,
134.1344 +	4,
134.1345 +};
134.1346 +
134.1347 +static const long _vq_lengthlist__44p1_p4_0[] = {
134.1348 +	 2, 6, 6,14,14, 6, 7, 7,14,14, 7, 7, 7,14,14, 0,
134.1349 +	13,13,16,16, 0,13,13,15,14, 7, 8, 8,15,15, 9,10,
134.1350 +	10,16,16, 9, 8, 8,15,15, 0,13,13,17,16, 0,13,13,
134.1351 +	15,16, 8, 8, 8,15,15,12,11,11,16,16, 9, 8, 8,14,
134.1352 +	14, 0,13,13,17,18, 0,13,13,15,15, 0,14,14,16,16,
134.1353 +	 0, 0, 0,19,18, 0,12,12,16,15, 0,15,16, 0,20, 0,
134.1354 +	14,14,16,16, 0,14,14,17,17, 0, 0, 0,19,18, 0,12,
134.1355 +	12,15,15, 0,17,17, 0,20, 0,14,14,16,16, 5, 6, 7,
134.1356 +	12,12, 9, 9, 9,14,14,10,10,10,14,14, 0,21,21,18,
134.1357 +	17, 0,20,20,18,17, 9,10,10,14,14,12,12,12,16,16,
134.1358 +	12,10,10,14,14, 0,20,19,18,17, 0, 0,20,17,18,11,
134.1359 +	10,10,14,14,14,13,13,18,18,13,11,11,14,14, 0,20,
134.1360 +	20,17,18, 0,21,21,17,17, 0,21, 0,18,18, 0, 0, 0,
134.1361 +	 0, 0, 0,20,19,16,17, 0, 0, 0,19,19, 0, 0, 0,18,
134.1362 +	18, 0,21,21,18,18, 0, 0, 0, 0, 0, 0,20,20,16,17,
134.1363 +	 0, 0, 0,21,21, 0, 0, 0,18,19, 6, 6, 6,13,12, 8,
134.1364 +	 6, 6,11,11, 8, 6, 6,13,13, 0, 9, 9,11,11, 0,11,
134.1365 +	10,14,14, 9, 7, 7,13,13,11, 9, 9,13,13,10, 6, 6,
134.1366 +	13,13, 0,10,10,14,15, 0,10,10,13,13, 9, 7, 7,13,
134.1367 +	13,13,10, 9,13,13,10, 6, 6,13,13, 0,10,10,15,14,
134.1368 +	 0,10,10,13,13, 0,11,11,15,15, 0,19,20,17,17, 0,
134.1369 +	 9, 9,13,13, 0,13,13,20,20, 0,11,11,13,13, 0,11,
134.1370 +	11,15,15, 0,19,19,17,17, 0,10,10,13,13, 0,15,15,
134.1371 +	20,20, 0,12,12,13,13, 0,10,10,12,12, 0,11,11,15,
134.1372 +	15, 0,11,11,15,15, 0,15,15,20, 0, 0,16,16, 0,21,
134.1373 +	 0,11,11,15,15, 0,14,14,18,17, 0,11,11,15,15, 0,
134.1374 +	15,16,19,20, 0,16,16,21,21, 0,12,12,15,15, 0,15,
134.1375 +	14,18,18, 0,11,11,16,16, 0,15,15,21,21, 0,16,15,
134.1376 +	 0, 0, 0,16,16,21, 0, 0, 0, 0, 0, 0, 0,14,14,20,
134.1377 +	20, 0,18,18, 0, 0, 0,16,17,21, 0, 0,16,16,21,21,
134.1378 +	 0, 0, 0, 0, 0, 0,15,15,21,21, 0,20,19, 0,21, 0,
134.1379 +	17,17, 0, 0, 0,10,10,12,11, 0,10,10,10,11, 0,11,
134.1380 +	11,12,12, 0,11,11, 9, 9, 0,13,13,11,12, 0,11,11,
134.1381 +	12,12, 0,13,13,12,12, 0,10,10,12,12, 0,12,12,13,
134.1382 +	13, 0,12,12,12,12, 0,11,11,12,12, 0,13,13,12,12,
134.1383 +	 0,10,10,12,12, 0,13,13,14,14, 0,12,12,12,12, 0,
134.1384 +	14,14,14,13, 0,19,20,15,15, 0,12,11,12,12, 0,15,
134.1385 +	15,21,20, 0,13,13,11,11, 0,13,13,13,13, 0,19, 0,
134.1386 +	15,15, 0,12,12,12,12, 0,17,16,19, 0, 0,13,13,12,
134.1387 +	12, 7, 7, 7,16,16,11, 9, 9,15,15,12, 9, 9,16,16,
134.1388 +	 0,13,13,15,14, 0,14,14,17,16,10, 9, 9,16,16,14,
134.1389 +	11,11,17,16,12, 9, 8,15,15, 0,13,13,18,18, 0,13,
134.1390 +	13,15,15,12,10,10,18,17,15,12,12,17,17,14, 9, 9,
134.1391 +	16,16, 0,13,13,18,19, 0,14,13,17,16, 0,14,14,18,
134.1392 +	18, 0, 0, 0,20,21, 0,12,12,16,16, 0,16,16,20,21,
134.1393 +	 0,14,14,17,16, 0,14,14,18,19, 0, 0, 0,19,21, 0,
134.1394 +	13,13,17,17, 0,17,17, 0,21, 0,15,15,16,16, 8, 7,
134.1395 +	 7,14,14,11,10,10,15,15,12,10,10,15,15, 0,20,20,
134.1396 +	18,18, 0, 0, 0,17,17,11,10,10,16,16,14,12,12,18,
134.1397 +	17,14,11,11,15,15, 0,20,21,18,18, 0, 0,19,18,17,
134.1398 +	12,10,10,16,16,17,14,14,19,19,14,11,11,15,15, 0,
134.1399 +	21,21,19,19, 0,21,20,19,18, 0,21, 0,18,19, 0, 0,
134.1400 +	 0, 0, 0, 0,20,20,18,17, 0,21, 0, 0, 0, 0, 0, 0,
134.1401 +	19,18, 0, 0, 0,18,19, 0, 0, 0, 0, 0, 0, 0,21,17,
134.1402 +	18, 0, 0, 0, 0,21, 0, 0,21,18,19,11, 9, 9,14,14,
134.1403 +	13,10,10,13,13,13,11,11,15,15, 0,13,13,12,12, 0,
134.1404 +	15,15,16,16,13,10,10,15,15,16,12,12,15,15,15,10,
134.1405 +	10,15,15, 0,14,13,16,15, 0,14,13,15,15,13,10,10,
134.1406 +	15,15,18,14,14,15,15,15,10,10,14,15, 0,14,14,16,
134.1407 +	16, 0,14,14,16,15, 0,15,15,17,16, 0,21, 0,18,18,
134.1408 +	 0,12,13,15,15, 0,16,16, 0, 0, 0,14,14,15,15, 0,
134.1409 +	15,15,16,16, 0,21,20,18,18, 0,13,13,15,15, 0,19,
134.1410 +	18, 0, 0, 0,15,15,15,15, 0,11,11,13,13, 0,12,12,
134.1411 +	16,16, 0,12,12,16,16, 0,15,16,20, 0, 0,16,17, 0,
134.1412 +	 0, 0,12,12,16,16, 0,14,14,18,18, 0,11,11,16,17,
134.1413 +	 0,15,15,20, 0, 0,16,16, 0, 0, 0,12,12,16,16, 0,
134.1414 +	15,15,19,19, 0,11,11,17,17, 0,16,16,21, 0, 0,16,
134.1415 +	16, 0, 0, 0,17,17,20,20, 0, 0, 0, 0, 0, 0,15,15,
134.1416 +	20, 0, 0,17,18, 0, 0, 0,17,17, 0, 0, 0,16,16, 0,
134.1417 +	21, 0, 0, 0, 0, 0, 0,15,15,21, 0, 0,19,18, 0, 0,
134.1418 +	 0,18,17, 0, 0, 0,11,11,14,14, 0,11,11,15,15, 0,
134.1419 +	12,12,16,16, 0,13,13,14,14, 0,14,14,17,17, 0,12,
134.1420 +	12,16,16, 0,14,14,16,16, 0,11,11,16,15, 0,13,13,
134.1421 +	16,17, 0,13,13,16,16, 0,12,12,15,16, 0,15,14,16,
134.1422 +	16, 0,11,11,15,15, 0,14,14,17,17, 0,13,13,16,16,
134.1423 +	 0,15,14,18,18, 0,21, 0,19,19, 0,13,13,15,15, 0,
134.1424 +	16,16,20,20, 0,14,14,16,15, 0,14,14,17,17, 0,21,
134.1425 +	 0,20,18, 0,13,13,15,15, 0,17,17, 0, 0, 0,14,14,
134.1426 +	16,15, 8, 8, 8,16,16,12, 9, 9,16,16,13, 9, 9,16,
134.1427 +	16, 0,14,14,18,17, 0,14,14,16,17,12,10,10,18,17,
134.1428 +	14,11,11,18,18,14, 9, 9,16,16, 0,13,13,18,18, 0,
134.1429 +	13,13,17,16,12, 9, 9,16,17,17,13,13,16,16,14, 9,
134.1430 +	 9,15,15, 0,14,14,20,20, 0,13,13,15,15, 0,15,14,
134.1431 +	18,18, 0, 0, 0,20,21, 0,12,13,16,17, 0,16,16,20,
134.1432 +	21, 0,14,14,16,17, 0,14,14,18,17, 0, 0, 0,20,21,
134.1433 +	 0,13,13,16,16, 0,19,17, 0,21, 0,14,15,16,16, 8,
134.1434 +	 7, 7,14,13,12,10,10,15,15,13,10,10,15,15, 0,21,
134.1435 +	21,18,19, 0,20,21,18,18,12,10,10,16,15,15,12,12,
134.1436 +	17,17,14,11,11,15,15, 0,21,21,19,18, 0, 0,21,17,
134.1437 +	18,13,11,11,15,15,16,13,13,18,19,15,11,11,15,14,
134.1438 +	 0,21, 0,19,19, 0, 0,21,18,18, 0, 0,21,19,19, 0,
134.1439 +	 0, 0, 0, 0, 0,20,19,17,17, 0, 0, 0,21, 0, 0,21,
134.1440 +	 0,18,19, 0, 0,20,20,19, 0, 0, 0, 0, 0, 0,21,20,
134.1441 +	18,17, 0, 0, 0, 0,20, 0, 0, 0,18,19, 0,10,10,15,
134.1442 +	14, 0,11,11,14,14, 0,11,11,15,16, 0,14,14,15,15,
134.1443 +	 0,15,15,16,16, 0,11,11,16,16, 0,14,13,16,16, 0,
134.1444 +	11,11,15,15, 0,14,14,16,16, 0,14,14,15,15, 0,11,
134.1445 +	11,15,15, 0,13,13,15,15, 0,11,11,15,15, 0,15,15,
134.1446 +	18,17, 0,14,14,15,15, 0,15,16,18,18, 0, 0, 0,20,
134.1447 +	20, 0,14,13,16,15, 0,17,17,21, 0, 0,15,15,15,15,
134.1448 +	 0,16,15,17,17, 0, 0, 0,19,19, 0,13,13,15,15, 0,
134.1449 +	20,19, 0, 0, 0,15,15,15,15, 0,11,11,13,13, 0,12,
134.1450 +	12,16,16, 0,12,12,16,16, 0,15,15,21,21, 0,17,16,
134.1451 +	 0, 0, 0,12,12,16,16, 0,14,14,17,17, 0,11,11,16,
134.1452 +	16, 0,15,15, 0, 0, 0,16,16,21, 0, 0,12,12,17,16,
134.1453 +	 0,14,15,20,20, 0,11,11,16,16, 0,15,15, 0,20, 0,
134.1454 +	16,16, 0,21, 0,16,17,21, 0, 0, 0, 0, 0, 0, 0,15,
134.1455 +	15, 0,21, 0,18,18, 0, 0, 0,17,16, 0, 0, 0,17,17,
134.1456 +	21, 0, 0, 0, 0, 0, 0, 0,15,15, 0,20, 0,19,20,21,
134.1457 +	 0, 0,17,18, 0, 0, 0,12,12,15,15, 0,12,12,15,15,
134.1458 +	 0,12,12,16,16, 0,13,13,15,15, 0,15,15,17,17, 0,
134.1459 +	13,12,17,16, 0,14,14,17,16, 0,11,11,16,16, 0,14,
134.1460 +	14,17,17, 0,14,14,17,17, 0,12,12,16,16, 0,15,15,
134.1461 +	17,17, 0,11,11,16,16, 0,14,14,17,17, 0,14,14,16,
134.1462 +	16, 0,15,15,18,17, 0, 0, 0,19, 0, 0,13,13,16,16,
134.1463 +	 0,16,16, 0,21, 0,14,14,16,16, 0,15,15,18,17, 0,
134.1464 +	 0, 0,19,19, 0,13,13,16,16, 0,18,17, 0,21, 0,14,
134.1465 +	15,16,16, 0,11,11,16,16, 0,13,13,17,17, 0,13,13,
134.1466 +	17,17, 0,16,16,16,17, 0,16,16,18,18, 0,12,12,17,
134.1467 +	17, 0,16,15,18,17, 0,12,12,16,16, 0,16,15,19,19,
134.1468 +	 0,16,15,17,17, 0,12,12,17,18, 0,16,16,18,18, 0,
134.1469 +	12,12,16,16, 0,16,16,19,19, 0,15,16,17,17, 0,15,
134.1470 +	16,18,18, 0, 0, 0,20,20, 0,13,13,16,16, 0,18,18,
134.1471 +	21,20, 0,15,15,16,16, 0,16,16,19,18, 0, 0, 0,19,
134.1472 +	20, 0,14,14,17,17, 0,19,19, 0,21, 0,15,16,16,16,
134.1473 +	 0, 9, 9,14,14, 0,13,13,15,15, 0,14,14,15,15, 0,
134.1474 +	 0,21,19,19, 0, 0,21,18,18, 0,12,12,15,15, 0,15,
134.1475 +	15,18,18, 0,14,13,15,15, 0,21,21,18,19, 0,21,20,
134.1476 +	18,18, 0,13,13,16,16, 0,17,17,18,19, 0,14,14,15,
134.1477 +	15, 0, 0,21,19,19, 0,21,20,18,19, 0,20,20,19,19,
134.1478 +	 0, 0, 0, 0, 0, 0,19,20,17,17, 0, 0, 0,21,21, 0,
134.1479 +	21, 0,18,20, 0,21, 0,18,21, 0, 0, 0, 0, 0, 0,21,
134.1480 +	21,19,18, 0, 0, 0, 0, 0, 0, 0, 0,19,19, 0,18,18,
134.1481 +	15,15, 0,18,20,17,16, 0,20, 0,17,17, 0,21, 0,17,
134.1482 +	17, 0,21,20,19,20, 0,19,19,16,16, 0,21,21,17,18,
134.1483 +	 0,19,19,17,17, 0,20,21,21,21, 0,20,20,18,18, 0,
134.1484 +	19,19,16,16, 0, 0,21,18,19, 0,18,19,16,17, 0,21,
134.1485 +	21,19,20, 0,21,19,18,18, 0,21,20,19,21, 0, 0, 0,
134.1486 +	20,21, 0,19,19,17,16, 0, 0, 0, 0, 0, 0,21,20,17,
134.1487 +	17, 0,20,21,19,18, 0, 0, 0, 0,21, 0,19,18,16,17,
134.1488 +	 0, 0, 0, 0, 0, 0,20,20,17,17, 0,11,11,14,14, 0,
134.1489 +	13,13,16,16, 0,13,13,16,16, 0,17,17,21, 0, 0,17,
134.1490 +	18, 0, 0, 0,12,12,16,16, 0,15,15,17,18, 0,12,12,
134.1491 +	16,16, 0,16,16, 0,20, 0,17,17, 0,21, 0,12,12,17,
134.1492 +	17, 0,16,16,19,20, 0,12,12,17,17, 0,17,17, 0,20,
134.1493 +	 0,17,17, 0, 0, 0,17,17,21, 0, 0, 0, 0, 0, 0, 0,
134.1494 +	15,15, 0,20, 0,19,19, 0, 0, 0,18,18, 0, 0, 0,17,
134.1495 +	17, 0, 0, 0, 0, 0, 0, 0, 0,15,15, 0, 0, 0,20,19,
134.1496 +	 0, 0, 0,19,18, 0, 0, 0,14,14,21,19, 0,16,16,20,
134.1497 +	21, 0,16,16,20,20, 0,17,17,20, 0, 0,17,17,20,20,
134.1498 +	 0,15,15,20,20, 0,19,18,20, 0, 0,15,15,20,20, 0,
134.1499 +	17,18,21,20, 0,17,17,20,21, 0,15,15,19,19, 0,19,
134.1500 +	18,21,21, 0,15,15,19,20, 0,17,18, 0, 0, 0,17,17,
134.1501 +	20,20, 0,17,18,20,21, 0, 0, 0, 0, 0, 0,15,15,20,
134.1502 +	20, 0,19,19, 0, 0, 0,17,17,19,21, 0,17,17, 0,21,
134.1503 +	 0, 0, 0, 0,21, 0,15,15,20,19, 0, 0,20, 0, 0, 0,
134.1504 +	17,17,21,20, 0,12,12,16,16, 0,14,14,17,17, 0,13,
134.1505 +	13,17,17, 0,16,16,17,18, 0,17,16,18,18, 0,13,13,
134.1506 +	18,17, 0,15,16,19,18, 0,13,13,16,16, 0,16,16,19,
134.1507 +	19, 0,16,16,17,17, 0,13,12,17,17, 0,16,16,18,17,
134.1508 +	 0,12,12,16,16, 0,17,17,19,18, 0,16,15,16,16, 0,
134.1509 +	16,17,18,19, 0, 0, 0,20,20, 0,14,14,17,16, 0,18,
134.1510 +	18,21, 0, 0,16,16,16,16, 0,16,16,18,17, 0, 0,21,
134.1511 +	21,21, 0,14,14,16,16, 0,21,20,21, 0, 0,16,16,16,
134.1512 +	16, 0,10,10,14,14, 0,14,14,15,16, 0,14,14,15,15,
134.1513 +	 0, 0,21,18,18, 0, 0,21,18,19, 0,13,13,16,16, 0,
134.1514 +	16,16,18,17, 0,14,14,15,15, 0,20, 0,18,18, 0,21,
134.1515 +	 0,18,17, 0,13,13,16,15, 0,17,17,19,19, 0,14,14,
134.1516 +	15,15, 0,20,20,18,19, 0, 0, 0,18,17, 0, 0,21,18,
134.1517 +	18, 0, 0, 0, 0, 0, 0,20,21,18,17, 0, 0, 0, 0, 0,
134.1518 +	 0, 0, 0,19,19, 0, 0,21,18,18, 0, 0, 0, 0, 0, 0,
134.1519 +	21, 0,18,17, 0, 0, 0, 0,21, 0, 0, 0,19,20, 0,19,
134.1520 +	19,16,16, 0, 0,21,18,17, 0,21, 0,18,18, 0,20, 0,
134.1521 +	19,18, 0,21,20,19,19, 0,21,19,17,18, 0, 0,21,19,
134.1522 +	19, 0,21,19,18,18, 0,21, 0,20,18, 0, 0,21,18,18,
134.1523 +	 0,20,21,17,17, 0,21, 0,18,18, 0,21,19,17,17, 0,
134.1524 +	21, 0, 0,20, 0, 0,20,17,18, 0, 0, 0,19,20, 0, 0,
134.1525 +	 0,20,19, 0,19,21,17,18, 0,21, 0, 0, 0, 0,21,21,
134.1526 +	18,17, 0, 0,21,18,18, 0, 0, 0, 0,21, 0,20,19,16,
134.1527 +	17, 0, 0, 0, 0, 0, 0,21,20,17,17, 0,11,11,13,13,
134.1528 +	 0,13,13,16,16, 0,13,13,16,16, 0,17,17, 0,21, 0,
134.1529 +	18,19,21, 0, 0,12,12,16,16, 0,15,15,19,18, 0,13,
134.1530 +	13,16,16, 0,16,17,21,19, 0,17,17,21,21, 0,13,13,
134.1531 +	16,16, 0,16,16,20,18, 0,13,13,16,16, 0,17,17, 0,
134.1532 +	 0, 0,18,18, 0, 0, 0,18,17, 0,20, 0, 0, 0, 0, 0,
134.1533 +	 0,15,15,21,21, 0,19,18, 0, 0, 0,17,17,21,21, 0,
134.1534 +	17,17, 0, 0, 0, 0, 0, 0, 0, 0,15,15,20,21, 0,20,
134.1535 +	20, 0, 0, 0,19,19, 0, 0, 0,14,15,21,19, 0,16,16,
134.1536 +	 0,21, 0,17,16,21,21, 0,17,18,21,20, 0,18,18, 0,
134.1537 +	21, 0,16,16, 0,20, 0,19,19, 0, 0, 0,16,15, 0,20,
134.1538 +	 0,18,18, 0, 0, 0,17,17, 0,21, 0,16,16,20,20, 0,
134.1539 +	20,19, 0, 0, 0,15,16,21,22, 0,18,18, 0, 0, 0,18,
134.1540 +	17, 0, 0, 0,18,18, 0, 0, 0, 0, 0, 0, 0, 0,16,16,
134.1541 +	21,20, 0,19,20, 0, 0, 0,18,17,21, 0, 0,17,18, 0,
134.1542 +	 0, 0, 0, 0, 0, 0, 0,16,16, 0,20, 0, 0,20, 0, 0,
134.1543 +	 0,18,18,22, 0,
134.1544 +};
134.1545 +
134.1546 +static const static_codebook _44p1_p4_0 = {
134.1547 +	5, 3125,
134.1548 +	(long *)_vq_lengthlist__44p1_p4_0,
134.1549 +	1, -528744448, 1616642048, 3, 0,
134.1550 +	(long *)_vq_quantlist__44p1_p4_0,
134.1551 +	0
134.1552 +};
134.1553 +
134.1554 +static const long _vq_quantlist__44p1_p4_1[] = {
134.1555 +	3,
134.1556 +	2,
134.1557 +	4,
134.1558 +	1,
134.1559 +	5,
134.1560 +	0,
134.1561 +	6,
134.1562 +};
134.1563 +
134.1564 +static const long _vq_lengthlist__44p1_p4_1[] = {
134.1565 +	 2, 3, 3, 3, 3, 3, 3,
134.1566 +};
134.1567 +
134.1568 +static const static_codebook _44p1_p4_1 = {
134.1569 +	1, 7,
134.1570 +	(long *)_vq_lengthlist__44p1_p4_1,
134.1571 +	1, -533200896, 1611661312, 3, 0,
134.1572 +	(long *)_vq_quantlist__44p1_p4_1,
134.1573 +	0
134.1574 +};
134.1575 +
134.1576 +static const long _vq_quantlist__44p1_p5_0[] = {
134.1577 +	1,
134.1578 +	0,
134.1579 +	2,
134.1580 +};
134.1581 +
134.1582 +static const long _vq_lengthlist__44p1_p5_0[] = {
134.1583 +	 1, 6, 6, 7, 8, 8, 7, 8, 8, 7, 9, 8,10,11,11, 9,
134.1584 +	 8, 8, 7, 8, 8,11,11,11, 9, 8, 8, 6, 7, 7,10,10,
134.1585 +	10,10,10,10,10,10,10,14,13,13,12,11,11,10,10,10,
134.1586 +	14,14,13,12,11,11, 6, 6, 6, 8, 5, 5, 8, 7, 7, 9,
134.1587 +	 7, 7,11,10,10, 9, 7, 7, 9, 7, 7,12,10,10,10, 7,
134.1588 +	 7, 7, 8, 8,12,11,10,12,10,10,11,10,10,15,13,13,
134.1589 +	13,10,10,11,10,10,17,14,13,13,10,10, 7, 7, 7,12,
134.1590 +	11,12,12,11,11,12,11,11,16,14,14,13,12,12,12,11,
134.1591 +	11,17,15,14,14,12,12,10, 9, 9,13,11,11,13,11,11,
134.1592 +	13,11,11,17,14,13,14,11,11,12,11,11,16,15,14,14,
134.1593 +	11,11, 7, 8, 8,12,11,11,12,10,10,12,10,10,15,13,
134.1594 +	13,14,11,10,12,10,10,16,14,14,14,10,10, 8, 7, 7,
134.1595 +	12,11,11,12,11,11,12,11,11,17,14,14,14,12,12,12,
134.1596 +	11,11,16,15,15,14,12,12,10,10,10,13,11,11,13,11,
134.1597 +	11,13,11,12,16,14,14,14,11,11,13,12,11,16,15,15,
134.1598 +	14,11,11,
134.1599 +};
134.1600 +
134.1601 +static const static_codebook _44p1_p5_0 = {
134.1602 +	5, 243,
134.1603 +	(long *)_vq_lengthlist__44p1_p5_0,
134.1604 +	1, -527106048, 1620377600, 2, 0,
134.1605 +	(long *)_vq_quantlist__44p1_p5_0,
134.1606 +	0
134.1607 +};
134.1608 +
134.1609 +static const long _vq_quantlist__44p1_p5_1[] = {
134.1610 +	1,
134.1611 +	0,
134.1612 +	2,
134.1613 +};
134.1614 +
134.1615 +static const long _vq_lengthlist__44p1_p5_1[] = {
134.1616 +	 2, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 9, 8, 8, 8,
134.1617 +	 7, 7, 8, 8, 8, 9, 8, 8, 9, 7, 7, 6, 6, 6, 9, 8,
134.1618 +	 7, 9, 7, 7, 9, 8, 8,10, 8, 8,10, 8, 8,10, 8, 8,
134.1619 +	10, 8, 8,10, 8, 8, 7, 6, 6, 9, 6, 6, 9, 7, 7, 9,
134.1620 +	 7, 7,10, 8, 8, 9, 6, 6, 9, 7, 7,10, 8, 8, 9, 7,
134.1621 +	 7, 7, 8, 8,11, 9, 9,11, 9, 9,11, 8, 9,12, 9, 9,
134.1622 +	12, 8, 8,11, 9, 9,12, 9, 9,12, 8, 8, 8, 7, 7,10,
134.1623 +	 9, 9,10,10, 9,10, 9, 9,11,10,10,11, 9, 9,11, 9,
134.1624 +	 9,11,10,11,11, 9, 9,10, 8, 8,11, 9, 9,10, 9, 9,
134.1625 +	11, 9, 9,11,10,10,11, 9, 9,11, 9, 9,11,10,10,11,
134.1626 +	 9, 9, 9, 8, 8,11, 9, 9,12, 9, 9,11, 9, 9,12, 9,
134.1627 +	 9,12, 8, 8,12, 9, 9,12, 9, 9,12, 8, 8, 9, 7, 7,
134.1628 +	11, 9, 9,11,10,10,11, 9, 9,11,11,11,11, 9, 9,11,
134.1629 +	10,10,11,11,11,11, 9, 9,10, 9, 9,11, 9, 9,11,10,
134.1630 +	10,11, 9, 9,11,10,10,11, 9, 9,11, 9,10,11,10,10,
134.1631 +	11, 9, 9,
134.1632 +};
134.1633 +
134.1634 +static const static_codebook _44p1_p5_1 = {
134.1635 +	5, 243,
134.1636 +	(long *)_vq_lengthlist__44p1_p5_1,
134.1637 +	1, -530841600, 1616642048, 2, 0,
134.1638 +	(long *)_vq_quantlist__44p1_p5_1,
134.1639 +	0
134.1640 +};
134.1641 +
134.1642 +static const long _vq_quantlist__44p1_p6_0[] = {
134.1643 +	1,
134.1644 +	0,
134.1645 +	2,
134.1646 +};
134.1647 +
134.1648 +static const long _vq_lengthlist__44p1_p6_0[] = {
134.1649 +	 1, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9,
134.1650 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 9, 9, 9, 9,
134.1651 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.1652 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.1653 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.1654 +	 9, 7, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.1655 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.1656 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.1657 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.1658 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.1659 +	 9, 9, 7, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.1660 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.1661 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.1662 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.1663 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.1664 +	 9, 9, 9,
134.1665 +};
134.1666 +
134.1667 +static const static_codebook _44p1_p6_0 = {
134.1668 +	5, 243,
134.1669 +	(long *)_vq_lengthlist__44p1_p6_0,
134.1670 +	1, -516716544, 1630767104, 2, 0,
134.1671 +	(long *)_vq_quantlist__44p1_p6_0,
134.1672 +	0
134.1673 +};
134.1674 +
134.1675 +static const long _vq_quantlist__44p1_p6_1[] = {
134.1676 +	12,
134.1677 +	11,
134.1678 +	13,
134.1679 +	10,
134.1680 +	14,
134.1681 +	9,
134.1682 +	15,
134.1683 +	8,
134.1684 +	16,
134.1685 +	7,
134.1686 +	17,
134.1687 +	6,
134.1688 +	18,
134.1689 +	5,
134.1690 +	19,
134.1691 +	4,
134.1692 +	20,
134.1693 +	3,
134.1694 +	21,
134.1695 +	2,
134.1696 +	22,
134.1697 +	1,
134.1698 +	23,
134.1699 +	0,
134.1700 +	24,
134.1701 +};
134.1702 +
134.1703 +static const long _vq_lengthlist__44p1_p6_1[] = {
134.1704 +	 1, 3, 2, 5, 4, 7, 7, 8, 8, 9, 9,10,10,11,11,12,
134.1705 +	12,13,13,13,14,16,16,16,16,
134.1706 +};
134.1707 +
134.1708 +static const static_codebook _44p1_p6_1 = {
134.1709 +	1, 25,
134.1710 +	(long *)_vq_lengthlist__44p1_p6_1,
134.1711 +	1, -518864896, 1620639744, 5, 0,
134.1712 +	(long *)_vq_quantlist__44p1_p6_1,
134.1713 +	0
134.1714 +};
134.1715 +
134.1716 +static const long _vq_quantlist__44p1_p6_2[] = {
134.1717 +	12,
134.1718 +	11,
134.1719 +	13,
134.1720 +	10,
134.1721 +	14,
134.1722 +	9,
134.1723 +	15,
134.1724 +	8,
134.1725 +	16,
134.1726 +	7,
134.1727 +	17,
134.1728 +	6,
134.1729 +	18,
134.1730 +	5,
134.1731 +	19,
134.1732 +	4,
134.1733 +	20,
134.1734 +	3,
134.1735 +	21,
134.1736 +	2,
134.1737 +	22,
134.1738 +	1,
134.1739 +	23,
134.1740 +	0,
134.1741 +	24,
134.1742 +};
134.1743 +
134.1744 +static const long _vq_lengthlist__44p1_p6_2[] = {
134.1745 +	 3, 4, 4, 5, 4, 5, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5,
134.1746 +	 5, 5, 5, 5, 5, 5, 5, 5, 5,
134.1747 +};
134.1748 +
134.1749 +static const static_codebook _44p1_p6_2 = {
134.1750 +	1, 25,
134.1751 +	(long *)_vq_lengthlist__44p1_p6_2,
134.1752 +	1, -529006592, 1611661312, 5, 0,
134.1753 +	(long *)_vq_quantlist__44p1_p6_2,
134.1754 +	0
134.1755 +};
134.1756 +
134.1757 +static const long _huff_lengthlist__44p1_short[] = {
134.1758 +	 4, 5, 7, 8,10,13,14, 4, 2, 4, 6, 8,11,12, 7, 4,
134.1759 +	 3, 5, 8,12,14, 8, 5, 4, 4, 8,12,12, 9, 7, 7, 7,
134.1760 +	 9,10,11,13,11,11, 9, 7, 8,10,13,11,10, 6, 5, 7,
134.1761 +	 9,
134.1762 +};
134.1763 +
134.1764 +static const static_codebook _huff_book__44p1_short = {
134.1765 +	2, 49,
134.1766 +	(long *)_huff_lengthlist__44p1_short,
134.1767 +	0, 0, 0, 0, 0,
134.1768 +	NULL,
134.1769 +	0
134.1770 +};
134.1771 +
134.1772 +static const long _vq_quantlist__44p2_l0_0[] = {
134.1773 +	6,
134.1774 +	5,
134.1775 +	7,
134.1776 +	4,
134.1777 +	8,
134.1778 +	3,
134.1779 +	9,
134.1780 +	2,
134.1781 +	10,
134.1782 +	1,
134.1783 +	11,
134.1784 +	0,
134.1785 +	12,
134.1786 +};
134.1787 +
134.1788 +static const long _vq_lengthlist__44p2_l0_0[] = {
134.1789 +	 1, 4, 4, 7, 7, 8, 8, 9, 9,10,10,11,11, 4, 6, 5,
134.1790 +	 8, 7, 9, 8,10, 9,11,10,11,11, 4, 5, 6, 7, 8, 8,
134.1791 +	 9, 9,10,10,10,10,11, 8, 9, 8,10, 8,10, 9,11,10,
134.1792 +	11,11,11,11, 8, 8, 9, 8,10, 9,10,10,11,11,11,11,
134.1793 +	11, 9,10,10,11,11,11,11,11,11,12,11,12,11, 9,10,
134.1794 +	10,10,11,11,11,11,11,11,12,11,12,10,11,11,12,11,
134.1795 +	12,12,12,12,12,12,12,12,10,11,11,11,11,12,12,12,
134.1796 +	13,12,12,12,12,11,12,12,12,12,13,13,12,12,12,12,
134.1797 +	12,12,11,12,12,12,12,13,13,12,13,12,12,12,12,12,
134.1798 +	13,13,13,13,13,13,12,13,12,13,12,12,12,13,13,13,
134.1799 +	13,13,13,13,12,13,12,12,12,
134.1800 +};
134.1801 +
134.1802 +static const static_codebook _44p2_l0_0 = {
134.1803 +	2, 169,
134.1804 +	(long *)_vq_lengthlist__44p2_l0_0,
134.1805 +	1, -526516224, 1616117760, 4, 0,
134.1806 +	(long *)_vq_quantlist__44p2_l0_0,
134.1807 +	0
134.1808 +};
134.1809 +
134.1810 +static const long _vq_quantlist__44p2_l0_1[] = {
134.1811 +	2,
134.1812 +	1,
134.1813 +	3,
134.1814 +	0,
134.1815 +	4,
134.1816 +};
134.1817 +
134.1818 +static const long _vq_lengthlist__44p2_l0_1[] = {
134.1819 +	 2, 4, 4, 5, 5, 4, 5, 5, 6, 5, 4, 5, 5, 5, 6, 5,
134.1820 +	 5, 6, 6, 6, 5, 6, 5, 6, 6,
134.1821 +};
134.1822 +
134.1823 +static const static_codebook _44p2_l0_1 = {
134.1824 +	2, 25,
134.1825 +	(long *)_vq_lengthlist__44p2_l0_1,
134.1826 +	1, -533725184, 1611661312, 3, 0,
134.1827 +	(long *)_vq_quantlist__44p2_l0_1,
134.1828 +	0
134.1829 +};
134.1830 +
134.1831 +static const long _vq_quantlist__44p2_l1_0[] = {
134.1832 +	1,
134.1833 +	0,
134.1834 +	2,
134.1835 +};
134.1836 +
134.1837 +static const long _vq_lengthlist__44p2_l1_0[] = {
134.1838 +	 1, 4, 4, 4, 4, 4, 4, 4, 4,
134.1839 +};
134.1840 +
134.1841 +static const static_codebook _44p2_l1_0 = {
134.1842 +	2, 9,
134.1843 +	(long *)_vq_lengthlist__44p2_l1_0,
134.1844 +	1, -516716544, 1630767104, 2, 0,
134.1845 +	(long *)_vq_quantlist__44p2_l1_0,
134.1846 +	0
134.1847 +};
134.1848 +
134.1849 +static const long _huff_lengthlist__44p2_lfe[] = {
134.1850 +	 1, 3, 2, 3,
134.1851 +};
134.1852 +
134.1853 +static const static_codebook _huff_book__44p2_lfe = {
134.1854 +	2, 4,
134.1855 +	(long *)_huff_lengthlist__44p2_lfe,
134.1856 +	0, 0, 0, 0, 0,
134.1857 +	NULL,
134.1858 +	0
134.1859 +};
134.1860 +
134.1861 +static const long _huff_lengthlist__44p2_long[] = {
134.1862 +	 3, 4, 9, 8, 8,10,13,16, 4, 2, 9, 5, 7,10,14,18,
134.1863 +	 9, 7, 6, 5, 7, 9,12,16, 7, 5, 5, 3, 5, 8,11,13,
134.1864 +	 8, 7, 7, 5, 5, 7, 9,11,10,10, 9, 8, 6, 6, 8,10,
134.1865 +	13,14,13,11, 9, 8, 9,10,17,18,16,14,11,10,10,10,
134.1866 +};
134.1867 +
134.1868 +static const static_codebook _huff_book__44p2_long = {
134.1869 +	2, 64,
134.1870 +	(long *)_huff_lengthlist__44p2_long,
134.1871 +	0, 0, 0, 0, 0,
134.1872 +	NULL,
134.1873 +	0
134.1874 +};
134.1875 +
134.1876 +static const long _vq_quantlist__44p2_p1_0[] = {
134.1877 +	1,
134.1878 +	0,
134.1879 +	2,
134.1880 +};
134.1881 +
134.1882 +static const long _vq_lengthlist__44p2_p1_0[] = {
134.1883 +	 1, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1884 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1885 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1886 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1887 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1888 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1889 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1890 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1891 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1892 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1893 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1894 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1895 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1896 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1897 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1898 +	 0, 0, 0,
134.1899 +};
134.1900 +
134.1901 +static const static_codebook _44p2_p1_0 = {
134.1902 +	5, 243,
134.1903 +	(long *)_vq_lengthlist__44p2_p1_0,
134.1904 +	1, -535822336, 1611661312, 2, 0,
134.1905 +	(long *)_vq_quantlist__44p2_p1_0,
134.1906 +	0
134.1907 +};
134.1908 +
134.1909 +static const long _vq_quantlist__44p2_p2_0[] = {
134.1910 +	2,
134.1911 +	1,
134.1912 +	3,
134.1913 +	0,
134.1914 +	4,
134.1915 +};
134.1916 +
134.1917 +static const long _vq_lengthlist__44p2_p2_0[] = {
134.1918 +	 1, 4, 4, 0, 0, 0, 8, 8, 0, 0, 0, 9, 9, 0, 0, 0,
134.1919 +	10,10, 0, 0, 0, 0, 0, 0, 0, 0,10,10, 0, 0, 0, 0,
134.1920 +	 0, 0, 0, 0, 9, 9, 0, 0, 0,11,11, 0, 0, 0, 0, 0,
134.1921 +	 0, 0, 0,10,10, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0,
134.1922 +	 0, 0,11,11, 0, 0, 0, 0, 0, 0, 0, 0,11,11, 0, 0,
134.1923 +	 0, 0, 0, 0, 0, 0,10,10, 0, 0, 0,11,11, 0, 0, 0,
134.1924 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1925 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7,
134.1926 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1927 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1928 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1929 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1930 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1931 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1932 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1933 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 0, 0, 0,
134.1934 +	 6, 6, 0, 0, 0, 7, 7, 0, 0, 0, 8, 8, 0, 0, 0, 0,
134.1935 +	 0, 0, 0, 0, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7,
134.1936 +	 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 0,
134.1937 +	 0, 0, 0, 0, 0, 0, 0, 7, 7, 0, 0, 0, 9, 9, 0, 0,
134.1938 +	 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0,
134.1939 +	 8, 8, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1940 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1941 +	 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 0, 0, 0, 8, 8, 0,
134.1942 +	 0, 0,10,10, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0,
134.1943 +	 0,10,10, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0,
134.1944 +	11,11, 0, 0, 0, 0, 0, 0, 0, 0,10,10, 0, 0, 0, 0,
134.1945 +	 0, 0, 0, 0, 9, 9, 0, 0, 0,11,10, 0, 0, 0, 0, 0,
134.1946 +	 0, 0, 0,11,11, 0, 0, 0, 0, 0, 0, 0, 0,10,10, 0,
134.1947 +	 0, 0,11,11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1948 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1949 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1950 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1951 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1952 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1953 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1954 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1955 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1956 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1957 +	 0, 0, 8, 8, 0, 0, 0,10,10, 0, 0, 0,11,11, 0, 0,
134.1958 +	 0,12,12, 0, 0, 0, 0, 0, 0, 0, 0,11,11, 0, 0, 0,
134.1959 +	 0, 0, 0, 0, 0,10,10, 0, 0, 0,13,13, 0, 0, 0, 0,
134.1960 +	 0, 0, 0, 0,13,13, 0, 0, 0, 0, 0, 0, 0, 0,12,12,
134.1961 +	 0, 0, 0,13,13, 0, 0, 0, 0, 0, 0, 0, 0,13,13, 0,
134.1962 +	 0, 0, 0, 0, 0, 0, 0,12,12, 0, 0, 0,13,13, 0, 0,
134.1963 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1964 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6,
134.1965 +	 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1966 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1967 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1968 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1969 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1970 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1971 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1972 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1973 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1974 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1975 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1976 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1977 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1978 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1979 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1980 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0,11,11,
134.1981 +	 0, 0, 0,12,12, 0, 0, 0,12,12, 0, 0, 0, 0, 0, 0,
134.1982 +	 0, 0,13,13, 0, 0, 0, 0, 0, 0, 0, 0,12,11, 0, 0,
134.1983 +	 0,12,12, 0, 0, 0, 0, 0, 0, 0, 0,13,13, 0, 0, 0,
134.1984 +	 0, 0, 0, 0, 0,12,12, 0, 0, 0,13,13, 0, 0, 0, 0,
134.1985 +	 0, 0, 0, 0,13,13, 0, 0, 0, 0, 0, 0, 0, 0,12,12,
134.1986 +	 0, 0, 0,13,13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1987 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1988 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1989 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1990 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1991 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1992 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1993 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1994 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1995 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.1996 +	 0, 0, 0, 8, 8, 0, 0, 0,10,10, 0, 0, 0,11,11, 0,
134.1997 +	 0, 0,12,12, 0, 0, 0, 0, 0, 0, 0, 0,13,13, 0, 0,
134.1998 +	 0, 0, 0, 0, 0, 0,12,12, 0, 0, 0,13,13, 0, 0, 0,
134.1999 +	 0, 0, 0, 0, 0,11,11, 0, 0, 0, 0, 0, 0, 0, 0,10,
134.2000 +	10, 0, 0, 0,13,13, 0, 0, 0, 0, 0, 0, 0, 0,14,13,
134.2001 +	 0, 0, 0, 0, 0, 0, 0, 0,13,12, 0, 0, 0,13,13, 0,
134.2002 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2003 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2004 +	 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2005 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2006 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2007 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2008 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2009 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2010 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2011 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2012 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2013 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2014 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2015 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2016 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2017 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2018 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2019 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0,11,
134.2020 +	11, 0, 0, 0,12,12, 0, 0, 0,12,12, 0, 0, 0, 0, 0,
134.2021 +	 0, 0, 0,12,12, 0, 0, 0, 0, 0, 0, 0, 0,12,12, 0,
134.2022 +	 0, 0,13,13, 0, 0, 0, 0, 0, 0, 0, 0,13,13, 0, 0,
134.2023 +	 0, 0, 0, 0, 0, 0,12,12, 0, 0, 0,12,12, 0, 0, 0,
134.2024 +	 0, 0, 0, 0, 0,13,13, 0, 0, 0, 0, 0, 0, 0, 0,12,
134.2025 +	12, 0, 0, 0,13,13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2026 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2027 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2028 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2029 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2030 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2031 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2032 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2033 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2034 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2035 +	 0, 0, 0, 0, 9, 9, 0, 0, 0,11,11, 0, 0, 0,12,12,
134.2036 +	 0, 0, 0,12,12, 0, 0, 0, 0, 0, 0, 0, 0,12,12, 0,
134.2037 +	 0, 0, 0, 0, 0, 0, 0,11,11, 0, 0, 0,14,14, 0, 0,
134.2038 +	 0, 0, 0, 0, 0, 0,13,13, 0, 0, 0, 0, 0, 0, 0, 0,
134.2039 +	12,12, 0, 0, 0,12,13, 0, 0, 0, 0, 0, 0, 0, 0,12,
134.2040 +	12, 0, 0, 0, 0, 0, 0, 0, 0,11,11, 0, 0, 0,14,13,
134.2041 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2042 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2043 +	 0, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2044 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2045 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2046 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2047 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2048 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2049 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2050 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2051 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2052 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2053 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2054 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2055 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2056 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2057 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2058 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0,
134.2059 +	11,11, 0, 0, 0,12,12, 0, 0, 0,13,13, 0, 0, 0, 0,
134.2060 +	 0, 0, 0, 0,13,13, 0, 0, 0, 0, 0, 0, 0, 0,12,12,
134.2061 +	 0, 0, 0,13,13, 0, 0, 0, 0, 0, 0, 0, 0,12,12, 0,
134.2062 +	 0, 0, 0, 0, 0, 0, 0,12,12, 0, 0, 0,14,14, 0, 0,
134.2063 +	 0, 0, 0, 0, 0, 0,14,14, 0, 0, 0, 0, 0, 0, 0, 0,
134.2064 +	12,12, 0, 0, 0,13,13, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2065 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2066 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2067 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2068 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2069 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2070 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2071 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2072 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2073 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2074 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2075 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2076 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2077 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2078 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2079 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2080 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2081 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2082 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2083 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2084 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2085 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2086 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2087 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2088 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2089 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2090 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2091 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2092 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2093 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2094 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2095 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2096 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2097 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2098 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2099 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2100 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2101 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2102 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2103 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2104 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2105 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2106 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2107 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2108 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2109 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2110 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2111 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2112 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2113 +	 0, 0, 0, 0, 0,
134.2114 +};
134.2115 +
134.2116 +static const static_codebook _44p2_p2_0 = {
134.2117 +	5, 3125,
134.2118 +	(long *)_vq_lengthlist__44p2_p2_0,
134.2119 +	1, -533725184, 1611661312, 3, 0,
134.2120 +	(long *)_vq_quantlist__44p2_p2_0,
134.2121 +	0
134.2122 +};
134.2123 +
134.2124 +static const long _vq_quantlist__44p2_p3_0[] = {
134.2125 +	1,
134.2126 +	0,
134.2127 +	2,
134.2128 +};
134.2129 +
134.2130 +static const long _vq_lengthlist__44p2_p3_0[] = {
134.2131 +	 1, 5, 5, 6, 7, 7, 0, 8, 8, 6, 9, 9, 8,11,11, 0,
134.2132 +	 8, 8, 0, 9, 9, 0,12,12, 0, 8, 8, 5, 7, 7, 7,10,
134.2133 +	10, 0,12,12, 8,11,11, 9,12,12, 0,11,12, 0,12,12,
134.2134 +	 0,15,15, 0,12,12, 0, 6, 6, 0, 6, 6, 0, 7, 7, 0,
134.2135 +	 7, 7, 0,10,10, 0, 7, 7, 0, 8, 8, 0,11,11, 0, 7,
134.2136 +	 7, 6, 7, 7,10, 9, 9, 0,11,10,10, 9, 9,12,12,12,
134.2137 +	 0,10,10, 0,11,11, 0,13,13, 0,11,11, 7, 6, 6,10,
134.2138 +	10,10, 0,11,11,11,11,11,12,12,12, 0,11,11, 0,12,
134.2139 +	12, 0,15,15, 0,11,11, 0,11,11, 0,11,11, 0,12,12,
134.2140 +	 0,12,12, 0,14,14, 0,12,12, 0,12,12, 0,15,15, 0,
134.2141 +	11,11, 0, 8, 8, 0,10,10, 0,11,11, 0,11,11, 0,12,
134.2142 +	12, 0,12,12, 0,11,11, 0,15,15, 0,11,11, 0, 6, 6,
134.2143 +	 0,10,10, 0,12,12, 0,10,10, 0,13,13, 0,12,12, 0,
134.2144 +	13,13, 0,14,14, 0,12,12, 0, 0, 0, 0, 0, 0, 0, 0,
134.2145 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.2146 +	 0, 0, 0,
134.2147 +};
134.2148 +
134.2149 +static const static_codebook _44p2_p3_0 = {
134.2150 +	5, 243,
134.2151 +	(long *)_vq_lengthlist__44p2_p3_0,
134.2152 +	1, -533200896, 1614282752, 2, 0,
134.2153 +	(long *)_vq_quantlist__44p2_p3_0,
134.2154 +	0
134.2155 +};
134.2156 +
134.2157 +static const long _vq_quantlist__44p2_p3_1[] = {
134.2158 +	1,
134.2159 +	0,
134.2160 +	2,
134.2161 +};
134.2162 +
134.2163 +static const long _vq_lengthlist__44p2_p3_1[] = {
134.2164 +	 2, 3, 3, 0, 8, 8, 0, 8, 8, 0, 9, 9, 0, 9, 9, 0,
134.2165 +	 9, 9, 0, 9, 9, 0, 9, 9, 0, 8, 8, 0, 6, 6, 0, 7,
134.2166 +	 7, 0, 7, 7, 0, 8, 8, 0, 8, 8, 0, 8, 8, 0, 8, 8,
134.2167 +	 0, 8, 8, 0, 8, 8, 0, 6, 6, 0, 6, 6, 0, 6, 6, 0,
134.2168 +	 8, 8, 0, 9, 9, 0, 7, 7, 0, 8, 8, 0, 9, 9, 0, 6,
134.2169 +	 6, 0, 8, 8, 0, 9, 9, 0, 9, 9, 0,10,10, 0,10,10,
134.2170 +	 0,10,10, 0,10,10, 0,11,11, 0, 9, 9, 0, 7, 7, 0,
134.2171 +	10,10, 0,10,10, 0,12,11, 0,12,12, 0,11,11, 0,11,
134.2172 +	11, 0,12,12, 0,10,10, 0, 7, 7, 0,10,10, 0,10,10,
134.2173 +	 0,12,12, 0,11,12, 0,11,11, 0,11,11, 0,11,11, 0,
134.2174 +	10,10, 0, 8, 8, 0, 9, 9, 0, 9, 9, 0,10,10, 0,10,
134.2175 +	10, 0,10, 9, 0,10,10, 0,10,10, 0, 9, 9, 0, 6, 6,
134.2176 +	 0,10,10, 0,10,10, 0,11,11, 0,12,12, 0,11,11, 0,
134.2177 +	11,11, 0,12,12, 0,11,11, 0, 7, 7, 0, 9, 9, 0, 9,
134.2178 +	 9, 0,11,11, 0,11,11, 0,10,10, 0,10,10, 0,11,11,
134.2179 +	 0, 9, 9,
134.2180 +};
134.2181 +
134.2182 +static const static_codebook _44p2_p3_1 = {
134.2183 +	5, 243,
134.2184 +	(long *)_vq_lengthlist__44p2_p3_1,
134.2185 +	1, -535822336, 1611661312, 2, 0,
134.2186 +	(long *)_vq_quantlist__44p2_p3_1,
134.2187 +	0
134.2188 +};
134.2189 +
134.2190 +static const long _vq_quantlist__44p2_p4_0[] = {
134.2191 +	1,
134.2192 +	0,
134.2193 +	2,
134.2194 +};
134.2195 +
134.2196 +static const long _vq_lengthlist__44p2_p4_0[] = {
134.2197 +	 1, 6, 6, 6, 7, 7, 7, 8, 8, 7, 8, 8,10,11,11, 9,
134.2198 +	 8, 8, 7, 8, 8,11,11,11, 9, 8, 8, 6, 7, 7, 9,11,
134.2199 +	11, 9,11,11,10,11,11,12,13,13,11,12,12,10,11,11,
134.2200 +	13,14,14,12,12,12, 6, 6, 6, 8, 6, 6, 8, 7, 7, 9,
134.2201 +	 7, 7,11,10,10,10, 6, 6, 9, 7, 7,12,10,10,11, 6,
134.2202 +	 7, 7, 7, 7,11,10,10,12,10,10,11,10,10,14,13,13,
134.2203 +	13,10,10,12,11,11,15,13,13,14,10,10, 8, 7, 7,12,
134.2204 +	11,11,12,11,11,11,11,11,14,14,14,13,12,12,12,11,
134.2205 +	11,15,15,15,13,12,12, 0,10,10, 0,11,11, 0,11,11,
134.2206 +	 0,11,11, 0,14,14, 0,11,11, 0,11,11, 0,15,15, 0,
134.2207 +	11,11, 7, 8, 8,12,10,10,12,10,10,12,11,11,15,13,
134.2208 +	13,14,11,11,12,10,10,16,14,14,14,10,10, 8, 7, 7,
134.2209 +	12,11,11,12,11,11,12,11,11,16,14,14,14,12,12,13,
134.2210 +	12,12,15,14,14,15,12,12, 0,11,11, 0,12,12, 0,12,
134.2211 +	12, 0,12,12, 0,15,15, 0,12,12, 0,12,12, 0,14,14,
134.2212 +	 0,12,12,
134.2213 +};
134.2214 +
134.2215 +static const static_codebook _44p2_p4_0 = {
134.2216 +	5, 243,
134.2217 +	(long *)_vq_lengthlist__44p2_p4_0,
134.2218 +	1, -531365888, 1616117760, 2, 0,
134.2219 +	(long *)_vq_quantlist__44p2_p4_0,
134.2220 +	0
134.2221 +};
134.2222 +
134.2223 +static const long _vq_quantlist__44p2_p4_1[] = {
134.2224 +	2,
134.2225 +	1,
134.2226 +	3,
134.2227 +	0,
134.2228 +	4,
134.2229 +};
134.2230 +
134.2231 +static const long _vq_lengthlist__44p2_p4_1[] = {
134.2232 +	 3, 4, 4, 8, 8,11, 9, 9,12,12,11,10,10,12,12,12,
134.2233 +	10,10,11,11,12,12,12,12,12,12,11,11,13,13,12,12,
134.2234 +	12,13,13,12,10,10,12,12,12,11,11,13,13,12,13,13,
134.2235 +	13,13,12,11,11,13,13,12,12,12,13,13,12,10,10,12,
134.2236 +	12,12,11,11,13,13,12,13,13,12,12,12,11,11,13,13,
134.2237 +	12,13,13,13,13,12,11,11,12,12,12,11,11,12,12,12,
134.2238 +	13,13,12,12,12,13,13,13,13,12,13,13,13,13,13,13,
134.2239 +	13,12,12,12,13,13,13,13,12,13,13,12,12,11, 8, 8,
134.2240 +	10,10,12,11,11,11,11,12,10,10,10,10,13,11,11,10,
134.2241 +	10,13,11,11,10,10,13,12,12,12,12,13,11,11,11,11,
134.2242 +	13,12,12,11,11,13,12,12,11,11,13,12,12,12,11,13,
134.2243 +	12,12,12,12,13,11,11,11,11,13,12,12,11,11,13,11,
134.2244 +	12,11,11,13,12,12,11,11,14,12,12,11,11,13,11,11,
134.2245 +	11,11,14,12,12,11,11,13,11,12,10,10,14,12,12,11,
134.2246 +	11,14,12,12,11,11,14,11,11,11,11,14,12,12,11,11,
134.2247 +	13,12,12,11,11,14,12,12,11,11,11, 8, 8,10,10,12,
134.2248 +	 7, 7,10,10,12, 9, 9,11,11,13, 9, 9, 9, 9,13,13,
134.2249 +	13,10,10,13, 9, 9,12,12,13,13,13,12,12,13, 9, 8,
134.2250 +	11,11,13,10,10,12,12,14,13,13,11,11,13, 9, 9,11,
134.2251 +	11,13,13,13,12,12,13, 9, 9,10,10,13,10,10,11,11,
134.2252 +	13,13,13,10,10,14,10,10,11,11,14,14,14,12,12,13,
134.2253 +	 9, 9,10,10,13,10,10,11,11,14,13,14,10,10,14,14,
134.2254 +	14,11,12,14,14,14,14,14,14,13,13,10,10,13,14,14,
134.2255 +	11,11,14,14,14,10,10,14, 9, 9, 9, 9,14, 9, 9, 9,
134.2256 +	 9,14,10,10, 9, 9,14,10,10, 8, 8,14,11,11, 8, 8,
134.2257 +	15,11,11,10,10,15,12,12,10,10,15,10,10,10,10,15,
134.2258 +	11,11,10,10,15,13,13,10,10,15,11,11,10,10,15,12,
134.2259 +	12,10,10,15,10,10,10,10,15,11,11,10,10,15,13,13,
134.2260 +	10,10,15,11,11,10,10,15,12,12,10,10,15,11,11, 9,
134.2261 +	 9,15,11,11, 9, 9,15,13,13, 9, 9,15,13,13,10,10,
134.2262 +	15,12,12,10,10,15,13,13,10,10,15,13,12, 9, 9,15,
134.2263 +	13,13, 9, 9,14,12,12, 9, 9,14,13,13, 9, 9,14,13,
134.2264 +	13, 9, 9,14,13,13, 7, 7,14,13,13, 8, 8,15,14,14,
134.2265 +	10,10,15,14,14,10,10,15,14,14,10,10,15,14,14,10,
134.2266 +	10,15,14,14, 9, 9,15,14,14,10,10,15,14,14,10,10,
134.2267 +	14,14,14, 9, 9,15,14,14,10,10,14,14,14, 9, 9,15,
134.2268 +	14,14,10,10,15,14,14,10,10,14,14,14, 9, 9,14,14,
134.2269 +	14, 9, 9,14,14,14, 8, 8,15,14,14,10,10,15,14,14,
134.2270 +	11,11,15,14,14, 9, 9,15,14,14, 9, 9,14,14,14, 8,
134.2271 +	 8,13, 9, 9,12,12,17,11,11,12,12,17,12,12,12,12,
134.2272 +	17,12,12,11,11,18,15,15,12,12,17,12,12,12,12,17,
134.2273 +	14,15,13,13,17,12,12,12,12,17,13,13,12,13,17,15,
134.2274 +	15,12,12,18,13,13,13,13,18,15,15,13,13,18,12,12,
134.2275 +	12,12,18,13,13,13,13,18,15,15,12,12,18,13,13,12,
134.2276 +	12,18,15,15,13,13,18,13,13,12,12,17,13,13,12,12,
134.2277 +	17,15,15,12,12,18,15,15,13,13,18,15,15,13,14,18,
134.2278 +	15,16,12,12,18,15,15,12,12,18,16,16,12,12,13, 8,
134.2279 +	 8,10,10,14,15,14,11,11,14,15,15,12,12,15,14,14,
134.2280 +	12,11,15,15,15,12,12,15,15,15,12,12,15,15,15,13,
134.2281 +	13,15,15,15,12,12,15,15,15,13,13,15,15,15,13,13,
134.2282 +	15,15,15,13,13,15,15,16,13,13,15,15,15,12,12,15,
134.2283 +	15,15,13,13,15,15,15,13,13,15,15,15,13,13,15,15,
134.2284 +	15,13,13,15,15,14,12,12,15,15,15,12,12,16,15,14,
134.2285 +	12,12,16,15,15,13,13,16,16,16,13,13,16,15,15,12,
134.2286 +	12,15,15,15,13,13,15,15,15,12,12,13,12,12,10,10,
134.2287 +	14,14,14,11,11,15,14,14,12,12,15,14,14,11,11,15,
134.2288 +	14,14,11,11,15,15,15,13,13,15,14,14,13,13,15,15,
134.2289 +	15,12,12,15,14,15,13,13,16,15,15,12,12,15,15,15,
134.2290 +	13,13,16,14,14,13,13,15,15,15,12,12,15,15,15,13,
134.2291 +	13,16,15,15,12,12,16,15,15,12,12,16,14,14,13,13,
134.2292 +	15,15,15,11,11,15,15,15,12,12,16,15,15,11,11,16,
134.2293 +	15,15,13,13,16,14,15,14,14,16,15,15,12,12,16,15,
134.2294 +	14,12,12,16,15,15,12,12,14,10,10, 9, 9,14,11,11,
134.2295 +	12,12,14,12,12,13,13,14,12,12,12,12,15,14,14,13,
134.2296 +	13,15,13,13,14,14,15,14,14,15,15,15,12,12,13,13,
134.2297 +	15,13,13,14,14,15,14,14,13,13,15,13,13,13,14,15,
134.2298 +	14,14,15,15,15,12,12,13,13,15,13,13,14,14,15,14,
134.2299 +	14,13,13,15,13,13,14,14,15,14,14,15,15,15,13,13,
134.2300 +	12,12,15,13,13,13,13,15,14,14,13,12,15,15,15,14,
134.2301 +	15,15,15,14,20,20,15,14,14,13,13,15,14,14,13,13,
134.2302 +	15,14,14,13,13,14,12,12, 9, 9,14,14,14,12,12,14,
134.2303 +	13,13,12,13,14,14,14,12,12,15,14,14,12,12,15,14,
134.2304 +	14,14,13,15,14,14,14,14,15,14,14,13,13,15,14,14,
134.2305 +	13,13,15,15,15,14,14,15,14,14,13,13,15,14,14,14,
134.2306 +	14,15,14,14,13,13,15,14,14,13,13,15,15,15,15,14,
134.2307 +	15,15,15,13,13,15,14,14,14,14,15,14,14,13,13,15,
134.2308 +	14,14,13,13,14,15,15,14,14,15,15,15,14,14,15,14,
134.2309 +	14,14,14,15,15,15,14,14,15,14,14,13,14,15,15,15,
134.2310 +	14,14,13,10,10,12,12,17,11,11,12,12,17,12,12,12,
134.2311 +	12,17,12,12,11,11,17,15,15,12,11,18,13,13,13,13,
134.2312 +	18,15,15,13,13,17,12,12,12,12,18,13,13,13,13,17,
134.2313 +	15,15,12,12,17,12,12,12,12,17,15,15,13,13,17,12,
134.2314 +	12,12,12,17,13,13,12,12,17,15,15,12,12,18,14,13,
134.2315 +	12,12,18,15,15,13,13,18,13,13,12,12,18,13,13,12,
134.2316 +	12,18,16,16,12,12,18,16,16,12,12,18,15,15,13,13,
134.2317 +	18,16,16,12,12,17,15,15,12,12,17,16,16,12,12,13,
134.2318 +	 8, 8,10,10,14,14,15,12,12,14,15,15,12,12,15,14,
134.2319 +	14,12,12,15,15,14,12,12,15,15,15,13,13,15,15,15,
134.2320 +	13,13,15,15,15,12,12,16,15,15,13,13,16,15,15,13,
134.2321 +	13,15,15,15,12,12,15,15,15,14,14,15,15,15,12,12,
134.2322 +	15,15,15,13,13,16,15,15,13,13,15,15,15,13,13,16,
134.2323 +	15,15,13,13,15,15,14,12,12,15,15,15,12,12,16,14,
134.2324 +	15,13,13,16,15,15,13,13,15,16,15,13,13,16,15,14,
134.2325 +	13,13,16,15,15,13,13,16,15,15,13,13,13,12,12,11,
134.2326 +	11,14,14,14,11,11,14,14,14,12,12,15,14,14,11,11,
134.2327 +	16,14,14,11,11,15,15,15,12,13,16,14,14,13,13,15,
134.2328 +	15,15,12,12,15,14,14,13,13,16,15,15,12,12,15,15,
134.2329 +	15,12,12,15,14,14,13,13,15,15,15,12,12,15,14,14,
134.2330 +	12,12,16,15,15,12,12,16,15,15,12,12,16,14,14,13,
134.2331 +	13,15,15,15,11,11,15,15,14,12,12,16,15,15,11,11,
134.2332 +	16,15,15,12,12,16,14,14,13,13,16,15,15,11,11,16,
134.2333 +	14,14,12,12,16,15,15,11,11,14,10,10, 9, 9,14,11,
134.2334 +	11,12,12,14,12,12,13,14,14,12,12,12,12,14,14,14,
134.2335 +	13,13,15,13,13,14,14,15,14,14,15,15,15,12,12,13,
134.2336 +	13,15,13,13,14,14,15,15,15,14,14,15,13,13,14,14,
134.2337 +	15,15,15,15,15,15,12,12,13,13,15,13,13,14,14,15,
134.2338 +	14,14,13,13,15,13,13,14,14,15,14,14,15,15,15,12,
134.2339 +	12,13,13,15,13,13,13,13,14,14,14,13,13,15,15,15,
134.2340 +	14,15,15,15,15,21,19,15,14,14,13,13,15,14,14,14,
134.2341 +	14,14,14,14,13,13,14,12,12, 9, 9,14,14,14,12,12,
134.2342 +	14,14,13,13,13,14,14,14,12,12,14,14,14,12,12,15,
134.2343 +	14,14,13,13,15,14,14,14,14,15,14,14,13,13,15,14,
134.2344 +	14,13,13,15,15,15,15,15,15,14,14,13,13,15,14,14,
134.2345 +	14,14,15,14,14,13,13,15,14,14,13,13,14,15,15,15,
134.2346 +	15,15,14,15,13,13,15,14,14,14,14,15,14,14,13,13,
134.2347 +	15,14,14,13,13,14,15,15,14,14,15,15,15,14,14,15,
134.2348 +	14,14,14,14,15,15,15,15,15,15,14,14,14,13,14,15,
134.2349 +	15,14,14,13,10,10,12,12,18,12,12,12,12,17,12,12,
134.2350 +	12,12,18,13,13,11,11,18,15,14,11,11,17,13,13,13,
134.2351 +	13,18,15,15,12,12,18,12,12,12,12,17,13,13,12,12,
134.2352 +	18,15,15,12,12,18,13,13,13,12,18,15,15,13,13,18,
134.2353 +	13,13,12,12,18,13,13,12,12,18,15,15,12,12,17,13,
134.2354 +	13,12,12,17,15,15,12,12,17,12,12,11,11,17,13,13,
134.2355 +	11,11,17,15,15,11,11,18,16,16,12,12,18,15,15,13,
134.2356 +	13,18,15,15,11,11,17,15,15,12,12,18,15,15,11,11,
134.2357 +	13, 8, 8,10,10,14,14,14,11,11,15,15,15,12,12,15,
134.2358 +	14,14,11,11,16,14,14,12,12,15,15,15,12,12,15,15,
134.2359 +	15,13,13,15,15,15,12,12,15,15,15,12,12,16,15,15,
134.2360 +	13,13,15,15,15,12,12,15,15,15,13,13,16,15,15,12,
134.2361 +	12,15,15,15,12,12,16,15,15,13,13,16,15,15,12,12,
134.2362 +	15,15,15,13,13,15,14,14,12,12,15,15,15,12,12,16,
134.2363 +	15,14,12,12,16,15,15,13,13,16,16,16,13,13,16,14,
134.2364 +	15,13,13,15,15,15,13,13,16,15,15,12,12,13,12,12,
134.2365 +	10,10,14,14,14,11,11,15,14,14,12,12,15,14,14,11,
134.2366 +	11,16,14,14,11,11,15,14,15,12,12,15,14,14,13,13,
134.2367 +	15,15,15,12,12,15,14,14,12,12,15,14,15,12,12,15,
134.2368 +	15,15,12,12,16,14,14,13,13,15,15,15,11,12,16,14,
134.2369 +	14,12,12,16,15,15,12,12,15,15,15,12,12,16,14,14,
134.2370 +	12,12,15,15,15,11,11,15,14,14,11,12,15,15,14,11,
134.2371 +	11,16,15,15,12,12,16,14,14,13,13,16,15,15,11,11,
134.2372 +	16,14,14,12,12,16,15,15,11,11,13,10,10, 8, 8,14,
134.2373 +	12,12,12,12,14,12,12,13,13,14,12,12,12,12,14,14,
134.2374 +	14,13,13,15,13,13,14,14,15,15,14,15,15,15,13,13,
134.2375 +	13,13,15,13,13,14,14,15,14,15,14,14,15,13,13,13,
134.2376 +	13,15,15,15,15,15,15,12,12,13,12,15,13,13,14,14,
134.2377 +	15,14,14,13,13,15,13,13,14,13,15,15,15,16,16,15,
134.2378 +	13,13,12,12,15,13,13,13,13,14,14,14,12,12,15,15,
134.2379 +	15,14,14,15,15,15,20,20,15,14,14,13,13,15,15,14,
134.2380 +	14,14,15,14,14,13,13,13,12,12, 9, 9,14,13,13,12,
134.2381 +	12,14,13,13,12,12,14,14,14,12,12,14,14,14,13,13,
134.2382 +	15,14,14,13,13,15,14,14,14,14,15,15,14,12,12,15,
134.2383 +	14,14,13,13,15,14,15,14,15,15,14,14,13,13,15,14,
134.2384 +	14,14,14,15,14,14,12,12,15,14,14,13,13,14,15,14,
134.2385 +	15,14,15,14,14,13,13,15,14,14,14,14,15,14,14,12,
134.2386 +	12,15,14,14,13,13,15,15,15,14,14,15,15,15,14,14,
134.2387 +	16,14,14,14,14,15,15,15,14,14,15,14,14,14,14,14,
134.2388 +	15,15,14,14,13,13,13,12,13,17,15,15,12,12,17,15,
134.2389 +	15,12,12,18,15,15,11,11,17,16,16,11,11,18,16,16,
134.2390 +	13,13,18,17,16,13,13,18,16,16,12,12,18,16,16,12,
134.2391 +	12,18,17,17,12,12,17,16,16,12,13,17,16,16,12,13,
134.2392 +	17,16,16,12,12,17,16,16,12,12,18,17,16,12,12,18,
134.2393 +	16,16,12,12,17,16,17,12,12,18,15,15,11,11,18,15,
134.2394 +	15,12,12,17,17,17,11,11,17,17,17,12,12,17,16,16,
134.2395 +	13,13,18,16,16,11,11,18,16,16,12,12,18,17,16,11,
134.2396 +	11,14,14,14,10,10,16,15,14,11,11,16,15,15,12,12,
134.2397 +	16,14,14,12,12,17,14,14,13,13,17,15,15,13,13,17,
134.2398 +	15,15,14,14,16,15,15,12,12,16,15,15,13,13,18,15,
134.2399 +	15,14,14,16,15,15,12,12,16,15,15,14,14,16,15,15,
134.2400 +	12,12,16,15,15,13,13,17,15,15,13,13,17,15,15,13,
134.2401 +	13,17,15,15,14,14,16,14,14,12,12,17,15,15,12,12,
134.2402 +	18,15,15,13,13,17,15,15,14,14,17,16,16,15,15,17,
134.2403 +	15,14,13,13,17,15,15,14,14,17,15,15,13,13,14,12,
134.2404 +	12,11,11,15,14,14,12,12,16,14,14,12,12,16,14,14,
134.2405 +	11,11,17,14,14,12,12,16,15,14,13,13,16,14,14,13,
134.2406 +	13,16,15,15,12,12,16,14,14,13,13,17,15,15,13,13,
134.2407 +	16,15,15,13,13,17,14,14,13,13,16,15,15,12,12,16,
134.2408 +	14,14,12,12,16,15,15,12,12,17,15,15,12,12,17,14,
134.2409 +	14,13,13,16,15,15,12,12,16,14,14,12,12,16,15,15,
134.2410 +	12,12,17,15,15,13,13,17,14,14,13,13,17,15,15,12,
134.2411 +	12,17,14,14,12,12,17,15,15,12,12,14,14,14, 8, 8,
134.2412 +	14,14,14,13,13,14,15,15,14,14,14,14,14,14,14,15,
134.2413 +	15,15,19,19,15,15,15,14,14,15,15,16,20,19,15,15,
134.2414 +	15,14,14,15,16,16,15,15,15,15,15,19,19,15,15,15,
134.2415 +	14,14,15,16,16,19,20,15,15,15,14,14,15,15,15,15,
134.2416 +	15,15,15,15,19,19,15,15,15,15,15,15,15,16,19,20,
134.2417 +	15,14,15,14,14,15,15,15,15,15,15,15,15,20,19,15,
134.2418 +	15,15,21,19,15,16,16,20,20,15,15,14,19,19,15,15,
134.2419 +	16,20,21,15,15,15,20,19,13,12,12, 9, 9,14,14,14,
134.2420 +	12,12,14,13,13,13,13,14,14,14,13,13,15,14,14,20,
134.2421 +	19,15,14,14,14,13,15,14,14,19,19,15,15,14,13,13,
134.2422 +	15,14,14,14,14,15,15,15,19,20,15,14,14,13,13,15,
134.2423 +	14,14,20,19,14,15,14,13,13,15,14,14,14,13,15,15,
134.2424 +	15,19,20,15,15,14,14,14,15,14,14,21,19,15,15,15,
134.2425 +	13,13,15,14,14,14,14,14,15,15,20,20,15,15,15,21,
134.2426 +	20,15,14,14,19,20,15,15,15,20,20,15,14,14,19,20,
134.2427 +	15,15,15,21,19,
134.2428 +};
134.2429 +
134.2430 +static const static_codebook _44p2_p4_1 = {
134.2431 +	5, 3125,
134.2432 +	(long *)_vq_lengthlist__44p2_p4_1,
134.2433 +	1, -533725184, 1611661312, 3, 0,
134.2434 +	(long *)_vq_quantlist__44p2_p4_1,
134.2435 +	0
134.2436 +};
134.2437 +
134.2438 +static const long _vq_quantlist__44p2_p5_0[] = {
134.2439 +	2,
134.2440 +	1,
134.2441 +	3,
134.2442 +	0,
134.2443 +	4,
134.2444 +};
134.2445 +
134.2446 +static const long _vq_lengthlist__44p2_p5_0[] = {
134.2447 +	 2, 6, 6,14,14, 6, 7, 7,14,14, 7, 7, 7,15,15, 0,
134.2448 +	13,13,16,16, 0,13,13,15,15, 7, 8, 8,15,15, 9,10,
134.2449 +	10,17,16, 9, 8, 8,15,15, 0,13,13,18,17, 0,13,13,
134.2450 +	16,16, 8, 8, 8,15,15,12,11,11,16,17, 9, 8, 8,14,
134.2451 +	14, 0,13,13,18,17, 0,13,13,16,15, 0,14,14,18,17,
134.2452 +	 0,20,22,18,20, 0,12,12,16,16, 0,16,16,22,20, 0,
134.2453 +	14,14,16,16, 0,14,14,17,17, 0,22,22,22,19, 0,12,
134.2454 +	13,16,16, 0,17,17, 0, 0, 0,15,15,16,16, 5, 7, 7,
134.2455 +	13,13, 9, 9, 9,15,14,10,10,10,14,14, 0,21,21,18,
134.2456 +	17, 0,21,22,18,17, 9,10,10,14,14,12,12,12,17,17,
134.2457 +	12,10,10,14,14, 0,19,21,18,17, 0,20,22,18,18,11,
134.2458 +	10,10,14,14,14,13,13,18,17,12,11,11,14,14, 0,22,
134.2459 +	19,17,18, 0,20, 0,18,17, 0,22,21,17,17, 0, 0, 0,
134.2460 +	 0, 0, 0,20,22,17,17, 0,22, 0,21,19, 0,22, 0,18,
134.2461 +	18, 0, 0,22,18,19, 0, 0, 0, 0, 0, 0,19,21,17,17,
134.2462 +	 0, 0, 0,20,20, 0, 0, 0,18,18, 6, 6, 6,13,12, 8,
134.2463 +	 6, 6,11,11, 8, 6, 6,13,13, 0, 9, 9,11,11, 0,11,
134.2464 +	11,14,14, 9, 7, 7,13,13,11, 9, 9,13,13,10, 6, 6,
134.2465 +	13,13, 0,10,10,14,14, 0,10,10,13,13, 9, 7, 7,13,
134.2466 +	14,13, 9, 9,13,13,10, 6, 6,13,12, 0,11,11,15,15,
134.2467 +	 0,10,10,13,13, 0,12,12,15,15, 0,19, 0,17,17, 0,
134.2468 +	 9, 9,13,13, 0,13,14,19,20, 0,11,11,13,13, 0,11,
134.2469 +	11,14,14, 0,19,20,17,18, 0,10,10,13,13, 0,15,15,
134.2470 +	21,19, 0,12,12,13,13, 0,10,10,12,13, 0,11,11,15,
134.2471 +	15, 0,11,11,15,15, 0,15,15,22, 0, 0,16,17,22, 0,
134.2472 +	 0,11,11,15,15, 0,14,14,18,17, 0,11,11,15,16, 0,
134.2473 +	15,15,22,21, 0,16,16, 0,20, 0,12,12,16,15, 0,15,
134.2474 +	14,19,19, 0,11,11,16,16, 0,15,15,21, 0, 0,16,15,
134.2475 +	 0, 0, 0,16,16,22,21, 0, 0, 0, 0, 0, 0,15,15,20,
134.2476 +	20, 0,18,18, 0, 0, 0,16,17, 0, 0, 0,17,17, 0,22,
134.2477 +	 0, 0, 0, 0, 0, 0,15,15,21,22, 0,20,18, 0, 0, 0,
134.2478 +	18,17,22, 0, 0,10,10,12,11, 0,10,10,10,10, 0,11,
134.2479 +	11,12,12, 0,11,11, 9, 9, 0,13,13,12,12, 0,11,11,
134.2480 +	12,12, 0,13,13,12,12, 0,10,10,12,12, 0,13,12,13,
134.2481 +	13, 0,12,12,12,12, 0,11,11,12,12, 0,13,13,12,12,
134.2482 +	 0,10,10,12,12, 0,13,13,13,14, 0,12,12,12,12, 0,
134.2483 +	13,14,14,14, 0,20,21,15,15, 0,12,11,12,12, 0,15,
134.2484 +	16,20,22, 0,13,12,11,11, 0,13,13,14,13, 0,20, 0,
134.2485 +	16,15, 0,12,12,12,12, 0,16,16,22,21, 0,13,13,12,
134.2486 +	12, 6, 7, 7,16,16,11, 9, 9,15,15,12, 9, 9,16,16,
134.2487 +	 0,13,13,14,14, 0,14,14,16,17,10, 9, 9,16,16,14,
134.2488 +	12,12,16,16,12, 9, 9,15,15, 0,13,13,18,18, 0,13,
134.2489 +	13,15,16,12,10,10,17,18,15,12,12,17,17,13, 9, 9,
134.2490 +	16,16, 0,13,13,17,18, 0,14,14,16,16, 0,15,15,18,
134.2491 +	18, 0,22, 0,20,20, 0,12,12,16,16, 0,16,16,20,22,
134.2492 +	 0,14,14,16,16, 0,15,14,18,18, 0, 0,22,19,21, 0,
134.2493 +	13,13,16,17, 0,17,17,22,22, 0,15,15,16,16, 7, 7,
134.2494 +	 7,14,14,11,10,10,15,15,12,10,10,15,14, 0,22, 0,
134.2495 +	18,18, 0, 0,21,17,18,11,10,10,15,15,14,12,12,17,
134.2496 +	17,14,11,11,15,15, 0,22,20,18,18, 0, 0,20,18,17,
134.2497 +	12,10,10,16,16,17,14,14,19,18,14,11,11,15,15, 0,
134.2498 +	21,22,19,19, 0,21,22,18,18, 0,22, 0,19,21, 0, 0,
134.2499 +	 0, 0, 0, 0,22,22,18,17, 0, 0, 0,21,20, 0,22,22,
134.2500 +	20,19, 0, 0,22,20,20, 0, 0, 0, 0, 0, 0,20,21,17,
134.2501 +	17, 0, 0,22,21,21, 0, 0, 0,18,18,10, 9, 9,14,14,
134.2502 +	13,10,10,13,13,13,10,11,14,14, 0,13,13,12,12, 0,
134.2503 +	15,15,16,16,13,10,10,15,15,15,12,12,14,14,15,10,
134.2504 +	10,14,15, 0,14,14,16,15, 0,14,14,15,15,13,10,10,
134.2505 +	15,15,18,13,13,15,15,15,10,10,14,15, 0,14,14,16,
134.2506 +	16, 0,14,14,15,15, 0,15,15,16,16, 0,22, 0,18,18,
134.2507 +	 0,12,13,14,14, 0,17,17,22, 0, 0,14,14,14,14, 0,
134.2508 +	15,15,16,16, 0,22, 0,18,17, 0,13,13,14,14, 0,19,
134.2509 +	18,21,22, 0,15,15,14,14, 0,11,11,13,13, 0,12,12,
134.2510 +	16,16, 0,12,12,16,16, 0,15,16,21, 0, 0,16,17, 0,
134.2511 +	22, 0,12,12,16,16, 0,14,14,17,18, 0,11,11,16,16,
134.2512 +	 0,15,15,21,22, 0,16,16, 0, 0, 0,12,12,16,16, 0,
134.2513 +	15,15, 0,19, 0,12,12,16,17, 0,16,16,22, 0, 0,16,
134.2514 +	16, 0,22, 0,17,17, 0,22, 0, 0, 0, 0, 0, 0,15,15,
134.2515 +	20,19, 0,18,18, 0, 0, 0,17,18, 0, 0, 0,17,17, 0,
134.2516 +	 0, 0, 0, 0, 0, 0, 0,15,15, 0,22, 0,20,18, 0, 0,
134.2517 +	 0,18,18,22,22, 0,11,11,14,14, 0,12,12,14,14, 0,
134.2518 +	12,12,15,15, 0,13,13,14,14, 0,14,14,17,16, 0,12,
134.2519 +	12,16,16, 0,14,14,16,16, 0,11,11,15,15, 0,13,13,
134.2520 +	16,16, 0,13,13,15,15, 0,12,12,15,15, 0,15,14,16,
134.2521 +	16, 0,11,11,15,15, 0,14,14,17,17, 0,13,13,15,15,
134.2522 +	 0,15,15,17,17, 0, 0, 0,19,18, 0,13,12,15,15, 0,
134.2523 +	16,16, 0, 0, 0,14,14,15,15, 0,14,14,16,17, 0,22,
134.2524 +	 0,18,18, 0,13,13,15,15, 0,17,17, 0, 0, 0,14,14,
134.2525 +	15,15, 8, 8, 8,16,16,12,10,10,16,16,13, 9, 9,16,
134.2526 +	16, 0,14,14,17,17, 0,14,14,17,16,12,10,10,18,17,
134.2527 +	14,11,11,18,18,14, 9,10,16,16, 0,13,13,18,19, 0,
134.2528 +	14,13,16,16,12, 9, 9,16,16,17,13,13,17,17,14, 9,
134.2529 +	 9,15,15, 0,14,14,19,20, 0,13,13,15,15, 0,15,15,
134.2530 +	18,19, 0, 0,22,22,22, 0,13,13,17,17, 0,16,16,19,
134.2531 +	21, 0,14,14,16,16, 0,14,14,18,18, 0, 0, 0, 0, 0,
134.2532 +	 0,13,13,16,16, 0,18,18, 0, 0, 0,15,15,16,16, 8,
134.2533 +	 7, 7,14,14,12,10,10,15,15,13,10,10,15,14, 0,22,
134.2534 +	 0,18,18, 0,22, 0,18,18,12,10,10,16,15,15,12,12,
134.2535 +	17,17,14,11,11,15,15, 0,20,21,19,18, 0, 0, 0,17,
134.2536 +	18,13,11,11,15,15,16,13,13,18,18,15,11,11,14,14,
134.2537 +	 0,22,21,19,19, 0,21,22,18,18, 0,22,22,20,18, 0,
134.2538 +	 0, 0, 0, 0, 0,22,19,17,17, 0, 0, 0,22,21, 0, 0,
134.2539 +	22,19,17, 0, 0,22,19,19, 0, 0, 0, 0, 0, 0,22,21,
134.2540 +	18,17, 0, 0, 0,22, 0, 0, 0, 0,19,19, 0,10,10,14,
134.2541 +	14, 0,11,11,15,14, 0,11,11,15,15, 0,14,14,15,14,
134.2542 +	 0,15,15,16,16, 0,11,11,16,16, 0,13,13,16,16, 0,
134.2543 +	11,11,15,15, 0,14,14,17,16, 0,14,14,15,15, 0,11,
134.2544 +	11,16,16, 0,14,13,15,15, 0,11,11,15,15, 0,15,15,
134.2545 +	17,17, 0,14,14,15,14, 0,16,16,17,17, 0, 0,22,18,
134.2546 +	18, 0,13,13,15,15, 0,17,17,22, 0, 0,15,15,15,14,
134.2547 +	 0,15,16,16,17, 0, 0,22,18,19, 0,13,13,15,15, 0,
134.2548 +	20,18,21, 0, 0,15,15,14,14, 0,11,11,13,13, 0,12,
134.2549 +	12,16,16, 0,12,12,16,15, 0,15,16,22,22, 0,17,17,
134.2550 +	 0, 0, 0,12,12,16,16, 0,14,14,18,18, 0,11,11,16,
134.2551 +	16, 0,15,16,22,20, 0,16,16, 0,22, 0,12,12,16,16,
134.2552 +	 0,15,15,18,20, 0,11,11,16,16, 0,15,15, 0, 0, 0,
134.2553 +	16,16, 0, 0, 0,17,17,22, 0, 0, 0, 0, 0, 0, 0,15,
134.2554 +	15, 0,21, 0,18,18, 0, 0, 0,17,16, 0, 0, 0,17,17,
134.2555 +	22,22, 0, 0, 0, 0, 0, 0,15,15,21, 0, 0,20,22, 0,
134.2556 +	 0, 0,18,18, 0, 0, 0,12,12,15,15, 0,12,12,15,15,
134.2557 +	 0,12,12,16,16, 0,13,13,15,15, 0,15,15,17,17, 0,
134.2558 +	13,12,16,16, 0,14,14,16,16, 0,12,11,16,16, 0,14,
134.2559 +	14,17,17, 0,14,14,16,16, 0,12,12,16,16, 0,15,15,
134.2560 +	17,16, 0,11,11,15,16, 0,14,14,17,17, 0,14,14,16,
134.2561 +	16, 0,15,15,18,18, 0, 0, 0,22,19, 0,13,13,15,16,
134.2562 +	 0,16,17, 0, 0, 0,14,14,16,16, 0,15,15,18,17, 0,
134.2563 +	 0, 0,20,20, 0,13,13,16,15, 0,17,17,22,22, 0,14,
134.2564 +	14,15,15, 0,11,11,16,16, 0,13,13,16,17, 0,13,13,
134.2565 +	17,18, 0,16,16,17,17, 0,17,17,18,18, 0,12,12,17,
134.2566 +	17, 0,16,15,18,18, 0,12,12,16,16, 0,16,16,18,18,
134.2567 +	 0,15,15,17,17, 0,12,12,17,17, 0,16,16,19,18, 0,
134.2568 +	12,12,16,17, 0,16,16,19,19, 0,15,16,16,17, 0,16,
134.2569 +	16,19,17, 0, 0, 0,20,22, 0,13,13,16,16, 0,19,18,
134.2570 +	21, 0, 0,15,15,16,16, 0,16,16,18,18, 0, 0, 0,22,
134.2571 +	21, 0,14,14,16,16, 0,21,19,21,22, 0,16,16,16,16,
134.2572 +	 0, 9, 9,14,14, 0,13,13,15,15, 0,14,14,15,15, 0,
134.2573 +	 0,20,18,19, 0, 0,22,18,18, 0,12,12,15,15, 0,15,
134.2574 +	15,17,18, 0,14,13,14,14, 0,20, 0,18,18, 0,21, 0,
134.2575 +	18,17, 0,13,13,15,16, 0,17,17,18,18, 0,14,14,15,
134.2576 +	15, 0,22,22,20,19, 0,20,21,18,18, 0,20,22,19,19,
134.2577 +	 0, 0, 0, 0, 0, 0,20,20,17,17, 0, 0,22,22,21, 0,
134.2578 +	22, 0,18,18, 0,20,22,19,19, 0, 0, 0, 0, 0, 0,21,
134.2579 +	21,17,18, 0, 0, 0,21,20, 0, 0,22,19,18, 0,18,18,
134.2580 +	15,15, 0,22,21,17,16, 0, 0,22,17,17, 0,20,22,18,
134.2581 +	18, 0, 0,22,20,20, 0,21,19,16,16, 0,21,21,18,18,
134.2582 +	 0,19,19,17,17, 0, 0,22,19,19, 0,22,20,17,17, 0,
134.2583 +	21,19,16,16, 0,22,22,19,18, 0,19,20,16,16, 0,22,
134.2584 +	21,19,21, 0,21,22,17,18, 0,21,20,18,18, 0, 0, 0,
134.2585 +	19,20, 0,20,19,16,16, 0,22,22, 0, 0, 0,21,21,17,
134.2586 +	16, 0,22,20,19,18, 0, 0, 0,20,20, 0,20,19,16,16,
134.2587 +	 0, 0, 0, 0, 0, 0,21,22,17,17, 0,11,11,13,13, 0,
134.2588 +	13,13,15,16, 0,13,13,16,16, 0,17,18,21, 0, 0,17,
134.2589 +	18, 0, 0, 0,12,12,15,16, 0,15,15,19,18, 0,12,12,
134.2590 +	16,16, 0,17,17,22, 0, 0,17,17, 0,22, 0,12,12,17,
134.2591 +	16, 0,16,16,19,20, 0,12,12,16,16, 0,17,17, 0, 0,
134.2592 +	 0,17,17, 0,21, 0,17,16,22, 0, 0, 0, 0, 0, 0, 0,
134.2593 +	15,15,20,22, 0,20,18, 0, 0, 0,18,18, 0, 0, 0,17,
134.2594 +	17,21, 0, 0, 0, 0, 0, 0, 0,15,15,21,22, 0,19,20,
134.2595 +	22, 0, 0,19,18, 0, 0, 0,14,14,18,18, 0,16,16,22,
134.2596 +	20, 0,16,16,22,19, 0,17,17,20,22, 0,19,19, 0, 0,
134.2597 +	 0,15,15,20, 0, 0,18,21, 0,20, 0,15,15,21,20, 0,
134.2598 +	18,17, 0, 0, 0,17,17, 0,22, 0,15,15,19,19, 0,19,
134.2599 +	18, 0, 0, 0,15,15,20, 0, 0,18,18,22,22, 0,17,17,
134.2600 +	 0,20, 0,18,18, 0, 0, 0, 0,22, 0, 0, 0,15,15,19,
134.2601 +	20, 0,20,19, 0, 0, 0,17,17,20,21, 0,17,18,20,22,
134.2602 +	 0, 0, 0, 0,22, 0,15,15,20,20, 0,22,20, 0, 0, 0,
134.2603 +	17,18,20, 0, 0,12,12,17,16, 0,14,14,17,17, 0,13,
134.2604 +	13,17,17, 0,16,16,18,18, 0,17,16,17,17, 0,13,13,
134.2605 +	17,17, 0,15,16,18,18, 0,13,13,16,16, 0,16,16,18,
134.2606 +	18, 0,16,16,17,16, 0,13,13,16,16, 0,17,17,18,17,
134.2607 +	 0,12,12,15,16, 0,17,17,19,19, 0,16,16,16,16, 0,
134.2608 +	16,17,19,18, 0, 0, 0,21,22, 0,14,14,16,16, 0,18,
134.2609 +	18, 0,22, 0,16,16,16,16, 0,16,16,18,17, 0, 0, 0,
134.2610 +	21,20, 0,14,14,16,16, 0,21,22,22, 0, 0,16,16,16,
134.2611 +	16, 0, 9, 9,14,13, 0,13,14,15,16, 0,14,13,15,14,
134.2612 +	 0,22, 0,18,18, 0,21, 0,17,18, 0,13,13,15,15, 0,
134.2613 +	15,16,18,17, 0,14,14,15,14, 0,20,22,18,18, 0,22,
134.2614 +	21,17,17, 0,13,13,15,15, 0,17,17,19,19, 0,14,14,
134.2615 +	14,14, 0, 0,22,18,18, 0, 0,22,17,17, 0, 0,22,19,
134.2616 +	20, 0, 0, 0, 0, 0, 0,21,20,17,16, 0, 0, 0,21,22,
134.2617 +	 0, 0, 0,18,19, 0, 0, 0,18,18, 0, 0, 0, 0, 0, 0,
134.2618 +	22, 0,17,17, 0, 0, 0,20,22, 0, 0, 0,18,19, 0,18,
134.2619 +	19,16,16, 0,22,20,17,17, 0,22,22,17,18, 0,22,22,
134.2620 +	18,17, 0, 0,22,18,19, 0,20,20,17,18, 0, 0,22,19,
134.2621 +	18, 0,22,22,17,17, 0,22, 0,19,19, 0, 0,22,18,18,
134.2622 +	 0,20,22,17,17, 0, 0,22,18,18, 0,19,20,17,17, 0,
134.2623 +	22, 0,20,19, 0,22,21,17,17, 0, 0, 0,18,18, 0, 0,
134.2624 +	 0,22,19, 0,20, 0,17,17, 0,22, 0, 0,22, 0, 0,20,
134.2625 +	17,18, 0,22, 0,19,19, 0, 0, 0, 0,19, 0,19,21,17,
134.2626 +	17, 0, 0, 0, 0, 0, 0,20,21,17,16, 0,11,11,13,13,
134.2627 +	 0,13,13,16,16, 0,13,13,15,16, 0,17,17,21,22, 0,
134.2628 +	17,18, 0, 0, 0,12,12,16,16, 0,15,15,18,18, 0,13,
134.2629 +	13,16,16, 0,17,16,21,21, 0,17,17, 0, 0, 0,13,13,
134.2630 +	16,16, 0,16,16,19,18, 0,13,13,16,16, 0,17,17, 0,
134.2631 +	22, 0,17,18,20,22, 0,17,18, 0, 0, 0, 0, 0, 0, 0,
134.2632 +	 0,15,15,20, 0, 0,18,19, 0, 0, 0,17,17, 0, 0, 0,
134.2633 +	18,17,22, 0, 0, 0, 0, 0, 0, 0,15,16,21,20, 0,20,
134.2634 +	20, 0, 0, 0,18,19, 0, 0, 0,15,15,22,22, 0,17,16,
134.2635 +	20,22, 0,17,17,20,22, 0,18,18, 0,21, 0,19,18, 0,
134.2636 +	 0, 0,16,16,20,20, 0,19,19,22, 0, 0,15,16,21,22,
134.2637 +	 0,18,19,22, 0, 0,17,18, 0, 0, 0,16,16,22, 0, 0,
134.2638 +	19,19, 0,21, 0,15,16,20, 0, 0,18,18, 0,22, 0,18,
134.2639 +	17, 0, 0, 0,18,18, 0, 0, 0, 0, 0, 0, 0, 0,16,16,
134.2640 +	22,21, 0,20,21, 0, 0, 0,17,18,22, 0, 0,18,18, 0,
134.2641 +	 0, 0, 0, 0, 0, 0, 0,16,16,20,19, 0,22,21, 0, 0,
134.2642 +	 0,18,18,22,22,
134.2643 +};
134.2644 +
134.2645 +static const static_codebook _44p2_p5_0 = {
134.2646 +	5, 3125,
134.2647 +	(long *)_vq_lengthlist__44p2_p5_0,
134.2648 +	1, -528744448, 1616642048, 3, 0,
134.2649 +	(long *)_vq_quantlist__44p2_p5_0,
134.2650 +	0
134.2651 +};
134.2652 +
134.2653 +static const long _vq_quantlist__44p2_p5_1[] = {
134.2654 +	3,
134.2655 +	2,
134.2656 +	4,
134.2657 +	1,
134.2658 +	5,
134.2659 +	0,
134.2660 +	6,
134.2661 +};
134.2662 +
134.2663 +static const long _vq_lengthlist__44p2_p5_1[] = {
134.2664 +	 2, 3, 3, 3, 3, 3, 3,
134.2665 +};
134.2666 +
134.2667 +static const static_codebook _44p2_p5_1 = {
134.2668 +	1, 7,
134.2669 +	(long *)_vq_lengthlist__44p2_p5_1,
134.2670 +	1, -533200896, 1611661312, 3, 0,
134.2671 +	(long *)_vq_quantlist__44p2_p5_1,
134.2672 +	0
134.2673 +};
134.2674 +
134.2675 +static const long _vq_quantlist__44p2_p6_0[] = {
134.2676 +	1,
134.2677 +	0,
134.2678 +	2,
134.2679 +};
134.2680 +
134.2681 +static const long _vq_lengthlist__44p2_p6_0[] = {
134.2682 +	 1, 7, 7, 7, 8, 8, 7, 8, 8, 7, 9, 9,10,11,11, 9,
134.2683 +	 8, 8, 7, 8, 9,11,11,11, 9, 8, 8, 6, 7, 7,10,10,
134.2684 +	10,10,10,10,10,10,10,14,14,14,12,11,11,10,11,11,
134.2685 +	15,14,14,13,11,11, 6, 6, 6, 8, 5, 5, 8, 7, 7, 8,
134.2686 +	 7, 7,11,10,10, 9, 7, 7, 9, 7, 7,12,10,10,10, 7,
134.2687 +	 7, 6, 8, 7,12,10,10,12,10,10,11,10,10,15,14,13,
134.2688 +	13,10,10,11,10,10,16,14,14,14,10,10, 7, 7, 7,12,
134.2689 +	11,11,12,11,11,11,11,11,16,14,14,13,12,12,11,11,
134.2690 +	11,17,15,15,14,12,12,10, 9, 9,13,11,11,13,11,11,
134.2691 +	12,11,11,16,14,13,14,11,11,12,11,11,17,15,14,14,
134.2692 +	11,11, 7, 8, 8,12,11,11,12,10,10,12,10,10,16,13,
134.2693 +	14,13,10,10,11,10,10,17,14,14,14,10,10, 7, 7, 7,
134.2694 +	12,11,11,12,11,11,12,11,11,15,14,15,14,12,12,12,
134.2695 +	11,11,17,15,15,14,12,12,10,10, 9,13,11,11,13,11,
134.2696 +	11,13,11,11,16,14,14,14,11,11,13,11,11,16,15,15,
134.2697 +	15,11,11,
134.2698 +};
134.2699 +
134.2700 +static const static_codebook _44p2_p6_0 = {
134.2701 +	5, 243,
134.2702 +	(long *)_vq_lengthlist__44p2_p6_0,
134.2703 +	1, -527106048, 1620377600, 2, 0,
134.2704 +	(long *)_vq_quantlist__44p2_p6_0,
134.2705 +	0
134.2706 +};
134.2707 +
134.2708 +static const long _vq_quantlist__44p2_p6_1[] = {
134.2709 +	1,
134.2710 +	0,
134.2711 +	2,
134.2712 +};
134.2713 +
134.2714 +static const long _vq_lengthlist__44p2_p6_1[] = {
134.2715 +	 2, 6, 6, 7, 7, 7, 7, 7, 7, 7, 8, 8, 9, 9, 9, 8,
134.2716 +	 7, 7, 8, 8, 8, 9, 9, 9, 9, 8, 8, 6, 7, 7, 9, 8,
134.2717 +	 8, 9, 7, 7, 9, 8, 8,10, 8, 8,10, 8, 8,10, 8, 8,
134.2718 +	10, 8, 9,10, 8, 8, 7, 6, 6, 8, 6, 6, 9, 6, 6, 9,
134.2719 +	 7, 7,10, 8, 8, 9, 6, 6, 9, 7, 7,10, 9, 8, 9, 7,
134.2720 +	 7, 7, 7, 7,11, 8, 8,11, 9, 9,10, 9, 9,12, 9, 9,
134.2721 +	12, 8, 8,11, 9, 9,12, 9, 9,12, 8, 8, 8, 7, 7,10,
134.2722 +	 9, 9,10, 9, 9,10, 9, 9,11,10,11,11, 9, 9,11, 9,
134.2723 +	 9,11,11,11,11, 9, 9,10, 8, 8,11, 9, 9,10, 9, 9,
134.2724 +	11, 9, 9,11,10,10,11, 9, 9,11, 9, 9,12,10,10,11,
134.2725 +	 9, 9, 8, 8, 8,11, 9, 9,12, 9, 9,11, 9, 9,12, 9,
134.2726 +	 9,12, 8, 8,12, 9, 9,12, 9,10,12, 8, 8, 9, 7, 7,
134.2727 +	11, 9, 9,11,10,10,11, 9, 9,11,11,11,11, 9, 9,11,
134.2728 +	10,10,12,11,11,11, 9,10,10, 9, 9,11, 9, 9,11,10,
134.2729 +	10,11,10,10,11,11,11,11, 9, 9,11, 9,10,11,11,11,
134.2730 +	11, 9, 9,
134.2731 +};
134.2732 +
134.2733 +static const static_codebook _44p2_p6_1 = {
134.2734 +	5, 243,
134.2735 +	(long *)_vq_lengthlist__44p2_p6_1,
134.2736 +	1, -530841600, 1616642048, 2, 0,
134.2737 +	(long *)_vq_quantlist__44p2_p6_1,
134.2738 +	0
134.2739 +};
134.2740 +
134.2741 +static const long _vq_quantlist__44p2_p7_0[] = {
134.2742 +	1,
134.2743 +	0,
134.2744 +	2,
134.2745 +};
134.2746 +
134.2747 +static const long _vq_lengthlist__44p2_p7_0[] = {
134.2748 +	 1, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9,
134.2749 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.2750 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.2751 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.2752 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.2753 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.2754 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.2755 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.2756 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.2757 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.2758 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.2759 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.2760 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.2761 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.2762 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.2763 +	 9, 9, 9,
134.2764 +};
134.2765 +
134.2766 +static const static_codebook _44p2_p7_0 = {
134.2767 +	5, 243,
134.2768 +	(long *)_vq_lengthlist__44p2_p7_0,
134.2769 +	1, -513979392, 1633504256, 2, 0,
134.2770 +	(long *)_vq_quantlist__44p2_p7_0,
134.2771 +	0
134.2772 +};
134.2773 +
134.2774 +static const long _vq_quantlist__44p2_p7_1[] = {
134.2775 +	1,
134.2776 +	0,
134.2777 +	2,
134.2778 +};
134.2779 +
134.2780 +static const long _vq_lengthlist__44p2_p7_1[] = {
134.2781 +	 1, 9, 9, 6, 9, 9, 5, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.2782 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.2783 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.2784 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.2785 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.2786 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.2787 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.2788 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.2789 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.2790 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.2791 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.2792 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.2793 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.2794 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.2795 +	 9, 9, 9,10,10,10,10,10,10,10,10,10,10,10,10,10,
134.2796 +	10,10,10,
134.2797 +};
134.2798 +
134.2799 +static const static_codebook _44p2_p7_1 = {
134.2800 +	5, 243,
134.2801 +	(long *)_vq_lengthlist__44p2_p7_1,
134.2802 +	1, -516716544, 1630767104, 2, 0,
134.2803 +	(long *)_vq_quantlist__44p2_p7_1,
134.2804 +	0
134.2805 +};
134.2806 +
134.2807 +static const long _vq_quantlist__44p2_p7_2[] = {
134.2808 +	12,
134.2809 +	11,
134.2810 +	13,
134.2811 +	10,
134.2812 +	14,
134.2813 +	9,
134.2814 +	15,
134.2815 +	8,
134.2816 +	16,
134.2817 +	7,
134.2818 +	17,
134.2819 +	6,
134.2820 +	18,
134.2821 +	5,
134.2822 +	19,
134.2823 +	4,
134.2824 +	20,
134.2825 +	3,
134.2826 +	21,
134.2827 +	2,
134.2828 +	22,
134.2829 +	1,
134.2830 +	23,
134.2831 +	0,
134.2832 +	24,
134.2833 +};
134.2834 +
134.2835 +static const long _vq_lengthlist__44p2_p7_2[] = {
134.2836 +	 1, 3, 2, 5, 4, 7, 7, 8, 8, 9, 9,10,10,11,11,12,
134.2837 +	12,13,13,14,14,15,15,15,15,
134.2838 +};
134.2839 +
134.2840 +static const static_codebook _44p2_p7_2 = {
134.2841 +	1, 25,
134.2842 +	(long *)_vq_lengthlist__44p2_p7_2,
134.2843 +	1, -518864896, 1620639744, 5, 0,
134.2844 +	(long *)_vq_quantlist__44p2_p7_2,
134.2845 +	0
134.2846 +};
134.2847 +
134.2848 +static const long _vq_quantlist__44p2_p7_3[] = {
134.2849 +	12,
134.2850 +	11,
134.2851 +	13,
134.2852 +	10,
134.2853 +	14,
134.2854 +	9,
134.2855 +	15,
134.2856 +	8,
134.2857 +	16,
134.2858 +	7,
134.2859 +	17,
134.2860 +	6,
134.2861 +	18,
134.2862 +	5,
134.2863 +	19,
134.2864 +	4,
134.2865 +	20,
134.2866 +	3,
134.2867 +	21,
134.2868 +	2,
134.2869 +	22,
134.2870 +	1,
134.2871 +	23,
134.2872 +	0,
134.2873 +	24,
134.2874 +};
134.2875 +
134.2876 +static const long _vq_lengthlist__44p2_p7_3[] = {
134.2877 +	 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
134.2878 +	 5, 5, 5, 5, 5, 5, 5, 5, 5,
134.2879 +};
134.2880 +
134.2881 +static const static_codebook _44p2_p7_3 = {
134.2882 +	1, 25,
134.2883 +	(long *)_vq_lengthlist__44p2_p7_3,
134.2884 +	1, -529006592, 1611661312, 5, 0,
134.2885 +	(long *)_vq_quantlist__44p2_p7_3,
134.2886 +	0
134.2887 +};
134.2888 +
134.2889 +static const long _huff_lengthlist__44p2_short[] = {
134.2890 +	 4, 4,12, 9, 8,12,15,17, 4, 2,11, 6, 5, 9,13,15,
134.2891 +	11, 7, 8, 7, 7,10,14,13, 8, 5, 7, 5, 5, 8,12,12,
134.2892 +	 8, 4, 7, 4, 3, 6,11,12,11, 8, 9, 7, 6, 8,11,12,
134.2893 +	15,13,14,12, 9, 7,10,13,16,12,17,12, 7, 5, 8,11,
134.2894 +};
134.2895 +
134.2896 +static const static_codebook _huff_book__44p2_short = {
134.2897 +	2, 64,
134.2898 +	(long *)_huff_lengthlist__44p2_short,
134.2899 +	0, 0, 0, 0, 0,
134.2900 +	NULL,
134.2901 +	0
134.2902 +};
134.2903 +
134.2904 +static const long _vq_quantlist__44p3_l0_0[] = {
134.2905 +	6,
134.2906 +	5,
134.2907 +	7,
134.2908 +	4,
134.2909 +	8,
134.2910 +	3,
134.2911 +	9,
134.2912 +	2,
134.2913 +	10,
134.2914 +	1,
134.2915 +	11,
134.2916 +	0,
134.2917 +	12,
134.2918 +};
134.2919 +
134.2920 +static const long _vq_lengthlist__44p3_l0_0[] = {
134.2921 +	 1, 4, 4, 8, 8, 8, 8, 9, 9,10,10,10,10, 4, 6, 5,
134.2922 +	 8, 7, 9, 9, 9, 9,10, 9,11, 9, 4, 5, 6, 7, 8, 9,
134.2923 +	 9, 9, 9, 9,10, 9,10, 8, 9, 8, 9, 8,10, 9,11, 9,
134.2924 +	12,10,12,10, 8, 8, 9, 8, 9, 9,10, 9,11,10,12,10,
134.2925 +	12, 9,10,10,11,10,12,11,12,11,12,12,12,12, 9,10,
134.2926 +	10,11,11,11,11,11,12,12,12,12,12,10,11,11,12,12,
134.2927 +	12,12,12,12,12,12,12,12,10,11,11,12,12,12,12,12,
134.2928 +	12,12,12,12,12,11,12,12,12,12,12,13,12,13,12,13,
134.2929 +	12,12,11,12,12,12,12,12,12,13,12,12,12,12,12,12,
134.2930 +	12,12,13,13,12,13,12,13,12,13,12,12,12,13,12,13,
134.2931 +	12,13,12,13,12,13,12,12,12,
134.2932 +};
134.2933 +
134.2934 +static const static_codebook _44p3_l0_0 = {
134.2935 +	2, 169,
134.2936 +	(long *)_vq_lengthlist__44p3_l0_0,
134.2937 +	1, -526516224, 1616117760, 4, 0,
134.2938 +	(long *)_vq_quantlist__44p3_l0_0,
134.2939 +	0
134.2940 +};
134.2941 +
134.2942 +static const long _vq_quantlist__44p3_l0_1[] = {
134.2943 +	2,
134.2944 +	1,
134.2945 +	3,
134.2946 +	0,
134.2947 +	4,
134.2948 +};
134.2949 +
134.2950 +static const long _vq_lengthlist__44p3_l0_1[] = {
134.2951 +	 3, 4, 4, 5, 5, 4, 4, 5, 5, 5, 4, 5, 4, 5, 5, 5,
134.2952 +	 5, 6, 5, 6, 5, 6, 5, 6, 5,
134.2953 +};
134.2954 +
134.2955 +static const static_codebook _44p3_l0_1 = {
134.2956 +	2, 25,
134.2957 +	(long *)_vq_lengthlist__44p3_l0_1,
134.2958 +	1, -533725184, 1611661312, 3, 0,
134.2959 +	(long *)_vq_quantlist__44p3_l0_1,
134.2960 +	0
134.2961 +};
134.2962 +
134.2963 +static const long _vq_quantlist__44p3_l1_0[] = {
134.2964 +	1,
134.2965 +	0,
134.2966 +	2,
134.2967 +};
134.2968 +
134.2969 +static const long _vq_lengthlist__44p3_l1_0[] = {
134.2970 +	 1, 4, 4, 4, 4, 4, 4, 4, 4,
134.2971 +};
134.2972 +
134.2973 +static const static_codebook _44p3_l1_0 = {
134.2974 +	2, 9,
134.2975 +	(long *)_vq_lengthlist__44p3_l1_0,
134.2976 +	1, -516716544, 1630767104, 2, 0,
134.2977 +	(long *)_vq_quantlist__44p3_l1_0,
134.2978 +	0
134.2979 +};
134.2980 +
134.2981 +static const long _huff_lengthlist__44p3_lfe[] = {
134.2982 +	 1, 3, 2, 3,
134.2983 +};
134.2984 +
134.2985 +static const static_codebook _huff_book__44p3_lfe = {
134.2986 +	2, 4,
134.2987 +	(long *)_huff_lengthlist__44p3_lfe,
134.2988 +	0, 0, 0, 0, 0,
134.2989 +	NULL,
134.2990 +	0
134.2991 +};
134.2992 +
134.2993 +static const long _huff_lengthlist__44p3_long[] = {
134.2994 +	 3, 4,13, 9, 9,12,15,17, 4, 2,18, 5, 7,10,14,18,
134.2995 +	11, 8, 6, 5, 6, 8,11,14, 8, 5, 5, 3, 5, 8,11,13,
134.2996 +	 9, 6, 7, 5, 5, 7, 9,10,11,10, 9, 8, 6, 6, 8,10,
134.2997 +	14,14,11,11, 9, 8, 9,10,17,17,14,13,10, 9,10,10,
134.2998 +};
134.2999 +
134.3000 +static const static_codebook _huff_book__44p3_long = {
134.3001 +	2, 64,
134.3002 +	(long *)_huff_lengthlist__44p3_long,
134.3003 +	0, 0, 0, 0, 0,
134.3004 +	NULL,
134.3005 +	0
134.3006 +};
134.3007 +
134.3008 +static const long _vq_quantlist__44p3_p1_0[] = {
134.3009 +	1,
134.3010 +	0,
134.3011 +	2,
134.3012 +};
134.3013 +
134.3014 +static const long _vq_lengthlist__44p3_p1_0[] = {
134.3015 +	 1, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3016 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3017 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3018 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3019 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3020 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3021 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3022 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3023 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3024 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3025 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3026 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3027 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3028 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3029 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3030 +	 0, 0, 0,
134.3031 +};
134.3032 +
134.3033 +static const static_codebook _44p3_p1_0 = {
134.3034 +	5, 243,
134.3035 +	(long *)_vq_lengthlist__44p3_p1_0,
134.3036 +	1, -535822336, 1611661312, 2, 0,
134.3037 +	(long *)_vq_quantlist__44p3_p1_0,
134.3038 +	0
134.3039 +};
134.3040 +
134.3041 +static const long _vq_quantlist__44p3_p2_0[] = {
134.3042 +	2,
134.3043 +	1,
134.3044 +	3,
134.3045 +	0,
134.3046 +	4,
134.3047 +};
134.3048 +
134.3049 +static const long _vq_lengthlist__44p3_p2_0[] = {
134.3050 +	 3, 7, 7, 0, 0, 0, 8, 8, 0, 0, 0, 8, 8, 0, 0, 0,
134.3051 +	11,11, 0, 0, 0, 0, 0, 0, 0, 0,10, 9, 0, 0, 0, 0,
134.3052 +	 0, 0, 0, 0, 9, 9, 0, 0, 0,10,11, 0, 0, 0, 0, 0,
134.3053 +	 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0,
134.3054 +	 0, 0,10,10, 0, 0, 0, 0, 0, 0, 0, 0,12,12, 0, 0,
134.3055 +	 0, 0, 0, 0, 0, 0,11,11, 0, 0, 0,12,12, 0, 0, 0,
134.3056 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3057 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7,
134.3058 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3059 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3060 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3061 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3062 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3063 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3064 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3065 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 0, 0, 0,
134.3066 +	 5, 5, 0, 0, 0, 7, 7, 0, 0, 0, 9, 9, 0, 0, 0, 0,
134.3067 +	 0, 0, 0, 0, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5,
134.3068 +	 0, 0, 0, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 0,
134.3069 +	 0, 0, 0, 0, 0, 0, 0, 5, 6, 0, 0, 0, 7, 7, 0, 0,
134.3070 +	 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0,
134.3071 +	 8, 8, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3072 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3073 +	 0, 0, 0, 0, 0, 0, 0, 0,11,11, 0, 0, 0, 9, 9, 0,
134.3074 +	 0, 0,10,10, 0, 0, 0,10,10, 0, 0, 0, 0, 0, 0, 0,
134.3075 +	 0,10,10, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0,
134.3076 +	10,10, 0, 0, 0, 0, 0, 0, 0, 0,10,10, 0, 0, 0, 0,
134.3077 +	 0, 0, 0, 0, 9, 9, 0, 0, 0,10,10, 0, 0, 0, 0, 0,
134.3078 +	 0, 0, 0,11,12, 0, 0, 0, 0, 0, 0, 0, 0,11,11, 0,
134.3079 +	 0, 0,12,12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3080 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3081 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3082 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3083 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3084 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3085 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3086 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3087 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3088 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3089 +	 0, 0, 9, 9, 0, 0, 0, 7, 7, 0, 0, 0, 8, 8, 0, 0,
134.3090 +	 0,10,10, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 0, 0, 0,
134.3091 +	 0, 0, 0, 0, 0, 7, 7, 0, 0, 0, 9, 9, 0, 0, 0, 0,
134.3092 +	 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8,
134.3093 +	 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0,10,10, 0,
134.3094 +	 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0,11,11, 0, 0,
134.3095 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3096 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5,
134.3097 +	 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3098 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3099 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3100 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3101 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3102 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3103 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3104 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3105 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3106 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3107 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3108 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3109 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3110 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3111 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3112 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 7, 7,
134.3113 +	 0, 0, 0, 9, 9, 0, 0, 0,10,10, 0, 0, 0, 0, 0, 0,
134.3114 +	 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 0, 0,
134.3115 +	 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0,
134.3116 +	 0, 0, 0, 0, 0, 7, 7, 0, 0, 0, 9, 9, 0, 0, 0, 0,
134.3117 +	 0, 0, 0, 0,11,11, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9,
134.3118 +	 0, 0, 0,10,10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3119 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3120 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3121 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3122 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3123 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3124 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3125 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3126 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3127 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3128 +	 0, 0, 0, 9, 9, 0, 0, 0, 7, 7, 0, 0, 0, 8, 8, 0,
134.3129 +	 0, 0,10,10, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0,
134.3130 +	 0, 0, 0, 0, 0, 0, 8, 7, 0, 0, 0, 9, 9, 0, 0, 0,
134.3131 +	 0, 0, 0, 0, 0, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 7,
134.3132 +	 7, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0,11,11,
134.3133 +	 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0,10,10, 0,
134.3134 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3135 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3136 +	 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3137 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3138 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3139 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3140 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3141 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3142 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3143 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3144 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3145 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3146 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3147 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3148 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3149 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3150 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3151 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 7,
134.3152 +	 7, 0, 0, 0, 9, 9, 0, 0, 0,10,10, 0, 0, 0, 0, 0,
134.3153 +	 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 0,
134.3154 +	 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0,
134.3155 +	 0, 0, 0, 0, 0, 0, 8, 8, 0, 0, 0, 9, 9, 0, 0, 0,
134.3156 +	 0, 0, 0, 0, 0,10,10, 0, 0, 0, 0, 0, 0, 0, 0, 9,
134.3157 +	 9, 0, 0, 0,11,11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3158 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3159 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3160 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3161 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3162 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3163 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3164 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3165 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3166 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3167 +	 0, 0, 0, 0,10,10, 0, 0, 0, 9, 9, 0, 0, 0,10,10,
134.3168 +	 0, 0, 0,11,12, 0, 0, 0, 0, 0, 0, 0, 0,10,10, 0,
134.3169 +	 0, 0, 0, 0, 0, 0, 0, 8, 8, 0, 0, 0,11,11, 0, 0,
134.3170 +	 0, 0, 0, 0, 0, 0,10,10, 0, 0, 0, 0, 0, 0, 0, 0,
134.3171 +	 9, 9, 0, 0, 0,10,10, 0, 0, 0, 0, 0, 0, 0, 0,11,
134.3172 +	11, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0,12,12,
134.3173 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3174 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3175 +	 0, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3176 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3177 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3178 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3179 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3180 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3181 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3182 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3183 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3184 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3185 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3186 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3187 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3188 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3189 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3190 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,10,10, 0, 0, 0,
134.3191 +	 9, 9, 0, 0, 0,10,10, 0, 0, 0,12,12, 0, 0, 0, 0,
134.3192 +	 0, 0, 0, 0,10,10, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9,
134.3193 +	 0, 0, 0,11,11, 0, 0, 0, 0, 0, 0, 0, 0,10,10, 0,
134.3194 +	 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0,11,11, 0, 0,
134.3195 +	 0, 0, 0, 0, 0, 0,12,12, 0, 0, 0, 0, 0, 0, 0, 0,
134.3196 +	10,10, 0, 0, 0,11,11, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3197 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3198 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3199 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3200 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3201 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3202 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3203 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3204 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3205 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3206 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3207 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3208 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3209 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3210 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3211 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3212 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3213 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3214 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3215 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3216 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3217 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3218 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3219 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3220 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3221 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3222 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3223 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3224 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3225 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3226 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3227 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3228 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3229 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3230 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3231 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3232 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3233 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3234 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3235 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3236 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3237 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3238 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3239 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3240 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3241 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3242 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3243 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3244 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3245 +	 0, 0, 0, 0, 0,
134.3246 +};
134.3247 +
134.3248 +static const static_codebook _44p3_p2_0 = {
134.3249 +	5, 3125,
134.3250 +	(long *)_vq_lengthlist__44p3_p2_0,
134.3251 +	1, -533725184, 1611661312, 3, 0,
134.3252 +	(long *)_vq_quantlist__44p3_p2_0,
134.3253 +	0
134.3254 +};
134.3255 +
134.3256 +static const long _vq_quantlist__44p3_p3_0[] = {
134.3257 +	1,
134.3258 +	0,
134.3259 +	2,
134.3260 +};
134.3261 +
134.3262 +static const long _vq_lengthlist__44p3_p3_0[] = {
134.3263 +	 1, 5, 5, 5, 8, 8, 0, 8, 8, 6, 9, 9, 8,10,10, 0,
134.3264 +	 8, 8, 0, 9, 9, 0,12,12, 0, 8, 8, 4, 7, 7, 6,10,
134.3265 +	10, 0,12,12, 7,11,11, 9,12,12, 0,12,12, 0,13,13,
134.3266 +	 0,15,15, 0,12,12, 0, 7, 7, 0, 7, 7, 0, 8, 8, 0,
134.3267 +	 8, 8, 0,10,10, 0, 7, 7, 0, 8, 8, 0,11,11, 0, 7,
134.3268 +	 7, 5, 7, 7, 9, 9, 9, 0,11,10, 9, 9, 9,11,12,12,
134.3269 +	 0,10,10, 0,11,11, 0,13,13, 0,11,11, 6, 7, 7, 9,
134.3270 +	10,10, 0,12,12,10,11,11,11,12,12, 0,12,12, 0,13,
134.3271 +	13, 0,15,15, 0,12,12, 0,10,10, 0,11,11, 0,11,11,
134.3272 +	 0,12,12, 0,13,13, 0,11,11, 0,12,12, 0,15,15, 0,
134.3273 +	11,11, 0, 8, 8, 0,10,10, 0,12,12, 0,11,11, 0,12,
134.3274 +	12, 0,12,12, 0,12,12, 0,15,15, 0,11,11, 0, 7, 7,
134.3275 +	 0,10,10, 0,12,12, 0,10,10, 0,12,13, 0,12,12, 0,
134.3276 +	13,13, 0,14,14, 0,12,12, 0, 0, 0, 0, 0, 0, 0, 0,
134.3277 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.3278 +	 0, 0, 0,
134.3279 +};
134.3280 +
134.3281 +static const static_codebook _44p3_p3_0 = {
134.3282 +	5, 243,
134.3283 +	(long *)_vq_lengthlist__44p3_p3_0,
134.3284 +	1, -533200896, 1614282752, 2, 0,
134.3285 +	(long *)_vq_quantlist__44p3_p3_0,
134.3286 +	0
134.3287 +};
134.3288 +
134.3289 +static const long _vq_quantlist__44p3_p3_1[] = {
134.3290 +	1,
134.3291 +	0,
134.3292 +	2,
134.3293 +};
134.3294 +
134.3295 +static const long _vq_lengthlist__44p3_p3_1[] = {
134.3296 +	 3, 4, 4, 0, 8, 8, 0, 8, 8, 0, 9, 9, 0,10,10, 0,
134.3297 +	 8, 8, 0, 9, 9, 0,10,10, 0, 8, 8, 0, 7, 7, 0, 8,
134.3298 +	 8, 0, 8, 8, 0, 8, 8, 0, 8, 8, 0, 8, 8, 0, 8, 8,
134.3299 +	 0, 8, 8, 0, 8, 8, 0, 7, 7, 0, 6, 6, 0, 7, 7, 0,
134.3300 +	 7, 7, 0,10,10, 0, 6, 6, 0, 7, 7, 0,10,10, 0, 6,
134.3301 +	 5, 0, 8, 8, 0, 7, 7, 0, 8, 8, 0, 8, 8, 0, 9, 9,
134.3302 +	 0, 7, 7, 0, 8, 8, 0, 9, 9, 0, 7, 7, 0, 6, 6, 0,
134.3303 +	 9,10, 0,10,10, 0,10,10, 0,11,11, 0, 9, 9, 0,10,
134.3304 +	10, 0,11,11, 0, 9, 9, 0, 8, 8, 0, 8, 8, 0, 8, 8,
134.3305 +	 0, 9, 9, 0, 9, 9, 0, 8, 8, 0, 8, 8, 0, 9, 9, 0,
134.3306 +	 7, 7, 0, 8, 8, 0, 7, 7, 0, 7, 7, 0, 8, 8, 0, 9,
134.3307 +	 9, 0, 7, 7, 0, 7, 7, 0, 9, 9, 0, 6, 6, 0, 6, 6,
134.3308 +	 0,10,10, 0,10,10, 0,10,10, 0,12,12, 0, 9, 9, 0,
134.3309 +	10,10, 0,12,12, 0, 9, 9, 0, 8, 8, 0, 7, 7, 0, 8,
134.3310 +	 8, 0, 8, 8, 0, 9, 9, 0, 7, 7, 0, 8, 8, 0, 9, 9,
134.3311 +	 0, 7, 7,
134.3312 +};
134.3313 +
134.3314 +static const static_codebook _44p3_p3_1 = {
134.3315 +	5, 243,
134.3316 +	(long *)_vq_lengthlist__44p3_p3_1,
134.3317 +	1, -535822336, 1611661312, 2, 0,
134.3318 +	(long *)_vq_quantlist__44p3_p3_1,
134.3319 +	0
134.3320 +};
134.3321 +
134.3322 +static const long _vq_quantlist__44p3_p4_0[] = {
134.3323 +	1,
134.3324 +	0,
134.3325 +	2,
134.3326 +};
134.3327 +
134.3328 +static const long _vq_lengthlist__44p3_p4_0[] = {
134.3329 +	 1, 6, 6, 7, 7, 7, 7, 7, 7, 7, 8, 8,10,11,11, 9,
134.3330 +	 8, 8, 8, 8, 8,11,11,11,10, 8, 8, 5, 7, 7, 9,11,
134.3331 +	11,10,11,11,10,11,11,12,13,14,11,12,12,10,11,11,
134.3332 +	13,14,14,12,12,12, 5, 6, 6, 8, 6, 6, 8, 7, 7, 8,
134.3333 +	 7, 7,11,10,10,10, 7, 7, 9, 7, 7,12,11,11,11, 7,
134.3334 +	 7, 7, 7, 7,11,10,10,12,10,10,11,10,10,15,13,13,
134.3335 +	13,10,10,12,11,11,15,13,13,14,11,11, 7, 7, 7,11,
134.3336 +	11,11,12,11,11,12,11,11,14,14,14,14,12,12,12,12,
134.3337 +	12,16,15,15,14,12,12, 0,10,10, 0,11,11, 0,11,12,
134.3338 +	 0,11,11, 0,14,14, 0,11,11, 0,12,12, 0,15,15, 0,
134.3339 +	11,11, 8, 8, 8,12,10,10,12,10,10,13,11,11,15,13,
134.3340 +	13,14,11,11,12,10,10,16,14,14,14,10,10, 8, 7, 7,
134.3341 +	12,11,11,13,11,11,12,11,11,15,14,14,14,12,12,13,
134.3342 +	12,12,15,14,14,15,12,12, 0,11,11, 0,12,12, 0,12,
134.3343 +	12, 0,12,12, 0,15,15, 0,12,12, 0,13,13, 0,14,15,
134.3344 +	 0,12,12,
134.3345 +};
134.3346 +
134.3347 +static const static_codebook _44p3_p4_0 = {
134.3348 +	5, 243,
134.3349 +	(long *)_vq_lengthlist__44p3_p4_0,
134.3350 +	1, -531365888, 1616117760, 2, 0,
134.3351 +	(long *)_vq_quantlist__44p3_p4_0,
134.3352 +	0
134.3353 +};
134.3354 +
134.3355 +static const long _vq_quantlist__44p3_p4_1[] = {
134.3356 +	2,
134.3357 +	1,
134.3358 +	3,
134.3359 +	0,
134.3360 +	4,
134.3361 +};
134.3362 +
134.3363 +static const long _vq_lengthlist__44p3_p4_1[] = {
134.3364 +	 3, 4, 5, 8, 8,12,10,10,12,12,12,10,10,12,12,13,
134.3365 +	11,11,12,12,13,12,12,12,12,13,10,10,13,13,13,13,
134.3366 +	13,13,13,13,10,10,13,13,13,11,11,13,13,14,13,13,
134.3367 +	12,12,13,10,10,13,13,13,13,13,13,13,13,10,10,12,
134.3368 +	12,13,11,11,13,13,13,13,13,12,12,13,12,12,13,13,
134.3369 +	13,13,13,13,13,14,11,11,12,12,14,12,12,13,12,14,
134.3370 +	14,14,12,12,13,14,14,13,13,14,13,13,13,13,14,14,
134.3371 +	14,12,12,14,13,13,13,13,14,14,14,12,12,12, 8, 8,
134.3372 +	11,11,12,12,12,11,11,12,11,11,10,10,13,12,12,10,
134.3373 +	10,13,12,12,10,10,13,12,12,12,12,14,12,12,12,12,
134.3374 +	13,13,13,11,11,14,12,12,11,11,14,12,12,12,12,14,
134.3375 +	12,12,12,12,13,12,12,12,12,13,13,13,11,11,14,12,
134.3376 +	12,11,11,14,12,12,12,12,14,13,13,12,12,14,12,12,
134.3377 +	12,11,14,13,13,11,11,14,13,12,11,11,14,13,13,11,
134.3378 +	11,14,13,13,12,12,14,12,12,12,12,15,13,13,12,12,
134.3379 +	14,12,12,11,11,14,13,13,11,11,12, 9, 9,10,10,12,
134.3380 +	 7, 7,11,11,12, 9, 9,12,12,13,10,10,10,10,14,14,
134.3381 +	14,11,11,13, 9, 9,12,12,14,14,14,12,12,13, 8, 8,
134.3382 +	11,11,14, 9, 9,12,12,14,14,14,11,11,13, 9, 9,12,
134.3383 +	12,14,14,14,12,12,14, 8, 8,11,11,14, 9, 9,12,12,
134.3384 +	14,14,14,11,11,14,10,10,12,12,14,14,14,13,13,14,
134.3385 +	 9, 9,11,11,14,10,10,12,12,14,14,14,11,11,14,14,
134.3386 +	15,12,12,15,14,14,14,14,15,14,14,11,11,14,14,14,
134.3387 +	12,12,14,14,14,11,11,14,11,11,10,10,14,10,10,10,
134.3388 +	10,14,10,10,10,10,15,11,11, 9, 9,14,12,12, 9, 9,
134.3389 +	15,11,11,11,11,15,13,13,11,11,15,10,10,10,10,15,
134.3390 +	11,11,10,10,15,13,13,11,11,15,11,11,11,11,15,13,
134.3391 +	13,11,11,15,10,10,10,10,15,11,11,10,10,15,13,13,
134.3392 +	11,11,15,12,12,11,11,15,13,13,11,11,15,11,11,10,
134.3393 +	10,15,12,12,10,10,15,13,13,10,10,15,14,14,11,11,
134.3394 +	15,13,13,11,11,15,14,14,10,11,15,13,13,10,10,15,
134.3395 +	13,14,10,10,14,13,13,10,10,14,13,13,10,10,14,13,
134.3396 +	13,10,10,14,13,13, 9, 9,14,14,14, 9, 9,15,14,14,
134.3397 +	11,11,15,14,14,10,10,15,14,14,10,10,15,14,14,11,
134.3398 +	11,15,14,14,10,10,15,14,14,11,11,15,14,14,10,10,
134.3399 +	14,14,14,10,10,15,14,14,10,10,14,14,14,10,10,15,
134.3400 +	14,14,11,11,15,14,14,11,11,14,14,14,10,10,15,14,
134.3401 +	14,10,10,14,14,14, 9, 9,15,15,15,11,11,15,14,14,
134.3402 +	12,12,15,15,14,10,10,15,14,14,10,10,14,15,15, 9,
134.3403 +	 9,14,10,10,12,12,17, 9, 9,12,12,17,10,10,13,13,
134.3404 +	17,11,11,12,12,18,14,14,12,12,17,10,10,13,13,17,
134.3405 +	14,14,12,12,17, 9, 9,12,12,17,11,11,12,12,17,14,
134.3406 +	14,12,12,18,10,10,13,13,18,14,14,13,13,18, 9, 9,
134.3407 +	12,12,18,10,10,13,13,18,14,14,12,12,18,11,11,13,
134.3408 +	13,18,14,14,13,13,18,10,10,12,12,17,11,11,12,12,
134.3409 +	17,14,14,12,12,18,15,15,13,13,18,14,14,14,14,18,
134.3410 +	15,15,12,12,18,14,14,12,12,18,15,15,12,12,13, 7,
134.3411 +	 7,11,11,14,15,15,11,11,14,15,15,12,12,14,15,15,
134.3412 +	11,11,15,15,15,11,11,14,15,15,12,12,14,15,15,12,
134.3413 +	12,14,15,15,11,11,14,15,15,11,11,15,15,15,12,12,
134.3414 +	14,15,15,12,12,14,15,15,12,12,14,15,15,11,11,14,
134.3415 +	15,15,11,11,15,15,15,12,12,15,15,15,12,12,14,15,
134.3416 +	15,12,12,14,15,14,12,12,14,15,15,11,11,15,14,14,
134.3417 +	12,12,15,15,15,12,12,15,16,16,12,12,15,15,15,12,
134.3418 +	12,15,15,15,12,12,15,15,15,12,12,13,13,13,11,10,
134.3419 +	14,14,15,11,11,14,14,14,12,12,15,14,14,10,10,15,
134.3420 +	15,15,11,11,14,15,15,12,12,14,14,14,11,11,14,15,
134.3421 +	15,11,11,14,15,15,12,12,15,15,15,11,11,14,15,15,
134.3422 +	12,12,14,14,14,12,12,14,15,15,11,11,14,15,15,12,
134.3423 +	12,15,15,15,11,11,15,15,15,12,12,15,14,14,12,12,
134.3424 +	14,15,15,11,11,14,15,15,11,11,15,15,15,10,10,15,
134.3425 +	15,16,12,12,15,15,15,14,14,15,15,15,11,11,15,15,
134.3426 +	15,12,12,15,15,15,11,11,14,11,11,10,10,15, 9, 9,
134.3427 +	12,12,15,10,10,12,12,15,11,11,11,11,15,14,14,12,
134.3428 +	12,15,10,10,13,13,15,14,14,12,12,15, 9, 9,12,12,
134.3429 +	15,10,10,13,13,15,13,13,12,11,15,10,10,12,12,15,
134.3430 +	14,14,12,12,15, 9, 9,11,11,15,11,11,12,12,15,13,
134.3431 +	13,11,11,15,11,11,13,13,15,13,14,13,14,15,11,11,
134.3432 +	11,11,15,11,11,12,12,15,14,14,11,11,15,14,14,13,
134.3433 +	13,15,14,14,20,20,15,14,14,12,12,15,14,14,12,12,
134.3434 +	15,14,14,11,11,14,13,13,10,10,14,13,13,12,12,14,
134.3435 +	14,13,12,12,15,14,14,12,12,15,14,14,11,11,15,14,
134.3436 +	14,12,12,15,14,14,13,13,15,14,14,12,11,15,14,14,
134.3437 +	11,11,15,14,14,13,13,15,14,14,12,12,15,14,14,13,
134.3438 +	13,15,14,14,12,11,15,14,14,12,12,15,14,14,13,13,
134.3439 +	15,14,14,13,13,15,14,14,12,12,15,14,14,12,12,15,
134.3440 +	14,14,12,12,15,15,15,13,13,15,15,15,13,13,15,14,
134.3441 +	14,13,13,15,15,15,13,13,15,14,15,12,12,15,15,15,
134.3442 +	13,13,14,10,10,12,13,17, 9, 9,12,12,17,10,10,13,
134.3443 +	13,17,11,11,12,12,18,14,14,12,12,18,10,10,13,13,
134.3444 +	18,14,14,12,12,17, 9, 9,12,12,18,10,11,13,13,18,
134.3445 +	14,14,12,12,17,10,10,12,12,17,14,14,12,12,17, 9,
134.3446 +	 9,12,12,17,11,11,12,12,17,14,14,12,12,18,11,11,
134.3447 +	12,12,18,14,14,13,13,18,11,11,12,12,18,11,11,12,
134.3448 +	12,18,14,14,12,12,18,15,15,12,12,18,14,14,13,13,
134.3449 +	18,15,15,12,12,17,14,14,12,12,17,15,15,12,12,13,
134.3450 +	 7, 7,11,11,14,15,15,11,11,14,15,15,11,11,14,15,
134.3451 +	14,12,12,15,15,15,12,11,14,15,15,12,12,14,15,15,
134.3452 +	12,12,14,15,15,11,11,14,15,15,11,11,15,15,15,13,
134.3453 +	13,14,15,15,11,11,14,15,15,13,12,14,15,15,11,11,
134.3454 +	14,15,15,11,11,15,15,15,13,13,14,15,15,12,12,15,
134.3455 +	15,15,12,12,15,15,15,11,11,15,15,15,11,11,15,15,
134.3456 +	15,12,12,15,15,15,13,13,15,16,16,12,12,15,15,15,
134.3457 +	12,13,15,15,15,12,12,15,15,15,12,12,13,13,13,11,
134.3458 +	11,14,14,14,11,11,14,14,14,12,12,14,14,14,10,10,
134.3459 +	15,14,14,11,11,14,15,15,12,12,14,14,14,12,12,14,
134.3460 +	15,15,11,11,14,15,14,12,12,15,14,14,11,11,14,15,
134.3461 +	15,12,12,14,14,14,11,11,14,15,15,11,11,14,14,14,
134.3462 +	12,12,15,15,14,11,11,15,15,15,12,12,15,14,14,12,
134.3463 +	12,14,15,15,11,11,14,15,14,11,11,15,15,15,10,10,
134.3464 +	15,15,15,12,12,15,14,14,14,13,15,15,15,11,11,15,
134.3465 +	15,15,11,11,15,15,15,10,10,14,11,11,10,10,15, 9,
134.3466 +	 9,12,12,15,10,10,12,12,15,11,11,11,11,15,14,14,
134.3467 +	12,12,15,10,10,13,13,15,13,13,12,12,15, 9, 9,12,
134.3468 +	12,15,11,11,13,13,15,14,14,12,12,15,10,10,13,13,
134.3469 +	15,13,14,12,12,15, 9, 9,12,12,15,10,10,13,13,15,
134.3470 +	13,13,11,11,15,11,11,13,13,15,14,14,13,13,15,10,
134.3471 +	10,11,11,15,11,11,12,12,15,14,14,11,11,15,14,14,
134.3472 +	13,13,15,14,14,21,20,15,14,14,11,11,15,14,14,12,
134.3473 +	12,15,14,14,11,11,14,13,13,10,10,14,13,13,11,11,
134.3474 +	15,14,14,12,12,15,14,14,12,12,14,14,14,12,12,15,
134.3475 +	14,14,12,12,15,14,14,13,13,14,14,14,11,11,15,14,
134.3476 +	14,11,11,15,14,14,13,13,15,14,14,12,12,15,14,14,
134.3477 +	13,13,14,14,14,11,11,15,14,14,11,11,14,14,14,13,
134.3478 +	13,15,14,14,12,12,15,14,14,12,12,15,14,14,12,12,
134.3479 +	15,14,14,12,12,14,14,14,13,13,15,15,15,13,13,16,
134.3480 +	14,14,12,13,15,15,15,13,13,15,14,14,12,12,15,15,
134.3481 +	15,13,13,15,11,11,13,12,18,10,10,12,12,17,11,11,
134.3482 +	12,12,18,12,12,11,11,18,14,14,12,12,18,11,11,13,
134.3483 +	13,17,14,14,12,12,18,10,10,12,12,18,12,12,12,12,
134.3484 +	18,14,15,12,12,18,11,11,13,13,18,14,14,12,12,17,
134.3485 +	10,10,12,12,18,11,11,12,12,18,15,14,12,12,17,12,
134.3486 +	12,12,12,17,14,14,12,12,17,11,11,11,11,17,12,12,
134.3487 +	12,11,17,15,15,11,11,18,15,15,12,12,18,14,15,13,
134.3488 +	13,18,15,15,11,11,17,15,15,12,12,18,15,15,11,11,
134.3489 +	14, 9, 9,11,11,14,15,15,11,11,15,15,15,11,11,15,
134.3490 +	15,15,12,11,15,15,15,12,12,15,15,15,11,11,15,15,
134.3491 +	15,13,13,14,15,15,11,11,15,15,15,11,11,15,15,15,
134.3492 +	13,13,15,15,15,11,11,15,15,15,13,13,15,15,15,11,
134.3493 +	11,15,15,15,11,11,15,15,15,13,13,15,15,15,12,12,
134.3494 +	15,15,15,13,13,15,15,14,11,11,15,15,15,12,12,15,
134.3495 +	15,15,12,12,16,15,15,13,13,15,16,16,13,13,16,15,
134.3496 +	15,12,12,15,15,15,13,12,15,15,15,12,12,13,12,12,
134.3497 +	11,11,14,14,14,11,11,14,14,14,12,12,15,14,14,11,
134.3498 +	11,15,14,14,12,12,15,14,14,12,12,15,14,14,12,12,
134.3499 +	14,15,15,11,11,15,14,14,12,12,15,14,14,11,11,15,
134.3500 +	14,14,12,12,15,14,14,12,12,14,15,15,11,11,15,14,
134.3501 +	14,12,12,15,14,14,11,11,15,15,15,12,12,15,14,14,
134.3502 +	12,12,15,15,15,11,11,15,14,14,11,11,15,14,15,11,
134.3503 +	11,15,15,15,12,12,15,14,14,13,13,16,15,15,11,11,
134.3504 +	15,14,14,12,12,15,15,15,11,11,14,11,11, 9, 9,15,
134.3505 +	10,10,12,12,14,11,11,12,12,15,12,12,12,12,15,14,
134.3506 +	14,13,13,15,11,11,13,13,15,14,14,13,13,15,10,10,
134.3507 +	12,12,15,12,12,13,13,15,14,14,13,13,15,11,11,12,
134.3508 +	12,15,14,14,13,13,14,10,10,12,12,15,12,12,13,13,
134.3509 +	15,14,14,12,12,15,12,12,13,13,15,14,14,15,15,15,
134.3510 +	11,11,12,12,15,12,12,12,13,15,14,14,12,12,15,15,
134.3511 +	15,14,14,15,14,14,20,20,15,14,14,12,12,15,14,14,
134.3512 +	13,13,15,14,14,12,12,14,13,13,10,10,14,13,13,11,
134.3513 +	11,14,13,13,12,12,14,14,14,12,12,15,14,14,13,13,
134.3514 +	15,14,14,12,12,14,14,14,14,14,14,14,14,11,11,15,
134.3515 +	14,14,12,12,15,14,14,14,14,15,14,14,12,12,14,14,
134.3516 +	14,14,14,14,14,14,11,11,15,14,14,12,12,14,14,14,
134.3517 +	14,14,15,14,14,12,12,15,14,14,13,13,15,14,14,12,
134.3518 +	12,15,14,14,12,12,14,14,14,14,13,15,15,15,14,14,
134.3519 +	15,14,14,13,13,15,15,15,14,14,15,14,14,13,13,15,
134.3520 +	15,15,13,13,14,13,13,13,13,18,15,15,12,12,18,15,
134.3521 +	15,13,12,18,15,16,11,11,18,16,17,12,12,18,15,15,
134.3522 +	13,13,18,17,17,12,12,18,15,15,12,12,17,15,15,12,
134.3523 +	12,18,17,17,12,12,18,15,15,13,13,18,16,17,12,12,
134.3524 +	17,15,15,12,12,18,15,15,12,12,18,16,17,11,12,18,
134.3525 +	16,16,12,12,17,16,17,12,12,18,15,15,11,11,18,15,
134.3526 +	15,12,12,18,17,17,11,11,17,17,17,12,12,18,16,16,
134.3527 +	13,13,18,17,17,11,11,18,16,16,12,12,18,17,17,11,
134.3528 +	11,15,14,14,11,11,16,15,15,11,11,16,15,15,12,12,
134.3529 +	16,15,15,12,12,17,15,15,14,13,16,15,15,12,12,17,
134.3530 +	15,15,14,14,16,15,15,11,11,16,15,15,12,12,18,15,
134.3531 +	15,13,13,16,15,15,11,11,17,15,15,14,14,16,15,15,
134.3532 +	11,11,16,15,15,12,12,17,15,15,13,13,16,15,15,12,
134.3533 +	12,17,16,15,14,14,16,14,15,12,12,16,15,15,12,12,
134.3534 +	18,15,15,13,13,17,15,15,14,14,17,16,16,15,15,17,
134.3535 +	15,15,13,13,17,15,15,14,14,18,15,15,13,13,15,12,
134.3536 +	13,11,11,15,14,14,12,12,16,14,14,12,12,16,14,14,
134.3537 +	12,12,16,14,14,12,12,16,14,14,13,12,17,14,14,13,
134.3538 +	13,16,15,15,12,12,16,14,14,12,12,17,14,14,12,12,
134.3539 +	16,14,14,12,12,17,14,14,13,13,15,15,15,12,12,16,
134.3540 +	14,14,12,12,17,14,14,12,12,17,15,15,12,12,17,14,
134.3541 +	14,13,13,16,15,15,12,12,16,14,14,12,12,17,15,15,
134.3542 +	12,12,18,15,15,13,13,17,14,14,13,13,17,15,15,12,
134.3543 +	12,17,14,14,12,12,17,15,15,12,12,14,15,15, 9, 9,
134.3544 +	15,15,15,12,12,15,15,15,13,13,15,15,15,14,14,15,
134.3545 +	15,15,19,19,15,15,16,13,13,15,15,16,19,20,15,15,
134.3546 +	15,13,12,15,16,16,14,14,15,15,15,19,19,15,15,15,
134.3547 +	13,13,15,16,15,20,19,14,15,15,13,13,15,15,15,14,
134.3548 +	14,15,15,15,19,19,15,15,15,14,14,15,16,16,19,20,
134.3549 +	15,15,15,14,14,15,15,15,14,14,15,15,15,19,19,15,
134.3550 +	15,15,20,19,15,16,16,20,19,15,15,15,19,19,15,16,
134.3551 +	16,20,20,15,15,15,19,20,14,13,13,10,10,14,14,14,
134.3552 +	11,11,14,14,14,12,12,15,14,14,13,13,15,14,14,19,
134.3553 +	20,15,14,14,12,12,14,14,14,20,19,14,14,14,11,11,
134.3554 +	15,14,14,12,12,15,14,14,20,20,15,14,14,12,12,14,
134.3555 +	14,14,20,19,14,14,14,11,11,15,14,14,12,12,15,14,
134.3556 +	14,19,20,15,14,14,13,13,15,14,14,22,19,15,15,14,
134.3557 +	12,12,15,14,14,13,13,14,15,15,22,20,15,15,15,20,
134.3558 +	20,15,14,14,21,20,15,15,15,20,21,15,14,14,20,20,
134.3559 +	14,15,15,20,20,
134.3560 +};
134.3561 +
134.3562 +static const static_codebook _44p3_p4_1 = {
134.3563 +	5, 3125,
134.3564 +	(long *)_vq_lengthlist__44p3_p4_1,
134.3565 +	1, -533725184, 1611661312, 3, 0,
134.3566 +	(long *)_vq_quantlist__44p3_p4_1,
134.3567 +	0
134.3568 +};
134.3569 +
134.3570 +static const long _vq_quantlist__44p3_p5_0[] = {
134.3571 +	2,
134.3572 +	1,
134.3573 +	3,
134.3574 +	0,
134.3575 +	4,
134.3576 +};
134.3577 +
134.3578 +static const long _vq_lengthlist__44p3_p5_0[] = {
134.3579 +	 2, 6, 6,14,14, 6, 7, 7,14,14, 7, 7, 7,15,15, 0,
134.3580 +	12,12,15,15, 0,13,13,15,15, 7, 8, 8,15,15,10,10,
134.3581 +	10,16,16, 9, 8, 8,15,15, 0,13,13,18,17, 0,13,13,
134.3582 +	16,16, 8, 8, 8,15,15,12,11,11,16,16, 9, 8, 8,15,
134.3583 +	15, 0,13,13,18,18, 0,13,13,16,16, 0,14,14,17,17,
134.3584 +	 0,20, 0,19,20, 0,12,12,16,16, 0,16,16,20,22, 0,
134.3585 +	14,14,16,16, 0,14,14,17,17, 0,20,22,20,19, 0,13,
134.3586 +	13,15,16, 0,17,18, 0,21, 0,15,15,16,16, 5, 7, 7,
134.3587 +	13,13, 8, 9, 9,14,14,10,10,10,14,14, 0,20,22,18,
134.3588 +	18, 0,22,21,18,17, 9,10,10,14,14,12,12,12,17,17,
134.3589 +	12,10,10,14,14, 0, 0,20,17,17, 0,22,21,17,18,11,
134.3590 +	10,10,14,14,14,13,13,18,18,12,11,11,14,14, 0,22,
134.3591 +	21,18,19, 0,20, 0,17,17, 0,22, 0,18,18, 0, 0, 0,
134.3592 +	 0, 0, 0,20,20,17,17, 0,22, 0,22,21, 0,21, 0,19,
134.3593 +	18, 0,22,22,18,18, 0, 0, 0, 0, 0, 0,21, 0,17,17,
134.3594 +	 0,22, 0,20,20, 0, 0, 0,19,18, 6, 6, 6,12,12, 8,
134.3595 +	 6, 6,10,10, 8, 6, 6,13,12, 0,10,10,11,11, 0,11,
134.3596 +	11,13,13, 8, 7, 7,13,13,11, 9, 9,13,13,10, 6, 6,
134.3597 +	12,12, 0,10,10,14,14, 0,10,10,13,13, 9, 7, 7,13,
134.3598 +	13,12,10,10,13,13,10, 6, 6,12,12, 0,11,11,15,15,
134.3599 +	 0,10,10,13,13, 0,12,12,15,14, 0,19,20,16,17, 0,
134.3600 +	 9, 9,13,13, 0,14,14,20,21, 0,12,11,13,12, 0,12,
134.3601 +	12,15,14, 0,20,19,17,17, 0,10,10,12,13, 0,15,15,
134.3602 +	22,21, 0,12,12,12,13, 0,10,10,12,12, 0,11,11,15,
134.3603 +	15, 0,11,11,15,15, 0,15,15,22,22, 0,16,17, 0, 0,
134.3604 +	 0,11,11,15,15, 0,14,14,18,18, 0,11,11,16,16, 0,
134.3605 +	16,15, 0,21, 0,16,16, 0, 0, 0,12,12,15,15, 0,14,
134.3606 +	14,19,19, 0,11,11,15,15, 0,15,15,22, 0, 0,16,16,
134.3607 +	22, 0, 0,16,16, 0,21, 0, 0, 0, 0, 0, 0,15,15,19,
134.3608 +	20, 0,18,18, 0, 0, 0,17,17, 0, 0, 0,17,17, 0, 0,
134.3609 +	 0, 0, 0, 0, 0, 0,16,15,22,21, 0,20,20, 0, 0, 0,
134.3610 +	18,18, 0, 0, 0,10,10,12,12, 0,10,10,11,11, 0,11,
134.3611 +	11,12,12, 0,11,11, 9, 9, 0,13,12,12,12, 0,11,11,
134.3612 +	13,13, 0,13,13,12,12, 0,10,10,12,12, 0,13,12,13,
134.3613 +	13, 0,12,12,12,12, 0,11,11,13,13, 0,13,13,12,12,
134.3614 +	 0,10,10,12,12, 0,13,13,14,13, 0,12,12,12,12, 0,
134.3615 +	14,13,13,14, 0,20,21,15,15, 0,11,11,12,12, 0,15,
134.3616 +	16,20,20, 0,12,13,10,10, 0,13,13,14,13, 0,20,20,
134.3617 +	15,15, 0,11,11,12,12, 0,16,17,21,21, 0,13,13,11,
134.3618 +	11, 6, 7, 7,16,15,11, 9, 9,14,15,12, 9, 9,16,16,
134.3619 +	 0,13,13,15,15, 0,14,14,17,17,10, 9, 9,16,16,14,
134.3620 +	12,12,16,16,12, 9, 9,15,15, 0,13,13,17,18, 0,13,
134.3621 +	13,15,15,12,10,10,17,17,15,12,12,17,17,13, 9, 9,
134.3622 +	16,16, 0,13,13,18,19, 0,14,14,16,16, 0,15,15,18,
134.3623 +	18, 0, 0, 0,20,19, 0,12,12,17,16, 0,16,17, 0,21,
134.3624 +	 0,14,15,16,16, 0,15,15,18,18, 0, 0,22,19,21, 0,
134.3625 +	13,13,16,16, 0,18,17,22,22, 0,15,15,16,16, 7, 7,
134.3626 +	 7,13,13,11,10,10,15,15,12,10,10,14,14, 0,21, 0,
134.3627 +	18,17, 0,21,22,18,18,11,10,10,15,15,14,12,12,17,
134.3628 +	17,14,11,11,14,14, 0,21,20,18,18, 0,22,21,18,17,
134.3629 +	12,11,10,16,16,16,14,14,17,19,14,11,11,15,15, 0,
134.3630 +	 0,22,19,19, 0,21,22,18,18, 0,21, 0,18,19, 0, 0,
134.3631 +	 0,22, 0, 0,22,21,17,17, 0, 0, 0,20,22, 0, 0,21,
134.3632 +	18,18, 0, 0, 0,19,20, 0, 0, 0, 0, 0, 0, 0,21,17,
134.3633 +	17, 0, 0, 0,22,21, 0, 0, 0,19,19,10, 9, 9,14,13,
134.3634 +	13,10,10,12,12,13,10,10,14,14, 0,13,13,12,12, 0,
134.3635 +	15,14,16,15,13,10,10,14,14,15,12,12,14,14,15,10,
134.3636 +	10,14,14, 0,14,14,15,15, 0,14,13,14,14,13,10,10,
134.3637 +	15,15,17,13,13,15,15,14,10,10,14,14, 0,14,14,15,
134.3638 +	16, 0,14,14,15,15, 0,15,15,16,16, 0,21,22,17,18,
134.3639 +	 0,12,12,14,14, 0,17,17,20,21, 0,14,14,14,14, 0,
134.3640 +	15,15,16,16, 0,21,22,18,18, 0,13,13,14,14, 0,18,
134.3641 +	18,22, 0, 0,15,15,14,14, 0,11,11,13,13, 0,12,12,
134.3642 +	16,15, 0,12,12,16,16, 0,16,16, 0, 0, 0,16,17, 0,
134.3643 +	22, 0,12,12,16,16, 0,14,14,17,18, 0,11,11,16,16,
134.3644 +	 0,15,15, 0,21, 0,16,16,21,22, 0,12,12,16,16, 0,
134.3645 +	15,15,19,19, 0,12,12,17,16, 0,16,16,21,22, 0,16,
134.3646 +	16, 0, 0, 0,17,17, 0,22, 0, 0, 0, 0, 0, 0,15,15,
134.3647 +	19,20, 0,17,19, 0, 0, 0,17,17,22, 0, 0,17,17, 0,
134.3648 +	22, 0, 0, 0, 0, 0, 0,15,15,21, 0, 0,19,20, 0, 0,
134.3649 +	 0,19,18,22, 0, 0,11,12,14,14, 0,11,11,14,14, 0,
134.3650 +	12,12,15,15, 0,13,13,13,13, 0,14,14,16,16, 0,12,
134.3651 +	12,15,15, 0,14,14,16,15, 0,11,11,15,15, 0,13,13,
134.3652 +	16,16, 0,13,13,15,15, 0,12,12,15,15, 0,15,14,16,
134.3653 +	16, 0,11,11,15,15, 0,14,14,17,17, 0,13,13,15,15,
134.3654 +	 0,15,15,16,16, 0, 0, 0,18,18, 0,12,12,14,14, 0,
134.3655 +	16,16,22, 0, 0,14,14,15,15, 0,15,15,16,17, 0,21,
134.3656 +	22,18,18, 0,13,13,15,14, 0,18,17,22, 0, 0,14,14,
134.3657 +	15,15, 8, 8, 8,16,15,12,10,10,16,15,12,10,10,16,
134.3658 +	16, 0,14,14,16,17, 0,14,14,17,16,12,10,10,17,18,
134.3659 +	14,12,12,18,18,14,10,10,16,16, 0,14,14,18,18, 0,
134.3660 +	14,14,16,16,12, 9, 9,16,16,17,13,13,16,17,14, 9,
134.3661 +	 9,15,15, 0,14,14,18,19, 0,13,13,15,15, 0,15,15,
134.3662 +	18,19, 0, 0, 0,22,21, 0,13,13,16,16, 0,16,16,22,
134.3663 +	 0, 0,15,15,16,16, 0,14,14,18,17, 0, 0, 0,20, 0,
134.3664 +	 0,13,13,16,16, 0,18,18, 0, 0, 0,15,15,16,16, 8,
134.3665 +	 7, 7,13,13,12,10,10,15,15,12,10,10,14,14, 0,22,
134.3666 +	22,19,18, 0, 0, 0,18,18,12,10,10,15,15,14,13,13,
134.3667 +	17,17,14,11,11,15,15, 0,19,20,18,18, 0,22,21,17,
134.3668 +	18,13,11,11,15,15,16,13,13,18,18,14,11,11,14,15,
134.3669 +	 0,22,21,20,19, 0,22,21,17,17, 0, 0,22,19,18, 0,
134.3670 +	 0, 0, 0, 0, 0,22,20,17,17, 0, 0, 0,21,20, 0, 0,
134.3671 +	 0,19,17, 0, 0,22,19,19, 0, 0, 0, 0, 0, 0,22,20,
134.3672 +	18,17, 0, 0, 0, 0, 0, 0, 0, 0,18,18, 0,10,10,14,
134.3673 +	14, 0,11,11,14,14, 0,11,11,15,15, 0,14,14,14,14,
134.3674 +	 0,15,15,16,16, 0,11,11,16,16, 0,13,13,16,16, 0,
134.3675 +	11,11,15,15, 0,14,14,16,16, 0,14,14,15,15, 0,11,
134.3676 +	11,15,15, 0,13,13,15,15, 0,10,10,15,15, 0,15,15,
134.3677 +	17,17, 0,14,14,14,14, 0,16,16,16,16, 0, 0,22,19,
134.3678 +	19, 0,13,13,14,14, 0,17,17, 0, 0, 0,15,15,14,14,
134.3679 +	 0,16,16,17,17, 0, 0,22,18,18, 0,13,13,14,14, 0,
134.3680 +	21,18, 0, 0, 0,15,15,14,14, 0,11,11,13,13, 0,12,
134.3681 +	12,15,15, 0,12,12,16,15, 0,16,16, 0, 0, 0,17,17,
134.3682 +	22,22, 0,12,12,16,16, 0,14,14,18,18, 0,11,12,16,
134.3683 +	16, 0,15,16, 0,21, 0,16,16,22,21, 0,12,12,16,16,
134.3684 +	 0,15,15,19,20, 0,11,12,16,16, 0,15,15,20,22, 0,
134.3685 +	16,16, 0,22, 0,17,17,22, 0, 0, 0, 0, 0, 0, 0,15,
134.3686 +	15,21,22, 0,19,18, 0, 0, 0,17,17, 0, 0, 0,17,17,
134.3687 +	 0,22, 0, 0, 0, 0, 0, 0,16,15,22, 0, 0,19,19, 0,
134.3688 +	 0, 0,17,18, 0, 0, 0,12,12,15,15, 0,12,12,15,15,
134.3689 +	 0,12,12,15,15, 0,13,13,14,14, 0,15,15,16,17, 0,
134.3690 +	12,12,16,16, 0,14,14,16,16, 0,12,11,15,16, 0,14,
134.3691 +	14,16,17, 0,14,14,16,16, 0,13,12,16,16, 0,15,15,
134.3692 +	16,16, 0,11,11,15,15, 0,14,14,16,16, 0,14,14,15,
134.3693 +	15, 0,15,15,18,17, 0, 0,22, 0,20, 0,13,13,15,15,
134.3694 +	 0,16,17,22,22, 0,14,14,15,15, 0,15,15,17,18, 0,
134.3695 +	20, 0,19,19, 0,13,13,15,15, 0,18,18,22, 0, 0,14,
134.3696 +	14,15,15, 0,11,11,16,16, 0,14,14,17,16, 0,13,13,
134.3697 +	17,17, 0,16,16,17,17, 0,17,17,18,19, 0,12,12,16,
134.3698 +	17, 0,15,15,18,18, 0,12,12,16,16, 0,16,16,19,18,
134.3699 +	 0,16,16,17,16, 0,12,13,17,17, 0,17,16,18,17, 0,
134.3700 +	13,12,16,16, 0,16,16,18,19, 0,16,16,16,17, 0,16,
134.3701 +	16,18,18, 0,22, 0,22,22, 0,13,13,16,16, 0,19,18,
134.3702 +	22,20, 0,16,15,16,16, 0,16,17,18,18, 0, 0, 0,22,
134.3703 +	20, 0,14,14,16,16, 0,19,19, 0, 0, 0,16,16,16,16,
134.3704 +	 0, 9, 9,13,13, 0,13,13,15,15, 0,14,14,15,15, 0,
134.3705 +	 0,22,17,18, 0,22, 0,18,19, 0,12,12,15,15, 0,15,
134.3706 +	16,17,17, 0,14,14,14,14, 0,22, 0,18,18, 0,21,22,
134.3707 +	17,17, 0,13,13,15,15, 0,17,17,17,18, 0,14,14,15,
134.3708 +	15, 0,22,21,21,19, 0,20,21,17,17, 0,21,21,19,18,
134.3709 +	 0, 0, 0, 0, 0, 0,21,21,17,17, 0, 0, 0,22,22, 0,
134.3710 +	 0,22,19,18, 0, 0,21,19,18, 0, 0, 0, 0,22, 0,19,
134.3711 +	20,17,17, 0, 0, 0, 0,22, 0, 0, 0,19,18, 0,19,19,
134.3712 +	15,16, 0,21,19,16,17, 0, 0,21,17,17, 0, 0,22,17,
134.3713 +	17, 0,22,22,18,19, 0,20,20,16,16, 0, 0,22,18,18,
134.3714 +	 0,20,19,16,17, 0,22,21,20,19, 0, 0,21,17,17, 0,
134.3715 +	21,20,17,17, 0, 0, 0,18,18, 0,19,19,17,16, 0,22,
134.3716 +	 0,19,19, 0,21,22,17,18, 0, 0,22,19,18, 0, 0, 0,
134.3717 +	19,20, 0,19,19,16,16, 0,22,22,22, 0, 0,20,22,16,
134.3718 +	16, 0,22,20,18,19, 0, 0, 0,20,19, 0,20,20,16,16,
134.3719 +	 0, 0, 0, 0, 0, 0,22,20,17,16, 0,11,11,13,13, 0,
134.3720 +	14,13,15,15, 0,13,13,16,15, 0,18,17,21, 0, 0,18,
134.3721 +	18,21, 0, 0,12,12,15,15, 0,15,16,17,18, 0,12,12,
134.3722 +	15,15, 0,17,17,22,20, 0,17,18,22, 0, 0,12,12,17,
134.3723 +	16, 0,16,17,19,19, 0,13,13,16,16, 0,17,17, 0,22,
134.3724 +	 0,17,17, 0,21, 0,18,18,20,22, 0, 0, 0, 0, 0, 0,
134.3725 +	15,15,21,20, 0,20,19, 0, 0, 0,18,18,22, 0, 0,17,
134.3726 +	17,22, 0, 0, 0, 0, 0, 0, 0,15,16,20,22, 0,20,21,
134.3727 +	 0, 0, 0,19,18, 0, 0, 0,15,15,19,19, 0,17,16,20,
134.3728 +	20, 0,16,17,20,21, 0,18,17, 0, 0, 0,19,19, 0, 0,
134.3729 +	 0,15,15,21,19, 0,19,19, 0, 0, 0,15,15,22,22, 0,
134.3730 +	18,18, 0,22, 0,17,18,22,21, 0,15,15,20,19, 0,19,
134.3731 +	19, 0, 0, 0,15,15,20,22, 0,18,19,20, 0, 0,18,17,
134.3732 +	21,21, 0,18,18,19,22, 0, 0, 0, 0, 0, 0,15,15,20,
134.3733 +	19, 0,19,19, 0, 0, 0,18,18,21,22, 0,18,18,22, 0,
134.3734 +	 0, 0, 0, 0, 0, 0,15,15,19,20, 0,21,21, 0, 0, 0,
134.3735 +	17,17,20,20, 0,12,12,17,17, 0,14,14,16,17, 0,13,
134.3736 +	14,17,17, 0,16,16,17,17, 0,17,17,17,19, 0,13,13,
134.3737 +	17,17, 0,16,16,18,18, 0,13,13,16,16, 0,16,16,18,
134.3738 +	18, 0,16,16,17,17, 0,13,13,17,17, 0,17,17,18,17,
134.3739 +	 0,12,12,15,16, 0,17,18,19,20, 0,16,16,16,16, 0,
134.3740 +	17,16,18,19, 0, 0,22,21,22, 0,14,14,16,16, 0,19,
134.3741 +	19, 0, 0, 0,16,16,16,16, 0,16,16,18,17, 0, 0,22,
134.3742 +	21,21, 0,14,14,16,16, 0,22,20,22, 0, 0,16,16,15,
134.3743 +	15, 0, 9, 9,13,13, 0,14,14,15,15, 0,14,14,14,14,
134.3744 +	 0,22,22,18,18, 0, 0,22,18,18, 0,12,12,15,15, 0,
134.3745 +	16,16,18,17, 0,14,14,14,14, 0,20,21,18,18, 0,22,
134.3746 +	21,17,17, 0,13,13,15,15, 0,17,17,18,18, 0,14,14,
134.3747 +	14,14, 0, 0,21,18,19, 0, 0,22,17,17, 0,22,22,19,
134.3748 +	18, 0, 0, 0, 0, 0, 0,19,21,17,17, 0, 0, 0,22,20,
134.3749 +	 0, 0,21,18,19, 0, 0,22,18,18, 0, 0, 0, 0,22, 0,
134.3750 +	20,22,17,17, 0, 0, 0,20,22, 0, 0, 0,18,18, 0,19,
134.3751 +	21,16,16, 0,20,22,16,17, 0,20, 0,17,17, 0,22, 0,
134.3752 +	18,17, 0,21, 0,18,19, 0,20,20,17,17, 0,22, 0,18,
134.3753 +	18, 0,21,20,17,17, 0, 0,20,20,19, 0, 0,21,18,17,
134.3754 +	 0,21,21,17,17, 0,22, 0,18,17, 0,19,19,17,17, 0,
134.3755 +	 0,22,20,21, 0, 0,21,17,17, 0,22, 0,18,18, 0, 0,
134.3756 +	 0,20,22, 0,20,19,16,16, 0, 0, 0, 0, 0, 0,22,22,
134.3757 +	17,17, 0,22, 0,18,19, 0, 0, 0,21,20, 0,19,21,16,
134.3758 +	17, 0, 0, 0, 0, 0, 0,22,22,17,16, 0,11,11,13,13,
134.3759 +	 0,13,13,15,15, 0,13,13,15,15, 0,17,17,22,21, 0,
134.3760 +	18,18,22, 0, 0,12,13,16,15, 0,15,16,18,18, 0,13,
134.3761 +	13,16,16, 0,17,17, 0,22, 0,17,17,22,22, 0,13,13,
134.3762 +	16,16, 0,16,16,19,18, 0,13,13,16,16, 0,18,17, 0,
134.3763 +	20, 0,18,17,20, 0, 0,17,17,21, 0, 0, 0, 0, 0, 0,
134.3764 +	 0,15,15,21,22, 0,19,20, 0, 0, 0,18,18, 0, 0, 0,
134.3765 +	18,17, 0, 0, 0, 0, 0, 0, 0, 0,16,16,22,22, 0,20,
134.3766 +	20, 0, 0, 0,21,19, 0, 0, 0,15,15,20,19, 0,16,16,
134.3767 +	22,20, 0,17,17, 0,22, 0,18,18, 0,22, 0,19,17, 0,
134.3768 +	 0, 0,15,16,22,20, 0,18,19, 0, 0, 0,16,16,22,20,
134.3769 +	 0,18,18, 0,22, 0,18,18,22, 0, 0,16,16,21,20, 0,
134.3770 +	19,20, 0,22, 0,16,16, 0,22, 0,18,18, 0,22, 0,18,
134.3771 +	18, 0,21, 0,19,18, 0,22, 0, 0, 0, 0, 0, 0,16,16,
134.3772 +	21,20, 0,20, 0, 0, 0, 0,18,18,21, 0, 0,18,18, 0,
134.3773 +	 0, 0, 0, 0, 0, 0, 0,16,16,21,19, 0, 0, 0, 0, 0,
134.3774 +	 0,18,18, 0,21,
134.3775 +};
134.3776 +
134.3777 +static const static_codebook _44p3_p5_0 = {
134.3778 +	5, 3125,
134.3779 +	(long *)_vq_lengthlist__44p3_p5_0,
134.3780 +	1, -528744448, 1616642048, 3, 0,
134.3781 +	(long *)_vq_quantlist__44p3_p5_0,
134.3782 +	0
134.3783 +};
134.3784 +
134.3785 +static const long _vq_quantlist__44p3_p5_1[] = {
134.3786 +	3,
134.3787 +	2,
134.3788 +	4,
134.3789 +	1,
134.3790 +	5,
134.3791 +	0,
134.3792 +	6,
134.3793 +};
134.3794 +
134.3795 +static const long _vq_lengthlist__44p3_p5_1[] = {
134.3796 +	 2, 3, 3, 3, 3, 3, 3,
134.3797 +};
134.3798 +
134.3799 +static const static_codebook _44p3_p5_1 = {
134.3800 +	1, 7,
134.3801 +	(long *)_vq_lengthlist__44p3_p5_1,
134.3802 +	1, -533200896, 1611661312, 3, 0,
134.3803 +	(long *)_vq_quantlist__44p3_p5_1,
134.3804 +	0
134.3805 +};
134.3806 +
134.3807 +static const long _vq_quantlist__44p3_p6_0[] = {
134.3808 +	1,
134.3809 +	0,
134.3810 +	2,
134.3811 +};
134.3812 +
134.3813 +static const long _vq_lengthlist__44p3_p6_0[] = {
134.3814 +	 1, 6, 6, 7, 7, 7, 7, 8, 8, 7, 9, 9,11,11,11, 9,
134.3815 +	 8, 8, 8, 9, 9,12,11,11, 9, 8, 8, 6, 7, 7,10,11,
134.3816 +	10,10,10,10,11,11,10,14,13,14,12,11,11,11,11,11,
134.3817 +	15,14,14,13,12,12, 5, 6, 6, 8, 5, 5, 8, 7, 7, 8,
134.3818 +	 8, 8,12,10,10, 9, 7, 7, 9, 7, 8,12,10,10,10, 7,
134.3819 +	 7, 7, 8, 8,12,10,10,12,10,10,11,10,10,15,13,13,
134.3820 +	13,10,10,11,10,10,16,13,14,14,10,10, 7, 7, 7,12,
134.3821 +	11,11,12,11,11,11,11,11,16,15,15,14,12,12,12,11,
134.3822 +	11,16,15,16,14,12,12,10, 9, 9,14,11,11,13,11,11,
134.3823 +	12,11,11,16,14,14,14,11,11,12,11,11,17,15,15,14,
134.3824 +	11,11, 7, 8, 8,12,11,11,12,10,10,12,10,10,16,14,
134.3825 +	13,14,10,10,12,10,10,17,14,14,14,10,10, 8, 7, 7,
134.3826 +	13,11,11,12,11,11,12,11,11,16,15,14,14,12,12,12,
134.3827 +	11,11,16,15,14,15,12,12,11,10,10,13,11,11,13,12,
134.3828 +	11,13,11,11,17,14,14,14,11,11,13,11,11,17,14,15,
134.3829 +	14,11,11,
134.3830 +};
134.3831 +
134.3832 +static const static_codebook _44p3_p6_0 = {
134.3833 +	5, 243,
134.3834 +	(long *)_vq_lengthlist__44p3_p6_0,
134.3835 +	1, -527106048, 1620377600, 2, 0,
134.3836 +	(long *)_vq_quantlist__44p3_p6_0,
134.3837 +	0
134.3838 +};
134.3839 +
134.3840 +static const long _vq_quantlist__44p3_p6_1[] = {
134.3841 +	1,
134.3842 +	0,
134.3843 +	2,
134.3844 +};
134.3845 +
134.3846 +static const long _vq_lengthlist__44p3_p6_1[] = {
134.3847 +	 2, 6, 6, 7, 7, 7, 7, 7, 7, 7, 8, 8, 9, 9, 9, 9,
134.3848 +	 7, 7, 8, 8, 8, 9, 9, 9, 9, 7, 8, 6, 7, 7, 8, 8,
134.3849 +	 8, 8, 8, 8, 9, 8, 8,10, 9, 9,10, 8, 8,10, 8, 8,
134.3850 +	10, 9, 9,10, 8, 8, 6, 6, 6, 8, 6, 6, 8, 7, 7, 8,
134.3851 +	 7, 7,10, 8, 8, 9, 7, 7, 9, 7, 7,10, 8, 9, 9, 7,
134.3852 +	 7, 7, 7, 7,10, 8, 8,11, 8, 8,10, 8, 8,12, 9, 9,
134.3853 +	12, 8, 8,11, 9, 9,12, 9, 9,11, 8, 8, 7, 7, 7,10,
134.3854 +	 9, 9,10, 9, 9,10, 9, 9,11,10,10,10, 9, 9,11, 9,
134.3855 +	 9,11,10,10,11, 9, 9, 9, 8, 8,10, 9, 9,10, 9, 9,
134.3856 +	11, 9, 9,11,10,10,11, 9, 9,11, 9, 9,11,10,10,11,
134.3857 +	 9, 9, 8, 8, 8,11, 9, 9,11, 9, 9,11, 9, 9,12, 9,
134.3858 +	 9,12, 8, 8,12, 9, 9,12, 9, 9,12, 8, 8, 8, 7, 7,
134.3859 +	10, 9, 9,10, 9, 9,11, 9, 9,11,11,11,11, 9, 9,11,
134.3860 +	10,10,11,11,11,11, 9, 9,10, 9, 9,11, 9, 9,11, 9,
134.3861 +	10,11,10, 9,11,10,10,11, 9, 9,11, 9,10,11,10,10,
134.3862 +	11, 9, 9,
134.3863 +};
134.3864 +
134.3865 +static const static_codebook _44p3_p6_1 = {
134.3866 +	5, 243,
134.3867 +	(long *)_vq_lengthlist__44p3_p6_1,
134.3868 +	1, -530841600, 1616642048, 2, 0,
134.3869 +	(long *)_vq_quantlist__44p3_p6_1,
134.3870 +	0
134.3871 +};
134.3872 +
134.3873 +static const long _vq_quantlist__44p3_p7_0[] = {
134.3874 +	1,
134.3875 +	0,
134.3876 +	2,
134.3877 +};
134.3878 +
134.3879 +static const long _vq_lengthlist__44p3_p7_0[] = {
134.3880 +	 1, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9,
134.3881 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.3882 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.3883 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.3884 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.3885 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.3886 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.3887 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.3888 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.3889 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.3890 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.3891 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.3892 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.3893 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.3894 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.3895 +	 9, 9, 9,
134.3896 +};
134.3897 +
134.3898 +static const static_codebook _44p3_p7_0 = {
134.3899 +	5, 243,
134.3900 +	(long *)_vq_lengthlist__44p3_p7_0,
134.3901 +	1, -513979392, 1633504256, 2, 0,
134.3902 +	(long *)_vq_quantlist__44p3_p7_0,
134.3903 +	0
134.3904 +};
134.3905 +
134.3906 +static const long _vq_quantlist__44p3_p7_1[] = {
134.3907 +	1,
134.3908 +	0,
134.3909 +	2,
134.3910 +};
134.3911 +
134.3912 +static const long _vq_lengthlist__44p3_p7_1[] = {
134.3913 +	 1, 9, 9, 6, 9, 9, 5, 9, 9, 8, 9, 9, 9, 9, 9, 9,
134.3914 +	 9, 9, 9, 9, 9, 9, 9, 9, 8, 9, 9, 9, 9, 9, 9, 9,
134.3915 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.3916 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 9, 9, 9, 9, 9, 9,
134.3917 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.3918 +	 9, 7, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.3919 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.3920 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.3921 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.3922 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.3923 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.3924 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 9, 9,
134.3925 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.3926 +	 9, 9, 9, 9, 9,10,10,10,10,10,10,10,10,10,10,10,
134.3927 +	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
134.3928 +	10,10,10,
134.3929 +};
134.3930 +
134.3931 +static const static_codebook _44p3_p7_1 = {
134.3932 +	5, 243,
134.3933 +	(long *)_vq_lengthlist__44p3_p7_1,
134.3934 +	1, -516716544, 1630767104, 2, 0,
134.3935 +	(long *)_vq_quantlist__44p3_p7_1,
134.3936 +	0
134.3937 +};
134.3938 +
134.3939 +static const long _vq_quantlist__44p3_p7_2[] = {
134.3940 +	12,
134.3941 +	11,
134.3942 +	13,
134.3943 +	10,
134.3944 +	14,
134.3945 +	9,
134.3946 +	15,
134.3947 +	8,
134.3948 +	16,
134.3949 +	7,
134.3950 +	17,
134.3951 +	6,
134.3952 +	18,
134.3953 +	5,
134.3954 +	19,
134.3955 +	4,
134.3956 +	20,
134.3957 +	3,
134.3958 +	21,
134.3959 +	2,
134.3960 +	22,
134.3961 +	1,
134.3962 +	23,
134.3963 +	0,
134.3964 +	24,
134.3965 +};
134.3966 +
134.3967 +static const long _vq_lengthlist__44p3_p7_2[] = {
134.3968 +	 1, 3, 2, 5, 4, 7, 7, 8, 8, 9, 9,10,10,11,11,12,
134.3969 +	12,13,13,14,14,15,15,15,15,
134.3970 +};
134.3971 +
134.3972 +static const static_codebook _44p3_p7_2 = {
134.3973 +	1, 25,
134.3974 +	(long *)_vq_lengthlist__44p3_p7_2,
134.3975 +	1, -518864896, 1620639744, 5, 0,
134.3976 +	(long *)_vq_quantlist__44p3_p7_2,
134.3977 +	0
134.3978 +};
134.3979 +
134.3980 +static const long _vq_quantlist__44p3_p7_3[] = {
134.3981 +	12,
134.3982 +	11,
134.3983 +	13,
134.3984 +	10,
134.3985 +	14,
134.3986 +	9,
134.3987 +	15,
134.3988 +	8,
134.3989 +	16,
134.3990 +	7,
134.3991 +	17,
134.3992 +	6,
134.3993 +	18,
134.3994 +	5,
134.3995 +	19,
134.3996 +	4,
134.3997 +	20,
134.3998 +	3,
134.3999 +	21,
134.4000 +	2,
134.4001 +	22,
134.4002 +	1,
134.4003 +	23,
134.4004 +	0,
134.4005 +	24,
134.4006 +};
134.4007 +
134.4008 +static const long _vq_lengthlist__44p3_p7_3[] = {
134.4009 +	 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5,
134.4010 +	 5, 5, 5, 5, 5, 5, 5, 5, 5,
134.4011 +};
134.4012 +
134.4013 +static const static_codebook _44p3_p7_3 = {
134.4014 +	1, 25,
134.4015 +	(long *)_vq_lengthlist__44p3_p7_3,
134.4016 +	1, -529006592, 1611661312, 5, 0,
134.4017 +	(long *)_vq_quantlist__44p3_p7_3,
134.4018 +	0
134.4019 +};
134.4020 +
134.4021 +static const long _huff_lengthlist__44p3_short[] = {
134.4022 +	 4, 5,16, 9, 9,12,17,18, 4, 2,18, 6, 5, 9,13,15,
134.4023 +	10, 7, 7, 6, 7, 9,13,13, 8, 5, 6, 5, 5, 7,11,12,
134.4024 +	 8, 4, 7, 4, 3, 6,10,12,11, 8, 9, 7, 6, 8,11,12,
134.4025 +	15,13,13,11, 9, 7,10,12,16,12,16,12, 6, 5, 8,11,
134.4026 +};
134.4027 +
134.4028 +static const static_codebook _huff_book__44p3_short = {
134.4029 +	2, 64,
134.4030 +	(long *)_huff_lengthlist__44p3_short,
134.4031 +	0, 0, 0, 0, 0,
134.4032 +	NULL,
134.4033 +	0
134.4034 +};
134.4035 +
134.4036 +static const long _vq_quantlist__44p4_l0_0[] = {
134.4037 +	6,
134.4038 +	5,
134.4039 +	7,
134.4040 +	4,
134.4041 +	8,
134.4042 +	3,
134.4043 +	9,
134.4044 +	2,
134.4045 +	10,
134.4046 +	1,
134.4047 +	11,
134.4048 +	0,
134.4049 +	12,
134.4050 +};
134.4051 +
134.4052 +static const long _vq_lengthlist__44p4_l0_0[] = {
134.4053 +	 1, 4, 4, 8, 8, 9, 8, 9, 9,10,10,10,10, 4, 6, 5,
134.4054 +	 8, 7, 9, 9, 9, 9,10, 9,10,10, 4, 5, 6, 7, 8, 9,
134.4055 +	 9, 9, 9, 9,10, 9,10, 8, 9, 8, 9, 8,10, 9,11, 9,
134.4056 +	12,10,11,10, 8, 8, 9, 8, 9, 9,10, 9,11,10,11,10,
134.4057 +	12, 9,10,10,11,10,11,11,12,11,12,12,12,12, 9,10,
134.4058 +	10,11,11,11,11,11,12,12,12,12,12,10,11,11,12,12,
134.4059 +	12,12,12,12,12,12,12,12,10,11,11,12,12,12,12,12,
134.4060 +	12,12,12,12,12,11,12,12,12,12,12,12,12,12,12,13,
134.4061 +	12,12,11,12,11,12,12,12,12,12,12,12,12,12,12,12,
134.4062 +	12,12,12,12,12,13,12,12,12,12,12,12,11,13,12,12,
134.4063 +	12,13,12,12,12,12,12,12,12,
134.4064 +};
134.4065 +
134.4066 +static const static_codebook _44p4_l0_0 = {
134.4067 +	2, 169,
134.4068 +	(long *)_vq_lengthlist__44p4_l0_0,
134.4069 +	1, -526516224, 1616117760, 4, 0,
134.4070 +	(long *)_vq_quantlist__44p4_l0_0,
134.4071 +	0
134.4072 +};
134.4073 +
134.4074 +static const long _vq_quantlist__44p4_l0_1[] = {
134.4075 +	2,
134.4076 +	1,
134.4077 +	3,
134.4078 +	0,
134.4079 +	4,
134.4080 +};
134.4081 +
134.4082 +static const long _vq_lengthlist__44p4_l0_1[] = {
134.4083 +	 3, 4, 4, 5, 5, 4, 4, 5, 5, 5, 4, 5, 4, 5, 5, 5,
134.4084 +	 5, 6, 5, 6, 5, 6, 5, 6, 5,
134.4085 +};
134.4086 +
134.4087 +static const static_codebook _44p4_l0_1 = {
134.4088 +	2, 25,
134.4089 +	(long *)_vq_lengthlist__44p4_l0_1,
134.4090 +	1, -533725184, 1611661312, 3, 0,
134.4091 +	(long *)_vq_quantlist__44p4_l0_1,
134.4092 +	0
134.4093 +};
134.4094 +
134.4095 +static const long _vq_quantlist__44p4_l1_0[] = {
134.4096 +	1,
134.4097 +	0,
134.4098 +	2,
134.4099 +};
134.4100 +
134.4101 +static const long _vq_lengthlist__44p4_l1_0[] = {
134.4102 +	 1, 4, 4, 4, 4, 4, 4, 4, 4,
134.4103 +};
134.4104 +
134.4105 +static const static_codebook _44p4_l1_0 = {
134.4106 +	2, 9,
134.4107 +	(long *)_vq_lengthlist__44p4_l1_0,
134.4108 +	1, -516716544, 1630767104, 2, 0,
134.4109 +	(long *)_vq_quantlist__44p4_l1_0,
134.4110 +	0
134.4111 +};
134.4112 +
134.4113 +static const long _huff_lengthlist__44p4_lfe[] = {
134.4114 +	 1, 3, 2, 3,
134.4115 +};
134.4116 +
134.4117 +static const static_codebook _huff_book__44p4_lfe = {
134.4118 +	2, 4,
134.4119 +	(long *)_huff_lengthlist__44p4_lfe,
134.4120 +	0, 0, 0, 0, 0,
134.4121 +	NULL,
134.4122 +	0
134.4123 +};
134.4124 +
134.4125 +static const long _huff_lengthlist__44p4_long[] = {
134.4126 +	 3, 5,13, 9, 9,12,16,18, 4, 2,20, 6, 7,10,15,20,
134.4127 +	10, 7, 5, 5, 6, 8,10,13, 8, 5, 5, 3, 5, 7,10,11,
134.4128 +	 9, 7, 6, 5, 5, 7, 9, 9,11,10, 8, 7, 6, 6, 8, 8,
134.4129 +	15,15,10,10, 9, 7, 8, 9,17,19,13,12,10, 8, 9, 9,
134.4130 +};
134.4131 +
134.4132 +static const static_codebook _huff_book__44p4_long = {
134.4133 +	2, 64,
134.4134 +	(long *)_huff_lengthlist__44p4_long,
134.4135 +	0, 0, 0, 0, 0,
134.4136 +	NULL,
134.4137 +	0
134.4138 +};
134.4139 +
134.4140 +static const long _vq_quantlist__44p4_p1_0[] = {
134.4141 +	1,
134.4142 +	0,
134.4143 +	2,
134.4144 +};
134.4145 +
134.4146 +static const long _vq_lengthlist__44p4_p1_0[] = {
134.4147 +	 1, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4148 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4149 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4150 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4151 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4152 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4153 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4154 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4155 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4156 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4157 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4158 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4159 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4160 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4161 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4162 +	 0, 0, 0,
134.4163 +};
134.4164 +
134.4165 +static const static_codebook _44p4_p1_0 = {
134.4166 +	5, 243,
134.4167 +	(long *)_vq_lengthlist__44p4_p1_0,
134.4168 +	1, -535822336, 1611661312, 2, 0,
134.4169 +	(long *)_vq_quantlist__44p4_p1_0,
134.4170 +	0
134.4171 +};
134.4172 +
134.4173 +static const long _vq_quantlist__44p4_p2_0[] = {
134.4174 +	2,
134.4175 +	1,
134.4176 +	3,
134.4177 +	0,
134.4178 +	4,
134.4179 +};
134.4180 +
134.4181 +static const long _vq_lengthlist__44p4_p2_0[] = {
134.4182 +	 3, 9, 9, 0, 0, 0, 8, 8, 0, 0, 0, 9, 9, 0, 0, 0,
134.4183 +	12,12, 0, 0, 0, 0, 0, 0, 0, 0,10,10, 0, 0, 0, 0,
134.4184 +	 0, 0, 0, 0, 9, 9, 0, 0, 0,11,11, 0, 0, 0, 0, 0,
134.4185 +	 0, 0, 0,10,10, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0,
134.4186 +	 0, 0,11,11, 0, 0, 0, 0, 0, 0, 0, 0,12,12, 0, 0,
134.4187 +	 0, 0, 0, 0, 0, 0,11,11, 0, 0, 0,12,12, 0, 0, 0,
134.4188 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4189 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7,
134.4190 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4191 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4192 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4193 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4194 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4195 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4196 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4197 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 0, 0, 0,
134.4198 +	 5, 5, 0, 0, 0, 7, 7, 0, 0, 0, 9, 9, 0, 0, 0, 0,
134.4199 +	 0, 0, 0, 0, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5,
134.4200 +	 0, 0, 0, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 0,
134.4201 +	 0, 0, 0, 0, 0, 0, 0, 5, 5, 0, 0, 0, 7, 7, 0, 0,
134.4202 +	 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0,
134.4203 +	 7, 7, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4204 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4205 +	 0, 0, 0, 0, 0, 0, 0, 0,11,11, 0, 0, 0, 9, 9, 0,
134.4206 +	 0, 0,10,10, 0, 0, 0,10,10, 0, 0, 0, 0, 0, 0, 0,
134.4207 +	 0,10,10, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0,
134.4208 +	10,10, 0, 0, 0, 0, 0, 0, 0, 0,10,10, 0, 0, 0, 0,
134.4209 +	 0, 0, 0, 0, 9, 9, 0, 0, 0,10,10, 0, 0, 0, 0, 0,
134.4210 +	 0, 0, 0,12,12, 0, 0, 0, 0, 0, 0, 0, 0,11,11, 0,
134.4211 +	 0, 0,12,12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4212 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4213 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4214 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4215 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4216 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4217 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4218 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4219 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4220 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4221 +	 0, 0, 9, 9, 0, 0, 0, 7, 7, 0, 0, 0, 8, 8, 0, 0,
134.4222 +	 0,10,10, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 0, 0, 0,
134.4223 +	 0, 0, 0, 0, 0, 7, 7, 0, 0, 0, 9, 9, 0, 0, 0, 0,
134.4224 +	 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8,
134.4225 +	 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0,10,10, 0,
134.4226 +	 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0,11,11, 0, 0,
134.4227 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4228 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5,
134.4229 +	 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4230 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4231 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4232 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4233 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4234 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4235 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4236 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4237 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4238 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4239 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4240 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4241 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4242 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4243 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4244 +	 0, 0, 0, 0, 0, 0, 0, 0, 0,10,10, 0, 0, 0, 7, 7,
134.4245 +	 0, 0, 0, 9, 9, 0, 0, 0,10,10, 0, 0, 0, 0, 0, 0,
134.4246 +	 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 0, 0,
134.4247 +	 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0,
134.4248 +	 0, 0, 0, 0, 0, 8, 8, 0, 0, 0, 9, 9, 0, 0, 0, 0,
134.4249 +	 0, 0, 0, 0,11,11, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9,
134.4250 +	 0, 0, 0,10,10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4251 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4252 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4253 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4254 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4255 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4256 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4257 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4258 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4259 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4260 +	 0, 0, 0, 9, 9, 0, 0, 0, 7, 7, 0, 0, 0, 8, 8, 0,
134.4261 +	 0, 0,10,11, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0,
134.4262 +	 0, 0, 0, 0, 0, 0, 8, 8, 0, 0, 0, 9, 9, 0, 0, 0,
134.4263 +	 0, 0, 0, 0, 0, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 7,
134.4264 +	 7, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0,11,11,
134.4265 +	 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0,10,10, 0,
134.4266 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4267 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4268 +	 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4269 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4270 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4271 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4272 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4273 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4274 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4275 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4276 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4277 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4278 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4279 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4280 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4281 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4282 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4283 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,10,10, 0, 0, 0, 7,
134.4284 +	 7, 0, 0, 0, 9, 9, 0, 0, 0,10,10, 0, 0, 0, 0, 0,
134.4285 +	 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 7, 8, 0,
134.4286 +	 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0,
134.4287 +	 0, 0, 0, 0, 0, 0, 8, 8, 0, 0, 0, 9, 9, 0, 0, 0,
134.4288 +	 0, 0, 0, 0, 0,10,10, 0, 0, 0, 0, 0, 0, 0, 0, 9,
134.4289 +	 9, 0, 0, 0,11,11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4290 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4291 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4292 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4293 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4294 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4295 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4296 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4297 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4298 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4299 +	 0, 0, 0, 0,10,10, 0, 0, 0, 9, 9, 0, 0, 0,10,10,
134.4300 +	 0, 0, 0,11,11, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0,
134.4301 +	 0, 0, 0, 0, 0, 0, 0, 8, 8, 0, 0, 0,10,10, 0, 0,
134.4302 +	 0, 0, 0, 0, 0, 0,10,10, 0, 0, 0, 0, 0, 0, 0, 0,
134.4303 +	 9, 9, 0, 0, 0,10,10, 0, 0, 0, 0, 0, 0, 0, 0,11,
134.4304 +	11, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0,12,12,
134.4305 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4306 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4307 +	 0, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4308 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4309 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4310 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4311 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4312 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4313 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4314 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4315 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4316 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4317 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4318 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4319 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4320 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4321 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4322 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,10,10, 0, 0, 0,
134.4323 +	 9, 9, 0, 0, 0,10,10, 0, 0, 0,12,12, 0, 0, 0, 0,
134.4324 +	 0, 0, 0, 0,10,10, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9,
134.4325 +	 0, 0, 0,10,10, 0, 0, 0, 0, 0, 0, 0, 0,10,10, 0,
134.4326 +	 0, 0, 0, 0, 0, 0, 0, 8, 8, 0, 0, 0,10,10, 0, 0,
134.4327 +	 0, 0, 0, 0, 0, 0,11,11, 0, 0, 0, 0, 0, 0, 0, 0,
134.4328 +	10,10, 0, 0, 0,11,11, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4329 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4330 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4331 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4332 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4333 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4334 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4335 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4336 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4337 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4338 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4339 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4340 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4341 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4342 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4343 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4344 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4345 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4346 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4347 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4348 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4349 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4350 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4351 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4352 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4353 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4354 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4355 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4356 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4357 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4358 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4359 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4360 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4361 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4362 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4363 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4364 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4365 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4366 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4367 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4368 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4369 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4370 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4371 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4372 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4373 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4374 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4375 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4376 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4377 +	 0, 0, 0, 0, 0,
134.4378 +};
134.4379 +
134.4380 +static const static_codebook _44p4_p2_0 = {
134.4381 +	5, 3125,
134.4382 +	(long *)_vq_lengthlist__44p4_p2_0,
134.4383 +	1, -533725184, 1611661312, 3, 0,
134.4384 +	(long *)_vq_quantlist__44p4_p2_0,
134.4385 +	0
134.4386 +};
134.4387 +
134.4388 +static const long _vq_quantlist__44p4_p3_0[] = {
134.4389 +	1,
134.4390 +	0,
134.4391 +	2,
134.4392 +};
134.4393 +
134.4394 +static const long _vq_lengthlist__44p4_p3_0[] = {
134.4395 +	 1, 6, 6, 5, 7, 8, 0, 8, 8, 6, 9, 9, 7,10,10, 0,
134.4396 +	 8, 8, 0, 9, 9, 0,12,12, 0, 8, 8, 4, 7, 7, 6,10,
134.4397 +	10, 0,12,12, 7,11,11, 8,12,12, 0,12,12, 0,13,12,
134.4398 +	 0,15,15, 0,12,12, 0, 7, 7, 0, 7, 7, 0, 7, 7, 0,
134.4399 +	 8, 8, 0,10,10, 0, 7, 7, 0, 8, 8, 0,11,11, 0, 7,
134.4400 +	 7, 5, 7, 7, 8, 9, 9, 0,10,10, 8, 9, 9,11,11,11,
134.4401 +	 0,10, 9, 0,11,11, 0,13,13, 0,10,10, 6, 7, 7, 8,
134.4402 +	10,10, 0,12,12, 9,10,10,10,12,12, 0,12,12, 0,12,
134.4403 +	12, 0,15,15, 0,12,12, 0,10,10, 0,11,11, 0,11,11,
134.4404 +	 0,11,11, 0,13,13, 0,11,11, 0,11,11, 0,15,15, 0,
134.4405 +	10,10, 0, 8, 8, 0,10,10, 0,12,12, 0,11,11, 0,12,
134.4406 +	12, 0,12,12, 0,12,12, 0,15,15, 0,11,11, 0, 7, 7,
134.4407 +	 0,10,10, 0,12,12, 0,10,10, 0,12,12, 0,12,12, 0,
134.4408 +	13,13, 0,14,14, 0,12,12, 0, 0, 0, 0, 0, 0, 0, 0,
134.4409 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.4410 +	 0, 0, 0,
134.4411 +};
134.4412 +
134.4413 +static const static_codebook _44p4_p3_0 = {
134.4414 +	5, 243,
134.4415 +	(long *)_vq_lengthlist__44p4_p3_0,
134.4416 +	1, -533200896, 1614282752, 2, 0,
134.4417 +	(long *)_vq_quantlist__44p4_p3_0,
134.4418 +	0
134.4419 +};
134.4420 +
134.4421 +static const long _vq_quantlist__44p4_p3_1[] = {
134.4422 +	1,
134.4423 +	0,
134.4424 +	2,
134.4425 +};
134.4426 +
134.4427 +static const long _vq_lengthlist__44p4_p3_1[] = {
134.4428 +	 3, 5, 5, 0, 8, 8, 0, 8, 8, 0, 9, 9, 0,10,10, 0,
134.4429 +	 8, 8, 0, 8, 8, 0,10,10, 0, 8, 8, 0, 7, 7, 0, 8,
134.4430 +	 8, 0, 7, 7, 0, 8, 8, 0, 8, 8, 0, 8, 8, 0, 8, 8,
134.4431 +	 0, 8, 8, 0, 8, 8, 0, 7, 7, 0, 6, 6, 0, 7, 7, 0,
134.4432 +	 7, 7, 0,10,10, 0, 6, 6, 0, 7, 7, 0,10,10, 0, 5,
134.4433 +	 5, 0, 8, 8, 0, 7, 7, 0, 8, 8, 0, 8, 8, 0, 9, 9,
134.4434 +	 0, 7, 7, 0, 8, 8, 0, 9, 9, 0, 7, 7, 0, 6, 6, 0,
134.4435 +	 9,10, 0,10,10, 0,10,10, 0,11,11, 0, 9, 9, 0,10,
134.4436 +	10, 0,11,11, 0, 9, 9, 0, 8, 8, 0, 8, 8, 0, 8, 8,
134.4437 +	 0, 9, 9, 0, 9, 9, 0, 7, 7, 0, 8, 8, 0, 9, 9, 0,
134.4438 +	 7, 7, 0, 8, 8, 0, 7, 7, 0, 7, 7, 0, 8, 8, 0, 9,
134.4439 +	 9, 0, 7, 7, 0, 7, 7, 0, 8, 8, 0, 6, 6, 0, 6, 6,
134.4440 +	 0,10,10, 0,10,10, 0,10,10, 0,12,12, 0, 9, 9, 0,
134.4441 +	10,10, 0,12,12, 0, 9, 9, 0, 8, 8, 0, 7, 7, 0, 7,
134.4442 +	 7, 0, 8, 8, 0, 9, 9, 0, 7, 7, 0, 8, 8, 0, 9, 9,
134.4443 +	 0, 6, 6,
134.4444 +};
134.4445 +
134.4446 +static const static_codebook _44p4_p3_1 = {
134.4447 +	5, 243,
134.4448 +	(long *)_vq_lengthlist__44p4_p3_1,
134.4449 +	1, -535822336, 1611661312, 2, 0,
134.4450 +	(long *)_vq_quantlist__44p4_p3_1,
134.4451 +	0
134.4452 +};
134.4453 +
134.4454 +static const long _vq_quantlist__44p4_p4_0[] = {
134.4455 +	1,
134.4456 +	0,
134.4457 +	2,
134.4458 +};
134.4459 +
134.4460 +static const long _vq_lengthlist__44p4_p4_0[] = {
134.4461 +	 1, 6, 6, 6, 7, 7, 7, 8, 8, 7, 8, 8,10,11,11, 9,
134.4462 +	 8, 8, 8, 8, 8,11,11,12, 9, 8, 8, 5, 7, 7, 9,11,
134.4463 +	11,10,11,11,10,11,11,12,14,14,11,12,12,10,12,12,
134.4464 +	13,14,14,12,12,12, 5, 6, 6, 7, 6, 6, 8, 7, 7, 8,
134.4465 +	 7, 7,11,10,10,10, 7, 7, 9, 8, 8,12,11,11,10, 7,
134.4466 +	 7, 7, 7, 7,11,10,10,12,10,10,11,10,10,15,13,13,
134.4467 +	13,10,10,12,11,11,15,13,13,14,11,11, 7, 7, 7,11,
134.4468 +	11,11,12,11,11,12,11,11,14,14,14,13,12,12,12,12,
134.4469 +	12,16,15,15,14,12,12, 0,10,10, 0,11,11, 0,12,12,
134.4470 +	 0,11,11, 0,14,14, 0,11,11, 0,12,12, 0,15,15, 0,
134.4471 +	11,11, 7, 8, 8,12,11,10,12,10,10,12,11,11,15,13,
134.4472 +	13,14,11,11,12,10,10,16,14,14,14,10,10, 8, 7, 7,
134.4473 +	12,11,11,12,11,11,12,11,11,15,14,14,14,12,12,13,
134.4474 +	12,12,15,14,14,15,13,13, 0,11,11, 0,12,12, 0,12,
134.4475 +	12, 0,12,12, 0,15,15, 0,12,12, 0,13,13, 0,15,14,
134.4476 +	 0,12,12,
134.4477 +};
134.4478 +
134.4479 +static const static_codebook _44p4_p4_0 = {
134.4480 +	5, 243,
134.4481 +	(long *)_vq_lengthlist__44p4_p4_0,
134.4482 +	1, -531365888, 1616117760, 2, 0,
134.4483 +	(long *)_vq_quantlist__44p4_p4_0,
134.4484 +	0
134.4485 +};
134.4486 +
134.4487 +static const long _vq_quantlist__44p4_p4_1[] = {
134.4488 +	2,
134.4489 +	1,
134.4490 +	3,
134.4491 +	0,
134.4492 +	4,
134.4493 +};
134.4494 +
134.4495 +static const long _vq_lengthlist__44p4_p4_1[] = {
134.4496 +	 4, 5, 5, 9, 9,12, 9, 9,12,12,12,10,10,13,13,13,
134.4497 +	11,11,12,12,13,13,13,12,12,13,10,10,13,13,13,13,
134.4498 +	13,13,13,13,10,10,13,12,13,11,11,13,13,13,14,14,
134.4499 +	13,12,13,10,10,13,13,12,13,13,13,13,13,10,10,12,
134.4500 +	12,13,11,11,13,13,13,14,14,12,12,13,12,12,13,13,
134.4501 +	13,13,13,13,13,13,11,11,12,12,13,11,11,13,13,13,
134.4502 +	14,14,12,12,13,14,14,13,13,14,13,13,14,14,14,14,
134.4503 +	14,12,12,13,14,14,13,13,14,14,14,12,12,12, 8, 8,
134.4504 +	12,12,13,12,12,11,11,13,11,11,11,11,14,12,12,11,
134.4505 +	11,14,12,12,10,11,14,12,12,12,12,14,12,12,12,12,
134.4506 +	13,13,13,11,11,14,12,12,11,11,14,12,12,12,12,14,
134.4507 +	12,12,12,12,14,12,12,12,12,14,13,13,11,11,14,12,
134.4508 +	12,11,11,14,12,12,12,12,14,13,13,12,12,14,12,12,
134.4509 +	12,12,14,13,13,11,11,14,12,12,11,11,14,13,13,11,
134.4510 +	11,15,13,13,12,12,14,12,12,12,12,15,13,13,12,12,
134.4511 +	14,12,12,11,11,15,13,13,11,11,12, 9, 9,11,11,13,
134.4512 +	 7, 7,11,11,13, 8, 8,12,12,14,10,10,10,10,14,14,
134.4513 +	14,11,11,14, 8, 8,12,12,14,14,14,12,12,14, 7, 7,
134.4514 +	11,11,14, 9, 9,12,12,14,14,14,11,11,14, 8, 8,12,
134.4515 +	12,14,14,14,12,12,14, 7, 7,11,11,14, 9, 9,12,12,
134.4516 +	14,14,14,11,11,14,10,10,12,12,14,14,14,13,13,14,
134.4517 +	 9, 9,11,11,14,10,10,12,11,15,14,14,11,11,14,15,
134.4518 +	15,12,12,15,14,14,14,14,15,14,14,11,11,15,14,14,
134.4519 +	12,12,15,14,14,11,11,14,11,11,10,10,15,10,10,10,
134.4520 +	10,15,10,10,10,10,15,11,11, 9, 9,15,12,13, 9, 9,
134.4521 +	15,11,11,11,11,15,13,13,11,11,15,10,10,10,10,15,
134.4522 +	11,11,10,10,15,13,13,11,11,15,11,11,11,11,15,13,
134.4523 +	13,11,11,15,10,10,10,10,15,11,11,10,10,15,13,13,
134.4524 +	10,11,15,12,12,11,11,15,13,13,11,10,15,11,11,10,
134.4525 +	10,15,11,12,10, 9,15,13,13,10,10,15,14,14,11,11,
134.4526 +	15,13,13,11,11,15,14,14,10,10,15,13,13,10,10,15,
134.4527 +	14,14,10,10,14,13,13,10,10,15,13,13,10,10,15,13,
134.4528 +	13,10,10,14,14,14, 8, 9,15,14,14, 9, 9,15,14,14,
134.4529 +	11,11,15,14,14,10,10,15,14,14,10,10,15,14,14,11,
134.4530 +	11,15,14,14,10,10,15,14,14,11,11,15,14,14,10,10,
134.4531 +	15,14,14,10,10,15,14,14,10,10,15,14,14, 9, 9,15,
134.4532 +	14,14,11,11,15,14,14,11,11,15,14,14,10,10,15,14,
134.4533 +	14,10,10,14,14,14, 9, 9,15,15,15,11,11,15,14,14,
134.4534 +	12,12,15,15,15,10,10,15,14,15,10,10,15,15,15, 9,
134.4535 +	 9,15,10,10,13,13,17, 8, 8,12,12,17,10, 9,13,13,
134.4536 +	18,11,11,12,12,18,14,14,12,12,17, 9, 9,13,13,17,
134.4537 +	13,13,12,12,18, 8, 8,12,12,18,10,10,12,12,18,14,
134.4538 +	14,12,12,18,10,10,13,13,18,13,13,13,13,18, 9, 9,
134.4539 +	12,12,18,10,10,13,13,18,14,14,12,12,18,11,11,13,
134.4540 +	13,18,14,14,13,13,18,10,10,12,12,17,11,11,12,12,
134.4541 +	18,14,14,12,12,18,14,14,13,13,18,14,14,13,13,19,
134.4542 +	14,15,12,12,18,14,14,12,12,18,15,15,12,12,13, 7,
134.4543 +	 7,11,11,14,15,15,11,11,14,16,15,11,11,14,15,15,
134.4544 +	11,11,14,15,15,11,11,14,15,15,11,12,14,15,15,12,
134.4545 +	12,13,15,15,11,11,14,15,15,11,11,15,15,15,12,12,
134.4546 +	14,15,15,12,12,14,16,16,12,12,14,15,15,11,11,14,
134.4547 +	15,15,11,11,15,15,15,12,12,15,15,15,12,12,14,15,
134.4548 +	15,12,12,14,15,15,11,11,14,15,15,11,11,15,14,15,
134.4549 +	12,12,15,15,15,12,12,15,16,16,12,12,15,15,15,12,
134.4550 +	12,14,15,15,12,12,15,15,15,12,12,13,13,13,11,11,
134.4551 +	14,14,15,11,11,14,14,14,12,12,14,15,15,10,10,15,
134.4552 +	15,15,11,11,14,15,15,12,12,14,14,14,11,11,14,15,
134.4553 +	15,11,11,14,15,15,12,12,15,15,15,11,11,14,15,15,
134.4554 +	12,12,14,14,15,11,11,14,15,15,11,11,14,15,15,12,
134.4555 +	12,15,15,15,11,11,15,15,15,12,12,14,15,15,12,12,
134.4556 +	14,15,15,10,10,14,15,15,11,11,15,15,15,10,10,15,
134.4557 +	15,15,12,12,15,15,15,14,14,15,15,15,11,11,15,15,
134.4558 +	15,11,11,15,15,15,11,11,14,10,10,10,10,15, 9, 9,
134.4559 +	12,11,15,10,10,12,12,15,11,11,11,11,15,13,13,12,
134.4560 +	12,16,10,10,12,12,15,13,13,12,12,15, 9, 9,11,11,
134.4561 +	15,10,10,13,12,15,13,13,11,11,15,10,10,12,12,15,
134.4562 +	13,13,12,12,15, 9, 9,11,11,15,10,10,12,12,15,13,
134.4563 +	13,11,11,15,11,11,12,12,15,13,13,13,13,15,10,10,
134.4564 +	11,11,15,11,11,12,12,15,13,14,11,11,15,14,14,13,
134.4565 +	13,16,14,14,20,19,15,14,14,11,11,15,13,14,12,12,
134.4566 +	15,14,14,11,11,14,13,13,10,10,14,14,13,11,11,15,
134.4567 +	13,14,12,12,15,14,14,12,12,15,14,14,11,11,15,14,
134.4568 +	14,12,12,15,15,14,13,13,15,14,14,11,11,15,14,14,
134.4569 +	11,11,15,14,14,13,13,15,14,14,12,12,15,14,14,13,
134.4570 +	13,15,14,14,11,11,15,14,14,11,11,15,14,14,13,13,
134.4571 +	15,14,14,12,12,15,14,14,12,12,15,14,14,12,12,15,
134.4572 +	14,14,11,11,15,15,15,12,12,15,15,15,13,13,16,14,
134.4573 +	14,12,12,15,15,15,13,13,15,15,15,12,12,15,15,15,
134.4574 +	12,12,14,10,10,13,13,17, 9, 9,12,12,17, 9, 9,13,
134.4575 +	13,17,11,11,12,12,18,14,14,12,12,18,10,10,13,13,
134.4576 +	18,14,13,12,12,18, 9, 9,12,12,18,10,10,12,13,18,
134.4577 +	14,14,12,12,17, 9, 9,12,12,17,13,14,12,12,17, 9,
134.4578 +	 9,12,12,17,10,10,12,12,17,14,14,11,11,18,11,11,
134.4579 +	12,12,18,14,14,12,13,18,10,10,12,12,18,11,11,12,
134.4580 +	12,18,14,14,11,11,18,15,15,12,12,18,14,14,13,13,
134.4581 +	18,14,15,12,12,17,14,14,12,12,17,15,15,12,12,13,
134.4582 +	 7, 7,11,11,14,15,15,11,11,14,15,15,11,11,14,15,
134.4583 +	15,11,11,14,15,15,11,11,14,15,15,11,11,14,15,15,
134.4584 +	12,12,14,15,15,11,11,14,15,15,11,11,15,15,15,12,
134.4585 +	12,14,15,15,11,11,14,15,15,12,12,14,15,15,11,11,
134.4586 +	15,15,15,11,11,15,15,15,12,12,14,15,15,12,12,14,
134.4587 +	15,16,12,12,14,15,15,11,11,14,15,15,11,11,15,15,
134.4588 +	15,12,12,15,15,15,12,12,15,16,16,12,12,15,15,15,
134.4589 +	12,12,15,15,15,12,12,15,15,15,12,12,13,13,13,12,
134.4590 +	12,14,14,14,11,11,14,14,14,12,12,14,14,14,10,10,
134.4591 +	15,15,15,11,11,14,15,15,12,12,14,14,14,11,11,14,
134.4592 +	15,15,11,11,14,14,14,12,12,15,15,14,11,11,14,15,
134.4593 +	15,12,12,14,14,14,11,11,14,15,15,11,11,14,14,14,
134.4594 +	11,11,15,14,14,10,10,14,15,15,12,12,14,14,14,12,
134.4595 +	12,14,15,15,10,10,14,15,15,11,11,15,15,15,10,10,
134.4596 +	15,15,15,12,12,15,14,14,13,13,15,15,15,10,10,15,
134.4597 +	14,14,11,11,15,15,15,10,10,14,10,10,10,10,14, 9,
134.4598 +	 9,12,12,15,10,10,12,12,14,11,11,11,11,15,13,14,
134.4599 +	12,12,15,10,10,13,13,15,13,13,12,12,15, 9, 9,12,
134.4600 +	12,15,10,10,13,13,15,13,14,11,11,15,10,10,12,12,
134.4601 +	15,13,13,12,12,15, 9, 9,11,11,15,10,10,12,12,15,
134.4602 +	13,13,11,11,15,11,11,12,12,15,13,13,13,13,15,10,
134.4603 +	10,11,11,15,11,11,12,12,15,14,14,11,11,15,14,14,
134.4604 +	13,13,15,14,14,20,19,15,14,14,11,11,15,14,14,12,
134.4605 +	12,15,14,14,11,11,14,13,13,11,11,15,13,13,11,11,
134.4606 +	15,14,13,12,12,15,14,14,11,12,15,14,14,11,11,15,
134.4607 +	14,14,12,12,14,14,14,13,13,15,14,14,11,11,15,14,
134.4608 +	14,11,11,15,14,14,13,13,15,14,14,12,12,15,14,14,
134.4609 +	13,13,14,14,14,11,11,15,14,14,11,11,15,14,14,13,
134.4610 +	13,15,14,14,12,12,15,14,14,12,12,15,14,14,12,12,
134.4611 +	15,14,14,11,11,14,14,14,12,12,15,15,15,13,13,16,
134.4612 +	14,14,12,12,15,15,15,13,13,15,14,14,12,12,15,15,
134.4613 +	15,12,12,15,11,11,13,13,18,10,10,12,12,17,11,11,
134.4614 +	12,12,18,12,12,11,11,18,14,14,12,12,18,10,10,13,
134.4615 +	13,18,14,14,12,12,18,10,10,12,12,18,11,11,12,12,
134.4616 +	18,14,14,12,12,18,11,11,12,13,18,14,14,12,12,18,
134.4617 +	10,10,12,12,18,11,11,12,12,18,14,14,11,11,18,11,
134.4618 +	11,12,12,18,14,14,12,12,17,10,10,11,11,17,12,12,
134.4619 +	11,11,17,14,14,11,11,18,15,15,12,12,18,14,14,13,
134.4620 +	13,18,15,15,11,11,18,15,14,12,12,18,15,15,11,11,
134.4621 +	14, 8, 8,11,11,14,15,15,10,10,14,15,15,11,11,14,
134.4622 +	15,15,11,11,15,15,15,12,12,15,15,15,11,11,15,15,
134.4623 +	15,12,12,14,15,15,10,10,15,15,15,11,11,15,15,15,
134.4624 +	12,12,15,15,15,11,11,15,15,15,13,13,14,15,15,10,
134.4625 +	10,15,15,15,11,11,15,15,15,12,12,15,15,15,12,12,
134.4626 +	15,16,16,12,12,15,14,14,11,11,15,15,15,11,11,15,
134.4627 +	15,15,12,12,16,15,15,13,13,15,16,16,13,13,16,15,
134.4628 +	15,12,12,15,15,15,12,12,15,15,15,12,12,14,13,13,
134.4629 +	11,11,14,14,14,11,11,14,14,14,12,12,15,14,14,11,
134.4630 +	11,15,15,14,11,11,15,14,14,12,12,15,14,14,12,12,
134.4631 +	14,15,15,11,11,15,14,14,12,12,15,14,14,11,11,15,
134.4632 +	14,15,12,12,15,14,14,12,12,14,15,15,11,11,15,14,
134.4633 +	14,11,11,15,14,14,11,11,15,15,14,12,12,15,14,14,
134.4634 +	12,12,15,15,15,10,11,15,14,14,11,11,15,15,15,10,
134.4635 +	10,15,15,15,12,12,16,14,14,13,13,15,15,15,11,11,
134.4636 +	15,14,14,11,11,15,15,15,11,11,14,11,11, 9, 9,14,
134.4637 +	10,10,12,12,15,11,11,12,12,15,12,12,12,12,15,14,
134.4638 +	14,13,13,15,11,11,12,12,15,14,14,13,13,14,10,10,
134.4639 +	12,12,15,11,11,13,13,15,14,14,12,12,15,10,10,12,
134.4640 +	12,14,14,14,13,13,14,10,10,11,11,15,11,11,12,12,
134.4641 +	15,14,14,12,12,15,12,12,13,13,15,14,14,14,14,15,
134.4642 +	11,11,11,11,15,12,11,12,12,15,14,14,11,11,15,15,
134.4643 +	15,13,14,15,14,14,20,19,15,14,14,12,12,15,14,14,
134.4644 +	13,13,15,14,14,12,12,14,13,13,10,10,14,13,13,11,
134.4645 +	11,14,13,13,11,11,15,14,14,12,12,15,14,14,12,12,
134.4646 +	15,14,14,12,11,14,14,14,13,13,15,14,14,11,11,15,
134.4647 +	14,14,11,11,15,14,14,14,14,15,14,14,11,12,15,14,
134.4648 +	14,13,13,14,14,14,11,11,15,14,14,11,11,15,14,14,
134.4649 +	14,14,15,14,14,12,12,15,14,14,13,13,15,14,14,11,
134.4650 +	11,14,14,14,12,12,15,14,14,13,13,15,15,15,13,13,
134.4651 +	15,14,14,13,13,15,15,15,13,13,15,14,14,13,13,15,
134.4652 +	15,15,13,13,15,14,14,13,13,18,15,15,12,12,18,15,
134.4653 +	15,12,12,18,16,16,11,11,18,17,17,12,12,18,15,15,
134.4654 +	13,13,18,17,17,12,12,18,15,15,12,12,18,15,16,12,
134.4655 +	12,18,17,17,12,12,18,15,15,13,12,17,16,17,12,12,
134.4656 +	17,15,15,11,12,18,15,15,12,12,18,17,17,11,11,18,
134.4657 +	16,16,12,12,18,17,16,12,12,18,15,15,11,11,18,15,
134.4658 +	15,12,12,18,17,17,11,11,18,17,17,12,12,18,16,16,
134.4659 +	13,13,18,17,17,11,11,17,16,16,11,11,18,17,17,11,
134.4660 +	11,15,15,15,11,11,16,15,15,11,11,16,15,15,11,11,
134.4661 +	16,15,15,12,12,17,15,15,14,14,16,15,15,11,11,17,
134.4662 +	15,15,14,14,16,15,15,11,11,16,15,15,12,12,18,15,
134.4663 +	15,13,13,16,15,15,11,11,17,15,15,14,14,16,15,15,
134.4664 +	11,11,16,15,15,12,12,17,15,15,13,13,16,15,15,12,
134.4665 +	12,17,16,15,14,14,16,15,15,11,11,16,15,15,12,12,
134.4666 +	18,15,15,13,13,17,15,15,14,14,17,16,16,15,15,18,
134.4667 +	14,15,13,13,18,15,15,14,14,18,15,15,13,13,15,13,
134.4668 +	13,12,12,15,14,14,12,12,16,14,14,12,12,16,14,14,
134.4669 +	12,12,17,14,15,12,12,16,14,14,12,12,17,14,14,13,
134.4670 +	13,16,15,15,12,12,16,14,14,12,12,17,14,14,12,12,
134.4671 +	16,14,14,12,12,17,14,14,13,13,15,15,15,11,11,16,
134.4672 +	14,14,12,12,17,14,14,12,12,16,15,15,12,12,17,14,
134.4673 +	14,13,12,16,15,15,11,11,16,14,14,12,12,17,15,15,
134.4674 +	11,11,17,15,15,13,13,17,14,14,13,13,18,15,15,12,
134.4675 +	12,17,14,14,12,12,17,15,15,12,12,14,15,15, 9, 9,
134.4676 +	14,15,15,12,12,15,16,15,13,13,15,15,15,14,14,15,
134.4677 +	15,15,21,19,15,15,15,13,13,15,15,15,19,19,15,15,
134.4678 +	15,12,12,15,16,16,14,14,15,15,15,19,19,15,16,15,
134.4679 +	13,13,15,16,16,19,20,15,15,15,12,13,15,16,16,14,
134.4680 +	14,15,15,15,20,19,15,15,15,14,14,15,16,16,19,19,
134.4681 +	15,15,15,14,13,15,15,15,14,14,15,15,15,19,19,15,
134.4682 +	16,16,20,19,15,17,16,21,20,15,15,15,20,19,15,16,
134.4683 +	16,20,20,15,15,15,19,20,14,13,13,10,10,14,14,14,
134.4684 +	11,11,14,14,14,12,12,15,14,14,13,13,15,15,14,20,
134.4685 +	20,15,14,14,12,12,14,14,14,19,19,15,14,14,11,11,
134.4686 +	15,14,14,12,12,15,14,14,20,19,15,14,14,12,12,14,
134.4687 +	14,14,20,20,14,14,14,11,11,15,14,14,12,12,15,14,
134.4688 +	14,20,21,15,14,14,13,13,15,14,14,20,20,15,14,14,
134.4689 +	12,12,15,14,14,13,13,14,15,15,20,20,15,15,15,20,
134.4690 +	19,15,14,14,20,19,15,15,15,20,20,15,14,14,21,20,
134.4691 +	15,15,15,20,20,
134.4692 +};
134.4693 +
134.4694 +static const static_codebook _44p4_p4_1 = {
134.4695 +	5, 3125,
134.4696 +	(long *)_vq_lengthlist__44p4_p4_1,
134.4697 +	1, -533725184, 1611661312, 3, 0,
134.4698 +	(long *)_vq_quantlist__44p4_p4_1,
134.4699 +	0
134.4700 +};
134.4701 +
134.4702 +static const long _vq_quantlist__44p4_p5_0[] = {
134.4703 +	2,
134.4704 +	1,
134.4705 +	3,
134.4706 +	0,
134.4707 +	4,
134.4708 +};
134.4709 +
134.4710 +static const long _vq_lengthlist__44p4_p5_0[] = {
134.4711 +	 1, 7, 6,15,15, 7, 8, 8,15,15, 8, 8, 8,15,15, 0,
134.4712 +	13,13,16,16, 0,14,14,16,16, 7, 9, 9,16,16,10,11,
134.4713 +	11,17,17,10, 8, 8,15,16, 0,14,14,18,18, 0,14,14,
134.4714 +	16,16, 9, 9, 9,16,16,12,11,11,17,17,10, 9, 9,15,
134.4715 +	15, 0,14,14,19,19, 0,14,14,16,16, 0,15,15,18,17,
134.4716 +	 0, 0, 0,20,20, 0,13,13,16,16, 0,17,17,22,20, 0,
134.4717 +	15,15,17,17, 0,15,15,18,18, 0,22,21,20,21, 0,13,
134.4718 +	13,16,16, 0,18,18, 0,22, 0,15,15,17,17, 6, 7, 7,
134.4719 +	13,13, 9,10,10,15,15,11,10,10,15,15, 0,21,22,18,
134.4720 +	18, 0, 0, 0,18,18,10,10,10,15,15,12,13,13,17,17,
134.4721 +	12,11,11,15,15, 0,22,22,18,18, 0, 0,21,18,18,12,
134.4722 +	11,11,15,15,15,14,14,18,18,13,11,11,15,15, 0, 0,
134.4723 +	21,18,19, 0,21,22,18,19, 0,22, 0,18,19, 0, 0, 0,
134.4724 +	 0, 0, 0,21,21,18,18, 0,22, 0, 0,21, 0, 0, 0,19,
134.4725 +	18, 0, 0, 0,18,19, 0, 0, 0, 0, 0, 0,20,20,18,17,
134.4726 +	 0, 0,22, 0,21, 0, 0, 0,19,19, 6, 6, 6,13,13, 8,
134.4727 +	 6, 6,11,11, 9, 7, 7,13,13, 0,10,10,11,11, 0,12,
134.4728 +	12,14,14, 9, 8, 8,14,14,12,10,10,13,13,10, 7, 7,
134.4729 +	13,13, 0,11,11,15,15, 0,11,11,13,13, 9, 8, 8,14,
134.4730 +	14,13,10,10,13,14,11, 7, 7,13,13, 0,11,11,15,15,
134.4731 +	 0,11,11,13,13, 0,12,12,15,15, 0,21,21,17,17, 0,
134.4732 +	10,10,13,13, 0,14,14,20,20, 0,12,12,13,13, 0,12,
134.4733 +	12,15,15, 0,21,22,17,18, 0,10,10,13,13, 0,16,16,
134.4734 +	20,21, 0,12,12,13,13, 0,11,11,13,13, 0,12,12,16,
134.4735 +	16, 0,12,12,16,16, 0,16,16, 0,21, 0,17,18, 0, 0,
134.4736 +	 0,12,12,15,15, 0,15,15,18,18, 0,12,12,16,16, 0,
134.4737 +	16,16,21,22, 0,17,17,22,21, 0,12,12,16,16, 0,15,
134.4738 +	15,19,19, 0,12,12,16,16, 0,16,16,22,22, 0,17,16,
134.4739 +	22, 0, 0,17,18, 0, 0, 0, 0, 0, 0, 0, 0,15,15,21,
134.4740 +	20, 0,19,20, 0,22, 0,18,18, 0, 0, 0,18,17, 0, 0,
134.4741 +	 0, 0, 0, 0, 0, 0,16,16,22,21, 0,20,20, 0,22, 0,
134.4742 +	20,19, 0, 0, 0,11,11,12,12, 0,10,10,11,11, 0,11,
134.4743 +	11,12,12, 0,12,12,10,10, 0,13,13,12,12, 0,11,11,
134.4744 +	13,13, 0,13,13,12,12, 0,10,10,12,12, 0,13,13,14,
134.4745 +	13, 0,12,12,12,12, 0,12,12,13,13, 0,14,14,13,13,
134.4746 +	 0,10,10,12,12, 0,13,13,14,14, 0,13,12,12,12, 0,
134.4747 +	14,14,14,14, 0,21,21,16,16, 0,12,12,12,12, 0,16,
134.4748 +	16,20,21, 0,13,13,11,11, 0,14,14,14,14, 0,20,20,
134.4749 +	16,15, 0,12,12,12,12, 0,17,17,20,20, 0,13,13,11,
134.4750 +	11, 7, 8, 8,16,16,11,10,10,15,15,12,10,10,17,17,
134.4751 +	 0,14,14,16,15, 0,15,15,17,17,11, 9, 9,16,16,14,
134.4752 +	12,12,17,17,13, 9, 9,16,15, 0,14,14,19,18, 0,14,
134.4753 +	14,16,16,12,10,10,17,18,16,13,13,17,18,14,10,10,
134.4754 +	16,16, 0,14,14,19,19, 0,14,15,17,17, 0,15,15,18,
134.4755 +	19, 0, 0, 0,20,20, 0,13,13,17,17, 0,17,18, 0,22,
134.4756 +	 0,15,15,16,17, 0,15,15,18,18, 0, 0, 0,20,21, 0,
134.4757 +	14,14,17,17, 0,19,18, 0, 0, 0,16,16,17,17, 8, 7,
134.4758 +	 7,14,14,12,11,11,15,15,13,11,11,15,15, 0, 0, 0,
134.4759 +	18,19, 0,21,20,18,18,12,10,11,15,16,14,13,13,18,
134.4760 +	18,14,11,11,15,15, 0,20,20,19,18, 0,20, 0,18,18,
134.4761 +	13,11,11,16,16,17,15,15,19,19,14,12,12,15,15, 0,
134.4762 +	21, 0,18,20, 0,22,22,18,19, 0,22,22,19,19, 0, 0,
134.4763 +	 0, 0, 0, 0,21,22,19,18, 0, 0, 0, 0,21, 0, 0, 0,
134.4764 +	19,19, 0, 0,22,20,20, 0, 0, 0, 0, 0, 0,22, 0,18,
134.4765 +	18, 0, 0, 0, 0,22, 0, 0, 0,19,20,11,10,10,14,14,
134.4766 +	14,11,11,13,13,14,11,11,15,15, 0,14,13,12,12, 0,
134.4767 +	15,15,16,16,13,11,11,15,15,16,13,13,15,15,15,10,
134.4768 +	10,14,15, 0,14,14,16,16, 0,14,14,15,15,13,11,11,
134.4769 +	15,15,18,14,14,15,15,15,10,10,15,14, 0,14,14,16,
134.4770 +	16, 0,14,14,15,15, 0,15,15,17,16, 0,21,22,18,18,
134.4771 +	 0,13,13,14,14, 0,18,17,20,21, 0,15,15,14,14, 0,
134.4772 +	15,16,16,17, 0, 0, 0,19,18, 0,13,13,15,14, 0,19,
134.4773 +	19, 0, 0, 0,15,15,14,14, 0,12,12,14,13, 0,13,13,
134.4774 +	16,16, 0,12,12,16,16, 0,16,16,22, 0, 0,17,18, 0,
134.4775 +	22, 0,13,13,16,16, 0,15,15,18,18, 0,12,12,16,16,
134.4776 +	 0,16,16,22,22, 0,17,17, 0, 0, 0,13,13,17,17, 0,
134.4777 +	16,16,19,20, 0,12,12,17,17, 0,17,17,22, 0, 0,17,
134.4778 +	17,22,21, 0,18,18, 0, 0, 0, 0, 0, 0, 0, 0,16,16,
134.4779 +	21,21, 0,19,19, 0, 0, 0,18,18, 0,22, 0,18,18, 0,
134.4780 +	22, 0, 0, 0, 0, 0, 0,16,16,22, 0, 0,20,20, 0, 0,
134.4781 +	 0,19,18, 0, 0, 0,12,12,15,15, 0,12,12,15,14, 0,
134.4782 +	13,13,15,15, 0,14,14,14,14, 0,15,15,16,16, 0,13,
134.4783 +	13,15,16, 0,15,15,16,16, 0,12,12,15,15, 0,14,14,
134.4784 +	16,16, 0,14,14,15,15, 0,13,13,15,16, 0,15,15,16,
134.4785 +	16, 0,12,12,15,15, 0,15,15,17,17, 0,14,14,15,15,
134.4786 +	 0,15,15,17,17, 0,21,21,19,19, 0,13,13,14,14, 0,
134.4787 +	17,17,22, 0, 0,14,14,15,15, 0,15,15,17,17, 0,22,
134.4788 +	 0,18,20, 0,13,13,15,15, 0,18,18, 0,22, 0,15,15,
134.4789 +	14,15, 8, 8, 8,17,16,12,10,10,16,16,13,10,10,17,
134.4790 +	16, 0,15,15,17,17, 0,15,15,17,17,12,11,11,18,18,
134.4791 +	15,12,12,18,18,15,10,10,16,17, 0,14,14,18,18, 0,
134.4792 +	14,14,17,17,13,10,10,16,16,17,14,14,17,17,15,10,
134.4793 +	10,16,15, 0,15,15,19,20, 0,14,14,15,16, 0,16,16,
134.4794 +	19,19, 0, 0, 0,21,22, 0,13,13,17,17, 0,18,17, 0,
134.4795 +	21, 0,15,15,17,17, 0,15,15,18,19, 0, 0,22, 0,21,
134.4796 +	 0,13,13,16,17, 0,19,19, 0,22, 0,16,15,16,16, 9,
134.4797 +	 8, 8,14,14,12,11,11,15,15,13,11,11,15,15, 0,21,
134.4798 +	20,19,18, 0, 0, 0,19,18,12,11,11,16,15,15,13,13,
134.4799 +	17,18,14,11,11,15,15, 0,22,22,19,18, 0,22,21,18,
134.4800 +	18,14,11,11,15,15,17,14,14,18,18,15,12,12,15,15,
134.4801 +	 0,22,22,20,19, 0, 0,21,18,18, 0, 0,22,20,20, 0,
134.4802 +	 0, 0, 0, 0, 0,20,21,18,18, 0, 0, 0,21,21, 0, 0,
134.4803 +	 0,20,19, 0,22,21,19,19, 0, 0, 0, 0, 0, 0, 0,22,
134.4804 +	17,18, 0, 0,22, 0,22, 0,22, 0,19,19, 0,11,11,15,
134.4805 +	15, 0,11,11,14,14, 0,12,12,15,15, 0,15,15,14,14,
134.4806 +	 0,16,16,16,16, 0,12,12,16,16, 0,14,14,16,16, 0,
134.4807 +	11,11,15,15, 0,15,15,17,17, 0,15,15,15,15, 0,12,
134.4808 +	12,16,16, 0,14,14,15,15, 0,11,11,15,15, 0,15,15,
134.4809 +	17,17, 0,15,15,14,15, 0,16,16,17,17, 0, 0, 0,19,
134.4810 +	19, 0,14,14,15,15, 0,18,18,21, 0, 0,15,15,14,15,
134.4811 +	 0,16,16,17,17, 0,21, 0,19,19, 0,14,14,15,15, 0,
134.4812 +	20,20,22, 0, 0,16,15,14,14, 0,12,12,13,13, 0,12,
134.4813 +	12,16,16, 0,12,12,16,16, 0,16,16,22,21, 0,18,17,
134.4814 +	21, 0, 0,13,13,16,16, 0,15,15,18,19, 0,12,12,16,
134.4815 +	16, 0,16,17,22, 0, 0,17,17, 0,22, 0,13,13,17,16,
134.4816 +	 0,15,15,19,19, 0,12,12,16,16, 0,16,16,21,20, 0,
134.4817 +	17,16,22, 0, 0,18,18,22,21, 0, 0, 0, 0, 0, 0,15,
134.4818 +	16,21,21, 0,19,19, 0, 0, 0,18,17, 0, 0, 0,18,18,
134.4819 +	21, 0, 0, 0, 0, 0, 0, 0,16,16,22,22, 0,20,21, 0,
134.4820 +	 0, 0,18,19, 0,22, 0,13,13,16,16, 0,12,12,15,15,
134.4821 +	 0,13,13,16,16, 0,14,14,15,15, 0,15,15,17,17, 0,
134.4822 +	13,13,17,16, 0,15,15,17,17, 0,12,12,16,16, 0,15,
134.4823 +	15,17,17, 0,14,14,16,16, 0,13,13,16,17, 0,15,15,
134.4824 +	17,17, 0,12,12,16,16, 0,14,14,17,17, 0,14,14,16,
134.4825 +	16, 0,16,16,17,17, 0,21, 0,21,19, 0,13,13,16,16,
134.4826 +	 0,17,17, 0, 0, 0,15,15,16,16, 0,16,15,18,18, 0,
134.4827 +	22, 0,20,20, 0,13,13,15,15, 0,18,18, 0, 0, 0,15,
134.4828 +	15,15,15, 0,12,12,17,17, 0,14,14,17,17, 0,14,14,
134.4829 +	17,17, 0,17,17,18,17, 0,17,17,19,18, 0,13,13,17,
134.4830 +	17, 0,16,16,18,18, 0,13,13,16,16, 0,17,17,19,19,
134.4831 +	 0,16,16,17,17, 0,13,13,18,18, 0,17,17,18,18, 0,
134.4832 +	13,13,17,17, 0,17,17,19,19, 0,16,17,17,17, 0,17,
134.4833 +	17,19,19, 0,21, 0,21,19, 0,14,14,16,16, 0,20,19,
134.4834 +	 0,21, 0,16,16,16,16, 0,17,18,19,19, 0, 0, 0, 0,
134.4835 +	21, 0,15,15,16,17, 0,21,20, 0, 0, 0,17,18,16,17,
134.4836 +	 0, 9, 9,14,14, 0,14,14,15,16, 0,14,14,15,15, 0,
134.4837 +	 0, 0,18,18, 0,21, 0,18,19, 0,12,12,15,15, 0,16,
134.4838 +	16,17,17, 0,14,14,14,14, 0,22, 0,19,18, 0,22, 0,
134.4839 +	17,18, 0,14,14,16,15, 0,18,18,19,18, 0,14,15,15,
134.4840 +	15, 0, 0,21,20,20, 0, 0, 0,18,18, 0,21,21,19,19,
134.4841 +	 0, 0, 0, 0, 0, 0,21,21,18,18, 0,22, 0,20,20, 0,
134.4842 +	22, 0,19,19, 0,22, 0,19,20, 0, 0, 0, 0, 0, 0, 0,
134.4843 +	21,17,18, 0, 0, 0,22,22, 0, 0, 0,19,18, 0,18,20,
134.4844 +	16,16, 0,21,20,17,17, 0, 0,21,18,18, 0,22,21,18,
134.4845 +	18, 0, 0,22,19,19, 0,20,20,17,17, 0, 0, 0,18,18,
134.4846 +	 0,19,20,17,17, 0,22, 0,19,21, 0,22,21,18,18, 0,
134.4847 +	20,19,17,18, 0, 0, 0,19,19, 0,20,20,17,17, 0,22,
134.4848 +	22,21,21, 0,20, 0,18,18, 0,22,22,18,18, 0, 0, 0,
134.4849 +	20,22, 0,20,20,16,16, 0, 0, 0,21, 0, 0,21,20,16,
134.4850 +	17, 0,22, 0,19,20, 0, 0, 0,21,20, 0,19,21,17,17,
134.4851 +	 0, 0, 0, 0, 0, 0,21,21,17,17, 0,12,12,13,13, 0,
134.4852 +	14,14,16,16, 0,14,14,16,16, 0,18,18, 0, 0, 0,19,
134.4853 +	18,22, 0, 0,13,13,16,16, 0,16,16,18,18, 0,13,13,
134.4854 +	16,16, 0,17,18,21, 0, 0,18,18,21, 0, 0,13,13,16,
134.4855 +	16, 0,17,17,19,20, 0,13,13,16,17, 0,18,18,21, 0,
134.4856 +	 0,18,18,21, 0, 0,18,19, 0,21, 0, 0, 0, 0, 0, 0,
134.4857 +	16,16,21,20, 0,20,20, 0, 0, 0,18,19, 0, 0, 0,18,
134.4858 +	18, 0, 0, 0, 0, 0, 0, 0, 0,16,16, 0,21, 0,22,22,
134.4859 +	 0, 0, 0,19,19, 0, 0, 0,16,16,19,20, 0,17,16,22,
134.4860 +	21, 0,17,17,21,20, 0,19,18, 0,22, 0,19,19,22,22,
134.4861 +	 0,16,15,22,22, 0,19,19, 0,21, 0,15,15,20,20, 0,
134.4862 +	18,19, 0,21, 0,18,18,22,22, 0,16,16,21,20, 0,20,
134.4863 +	19,21,22, 0,16,15,20,20, 0,19,19, 0,22, 0,18,18,
134.4864 +	21, 0, 0,19,18,21,22, 0, 0, 0, 0, 0, 0,16,16,19,
134.4865 +	21, 0,20,22, 0,22, 0,18,18,20,21, 0,19,18, 0,22,
134.4866 +	 0, 0, 0,22, 0, 0,16,16,20,20, 0,21,21, 0, 0, 0,
134.4867 +	18,18,21, 0, 0,12,12,17,17, 0,15,14,17,17, 0,14,
134.4868 +	14,18,18, 0,17,17,17,18, 0,18,18,18,18, 0,13,13,
134.4869 +	18,18, 0,16,17,19,18, 0,13,13,16,17, 0,17,17,18,
134.4870 +	19, 0,17,17,17,17, 0,13,13,17,17, 0,17,18,18,18,
134.4871 +	 0,13,13,16,16, 0,18,18,19,20, 0,16,17,17,16, 0,
134.4872 +	17,18,19,18, 0, 0, 0,22,21, 0,15,15,16,16, 0,20,
134.4873 +	20,21,22, 0,17,17,16,16, 0,16,17,18,18, 0, 0, 0,
134.4874 +	21,21, 0,15,15,16,16, 0,21,20, 0, 0, 0,17,17,16,
134.4875 +	16, 0,10,10,14,14, 0,14,14,15,15, 0,14,14,15,15,
134.4876 +	 0,22, 0,18,18, 0, 0, 0,19,19, 0,13,13,15,16, 0,
134.4877 +	17,16,18,18, 0,14,14,15,15, 0,21,21,19,18, 0,22,
134.4878 +	21,18,17, 0,14,14,15,15, 0,18,18,19,18, 0,15,15,
134.4879 +	14,14, 0,22,21,19,19, 0,22,21,17,18, 0, 0, 0,19,
134.4880 +	19, 0, 0, 0, 0, 0, 0,20,22,17,17, 0, 0,22,22,20,
134.4881 +	 0, 0, 0,19,18, 0,21,22,19,18, 0, 0, 0, 0, 0, 0,
134.4882 +	22,22,17,18, 0, 0, 0,21,22, 0, 0, 0,19,18, 0,20,
134.4883 +	20,17,17, 0,21,21,17,18, 0,21,22,18,18, 0,21, 0,
134.4884 +	18,18, 0,22, 0,19,19, 0,19,21,18,18, 0, 0,22,18,
134.4885 +	18, 0,22,21,17,17, 0,22, 0,20,20, 0, 0, 0,18,18,
134.4886 +	 0,22,21,18,18, 0,21, 0,19,19, 0,20,21,17,17, 0,
134.4887 +	 0,22,22,20, 0,21,22,17,17, 0, 0,21,19,18, 0, 0,
134.4888 +	 0,21,21, 0,21,20,16,17, 0, 0, 0, 0, 0, 0,21, 0,
134.4889 +	17,17, 0,21, 0,19,20, 0, 0, 0,20,22, 0,20,20,17,
134.4890 +	17, 0, 0, 0, 0, 0, 0,21,21,17,17, 0,12,12,13,13,
134.4891 +	 0,14,14,16,16, 0,14,14,16,16, 0,18,18,21, 0, 0,
134.4892 +	19,19,22, 0, 0,13,13,16,16, 0,16,16,18,18, 0,13,
134.4893 +	13,16,16, 0,18,18,21,22, 0,18,18, 0,22, 0,13,13,
134.4894 +	16,16, 0,17,17,20,18, 0,13,13,16,16, 0,19,18, 0,
134.4895 +	22, 0,18,18,22,21, 0,18,19, 0, 0, 0, 0, 0, 0, 0,
134.4896 +	 0,16,16,21,21, 0,21,21, 0, 0, 0,18,19, 0, 0, 0,
134.4897 +	19,19,21, 0, 0, 0, 0, 0, 0, 0,16,16, 0,21, 0,20,
134.4898 +	20, 0, 0, 0,20,20, 0, 0, 0,16,16,21,20, 0,18,17,
134.4899 +	21,22, 0,17,18, 0,21, 0,18,19,22,22, 0,19,19, 0,
134.4900 +	22, 0,16,17,21,22, 0,20,19, 0, 0, 0,16,16,20,21,
134.4901 +	 0,19,19, 0, 0, 0,19,19, 0,22, 0,17,17,21,21, 0,
134.4902 +	19,20, 0, 0, 0,16,16, 0,20, 0,19,20, 0,21, 0,18,
134.4903 +	18, 0,22, 0,19,20,22,22, 0, 0, 0, 0,22, 0,17,17,
134.4904 +	 0,21, 0,21,21, 0, 0, 0,18,19,23,21, 0,20,19, 0,
134.4905 +	 0, 0, 0, 0, 0, 0, 0,17,17, 0,20, 0, 0, 0, 0, 0,
134.4906 +	 0,19,19,23,22,
134.4907 +};
134.4908 +
134.4909 +static const static_codebook _44p4_p5_0 = {
134.4910 +	5, 3125,
134.4911 +	(long *)_vq_lengthlist__44p4_p5_0,
134.4912 +	1, -528744448, 1616642048, 3, 0,
134.4913 +	(long *)_vq_quantlist__44p4_p5_0,
134.4914 +	0
134.4915 +};
134.4916 +
134.4917 +static const long _vq_quantlist__44p4_p5_1[] = {
134.4918 +	3,
134.4919 +	2,
134.4920 +	4,
134.4921 +	1,
134.4922 +	5,
134.4923 +	0,
134.4924 +	6,
134.4925 +};
134.4926 +
134.4927 +static const long _vq_lengthlist__44p4_p5_1[] = {
134.4928 +	 2, 3, 3, 3, 3, 3, 3,
134.4929 +};
134.4930 +
134.4931 +static const static_codebook _44p4_p5_1 = {
134.4932 +	1, 7,
134.4933 +	(long *)_vq_lengthlist__44p4_p5_1,
134.4934 +	1, -533200896, 1611661312, 3, 0,
134.4935 +	(long *)_vq_quantlist__44p4_p5_1,
134.4936 +	0
134.4937 +};
134.4938 +
134.4939 +static const long _vq_quantlist__44p4_p6_0[] = {
134.4940 +	1,
134.4941 +	0,
134.4942 +	2,
134.4943 +};
134.4944 +
134.4945 +static const long _vq_lengthlist__44p4_p6_0[] = {
134.4946 +	 1, 7, 7, 7, 8, 8, 7, 8, 8, 7, 9, 9,11,11,11, 9,
134.4947 +	 8, 8, 8, 9, 9,12,11,12, 9, 8, 8, 6, 7, 7,10,11,
134.4948 +	11,10,10,10,11,11,11,14,14,14,12,11,12,11,11,11,
134.4949 +	15,15,14,13,12,12, 5, 6, 6, 8, 5, 5, 8, 7, 7, 8,
134.4950 +	 7, 7,12,10,10,10, 7, 6, 9, 8, 8,12,10,10,10, 6,
134.4951 +	 6, 7, 8, 8,12,10,10,12,10,10,11,10,10,16,14,14,
134.4952 +	13,10,10,12,10,10,15,14,14,14,10,10, 7, 7, 7,13,
134.4953 +	11,11,13,11,11,12,11,11,16,14,14,14,12,12,12,11,
134.4954 +	11,18,15,15,14,12,12,10, 9,10,14,11,11,13,11,11,
134.4955 +	12,11,11,17,14,14,14,11,11,13,11,11,16,15,15,14,
134.4956 +	11,11, 7, 8, 8,13,11,11,12,10,10,12,10,10,16,14,
134.4957 +	13,13,10,10,12,10,10,17,14,14,14,10,10, 8, 7, 7,
134.4958 +	12,11,11,13,11,11,12,11,11,16,15,14,14,12,12,12,
134.4959 +	11,11,16,15,15,14,12,12,11,10,10,14,11,11,13,11,
134.4960 +	11,13,11,11,17,14,14,14,11,11,13,11,11,18,14,15,
134.4961 +	15,11,10,
134.4962 +};
134.4963 +
134.4964 +static const static_codebook _44p4_p6_0 = {
134.4965 +	5, 243,
134.4966 +	(long *)_vq_lengthlist__44p4_p6_0,
134.4967 +	1, -527106048, 1620377600, 2, 0,
134.4968 +	(long *)_vq_quantlist__44p4_p6_0,
134.4969 +	0
134.4970 +};
134.4971 +
134.4972 +static const long _vq_quantlist__44p4_p6_1[] = {
134.4973 +	1,
134.4974 +	0,
134.4975 +	2,
134.4976 +};
134.4977 +
134.4978 +static const long _vq_lengthlist__44p4_p6_1[] = {
134.4979 +	 2, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 9, 9, 9, 9,
134.4980 +	 7, 7, 8, 8, 8, 9, 9, 9, 9, 8, 8, 6, 7, 7, 8, 8,
134.4981 +	 8, 8, 8, 8, 9, 8, 8, 9, 8, 9, 9, 8, 8,10, 8, 8,
134.4982 +	10, 9, 9,10, 8, 8, 6, 6, 6, 8, 6, 6, 8, 7, 7, 8,
134.4983 +	 7, 7,10, 8, 8, 9, 7, 7, 9, 7, 7,10, 8, 8, 9, 7,
134.4984 +	 7, 7, 7, 7,10, 8, 8,11, 9, 9,10, 9, 9,11, 9, 9,
134.4985 +	11, 8, 8,11, 9, 9,12, 9, 9,12, 8, 8, 7, 7, 7,10,
134.4986 +	 9, 9,10, 9, 9,10, 9, 9,11,10,10,10, 9, 9,11, 9,
134.4987 +	10,11,10,11,10, 9, 9, 9, 8, 8,10, 9, 9,10, 9, 9,
134.4988 +	11, 9, 9,11,10,10,11, 9, 9,11, 9, 9,11,10,10,11,
134.4989 +	 9, 9, 8, 8, 8,11, 9, 9,11, 9, 9,11, 9, 9,12, 9,
134.4990 +	 9,12, 8, 8,11, 9, 9,12, 9, 9,12, 8, 8, 8, 7, 7,
134.4991 +	10, 9, 9,10, 9, 9,10, 9, 9,11,11,11,11, 9, 9,11,
134.4992 +	10,10,11,11,11,11, 9, 9,10, 9, 9,11, 9, 9,11, 9,
134.4993 +	10,11,10,10,11,10,10,11, 9, 9,11,10,10,11,10,10,
134.4994 +	11, 9, 9,
134.4995 +};
134.4996 +
134.4997 +static const static_codebook _44p4_p6_1 = {
134.4998 +	5, 243,
134.4999 +	(long *)_vq_lengthlist__44p4_p6_1,
134.5000 +	1, -530841600, 1616642048, 2, 0,
134.5001 +	(long *)_vq_quantlist__44p4_p6_1,
134.5002 +	0
134.5003 +};
134.5004 +
134.5005 +static const long _vq_quantlist__44p4_p7_0[] = {
134.5006 +	1,
134.5007 +	0,
134.5008 +	2,
134.5009 +};
134.5010 +
134.5011 +static const long _vq_lengthlist__44p4_p7_0[] = {
134.5012 +	 1, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9,
134.5013 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.5014 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.5015 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.5016 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.5017 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.5018 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.5019 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.5020 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.5021 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.5022 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.5023 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.5024 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.5025 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.5026 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.5027 +	 9, 9, 9,
134.5028 +};
134.5029 +
134.5030 +static const static_codebook _44p4_p7_0 = {
134.5031 +	5, 243,
134.5032 +	(long *)_vq_lengthlist__44p4_p7_0,
134.5033 +	1, -513979392, 1633504256, 2, 0,
134.5034 +	(long *)_vq_quantlist__44p4_p7_0,
134.5035 +	0
134.5036 +};
134.5037 +
134.5038 +static const long _vq_quantlist__44p4_p7_1[] = {
134.5039 +	1,
134.5040 +	0,
134.5041 +	2,
134.5042 +};
134.5043 +
134.5044 +static const long _vq_lengthlist__44p4_p7_1[] = {
134.5045 +	 1, 9, 9, 7, 9, 9, 8, 8, 9, 9, 9, 9, 9, 9, 9, 8,
134.5046 +	 9, 9, 7, 9, 9, 9, 9, 9, 9, 9, 9, 7, 9, 9, 9, 9,
134.5047 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.5048 +	 9, 9, 9, 9, 9, 9, 6, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.5049 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.5050 +	 9, 5, 9, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.5051 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 9, 8, 9,
134.5052 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.5053 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.5054 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.5055 +	 9, 9, 5,10, 9,10,10,10,10,10,10,10,10,10,10,10,
134.5056 +	10,10,10,10,10,10,10,10,10,10,10,10,10, 8,10,10,
134.5057 +	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
134.5058 +	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
134.5059 +	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
134.5060 +	10,10,10,
134.5061 +};
134.5062 +
134.5063 +static const static_codebook _44p4_p7_1 = {
134.5064 +	5, 243,
134.5065 +	(long *)_vq_lengthlist__44p4_p7_1,
134.5066 +	1, -516716544, 1630767104, 2, 0,
134.5067 +	(long *)_vq_quantlist__44p4_p7_1,
134.5068 +	0
134.5069 +};
134.5070 +
134.5071 +static const long _vq_quantlist__44p4_p7_2[] = {
134.5072 +	12,
134.5073 +	11,
134.5074 +	13,
134.5075 +	10,
134.5076 +	14,
134.5077 +	9,
134.5078 +	15,
134.5079 +	8,
134.5080 +	16,
134.5081 +	7,
134.5082 +	17,
134.5083 +	6,
134.5084 +	18,
134.5085 +	5,
134.5086 +	19,
134.5087 +	4,
134.5088 +	20,
134.5089 +	3,
134.5090 +	21,
134.5091 +	2,
134.5092 +	22,
134.5093 +	1,
134.5094 +	23,
134.5095 +	0,
134.5096 +	24,
134.5097 +};
134.5098 +
134.5099 +static const long _vq_lengthlist__44p4_p7_2[] = {
134.5100 +	 1, 3, 2, 5, 4, 7, 7, 8, 8, 9, 9,10,10,11,11,12,
134.5101 +	12,13,13,14,14,15,15,15,15,
134.5102 +};
134.5103 +
134.5104 +static const static_codebook _44p4_p7_2 = {
134.5105 +	1, 25,
134.5106 +	(long *)_vq_lengthlist__44p4_p7_2,
134.5107 +	1, -518864896, 1620639744, 5, 0,
134.5108 +	(long *)_vq_quantlist__44p4_p7_2,
134.5109 +	0
134.5110 +};
134.5111 +
134.5112 +static const long _vq_quantlist__44p4_p7_3[] = {
134.5113 +	12,
134.5114 +	11,
134.5115 +	13,
134.5116 +	10,
134.5117 +	14,
134.5118 +	9,
134.5119 +	15,
134.5120 +	8,
134.5121 +	16,
134.5122 +	7,
134.5123 +	17,
134.5124 +	6,
134.5125 +	18,
134.5126 +	5,
134.5127 +	19,
134.5128 +	4,
134.5129 +	20,
134.5130 +	3,
134.5131 +	21,
134.5132 +	2,
134.5133 +	22,
134.5134 +	1,
134.5135 +	23,
134.5136 +	0,
134.5137 +	24,
134.5138 +};
134.5139 +
134.5140 +static const long _vq_lengthlist__44p4_p7_3[] = {
134.5141 +	 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5,
134.5142 +	 5, 5, 5, 5, 5, 5, 5, 5, 5,
134.5143 +};
134.5144 +
134.5145 +static const static_codebook _44p4_p7_3 = {
134.5146 +	1, 25,
134.5147 +	(long *)_vq_lengthlist__44p4_p7_3,
134.5148 +	1, -529006592, 1611661312, 5, 0,
134.5149 +	(long *)_vq_quantlist__44p4_p7_3,
134.5150 +	0
134.5151 +};
134.5152 +
134.5153 +static const long _huff_lengthlist__44p4_short[] = {
134.5154 +	 3, 5,16, 9, 9,13,18,21, 4, 2,21, 6, 6,10,15,21,
134.5155 +	16,19, 6, 5, 7,10,13,16, 8, 6, 5, 4, 4, 8,13,16,
134.5156 +	 8, 5, 6, 4, 4, 7,12,15,13,10, 9, 7, 7, 9,13,16,
134.5157 +	18,15,13,12, 9, 7,10,14,21,18,13,13, 7, 5, 8,12,
134.5158 +};
134.5159 +
134.5160 +static const static_codebook _huff_book__44p4_short = {
134.5161 +	2, 64,
134.5162 +	(long *)_huff_lengthlist__44p4_short,
134.5163 +	0, 0, 0, 0, 0,
134.5164 +	NULL,
134.5165 +	0
134.5166 +};
134.5167 +
134.5168 +static const long _vq_quantlist__44p5_l0_0[] = {
134.5169 +	6,
134.5170 +	5,
134.5171 +	7,
134.5172 +	4,
134.5173 +	8,
134.5174 +	3,
134.5175 +	9,
134.5176 +	2,
134.5177 +	10,
134.5178 +	1,
134.5179 +	11,
134.5180 +	0,
134.5181 +	12,
134.5182 +};
134.5183 +
134.5184 +static const long _vq_lengthlist__44p5_l0_0[] = {
134.5185 +	 1, 4, 4, 8, 8,10,10,10,10, 9, 8,11,11, 4, 6, 5,
134.5186 +	 8, 6,10,10,10,10,10, 9,10, 9, 4, 5, 6, 6, 9,10,
134.5187 +	10,10,10, 9,10, 9,10, 8, 9, 8, 9, 8, 9, 9,10, 9,
134.5188 +	11,10,12,10, 8, 8, 9, 8, 9, 9, 9, 9,10,10,11,10,
134.5189 +	12, 9,10,10,11,10,11,10,12,11,12,11,13,11, 9,10,
134.5190 +	10,10,11,10,11,11,12,11,12,11,12,11,12,12,12,12,
134.5191 +	13,12,13,12,13,12,13,13,11,12,12,12,12,12,12,12,
134.5192 +	13,13,13,13,13,12,12,12,13,13,13,13,13,13,13,13,
134.5193 +	13,13,12,13,12,13,13,13,13,13,13,13,13,13,13,12,
134.5194 +	13,13,13,14,14,13,13,13,13,13,13,13,12,13,12,13,
134.5195 +	13,13,13,13,13,13,13,13,13,
134.5196 +};
134.5197 +
134.5198 +static const static_codebook _44p5_l0_0 = {
134.5199 +	2, 169,
134.5200 +	(long *)_vq_lengthlist__44p5_l0_0,
134.5201 +	1, -526516224, 1616117760, 4, 0,
134.5202 +	(long *)_vq_quantlist__44p5_l0_0,
134.5203 +	0
134.5204 +};
134.5205 +
134.5206 +static const long _vq_quantlist__44p5_l0_1[] = {
134.5207 +	2,
134.5208 +	1,
134.5209 +	3,
134.5210 +	0,
134.5211 +	4,
134.5212 +};
134.5213 +
134.5214 +static const long _vq_lengthlist__44p5_l0_1[] = {
134.5215 +	 4, 4, 4, 5, 5, 4, 5, 5, 5, 5, 4, 5, 4, 4, 5, 5,
134.5216 +	 5, 5, 5, 5, 5, 5, 5, 5, 5,
134.5217 +};
134.5218 +
134.5219 +static const static_codebook _44p5_l0_1 = {
134.5220 +	2, 25,
134.5221 +	(long *)_vq_lengthlist__44p5_l0_1,
134.5222 +	1, -533725184, 1611661312, 3, 0,
134.5223 +	(long *)_vq_quantlist__44p5_l0_1,
134.5224 +	0
134.5225 +};
134.5226 +
134.5227 +static const long _vq_quantlist__44p5_l1_0[] = {
134.5228 +	1,
134.5229 +	0,
134.5230 +	2,
134.5231 +};
134.5232 +
134.5233 +static const long _vq_lengthlist__44p5_l1_0[] = {
134.5234 +	 1, 4, 4, 4, 4, 4, 4, 4, 4,
134.5235 +};
134.5236 +
134.5237 +static const static_codebook _44p5_l1_0 = {
134.5238 +	2, 9,
134.5239 +	(long *)_vq_lengthlist__44p5_l1_0,
134.5240 +	1, -516716544, 1630767104, 2, 0,
134.5241 +	(long *)_vq_quantlist__44p5_l1_0,
134.5242 +	0
134.5243 +};
134.5244 +
134.5245 +static const long _huff_lengthlist__44p5_lfe[] = {
134.5246 +	 1, 3, 2, 3,
134.5247 +};
134.5248 +
134.5249 +static const static_codebook _huff_book__44p5_lfe = {
134.5250 +	2, 4,
134.5251 +	(long *)_huff_lengthlist__44p5_lfe,
134.5252 +	0, 0, 0, 0, 0,
134.5253 +	NULL,
134.5254 +	0
134.5255 +};
134.5256 +
134.5257 +static const long _huff_lengthlist__44p5_long[] = {
134.5258 +	 3, 7,12,14,14,16,18,19, 6, 2, 4, 6, 8, 9,12,14,
134.5259 +	12, 3, 3, 5, 7, 8,11,13,13, 6, 4, 5, 7, 8,10,11,
134.5260 +	14, 8, 7, 7, 7, 7, 9,10,15, 9, 8, 7, 7, 6, 8, 9,
134.5261 +	17,11,11,10, 9, 8, 9, 9,19,14,13,11,10, 9, 9, 9,
134.5262 +};
134.5263 +
134.5264 +static const static_codebook _huff_book__44p5_long = {
134.5265 +	2, 64,
134.5266 +	(long *)_huff_lengthlist__44p5_long,
134.5267 +	0, 0, 0, 0, 0,
134.5268 +	NULL,
134.5269 +	0
134.5270 +};
134.5271 +
134.5272 +static const long _vq_quantlist__44p5_p1_0[] = {
134.5273 +	1,
134.5274 +	0,
134.5275 +	2,
134.5276 +};
134.5277 +
134.5278 +static const long _vq_lengthlist__44p5_p1_0[] = {
134.5279 +	 2, 5, 5, 5, 7, 7, 5, 7, 7, 5, 7, 7, 7, 8, 9, 7,
134.5280 +	 9, 9, 5, 7, 7, 7, 9, 9, 7, 9, 8, 5, 7, 8, 8, 9,
134.5281 +	10, 8, 9,10, 8, 9,10, 9,10,12,10,11,11, 8,10,10,
134.5282 +	10,11,11, 9,11,11, 5, 8, 7, 8, 9, 9, 8,10, 9, 8,
134.5283 +	10,10, 9,11,11,10,11,11, 8,10, 9,10,11,11, 9,12,
134.5284 +	10, 5, 8, 8, 7, 9,10, 8,10, 9, 7, 9, 9, 9,10,11,
134.5285 +	 9,11,11, 8,10, 9,10,11,11,10,11,11, 7, 9, 9, 9,
134.5286 +	10,11, 9,11,11, 9, 9,11,10,10,13,11,11,12, 9,11,
134.5287 +	11,11,12,13,11,13,12, 7, 9, 9, 9,11,11, 9,11,10,
134.5288 +	 9,11,10,10,11,12,11,13,12, 9,11,11,11,12,13,11,
134.5289 +	13,11, 5, 8, 8, 8, 9,10, 7,10, 9, 8, 9,10,10,11,
134.5290 +	11,10,11,11, 7, 9, 9, 9,11,11, 9,11,10, 7, 9, 9,
134.5291 +	 9,10,11, 9,11,11, 9,11,11,11,11,13,11,13,12, 9,
134.5292 +	10,11,11,12,13,10,12,11, 7, 9, 9, 9,11,11, 9,11,
134.5293 +	10, 9,11,11,11,12,13,11,13,12, 9,11, 9,11,12,11,
134.5294 +	10,13,10,
134.5295 +};
134.5296 +
134.5297 +static const static_codebook _44p5_p1_0 = {
134.5298 +	5, 243,
134.5299 +	(long *)_vq_lengthlist__44p5_p1_0,
134.5300 +	1, -535822336, 1611661312, 2, 0,
134.5301 +	(long *)_vq_quantlist__44p5_p1_0,
134.5302 +	0
134.5303 +};
134.5304 +
134.5305 +static const long _vq_quantlist__44p5_p2_0[] = {
134.5306 +	2,
134.5307 +	1,
134.5308 +	3,
134.5309 +	0,
134.5310 +	4,
134.5311 +};
134.5312 +
134.5313 +static const long _vq_lengthlist__44p5_p2_0[] = {
134.5314 +	 4, 6, 6, 9, 9, 6, 7, 8,10,10, 6, 8, 7,10,10, 8,
134.5315 +	10,10,12,13, 8,10,10,13,12, 6, 7, 8,10,10, 7, 8,
134.5316 +	 9,10,11, 8, 9, 9,11,11,10,10,11,12,14,10,11,11,
134.5317 +	14,13, 6, 8, 7,10,10, 8, 9, 9,11,11, 7, 9, 8,11,
134.5318 +	10,10,11,11,13,14,10,11,10,14,12, 9,10,10,12,12,
134.5319 +	10,10,11,12,13,10,11,11,13,13,12,12,13,12,15,13,
134.5320 +	14,13,15,14, 9,10,10,12,12,10,11,11,13,13,10,11,
134.5321 +	10,13,12,13,13,14,14,15,12,13,12,15,12, 6, 7, 8,
134.5322 +	10,11, 8, 9,10,11,12, 8, 9, 9,11,12,10,11,12,13,
134.5323 +	14,10,11,11,14,13, 8, 9,10,11,12, 9,10,11,12,13,
134.5324 +	 9,10,11,12,13,11,12,13,13,15,12,12,13,15,14, 8,
134.5325 +	 9, 9,12,12, 9,10,11,12,13, 9,10,10,13,12,12,12,
134.5326 +	13,14,15,11,12,12,14,14,11,11,12,13,14,11,12,13,
134.5327 +	13,15,12,13,13,14,15,14,13,15,14,16,14,15,15,16,
134.5328 +	16,11,12,11,14,13,12,13,13,15,14,11,13,12,14,13,
134.5329 +	14,15,15,15,16,13,14,14,16,14, 6, 8, 7,11,10, 8,
134.5330 +	 9, 9,11,12, 8,10, 9,12,11,10,11,11,13,14,10,12,
134.5331 +	11,14,13, 8, 9, 9,12,12, 9,10,10,12,13, 9,11,10,
134.5332 +	13,12,11,12,12,13,14,12,13,12,15,14, 8,10, 9,12,
134.5333 +	11, 9,11,10,13,12, 9,11,10,13,12,12,13,12,14,15,
134.5334 +	11,13,12,15,13,11,11,12,13,14,11,12,13,13,15,12,
134.5335 +	13,13,14,15,13,14,14,14,16,14,15,15,16,16,11,12,
134.5336 +	11,14,13,12,13,13,15,14,11,13,12,15,13,14,15,15,
134.5337 +	16,16,13,15,13,16,14, 9,10,11,12,14,11,11,12,13,
134.5338 +	15,11,12,12,13,14,13,14,15,15,17,13,14,14,15,16,
134.5339 +	11,11,12,13,15,12,12,13,14,16,12,13,13,14,15,14,
134.5340 +	14,16,15,17,15,15,15,16,17,11,12,12,14,14,12,13,
134.5341 +	13,15,16,12,13,13,15,15,15,15,15,16,17,14,15,15,
134.5342 +	16,16,14,14,15,15,17,14,15,15,15,17,15,15,16,16,
134.5343 +	17,16,16,17,16,18,17,17,17,18,18,14,15,14,16,16,
134.5344 +	15,15,16,17,17,14,15,15,17,16,17,17,17,18,18,16,
134.5345 +	16,16,17,17, 9,11,10,14,12,11,12,12,14,13,11,12,
134.5346 +	11,15,13,13,14,14,16,15,13,15,14,17,15,11,12,12,
134.5347 +	15,14,12,13,13,15,15,12,13,13,15,15,14,15,15,16,
134.5348 +	16,15,15,15,17,16,11,12,11,15,13,12,13,13,15,14,
134.5349 +	12,13,12,16,14,15,15,15,17,16,14,15,14,17,15,14,
134.5350 +	14,15,16,16,14,15,15,16,16,15,16,15,17,17,16,16,
134.5351 +	16,17,17,17,17,17,18,17,14,15,14,16,15,15,15,15,
134.5352 +	17,16,15,15,15,17,15,17,17,17,18,18,16,17,16,18,
134.5353 +	16, 6, 8, 8,11,11, 8, 9, 9,11,12, 8, 9, 9,12,11,
134.5354 +	10,11,11,13,14,10,12,11,14,13, 7, 9, 9,11,12, 9,
134.5355 +	10,10,12,13, 9,10,10,13,13,11,11,12,13,15,11,12,
134.5356 +	12,15,14, 8, 9, 9,12,11, 9,11,10,13,13, 9,11,10,
134.5357 +	13,12,12,13,12,14,15,11,13,12,15,13,10,11,12,13,
134.5358 +	14,11,12,12,13,15,12,12,13,14,15,13,13,14,14,16,
134.5359 +	14,15,15,16,16,11,12,11,14,13,12,13,13,15,14,11,
134.5360 +	13,12,15,13,14,15,15,15,16,13,14,14,16,14, 7, 9,
134.5361 +	 9,11,12, 9,10,11,12,13, 9,10,10,13,12,11,12,12,
134.5362 +	14,15,11,12,12,15,14, 9, 9,11,11,13,10,10,12,12,
134.5363 +	14,10,11,12,13,14,12,12,13,14,16,12,13,13,15,15,
134.5364 +	 9,11,10,13,13,10,12,12,13,14,10,12,11,14,13,12,
134.5365 +	13,13,15,16,12,13,13,15,14,11,11,13,13,15,12,12,
134.5366 +	14,13,16,13,13,13,14,15,14,14,15,14,17,15,15,15,
134.5367 +	16,16,12,13,12,15,14,13,14,14,15,15,12,14,13,16,
134.5368 +	14,15,15,16,16,17,14,15,14,17,15, 7, 9, 9,12,11,
134.5369 +	 9,10,10,12,13, 9,11,10,13,12,11,12,12,14,14,11,
134.5370 +	13,12,15,14, 9,10,10,13,12,10,10,11,12,13,10,12,
134.5371 +	11,14,13,12,12,13,13,15,12,14,13,16,15, 9,10,10,
134.5372 +	13,12,11,11,12,13,13,10,12,10,14,12,13,13,13,15,
134.5373 +	15,12,13,12,15,13,11,12,12,14,14,12,12,13,14,15,
134.5374 +	13,14,13,15,15,14,13,15,13,16,15,16,15,17,16,12,
134.5375 +	13,12,14,14,13,14,14,15,15,12,13,12,15,14,15,15,
134.5376 +	16,16,17,14,15,13,16,13,10,11,12,13,14,11,12,13,
134.5377 +	14,15,12,13,13,15,15,14,14,15,15,17,14,15,15,16,
134.5378 +	16,12,12,13,12,15,12,12,14,13,16,13,13,14,14,16,
134.5379 +	14,14,16,15,17,15,15,16,16,17,12,13,13,15,15,13,
134.5380 +	14,14,16,16,13,14,13,16,15,15,16,16,17,17,14,15,
134.5381 +	15,17,16,14,14,15,14,17,15,15,16,15,17,15,15,16,
134.5382 +	15,17,16,16,17,16,18,17,17,17,17,18,14,15,15,17,
134.5383 +	16,15,16,16,17,17,15,16,15,17,16,17,17,17,18,18,
134.5384 +	16,17,16,18,17,10,12,11,14,14,12,13,13,15,15,12,
134.5385 +	13,12,15,14,14,15,15,16,16,14,15,15,17,16,11,13,
134.5386 +	12,15,14,12,13,13,15,15,13,14,13,16,14,15,15,15,
134.5387 +	16,16,15,16,15,17,16,12,13,13,15,15,13,14,14,16,
134.5388 +	16,12,14,13,16,15,15,16,16,17,17,15,16,15,17,16,
134.5389 +	14,15,15,16,16,14,15,15,16,16,15,16,16,17,16,16,
134.5390 +	16,16,16,17,17,18,17,18,17,14,15,15,17,16,15,16,
134.5391 +	16,17,17,15,16,15,17,16,17,17,18,18,18,16,17,16,
134.5392 +	18,16, 6, 8, 8,11,11, 8, 9, 9,11,12, 8, 9, 9,12,
134.5393 +	11,10,11,12,13,14,10,11,11,14,13, 8, 9, 9,11,12,
134.5394 +	 9,10,11,12,13, 9,10,11,13,13,11,12,13,13,15,12,
134.5395 +	12,12,15,14, 7, 9, 9,12,11, 9,10,10,13,13, 9,10,
134.5396 +	10,13,12,11,12,12,14,15,11,12,11,15,13,11,11,12,
134.5397 +	13,14,11,12,13,13,15,12,13,13,14,15,13,14,14,14,
134.5398 +	16,14,15,15,16,16,10,12,11,14,13,12,13,12,14,14,
134.5399 +	11,12,12,15,13,14,15,15,16,16,13,14,13,16,14, 7,
134.5400 +	 9, 9,11,12, 9,10,11,12,13, 9,10,10,13,12,11,12,
134.5401 +	13,14,15,11,12,12,14,14, 9,10,10,12,13,10,10,12,
134.5402 +	12,14,11,12,11,13,13,12,12,14,13,15,13,13,13,15,
134.5403 +	15, 9,10,10,12,13,10,11,12,13,14,10,11,10,13,12,
134.5404 +	13,13,14,15,16,12,13,12,15,13,12,13,13,14,14,12,
134.5405 +	12,13,14,15,13,14,14,15,15,14,13,15,13,16,15,16,
134.5406 +	15,17,16,11,12,12,14,14,13,13,14,15,15,12,13,12,
134.5407 +	15,14,15,15,16,16,17,14,14,13,16,13, 7, 9, 9,12,
134.5408 +	11, 9,10,10,12,13, 9,11,10,13,12,11,12,12,14,15,
134.5409 +	11,12,12,15,14, 9,10,11,13,13,10,11,12,13,14,10,
134.5410 +	12,12,14,13,12,13,13,14,16,12,13,13,16,15, 9,11,
134.5411 +	 9,13,11,10,12,11,13,13,10,12,10,14,12,12,13,13,
134.5412 +	15,15,12,13,12,16,14,12,12,13,14,15,12,13,14,14,
134.5413 +	15,13,14,14,15,15,14,14,15,15,17,15,16,15,17,16,
134.5414 +	11,13,11,15,13,13,14,13,15,14,12,14,12,16,13,15,
134.5415 +	15,15,16,16,14,15,14,17,14,10,11,12,14,14,12,12,
134.5416 +	13,14,15,12,13,13,15,15,14,15,15,16,17,14,15,15,
134.5417 +	16,16,12,12,13,15,15,13,13,14,15,16,13,14,14,16,
134.5418 +	16,15,15,16,16,17,15,16,16,17,17,11,12,13,14,15,
134.5419 +	13,13,14,15,16,12,13,13,15,15,15,15,16,16,17,15,
134.5420 +	15,15,16,16,14,15,15,16,17,15,15,16,16,17,15,16,
134.5421 +	16,17,17,16,16,17,16,18,17,17,17,18,18,14,15,15,
134.5422 +	16,16,15,16,16,16,17,15,15,15,16,16,17,17,17,18,
134.5423 +	18,16,16,16,17,16,10,12,11,14,13,12,13,13,15,15,
134.5424 +	11,13,12,15,14,14,15,15,16,16,14,15,14,17,15,12,
134.5425 +	13,13,15,15,13,13,14,16,16,13,14,14,16,16,15,15,
134.5426 +	15,16,17,15,16,16,17,17,12,13,12,15,12,13,14,13,
134.5427 +	16,14,12,14,12,16,13,15,16,15,17,16,14,16,14,17,
134.5428 +	15,14,15,15,16,17,15,15,16,17,17,15,16,16,17,17,
134.5429 +	16,16,17,17,18,17,18,17,18,18,14,15,14,17,14,15,
134.5430 +	16,15,17,15,15,16,15,17,15,17,17,17,18,17,16,17,
134.5431 +	16,18,16, 9,11,11,14,14,11,12,12,14,14,11,12,12,
134.5432 +	15,14,13,14,14,16,16,13,15,14,16,16,10,11,12,14,
134.5433 +	14,11,12,13,15,15,12,13,13,15,15,13,14,15,16,17,
134.5434 +	14,15,15,17,16,11,12,12,15,14,12,13,13,15,15,12,
134.5435 +	13,13,15,15,14,15,15,16,16,14,15,15,17,16,12,13,
134.5436 +	14,15,16,13,14,14,15,16,13,14,15,16,16,15,15,16,
134.5437 +	16,18,16,16,16,18,17,14,14,14,16,15,15,15,15,17,
134.5438 +	16,14,15,15,17,16,16,17,17,18,17,16,16,16,18,16,
134.5439 +	10,12,12,14,14,11,12,13,15,15,12,13,13,15,15,13,
134.5440 +	14,15,16,17,14,15,15,17,16,11,12,13,14,15,12,12,
134.5441 +	14,15,16,13,13,14,15,16,14,14,15,16,17,15,15,16,
134.5442 +	17,17,12,13,13,15,15,13,14,14,16,16,13,14,13,16,
134.5443 +	15,15,16,15,17,17,15,16,15,17,16,13,13,15,14,17,
134.5444 +	14,13,16,15,17,15,14,16,15,17,15,15,17,16,18,16,
134.5445 +	16,17,17,18,14,15,15,17,16,15,16,16,17,17,15,16,
134.5446 +	15,17,16,17,17,17,18,18,16,17,16,18,17,10,12,11,
134.5447 +	14,14,11,12,13,15,15,12,13,12,15,15,14,15,15,16,
134.5448 +	16,14,15,15,17,16,11,12,12,15,15,12,13,13,15,15,
134.5449 +	13,14,13,16,15,14,15,15,16,16,15,16,15,17,16,11,
134.5450 +	13,13,15,15,13,14,14,15,15,12,14,13,16,15,15,16,
134.5451 +	15,17,17,15,16,15,17,16,13,15,14,16,16,14,15,14,
134.5452 +	16,16,15,16,15,17,16,15,16,16,16,17,16,17,16,18,
134.5453 +	17,14,15,15,16,16,15,16,16,17,17,15,15,15,17,16,
134.5454 +	17,17,17,18,18,16,16,16,18,16,12,13,13,15,16,13,
134.5455 +	14,14,15,16,13,14,14,16,16,15,15,16,16,18,15,16,
134.5456 +	16,17,17,13,13,14,15,16,14,14,15,15,17,14,15,15,
134.5457 +	16,17,15,15,17,16,18,16,16,17,17,17,13,14,14,16,
134.5458 +	16,14,15,15,17,17,14,15,14,17,16,16,17,16,17,18,
134.5459 +	16,17,16,18,17,15,15,16,14,17,16,15,17,14,18,16,
134.5460 +	16,16,15,18,16,16,18,15,19,18,18,18,17,19,15,16,
134.5461 +	16,18,17,16,17,17,18,17,16,17,16,18,17,18,18,18,
134.5462 +	19,19,17,18,16,18,17,11,12,12,15,15,13,13,14,15,
134.5463 +	16,13,14,13,16,15,15,16,16,16,17,15,16,16,17,16,
134.5464 +	12,14,13,16,15,13,13,14,15,16,14,15,14,17,15,15,
134.5465 +	15,16,16,17,16,17,16,18,17,12,13,14,15,16,14,15,
134.5466 +	15,16,16,13,14,13,16,15,16,16,16,17,17,15,16,15,
134.5467 +	17,15,15,16,15,17,16,15,15,15,16,16,16,17,16,18,
134.5468 +	16,16,15,16,15,17,17,18,17,18,17,15,15,16,17,17,
134.5469 +	16,16,17,17,17,15,16,15,17,16,18,18,18,18,18,16,
134.5470 +	17,16,18,15, 9,11,11,14,14,11,12,12,14,15,10,12,
134.5471 +	12,15,14,13,14,15,16,16,13,14,14,16,16,11,12,12,
134.5472 +	14,15,12,12,13,15,15,12,13,13,15,15,14,15,15,16,
134.5473 +	17,14,15,15,16,16,10,12,12,14,14,12,13,13,15,15,
134.5474 +	11,13,12,15,15,14,15,15,16,17,13,15,14,16,16,14,
134.5475 +	14,14,15,16,14,15,15,16,17,14,15,15,16,17,16,16,
134.5476 +	17,16,18,16,17,17,17,17,12,14,13,16,15,13,15,14,
134.5477 +	16,16,13,14,14,16,15,16,16,16,17,17,15,16,15,17,
134.5478 +	16,10,11,11,14,14,12,12,13,14,15,11,13,12,15,14,
134.5479 +	14,15,15,16,17,14,15,15,16,16,12,13,13,15,15,12,
134.5480 +	13,14,15,16,13,14,14,15,15,15,15,16,16,17,15,15,
134.5481 +	16,17,17,11,12,12,15,15,13,13,14,15,16,12,13,13,
134.5482 +	15,15,15,15,16,16,17,14,15,15,16,16,14,15,15,16,
134.5483 +	16,15,15,15,16,17,15,16,16,17,17,16,16,17,16,18,
134.5484 +	17,17,17,17,18,13,14,15,16,16,15,15,16,16,17,14,
134.5485 +	14,14,16,16,16,16,17,17,18,16,16,16,17,16,10,12,
134.5486 +	12,14,14,12,13,13,15,15,11,13,12,15,15,14,15,15,
134.5487 +	16,17,13,15,14,17,16,12,13,13,15,15,13,13,14,15,
134.5488 +	16,13,14,14,16,16,15,15,16,16,17,15,15,16,17,17,
134.5489 +	11,13,12,15,14,13,14,13,16,15,12,14,12,16,15,15,
134.5490 +	16,15,17,17,14,15,14,17,16,14,15,15,16,17,15,15,
134.5491 +	16,16,17,15,16,16,17,17,16,16,17,17,18,17,17,17,
134.5492 +	18,18,13,15,13,17,14,14,16,14,17,16,14,15,13,17,
134.5493 +	15,16,17,16,18,17,15,17,15,18,16,11,12,12,15,15,
134.5494 +	13,13,14,15,16,13,14,13,16,15,15,16,16,16,17,15,
134.5495 +	16,16,17,16,12,14,13,16,15,13,13,14,15,16,14,15,
134.5496 +	15,16,16,16,15,16,16,17,16,16,16,17,17,12,13,14,
134.5497 +	15,16,14,14,15,15,17,13,14,13,16,15,16,16,17,17,
134.5498 +	18,15,16,15,17,15,15,16,15,17,17,15,15,16,16,17,
134.5499 +	16,17,16,17,17,16,15,17,15,18,17,18,17,18,18,15,
134.5500 +	15,16,16,17,16,16,17,16,18,15,15,15,16,16,17,17,
134.5501 +	18,17,18,16,16,15,17,15,12,13,13,15,15,13,14,14,
134.5502 +	16,16,13,14,14,16,16,15,16,16,17,18,15,16,15,18,
134.5503 +	16,13,14,14,16,16,14,14,15,16,17,14,15,15,17,17,
134.5504 +	16,16,17,17,18,16,16,17,18,17,13,14,13,16,14,14,
134.5505 +	15,15,17,16,14,15,14,17,15,16,17,17,18,17,15,17,
134.5506 +	15,18,16,15,16,16,17,17,16,16,17,17,18,16,17,17,
134.5507 +	18,18,17,16,18,17,19,18,18,18,18,18,15,16,15,17,
134.5508 +	14,16,16,16,18,15,16,17,15,18,14,18,18,18,18,17,
134.5509 +	17,18,16,19,15,
134.5510 +};
134.5511 +
134.5512 +static const static_codebook _44p5_p2_0 = {
134.5513 +	5, 3125,
134.5514 +	(long *)_vq_lengthlist__44p5_p2_0,
134.5515 +	1, -533725184, 1611661312, 3, 0,
134.5516 +	(long *)_vq_quantlist__44p5_p2_0,
134.5517 +	0
134.5518 +};
134.5519 +
134.5520 +static const long _vq_quantlist__44p5_p3_0[] = {
134.5521 +	1,
134.5522 +	0,
134.5523 +	2,
134.5524 +};
134.5525 +
134.5526 +static const long _vq_lengthlist__44p5_p3_0[] = {
134.5527 +	 1, 5, 6, 5, 7, 8, 5, 8, 7, 5, 7, 8, 7, 8,10, 8,
134.5528 +	10,10, 5, 8, 7, 8,10,10, 7,10, 8, 6, 8, 9, 8,10,
134.5529 +	11, 9,10,10, 9,10,11,10,11,12,11,12,12, 9,11,10,
134.5530 +	11,12,12,10,12,11, 6, 9, 8, 9,10,10, 8,11,10, 9,
134.5531 +	10,11,10,11,12,11,12,12, 9,11,10,11,12,12,10,12,
134.5532 +	11, 6, 9, 9, 8,10,11, 9,11,10, 8,10,10,10,10,12,
134.5533 +	11,12,12, 9,11,10,11,12,12,10,12,11, 8,10,10,10,
134.5534 +	11,12,10,12,11,10,10,12,11,11,13,12,13,13,10,12,
134.5535 +	11,12,13,13,11,13,11, 7,10,10,10,11,12,10,12,11,
134.5536 +	10,12,11,11,11,12,12,14,13,10,12,12,12,14,14,11,
134.5537 +	13,11, 6, 9, 9, 9,10,11, 8,11,10, 9,10,11,10,11,
134.5538 +	12,11,12,12, 8,11,10,11,12,12,10,12,10, 7,10,10,
134.5539 +	10,11,12,10,12,11,10,12,12,11,11,13,12,13,13,10,
134.5540 +	11,12,12,13,14,11,12,11, 8,10,10,10,11,12,10,12,
134.5541 +	11,10,11,12,11,11,13,12,13,13,10,12,10,12,13,13,
134.5542 +	11,13,11,
134.5543 +};
134.5544 +
134.5545 +static const static_codebook _44p5_p3_0 = {
134.5546 +	5, 243,
134.5547 +	(long *)_vq_lengthlist__44p5_p3_0,
134.5548 +	1, -533200896, 1614282752, 2, 0,
134.5549 +	(long *)_vq_quantlist__44p5_p3_0,
134.5550 +	0
134.5551 +};
134.5552 +
134.5553 +static const long _vq_quantlist__44p5_p3_1[] = {
134.5554 +	1,
134.5555 +	0,
134.5556 +	2,
134.5557 +};
134.5558 +
134.5559 +static const long _vq_lengthlist__44p5_p3_1[] = {
134.5560 +	 5, 6, 6, 6, 7, 7, 6, 7, 7, 6, 7, 7, 7, 7, 8, 7,
134.5561 +	 8, 8, 6, 7, 7, 7, 8, 8, 7, 8, 7, 7, 8, 8, 8, 8,
134.5562 +	 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 8, 9, 9, 8, 8, 8,
134.5563 +	 8, 9, 9, 8, 9, 9, 7, 8, 7, 8, 8, 8, 8, 8, 8, 8,
134.5564 +	 8, 8, 8, 9, 9, 8, 9, 9, 8, 8, 8, 8, 9, 9, 8, 9,
134.5565 +	 8, 6, 8, 8, 7, 8, 8, 7, 8, 8, 7, 8, 8, 8, 8, 9,
134.5566 +	 8, 9, 9, 8, 8, 8, 8, 9, 9, 8, 9, 8, 7, 8, 8, 8,
134.5567 +	 9, 9, 8, 9, 9, 8, 8, 9, 9, 9, 9, 9, 9, 9, 8, 9,
134.5568 +	 9, 9, 9, 9, 9, 9, 9, 7, 8, 8, 8, 8, 9, 8, 9, 8,
134.5569 +	 8, 8, 8, 8, 9, 9, 9, 9, 9, 8, 9, 8, 9, 9, 9, 8,
134.5570 +	 9, 9, 6, 8, 8, 7, 8, 8, 7, 8, 8, 8, 8, 8, 8, 8,
134.5571 +	 9, 8, 9, 9, 7, 8, 8, 8, 9, 9, 8, 9, 8, 7, 8, 8,
134.5572 +	 8, 8, 9, 8, 9, 8, 8, 8, 9, 8, 9, 9, 9, 9, 9, 8,
134.5573 +	 8, 8, 9, 9, 9, 8, 9, 9, 7, 8, 8, 8, 9, 9, 8, 9,
134.5574 +	 9, 8, 9, 9, 9, 9, 9, 9, 9, 9, 8, 9, 8, 9, 9, 9,
134.5575 +	 9, 9, 9,
134.5576 +};
134.5577 +
134.5578 +static const static_codebook _44p5_p3_1 = {
134.5579 +	5, 243,
134.5580 +	(long *)_vq_lengthlist__44p5_p3_1,
134.5581 +	1, -535822336, 1611661312, 2, 0,
134.5582 +	(long *)_vq_quantlist__44p5_p3_1,
134.5583 +	0
134.5584 +};
134.5585 +
134.5586 +static const long _vq_quantlist__44p5_p4_0[] = {
134.5587 +	1,
134.5588 +	0,
134.5589 +	2,
134.5590 +};
134.5591 +
134.5592 +static const long _vq_lengthlist__44p5_p4_0[] = {
134.5593 +	 1, 5, 5, 5, 7, 9, 5, 9, 7, 5, 7, 8, 7, 7,10, 9,
134.5594 +	10,10, 5, 8, 7, 9,10,10, 7,10, 7, 6, 8, 9, 9,10,
134.5595 +	12, 9,11,11, 9,10,11,11,11,13,12,13,13, 9,11,11,
134.5596 +	11,12,13,11,13,11, 6, 9, 8, 9,11,11, 9,12,10, 9,
134.5597 +	11,11,11,11,13,11,13,12, 9,11,10,12,13,13,11,13,
134.5598 +	11, 6, 9, 9, 8,10,11, 9,12,11, 9,10,11,10,10,12,
134.5599 +	11,13,13, 9,11,11,11,13,12,11,13,11, 8,10,10, 9,
134.5600 +	10,12,10,12,11,10,10,12,10,10,13,12,13,13,10,12,
134.5601 +	11,12,13,13,10,13,10, 7,10,10,11,11,13,11,14,11,
134.5602 +	10,12,11,11,11,13,13,14,13,10,12,12,14,14,14,11,
134.5603 +	14,11, 6, 9, 9, 9,11,12, 8,11,10, 9,11,11,11,11,
134.5604 +	13,11,12,13, 8,11,10,11,13,13,10,12,10, 7,10,10,
134.5605 +	11,11,14,11,13,11,10,12,12,11,11,14,14,14,14,10,
134.5606 +	11,12,13,13,14,11,13,11, 8,10,10,10,11,12, 9,12,
134.5607 +	10,10,11,12,11,10,13,12,13,13,10,12,10,12,13,13,
134.5608 +	11,13,10,
134.5609 +};
134.5610 +
134.5611 +static const static_codebook _44p5_p4_0 = {
134.5612 +	5, 243,
134.5613 +	(long *)_vq_lengthlist__44p5_p4_0,
134.5614 +	1, -531365888, 1616117760, 2, 0,
134.5615 +	(long *)_vq_quantlist__44p5_p4_0,
134.5616 +	0
134.5617 +};
134.5618 +
134.5619 +static const long _vq_quantlist__44p5_p4_1[] = {
134.5620 +	2,
134.5621 +	1,
134.5622 +	3,
134.5623 +	0,
134.5624 +	4,
134.5625 +};
134.5626 +
134.5627 +static const long _vq_lengthlist__44p5_p4_1[] = {
134.5628 +	 5, 7, 7,10,10, 7, 8, 9,10,11, 7, 9, 8,11,10, 9,
134.5629 +	10,10,11,11, 9,10,10,11,11, 7, 9, 9,10,10, 8, 9,
134.5630 +	10,10,11, 9,10,10,11,11,10,10,11,11,11,10,11,11,
134.5631 +	12,12, 7, 9, 9,10,10, 9,10,10,11,11, 8,10, 9,11,
134.5632 +	10,10,11,11,11,11,10,11,10,11,11,10,10,10,11,11,
134.5633 +	10,10,11,11,11,11,11,11,11,11,11,11,12,11,12,11,
134.5634 +	12,11,12,12,10,10,10,11,11,10,11,11,11,11,10,11,
134.5635 +	10,11,11,11,12,11,12,12,11,12,11,12,11, 8, 9, 9,
134.5636 +	11,11, 9,10,10,11,12, 9,10,10,11,11,10,11,11,12,
134.5637 +	12,10,11,11,12,12, 9,10,10,11,11,10,10,11,11,12,
134.5638 +	10,11,11,12,12,11,11,12,12,12,11,12,12,12,12, 9,
134.5639 +	10,10,11,11,10,11,11,12,12,10,11,10,12,12,11,12,
134.5640 +	12,12,12,11,12,12,12,12,11,11,11,12,12,11,11,12,
134.5641 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.5642 +	12,11,11,11,12,12,11,12,12,12,12,11,12,12,12,12,
134.5643 +	12,12,12,12,12,12,12,12,12,12, 8, 9, 9,11,11, 9,
134.5644 +	10,10,11,11, 9,10,10,11,11,10,11,11,12,12,10,11,
134.5645 +	11,12,12, 9,10,10,11,11,10,10,11,12,12,10,11,11,
134.5646 +	12,12,11,12,12,12,12,11,12,12,12,12, 9,10,10,11,
134.5647 +	11,10,11,11,12,12,10,11,10,12,11,11,12,12,12,12,
134.5648 +	11,12,11,12,12,11,11,11,12,12,11,12,12,12,12,11,
134.5649 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,11,11,
134.5650 +	11,12,12,11,12,12,12,12,11,12,11,12,12,12,12,12,
134.5651 +	12,12,12,12,12,12,12,10,11,11,12,12,11,12,12,12,
134.5652 +	12,11,12,12,12,12,12,12,13,13,13,12,12,12,13,13,
134.5653 +	11,12,12,12,12,12,12,12,12,13,12,12,12,13,13,12,
134.5654 +	12,13,13,13,12,13,13,13,13,11,12,12,12,12,12,12,
134.5655 +	12,13,13,12,12,12,13,13,12,13,13,13,13,12,13,13,
134.5656 +	13,13,12,12,12,12,13,12,13,13,13,13,13,13,13,13,
134.5657 +	13,13,13,13,13,13,13,13,13,13,13,12,12,12,13,12,
134.5658 +	13,13,13,13,13,12,13,13,13,13,13,13,13,13,13,13,
134.5659 +	13,13,13,13,10,11,11,12,12,11,12,12,12,12,11,12,
134.5660 +	11,12,12,12,12,12,13,12,12,12,12,13,13,11,12,12,
134.5661 +	12,12,12,12,12,13,13,12,12,12,13,13,12,13,13,13,
134.5662 +	13,12,13,13,13,13,11,12,12,12,12,12,12,12,13,13,
134.5663 +	12,12,12,13,12,12,13,13,13,13,12,13,12,13,13,12,
134.5664 +	12,12,12,13,12,13,13,13,13,12,13,13,13,13,13,13,
134.5665 +	13,13,13,13,13,13,13,13,12,12,12,13,12,13,13,13,
134.5666 +	13,13,12,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.5667 +	13, 8, 9, 9,11,11, 9,10,10,11,11, 9,10,10,12,11,
134.5668 +	10,11,11,12,12,10,11,11,12,12, 9,10,10,11,11,10,
134.5669 +	10,11,11,12,10,11,11,12,12,11,11,12,12,12,11,12,
134.5670 +	12,12,12, 9,10,10,11,11,10,11,11,12,12,10,11,10,
134.5671 +	12,12,11,12,12,12,12,11,12,12,12,12,11,11,11,12,
134.5672 +	12,11,11,12,12,12,11,12,12,12,12,12,12,12,12,12,
134.5673 +	12,12,12,12,12,11,11,11,12,12,11,12,12,12,12,11,
134.5674 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12, 9,10,
134.5675 +	10,11,11,10,10,11,12,12,10,11,11,12,12,11,11,12,
134.5676 +	12,12,11,12,12,12,12,10,10,11,11,12,11,11,12,12,
134.5677 +	12,11,11,12,12,12,11,11,12,12,13,12,12,12,12,12,
134.5678 +	10,11,11,12,12,11,12,11,12,12,11,12,11,12,12,12,
134.5679 +	12,12,12,12,12,12,12,12,12,11,11,12,12,12,12,12,
134.5680 +	12,12,12,12,12,12,12,13,12,12,13,12,13,12,12,13,
134.5681 +	13,13,11,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.5682 +	12,12,12,12,13,12,12,12,12,13,12, 8,10,10,11,11,
134.5683 +	10,11,11,12,12,10,11,10,12,12,11,12,12,12,12,11,
134.5684 +	12,12,12,12,10,11,10,12,12,10,10,11,12,12,11,12,
134.5685 +	12,12,12,12,12,12,12,13,12,12,12,13,13,10,11,11,
134.5686 +	12,12,11,12,12,12,12,10,12,11,12,12,12,12,12,13,
134.5687 +	13,12,13,12,13,12,11,12,12,12,12,11,12,12,12,13,
134.5688 +	12,12,12,13,13,12,12,13,12,13,12,13,13,13,13,11,
134.5689 +	12,12,12,12,12,12,12,13,13,12,12,12,13,12,12,13,
134.5690 +	13,13,13,12,13,12,13,12,11,11,11,12,12,11,12,12,
134.5691 +	12,13,11,12,12,12,12,12,12,12,13,13,12,12,13,13,
134.5692 +	13,11,12,12,12,12,12,12,12,12,13,12,12,13,13,13,
134.5693 +	12,12,13,13,13,13,13,13,13,13,11,12,12,12,12,12,
134.5694 +	13,12,13,13,12,12,12,13,13,12,13,13,13,13,12,13,
134.5695 +	13,13,13,12,12,12,12,13,12,13,13,13,13,13,13,13,
134.5696 +	13,13,13,13,13,13,13,13,13,13,13,13,12,12,12,13,
134.5697 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.5698 +	13,13,13,13,13,10,11,11,12,12,11,12,12,12,13,11,
134.5699 +	12,12,13,12,12,13,13,13,13,12,13,13,13,13,11,12,
134.5700 +	12,12,12,12,12,12,13,13,12,13,12,13,13,13,13,13,
134.5701 +	13,13,13,13,13,13,13,11,12,12,13,12,12,13,12,13,
134.5702 +	13,12,13,12,13,13,13,13,13,13,13,13,13,13,13,13,
134.5703 +	12,13,13,13,13,12,13,13,13,13,13,13,13,13,13,13,
134.5704 +	13,13,13,13,13,13,13,13,13,12,13,13,13,13,13,13,
134.5705 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.5706 +	13,13, 8, 9, 9,11,11, 9,10,10,11,12, 9,10,10,11,
134.5707 +	11,10,11,11,12,12,10,11,11,12,12, 9,10,10,11,11,
134.5708 +	10,10,11,12,12,10,11,11,12,12,11,11,12,12,12,11,
134.5709 +	12,12,12,12, 9,10,10,11,11,10,11,11,12,12,10,11,
134.5710 +	10,12,12,11,12,12,12,12,11,12,11,12,12,11,11,11,
134.5711 +	12,12,11,11,12,12,12,12,12,12,12,12,12,12,12,12,
134.5712 +	12,12,12,12,12,12,11,11,11,12,12,11,12,12,12,12,
134.5713 +	11,12,11,12,12,12,12,12,12,12,12,12,12,12,12, 8,
134.5714 +	10,10,11,11,10,10,11,12,12,10,11,11,12,12,11,12,
134.5715 +	12,12,12,11,12,12,12,12,10,11,11,12,12,10,11,12,
134.5716 +	12,12,11,12,12,12,12,12,12,12,12,13,12,12,12,13,
134.5717 +	13,10,10,11,12,12,11,12,12,12,12,10,11,10,12,12,
134.5718 +	12,12,12,13,13,12,12,12,13,12,11,12,12,12,12,11,
134.5719 +	12,12,12,13,12,12,12,13,13,12,12,13,12,13,12,13,
134.5720 +	13,13,13,11,12,12,12,12,12,12,12,13,13,11,12,12,
134.5721 +	13,12,12,13,13,13,13,12,13,12,13,12, 9,10,10,11,
134.5722 +	11,10,11,11,12,12,10,11,11,12,12,11,12,12,12,12,
134.5723 +	11,12,11,12,12,10,11,11,12,12,11,11,12,12,12,11,
134.5724 +	11,12,12,12,12,12,12,12,13,12,12,12,13,12,10,11,
134.5725 +	10,12,11,11,12,11,12,12,11,12,11,12,12,12,12,12,
134.5726 +	12,12,12,12,11,12,12,11,12,12,12,12,12,12,12,12,
134.5727 +	12,12,12,12,12,12,12,12,13,12,13,12,13,13,13,13,
134.5728 +	11,12,11,12,12,12,12,12,13,12,12,12,12,12,12,12,
134.5729 +	13,12,13,13,12,12,12,13,12,10,11,11,12,12,11,12,
134.5730 +	12,12,13,11,12,12,13,12,12,12,13,13,13,12,13,13,
134.5731 +	13,13,11,12,12,12,13,12,12,13,13,13,12,12,13,13,
134.5732 +	13,13,13,13,13,13,13,13,13,13,13,11,12,12,12,12,
134.5733 +	12,12,13,13,13,12,13,12,13,13,13,13,13,13,13,13,
134.5734 +	13,13,13,13,12,13,13,13,13,12,13,13,13,13,13,13,
134.5735 +	13,13,13,13,13,13,13,13,13,13,13,13,13,12,12,13,
134.5736 +	13,13,13,13,13,13,13,12,13,13,13,13,13,13,13,13,
134.5737 +	13,13,13,13,13,13,11,11,11,12,12,11,12,12,12,12,
134.5738 +	11,12,12,12,12,12,12,13,13,13,12,13,12,13,13,11,
134.5739 +	12,12,12,12,12,12,13,13,13,12,12,13,13,13,12,13,
134.5740 +	13,13,13,12,13,13,13,13,11,12,12,12,12,12,13,12,
134.5741 +	13,13,12,12,12,13,12,13,13,13,13,13,12,13,12,13,
134.5742 +	13,12,12,12,13,13,12,13,13,13,13,13,13,13,13,13,
134.5743 +	13,13,13,13,13,13,13,13,13,13,12,12,12,13,12,13,
134.5744 +	13,13,13,13,12,13,13,13,13,13,13,13,13,13,13,13,
134.5745 +	13,13,13,10,11,11,12,12,11,12,12,12,12,11,12,12,
134.5746 +	12,12,12,12,12,13,13,12,12,12,13,13,11,12,12,12,
134.5747 +	12,11,12,12,13,13,12,12,12,13,13,12,12,13,13,13,
134.5748 +	12,13,13,13,13,11,12,12,12,12,12,12,12,13,13,12,
134.5749 +	12,12,13,12,12,13,13,13,13,12,13,12,13,13,12,12,
134.5750 +	12,12,12,12,12,13,13,13,12,13,13,13,13,12,13,13,
134.5751 +	13,13,13,13,13,13,13,12,12,12,13,12,12,13,13,13,
134.5752 +	13,12,13,12,13,13,13,13,13,13,13,13,13,13,13,13,
134.5753 +	10,11,11,12,12,11,12,12,12,13,11,12,12,13,12,12,
134.5754 +	12,12,13,13,12,12,12,13,13,11,12,12,12,12,12,12,
134.5755 +	13,13,13,12,12,12,13,13,12,12,13,13,13,12,13,13,
134.5756 +	13,13,11,12,12,12,12,12,12,12,13,13,12,12,12,13,
134.5757 +	13,12,13,13,13,13,12,13,13,13,13,12,12,12,12,13,
134.5758 +	12,12,13,13,13,12,13,13,13,13,12,13,13,13,13,13,
134.5759 +	13,13,13,13,12,12,12,13,13,13,13,13,13,13,12,13,
134.5760 +	13,13,13,13,13,13,13,13,13,13,13,13,13,10,11,11,
134.5761 +	12,12,11,12,12,12,13,11,12,12,13,12,12,13,13,13,
134.5762 +	13,12,13,12,13,13,11,12,12,13,13,12,12,12,13,13,
134.5763 +	12,12,13,13,13,12,13,13,13,13,13,13,13,13,13,11,
134.5764 +	12,12,13,12,12,13,12,13,13,12,13,12,13,13,13,13,
134.5765 +	13,13,13,12,13,13,13,13,12,12,12,13,13,12,13,13,
134.5766 +	13,13,12,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.5767 +	13,12,12,12,13,13,12,13,13,13,13,12,13,13,13,13,
134.5768 +	13,13,13,13,13,13,13,13,13,13,11,11,11,12,12,11,
134.5769 +	12,12,12,12,11,12,12,12,12,12,12,12,13,13,12,12,
134.5770 +	12,13,13,11,12,12,12,12,12,12,12,12,13,12,12,12,
134.5771 +	13,13,12,12,13,13,13,12,13,13,13,13,11,12,12,12,
134.5772 +	12,12,12,12,13,13,12,12,12,13,12,12,13,13,13,13,
134.5773 +	12,13,12,13,13,12,12,12,12,12,12,12,13,12,13,12,
134.5774 +	13,13,13,13,12,13,13,12,13,13,13,13,13,13,12,12,
134.5775 +	12,12,12,12,13,13,13,13,12,13,12,13,13,13,13,13,
134.5776 +	13,13,12,13,13,13,12,10,11,11,12,12,11,12,12,12,
134.5777 +	12,11,12,12,12,12,12,12,12,13,13,12,13,12,13,13,
134.5778 +	11,12,12,12,12,12,12,12,13,13,12,12,12,13,13,12,
134.5779 +	12,13,13,13,13,13,13,13,13,11,12,12,12,12,12,13,
134.5780 +	12,13,13,12,13,12,13,13,12,13,13,13,13,12,13,12,
134.5781 +	13,13,12,12,12,12,12,12,13,13,13,13,12,13,13,13,
134.5782 +	13,13,13,13,13,13,13,13,13,13,13,12,12,12,13,12,
134.5783 +	12,13,13,13,13,12,13,12,13,13,13,13,13,13,13,13,
134.5784 +	13,13,13,13,10,11,11,12,12,11,12,12,12,12,11,12,
134.5785 +	12,12,12,12,12,12,13,13,12,12,12,13,13,11,12,12,
134.5786 +	12,12,12,12,12,13,13,12,12,12,13,13,12,12,13,13,
134.5787 +	13,12,12,13,13,13,11,12,11,12,12,12,12,12,13,13,
134.5788 +	11,12,12,13,13,12,13,13,13,13,12,13,12,13,13,12,
134.5789 +	12,12,12,12,12,13,13,13,13,12,13,13,13,13,13,13,
134.5790 +	13,13,13,13,13,13,13,13,12,12,12,13,12,12,13,13,
134.5791 +	13,13,12,13,12,13,13,13,13,13,13,13,12,13,13,13,
134.5792 +	13,10,11,11,12,12,11,12,12,12,13,11,12,12,13,12,
134.5793 +	12,12,13,13,13,12,13,13,13,13,11,12,12,13,13,12,
134.5794 +	12,13,13,13,12,12,13,13,13,12,13,13,13,13,13,13,
134.5795 +	13,13,13,11,12,12,13,12,12,13,12,13,13,12,12,12,
134.5796 +	13,13,12,13,13,13,13,13,13,13,13,13,12,12,13,13,
134.5797 +	13,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.5798 +	13,13,13,13,13,12,12,12,13,13,13,13,13,13,13,12,
134.5799 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,10,12,
134.5800 +	11,12,12,11,12,12,12,13,11,12,12,12,12,12,12,12,
134.5801 +	13,13,12,12,12,13,13,11,12,12,12,13,12,12,12,13,
134.5802 +	13,12,12,12,13,13,12,13,13,13,13,12,13,13,13,13,
134.5803 +	11,12,12,13,12,12,12,12,13,13,12,12,12,13,13,12,
134.5804 +	13,13,13,13,12,13,12,13,13,12,13,12,13,13,12,13,
134.5805 +	13,13,13,12,13,13,13,13,13,13,13,13,13,13,13,13,
134.5806 +	13,13,12,12,12,13,12,13,13,13,13,13,12,13,12,13,
134.5807 +	13,13,13,13,13,13,12,13,13,13,13,10,11,11,12,12,
134.5808 +	11,12,12,12,13,11,12,12,12,12,12,12,12,13,13,12,
134.5809 +	12,12,13,13,11,12,12,12,12,12,12,13,13,13,12,13,
134.5810 +	13,13,13,12,12,13,13,13,13,13,13,13,13,11,12,12,
134.5811 +	12,12,12,13,12,13,13,12,12,12,13,13,12,13,13,13,
134.5812 +	13,12,13,12,13,13,12,12,12,12,13,12,13,13,13,13,
134.5813 +	12,13,13,13,13,12,13,13,13,13,13,13,13,13,13,12,
134.5814 +	12,12,12,12,12,13,13,13,13,12,13,13,13,13,13,13,
134.5815 +	13,13,13,12,13,13,13,13,11,12,11,12,12,11,12,12,
134.5816 +	12,12,11,12,12,12,12,12,12,12,12,13,12,12,12,13,
134.5817 +	12,11,12,12,12,12,12,12,12,12,13,12,12,12,13,13,
134.5818 +	12,12,13,13,13,12,13,13,13,13,11,12,12,12,12,12,
134.5819 +	12,12,13,13,12,12,12,13,12,12,13,13,13,13,12,13,
134.5820 +	12,13,13,12,12,12,12,12,12,12,13,13,13,12,13,13,
134.5821 +	13,13,13,13,13,12,13,13,13,13,13,13,12,12,12,12,
134.5822 +	12,12,13,13,13,13,12,13,12,13,12,13,13,13,13,13,
134.5823 +	13,13,13,13,12,
134.5824 +};
134.5825 +
134.5826 +static const static_codebook _44p5_p4_1 = {
134.5827 +	5, 3125,
134.5828 +	(long *)_vq_lengthlist__44p5_p4_1,
134.5829 +	1, -533725184, 1611661312, 3, 0,
134.5830 +	(long *)_vq_quantlist__44p5_p4_1,
134.5831 +	0
134.5832 +};
134.5833 +
134.5834 +static const long _vq_quantlist__44p5_p5_0[] = {
134.5835 +	2,
134.5836 +	1,
134.5837 +	3,
134.5838 +	0,
134.5839 +	4,
134.5840 +};
134.5841 +
134.5842 +static const long _vq_lengthlist__44p5_p5_0[] = {
134.5843 +	 1, 6, 6,10,10, 6, 7, 9,11,13, 5, 9, 7,13,11, 8,
134.5844 +	11,12,13,15, 8,12,11,15,13, 6, 7, 8,11,11, 7, 8,
134.5845 +	10,11,13, 9,10,10,13,13,11,11,13,12,16,12,13,13,
134.5846 +	16,15, 6, 8, 7,11,11, 9,10,10,13,13, 7,10, 7,13,
134.5847 +	11,12,13,13,15,16,11,13,11,16,12,10,11,11,11,13,
134.5848 +	11,11,13,12,15,13,13,13,14,15,13,12,15,12,17,15,
134.5849 +	16,16,16,16,10,11,11,14,11,13,13,13,15,14,11,13,
134.5850 +	11,15,12,15,15,16,16,16,13,15,12,17,12, 6, 8, 9,
134.5851 +	12,12, 9,10,12,13,15, 9,11,11,15,14,12,13,15,16,
134.5852 +	18,13,14,14,17,16, 9,10,11,13,14,11,10,13,14,16,
134.5853 +	11,12,12,15,15,14,13,16,15,18,14,15,15,17,17, 9,
134.5854 +	11,11,14,14,11,12,13,15,16,11,13,11,15,14,15,15,
134.5855 +	15,17,18,14,15,14,17,15,13,14,14,15,16,14,14,15,
134.5856 +	15,17,15,16,15,17,17,16,16,17,15,19,17,18,18,19,
134.5857 +	18,13,14,14,16,15,15,15,16,17,17,14,15,14,18,15,
134.5858 +	17,17,17,19,19,16,17,15,19,16, 6, 9, 8,13,12, 9,
134.5859 +	11,11,14,15, 9,12,10,15,13,13,14,14,16,17,12,15,
134.5860 +	13,18,16, 9,11,11,14,14,11,11,13,14,15,11,13,12,
134.5861 +	16,15,14,14,15,15,18,14,15,15,18,17, 9,11,10,14,
134.5862 +	13,11,12,12,15,15,11,13,10,16,14,14,15,15,16,18,
134.5863 +	14,16,13,18,15,13,14,14,16,16,14,14,15,15,17,15,
134.5864 +	16,15,17,17,16,16,17,16,19,17,18,17,18,19,13,14,
134.5865 +	14,16,15,15,15,15,17,17,14,15,14,17,15,17,17,17,
134.5866 +	18,19,16,17,15,19,15,11,13,13,15,16,13,14,15,16,
134.5867 +	18,14,15,15,17,17,16,16,18,18,20,17,18,17,19,20,
134.5868 +	13,14,14,16,17,15,15,16,17,18,15,16,16,17,17,18,
134.5869 +	17,19,18,19,18,18,18,19,21,14,14,15,16,17,15,15,
134.5870 +	16,18,18,15,16,16,17,18,18,18,19,19,21,18,19,19,
134.5871 +	22,20,16,16,17,17,19,17,17,17,18,20,17,18,18,20,
134.5872 +	19,19,19,20,19, 0,19,19,20,20,21,17,17,17,19,18,
134.5873 +	18,18,20,19,19,18,18,18,20,20,19,19,20,20,20,20,
134.5874 +	21,20,21,19,11,13,13,16,15,14,15,15,17,17,14,15,
134.5875 +	14,18,16,16,18,18,20,19,16,19,17,21,18,13,14,15,
134.5876 +	16,17,15,15,16,18,18,15,16,15,19,18,18,18,18,19,
134.5877 +	19,18,18,18,22,20,13,14,14,16,16,15,16,16,18,17,
134.5878 +	15,16,15,18,17,18,18,18,19,19,17,18,17,21,18,16,
134.5879 +	17,17,18,18,17,18,19,19,19,18,20,18,19,19,19,20,
134.5880 +	21,19,21,20,20,20, 0,21,16,17,17,19,19,18,18,18,
134.5881 +	19,21,17,18,18,19,18,20,19,21,20,21,19,20,20,22,
134.5882 +	19, 7, 9, 9,13,13, 8,10,11,14,15, 9,12,11,15,14,
134.5883 +	11,13,14,16,17,13,15,14,17,16, 8,10,11,14,14,10,
134.5884 +	10,12,14,16,11,12,12,16,15,13,12,15,15,18,14,15,
134.5885 +	15,19,17, 9,11,11,14,14,11,12,12,15,15,11,13,11,
134.5886 +	16,14,14,15,14,17,17,14,16,14,18,15,12,13,14,15,
134.5887 +	16,13,13,15,14,17,15,15,15,17,17,15,14,17,14,19,
134.5888 +	17,18,18,19,18,13,14,14,16,16,15,15,15,17,17,14,
134.5889 +	15,14,18,15,17,18,17,18,17,16,18,16,19,15, 7,10,
134.5890 +	10,13,13, 9,10,12,14,15,10,12,11,15,14,12,13,14,
134.5891 +	16,17,13,15,14,18,16,10,10,12,13,14,10,10,13,13,
134.5892 +	16,12,12,13,15,15,13,12,15,15,18,15,15,16,18,17,
134.5893 +	10,11,11,14,14,12,13,13,15,16,10,13,10,16,14,14,
134.5894 +	15,15,17,17,14,15,13,17,15,13,13,14,15,16,14,13,
134.5895 +	15,14,18,15,15,16,16,17,16,15,18,15,18,17,18,18,
134.5896 +	18,18,13,15,14,17,16,15,16,16,17,17,14,15,13,17,
134.5897 +	15,17,17,18,18,18,16,17,14,20,14, 8,10,10,14,14,
134.5898 +	11,11,13,14,16,11,13,11,16,14,14,15,16,16,18,14,
134.5899 +	16,15,18,16,10,12,11,15,14,11,11,13,14,16,13,14,
134.5900 +	13,16,15,15,14,16,15,19,16,17,16,20,18,10,11,12,
134.5901 +	14,15,13,13,14,16,16,11,14,11,16,14,16,16,17,18,
134.5902 +	19,15,17,14,20,15,14,15,14,17,16,13,14,15,15,18,
134.5903 +	16,17,16,19,18,16,15,18,15,19,18,19,18,21,21,14,
134.5904 +	14,15,16,17,16,16,17,18,18,13,15,14,17,15,18,18,
134.5905 +	19,18,22,16,18,15,21,15,12,13,14,16,16,14,14,16,
134.5906 +	16,18,14,15,15,17,18,16,16,18,18,20,18,18,17,20,
134.5907 +	20,13,14,15,15,17,15,14,16,16,18,16,16,16,17,19,
134.5908 +	17,15,18,17,21,18,18,18,19,19,14,15,15,18,17,15,
134.5909 +	16,16,18,19,15,16,15,18,18,17,18,18,20,21,17,19,
134.5910 +	17,20,19,16,16,17,16,19,17,17,18,17,20,18,18,18,
134.5911 +	18,19,19,18,20,17,22,20,20,19,20,20,17,17,18,18,
134.5912 +	19,18,18,20,21,20,17,18,17,20,20,21,21,21,21,21,
134.5913 +	19,21,18,22,20,11,13,13,17,16,14,14,16,16,18,14,
134.5914 +	16,14,18,16,17,18,19,19,20,18,19,18,21,19,14,15,
134.5915 +	14,17,16,14,14,16,18,18,16,17,16,18,17,18,17,19,
134.5916 +	18,20,19,19,18,20,20,13,14,15,16,17,16,16,17,18,
134.5917 +	19,14,16,14,19,17,18,19,18,20,20,18,20,17,21,18,
134.5918 +	17,17,17,19,18,16,17,18,18,19,18,19,18,21,21,18,
134.5919 +	18,20,17,21,19,20,20,22,21,16,17,18,18,19,18,18,
134.5920 +	19,21,20,16,17,17,20,18,21,21,22,21,22,18,21,18,
134.5921 +	 0,18, 7, 9, 9,13,13, 9,11,12,14,15, 8,11,10,15,
134.5922 +	14,13,14,15,16,18,11,14,13,17,15, 9,11,11,14,14,
134.5923 +	11,11,13,14,16,11,12,12,15,15,14,14,16,15,18,14,
134.5924 +	14,15,17,17, 8,11,10,14,14,11,12,12,15,15,10,12,
134.5925 +	10,16,14,14,15,15,17,18,13,15,12,18,15,13,14,14,
134.5926 +	16,16,14,14,15,15,17,15,15,15,16,17,16,15,17,15,
134.5927 +	19,17,17,17,18,18,12,14,13,16,15,15,15,15,17,17,
134.5928 +	13,15,13,17,14,17,18,18,18,19,15,17,14,19,14, 8,
134.5929 +	10,10,14,14,11,11,13,14,16,11,13,11,16,14,14,15,
134.5930 +	16,17,19,14,16,15,18,17,10,12,11,15,14,11,11,14,
134.5931 +	14,17,13,14,13,17,15,15,14,17,15,19,16,17,16,19,
134.5932 +	17,10,11,12,14,15,13,13,14,15,17,11,13,11,17,14,
134.5933 +	16,16,17,18,19,15,16,14,18,15,14,15,14,16,16,13,
134.5934 +	14,15,15,18,16,16,16,18,18,16,15,18,15,20,18,19,
134.5935 +	18,21,18,14,14,15,16,17,16,16,17,17,18,13,15,14,
134.5936 +	17,16,19,19,19,19,19,15,18,15,20,15, 7,10,10,13,
134.5937 +	13,10,11,12,14,15, 9,12,10,15,14,13,14,15,16,17,
134.5938 +	12,15,13,17,16,10,11,11,14,14,10,10,13,14,16,12,
134.5939 +	13,13,16,15,14,13,16,15,18,15,15,16,17,17,10,12,
134.5940 +	10,14,13,12,13,12,15,15,10,13,10,16,13,15,16,15,
134.5941 +	17,18,13,16,12,18,15,13,14,14,16,17,14,13,15,15,
134.5942 +	18,15,16,15,17,17,16,14,17,15,19,17,18,18,19,19,
134.5943 +	13,15,13,17,14,15,15,15,18,17,14,15,13,17,14,18,
134.5944 +	17,18,18,19,15,17,15,19,15,11,13,13,16,17,14,14,
134.5945 +	16,16,18,14,16,15,18,17,17,18,19,18,21,18,18,17,
134.5946 +	20,18,13,15,14,17,16,14,14,16,17,18,16,17,16,19,
134.5947 +	17,18,17,19,18,22,18,19,19,21,21,13,14,15,16,18,
134.5948 +	16,16,17,17,20,14,16,14,18,17,18,18,19,19,21,17,
134.5949 +	18,17,21,18,17,18,17,19,18,16,17,17,18,19,18,18,
134.5950 +	18,22,22,18,17,19,17, 0,20,21,19,21,20,17,17,18,
134.5951 +	18,21,18,18,18,19,21,17,17,17,19,19,20,20,22,21,
134.5952 +	21,19,20,18,20,17,12,14,13,17,16,14,15,15,17,18,
134.5953 +	14,16,14,18,16,17,18,18,21,20,16,18,16,21,18,14,
134.5954 +	15,15,17,17,15,15,16,18,18,15,17,16,18,18,17,17,
134.5955 +	19,19,20,18,19,18,20,19,14,15,14,17,15,15,16,16,
134.5956 +	18,17,15,16,14,19,15,18,18,18,19,20,17,20,15,21,
134.5957 +	17,16,17,18,18,19,17,17,18,18,20,18,19,18,19,21,
134.5958 +	19,18,19,19,21,20, 0,19,21,20,16,17,16,19,16,18,
134.5959 +	18,18,19,19,17,18,17,20,17,19,20,20,22, 0,19,20,
134.5960 +	17,21,17,11,13,14,16,17,14,15,15,17,18,14,15,15,
134.5961 +	18,18,16,17,17,19,20,16,18,17,19,21,13,14,15,17,
134.5962 +	17,14,15,16,17,19,15,16,16,18,19,16,17,18,19,21,
134.5963 +	17,18,20,21,21,13,15,15,17,17,15,16,16,18,19,15,
134.5964 +	16,16,18,19,17,17,18,19,22,17,19,18,22,19,15,16,
134.5965 +	17,19,19,16,17,18,18,20,17,18,18,19,20,19,18,20,
134.5966 +	18,22,20,19,19,22,21,16,17,17,18,19,18,18,18,19,
134.5967 +	20,17,18,18,20,19,20,19,20,22,20,19,20,21,21,20,
134.5968 +	12,14,14,16,16,13,14,16,17,18,14,16,15,18,18,15,
134.5969 +	17,17,19,19,17,18,18,19,19,13,14,15,16,17,14,14,
134.5970 +	16,16,20,15,16,16,17,19,16,15,18,17,20,18,17,19,
134.5971 +	19,19,14,15,15,17,17,16,16,16,18,18,15,16,15,19,
134.5972 +	18,17,18,18,20,21,17,18,17,21,18,16,15,17,17,19,
134.5973 +	17,15,18,17,20,19,17,18,19,20,18,16,19,17,22,20,
134.5974 +	19,20,19,20,17,17,18,19,19,18,18,19,20,20,17,18,
134.5975 +	17,18,18,21,21,20,20,21,18,20,17,21,19,11,14,14,
134.5976 +	16,17,15,14,16,17,19,14,16,14,18,17,18,18,19,19,
134.5977 +	21,17,19,18,20,20,13,15,14,17,17,14,14,16,17,18,
134.5978 +	16,17,16,19,18,18,17,19,18,20,18,21,18,20,20,13,
134.5979 +	15,15,16,17,16,16,17,18,19,14,16,15,19,18,19,19,
134.5980 +	19,21,20,18,19,17,20,18,16,17,16,19,18,16,17,17,
134.5981 +	19,20,17,19,18,20,19,18,17,21,18, 0,21,20,20, 0,
134.5982 +	20,17,17,18,18,19,18,19,19,20,22,16,17,17,20,18,
134.5983 +	21,22,20,20,22,18,22,18,22,18,12,14,14,17,17,14,
134.5984 +	15,16,17,19,14,16,15,17,17,17,17,18,18,21,17,19,
134.5985 +	17,20,19,14,15,15,16,18,15,14,16,16,19,16,17,16,
134.5986 +	19,18,17,16,20,17,20,18,20,19,19,20,14,15,15,18,
134.5987 +	17,16,16,17,18,19,14,16,15,19,17,18,21,18,19,21,
134.5988 +	17,18,17,19,18,17,17,18,17,20,17,16,18,17,21,18,
134.5989 +	19,19,19,19,18,17,19,17,20,20,21,20,21,20,17,17,
134.5990 +	17,19,19,19,18,18,20,21,16,18,16,19,18,20,20,21,
134.5991 +	21,20,18,19,16, 0,17,12,14,14,17,17,15,15,18,17,
134.5992 +	19,15,18,15,20,16,20,19,21,18,22,20,20,20,22,19,
134.5993 +	14,16,14,20,17,14,15,17,17,20,18,18,17,20,18,18,
134.5994 +	17,19,17,21,20,21,20, 0,21,14,15,16,17,19,18,17,
134.5995 +	19,18,21,14,18,15,21,17,21,20,21,20, 0,18,21,17,
134.5996 +	21,17,18,19,17,20,18,16,17,17,19,19,19,21,20, 0,
134.5997 +	20,18,17,21,17, 0,22, 0,21, 0,22,17,17,19,18,20,
134.5998 +	20,20,21,19,22,16,17,18,20,18,22,22, 0,22, 0,17,
134.5999 +	21,17,22,17,11,14,13,16,16,14,15,15,17,18,14,15,
134.6000 +	14,18,17,17,18,18,19,20,16,17,17,21,19,13,14,15,
134.6001 +	17,17,15,16,16,18,18,15,16,16,19,18,18,18,18,19,
134.6002 +	20,17,18,18,20,19,13,15,14,17,17,15,16,16,17,18,
134.6003 +	14,16,15,19,17,17,18,19,21,21,17,18,17,20,18,16,
134.6004 +	17,17,19,19,17,18,19,19,20,18,19,18,21,21,21,20,
134.6005 +	19,21,22,20,20,19,21,20,15,17,16,19,19,17,18,18,
134.6006 +	20,21,16,18,17,20,18,19,19,21,21,21,19,19,19,20,
134.6007 +	18,11,14,13,17,16,14,14,16,16,19,14,16,15,19,16,
134.6008 +	18,18,18,19,22,17,18,17,20,19,13,15,14,17,17,15,
134.6009 +	15,16,17,19,16,17,16,20,18,18,17,19,18,21,19,19,
134.6010 +	18,22, 0,13,14,15,17,18,16,16,17,17,19,14,16,15,
134.6011 +	19,18,18,19,19,20,21,18,18,17,20,18,17,18,17,20,
134.6012 +	18,16,17,17,18,20,18,19,18,20,20,18,18,21,17,21,
134.6013 +	20,21,21, 0,19,16,16,18,18,19,19,18,20,19,20,16,
134.6014 +	17,17,20,18,21,20,21,22,22,18,20,17,21,17,12,14,
134.6015 +	14,17,16,14,15,16,18,18,13,15,14,18,17,17,18,18,
134.6016 +	19,19,15,17,16,19,19,14,15,15,17,17,15,15,16,18,
134.6017 +	19,15,16,16,19,18,17,17,18,18,20,18,18,18,21,20,
134.6018 +	13,15,14,17,16,15,16,15,18,18,14,16,14,18,17,18,
134.6019 +	18,18,19,21,16,18,16,20,17,17,18,17,18,19,17,17,
134.6020 +	18,18,19,18,19,19,21,19,19,18,20,18,21,21,20,20,
134.6021 +	21,20,16,17,15,20,17,17,19,17,19,19,17,18,15,20,
134.6022 +	17,19,20,19,21,22,17,20,16, 0,17,12,14,14,17,18,
134.6023 +	16,15,18,16,20,16,18,15,21,17,20,18,21,19,22,19,
134.6024 +	21,19, 0,19,14,16,15,19,17,14,15,17,16,21,18,19,
134.6025 +	18,21,17,19,17,21,17,22,20,21,21, 0,21,14,15,16,
134.6026 +	17,19,18,17,19,18,21,14,17,15,20,17,21,22,21,20,
134.6027 +	22,18,21,17,21,17,17,19,17,21,18,16,17,17,19,20,
134.6028 +	19,21,20,21,20,17,18,20,17,21, 0,22,20,21,22,17,
134.6029 +	17,20,18,21,21,20,22,20,21,16,17,17,21,19, 0,22,
134.6030 +	 0,21,21,18,22,17,21,17,12,14,14,17,16,14,15,16,
134.6031 +	17,18,14,16,15,18,17,17,17,20,19,20,16,18,17,21,
134.6032 +	18,14,15,15,17,17,14,15,16,17,19,16,17,16,18,18,
134.6033 +	17,16,19,18,19,18,19,18,21,20,14,15,15,18,17,16,
134.6034 +	16,16,19,18,15,16,14,20,16,18,18,19,19,20,16,19,
134.6035 +	16,21,17,17,17,18,19,19,16,16,18,18,19,19,19,18,
134.6036 +	20,20,18,16,19,18,20,22,21,20,19,20,16,18,17,20,
134.6037 +	16,18,19,18,19,18,16,18,16,20,17,21,20,21,20,20,
134.6038 +	18,19,17,21,16,
134.6039 +};
134.6040 +
134.6041 +static const static_codebook _44p5_p5_0 = {
134.6042 +	5, 3125,
134.6043 +	(long *)_vq_lengthlist__44p5_p5_0,
134.6044 +	1, -528744448, 1616642048, 3, 0,
134.6045 +	(long *)_vq_quantlist__44p5_p5_0,
134.6046 +	0
134.6047 +};
134.6048 +
134.6049 +static const long _vq_quantlist__44p5_p5_1[] = {
134.6050 +	3,
134.6051 +	2,
134.6052 +	4,
134.6053 +	1,
134.6054 +	5,
134.6055 +	0,
134.6056 +	6,
134.6057 +};
134.6058 +
134.6059 +static const long _vq_lengthlist__44p5_p5_1[] = {
134.6060 +	 2, 3, 3, 3, 3, 3, 3,
134.6061 +};
134.6062 +
134.6063 +static const static_codebook _44p5_p5_1 = {
134.6064 +	1, 7,
134.6065 +	(long *)_vq_lengthlist__44p5_p5_1,
134.6066 +	1, -533200896, 1611661312, 3, 0,
134.6067 +	(long *)_vq_quantlist__44p5_p5_1,
134.6068 +	0
134.6069 +};
134.6070 +
134.6071 +static const long _vq_quantlist__44p5_p6_0[] = {
134.6072 +	1,
134.6073 +	0,
134.6074 +	2,
134.6075 +};
134.6076 +
134.6077 +static const long _vq_lengthlist__44p5_p6_0[] = {
134.6078 +	 1, 5, 5, 5, 7, 9, 5, 9, 7, 5, 7, 8, 7, 7,10, 9,
134.6079 +	 9,10, 5, 8, 7, 9,10, 9, 7,10, 7, 6, 9, 9, 9,10,
134.6080 +	12,10,12,11, 9,10,11,11,10,13,12,12,13,10,11,11,
134.6081 +	12,13,13,11,13,11, 6, 9, 9,10,11,12, 9,12,11,10,
134.6082 +	11,11,11,11,13,12,13,13, 9,11,10,12,13,13,11,13,
134.6083 +	10, 6, 9,10, 9,11,12,10,12,11, 9,10,11,10,10,13,
134.6084 +	11,13,13,10,11,11,12,13,12,11,13,11, 7, 9,10, 9,
134.6085 +	10,12,10,11,11,10,10,11,10,10,12,12,11,12,10,11,
134.6086 +	10,12,12,12,10,12,10, 7,10,10,11,11,13,11,13,11,
134.6087 +	10,12,11,11,10,13,13,14,13,10,11,12,13,13,14,11,
134.6088 +	13,10, 6,10, 9,10,11,12, 9,12,11, 9,11,11,11,11,
134.6089 +	13,12,12,13, 9,11,10,12,13,13,10,13,10, 7,10,10,
134.6090 +	11,11,14,11,13,11,10,12,11,11,10,14,13,14,13,10,
134.6091 +	11,12,13,13,14,11,13,10, 7,10, 9,10,10,12, 9,12,
134.6092 +	10,10,11,11,10,10,12,12,12,12, 9,11,10,11,12,12,
134.6093 +	10,12, 9,
134.6094 +};
134.6095 +
134.6096 +static const static_codebook _44p5_p6_0 = {
134.6097 +	5, 243,
134.6098 +	(long *)_vq_lengthlist__44p5_p6_0,
134.6099 +	1, -527106048, 1620377600, 2, 0,
134.6100 +	(long *)_vq_quantlist__44p5_p6_0,
134.6101 +	0
134.6102 +};
134.6103 +
134.6104 +static const long _vq_quantlist__44p5_p6_1[] = {
134.6105 +	1,
134.6106 +	0,
134.6107 +	2,
134.6108 +};
134.6109 +
134.6110 +static const long _vq_lengthlist__44p5_p6_1[] = {
134.6111 +	 2, 6, 6, 5, 7, 8, 5, 8, 7, 6, 7, 7, 7, 7, 8, 8,
134.6112 +	 8, 8, 6, 7, 7, 7, 8, 8, 7, 8, 7, 6, 8, 8, 8, 9,
134.6113 +	10, 8, 9, 9, 8, 9, 9, 9, 9,10,10,10,10, 8, 9, 9,
134.6114 +	10,10,10, 9,10,10, 6, 8, 8, 8, 9, 9, 8,10, 9, 9,
134.6115 +	 9, 9, 9, 9,10,10,10,10, 8, 9, 9,10,10,10, 9,10,
134.6116 +	 9, 6, 8, 9, 8, 9, 9, 8, 9, 9, 8, 9, 9, 9, 9,10,
134.6117 +	 9,10,10, 8, 9, 9, 9,10,10, 9,10, 9, 7, 8, 9, 8,
134.6118 +	 9, 9, 9, 9, 9, 8, 9, 9, 9, 9, 9, 9, 9, 9, 8, 9,
134.6119 +	 9, 9, 9, 9, 9, 9, 9, 7, 9, 9, 9,10,10, 9,10,10,
134.6120 +	 9,10, 9, 9, 9,10,10,10,10, 9,10, 9,10,10,10, 9,
134.6121 +	10, 9, 6, 8, 8, 8, 9, 9, 8, 9, 9, 8, 9, 9, 9, 9,
134.6122 +	10, 9,10,10, 8, 9, 9, 9,10,10, 9,10, 9, 7, 9, 9,
134.6123 +	 9,10,10, 9,10, 9, 9, 9,10,10, 9,10,10,10,10, 9,
134.6124 +	 9, 9,10,10,10, 9,10, 9, 7, 9, 8, 8, 9, 9, 8, 9,
134.6125 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 9, 8, 9, 9, 9,
134.6126 +	 9, 9, 9,
134.6127 +};
134.6128 +
134.6129 +static const static_codebook _44p5_p6_1 = {
134.6130 +	5, 243,
134.6131 +	(long *)_vq_lengthlist__44p5_p6_1,
134.6132 +	1, -530841600, 1616642048, 2, 0,
134.6133 +	(long *)_vq_quantlist__44p5_p6_1,
134.6134 +	0
134.6135 +};
134.6136 +
134.6137 +static const long _vq_quantlist__44p5_p7_0[] = {
134.6138 +	1,
134.6139 +	0,
134.6140 +	2,
134.6141 +};
134.6142 +
134.6143 +static const long _vq_lengthlist__44p5_p7_0[] = {
134.6144 +	 1, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9,
134.6145 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.6146 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.6147 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.6148 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.6149 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.6150 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.6151 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.6152 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.6153 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.6154 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.6155 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.6156 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.6157 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.6158 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.6159 +	 9, 9, 9,
134.6160 +};
134.6161 +
134.6162 +static const static_codebook _44p5_p7_0 = {
134.6163 +	5, 243,
134.6164 +	(long *)_vq_lengthlist__44p5_p7_0,
134.6165 +	1, -513979392, 1633504256, 2, 0,
134.6166 +	(long *)_vq_quantlist__44p5_p7_0,
134.6167 +	0
134.6168 +};
134.6169 +
134.6170 +static const long _vq_quantlist__44p5_p7_1[] = {
134.6171 +	1,
134.6172 +	0,
134.6173 +	2,
134.6174 +};
134.6175 +
134.6176 +static const long _vq_lengthlist__44p5_p7_1[] = {
134.6177 +	 1, 7, 7, 6, 9, 9, 7, 9, 9, 6, 9, 9, 9, 9, 9, 9,
134.6178 +	 9, 9, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.6179 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.6180 +	 9, 9, 9, 9, 9, 9, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.6181 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.6182 +	 9, 7, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.6183 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.6184 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.6185 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.6186 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.6187 +	 9, 9, 7, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.6188 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.6189 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.6190 +	 9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
134.6191 +	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
134.6192 +	10,10,10,
134.6193 +};
134.6194 +
134.6195 +static const static_codebook _44p5_p7_1 = {
134.6196 +	5, 243,
134.6197 +	(long *)_vq_lengthlist__44p5_p7_1,
134.6198 +	1, -516716544, 1630767104, 2, 0,
134.6199 +	(long *)_vq_quantlist__44p5_p7_1,
134.6200 +	0
134.6201 +};
134.6202 +
134.6203 +static const long _vq_quantlist__44p5_p7_2[] = {
134.6204 +	12,
134.6205 +	11,
134.6206 +	13,
134.6207 +	10,
134.6208 +	14,
134.6209 +	9,
134.6210 +	15,
134.6211 +	8,
134.6212 +	16,
134.6213 +	7,
134.6214 +	17,
134.6215 +	6,
134.6216 +	18,
134.6217 +	5,
134.6218 +	19,
134.6219 +	4,
134.6220 +	20,
134.6221 +	3,
134.6222 +	21,
134.6223 +	2,
134.6224 +	22,
134.6225 +	1,
134.6226 +	23,
134.6227 +	0,
134.6228 +	24,
134.6229 +};
134.6230 +
134.6231 +static const long _vq_lengthlist__44p5_p7_2[] = {
134.6232 +	 1, 2, 3, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9,10,10,11,
134.6233 +	11,12,12,13,13,14,14,14,14,
134.6234 +};
134.6235 +
134.6236 +static const static_codebook _44p5_p7_2 = {
134.6237 +	1, 25,
134.6238 +	(long *)_vq_lengthlist__44p5_p7_2,
134.6239 +	1, -518864896, 1620639744, 5, 0,
134.6240 +	(long *)_vq_quantlist__44p5_p7_2,
134.6241 +	0
134.6242 +};
134.6243 +
134.6244 +static const long _vq_quantlist__44p5_p7_3[] = {
134.6245 +	12,
134.6246 +	11,
134.6247 +	13,
134.6248 +	10,
134.6249 +	14,
134.6250 +	9,
134.6251 +	15,
134.6252 +	8,
134.6253 +	16,
134.6254 +	7,
134.6255 +	17,
134.6256 +	6,
134.6257 +	18,
134.6258 +	5,
134.6259 +	19,
134.6260 +	4,
134.6261 +	20,
134.6262 +	3,
134.6263 +	21,
134.6264 +	2,
134.6265 +	22,
134.6266 +	1,
134.6267 +	23,
134.6268 +	0,
134.6269 +	24,
134.6270 +};
134.6271 +
134.6272 +static const long _vq_lengthlist__44p5_p7_3[] = {
134.6273 +	 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5,
134.6274 +	 5, 5, 5, 5, 5, 5, 5, 5, 5,
134.6275 +};
134.6276 +
134.6277 +static const static_codebook _44p5_p7_3 = {
134.6278 +	1, 25,
134.6279 +	(long *)_vq_lengthlist__44p5_p7_3,
134.6280 +	1, -529006592, 1611661312, 5, 0,
134.6281 +	(long *)_vq_quantlist__44p5_p7_3,
134.6282 +	0
134.6283 +};
134.6284 +
134.6285 +static const long _huff_lengthlist__44p5_short[] = {
134.6286 +	 4, 7,12,14,15,18,20,20, 5, 3, 4, 6, 9,11,15,19,
134.6287 +	 9, 4, 3, 4, 7, 9,13,18,11, 6, 3, 3, 5, 8,13,19,
134.6288 +	14, 9, 6, 5, 7,10,16,20,16,11, 9, 8,10,10,14,16,
134.6289 +	21,14,13,11, 8, 7,11,14,21,14,13, 9, 6, 5,10,12,
134.6290 +};
134.6291 +
134.6292 +static const static_codebook _huff_book__44p5_short = {
134.6293 +	2, 64,
134.6294 +	(long *)_huff_lengthlist__44p5_short,
134.6295 +	0, 0, 0, 0, 0,
134.6296 +	NULL,
134.6297 +	0
134.6298 +};
134.6299 +
134.6300 +static const long _vq_quantlist__44p6_l0_0[] = {
134.6301 +	6,
134.6302 +	5,
134.6303 +	7,
134.6304 +	4,
134.6305 +	8,
134.6306 +	3,
134.6307 +	9,
134.6308 +	2,
134.6309 +	10,
134.6310 +	1,
134.6311 +	11,
134.6312 +	0,
134.6313 +	12,
134.6314 +};
134.6315 +
134.6316 +static const long _vq_lengthlist__44p6_l0_0[] = {
134.6317 +	 1, 4, 4, 7, 7,10,10,12,12,12,12,13,12, 5, 5, 5,
134.6318 +	 8, 6,11, 9,12,12,13,12,12,12, 4, 5, 5, 6, 8, 9,
134.6319 +	11,12,12,13,12,12,12, 7, 7, 8, 9, 9,11, 8,12, 9,
134.6320 +	12,12,12,12, 7, 8, 8, 9, 9, 8,11, 9,12,12,12,11,
134.6321 +	12,10,10,10,11,11,11,11,11,10,11,11,12,11,10,10,
134.6322 +	10,11,11,11,11,10,11,11,11,11,12,11,11,11,12,11,
134.6323 +	12,11,12,11,13,11,13,11,11,11,11,11,12,11,12,10,
134.6324 +	13,11,12,11,13,12,12,12,13,12,13,13,13,12,14,12,
134.6325 +	14,13,12,12,12,12,13,13,13,12,14,12,14,13,14,13,
134.6326 +	14,14,14,14,14,14,14,14,15,14,15,14,13,14,13,14,
134.6327 +	14,14,14,14,15,14,14,14,15,
134.6328 +};
134.6329 +
134.6330 +static const static_codebook _44p6_l0_0 = {
134.6331 +	2, 169,
134.6332 +	(long *)_vq_lengthlist__44p6_l0_0,
134.6333 +	1, -526516224, 1616117760, 4, 0,
134.6334 +	(long *)_vq_quantlist__44p6_l0_0,
134.6335 +	0
134.6336 +};
134.6337 +
134.6338 +static const long _vq_quantlist__44p6_l0_1[] = {
134.6339 +	2,
134.6340 +	1,
134.6341 +	3,
134.6342 +	0,
134.6343 +	4,
134.6344 +};
134.6345 +
134.6346 +static const long _vq_lengthlist__44p6_l0_1[] = {
134.6347 +	 4, 4, 4, 5, 5, 4, 5, 5, 5, 5, 4, 5, 5, 5, 5, 5,
134.6348 +	 5, 5, 4, 5, 5, 5, 5, 5, 4,
134.6349 +};
134.6350 +
134.6351 +static const static_codebook _44p6_l0_1 = {
134.6352 +	2, 25,
134.6353 +	(long *)_vq_lengthlist__44p6_l0_1,
134.6354 +	1, -533725184, 1611661312, 3, 0,
134.6355 +	(long *)_vq_quantlist__44p6_l0_1,
134.6356 +	0
134.6357 +};
134.6358 +
134.6359 +static const long _vq_quantlist__44p6_l1_0[] = {
134.6360 +	1,
134.6361 +	0,
134.6362 +	2,
134.6363 +};
134.6364 +
134.6365 +static const long _vq_lengthlist__44p6_l1_0[] = {
134.6366 +	 1, 3, 2, 5, 5, 6, 6, 6, 6,
134.6367 +};
134.6368 +
134.6369 +static const static_codebook _44p6_l1_0 = {
134.6370 +	2, 9,
134.6371 +	(long *)_vq_lengthlist__44p6_l1_0,
134.6372 +	1, -516716544, 1630767104, 2, 0,
134.6373 +	(long *)_vq_quantlist__44p6_l1_0,
134.6374 +	0
134.6375 +};
134.6376 +
134.6377 +static const long _huff_lengthlist__44p6_lfe[] = {
134.6378 +	 2, 3, 1, 3,
134.6379 +};
134.6380 +
134.6381 +static const static_codebook _huff_book__44p6_lfe = {
134.6382 +	2, 4,
134.6383 +	(long *)_huff_lengthlist__44p6_lfe,
134.6384 +	0, 0, 0, 0, 0,
134.6385 +	NULL,
134.6386 +	0
134.6387 +};
134.6388 +
134.6389 +static const long _huff_lengthlist__44p6_long[] = {
134.6390 +	 2, 7,13,15,16,17,19,20, 6, 3, 4, 7, 9,10,12,15,
134.6391 +	13, 4, 3, 4, 7, 8,11,13,14, 7, 4, 4, 6, 7,10,11,
134.6392 +	16, 9, 7, 6, 7, 8, 9,10,16, 9, 8, 7, 7, 6, 8, 8,
134.6393 +	18,12,10,10, 9, 8, 8, 9,20,14,13,12,11, 8, 9, 9,
134.6394 +};
134.6395 +
134.6396 +static const static_codebook _huff_book__44p6_long = {
134.6397 +	2, 64,
134.6398 +	(long *)_huff_lengthlist__44p6_long,
134.6399 +	0, 0, 0, 0, 0,
134.6400 +	NULL,
134.6401 +	0
134.6402 +};
134.6403 +
134.6404 +static const long _vq_quantlist__44p6_p1_0[] = {
134.6405 +	1,
134.6406 +	0,
134.6407 +	2,
134.6408 +};
134.6409 +
134.6410 +static const long _vq_lengthlist__44p6_p1_0[] = {
134.6411 +	 2, 5, 5, 5, 7, 7, 5, 7, 7, 5, 7, 7, 7, 8, 9, 7,
134.6412 +	 9, 9, 5, 7, 7, 7, 9, 9, 7, 9, 8, 5, 7, 8, 8, 9,
134.6413 +	10, 8, 9, 9, 8, 9,10, 9,10,12,10,11,11, 8, 9,10,
134.6414 +	10,11,11, 9,11,11, 5, 8, 7, 8, 9, 9, 8,10, 9, 8,
134.6415 +	10, 9, 9,11,11,10,11,11, 8,10, 9,10,11,11, 9,12,
134.6416 +	10, 5, 8, 8, 7, 9,10, 8,10, 9, 7, 9, 9, 9,10,11,
134.6417 +	 9,11,11, 8,10,10,10,11,11,10,12,11, 7, 9, 9, 9,
134.6418 +	10,11, 9,11,11, 9, 9,11,10,10,13,11,11,12, 9,11,
134.6419 +	11,11,12,13,11,13,12, 7, 9, 9, 9,11,11, 9,12,10,
134.6420 +	 9,11,10,10,11,12,11,13,12, 9,11,11,11,13,13,11,
134.6421 +	13,11, 5, 8, 8, 8, 9,10, 7,10, 9, 8,10,10,10,11,
134.6422 +	11,10,11,11, 7, 9, 9, 9,11,11, 9,11,10, 7, 9, 9,
134.6423 +	 9,10,12, 9,11,11, 9,11,11,11,11,13,11,13,13, 9,
134.6424 +	10,11,11,12,13,10,12,11, 7, 9, 9, 9,11,11, 9,11,
134.6425 +	10, 9,11,11,11,12,13,11,13,12, 9,11, 9,11,12,11,
134.6426 +	10,13,10,
134.6427 +};
134.6428 +
134.6429 +static const static_codebook _44p6_p1_0 = {
134.6430 +	5, 243,
134.6431 +	(long *)_vq_lengthlist__44p6_p1_0,
134.6432 +	1, -535822336, 1611661312, 2, 0,
134.6433 +	(long *)_vq_quantlist__44p6_p1_0,
134.6434 +	0
134.6435 +};
134.6436 +
134.6437 +static const long _vq_quantlist__44p6_p2_0[] = {
134.6438 +	2,
134.6439 +	1,
134.6440 +	3,
134.6441 +	0,
134.6442 +	4,
134.6443 +};
134.6444 +
134.6445 +static const long _vq_lengthlist__44p6_p2_0[] = {
134.6446 +	 4, 6, 6, 9, 9, 6, 7, 8,10,10, 6, 8, 7,10,10, 8,
134.6447 +	10,10,12,13, 8,10,10,13,12, 6, 8, 8,10,10, 7, 8,
134.6448 +	 9,10,11, 8, 9, 9,11,11,10,10,11,12,13,10,11,11,
134.6449 +	14,13, 6, 8, 8,10,10, 8, 9, 9,11,11, 7, 9, 8,11,
134.6450 +	10,10,11,11,13,14,10,11,10,13,12, 9,10,10,12,12,
134.6451 +	10,10,11,12,13,10,11,11,13,13,12,12,13,12,15,13,
134.6452 +	14,13,15,14, 9,10,10,13,12,10,11,11,13,13,10,11,
134.6453 +	10,13,12,13,13,14,14,15,12,13,12,15,12, 6, 8, 8,
134.6454 +	10,11, 8, 9,10,11,12, 8, 9, 9,11,11,10,11,12,13,
134.6455 +	14,10,11,11,14,13, 8, 9, 9,11,12, 9,10,11,12,13,
134.6456 +	 9,10,11,12,13,11,11,13,13,15,11,12,12,14,14, 8,
134.6457 +	 9, 9,12,12, 9,10,11,12,13, 9,10,10,13,12,11,12,
134.6458 +	13,14,15,11,12,12,14,14,11,11,12,13,14,11,12,13,
134.6459 +	13,15,12,13,13,14,15,13,13,14,14,16,14,15,15,16,
134.6460 +	16,11,12,11,14,13,12,13,13,14,14,11,13,12,14,13,
134.6461 +	14,15,15,16,16,13,14,14,16,14, 6, 8, 8,11,10, 8,
134.6462 +	 9, 9,12,11, 8,10, 9,12,11,10,11,11,13,13,10,12,
134.6463 +	11,14,13, 8, 9, 9,12,12, 9,10,10,12,13, 9,11,10,
134.6464 +	13,12,11,12,12,14,14,11,13,12,15,14, 8, 9, 9,12,
134.6465 +	11, 9,10,10,13,12, 9,11,10,13,12,12,12,12,14,14,
134.6466 +	11,13,12,15,13,11,11,12,13,14,11,12,13,13,14,12,
134.6467 +	13,13,14,15,13,13,14,14,16,14,15,15,16,16,11,12,
134.6468 +	11,14,13,12,13,13,15,14,11,13,12,15,13,14,15,15,
134.6469 +	16,16,13,15,13,16,14, 9,10,11,12,13,11,11,12,13,
134.6470 +	14,11,12,12,13,14,13,13,14,14,16,13,14,14,15,16,
134.6471 +	11,11,12,13,14,12,12,13,14,15,12,13,13,14,15,14,
134.6472 +	14,15,15,17,14,15,15,16,17,11,12,12,14,14,12,13,
134.6473 +	13,14,15,12,13,12,15,15,14,15,15,16,17,14,15,15,
134.6474 +	16,16,13,14,14,15,16,14,14,15,15,17,15,15,15,16,
134.6475 +	17,16,16,17,16,18,16,17,17,18,18,13,14,14,16,15,
134.6476 +	14,15,15,17,16,14,15,15,16,16,16,17,17,18,18,16,
134.6477 +	16,16,17,16, 9,11,10,13,12,11,12,12,14,13,11,12,
134.6478 +	11,15,13,13,14,14,16,15,13,14,13,17,14,11,12,12,
134.6479 +	14,14,12,12,13,15,15,12,13,13,15,14,14,14,15,16,
134.6480 +	16,14,15,15,17,16,11,12,11,14,13,12,13,13,15,14,
134.6481 +	12,13,12,15,13,14,15,15,16,16,14,15,14,17,15,13,
134.6482 +	14,14,15,16,14,15,15,16,17,14,15,15,16,17,16,16,
134.6483 +	16,17,17,16,17,17,18,18,13,15,14,16,15,15,15,15,
134.6484 +	17,16,14,15,14,17,15,16,17,17,18,18,16,17,16,18,
134.6485 +	16, 6, 8, 8,11,11, 8, 9, 9,11,12, 8, 9, 9,12,11,
134.6486 +	10,11,11,13,14,10,12,11,14,13, 7, 9, 9,11,12, 9,
134.6487 +	10,10,12,13, 9,10,10,13,12,11,11,12,13,15,11,12,
134.6488 +	12,15,14, 8, 9, 9,12,11, 9,10,10,13,13, 9,11,10,
134.6489 +	13,12,12,12,12,14,15,11,13,12,15,13,10,11,11,13,
134.6490 +	14,11,12,12,13,15,11,12,12,14,14,13,13,14,14,16,
134.6491 +	14,15,14,16,16,11,12,11,14,13,12,13,13,15,14,11,
134.6492 +	13,12,15,13,14,15,15,16,16,13,14,14,16,14, 8, 9,
134.6493 +	 9,11,12, 9,10,11,12,13, 9,10,10,13,12,11,12,13,
134.6494 +	14,15,11,12,12,15,14, 9, 9,11,11,13,10,10,12,12,
134.6495 +	14,10,10,11,13,14,12,12,13,14,16,12,13,13,15,15,
134.6496 +	 9,11,10,13,12,10,11,11,13,14,10,12,11,14,13,12,
134.6497 +	13,13,15,16,12,13,13,15,15,11,11,13,13,15,12,12,
134.6498 +	14,13,15,13,13,14,14,15,14,14,15,14,17,15,15,15,
134.6499 +	16,16,12,13,12,15,14,13,14,14,15,15,12,14,13,15,
134.6500 +	14,15,15,15,17,17,14,15,14,17,15, 7, 9, 9,12,11,
134.6501 +	 9,10,10,12,12, 9,11,10,13,12,11,12,12,14,14,11,
134.6502 +	13,12,15,14, 9,10,10,12,12,10,10,11,12,13,10,11,
134.6503 +	11,14,13,12,12,13,14,15,12,13,13,16,15, 9,10,10,
134.6504 +	13,12,10,11,11,13,13,10,11,10,14,12,13,13,13,15,
134.6505 +	15,12,13,12,15,14,11,12,12,14,14,12,12,13,14,15,
134.6506 +	13,14,13,15,15,14,13,15,14,16,15,16,15,17,16,12,
134.6507 +	12,12,14,14,13,13,14,15,15,12,13,12,15,14,15,15,
134.6508 +	16,16,17,14,15,14,17,14,10,11,12,13,14,11,12,13,
134.6509 +	14,15,11,12,13,14,15,13,14,15,15,17,14,15,15,16,
134.6510 +	16,11,12,13,12,15,12,12,14,13,16,13,13,14,13,16,
134.6511 +	14,14,16,14,18,15,15,16,16,17,12,13,12,15,15,13,
134.6512 +	14,14,15,16,13,14,13,16,15,15,15,16,17,18,15,15,
134.6513 +	15,17,16,14,14,15,14,17,15,14,16,14,17,15,15,16,
134.6514 +	15,18,16,16,17,16,19,17,17,17,17,18,14,15,15,17,
134.6515 +	16,15,16,16,17,17,15,16,15,18,16,17,17,18,18,18,
134.6516 +	16,17,16,18,17,10,11,11,14,13,11,12,12,15,14,11,
134.6517 +	13,12,15,14,14,15,15,16,16,14,15,15,17,16,11,12,
134.6518 +	12,15,14,12,13,13,15,14,13,14,13,16,14,14,15,15,
134.6519 +	16,16,15,16,15,18,16,11,13,12,15,15,13,14,14,15,
134.6520 +	15,12,14,13,16,15,15,16,16,17,17,15,16,15,17,16,
134.6521 +	14,15,14,16,16,14,15,15,16,16,15,16,15,17,16,16,
134.6522 +	16,17,16,17,17,18,17,19,18,14,15,15,17,16,15,16,
134.6523 +	16,17,17,15,15,15,18,16,17,18,18,18,18,16,17,16,
134.6524 +	19,16, 6, 8, 8,11,11, 8, 9, 9,11,12, 8, 9, 9,12,
134.6525 +	11,10,11,12,13,14,10,11,11,14,13, 8, 9, 9,11,12,
134.6526 +	 9,10,11,12,13, 9,10,10,13,13,11,12,13,13,15,11,
134.6527 +	12,12,15,14, 7, 9, 9,12,11, 9,10,10,12,13, 9,10,
134.6528 +	10,13,12,11,12,12,14,15,11,12,11,14,13,11,11,12,
134.6529 +	13,14,11,12,13,13,15,12,13,13,14,15,13,14,14,14,
134.6530 +	16,14,15,15,16,16,10,11,11,14,13,11,12,12,14,14,
134.6531 +	11,12,12,15,13,14,14,14,16,16,13,14,13,16,14, 7,
134.6532 +	 9, 9,11,12, 9,10,10,12,13, 9,10,10,12,12,11,12,
134.6533 +	13,14,15,11,12,12,14,14, 9,10,10,12,13,10,10,11,
134.6534 +	12,14,10,11,11,13,13,12,12,13,14,15,13,13,13,15,
134.6535 +	15, 9,10,10,12,12,10,11,11,13,14,10,11,10,13,12,
134.6536 +	12,13,13,15,16,12,13,12,15,14,11,12,13,14,14,12,
134.6537 +	12,13,14,15,13,14,13,15,15,14,14,15,14,17,15,16,
134.6538 +	15,17,16,11,12,12,14,14,13,13,13,15,15,12,13,12,
134.6539 +	15,14,15,15,15,16,17,14,15,14,16,14, 8, 9, 9,12,
134.6540 +	11, 9,10,10,12,13, 9,11,10,13,12,11,12,12,14,15,
134.6541 +	11,12,12,15,14, 9,10,11,13,13,10,11,12,13,14,10,
134.6542 +	11,11,14,13,12,13,13,15,15,12,13,13,16,15, 9,11,
134.6543 +	 9,13,11,10,11,10,14,13,10,12,10,14,12,12,13,13,
134.6544 +	15,15,12,13,12,16,14,12,12,13,14,15,12,13,14,14,
134.6545 +	16,13,14,14,15,15,14,14,15,15,17,15,16,15,17,16,
134.6546 +	11,13,11,15,13,13,14,13,15,14,12,14,12,16,13,15,
134.6547 +	15,15,16,16,14,15,14,17,14,10,11,11,13,14,11,12,
134.6548 +	13,14,15,11,12,12,14,15,14,14,15,16,17,14,15,15,
134.6549 +	16,16,11,12,13,14,15,12,13,14,15,16,13,14,14,15,
134.6550 +	16,15,15,16,16,18,15,16,16,17,17,11,12,12,14,15,
134.6551 +	13,13,14,14,16,12,13,13,15,15,15,15,16,16,18,14,
134.6552 +	15,15,16,16,14,15,15,16,17,15,15,16,16,17,15,16,
134.6553 +	16,17,17,16,16,17,16,19,17,18,17,18,18,14,14,15,
134.6554 +	16,16,15,15,16,16,17,14,15,15,16,16,17,17,18,18,
134.6555 +	19,16,17,16,17,16,10,12,11,14,13,11,13,12,15,14,
134.6556 +	11,13,12,15,14,14,15,15,16,16,13,15,14,17,15,12,
134.6557 +	13,13,15,15,13,13,14,15,16,13,14,14,16,16,14,15,
134.6558 +	15,17,17,15,16,16,17,17,11,13,12,15,12,13,14,13,
134.6559 +	16,13,12,14,12,16,13,15,16,15,17,16,14,16,14,18,
134.6560 +	14,14,15,15,16,17,15,15,16,16,17,15,16,16,17,17,
134.6561 +	16,16,17,17,18,17,18,17,18,18,14,15,14,17,14,15,
134.6562 +	16,15,18,15,15,16,15,18,14,17,17,17,18,17,16,17,
134.6563 +	16,19,16, 9,11,11,13,13,10,12,12,14,14,11,12,12,
134.6564 +	15,14,13,14,14,16,16,13,14,14,16,16,10,11,12,14,
134.6565 +	14,11,12,13,14,15,12,13,13,15,15,13,14,15,16,16,
134.6566 +	14,15,15,17,16,11,12,12,15,14,12,13,13,15,15,12,
134.6567 +	13,12,15,15,14,15,15,16,17,14,15,14,17,16,12,13,
134.6568 +	14,15,16,13,13,14,15,16,13,14,15,16,16,14,15,16,
134.6569 +	16,18,15,16,16,18,18,13,14,14,16,15,14,15,15,17,
134.6570 +	16,14,15,15,17,16,16,17,17,18,18,16,17,16,18,17,
134.6571 +	10,12,12,14,14,11,12,13,15,15,12,13,13,15,15,13,
134.6572 +	14,15,16,17,14,15,15,17,16,11,11,13,14,15,12,12,
134.6573 +	14,15,16,13,13,14,15,16,14,14,15,16,17,15,15,16,
134.6574 +	17,17,12,13,12,15,15,13,14,14,16,16,13,14,13,16,
134.6575 +	15,15,16,15,17,17,15,16,15,18,16,13,12,15,14,17,
134.6576 +	14,13,16,14,17,14,14,16,15,18,15,14,17,16,18,16,
134.6577 +	16,17,17,18,14,15,15,17,16,15,16,16,17,17,15,16,
134.6578 +	15,18,16,17,17,17,18,18,16,17,16,19,17,10,11,11,
134.6579 +	14,14,11,12,12,15,15,11,13,12,15,15,14,15,14,16,
134.6580 +	16,14,15,15,17,16,11,12,12,15,14,12,12,13,15,15,
134.6581 +	13,14,13,16,15,14,15,15,16,16,15,16,15,18,17,11,
134.6582 +	13,12,15,15,13,14,13,15,15,12,14,13,16,15,15,16,
134.6583 +	15,17,17,15,16,15,18,16,13,14,13,16,16,14,15,14,
134.6584 +	16,16,14,15,15,17,16,16,16,16,16,18,16,18,17,19,
134.6585 +	18,14,15,15,17,16,15,16,16,17,17,15,15,15,17,16,
134.6586 +	17,17,18,18,19,16,17,16,18,16,12,13,13,15,16,13,
134.6587 +	14,14,16,17,13,14,14,16,16,15,15,16,17,18,15,16,
134.6588 +	16,18,17,13,13,14,14,17,14,14,15,15,17,14,14,15,
134.6589 +	16,17,15,15,17,16,18,16,17,17,18,18,13,14,14,17,
134.6590 +	16,14,15,15,17,17,14,15,14,17,16,16,17,17,18,18,
134.6591 +	16,17,16,18,17,15,14,16,13,18,16,15,17,14,19,16,
134.6592 +	16,17,15,18,17,16,18,15,19,18,18,18,17,19,15,16,
134.6593 +	16,18,17,16,17,17,18,18,16,17,16,19,17,18,19,18,
134.6594 +	19,19,17,18,17,20,18,11,12,12,15,15,13,13,14,15,
134.6595 +	16,13,14,13,16,15,15,16,16,17,17,15,16,16,18,17,
134.6596 +	12,14,13,16,15,13,13,14,15,16,14,15,14,17,16,16,
134.6597 +	16,16,16,17,16,17,17,19,17,12,13,14,16,16,14,15,
134.6598 +	15,16,17,13,15,13,17,15,16,17,17,18,18,16,17,16,
134.6599 +	18,16,15,16,15,17,16,15,15,15,17,17,16,17,16,18,
134.6600 +	17,17,16,17,16,18,18,19,18,20,18,15,16,16,17,17,
134.6601 +	16,17,17,18,18,15,16,15,18,17,18,18,19,19,19,17,
134.6602 +	18,16,19,16, 9,11,11,13,13,11,12,12,14,15,10,12,
134.6603 +	12,14,14,13,14,14,16,16,13,14,14,16,16,11,12,12,
134.6604 +	14,14,12,12,13,15,15,12,13,13,15,15,14,15,15,16,
134.6605 +	17,14,15,15,16,16,10,12,11,14,14,12,13,13,15,15,
134.6606 +	11,13,12,15,14,14,15,15,16,17,13,15,14,17,16,13,
134.6607 +	14,14,15,16,14,15,15,16,17,14,15,15,16,17,16,16,
134.6608 +	17,17,18,16,17,17,18,18,12,14,13,16,15,13,15,14,
134.6609 +	17,16,13,14,13,17,15,15,16,16,18,18,15,16,15,18,
134.6610 +	16,10,11,11,14,14,11,12,13,14,15,11,12,12,15,15,
134.6611 +	14,15,15,16,17,14,15,15,16,16,11,12,13,15,15,12,
134.6612 +	13,14,15,16,13,14,14,15,16,15,15,16,16,18,15,15,
134.6613 +	16,17,17,11,12,12,14,15,13,13,14,15,16,12,13,13,
134.6614 +	15,15,15,15,16,17,18,14,15,15,17,16,14,15,15,16,
134.6615 +	17,15,15,16,16,17,15,16,16,17,17,16,16,17,16,19,
134.6616 +	17,17,18,19,18,13,13,14,16,16,14,15,16,17,17,14,
134.6617 +	14,15,16,16,16,16,17,18,18,16,16,16,18,16,10,12,
134.6618 +	12,14,14,12,13,13,15,15,11,13,12,15,15,14,15,15,
134.6619 +	16,17,13,15,14,17,16,12,13,13,15,15,13,13,14,15,
134.6620 +	16,13,14,14,16,16,15,15,16,17,18,15,15,16,17,17,
134.6621 +	11,13,12,15,14,13,14,13,16,15,12,14,12,16,14,15,
134.6622 +	16,15,17,17,14,16,14,17,16,14,15,15,16,17,15,15,
134.6623 +	16,16,18,15,16,16,17,17,16,17,17,17,19,17,17,17,
134.6624 +	18,18,13,15,12,17,14,14,16,14,17,15,14,15,13,17,
134.6625 +	14,16,17,16,18,17,15,17,14,19,15,11,12,12,15,15,
134.6626 +	13,13,14,15,16,13,14,13,16,15,15,16,16,17,18,15,
134.6627 +	16,16,17,17,12,14,13,16,16,13,13,15,15,17,14,15,
134.6628 +	15,17,16,16,16,17,16,19,16,17,17,18,18,12,13,14,
134.6629 +	15,16,14,14,15,16,17,13,14,13,16,15,16,17,17,18,
134.6630 +	19,15,16,16,17,16,15,16,16,18,17,15,15,16,17,18,
134.6631 +	16,17,17,18,18,16,16,18,16,19,18,19,19,20,19,15,
134.6632 +	15,16,16,17,16,16,17,17,18,15,15,15,17,16,18,18,
134.6633 +	19,18,20,17,17,16,18,16,12,13,13,16,15,13,14,14,
134.6634 +	16,16,13,14,14,16,16,15,16,16,17,18,15,16,15,18,
134.6635 +	17,13,14,14,16,16,14,15,15,16,17,14,15,15,17,17,
134.6636 +	16,17,17,18,18,16,17,17,18,18,13,14,13,17,14,14,
134.6637 +	15,14,17,16,14,15,14,17,15,16,17,17,18,18,15,17,
134.6638 +	15,19,15,16,16,16,17,18,16,16,17,17,19,16,17,17,
134.6639 +	18,19,17,17,18,18,20,18,18,18,19,19,15,16,14,18,
134.6640 +	13,16,17,16,19,15,16,17,15,19,14,18,18,18,19,17,
134.6641 +	17,18,16,20,15,
134.6642 +};
134.6643 +
134.6644 +static const static_codebook _44p6_p2_0 = {
134.6645 +	5, 3125,
134.6646 +	(long *)_vq_lengthlist__44p6_p2_0,
134.6647 +	1, -533725184, 1611661312, 3, 0,
134.6648 +	(long *)_vq_quantlist__44p6_p2_0,
134.6649 +	0
134.6650 +};
134.6651 +
134.6652 +static const long _vq_quantlist__44p6_p3_0[] = {
134.6653 +	1,
134.6654 +	0,
134.6655 +	2,
134.6656 +};
134.6657 +
134.6658 +static const long _vq_lengthlist__44p6_p3_0[] = {
134.6659 +	 1, 5, 5, 5, 7, 8, 5, 8, 7, 5, 7, 8, 8, 8,10, 8,
134.6660 +	10,10, 5, 8, 7, 8,10,10, 8,10, 8, 6, 8, 9, 8,10,
134.6661 +	12, 9,11,11, 9,10,11,11,11,13,12,13,13, 9,11,11,
134.6662 +	11,13,13,11,13,12, 6, 9, 8, 9,11,11, 8,12,10, 9,
134.6663 +	11,11,11,12,13,11,13,13, 9,11,10,11,13,13,11,13,
134.6664 +	11, 5, 9, 9, 8,11,11, 9,12,11, 8,10,11,10,11,13,
134.6665 +	11,13,13, 9,11,11,11,13,13,11,13,12, 8,10,11,10,
134.6666 +	12,13,10,13,12,10,10,13,11,11,14,12,13,14,11,13,
134.6667 +	12,13,14,14,12,14,12, 8,11,10,11,12,13,11,14,12,
134.6668 +	10,13,12,12,12,13,13,15,14,11,12,13,13,14,15,12,
134.6669 +	14,12, 5, 9, 9, 9,11,12, 8,11,11, 9,11,11,11,12,
134.6670 +	13,11,13,13, 8,11,10,11,13,13,10,13,11, 8,10,11,
134.6671 +	11,12,14,11,13,12,11,13,12,12,12,14,13,15,14,10,
134.6672 +	12,13,13,14,15,12,13,12, 8,11,10,10,12,13,10,13,
134.6673 +	12,11,12,13,12,12,14,13,14,14,10,13,10,12,14,13,
134.6674 +	11,14,11,
134.6675 +};
134.6676 +
134.6677 +static const static_codebook _44p6_p3_0 = {
134.6678 +	5, 243,
134.6679 +	(long *)_vq_lengthlist__44p6_p3_0,
134.6680 +	1, -533200896, 1614282752, 2, 0,
134.6681 +	(long *)_vq_quantlist__44p6_p3_0,
134.6682 +	0
134.6683 +};
134.6684 +
134.6685 +static const long _vq_quantlist__44p6_p3_1[] = {
134.6686 +	1,
134.6687 +	0,
134.6688 +	2,
134.6689 +};
134.6690 +
134.6691 +static const long _vq_lengthlist__44p6_p3_1[] = {
134.6692 +	 5, 7, 7, 6, 7, 7, 6, 7, 7, 6, 7, 7, 7, 8, 8, 7,
134.6693 +	 8, 8, 6, 7, 7, 7, 8, 8, 7, 8, 8, 7, 7, 8, 7, 8,
134.6694 +	 8, 7, 8, 8, 8, 8, 8, 8, 8, 9, 8, 9, 9, 8, 8, 8,
134.6695 +	 8, 9, 9, 8, 9, 8, 7, 8, 7, 7, 8, 8, 7, 8, 8, 8,
134.6696 +	 8, 8, 8, 8, 9, 8, 9, 9, 8, 8, 8, 8, 9, 9, 8, 9,
134.6697 +	 8, 6, 8, 8, 7, 8, 8, 7, 8, 8, 7, 8, 8, 8, 8, 9,
134.6698 +	 8, 9, 9, 8, 8, 8, 8, 9, 9, 8, 9, 8, 7, 8, 8, 8,
134.6699 +	 8, 9, 8, 9, 9, 8, 8, 9, 8, 9, 9, 9, 9, 9, 8, 9,
134.6700 +	 9, 9, 9, 9, 9, 9, 9, 7, 8, 8, 8, 9, 9, 8, 9, 8,
134.6701 +	 8, 8, 8, 8, 9, 9, 9, 9, 9, 8, 9, 8, 9, 9, 9, 9,
134.6702 +	 9, 9, 6, 8, 8, 7, 8, 8, 7, 8, 8, 8, 8, 8, 8, 8,
134.6703 +	 9, 8, 9, 9, 7, 8, 8, 8, 9, 9, 8, 9, 8, 7, 8, 8,
134.6704 +	 8, 8, 9, 8, 9, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 8,
134.6705 +	 8, 8, 9, 9, 9, 8, 9, 9, 7, 8, 8, 8, 9, 9, 8, 9,
134.6706 +	 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 8, 9, 8, 9, 9, 9,
134.6707 +	 9, 9, 9,
134.6708 +};
134.6709 +
134.6710 +static const static_codebook _44p6_p3_1 = {
134.6711 +	5, 243,
134.6712 +	(long *)_vq_lengthlist__44p6_p3_1,
134.6713 +	1, -535822336, 1611661312, 2, 0,
134.6714 +	(long *)_vq_quantlist__44p6_p3_1,
134.6715 +	0
134.6716 +};
134.6717 +
134.6718 +static const long _vq_quantlist__44p6_p4_0[] = {
134.6719 +	1,
134.6720 +	0,
134.6721 +	2,
134.6722 +};
134.6723 +
134.6724 +static const long _vq_lengthlist__44p6_p4_0[] = {
134.6725 +	 2, 5, 5, 5, 7, 8, 5, 8, 7, 5, 7, 7, 7, 7, 9, 7,
134.6726 +	 9, 9, 5, 7, 7, 8, 9, 9, 7, 9, 7, 6, 8, 8, 8, 9,
134.6727 +	10, 8, 9, 9, 8, 9,10, 9, 9,11,10,11,11, 8, 9, 9,
134.6728 +	10,11,11, 9,11,10, 6, 8, 8, 8, 9, 9, 8,10, 9, 8,
134.6729 +	 9, 9, 9,10,11,10,11,10, 8,10, 9,10,11,11, 9,11,
134.6730 +	 9, 6, 8, 8, 7, 9, 9, 8,10, 9, 7, 9, 9, 9, 9,10,
134.6731 +	 9,10,10, 8, 9, 9, 9,10,10, 9,11,10, 7, 9, 9, 8,
134.6732 +	10,10, 9,10,10, 9, 9,10,10,10,11,10,11,11, 9,10,
134.6733 +	10,10,11,11,10,11,10, 7, 9, 9, 9, 9,10, 9,10, 9,
134.6734 +	 8,10, 9, 9, 9,11,10,11,11, 9,10,10,10,11,11, 9,
134.6735 +	11, 9, 6, 8, 8, 8, 9,10, 7, 9, 9, 8, 9, 9, 9,10,
134.6736 +	10, 9,10,10, 7, 9, 9, 9,10,10, 9,10, 9, 7, 9, 9,
134.6737 +	 9, 9,10, 9,10, 9, 9,10,10, 9, 9,11,10,11,11, 8,
134.6738 +	 9,10,10,11,11, 9,11, 9, 7, 9, 9, 9,10,10, 8,10,
134.6739 +	10, 9,10,10,10,10,11,10,11,11, 9,10, 9,10,11,11,
134.6740 +	10,11,10,
134.6741 +};
134.6742 +
134.6743 +static const static_codebook _44p6_p4_0 = {
134.6744 +	5, 243,
134.6745 +	(long *)_vq_lengthlist__44p6_p4_0,
134.6746 +	1, -531365888, 1616117760, 2, 0,
134.6747 +	(long *)_vq_quantlist__44p6_p4_0,
134.6748 +	0
134.6749 +};
134.6750 +
134.6751 +static const long _vq_quantlist__44p6_p4_1[] = {
134.6752 +	2,
134.6753 +	1,
134.6754 +	3,
134.6755 +	0,
134.6756 +	4,
134.6757 +};
134.6758 +
134.6759 +static const long _vq_lengthlist__44p6_p4_1[] = {
134.6760 +	 6, 8, 8,10,10, 8, 9, 9,10,11, 8,10, 9,11,10, 9,
134.6761 +	10,10,11,11, 9,10,10,11,11, 8, 9, 9,10,10, 9, 9,
134.6762 +	10,11,11,10,10,10,11,11,10,11,11,11,11,10,11,11,
134.6763 +	11,11, 8, 9, 9,11,10,10,10,10,11,11, 9,10, 9,11,
134.6764 +	11,10,11,11,11,11,10,11,10,11,11,10,10,11,11,11,
134.6765 +	10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
134.6766 +	11,11,11,11,10,11,10,11,11,11,11,11,11,11,10,11,
134.6767 +	11,11,11,11,11,11,11,11,11,11,11,11,11, 8, 9,10,
134.6768 +	11,11,10,10,11,11,11,10,10,10,11,11,10,11,11,12,
134.6769 +	12,10,11,11,12,12,10,10,11,11,11,10,10,11,11,12,
134.6770 +	11,11,11,12,12,11,11,12,12,12,11,11,12,12,12,10,
134.6771 +	10,10,11,11,11,11,11,12,12,10,11,11,12,12,11,12,
134.6772 +	12,12,12,11,12,11,12,12,11,11,11,11,12,11,11,12,
134.6773 +	12,12,11,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.6774 +	12,11,11,11,12,11,11,12,12,12,12,11,12,12,12,12,
134.6775 +	12,12,12,12,12,12,12,12,12,12, 8,10, 9,11,11,10,
134.6776 +	10,10,11,11,10,11,10,11,11,10,11,11,12,12,10,11,
134.6777 +	11,12,12,10,10,10,11,11,10,11,11,12,12,11,11,11,
134.6778 +	12,12,11,11,12,12,12,11,12,12,12,12,10,11,10,11,
134.6779 +	11,11,11,11,12,12,10,11,10,12,11,11,12,11,12,12,
134.6780 +	11,12,11,12,12,11,11,11,12,12,11,11,12,12,12,11,
134.6781 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,11,11,
134.6782 +	11,12,11,11,12,12,12,12,11,12,11,12,12,12,12,12,
134.6783 +	12,12,12,12,12,12,12,10,11,11,11,12,11,11,12,12,
134.6784 +	12,11,11,11,12,12,11,12,12,12,12,11,12,12,12,12,
134.6785 +	11,11,12,12,12,11,12,12,12,12,12,12,12,12,12,12,
134.6786 +	12,12,12,12,12,12,12,12,13,11,12,11,12,12,12,12,
134.6787 +	12,12,12,11,12,12,12,12,12,12,12,12,12,12,12,12,
134.6788 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.6789 +	12,12,12,13,12,13,12,12,12,12,13,12,12,12,12,12,
134.6790 +	12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,12,
134.6791 +	12,12,13,12,10,11,11,12,11,11,11,12,12,12,11,12,
134.6792 +	11,12,12,11,12,12,12,12,11,12,12,12,12,11,11,12,
134.6793 +	12,12,11,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.6794 +	12,12,12,12,12,12,11,12,11,12,12,12,12,12,12,12,
134.6795 +	11,12,12,12,12,12,12,12,12,12,12,12,12,13,12,12,
134.6796 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.6797 +	12,12,13,12,12,12,12,13,12,12,12,12,12,12,12,12,
134.6798 +	12,12,12,12,12,12,12,12,12,12,13,13,12,13,12,13,
134.6799 +	12, 8,10,10,11,11,10,10,11,11,11,10,11,10,11,11,
134.6800 +	10,11,11,12,12,10,11,11,12,12, 9,10,11,11,11,10,
134.6801 +	10,11,12,12,10,11,11,12,12,11,11,12,12,12,11,12,
134.6802 +	12,12,12,10,11,10,11,11,11,11,11,12,12,10,11,11,
134.6803 +	12,12,11,12,12,12,12,11,12,11,12,12,11,11,11,12,
134.6804 +	12,11,11,12,12,12,11,12,12,12,12,12,12,12,12,12,
134.6805 +	12,12,12,12,12,11,11,11,12,12,11,12,12,12,12,11,
134.6806 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12, 9,10,
134.6807 +	10,11,11,10,11,11,12,12,10,11,11,12,12,11,11,12,
134.6808 +	12,12,11,12,12,12,12,10,11,11,12,12,11,11,12,12,
134.6809 +	12,11,11,12,12,12,11,11,12,12,12,12,12,12,12,12,
134.6810 +	10,11,11,12,12,11,12,12,12,12,11,12,11,12,12,12,
134.6811 +	12,12,12,12,12,12,12,12,12,11,11,12,12,12,12,12,
134.6812 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.6813 +	12,12,11,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.6814 +	12,12,12,12,12,12,12,12,12,12,12, 9,10,10,11,11,
134.6815 +	10,11,11,12,12,10,11,11,12,11,11,12,12,12,12,11,
134.6816 +	12,12,12,12,10,11,11,12,12,11,11,11,12,12,11,12,
134.6817 +	12,12,12,12,12,12,12,12,12,12,12,12,12,10,11,11,
134.6818 +	12,12,11,12,12,12,12,11,12,11,12,12,12,12,12,12,
134.6819 +	12,12,12,12,12,12,11,12,12,12,12,11,12,12,12,12,
134.6820 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,11,
134.6821 +	12,12,12,12,12,12,12,12,12,11,12,12,12,12,12,12,
134.6822 +	12,12,12,12,12,12,12,12,11,11,11,12,12,11,12,12,
134.6823 +	12,12,11,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.6824 +	13,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.6825 +	12,12,13,12,13,12,12,13,13,13,11,12,12,12,12,12,
134.6826 +	12,12,13,13,12,12,12,13,12,12,12,12,13,13,12,13,
134.6827 +	12,13,13,12,12,12,12,12,12,12,12,12,13,12,13,13,
134.6828 +	13,13,12,13,13,13,13,13,13,13,13,13,12,12,12,12,
134.6829 +	12,12,12,13,13,13,12,13,12,13,13,12,13,13,13,13,
134.6830 +	12,13,13,13,13,11,11,11,12,12,11,12,12,12,12,11,
134.6831 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,11,12,
134.6832 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,
134.6833 +	12,13,12,12,12,13,13,11,12,12,12,12,12,12,12,12,
134.6834 +	13,12,12,12,13,12,12,13,12,13,13,12,13,12,13,13,
134.6835 +	12,12,12,12,12,12,12,13,13,13,12,12,13,13,13,12,
134.6836 +	13,13,12,13,13,13,13,13,13,12,12,12,12,12,12,13,
134.6837 +	12,13,13,12,13,12,13,12,12,13,13,13,13,12,13,13,
134.6838 +	13,13, 8,10,10,11,11,10,10,11,11,11, 9,11,10,11,
134.6839 +	11,10,11,11,12,12,10,11,11,12,12,10,10,11,11,11,
134.6840 +	10,11,11,12,12,11,11,11,12,12,11,11,12,12,12,11,
134.6841 +	12,12,12,12, 9,11,10,11,11,10,11,11,12,12,10,11,
134.6842 +	10,12,12,11,12,12,12,12,11,12,11,12,12,11,11,11,
134.6843 +	12,12,11,12,12,12,12,11,12,12,12,12,12,12,12,12,
134.6844 +	12,12,12,12,12,12,11,11,11,12,12,11,12,12,12,12,
134.6845 +	11,12,11,12,12,12,12,12,12,12,12,12,12,12,12, 9,
134.6846 +	10,10,11,11,10,11,11,12,12,10,11,11,12,12,11,12,
134.6847 +	12,12,12,11,12,12,12,12,10,11,11,12,12,11,11,12,
134.6848 +	12,12,11,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.6849 +	12,10,11,11,12,12,11,11,12,12,12,11,11,11,12,12,
134.6850 +	12,12,12,12,12,11,12,12,12,12,11,12,12,12,12,11,
134.6851 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.6852 +	12,12,12,11,12,12,12,12,12,12,12,12,12,11,12,12,
134.6853 +	12,12,12,12,12,12,12,12,12,12,12,12, 9,10,10,11,
134.6854 +	11,10,11,11,12,12,10,11,11,12,12,11,12,12,12,12,
134.6855 +	11,12,11,12,12,10,11,11,12,12,11,11,12,12,12,11,
134.6856 +	11,12,12,12,12,12,12,12,12,12,12,12,12,12,10,11,
134.6857 +	11,12,12,11,12,11,12,12,11,12,11,12,12,12,12,12,
134.6858 +	12,12,11,12,11,12,12,11,12,12,12,12,12,12,12,12,
134.6859 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.6860 +	11,12,11,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.6861 +	12,12,12,12,12,12,12,12,12,11,11,11,12,12,11,12,
134.6862 +	12,12,12,11,12,12,12,12,12,12,12,12,12,12,12,12,
134.6863 +	12,12,11,12,12,12,12,12,12,12,12,12,12,12,12,13,
134.6864 +	13,12,12,12,13,13,12,12,13,13,13,11,12,12,12,12,
134.6865 +	12,12,12,12,12,12,12,12,12,12,12,13,12,13,13,12,
134.6866 +	12,12,13,12,12,12,12,12,12,12,12,13,13,13,12,12,
134.6867 +	13,13,13,12,13,13,12,13,12,13,13,13,13,12,12,12,
134.6868 +	12,12,12,12,13,13,13,12,12,12,13,12,12,13,13,13,
134.6869 +	13,12,13,13,13,13,11,11,11,12,12,11,12,12,12,12,
134.6870 +	11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,11,
134.6871 +	12,12,12,12,12,12,12,12,12,12,12,12,13,12,12,12,
134.6872 +	13,13,13,12,12,12,13,13,11,12,12,12,12,12,12,12,
134.6873 +	13,12,12,12,12,13,12,12,13,12,13,13,12,13,12,13,
134.6874 +	12,12,12,12,12,12,12,12,13,13,13,12,13,13,13,13,
134.6875 +	12,13,13,13,13,13,13,13,13,13,12,12,12,12,12,12,
134.6876 +	13,12,13,12,12,13,12,13,12,13,13,13,13,13,12,13,
134.6877 +	13,13,13,10,11,11,12,12,11,12,12,12,12,11,12,12,
134.6878 +	12,12,12,12,12,12,12,12,12,12,12,12,11,11,12,12,
134.6879 +	12,11,12,12,12,12,12,12,12,12,12,12,12,12,13,13,
134.6880 +	12,12,12,13,13,11,12,12,12,12,12,12,12,12,12,12,
134.6881 +	12,12,12,12,12,12,12,13,13,12,12,12,13,12,12,12,
134.6882 +	12,12,12,12,12,12,12,13,12,12,12,12,13,12,12,13,
134.6883 +	12,13,12,13,13,13,13,12,12,12,12,12,12,12,12,13,
134.6884 +	12,12,12,12,13,12,12,13,13,13,13,12,13,12,13,13,
134.6885 +	11,11,11,12,12,11,12,12,12,12,11,12,12,12,12,12,
134.6886 +	12,12,12,13,12,12,12,13,12,11,12,12,12,12,12,12,
134.6887 +	12,12,13,12,12,12,12,13,12,12,13,13,13,12,12,13,
134.6888 +	13,13,11,12,12,12,12,12,12,12,12,13,12,12,12,13,
134.6889 +	12,12,13,12,13,13,12,13,12,13,13,12,12,12,12,12,
134.6890 +	12,12,13,12,13,12,12,13,13,13,12,12,13,13,13,13,
134.6891 +	13,13,13,13,12,12,12,12,12,12,13,13,13,13,12,13,
134.6892 +	12,13,12,12,13,13,13,13,12,13,13,13,13,11,11,11,
134.6893 +	12,12,11,12,12,12,12,11,12,12,12,12,12,12,12,12,
134.6894 +	12,12,12,12,12,13,11,12,12,12,12,12,12,12,12,13,
134.6895 +	12,12,12,13,13,12,12,13,13,13,12,12,13,13,13,11,
134.6896 +	12,12,12,12,12,12,12,13,13,12,12,12,13,12,12,13,
134.6897 +	12,13,13,12,13,12,13,13,12,12,12,12,12,12,12,12,
134.6898 +	12,13,12,13,12,13,13,12,13,13,13,13,12,13,13,13,
134.6899 +	13,12,12,12,12,12,12,13,12,13,13,12,12,12,13,13,
134.6900 +	12,13,13,13,13,12,13,12,13,13,11,12,12,12,12,11,
134.6901 +	12,12,12,12,11,12,12,12,12,12,12,12,12,12,12,12,
134.6902 +	12,12,12,11,12,12,12,12,12,12,12,12,12,12,12,12,
134.6903 +	12,12,12,12,13,12,13,12,12,12,13,13,11,12,12,12,
134.6904 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,
134.6905 +	12,13,12,13,13,12,12,12,12,12,12,12,13,12,13,12,
134.6906 +	12,13,12,13,12,12,13,12,13,12,13,13,13,13,12,12,
134.6907 +	12,12,12,12,12,12,12,12,12,12,12,13,12,12,13,13,
134.6908 +	13,13,12,13,12,13,12,11,11,11,12,12,11,12,12,12,
134.6909 +	12,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.6910 +	11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.6911 +	12,12,12,12,12,12,12,13,13,11,12,12,12,12,12,12,
134.6912 +	12,12,12,12,12,12,12,12,12,12,12,13,13,12,12,12,
134.6913 +	13,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.6914 +	12,12,12,13,12,12,12,13,12,12,12,12,12,12,12,12,
134.6915 +	12,12,12,13,12,12,12,12,13,12,12,13,12,13,12,12,
134.6916 +	13,12,13,12,10,11,11,12,12,11,12,12,12,12,11,12,
134.6917 +	11,12,12,11,12,12,12,12,11,12,12,12,12,11,12,12,
134.6918 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.6919 +	13,12,12,12,13,13,11,12,11,12,12,12,12,12,12,12,
134.6920 +	11,12,12,12,12,12,12,12,13,13,12,12,12,13,12,12,
134.6921 +	12,12,12,12,12,12,12,12,13,12,12,12,12,13,12,13,
134.6922 +	13,12,13,12,13,13,13,13,12,12,12,12,12,12,12,12,
134.6923 +	13,13,12,12,12,13,12,12,13,13,13,13,12,13,12,13,
134.6924 +	12,11,11,11,12,12,11,12,12,12,12,11,12,12,12,12,
134.6925 +	12,12,12,13,13,12,12,12,13,12,11,12,12,12,12,12,
134.6926 +	12,12,12,13,12,12,12,13,13,12,12,13,13,13,12,12,
134.6927 +	13,13,13,11,12,12,12,12,12,12,12,13,13,12,12,12,
134.6928 +	13,12,12,13,12,13,13,12,12,12,13,13,12,12,12,12,
134.6929 +	12,12,12,13,13,13,12,12,13,13,13,12,12,13,13,13,
134.6930 +	12,13,13,13,13,12,12,12,12,12,12,12,13,13,13,12,
134.6931 +	12,12,13,12,12,13,13,13,13,12,13,13,13,13,11,11,
134.6932 +	11,12,12,11,12,12,12,12,11,12,12,12,12,12,12,12,
134.6933 +	12,13,12,12,12,13,13,11,12,12,12,12,12,12,12,12,
134.6934 +	13,12,12,12,13,13,12,12,13,13,13,12,12,13,13,13,
134.6935 +	11,12,12,12,12,12,12,12,13,12,12,12,12,13,12,12,
134.6936 +	13,12,13,13,12,13,12,13,13,12,12,12,12,12,12,12,
134.6937 +	12,13,13,12,13,12,13,13,12,13,13,13,13,13,13,13,
134.6938 +	13,13,12,12,12,12,12,12,13,12,13,13,12,13,12,13,
134.6939 +	12,12,13,13,13,13,12,13,12,13,13,11,11,11,12,12,
134.6940 +	11,12,12,12,12,11,12,12,12,12,12,12,12,12,12,12,
134.6941 +	12,12,12,12,11,12,12,12,12,12,12,12,12,12,12,12,
134.6942 +	12,12,12,12,12,12,12,13,12,12,12,13,13,11,12,12,
134.6943 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,
134.6944 +	13,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,
134.6945 +	12,12,12,12,13,12,12,12,12,13,12,12,13,12,13,12,
134.6946 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.6947 +	13,12,12,12,13,12,12,12,11,12,11,12,12,11,12,12,
134.6948 +	12,12,11,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.6949 +	12,11,12,12,12,12,12,12,12,12,13,12,12,12,12,12,
134.6950 +	12,12,12,13,13,12,12,12,13,13,11,12,12,12,12,12,
134.6951 +	12,12,12,12,12,12,12,12,12,12,13,12,13,13,12,12,
134.6952 +	12,13,12,12,12,12,12,12,12,12,12,12,13,12,12,12,
134.6953 +	13,13,12,12,13,12,13,12,13,13,13,13,12,12,12,12,
134.6954 +	12,12,12,12,13,12,12,12,12,13,12,12,13,12,13,13,
134.6955 +	12,13,12,13,12,
134.6956 +};
134.6957 +
134.6958 +static const static_codebook _44p6_p4_1 = {
134.6959 +	5, 3125,
134.6960 +	(long *)_vq_lengthlist__44p6_p4_1,
134.6961 +	1, -533725184, 1611661312, 3, 0,
134.6962 +	(long *)_vq_quantlist__44p6_p4_1,
134.6963 +	0
134.6964 +};
134.6965 +
134.6966 +static const long _vq_quantlist__44p6_p5_0[] = {
134.6967 +	2,
134.6968 +	1,
134.6969 +	3,
134.6970 +	0,
134.6971 +	4,
134.6972 +};
134.6973 +
134.6974 +static const long _vq_lengthlist__44p6_p5_0[] = {
134.6975 +	 2, 6, 6,10,10, 5, 7, 8,11,12, 5, 8, 7,12,11, 9,
134.6976 +	11,11,13,15, 9,11,11,15,13, 6, 7, 8,11,11, 7, 7,
134.6977 +	 9,11,13, 8, 9, 9,13,12,11,11,12,12,15,11,12,12,
134.6978 +	15,14, 6, 8, 7,11,11, 8, 9, 9,12,13, 7, 9, 7,13,
134.6979 +	11,11,12,12,14,15,11,12,11,15,12,10,11,11,12,14,
134.6980 +	10,11,12,12,15,12,13,13,14,15,13,12,14,12,16,15,
134.6981 +	15,15,16,16,10,11,11,14,12,12,13,13,15,14,10,12,
134.6982 +	11,15,12,15,15,15,16,17,13,14,12,17,12, 6, 8, 8,
134.6983 +	12,12, 8, 9,10,13,13, 8, 9, 9,13,13,12,12,13,15,
134.6984 +	16,12,13,13,16,15, 8, 9,10,12,13, 9, 9,11,13,14,
134.6985 +	10,11,11,14,14,13,13,14,15,16,13,14,14,16,16, 8,
134.6986 +	10, 9,13,13,10,11,11,14,14, 9,10,10,14,13,13,14,
134.6987 +	14,16,17,13,13,13,16,15,12,13,13,14,16,13,13,14,
134.6988 +	14,16,14,14,14,16,16,15,15,16,15,18,16,17,17,18,
134.6989 +	18,12,13,13,15,15,14,14,14,16,16,13,14,13,16,15,
134.6990 +	16,16,17,18,18,15,16,15,18,15, 6, 8, 8,12,12, 8,
134.6991 +	 9, 9,13,13, 8,10, 9,13,13,12,13,13,15,16,12,13,
134.6992 +	12,16,15, 8, 9,10,13,13, 9,10,10,13,14,10,11,11,
134.6993 +	14,14,13,13,13,15,16,13,14,14,17,16, 8,10, 9,13,
134.6994 +	13,10,11,11,14,14, 9,11, 9,14,13,13,14,14,16,16,
134.6995 +	13,14,13,16,14,12,13,13,15,16,13,13,14,15,16,14,
134.6996 +	14,14,16,16,15,15,16,15,18,17,17,17,18,18,12,13,
134.6997 +	13,16,14,14,14,14,16,16,13,14,13,16,14,16,17,17,
134.6998 +	18,18,15,16,15,18,15,11,12,13,14,16,13,13,14,15,
134.6999 +	17,13,14,14,16,17,16,16,17,17,19,16,17,17,18,19,
134.7000 +	13,13,14,16,16,14,14,15,16,17,14,15,15,17,17,17,
134.7001 +	16,17,17,19,17,17,18,19,19,13,14,14,16,16,14,14,
134.7002 +	15,17,18,14,15,14,17,17,17,17,18,18,19,17,17,17,
134.7003 +	18,19,16,16,16,17,18,17,17,17,18,19,17,17,17,18,
134.7004 +	19,18,18,19,18,20,19,20,19,21,20,16,17,17,18,18,
134.7005 +	17,17,18,19,19,17,17,17,19,18,19,19,19,19,20,19,
134.7006 +	19,19,20,19,11,13,12,16,14,13,14,14,17,16,13,14,
134.7007 +	13,17,15,16,17,17,18,18,16,17,16,19,17,13,14,14,
134.7008 +	16,16,14,14,14,17,17,14,15,15,17,16,17,17,17,19,
134.7009 +	19,17,18,17,19,18,13,14,13,17,16,14,15,15,17,17,
134.7010 +	14,15,14,18,16,17,17,17,19,19,17,17,16,19,17,16,
134.7011 +	17,17,18,19,17,17,17,18,18,17,18,17,19,18,18,19,
134.7012 +	18,19,19,19,20,19,20,20,16,17,16,18,17,17,17,17,
134.7013 +	18,18,17,18,17,19,17,19,19,19,19,20,18,19,19,20,
134.7014 +	18, 6, 8, 8,12,12, 8, 9, 9,13,13, 8,10, 9,13,13,
134.7015 +	11,13,13,15,16,12,13,13,16,15, 8, 9, 9,13,13, 9,
134.7016 +	 9,10,13,14,10,11,11,14,14,12,12,13,14,16,13,14,
134.7017 +	14,17,16, 8,10, 9,13,13,10,11,11,14,14, 9,11,10,
134.7018 +	14,13,13,14,14,16,16,13,14,13,16,15,12,13,13,14,
134.7019 +	16,12,13,14,14,16,13,14,14,16,16,15,14,16,15,18,
134.7020 +	16,17,17,18,17,12,13,13,16,15,14,14,14,16,16,13,
134.7021 +	14,13,16,15,16,16,17,17,17,15,16,15,18,15, 7, 9,
134.7022 +	 9,13,13, 9, 9,11,13,14, 9,10,10,14,13,12,13,14,
134.7023 +	15,16,12,14,13,17,15, 9, 9,10,13,14,10, 9,11,13,
134.7024 +	15,11,11,11,14,14,13,12,14,14,17,14,14,14,17,16,
134.7025 +	 9,10,10,14,13,11,11,11,14,14,10,11,10,15,13,14,
134.7026 +	14,14,16,17,13,14,13,17,14,13,13,14,14,16,13,13,
134.7027 +	14,14,17,14,14,14,16,16,15,14,16,15,18,17,17,17,
134.7028 +	18,18,13,14,13,16,15,14,14,15,17,16,13,14,13,17,
134.7029 +	15,17,16,17,17,17,15,16,14,18,14, 7, 9, 9,13,13,
134.7030 +	 9,10,10,13,14, 9,11,10,14,13,13,14,14,16,16,13,
134.7031 +	14,14,17,15, 9,10,10,14,13, 9,10,11,13,14,11,12,
134.7032 +	11,15,14,13,13,14,14,16,14,15,15,17,17, 9,10,10,
134.7033 +	14,14,11,12,12,14,15,10,11,10,15,13,14,15,15,17,
134.7034 +	17,14,15,13,17,14,13,14,13,16,16,13,13,14,15,16,
134.7035 +	14,15,15,17,17,15,14,16,15,18,17,18,17,20,18,13,
134.7036 +	14,14,16,16,15,15,15,17,17,13,14,13,17,15,17,17,
134.7037 +	18,18,18,15,16,14,19,14,12,13,13,15,16,13,13,15,
134.7038 +	16,17,13,14,14,16,16,15,15,17,17,19,16,17,17,19,
134.7039 +	18,13,13,14,15,17,14,13,15,15,17,14,15,15,16,17,
134.7040 +	16,15,18,16,19,17,17,17,18,19,13,14,14,17,16,14,
134.7041 +	15,15,17,17,14,15,14,17,16,17,17,17,18,19,16,17,
134.7042 +	16,19,17,16,16,17,16,18,16,16,17,16,19,17,17,18,
134.7043 +	18,19,18,17,18,17,21,19,19,19,20,19,16,17,17,18,
134.7044 +	18,17,17,18,18,19,16,17,16,18,18,19,19,19,19,20,
134.7045 +	18,18,17,20,18,11,13,13,16,15,13,14,14,16,17,13,
134.7046 +	15,14,17,16,16,17,17,18,18,17,17,17,19,18,13,14,
134.7047 +	13,17,16,14,13,14,16,17,15,16,15,18,16,17,16,17,
134.7048 +	17,19,18,18,18,20,18,13,14,14,16,17,15,15,15,17,
134.7049 +	18,14,15,14,18,16,18,18,18,19,20,17,18,16,20,17,
134.7050 +	16,17,16,18,18,16,16,17,18,18,17,18,18,19,18,18,
134.7051 +	17,19,17,20,19,20,19,22,20,16,16,17,18,18,18,17,
134.7052 +	17,19,19,16,17,16,18,17,19,20,19,22,21,18,19,18,
134.7053 +	21,17, 6, 8, 8,12,12, 8, 9,10,13,13, 8, 9, 9,13,
134.7054 +	13,12,13,13,15,16,11,13,13,16,15, 8, 9,10,13,13,
134.7055 +	 9,10,11,13,14,10,11,11,14,14,13,13,14,15,16,13,
134.7056 +	14,14,16,16, 8, 9, 9,13,13,10,11,11,14,14, 9,10,
134.7057 +	 9,14,13,13,14,14,16,17,12,14,12,16,14,12,13,13,
134.7058 +	15,16,13,13,14,15,16,13,14,14,15,17,15,15,16,15,
134.7059 +	18,16,16,17,17,17,12,13,13,16,14,13,14,14,16,16,
134.7060 +	12,14,13,16,14,16,17,17,18,18,15,15,14,18,14, 7,
134.7061 +	 9, 9,13,13, 9,10,11,13,14, 9,10,10,14,13,13,14,
134.7062 +	14,15,17,13,14,14,16,15, 9,10,10,14,14,10,10,11,
134.7063 +	13,15,11,12,12,15,14,14,13,15,14,17,14,15,15,17,
134.7064 +	17, 9,10,10,13,14,11,11,12,14,15, 9,11,10,14,13,
134.7065 +	14,15,15,16,18,13,14,13,16,14,13,14,14,16,16,13,
134.7066 +	13,14,15,17,15,15,15,16,17,15,14,16,15,18,17,17,
134.7067 +	18,19,18,13,14,14,16,16,14,15,15,17,17,13,14,13,
134.7068 +	16,15,17,17,18,18,18,15,16,14,18,15, 7, 9, 9,13,
134.7069 +	13, 9,10,10,13,14, 9,11,10,14,13,12,13,14,15,16,
134.7070 +	12,14,13,16,15, 9,10,10,13,14,10,10,11,13,14,11,
134.7071 +	11,11,15,14,13,13,14,14,16,14,14,14,17,16, 9,10,
134.7072 +	 9,14,13,11,11,11,14,14,10,11, 9,15,13,14,14,14,
134.7073 +	16,16,13,14,12,17,14,13,13,14,15,16,13,13,14,15,
134.7074 +	16,14,15,14,16,17,15,14,16,14,18,16,17,17,18,18,
134.7075 +	13,14,13,16,14,14,14,14,16,16,13,14,13,17,14,17,
134.7076 +	17,17,18,18,15,16,14,18,15,11,13,13,16,16,13,14,
134.7077 +	15,16,17,13,14,14,17,16,16,17,17,18,19,17,17,17,
134.7078 +	19,18,13,14,14,17,17,13,13,15,16,18,15,15,15,17,
134.7079 +	17,17,16,18,17,20,18,17,18,19,19,13,14,14,16,17,
134.7080 +	15,15,16,16,18,14,15,14,16,16,17,17,18,18,20,17,
134.7081 +	18,16,18,17,16,17,16,19,18,16,16,17,18,19,18,18,
134.7082 +	18,19,19,18,17,18,17,21,20,19,19,21,21,16,16,17,
134.7083 +	18,18,17,17,18,19,19,16,17,16,19,18,20,20,20,19,
134.7084 +	21,18,18,17,20,18,12,13,13,16,15,13,14,14,16,16,
134.7085 +	13,14,13,17,16,16,17,17,18,18,15,17,15,19,17,13,
134.7086 +	14,14,16,17,14,14,15,16,17,14,15,15,17,17,16,16,
134.7087 +	17,17,18,17,17,17,19,19,13,14,13,17,15,14,15,15,
134.7088 +	17,16,14,15,13,17,15,17,18,17,19,18,16,17,15,20,
134.7089 +	16,16,17,17,18,18,16,16,17,18,18,17,18,17,19,18,
134.7090 +	17,17,18,18,20,19,20,19,20,19,16,16,16,19,16,17,
134.7091 +	17,17,19,18,16,17,16,19,16,19,19,19,19,19,18,19,
134.7092 +	17,19,17,11,13,13,16,16,13,14,14,17,17,13,14,14,
134.7093 +	17,17,15,17,17,19,19,16,18,17,20,19,12,14,14,17,
134.7094 +	17,13,14,15,17,18,14,15,15,17,18,16,16,17,18,20,
134.7095 +	17,18,18,20,18,13,14,14,17,17,14,15,15,17,18,14,
134.7096 +	15,15,17,17,17,18,17,19,19,17,18,17,19,19,15,16,
134.7097 +	16,18,18,15,16,17,18,19,16,17,17,19,19,17,17,18,
134.7098 +	18,21,18,19,19,21,19,16,17,17,18,18,17,17,18,19,
134.7099 +	19,17,18,17,19,19,19,19,19,20,20,18,19,18,21,19,
134.7100 +	12,13,13,16,16,13,14,14,16,17,13,15,14,17,16,15,
134.7101 +	16,17,17,19,16,17,17,19,18,13,13,14,16,17,14,13,
134.7102 +	15,16,17,14,15,15,17,17,15,15,17,17,20,17,17,18,
134.7103 +	19,18,13,14,14,17,16,15,15,15,17,18,14,15,14,17,
134.7104 +	16,17,17,17,18,18,16,17,16,19,17,16,15,17,17,19,
134.7105 +	16,15,17,16,19,17,16,17,18,19,17,16,19,16,20,19,
134.7106 +	18,19,19,19,16,17,17,18,18,17,17,17,18,19,16,17,
134.7107 +	16,19,18,20,19,19,20,19,18,18,17,20,17,11,13,13,
134.7108 +	16,16,13,14,15,16,17,14,15,14,18,16,17,17,17,18,
134.7109 +	21,17,18,17,20,19,13,14,14,17,16,13,14,15,16,18,
134.7110 +	15,16,15,18,17,17,16,17,17,19,17,18,18,20,19,13,
134.7111 +	14,14,16,17,15,15,16,17,18,14,15,14,18,17,17,18,
134.7112 +	18,19,20,17,18,16,19,17,16,17,15,19,18,16,16,16,
134.7113 +	18,18,17,18,17,20,19,18,17,18,17,20,20,20,19,22,
134.7114 +	20,16,17,17,18,19,18,18,18,19,20,16,17,16,19,18,
134.7115 +	20,19,19,20,20,18,19,17,20,17,13,14,14,16,17,14,
134.7116 +	14,16,16,18,14,16,15,17,16,16,16,17,17,18,17,17,
134.7117 +	16,19,18,14,14,15,16,17,14,14,16,16,18,16,16,16,
134.7118 +	17,17,16,15,17,16,19,18,18,18,19,19,14,15,15,17,
134.7119 +	17,15,16,16,17,18,14,16,14,18,16,17,17,18,18,19,
134.7120 +	16,17,16,19,17,16,16,17,16,18,16,16,17,16,19,18,
134.7121 +	18,18,17,18,17,16,18,16,20,19,19,19,19,19,16,17,
134.7122 +	17,18,18,17,17,18,19,19,16,17,16,19,17,18,19,19,
134.7123 +	19,20,17,18,16,20,16,11,14,13,17,17,14,14,16,16,
134.7124 +	18,14,16,14,19,16,18,18,19,18,19,18,19,18,21,18,
134.7125 +	13,15,14,18,16,14,14,16,16,18,16,17,16,19,17,18,
134.7126 +	16,19,17,20,19,19,19,21,19,13,14,15,17,18,17,16,
134.7127 +	17,17,19,14,16,14,18,16,20,19,19,20,21,18,19,16,
134.7128 +	21,17,17,18,16,19,17,16,16,17,18,18,19,19,18,21,
134.7129 +	18,17,17,18,17,20,20,20,20,22,20,17,17,18,18,20,
134.7130 +	19,19,19,18,20,16,17,17,19,19,21,21,21,20,21,17,
134.7131 +	19,17,23,17,11,13,13,16,16,13,14,14,17,17,13,14,
134.7132 +	14,17,17,16,17,17,19,20,15,16,16,19,19,13,14,14,
134.7133 +	16,17,14,15,15,17,18,14,15,15,17,17,17,17,18,19,
134.7134 +	19,17,17,18,19,19,13,14,14,17,16,14,15,15,17,17,
134.7135 +	13,15,14,18,17,17,18,18,19,20,16,17,16,19,18,16,
134.7136 +	16,17,18,18,17,17,17,18,19,17,18,17,19,19,19,19,
134.7137 +	19,19,20,19,20,19,20,20,15,16,16,18,17,16,17,17,
134.7138 +	20,18,15,16,16,19,17,19,19,19,20,20,17,18,17,21,
134.7139 +	17,11,13,13,16,16,13,14,15,16,17,13,15,14,17,16,
134.7140 +	17,17,18,18,20,17,17,17,19,19,13,14,14,17,17,14,
134.7141 +	14,15,17,18,15,15,15,18,17,17,17,18,17,20,18,18,
134.7142 +	17,20,18,13,14,14,16,17,15,15,16,17,18,14,15,13,
134.7143 +	17,17,17,18,18,19,20,17,17,16,19,17,16,17,17,18,
134.7144 +	18,16,16,17,18,18,18,18,18,19,19,18,17,19,18,21,
134.7145 +	19,20,20,20,20,16,15,17,18,18,17,17,18,18,20,16,
134.7146 +	16,16,18,17,20,19,20,21,22,17,18,17,20,17,12,13,
134.7147 +	13,16,16,13,14,15,16,17,13,14,14,17,16,16,17,18,
134.7148 +	18,19,15,16,16,19,18,13,14,14,16,17,14,14,15,16,
134.7149 +	17,14,15,15,17,17,16,16,17,17,19,17,17,17,19,18,
134.7150 +	13,14,13,17,16,14,15,15,17,17,13,15,13,17,16,17,
134.7151 +	17,17,19,19,15,17,15,19,17,16,17,17,18,18,16,16,
134.7152 +	17,17,19,17,18,17,19,19,18,17,19,17,19,19,19,19,
134.7153 +	20,19,15,17,15,19,16,17,17,16,19,18,16,17,15,18,
134.7154 +	16,19,19,19,20,19,17,19,16,19,16,11,14,14,17,17,
134.7155 +	15,14,16,16,18,15,16,14,18,16,18,18,19,18,21,18,
134.7156 +	19,18,20,18,13,15,14,18,17,14,14,16,16,18,16,17,
134.7157 +	16,19,17,17,17,19,17,22,19,19,19,21,19,13,14,15,
134.7158 +	17,18,17,16,17,17,19,14,16,14,18,16,19,19,19,20,
134.7159 +	21,18,18,16,20,17,17,18,16,19,18,15,17,17,19,19,
134.7160 +	19,19,18,21,19,18,17,20,17,21,22,21,20,21,21,17,
134.7161 +	16,19,18,20,19,18,19,18,20,16,17,16,19,18,21,20,
134.7162 +	21,19,23,18,19,16,20,17,13,14,14,17,16,14,14,15,
134.7163 +	16,18,14,16,14,17,16,16,16,17,17,19,16,17,16,19,
134.7164 +	17,14,15,15,17,17,14,14,16,16,17,15,16,16,18,17,
134.7165 +	16,16,17,17,19,17,18,17,19,18,14,15,14,17,16,16,
134.7166 +	16,16,17,17,14,16,14,17,16,18,18,18,18,19,16,17,
134.7167 +	15,19,16,17,17,17,18,18,16,15,17,17,18,18,18,18,
134.7168 +	19,19,17,16,18,16,19,19,19,19,19,19,16,17,16,19,
134.7169 +	16,18,18,17,19,18,16,17,16,19,16,19,19,20,19,19,
134.7170 +	17,18,16,20,16,
134.7171 +};
134.7172 +
134.7173 +static const static_codebook _44p6_p5_0 = {
134.7174 +	5, 3125,
134.7175 +	(long *)_vq_lengthlist__44p6_p5_0,
134.7176 +	1, -528744448, 1616642048, 3, 0,
134.7177 +	(long *)_vq_quantlist__44p6_p5_0,
134.7178 +	0
134.7179 +};
134.7180 +
134.7181 +static const long _vq_quantlist__44p6_p5_1[] = {
134.7182 +	3,
134.7183 +	2,
134.7184 +	4,
134.7185 +	1,
134.7186 +	5,
134.7187 +	0,
134.7188 +	6,
134.7189 +};
134.7190 +
134.7191 +static const long _vq_lengthlist__44p6_p5_1[] = {
134.7192 +	 2, 3, 3, 3, 3, 3, 3,
134.7193 +};
134.7194 +
134.7195 +static const static_codebook _44p6_p5_1 = {
134.7196 +	1, 7,
134.7197 +	(long *)_vq_lengthlist__44p6_p5_1,
134.7198 +	1, -533200896, 1611661312, 3, 0,
134.7199 +	(long *)_vq_quantlist__44p6_p5_1,
134.7200 +	0
134.7201 +};
134.7202 +
134.7203 +static const long _vq_quantlist__44p6_p6_0[] = {
134.7204 +	1,
134.7205 +	0,
134.7206 +	2,
134.7207 +};
134.7208 +
134.7209 +static const long _vq_lengthlist__44p6_p6_0[] = {
134.7210 +	 1, 5, 5, 5, 7, 9, 5, 9, 7, 5, 7, 8, 7, 7,10, 9,
134.7211 +	10,10, 5, 8, 7, 9,10,10, 7,10, 7, 6, 9, 9, 9,10,
134.7212 +	12, 9,11,11, 9,10,11,11,11,13,12,13,13, 9,11,11,
134.7213 +	12,13,13,11,13,11, 6, 9, 9, 9,11,11, 9,12,10, 9,
134.7214 +	11,11,11,11,13,12,13,13, 9,11,10,12,13,13,11,13,
134.7215 +	11, 6, 9, 9, 9,11,12, 9,12,11, 9,10,11,10,10,13,
134.7216 +	12,13,13, 9,11,11,12,13,12,11,13,11, 7, 9,10, 9,
134.7217 +	10,12,10,12,11,10,10,12,10,10,12,12,12,13,10,11,
134.7218 +	11,12,12,13,10,12,10, 7,10,10,11,11,14,11,14,11,
134.7219 +	10,12,11,11,11,14,14,14,14,10,11,12,14,14,14,11,
134.7220 +	14,11, 6, 9, 9, 9,11,12, 9,12,11, 9,11,11,11,11,
134.7221 +	13,12,12,13, 9,11,10,12,13,13,10,13,10, 7,10,10,
134.7222 +	11,11,14,11,14,11,10,12,11,11,11,14,14,15,14,10,
134.7223 +	11,12,13,14,15,11,14,11, 7,10, 9,10,11,12, 9,12,
134.7224 +	10,10,11,11,10,10,12,12,13,12, 9,12,10,12,13,12,
134.7225 +	10,12,10,
134.7226 +};
134.7227 +
134.7228 +static const static_codebook _44p6_p6_0 = {
134.7229 +	5, 243,
134.7230 +	(long *)_vq_lengthlist__44p6_p6_0,
134.7231 +	1, -527106048, 1620377600, 2, 0,
134.7232 +	(long *)_vq_quantlist__44p6_p6_0,
134.7233 +	0
134.7234 +};
134.7235 +
134.7236 +static const long _vq_quantlist__44p6_p6_1[] = {
134.7237 +	1,
134.7238 +	0,
134.7239 +	2,
134.7240 +};
134.7241 +
134.7242 +static const long _vq_lengthlist__44p6_p6_1[] = {
134.7243 +	 2, 6, 6, 6, 7, 8, 6, 8, 7, 6, 7, 7, 7, 7, 8, 7,
134.7244 +	 8, 8, 6, 7, 7, 7, 8, 8, 7, 8, 7, 6, 8, 8, 8, 9,
134.7245 +	 9, 8, 9, 9, 8, 9, 9, 9, 9,10, 9,10,10, 8, 9, 9,
134.7246 +	 9,10,10, 9,10, 9, 6, 8, 8, 8, 9, 9, 8, 9, 9, 8,
134.7247 +	 9, 9, 9, 9,10, 9,10,10, 8, 9, 9, 9,10, 9, 9,10,
134.7248 +	 9, 6, 8, 8, 8, 9, 9, 8, 9, 9, 8, 9, 9, 9, 9,10,
134.7249 +	 9, 9,10, 8, 9, 9, 9,10, 9, 9,10, 9, 7, 8, 8, 8,
134.7250 +	 9, 9, 8, 9, 9, 8, 8, 9, 9, 9, 9, 9, 9, 9, 8, 9,
134.7251 +	 9, 9,10, 9, 9, 9, 9, 7, 9, 9, 9, 9,10, 9,10, 9,
134.7252 +	 9, 9, 9, 9, 9,10,10,10,10, 9, 9, 9,10,10,10, 9,
134.7253 +	10, 9, 6, 8, 8, 8, 9, 9, 8, 9, 9, 8, 9, 9, 9, 9,
134.7254 +	10, 9,10,10, 8, 9, 9, 9,10, 9, 9,10, 9, 7, 9, 9,
134.7255 +	 9, 9,10, 9,10, 9, 9, 9, 9, 9, 9,10,10,10,10, 9,
134.7256 +	 9, 9,10,10,10, 9,10, 9, 7, 8, 8, 8, 9, 9, 8, 9,
134.7257 +	 9, 8, 9, 9, 9, 9,10, 9, 9,10, 8, 9, 8, 9, 9, 9,
134.7258 +	 9,10, 9,
134.7259 +};
134.7260 +
134.7261 +static const static_codebook _44p6_p6_1 = {
134.7262 +	5, 243,
134.7263 +	(long *)_vq_lengthlist__44p6_p6_1,
134.7264 +	1, -530841600, 1616642048, 2, 0,
134.7265 +	(long *)_vq_quantlist__44p6_p6_1,
134.7266 +	0
134.7267 +};
134.7268 +
134.7269 +static const long _vq_quantlist__44p6_p7_0[] = {
134.7270 +	1,
134.7271 +	0,
134.7272 +	2,
134.7273 +};
134.7274 +
134.7275 +static const long _vq_lengthlist__44p6_p7_0[] = {
134.7276 +	 1, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9,
134.7277 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.7278 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.7279 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.7280 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.7281 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.7282 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.7283 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.7284 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.7285 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.7286 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.7287 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.7288 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.7289 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.7290 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.7291 +	 9, 9, 9,
134.7292 +};
134.7293 +
134.7294 +static const static_codebook _44p6_p7_0 = {
134.7295 +	5, 243,
134.7296 +	(long *)_vq_lengthlist__44p6_p7_0,
134.7297 +	1, -513979392, 1633504256, 2, 0,
134.7298 +	(long *)_vq_quantlist__44p6_p7_0,
134.7299 +	0
134.7300 +};
134.7301 +
134.7302 +static const long _vq_quantlist__44p6_p7_1[] = {
134.7303 +	1,
134.7304 +	0,
134.7305 +	2,
134.7306 +};
134.7307 +
134.7308 +static const long _vq_lengthlist__44p6_p7_1[] = {
134.7309 +	 1, 4, 5, 5,10,10, 5,10,10, 5,10,10,10,10,10,10,
134.7310 +	10,10, 5,10,10,10,10,10,10,10,10, 7,10,10,10,10,
134.7311 +	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
134.7312 +	10,10,10,10,10,10, 6,10,10,10,10,10,10,10,10,10,
134.7313 +	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
134.7314 +	10, 6,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
134.7315 +	10,10,10,10,10,10,10,10,10,10,10,10, 9,10,10,10,
134.7316 +	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
134.7317 +	10,10,10,10,10,10,10, 9,10,10,10,10,10,10,10,10,
134.7318 +	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
134.7319 +	10,10, 6,10,10,10,10,10,10,10,10,10,10,10,10,10,
134.7320 +	10,10,10,10,10,10,10,10,10,10,10,10,10, 9,10,10,
134.7321 +	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
134.7322 +	10,10,10,10,10,10,10,10, 9,10,10,10,10,10,10,10,
134.7323 +	10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,
134.7324 +	11,11,11,
134.7325 +};
134.7326 +
134.7327 +static const static_codebook _44p6_p7_1 = {
134.7328 +	5, 243,
134.7329 +	(long *)_vq_lengthlist__44p6_p7_1,
134.7330 +	1, -516716544, 1630767104, 2, 0,
134.7331 +	(long *)_vq_quantlist__44p6_p7_1,
134.7332 +	0
134.7333 +};
134.7334 +
134.7335 +static const long _vq_quantlist__44p6_p7_2[] = {
134.7336 +	12,
134.7337 +	11,
134.7338 +	13,
134.7339 +	10,
134.7340 +	14,
134.7341 +	9,
134.7342 +	15,
134.7343 +	8,
134.7344 +	16,
134.7345 +	7,
134.7346 +	17,
134.7347 +	6,
134.7348 +	18,
134.7349 +	5,
134.7350 +	19,
134.7351 +	4,
134.7352 +	20,
134.7353 +	3,
134.7354 +	21,
134.7355 +	2,
134.7356 +	22,
134.7357 +	1,
134.7358 +	23,
134.7359 +	0,
134.7360 +	24,
134.7361 +};
134.7362 +
134.7363 +static const long _vq_lengthlist__44p6_p7_2[] = {
134.7364 +	 1, 2, 3, 4, 5, 7, 7, 8, 8, 9, 9,10,10,11,11,12,
134.7365 +	12,13,13,14,14,15,15,15,15,
134.7366 +};
134.7367 +
134.7368 +static const static_codebook _44p6_p7_2 = {
134.7369 +	1, 25,
134.7370 +	(long *)_vq_lengthlist__44p6_p7_2,
134.7371 +	1, -518864896, 1620639744, 5, 0,
134.7372 +	(long *)_vq_quantlist__44p6_p7_2,
134.7373 +	0
134.7374 +};
134.7375 +
134.7376 +static const long _vq_quantlist__44p6_p7_3[] = {
134.7377 +	12,
134.7378 +	11,
134.7379 +	13,
134.7380 +	10,
134.7381 +	14,
134.7382 +	9,
134.7383 +	15,
134.7384 +	8,
134.7385 +	16,
134.7386 +	7,
134.7387 +	17,
134.7388 +	6,
134.7389 +	18,
134.7390 +	5,
134.7391 +	19,
134.7392 +	4,
134.7393 +	20,
134.7394 +	3,
134.7395 +	21,
134.7396 +	2,
134.7397 +	22,
134.7398 +	1,
134.7399 +	23,
134.7400 +	0,
134.7401 +	24,
134.7402 +};
134.7403 +
134.7404 +static const long _vq_lengthlist__44p6_p7_3[] = {
134.7405 +	 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5,
134.7406 +	 5, 5, 5, 5, 5, 5, 5, 5, 5,
134.7407 +};
134.7408 +
134.7409 +static const static_codebook _44p6_p7_3 = {
134.7410 +	1, 25,
134.7411 +	(long *)_vq_lengthlist__44p6_p7_3,
134.7412 +	1, -529006592, 1611661312, 5, 0,
134.7413 +	(long *)_vq_quantlist__44p6_p7_3,
134.7414 +	0
134.7415 +};
134.7416 +
134.7417 +static const long _huff_lengthlist__44p6_short[] = {
134.7418 +	 2, 8,13,15,16,18,21,22, 5, 4, 6, 8,10,12,17,21,
134.7419 +	 9, 5, 5, 6, 8,11,15,19,11, 6, 5, 5, 6, 7,12,14,
134.7420 +	14, 8, 7, 5, 4, 4, 9,11,16,11, 9, 7, 4, 3, 7,10,
134.7421 +	22,15,14,12, 8, 7, 9,11,21,16,15,12, 9, 5, 6, 8,
134.7422 +};
134.7423 +
134.7424 +static const static_codebook _huff_book__44p6_short = {
134.7425 +	2, 64,
134.7426 +	(long *)_huff_lengthlist__44p6_short,
134.7427 +	0, 0, 0, 0, 0,
134.7428 +	NULL,
134.7429 +	0
134.7430 +};
134.7431 +
134.7432 +static const long _vq_quantlist__44p7_l0_0[] = {
134.7433 +	6,
134.7434 +	5,
134.7435 +	7,
134.7436 +	4,
134.7437 +	8,
134.7438 +	3,
134.7439 +	9,
134.7440 +	2,
134.7441 +	10,
134.7442 +	1,
134.7443 +	11,
134.7444 +	0,
134.7445 +	12,
134.7446 +};
134.7447 +
134.7448 +static const long _vq_lengthlist__44p7_l0_0[] = {
134.7449 +	 2, 4, 4, 7, 7, 8, 8,10,10,11,11,12,12, 4, 5, 5,
134.7450 +	 7, 7, 9, 9,11, 9,12,11,12,12, 4, 5, 5, 7, 7, 9,
134.7451 +	 9, 9,10,10,11,12,12, 7, 7, 7, 7, 8, 9, 8,11, 5,
134.7452 +	12, 6,12,10, 7, 7, 7, 8, 7, 8, 9, 5,11, 6,12,10,
134.7453 +	12, 8, 9, 9, 9, 9,10,10,11, 7,11, 7,12, 9, 8, 9,
134.7454 +	 8, 9, 9,10,10, 7,11, 7,11, 9,11,10,10,10,10,10,
134.7455 +	10,10,11,10,11, 8,11, 9,10,10,10,10,10,10,10,10,
134.7456 +	11, 8,10, 9,11,10,11,11,11,11,11,10,11,10,12,10,
134.7457 +	12,11,10,11,11,11,11,10,11,10,11,10,12,11,12,11,
134.7458 +	12,12,12,12,12,12,12,12,12,12,13,12,11,12,11,12,
134.7459 +	12,12,12,12,11,12,11,12,13,
134.7460 +};
134.7461 +
134.7462 +static const static_codebook _44p7_l0_0 = {
134.7463 +	2, 169,
134.7464 +	(long *)_vq_lengthlist__44p7_l0_0,
134.7465 +	1, -526516224, 1616117760, 4, 0,
134.7466 +	(long *)_vq_quantlist__44p7_l0_0,
134.7467 +	0
134.7468 +};
134.7469 +
134.7470 +static const long _vq_quantlist__44p7_l0_1[] = {
134.7471 +	2,
134.7472 +	1,
134.7473 +	3,
134.7474 +	0,
134.7475 +	4,
134.7476 +};
134.7477 +
134.7478 +static const long _vq_lengthlist__44p7_l0_1[] = {
134.7479 +	 4, 4, 4, 5, 5, 4, 4, 5, 5, 5, 4, 5, 4, 5, 5, 5,
134.7480 +	 5, 5, 5, 5, 5, 5, 5, 5, 5,
134.7481 +};
134.7482 +
134.7483 +static const static_codebook _44p7_l0_1 = {
134.7484 +	2, 25,
134.7485 +	(long *)_vq_lengthlist__44p7_l0_1,
134.7486 +	1, -533725184, 1611661312, 3, 0,
134.7487 +	(long *)_vq_quantlist__44p7_l0_1,
134.7488 +	0
134.7489 +};
134.7490 +
134.7491 +static const long _vq_quantlist__44p7_l1_0[] = {
134.7492 +	54,
134.7493 +	29,
134.7494 +	79,
134.7495 +	0,
134.7496 +	108,
134.7497 +};
134.7498 +
134.7499 +static const long _vq_lengthlist__44p7_l1_0[] = {
134.7500 +	 1, 2, 3, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8,
134.7501 +	 8, 8, 8, 8, 8, 8, 8, 8, 8,
134.7502 +};
134.7503 +
134.7504 +static const static_codebook _44p7_l1_0 = {
134.7505 +	2, 25,
134.7506 +	(long *)_vq_lengthlist__44p7_l1_0,
134.7507 +	1, -514516992, 1620639744, 7, 0,
134.7508 +	(long *)_vq_quantlist__44p7_l1_0,
134.7509 +	0
134.7510 +};
134.7511 +
134.7512 +static const long _huff_lengthlist__44p7_lfe[] = {
134.7513 +	 2, 3, 1, 3,
134.7514 +};
134.7515 +
134.7516 +static const static_codebook _huff_book__44p7_lfe = {
134.7517 +	2, 4,
134.7518 +	(long *)_huff_lengthlist__44p7_lfe,
134.7519 +	0, 0, 0, 0, 0,
134.7520 +	NULL,
134.7521 +	0
134.7522 +};
134.7523 +
134.7524 +static const long _huff_lengthlist__44p7_long[] = {
134.7525 +	 2, 7,14,16,17,17,18,20, 6, 3, 5, 8,10,11,13,15,
134.7526 +	13, 5, 3, 5, 8, 9,11,12,15, 7, 4, 3, 5, 7, 9,11,
134.7527 +	16,10, 7, 5, 6, 7, 9,10,17,11, 8, 7, 7, 6, 8, 8,
134.7528 +	19,13,11, 9, 9, 8, 8, 9,20,14,13,11,10, 8, 9, 9,
134.7529 +};
134.7530 +
134.7531 +static const static_codebook _huff_book__44p7_long = {
134.7532 +	2, 64,
134.7533 +	(long *)_huff_lengthlist__44p7_long,
134.7534 +	0, 0, 0, 0, 0,
134.7535 +	NULL,
134.7536 +	0
134.7537 +};
134.7538 +
134.7539 +static const long _vq_quantlist__44p7_p1_0[] = {
134.7540 +	1,
134.7541 +	0,
134.7542 +	2,
134.7543 +};
134.7544 +
134.7545 +static const long _vq_lengthlist__44p7_p1_0[] = {
134.7546 +	 2, 5, 5, 4, 7, 7, 4, 7, 7, 5, 7, 7, 7, 8, 9, 7,
134.7547 +	 9, 9, 5, 7, 7, 7, 9, 9, 7, 9, 8, 6, 7, 8, 8, 9,
134.7548 +	10, 8, 9,10, 8, 9,10,10,10,12,10,11,11, 8,10,10,
134.7549 +	10,11,12,10,11,11, 6, 8, 7, 8,10, 9, 8,10, 9, 8,
134.7550 +	10,10,10,11,11,10,12,11, 8,10, 9,10,11,11,10,12,
134.7551 +	10, 5, 8, 8, 8,10,10, 8,10,10, 7, 9,10, 9,10,11,
134.7552 +	 9,11,11, 8,10,10,10,11,12,10,12,11, 7, 9, 9, 9,
134.7553 +	10,11, 9,11,11, 9, 9,11,10,11,12,11,11,12, 9,11,
134.7554 +	11,11,12,12,11,12,12, 7, 9, 9,10,11,11,10,12,11,
134.7555 +	 9,11,10,11,11,12,11,13,12,10,11,11,12,13,13,11,
134.7556 +	13,11, 5, 8, 8, 8,10,10, 8,10,10, 8,10,10,10,11,
134.7557 +	12,10,12,11, 7,10, 9, 9,11,11, 9,11,10, 7, 9, 9,
134.7558 +	10,11,12,10,11,11,10,11,11,11,11,13,12,13,13, 9,
134.7559 +	10,11,11,12,13,11,12,11, 7, 9, 9, 9,11,11, 9,11,
134.7560 +	10, 9,11,11,11,12,12,11,12,12, 9,11, 9,11,12,11,
134.7561 +	10,12,11,
134.7562 +};
134.7563 +
134.7564 +static const static_codebook _44p7_p1_0 = {
134.7565 +	5, 243,
134.7566 +	(long *)_vq_lengthlist__44p7_p1_0,
134.7567 +	1, -535822336, 1611661312, 2, 0,
134.7568 +	(long *)_vq_quantlist__44p7_p1_0,
134.7569 +	0
134.7570 +};
134.7571 +
134.7572 +static const long _vq_quantlist__44p7_p2_0[] = {
134.7573 +	2,
134.7574 +	1,
134.7575 +	3,
134.7576 +	0,
134.7577 +	4,
134.7578 +};
134.7579 +
134.7580 +static const long _vq_lengthlist__44p7_p2_0[] = {
134.7581 +	 4, 6, 6, 9, 9, 6, 8, 8,10,10, 6, 8, 8,10,10, 8,
134.7582 +	10,10,12,13, 8,10,10,13,12, 6, 8, 8,10,10, 8, 8,
134.7583 +	 9,10,11, 8, 9, 9,11,11,10,10,11,12,13,10,11,11,
134.7584 +	13,13, 6, 8, 8,10,10, 8, 9, 9,11,11, 8, 9, 8,11,
134.7585 +	10,10,11,11,13,13,10,11,10,13,12, 9,10,10,12,12,
134.7586 +	10,10,11,12,13,10,11,11,13,13,12,12,13,12,15,13,
134.7587 +	13,13,15,14, 9,10,10,12,12,10,11,11,13,13,10,11,
134.7588 +	10,13,12,12,13,13,14,15,12,13,12,15,12, 6, 8, 8,
134.7589 +	10,11, 8, 9,10,11,12, 8, 9, 9,11,11,10,11,12,13,
134.7590 +	14,10,11,11,13,13, 8, 9, 9,11,12, 9,10,11,12,13,
134.7591 +	 9,10,10,12,13,11,12,13,13,15,11,12,12,14,14, 8,
134.7592 +	 9, 9,11,12, 9,10,11,12,13, 9,10,10,13,12,11,12,
134.7593 +	13,14,15,11,12,12,14,13,10,11,12,13,14,11,12,13,
134.7594 +	13,15,12,13,13,14,14,13,13,14,14,16,14,15,14,16,
134.7595 +	15,10,12,11,14,13,12,12,13,14,14,11,12,12,14,14,
134.7596 +	14,14,15,15,16,13,14,14,16,14, 6, 8, 8,11,10, 8,
134.7597 +	 9, 9,11,11, 8,10, 9,12,11,10,11,11,13,13,10,12,
134.7598 +	11,14,13, 8, 9, 9,12,11, 9,10,10,12,13, 9,11,10,
134.7599 +	13,12,11,12,12,14,14,11,13,12,15,14, 8, 9, 9,12,
134.7600 +	11, 9,10,10,13,12, 9,11,10,13,12,11,12,12,14,14,
134.7601 +	11,13,12,15,13,10,11,12,13,14,11,12,13,13,14,12,
134.7602 +	13,12,14,14,13,13,14,14,16,14,15,14,16,16,10,12,
134.7603 +	11,14,13,12,13,13,14,14,11,13,12,15,13,14,14,15,
134.7604 +	16,16,13,14,13,16,14, 9,10,11,12,13,11,11,12,13,
134.7605 +	14,11,11,12,13,14,13,13,14,14,16,13,14,14,15,15,
134.7606 +	11,11,12,13,14,12,12,13,13,15,12,13,13,14,15,14,
134.7607 +	14,15,15,17,14,14,15,16,16,11,12,12,13,14,12,12,
134.7608 +	13,14,15,12,13,12,14,15,14,14,15,15,17,14,15,14,
134.7609 +	16,16,13,14,14,15,16,14,14,15,15,17,14,15,15,16,
134.7610 +	16,15,16,17,16,18,16,17,16,17,17,13,14,14,16,15,
134.7611 +	14,15,15,16,16,14,15,14,16,15,16,16,17,17,18,16,
134.7612 +	16,16,17,16, 9,11,10,13,12,11,12,11,14,13,11,12,
134.7613 +	11,14,13,13,14,14,16,15,13,14,13,16,14,11,12,12,
134.7614 +	14,13,12,12,13,14,14,12,13,13,15,14,14,14,15,16,
134.7615 +	16,14,15,14,17,15,11,12,11,14,13,12,13,13,15,14,
134.7616 +	12,13,12,15,13,14,15,14,16,16,14,15,14,17,15,13,
134.7617 +	14,14,15,16,14,14,15,16,16,14,15,15,16,16,15,16,
134.7618 +	16,16,17,16,16,16,17,17,13,14,14,16,15,14,15,15,
134.7619 +	17,16,14,15,14,17,15,16,17,17,17,17,16,16,16,18,
134.7620 +	16, 6, 8, 8,11,11, 8, 9, 9,11,12, 8, 9, 9,12,11,
134.7621 +	10,11,11,13,14,10,11,11,14,13, 8, 9, 9,11,12, 9,
134.7622 +	10,10,12,13, 9,10,10,13,12,11,11,12,13,15,11,12,
134.7623 +	12,15,14, 8, 9, 9,12,11, 9,10,11,12,13, 9,11,10,
134.7624 +	13,12,11,12,12,14,15,11,13,12,15,14,10,11,11,13,
134.7625 +	14,11,12,12,13,14,11,12,12,14,14,13,13,14,14,16,
134.7626 +	13,14,14,16,15,11,12,11,14,13,12,13,13,14,14,11,
134.7627 +	13,12,14,13,14,14,15,16,16,13,14,14,16,14, 8, 9,
134.7628 +	 9,11,12, 9,10,10,12,13, 9,10,10,13,12,11,12,12,
134.7629 +	14,15,11,12,12,14,14, 9, 9,10,11,13,10,10,12,12,
134.7630 +	14,10,10,11,13,13,12,12,13,14,16,12,12,13,15,15,
134.7631 +	 9,10,10,13,12,10,11,11,13,14,10,12,11,14,13,12,
134.7632 +	13,13,15,15,12,13,13,15,15,11,11,12,13,15,12,12,
134.7633 +	13,13,15,12,13,13,14,15,14,14,15,15,17,14,15,15,
134.7634 +	16,16,11,13,12,15,14,13,13,13,15,15,12,14,13,15,
134.7635 +	14,15,15,15,16,16,14,15,15,17,15, 7, 9, 9,12,11,
134.7636 +	 9,10,10,12,12, 9,11,10,13,12,11,12,12,14,14,11,
134.7637 +	13,12,15,14, 9,10,10,12,12,10,10,11,12,13,10,11,
134.7638 +	11,14,13,12,12,13,14,15,12,13,13,15,14, 9,10,10,
134.7639 +	12,12,10,11,11,13,13,10,11,10,14,12,12,13,13,15,
134.7640 +	15,12,13,12,15,13,11,12,12,14,14,12,12,13,14,15,
134.7641 +	12,13,13,15,15,14,13,14,13,16,14,15,15,16,16,11,
134.7642 +	12,12,14,14,13,13,14,15,15,12,13,12,15,14,15,15,
134.7643 +	15,16,16,14,15,14,17,14,10,11,12,13,14,11,12,13,
134.7644 +	14,15,11,12,12,14,15,13,14,15,15,17,14,14,14,16,
134.7645 +	16,11,12,13,12,15,12,12,14,13,16,13,13,14,13,16,
134.7646 +	14,14,15,14,17,15,15,15,15,17,11,13,12,15,15,13,
134.7647 +	13,14,15,16,12,14,13,16,15,15,15,15,17,17,15,15,
134.7648 +	15,17,16,14,14,15,14,16,14,14,16,14,17,15,15,15,
134.7649 +	14,17,16,16,17,15,18,17,17,17,16,18,14,15,15,17,
134.7650 +	16,15,16,16,17,17,15,16,15,17,16,17,17,17,18,18,
134.7651 +	16,17,16,18,17,10,11,11,14,13,11,12,12,14,14,11,
134.7652 +	13,12,15,14,14,14,14,16,16,14,15,14,16,15,11,12,
134.7653 +	12,15,13,12,13,13,15,14,13,14,13,16,14,14,15,15,
134.7654 +	16,16,15,16,15,17,16,11,13,12,15,14,13,13,14,15,
134.7655 +	15,12,14,13,16,14,15,15,15,17,17,14,16,15,17,16,
134.7656 +	14,14,14,16,15,14,15,15,16,16,15,16,15,17,16,16,
134.7657 +	16,16,16,17,16,17,17,18,17,14,15,15,16,16,15,15,
134.7658 +	16,17,16,14,15,15,17,16,17,17,17,18,18,16,17,16,
134.7659 +	18,16, 6, 8, 8,11,11, 8, 9, 9,11,12, 8, 9, 9,12,
134.7660 +	11,10,11,12,13,14,10,11,11,14,13, 8, 9, 9,11,12,
134.7661 +	 9,10,11,12,13, 9,11,10,13,12,11,12,13,14,15,11,
134.7662 +	12,12,15,14, 8, 9, 9,12,11, 9,10,10,12,13, 9,10,
134.7663 +	10,13,12,11,12,12,14,15,11,12,12,14,13,11,11,12,
134.7664 +	13,14,11,12,13,13,15,12,13,13,14,14,13,14,14,14,
134.7665 +	16,14,15,14,16,16,10,11,11,14,13,11,12,12,14,14,
134.7666 +	11,12,12,14,13,13,14,14,15,16,13,14,13,16,14, 7,
134.7667 +	 9, 9,11,11, 9,10,11,12,13, 9,10,10,12,12,11,12,
134.7668 +	13,14,15,11,12,12,14,14, 9,10,10,12,12,10,10,11,
134.7669 +	12,13,10,11,11,13,13,12,12,13,13,15,12,13,13,15,
134.7670 +	15, 9,10,10,12,12,10,11,11,13,13,10,11,10,13,12,
134.7671 +	12,13,13,14,15,12,13,12,15,13,11,12,12,14,14,12,
134.7672 +	12,13,14,15,13,14,13,15,15,14,13,15,13,16,15,15,
134.7673 +	15,16,16,11,12,12,14,14,12,13,13,14,15,12,13,12,
134.7674 +	15,14,14,15,15,16,17,13,14,13,16,13, 8, 9, 9,12,
134.7675 +	11, 9,10,10,12,13, 9,10,10,13,12,11,12,12,14,15,
134.7676 +	11,12,12,15,14, 9,10,10,12,13,10,11,12,13,14,10,
134.7677 +	11,11,14,13,12,13,13,15,15,12,13,13,15,15, 9,10,
134.7678 +	 9,13,11,10,11,10,13,13,10,12,10,14,12,12,13,12,
134.7679 +	15,15,12,13,12,15,14,11,12,13,14,15,12,13,14,14,
134.7680 +	15,13,13,13,15,15,14,15,15,15,17,15,15,15,16,16,
134.7681 +	11,12,11,15,13,12,13,13,15,14,12,13,12,16,13,14,
134.7682 +	15,15,16,16,14,15,14,17,14,10,11,11,13,14,11,12,
134.7683 +	13,14,15,11,12,12,14,14,14,14,15,15,17,14,14,14,
134.7684 +	15,16,11,12,13,14,15,12,13,14,14,16,13,14,13,15,
134.7685 +	15,14,15,16,15,17,15,15,15,17,17,11,12,12,13,15,
134.7686 +	13,13,14,14,16,12,13,13,14,15,15,15,15,16,17,14,
134.7687 +	15,15,16,16,14,15,15,16,16,14,15,15,16,17,15,15,
134.7688 +	16,16,17,16,16,17,16,18,17,17,17,18,18,14,14,15,
134.7689 +	15,16,15,15,15,16,17,14,15,15,16,16,16,17,17,17,
134.7690 +	18,16,16,16,17,16,10,11,11,14,13,11,13,12,15,14,
134.7691 +	11,13,12,15,14,14,15,14,16,16,13,15,14,17,15,11,
134.7692 +	12,13,15,15,12,13,14,15,16,13,14,13,16,15,15,15,
134.7693 +	15,16,17,15,15,15,17,16,11,13,11,15,12,13,14,13,
134.7694 +	16,13,12,14,12,16,13,15,15,15,17,15,14,16,14,17,
134.7695 +	14,14,15,15,16,17,15,15,16,16,17,15,16,15,17,17,
134.7696 +	16,16,17,17,18,16,17,17,18,18,14,15,14,17,13,15,
134.7697 +	16,15,17,15,15,16,15,17,14,16,17,16,18,16,16,17,
134.7698 +	16,18,15, 9,11,11,13,13,10,12,12,14,14,11,12,12,
134.7699 +	14,14,13,14,14,15,16,13,14,14,16,16,10,11,12,14,
134.7700 +	14,11,12,13,14,15,11,13,13,15,15,13,14,14,15,16,
134.7701 +	14,15,15,16,16,11,12,12,14,14,12,13,13,15,15,12,
134.7702 +	13,12,15,14,14,15,15,16,16,14,15,14,17,16,12,13,
134.7703 +	13,15,16,13,13,14,15,16,13,14,14,16,16,14,15,16,
134.7704 +	16,17,15,16,16,17,17,13,14,14,16,15,14,15,15,17,
134.7705 +	16,14,15,14,17,15,16,16,17,17,17,16,16,16,18,16,
134.7706 +	10,11,12,14,14,11,12,13,14,15,11,13,12,15,15,13,
134.7707 +	14,15,16,16,14,15,15,17,16,11,11,13,14,15,12,12,
134.7708 +	14,14,16,12,13,14,15,15,14,14,15,16,17,15,15,15,
134.7709 +	17,17,12,13,12,15,15,13,14,14,16,15,13,14,13,16,
134.7710 +	15,15,16,15,17,17,15,16,15,17,16,13,12,15,14,16,
134.7711 +	14,13,15,14,17,14,13,15,15,17,15,14,17,15,18,16,
134.7712 +	15,17,17,18,14,15,15,17,16,15,16,16,17,17,15,16,
134.7713 +	15,17,16,16,17,17,18,18,16,17,16,18,17,10,11,11,
134.7714 +	14,14,11,12,12,14,15,11,13,12,15,14,13,14,14,16,
134.7715 +	16,14,15,14,16,16,11,12,12,14,14,12,12,13,15,15,
134.7716 +	12,13,13,15,15,14,14,15,16,16,14,15,15,17,16,11,
134.7717 +	12,12,15,15,13,13,13,15,15,12,13,13,15,15,15,15,
134.7718 +	15,17,17,14,15,15,17,16,13,14,13,16,15,14,14,14,
134.7719 +	16,16,14,15,14,17,16,15,15,16,16,17,16,17,16,18,
134.7720 +	17,14,15,15,16,16,15,15,15,17,17,14,15,15,17,16,
134.7721 +	16,17,17,18,18,16,17,16,18,16,12,13,13,15,15,13,
134.7722 +	14,14,16,16,13,14,14,16,16,14,15,16,16,18,15,16,
134.7723 +	16,17,17,13,13,14,14,16,14,14,15,15,17,14,14,15,
134.7724 +	15,17,15,15,17,15,18,16,16,17,17,18,13,14,14,16,
134.7725 +	16,14,15,15,16,17,14,15,15,17,16,16,17,16,17,18,
134.7726 +	16,17,16,18,17,15,14,16,13,18,16,15,17,14,18,16,
134.7727 +	15,17,14,18,17,16,18,15,19,17,17,18,16,19,15,16,
134.7728 +	16,17,17,16,17,17,18,18,16,17,16,18,17,18,18,18,
134.7729 +	19,18,17,18,17,19,17,11,12,12,15,15,13,13,14,15,
134.7730 +	16,13,14,13,16,15,15,15,15,16,17,15,16,15,17,16,
134.7731 +	12,13,13,15,15,13,13,14,15,16,14,15,14,16,15,15,
134.7732 +	15,16,16,17,16,16,16,18,17,12,13,13,15,15,14,14,
134.7733 +	15,16,16,13,14,13,16,15,16,16,16,17,17,15,16,15,
134.7734 +	18,16,15,15,15,17,15,14,15,15,16,16,16,17,16,17,
134.7735 +	16,16,16,17,16,17,17,18,17,19,18,15,15,16,17,17,
134.7736 +	16,16,16,17,17,15,16,15,17,16,17,18,18,18,18,16,
134.7737 +	17,16,18,16, 9,11,11,13,13,11,12,12,14,14,10,12,
134.7738 +	12,14,14,13,14,14,15,16,13,14,14,16,15,11,12,12,
134.7739 +	14,14,12,12,13,14,15,12,13,13,15,15,14,14,15,16,
134.7740 +	17,14,15,15,16,16,10,12,11,14,14,11,13,13,15,15,
134.7741 +	11,13,12,15,14,14,14,15,16,16,13,14,14,16,15,13,
134.7742 +	14,14,15,16,14,14,15,15,17,14,15,15,16,17,16,16,
134.7743 +	16,16,18,16,16,17,17,17,12,13,13,16,15,13,14,14,
134.7744 +	16,16,12,14,13,16,15,15,16,16,17,17,14,16,15,17,
134.7745 +	16,10,11,11,14,14,11,12,13,14,15,11,12,12,15,14,
134.7746 +	14,14,15,16,16,13,14,14,16,16,11,12,12,14,15,12,
134.7747 +	13,14,15,15,13,13,13,15,15,14,15,15,16,17,15,15,
134.7748 +	15,16,17,11,12,12,14,14,12,13,13,15,15,12,13,12,
134.7749 +	15,15,14,15,15,16,17,14,15,14,16,16,14,14,15,16,
134.7750 +	16,14,15,15,16,17,15,16,15,17,17,16,16,17,16,18,
134.7751 +	16,17,17,18,18,13,13,14,15,16,14,14,15,16,17,14,
134.7752 +	14,14,16,15,16,16,17,17,18,15,16,15,17,16,10,12,
134.7753 +	11,14,14,11,13,13,15,15,11,13,12,15,15,14,15,15,
134.7754 +	16,16,13,15,14,16,16,12,12,13,15,15,13,13,14,15,
134.7755 +	16,13,14,14,16,15,15,15,16,16,17,15,15,15,17,17,
134.7756 +	11,13,11,15,14,12,14,13,16,15,12,14,12,16,14,15,
134.7757 +	15,15,17,17,14,15,14,17,15,14,15,15,16,17,15,15,
134.7758 +	16,16,17,15,16,16,17,17,16,16,17,17,18,16,17,17,
134.7759 +	18,18,13,14,12,16,14,14,15,13,17,15,14,15,13,17,
134.7760 +	14,16,17,15,18,17,15,17,14,18,15,11,12,12,14,15,
134.7761 +	13,13,14,15,16,13,14,13,16,15,15,15,16,16,17,15,
134.7762 +	15,15,16,16,12,13,13,15,15,13,13,14,15,16,14,15,
134.7763 +	14,16,16,15,15,16,16,18,16,16,16,18,17,12,13,13,
134.7764 +	15,15,14,14,15,15,16,13,14,13,15,15,16,16,16,17,
134.7765 +	18,15,16,15,17,16,15,16,15,17,16,15,15,16,16,17,
134.7766 +	16,17,16,17,17,16,16,17,16,18,17,18,18,18,18,14,
134.7767 +	15,15,15,17,16,15,17,16,17,14,15,15,16,16,17,17,
134.7768 +	18,18,19,16,16,16,17,16,12,13,13,15,15,13,14,14,
134.7769 +	16,16,13,14,14,16,16,15,16,16,17,17,15,16,15,18,
134.7770 +	16,13,14,14,16,16,14,15,15,16,17,14,15,15,17,16,
134.7771 +	16,16,17,17,18,16,17,16,18,18,13,14,13,16,14,14,
134.7772 +	15,14,17,15,14,15,14,17,14,16,17,16,18,17,15,17,
134.7773 +	15,18,15,15,16,16,17,18,16,16,17,17,18,16,17,17,
134.7774 +	17,18,17,17,18,18,19,17,18,18,19,18,15,16,14,17,
134.7775 +	13,16,17,15,18,14,16,17,15,18,14,18,18,17,19,16,
134.7776 +	17,18,16,19,15,
134.7777 +};
134.7778 +
134.7779 +static const static_codebook _44p7_p2_0 = {
134.7780 +	5, 3125,
134.7781 +	(long *)_vq_lengthlist__44p7_p2_0,
134.7782 +	1, -533725184, 1611661312, 3, 0,
134.7783 +	(long *)_vq_quantlist__44p7_p2_0,
134.7784 +	0
134.7785 +};
134.7786 +
134.7787 +static const long _vq_quantlist__44p7_p3_0[] = {
134.7788 +	1,
134.7789 +	0,
134.7790 +	2,
134.7791 +};
134.7792 +
134.7793 +static const long _vq_lengthlist__44p7_p3_0[] = {
134.7794 +	 2, 5, 5, 4, 7, 7, 4, 7, 7, 5, 7, 8, 7, 8,10, 8,
134.7795 +	 9, 9, 5, 7, 7, 8, 9, 9, 7,10, 8, 5, 7, 8, 8, 9,
134.7796 +	10, 8,10,10, 8, 9,10,10,10,12,10,12,12, 8,10,10,
134.7797 +	10,12,12,10,12,11, 5, 8, 7, 8,10,10, 8,10, 9, 8,
134.7798 +	10,10,10,11,12,10,12,12, 8,10, 9,10,12,12,10,12,
134.7799 +	10, 5, 8, 8, 7,10,10, 8,10,10, 7, 9,10, 9,10,12,
134.7800 +	10,12,12, 8,10,10,10,12,12,10,12,11, 7, 9,10, 9,
134.7801 +	11,12,10,12,11, 9, 9,12,11,10,14,12,12,13,10,12,
134.7802 +	11,12,13,13,11,14,12, 7,10, 9,10,11,11,10,12,11,
134.7803 +	 9,11,11,11,11,13,12,14,13,10,12,12,12,14,14,11,
134.7804 +	14,12, 5, 8, 8, 8,10,10, 7,10,10, 8,10,10,10,11,
134.7805 +	12,10,12,12, 7,10, 9,10,12,12, 9,12,10, 7, 9,10,
134.7806 +	10,11,12,10,11,11,10,12,12,11,12,14,12,14,14, 9,
134.7807 +	11,11,12,13,14,11,13,11, 7,10, 9,10,11,12, 9,12,
134.7808 +	11,10,11,12,11,12,14,12,13,13, 9,12, 9,12,13,12,
134.7809 +	11,14,10,
134.7810 +};
134.7811 +
134.7812 +static const static_codebook _44p7_p3_0 = {
134.7813 +	5, 243,
134.7814 +	(long *)_vq_lengthlist__44p7_p3_0,
134.7815 +	1, -533200896, 1614282752, 2, 0,
134.7816 +	(long *)_vq_quantlist__44p7_p3_0,
134.7817 +	0
134.7818 +};
134.7819 +
134.7820 +static const long _vq_quantlist__44p7_p3_1[] = {
134.7821 +	1,
134.7822 +	0,
134.7823 +	2,
134.7824 +};
134.7825 +
134.7826 +static const long _vq_lengthlist__44p7_p3_1[] = {
134.7827 +	 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 7, 8, 8, 7,
134.7828 +	 8, 8, 7, 8, 7, 7, 8, 8, 7, 8, 8, 7, 8, 8, 8, 8,
134.7829 +	 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 8, 8, 9, 8, 8, 8,
134.7830 +	 8, 8, 8, 8, 9, 8, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8,
134.7831 +	 8, 8, 8, 8, 9, 8, 8, 8, 8, 8, 8, 8, 9, 8, 8, 9,
134.7832 +	 8, 7, 8, 8, 7, 8, 8, 7, 8, 8, 7, 8, 8, 8, 8, 8,
134.7833 +	 8, 8, 8, 8, 8, 8, 8, 9, 8, 8, 9, 8, 7, 8, 8, 8,
134.7834 +	 8, 9, 8, 8, 8, 8, 8, 8, 8, 8, 9, 8, 9, 9, 8, 8,
134.7835 +	 8, 9, 9, 9, 8, 9, 9, 7, 8, 8, 8, 8, 8, 8, 8, 8,
134.7836 +	 8, 8, 8, 8, 8, 9, 8, 9, 9, 8, 8, 8, 8, 9, 9, 8,
134.7837 +	 9, 8, 7, 8, 8, 7, 8, 8, 7, 8, 8, 8, 8, 8, 8, 8,
134.7838 +	 9, 8, 8, 9, 7, 8, 8, 8, 8, 8, 8, 8, 8, 7, 8, 8,
134.7839 +	 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 8, 9, 9, 8,
134.7840 +	 8, 8, 8, 9, 9, 8, 9, 8, 7, 8, 8, 8, 8, 8, 8, 9,
134.7841 +	 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 8, 8, 8, 8, 9, 9,
134.7842 +	 8, 9, 8,
134.7843 +};
134.7844 +
134.7845 +static const static_codebook _44p7_p3_1 = {
134.7846 +	5, 243,
134.7847 +	(long *)_vq_lengthlist__44p7_p3_1,
134.7848 +	1, -535822336, 1611661312, 2, 0,
134.7849 +	(long *)_vq_quantlist__44p7_p3_1,
134.7850 +	0
134.7851 +};
134.7852 +
134.7853 +static const long _vq_quantlist__44p7_p4_0[] = {
134.7854 +	1,
134.7855 +	0,
134.7856 +	2,
134.7857 +};
134.7858 +
134.7859 +static const long _vq_lengthlist__44p7_p4_0[] = {
134.7860 +	 1, 5, 5, 5, 7, 8, 5, 8, 7, 5, 7, 8, 7, 8,10, 8,
134.7861 +	10,10, 5, 8, 7, 8,10,10, 7,10, 8, 6, 8, 9, 9,10,
134.7862 +	12, 9,11,11, 9,10,11,11,11,13,11,13,13, 9,11,11,
134.7863 +	11,12,13,11,13,11, 6, 9, 8, 9,11,11, 9,12,10, 9,
134.7864 +	11,11,11,11,13,11,13,13, 9,11,10,11,13,13,11,13,
134.7865 +	11, 6, 9, 9, 8,10,11, 9,12,11, 8,10,11,10,11,13,
134.7866 +	11,13,13, 9,11,11,11,13,12,11,13,11, 8,10,10, 9,
134.7867 +	11,12,10,12,12,10,10,12,11,11,14,12,13,14,10,12,
134.7868 +	12,12,13,13,11,14,11, 8,11,10,11,12,13,11,14,12,
134.7869 +	10,12,11,11,12,14,13,15,14,10,12,12,13,14,15,12,
134.7870 +	14,12, 5, 9, 9, 9,11,12, 8,11,10, 9,11,11,11,11,
134.7871 +	13,11,12,13, 8,11,10,11,13,13,10,13,11, 8,10,11,
134.7872 +	11,12,14,11,13,12,10,12,12,12,12,14,14,15,14,10,
134.7873 +	11,12,13,14,15,11,14,12, 8,10,10,10,12,12, 9,12,
134.7874 +	11,10,12,12,11,11,14,12,13,13,10,12,10,12,14,13,
134.7875 +	11,13,11,
134.7876 +};
134.7877 +
134.7878 +static const static_codebook _44p7_p4_0 = {
134.7879 +	5, 243,
134.7880 +	(long *)_vq_lengthlist__44p7_p4_0,
134.7881 +	1, -531365888, 1616117760, 2, 0,
134.7882 +	(long *)_vq_quantlist__44p7_p4_0,
134.7883 +	0
134.7884 +};
134.7885 +
134.7886 +static const long _vq_quantlist__44p7_p4_1[] = {
134.7887 +	2,
134.7888 +	1,
134.7889 +	3,
134.7890 +	0,
134.7891 +	4,
134.7892 +};
134.7893 +
134.7894 +static const long _vq_lengthlist__44p7_p4_1[] = {
134.7895 +	 7, 8, 8,10,10, 8, 9, 9,10,11, 8, 9, 9,10,10, 9,
134.7896 +	10,10,11,11, 9,10,10,11,11, 8, 9, 9,10,10, 9, 9,
134.7897 +	10,11,11, 9,10,10,11,11,10,10,11,11,11,10,11,11,
134.7898 +	11,11, 8, 9, 9,10,10, 9,10,10,11,11, 9,10, 9,11,
134.7899 +	11,10,11,11,11,11,10,11,10,11,11,10,10,10,11,11,
134.7900 +	10,11,11,11,11,10,11,11,11,11,11,11,11,11,12,11,
134.7901 +	11,11,11,12,10,10,10,11,11,10,11,11,11,11,10,11,
134.7902 +	11,11,11,11,11,11,12,11,11,11,11,12,11, 8, 9,10,
134.7903 +	11,11, 9,10,11,11,11, 9,10,10,11,11,10,11,11,12,
134.7904 +	12,10,11,11,12,12,10,10,10,11,11,10,10,11,11,12,
134.7905 +	10,11,11,12,12,11,11,12,12,12,11,11,12,12,12,10,
134.7906 +	10,10,11,11,10,11,11,12,12,10,11,11,12,11,11,12,
134.7907 +	12,12,12,11,12,11,12,12,11,11,11,11,12,11,11,12,
134.7908 +	12,12,11,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.7909 +	12,11,11,11,12,12,11,12,12,12,12,11,12,11,12,12,
134.7910 +	12,12,12,12,12,12,12,12,12,12, 8,10, 9,11,11, 9,
134.7911 +	10,10,11,11, 9,10,10,11,11,10,11,11,12,12,10,11,
134.7912 +	11,12,12,10,10,10,11,11,10,11,11,12,12,10,11,11,
134.7913 +	12,12,11,11,12,12,12,11,12,12,12,12,10,10,10,11,
134.7914 +	11,10,11,11,12,12,10,11,10,12,11,11,12,11,12,12,
134.7915 +	11,12,11,12,12,11,11,11,12,12,11,12,12,12,12,11,
134.7916 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,11,11,
134.7917 +	11,12,11,11,12,12,12,12,11,12,11,12,12,12,12,12,
134.7918 +	12,12,12,12,12,12,12,10,11,11,11,12,11,11,12,12,
134.7919 +	12,11,11,11,12,12,11,12,12,12,12,11,12,12,12,12,
134.7920 +	11,11,12,12,12,11,12,12,12,12,12,12,12,12,12,12,
134.7921 +	12,13,12,13,12,12,12,13,13,11,12,11,12,12,11,12,
134.7922 +	12,12,12,11,12,12,12,12,12,12,12,13,13,12,12,12,
134.7923 +	13,13,12,12,12,12,12,12,12,12,12,13,12,12,13,13,
134.7924 +	13,12,13,13,13,13,12,13,13,13,13,12,12,12,12,12,
134.7925 +	12,12,13,13,13,12,12,12,13,12,12,13,13,13,13,12,
134.7926 +	13,13,13,13,10,11,11,12,11,11,11,11,12,12,11,12,
134.7927 +	11,12,12,11,12,12,12,12,11,12,12,12,12,11,11,11,
134.7928 +	12,12,11,12,12,12,12,12,12,12,12,12,12,12,12,13,
134.7929 +	13,12,12,12,13,13,11,12,11,12,12,12,12,12,12,12,
134.7930 +	11,12,11,12,12,12,12,12,13,13,12,12,12,13,12,12,
134.7931 +	12,12,12,12,12,12,12,13,13,12,12,12,13,13,12,13,
134.7932 +	13,13,13,12,13,13,13,13,12,12,12,12,12,12,12,12,
134.7933 +	13,13,12,13,12,13,12,12,13,13,13,13,13,13,13,13,
134.7934 +	13, 8,10,10,11,11, 9,10,10,11,11, 9,10,10,11,11,
134.7935 +	10,11,11,12,12,10,11,11,12,12, 9,10,10,11,11,10,
134.7936 +	10,11,11,12,10,11,11,12,12,11,11,12,12,12,11,11,
134.7937 +	12,12,12,10,10,10,11,11,10,11,11,12,12,10,11,10,
134.7938 +	12,11,11,12,11,12,12,11,12,11,12,12,11,11,11,12,
134.7939 +	12,11,11,12,12,12,11,12,12,12,12,11,12,12,12,12,
134.7940 +	12,12,12,12,12,11,11,11,12,11,11,12,12,12,12,11,
134.7941 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12, 9,10,
134.7942 +	10,11,11,10,11,11,11,12,10,11,11,12,12,11,11,11,
134.7943 +	12,12,11,11,11,12,12,10,10,11,11,12,11,11,12,12,
134.7944 +	12,11,11,11,12,12,11,11,12,12,12,11,12,12,12,12,
134.7945 +	10,11,11,12,12,11,11,11,12,12,11,12,11,12,12,11,
134.7946 +	12,12,12,12,11,12,12,12,12,11,11,12,12,12,11,12,
134.7947 +	12,12,12,12,12,12,12,12,12,12,12,12,13,12,12,12,
134.7948 +	12,13,11,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.7949 +	12,12,12,12,12,12,12,12,12,13,12, 9,10,10,11,11,
134.7950 +	10,11,11,12,12,10,11,11,12,11,11,12,11,12,12,11,
134.7951 +	12,11,12,12,10,11,11,12,12,11,11,11,12,12,11,12,
134.7952 +	11,12,12,11,12,12,12,12,12,12,12,12,12,10,11,11,
134.7953 +	12,12,11,12,11,12,12,11,12,11,12,12,12,12,12,13,
134.7954 +	12,12,12,12,12,12,11,12,11,12,12,11,12,12,12,12,
134.7955 +	12,12,12,12,12,12,12,12,12,13,12,12,12,12,13,11,
134.7956 +	12,12,12,12,12,12,12,13,12,11,12,12,12,12,12,12,
134.7957 +	12,13,12,12,12,12,13,12,10,11,11,12,12,11,12,12,
134.7958 +	12,12,11,12,12,12,12,12,12,12,12,13,12,12,12,13,
134.7959 +	13,11,11,12,12,12,12,12,12,12,13,12,12,12,12,12,
134.7960 +	12,12,13,12,13,12,12,13,13,13,11,12,12,12,12,12,
134.7961 +	12,12,13,13,12,12,12,13,12,12,13,12,13,13,12,13,
134.7962 +	12,13,13,12,12,12,12,12,12,12,13,12,13,12,13,13,
134.7963 +	13,13,13,13,13,13,13,13,13,13,13,13,12,12,12,13,
134.7964 +	13,12,13,13,13,13,12,13,13,13,13,13,13,13,13,13,
134.7965 +	13,13,13,13,13,10,11,11,12,12,11,12,12,12,12,11,
134.7966 +	12,12,12,12,12,12,12,13,13,12,12,12,13,13,11,12,
134.7967 +	12,12,12,12,12,12,12,13,12,12,12,13,12,12,12,13,
134.7968 +	13,13,12,13,13,13,13,11,12,12,12,12,12,12,12,13,
134.7969 +	13,12,12,12,13,12,12,13,13,13,13,12,13,12,13,13,
134.7970 +	12,12,12,12,12,12,13,13,13,13,12,13,13,13,13,13,
134.7971 +	13,13,13,13,13,13,13,13,13,12,12,12,13,12,12,13,
134.7972 +	13,13,13,12,13,13,13,13,13,13,13,13,13,13,13,13,
134.7973 +	13,13, 8,10,10,11,11, 9,10,10,11,11, 9,10,10,11,
134.7974 +	11,10,11,11,12,12,10,11,11,12,12,10,10,10,11,11,
134.7975 +	10,11,11,11,12,10,11,11,12,12,11,11,12,12,12,11,
134.7976 +	11,12,12,12, 9,10,10,11,11,10,11,11,12,12,10,11,
134.7977 +	10,12,11,11,12,11,12,12,11,12,11,12,12,11,11,11,
134.7978 +	12,12,11,11,12,12,12,11,12,12,12,12,12,12,12,12,
134.7979 +	12,12,12,12,12,12,11,11,11,12,11,11,12,12,12,12,
134.7980 +	11,12,11,12,12,12,12,12,12,12,12,12,12,12,12, 9,
134.7981 +	10,10,11,11,10,11,11,12,12,10,11,11,12,12,11,11,
134.7982 +	12,12,12,11,12,12,12,12,10,11,11,12,12,11,11,12,
134.7983 +	12,12,11,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.7984 +	12,10,11,11,12,12,11,11,12,12,12,11,11,11,12,12,
134.7985 +	12,12,12,12,12,11,12,12,12,12,11,12,12,12,12,12,
134.7986 +	12,12,12,12,12,12,12,12,12,12,12,13,12,13,12,12,
134.7987 +	12,13,12,11,12,12,12,12,12,12,12,12,12,11,12,12,
134.7988 +	12,12,12,12,12,13,12,12,12,12,13,12, 9,10,10,11,
134.7989 +	11,10,11,11,12,12,10,11,11,12,12,11,11,11,12,12,
134.7990 +	11,12,11,12,12,10,11,11,12,12,11,11,12,12,12,11,
134.7991 +	11,11,12,12,11,12,12,12,12,11,12,12,12,12,10,11,
134.7992 +	10,12,11,11,11,11,12,12,11,12,11,12,12,11,12,12,
134.7993 +	12,12,11,12,11,12,12,11,12,12,12,12,12,12,12,12,
134.7994 +	12,12,12,12,12,12,12,12,12,12,13,12,12,12,12,13,
134.7995 +	11,12,11,12,12,12,12,12,12,12,11,12,12,12,12,12,
134.7996 +	12,12,13,12,12,12,12,13,12,10,11,11,12,12,11,12,
134.7997 +	12,12,12,11,12,12,12,12,12,12,12,13,13,12,12,12,
134.7998 +	13,13,11,12,12,12,12,12,12,12,12,13,12,12,12,13,
134.7999 +	13,12,12,13,13,13,12,13,13,13,13,11,12,12,12,12,
134.8000 +	12,12,12,12,13,12,12,12,12,12,12,13,13,13,13,12,
134.8001 +	13,12,13,13,12,12,12,12,13,12,13,13,13,13,12,13,
134.8002 +	13,13,13,13,13,13,13,13,13,13,13,13,13,12,12,12,
134.8003 +	12,12,12,13,13,13,13,12,13,12,13,13,13,13,13,13,
134.8004 +	13,13,13,13,13,13,11,11,11,12,12,11,12,12,12,12,
134.8005 +	11,12,12,12,12,12,12,12,13,13,12,12,12,13,12,11,
134.8006 +	12,12,12,12,12,12,12,13,13,12,12,12,13,13,12,12,
134.8007 +	13,13,13,12,13,13,13,13,11,12,11,12,12,12,12,12,
134.8008 +	13,12,12,12,12,13,12,12,13,12,13,13,12,13,12,13,
134.8009 +	12,12,12,12,12,13,12,12,13,13,13,12,13,13,13,13,
134.8010 +	13,13,13,13,13,13,13,13,13,13,12,12,12,12,12,12,
134.8011 +	13,13,13,13,12,13,12,13,12,13,13,13,13,13,13,13,
134.8012 +	13,13,13,10,11,11,12,12,10,11,11,12,12,10,11,11,
134.8013 +	12,12,11,12,12,12,12,11,12,12,12,12,11,11,11,12,
134.8014 +	12,11,11,12,12,12,11,12,12,12,12,12,12,12,13,13,
134.8015 +	12,12,12,13,13,11,11,11,12,12,11,12,12,12,12,11,
134.8016 +	12,11,13,12,12,12,12,13,13,12,12,12,13,13,11,12,
134.8017 +	12,12,12,12,12,12,12,13,12,12,12,13,13,12,12,13,
134.8018 +	13,13,12,13,12,13,13,11,12,12,12,12,12,12,12,13,
134.8019 +	12,12,12,12,13,12,12,13,13,13,13,12,13,13,13,13,
134.8020 +	10,11,11,12,12,11,12,12,12,12,11,12,12,12,12,12,
134.8021 +	12,12,13,13,12,12,12,13,13,11,11,12,12,12,11,12,
134.8022 +	12,12,13,12,12,12,13,13,12,12,13,13,13,12,12,13,
134.8023 +	13,13,11,12,12,12,12,12,12,12,13,13,12,12,12,13,
134.8024 +	13,12,13,13,13,13,12,13,12,13,13,12,12,12,12,13,
134.8025 +	12,12,13,12,13,12,12,13,13,13,12,12,13,13,13,12,
134.8026 +	13,13,13,13,12,12,12,12,13,12,12,13,13,13,12,12,
134.8027 +	12,13,13,13,13,13,13,13,12,13,13,13,13,10,11,11,
134.8028 +	12,12,11,12,12,12,12,11,12,12,12,12,12,12,12,13,
134.8029 +	13,12,12,12,13,13,11,12,12,12,12,11,12,12,12,13,
134.8030 +	12,12,12,13,13,12,12,13,13,13,12,13,13,13,13,11,
134.8031 +	12,12,12,12,12,12,12,13,13,12,12,12,13,12,12,13,
134.8032 +	12,13,13,12,13,12,13,13,12,12,12,12,12,12,12,12,
134.8033 +	13,13,12,13,12,13,13,12,13,13,13,13,13,13,13,13,
134.8034 +	13,12,12,12,13,12,12,13,13,13,13,12,13,12,13,13,
134.8035 +	13,13,13,13,13,13,13,13,13,13,11,11,11,12,12,11,
134.8036 +	12,12,12,12,11,12,12,12,12,12,12,12,13,13,12,12,
134.8037 +	12,13,13,11,12,12,12,12,12,12,12,12,13,12,12,12,
134.8038 +	13,13,12,12,13,13,13,12,12,13,13,13,11,12,12,12,
134.8039 +	12,12,12,12,13,13,12,12,12,13,13,12,13,13,13,13,
134.8040 +	12,13,12,13,13,12,12,12,12,12,12,12,13,12,13,12,
134.8041 +	13,13,13,13,12,13,13,12,13,13,13,13,13,13,12,12,
134.8042 +	12,12,12,12,13,13,13,13,12,13,12,13,13,13,13,13,
134.8043 +	13,13,13,13,13,13,13,10,11,11,12,12,11,12,12,12,
134.8044 +	13,11,12,12,13,12,12,12,12,13,13,12,12,12,13,13,
134.8045 +	11,12,12,12,12,12,12,12,13,13,12,13,12,13,13,12,
134.8046 +	12,13,13,13,12,13,13,13,13,11,12,12,12,13,12,12,
134.8047 +	12,13,13,12,12,12,13,12,12,13,13,13,13,12,13,12,
134.8048 +	13,13,12,12,12,12,12,12,12,13,13,13,12,13,13,13,
134.8049 +	13,13,13,13,13,13,13,13,13,13,13,12,12,12,13,12,
134.8050 +	12,13,13,13,13,12,13,12,13,13,13,13,13,13,13,13,
134.8051 +	13,13,13,13,10,11,11,12,12,10,11,11,12,12,10,11,
134.8052 +	11,12,12,11,12,12,12,12,11,12,12,12,12,11,11,11,
134.8053 +	12,12,11,11,12,12,13,11,12,12,12,12,12,12,12,13,
134.8054 +	13,12,12,12,13,13,10,11,11,12,12,11,12,12,12,12,
134.8055 +	11,12,11,12,12,12,12,12,13,13,12,12,12,13,12,11,
134.8056 +	12,12,12,12,12,12,12,12,13,12,12,12,13,13,12,12,
134.8057 +	13,13,13,12,13,13,13,13,11,12,12,12,12,12,12,12,
134.8058 +	13,13,12,12,12,13,12,12,13,13,13,13,12,13,12,13,
134.8059 +	13,10,11,11,12,12,11,12,12,12,12,11,12,12,12,12,
134.8060 +	12,12,12,13,13,12,12,12,13,13,11,12,12,12,12,12,
134.8061 +	12,12,12,13,12,12,12,13,13,12,12,13,13,13,12,12,
134.8062 +	13,13,13,11,12,12,12,12,12,12,12,13,13,11,12,12,
134.8063 +	13,12,12,13,13,13,13,12,13,12,13,13,12,12,12,12,
134.8064 +	13,12,12,13,13,13,12,13,13,13,13,13,13,13,13,13,
134.8065 +	13,13,13,13,13,12,12,12,13,12,12,12,13,13,13,12,
134.8066 +	12,12,13,13,13,13,13,13,13,12,13,13,13,13,10,11,
134.8067 +	11,12,12,11,12,12,12,12,11,12,12,12,12,12,12,12,
134.8068 +	13,13,12,12,12,13,13,11,12,12,12,12,12,12,12,12,
134.8069 +	13,12,12,12,13,13,12,12,13,13,13,12,12,13,13,13,
134.8070 +	11,12,11,12,12,12,12,12,13,13,11,12,12,13,12,12,
134.8071 +	13,12,13,13,12,13,12,13,13,12,12,12,12,12,12,12,
134.8072 +	13,13,13,12,13,12,13,13,12,13,13,13,13,13,13,13,
134.8073 +	13,13,12,12,12,13,12,12,13,12,13,13,12,13,12,13,
134.8074 +	13,13,13,13,13,13,12,13,12,13,13,10,11,11,12,12,
134.8075 +	11,12,12,12,12,11,12,12,13,12,12,12,12,13,13,12,
134.8076 +	12,12,13,13,11,12,12,12,12,12,12,12,12,13,12,12,
134.8077 +	12,13,13,12,12,13,13,13,12,13,13,13,13,11,12,12,
134.8078 +	12,12,12,12,12,13,13,12,12,12,13,12,12,13,13,13,
134.8079 +	13,12,13,12,13,13,12,12,12,12,13,12,12,13,13,13,
134.8080 +	12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,12,
134.8081 +	12,12,12,12,12,13,13,13,13,12,13,12,13,13,13,13,
134.8082 +	13,13,13,13,13,13,13,13,11,11,11,12,12,11,12,12,
134.8083 +	12,12,11,12,12,12,12,12,12,12,13,13,12,12,12,13,
134.8084 +	13,11,12,12,12,12,12,12,12,13,13,12,12,12,13,13,
134.8085 +	12,12,13,13,13,12,13,13,13,13,11,12,12,12,12,12,
134.8086 +	12,12,13,13,12,12,12,13,12,12,13,12,13,13,12,13,
134.8087 +	12,13,13,12,12,12,12,12,12,13,13,13,13,12,13,13,
134.8088 +	13,13,13,13,13,13,13,13,13,13,13,13,12,12,12,12,
134.8089 +	12,12,13,13,13,13,12,13,12,13,12,13,13,13,13,13,
134.8090 +	13,13,13,13,12,
134.8091 +};
134.8092 +
134.8093 +static const static_codebook _44p7_p4_1 = {
134.8094 +	5, 3125,
134.8095 +	(long *)_vq_lengthlist__44p7_p4_1,
134.8096 +	1, -533725184, 1611661312, 3, 0,
134.8097 +	(long *)_vq_quantlist__44p7_p4_1,
134.8098 +	0
134.8099 +};
134.8100 +
134.8101 +static const long _vq_quantlist__44p7_p5_0[] = {
134.8102 +	2,
134.8103 +	1,
134.8104 +	3,
134.8105 +	0,
134.8106 +	4,
134.8107 +};
134.8108 +
134.8109 +static const long _vq_lengthlist__44p7_p5_0[] = {
134.8110 +	 2, 6, 6, 9, 9, 5, 7, 8,10,11, 5, 8, 7,11,10, 8,
134.8111 +	10,11,12,13, 8,11,10,13,12, 6, 7, 8,10,11, 7, 8,
134.8112 +	10,10,12, 8, 9, 9,12,11,10,10,12,11,14,10,11,12,
134.8113 +	14,13, 6, 8, 7,11,10, 8, 9, 9,11,12, 7,10, 8,12,
134.8114 +	10,10,12,12,13,14,10,12,10,14,11, 9,10,11,11,12,
134.8115 +	10,10,11,11,13,11,12,12,13,13,12,11,13,11,15,13,
134.8116 +	14,13,14,14, 9,11,10,12,11,11,12,12,13,13,10,11,
134.8117 +	10,13,11,13,13,14,14,14,12,13,11,14,11, 7, 8, 9,
134.8118 +	11,12, 9, 9,11,12,13, 9,10,10,13,12,11,12,13,13,
134.8119 +	15,11,12,12,14,14, 9,10,10,12,13,10,10,12,12,14,
134.8120 +	11,11,11,13,13,12,12,13,13,15,12,13,13,15,14, 9,
134.8121 +	10,10,12,13,10,11,11,13,14,10,12,11,14,13,12,13,
134.8122 +	13,14,15,12,13,13,15,14,12,12,13,13,14,12,13,13,
134.8123 +	13,15,13,14,14,14,15,14,14,15,14,16,14,15,15,16,
134.8124 +	16,12,13,13,14,14,13,13,14,15,14,12,13,13,15,14,
134.8125 +	14,15,15,15,16,14,15,14,16,14, 7, 9, 8,12,11, 9,
134.8126 +	10,10,12,13, 9,11, 9,13,12,11,12,12,14,14,11,13,
134.8127 +	12,15,13, 9,10,10,13,12,10,11,12,13,14,10,12,11,
134.8128 +	14,13,12,13,13,14,15,13,13,13,15,14, 9,10,10,13,
134.8129 +	12,11,11,11,13,13,10,12,10,14,12,13,13,13,14,15,
134.8130 +	12,13,12,15,13,12,13,13,14,14,12,13,13,14,15,13,
134.8131 +	14,13,15,15,14,14,15,14,16,14,15,15,16,15,12,13,
134.8132 +	12,14,13,13,13,13,15,14,12,13,13,15,13,14,15,15,
134.8133 +	16,15,14,15,14,16,14,11,12,12,13,14,12,13,14,14,
134.8134 +	15,12,13,13,14,15,14,14,15,15,16,14,15,15,16,16,
134.8135 +	12,13,13,14,15,13,13,14,14,16,13,14,14,15,15,15,
134.8136 +	15,16,15,17,15,15,15,16,16,12,13,13,14,15,13,14,
134.8137 +	14,15,16,13,14,14,15,15,15,15,16,16,17,15,15,15,
134.8138 +	17,16,14,15,15,16,16,15,15,16,15,16,15,16,16,16,
134.8139 +	17,16,16,17,16,18,16,16,17,18,17,14,15,15,16,16,
134.8140 +	15,16,16,16,17,15,16,15,17,16,16,17,17,17,18,16,
134.8141 +	16,16,17,16,11,12,12,14,13,12,13,13,15,14,12,14,
134.8142 +	13,15,14,14,15,15,16,16,14,15,14,16,15,12,13,13,
134.8143 +	15,14,13,14,14,15,15,13,14,14,16,15,15,15,15,16,
134.8144 +	16,15,16,15,17,16,12,13,13,15,14,13,14,14,15,15,
134.8145 +	13,14,13,16,14,15,15,15,16,16,15,15,15,17,15,14,
134.8146 +	15,15,16,16,15,15,15,16,16,15,16,16,17,17,16,16,
134.8147 +	17,17,17,16,17,17,18,17,14,15,15,16,15,15,15,16,
134.8148 +	16,16,15,15,15,17,15,17,17,17,18,17,16,17,16,18,
134.8149 +	16, 6, 9, 9,12,12, 8,10,10,12,13, 9,11,10,13,12,
134.8150 +	10,12,12,14,14,11,13,12,14,14, 8,10,10,12,12, 9,
134.8151 +	10,11,12,14,10,11,11,13,13,12,12,13,13,15,12,13,
134.8152 +	13,15,14, 9,10,10,13,13,10,11,11,13,13,10,12,10,
134.8153 +	14,13,12,13,13,14,15,12,13,13,15,14,11,12,12,13,
134.8154 +	14,12,12,13,13,15,12,13,13,14,14,13,13,14,13,16,
134.8155 +	14,15,15,16,15,11,12,12,14,14,13,13,13,15,14,12,
134.8156 +	13,13,15,14,14,15,15,16,15,14,14,14,16,14, 7, 9,
134.8157 +	10,12,12, 9,10,11,13,13, 9,11,10,13,13,11,12,13,
134.8158 +	14,15,12,13,13,15,14, 9,10,11,12,13,10,10,12,13,
134.8159 +	14,11,11,12,14,14,12,12,14,14,15,13,13,13,15,15,
134.8160 +	 9,11,11,13,13,11,12,12,14,14,10,12,10,14,13,13,
134.8161 +	14,13,15,15,12,14,13,15,14,12,12,13,13,15,12,12,
134.8162 +	14,13,15,13,14,14,15,15,14,14,15,14,17,14,15,15,
134.8163 +	16,16,12,13,13,15,14,13,14,14,15,15,12,14,13,15,
134.8164 +	14,14,15,15,16,16,14,15,14,16,14, 7,10,10,12,12,
134.8165 +	10,11,11,12,13,10,12,10,14,12,12,13,13,14,15,12,
134.8166 +	13,13,15,14, 9,11,10,13,12,10,10,12,12,14,11,13,
134.8167 +	12,14,13,13,13,14,13,15,13,14,14,15,14,10,11,11,
134.8168 +	13,13,12,12,12,13,14,10,12,10,14,12,13,14,14,15,
134.8169 +	15,13,14,13,15,13,12,13,13,14,14,12,12,13,14,15,
134.8170 +	13,14,14,15,15,13,13,14,13,15,14,15,15,16,16,12,
134.8171 +	13,13,14,14,13,14,14,15,15,12,13,13,15,13,15,15,
134.8172 +	15,16,16,13,14,13,16,13,11,12,13,14,14,12,13,14,
134.8173 +	14,15,12,13,13,15,15,14,14,15,15,17,14,15,15,16,
134.8174 +	16,12,13,14,14,15,13,13,14,14,16,13,14,14,15,16,
134.8175 +	14,14,16,15,17,15,15,16,16,16,12,13,13,15,15,13,
134.8176 +	14,14,15,16,13,14,14,15,16,15,15,16,17,17,15,16,
134.8177 +	15,17,16,14,15,15,15,16,15,15,16,15,17,15,15,16,
134.8178 +	16,17,16,16,16,16,18,16,16,17,17,17,14,15,15,16,
134.8179 +	16,15,16,16,16,17,15,16,15,17,16,16,17,17,17,17,
134.8180 +	16,17,16,18,17,11,12,12,14,14,13,13,14,14,15,13,
134.8181 +	14,13,15,14,14,15,15,15,16,14,15,15,17,15,12,13,
134.8182 +	13,15,14,13,13,14,15,15,14,15,14,16,15,15,15,15,
134.8183 +	15,16,15,16,15,17,16,12,13,13,15,15,14,14,14,15,
134.8184 +	16,13,14,13,16,15,15,15,16,16,17,15,16,15,17,15,
134.8185 +	14,15,15,16,16,14,15,15,16,16,15,16,16,17,16,15,
134.8186 +	15,16,15,17,16,17,17,18,17,14,15,15,16,16,15,16,
134.8187 +	16,16,17,14,15,15,17,16,17,17,17,17,18,15,16,16,
134.8188 +	18,15, 6, 9, 9,12,12, 9,10,11,12,13, 8,10,10,13,
134.8189 +	12,11,12,13,14,14,10,12,12,14,13, 9,10,10,12,13,
134.8190 +	10,10,12,13,14,10,11,11,13,13,12,13,13,14,15,12,
134.8191 +	13,13,15,14, 8,10,10,12,12,10,11,11,13,13, 9,11,
134.8192 +	10,13,13,12,13,13,14,15,12,13,12,15,13,11,12,12,
134.8193 +	14,14,12,13,13,13,15,13,13,13,14,15,14,14,15,14,
134.8194 +	16,14,15,15,15,15,11,12,12,14,13,12,13,13,15,14,
134.8195 +	12,13,12,15,13,14,14,15,16,16,13,14,13,16,13, 7,
134.8196 +	10,10,12,12,10,10,12,12,14,10,11,11,13,12,12,13,
134.8197 +	13,13,15,12,13,13,15,14,10,11,11,13,13,10,10,12,
134.8198 +	12,14,12,12,12,14,13,13,13,14,13,15,13,14,14,15,
134.8199 +	14, 9,10,11,13,13,11,12,12,13,14,10,12,10,14,12,
134.8200 +	13,13,14,14,15,13,13,12,15,13,12,13,13,14,14,12,
134.8201 +	13,13,14,15,13,14,14,15,15,13,13,15,13,16,15,15,
134.8202 +	15,16,16,12,13,13,14,14,13,14,14,15,15,12,13,12,
134.8203 +	15,14,15,15,15,16,16,13,14,13,15,13, 7,10, 9,12,
134.8204 +	12, 9,10,11,13,13, 9,11,10,13,13,11,13,13,14,15,
134.8205 +	11,13,12,15,14, 9,11,11,13,13,10,10,12,13,14,11,
134.8206 +	12,12,14,14,12,13,14,14,15,13,13,13,15,15, 9,11,
134.8207 +	10,13,12,11,12,11,14,14,10,12,10,14,13,13,14,13,
134.8208 +	15,15,12,14,12,15,14,12,13,13,14,15,13,13,14,14,
134.8209 +	15,13,14,14,15,15,14,14,15,14,17,14,15,15,16,16,
134.8210 +	12,13,12,15,13,13,14,14,15,15,12,14,13,15,13,14,
134.8211 +	15,15,16,16,14,15,14,16,14,11,12,12,14,14,13,13,
134.8212 +	14,14,15,13,14,13,15,15,14,15,15,16,17,14,15,15,
134.8213 +	16,15,12,13,13,15,15,13,13,14,15,16,14,14,14,16,
134.8214 +	15,15,15,16,15,17,15,16,15,17,16,12,13,13,14,15,
134.8215 +	14,14,15,15,16,13,14,13,15,15,15,15,16,16,17,15,
134.8216 +	15,15,16,15,14,15,15,16,16,14,15,15,16,17,15,16,
134.8217 +	16,17,17,16,15,16,15,17,16,17,17,17,17,14,15,15,
134.8218 +	15,16,15,15,16,16,17,14,15,15,16,16,16,16,17,17,
134.8219 +	18,15,16,15,17,15,11,13,12,14,14,12,13,13,15,15,
134.8220 +	12,14,13,15,14,14,15,15,16,16,14,15,14,16,15,12,
134.8221 +	13,13,15,15,13,14,14,15,16,13,14,14,16,16,15,15,
134.8222 +	16,16,17,15,16,15,17,16,12,13,13,15,14,13,14,14,
134.8223 +	16,15,13,14,13,16,14,15,16,15,17,16,15,15,14,18,
134.8224 +	15,14,15,15,16,16,15,15,16,16,17,15,16,15,17,16,
134.8225 +	16,16,17,17,18,16,17,17,18,17,14,15,15,16,15,15,
134.8226 +	16,15,17,16,15,15,15,17,15,16,17,17,18,17,16,17,
134.8227 +	16,18,15,10,12,12,14,14,12,13,13,14,14,12,13,13,
134.8228 +	14,14,13,14,14,15,15,13,14,14,16,15,11,12,13,14,
134.8229 +	14,12,13,13,15,15,12,13,13,15,15,13,14,15,15,16,
134.8230 +	14,15,15,16,16,12,13,13,14,14,13,13,14,15,15,13,
134.8231 +	14,13,15,15,14,15,15,16,16,14,15,14,16,15,13,14,
134.8232 +	14,15,15,13,14,14,15,16,14,14,15,16,16,14,15,15,
134.8233 +	15,17,15,16,16,17,17,13,14,14,15,15,14,15,15,16,
134.8234 +	16,14,15,15,16,16,15,16,16,16,17,15,16,15,17,16,
134.8235 +	11,12,12,14,14,12,13,13,14,15,12,13,13,15,14,13,
134.8236 +	14,14,15,16,13,14,14,16,15,12,13,13,14,15,13,13,
134.8237 +	14,15,15,13,14,14,15,15,14,14,15,15,17,14,15,15,
134.8238 +	16,16,12,13,13,15,15,13,14,14,15,15,13,14,13,15,
134.8239 +	15,14,15,15,16,17,14,15,15,16,16,13,13,14,15,16,
134.8240 +	14,14,15,15,16,14,15,15,16,16,15,15,16,15,18,15,
134.8241 +	16,16,17,17,14,15,15,16,16,15,15,15,16,16,14,15,
134.8242 +	15,17,16,16,16,16,17,17,15,16,16,17,16,10,12,12,
134.8243 +	14,14,12,13,13,14,15,12,13,13,15,14,14,14,15,15,
134.8244 +	16,14,15,14,16,15,12,13,13,15,14,13,13,14,15,15,
134.8245 +	13,14,14,15,15,14,14,15,15,16,14,15,15,16,16,12,
134.8246 +	13,13,15,15,13,14,14,15,16,13,14,13,15,14,15,15,
134.8247 +	15,16,16,14,15,15,16,15,13,14,14,16,15,14,14,14,
134.8248 +	15,16,14,15,15,16,16,15,15,16,15,17,16,17,16,17,
134.8249 +	17,14,14,15,15,16,15,15,16,16,16,14,15,14,16,15,
134.8250 +	16,16,16,17,17,15,16,15,17,15,11,13,13,14,15,13,
134.8251 +	13,14,15,15,13,14,13,15,15,14,15,15,15,16,14,15,
134.8252 +	15,17,15,13,13,14,15,15,13,14,15,15,16,14,14,14,
134.8253 +	16,16,15,14,16,15,17,15,16,16,17,16,13,14,14,15,
134.8254 +	15,14,14,14,16,16,13,15,14,16,15,15,15,16,17,17,
134.8255 +	15,16,15,17,16,14,15,15,15,16,15,15,16,15,17,15,
134.8256 +	16,16,16,17,16,16,17,15,18,16,17,17,17,17,14,15,
134.8257 +	15,16,16,15,16,16,17,17,15,16,15,17,16,16,17,17,
134.8258 +	18,18,16,17,15,18,16,10,12,12,14,14,13,13,14,14,
134.8259 +	15,13,14,13,15,14,14,15,15,15,16,15,15,15,16,15,
134.8260 +	12,13,13,15,14,12,12,14,14,15,14,15,14,16,15,15,
134.8261 +	14,15,14,17,15,16,16,17,16,12,13,13,14,15,14,14,
134.8262 +	15,15,16,13,14,12,16,14,15,16,16,16,17,15,16,14,
134.8263 +	17,15,14,15,14,16,15,14,14,15,15,15,15,16,15,17,
134.8264 +	16,15,14,16,14,16,16,17,17,18,17,14,14,15,15,16,
134.8265 +	15,16,16,16,17,14,15,14,16,15,16,16,17,17,17,15,
134.8266 +	16,14,17,14,10,12,12,14,13,12,13,13,14,14,11,13,
134.8267 +	12,14,14,13,14,14,15,16,13,14,14,16,15,12,13,13,
134.8268 +	14,14,13,13,14,15,15,13,14,13,15,15,14,14,15,15,
134.8269 +	16,14,15,15,16,16,11,13,12,14,14,12,13,13,15,15,
134.8270 +	12,13,13,15,15,14,15,15,16,16,13,14,14,16,15,13,
134.8271 +	14,14,15,15,14,15,15,15,16,14,15,15,16,16,15,16,
134.8272 +	16,16,17,16,16,16,17,17,13,14,14,15,15,14,15,15,
134.8273 +	16,16,13,14,14,16,15,15,16,16,17,17,15,15,15,17,
134.8274 +	15,11,12,12,14,14,12,13,13,14,15,12,13,13,15,14,
134.8275 +	14,14,15,15,16,14,14,14,16,15,12,13,13,15,14,13,
134.8276 +	13,14,15,15,13,14,14,16,15,14,15,15,15,16,15,15,
134.8277 +	15,16,16,12,13,13,14,15,13,13,14,15,15,13,14,13,
134.8278 +	15,15,15,15,15,16,16,14,15,14,16,15,14,14,15,16,
134.8279 +	16,14,15,15,15,16,15,16,15,16,16,15,15,16,15,17,
134.8280 +	16,16,16,17,17,13,14,14,15,16,14,15,15,16,16,14,
134.8281 +	14,14,16,16,16,16,16,17,17,15,15,15,17,15,11,12,
134.8282 +	12,14,14,12,13,13,14,15,12,13,13,15,14,14,14,14,
134.8283 +	15,16,13,14,14,16,15,12,13,13,15,15,13,13,14,15,
134.8284 +	16,13,14,14,15,15,14,15,15,16,17,14,15,15,17,16,
134.8285 +	12,13,13,15,14,13,14,14,15,15,13,14,13,15,15,14,
134.8286 +	15,15,16,16,14,15,14,17,15,14,15,15,16,16,14,15,
134.8287 +	15,16,17,15,15,15,17,17,15,16,16,16,17,16,17,16,
134.8288 +	17,17,13,15,14,16,15,14,15,15,16,16,14,15,14,16,
134.8289 +	15,16,16,16,17,17,15,16,15,17,15,10,12,12,14,14,
134.8290 +	13,13,14,14,15,13,14,13,15,14,14,15,15,15,17,14,
134.8291 +	15,15,16,15,12,13,13,15,14,12,12,14,14,15,14,15,
134.8292 +	14,16,15,15,14,16,15,17,15,16,16,17,16,12,13,13,
134.8293 +	14,15,14,14,15,15,16,12,14,12,15,14,15,16,16,16,
134.8294 +	17,15,16,14,17,14,14,15,14,16,16,14,14,15,15,16,
134.8295 +	15,16,16,17,16,15,14,16,14,17,16,17,17,18,17,14,
134.8296 +	14,15,15,16,15,15,16,16,17,14,15,14,16,15,16,17,
134.8297 +	17,17,18,15,16,14,17,14,11,13,13,15,14,13,13,14,
134.8298 +	15,15,12,14,13,15,15,14,15,15,15,17,14,15,14,16,
134.8299 +	15,13,14,14,15,15,13,14,15,15,16,14,15,14,16,16,
134.8300 +	15,15,16,16,17,15,16,16,17,17,13,14,13,15,15,14,
134.8301 +	14,14,16,16,13,15,14,16,15,15,16,16,17,17,15,16,
134.8302 +	14,17,15,15,15,15,16,17,15,15,16,16,17,15,16,16,
134.8303 +	17,17,16,15,17,16,17,17,17,17,18,18,14,15,15,17,
134.8304 +	15,15,16,16,17,16,15,16,15,17,15,16,17,17,17,17,
134.8305 +	16,17,15,18,15,
134.8306 +};
134.8307 +
134.8308 +static const static_codebook _44p7_p5_0 = {
134.8309 +	5, 3125,
134.8310 +	(long *)_vq_lengthlist__44p7_p5_0,
134.8311 +	1, -528744448, 1616642048, 3, 0,
134.8312 +	(long *)_vq_quantlist__44p7_p5_0,
134.8313 +	0
134.8314 +};
134.8315 +
134.8316 +static const long _vq_quantlist__44p7_p5_1[] = {
134.8317 +	3,
134.8318 +	2,
134.8319 +	4,
134.8320 +	1,
134.8321 +	5,
134.8322 +	0,
134.8323 +	6,
134.8324 +};
134.8325 +
134.8326 +static const long _vq_lengthlist__44p7_p5_1[] = {
134.8327 +	 2, 3, 3, 3, 3, 3, 3,
134.8328 +};
134.8329 +
134.8330 +static const static_codebook _44p7_p5_1 = {
134.8331 +	1, 7,
134.8332 +	(long *)_vq_lengthlist__44p7_p5_1,
134.8333 +	1, -533200896, 1611661312, 3, 0,
134.8334 +	(long *)_vq_quantlist__44p7_p5_1,
134.8335 +	0
134.8336 +};
134.8337 +
134.8338 +static const long _vq_quantlist__44p7_p6_0[] = {
134.8339 +	1,
134.8340 +	0,
134.8341 +	2,
134.8342 +};
134.8343 +
134.8344 +static const long _vq_lengthlist__44p7_p6_0[] = {
134.8345 +	 2, 5, 6, 5, 7, 8, 5, 8, 7, 5, 7, 7, 7, 7, 9, 8,
134.8346 +	 9, 9, 5, 7, 7, 8, 9, 9, 7, 9, 7, 6, 8, 8, 8, 9,
134.8347 +	10, 8, 9, 9, 8, 9,10, 9, 9,11,10,10,11, 8,10, 9,
134.8348 +	10,10,11, 9,10,10, 6, 8, 8, 8, 9, 9, 8,10, 9, 8,
134.8349 +	 9,10, 9,10,10,10,11,10, 8,10, 9,10,11,10, 9,11,
134.8350 +	 9, 6, 8, 8, 7, 9, 9, 8, 9, 9, 7, 9, 9, 9, 9,10,
134.8351 +	 9,10,10, 8, 9, 9, 9,10,10, 9,10, 9, 7, 9, 9, 9,
134.8352 +	10,10, 9,10,10, 9, 9,10,10, 9,11,10,11,11, 9,10,
134.8353 +	10,10,11,11,10,11,10, 6, 9, 8, 9,10,10, 9,10, 9,
134.8354 +	 8,10,10, 9, 9,10,10,11,11, 9,10,10,10,11,11, 9,
134.8355 +	11, 9, 6, 8, 8, 8, 9, 9, 7, 9, 9, 8, 9, 9, 9, 9,
134.8356 +	10, 9,10,10, 7, 9, 9, 9,10,10, 9,10, 9, 6, 8, 9,
134.8357 +	 9, 9,10, 9,10,10, 9,10,10, 9, 9,11,10,11,11, 8,
134.8358 +	10,10,10,11,11, 9,10, 9, 7, 9, 9, 9,10,10, 9,10,
134.8359 +	10, 9,10,10,10,10,11,10,11,11, 9,10, 9,10,11,11,
134.8360 +	10,11, 9,
134.8361 +};
134.8362 +
134.8363 +static const static_codebook _44p7_p6_0 = {
134.8364 +	5, 243,
134.8365 +	(long *)_vq_lengthlist__44p7_p6_0,
134.8366 +	1, -527106048, 1620377600, 2, 0,
134.8367 +	(long *)_vq_quantlist__44p7_p6_0,
134.8368 +	0
134.8369 +};
134.8370 +
134.8371 +static const long _vq_quantlist__44p7_p6_1[] = {
134.8372 +	1,
134.8373 +	0,
134.8374 +	2,
134.8375 +};
134.8376 +
134.8377 +static const long _vq_lengthlist__44p7_p6_1[] = {
134.8378 +	 4, 7, 7, 6, 7, 8, 6, 8, 7, 7, 7, 8, 7, 7, 8, 8,
134.8379 +	 8, 8, 7, 7, 7, 8, 8, 8, 7, 8, 8, 7, 8, 8, 8, 8,
134.8380 +	 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 8, 9, 9, 8, 8, 8,
134.8381 +	 8, 9, 9, 8, 9, 8, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8,
134.8382 +	 8, 8, 8, 8, 9, 8, 9, 9, 8, 8, 8, 8, 9, 9, 8, 9,
134.8383 +	 8, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9,
134.8384 +	 8, 9, 9, 8, 8, 8, 8, 9, 9, 8, 9, 8, 7, 8, 8, 8,
134.8385 +	 8, 9, 8, 9, 8, 8, 8, 8, 8, 8, 9, 8, 9, 9, 8, 8,
134.8386 +	 8, 9, 9, 9, 8, 9, 9, 7, 8, 8, 8, 8, 8, 8, 8, 8,
134.8387 +	 8, 8, 8, 8, 8, 9, 8, 9, 9, 8, 8, 8, 8, 9, 9, 8,
134.8388 +	 9, 8, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
134.8389 +	 9, 8, 9, 9, 8, 8, 8, 8, 9, 9, 8, 9, 8, 7, 8, 8,
134.8390 +	 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 8, 9, 9, 8,
134.8391 +	 8, 8, 8, 9, 9, 8, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8,
134.8392 +	 8, 8, 8, 8, 8, 9, 9, 8, 9, 9, 8, 8, 8, 9, 9, 9,
134.8393 +	 8, 9, 8,
134.8394 +};
134.8395 +
134.8396 +static const static_codebook _44p7_p6_1 = {
134.8397 +	5, 243,
134.8398 +	(long *)_vq_lengthlist__44p7_p6_1,
134.8399 +	1, -530841600, 1616642048, 2, 0,
134.8400 +	(long *)_vq_quantlist__44p7_p6_1,
134.8401 +	0
134.8402 +};
134.8403 +
134.8404 +static const long _vq_quantlist__44p7_p7_0[] = {
134.8405 +	1,
134.8406 +	0,
134.8407 +	2,
134.8408 +};
134.8409 +
134.8410 +static const long _vq_lengthlist__44p7_p7_0[] = {
134.8411 +	 1, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9,
134.8412 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.8413 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.8414 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.8415 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.8416 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.8417 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.8418 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.8419 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.8420 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.8421 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.8422 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.8423 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.8424 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.8425 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.8426 +	 9, 9, 9,
134.8427 +};
134.8428 +
134.8429 +static const static_codebook _44p7_p7_0 = {
134.8430 +	5, 243,
134.8431 +	(long *)_vq_lengthlist__44p7_p7_0,
134.8432 +	1, -513979392, 1633504256, 2, 0,
134.8433 +	(long *)_vq_quantlist__44p7_p7_0,
134.8434 +	0
134.8435 +};
134.8436 +
134.8437 +static const long _vq_quantlist__44p7_p7_1[] = {
134.8438 +	1,
134.8439 +	0,
134.8440 +	2,
134.8441 +};
134.8442 +
134.8443 +static const long _vq_lengthlist__44p7_p7_1[] = {
134.8444 +	 1, 5, 5, 4,10,10, 5,10,10, 5,10,10,10,10,10,10,
134.8445 +	10,10, 5,10,10,10,10,10, 9,10,10, 6,10,10,10,10,
134.8446 +	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
134.8447 +	10,10,10,10,10,10, 7,10,10,10,10,10,10,10,10,10,
134.8448 +	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
134.8449 +	10, 6,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
134.8450 +	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
134.8451 +	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
134.8452 +	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
134.8453 +	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
134.8454 +	10,10, 6,10,10,10,10,10,10,10,10,10,10,10,10,10,
134.8455 +	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
134.8456 +	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
134.8457 +	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
134.8458 +	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
134.8459 +	10,11,11,
134.8460 +};
134.8461 +
134.8462 +static const static_codebook _44p7_p7_1 = {
134.8463 +	5, 243,
134.8464 +	(long *)_vq_lengthlist__44p7_p7_1,
134.8465 +	1, -516716544, 1630767104, 2, 0,
134.8466 +	(long *)_vq_quantlist__44p7_p7_1,
134.8467 +	0
134.8468 +};
134.8469 +
134.8470 +static const long _vq_quantlist__44p7_p7_2[] = {
134.8471 +	12,
134.8472 +	11,
134.8473 +	13,
134.8474 +	10,
134.8475 +	14,
134.8476 +	9,
134.8477 +	15,
134.8478 +	8,
134.8479 +	16,
134.8480 +	7,
134.8481 +	17,
134.8482 +	6,
134.8483 +	18,
134.8484 +	5,
134.8485 +	19,
134.8486 +	4,
134.8487 +	20,
134.8488 +	3,
134.8489 +	21,
134.8490 +	2,
134.8491 +	22,
134.8492 +	1,
134.8493 +	23,
134.8494 +	0,
134.8495 +	24,
134.8496 +};
134.8497 +
134.8498 +static const long _vq_lengthlist__44p7_p7_2[] = {
134.8499 +	 1, 3, 2, 4, 5, 7, 7, 8, 8, 9, 9,10,10,11,11,12,
134.8500 +	12,13,13,14,14,15,15,15,15,
134.8501 +};
134.8502 +
134.8503 +static const static_codebook _44p7_p7_2 = {
134.8504 +	1, 25,
134.8505 +	(long *)_vq_lengthlist__44p7_p7_2,
134.8506 +	1, -518864896, 1620639744, 5, 0,
134.8507 +	(long *)_vq_quantlist__44p7_p7_2,
134.8508 +	0
134.8509 +};
134.8510 +
134.8511 +static const long _vq_quantlist__44p7_p7_3[] = {
134.8512 +	12,
134.8513 +	11,
134.8514 +	13,
134.8515 +	10,
134.8516 +	14,
134.8517 +	9,
134.8518 +	15,
134.8519 +	8,
134.8520 +	16,
134.8521 +	7,
134.8522 +	17,
134.8523 +	6,
134.8524 +	18,
134.8525 +	5,
134.8526 +	19,
134.8527 +	4,
134.8528 +	20,
134.8529 +	3,
134.8530 +	21,
134.8531 +	2,
134.8532 +	22,
134.8533 +	1,
134.8534 +	23,
134.8535 +	0,
134.8536 +	24,
134.8537 +};
134.8538 +
134.8539 +static const long _vq_lengthlist__44p7_p7_3[] = {
134.8540 +	 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5,
134.8541 +	 5, 5, 5, 5, 5, 5, 5, 5, 5,
134.8542 +};
134.8543 +
134.8544 +static const static_codebook _44p7_p7_3 = {
134.8545 +	1, 25,
134.8546 +	(long *)_vq_lengthlist__44p7_p7_3,
134.8547 +	1, -529006592, 1611661312, 5, 0,
134.8548 +	(long *)_vq_quantlist__44p7_p7_3,
134.8549 +	0
134.8550 +};
134.8551 +
134.8552 +static const long _huff_lengthlist__44p7_short[] = {
134.8553 +	 3, 9,14,16,17,19,22,22, 5, 4, 6, 9,11,13,17,20,
134.8554 +	 9, 5, 5, 6, 9,11,15,19,11, 7, 5, 5, 7, 9,13,17,
134.8555 +	14, 9, 7, 6, 6, 7,11,14,16,11, 9, 7, 6, 4, 4, 8,
134.8556 +	19,15,13,11, 9, 4, 3, 4,21,16,16,15,12, 6, 4, 4,
134.8557 +};
134.8558 +
134.8559 +static const static_codebook _huff_book__44p7_short = {
134.8560 +	2, 64,
134.8561 +	(long *)_huff_lengthlist__44p7_short,
134.8562 +	0, 0, 0, 0, 0,
134.8563 +	NULL,
134.8564 +	0
134.8565 +};
134.8566 +
134.8567 +static const long _vq_quantlist__44p8_l0_0[] = {
134.8568 +	6,
134.8569 +	5,
134.8570 +	7,
134.8571 +	4,
134.8572 +	8,
134.8573 +	3,
134.8574 +	9,
134.8575 +	2,
134.8576 +	10,
134.8577 +	1,
134.8578 +	11,
134.8579 +	0,
134.8580 +	12,
134.8581 +};
134.8582 +
134.8583 +static const long _vq_lengthlist__44p8_l0_0[] = {
134.8584 +	 2, 4, 4, 7, 7, 8, 8,10,10,11,11,12,12, 4, 5, 5,
134.8585 +	 7, 7, 9, 9,10, 9,12,10,12,12, 4, 5, 5, 7, 7, 9,
134.8586 +	 9, 9,10,10,12,12,12, 7, 7, 7, 7, 8, 9, 8,11, 5,
134.8587 +	12, 6,12,10, 7, 7, 7, 8, 7, 8, 9, 5,11, 6,12,10,
134.8588 +	12, 8, 9, 9, 9, 9, 9, 9,11, 7,11, 7,11, 9, 8, 9,
134.8589 +	 9, 9, 9, 9, 9, 7,10, 7,11, 9,11,10,10,10,10,10,
134.8590 +	10,10,11,10,11, 8,12, 9,10,10,10,10,10,10,10,10,
134.8591 +	11, 8,11, 9,12,10,11,11,11,11,11,11,11,11,12,10,
134.8592 +	12,11,10,11,11,11,11,11,11,11,11,10,12,11,12,12,
134.8593 +	12,12,12,12,12,12,12,12,12,12,12,12,11,12,12,12,
134.8594 +	12,12,12,12,12,12,11,12,12,
134.8595 +};
134.8596 +
134.8597 +static const static_codebook _44p8_l0_0 = {
134.8598 +	2, 169,
134.8599 +	(long *)_vq_lengthlist__44p8_l0_0,
134.8600 +	1, -526516224, 1616117760, 4, 0,
134.8601 +	(long *)_vq_quantlist__44p8_l0_0,
134.8602 +	0
134.8603 +};
134.8604 +
134.8605 +static const long _vq_quantlist__44p8_l0_1[] = {
134.8606 +	2,
134.8607 +	1,
134.8608 +	3,
134.8609 +	0,
134.8610 +	4,
134.8611 +};
134.8612 +
134.8613 +static const long _vq_lengthlist__44p8_l0_1[] = {
134.8614 +	 4, 4, 4, 5, 5, 4, 4, 5, 5, 5, 4, 5, 4, 5, 5, 5,
134.8615 +	 5, 5, 5, 5, 5, 5, 5, 5, 5,
134.8616 +};
134.8617 +
134.8618 +static const static_codebook _44p8_l0_1 = {
134.8619 +	2, 25,
134.8620 +	(long *)_vq_lengthlist__44p8_l0_1,
134.8621 +	1, -533725184, 1611661312, 3, 0,
134.8622 +	(long *)_vq_quantlist__44p8_l0_1,
134.8623 +	0
134.8624 +};
134.8625 +
134.8626 +static const long _vq_quantlist__44p8_l1_0[] = {
134.8627 +	54,
134.8628 +	29,
134.8629 +	79,
134.8630 +	0,
134.8631 +	108,
134.8632 +};
134.8633 +
134.8634 +static const long _vq_lengthlist__44p8_l1_0[] = {
134.8635 +	 1, 2, 3, 6, 7, 7, 6, 7, 7, 8, 8, 8, 8, 8, 8, 8,
134.8636 +	 8, 8, 8, 8, 8, 8, 8, 8, 8,
134.8637 +};
134.8638 +
134.8639 +static const static_codebook _44p8_l1_0 = {
134.8640 +	2, 25,
134.8641 +	(long *)_vq_lengthlist__44p8_l1_0,
134.8642 +	1, -514516992, 1620639744, 7, 0,
134.8643 +	(long *)_vq_quantlist__44p8_l1_0,
134.8644 +	0
134.8645 +};
134.8646 +
134.8647 +static const long _huff_lengthlist__44p8_lfe[] = {
134.8648 +	 2, 3, 1, 3,
134.8649 +};
134.8650 +
134.8651 +static const static_codebook _huff_book__44p8_lfe = {
134.8652 +	2, 4,
134.8653 +	(long *)_huff_lengthlist__44p8_lfe,
134.8654 +	0, 0, 0, 0, 0,
134.8655 +	NULL,
134.8656 +	0
134.8657 +};
134.8658 +
134.8659 +static const long _huff_lengthlist__44p8_long[] = {
134.8660 +	 2, 7,14,16,17,18,20,21, 7, 4, 6, 8,11,12,14,16,
134.8661 +	13, 5, 4, 4, 8, 9,11,13,15, 8, 4, 3, 5, 7, 9,10,
134.8662 +	17,11, 8, 4, 4, 6, 9, 9,17,11, 9, 7, 6, 5, 7, 8,
134.8663 +	19,13,11, 9, 9, 7, 8, 8,21,15,13,11,10, 8, 8, 7,
134.8664 +};
134.8665 +
134.8666 +static const static_codebook _huff_book__44p8_long = {
134.8667 +	2, 64,
134.8668 +	(long *)_huff_lengthlist__44p8_long,
134.8669 +	0, 0, 0, 0, 0,
134.8670 +	NULL,
134.8671 +	0
134.8672 +};
134.8673 +
134.8674 +static const long _vq_quantlist__44p8_p1_0[] = {
134.8675 +	1,
134.8676 +	0,
134.8677 +	2,
134.8678 +};
134.8679 +
134.8680 +static const long _vq_lengthlist__44p8_p1_0[] = {
134.8681 +	 2, 5, 5, 4, 7, 7, 4, 7, 7, 5, 7, 7, 7, 8, 9, 7,
134.8682 +	 9, 9, 5, 7, 7, 7, 9, 9, 7, 9, 8, 6, 7, 8, 8, 9,
134.8683 +	10, 8, 9,10, 8, 9,10,10,10,12,10,11,12, 8,10,10,
134.8684 +	10,11,12,10,11,11, 6, 8, 7, 8,10, 9, 8,10, 9, 8,
134.8685 +	10,10,10,11,11,10,12,11, 8,10, 9,10,12,11,10,12,
134.8686 +	10, 5, 8, 8, 8,10,10, 8,10,10, 7, 9,10, 9,10,11,
134.8687 +	 9,11,11, 8,10,10,10,12,12,10,12,11, 7, 9, 9, 9,
134.8688 +	10,11, 9,11,11, 9, 9,11,10,11,12,10,11,12, 9,11,
134.8689 +	11,11,12,12,11,12,12, 7, 9, 9,10,11,11,10,12,11,
134.8690 +	 9,11,10,11,11,12,11,13,12,10,11,11,12,13,13,11,
134.8691 +	13,11, 5, 8, 8, 8,10,10, 8,10,10, 8,10,10,10,11,
134.8692 +	12,10,12,11, 7,10, 9, 9,11,11, 9,11,10, 7, 9, 9,
134.8693 +	10,11,12,10,11,11,10,11,11,11,11,13,12,13,13, 9,
134.8694 +	10,11,12,12,13,11,12,11, 7, 9, 9, 9,11,11, 9,11,
134.8695 +	10, 9,11,11,11,12,12,11,12,12, 9,11, 9,10,12,11,
134.8696 +	10,12,11,
134.8697 +};
134.8698 +
134.8699 +static const static_codebook _44p8_p1_0 = {
134.8700 +	5, 243,
134.8701 +	(long *)_vq_lengthlist__44p8_p1_0,
134.8702 +	1, -535822336, 1611661312, 2, 0,
134.8703 +	(long *)_vq_quantlist__44p8_p1_0,
134.8704 +	0
134.8705 +};
134.8706 +
134.8707 +static const long _vq_quantlist__44p8_p2_0[] = {
134.8708 +	2,
134.8709 +	1,
134.8710 +	3,
134.8711 +	0,
134.8712 +	4,
134.8713 +};
134.8714 +
134.8715 +static const long _vq_lengthlist__44p8_p2_0[] = {
134.8716 +	 4, 6, 6, 9, 9, 6, 8, 8,10,10, 6, 8, 8,10,10, 8,
134.8717 +	 9,10,12,12, 8,10, 9,12,12, 6, 8, 8,10,10, 8, 8,
134.8718 +	 9,10,11, 8, 9, 9,11,11, 9,10,11,12,13,10,11,11,
134.8719 +	13,13, 6, 8, 8,10,10, 8, 9, 9,11,11, 8, 9, 8,11,
134.8720 +	10,10,11,11,13,13, 9,11,10,13,12, 9,10,10,12,12,
134.8721 +	10,10,11,12,13,10,11,11,13,13,12,12,13,12,15,12,
134.8722 +	13,13,15,14, 9,10,10,12,12,10,11,11,13,13,10,11,
134.8723 +	10,13,12,12,13,13,14,15,12,13,12,15,12, 7, 8, 8,
134.8724 +	10,11, 8, 9,10,11,12, 8, 9, 9,11,11,10,11,11,13,
134.8725 +	14,10,11,11,13,13, 8, 9, 9,11,12, 9,10,11,11,13,
134.8726 +	 9,10,10,12,12,11,11,12,13,15,11,12,12,14,14, 8,
134.8727 +	 9, 9,11,11, 9,10,11,12,13, 9,10,10,12,12,11,12,
134.8728 +	12,14,15,11,12,12,14,14,10,11,12,13,13,11,12,12,
134.8729 +	13,14,12,12,12,14,14,13,13,14,14,16,14,14,14,16,
134.8730 +	15,10,11,11,13,13,12,12,12,14,14,11,12,12,14,13,
134.8731 +	14,14,14,15,16,13,14,13,16,14, 7, 8, 8,11,10, 8,
134.8732 +	 9, 9,11,11, 8,10, 9,12,11,10,11,11,13,13,10,11,
134.8733 +	11,14,13, 8, 9, 9,12,11, 9,10,10,12,12, 9,11,10,
134.8734 +	13,12,11,12,12,13,14,11,12,12,15,14, 8, 9, 9,12,
134.8735 +	11, 9,10,10,12,12, 9,11,10,13,11,11,12,12,14,14,
134.8736 +	11,12,12,14,13,10,11,11,13,13,11,12,12,13,14,12,
134.8737 +	13,12,14,14,13,13,14,14,16,13,14,14,16,15,10,11,
134.8738 +	11,13,13,12,12,12,14,14,11,12,12,14,13,13,14,14,
134.8739 +	15,15,13,14,13,16,14, 9,10,11,12,13,11,11,12,12,
134.8740 +	14,11,11,12,13,14,13,13,14,14,16,13,13,14,15,15,
134.8741 +	11,11,12,12,14,12,12,13,13,15,12,12,13,13,15,14,
134.8742 +	14,15,15,16,14,14,14,15,16,11,12,12,13,14,12,12,
134.8743 +	13,14,15,12,13,12,14,14,14,14,15,15,16,14,14,14,
134.8744 +	16,16,13,13,14,15,16,14,14,15,15,16,14,15,15,16,
134.8745 +	16,15,15,16,16,18,16,16,16,17,17,13,14,14,15,15,
134.8746 +	14,14,15,16,16,14,15,14,16,16,16,16,16,17,18,15,
134.8747 +	16,16,17,16, 9,11,10,13,12,11,12,11,14,13,11,12,
134.8748 +	11,14,12,13,14,13,15,14,13,14,13,16,14,11,12,12,
134.8749 +	14,13,12,12,13,14,14,12,13,12,15,14,14,14,14,16,
134.8750 +	16,14,15,14,17,15,11,12,11,14,12,12,13,12,15,13,
134.8751 +	12,13,12,15,13,14,14,14,16,15,14,15,14,16,15,13,
134.8752 +	14,14,15,15,14,14,15,16,16,14,15,14,16,16,15,15,
134.8753 +	16,16,17,16,16,16,17,17,13,14,14,16,15,14,15,15,
134.8754 +	16,16,14,15,14,17,15,16,16,16,17,17,15,16,15,18,
134.8755 +	16, 7, 8, 8,10,11, 8, 9, 9,11,12, 8, 9, 9,12,11,
134.8756 +	10,11,11,13,14,10,11,11,14,13, 8, 9, 9,11,11, 9,
134.8757 +	10,10,12,12, 9,10,10,12,12,11,12,12,13,14,11,12,
134.8758 +	12,14,14, 8, 9, 9,12,11, 9,10,11,12,13, 9,11,10,
134.8759 +	13,12,11,12,12,14,14,11,12,12,14,13,10,11,11,13,
134.8760 +	13,11,12,12,13,14,11,12,12,14,14,13,13,14,14,16,
134.8761 +	13,14,14,16,15,10,12,11,13,13,12,12,12,14,14,11,
134.8762 +	12,12,14,13,14,14,14,15,16,13,14,14,16,14, 8, 9,
134.8763 +	 9,11,11, 9,10,10,12,12, 9,10,10,12,12,11,11,12,
134.8764 +	13,14,11,12,12,14,14, 9, 9,10,11,12,10,10,11,12,
134.8765 +	13,10,10,11,12,13,12,12,13,14,15,12,12,13,14,15,
134.8766 +	 9,10,10,12,12,10,11,11,13,13,10,11,11,13,13,12,
134.8767 +	13,13,15,15,12,13,13,15,14,11,11,12,13,14,12,12,
134.8768 +	13,13,15,12,12,13,14,15,14,14,15,14,16,14,14,15,
134.8769 +	15,16,11,12,12,14,14,12,13,13,15,15,12,13,13,15,
134.8770 +	14,14,15,15,16,16,14,15,14,17,15, 8, 9, 9,11,11,
134.8771 +	 9,10,10,12,12, 9,11,10,13,12,11,12,12,14,14,11,
134.8772 +	13,12,15,13, 9,10,10,12,12,10,10,11,12,13,10,12,
134.8773 +	11,13,13,12,12,13,13,15,12,13,13,15,14, 9,10,10,
134.8774 +	12,12,11,11,12,13,13,10,12,10,13,12,12,13,13,15,
134.8775 +	15,12,13,13,15,13,11,12,12,14,14,12,12,13,14,14,
134.8776 +	12,13,13,15,14,13,13,14,13,16,14,15,14,16,16,11,
134.8777 +	12,12,14,14,13,13,13,15,15,12,13,12,15,14,14,15,
134.8778 +	15,16,17,14,15,13,16,13,10,11,11,13,14,11,12,12,
134.8779 +	13,15,11,12,12,14,14,13,14,14,15,16,13,14,14,16,
134.8780 +	16,11,11,12,12,14,12,12,13,13,15,12,13,13,13,15,
134.8781 +	14,14,15,14,17,14,14,15,15,16,11,12,12,14,14,12,
134.8782 +	13,13,15,15,12,13,13,15,15,14,15,15,16,17,14,15,
134.8783 +	15,16,16,13,14,14,14,16,14,14,15,14,17,14,15,15,
134.8784 +	14,17,16,16,17,15,18,16,16,17,16,18,13,14,14,16,
134.8785 +	16,14,15,15,17,16,14,15,15,17,16,16,17,17,18,18,
134.8786 +	16,17,16,18,17,10,11,11,14,13,11,12,12,14,14,11,
134.8787 +	13,12,15,14,14,14,14,16,15,14,15,14,16,15,11,12,
134.8788 +	12,14,13,12,13,13,15,14,13,14,13,15,14,14,15,15,
134.8789 +	16,16,14,15,15,17,15,11,12,12,14,14,13,13,13,15,
134.8790 +	15,12,13,13,15,14,15,15,15,17,17,14,15,15,17,15,
134.8791 +	13,14,14,16,15,14,15,15,16,16,15,15,15,17,16,16,
134.8792 +	16,16,16,17,16,17,16,18,17,14,14,14,16,16,15,15,
134.8793 +	15,16,16,14,15,14,17,16,16,17,17,17,18,16,17,16,
134.8794 +	18,16, 7, 8, 8,11,11, 8, 9, 9,11,12, 8, 9, 9,12,
134.8795 +	11,10,11,11,13,14,10,11,11,14,13, 8, 9, 9,11,12,
134.8796 +	 9,10,11,12,13, 9,11,10,13,12,11,12,12,13,14,11,
134.8797 +	12,12,14,14, 8, 9, 9,11,11, 9,10,10,12,12, 9,10,
134.8798 +	10,13,12,11,12,12,14,14,11,12,11,14,13,10,11,12,
134.8799 +	13,13,11,12,12,13,14,12,13,12,14,14,13,13,14,14,
134.8800 +	16,13,14,14,16,15,10,11,11,13,13,11,12,12,14,14,
134.8801 +	11,12,12,14,13,13,14,14,15,16,13,14,13,16,14, 8,
134.8802 +	 9, 9,11,11, 9,10,11,12,13, 9,10,10,12,12,11,12,
134.8803 +	13,13,14,11,12,12,14,14, 9,10,10,12,12,10,10,11,
134.8804 +	12,13,11,12,11,13,13,12,12,13,13,15,12,13,13,15,
134.8805 +	15, 9,10,10,12,12,10,11,12,13,14,10,11,10,13,12,
134.8806 +	12,13,13,14,15,12,13,12,15,13,12,12,12,14,14,12,
134.8807 +	12,13,14,15,13,13,13,15,15,14,14,15,13,16,14,15,
134.8808 +	15,16,16,11,12,12,14,14,12,13,13,14,15,12,13,12,
134.8809 +	14,14,14,14,15,16,16,13,14,13,16,14, 8, 9, 9,11,
134.8810 +	11, 9,10,10,12,12, 9,10,10,12,12,11,12,12,14,14,
134.8811 +	11,12,11,14,14, 9,10,10,12,12,10,11,11,13,13,10,
134.8812 +	11,11,13,13,12,13,13,14,15,12,13,13,15,14, 9,10,
134.8813 +	 9,12,11,10,11,10,13,12,10,11,10,13,12,12,13,12,
134.8814 +	15,14,12,13,12,15,14,11,12,12,14,14,12,13,13,14,
134.8815 +	15,12,13,13,15,15,14,14,15,15,17,14,15,15,16,16,
134.8816 +	11,12,11,14,13,12,13,12,15,14,12,13,12,15,13,14,
134.8817 +	15,14,16,15,13,15,14,17,14,10,11,11,13,14,11,12,
134.8818 +	13,13,15,11,12,12,14,14,14,14,15,15,17,13,14,14,
134.8819 +	15,16,11,12,12,14,14,12,12,13,14,15,13,13,13,15,
134.8820 +	15,14,15,15,15,17,15,15,15,16,16,11,12,12,13,14,
134.8821 +	13,13,14,14,15,12,13,13,14,15,14,15,15,16,17,14,
134.8822 +	15,15,16,16,14,14,14,16,16,14,14,15,15,17,15,15,
134.8823 +	15,17,16,16,16,17,16,18,16,17,17,18,17,13,14,14,
134.8824 +	15,16,14,15,15,16,17,14,15,15,16,16,16,17,17,17,
134.8825 +	18,16,16,16,17,16,10,11,11,14,13,11,12,12,14,14,
134.8826 +	11,12,12,15,13,13,14,14,16,15,13,14,14,16,15,11,
134.8827 +	12,12,14,14,12,13,13,15,15,12,13,13,15,15,14,15,
134.8828 +	15,16,17,14,15,15,17,16,11,12,11,14,12,12,13,13,
134.8829 +	15,13,12,13,12,15,13,14,15,15,16,15,14,15,14,17,
134.8830 +	14,13,14,14,16,16,14,15,15,16,17,14,15,15,16,17,
134.8831 +	16,16,17,17,18,16,17,17,18,18,13,14,14,16,13,14,
134.8832 +	15,15,17,14,14,15,14,17,14,16,17,16,17,16,16,17,
134.8833 +	16,18,15, 8,11,11,13,13,10,12,12,14,14,11,12,12,
134.8834 +	14,14,13,13,14,15,16,13,14,14,16,15,10,11,11,14,
134.8835 +	14,11,12,12,14,15,11,12,12,15,14,13,14,14,15,16,
134.8836 +	13,14,14,16,16,11,12,12,14,14,12,13,13,15,15,12,
134.8837 +	13,12,15,14,14,14,15,16,16,14,15,14,16,16,12,13,
134.8838 +	13,15,15,12,13,14,15,16,13,14,14,16,16,14,15,15,
134.8839 +	16,17,15,15,16,17,17,13,14,14,16,15,14,15,15,16,
134.8840 +	16,14,15,14,16,16,16,16,16,17,17,15,16,16,18,16,
134.8841 +	10,11,11,13,14,11,12,12,14,15,11,12,12,15,14,13,
134.8842 +	14,14,16,16,13,14,14,16,16,11,11,12,14,14,12,12,
134.8843 +	13,14,15,12,13,13,15,15,14,14,15,15,17,14,14,15,
134.8844 +	16,16,11,12,12,15,14,12,13,13,15,15,12,13,13,15,
134.8845 +	15,14,15,15,17,17,14,15,15,17,16,13,12,14,14,16,
134.8846 +	13,13,15,14,17,14,13,15,15,17,15,14,16,15,18,16,
134.8847 +	15,16,16,18,13,14,14,16,16,14,15,15,17,17,14,15,
134.8848 +	15,17,16,16,17,17,18,18,16,17,16,18,17,10,11,11,
134.8849 +	14,13,11,12,12,14,14,11,13,12,15,14,13,14,14,15,
134.8850 +	16,13,14,14,16,16,11,12,12,14,14,12,13,13,14,15,
134.8851 +	12,13,13,15,15,14,14,15,15,16,14,15,15,17,16,11,
134.8852 +	12,12,14,14,13,13,13,15,15,12,13,13,15,14,14,15,
134.8853 +	15,16,17,14,15,14,17,15,13,14,13,16,15,14,14,14,
134.8854 +	15,16,14,15,14,16,16,15,15,16,16,17,16,16,16,18,
134.8855 +	17,14,14,14,16,16,15,15,15,17,16,14,15,14,17,16,
134.8856 +	16,16,17,17,18,16,17,16,18,16,11,13,13,15,15,12,
134.8857 +	13,14,15,16,12,14,14,15,15,14,15,15,16,17,14,15,
134.8858 +	15,17,17,12,13,14,14,16,13,14,14,14,16,14,14,14,
134.8859 +	15,16,15,15,16,15,18,15,16,16,17,17,13,14,14,16,
134.8860 +	16,14,14,15,16,16,14,15,14,16,16,15,16,16,17,18,
134.8861 +	15,16,16,18,17,14,14,16,13,17,15,15,16,14,18,15,
134.8862 +	15,16,14,18,16,16,18,15,19,17,17,18,16,18,15,16,
134.8863 +	15,17,17,15,16,17,18,18,16,16,16,18,17,17,18,18,
134.8864 +	19,19,17,18,17,19,18,11,12,12,15,14,13,13,14,15,
134.8865 +	16,13,14,13,16,14,15,15,15,16,17,15,16,15,17,16,
134.8866 +	12,13,13,15,14,13,13,14,15,15,14,15,14,16,15,15,
134.8867 +	15,16,16,17,16,16,16,18,17,12,13,13,15,15,14,14,
134.8868 +	15,16,16,13,14,13,16,15,16,16,16,17,18,15,16,15,
134.8869 +	17,16,14,15,14,17,15,14,15,15,16,16,15,16,15,17,
134.8870 +	16,16,15,16,15,17,17,18,17,18,17,15,15,15,16,17,
134.8871 +	16,16,16,17,17,15,16,15,17,16,17,18,18,18,18,16,
134.8872 +	17,16,18,15, 8,11,11,13,13,11,12,12,14,14,10,12,
134.8873 +	12,14,14,13,14,14,15,16,13,14,13,16,15,11,12,12,
134.8874 +	14,14,12,12,13,14,15,12,13,13,15,15,14,14,15,15,
134.8875 +	16,14,14,14,16,16,10,11,11,14,14,11,12,12,14,15,
134.8876 +	11,12,12,15,14,13,14,14,16,16,13,14,14,16,15,13,
134.8877 +	14,14,15,16,14,14,15,16,16,14,15,15,16,16,15,16,
134.8878 +	16,16,18,16,16,16,17,17,12,13,13,15,15,13,14,14,
134.8879 +	16,16,12,14,13,16,15,15,16,15,17,17,14,16,15,17,
134.8880 +	16,10,11,11,13,14,11,12,13,14,15,11,13,12,14,14,
134.8881 +	14,14,15,16,16,13,14,14,16,16,11,12,12,14,14,12,
134.8882 +	13,13,14,15,13,14,13,15,15,14,15,15,16,17,14,15,
134.8883 +	15,17,16,11,12,12,14,14,12,13,13,15,15,12,13,12,
134.8884 +	15,14,14,15,15,16,17,14,15,15,16,16,14,14,14,16,
134.8885 +	16,14,14,15,16,16,15,15,15,16,16,16,16,17,16,18,
134.8886 +	16,17,17,18,18,13,13,14,15,16,14,14,15,16,17,13,
134.8887 +	14,14,16,16,16,16,17,17,18,15,16,15,17,16,10,11,
134.8888 +	11,14,13,11,12,12,14,14,11,12,12,15,14,13,14,14,
134.8889 +	16,16,13,14,14,16,16,11,12,12,14,14,12,13,13,15,
134.8890 +	15,12,13,13,15,15,14,15,15,16,17,14,15,15,17,16,
134.8891 +	11,12,11,14,14,12,13,13,15,15,12,13,12,15,14,14,
134.8892 +	15,14,16,16,14,15,14,17,16,14,14,14,16,16,14,15,
134.8893 +	15,16,17,14,15,15,17,17,16,16,17,17,18,16,17,17,
134.8894 +	18,18,13,14,12,16,14,14,15,13,17,15,13,15,13,17,
134.8895 +	14,16,16,15,18,16,15,17,14,18,15,11,12,12,14,15,
134.8896 +	13,13,14,14,16,13,14,13,15,14,15,15,16,16,17,15,
134.8897 +	16,15,17,16,12,13,13,15,15,13,13,14,15,16,14,15,
134.8898 +	14,16,16,15,15,16,15,18,16,16,16,18,17,12,13,13,
134.8899 +	15,15,14,14,15,15,16,13,14,13,15,15,16,16,16,16,
134.8900 +	18,15,16,15,17,16,15,15,15,17,16,15,15,16,16,17,
134.8901 +	16,16,16,18,17,16,16,17,15,18,17,18,17,19,18,14,
134.8902 +	14,15,15,17,15,15,16,16,17,14,15,15,16,16,17,17,
134.8903 +	18,17,19,16,17,15,17,15,11,13,12,15,15,12,14,14,
134.8904 +	15,15,12,14,13,16,15,15,15,15,17,17,14,15,15,17,
134.8905 +	16,12,14,14,16,16,14,14,15,16,16,14,14,14,16,16,
134.8906 +	15,16,17,17,18,15,16,16,18,17,12,14,13,16,14,13,
134.8907 +	14,14,16,15,13,15,14,16,14,15,16,16,17,17,15,16,
134.8908 +	15,18,15,15,15,16,17,17,15,16,16,17,18,16,16,16,
134.8909 +	18,18,17,17,18,18,19,17,17,18,19,19,14,15,14,17,
134.8910 +	13,15,16,15,18,14,15,16,15,18,14,17,18,17,18,16,
134.8911 +	16,18,16,19,15,
134.8912 +};
134.8913 +
134.8914 +static const static_codebook _44p8_p2_0 = {
134.8915 +	5, 3125,
134.8916 +	(long *)_vq_lengthlist__44p8_p2_0,
134.8917 +	1, -533725184, 1611661312, 3, 0,
134.8918 +	(long *)_vq_quantlist__44p8_p2_0,
134.8919 +	0
134.8920 +};
134.8921 +
134.8922 +static const long _vq_quantlist__44p8_p3_0[] = {
134.8923 +	1,
134.8924 +	0,
134.8925 +	2,
134.8926 +};
134.8927 +
134.8928 +static const long _vq_lengthlist__44p8_p3_0[] = {
134.8929 +	 2, 5, 5, 5, 7, 7, 5, 7, 7, 5, 7, 7, 7, 8, 9, 7,
134.8930 +	 9, 9, 5, 7, 7, 7, 9, 9, 7, 9, 8, 5, 7, 8, 7, 9,
134.8931 +	10, 8, 9, 9, 8, 9,10, 9,10,12,10,11,11, 8,10, 9,
134.8932 +	10,11,12, 9,11,10, 5, 8, 7, 8,10, 9, 7,10, 9, 8,
134.8933 +	 9,10, 9,10,11,10,12,11, 8,10, 9,10,11,11, 9,12,
134.8934 +	10, 5, 8, 8, 7, 9,10, 8,10, 9, 7, 9,10, 9,10,11,
134.8935 +	 9,11,11, 8,10, 9,10,11,11,10,12,10, 7, 9,10, 9,
134.8936 +	10,12, 9,11,11, 9, 9,12,11,10,13,11,11,13,10,12,
134.8937 +	11,11,13,13,11,13,12, 7, 9, 9, 9,11,11, 9,12,11,
134.8938 +	 9,11,10,10,11,12,11,13,12, 9,11,11,12,13,13,11,
134.8939 +	13,11, 5, 8, 8, 8, 9,10, 7,10, 9, 8, 9,10,10,10,
134.8940 +	12,10,11,11, 7,10, 9, 9,11,11, 9,11,10, 7, 9, 9,
134.8941 +	 9,11,12, 9,11,11, 9,11,11,11,11,13,12,13,13, 9,
134.8942 +	10,11,11,12,13,10,12,11, 7,10, 9, 9,11,11, 9,12,
134.8943 +	10,10,11,12,11,12,13,12,13,13, 9,12, 9,11,13,11,
134.8944 +	10,13,10,
134.8945 +};
134.8946 +
134.8947 +static const static_codebook _44p8_p3_0 = {
134.8948 +	5, 243,
134.8949 +	(long *)_vq_lengthlist__44p8_p3_0,
134.8950 +	1, -533200896, 1614282752, 2, 0,
134.8951 +	(long *)_vq_quantlist__44p8_p3_0,
134.8952 +	0
134.8953 +};
134.8954 +
134.8955 +static const long _vq_quantlist__44p8_p3_1[] = {
134.8956 +	1,
134.8957 +	0,
134.8958 +	2,
134.8959 +};
134.8960 +
134.8961 +static const long _vq_lengthlist__44p8_p3_1[] = {
134.8962 +	 6, 7, 7, 7, 7, 8, 7, 8, 7, 7, 7, 8, 7, 8, 8, 8,
134.8963 +	 8, 8, 7, 8, 7, 7, 8, 8, 7, 8, 8, 7, 8, 8, 8, 8,
134.8964 +	 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
134.8965 +	 8, 8, 8, 8, 8, 8, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8,
134.8966 +	 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
134.8967 +	 8, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
134.8968 +	 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 8, 8, 8,
134.8969 +	 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 8, 8, 9, 8, 8,
134.8970 +	 8, 8, 9, 9, 8, 9, 9, 7, 8, 8, 8, 8, 8, 8, 8, 8,
134.8971 +	 8, 8, 8, 8, 8, 8, 8, 9, 8, 8, 8, 8, 8, 9, 9, 8,
134.8972 +	 9, 8, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
134.8973 +	 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 8, 8,
134.8974 +	 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 8, 9, 9, 8,
134.8975 +	 8, 8, 8, 8, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
134.8976 +	 8, 8, 8, 8, 8, 9, 9, 8, 9, 9, 8, 8, 8, 8, 9, 8,
134.8977 +	 8, 9, 8,
134.8978 +};
134.8979 +
134.8980 +static const static_codebook _44p8_p3_1 = {
134.8981 +	5, 243,
134.8982 +	(long *)_vq_lengthlist__44p8_p3_1,
134.8983 +	1, -535822336, 1611661312, 2, 0,
134.8984 +	(long *)_vq_quantlist__44p8_p3_1,
134.8985 +	0
134.8986 +};
134.8987 +
134.8988 +static const long _vq_quantlist__44p8_p4_0[] = {
134.8989 +	1,
134.8990 +	0,
134.8991 +	2,
134.8992 +};
134.8993 +
134.8994 +static const long _vq_lengthlist__44p8_p4_0[] = {
134.8995 +	 2, 5, 5, 4, 7, 8, 4, 8, 7, 5, 7, 8, 7, 7,10, 8,
134.8996 +	 9, 9, 5, 7, 7, 8, 9, 9, 7,10, 7, 5, 7, 8, 8, 9,
134.8997 +	11, 8,10,10, 8, 9,10,10,10,12,11,12,12, 8,10,10,
134.8998 +	10,12,12,10,12,11, 5, 8, 7, 8,10,10, 8,11, 9, 8,
134.8999 +	10,10,10,11,12,10,12,12, 8,10, 9,11,12,12,10,12,
134.9000 +	10, 5, 8, 8, 7,10,10, 8,11,10, 7, 9,10, 9,10,12,
134.9001 +	10,12,12, 8,10,10,10,12,12,10,12,11, 7, 9,10, 9,
134.9002 +	11,12,10,12,11, 9, 9,12,10,10,13,12,12,13,10,12,
134.9003 +	11,12,13,13,11,13,11, 7,10, 9,10,11,12,10,13,11,
134.9004 +	 9,11,11,11,11,13,12,14,13,10,11,11,12,14,14,11,
134.9005 +	14,11, 5, 8, 8, 8,10,11, 7,10,10, 8,10,10,10,11,
134.9006 +	12,10,12,12, 7,10, 9,10,12,12, 9,12,10, 7, 9,10,
134.9007 +	10,11,13,10,12,11,10,11,11,11,11,14,12,14,14, 9,
134.9008 +	11,11,12,13,14,11,13,11, 7,10, 9,10,11,12, 9,12,
134.9009 +	10,10,11,12,11,11,13,12,13,13, 9,12, 9,12,13,12,
134.9010 +	10,13,10,
134.9011 +};
134.9012 +
134.9013 +static const static_codebook _44p8_p4_0 = {
134.9014 +	5, 243,
134.9015 +	(long *)_vq_lengthlist__44p8_p4_0,
134.9016 +	1, -531365888, 1616117760, 2, 0,
134.9017 +	(long *)_vq_quantlist__44p8_p4_0,
134.9018 +	0
134.9019 +};
134.9020 +
134.9021 +static const long _vq_quantlist__44p8_p4_1[] = {
134.9022 +	2,
134.9023 +	1,
134.9024 +	3,
134.9025 +	0,
134.9026 +	4,
134.9027 +};
134.9028 +
134.9029 +static const long _vq_lengthlist__44p8_p4_1[] = {
134.9030 +	 7, 9, 9,10,10, 9,10,10,10,11, 9,10,10,11,10, 9,
134.9031 +	10,10,11,11, 9,10,10,11,11, 9,10,10,11,11,10,10,
134.9032 +	10,11,11,10,10,10,11,11,10,11,11,11,11,10,11,11,
134.9033 +	11,11, 9,10,10,11,11,10,10,10,11,11, 9,10,10,11,
134.9034 +	11,10,11,11,11,11,10,11,11,11,11,10,11,11,11,11,
134.9035 +	10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
134.9036 +	11,11,11,12,10,11,11,11,11,11,11,11,11,11,10,11,
134.9037 +	11,11,11,11,11,11,11,11,11,11,11,11,11, 9,10,10,
134.9038 +	11,11,10,10,11,11,11,10,10,11,11,11,10,11,11,11,
134.9039 +	12,10,11,11,12,12,10,10,11,11,11,10,11,11,11,12,
134.9040 +	11,11,11,12,12,11,11,12,12,12,11,11,12,12,12,10,
134.9041 +	11,11,11,11,11,11,11,12,12,10,11,11,12,12,11,12,
134.9042 +	11,12,12,11,12,11,12,12,11,11,11,11,12,11,11,12,
134.9043 +	12,12,11,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.9044 +	12,11,11,11,12,12,11,12,12,12,12,11,12,11,12,12,
134.9045 +	12,12,12,12,12,12,12,12,12,12, 9,10,10,11,11,10,
134.9046 +	11,10,11,11,10,11,10,11,11,10,11,11,12,12,10,11,
134.9047 +	11,12,11,10,11,11,11,11,10,11,11,11,12,11,11,11,
134.9048 +	12,12,11,11,12,12,12,11,11,11,12,12,10,11,10,11,
134.9049 +	11,11,11,11,12,12,10,11,11,12,11,11,12,11,12,12,
134.9050 +	11,12,11,12,12,11,11,11,12,12,11,11,12,12,12,11,
134.9051 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,11,11,
134.9052 +	11,12,11,11,12,12,12,12,11,12,11,12,12,12,12,12,
134.9053 +	12,12,12,12,12,12,12,10,11,11,11,11,11,11,11,12,
134.9054 +	12,11,11,11,12,12,11,12,12,12,12,11,12,12,12,12,
134.9055 +	11,11,11,12,12,11,11,12,12,12,11,12,12,12,12,12,
134.9056 +	12,12,12,12,12,12,12,12,12,11,11,11,12,12,11,12,
134.9057 +	12,12,12,11,12,12,12,12,12,12,12,12,12,12,12,12,
134.9058 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.9059 +	12,12,12,13,12,13,12,12,12,12,13,12,12,12,12,12,
134.9060 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.9061 +	12,12,13,12,10,11,11,11,11,11,11,11,12,12,11,11,
134.9062 +	11,12,12,11,12,12,12,12,11,12,12,12,12,11,11,11,
134.9063 +	12,12,11,12,12,12,12,11,12,12,12,12,12,12,12,12,
134.9064 +	12,12,12,12,12,12,11,11,11,12,12,11,12,12,12,12,
134.9065 +	11,12,11,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.9066 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.9067 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.9068 +	12,12,12,12,12,12,12,12,12,12,13,12,12,13,12,13,
134.9069 +	12, 9,10,10,11,11,10,10,11,11,11,10,11,10,11,11,
134.9070 +	10,11,11,12,12,10,11,11,12,12,10,10,11,11,11,10,
134.9071 +	11,11,11,12,10,11,11,12,12,11,11,12,12,12,11,11,
134.9072 +	11,12,12,10,11,10,11,11,11,11,11,12,12,10,11,11,
134.9073 +	12,11,11,12,11,12,12,11,12,11,12,12,11,11,11,11,
134.9074 +	12,11,11,12,12,12,11,12,12,12,12,11,12,12,12,12,
134.9075 +	11,12,12,12,12,11,11,11,12,11,11,12,12,12,12,11,
134.9076 +	12,11,12,12,12,12,12,12,12,12,12,12,12,12,10,10,
134.9077 +	11,11,11,10,11,11,12,12,10,11,11,12,12,11,11,11,
134.9078 +	12,12,11,11,12,12,12,10,11,11,11,12,11,11,12,12,
134.9079 +	12,11,11,12,12,12,11,11,12,12,12,11,12,12,12,12,
134.9080 +	11,11,11,12,12,11,12,12,12,12,11,12,11,12,12,11,
134.9081 +	12,12,12,12,11,12,12,12,12,11,11,12,12,12,11,12,
134.9082 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.9083 +	12,12,11,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.9084 +	12,12,12,12,12,12,12,12,12,12,12, 9,10,10,11,11,
134.9085 +	10,11,11,11,12,10,11,11,12,11,11,12,11,12,12,11,
134.9086 +	12,11,12,12,10,11,11,12,11,11,11,11,12,12,11,12,
134.9087 +	11,12,12,11,12,12,12,12,11,12,12,12,12,10,11,11,
134.9088 +	12,12,11,12,11,12,12,11,12,11,12,12,12,12,12,12,
134.9089 +	12,11,12,12,12,12,11,12,11,12,12,11,12,12,12,12,
134.9090 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,11,
134.9091 +	12,12,12,12,12,12,12,12,12,11,12,12,12,12,12,12,
134.9092 +	12,12,12,12,12,12,12,12,11,11,11,12,12,11,12,12,
134.9093 +	12,12,11,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.9094 +	12,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.9095 +	12,12,12,12,13,12,12,12,12,12,11,12,12,12,12,12,
134.9096 +	12,12,12,12,12,12,12,12,12,12,12,12,13,13,12,12,
134.9097 +	12,13,13,12,12,12,12,12,12,12,12,12,13,12,12,12,
134.9098 +	12,13,12,12,13,12,13,12,13,13,13,13,12,12,12,12,
134.9099 +	12,12,12,12,13,12,12,12,12,13,12,12,13,13,13,13,
134.9100 +	12,13,13,13,13,10,11,11,12,12,11,12,12,12,12,11,
134.9101 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,11,11,
134.9102 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.9103 +	12,12,12,12,12,12,12,11,12,12,12,12,12,12,12,12,
134.9104 +	12,12,12,12,13,12,12,12,12,13,13,12,12,12,13,12,
134.9105 +	12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,12,
134.9106 +	13,13,12,13,12,13,13,13,13,12,12,12,12,12,12,12,
134.9107 +	12,13,12,12,12,12,13,12,12,13,13,13,13,12,13,13,
134.9108 +	13,13, 9,10,10,11,11,10,10,11,11,11,10,11,10,11,
134.9109 +	11,10,11,11,12,12,10,11,11,12,12,10,11,11,11,11,
134.9110 +	10,11,11,12,12,11,11,11,12,12,11,11,12,12,12,11,
134.9111 +	11,12,12,12,10,11,10,11,11,10,11,11,12,12,10,11,
134.9112 +	11,12,11,11,12,11,12,12,11,11,11,12,12,11,11,11,
134.9113 +	11,12,11,11,12,12,12,11,12,12,12,12,12,12,12,12,
134.9114 +	12,12,12,12,12,12,11,11,11,12,11,11,12,12,12,12,
134.9115 +	11,12,11,12,12,12,12,12,12,12,11,12,12,12,12, 9,
134.9116 +	10,10,11,11,10,11,11,11,12,10,11,11,12,11,11,11,
134.9117 +	12,12,12,11,11,12,12,12,10,11,11,12,12,11,11,12,
134.9118 +	12,12,11,11,12,12,12,12,12,12,12,12,12,12,12,12,
134.9119 +	12,10,11,11,12,12,11,11,11,12,12,11,11,11,12,12,
134.9120 +	11,12,12,12,12,11,12,12,12,12,11,12,12,12,12,11,
134.9121 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.9122 +	12,12,12,11,11,12,12,12,12,12,12,12,12,11,12,12,
134.9123 +	12,12,12,12,12,12,12,12,12,12,12,12,10,11,10,11,
134.9124 +	11,10,11,11,12,12,10,11,11,12,12,11,11,11,12,12,
134.9125 +	11,12,11,12,12,11,11,11,12,12,11,11,12,12,12,11,
134.9126 +	11,12,12,12,11,12,12,12,12,11,12,12,12,12,10,11,
134.9127 +	11,12,11,11,12,11,12,12,11,12,11,12,12,11,12,12,
134.9128 +	12,12,11,12,11,12,12,11,12,12,12,12,12,12,12,12,
134.9129 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.9130 +	11,12,11,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.9131 +	12,12,12,12,12,12,12,12,12,11,11,11,12,12,11,11,
134.9132 +	12,12,12,11,12,12,12,12,12,12,12,12,12,12,12,12,
134.9133 +	12,12,11,12,12,12,12,12,12,12,12,13,12,12,12,12,
134.9134 +	12,12,12,12,13,13,12,12,12,13,13,11,12,12,12,12,
134.9135 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,12,
134.9136 +	12,12,12,12,12,12,12,12,12,12,12,13,12,13,12,12,
134.9137 +	12,13,13,12,13,13,12,13,12,13,13,13,13,12,12,12,
134.9138 +	12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,
134.9139 +	13,12,13,12,13,12,11,11,11,12,12,11,12,12,12,12,
134.9140 +	11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,11,
134.9141 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.9142 +	12,13,13,12,12,12,13,13,11,12,11,12,12,12,12,12,
134.9143 +	12,12,12,12,12,12,12,12,12,12,13,12,12,12,12,13,
134.9144 +	12,12,12,12,12,12,12,12,12,13,13,12,12,12,12,13,
134.9145 +	12,13,13,13,13,12,13,13,13,13,12,12,12,12,12,12,
134.9146 +	12,12,13,12,12,12,12,13,12,12,13,13,13,13,12,13,
134.9147 +	13,13,12,10,11,11,12,12,11,11,11,12,12,11,11,11,
134.9148 +	12,12,11,12,12,12,12,11,12,12,12,12,11,11,11,12,
134.9149 +	12,11,11,12,12,12,11,12,12,12,12,11,12,12,12,12,
134.9150 +	12,12,12,12,12,11,11,11,12,12,11,12,12,12,12,11,
134.9151 +	12,11,12,12,12,12,12,12,12,12,12,12,12,12,11,12,
134.9152 +	12,12,12,11,12,12,12,12,12,12,12,12,12,12,12,12,
134.9153 +	12,13,12,12,12,12,12,11,12,12,12,12,12,12,12,12,
134.9154 +	12,12,12,12,12,12,12,12,12,13,12,12,12,12,12,12,
134.9155 +	11,11,11,12,12,11,12,12,12,12,11,12,12,12,12,12,
134.9156 +	12,12,12,12,11,12,12,12,12,11,11,12,12,12,11,12,
134.9157 +	12,12,12,12,12,12,12,12,12,12,12,12,13,12,12,12,
134.9158 +	13,13,11,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.9159 +	12,12,12,12,13,13,12,12,12,13,13,12,12,12,12,12,
134.9160 +	12,12,12,12,13,12,12,12,12,13,12,12,13,12,13,12,
134.9161 +	12,13,13,13,12,12,12,12,12,12,12,12,12,13,12,12,
134.9162 +	12,13,12,12,13,13,13,13,12,13,13,13,13,10,11,11,
134.9163 +	12,12,11,12,12,12,12,11,12,12,12,12,11,12,12,12,
134.9164 +	12,12,12,12,12,12,11,11,12,12,12,11,12,12,12,12,
134.9165 +	12,12,12,12,12,12,12,12,12,13,12,12,12,13,13,11,
134.9166 +	12,11,12,12,12,12,12,12,12,11,12,12,12,12,12,12,
134.9167 +	12,13,13,12,12,12,13,12,12,12,12,12,12,12,12,12,
134.9168 +	12,12,12,12,12,13,12,12,12,12,12,13,12,13,12,13,
134.9169 +	13,12,12,12,12,12,12,12,12,13,12,12,12,12,13,12,
134.9170 +	12,13,12,13,13,12,13,12,13,12,11,11,11,12,12,11,
134.9171 +	12,12,12,12,11,12,12,12,12,12,12,12,12,12,12,12,
134.9172 +	12,12,12,11,12,12,12,12,12,12,12,12,12,12,12,12,
134.9173 +	12,12,12,12,13,12,13,12,12,13,13,13,11,12,12,12,
134.9174 +	12,12,12,12,12,12,12,12,12,13,12,12,12,12,13,13,
134.9175 +	12,12,12,13,12,12,12,12,12,12,12,12,13,12,13,12,
134.9176 +	12,12,12,13,12,12,13,12,13,12,13,13,12,13,12,12,
134.9177 +	12,12,12,12,13,13,13,12,12,12,12,13,12,12,13,13,
134.9178 +	13,13,12,13,13,13,12,11,11,11,12,12,11,12,12,12,
134.9179 +	12,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.9180 +	11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.9181 +	12,12,12,13,12,12,13,13,13,11,12,12,12,12,12,12,
134.9182 +	12,12,13,12,12,12,13,12,12,13,12,13,13,12,13,12,
134.9183 +	13,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.9184 +	12,12,12,13,12,13,12,13,13,13,12,12,12,12,12,12,
134.9185 +	12,13,12,13,12,12,12,12,13,12,12,13,13,13,12,12,
134.9186 +	13,12,13,12,10,11,11,12,12,11,11,11,12,12,11,11,
134.9187 +	11,12,12,11,12,12,12,12,11,12,12,12,12,11,11,11,
134.9188 +	12,12,11,11,12,12,12,11,12,12,12,12,12,12,12,12,
134.9189 +	12,12,12,12,12,12,11,11,11,12,12,11,12,12,12,12,
134.9190 +	11,12,11,12,12,12,12,12,12,12,11,12,12,12,12,11,
134.9191 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.9192 +	12,12,13,12,12,12,12,12,11,12,12,12,12,12,12,12,
134.9193 +	12,12,11,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.9194 +	12,10,11,11,12,12,11,11,12,12,12,11,12,12,12,12,
134.9195 +	11,12,12,12,12,12,12,12,12,12,11,11,12,12,12,12,
134.9196 +	12,12,12,12,12,12,12,12,12,12,12,12,12,13,12,12,
134.9197 +	12,13,13,11,11,11,12,12,12,12,12,12,12,11,12,12,
134.9198 +	12,12,12,12,12,13,13,12,12,12,13,13,12,12,12,12,
134.9199 +	12,12,12,12,12,13,12,12,12,12,13,12,12,13,12,13,
134.9200 +	12,12,13,13,13,12,12,12,12,12,12,12,12,12,13,12,
134.9201 +	12,12,12,12,12,12,13,13,13,12,12,12,13,12,11,11,
134.9202 +	11,12,12,11,12,12,12,12,11,12,12,12,12,12,12,12,
134.9203 +	12,12,11,12,12,12,12,11,12,12,12,12,12,12,12,12,
134.9204 +	12,12,12,12,12,12,12,12,12,13,13,12,12,12,13,13,
134.9205 +	11,12,11,12,12,12,12,12,12,12,11,12,12,12,12,12,
134.9206 +	12,12,13,13,12,12,12,13,12,12,12,12,12,12,12,12,
134.9207 +	12,12,13,12,12,12,13,13,12,13,13,13,13,12,13,13,
134.9208 +	13,13,12,12,12,12,12,12,12,12,13,12,12,12,12,13,
134.9209 +	12,12,13,12,13,13,12,13,12,13,12,11,11,11,12,12,
134.9210 +	11,12,12,12,12,11,12,12,12,12,12,12,12,12,12,12,
134.9211 +	12,12,12,12,11,12,12,12,12,12,12,12,12,13,12,12,
134.9212 +	12,13,13,12,12,13,12,13,12,12,13,13,13,11,12,12,
134.9213 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,
134.9214 +	13,12,12,12,13,12,12,12,12,12,12,12,12,12,12,13,
134.9215 +	12,12,12,13,13,12,12,13,12,13,12,13,13,13,13,12,
134.9216 +	12,12,12,12,12,12,13,12,13,12,12,12,12,12,12,13,
134.9217 +	13,12,12,12,13,12,12,12,11,11,11,12,12,11,12,12,
134.9218 +	12,12,11,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.9219 +	12,11,12,12,12,12,12,12,12,12,13,12,12,12,12,13,
134.9220 +	12,12,13,13,13,12,12,12,13,13,11,12,12,12,12,12,
134.9221 +	12,12,12,12,12,12,12,12,12,12,13,12,13,13,12,13,
134.9222 +	12,13,12,12,12,12,12,12,12,12,12,12,13,12,13,12,
134.9223 +	13,13,12,13,13,12,13,12,13,13,13,13,12,12,12,12,
134.9224 +	12,12,12,12,13,12,12,13,12,13,12,12,13,12,13,12,
134.9225 +	12,13,12,13,12,
134.9226 +};
134.9227 +
134.9228 +static const static_codebook _44p8_p4_1 = {
134.9229 +	5, 3125,
134.9230 +	(long *)_vq_lengthlist__44p8_p4_1,
134.9231 +	1, -533725184, 1611661312, 3, 0,
134.9232 +	(long *)_vq_quantlist__44p8_p4_1,
134.9233 +	0
134.9234 +};
134.9235 +
134.9236 +static const long _vq_quantlist__44p8_p5_0[] = {
134.9237 +	2,
134.9238 +	1,
134.9239 +	3,
134.9240 +	0,
134.9241 +	4,
134.9242 +};
134.9243 +
134.9244 +static const long _vq_lengthlist__44p8_p5_0[] = {
134.9245 +	 2, 6, 6, 9, 9, 5, 7, 8,10,11, 5, 8, 7,11,10, 8,
134.9246 +	10,11,12,13, 8,11,10,13,12, 6, 7, 8,10,11, 7, 8,
134.9247 +	10,10,12, 8, 9, 9,12,12,10,10,12,12,14,10,12,12,
134.9248 +	14,13, 6, 8, 7,11,10, 8, 9, 9,12,12, 7,10, 8,12,
134.9249 +	11,10,12,12,13,14,10,12,10,14,12, 9,10,11,11,13,
134.9250 +	10,10,11,11,13,11,12,12,13,14,12,12,13,11,15,13,
134.9251 +	14,14,15,14, 9,11,10,13,11,11,12,12,13,13,10,11,
134.9252 +	10,13,11,13,14,14,15,15,12,13,12,15,11, 6, 8, 9,
134.9253 +	11,12, 8, 9,11,12,13, 8,10,10,13,13,11,12,13,14,
134.9254 +	15,11,12,13,14,14, 9, 9,10,12,13,10,10,12,12,14,
134.9255 +	10,11,11,13,14,12,12,14,14,15,13,13,14,15,15, 9,
134.9256 +	10,10,13,13,10,11,11,13,14,10,11,10,14,13,13,13,
134.9257 +	14,15,15,12,14,13,15,14,12,12,13,13,14,12,13,14,
134.9258 +	13,15,13,14,14,15,15,14,14,15,14,16,15,15,15,16,
134.9259 +	16,12,13,13,14,14,13,14,14,15,15,12,14,13,15,14,
134.9260 +	14,15,15,16,16,14,15,14,16,14, 6, 9, 8,12,11, 8,
134.9261 +	10,10,13,13, 8,11, 9,13,12,11,12,12,14,14,11,13,
134.9262 +	12,15,14, 9,10,10,13,13,10,10,11,13,14,10,12,11,
134.9263 +	14,13,12,13,14,14,15,13,13,13,15,14, 9,10, 9,13,
134.9264 +	12,10,11,11,14,13,10,12,10,14,12,13,14,13,15,15,
134.9265 +	12,14,12,15,14,12,13,13,14,14,13,13,13,14,15,13,
134.9266 +	14,14,15,15,14,14,15,14,16,14,15,15,16,16,12,13,
134.9267 +	12,14,13,13,14,14,15,15,12,14,13,15,13,15,15,15,
134.9268 +	16,16,14,15,14,16,14,11,12,12,13,14,12,13,14,14,
134.9269 +	16,12,13,13,15,15,14,14,16,15,17,14,15,15,16,16,
134.9270 +	12,13,14,14,15,13,13,15,15,16,14,14,14,15,16,15,
134.9271 +	15,16,16,17,15,15,16,16,17,13,13,13,15,15,14,14,
134.9272 +	15,15,16,13,14,14,15,16,15,15,16,16,17,15,16,15,
134.9273 +	17,16,14,15,15,16,16,15,15,16,16,17,15,16,16,17,
134.9274 +	17,16,16,17,16,18,16,17,17,17,17,15,15,15,16,16,
134.9275 +	15,16,16,17,17,15,16,16,17,16,16,17,17,18,18,16,
134.9276 +	17,16,17,16,11,12,12,15,13,13,13,13,15,15,12,14,
134.9277 +	13,16,14,14,15,15,16,16,14,15,14,17,15,13,13,13,
134.9278 +	15,14,13,14,14,16,15,14,14,14,16,15,15,15,16,16,
134.9279 +	17,15,16,15,17,16,12,14,13,15,14,14,14,14,16,15,
134.9280 +	13,14,13,16,15,15,16,16,17,16,15,16,15,17,16,15,
134.9281 +	15,15,16,16,15,15,16,16,17,15,16,16,17,17,16,16,
134.9282 +	17,17,17,17,17,17,18,17,14,15,15,16,16,15,16,16,
134.9283 +	17,16,15,16,15,17,16,17,17,17,18,17,16,17,16,18,
134.9284 +	16, 6, 9, 9,12,12, 8,10,10,12,13, 8,10,10,13,12,
134.9285 +	10,12,12,14,15,11,13,12,15,14, 8, 9,10,12,13, 9,
134.9286 +	10,11,13,14,10,11,11,14,13,12,12,13,14,15,12,13,
134.9287 +	13,15,15, 8,10,10,13,13,10,11,11,13,14,10,12,10,
134.9288 +	14,13,12,13,13,15,15,12,14,13,15,14,11,12,12,13,
134.9289 +	14,12,12,13,13,15,12,13,13,15,15,14,13,15,14,16,
134.9290 +	14,15,15,16,16,12,13,13,14,14,13,13,14,15,14,12,
134.9291 +	14,13,15,14,14,15,15,16,15,14,15,14,16,14, 7, 9,
134.9292 +	10,12,12, 9,10,11,13,14, 9,11,10,13,13,11,12,13,
134.9293 +	14,15,12,13,13,15,14, 9,10,11,12,13,10,10,12,13,
134.9294 +	14,11,11,12,14,14,12,12,14,14,15,13,13,14,15,15,
134.9295 +	 9,11,11,13,13,11,12,12,14,14,10,12,10,14,13,13,
134.9296 +	14,14,15,15,13,14,13,16,14,12,12,13,14,15,13,13,
134.9297 +	14,14,16,13,14,14,15,15,14,14,15,14,17,14,15,15,
134.9298 +	16,16,12,13,13,15,14,13,14,14,15,15,13,14,13,16,
134.9299 +	14,15,15,15,16,16,14,15,14,16,14, 7,10, 9,13,12,
134.9300 +	10,11,12,12,14,10,12,11,14,12,12,13,13,14,15,12,
134.9301 +	14,13,15,14, 9,11,10,13,13,10,11,12,13,14,12,13,
134.9302 +	12,15,13,13,13,14,13,15,13,14,14,16,15,10,11,11,
134.9303 +	13,13,12,12,13,14,14,11,12,11,14,13,14,14,14,15,
134.9304 +	16,13,14,13,16,13,12,13,13,14,14,12,13,13,14,15,
134.9305 +	14,14,14,15,15,14,13,15,13,16,15,15,15,17,16,13,
134.9306 +	13,13,14,14,14,14,14,15,15,12,13,13,15,14,15,16,
134.9307 +	16,16,16,14,15,14,16,13,11,12,13,14,15,12,13,14,
134.9308 +	15,16,13,14,14,15,15,14,14,15,15,17,14,15,15,16,
134.9309 +	16,13,13,14,14,15,13,13,15,14,16,14,14,15,15,16,
134.9310 +	15,14,16,15,17,15,16,16,16,17,13,14,14,15,15,14,
134.9311 +	14,15,16,16,13,15,14,16,16,15,16,16,17,17,15,16,
134.9312 +	15,17,16,14,15,15,15,17,15,15,16,15,17,15,16,16,
134.9313 +	16,17,16,16,17,16,18,17,17,17,17,18,15,15,15,17,
134.9314 +	16,15,16,16,17,17,15,16,16,17,16,16,17,17,18,18,
134.9315 +	16,17,16,18,17,11,13,12,15,14,13,13,14,15,15,13,
134.9316 +	14,13,16,14,15,15,15,16,16,15,16,15,17,16,13,14,
134.9317 +	13,15,14,13,13,14,15,15,14,15,14,16,15,15,15,16,
134.9318 +	16,16,15,16,15,18,16,13,14,14,15,15,14,15,15,15,
134.9319 +	16,13,15,13,16,15,15,16,16,17,17,15,16,15,17,16,
134.9320 +	15,15,15,16,16,15,15,15,16,17,16,16,16,17,16,16,
134.9321 +	16,17,16,17,17,17,17,18,17,15,15,15,16,16,16,16,
134.9322 +	16,17,17,15,16,15,17,16,17,17,17,18,18,16,17,16,
134.9323 +	17,15, 6, 9, 9,12,12, 8,10,10,12,13, 8,10,10,13,
134.9324 +	12,11,12,13,14,15,10,12,12,14,14, 9,10,10,13,13,
134.9325 +	10,10,12,13,14,10,11,11,14,13,12,13,14,14,15,12,
134.9326 +	13,13,15,15, 8,10, 9,13,12,10,11,11,13,14, 9,11,
134.9327 +	10,14,13,12,13,13,15,15,12,13,12,15,14,12,13,13,
134.9328 +	14,14,12,13,13,14,15,13,14,14,14,15,14,14,15,14,
134.9329 +	16,14,15,15,16,16,11,12,12,14,13,13,13,13,15,15,
134.9330 +	12,13,12,15,13,14,15,15,16,16,14,15,14,16,14, 7,
134.9331 +	 9,10,12,13,10,10,12,12,14,10,12,11,14,13,12,13,
134.9332 +	14,14,15,12,13,13,15,14,10,11,11,13,13,11,11,12,
134.9333 +	13,14,12,13,12,14,14,13,13,14,13,16,14,14,14,15,
134.9334 +	15, 9,10,11,13,14,12,12,13,13,15,10,12,10,14,13,
134.9335 +	13,14,14,15,16,13,14,13,15,13,13,14,13,14,15,12,
134.9336 +	13,13,14,15,14,14,14,15,15,14,13,15,13,16,15,16,
134.9337 +	16,16,16,12,13,13,14,14,14,14,14,15,15,12,13,13,
134.9338 +	15,14,15,15,16,16,16,14,15,13,16,13, 7,10, 9,12,
134.9339 +	12, 9,10,11,13,13, 9,11,10,14,13,12,13,13,14,15,
134.9340 +	11,13,12,15,14, 9,11,11,13,13,10,10,12,13,14,11,
134.9341 +	12,12,14,14,13,13,14,14,16,13,14,14,16,15, 9,11,
134.9342 +	10,13,12,11,12,11,14,14,10,12,10,14,13,13,14,13,
134.9343 +	15,15,12,14,12,16,14,12,13,13,14,15,13,13,14,14,
134.9344 +	16,13,14,14,15,15,14,14,15,14,16,15,15,15,16,16,
134.9345 +	12,13,12,15,14,13,14,14,15,15,12,14,13,16,14,14,
134.9346 +	15,15,16,16,14,15,14,17,14,11,12,13,14,15,13,13,
134.9347 +	14,14,16,13,14,13,15,15,15,15,16,16,17,15,15,15,
134.9348 +	16,16,13,14,13,15,15,13,13,15,15,16,14,15,15,16,
134.9349 +	16,15,15,16,15,17,16,16,16,17,17,13,13,14,14,15,
134.9350 +	14,14,15,15,16,13,14,13,15,15,15,16,16,16,17,15,
134.9351 +	16,15,16,16,15,15,15,16,16,15,15,16,16,17,16,16,
134.9352 +	16,17,17,16,16,17,16,18,17,17,17,18,18,15,15,15,
134.9353 +	16,16,16,16,16,17,17,15,15,15,16,16,17,17,17,17,
134.9354 +	18,16,16,16,17,15,11,13,12,15,14,13,13,14,15,15,
134.9355 +	12,14,13,16,14,14,15,15,16,16,14,15,14,16,15,13,
134.9356 +	14,14,15,15,13,14,14,16,16,14,15,14,16,16,15,15,
134.9357 +	16,17,17,15,16,16,17,17,13,14,13,15,14,14,14,14,
134.9358 +	16,15,13,15,13,16,14,15,16,15,17,16,15,16,14,17,
134.9359 +	15,14,16,15,16,17,15,16,16,16,17,15,16,16,17,17,
134.9360 +	16,16,17,17,18,16,17,17,18,17,14,15,15,17,15,15,
134.9361 +	16,16,17,16,15,16,15,17,15,16,17,17,18,17,16,17,
134.9362 +	16,18,15,10,12,12,14,14,12,13,13,15,15,12,13,13,
134.9363 +	15,15,13,14,14,15,16,14,15,14,16,16,12,13,13,15,
134.9364 +	15,12,13,14,15,15,13,14,14,15,15,14,14,15,16,17,
134.9365 +	14,15,15,17,16,12,13,13,15,15,13,14,14,15,16,13,
134.9366 +	14,14,16,15,14,15,15,16,17,14,15,15,17,16,13,14,
134.9367 +	14,15,16,14,14,15,15,16,14,15,15,16,16,15,15,16,
134.9368 +	16,17,15,16,16,17,17,14,15,15,16,16,15,15,15,16,
134.9369 +	16,15,15,15,16,16,16,17,16,17,17,16,16,16,18,16,
134.9370 +	11,12,12,14,14,12,13,14,15,15,12,13,13,15,15,13,
134.9371 +	14,15,16,16,14,15,15,16,16,12,13,13,15,15,13,13,
134.9372 +	14,15,16,13,14,14,15,16,14,14,15,16,17,15,15,15,
134.9373 +	16,17,12,13,13,15,15,13,14,14,15,16,13,14,14,16,
134.9374 +	15,15,15,15,16,17,15,16,15,17,16,14,14,15,15,16,
134.9375 +	14,14,15,15,17,15,15,16,16,17,15,15,16,15,18,16,
134.9376 +	16,16,17,17,14,15,15,16,16,15,16,16,17,17,15,15,
134.9377 +	15,17,16,16,17,16,17,17,16,16,16,18,16,11,12,12,
134.9378 +	14,14,13,13,14,15,15,13,14,13,15,15,14,15,15,16,
134.9379 +	16,14,15,15,16,16,12,13,13,15,15,13,13,14,15,15,
134.9380 +	14,14,14,16,15,15,15,15,15,16,15,16,15,17,16,12,
134.9381 +	13,13,15,15,14,14,15,15,16,13,14,13,16,15,15,15,
134.9382 +	16,16,17,15,16,15,17,15,14,15,14,16,16,14,15,15,
134.9383 +	16,16,15,16,15,17,16,15,15,16,15,17,16,17,16,17,
134.9384 +	17,14,15,15,16,16,15,16,16,16,17,14,15,15,16,16,
134.9385 +	16,17,17,17,18,16,16,16,17,16,12,13,13,15,15,13,
134.9386 +	13,14,15,16,13,14,14,16,15,14,15,15,16,17,14,15,
134.9387 +	15,17,16,13,14,14,15,16,14,14,15,15,17,14,15,15,
134.9388 +	16,16,15,14,16,15,17,15,16,16,17,17,13,14,14,16,
134.9389 +	16,14,15,15,16,16,14,15,14,16,16,15,16,16,17,17,
134.9390 +	15,16,15,17,16,15,15,16,15,17,15,15,16,15,17,15,
134.9391 +	16,16,16,17,16,15,17,15,18,17,17,17,17,17,15,15,
134.9392 +	15,17,17,16,16,16,17,17,15,16,15,17,17,16,17,17,
134.9393 +	18,18,16,17,15,18,15,11,12,12,15,15,13,13,15,14,
134.9394 +	16,13,14,13,16,14,15,15,16,16,17,15,16,15,17,15,
134.9395 +	12,14,13,16,14,13,13,14,14,16,14,15,14,16,15,15,
134.9396 +	15,16,15,17,16,16,16,17,16,12,13,14,15,16,15,15,
134.9397 +	15,15,16,13,15,13,16,14,16,16,16,17,17,15,16,15,
134.9398 +	17,15,15,16,15,16,15,14,14,15,16,16,16,16,16,17,
134.9399 +	16,15,15,16,15,17,17,17,17,18,17,15,15,15,16,16,
134.9400 +	16,16,16,16,17,14,15,15,17,16,17,17,17,17,18,15,
134.9401 +	16,15,18,14,10,12,12,14,14,12,13,13,15,15,12,13,
134.9402 +	13,15,15,14,14,15,15,16,13,15,14,16,16,12,13,13,
134.9403 +	15,15,13,14,14,15,16,13,14,14,15,15,14,15,15,16,
134.9404 +	17,14,15,15,17,16,12,13,13,15,15,13,14,14,15,15,
134.9405 +	12,14,13,15,15,14,15,15,16,17,14,15,14,17,15,14,
134.9406 +	15,15,16,16,14,15,15,16,17,15,15,15,17,16,16,16,
134.9407 +	16,16,17,16,16,16,17,17,13,14,14,16,15,14,15,15,
134.9408 +	16,16,14,15,14,16,16,15,16,16,17,17,15,16,15,17,
134.9409 +	16,11,12,12,14,15,13,13,14,14,15,13,14,13,15,15,
134.9410 +	14,15,15,16,16,14,15,15,16,16,12,14,13,15,15,13,
134.9411 +	13,14,15,16,14,15,14,16,15,15,15,16,15,17,15,16,
134.9412 +	16,17,16,12,13,13,15,15,14,14,15,15,16,13,14,13,
134.9413 +	16,15,15,15,16,16,17,15,15,15,16,16,14,15,15,16,
134.9414 +	16,14,15,15,16,16,15,16,16,17,17,16,16,16,16,17,
134.9415 +	16,17,17,18,17,14,14,15,15,16,15,15,16,16,17,14,
134.9416 +	15,15,16,16,16,16,16,17,17,15,16,15,17,15,11,12,
134.9417 +	12,14,14,12,13,14,15,15,12,13,13,15,15,14,15,15,
134.9418 +	16,16,13,15,14,16,16,12,13,13,15,15,13,14,14,15,
134.9419 +	16,13,14,14,16,16,15,15,15,16,17,15,15,15,17,16,
134.9420 +	12,13,13,15,15,13,14,14,16,15,13,14,13,16,15,15,
134.9421 +	16,15,17,17,14,15,14,17,16,14,15,15,16,16,15,15,
134.9422 +	16,16,17,15,16,16,17,17,16,16,16,16,18,16,17,16,
134.9423 +	18,17,14,15,14,16,15,15,15,15,17,16,14,15,14,17,
134.9424 +	15,16,17,16,17,17,15,16,15,17,15,11,12,12,15,15,
134.9425 +	13,13,15,14,16,13,15,13,16,14,15,15,16,15,17,15,
134.9426 +	16,15,17,16,12,14,13,15,15,13,13,15,15,16,15,15,
134.9427 +	15,16,15,15,15,16,15,17,16,16,16,17,16,12,13,14,
134.9428 +	15,16,14,14,15,15,16,13,14,13,16,14,16,16,16,16,
134.9429 +	17,15,16,15,17,15,15,16,15,16,16,14,15,15,16,16,
134.9430 +	16,16,16,17,16,15,15,16,15,17,17,17,17,18,17,15,
134.9431 +	15,15,15,16,16,16,16,16,17,14,15,14,16,15,17,17,
134.9432 +	17,17,18,15,16,15,17,15,12,13,13,15,15,13,14,14,
134.9433 +	15,16,13,14,14,16,15,14,15,15,16,17,14,15,15,17,
134.9434 +	16,13,14,14,16,15,13,14,15,16,16,14,15,15,16,16,
134.9435 +	15,15,16,16,17,15,16,16,17,17,13,14,13,16,15,14,
134.9436 +	15,15,16,16,13,15,14,16,15,15,16,16,17,17,15,16,
134.9437 +	14,17,15,15,15,16,17,17,15,15,16,16,17,16,16,16,
134.9438 +	17,17,16,15,17,16,18,17,17,17,18,18,15,15,15,17,
134.9439 +	14,16,16,16,17,16,15,16,15,17,15,16,17,17,18,17,
134.9440 +	16,17,15,18,15,
134.9441 +};
134.9442 +
134.9443 +static const static_codebook _44p8_p5_0 = {
134.9444 +	5, 3125,
134.9445 +	(long *)_vq_lengthlist__44p8_p5_0,
134.9446 +	1, -528744448, 1616642048, 3, 0,
134.9447 +	(long *)_vq_quantlist__44p8_p5_0,
134.9448 +	0
134.9449 +};
134.9450 +
134.9451 +static const long _vq_quantlist__44p8_p5_1[] = {
134.9452 +	3,
134.9453 +	2,
134.9454 +	4,
134.9455 +	1,
134.9456 +	5,
134.9457 +	0,
134.9458 +	6,
134.9459 +};
134.9460 +
134.9461 +static const long _vq_lengthlist__44p8_p5_1[] = {
134.9462 +	 2, 3, 3, 3, 3, 3, 3,
134.9463 +};
134.9464 +
134.9465 +static const static_codebook _44p8_p5_1 = {
134.9466 +	1, 7,
134.9467 +	(long *)_vq_lengthlist__44p8_p5_1,
134.9468 +	1, -533200896, 1611661312, 3, 0,
134.9469 +	(long *)_vq_quantlist__44p8_p5_1,
134.9470 +	0
134.9471 +};
134.9472 +
134.9473 +static const long _vq_quantlist__44p8_p6_0[] = {
134.9474 +	1,
134.9475 +	0,
134.9476 +	2,
134.9477 +};
134.9478 +
134.9479 +static const long _vq_lengthlist__44p8_p6_0[] = {
134.9480 +	 2, 6, 6, 5, 7, 7, 5, 7, 7, 5, 7, 7, 7, 7, 9, 7,
134.9481 +	 9, 9, 6, 7, 7, 8, 9, 9, 7, 9, 7, 6, 8, 8, 8, 9,
134.9482 +	10, 8, 9, 9, 8, 9,10, 9, 9,10,10,10,10, 8, 9, 9,
134.9483 +	10,10,11, 9,10,10, 6, 8, 8, 8, 9, 9, 8,10, 9, 8,
134.9484 +	 9, 9, 9,10,10,10,11,10, 8,10, 9,10,11,10, 9,11,
134.9485 +	 9, 6, 8, 8, 7, 9, 9, 7, 9, 9, 7, 9, 9, 8, 9,10,
134.9486 +	 9,10,10, 8, 9, 9, 9,10,10, 9,10, 9, 7, 9, 9, 9,
134.9487 +	 9,10, 9,10,10, 9, 9,10,10, 9,11,10,11,11, 9,10,
134.9488 +	10,10,11,11,10,11,10, 6, 9, 8, 9, 9,10, 9,10, 9,
134.9489 +	 8,10,10, 9, 9,10,10,11,11, 9,10,10,10,11,11, 9,
134.9490 +	11, 9, 6, 8, 8, 7, 9, 9, 7, 9, 9, 8, 9, 9, 9, 9,
134.9491 +	10, 9,10,10, 7, 9, 9, 9,10,10, 8,10, 9, 6, 8, 9,
134.9492 +	 9, 9,10, 9,10, 9, 9,10,10, 9, 9,11,10,11,11, 8,
134.9493 +	 9,10,10,11,11, 9,10, 9, 7, 9, 9, 9,10,10, 9,10,
134.9494 +	 9, 9,10,10,10,10,11,10,11,11, 9,10, 9,10,11,11,
134.9495 +	10,11, 9,
134.9496 +};
134.9497 +
134.9498 +static const static_codebook _44p8_p6_0 = {
134.9499 +	5, 243,
134.9500 +	(long *)_vq_lengthlist__44p8_p6_0,
134.9501 +	1, -527106048, 1620377600, 2, 0,
134.9502 +	(long *)_vq_quantlist__44p8_p6_0,
134.9503 +	0
134.9504 +};
134.9505 +
134.9506 +static const long _vq_quantlist__44p8_p6_1[] = {
134.9507 +	1,
134.9508 +	0,
134.9509 +	2,
134.9510 +};
134.9511 +
134.9512 +static const long _vq_lengthlist__44p8_p6_1[] = {
134.9513 +	 4, 7, 7, 7, 7, 8, 7, 8, 7, 7, 7, 8, 7, 8, 8, 8,
134.9514 +	 8, 8, 7, 8, 7, 8, 8, 8, 7, 8, 8, 7, 8, 8, 8, 8,
134.9515 +	 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 8, 8, 9, 8, 8, 8,
134.9516 +	 8, 9, 8, 8, 8, 8, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8,
134.9517 +	 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 8, 8, 9,
134.9518 +	 8, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9,
134.9519 +	 8, 8, 9, 8, 8, 8, 8, 9, 9, 8, 9, 8, 8, 8, 8, 8,
134.9520 +	 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 8, 9, 9, 8, 8,
134.9521 +	 8, 8, 9, 9, 8, 9, 9, 7, 8, 8, 8, 8, 8, 8, 8, 8,
134.9522 +	 8, 8, 8, 8, 8, 9, 8, 9, 8, 8, 8, 8, 8, 9, 9, 8,
134.9523 +	 9, 8, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
134.9524 +	 9, 8, 9, 9, 8, 8, 8, 8, 9, 8, 8, 9, 8, 7, 8, 8,
134.9525 +	 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 8, 9, 9, 8,
134.9526 +	 8, 8, 8, 9, 9, 8, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8,
134.9527 +	 8, 8, 8, 8, 8, 9, 9, 8, 9, 9, 8, 8, 8, 8, 9, 9,
134.9528 +	 8, 9, 8,
134.9529 +};
134.9530 +
134.9531 +static const static_codebook _44p8_p6_1 = {
134.9532 +	5, 243,
134.9533 +	(long *)_vq_lengthlist__44p8_p6_1,
134.9534 +	1, -530841600, 1616642048, 2, 0,
134.9535 +	(long *)_vq_quantlist__44p8_p6_1,
134.9536 +	0
134.9537 +};
134.9538 +
134.9539 +static const long _vq_quantlist__44p8_p7_0[] = {
134.9540 +	1,
134.9541 +	0,
134.9542 +	2,
134.9543 +};
134.9544 +
134.9545 +static const long _vq_lengthlist__44p8_p7_0[] = {
134.9546 +	 1, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9,
134.9547 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.9548 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.9549 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.9550 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.9551 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.9552 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.9553 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.9554 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.9555 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.9556 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.9557 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.9558 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.9559 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.9560 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.9561 +	 9, 9, 9,
134.9562 +};
134.9563 +
134.9564 +static const static_codebook _44p8_p7_0 = {
134.9565 +	5, 243,
134.9566 +	(long *)_vq_lengthlist__44p8_p7_0,
134.9567 +	1, -512202240, 1635281408, 2, 0,
134.9568 +	(long *)_vq_quantlist__44p8_p7_0,
134.9569 +	0
134.9570 +};
134.9571 +
134.9572 +static const long _vq_quantlist__44p8_p7_1[] = {
134.9573 +	2,
134.9574 +	1,
134.9575 +	3,
134.9576 +	0,
134.9577 +	4,
134.9578 +};
134.9579 +
134.9580 +static const long _vq_lengthlist__44p8_p7_1[] = {
134.9581 +	 1, 7, 7,12,12, 5,11,12,12,12, 5,12,11,12,12,12,
134.9582 +	12,12,12,12,12,13,13,13,13, 7,11,11,13,13,13,12,
134.9583 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9584 +	13,13, 7,13,10,13,13,13,13,13,13,13,12,13,13,13,
134.9585 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9586 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9587 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9588 +	13,13,13,13,13,13,13,13,13,13,13,13,13, 7,13,12,
134.9589 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9590 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9591 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,12,
134.9592 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9593 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9594 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9595 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9596 +	13,13,13,13,13,13,13,13,13,13, 8,13,13,13,13,13,
134.9597 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9598 +	13,13,13,12,13,13,13,13,13,13,13,13,13,13,13,13,
134.9599 +	13,13,13,13,13,13,13,13,13,13,13,13,12,13,13,13,
134.9600 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9601 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9602 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9603 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9604 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9605 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9606 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9607 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9608 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9609 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9610 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9611 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9612 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9613 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9614 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9615 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9616 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9617 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9618 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9619 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9620 +	13, 8,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9621 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9622 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9623 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9624 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9625 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9626 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9627 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9628 +	13,13,13,12,13,13,13,13,13,13,13,13,13,13,13,13,
134.9629 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9630 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9631 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9632 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9633 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9634 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9635 +	13,13,13,13,13,13,13,13,13,13,13,10,13,13,13,13,
134.9636 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9637 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9638 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9639 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9640 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9641 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9642 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9643 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9644 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9645 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9646 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9647 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9648 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9649 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9650 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9651 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9652 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9653 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9654 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9655 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9656 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9657 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9658 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9659 +	13,13, 8,13,12,13,13,13,13,13,13,13,13,13,13,13,
134.9660 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9661 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9662 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9663 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9664 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9665 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9666 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,11,
134.9667 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9668 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9669 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9670 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9671 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9672 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9673 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9674 +	13,13,13,13,13,13,13,13,13,13,13,13,11,13,13,13,
134.9675 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9676 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9677 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9678 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9679 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9680 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9681 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9682 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9683 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9684 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9685 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9686 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9687 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9688 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9689 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9690 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9691 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9692 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9693 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9694 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9695 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9696 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9697 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9698 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9699 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9700 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9701 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9702 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9703 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9704 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9705 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9706 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9707 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9708 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9709 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9710 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9711 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9712 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9713 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9714 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9715 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9716 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9717 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9718 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9719 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9720 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9721 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9722 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9723 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9724 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9725 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9726 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9727 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9728 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9729 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9730 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9731 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9732 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9733 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9734 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9735 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9736 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9737 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9738 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9739 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9740 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9741 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9742 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9743 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9744 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9745 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9746 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9747 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9748 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9749 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9750 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9751 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9752 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9753 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9754 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9755 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9756 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9757 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9758 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9759 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9760 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9761 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9762 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9763 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9764 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9765 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9766 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9767 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9768 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9769 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9770 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9771 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9772 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9773 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9774 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9775 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.9776 +	13,13,13,13,13,
134.9777 +};
134.9778 +
134.9779 +static const static_codebook _44p8_p7_1 = {
134.9780 +	5, 3125,
134.9781 +	(long *)_vq_lengthlist__44p8_p7_1,
134.9782 +	1, -514619392, 1630767104, 3, 0,
134.9783 +	(long *)_vq_quantlist__44p8_p7_1,
134.9784 +	0
134.9785 +};
134.9786 +
134.9787 +static const long _vq_quantlist__44p8_p7_2[] = {
134.9788 +	12,
134.9789 +	11,
134.9790 +	13,
134.9791 +	10,
134.9792 +	14,
134.9793 +	9,
134.9794 +	15,
134.9795 +	8,
134.9796 +	16,
134.9797 +	7,
134.9798 +	17,
134.9799 +	6,
134.9800 +	18,
134.9801 +	5,
134.9802 +	19,
134.9803 +	4,
134.9804 +	20,
134.9805 +	3,
134.9806 +	21,
134.9807 +	2,
134.9808 +	22,
134.9809 +	1,
134.9810 +	23,
134.9811 +	0,
134.9812 +	24,
134.9813 +};
134.9814 +
134.9815 +static const long _vq_lengthlist__44p8_p7_2[] = {
134.9816 +	 1, 3, 2, 4, 5, 7, 7, 8, 8, 9, 9,10,10,11,11,12,
134.9817 +	12,13,13,14,14,15,15,15,15,
134.9818 +};
134.9819 +
134.9820 +static const static_codebook _44p8_p7_2 = {
134.9821 +	1, 25,
134.9822 +	(long *)_vq_lengthlist__44p8_p7_2,
134.9823 +	1, -518864896, 1620639744, 5, 0,
134.9824 +	(long *)_vq_quantlist__44p8_p7_2,
134.9825 +	0
134.9826 +};
134.9827 +
134.9828 +static const long _vq_quantlist__44p8_p7_3[] = {
134.9829 +	12,
134.9830 +	11,
134.9831 +	13,
134.9832 +	10,
134.9833 +	14,
134.9834 +	9,
134.9835 +	15,
134.9836 +	8,
134.9837 +	16,
134.9838 +	7,
134.9839 +	17,
134.9840 +	6,
134.9841 +	18,
134.9842 +	5,
134.9843 +	19,
134.9844 +	4,
134.9845 +	20,
134.9846 +	3,
134.9847 +	21,
134.9848 +	2,
134.9849 +	22,
134.9850 +	1,
134.9851 +	23,
134.9852 +	0,
134.9853 +	24,
134.9854 +};
134.9855 +
134.9856 +static const long _vq_lengthlist__44p8_p7_3[] = {
134.9857 +	 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5,
134.9858 +	 5, 5, 5, 5, 5, 5, 5, 5, 5,
134.9859 +};
134.9860 +
134.9861 +static const static_codebook _44p8_p7_3 = {
134.9862 +	1, 25,
134.9863 +	(long *)_vq_lengthlist__44p8_p7_3,
134.9864 +	1, -529006592, 1611661312, 5, 0,
134.9865 +	(long *)_vq_quantlist__44p8_p7_3,
134.9866 +	0
134.9867 +};
134.9868 +
134.9869 +static const long _huff_lengthlist__44p8_short[] = {
134.9870 +	 3, 9,15,17,20,21,22,23, 5, 5, 7, 9,11,13,17,20,
134.9871 +	 9, 5, 5, 6, 8,10,15,18,11, 7, 5, 4, 6, 9,13,17,
134.9872 +	14, 9, 7, 5, 6, 7,10,14,17,10, 8, 6, 6, 4, 5, 8,
134.9873 +	20,14,13,10, 8, 4, 3, 4,23,17,16,14,12, 6, 4, 4,
134.9874 +};
134.9875 +
134.9876 +static const static_codebook _huff_book__44p8_short = {
134.9877 +	2, 64,
134.9878 +	(long *)_huff_lengthlist__44p8_short,
134.9879 +	0, 0, 0, 0, 0,
134.9880 +	NULL,
134.9881 +	0
134.9882 +};
134.9883 +
134.9884 +static const long _vq_quantlist__44p9_l0_0[] = {
134.9885 +	6,
134.9886 +	5,
134.9887 +	7,
134.9888 +	4,
134.9889 +	8,
134.9890 +	3,
134.9891 +	9,
134.9892 +	2,
134.9893 +	10,
134.9894 +	1,
134.9895 +	11,
134.9896 +	0,
134.9897 +	12,
134.9898 +};
134.9899 +
134.9900 +static const long _vq_lengthlist__44p9_l0_0[] = {
134.9901 +	 2, 5, 5, 7, 6, 8, 8, 9, 9,10,10,11,11, 4, 5, 5,
134.9902 +	 6, 7, 8, 8, 9, 9,10,10,11,10, 4, 5, 5, 7, 6, 8,
134.9903 +	 8, 9, 9,10,10,10,10, 6, 6, 7, 6, 7, 8, 8, 9, 9,
134.9904 +	10, 9,11, 9, 6, 6, 6, 7, 6, 8, 8, 9, 9, 9,10, 9,
134.9905 +	11, 7, 7, 8, 8, 8, 8, 9, 9, 9,10, 9,11, 9, 7, 8,
134.9906 +	 8, 8, 8, 9, 8, 9, 9, 9,10, 9,11, 8, 9, 9, 9, 9,
134.9907 +	 9, 9,10,10,11,10,12,10, 8, 9, 9, 9, 9, 9, 9,10,
134.9908 +	 9,10,11,11,12, 9,10,10,10,10,10,10,10,11,11,11,
134.9909 +	11,12, 9,10,10,10,10,11,10,11,10,11,11,12,11,11,
134.9910 +	11,11,11,11,11,11,11,12,11,12,11,12,11,11,11,11,
134.9911 +	11,11,11,12,11,12,11,12,11,
134.9912 +};
134.9913 +
134.9914 +static const static_codebook _44p9_l0_0 = {
134.9915 +	2, 169,
134.9916 +	(long *)_vq_lengthlist__44p9_l0_0,
134.9917 +	1, -526516224, 1616117760, 4, 0,
134.9918 +	(long *)_vq_quantlist__44p9_l0_0,
134.9919 +	0
134.9920 +};
134.9921 +
134.9922 +static const long _vq_quantlist__44p9_l0_1[] = {
134.9923 +	2,
134.9924 +	1,
134.9925 +	3,
134.9926 +	0,
134.9927 +	4,
134.9928 +};
134.9929 +
134.9930 +static const long _vq_lengthlist__44p9_l0_1[] = {
134.9931 +	 4, 4, 4, 5, 5, 4, 4, 5, 5, 5, 4, 5, 4, 5, 5, 5,
134.9932 +	 5, 5, 5, 5, 5, 5, 5, 5, 5,
134.9933 +};
134.9934 +
134.9935 +static const static_codebook _44p9_l0_1 = {
134.9936 +	2, 25,
134.9937 +	(long *)_vq_lengthlist__44p9_l0_1,
134.9938 +	1, -533725184, 1611661312, 3, 0,
134.9939 +	(long *)_vq_quantlist__44p9_l0_1,
134.9940 +	0
134.9941 +};
134.9942 +
134.9943 +static const long _vq_quantlist__44p9_l1_0[] = {
134.9944 +	2,
134.9945 +	1,
134.9946 +	3,
134.9947 +	0,
134.9948 +	4,
134.9949 +};
134.9950 +
134.9951 +static const long _vq_lengthlist__44p9_l1_0[] = {
134.9952 +	 1, 2, 3, 5, 9, 9, 4, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.9953 +	 9,10,10,10,10,10,10,10,10,
134.9954 +};
134.9955 +
134.9956 +static const static_codebook _44p9_l1_0 = {
134.9957 +	2, 25,
134.9958 +	(long *)_vq_lengthlist__44p9_l1_0,
134.9959 +	1, -514619392, 1630767104, 3, 0,
134.9960 +	(long *)_vq_quantlist__44p9_l1_0,
134.9961 +	0
134.9962 +};
134.9963 +
134.9964 +static const long _huff_lengthlist__44p9_lfe[] = {
134.9965 +	 1, 1,
134.9966 +};
134.9967 +
134.9968 +static const static_codebook _huff_book__44p9_lfe = {
134.9969 +	1, 2,
134.9970 +	(long *)_huff_lengthlist__44p9_lfe,
134.9971 +	0, 0, 0, 0, 0,
134.9972 +	NULL,
134.9973 +	0
134.9974 +};
134.9975 +
134.9976 +static const long _huff_lengthlist__44p9_long[] = {
134.9977 +	 3, 3, 3, 3, 3, 3, 3, 3,
134.9978 +};
134.9979 +
134.9980 +static const static_codebook _huff_book__44p9_long = {
134.9981 +	1, 8,
134.9982 +	(long *)_huff_lengthlist__44p9_long,
134.9983 +	0, 0, 0, 0, 0,
134.9984 +	NULL,
134.9985 +	0
134.9986 +};
134.9987 +
134.9988 +static const long _vq_quantlist__44p9_p1_0[] = {
134.9989 +	1,
134.9990 +	0,
134.9991 +	2,
134.9992 +};
134.9993 +
134.9994 +static const long _vq_lengthlist__44p9_p1_0[] = {
134.9995 +	 1, 5, 5, 4, 8, 8, 4, 8, 8, 5, 7, 8, 8, 9,10, 8,
134.9996 +	10,10, 5, 8, 7, 8,10,10, 8,10, 9, 7, 9, 9, 9,11,
134.9997 +	11, 9,11,11, 9,11,11,11,12,13,11,13,13, 9,11,11,
134.9998 +	11,13,13,11,13,13, 7, 9, 9, 9,11,11, 9,11,11, 9,
134.9999 +	11,11,11,13,13,11,13,13, 9,11,11,11,13,13,11,13,
134.10000 +	12, 5, 9, 9, 9,11,11, 9,11,11, 9,11,11,11,12,13,
134.10001 +	11,13,13, 9,11,11,11,13,13,11,13,13, 9,11,12,11,
134.10002 +	13,13,12,13,13,11,12,13,13,14,15,13,14,14,12,13,
134.10003 +	13,13,15,15,13,15,14, 8,10,10,11,13,13,12,14,13,
134.10004 +	11,12,12,13,14,15,13,15,15,11,12,12,13,15,15,13,
134.10005 +	15,14, 5, 9, 9, 9,11,11, 9,11,11, 9,11,11,11,13,
134.10006 +	13,11,13,13, 9,11,10,11,13,13,11,13,12, 8,10,10,
134.10007 +	11,13,13,12,13,13,11,12,12,13,14,15,14,15,15,10,
134.10008 +	12,12,13,14,15,13,15,14, 9,12,11,12,13,13,11,13,
134.10009 +	13,12,13,13,13,15,15,13,14,15,11,13,12,13,15,14,
134.10010 +	13,15,14,
134.10011 +};
134.10012 +
134.10013 +static const static_codebook _44p9_p1_0 = {
134.10014 +	5, 243,
134.10015 +	(long *)_vq_lengthlist__44p9_p1_0,
134.10016 +	1, -535822336, 1611661312, 2, 0,
134.10017 +	(long *)_vq_quantlist__44p9_p1_0,
134.10018 +	0
134.10019 +};
134.10020 +
134.10021 +static const long _vq_quantlist__44p9_p2_0[] = {
134.10022 +	2,
134.10023 +	1,
134.10024 +	3,
134.10025 +	0,
134.10026 +	4,
134.10027 +};
134.10028 +
134.10029 +static const long _vq_lengthlist__44p9_p2_0[] = {
134.10030 +	 4, 6, 6, 8, 8, 5, 7, 7, 9, 9, 5, 7, 7, 9, 9, 6,
134.10031 +	 8, 8,11,11, 6, 8, 8,11,11, 6, 7, 7, 9, 9, 7, 8,
134.10032 +	 9,10,11, 7, 9, 9,11,10, 8, 9,10,12,12, 8,10,10,
134.10033 +	12,12, 6, 7, 7, 9, 9, 7, 9, 9,10,10, 7, 9, 8,11,
134.10034 +	10, 8,10,10,12,12, 8,10, 9,12,12, 8, 9, 9,11,11,
134.10035 +	 9,10,10,12,12, 9,11,11,12,13,11,12,12,13,14,11,
134.10036 +	12,12,14,14, 8, 9, 9,11,11, 9,11,10,13,12, 9,10,
134.10037 +	10,13,12,11,12,12,14,14,11,12,12,14,13, 7, 8, 9,
134.10038 +	10,10, 8,10,10,11,11, 8,10,10,11,11,10,11,11,13,
134.10039 +	13,10,11,11,13,13, 8, 9,10,10,11,10,11,11,12,13,
134.10040 +	10,11,11,12,12,11,11,12,13,14,11,12,12,14,14, 8,
134.10041 +	10,10,11,11,10,11,11,12,13,10,11,11,12,12,11,12,
134.10042 +	12,14,14,11,12,12,14,14,10,11,11,12,13,11,12,12,
134.10043 +	13,14,12,13,13,14,14,13,13,14,14,16,13,14,14,15,
134.10044 +	16,10,11,11,13,13,12,12,12,14,14,11,12,12,14,14,
134.10045 +	13,14,14,15,16,13,14,14,16,15, 7, 8, 8,10,10, 8,
134.10046 +	10,10,11,11, 8,10,10,12,11,10,11,11,13,13,10,11,
134.10047 +	11,13,13, 8,10,10,11,11,10,11,11,12,12,10,11,11,
134.10048 +	12,12,11,12,12,14,14,11,12,12,14,14, 8,10, 9,11,
134.10049 +	10,10,11,11,13,12,10,11,10,13,12,11,12,12,14,14,
134.10050 +	11,12,11,14,13,10,11,11,13,13,11,12,12,14,14,12,
134.10051 +	12,12,14,14,13,14,14,15,16,13,14,14,15,15,10,11,
134.10052 +	11,13,12,12,12,12,14,14,11,12,12,14,13,13,14,14,
134.10053 +	16,15,13,14,13,16,14,10,11,11,13,13,12,12,13,14,
134.10054 +	15,12,13,13,14,15,13,14,15,15,16,13,14,14,16,16,
134.10055 +	11,12,13,14,14,13,13,14,15,16,13,14,14,15,16,14,
134.10056 +	15,15,16,17,14,15,16,17,17,11,12,12,14,14,13,14,
134.10057 +	14,15,16,13,14,14,15,15,14,15,15,16,18,14,15,15,
134.10058 +	17,16,13,14,15,15,16,15,15,16,16,18,15,15,15,17,
134.10059 +	17,16,16,17,17,18,16,16,16,18,18,14,14,14,16,16,
134.10060 +	15,15,15,16,17,15,15,15,16,17,16,17,17,18,18,16,
134.10061 +	16,17,18,17,10,11,11,14,13,12,13,13,15,14,11,13,
134.10062 +	13,15,14,13,15,15,16,16,13,14,14,16,16,11,12,12,
134.10063 +	14,14,13,13,13,15,15,13,14,13,15,15,15,15,15,17,
134.10064 +	16,14,15,15,17,16,11,13,12,14,14,13,14,13,15,15,
134.10065 +	13,14,13,15,15,14,15,15,17,17,14,15,15,17,16,14,
134.10066 +	14,14,16,16,14,15,15,17,17,15,15,16,17,16,17,16,
134.10067 +	17,18,18,16,17,17,18,18,13,14,14,16,15,15,15,15,
134.10068 +	17,17,14,16,15,16,16,17,17,17,18,18,16,17,16,20,
134.10069 +	19, 6, 8, 8,10,10, 8,10,10,11,11, 8,10,10,12,11,
134.10070 +	10,11,11,13,13,10,11,11,13,13, 8, 9,10,11,11,10,
134.10071 +	11,11,12,12,10,11,11,13,12,11,12,12,14,14,11,12,
134.10072 +	12,14,14, 9,10,10,11,11,10,11,11,12,12,10,11,11,
134.10073 +	13,12,11,12,12,14,14,11,12,12,14,14,10,10,11,12,
134.10074 +	13,11,12,12,14,14,11,12,12,14,14,13,14,14,15,16,
134.10075 +	13,14,14,15,16,10,11,11,13,13,12,12,12,14,14,12,
134.10076 +	13,12,14,14,13,14,14,16,16,13,14,14,15,15, 9,10,
134.10077 +	10,11,12,10,11,11,12,13,10,11,11,13,12,11,12,12,
134.10078 +	14,14,11,12,12,14,14,10,10,11,12,13,11,12,12,13,
134.10079 +	14,11,12,12,13,14,12,13,14,14,15,12,13,13,15,15,
134.10080 +	10,11,11,13,13,11,12,12,13,14,11,12,12,14,13,12,
134.10081 +	13,13,15,15,12,13,13,15,15,12,11,13,12,14,13,13,
134.10082 +	14,14,15,13,13,14,14,15,14,15,15,16,17,14,15,15,
134.10083 +	16,17,12,13,12,14,14,13,14,14,15,15,13,14,14,15,
134.10084 +	15,14,15,15,16,17,14,15,15,16,17, 8, 9, 9,11,11,
134.10085 +	10,11,11,12,13,10,11,11,13,12,12,13,13,14,15,11,
134.10086 +	13,12,15,14, 9,11,10,12,12,11,12,12,13,14,11,12,
134.10087 +	12,14,13,13,13,14,15,15,13,14,13,15,15, 9,11,11,
134.10088 +	12,12,11,12,12,14,14,11,12,12,14,13,13,14,14,15,
134.10089 +	16,13,14,13,15,14,11,12,12,14,13,12,13,13,14,15,
134.10090 +	13,14,14,16,15,15,15,15,15,16,15,16,15,17,17,11,
134.10091 +	12,12,14,14,13,14,14,15,15,12,13,13,15,14,15,15,
134.10092 +	15,17,17,14,15,15,17,15,11,12,12,14,14,12,13,13,
134.10093 +	15,15,12,13,13,15,15,14,15,15,17,17,14,15,15,16,
134.10094 +	16,12,13,13,14,15,13,14,14,16,16,14,14,14,15,16,
134.10095 +	15,16,16,17,17,15,16,16,17,17,12,13,13,15,15,14,
134.10096 +	14,14,16,16,14,14,15,16,16,15,16,16,17,17,15,16,
134.10097 +	16,17,17,14,15,15,15,16,15,15,16,16,18,15,16,16,
134.10098 +	17,17,17,17,17,18,18,16,17,17,19,18,14,15,15,16,
134.10099 +	17,15,16,16,17,17,15,16,16,18,17,16,17,17,19,18,
134.10100 +	17,17,17,19,18,10,12,12,14,14,13,13,14,15,15,12,
134.10101 +	14,13,16,15,15,15,15,17,17,14,15,15,17,16,12,13,
134.10102 +	13,15,14,13,14,14,16,16,14,14,15,17,16,15,16,16,
134.10103 +	17,17,15,16,16,18,17,12,13,13,15,14,14,15,15,16,
134.10104 +	16,13,15,14,16,15,16,17,16,19,17,15,16,16,17,17,
134.10105 +	14,15,15,17,15,15,16,15,17,17,16,17,16,18,17,17,
134.10106 +	17,18,18,18,17,17,18,19,18,14,15,15,16,16,15,16,
134.10107 +	16,17,18,15,16,16,18,16,17,18,18,19,19,17,18,17,
134.10108 +	18,19, 6, 8, 8,10,10, 8,10,10,11,11, 8,10,10,12,
134.10109 +	11,10,11,11,13,13, 9,11,11,13,13, 9,10,10,11,11,
134.10110 +	10,11,11,12,12,10,11,11,12,12,11,12,12,14,14,11,
134.10111 +	12,12,14,14, 8,10, 9,11,11,10,11,11,12,12,10,11,
134.10112 +	11,12,12,11,12,12,14,14,11,12,12,14,14,10,11,11,
134.10113 +	13,13,11,12,13,14,14,12,12,12,14,14,13,14,14,15,
134.10114 +	16,13,14,14,16,16,10,11,10,13,12,11,12,12,14,14,
134.10115 +	11,12,12,14,14,13,14,14,15,16,13,14,14,16,15, 8,
134.10116 +	 9, 9,11,11,10,11,11,12,13,10,11,11,13,12,12,13,
134.10117 +	13,14,15,12,13,13,15,14,10,11,11,12,12,11,11,12,
134.10118 +	13,14,11,12,12,14,14,13,13,14,15,16,13,14,14,15,
134.10119 +	15, 9,10,11,12,12,11,12,12,13,14,11,12,12,14,13,
134.10120 +	13,14,14,15,16,12,14,13,15,15,11,12,12,14,14,12,
134.10121 +	13,13,14,15,13,14,14,16,15,14,15,15,15,17,15,15,
134.10122 +	16,16,17,11,12,12,13,14,13,14,14,15,15,12,13,13,
134.10123 +	15,14,15,16,15,16,17,14,16,15,17,15, 9,10,10,12,
134.10124 +	11,10,11,11,13,13,10,11,11,13,12,11,12,12,14,14,
134.10125 +	11,12,12,14,14,10,11,11,12,13,11,12,12,13,14,11,
134.10126 +	12,12,14,14,12,13,13,15,15,12,13,13,15,15,10,11,
134.10127 +	10,13,12,11,12,12,13,13,11,12,12,14,13,12,13,13,
134.10128 +	15,15,12,13,13,15,14,12,13,12,14,14,13,14,14,15,
134.10129 +	15,13,14,14,15,15,14,15,15,16,16,14,15,15,16,16,
134.10130 +	11,13,11,14,12,13,13,13,15,14,12,14,13,15,14,15,
134.10131 +	15,15,17,16,14,15,14,17,15,10,12,12,14,14,13,13,
134.10132 +	14,15,16,12,14,13,15,15,14,15,16,17,17,14,15,16,
134.10133 +	17,17,12,13,13,14,15,13,14,14,16,16,14,14,15,16,
134.10134 +	16,16,16,16,17,17,16,16,16,18,18,12,13,13,14,15,
134.10135 +	14,14,15,16,16,13,14,14,16,15,16,16,16,17,18,15,
134.10136 +	16,16,17,17,14,15,15,16,16,15,15,16,17,17,15,16,
134.10137 +	16,17,18,17,18,18,18,19,17,18,18,19,19,14,15,15,
134.10138 +	16,16,15,16,16,17,17,15,16,16,17,17,17,17,18,20,
134.10139 +	18,17,18,17,18,18,11,12,12,14,14,12,13,14,15,15,
134.10140 +	12,13,13,15,15,14,15,15,16,17,14,15,15,16,17,12,
134.10141 +	13,13,15,15,14,14,14,16,16,14,14,14,16,16,15,16,
134.10142 +	16,17,17,15,16,16,17,17,12,13,13,15,14,13,14,14,
134.10143 +	16,15,14,15,14,16,15,15,16,16,17,17,15,16,16,17,
134.10144 +	16,14,15,15,16,16,15,16,16,17,17,16,16,16,17,17,
134.10145 +	17,17,17,19,18,17,17,17,18,19,14,15,14,17,15,15,
134.10146 +	16,16,17,17,15,16,15,17,17,16,17,17,18,18,16,17,
134.10147 +	17,18,17, 6,11,11,13,13,11,12,12,14,14,11,12,12,
134.10148 +	14,14,13,14,14,16,16,13,14,14,16,16,11,12,12,14,
134.10149 +	14,12,13,13,15,15,12,13,13,15,15,14,15,15,16,17,
134.10150 +	14,15,15,17,18,11,12,12,14,14,12,13,13,15,15,12,
134.10151 +	13,13,15,15,14,15,15,17,17,14,15,15,16,16,13,14,
134.10152 +	14,15,16,14,15,15,16,17,14,15,15,17,16,15,16,17,
134.10153 +	18,17,16,16,16,18,17,14,14,15,16,16,14,15,15,18,
134.10154 +	16,14,15,15,17,16,16,17,17,18,18,16,17,16,18,17,
134.10155 +	11,12,12,14,14,12,13,13,15,15,12,13,13,15,15,14,
134.10156 +	15,15,17,17,14,15,15,16,16,12,13,13,15,15,13,14,
134.10157 +	14,15,16,13,14,14,16,16,15,16,16,17,17,15,15,16,
134.10158 +	17,17,12,13,13,15,15,14,14,14,16,16,13,14,14,16,
134.10159 +	16,15,16,16,17,17,15,16,16,17,17,14,14,15,15,16,
134.10160 +	15,15,16,16,17,15,15,16,16,17,16,17,17,17,18,16,
134.10161 +	17,17,18,18,14,15,15,16,16,15,16,16,17,17,15,16,
134.10162 +	16,17,17,17,17,17,18,19,17,17,17,18,18,10,12,12,
134.10163 +	14,14,12,13,14,15,16,13,14,13,15,15,14,15,15,17,
134.10164 +	17,14,15,16,17,17,12,13,13,15,15,13,14,14,15,15,
134.10165 +	14,15,14,16,16,15,16,16,17,18,15,17,16,18,17,12,
134.10166 +	13,13,15,15,14,14,14,16,16,13,14,14,16,15,15,16,
134.10167 +	16,17,18,15,16,16,17,17,14,14,14,16,16,15,15,16,
134.10168 +	17,17,15,16,16,17,17,17,17,17,18,20,17,17,17,19,
134.10169 +	19,14,15,15,16,16,15,17,16,18,18,15,16,15,17,16,
134.10170 +	17,18,19,19,19,17,17,17,18,17,13,14,14,16,16,14,
134.10171 +	15,15,17,17,14,15,15,16,17,15,17,17,18,18,16,16,
134.10172 +	17,18,17,14,15,15,16,17,15,16,16,17,17,15,16,16,
134.10173 +	17,17,16,17,17,18,18,17,17,17,18,19,14,15,15,16,
134.10174 +	17,15,16,16,17,17,15,16,16,17,17,16,17,17,18,18,
134.10175 +	17,17,17,19,19,16,16,16,16,18,16,17,17,17,18,17,
134.10176 +	17,17,17,19,18,18,18,19,19,18,18,18,19,20,16,16,
134.10177 +	17,18,18,16,18,17,18,18,17,17,17,20,19,18,18,19,
134.10178 +	21,20,18,20,18,18,19,10,12,12,14,14,14,14,15,15,
134.10179 +	17,14,15,14,17,15,16,16,17,18,18,16,18,17,19,18,
134.10180 +	12,14,13,16,15,14,14,15,15,17,15,16,16,18,17,16,
134.10181 +	17,18,17,19,17,19,18,20,19,12,13,13,15,15,15,16,
134.10182 +	17,17,18,14,16,14,17,16,17,18,18,19,19,17,17,17,
134.10183 +	18,18,15,15,15,17,16,15,16,16,17,17,17,19,17,18,
134.10184 +	18,18,18,18,18,21,19,20,19,20,19,15,15,16,16,17,
134.10185 +	17,17,18,20,20,15,16,16,18,17,18,19,19,19,20,18,
134.10186 +	19,18,19,17, 6,11,11,13,13,11,12,12,14,14,11,12,
134.10187 +	12,14,14,13,14,14,16,16,13,14,14,16,16,11,12,12,
134.10188 +	14,14,12,13,13,15,15,12,13,13,15,15,14,15,15,17,
134.10189 +	17,14,15,15,17,16,11,12,12,14,14,12,13,13,15,15,
134.10190 +	12,13,13,15,15,14,15,15,16,16,14,15,15,16,16,13,
134.10191 +	14,14,16,16,15,15,15,16,16,14,15,15,17,16,16,17,
134.10192 +	17,19,18,16,17,17,18,18,13,14,14,15,15,14,15,15,
134.10193 +	17,16,14,15,15,17,16,16,17,16,17,18,15,16,16,18,
134.10194 +	18,10,12,12,14,14,12,13,14,15,15,12,13,13,15,15,
134.10195 +	14,15,15,17,17,14,15,15,17,16,12,13,13,15,15,14,
134.10196 +	14,14,15,16,14,15,15,16,16,15,16,16,17,18,16,16,
134.10197 +	16,18,18,12,13,13,14,14,14,14,15,16,16,13,14,14,
134.10198 +	16,16,15,16,16,18,18,15,16,16,19,17,14,15,15,16,
134.10199 +	17,15,15,16,17,17,16,17,16,17,18,17,17,18,17,19,
134.10200 +	17,17,18,18,19,14,14,14,16,16,15,16,16,17,17,15,
134.10201 +	16,15,17,17,17,17,17,19,20,16,17,17,18,18,11,12,
134.10202 +	12,14,14,12,13,13,15,15,12,13,13,15,15,14,15,15,
134.10203 +	16,16,14,15,14,16,16,12,13,13,15,15,14,14,14,16,
134.10204 +	16,13,14,14,16,16,15,16,16,18,17,15,16,16,17,17,
134.10205 +	12,13,13,15,15,13,14,14,16,16,13,14,14,16,16,15,
134.10206 +	16,15,18,18,15,16,15,17,16,14,15,15,16,16,15,16,
134.10207 +	16,17,17,15,16,16,18,17,16,17,17,18,18,16,17,17,
134.10208 +	18,18,14,15,14,16,15,15,16,15,17,17,15,16,15,17,
134.10209 +	16,16,17,17,18,18,17,17,16,19,17,10,12,12,14,15,
134.10210 +	14,14,15,15,17,14,15,14,17,15,16,17,17,17,18,16,
134.10211 +	17,17,18,18,12,14,13,16,15,14,14,16,15,17,15,17,
134.10212 +	16,18,17,17,17,18,17,19,18,18,18,19,18,12,13,14,
134.10213 +	15,15,15,16,16,16,17,14,15,14,18,16,18,17,18,19,
134.10214 +	19,17,18,17,20,18,15,15,15,17,17,15,16,16,17,18,
134.10215 +	18,18,18,19,18,18,18,19,18,20,18,19,19,21,21,15,
134.10216 +	15,16,16,17,17,18,18,18,18,15,16,16,17,17,17,19,
134.10217 +	20,19,20,17,18,18,19,17,13,14,14,16,16,14,15,15,
134.10218 +	16,17,14,15,15,17,17,16,16,17,17,18,15,17,16,17,
134.10219 +	17,14,15,15,16,16,15,16,16,17,17,16,16,16,17,17,
134.10220 +	17,17,18,17,18,17,17,17,18,20,14,15,15,17,16,15,
134.10221 +	16,16,17,17,15,16,16,17,17,17,17,17,18,18,16,17,
134.10222 +	17,19,18,16,16,17,17,17,17,18,17,19,18,17,17,17,
134.10223 +	18,19,17,20,18,19,21,17,19,18,19,20,15,17,15,17,
134.10224 +	16,16,17,17,18,18,17,17,17,18,17,18,19,18,19,21,
134.10225 +	18,18,17,19,19,
134.10226 +};
134.10227 +
134.10228 +static const static_codebook _44p9_p2_0 = {
134.10229 +	5, 3125,
134.10230 +	(long *)_vq_lengthlist__44p9_p2_0,
134.10231 +	1, -533725184, 1611661312, 3, 0,
134.10232 +	(long *)_vq_quantlist__44p9_p2_0,
134.10233 +	0
134.10234 +};
134.10235 +
134.10236 +static const long _vq_quantlist__44p9_p3_0[] = {
134.10237 +	1,
134.10238 +	0,
134.10239 +	2,
134.10240 +};
134.10241 +
134.10242 +static const long _vq_lengthlist__44p9_p3_0[] = {
134.10243 +	 2, 5, 4, 4, 7, 7, 4, 7, 6, 5, 6, 7, 7, 8, 9, 7,
134.10244 +	 9, 9, 5, 7, 6, 7, 9, 9, 7, 9, 8, 6, 8, 8, 8,10,
134.10245 +	10, 8,10,10, 8, 9,10,10,11,12,10,12,12, 8,10,10,
134.10246 +	10,12,12,10,12,11, 6, 8, 8, 8,10,10, 8,10,10, 8,
134.10247 +	10,10,10,11,12,10,12,12, 8,10, 9,10,12,11,10,12,
134.10248 +	11, 5, 8, 8, 8,10,10, 8,10,10, 8, 9,10,10,11,11,
134.10249 +	10,11,11, 8,10,10,10,11,12,10,12,11, 8,10,10,10,
134.10250 +	11,11,10,11,11,10,11,11,11,12,13,11,12,13,10,11,
134.10251 +	11,11,13,13,11,13,13, 7, 9, 9,10,11,12,10,12,11,
134.10252 +	 9,11,11,11,12,13,12,14,13, 9,11,11,12,13,14,11,
134.10253 +	13,12, 5, 8, 8, 8,10,10, 8,10,10, 8,10,10,10,11,
134.10254 +	12,10,12,12, 8,10, 9,10,12,11, 9,11,11, 7, 9, 9,
134.10255 +	10,11,12,10,12,11, 9,11,11,11,12,13,12,14,13, 9,
134.10256 +	11,11,12,13,14,11,13,12, 8,10,10,10,11,11,10,11,
134.10257 +	11,10,11,11,11,13,13,11,13,13,10,11,10,11,13,12,
134.10258 +	11,13,12,
134.10259 +};
134.10260 +
134.10261 +static const static_codebook _44p9_p3_0 = {
134.10262 +	5, 243,
134.10263 +	(long *)_vq_lengthlist__44p9_p3_0,
134.10264 +	1, -533200896, 1614282752, 2, 0,
134.10265 +	(long *)_vq_quantlist__44p9_p3_0,
134.10266 +	0
134.10267 +};
134.10268 +
134.10269 +static const long _vq_quantlist__44p9_p3_1[] = {
134.10270 +	1,
134.10271 +	0,
134.10272 +	2,
134.10273 +};
134.10274 +
134.10275 +static const long _vq_lengthlist__44p9_p3_1[] = {
134.10276 +	 4, 6, 6, 6, 7, 7, 6, 7, 7, 6, 7, 7, 7, 7, 8, 7,
134.10277 +	 7, 8, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8,
134.10278 +	 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 8, 9, 9, 8, 8, 8,
134.10279 +	 8, 9, 9, 8, 9, 9, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8,
134.10280 +	 8, 8, 8, 9, 9, 8, 9, 9, 8, 8, 8, 8, 9, 9, 8, 9,
134.10281 +	 9, 5, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9,
134.10282 +	 8, 9, 9, 8, 8, 8, 8, 9, 9, 8, 9, 9, 8, 8, 8, 8,
134.10283 +	 9, 9, 8, 9, 9, 8, 8, 9, 9, 9, 9, 9, 9, 9, 8, 9,
134.10284 +	 9, 9, 9, 9, 9, 9, 9, 7, 8, 8, 8, 9, 9, 8, 9, 9,
134.10285 +	 8, 9, 8, 9, 9, 9, 9, 9, 9, 8, 8, 8, 9, 9, 9, 9,
134.10286 +	 9, 9, 6, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9,
134.10287 +	 9, 8, 9, 9, 8, 8, 8, 8, 9, 9, 8, 9, 9, 7, 8, 8,
134.10288 +	 8, 9, 9, 8, 9, 9, 8, 8, 9, 9, 9, 9, 9, 9, 9, 8,
134.10289 +	 8, 8, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 9, 9, 8, 9,
134.10290 +	 9, 8, 9, 9, 9, 9, 9, 9, 9, 9, 8, 9, 8, 9, 9, 9,
134.10291 +	 9, 9, 9,
134.10292 +};
134.10293 +
134.10294 +static const static_codebook _44p9_p3_1 = {
134.10295 +	5, 243,
134.10296 +	(long *)_vq_lengthlist__44p9_p3_1,
134.10297 +	1, -535822336, 1611661312, 2, 0,
134.10298 +	(long *)_vq_quantlist__44p9_p3_1,
134.10299 +	0
134.10300 +};
134.10301 +
134.10302 +static const long _vq_quantlist__44p9_p4_0[] = {
134.10303 +	1,
134.10304 +	0,
134.10305 +	2,
134.10306 +};
134.10307 +
134.10308 +static const long _vq_lengthlist__44p9_p4_0[] = {
134.10309 +	 2, 5, 5, 4, 7, 7, 4, 7, 6, 5, 7, 7, 7, 8, 9, 7,
134.10310 +	 9, 9, 5, 7, 7, 7, 9, 9, 7, 9, 8, 6, 7, 8, 8, 9,
134.10311 +	10, 8,10,10, 8, 9,10,10,11,12,10,11,12, 8,10,10,
134.10312 +	10,11,12,10,12,11, 6, 8, 7, 8,10,10, 8,10, 9, 8,
134.10313 +	10,10,10,11,12,10,12,12, 8,10, 9,10,12,11,10,12,
134.10314 +	11, 5, 8, 8, 8,10,10, 8,10,10, 7, 9,10, 9,10,11,
134.10315 +	10,11,11, 8,10,10,10,12,12,10,12,11, 7, 9, 9, 9,
134.10316 +	11,11, 9,11,11, 9,10,11,11,11,12,11,12,12, 9,11,
134.10317 +	11,11,12,12,11,12,12, 7, 9, 9,10,11,12,10,12,11,
134.10318 +	 9,11,10,11,11,12,12,13,13, 9,11,11,12,13,13,11,
134.10319 +	13,11, 5, 8, 8, 8,10,10, 8,10,10, 8,10,10,10,11,
134.10320 +	12,10,12,12, 7, 9, 9, 9,11,11, 9,11,10, 7, 9, 9,
134.10321 +	10,11,12,10,12,11, 9,11,11,11,11,13,12,13,13, 9,
134.10322 +	10,11,12,13,13,11,12,11, 7, 9, 9, 9,11,11, 9,11,
134.10323 +	11, 9,11,11,11,12,12,11,12,12, 9,11,10,11,12,12,
134.10324 +	10,12,11,
134.10325 +};
134.10326 +
134.10327 +static const static_codebook _44p9_p4_0 = {
134.10328 +	5, 243,
134.10329 +	(long *)_vq_lengthlist__44p9_p4_0,
134.10330 +	1, -531365888, 1616117760, 2, 0,
134.10331 +	(long *)_vq_quantlist__44p9_p4_0,
134.10332 +	0
134.10333 +};
134.10334 +
134.10335 +static const long _vq_quantlist__44p9_p4_1[] = {
134.10336 +	2,
134.10337 +	1,
134.10338 +	3,
134.10339 +	0,
134.10340 +	4,
134.10341 +};
134.10342 +
134.10343 +static const long _vq_lengthlist__44p9_p4_1[] = {
134.10344 +	 6, 8, 8,10, 9, 8, 9, 9,10,10, 8, 9, 9,10,10, 8,
134.10345 +	10,10,10,10, 8,10,10,10,10, 9, 9, 9,10,10, 9,10,
134.10346 +	10,10,11, 9,10,10,11,11,10,10,10,11,11,10,10,10,
134.10347 +	11,11, 9, 9, 9,10,10, 9,10,10,11,11, 9,10,10,11,
134.10348 +	10,10,10,10,11,11,10,10,10,11,11,10,10,10,10,11,
134.10349 +	10,10,11,11,11,10,11,11,11,11,11,11,11,11,11,11,
134.10350 +	11,11,11,11,10,10,10,11,10,10,11,11,11,11,10,11,
134.10351 +	10,11,11,11,11,11,11,11,10,11,11,11,11, 9,10,10,
134.10352 +	10,11,10,10,11,11,11,10,11,11,11,11,10,11,11,11,
134.10353 +	11,10,11,11,11,11,10,10,11,11,11,11,11,11,11,11,
134.10354 +	11,11,11,11,12,11,11,12,12,12,11,11,11,12,12,10,
134.10355 +	11,11,11,11,11,11,11,12,12,11,11,11,11,11,11,11,
134.10356 +	11,12,12,11,11,11,12,12,11,11,11,11,11,11,12,12,
134.10357 +	12,12,11,12,12,12,12,11,12,12,12,12,12,12,12,12,
134.10358 +	12,11,11,11,11,11,11,12,12,12,12,11,12,11,12,12,
134.10359 +	11,12,12,12,12,12,12,12,12,12, 9,10,10,11,10,10,
134.10360 +	11,11,11,11,10,11,11,11,11,10,11,11,11,11,10,11,
134.10361 +	11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,
134.10362 +	12,12,11,11,12,12,12,11,11,11,12,12,10,11,10,11,
134.10363 +	11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,
134.10364 +	11,11,11,12,12,11,11,11,11,11,11,12,12,12,12,11,
134.10365 +	12,12,12,12,11,12,12,12,12,12,12,12,12,12,11,11,
134.10366 +	11,11,11,11,12,12,12,12,11,12,11,12,12,12,12,12,
134.10367 +	12,12,11,12,12,12,12,11,11,11,11,11,11,12,12,12,
134.10368 +	12,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10369 +	11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10370 +	12,12,13,13,12,12,12,13,13,11,12,12,12,12,12,12,
134.10371 +	12,12,12,12,12,12,12,12,12,12,12,13,13,12,12,12,
134.10372 +	13,13,12,12,12,12,12,12,12,12,12,13,12,12,12,13,
134.10373 +	13,12,13,13,13,13,12,13,13,13,13,12,12,12,12,12,
134.10374 +	12,12,12,13,13,12,12,12,13,13,12,13,13,13,13,12,
134.10375 +	13,13,13,13,11,11,11,11,11,11,12,12,12,12,11,12,
134.10376 +	12,12,12,12,12,12,12,12,12,12,12,12,12,11,12,12,
134.10377 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,
134.10378 +	13,12,12,12,13,13,11,12,12,12,12,12,12,12,12,12,
134.10379 +	12,12,12,12,12,12,12,12,13,13,12,12,12,13,13,12,
134.10380 +	12,12,12,12,12,12,12,13,13,12,12,12,13,13,12,13,
134.10381 +	13,13,13,12,13,13,13,13,12,12,12,12,12,12,12,12,
134.10382 +	13,13,12,12,12,13,12,12,13,13,13,13,12,13,13,13,
134.10383 +	13, 7,10,10,11,11,10,10,11,11,11,10,11,11,11,11,
134.10384 +	10,11,11,11,11,10,11,11,11,11,10,10,10,11,11,10,
134.10385 +	11,11,11,11,11,11,11,11,12,11,11,11,12,12,11,11,
134.10386 +	11,12,12,10,11,11,11,11,11,11,11,12,11,11,11,11,
134.10387 +	12,11,11,11,11,12,12,11,11,11,12,12,11,11,11,11,
134.10388 +	11,11,11,11,12,12,11,11,12,12,12,11,12,12,12,12,
134.10389 +	11,12,12,12,12,11,11,11,11,11,11,12,12,12,12,11,
134.10390 +	11,12,12,12,11,12,12,12,12,11,12,12,12,12,10,11,
134.10391 +	11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,
134.10392 +	12,12,11,11,11,12,12,11,11,11,11,11,11,11,12,12,
134.10393 +	12,11,11,11,12,12,11,12,12,12,12,11,12,12,12,12,
134.10394 +	11,11,11,11,11,11,12,11,12,12,11,11,11,12,12,11,
134.10395 +	12,12,12,12,11,12,12,12,12,11,11,11,11,12,11,12,
134.10396 +	12,12,12,11,12,12,12,12,12,12,12,12,12,12,12,12,
134.10397 +	12,12,11,11,11,12,12,11,12,12,12,12,11,12,12,12,
134.10398 +	12,12,12,12,12,12,12,12,12,12,12,10,11,10,11,11,
134.10399 +	11,11,11,12,12,11,11,11,12,12,11,12,12,12,12,11,
134.10400 +	12,12,12,12,10,11,11,12,11,11,11,12,12,12,11,12,
134.10401 +	12,12,12,12,12,12,12,12,12,12,12,12,12,11,11,11,
134.10402 +	12,11,11,12,12,12,12,11,12,11,12,12,12,12,12,12,
134.10403 +	12,12,12,12,12,12,11,12,11,12,12,12,12,12,12,12,
134.10404 +	12,12,12,12,12,12,12,12,12,13,12,12,12,12,12,11,
134.10405 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10406 +	12,12,13,12,12,12,13,12,11,11,11,12,12,12,12,12,
134.10407 +	12,12,11,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10408 +	13,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10409 +	12,12,13,13,13,12,12,12,13,13,11,12,12,12,12,12,
134.10410 +	12,12,12,13,12,12,12,12,12,12,12,13,13,13,12,13,
134.10411 +	12,13,13,12,12,12,12,12,12,12,12,13,13,12,12,12,
134.10412 +	13,13,12,13,13,13,13,12,13,13,13,13,12,12,12,12,
134.10413 +	12,12,12,12,13,13,12,13,12,13,13,12,13,13,13,13,
134.10414 +	12,13,13,13,13,11,11,11,12,12,12,12,12,12,12,11,
134.10415 +	12,12,12,12,12,12,12,13,13,12,12,12,13,13,11,12,
134.10416 +	12,12,12,12,12,12,12,12,12,12,12,13,13,12,13,12,
134.10417 +	13,13,12,13,13,13,13,11,12,12,12,12,12,12,12,13,
134.10418 +	13,12,12,12,13,12,12,13,13,13,13,12,13,13,13,13,
134.10419 +	12,12,12,12,12,12,12,13,13,13,12,13,13,13,13,13,
134.10420 +	13,13,13,13,13,13,13,13,13,12,12,12,12,12,12,13,
134.10421 +	13,13,13,12,12,12,13,13,13,13,13,13,13,13,13,13,
134.10422 +	13,13, 7,10,10,11,11,10,11,11,11,11,10,11,11,11,
134.10423 +	11,10,11,11,11,11,10,11,11,11,11,10,11,11,11,11,
134.10424 +	11,11,11,11,11,11,11,11,12,11,11,11,12,12,12,11,
134.10425 +	11,11,12,12,10,10,10,11,11,11,11,11,12,11,10,11,
134.10426 +	11,11,11,11,11,11,12,12,11,11,11,12,12,11,11,11,
134.10427 +	11,11,11,11,12,12,12,11,12,11,12,12,11,12,12,12,
134.10428 +	12,11,12,12,12,12,11,11,11,11,11,11,11,11,12,12,
134.10429 +	11,12,11,12,12,11,12,12,12,12,11,12,12,12,12,10,
134.10430 +	10,10,11,11,11,11,11,12,12,11,11,11,12,12,11,12,
134.10431 +	12,12,12,11,12,12,12,12,11,11,11,11,11,11,11,12,
134.10432 +	12,12,11,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10433 +	12,11,11,11,11,11,11,12,12,12,12,11,12,11,12,12,
134.10434 +	12,12,12,12,12,12,12,12,12,12,11,12,12,12,12,12,
134.10435 +	12,12,12,12,12,12,12,12,12,12,12,12,12,13,12,12,
134.10436 +	12,13,12,11,11,11,12,12,12,12,12,12,12,12,12,12,
134.10437 +	12,12,12,12,12,12,12,12,12,12,12,12,10,11,11,11,
134.10438 +	11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,
134.10439 +	11,11,11,12,12,11,11,11,11,11,11,11,12,12,12,11,
134.10440 +	12,11,12,12,11,12,12,12,12,11,12,12,12,12,11,11,
134.10441 +	11,11,11,11,11,11,12,12,11,11,11,12,12,11,12,12,
134.10442 +	12,12,11,12,12,12,12,11,11,11,12,11,12,12,12,12,
134.10443 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10444 +	11,11,11,12,11,11,12,12,12,12,11,12,12,12,12,12,
134.10445 +	12,12,12,12,12,12,12,12,12,11,11,11,12,12,11,12,
134.10446 +	12,12,12,12,12,12,12,12,12,12,12,13,13,12,12,12,
134.10447 +	13,12,11,12,12,12,12,12,12,12,12,13,12,12,12,13,
134.10448 +	13,12,13,13,13,13,12,13,13,13,13,11,12,12,12,12,
134.10449 +	12,12,12,12,13,12,12,12,12,12,12,13,13,13,13,12,
134.10450 +	13,13,13,13,12,12,12,12,12,12,12,13,13,13,12,13,
134.10451 +	12,13,13,13,13,13,13,13,13,13,13,13,13,12,12,12,
134.10452 +	12,12,12,13,13,13,13,12,13,12,13,13,13,13,13,13,
134.10453 +	13,13,13,13,13,13,11,11,11,12,12,11,12,12,12,12,
134.10454 +	11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,11,
134.10455 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,
134.10456 +	12,13,13,12,12,12,13,13,11,12,12,12,12,12,12,12,
134.10457 +	12,12,12,12,12,12,12,12,12,12,13,13,12,13,12,13,
134.10458 +	13,12,12,12,12,12,12,12,12,13,13,12,12,12,13,13,
134.10459 +	13,13,13,13,13,12,13,13,13,13,12,12,12,12,12,12,
134.10460 +	13,12,13,13,12,13,12,13,12,12,13,13,13,13,12,13,
134.10461 +	13,13,13, 8,11,11,12,12,11,12,12,12,12,11,12,12,
134.10462 +	12,12,12,12,12,12,12,12,12,12,12,12,11,11,11,12,
134.10463 +	12,11,12,12,12,12,12,12,12,12,12,12,12,12,13,13,
134.10464 +	12,12,12,13,13,11,11,11,12,12,12,12,12,12,12,12,
134.10465 +	12,12,12,12,12,12,12,13,13,12,12,12,13,13,11,12,
134.10466 +	12,12,12,12,12,12,12,13,12,12,12,12,12,12,12,13,
134.10467 +	13,13,12,12,13,13,13,11,12,12,12,12,12,12,12,13,
134.10468 +	12,12,12,12,13,13,12,13,13,13,13,12,13,13,13,13,
134.10469 +	11,11,11,12,12,11,12,12,12,12,11,12,12,12,12,12,
134.10470 +	12,12,12,12,12,12,12,12,12,11,12,12,12,12,12,12,
134.10471 +	12,12,12,12,12,12,12,12,12,12,12,13,13,12,12,12,
134.10472 +	13,13,11,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10473 +	12,12,13,12,13,13,12,13,12,13,13,12,12,12,12,12,
134.10474 +	12,12,12,12,13,12,12,12,13,13,12,13,13,13,13,12,
134.10475 +	13,13,13,13,12,12,12,12,12,12,12,12,13,13,12,12,
134.10476 +	12,13,13,12,13,13,13,13,12,13,13,13,13,11,11,11,
134.10477 +	12,12,11,12,12,12,12,11,12,12,12,12,12,12,12,13,
134.10478 +	12,12,12,12,12,13,11,12,12,12,12,12,12,12,12,13,
134.10479 +	12,12,12,12,13,12,13,13,13,13,12,13,13,13,13,11,
134.10480 +	12,12,12,12,12,12,12,12,13,12,12,12,13,12,12,13,
134.10481 +	13,13,13,12,13,13,13,13,12,12,12,12,12,12,12,12,
134.10482 +	13,13,12,12,13,13,13,12,13,13,13,13,12,13,13,13,
134.10483 +	13,12,12,12,12,12,12,13,13,13,13,12,13,12,13,13,
134.10484 +	12,13,13,13,13,13,13,13,13,13,11,11,11,12,12,12,
134.10485 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10486 +	12,12,12,11,12,12,12,12,12,12,12,12,12,12,12,12,
134.10487 +	12,12,12,12,13,13,13,12,13,13,13,13,11,12,12,12,
134.10488 +	12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,
134.10489 +	12,13,12,13,13,12,12,12,12,12,12,12,12,13,13,12,
134.10490 +	12,12,13,13,12,13,13,13,13,12,13,13,13,13,12,12,
134.10491 +	12,12,12,12,13,12,13,13,12,12,12,13,13,13,13,13,
134.10492 +	13,13,12,13,13,13,13,11,11,11,12,12,12,12,12,12,
134.10493 +	12,12,12,12,12,12,12,12,12,12,13,12,12,12,13,12,
134.10494 +	11,12,12,12,12,12,12,12,12,12,12,12,12,13,13,12,
134.10495 +	12,13,13,13,12,13,13,13,13,11,12,12,12,12,12,12,
134.10496 +	12,12,13,12,12,12,13,12,12,13,13,13,13,12,13,13,
134.10497 +	13,13,12,12,12,12,12,12,12,12,13,13,12,12,12,13,
134.10498 +	13,13,13,13,13,13,13,13,13,13,13,12,12,12,12,12,
134.10499 +	12,13,13,13,13,12,13,12,13,13,13,13,13,13,13,13,
134.10500 +	13,13,13,13, 8,11,11,11,11,11,12,12,12,12,11,12,
134.10501 +	12,12,12,12,12,12,12,12,11,12,12,12,12,11,11,11,
134.10502 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10503 +	13,12,12,12,13,13,11,11,11,12,12,12,12,12,12,12,
134.10504 +	12,12,12,12,12,12,12,12,13,13,12,12,12,13,12,12,
134.10505 +	12,12,12,12,12,12,12,12,12,12,12,12,13,13,12,13,
134.10506 +	13,13,13,12,13,13,13,13,11,12,12,12,12,12,12,12,
134.10507 +	12,13,12,12,12,13,12,12,13,13,13,13,12,13,12,13,
134.10508 +	13,11,11,11,12,12,12,12,12,12,12,11,12,12,12,12,
134.10509 +	12,12,12,13,13,12,12,12,13,12,11,12,12,12,12,12,
134.10510 +	12,12,12,12,12,12,12,13,13,12,12,13,13,13,12,13,
134.10511 +	13,13,13,11,12,12,12,12,12,12,12,13,13,12,12,12,
134.10512 +	12,12,12,13,13,13,13,12,13,13,13,13,12,12,12,12,
134.10513 +	12,12,12,13,13,13,12,12,13,13,13,13,13,13,13,13,
134.10514 +	12,13,13,13,13,12,12,12,12,12,12,13,12,13,13,12,
134.10515 +	12,12,13,13,13,13,13,13,13,12,13,13,13,13,11,11,
134.10516 +	11,12,12,11,12,12,12,12,11,12,12,12,12,12,12,12,
134.10517 +	12,12,12,12,12,12,12,11,12,12,12,12,12,12,12,12,
134.10518 +	12,12,12,12,12,12,12,13,12,13,13,12,12,12,13,13,
134.10519 +	11,12,12,12,12,12,12,12,12,13,12,12,12,12,12,12,
134.10520 +	12,12,13,13,12,13,12,13,13,12,12,12,12,12,12,12,
134.10521 +	12,13,12,12,12,12,13,13,12,13,13,13,13,12,13,13,
134.10522 +	13,13,12,12,12,12,12,12,12,12,13,13,12,12,12,13,
134.10523 +	12,12,13,13,13,13,12,13,13,13,13,11,11,11,12,12,
134.10524 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10525 +	12,12,13,13,11,12,12,12,12,12,12,12,12,13,12,12,
134.10526 +	12,12,12,12,13,13,13,13,12,13,13,13,13,11,12,12,
134.10527 +	12,12,12,12,12,12,13,12,12,12,12,12,12,13,13,13,
134.10528 +	13,12,13,13,13,13,12,12,12,12,12,12,12,12,13,13,
134.10529 +	12,12,13,13,13,13,13,13,13,13,13,13,13,13,13,12,
134.10530 +	12,12,12,12,12,13,13,13,13,12,12,12,13,12,13,13,
134.10531 +	13,13,13,12,13,13,13,13,11,11,11,12,12,12,12,12,
134.10532 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10533 +	13,11,12,12,12,12,12,12,12,12,12,12,12,12,13,12,
134.10534 +	12,12,12,13,13,12,13,13,13,13,11,12,12,12,12,12,
134.10535 +	12,12,12,12,12,12,12,12,12,12,13,13,13,13,12,13,
134.10536 +	12,13,13,12,12,12,12,12,12,12,13,13,13,12,13,12,
134.10537 +	13,13,12,13,13,13,13,13,13,13,13,13,12,12,12,12,
134.10538 +	12,12,12,12,12,13,12,12,12,13,13,13,13,13,13,13,
134.10539 +	12,13,13,13,13,
134.10540 +};
134.10541 +
134.10542 +static const static_codebook _44p9_p4_1 = {
134.10543 +	5, 3125,
134.10544 +	(long *)_vq_lengthlist__44p9_p4_1,
134.10545 +	1, -533725184, 1611661312, 3, 0,
134.10546 +	(long *)_vq_quantlist__44p9_p4_1,
134.10547 +	0
134.10548 +};
134.10549 +
134.10550 +static const long _vq_quantlist__44p9_p5_0[] = {
134.10551 +	2,
134.10552 +	1,
134.10553 +	3,
134.10554 +	0,
134.10555 +	4,
134.10556 +};
134.10557 +
134.10558 +static const long _vq_lengthlist__44p9_p5_0[] = {
134.10559 +	 4, 6, 6, 9, 9, 6, 7, 8,10,11, 6, 8, 7,10,10, 8,
134.10560 +	10,10,12,12, 8,10,10,12,12, 6, 7, 8,10,10, 7, 8,
134.10561 +	 9,10,11, 8, 9, 9,11,11,10,10,11,12,13,10,11,11,
134.10562 +	13,13, 6, 8, 7,10,10, 8, 9, 9,11,11, 7, 9, 8,11,
134.10563 +	10,10,11,11,13,13,10,11,10,13,12, 9,10,10,11,12,
134.10564 +	10,10,11,12,13,10,11,11,12,13,12,12,13,12,14,12,
134.10565 +	13,13,14,14, 9,10,10,12,11,10,11,11,13,12,10,11,
134.10566 +	10,13,12,12,13,13,14,14,12,13,12,14,12, 7, 8, 8,
134.10567 +	10,11, 8, 9,10,11,12, 8, 9, 9,11,12,10,11,12,13,
134.10568 +	14,10,11,11,13,13, 8, 9,10,11,12, 9,10,11,12,13,
134.10569 +	10,10,11,12,12,11,12,12,13,14,11,12,12,14,14, 8,
134.10570 +	 9, 9,11,12,10,10,11,12,13, 9,10,10,12,12,11,12,
134.10571 +	12,14,14,11,12,12,14,13,11,11,12,12,13,11,12,12,
134.10572 +	13,14,12,12,13,14,14,13,13,14,14,16,13,14,14,15,
134.10573 +	15,11,12,11,13,13,12,12,12,14,14,11,12,12,14,13,
134.10574 +	13,14,14,15,15,13,14,13,15,14, 7, 8, 8,11,10, 8,
134.10575 +	10, 9,12,11, 8,10, 9,12,11,10,11,11,13,13,10,12,
134.10576 +	11,14,13, 8, 9, 9,12,11, 9,10,10,12,12,10,11,10,
134.10577 +	13,12,11,12,12,13,14,11,12,12,14,14, 8,10, 9,12,
134.10578 +	11,10,11,10,12,12, 9,11,10,13,11,11,12,12,14,14,
134.10579 +	11,12,12,14,13,11,11,12,13,13,11,12,12,13,14,12,
134.10580 +	12,12,14,14,13,13,14,14,15,13,14,14,15,15,11,12,
134.10581 +	11,13,12,12,12,12,14,14,11,12,12,14,13,13,14,14,
134.10582 +	15,15,13,14,13,15,14,10,11,11,12,13,11,12,12,13,
134.10583 +	14,11,12,12,13,14,13,13,14,14,16,13,14,14,15,15,
134.10584 +	11,12,12,12,14,12,12,13,13,15,12,13,13,13,15,14,
134.10585 +	14,15,15,16,14,14,15,15,16,11,12,12,13,14,12,13,
134.10586 +	13,14,15,12,13,13,14,14,14,14,15,15,16,14,14,14,
134.10587 +	15,15,13,14,14,14,15,14,14,15,15,16,14,15,15,15,
134.10588 +	16,15,15,16,16,18,16,16,16,17,17,13,14,14,15,15,
134.10589 +	14,14,15,16,16,14,14,14,16,15,16,16,16,17,17,15,
134.10590 +	16,16,17,16,10,11,11,13,12,11,12,12,14,13,11,12,
134.10591 +	12,14,13,13,14,14,15,15,13,14,13,16,14,11,12,12,
134.10592 +	14,13,12,13,13,14,14,12,13,13,15,14,14,14,14,15,
134.10593 +	15,14,15,14,16,15,11,12,12,14,12,12,13,13,15,14,
134.10594 +	12,13,12,15,13,14,15,14,16,15,14,15,14,16,15,13,
134.10595 +	14,14,15,15,14,14,14,15,16,14,15,14,16,16,15,16,
134.10596 +	16,16,17,16,16,16,17,17,13,14,14,15,14,14,15,15,
134.10597 +	16,15,14,15,14,16,15,16,16,16,17,17,15,16,15,18,
134.10598 +	16, 6, 8, 8,11,11, 8, 9,10,11,12, 8,10, 9,12,12,
134.10599 +	10,11,11,13,13,10,12,11,14,13, 8, 9, 9,11,12, 9,
134.10600 +	10,10,12,12, 9,10,10,12,12,11,11,12,13,14,11,12,
134.10601 +	12,14,14, 8,10, 9,12,11,10,11,11,12,12, 9,11,10,
134.10602 +	13,12,11,12,12,14,14,11,12,12,14,13,10,11,11,13,
134.10603 +	13,11,12,12,13,14,11,12,12,14,14,13,13,14,13,15,
134.10604 +	13,14,14,15,15,11,12,11,13,13,12,12,12,14,14,11,
134.10605 +	12,12,14,13,13,14,14,15,15,13,14,13,15,14, 8, 9,
134.10606 +	 9,11,11, 9,10,10,12,12, 9,10,10,12,12,11,12,12,
134.10607 +	13,14,11,12,12,14,14, 9, 9,10,11,12,10,10,11,12,
134.10608 +	13,10,10,11,12,13,12,12,13,13,15,12,12,13,14,14,
134.10609 +	 9,10,10,12,12,10,11,11,13,13,10,11,11,13,13,12,
134.10610 +	13,13,14,15,12,13,12,14,14,11,11,12,12,14,12,12,
134.10611 +	13,13,14,12,12,13,13,14,13,13,14,14,16,14,14,14,
134.10612 +	15,15,11,12,12,14,13,12,13,13,14,14,12,13,13,15,
134.10613 +	14,14,14,14,16,16,13,14,14,16,14, 7, 9, 9,12,11,
134.10614 +	 9,10,10,12,12, 9,11,10,13,12,11,12,12,13,14,11,
134.10615 +	13,12,14,13, 9,10,10,12,12,10,10,11,12,13,10,12,
134.10616 +	11,13,13,12,12,13,13,14,12,13,13,15,14, 9,10,10,
134.10617 +	12,12,11,11,11,13,13,10,12,10,13,12,12,13,13,14,
134.10618 +	15,12,13,12,15,13,11,12,12,14,13,12,12,13,13,14,
134.10619 +	12,13,13,15,14,13,13,14,13,16,14,15,14,16,15,12,
134.10620 +	12,12,14,14,13,13,13,14,14,12,13,12,14,13,14,15,
134.10621 +	15,16,16,13,14,13,16,13,10,11,12,13,14,11,12,13,
134.10622 +	13,15,12,12,13,14,14,13,14,14,15,16,13,14,14,16,
134.10623 +	15,12,12,13,12,14,12,12,13,13,15,13,13,13,13,15,
134.10624 +	14,14,15,14,16,14,15,15,15,16,12,13,12,14,14,13,
134.10625 +	13,13,15,15,12,13,13,15,15,14,15,15,16,16,14,15,
134.10626 +	15,16,16,13,14,14,13,16,14,14,15,14,16,14,14,15,
134.10627 +	14,16,15,15,16,15,18,16,16,16,16,17,14,14,14,16,
134.10628 +	15,14,15,15,16,16,14,15,15,16,16,16,16,16,17,17,
134.10629 +	15,16,16,17,16,10,12,11,14,13,12,13,13,14,14,12,
134.10630 +	13,12,15,14,14,14,14,15,15,14,15,14,16,15,12,13,
134.10631 +	12,14,13,12,13,13,15,14,13,14,13,15,14,14,15,15,
134.10632 +	16,16,14,15,15,17,15,12,13,12,14,14,13,14,14,15,
134.10633 +	15,13,14,13,15,14,15,15,15,16,16,14,15,15,17,15,
134.10634 +	14,14,14,16,15,14,15,15,16,16,14,15,15,16,15,16,
134.10635 +	16,16,16,17,16,17,16,18,17,14,14,14,16,15,15,15,
134.10636 +	15,16,16,14,15,14,16,15,16,16,17,17,17,15,16,15,
134.10637 +	17,16, 6, 8, 8,11,11, 8, 9,10,12,12, 8,10, 9,12,
134.10638 +	11,10,11,12,13,13,10,11,11,13,13, 8, 9,10,11,12,
134.10639 +	 9,10,11,12,13,10,11,11,12,12,11,12,12,13,14,11,
134.10640 +	12,12,14,14, 8, 9, 9,12,11, 9,10,10,12,12, 9,10,
134.10641 +	10,12,12,11,12,12,14,14,11,12,11,14,13,11,11,12,
134.10642 +	13,13,11,12,12,13,14,12,12,12,14,14,13,13,14,14,
134.10643 +	15,13,14,14,15,15,10,11,11,13,13,11,12,12,14,14,
134.10644 +	11,12,12,14,13,13,14,14,15,15,13,14,13,15,13, 7,
134.10645 +	 9, 9,11,12, 9,10,11,12,13, 9,10,10,12,12,11,12,
134.10646 +	13,13,14,11,12,12,14,14, 9,10,10,12,12,10,10,11,
134.10647 +	12,13,11,12,11,13,13,12,12,13,13,15,12,13,13,15,
134.10648 +	14, 9,10,10,12,12,10,11,12,13,13,10,11,10,13,12,
134.10649 +	12,13,13,14,15,12,13,12,14,13,12,12,12,14,14,12,
134.10650 +	12,13,13,14,13,13,13,15,14,14,13,14,13,16,14,15,
134.10651 +	15,16,16,11,12,12,13,14,12,13,13,14,15,12,13,12,
134.10652 +	14,13,14,14,15,15,16,13,14,13,15,13, 8, 9, 9,11,
134.10653 +	11, 9,10,10,12,12, 9,10,10,12,12,11,12,12,14,14,
134.10654 +	11,12,11,14,13, 9,10,10,12,12,10,11,11,13,13,10,
134.10655 +	11,11,13,13,12,12,13,14,15,12,13,13,15,14, 9,10,
134.10656 +	 9,12,11,10,11,10,13,12,10,11,10,13,12,12,13,12,
134.10657 +	14,14,12,13,12,15,13,11,12,12,13,14,12,13,13,14,
134.10658 +	14,12,13,13,14,14,14,14,14,14,16,14,14,14,16,15,
134.10659 +	11,12,11,14,12,12,13,12,15,13,12,13,12,15,13,14,
134.10660 +	14,14,16,15,13,14,13,16,14,10,11,12,13,14,12,12,
134.10661 +	13,13,15,12,13,13,14,14,14,14,15,15,16,14,14,14,
134.10662 +	15,16,12,12,13,14,14,12,13,14,14,15,13,14,14,15,
134.10663 +	15,14,15,15,15,17,15,15,15,16,16,12,12,13,13,14,
134.10664 +	13,13,14,14,15,12,13,13,14,15,15,15,15,15,17,14,
134.10665 +	15,15,15,15,14,14,14,16,16,14,15,15,15,16,15,15,
134.10666 +	15,16,16,16,15,16,16,18,16,16,17,17,17,14,14,14,
134.10667 +	15,16,15,15,15,16,17,14,15,14,16,16,16,16,17,17,
134.10668 +	18,16,16,15,17,16,10,12,11,14,13,12,12,12,14,14,
134.10669 +	11,13,12,14,13,13,14,14,15,15,13,14,13,16,15,12,
134.10670 +	12,13,14,14,12,13,13,15,15,13,13,13,15,15,14,15,
134.10671 +	15,16,16,14,15,15,17,16,12,13,12,14,12,13,13,13,
134.10672 +	15,13,12,13,12,15,13,14,15,15,16,15,14,15,14,16,
134.10673 +	14,14,14,14,16,16,14,15,15,16,16,14,15,15,16,16,
134.10674 +	15,16,16,16,17,16,17,16,18,17,13,14,14,16,13,14,
134.10675 +	15,15,16,14,14,15,14,16,14,16,16,16,17,16,15,16,
134.10676 +	15,18,15, 9,11,11,13,13,11,12,12,14,14,11,12,12,
134.10677 +	14,14,13,14,14,15,15,13,14,14,15,15,11,12,12,14,
134.10678 +	14,11,12,13,14,15,12,13,13,15,14,13,14,14,15,16,
134.10679 +	13,14,14,16,16,11,12,12,14,14,12,13,13,15,15,12,
134.10680 +	13,13,15,14,14,14,14,16,16,14,15,14,16,15,12,13,
134.10681 +	13,14,15,12,13,14,15,16,13,14,14,16,16,14,14,15,
134.10682 +	16,17,15,15,15,17,17,13,14,14,15,15,14,15,14,16,
134.10683 +	16,14,15,14,16,15,15,16,16,17,17,15,16,15,17,16,
134.10684 +	10,12,12,13,14,11,12,13,14,14,12,13,12,14,14,13,
134.10685 +	14,14,15,16,13,14,14,16,15,11,12,12,14,14,12,12,
134.10686 +	13,14,15,12,13,13,15,15,13,13,15,15,17,14,14,15,
134.10687 +	16,16,12,13,12,14,14,12,13,13,15,15,12,13,13,15,
134.10688 +	14,14,15,15,16,16,14,15,14,16,16,13,12,14,13,16,
134.10689 +	13,13,15,14,16,14,13,15,15,16,14,14,16,15,17,15,
134.10690 +	15,16,16,17,13,14,14,16,15,14,15,15,16,16,14,15,
134.10691 +	14,16,15,16,16,16,17,17,15,16,16,18,16,10,12,12,
134.10692 +	14,14,12,12,13,14,14,12,13,12,15,14,13,14,14,15,
134.10693 +	16,14,15,14,16,15,11,12,12,14,14,12,13,13,14,15,
134.10694 +	13,14,13,15,15,14,14,15,15,16,14,15,15,17,16,12,
134.10695 +	13,13,14,14,13,13,14,15,15,12,14,13,15,15,14,15,
134.10696 +	15,16,16,14,15,15,17,15,13,14,13,15,15,13,14,14,
134.10697 +	15,16,14,15,14,17,16,15,15,15,15,17,16,16,16,18,
134.10698 +	17,14,14,14,16,16,15,15,15,16,16,14,15,14,16,16,
134.10699 +	16,16,17,17,17,16,16,16,17,16,11,12,13,14,14,12,
134.10700 +	13,13,15,15,12,13,13,15,15,14,15,15,16,16,14,15,
134.10701 +	15,17,16,12,13,13,14,15,13,13,14,14,16,13,14,14,
134.10702 +	15,16,15,14,16,15,17,15,15,16,16,17,12,13,13,15,
134.10703 +	15,13,14,14,16,16,13,14,14,16,15,15,15,16,17,17,
134.10704 +	15,16,15,17,16,14,14,15,13,16,15,14,16,14,17,15,
134.10705 +	15,16,14,17,16,15,17,15,18,16,16,17,16,18,14,15,
134.10706 +	15,17,16,15,16,16,17,17,15,16,15,17,16,16,17,17,
134.10707 +	18,18,16,17,15,18,16,11,12,12,14,14,13,13,14,14,
134.10708 +	15,13,14,13,16,14,15,15,15,16,16,15,16,15,17,16,
134.10709 +	12,13,13,15,14,13,13,14,15,15,14,15,14,16,15,15,
134.10710 +	15,16,15,16,16,16,16,18,16,12,13,13,15,15,14,14,
134.10711 +	15,15,16,13,14,13,16,15,16,16,16,17,17,15,16,15,
134.10712 +	17,15,14,15,14,16,15,14,15,15,16,16,15,16,15,17,
134.10713 +	16,16,15,16,15,17,17,18,17,18,17,15,15,15,16,16,
134.10714 +	16,16,16,17,17,14,15,15,17,16,17,17,18,18,18,16,
134.10715 +	17,15,18,15, 9,11,11,13,13,11,12,12,14,14,11,12,
134.10716 +	12,14,14,13,14,14,15,16,13,14,14,15,15,11,12,12,
134.10717 +	14,14,12,13,13,14,15,12,13,13,14,14,14,14,15,15,
134.10718 +	16,14,14,14,16,16,11,12,12,14,14,12,13,13,14,15,
134.10719 +	11,13,12,14,14,13,14,14,16,16,13,14,14,16,15,13,
134.10720 +	14,14,15,15,14,14,15,15,16,14,15,14,16,16,15,15,
134.10721 +	16,16,17,15,16,16,17,17,12,13,13,15,15,13,14,14,
134.10722 +	16,15,12,14,13,16,15,15,16,15,17,17,14,15,15,17,
134.10723 +	15,10,12,12,14,14,12,12,13,14,15,12,13,12,14,14,
134.10724 +	14,14,15,15,16,13,14,14,16,16,12,13,13,14,14,13,
134.10725 +	13,14,14,15,13,14,13,15,15,14,15,15,15,17,14,15,
134.10726 +	15,16,16,11,12,12,14,14,13,13,14,15,15,12,13,13,
134.10727 +	15,14,14,15,15,16,17,14,15,14,16,15,14,14,14,16,
134.10728 +	16,14,15,15,16,16,15,15,15,16,16,15,16,16,16,18,
134.10729 +	16,17,16,18,17,13,13,14,15,15,14,14,15,16,16,13,
134.10730 +	14,14,16,15,16,16,17,17,17,15,15,15,17,15,10,12,
134.10731 +	12,14,13,12,12,13,14,14,11,13,12,14,14,13,14,14,
134.10732 +	16,16,13,14,14,16,15,12,12,13,14,14,12,13,13,14,
134.10733 +	15,13,13,13,15,15,14,14,15,16,16,14,15,15,16,16,
134.10734 +	11,12,12,14,14,12,13,13,15,15,12,13,12,15,14,14,
134.10735 +	15,14,16,16,13,15,13,16,15,13,14,14,15,16,14,15,
134.10736 +	15,15,17,14,15,15,16,16,16,15,16,16,17,16,16,16,
134.10737 +	17,17,13,14,12,16,13,14,15,13,16,15,13,15,13,16,
134.10738 +	14,15,16,15,17,16,15,16,14,17,15,11,12,12,14,15,
134.10739 +	13,13,14,14,16,13,14,13,15,14,15,15,16,16,17,15,
134.10740 +	15,15,16,16,12,13,13,15,15,13,13,14,15,16,14,15,
134.10741 +	14,16,15,15,15,16,15,17,16,16,16,17,17,12,13,13,
134.10742 +	14,15,14,14,15,15,16,13,14,13,15,15,16,16,16,17,
134.10743 +	17,15,16,15,16,15,15,15,15,16,16,14,15,15,16,17,
134.10744 +	16,16,16,17,17,16,15,17,15,18,17,18,17,18,18,14,
134.10745 +	14,15,15,17,15,15,16,16,17,14,15,15,16,16,17,17,
134.10746 +	17,17,18,16,16,15,17,15,11,12,12,14,14,12,13,13,
134.10747 +	15,15,12,13,13,15,15,14,15,15,16,16,14,15,14,17,
134.10748 +	16,13,13,13,15,15,13,14,14,15,16,13,14,14,16,16,
134.10749 +	15,15,16,16,17,15,16,16,17,17,12,13,13,15,14,13,
134.10750 +	14,14,16,15,13,14,13,16,14,15,16,16,17,16,15,16,
134.10751 +	14,17,15,14,15,15,16,17,15,15,16,16,17,15,16,16,
134.10752 +	17,17,16,15,17,16,18,16,17,17,18,18,14,15,14,16,
134.10753 +	13,15,16,15,17,14,15,16,14,17,14,16,17,16,18,16,
134.10754 +	16,17,15,18,15,
134.10755 +};
134.10756 +
134.10757 +static const static_codebook _44p9_p5_0 = {
134.10758 +	5, 3125,
134.10759 +	(long *)_vq_lengthlist__44p9_p5_0,
134.10760 +	1, -528744448, 1616642048, 3, 0,
134.10761 +	(long *)_vq_quantlist__44p9_p5_0,
134.10762 +	0
134.10763 +};
134.10764 +
134.10765 +static const long _vq_quantlist__44p9_p5_1[] = {
134.10766 +	3,
134.10767 +	2,
134.10768 +	4,
134.10769 +	1,
134.10770 +	5,
134.10771 +	0,
134.10772 +	6,
134.10773 +};
134.10774 +
134.10775 +static const long _vq_lengthlist__44p9_p5_1[] = {
134.10776 +	 2, 3, 3, 3, 3, 3, 3,
134.10777 +};
134.10778 +
134.10779 +static const static_codebook _44p9_p5_1 = {
134.10780 +	1, 7,
134.10781 +	(long *)_vq_lengthlist__44p9_p5_1,
134.10782 +	1, -533200896, 1611661312, 3, 0,
134.10783 +	(long *)_vq_quantlist__44p9_p5_1,
134.10784 +	0
134.10785 +};
134.10786 +
134.10787 +static const long _vq_quantlist__44p9_p6_0[] = {
134.10788 +	1,
134.10789 +	0,
134.10790 +	2,
134.10791 +};
134.10792 +
134.10793 +static const long _vq_lengthlist__44p9_p6_0[] = {
134.10794 +	 2, 5, 5, 5, 7, 7, 5, 7, 7, 5, 7, 7, 7, 8, 9, 7,
134.10795 +	 9, 9, 5, 7, 7, 7, 9, 9, 7, 9, 8, 5, 7, 8, 8, 9,
134.10796 +	10, 8, 9,10, 8, 9,10,10,10,12,10,11,11, 8,10,10,
134.10797 +	10,11,12,10,11,10, 5, 8, 7, 8,10,10, 8,10, 9, 8,
134.10798 +	10,10,10,10,11,10,12,11, 8,10, 9,10,11,11,10,12,
134.10799 +	10, 5, 8, 8, 7, 9,10, 8,10, 9, 7, 9,10, 9,10,11,
134.10800 +	 9,11,11, 8,10, 9,10,11,11, 9,11,10, 7, 9, 9, 9,
134.10801 +	10,11, 9,11,11, 9, 9,11,10,10,13,11,12,12, 9,11,
134.10802 +	11,11,12,13,11,13,11, 7, 9, 9, 9,10,11, 9,11,10,
134.10803 +	 9,11,10,10,10,12,11,13,12, 9,11,11,11,12,12,10,
134.10804 +	12,10, 5, 8, 8, 8, 9,10, 7,10, 9, 8, 9,10, 9,10,
134.10805 +	11,10,11,11, 7,10, 9, 9,11,11, 9,11,10, 7, 9, 9,
134.10806 +	 9,10,11, 9,11,10, 9,11,11,10,10,12,11,12,12, 9,
134.10807 +	10,11,11,12,13,10,12,10, 7, 9, 9, 9,11,11, 9,11,
134.10808 +	10, 9,11,11,11,11,13,11,13,12, 9,11, 9,11,12,12,
134.10809 +	10,13,10,
134.10810 +};
134.10811 +
134.10812 +static const static_codebook _44p9_p6_0 = {
134.10813 +	5, 243,
134.10814 +	(long *)_vq_lengthlist__44p9_p6_0,
134.10815 +	1, -527106048, 1620377600, 2, 0,
134.10816 +	(long *)_vq_quantlist__44p9_p6_0,
134.10817 +	0
134.10818 +};
134.10819 +
134.10820 +static const long _vq_quantlist__44p9_p6_1[] = {
134.10821 +	1,
134.10822 +	0,
134.10823 +	2,
134.10824 +};
134.10825 +
134.10826 +static const long _vq_lengthlist__44p9_p6_1[] = {
134.10827 +	 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 7, 8, 8, 7,
134.10828 +	 8, 8, 7, 8, 7, 7, 8, 8, 7, 8, 8, 7, 8, 8, 8, 8,
134.10829 +	 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 8, 8, 9, 8, 8, 8,
134.10830 +	 8, 8, 8, 8, 8, 8, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8,
134.10831 +	 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9,
134.10832 +	 8, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
134.10833 +	 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
134.10834 +	 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 8, 8, 9, 8, 8,
134.10835 +	 8, 8, 9, 9, 8, 9, 9, 7, 8, 8, 8, 8, 8, 8, 8, 8,
134.10836 +	 8, 8, 8, 8, 8, 8, 8, 9, 8, 8, 8, 8, 8, 9, 9, 8,
134.10837 +	 9, 8, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
134.10838 +	 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 8, 8,
134.10839 +	 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 8, 9, 9, 8,
134.10840 +	 8, 8, 8, 8, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
134.10841 +	 8, 8, 8, 8, 8, 9, 9, 8, 9, 9, 8, 8, 8, 8, 9, 8,
134.10842 +	 8, 9, 8,
134.10843 +};
134.10844 +
134.10845 +static const static_codebook _44p9_p6_1 = {
134.10846 +	5, 243,
134.10847 +	(long *)_vq_lengthlist__44p9_p6_1,
134.10848 +	1, -530841600, 1616642048, 2, 0,
134.10849 +	(long *)_vq_quantlist__44p9_p6_1,
134.10850 +	0
134.10851 +};
134.10852 +
134.10853 +static const long _vq_quantlist__44p9_p7_0[] = {
134.10854 +	2,
134.10855 +	1,
134.10856 +	3,
134.10857 +	0,
134.10858 +	4,
134.10859 +};
134.10860 +
134.10861 +static const long _vq_lengthlist__44p9_p7_0[] = {
134.10862 +	 1,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10863 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10864 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10865 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10866 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10867 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10868 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10869 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10870 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10871 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10872 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10873 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10874 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10875 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10876 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10877 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10878 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10879 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10880 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10881 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10882 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10883 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10884 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10885 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10886 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10887 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10888 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10889 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10890 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10891 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10892 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10893 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10894 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10895 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10896 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10897 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10898 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10899 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10900 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10901 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10902 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10903 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10904 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10905 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10906 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10907 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10908 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10909 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10910 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10911 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10912 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10913 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10914 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10915 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10916 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10917 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10918 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10919 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10920 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10921 +	12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
134.10922 +	12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,
134.10923 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10924 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10925 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10926 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10927 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10928 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10929 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10930 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10931 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10932 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10933 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10934 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10935 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10936 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10937 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10938 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10939 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10940 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10941 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10942 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10943 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10944 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10945 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10946 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10947 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10948 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10949 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10950 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10951 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10952 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10953 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10954 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10955 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10956 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10957 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10958 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10959 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10960 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10961 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10962 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10963 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10964 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10965 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10966 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10967 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10968 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10969 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10970 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10971 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10972 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10973 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10974 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10975 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10976 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10977 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10978 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10979 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10980 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10981 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10982 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10983 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10984 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10985 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10986 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10987 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10988 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10989 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10990 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10991 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10992 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10993 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10994 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10995 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10996 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10997 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10998 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.10999 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11000 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11001 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11002 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11003 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11004 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11005 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11006 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11007 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11008 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11009 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11010 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11011 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11012 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11013 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11014 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11015 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11016 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11017 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11018 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11019 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11020 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11021 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11022 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11023 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11024 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11025 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11026 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11027 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11028 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11029 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11030 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11031 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11032 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11033 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11034 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11035 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11036 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11037 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11038 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11039 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11040 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11041 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11042 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11043 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11044 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11045 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11046 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11047 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11048 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11049 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11050 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11051 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11052 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11053 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11054 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11055 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11056 +	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
134.11057 +	13,13,13,13,13,
134.11058 +};
134.11059 +
134.11060 +static const static_codebook _44p9_p7_0 = {
134.11061 +	5, 3125,
134.11062 +	(long *)_vq_lengthlist__44p9_p7_0,
134.11063 +	1, -510105088, 1635281408, 3, 0,
134.11064 +	(long *)_vq_quantlist__44p9_p7_0,
134.11065 +	0
134.11066 +};
134.11067 +
134.11068 +static const long _vq_quantlist__44p9_p7_1[] = {
134.11069 +	2,
134.11070 +	1,
134.11071 +	3,
134.11072 +	0,
134.11073 +	4,
134.11074 +};
134.11075 +
134.11076 +static const long _vq_lengthlist__44p9_p7_1[] = {
134.11077 +	 1, 4, 4,16,16, 4, 9,11,15,16, 4,12, 8,16,16,12,
134.11078 +	16,16,16,16,13,16,16,16,16, 5, 8,10,16,16, 9, 9,
134.11079 +	14,15,16,12,14,14,16,16,16,16,16,16,16,16,16,16,
134.11080 +	16,16, 5,11, 8,16,15,12,14,16,16,16, 9,15, 9,16,
134.11081 +	16,16,16,16,16,16,16,16,16,16,16,15,16,16,16,16,
134.11082 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11083 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11084 +	16,16,16,16,16,16,16,16,16,16,16,16,16, 6,11,11,
134.11085 +	16,16,12,13,16,16,16,12,16,14,16,16,16,16,16,16,
134.11086 +	16,16,16,16,16,16,11,15,15,16,16,14,16,16,16,16,
134.11087 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,12,
134.11088 +	15,16,16,16,16,16,16,16,16,14,16,15,16,16,16,16,
134.11089 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11090 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11091 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11092 +	16,16,16,16,16,16,16,16,16,16, 5,11,11,16,16,12,
134.11093 +	15,16,16,16,12,16,14,16,16,16,16,16,16,16,16,16,
134.11094 +	16,16,16,12,15,15,16,16,14,16,16,16,16,16,16,16,
134.11095 +	16,16,16,16,16,16,16,16,16,16,16,16,11,15,15,16,
134.11096 +	16,16,16,16,16,16,15,16,14,16,16,16,16,16,16,16,
134.11097 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11098 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11099 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11100 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11101 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11102 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11103 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11104 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11105 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11106 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11107 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11108 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11109 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11110 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11111 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11112 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11113 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11114 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11115 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11116 +	16, 6,11,12,16,16,11,15,16,16,16,13,16,14,16,16,
134.11117 +	16,16,16,16,16,16,16,16,16,16,11,16,14,16,16,14,
134.11118 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11119 +	16,16,16,12,14,14,16,16,16,16,16,16,16,15,16,16,
134.11120 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11121 +	16,16,15,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11122 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11123 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16, 8,13,
134.11124 +	15,16,16,15,15,16,16,16,14,16,16,16,16,16,16,16,
134.11125 +	16,16,16,16,16,16,16,14,16,16,16,16,16,16,16,16,
134.11126 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11127 +	15,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11128 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11129 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11130 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11131 +	16,16,16,16,16,16,16,16,16,16,16, 7,12,12,16,16,
134.11132 +	13,12,16,16,16,14,16,14,16,16,16,16,16,16,16,16,
134.11133 +	16,16,16,16,13,16,16,16,16,14,14,16,16,16,16,16,
134.11134 +	16,16,16,16,16,16,16,16,16,16,16,16,16,12,14,16,
134.11135 +	16,16,16,16,16,16,16,14,16,14,16,16,16,16,16,16,
134.11136 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11137 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11138 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11139 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11140 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11141 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11142 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11143 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11144 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11145 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11146 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11147 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11148 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11149 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11150 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11151 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11152 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11153 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11154 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11155 +	16,16, 6,11,11,16,16,13,15,16,16,16,11,15,14,16,
134.11156 +	16,16,16,16,16,16,14,16,16,16,16,11,16,16,16,16,
134.11157 +	16,16,16,16,16,15,16,16,16,16,16,16,16,16,16,16,
134.11158 +	16,16,16,16,11,16,14,16,16,14,16,16,16,16,13,15,
134.11159 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11160 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11161 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11162 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 7,
134.11163 +	11,11,16,16,13,13,16,16,16,13,16,13,16,16,16,16,
134.11164 +	16,16,16,16,16,16,16,16,12,16,15,16,16,14,16,16,
134.11165 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11166 +	16,12,14,16,16,16,16,16,16,16,16,14,16,13,16,16,
134.11167 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11168 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11169 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11170 +	16,16,16,16,16,16,16,16,16,16,16,16, 8,13,14,16,
134.11171 +	16,15,16,16,16,16,14,16,16,16,16,16,16,16,16,16,
134.11172 +	16,16,16,16,16,15,16,16,16,16,16,16,16,16,16,16,
134.11173 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,15,16,
134.11174 +	15,16,16,16,16,16,16,16,16,16,15,16,16,16,16,16,
134.11175 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11176 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11177 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11178 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11179 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11180 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11181 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11182 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11183 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11184 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11185 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11186 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11187 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11188 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11189 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11190 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11191 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11192 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11193 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11194 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11195 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11196 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11197 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11198 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11199 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11200 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11201 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11202 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11203 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11204 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11205 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11206 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11207 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11208 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11209 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11210 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11211 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11212 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11213 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11214 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11215 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11216 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11217 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11218 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11219 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11220 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11221 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11222 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11223 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11224 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11225 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11226 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11227 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11228 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11229 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11230 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11231 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11232 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11233 +	16,16,16,16,15,16,16,16,16,16,16,16,16,16,16,16,
134.11234 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11235 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11236 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11237 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11238 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11239 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11240 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11241 +	16,15,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11242 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11243 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11244 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11245 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11246 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11247 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11248 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11249 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11250 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11251 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11252 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11253 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11254 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11255 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11256 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11257 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11258 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11259 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11260 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11261 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11262 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11263 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11264 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11265 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11266 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11267 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11268 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11269 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11270 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11271 +	16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
134.11272 +	16,16,16,16,16,
134.11273 +};
134.11274 +
134.11275 +static const static_codebook _44p9_p7_1 = {
134.11276 +	5, 3125,
134.11277 +	(long *)_vq_lengthlist__44p9_p7_1,
134.11278 +	1, -514619392, 1630767104, 3, 0,
134.11279 +	(long *)_vq_quantlist__44p9_p7_1,
134.11280 +	0
134.11281 +};
134.11282 +
134.11283 +static const long _vq_quantlist__44p9_p7_2[] = {
134.11284 +	12,
134.11285 +	11,
134.11286 +	13,
134.11287 +	10,
134.11288 +	14,
134.11289 +	9,
134.11290 +	15,
134.11291 +	8,
134.11292 +	16,
134.11293 +	7,
134.11294 +	17,
134.11295 +	6,
134.11296 +	18,
134.11297 +	5,
134.11298 +	19,
134.11299 +	4,
134.11300 +	20,
134.11301 +	3,
134.11302 +	21,
134.11303 +	2,
134.11304 +	22,
134.11305 +	1,
134.11306 +	23,
134.11307 +	0,
134.11308 +	24,
134.11309 +};
134.11310 +
134.11311 +static const long _vq_lengthlist__44p9_p7_2[] = {
134.11312 +	 1, 3, 2, 5, 4, 7, 7, 8, 8, 9,10,10,10,11,11,11,
134.11313 +	12,12,12,13,13,13,13,13,13,
134.11314 +};
134.11315 +
134.11316 +static const static_codebook _44p9_p7_2 = {
134.11317 +	1, 25,
134.11318 +	(long *)_vq_lengthlist__44p9_p7_2,
134.11319 +	1, -518864896, 1620639744, 5, 0,
134.11320 +	(long *)_vq_quantlist__44p9_p7_2,
134.11321 +	0
134.11322 +};
134.11323 +
134.11324 +static const long _vq_quantlist__44p9_p7_3[] = {
134.11325 +	12,
134.11326 +	11,
134.11327 +	13,
134.11328 +	10,
134.11329 +	14,
134.11330 +	9,
134.11331 +	15,
134.11332 +	8,
134.11333 +	16,
134.11334 +	7,
134.11335 +	17,
134.11336 +	6,
134.11337 +	18,
134.11338 +	5,
134.11339 +	19,
134.11340 +	4,
134.11341 +	20,
134.11342 +	3,
134.11343 +	21,
134.11344 +	2,
134.11345 +	22,
134.11346 +	1,
134.11347 +	23,
134.11348 +	0,
134.11349 +	24,
134.11350 +};
134.11351 +
134.11352 +static const long _vq_lengthlist__44p9_p7_3[] = {
134.11353 +	 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5,
134.11354 +	 5, 5, 5, 5, 5, 5, 5, 5, 5,
134.11355 +};
134.11356 +
134.11357 +static const static_codebook _44p9_p7_3 = {
134.11358 +	1, 25,
134.11359 +	(long *)_vq_lengthlist__44p9_p7_3,
134.11360 +	1, -529006592, 1611661312, 5, 0,
134.11361 +	(long *)_vq_quantlist__44p9_p7_3,
134.11362 +	0
134.11363 +};
134.11364 +
134.11365 +static const long _huff_lengthlist__44p9_short[] = {
134.11366 +	 3, 3, 3, 3, 3, 3, 3, 3,
134.11367 +};
134.11368 +
134.11369 +static const static_codebook _huff_book__44p9_short = {
134.11370 +	1, 8,
134.11371 +	(long *)_huff_lengthlist__44p9_short,
134.11372 +	0, 0, 0, 0, 0,
134.11373 +	NULL,
134.11374 +	0
134.11375 +};
134.11376 +
134.11377 +static const long _vq_quantlist__44pn1_l0_0[] = {
134.11378 +	6,
134.11379 +	5,
134.11380 +	7,
134.11381 +	4,
134.11382 +	8,
134.11383 +	3,
134.11384 +	9,
134.11385 +	2,
134.11386 +	10,
134.11387 +	1,
134.11388 +	11,
134.11389 +	0,
134.11390 +	12,
134.11391 +};
134.11392 +
134.11393 +static const long _vq_lengthlist__44pn1_l0_0[] = {
134.11394 +	 1, 3, 3, 8, 8,10,10,10,10,10,10,10,10, 5, 7, 5,
134.11395 +	 9, 8,10,10,10,10,11,10,11,10, 5, 5, 7, 8, 9,10,
134.11396 +	10,11,10,10,11,10,11,10,10,10,11,11,11,11,11,11,
134.11397 +	11,10,11,11,10,10,10,10,11,11,11,11,11,10,11,11,
134.11398 +	11,11,11,11,11,11,12,11,10,11,11,11,11,11,11,11,
134.11399 +	11,11,11,11,11,10,10,11,11,12,11,11,11,11,11,11,
134.11400 +	12,11,11,11,10,11,11,11,11,11,11,11,11,10,11,11,
134.11401 +	10,11,10,11,11,11,11,11,11,11,11,11,11,12,11,11,
134.11402 +	12,12,11,11,11,11,11,11,11,11,11,11,11,11,12,11,
134.11403 +	10,11,11,11,11,11,11,11,12,11,13,11,11,11,11,11,
134.11404 +	11,11,11,11,11,11,12,11,13,
134.11405 +};
134.11406 +
134.11407 +static const static_codebook _44pn1_l0_0 = {
134.11408 +	2, 169,
134.11409 +	(long *)_vq_lengthlist__44pn1_l0_0,
134.11410 +	1, -526516224, 1616117760, 4, 0,
134.11411 +	(long *)_vq_quantlist__44pn1_l0_0,
134.11412 +	0
134.11413 +};
134.11414 +
134.11415 +static const long _vq_quantlist__44pn1_l0_1[] = {
134.11416 +	2,
134.11417 +	1,
134.11418 +	3,
134.11419 +	0,
134.11420 +	4,
134.11421 +};
134.11422 +
134.11423 +static const long _vq_lengthlist__44pn1_l0_1[] = {
134.11424 +	 1, 4, 4, 7, 7, 4, 5, 6, 7, 7, 4, 6, 5, 7, 7, 7,
134.11425 +	 6, 7, 6, 7, 7, 7, 6, 7, 6,
134.11426 +};
134.11427 +
134.11428 +static const static_codebook _44pn1_l0_1 = {
134.11429 +	2, 25,
134.11430 +	(long *)_vq_lengthlist__44pn1_l0_1,
134.11431 +	1, -533725184, 1611661312, 3, 0,
134.11432 +	(long *)_vq_quantlist__44pn1_l0_1,
134.11433 +	0
134.11434 +};
134.11435 +
134.11436 +static const long _vq_quantlist__44pn1_l1_0[] = {
134.11437 +	1,
134.11438 +	0,
134.11439 +	2,
134.11440 +};
134.11441 +
134.11442 +static const long _vq_lengthlist__44pn1_l1_0[] = {
134.11443 +	 1, 4, 4, 4, 4, 4, 4, 4, 4,
134.11444 +};
134.11445 +
134.11446 +static const static_codebook _44pn1_l1_0 = {
134.11447 +	2, 9,
134.11448 +	(long *)_vq_lengthlist__44pn1_l1_0,
134.11449 +	1, -516716544, 1630767104, 2, 0,
134.11450 +	(long *)_vq_quantlist__44pn1_l1_0,
134.11451 +	0
134.11452 +};
134.11453 +
134.11454 +static const long _huff_lengthlist__44pn1_lfe[] = {
134.11455 +	 1, 3, 2, 3,
134.11456 +};
134.11457 +
134.11458 +static const static_codebook _huff_book__44pn1_lfe = {
134.11459 +	2, 4,
134.11460 +	(long *)_huff_lengthlist__44pn1_lfe,
134.11461 +	0, 0, 0, 0, 0,
134.11462 +	NULL,
134.11463 +	0
134.11464 +};
134.11465 +
134.11466 +static const long _huff_lengthlist__44pn1_long[] = {
134.11467 +	 2, 3, 6, 7, 9,13,17, 3, 2, 5, 7, 9,13,17, 6, 5,
134.11468 +	 5, 6, 9,12,16, 7, 7, 6, 6, 7,10,13,10,10, 9, 7,
134.11469 +	 6,10,13,13,13,12,10,10,11,15,17,17,17,14,14,15,
134.11470 +	17,
134.11471 +};
134.11472 +
134.11473 +static const static_codebook _huff_book__44pn1_long = {
134.11474 +	2, 49,
134.11475 +	(long *)_huff_lengthlist__44pn1_long,
134.11476 +	0, 0, 0, 0, 0,
134.11477 +	NULL,
134.11478 +	0
134.11479 +};
134.11480 +
134.11481 +static const long _vq_quantlist__44pn1_p1_0[] = {
134.11482 +	1,
134.11483 +	0,
134.11484 +	2,
134.11485 +};
134.11486 +
134.11487 +static const long _vq_lengthlist__44pn1_p1_0[] = {
134.11488 +	 1, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.11489 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.11490 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.11491 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.11492 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.11493 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.11494 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.11495 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.11496 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.11497 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.11498 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.11499 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.11500 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.11501 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.11502 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.11503 +	 0, 0, 0,
134.11504 +};
134.11505 +
134.11506 +static const static_codebook _44pn1_p1_0 = {
134.11507 +	5, 243,
134.11508 +	(long *)_vq_lengthlist__44pn1_p1_0,
134.11509 +	1, -535822336, 1611661312, 2, 0,
134.11510 +	(long *)_vq_quantlist__44pn1_p1_0,
134.11511 +	0
134.11512 +};
134.11513 +
134.11514 +static const long _vq_quantlist__44pn1_p2_0[] = {
134.11515 +	1,
134.11516 +	0,
134.11517 +	2,
134.11518 +};
134.11519 +
134.11520 +static const long _vq_lengthlist__44pn1_p2_0[] = {
134.11521 +	 1, 5, 5, 0, 7, 7, 0, 8, 8, 0, 9, 9, 0,12,12, 0,
134.11522 +	 8, 8, 0, 9, 9, 0,13,13, 0, 8, 8, 0, 6, 6, 0,11,
134.11523 +	11, 0,12,12, 0,12,12, 0,14,14, 0,11,12, 0,12,12,
134.11524 +	 0,15,15, 0,12,12, 0, 5, 5, 0, 5, 5, 0, 6, 6, 0,
134.11525 +	 7, 7, 0,10,10, 0, 6, 6, 0, 7, 7, 0,11,11, 0, 6,
134.11526 +	 6, 0, 7, 7, 0,11,11, 0,12,11, 0,11,11, 0,14,14,
134.11527 +	 0,10,10, 0,12,12, 0,15,15, 0,12,12, 0, 6, 6, 0,
134.11528 +	12,12, 0,12,12, 0,12,12, 0,14,14, 0,11,11, 0,12,
134.11529 +	12, 0,16,16, 0,12,12, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.11530 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.11531 +	 0, 0, 0, 8, 8, 0,12,12, 0,12,12, 0,12,12, 0,15,
134.11532 +	15, 0,12,12, 0,11,11, 0,16,16, 0,11,11, 0, 6, 6,
134.11533 +	 0,12,12, 0,12,12, 0,13,13, 0,15,15, 0,12,12, 0,
134.11534 +	13,13, 0,15,15, 0,12,12, 0, 0, 0, 0, 0, 0, 0, 0,
134.11535 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.11536 +	 0, 0, 0,
134.11537 +};
134.11538 +
134.11539 +static const static_codebook _44pn1_p2_0 = {
134.11540 +	5, 243,
134.11541 +	(long *)_vq_lengthlist__44pn1_p2_0,
134.11542 +	1, -533200896, 1614282752, 2, 0,
134.11543 +	(long *)_vq_quantlist__44pn1_p2_0,
134.11544 +	0
134.11545 +};
134.11546 +
134.11547 +static const long _vq_quantlist__44pn1_p2_1[] = {
134.11548 +	1,
134.11549 +	0,
134.11550 +	2,
134.11551 +};
134.11552 +
134.11553 +static const long _vq_lengthlist__44pn1_p2_1[] = {
134.11554 +	 1, 3, 3, 0, 9, 9, 0, 9, 9, 0,10,10, 0, 9, 9, 0,
134.11555 +	10,10, 0,10,10, 0,10,10, 0,10,10, 0, 7, 7, 0, 7,
134.11556 +	 7, 0, 6, 6, 0, 8, 8, 0, 7, 7, 0, 8, 8, 0, 8, 8,
134.11557 +	 0, 7, 7, 0, 8, 8, 0, 7, 7, 0, 9, 9, 0, 8, 9, 0,
134.11558 +	10,10, 0, 9, 9, 0,10,10, 0,10,11, 0, 9, 9, 0,10,
134.11559 +	10, 0, 9, 9, 0,11,11, 0,12,12, 0,12,12, 0,11,11,
134.11560 +	 0,12,12, 0,13,13, 0,12,12, 0,13,13, 0, 8, 8, 0,
134.11561 +	12,12, 0,12,12, 0,13,13, 0,13,13, 0,13,13, 0,13,
134.11562 +	13, 0,13,13, 0,13,13, 0, 7, 7, 0, 0, 0, 0, 0, 0,
134.11563 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.11564 +	 0, 0, 0, 9, 9, 0,11,11, 0,12,12, 0,13,13, 0,12,
134.11565 +	12, 0,13,13, 0,13,13, 0,12,12, 0,12,12, 0, 9, 9,
134.11566 +	 0,12,12, 0,13,13, 0,14,14, 0,13,13, 0,14,14, 0,
134.11567 +	14,14, 0,13,13, 0,14,14, 0, 7, 7, 0, 0, 0, 0, 0,
134.11568 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134.11569 +	 0, 0, 0,
134.11570 +};
134.11571 +
134.11572 +static const static_codebook _44pn1_p2_1 = {
134.11573 +	5, 243,
134.11574 +	(long *)_vq_lengthlist__44pn1_p2_1,
134.11575 +	1, -535822336, 1611661312, 2, 0,
134.11576 +	(long *)_vq_quantlist__44pn1_p2_1,
134.11577 +	0
134.11578 +};
134.11579 +
134.11580 +static const long _vq_quantlist__44pn1_p3_0[] = {
134.11581 +	1,
134.11582 +	0,
134.11583 +	2,
134.11584 +};
134.11585 +
134.11586 +static const long _vq_lengthlist__44pn1_p3_0[] = {
134.11587 +	 1, 6, 6, 6, 8, 8, 6, 8, 8, 7, 9, 9,10,11,11, 8,
134.11588 +	 8, 8, 7, 9, 9,11,12,12, 9, 9, 9, 6, 7, 7,10,11,
134.11589 +	11,10,11,11,10,11,11,13,13,13,12,12,12,10,12,11,
134.11590 +	14,14,14,12,12,12, 6, 5, 5, 9, 6, 6, 9, 6, 6, 9,
134.11591 +	 7, 7,12,10,10,11, 7, 6, 9, 7, 7,13,11,11,12, 7,
134.11592 +	 7, 7, 8, 8,12,10,10,12,10,10,11,10,10,15,13,13,
134.11593 +	13, 9, 9,12,11,11,15,14,14,15,11,11, 8, 7, 7,12,
134.11594 +	11,11,12,11,11,11,11,11,14,13,14,14,12,12,12,11,
134.11595 +	11,16,15,15,14,12,12, 0,10,10, 0,12,12, 0,12,12,
134.11596 +	 0,11,11, 0,14,14, 0,11,11, 0,11,11, 0,15,15, 0,
134.11597 +	11,11, 7, 8, 8,13,11,11,12,10,10,12,11,11,15,13,
134.11598 +	13,14,11,11,12,10,10,16,14,14,15,10,10, 9, 7, 7,
134.11599 +	13,11,12,13,12,11,12,11,11,15,14,14,14,12,12,13,
134.11600 +	12,12,16,15,15,15,12,12, 0,11,11, 0,12,12, 0,12,
134.11601 +	13, 0,12,12, 0,15,15, 0,12,12, 0,12,12, 0,16,15,
134.11602 +	 0,12,12,
134.11603 +};
134.11604 +
134.11605 +static const static_codebook _44pn1_p3_0 = {
134.11606 +	5, 243,
134.11607 +	(long *)_vq_lengthlist__44pn1_p3_0,
134.11608 +	1, -531365888, 1616117760, 2, 0,
134.11609 +	(long *)_vq_quantlist__44pn1_p3_0,
134.11610 +	0
134.11611 +};
134.11612 +
134.11613 +static const long _vq_quantlist__44pn1_p3_1[] = {
134.11614 +	2,
134.11615 +	1,
134.11616 +	3,
134.11617 +	0,
134.11618 +	4,
134.11619 +};
134.11620 +
134.11621 +static const long _vq_lengthlist__44pn1_p3_1[] = {
134.11622 +	 2, 3, 4, 9, 9,10,12,12,12,11,10,12,12,13,12,11,
134.11623 +	13,12,11,11,11,12,12,12,11,11,13,13,13,13,11,12,
134.11624 +	12,14,14,12,13,13,13,13,11,13,13,13,13,11,13,13,
134.11625 +	13,13,11,13,13,13,13,11,12,12,14,14,12,13,13,12,
134.11626 +	12,11,13,13,13,13,11,13,13,12,12,11,13,13,13,13,
134.11627 +	12,12,13,14,14,12,13,13,12,12,11,13,13,13,13,11,
134.11628 +	13,13,12,12,11,13,13,13,13,12,13,13,14,14,12,13,
134.11629 +	13,12,12,11,13,13,13,13,11,13,13,12,12,11,10,10,
134.11630 +	10,10,12,10,10,11,11,12, 9, 9,11,11,13,11,11,10,
134.11631 +	10,13,10,10,10,10,13,11,11,12,12,13,10,10,12,12,
134.11632 +	14,12,11,12,12,13,11,11,11,12,13,12,12,12,12,13,
134.11633 +	11,11,12,12,13,10,10,12,12,14,11,11,12,12,13,11,
134.11634 +	11,12,12,13,11,11,12,12,14,12,12,12,12,14,10,10,
134.11635 +	11,11,14,12,11,11,11,13,11,11,11,11,13,12,12,11,
134.11636 +	11,14,12,12,12,11,14,10,10,11,11,14,12,11,11,11,
134.11637 +	13,11,11,11,11,13,12,12,11,11,11,11,11,10,10,12,
134.11638 +	10,11, 9, 9,12,12,12,11,11,13,12,12, 9, 9,13,13,
134.11639 +	13,10,10,13,13,13,12,12,13,13,13,14,14,13,12,12,
134.11640 +	11,11,14,13,13,12,12,14,13,13,11,11,13,13,13,12,
134.11641 +	11,13,13,13,14,14,13,12,12,10,10,14,13,13,11,11,
134.11642 +	13,13,13,10,10,13,13,13,11,11,14,13,13,14,14,14,
134.11643 +	12,12,10,10,13,13,13,11,11,13,13,13,10,10,13,13,
134.11644 +	13,11,11,14,13,13,14,14,14,13,13,10,10,13,13,13,
134.11645 +	11,11,13,13,13,10,10,14,12,12, 8, 8,14,12,12, 9,
134.11646 +	 9,14,11,11, 9, 9,14,12,12, 8, 8,14,12,12, 7, 7,
134.11647 +	15,13,13,10,10,15,12,12,10,10,15,13,13,10,10,15,
134.11648 +	12,13, 9, 9,15,13,13,10,10,15,13,13,10,10,15,12,
134.11649 +	12,10,10,15,13,13,10,10,15,13,13, 9, 9,15,13,13,
134.11650 +	10,10,15,13,13,10,10,15,12,12,10,10,15,13,13, 9,
134.11651 +	 9,14,13,12, 9, 9,14,13,13, 9, 9,15,13,13,10,10,
134.11652 +	15,12,12,10,10,15,13,13, 9, 9,15,13,13, 9, 9,14,
134.11653 +	13,13, 9, 9,14,12,12, 8, 8,13,13,13, 8, 8,14,14,
134.11654 +	13, 9, 9,14,14,13, 7, 7,14,14,14, 8, 8,14,14,14,
134.11655 +	10,10,15,14,14,12,12,14,14,14, 9, 9,15,14,14,10,
134.11656 +	10,14,14,14, 9, 9,14,14,14,10, 9,15,14,14,12,12,
134.11657 +	14,14,14, 9, 9,15,14,14,10,10,14,14,14, 9, 9,15,
134.11658 +	14,15, 9, 9,15,14,14,11,11,14,14,14, 8, 8,14,14,
134.11659 +	14, 9, 9,14,14,14, 8, 8,14,15,14,10,10,15,14,14,
134.11660 +	11,11,14,14,14, 8, 8,15,14,14, 9, 9,14,14,14, 8,
134.11661 +	 8,12,12,12,13,13,16,16,15,12,12,17,16,16,13,13,
134.11662 +	17,16,16,11,11,17,16,16,12,12,17,16,17,13,13,17,
134.11663 +	16,16,14,14,17,17,16,12,12,18,16,16,13,13,17,16,
134.11664 +	17,12,12,17,17,17,13,13,18,16,16,14,14,18,17,17,
134.11665 +	12,12,17,17,17,13,13,18,17,17,13,13,17,17,17,13,
134.11666 +	13,17,16,16,14,14,17,17,17,12,12,16,16,17,13,13,
134.11667 +	17,17,16,12,12,18,17,17,13,13,18,16,16,14,14,18,
134.11668 +	17,17,12,12,19,16,17,13,13,17,16,17,12,12,13,14,
134.11669 +	14,10,10,16,14,14,13,13,17,15,15,14,14,17,14,14,
134.11670 +	13,13,16,14,14,13,13,17,16,15,14,14,16,16,16,15,
134.11671 +	15,17,15,15,14,14,17,15,15,14,14,17,15,15,14,14,
134.11672 +	17,16,15,14,14,16,16,16,15,15,18,15,15,13,13,16,
134.11673 +	16,15,14,14,17,15,15,14,13,17,15,15,14,14,16,16,
134.11674 +	16,15,15,18,15,14,13,13,17,15,15,14,14,18,14,15,
134.11675 +	13,13,18,15,15,14,14,16,16,16,15,15,17,15,15,13,
134.11676 +	13,17,15,15,14,14,17,15,15,13,13,13,11,11,10,10,
134.11677 +	16,14,14,13,13,17,14,15,14,14,17,15,15,12,12,17,
134.11678 +	14,14,12,12,16,15,15,14,14,16,14,14,14,14,16,15,
134.11679 +	15,14,14,16,15,15,14,14,16,15,15,14,14,16,15,15,
134.11680 +	14,14,16,15,14,15,15,17,15,15,14,14,17,15,15,14,
134.11681 +	14,17,15,15,14,14,17,15,16,14,14,16,14,14,14,14,
134.11682 +	17,15,15,13,13,17,15,15,13,13,16,15,15,13,13,17,
134.11683 +	16,16,14,14,17,15,14,15,14,17,15,15,13,13,17,15,
134.11684 +	15,13,13,17,15,15,13,13,14,14,14, 9, 9,14,14,14,
134.11685 +	18,19,14,15,15,19,18,14,14,14,19,19,15,14,14,19,
134.11686 +	19,15,16,16,19,19,15,16,16,19,19,15,15,15,19,19,
134.11687 +	15,16,16,19,20,15,15,15,19,19,15,15,15,19,19,15,
134.11688 +	16,16,20,20,15,15,15,18,19,15,15,16,19,20,15,15,
134.11689 +	15,19,18,15,15,15,18,18,15,16,16,21,20,15,15,15,
134.11690 +	19,19,15,15,15,19,19,15,15,14,19,20,15,15,15,20,
134.11691 +	19,15,16,16,19,20,15,15,15,19,19,15,15,15,20,21,
134.11692 +	15,14,15,19,19,14,12,12, 9, 9,14,14,15,21,19,14,
134.11693 +	14,14,18,19,14,15,15,19,20,14,14,14,19,19,15,15,
134.11694 +	15,19,20,15,15,14,21,19,15,15,15,20,19,15,14,15,
134.11695 +	20,21,15,15,15,18,18,15,15,15,20,21,16,14,14,18,
134.11696 +	19,15,15,15,20,19,15,15,15,18,21,15,15,15,19,19,
134.11697 +	15,15,15,19,20,16,15,14,20,19,15,16,15,19,19,15,
134.11698 +	15,15,19, 0,14,15,15,19,19,15,15,15,19,19,15,15,
134.11699 +	14,20,19,15,15,15,20,19,15,15,15,19,19,15,15,15,
134.11700 +	20,19,12,12,12,13,13,16,15,16,11,11,16,16,16,12,
134.11701 +	12,17,16,16,11,11,17,16,16,12,11,17,17,17,13,13,
134.11702 +	18,16,16,14,14,18,18,17,13,13,17,16,16,13,13,17,
134.11703 +	17,17,13,13,17,16,17,12,12,17,15,16,13,13,17,16,
134.11704 +	17,12,12,17,16,16,13,12,17,16,16,12,12,18,17,17,
134.11705 +	13,13,18,16,16,13,14,18,17,17,12,12,17,16,16,12,
134.11706 +	12,17,17,17,12,12,18,17,17,13,13,17,16,16,14,14,
134.11707 +	17,17,17,12,12,17,16,16,12,12,18,17,17,12,12,13,
134.11708 +	14,14, 9, 9,16,14,14,13,13,16,15,15,14,14,16,14,
134.11709 +	14,13,13,16,14,14,13,13,17,16,15,15,15,16,15,16,
134.11710 +	16,15,17,15,15,14,14,17,15,15,15,15,17,15,15,14,
134.11711 +	14,17,15,15,14,14,16,15,16,16,16,17,15,15,14,14,
134.11712 +	16,15,15,14,15,16,15,15,14,14,17,15,15,15,15,16,
134.11713 +	16,16,15,16,18,15,14,13,14,17,15,15,14,14,17,14,
134.11714 +	14,13,13,17,15,15,14,14,16,15,15,15,15,17,15,14,
134.11715 +	14,14,17,15,15,14,14,17,14,14,13,13,13,11,11,11,
134.11716 +	11,16,14,14,12,12,16,14,14,13,13,16,14,14,12,12,
134.11717 +	16,14,14,12,12,16,15,15,13,13,17,14,14,14,14,17,
134.11718 +	15,15,13,13,16,15,15,14,13,16,15,15,13,13,16,15,
134.11719 +	15,13,13,16,14,14,14,14,16,15,15,13,13,16,14,15,
134.11720 +	13,13,17,15,15,13,13,17,15,15,13,13,16,14,14,14,
134.11721 +	14,17,15,15,12,12,17,14,15,13,13,17,15,15,12,12,
134.11722 +	16,15,15,13,13,17,14,14,14,14,17,15,15,12,12,17,
134.11723 +	15,15,13,13,16,15,15,12,12,14,15,15, 8, 8,14,14,
134.11724 +	14,19,18,14,15,15,19,20,14,14,14,19,19,14,14,15,
134.11725 +	19,20,15,16,15,19,21,15,16,16,21,19,15,15,15,20,
134.11726 +	19,15,16,16,19,20,15,15,15,19,18,15,16,15,20,19,
134.11727 +	15,16,16,19,20,15,15,15,19,19,15,16,15,20,20,14,
134.11728 +	15,15,19,19,15,15,15,21,19,15,17,16,19,20,15,14,
134.11729 +	15, 0,21,15,15,15,19,20,14,14,14,19,19,15,15,15,
134.11730 +	20,19,15,16,16,19,19,15,15,15,19,18,15,15,15,20,
134.11731 +	19,14,14,15,18,18,14,12,12, 9, 9,14,14,14,18,18,
134.11732 +	14,14,14,18,18,14,15,14,19,18,14,14,14,19,18,15,
134.11733 +	15,15,19,20,15,14,14,18,18,15,15,15,20,19,15,15,
134.11734 +	15,18,20,15,15,15,19,18,15,15,15,19,19,15,14,14,
134.11735 +	19,21,15,15,15,20,20,15,15,15,18,19,14,15,15,19,
134.11736 +	20,15,15,15,20,19,15,14,14,19,21,15,15,15,18,19,
134.11737 +	15,14,15,20,19,14,15,15,21,21,14,15,15,19,20,15,
134.11738 +	14,14,19,20,15,15,15,19,20,15,15,14,20,20,14,15,
134.11739 +	15,20,19,13,12,12,13,13,17,16,16,11,11,17,16,16,
134.11740 +	12,12,18,17,16,11,11,18,16,16,11,11,17,17,17,13,
134.11741 +	13,18,16,16,13,13,18,17,17,12,12,18,16,16,13,13,
134.11742 +	18,17,17,12,12,18,17,17,13,13,18,16,16,14,14,18,
134.11743 +	16,17,12,12,18,17,17,13,13,17,17,17,12,12,17,17,
134.11744 +	17,12,12,17,16,15,13,13,18,16,16,11,11,17,16,16,
134.11745 +	12,12,17,16,17,11,11,18,17,17,13,12,17,16,16,13,
134.11746 +	13,17,17,17,12,12,17,16,17,12,12,18,17,17,11,11,
134.11747 +	14,14,14, 9, 9,16,14,14,13,13,17,15,15,14,14,17,
134.11748 +	14,14,13,13,16,14,14,13,13,17,15,15,14,14,16,16,
134.11749 +	16,16,15,18,15,15,14,14,17,16,15,15,15,17,15,15,
134.11750 +	14,14,17,15,15,14,15,16,16,16,15,16,18,15,15,14,
134.11751 +	14,17,15,15,14,15,17,15,15,14,14,17,15,15,14,14,
134.11752 +	16,16,16,15,16,17,14,14,13,13,17,15,15,14,14,18,
134.11753 +	15,15,13,13,17,15,15,14,14,16,16,16,15,15,17,14,
134.11754 +	14,13,13,17,15,15,14,14,17,14,14,13,13,13,11,11,
134.11755 +	11,11,16,14,14,12,12,16,14,14,12,13,17,15,14,11,
134.11756 +	11,17,14,14,11,11,17,15,15,13,14,17,14,14,14,14,
134.11757 +	17,15,15,13,13,17,14,14,13,13,17,15,15,13,13,17,
134.11758 +	15,15,13,13,17,14,14,14,14,17,15,15,13,13,18,14,
134.11759 +	15,13,13,17,15,15,13,13,16,15,15,13,13,17,14,14,
134.11760 +	13,13,17,15,15,12,12,16,14,14,12,12,16,15,15,12,
134.11761 +	12,17,16,15,13,13,17,14,14,13,13,17,15,15,12,12,
134.11762 +	16,15,15,12,12,16,15,15,12,12,13,15,15, 8, 8,14,
134.11763 +	14,14,18,19,14,15,15,19,20,14,14,14,18,18,14,15,
134.11764 +	15,18,18,15,16,16,19,19,15,16,17,20,20,15,15,15,
134.11765 +	19,19,15,16,16,18,20,15,15,15,19,19,15,15,16,18,
134.11766 +	18,15,17,16,19,19,15,15,15,18,21,15,16,16,21,20,
134.11767 +	15,15,15,19,21,15,16,15,20,19,15,16,17,20,20,15,
134.11768 +	15,15,19,19,15,16,16,21,20,15,15,15,19,20,15,15,
134.11769 +	15,19,19,15,16,16,20,19,15,15,15,19,19,15,16,15,
134.11770 +	20,21,15,15,15,21,19,14,12,12, 8, 8,14,14,14,20,
134.11771 +	18,14,13,13,19,19,14,14,14,19,18,15,14,14,19,20,
134.11772 +	14,15,15,20,20,15,14,14,21,20,15,15,15,20,20,15,
134.11773 +	15,14,21,19,15,15,15,19,19,15,15,15,19,20,15,14,
134.11774 +	14,20,20,15,15,15,19,20,15,14,14,19,20,15,15,15,
134.11775 +	20,20,15,15,15,20,19,15,14,14,20,21,15,15,15,20,
134.11776 +	21,15,14,14,20, 0,15,16,15,20,21,15,15,15,19,20,
134.11777 +	15,14,14,19,19,15,15,15,19,20,15,15,15,19,19,15,
134.11778 +	15,15,18,20,13,12,12,13,13,18,16,17,12,12,17,16,
134.11779 +	16,12,12,17,17,16,11,11,18,16,16,11,11,17,17,18,
134.11780 +	13,13,18,16,16,14,14,18,17,17,13,13,18,16,16,13,
134.11781 +	13,18,17,17,12,12,17,17,16,13,13,17,16,16,13,14,
134.11782 +	18,17,17,12,12,18,16,16,12,13,17,16,17,12,12,17,
134.11783 +	18,17,13,13,18,16,16,13,13,18,17,17,12,12,17,16,
134.11784 +	16,12,12,17,17,17,11,11,17,16,17,12,12,17,16,16,
134.11785 +	13,13,17,16,16,11,11,17,16,16,12,12,18,16,17,11,
134.11786 +	11,14,14,14, 9, 9,16,14,15,13,13,17,15,15,14,14,
134.11787 +	17,14,14,12,12,16,14,14,13,13,18,15,15,15,15,17,
134.11788 +	15,16,15,16,18,15,15,14,14,17,15,16,15,15,17,15,
134.11789 +	15,14,14,18,15,15,14,14,16,16,16,16,15,17,15,15,
134.11790 +	14,14,16,15,15,14,14,17,15,15,14,14,17,15,15,14,
134.11791 +	14,17,16,16,15,15,17,15,14,13,13,17,15,15,14,14,
134.11792 +	17,15,15,13,13,17,15,15,14,14,16,16,16,15,15,18,
134.11793 +	15,14,14,14,17,15,15,14,14,18,15,15,13,13,13,12,
134.11794 +	12,11,11,16,14,14,12,12,16,14,14,13,13,17,15,15,
134.11795 +	12,12,17,14,14,12,12,17,15,15,14,14,17,14,14,14,
134.11796 +	14,17,15,15,13,13,17,15,14,13,13,17,15,15,13,13,
134.11797 +	17,15,15,13,13,16,14,14,14,14,17,15,15,13,13,16,
134.11798 +	14,14,13,13,16,15,15,13,13,17,15,16,13,13,17,14,
134.11799 +	14,14,13,17,15,15,12,12,16,15,14,12,12,17,15,15,
134.11800 +	12,12,16,15,16,13,13,16,14,14,14,13,17,15,15,12,
134.11801 +	12,16,14,14,12,12,17,15,15,12,12,14,15,15, 8, 8,
134.11802 +	14,14,14,18,18,14,15,15,19,18,14,14,14,18,18,14,
134.11803 +	15,15,19,20,15,16,15,21,18,15,16,16,18, 0,15,15,
134.11804 +	15,19,20,15,16,16,20, 0,15,16,15,19,18,15,15,15,
134.11805 +	19,19,15,16,16,21,19,15,15,15,19,19,15,16,16,20,
134.11806 +	20,15,15,15,19,19,15,15,15,19,18,15,16,16,20,20,
134.11807 +	15,14,15,20,19,15,15,15,19,20,15,15,15,19,19,15,
134.11808 +	16,15,19,20,15,16,16,19,20,15,15,15,19,19,15,16,
134.11809 +	15,20,20,15,15,15,20,18,13,12,12, 8, 8,14,14,14,
134.11810 +	19,20,14,14,14,19,19,14,15,15,20,20,14,14,14,18,
134.11811 +	19,15,15,15,20, 0,15,14,14,18,20,15,15,15,19,19,
134.11812 +	15,15,15,21,19,15,15,15,19,20,15,15,15,20,21,15,
134.11813 +	14,14,20,19,15,15,15,20,19,15,15,14,21,19,15,15,
134.11814 +	15,19,18,15,15,15,20,19,15,14,14,19,19,15,15,16,
134.11815 +	20,19,15,15,15,20, 0,15,15,15,19,21,15,15,15,22,
134.11816 +	20,15,14,14,22,19,15,15,15,19,20,15,14,14,20,19,
134.11817 +	14,15,15,19,21,
134.11818 +};
134.11819 +
134.11820 +static const static_codebook _44pn1_p3_1 = {
134.11821 +	5, 3125,
134.11822 +	(long *)_vq_lengthlist__44pn1_p3_1,
134.11823 +	1, -533725184, 1611661312, 3, 0,
134.11824 +	(long *)_vq_quantlist__44pn1_p3_1,
134.11825 +	0
134.11826 +};
134.11827 +
134.11828 +static const long _vq_quantlist__44pn1_p4_0[] = {
134.11829 +	2,
134.11830 +	1,
134.11831 +	3,
134.11832 +	0,
134.11833 +	4,
134.11834 +};
134.11835 +
134.11836 +static const long _vq_lengthlist__44pn1_p4_0[] = {
134.11837 +	 1, 7, 7,14,14, 6, 8, 8,15,16, 7, 8, 8,16,15, 0,
134.11838 +	14,14,17,17, 0,14,14,16,16, 7, 9, 9,16,16,10,11,
134.11839 +	11,17,18, 9, 8, 8,16,16, 0,14,14,19,19, 0,14,14,
134.11840 +	17,16, 8, 9, 9,16,16,12,12,12,17,17,10, 9, 9,16,
134.11841 +	16, 0,15,14,18,20, 0,14,14,17,17, 0,15,15,18,17,
134.11842 +	 0,21, 0, 0,21, 0,13,13,17,17, 0,17,17, 0, 0, 0,
134.11843 +	15,15,17,17, 0,15,15,17,18, 0, 0, 0, 0,21, 0,13,
134.11844 +	13,17,17, 0,18,18, 0,21, 0,16,15,17,18, 6, 7, 7,
134.11845 +	14,14, 9,10,10,16,16,11,10,10,15,15, 0,21, 0,20,
134.11846 +	21, 0, 0, 0,18,20,10,10,10,15,16,12,13,13,18,18,
134.11847 +	12,11,11,15,15, 0, 0, 0,20,20, 0, 0,21,19,19,12,
134.11848 +	11,11,15,15,15,14,14,18,18,13,11,11,15,16, 0, 0,
134.11849 +	 0,20,19, 0, 0, 0,20,21, 0, 0,20,19,19, 0, 0, 0,
134.11850 +	 0, 0, 0,20, 0,17,18, 0, 0,21, 0, 0, 0, 0, 0,21,
134.11851 +	 0, 0,21, 0,20,19, 0, 0, 0, 0, 0, 0,21, 0,18,18,
134.11852 +	 0, 0, 0,21, 0, 0, 0, 0, 0,20, 7, 6, 6,13,13, 9,
134.11853 +	 6, 6,12,12, 9, 7, 7,14,14, 0,10,10,12,12, 0,11,
134.11854 +	11,15,15, 9, 7, 7,14,14,12, 9, 9,14,14,10, 7, 7,
134.11855 +	14,13, 0,11,11,16,15, 0,11,11,14,14, 9, 7, 7,14,
134.11856 +	14,13,10,10,14,14,11, 7, 7,14,13, 0,11,11,16,16,
134.11857 +	 0,11,11,14,14, 0,12,12,16,16, 0,19, 0,17,18, 0,
134.11858 +	10,10,14,14, 0,15,14, 0, 0, 0,12,12,14,14, 0,12,
134.11859 +	12,15,15, 0,20, 0,18,19, 0,10,10,14,14, 0,16,15,
134.11860 +	 0,20, 0,13,13,14,14, 0,11,11,13,13, 0,12,13,16,
134.11861 +	16, 0,12,12,16,16, 0,16,16, 0,21, 0,17,18, 0, 0,
134.11862 +	 0,12,12,16,16, 0,15,15,18, 0, 0,12,12,16,16, 0,
134.11863 +	17,16,21,21, 0,16,17, 0, 0, 0,13,13,17,16, 0,16,
134.11864 +	16,20,21, 0,12,12,17,16, 0,17,17, 0,21, 0,17,17,
134.11865 +	21,21, 0,17,18, 0, 0, 0, 0, 0, 0, 0, 0,15,15, 0,
134.11866 +	 0, 0,18,21, 0, 0, 0,18,19, 0, 0, 0,18,17,21,21,
134.11867 +	 0, 0, 0, 0, 0, 0,16,16, 0, 0, 0, 0, 0, 0, 0, 0,
134.11868 +	19,19, 0, 0, 0,11,11,12,12, 0,11,11,10,10, 0,12,
134.11869 +	12,13,13, 0,12,12, 9, 9, 0,14,14,13,13, 0,12,12,
134.11870 +	13,13, 0,14,14,12,13, 0,11,11,12,12, 0,13,13,13,
134.11871 +	13, 0,13,13,13,13, 0,12,12,13,13, 0,14,14,12,12,
134.11872 +	 0,11,11,12,12, 0,14,13,14,14, 0,13,13,13,13, 0,
134.11873 +	15,15,14,15, 0, 0, 0,16,16, 0,12,12,13,13, 0,16,
134.11874 +	17,20,21, 0,14,13,12,12, 0,14,14,14,14, 0,21, 0,
134.11875 +	16,16, 0,12,12,13,13, 0,18,17,21, 0, 0,14,14,13,
134.11876 +	13, 7, 8, 8,17,17,11,10,10,18,18,12,10,10,17,17,
134.11877 +	 0,15,15,20,18, 0,15,15,17,17,11, 9, 9,17,17,14,
134.11878 +	12,12,19,19,13, 9, 9,16,16, 0,15,14, 0,19, 0,14,
134.11879 +	14,16,16,12,10,10,20,18,16,13,13,21,20,14,10,10,
134.11880 +	17,17, 0,15,15,21,20, 0,15,14,17,17, 0,15,15,21,
134.11881 +	21, 0, 0,21, 0, 0, 0,13,13,18,18, 0,19,16, 0, 0,
134.11882 +	 0,15,15,17,16, 0,16,16, 0,21, 0, 0, 0, 0,21, 0,
134.11883 +	13,14,18,17, 0,20,19, 0, 0, 0,15,15,18,18, 8, 7,
134.11884 +	 7,15,15,12,11,11,17,16,13,11,11,16,16, 0, 0, 0,
134.11885 +	21,20, 0, 0, 0, 0,20,11,10,10,17,17,14,13,13,19,
134.11886 +	18,14,11,11,16,16, 0,20, 0,21,19, 0, 0,21, 0,20,
134.11887 +	12,11,11,17,17,16,15,15, 0,19,14,11,11,17,16, 0,
134.11888 +	21, 0, 0,19, 0, 0, 0,21,20, 0, 0,21,20, 0, 0, 0,
134.11889 +	 0, 0, 0, 0, 0, 0,19,21, 0, 0, 0, 0, 0, 0, 0, 0,
134.11890 +	19,20, 0, 0, 0,20,21, 0, 0, 0, 0, 0, 0,20, 0,19,
134.11891 +	21, 0, 0, 0, 0, 0, 0, 0, 0,21,20,11,10, 9,15,15,
134.11892 +	14,11,11,15,15,14,11,11,16,16, 0,14,14,14,14, 0,
134.11893 +	16,15,17,16,13,11,11,16,16,16,13,13,16,16,15,10,
134.11894 +	10,15,15, 0,14,15,17,17, 0,14,14,16,15,13,11,11,
134.11895 +	16,16,17,15,14,16,16,15,10,10,15,15, 0,15,15,17,
134.11896 +	18, 0,15,15,16,16, 0,16,16,17,17, 0,21, 0,21,20,
134.11897 +	 0,13,13,15,15, 0,18,18, 0,21, 0,15,15,15,15, 0,
134.11898 +	16,16,17,17, 0, 0, 0, 0,18, 0,13,13,15,15, 0,19,
134.11899 +	18, 0, 0, 0,15,15,16,16, 0,12,12,15,15, 0,13,13,
134.11900 +	17,17, 0,13,13,17,18, 0,16,17,21, 0, 0,20,18, 0,
134.11901 +	 0, 0,13,13,17,17, 0,15,15, 0,18, 0,12,12,17,18,
134.11902 +	 0,16,16, 0, 0, 0,17,17,21, 0, 0,13,13,18,18, 0,
134.11903 +	16,16,21,21, 0,12,12,17,18, 0,16,17,21, 0, 0,17,
134.11904 +	17, 0,21, 0,17,18, 0, 0, 0, 0, 0, 0, 0, 0,16,15,
134.11905 +	 0,21, 0,21,19, 0, 0, 0,18,18, 0, 0, 0,18,19, 0,
134.11906 +	 0, 0, 0, 0, 0, 0, 0,16,16,21,21, 0,20,19, 0, 0,
134.11907 +	 0,19,21, 0,21, 0,12,12,15,15, 0,12,12,15,16, 0,
134.11908 +	13,13,16,16, 0,14,14,15,15, 0,16,15,17,17, 0,13,
134.11909 +	13,17,17, 0,15,15,16,18, 0,12,12,16,16, 0,14,14,
134.11910 +	17,17, 0,15,14,16,16, 0,13,13,16,16, 0,16,15,17,
134.11911 +	17, 0,12,12,16,16, 0,15,15,18,18, 0,14,14,17,16,
134.11912 +	 0,16,16,17,18, 0, 0, 0,20,21, 0,13,13,16,17, 0,
134.11913 +	17,17, 0, 0, 0,15,15,16,16, 0,15,16,17,17, 0, 0,
134.11914 +	 0,19, 0, 0,13,13,15,16, 0,19,18, 0, 0, 0,16,15,
134.11915 +	16,17, 8, 8, 8,17,17,13,11,10,17,18,13,10,10,17,
134.11916 +	17, 0,15,15,20,19, 0,15,15,17,17,12,10,10,19,18,
134.11917 +	15,12,12,20,18,14,10,10,17,16, 0,15,15,20,20, 0,
134.11918 +	14,15,16,16,13,10,10,17,17,17,14,14, 0,18,15,10,
134.11919 +	10,17,17, 0,16,15,20,20, 0,14,14,17,17, 0,15,16,
134.11920 +	20,20, 0, 0,21, 0, 0, 0,13,13,17,17, 0,18,17, 0,
134.11921 +	 0, 0,15,16,17,18, 0,15,15,18,21, 0, 0, 0,21, 0,
134.11922 +	 0,13,13,18,18, 0,19,19, 0, 0, 0,16,16,18,17, 9,
134.11923 +	 8, 8,15,15,12,11,11,16,16,13,11,11,16,15, 0, 0,
134.11924 +	 0, 0,21, 0,21, 0,19,19,12,11,11,17,18,15,13,13,
134.11925 +	18,19,14,11,11,16,16, 0, 0,21,21,19, 0, 0, 0,21,
134.11926 +	20,13,11,11,18,17,17,14,15,20,21,15,11,12,16,16,
134.11927 +	 0, 0, 0,20, 0, 0, 0,21, 0,19, 0, 0, 0, 0,19, 0,
134.11928 +	 0, 0, 0, 0, 0,21,21,19,19, 0, 0, 0,21, 0, 0, 0,
134.11929 +	 0,19,21, 0, 0, 0,19,20, 0, 0, 0,21, 0, 0, 0,21,
134.11930 +	19,19, 0, 0, 0, 0, 0, 0, 0, 0,21,20, 0,11,11,15,
134.11931 +	15, 0,12,12,15,16, 0,12,12,16,16, 0,15,15,16,15,
134.11932 +	 0,16,16,17,17, 0,12,12,17,17, 0,14,14,17,17, 0,
134.11933 +	11,11,16,16, 0,15,15,19,18, 0,15,15,16,16, 0,12,
134.11934 +	12,17,16, 0,14,15,16,16, 0,11,11,15,15, 0,16,16,
134.11935 +	18,19, 0,15,15,15,16, 0,17,17,18,20, 0,21, 0,21,
134.11936 +	19, 0,14,14,16,16, 0,18,18, 0, 0, 0,16,16,15,15,
134.11937 +	 0,16,16,18,17, 0, 0, 0,19,20, 0,14,14,16,16, 0,
134.11938 +	19,19, 0, 0, 0,16,17,15,15, 0,12,12,14,15, 0,13,
134.11939 +	13,16,17, 0,12,12,17,17, 0,17,16, 0, 0, 0,18,17,
134.11940 +	21, 0, 0,13,13,19,17, 0,15,15,20,21, 0,12,12,17,
134.11941 +	17, 0,17,17, 0, 0, 0,17,17, 0, 0, 0,13,13,17,18,
134.11942 +	 0,16,16,21, 0, 0,12,12,17,17, 0,17,17, 0, 0, 0,
134.11943 +	17,17, 0, 0, 0,18,21, 0, 0, 0, 0, 0, 0, 0, 0,15,
134.11944 +	15,21, 0, 0,20,21, 0, 0, 0,18,19, 0, 0, 0,18,17,
134.11945 +	 0, 0, 0, 0, 0, 0, 0, 0,16,16,21, 0, 0,21,21, 0,
134.11946 +	 0, 0,18,19, 0, 0, 0,12,12,16,16, 0,13,13,16,17,
134.11947 +	 0,13,13,17,16, 0,14,14,16,16, 0,16,15,19,18, 0,
134.11948 +	13,13,17,17, 0,15,15,18,18, 0,12,12,16,16, 0,15,
134.11949 +	15,18,19, 0,15,15,17,16, 0,13,13,17,17, 0,16,16,
134.11950 +	18,17, 0,12,12,17,16, 0,15,15,18,18, 0,15,15,17,
134.11951 +	17, 0,16,16, 0,19, 0, 0, 0, 0, 0, 0,14,14,16,17,
134.11952 +	 0,18,18, 0, 0, 0,15,15,17,17, 0,16,16,21,19, 0,
134.11953 +	21, 0,21,21, 0,13,14,16,16, 0,19,19, 0, 0, 0,15,
134.11954 +	16,16,16, 0,11,11,17,16, 0,15,14,19,18, 0,14,14,
134.11955 +	19,19, 0,18,17,18,20, 0,17,17,18,19, 0,13,13,17,
134.11956 +	17, 0,16,17,21,18, 0,13,13,17,16, 0,18,17,19, 0,
134.11957 +	 0,16,17,18,18, 0,12,12,19,18, 0,18,18,20,20, 0,
134.11958 +	13,13,17,17, 0,17,17,21, 0, 0,16,17,17,18, 0,18,
134.11959 +	17,19,18, 0, 0, 0, 0, 0, 0,14,14,17,17, 0,19,19,
134.11960 +	21, 0, 0,16,16,16,17, 0,17,17,19,20, 0, 0, 0, 0,
134.11961 +	21, 0,15,15,17,18, 0,21,21, 0, 0, 0,17,17,17,18,
134.11962 +	 0,10,10,15,15, 0,15,14,17,18, 0,14,14,16,16, 0,
134.11963 +	 0, 0,18, 0, 0,21, 0,19, 0, 0,13,13,17,16, 0,17,
134.11964 +	17,18, 0, 0,14,14,16,15, 0, 0, 0,21, 0, 0,21, 0,
134.11965 +	19,18, 0,13,13,17,17, 0,18,18,20,20, 0,15,15,16,
134.11966 +	16, 0, 0, 0,21,21, 0, 0, 0,20,20, 0, 0, 0,19, 0,
134.11967 +	 0, 0, 0, 0, 0, 0,21,20,18,18, 0, 0, 0, 0, 0, 0,
134.11968 +	 0, 0, 0,20, 0, 0, 0, 0,20, 0, 0, 0, 0, 0, 0, 0,
134.11969 +	 0,19,18, 0, 0, 0, 0,21, 0, 0, 0,18,20, 0,18,19,
134.11970 +	16,17, 0,21,19,17,17, 0, 0,21,18,18, 0, 0,21,20,
134.11971 +	19, 0, 0, 0,20,20, 0, 0,21,17,17, 0, 0, 0,19,19,
134.11972 +	 0,20,20,17,17, 0, 0, 0, 0,20, 0, 0,20,18,18, 0,
134.11973 +	21,20,17,17, 0, 0, 0,20,21, 0,19, 0,17,17, 0, 0,
134.11974 +	21, 0, 0, 0,20, 0,18,19, 0, 0, 0,21,21, 0, 0, 0,
134.11975 +	 0,21, 0,20,20,17,17, 0, 0, 0, 0, 0, 0,21, 0,18,
134.11976 +	17, 0, 0, 0,20,19, 0, 0, 0, 0,21, 0,20,20,17,17,
134.11977 +	 0, 0, 0, 0, 0, 0,21,21,18,18, 0,12,12,15,14, 0,
134.11978 +	14,14,17,17, 0,14,14,17,16, 0,18,18,21, 0, 0,19,
134.11979 +	20, 0, 0, 0,13,13,18,17, 0,16,16,19,18, 0,13,13,
134.11980 +	17,17, 0,17,17, 0, 0, 0,17,17,21, 0, 0,13,13,17,
134.11981 +	17, 0,17,17,21,20, 0,13,13,18,17, 0,18,19,21,21,
134.11982 +	 0,19,18, 0, 0, 0,18,17, 0, 0, 0, 0, 0, 0, 0, 0,
134.11983 +	15,16, 0, 0, 0,21,21, 0, 0, 0,20,18,21, 0, 0,17,
134.11984 +	18, 0, 0, 0, 0, 0, 0, 0, 0,15,16, 0, 0, 0, 0,20,
134.11985 +	 0, 0, 0, 0,19, 0, 0, 0,15,15,18,19, 0,18,17,21,
134.11986 +	 0, 0,16,18, 0,20, 0,17,18,21, 0, 0,18,20, 0, 0,
134.11987 +	 0,16,16,21,21, 0,19,20,21, 0, 0,16,15, 0,21, 0,
134.11988 +	18,20, 0, 0, 0,18,19, 0, 0, 0,16,15,21,21, 0,21,
134.11989 +	 0, 0, 0, 0,16,15,21, 0, 0,20,19, 0, 0, 0,18,21,
134.11990 +	21, 0, 0,20,18, 0, 0, 0, 0, 0, 0, 0, 0,16,16, 0,
134.11991 +	20, 0,21, 0, 0, 0, 0,17,18,20,21, 0,18,18,21,21,
134.11992 +	 0, 0, 0, 0, 0, 0,16,16,20, 0, 0, 0,21, 0, 0, 0,
134.11993 +	21,18, 0, 0, 0,12,12,20,17, 0,15,15,19,18, 0,14,
134.11994 +	14,19,18, 0,18,17,21,19, 0,17,17,21,17, 0,13,13,
134.11995 +	21,19, 0,16,17,20,19, 0,13,13,16,16, 0,17,17,20,
134.11996 +	21, 0,16,16,19,17, 0,13,13,18,18, 0,17,19,19,19,
134.11997 +	 0,13,13,17,17, 0,18,18, 0,19, 0,16,17,18,18, 0,
134.11998 +	16,17,19,21, 0, 0, 0, 0, 0, 0,15,15,16,17, 0,20,
134.11999 +	19,21, 0, 0,17,17,17,17, 0,17,17,21,19, 0, 0, 0,
134.12000 +	 0, 0, 0,15,15,17,17, 0,21, 0, 0, 0, 0,18,18,17,
134.12001 +	17, 0,10,10,15,15, 0,15,15,17,17, 0,15,14,16,16,
134.12002 +	 0, 0, 0,21,19, 0,21,21,19,21, 0,13,13,17,16, 0,
134.12003 +	17,17,18,19, 0,14,15,16,15, 0, 0, 0,21,19, 0,21,
134.12004 +	21,18,19, 0,14,14,16,17, 0,18,18,18,19, 0,15,15,
134.12005 +	15,16, 0, 0,21, 0,21, 0, 0, 0,19,20, 0, 0, 0,21,
134.12006 +	19, 0, 0, 0, 0, 0, 0,21,21,19,17, 0, 0, 0, 0, 0,
134.12007 +	 0, 0, 0,21,21, 0,21, 0, 0,21, 0, 0, 0, 0, 0, 0,
134.12008 +	21,21,19,18, 0, 0, 0, 0, 0, 0, 0, 0, 0,19, 0,21,
134.12009 +	18,18,17, 0,21, 0,20,20, 0, 0, 0,18,20, 0, 0,21,
134.12010 +	18,21, 0, 0, 0,21,18, 0, 0, 0, 0,19, 0, 0, 0,21,
134.12011 +	21, 0,20,21,17,19, 0,21, 0,21, 0, 0,21, 0,18,18,
134.12012 +	 0,20,21,17,18, 0, 0, 0,21,19, 0,20,21,17,18, 0,
134.12013 +	 0, 0,21,21, 0, 0, 0,20,19, 0, 0, 0,21,21, 0, 0,
134.12014 +	 0, 0, 0, 0,21,21,19,18, 0, 0, 0, 0, 0, 0, 0,21,
134.12015 +	19,18, 0,21,21,19, 0, 0, 0, 0,21, 0, 0,21,21,18,
134.12016 +	17, 0, 0, 0, 0, 0, 0,21, 0,21,18, 0,12,12,14,14,
134.12017 +	 0,15,14,17,17, 0,14,14,17,16, 0,19,17, 0, 0, 0,
134.12018 +	19,19, 0, 0, 0,13,13,17,17, 0,17,17,20,20, 0,13,
134.12019 +	13,18,18, 0,18,17, 0, 0, 0,18,21, 0, 0, 0,13,13,
134.12020 +	17,17, 0,18,18,21,20, 0,14,14,18,19, 0,19,18,21,
134.12021 +	 0, 0,19,19, 0, 0, 0,20,18,20, 0, 0, 0, 0, 0, 0,
134.12022 +	 0,15,16, 0, 0, 0,21,21, 0, 0, 0,19,19, 0, 0, 0,
134.12023 +	18,18, 0, 0, 0, 0, 0, 0, 0, 0,16,16, 0,21, 0, 0,
134.12024 +	 0, 0, 0, 0,19,20, 0, 0, 0,15,15,20,21, 0,17,17,
134.12025 +	21,21, 0,17,17, 0, 0, 0,19,18, 0, 0, 0,18,19, 0,
134.12026 +	 0, 0,17,16, 0,21, 0, 0,20, 0, 0, 0,16,16, 0,20,
134.12027 +	 0,19,19, 0,21, 0,19,18, 0,21, 0,16,16, 0, 0, 0,
134.12028 +	21,21, 0, 0, 0,16,16, 0, 0, 0,21,21, 0, 0, 0,19,
134.12029 +	19, 0, 0, 0,20, 0, 0, 0, 0, 0, 0, 0, 0, 0,17,17,
134.12030 +	 0,21, 0, 0,20, 0, 0, 0,20,18,21,21, 0,19,18, 0,
134.12031 +	20, 0, 0, 0, 0, 0, 0,16,17,21, 0, 0, 0,21, 0, 0,
134.12032 +	 0,19,20,21,20,
134.12033 +};
134.12034 +
134.12035 +static const static_codebook _44pn1_p4_0 = {
134.12036 +	5, 3125,
134.12037 +	(long *)_vq_lengthlist__44pn1_p4_0,
134.12038 +	1, -528744448, 1616642048, 3, 0,
134.12039 +	(long *)_vq_quantlist__44pn1_p4_0,
134.12040 +	0
134.12041 +};
134.12042 +
134.12043 +static const long _vq_quantlist__44pn1_p4_1[] = {
134.12044 +	3,
134.12045 +	2,
134.12046 +	4,
134.12047 +	1,
134.12048 +	5,
134.12049 +	0,
134.12050 +	6,
134.12051 +};
134.12052 +
134.12053 +static const long _vq_lengthlist__44pn1_p4_1[] = {
134.12054 +	 2, 3, 3, 3, 3, 3, 3,
134.12055 +};
134.12056 +
134.12057 +static const static_codebook _44pn1_p4_1 = {
134.12058 +	1, 7,
134.12059 +	(long *)_vq_lengthlist__44pn1_p4_1,
134.12060 +	1, -533200896, 1611661312, 3, 0,
134.12061 +	(long *)_vq_quantlist__44pn1_p4_1,
134.12062 +	0
134.12063 +};
134.12064 +
134.12065 +static const long _vq_quantlist__44pn1_p5_0[] = {
134.12066 +	1,
134.12067 +	0,
134.12068 +	2,
134.12069 +};
134.12070 +
134.12071 +static const long _vq_lengthlist__44pn1_p5_0[] = {
134.12072 +	 1, 7, 7, 6, 8, 8, 7, 8, 8, 7, 9, 9,11,11,11, 9,
134.12073 +	 8, 8, 7, 9, 9,11,12,11, 9, 9, 9, 6, 7, 7,10,11,
134.12074 +	11,10,10,10,10,11,11,15,14,14,12,12,12,11,11,11,
134.12075 +	14,14,14,12,12,12, 5, 6, 6, 8, 5, 5, 8, 7, 7, 8,
134.12076 +	 8, 8,12,10,10,10, 7, 7, 8, 7, 7,12,10,10,10, 7,
134.12077 +	 7, 6, 7, 7,12,11,11,12,10,10,11,10,10,14,14,13,
134.12078 +	13,10,10,11,10,10,16,14,14,14,11,10, 7, 7, 7,13,
134.12079 +	12,12,12,12,11,11,11,11,15,14,17,13,12,12,12,11,
134.12080 +	11,15,15,15,14,13,13,10, 9, 9,14,12,11,13,11,11,
134.12081 +	12,11,11,16,15,14,14,11,11,12,11,11,17,14,14,15,
134.12082 +	11,11, 7, 8, 8,12,11,11,13,10,10,11,10,10,17,14,
134.12083 +	13,14,10,10,12,10,10,18,15,15,14,10,10, 8, 7, 7,
134.12084 +	13,12,12,13,11,11,12,11,11,16,14,15,14,12,12,12,
134.12085 +	11,11,18,16,16,14,12,12,11,10,10,13,12,11,13,11,
134.12086 +	11,13,12,12, 0,15,14,14,11,11,13,11,11,16,15,15,
134.12087 +	15,11,11,
134.12088 +};
134.12089 +
134.12090 +static const static_codebook _44pn1_p5_0 = {
134.12091 +	5, 243,
134.12092 +	(long *)_vq_lengthlist__44pn1_p5_0,
134.12093 +	1, -527106048, 1620377600, 2, 0,
134.12094 +	(long *)_vq_quantlist__44pn1_p5_0,
134.12095 +	0
134.12096 +};
134.12097 +
134.12098 +static const long _vq_quantlist__44pn1_p5_1[] = {
134.12099 +	1,
134.12100 +	0,
134.12101 +	2,
134.12102 +};
134.12103 +
134.12104 +static const long _vq_lengthlist__44pn1_p5_1[] = {
134.12105 +	 2, 6, 7, 6, 8, 8, 7, 7, 8, 7, 8, 8, 9, 9, 9, 8,
134.12106 +	 7, 7, 8, 8, 8, 9, 9, 9, 9, 8, 8, 6, 6, 6, 9, 7,
134.12107 +	 7, 9, 7, 7, 9, 8, 8,10, 8, 8,10, 8, 8,10, 8, 8,
134.12108 +	10, 9, 8,10, 8, 8, 7, 6, 6, 9, 6, 6, 9, 6, 6, 9,
134.12109 +	 7, 7,10, 8, 8,10, 6, 6, 9, 7, 7,10, 8, 8,10, 6,
134.12110 +	 6, 7, 7, 7,11, 9, 9,11, 9, 9,10, 9, 9,12,10,10,
134.12111 +	12, 8, 8,11, 9, 9,13, 9,10,12, 8, 8, 8, 7, 7,11,
134.12112 +	 9,10,11,10,10,10, 9, 9,11,11,11,11, 9, 9,11,10,
134.12113 +	 9,12,11,11,11, 9,10,10, 8, 8,11, 9,10,11, 9, 9,
134.12114 +	11, 9, 9,12,10,10,11, 9, 9,11, 9, 9,12,10,11,11,
134.12115 +	 9, 9, 8, 8, 8,12, 9, 9,12, 9, 9,11, 9, 9,13, 9,
134.12116 +	 9,13, 8, 8,12, 9, 9,13,10,10,12, 8, 8, 9, 7, 7,
134.12117 +	11,10,10,11,10,10,11,10,10,12,11,11,11,10, 9,11,
134.12118 +	10,10,11,11,11,11, 9, 9,11, 9, 9,12,10,10,11,10,
134.12119 +	10,12,10,10,11,11,11,11, 9, 9,11,10,10,12,11,11,
134.12120 +	11, 9, 9,
134.12121 +};
134.12122 +
134.12123 +static const static_codebook _44pn1_p5_1 = {
134.12124 +	5, 243,
134.12125 +	(long *)_vq_lengthlist__44pn1_p5_1,
134.12126 +	1, -530841600, 1616642048, 2, 0,
134.12127 +	(long *)_vq_quantlist__44pn1_p5_1,
134.12128 +	0
134.12129 +};
134.12130 +
134.12131 +static const long _vq_quantlist__44pn1_p6_0[] = {
134.12132 +	1,
134.12133 +	0,
134.12134 +	2,
134.12135 +};
134.12136 +
134.12137 +static const long _vq_lengthlist__44pn1_p6_0[] = {
134.12138 +	 1, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9,
134.12139 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.12140 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.12141 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.12142 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.12143 +	 9, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.12144 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.12145 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.12146 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.12147 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.12148 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.12149 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.12150 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.12151 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.12152 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
134.12153 +	 9, 9, 9,
134.12154 +};
134.12155 +
134.12156 +static const static_codebook _44pn1_p6_0 = {
134.12157 +	5, 243,
134.12158 +	(long *)_vq_lengthlist__44pn1_p6_0,
134.12159 +	1, -516716544, 1630767104, 2, 0,
134.12160 +	(long *)_vq_quantlist__44pn1_p6_0,
134.12161 +	0
134.12162 +};
134.12163 +
134.12164 +static const long _vq_quantlist__44pn1_p6_1[] = {
134.12165 +	12,
134.12166 +	11,
134.12167 +	13,
134.12168 +	10,
134.12169 +	14,
134.12170 +	9,
134.12171 +	15,
134.12172 +	8,
134.12173 +	16,
134.12174 +	7,
134.12175 +	17,
134.12176 +	6,
134.12177 +	18,
134.12178 +	5,
134.12179 +	19,
134.12180 +	4,
134.12181 +	20,
134.12182 +	3,
134.12183 +	21,
134.12184 +	2,
134.12185 +	22,
134.12186 +	1,
134.12187 +	23,
134.12188 +	0,
134.12189 +	24,
134.12190 +};
134.12191 +
134.12192 +static const long _vq_lengthlist__44pn1_p6_1[] = {
134.12193 +	 1, 3, 2, 5, 4, 7, 7, 8, 8, 9, 9,10,10,11,11,12,
134.12194 +	12,13,13,14,14,15,15,15,15,
134.12195 +};
134.12196 +
134.12197 +static const static_codebook _44pn1_p6_1 = {
134.12198 +	1, 25,
134.12199 +	(long *)_vq_lengthlist__44pn1_p6_1,
134.12200 +	1, -518864896, 1620639744, 5, 0,
134.12201 +	(long *)_vq_quantlist__44pn1_p6_1,
134.12202 +	0
134.12203 +};
134.12204 +
134.12205 +static const long _vq_quantlist__44pn1_p6_2[] = {
134.12206 +	12,
134.12207 +	11,
134.12208 +	13,
134.12209 +	10,
134.12210 +	14,
134.12211 +	9,
134.12212 +	15,
134.12213 +	8,
134.12214 +	16,
134.12215 +	7,
134.12216 +	17,
134.12217 +	6,
134.12218 +	18,
134.12219 +	5,
134.12220 +	19,
134.12221 +	4,
134.12222 +	20,
134.12223 +	3,
134.12224 +	21,
134.12225 +	2,
134.12226 +	22,
134.12227 +	1,
134.12228 +	23,
134.12229 +	0,
134.12230 +	24,
134.12231 +};
134.12232 +
134.12233 +static const long _vq_lengthlist__44pn1_p6_2[] = {
134.12234 +	 3, 5, 4, 5, 4, 5, 4, 5, 5, 5, 4, 5, 5, 5, 5, 5,
134.12235 +	 5, 5, 5, 5, 5, 5, 5, 5, 5,
134.12236 +};
134.12237 +
134.12238 +static const static_codebook _44pn1_p6_2 = {
134.12239 +	1, 25,
134.12240 +	(long *)_vq_lengthlist__44pn1_p6_2,
134.12241 +	1, -529006592, 1611661312, 5, 0,
134.12242 +	(long *)_vq_quantlist__44pn1_p6_2,
134.12243 +	0
134.12244 +};
134.12245 +
134.12246 +static const long _huff_lengthlist__44pn1_short[] = {
134.12247 +	 4, 3, 7, 9,12,16,16, 3, 2, 5, 7,11,14,15, 7, 4,
134.12248 +	 5, 6, 9,12,15, 8, 5, 5, 5, 8,10,14, 9, 7, 6, 6,
134.12249 +	 8,10,12,12,10,10, 7, 6, 8,10,15,12,10, 6, 4, 7,
134.12250 +	 9,
134.12251 +};
134.12252 +
134.12253 +static const static_codebook _huff_book__44pn1_short = {
134.12254 +	2, 49,
134.12255 +	(long *)_huff_lengthlist__44pn1_short,
134.12256 +	0, 0, 0, 0, 0,
134.12257 +	NULL,
134.12258 +	0
134.12259 +};
134.12260 +
   135.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   135.2 +++ b/libs/vorbis/books/coupled/res_books_stereo.h	Sun Nov 01 00:36:56 2015 +0200
   135.3 @@ -0,0 +1,15783 @@
   135.4 +/********************************************************************
   135.5 + *                                                                  *
   135.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   135.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   135.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   135.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  135.10 + *                                                                  *
  135.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007             *
  135.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  135.13 + *                                                                  *
  135.14 + ********************************************************************
  135.15 +
  135.16 + function: static codebooks autogenerated by huff/huffbuld
  135.17 + last modified: $Id: res_books_stereo.h 17025 2010-03-25 04:56:56Z xiphmont $
  135.18 +
  135.19 + ********************************************************************/
  135.20 +
  135.21 +#include "codebook.h"
  135.22 +
  135.23 +static const long _vq_quantlist__16c0_s_p1_0[] = {
  135.24 +        1,
  135.25 +        0,
  135.26 +        2,
  135.27 +};
  135.28 +
  135.29 +static const long _vq_lengthlist__16c0_s_p1_0[] = {
  135.30 +         1, 4, 4, 0, 0, 0, 0, 0, 0, 5, 7, 7, 0, 0, 0, 0,
  135.31 +         0, 0, 5, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.32 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.33 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.34 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.35 +         0, 5, 8, 8, 0, 0, 0, 0, 0, 0, 8, 9,10, 0, 0, 0,
  135.36 +         0, 0, 0, 7, 9,10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.37 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.38 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.39 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.40 +         0, 0, 5, 8, 8, 0, 0, 0, 0, 0, 0, 7, 9, 9, 0, 0,
  135.41 +         0, 0, 0, 0, 7, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.42 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.43 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.44 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.45 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.46 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.47 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.48 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.49 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.50 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.51 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.52 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.53 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.54 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.55 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.56 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.57 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.58 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.59 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.60 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.61 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.62 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.63 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.64 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.65 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.66 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.67 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.68 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.69 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.70 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.71 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.72 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.73 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.74 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.75 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 8, 8, 0, 0, 0, 0,
  135.76 +         0, 0, 8,10,10, 0, 0, 0, 0, 0, 0, 8,10,10, 0, 0,
  135.77 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.78 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.79 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.80 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7,10,10, 0, 0, 0,
  135.81 +         0, 0, 0, 9, 9,12, 0, 0, 0, 0, 0, 0,10,12,11, 0,
  135.82 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.83 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.84 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.85 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7,10,10, 0, 0,
  135.86 +         0, 0, 0, 0, 9,12,10, 0, 0, 0, 0, 0, 0,10,11,12,
  135.87 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.88 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.89 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.90 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.91 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.92 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.93 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.94 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.95 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.96 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.97 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.98 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  135.99 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.100 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.101 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.102 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.103 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.104 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.105 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.106 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.107 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.108 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.109 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.110 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.111 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.112 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.113 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.114 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.115 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.116 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.117 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.118 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.119 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.120 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.121 +         0, 0, 5, 8, 8, 0, 0, 0, 0, 0, 0, 8,10,10, 0, 0,
 135.122 +         0, 0, 0, 0, 8,10,10, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.123 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.124 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.125 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.126 +         0, 0, 0, 7,10,10, 0, 0, 0, 0, 0, 0,10,12,11, 0,
 135.127 +         0, 0, 0, 0, 0, 9,10,12, 0, 0, 0, 0, 0, 0, 0, 0,
 135.128 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.129 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.130 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.131 +         0, 0, 0, 0, 7,10,10, 0, 0, 0, 0, 0, 0,10,11,12,
 135.132 +         0, 0, 0, 0, 0, 0, 9,12, 9, 0, 0, 0, 0, 0, 0, 0,
 135.133 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.134 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.135 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.136 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.137 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.138 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.139 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.140 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.141 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.142 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.143 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.144 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.145 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.146 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.147 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.148 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.149 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.150 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.151 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.152 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.153 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.154 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.155 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.156 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.157 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.158 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.159 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.160 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.161 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.162 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.163 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.164 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.165 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.166 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.167 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.168 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.169 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.170 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.171 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.172 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.173 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.174 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.175 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.176 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.177 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.178 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.179 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.180 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.181 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.182 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.183 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.184 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.185 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.186 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.187 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.188 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.189 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.190 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.191 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.192 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.193 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.194 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.195 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.196 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.197 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.198 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.199 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.200 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.201 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.202 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.203 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.204 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.205 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.206 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.207 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.208 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.209 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.210 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.211 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.212 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.213 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.214 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.215 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.216 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.217 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.218 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.219 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.220 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.221 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.222 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.223 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.224 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.225 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.226 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.227 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.228 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.229 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.230 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.231 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.232 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.233 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.234 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.235 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.236 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.237 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.238 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.239 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.240 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.241 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.242 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.243 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.244 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.245 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.246 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.247 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.248 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.249 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.250 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.251 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.252 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.253 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.254 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.255 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.256 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.257 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.258 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.259 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.260 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.261 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.262 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.263 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.264 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.265 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.266 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.267 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.268 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.269 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.270 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.271 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.272 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.273 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.274 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.275 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.276 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.277 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.278 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.279 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.280 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.281 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.282 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.283 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.284 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.285 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.286 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.287 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.288 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.289 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.290 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.291 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.292 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.293 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.294 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.295 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.296 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.297 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.298 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.299 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.300 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.301 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.302 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.303 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.304 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.305 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.306 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.307 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.308 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.309 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.310 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.311 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.312 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.313 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.314 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.315 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.316 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.317 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.318 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.319 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.320 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.321 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.322 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.323 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.324 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.325 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.326 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.327 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.328 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.329 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.330 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.331 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.332 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.333 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.334 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.335 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.336 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.337 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.338 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.339 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.340 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.341 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.342 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.343 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.344 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.345 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.346 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.347 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.348 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.349 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.350 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.351 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.352 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.353 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.354 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.355 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.356 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.357 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.358 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.359 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.360 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.361 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.362 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.363 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.364 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.365 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.366 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.367 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.368 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.369 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.370 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.371 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.372 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.373 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.374 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.375 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.376 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.377 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.378 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.379 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.380 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.381 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.382 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.383 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.384 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.385 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.386 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.387 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.388 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.389 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.390 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.391 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.392 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.393 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.394 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.395 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.396 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.397 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.398 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.399 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.400 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.401 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.402 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.403 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.404 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.405 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.406 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.407 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.408 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.409 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.410 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.411 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.412 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.413 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.414 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.415 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.416 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.417 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.418 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.419 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.420 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.421 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.422 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.423 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.424 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.425 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.426 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.427 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.428 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.429 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.430 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.431 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.432 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.433 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.434 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.435 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.436 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.437 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.438 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.439 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.440 +         0,
 135.441 +};
 135.442 +
 135.443 +static const static_codebook _16c0_s_p1_0 = {
 135.444 +        8, 6561,
 135.445 +        (long *)_vq_lengthlist__16c0_s_p1_0,
 135.446 +        1, -535822336, 1611661312, 2, 0,
 135.447 +        (long *)_vq_quantlist__16c0_s_p1_0,
 135.448 +        0
 135.449 +};
 135.450 +
 135.451 +static const long _vq_quantlist__16c0_s_p3_0[] = {
 135.452 +        2,
 135.453 +        1,
 135.454 +        3,
 135.455 +        0,
 135.456 +        4,
 135.457 +};
 135.458 +
 135.459 +static const long _vq_lengthlist__16c0_s_p3_0[] = {
 135.460 +         1, 4, 4, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.461 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 6, 6, 7, 6, 0, 0,
 135.462 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.463 +         0, 0, 4, 6, 6, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.464 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 6, 9, 9,
 135.465 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.466 +         0, 0, 0, 0, 6, 6, 6, 9, 9, 0, 0, 0, 0, 0, 0, 0,
 135.467 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.468 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.469 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.470 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.471 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.472 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.473 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.474 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.475 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.476 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.477 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.478 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.479 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.480 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.481 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.482 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.483 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.484 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.485 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.486 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.487 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.488 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.489 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.490 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.491 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.492 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.493 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.494 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.495 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.496 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.497 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.498 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.499 +         0,
 135.500 +};
 135.501 +
 135.502 +static const static_codebook _16c0_s_p3_0 = {
 135.503 +        4, 625,
 135.504 +        (long *)_vq_lengthlist__16c0_s_p3_0,
 135.505 +        1, -533725184, 1611661312, 3, 0,
 135.506 +        (long *)_vq_quantlist__16c0_s_p3_0,
 135.507 +        0
 135.508 +};
 135.509 +
 135.510 +static const long _vq_quantlist__16c0_s_p4_0[] = {
 135.511 +        4,
 135.512 +        3,
 135.513 +        5,
 135.514 +        2,
 135.515 +        6,
 135.516 +        1,
 135.517 +        7,
 135.518 +        0,
 135.519 +        8,
 135.520 +};
 135.521 +
 135.522 +static const long _vq_lengthlist__16c0_s_p4_0[] = {
 135.523 +         1, 3, 2, 7, 8, 0, 0, 0, 0, 0, 0, 0, 6, 6, 0, 0,
 135.524 +         0, 0, 0, 0, 0, 6, 6, 0, 0, 0, 0, 0, 0, 0, 7, 7,
 135.525 +         0, 0, 0, 0, 0, 0, 0, 7, 7, 0, 0, 0, 0, 0, 0, 0,
 135.526 +         8, 8, 0, 0, 0, 0, 0, 0, 0, 8, 8, 0, 0, 0, 0, 0,
 135.527 +         0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.528 +         0,
 135.529 +};
 135.530 +
 135.531 +static const static_codebook _16c0_s_p4_0 = {
 135.532 +        2, 81,
 135.533 +        (long *)_vq_lengthlist__16c0_s_p4_0,
 135.534 +        1, -531628032, 1611661312, 4, 0,
 135.535 +        (long *)_vq_quantlist__16c0_s_p4_0,
 135.536 +        0
 135.537 +};
 135.538 +
 135.539 +static const long _vq_quantlist__16c0_s_p5_0[] = {
 135.540 +        4,
 135.541 +        3,
 135.542 +        5,
 135.543 +        2,
 135.544 +        6,
 135.545 +        1,
 135.546 +        7,
 135.547 +        0,
 135.548 +        8,
 135.549 +};
 135.550 +
 135.551 +static const long _vq_lengthlist__16c0_s_p5_0[] = {
 135.552 +         1, 3, 3, 6, 6, 6, 6, 8, 8, 0, 0, 0, 7, 7, 7, 7,
 135.553 +         8, 8, 0, 0, 0, 7, 7, 7, 7, 8, 8, 0, 0, 0, 7, 7,
 135.554 +         8, 8, 9, 9, 0, 0, 0, 7, 7, 8, 8, 9, 9, 0, 0, 0,
 135.555 +         8, 9, 8, 8,10,10, 0, 0, 0, 8, 8, 8, 8,10,10, 0,
 135.556 +         0, 0,10,10, 9, 9,10,10, 0, 0, 0, 0, 0, 9, 9,10,
 135.557 +        10,
 135.558 +};
 135.559 +
 135.560 +static const static_codebook _16c0_s_p5_0 = {
 135.561 +        2, 81,
 135.562 +        (long *)_vq_lengthlist__16c0_s_p5_0,
 135.563 +        1, -531628032, 1611661312, 4, 0,
 135.564 +        (long *)_vq_quantlist__16c0_s_p5_0,
 135.565 +        0
 135.566 +};
 135.567 +
 135.568 +static const long _vq_quantlist__16c0_s_p6_0[] = {
 135.569 +        8,
 135.570 +        7,
 135.571 +        9,
 135.572 +        6,
 135.573 +        10,
 135.574 +        5,
 135.575 +        11,
 135.576 +        4,
 135.577 +        12,
 135.578 +        3,
 135.579 +        13,
 135.580 +        2,
 135.581 +        14,
 135.582 +        1,
 135.583 +        15,
 135.584 +        0,
 135.585 +        16,
 135.586 +};
 135.587 +
 135.588 +static const long _vq_lengthlist__16c0_s_p6_0[] = {
 135.589 +         1, 3, 4, 6, 6, 7, 7, 8, 8, 8, 8, 9, 9,10,10,11,
 135.590 +        11, 0, 0, 0, 7, 7, 8, 8, 9, 9, 9, 9,10,10,10,11,
 135.591 +        11,11, 0, 0, 0, 6, 6, 8, 8, 9, 9, 9, 9,10,10,11,
 135.592 +        11,11,11, 0, 0, 0, 7, 7, 8, 8, 9, 9, 9, 9,10,10,
 135.593 +        11,11,12,12, 0, 0, 0, 7, 7, 8, 8, 9, 9, 9, 9,10,
 135.594 +        10,11,11,12,12, 0, 0, 0, 8, 8, 9, 9,10,10,10,10,
 135.595 +        11,11,12,12,12,12, 0, 0, 0, 8, 8, 9, 9,10,10,10,
 135.596 +        10,11,11,12,12,12,13, 0, 0, 0, 9, 9, 9, 9,10,10,
 135.597 +        10,10,11,11,12,12,13,13, 0, 0, 0, 0, 0,10,10,10,
 135.598 +        10,10,10,11,11,12,12,13,13, 0, 0, 0, 0, 0, 9, 9,
 135.599 +        10,10,11,11,12,12,13,13,13,13, 0, 0, 0, 0, 0, 9,
 135.600 +         9,10,10,11,11,12,12,13,13,13,14, 0, 0, 0, 0, 0,
 135.601 +        10,10,10,11,11,11,12,12,13,13,13,14, 0, 0, 0, 0,
 135.602 +         0, 0, 0,10,10,11,11,12,12,13,13,14,14, 0, 0, 0,
 135.603 +         0, 0, 0, 0,11,11,12,12,13,13,13,13,14,14, 0, 0,
 135.604 +         0, 0, 0, 0, 0,11,11,12,12,12,13,13,14,15,14, 0,
 135.605 +         0, 0, 0, 0, 0, 0,12,12,12,12,13,13,13,14,14,15,
 135.606 +         0, 0, 0, 0, 0, 0, 0, 0, 0,12,12,13,13,14,13,14,
 135.607 +        14,
 135.608 +};
 135.609 +
 135.610 +static const static_codebook _16c0_s_p6_0 = {
 135.611 +        2, 289,
 135.612 +        (long *)_vq_lengthlist__16c0_s_p6_0,
 135.613 +        1, -529530880, 1611661312, 5, 0,
 135.614 +        (long *)_vq_quantlist__16c0_s_p6_0,
 135.615 +        0
 135.616 +};
 135.617 +
 135.618 +static const long _vq_quantlist__16c0_s_p7_0[] = {
 135.619 +        1,
 135.620 +        0,
 135.621 +        2,
 135.622 +};
 135.623 +
 135.624 +static const long _vq_lengthlist__16c0_s_p7_0[] = {
 135.625 +         1, 4, 4, 6, 6, 6, 7, 6, 6, 4, 7, 7,11,10,10,11,
 135.626 +        11,10, 4, 7, 7,10,10,10,11,10,10, 6,10,10,11,11,
 135.627 +        11,11,11,10, 6, 9, 9,11,12,12,11, 9, 9, 6, 9,10,
 135.628 +        11,12,12,11, 9,10, 7,11,11,11,11,11,12,13,12, 6,
 135.629 +         9,10,11,10,10,12,13,13, 6,10, 9,11,10,10,11,12,
 135.630 +        13,
 135.631 +};
 135.632 +
 135.633 +static const static_codebook _16c0_s_p7_0 = {
 135.634 +        4, 81,
 135.635 +        (long *)_vq_lengthlist__16c0_s_p7_0,
 135.636 +        1, -529137664, 1618345984, 2, 0,
 135.637 +        (long *)_vq_quantlist__16c0_s_p7_0,
 135.638 +        0
 135.639 +};
 135.640 +
 135.641 +static const long _vq_quantlist__16c0_s_p7_1[] = {
 135.642 +        5,
 135.643 +        4,
 135.644 +        6,
 135.645 +        3,
 135.646 +        7,
 135.647 +        2,
 135.648 +        8,
 135.649 +        1,
 135.650 +        9,
 135.651 +        0,
 135.652 +        10,
 135.653 +};
 135.654 +
 135.655 +static const long _vq_lengthlist__16c0_s_p7_1[] = {
 135.656 +         1, 3, 4, 6, 6, 7, 7, 8, 8, 8, 8,10,10,10, 7, 7,
 135.657 +         8, 8, 8, 9, 9, 9,10,10,10, 6, 7, 8, 8, 8, 8, 9,
 135.658 +         8,10,10,10, 7, 7, 8, 8, 9, 9, 9, 9,10,10,10, 7,
 135.659 +         7, 8, 8, 9, 9, 8, 9,10,10,10, 8, 8, 9, 9, 9, 9,
 135.660 +         9, 9,11,11,11, 8, 8, 9, 9, 9, 9, 9,10,10,11,11,
 135.661 +         9, 9, 9, 9, 9, 9, 9,10,11,11,11,10,11, 9, 9, 9,
 135.662 +         9,10, 9,11,11,11,10,11,10,10, 9, 9,10,10,11,11,
 135.663 +        11,11,11, 9, 9, 9, 9,10,10,
 135.664 +};
 135.665 +
 135.666 +static const static_codebook _16c0_s_p7_1 = {
 135.667 +        2, 121,
 135.668 +        (long *)_vq_lengthlist__16c0_s_p7_1,
 135.669 +        1, -531365888, 1611661312, 4, 0,
 135.670 +        (long *)_vq_quantlist__16c0_s_p7_1,
 135.671 +        0
 135.672 +};
 135.673 +
 135.674 +static const long _vq_quantlist__16c0_s_p8_0[] = {
 135.675 +        6,
 135.676 +        5,
 135.677 +        7,
 135.678 +        4,
 135.679 +        8,
 135.680 +        3,
 135.681 +        9,
 135.682 +        2,
 135.683 +        10,
 135.684 +        1,
 135.685 +        11,
 135.686 +        0,
 135.687 +        12,
 135.688 +};
 135.689 +
 135.690 +static const long _vq_lengthlist__16c0_s_p8_0[] = {
 135.691 +         1, 4, 4, 7, 7, 7, 7, 7, 6, 8, 8,10,10, 6, 5, 6,
 135.692 +         8, 8, 8, 8, 8, 8, 8, 9,10,10, 7, 6, 6, 8, 8, 8,
 135.693 +         8, 8, 8, 8, 8,10,10, 0, 8, 8, 8, 8, 9, 8, 9, 9,
 135.694 +         9,10,10,10, 0, 9, 8, 8, 8, 9, 9, 8, 8, 9, 9,10,
 135.695 +        10, 0,12,11, 8, 8, 9, 9, 9, 9,10,10,11,10, 0,12,
 135.696 +        13, 8, 8, 9,10, 9, 9,11,11,11,12, 0, 0, 0, 8, 8,
 135.697 +         8, 8,10, 9,12,13,12,14, 0, 0, 0, 8, 8, 8, 9,10,
 135.698 +        10,12,12,13,14, 0, 0, 0,13,13, 9, 9,11,11, 0, 0,
 135.699 +        14, 0, 0, 0, 0,14,14,10,10,12,11,12,14,14,14, 0,
 135.700 +         0, 0, 0, 0,11,11,13,13,14,13,14,14, 0, 0, 0, 0,
 135.701 +         0,12,13,13,12,13,14,14,14,
 135.702 +};
 135.703 +
 135.704 +static const static_codebook _16c0_s_p8_0 = {
 135.705 +        2, 169,
 135.706 +        (long *)_vq_lengthlist__16c0_s_p8_0,
 135.707 +        1, -526516224, 1616117760, 4, 0,
 135.708 +        (long *)_vq_quantlist__16c0_s_p8_0,
 135.709 +        0
 135.710 +};
 135.711 +
 135.712 +static const long _vq_quantlist__16c0_s_p8_1[] = {
 135.713 +        2,
 135.714 +        1,
 135.715 +        3,
 135.716 +        0,
 135.717 +        4,
 135.718 +};
 135.719 +
 135.720 +static const long _vq_lengthlist__16c0_s_p8_1[] = {
 135.721 +         1, 4, 3, 5, 5, 7, 7, 7, 6, 6, 7, 7, 7, 5, 5, 7,
 135.722 +         7, 7, 6, 6, 7, 7, 7, 6, 6,
 135.723 +};
 135.724 +
 135.725 +static const static_codebook _16c0_s_p8_1 = {
 135.726 +        2, 25,
 135.727 +        (long *)_vq_lengthlist__16c0_s_p8_1,
 135.728 +        1, -533725184, 1611661312, 3, 0,
 135.729 +        (long *)_vq_quantlist__16c0_s_p8_1,
 135.730 +        0
 135.731 +};
 135.732 +
 135.733 +static const long _vq_quantlist__16c0_s_p9_0[] = {
 135.734 +        1,
 135.735 +        0,
 135.736 +        2,
 135.737 +};
 135.738 +
 135.739 +static const long _vq_lengthlist__16c0_s_p9_0[] = {
 135.740 +         1, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
 135.741 +         8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
 135.742 +         8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
 135.743 +         7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
 135.744 +         7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
 135.745 +         7,
 135.746 +};
 135.747 +
 135.748 +static const static_codebook _16c0_s_p9_0 = {
 135.749 +        4, 81,
 135.750 +        (long *)_vq_lengthlist__16c0_s_p9_0,
 135.751 +        1, -518803456, 1628680192, 2, 0,
 135.752 +        (long *)_vq_quantlist__16c0_s_p9_0,
 135.753 +        0
 135.754 +};
 135.755 +
 135.756 +static const long _vq_quantlist__16c0_s_p9_1[] = {
 135.757 +        7,
 135.758 +        6,
 135.759 +        8,
 135.760 +        5,
 135.761 +        9,
 135.762 +        4,
 135.763 +        10,
 135.764 +        3,
 135.765 +        11,
 135.766 +        2,
 135.767 +        12,
 135.768 +        1,
 135.769 +        13,
 135.770 +        0,
 135.771 +        14,
 135.772 +};
 135.773 +
 135.774 +static const long _vq_lengthlist__16c0_s_p9_1[] = {
 135.775 +         1, 5, 5, 5, 5, 9,11,11,10,10,10,10,10,10,10, 7,
 135.776 +         6, 6, 6, 6,10,10,10,10,10,10,10,10,10,10, 7, 6,
 135.777 +         6, 6, 6,10, 9,10,10,10,10,10,10,10,10,10, 7, 7,
 135.778 +         8, 9,10,10,10,10,10,10,10,10,10,10,10, 8, 7,10,
 135.779 +        10,10, 9,10,10,10,10,10,10,10,10,10,10,10,10,10,
 135.780 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
 135.781 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
 135.782 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
 135.783 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
 135.784 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
 135.785 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
 135.786 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
 135.787 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
 135.788 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
 135.789 +        10,
 135.790 +};
 135.791 +
 135.792 +static const static_codebook _16c0_s_p9_1 = {
 135.793 +        2, 225,
 135.794 +        (long *)_vq_lengthlist__16c0_s_p9_1,
 135.795 +        1, -520986624, 1620377600, 4, 0,
 135.796 +        (long *)_vq_quantlist__16c0_s_p9_1,
 135.797 +        0
 135.798 +};
 135.799 +
 135.800 +static const long _vq_quantlist__16c0_s_p9_2[] = {
 135.801 +        10,
 135.802 +        9,
 135.803 +        11,
 135.804 +        8,
 135.805 +        12,
 135.806 +        7,
 135.807 +        13,
 135.808 +        6,
 135.809 +        14,
 135.810 +        5,
 135.811 +        15,
 135.812 +        4,
 135.813 +        16,
 135.814 +        3,
 135.815 +        17,
 135.816 +        2,
 135.817 +        18,
 135.818 +        1,
 135.819 +        19,
 135.820 +        0,
 135.821 +        20,
 135.822 +};
 135.823 +
 135.824 +static const long _vq_lengthlist__16c0_s_p9_2[] = {
 135.825 +         1, 5, 5, 7, 8, 8, 7, 9, 9, 9,12,12,11,12,12,10,
 135.826 +        10,11,12,12,12,11,12,12, 8, 9, 8, 7, 9,10,10,11,
 135.827 +        11,10,11,12,10,12,10,12,12,12,11,12,11, 9, 8, 8,
 135.828 +         9,10, 9, 8, 9,10,12,12,11,11,12,11,10,11,12,11,
 135.829 +        12,12, 8, 9, 9, 9,10,11,12,11,12,11,11,11,11,12,
 135.830 +        12,11,11,12,12,11,11, 9, 9, 8, 9, 9,11, 9, 9,10,
 135.831 +         9,11,11,11,11,12,11,11,10,12,12,12, 9,12,11,10,
 135.832 +        11,11,11,11,12,12,12,11,11,11,12,10,12,12,12,10,
 135.833 +        10, 9,10, 9,10,10, 9, 9, 9,10,10,12,10,11,11, 9,
 135.834 +        11,11,10,11,11,11,10,10,10, 9, 9,10,10, 9, 9,10,
 135.835 +        11,11,10,11,10,11,10,11,11,10,11,11,11,10, 9,10,
 135.836 +        10, 9,10, 9, 9,11, 9, 9,11,10,10,11,11,10,10,11,
 135.837 +        10,11, 8, 9,11,11,10, 9,10,11,11,10,11,11,10,10,
 135.838 +        10,11,10, 9,10,10,11, 9,10,10, 9,11,10,10,10,10,
 135.839 +        11,10,11,11, 9,11,10,11,10,10,11,11,10,10,10, 9,
 135.840 +        10,10,11,11,11, 9,10,10,10,10,10,11,10,10,10, 9,
 135.841 +        10,10,11,10,10,10,10,10, 9,10,11,10,10,10,10,11,
 135.842 +        11,11,10,10,10,10,10,11,10,11,10,11,10,10,10, 9,
 135.843 +        11,11,10,10,10,11,11,10,10,10,10,10,10,10,10,11,
 135.844 +        11, 9,10,10,10,11,10,11,10,10,10,11, 9,10,11,10,
 135.845 +        11,10,10, 9,10,10,10,11,10,11,10,10,10,10,10,11,
 135.846 +        11,10,11,11,10,10,11,11,10, 9, 9,10,10,10,10,10,
 135.847 +         9,11, 9,10,10,10,11,11,10,10,10,10,11,11,11,10,
 135.848 +         9, 9,10,10,11,10,10,10,10,10,11,11,11,10,10,10,
 135.849 +        11,11,11, 9,10,10,10,10, 9,10, 9,10,11,10,11,10,
 135.850 +        10,11,11,10,11,11,11,11,11,10,11,10,10,10, 9,11,
 135.851 +        11,10,11,11,11,11,11,11,11,11,11,10,11,10,10,10,
 135.852 +        10,11,10,10,11, 9,10,10,10,
 135.853 +};
 135.854 +
 135.855 +static const static_codebook _16c0_s_p9_2 = {
 135.856 +        2, 441,
 135.857 +        (long *)_vq_lengthlist__16c0_s_p9_2,
 135.858 +        1, -529268736, 1611661312, 5, 0,
 135.859 +        (long *)_vq_quantlist__16c0_s_p9_2,
 135.860 +        0
 135.861 +};
 135.862 +
 135.863 +static const long _huff_lengthlist__16c0_s_single[] = {
 135.864 +         3, 4,19, 7, 9, 7, 8,11, 9,12, 4, 1,19, 6, 7, 7,
 135.865 +         8,10,11,13,18,18,18,18,18,18,18,18,18,18, 8, 6,
 135.866 +        18, 8, 9, 9,11,12,14,18, 9, 6,18, 9, 7, 8, 9,11,
 135.867 +        12,18, 7, 6,18, 8, 7, 7, 7, 9,11,17, 8, 8,18, 9,
 135.868 +         7, 6, 6, 8,11,17,10,10,18,12, 9, 8, 7, 9,12,18,
 135.869 +        13,15,18,15,13,11,10,11,15,18,14,18,18,18,18,18,
 135.870 +        16,16,18,18,
 135.871 +};
 135.872 +
 135.873 +static const static_codebook _huff_book__16c0_s_single = {
 135.874 +        2, 100,
 135.875 +        (long *)_huff_lengthlist__16c0_s_single,
 135.876 +        0, 0, 0, 0, 0,
 135.877 +        NULL,
 135.878 +        0
 135.879 +};
 135.880 +
 135.881 +static const long _huff_lengthlist__16c1_s_long[] = {
 135.882 +         2, 5,20, 7,10, 7, 8,10,11,11, 4, 2,20, 5, 8, 6,
 135.883 +         7, 9,10,10,20,20,20,20,19,19,19,19,19,19, 7, 5,
 135.884 +        19, 6,10, 7, 9,11,13,17,11, 8,19,10, 7, 7, 8,10,
 135.885 +        11,15, 7, 5,19, 7, 7, 5, 6, 9,11,16, 7, 6,19, 8,
 135.886 +         7, 6, 6, 7, 9,13, 9, 9,19,11, 9, 8, 6, 7, 8,13,
 135.887 +        12,14,19,16,13,10, 9, 8, 9,13,14,17,19,18,18,17,
 135.888 +        12,11,11,13,
 135.889 +};
 135.890 +
 135.891 +static const static_codebook _huff_book__16c1_s_long = {
 135.892 +        2, 100,
 135.893 +        (long *)_huff_lengthlist__16c1_s_long,
 135.894 +        0, 0, 0, 0, 0,
 135.895 +        NULL,
 135.896 +        0
 135.897 +};
 135.898 +
 135.899 +static const long _vq_quantlist__16c1_s_p1_0[] = {
 135.900 +        1,
 135.901 +        0,
 135.902 +        2,
 135.903 +};
 135.904 +
 135.905 +static const long _vq_lengthlist__16c1_s_p1_0[] = {
 135.906 +         1, 5, 5, 0, 0, 0, 0, 0, 0, 5, 7, 7, 0, 0, 0, 0,
 135.907 +         0, 0, 5, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.908 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.909 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.910 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.911 +         0, 5, 8, 7, 0, 0, 0, 0, 0, 0, 7, 9, 9, 0, 0, 0,
 135.912 +         0, 0, 0, 7, 8, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.913 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.914 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.915 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.916 +         0, 0, 5, 7, 8, 0, 0, 0, 0, 0, 0, 7, 9, 8, 0, 0,
 135.917 +         0, 0, 0, 0, 7, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.918 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.919 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.920 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.921 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.922 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.923 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.924 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.925 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.926 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.927 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.928 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.929 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.930 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.931 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.932 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.933 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.934 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.935 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.936 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.937 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.938 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.939 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.940 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.941 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.942 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.943 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.944 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.945 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.946 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.947 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.948 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.949 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.950 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.951 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 8, 7, 0, 0, 0, 0,
 135.952 +         0, 0, 8, 9, 9, 0, 0, 0, 0, 0, 0, 7, 9, 9, 0, 0,
 135.953 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.954 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.955 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.956 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 9, 9, 0, 0, 0,
 135.957 +         0, 0, 0, 9, 9,11, 0, 0, 0, 0, 0, 0, 9,11,10, 0,
 135.958 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.959 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.960 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.961 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 9, 9, 0, 0,
 135.962 +         0, 0, 0, 0, 8,11, 9, 0, 0, 0, 0, 0, 0, 9,10,11,
 135.963 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.964 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.965 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.966 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.967 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.968 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.969 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.970 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.971 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.972 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.973 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.974 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.975 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.976 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.977 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.978 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.979 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.980 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.981 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.982 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.983 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.984 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.985 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.986 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.987 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.988 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.989 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.990 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.991 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.992 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.993 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.994 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.995 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.996 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.997 +         0, 0, 5, 7, 8, 0, 0, 0, 0, 0, 0, 7, 9, 9, 0, 0,
 135.998 +         0, 0, 0, 0, 8, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 135.999 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1000 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1001 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1002 +         0, 0, 0, 7, 9, 9, 0, 0, 0, 0, 0, 0, 9,11,10, 0,
135.1003 +         0, 0, 0, 0, 0, 8, 9,11, 0, 0, 0, 0, 0, 0, 0, 0,
135.1004 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1005 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1006 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1007 +         0, 0, 0, 0, 7, 9, 9, 0, 0, 0, 0, 0, 0, 9,10,11,
135.1008 +         0, 0, 0, 0, 0, 0, 9,11, 9, 0, 0, 0, 0, 0, 0, 0,
135.1009 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1010 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1011 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1012 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1013 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1014 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1015 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1016 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1017 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1018 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1019 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1020 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1021 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1022 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1023 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1024 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1025 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1026 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1027 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1028 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1029 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1030 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1031 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1032 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1033 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1034 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1035 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1036 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1037 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1038 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1039 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1040 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1041 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1042 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1043 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1044 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1045 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1046 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1047 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1048 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1049 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1050 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1051 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1052 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1053 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1054 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1055 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1056 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1057 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1058 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1059 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1060 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1061 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1062 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1063 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1064 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1065 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1066 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1067 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1068 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1069 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1070 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1071 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1072 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1073 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1074 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1075 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1076 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1077 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1078 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1079 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1080 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1081 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1082 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1083 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1084 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1085 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1086 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1087 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1088 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1089 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1090 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1091 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1092 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1093 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1094 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1095 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1096 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1097 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1098 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1099 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1100 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1101 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1102 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1103 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1104 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1105 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1106 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1107 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1108 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1109 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1110 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1111 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1112 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1113 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1114 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1115 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1116 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1117 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1118 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1119 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1120 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1121 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1122 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1123 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1124 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1125 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1126 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1127 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1128 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1129 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1130 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1131 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1132 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1133 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1134 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1135 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1136 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1137 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1138 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1139 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1140 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1141 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1142 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1143 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1144 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1145 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1146 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1147 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1148 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1149 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1150 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1151 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1152 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1153 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1154 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1155 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1156 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1157 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1158 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1159 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1160 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1161 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1162 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1163 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1164 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1165 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1166 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1167 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1168 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1169 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1170 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1171 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1172 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1173 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1174 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1175 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1176 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1177 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1178 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1179 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1180 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1181 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1182 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1183 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1184 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1185 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1186 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1187 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1188 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1189 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1190 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1191 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1192 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1193 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1194 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1195 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1196 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1197 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1198 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1199 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1200 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1201 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1202 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1203 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1204 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1205 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1206 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1207 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1208 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1209 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1210 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1211 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1212 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1213 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1214 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1215 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1216 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1217 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1218 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1219 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1220 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1221 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1222 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1223 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1224 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1225 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1226 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1227 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1228 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1229 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1230 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1231 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1232 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1233 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1234 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1235 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1236 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1237 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1238 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1239 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1240 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1241 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1242 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1243 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1244 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1245 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1246 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1247 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1248 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1249 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1250 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1251 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1252 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1253 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1254 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1255 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1256 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1257 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1258 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1259 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1260 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1261 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1262 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1263 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1264 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1265 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1266 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1267 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1268 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1269 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1270 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1271 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1272 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1273 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1274 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1275 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1276 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1277 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1278 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1279 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1280 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1281 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1282 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1283 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1284 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1285 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1286 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1287 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1288 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1289 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1290 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1291 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1292 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1293 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1294 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1295 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1296 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1297 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1298 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1299 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1300 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1301 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1302 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1303 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1304 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1305 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1306 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1307 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1308 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1309 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1310 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1311 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1312 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1313 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1314 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1315 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1316 +         0,
135.1317 +};
135.1318 +
135.1319 +static const static_codebook _16c1_s_p1_0 = {
135.1320 +        8, 6561,
135.1321 +        (long *)_vq_lengthlist__16c1_s_p1_0,
135.1322 +        1, -535822336, 1611661312, 2, 0,
135.1323 +        (long *)_vq_quantlist__16c1_s_p1_0,
135.1324 +        0
135.1325 +};
135.1326 +
135.1327 +static const long _vq_quantlist__16c1_s_p3_0[] = {
135.1328 +        2,
135.1329 +        1,
135.1330 +        3,
135.1331 +        0,
135.1332 +        4,
135.1333 +};
135.1334 +
135.1335 +static const long _vq_lengthlist__16c1_s_p3_0[] = {
135.1336 +         1, 4, 4, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1337 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, 5, 7, 7, 0, 0,
135.1338 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1339 +         0, 0, 4, 5, 5, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1340 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 9, 9,
135.1341 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1342 +         0, 0, 0, 0, 6, 7, 7, 9, 9, 0, 0, 0, 0, 0, 0, 0,
135.1343 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1344 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1345 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1346 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1347 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1348 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1349 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1350 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1351 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1352 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1353 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1354 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1355 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1356 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1357 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1358 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1359 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1360 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1361 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1362 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1363 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1364 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1365 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1366 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1367 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1368 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1369 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1370 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1371 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1372 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1373 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1374 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1375 +         0,
135.1376 +};
135.1377 +
135.1378 +static const static_codebook _16c1_s_p3_0 = {
135.1379 +        4, 625,
135.1380 +        (long *)_vq_lengthlist__16c1_s_p3_0,
135.1381 +        1, -533725184, 1611661312, 3, 0,
135.1382 +        (long *)_vq_quantlist__16c1_s_p3_0,
135.1383 +        0
135.1384 +};
135.1385 +
135.1386 +static const long _vq_quantlist__16c1_s_p4_0[] = {
135.1387 +        4,
135.1388 +        3,
135.1389 +        5,
135.1390 +        2,
135.1391 +        6,
135.1392 +        1,
135.1393 +        7,
135.1394 +        0,
135.1395 +        8,
135.1396 +};
135.1397 +
135.1398 +static const long _vq_lengthlist__16c1_s_p4_0[] = {
135.1399 +         1, 2, 3, 7, 7, 0, 0, 0, 0, 0, 0, 0, 6, 6, 0, 0,
135.1400 +         0, 0, 0, 0, 0, 6, 6, 0, 0, 0, 0, 0, 0, 0, 7, 7,
135.1401 +         0, 0, 0, 0, 0, 0, 0, 7, 7, 0, 0, 0, 0, 0, 0, 0,
135.1402 +         8, 8, 0, 0, 0, 0, 0, 0, 0, 8, 9, 0, 0, 0, 0, 0,
135.1403 +         0, 0,10,10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1404 +         0,
135.1405 +};
135.1406 +
135.1407 +static const static_codebook _16c1_s_p4_0 = {
135.1408 +        2, 81,
135.1409 +        (long *)_vq_lengthlist__16c1_s_p4_0,
135.1410 +        1, -531628032, 1611661312, 4, 0,
135.1411 +        (long *)_vq_quantlist__16c1_s_p4_0,
135.1412 +        0
135.1413 +};
135.1414 +
135.1415 +static const long _vq_quantlist__16c1_s_p5_0[] = {
135.1416 +        4,
135.1417 +        3,
135.1418 +        5,
135.1419 +        2,
135.1420 +        6,
135.1421 +        1,
135.1422 +        7,
135.1423 +        0,
135.1424 +        8,
135.1425 +};
135.1426 +
135.1427 +static const long _vq_lengthlist__16c1_s_p5_0[] = {
135.1428 +         1, 3, 3, 5, 5, 6, 6, 8, 8, 0, 0, 0, 7, 7, 7, 7,
135.1429 +         9, 9, 0, 0, 0, 7, 7, 7, 7, 9, 9, 0, 0, 0, 8, 8,
135.1430 +         8, 8, 9, 9, 0, 0, 0, 8, 8, 8, 8,10,10, 0, 0, 0,
135.1431 +         9, 9, 8, 8,10,10, 0, 0, 0, 9, 9, 8, 8,10,10, 0,
135.1432 +         0, 0,10,10, 9, 9,10,10, 0, 0, 0, 0, 0, 9, 9,10,
135.1433 +        10,
135.1434 +};
135.1435 +
135.1436 +static const static_codebook _16c1_s_p5_0 = {
135.1437 +        2, 81,
135.1438 +        (long *)_vq_lengthlist__16c1_s_p5_0,
135.1439 +        1, -531628032, 1611661312, 4, 0,
135.1440 +        (long *)_vq_quantlist__16c1_s_p5_0,
135.1441 +        0
135.1442 +};
135.1443 +
135.1444 +static const long _vq_quantlist__16c1_s_p6_0[] = {
135.1445 +        8,
135.1446 +        7,
135.1447 +        9,
135.1448 +        6,
135.1449 +        10,
135.1450 +        5,
135.1451 +        11,
135.1452 +        4,
135.1453 +        12,
135.1454 +        3,
135.1455 +        13,
135.1456 +        2,
135.1457 +        14,
135.1458 +        1,
135.1459 +        15,
135.1460 +        0,
135.1461 +        16,
135.1462 +};
135.1463 +
135.1464 +static const long _vq_lengthlist__16c1_s_p6_0[] = {
135.1465 +         1, 3, 3, 6, 6, 8, 8, 9, 9, 9, 9,10,10,11,11,12,
135.1466 +        12, 0, 0, 0, 7, 7, 8, 8, 9, 9, 9, 9,10,10,11,11,
135.1467 +        12,12, 0, 0, 0, 7, 7, 8, 8, 9, 9, 9, 9,10,10,11,
135.1468 +        11,12,12, 0, 0, 0, 8, 8, 8, 9,10, 9,10,10,10,10,
135.1469 +        11,11,12,12, 0, 0, 0, 8, 8, 9, 9,10,10,10,10,11,
135.1470 +        11,11,12,12,12, 0, 0, 0, 8, 8, 9, 9,10,10,10,10,
135.1471 +        11,11,12,12,12,12, 0, 0, 0, 8, 8, 9, 9,10,10,10,
135.1472 +        10,11,11,12,12,13,13, 0, 0, 0, 9, 9, 9, 9,10,10,
135.1473 +        10,10,11,11,12,12,13,13, 0, 0, 0, 0, 0, 9, 9,10,
135.1474 +        10,10,10,11,11,12,12,13,13, 0, 0, 0, 0, 0, 9, 9,
135.1475 +        10,10,11,11,12,12,12,12,13,13, 0, 0, 0, 0, 0, 9,
135.1476 +         9,10,10,11,11,12,12,12,12,13,13, 0, 0, 0, 0, 0,
135.1477 +        10,10,11,10,11,11,12,12,13,13,13,13, 0, 0, 0, 0,
135.1478 +         0, 0, 0,10,10,11,11,12,12,13,13,13,13, 0, 0, 0,
135.1479 +         0, 0, 0, 0,11,11,12,12,12,12,13,13,14,14, 0, 0,
135.1480 +         0, 0, 0, 0, 0,11,11,12,12,12,12,13,13,14,14, 0,
135.1481 +         0, 0, 0, 0, 0, 0,12,12,12,12,13,13,13,13,14,14,
135.1482 +         0, 0, 0, 0, 0, 0, 0, 0, 0,12,12,13,13,13,13,14,
135.1483 +        14,
135.1484 +};
135.1485 +
135.1486 +static const static_codebook _16c1_s_p6_0 = {
135.1487 +        2, 289,
135.1488 +        (long *)_vq_lengthlist__16c1_s_p6_0,
135.1489 +        1, -529530880, 1611661312, 5, 0,
135.1490 +        (long *)_vq_quantlist__16c1_s_p6_0,
135.1491 +        0
135.1492 +};
135.1493 +
135.1494 +static const long _vq_quantlist__16c1_s_p7_0[] = {
135.1495 +        1,
135.1496 +        0,
135.1497 +        2,
135.1498 +};
135.1499 +
135.1500 +static const long _vq_lengthlist__16c1_s_p7_0[] = {
135.1501 +         1, 4, 4, 6, 6, 6, 7, 6, 6, 4, 7, 7,10, 9,10,10,
135.1502 +        10, 9, 4, 7, 7,10,10,10,11,10,10, 6,10,10,11,11,
135.1503 +        11,11,10,10, 6,10, 9,11,11,11,11,10,10, 6,10,10,
135.1504 +        11,11,11,11,10,10, 7,11,11,11,11,11,12,12,11, 6,
135.1505 +        10,10,11,10,10,11,11,11, 6,10,10,10,11,10,11,11,
135.1506 +        11,
135.1507 +};
135.1508 +
135.1509 +static const static_codebook _16c1_s_p7_0 = {
135.1510 +        4, 81,
135.1511 +        (long *)_vq_lengthlist__16c1_s_p7_0,
135.1512 +        1, -529137664, 1618345984, 2, 0,
135.1513 +        (long *)_vq_quantlist__16c1_s_p7_0,
135.1514 +        0
135.1515 +};
135.1516 +
135.1517 +static const long _vq_quantlist__16c1_s_p7_1[] = {
135.1518 +        5,
135.1519 +        4,
135.1520 +        6,
135.1521 +        3,
135.1522 +        7,
135.1523 +        2,
135.1524 +        8,
135.1525 +        1,
135.1526 +        9,
135.1527 +        0,
135.1528 +        10,
135.1529 +};
135.1530 +
135.1531 +static const long _vq_lengthlist__16c1_s_p7_1[] = {
135.1532 +         2, 3, 3, 5, 6, 7, 7, 7, 7, 8, 8,10,10,10, 6, 6,
135.1533 +         7, 7, 8, 8, 8, 8,10,10,10, 6, 6, 7, 7, 8, 8, 8,
135.1534 +         8,10,10,10, 7, 7, 7, 7, 8, 8, 8, 8,10,10,10, 7,
135.1535 +         7, 7, 7, 8, 8, 8, 8,10,10,10, 7, 7, 8, 8, 8, 8,
135.1536 +         8, 8,10,10,10, 7, 7, 8, 8, 8, 8, 8, 8,10,10,10,
135.1537 +         8, 8, 8, 8, 8, 8, 9, 9,10,10,10,10,10, 8, 8, 8,
135.1538 +         8, 9, 9,10,10,10,10,10, 9, 9, 8, 8, 9, 9,10,10,
135.1539 +        10,10,10, 8, 8, 8, 8, 9, 9,
135.1540 +};
135.1541 +
135.1542 +static const static_codebook _16c1_s_p7_1 = {
135.1543 +        2, 121,
135.1544 +        (long *)_vq_lengthlist__16c1_s_p7_1,
135.1545 +        1, -531365888, 1611661312, 4, 0,
135.1546 +        (long *)_vq_quantlist__16c1_s_p7_1,
135.1547 +        0
135.1548 +};
135.1549 +
135.1550 +static const long _vq_quantlist__16c1_s_p8_0[] = {
135.1551 +        6,
135.1552 +        5,
135.1553 +        7,
135.1554 +        4,
135.1555 +        8,
135.1556 +        3,
135.1557 +        9,
135.1558 +        2,
135.1559 +        10,
135.1560 +        1,
135.1561 +        11,
135.1562 +        0,
135.1563 +        12,
135.1564 +};
135.1565 +
135.1566 +static const long _vq_lengthlist__16c1_s_p8_0[] = {
135.1567 +         1, 4, 4, 6, 6, 7, 7, 7, 7, 8, 8, 9, 9, 6, 5, 5,
135.1568 +         7, 8, 8, 9, 8, 8, 9, 9,10,11, 6, 5, 5, 8, 8, 9,
135.1569 +         9, 8, 8, 9,10,10,11, 0, 8, 8, 8, 9, 9, 9, 9, 9,
135.1570 +        10,10,11,11, 0, 9, 9, 9, 8, 9, 9, 9, 9,10,10,11,
135.1571 +        11, 0,13,13, 9, 9,10,10,10,10,11,11,12,12, 0,14,
135.1572 +        13, 9, 9,10,10,10,10,11,11,12,12, 0, 0, 0,10,10,
135.1573 +         9, 9,11,11,12,12,13,12, 0, 0, 0,10,10, 9, 9,10,
135.1574 +        10,12,12,13,13, 0, 0, 0,13,14,11,10,11,11,12,12,
135.1575 +        13,14, 0, 0, 0,14,14,10,10,11,11,12,12,13,13, 0,
135.1576 +         0, 0, 0, 0,12,12,12,12,13,13,14,15, 0, 0, 0, 0,
135.1577 +         0,12,12,12,12,13,13,14,15,
135.1578 +};
135.1579 +
135.1580 +static const static_codebook _16c1_s_p8_0 = {
135.1581 +        2, 169,
135.1582 +        (long *)_vq_lengthlist__16c1_s_p8_0,
135.1583 +        1, -526516224, 1616117760, 4, 0,
135.1584 +        (long *)_vq_quantlist__16c1_s_p8_0,
135.1585 +        0
135.1586 +};
135.1587 +
135.1588 +static const long _vq_quantlist__16c1_s_p8_1[] = {
135.1589 +        2,
135.1590 +        1,
135.1591 +        3,
135.1592 +        0,
135.1593 +        4,
135.1594 +};
135.1595 +
135.1596 +static const long _vq_lengthlist__16c1_s_p8_1[] = {
135.1597 +         2, 3, 3, 5, 5, 6, 6, 6, 5, 5, 6, 6, 6, 5, 5, 6,
135.1598 +         6, 6, 5, 5, 6, 6, 6, 5, 5,
135.1599 +};
135.1600 +
135.1601 +static const static_codebook _16c1_s_p8_1 = {
135.1602 +        2, 25,
135.1603 +        (long *)_vq_lengthlist__16c1_s_p8_1,
135.1604 +        1, -533725184, 1611661312, 3, 0,
135.1605 +        (long *)_vq_quantlist__16c1_s_p8_1,
135.1606 +        0
135.1607 +};
135.1608 +
135.1609 +static const long _vq_quantlist__16c1_s_p9_0[] = {
135.1610 +        6,
135.1611 +        5,
135.1612 +        7,
135.1613 +        4,
135.1614 +        8,
135.1615 +        3,
135.1616 +        9,
135.1617 +        2,
135.1618 +        10,
135.1619 +        1,
135.1620 +        11,
135.1621 +        0,
135.1622 +        12,
135.1623 +};
135.1624 +
135.1625 +static const long _vq_lengthlist__16c1_s_p9_0[] = {
135.1626 +         1, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
135.1627 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
135.1628 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
135.1629 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
135.1630 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
135.1631 +         9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
135.1632 +         8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
135.1633 +         8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
135.1634 +         8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
135.1635 +         8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
135.1636 +         8, 8, 8, 8, 8, 8, 8, 8, 8,
135.1637 +};
135.1638 +
135.1639 +static const static_codebook _16c1_s_p9_0 = {
135.1640 +        2, 169,
135.1641 +        (long *)_vq_lengthlist__16c1_s_p9_0,
135.1642 +        1, -513964032, 1628680192, 4, 0,
135.1643 +        (long *)_vq_quantlist__16c1_s_p9_0,
135.1644 +        0
135.1645 +};
135.1646 +
135.1647 +static const long _vq_quantlist__16c1_s_p9_1[] = {
135.1648 +        7,
135.1649 +        6,
135.1650 +        8,
135.1651 +        5,
135.1652 +        9,
135.1653 +        4,
135.1654 +        10,
135.1655 +        3,
135.1656 +        11,
135.1657 +        2,
135.1658 +        12,
135.1659 +        1,
135.1660 +        13,
135.1661 +        0,
135.1662 +        14,
135.1663 +};
135.1664 +
135.1665 +static const long _vq_lengthlist__16c1_s_p9_1[] = {
135.1666 +         1, 4, 4, 4, 4, 8, 8,12,13,14,14,14,14,14,14, 6,
135.1667 +         6, 6, 6, 6,10, 9,14,14,14,14,14,14,14,14, 7, 6,
135.1668 +         5, 6, 6,10, 9,12,13,13,13,13,13,13,13,13, 7, 7,
135.1669 +         9, 9,11,11,12,13,13,13,13,13,13,13,13, 7, 7, 8,
135.1670 +         8,11,12,13,13,13,13,13,13,13,13,13,12,12,10,10,
135.1671 +        13,12,13,13,13,13,13,13,13,13,13,12,12,10,10,13,
135.1672 +        13,13,13,13,13,13,13,13,13,13,13,13,13,12,13,12,
135.1673 +        13,13,13,13,13,13,13,13,13,13,13,13,12,13,13,13,
135.1674 +        13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
135.1675 +        13,13,13,13,13,13,13,13,13,13,13,13,12,13,13,13,
135.1676 +        13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
135.1677 +        13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
135.1678 +        13,13,13,13,13,13,13,13,13,12,13,13,13,13,13,13,
135.1679 +        13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
135.1680 +        13,
135.1681 +};
135.1682 +
135.1683 +static const static_codebook _16c1_s_p9_1 = {
135.1684 +        2, 225,
135.1685 +        (long *)_vq_lengthlist__16c1_s_p9_1,
135.1686 +        1, -520986624, 1620377600, 4, 0,
135.1687 +        (long *)_vq_quantlist__16c1_s_p9_1,
135.1688 +        0
135.1689 +};
135.1690 +
135.1691 +static const long _vq_quantlist__16c1_s_p9_2[] = {
135.1692 +        10,
135.1693 +        9,
135.1694 +        11,
135.1695 +        8,
135.1696 +        12,
135.1697 +        7,
135.1698 +        13,
135.1699 +        6,
135.1700 +        14,
135.1701 +        5,
135.1702 +        15,
135.1703 +        4,
135.1704 +        16,
135.1705 +        3,
135.1706 +        17,
135.1707 +        2,
135.1708 +        18,
135.1709 +        1,
135.1710 +        19,
135.1711 +        0,
135.1712 +        20,
135.1713 +};
135.1714 +
135.1715 +static const long _vq_lengthlist__16c1_s_p9_2[] = {
135.1716 +         1, 4, 4, 6, 6, 7, 7, 8, 7, 8, 8, 9, 9, 9, 9,10,
135.1717 +        10,10, 9,10,10,11,12,12, 8, 8, 8, 8, 9, 9, 9, 9,
135.1718 +        10,10,10,10,10,11,11,10,12,11,11,13,11, 7, 7, 8,
135.1719 +         8, 8, 8, 9, 9, 9,10,10,10,10, 9,10,10,11,11,12,
135.1720 +        11,11, 8, 8, 8, 8, 9, 9,10,10,10,10,11,11,11,11,
135.1721 +        11,11,11,12,11,12,12, 8, 8, 9, 9, 9, 9, 9,10,10,
135.1722 +        10,10,10,10,11,11,11,11,11,11,12,11, 9, 9, 9, 9,
135.1723 +        10,10,10,10,11,10,11,11,11,11,11,11,12,12,12,12,
135.1724 +        11, 9, 9, 9, 9,10,10,10,10,11,11,11,11,11,11,11,
135.1725 +        11,11,12,12,12,13, 9,10,10, 9,11,10,10,10,10,11,
135.1726 +        11,11,11,11,10,11,12,11,12,12,11,12,11,10, 9,10,
135.1727 +        10,11,10,11,11,11,11,11,11,11,11,11,12,12,11,12,
135.1728 +        12,12,10,10,10,11,10,11,11,11,11,11,11,11,11,11,
135.1729 +        11,11,12,13,12,12,11, 9,10,10,11,11,10,11,11,11,
135.1730 +        12,11,11,11,11,11,12,12,13,13,12,13,10,10,12,10,
135.1731 +        11,11,11,11,11,11,11,11,11,12,12,11,13,12,12,12,
135.1732 +        12,13,12,11,11,11,11,11,11,12,11,12,11,11,11,11,
135.1733 +        12,12,13,12,11,12,12,11,11,11,11,11,12,11,11,11,
135.1734 +        11,12,11,11,12,11,12,13,13,12,12,12,12,11,11,11,
135.1735 +        11,11,12,11,11,12,11,12,11,11,11,11,13,12,12,12,
135.1736 +        12,13,11,11,11,12,12,11,11,11,12,11,12,12,12,11,
135.1737 +        12,13,12,11,11,12,12,11,12,11,11,11,12,12,11,12,
135.1738 +        11,11,11,12,12,12,12,13,12,13,12,12,12,12,11,11,
135.1739 +        12,11,11,11,11,11,11,12,12,12,13,12,11,13,13,12,
135.1740 +        12,11,12,10,11,11,11,11,12,11,12,12,11,12,12,13,
135.1741 +        12,12,13,12,12,12,12,12,11,12,12,12,11,12,11,11,
135.1742 +        11,12,13,12,13,13,13,13,13,12,13,13,12,12,13,11,
135.1743 +        11,11,11,11,12,11,11,12,11,
135.1744 +};
135.1745 +
135.1746 +static const static_codebook _16c1_s_p9_2 = {
135.1747 +        2, 441,
135.1748 +        (long *)_vq_lengthlist__16c1_s_p9_2,
135.1749 +        1, -529268736, 1611661312, 5, 0,
135.1750 +        (long *)_vq_quantlist__16c1_s_p9_2,
135.1751 +        0
135.1752 +};
135.1753 +
135.1754 +static const long _huff_lengthlist__16c1_s_short[] = {
135.1755 +         5, 6,17, 8,12, 9,10,10,12,13, 5, 2,17, 4, 9, 5,
135.1756 +         7, 8,11,13,16,16,16,16,16,16,16,16,16,16, 6, 4,
135.1757 +        16, 5,10, 5, 7,10,14,16,13, 9,16,11, 8, 7, 8, 9,
135.1758 +        13,16, 7, 4,16, 5, 7, 4, 6, 8,11,13, 8, 6,16, 7,
135.1759 +         8, 5, 5, 7, 9,13, 9, 8,16, 9, 8, 6, 6, 7, 9,13,
135.1760 +        11,11,16,10,10, 7, 7, 7, 9,13,13,13,16,13,13, 9,
135.1761 +         9, 9,10,13,
135.1762 +};
135.1763 +
135.1764 +static const static_codebook _huff_book__16c1_s_short = {
135.1765 +        2, 100,
135.1766 +        (long *)_huff_lengthlist__16c1_s_short,
135.1767 +        0, 0, 0, 0, 0,
135.1768 +        NULL,
135.1769 +        0
135.1770 +};
135.1771 +
135.1772 +static const long _huff_lengthlist__16c2_s_long[] = {
135.1773 +	 4, 7, 9, 9, 9, 8, 9,10,13,16, 5, 4, 5, 6, 7, 7,
135.1774 +	 8, 9,12,16, 6, 5, 5, 5, 7, 7, 9,10,12,15, 7, 6,
135.1775 +	 5, 4, 5, 6, 8, 9,10,13, 8, 7, 7, 5, 5, 5, 7, 9,
135.1776 +	10,12, 7, 7, 7, 6, 5, 5, 6, 7,10,12, 8, 8, 8, 7,
135.1777 +	 7, 5, 5, 6, 9,11, 8, 9, 9, 8, 8, 6, 6, 5, 8,11,
135.1778 +	10,11,12,12,11, 9, 9, 8, 9,12,13,14,15,15,14,12,
135.1779 +	12,11,11,13,
135.1780 +};
135.1781 +
135.1782 +static const static_codebook _huff_book__16c2_s_long = {
135.1783 +	2, 100,
135.1784 +	(long *)_huff_lengthlist__16c2_s_long,
135.1785 +	0, 0, 0, 0, 0,
135.1786 +	NULL,
135.1787 +	0
135.1788 +};
135.1789 +
135.1790 +static const long _vq_quantlist__16c2_s_p1_0[] = {
135.1791 +	1,
135.1792 +	0,
135.1793 +	2,
135.1794 +};
135.1795 +
135.1796 +static const long _vq_lengthlist__16c2_s_p1_0[] = {
135.1797 +	 1, 3, 3, 0, 0, 0, 0, 0, 0, 4, 5, 5, 0, 0, 0, 0,
135.1798 +	 0, 0, 4, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1799 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1800 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1801 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1802 +	 0,
135.1803 +};
135.1804 +
135.1805 +static const static_codebook _16c2_s_p1_0 = {
135.1806 +	4, 81,
135.1807 +	(long *)_vq_lengthlist__16c2_s_p1_0,
135.1808 +	1, -535822336, 1611661312, 2, 0,
135.1809 +	(long *)_vq_quantlist__16c2_s_p1_0,
135.1810 +	0
135.1811 +};
135.1812 +
135.1813 +static const long _vq_quantlist__16c2_s_p2_0[] = {
135.1814 +	2,
135.1815 +	1,
135.1816 +	3,
135.1817 +	0,
135.1818 +	4,
135.1819 +};
135.1820 +
135.1821 +static const long _vq_lengthlist__16c2_s_p2_0[] = {
135.1822 +	 2, 4, 4, 7, 7, 0, 0, 0, 8, 8, 0, 0, 0, 8, 8, 0,
135.1823 +	 0, 0, 8, 8, 0, 0, 0, 8, 8, 4, 4, 4, 8, 7, 0, 0,
135.1824 +	 0, 8, 8, 0, 0, 0, 8, 8, 0, 0, 0, 9, 9, 0, 0, 0,
135.1825 +	 9, 9, 4, 4, 4, 7, 8, 0, 0, 0, 8, 8, 0, 0, 0, 8,
135.1826 +	 8, 0, 0, 0, 9, 9, 0, 0, 0, 9, 9, 7, 8, 8,10, 9,
135.1827 +	 0, 0, 0,12,11, 0, 0, 0,11,12, 0, 0, 0,14,13, 0,
135.1828 +	 0, 0,14,14, 7, 8, 8, 9,10, 0, 0, 0,11,12, 0, 0,
135.1829 +	 0,11,11, 0, 0, 0,14,14, 0, 0, 0,14,14, 0, 0, 0,
135.1830 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1831 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1832 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1833 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1834 +	 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 8,11,11, 0, 0, 0,
135.1835 +	12,11, 0, 0, 0,12,12, 0, 0, 0,13,12, 0, 0, 0,13,
135.1836 +	13, 8, 8, 8,11,11, 0, 0, 0,11,11, 0, 0, 0,12,12,
135.1837 +	 0, 0, 0,13,13, 0, 0, 0,13,13, 0, 0, 0, 0, 0, 0,
135.1838 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1839 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1840 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1841 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1842 +	 0, 0, 0, 0, 0, 8, 9, 8,12,11, 0, 0, 0,12,12, 0,
135.1843 +	 0, 0,12,11, 0, 0, 0,13,13, 0, 0, 0,13,13, 8, 8,
135.1844 +	 8,11,12, 0, 0, 0,11,12, 0, 0, 0,11,12, 0, 0, 0,
135.1845 +	13,14, 0, 0, 0,13,13, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1846 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1847 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1848 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1849 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1850 +	 0, 0, 8, 9, 9,14,14, 0, 0, 0,13,13, 0, 0, 0,13,
135.1851 +	13, 0, 0, 0,13,12, 0, 0, 0,13,13, 8, 9, 9,14,14,
135.1852 +	 0, 0, 0,13,13, 0, 0, 0,13,13, 0, 0, 0,12,13, 0,
135.1853 +	 0, 0,13,13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1854 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1855 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1856 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1857 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8,
135.1858 +	 9, 9,14,14, 0, 0, 0,13,13, 0, 0, 0,13,13, 0, 0,
135.1859 +	 0,13,13, 0, 0, 0,13,12, 8, 9, 9,14,14, 0, 0, 0,
135.1860 +	13,13, 0, 0, 0,13,13, 0, 0, 0,13,13, 0, 0, 0,12,
135.1861 +	12,
135.1862 +};
135.1863 +
135.1864 +static const static_codebook _16c2_s_p2_0 = {
135.1865 +	4, 625,
135.1866 +	(long *)_vq_lengthlist__16c2_s_p2_0,
135.1867 +	1, -533725184, 1611661312, 3, 0,
135.1868 +	(long *)_vq_quantlist__16c2_s_p2_0,
135.1869 +	0
135.1870 +};
135.1871 +
135.1872 +static const long _vq_quantlist__16c2_s_p3_0[] = {
135.1873 +	4,
135.1874 +	3,
135.1875 +	5,
135.1876 +	2,
135.1877 +	6,
135.1878 +	1,
135.1879 +	7,
135.1880 +	0,
135.1881 +	8,
135.1882 +};
135.1883 +
135.1884 +static const long _vq_lengthlist__16c2_s_p3_0[] = {
135.1885 +	 1, 3, 3, 5, 5, 7, 7, 8, 8, 0, 0, 0, 6, 6, 8, 8,
135.1886 +	 9, 9, 0, 0, 0, 6, 6, 8, 8, 9, 9, 0, 0, 0, 7, 7,
135.1887 +	 8, 9,10,10, 0, 0, 0, 7, 7, 9, 9,10,10, 0, 0, 0,
135.1888 +	 8, 8, 9, 9,11,11, 0, 0, 0, 7, 7, 9, 9,11,11, 0,
135.1889 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1890 +	 0,
135.1891 +};
135.1892 +
135.1893 +static const static_codebook _16c2_s_p3_0 = {
135.1894 +	2, 81,
135.1895 +	(long *)_vq_lengthlist__16c2_s_p3_0,
135.1896 +	1, -531628032, 1611661312, 4, 0,
135.1897 +	(long *)_vq_quantlist__16c2_s_p3_0,
135.1898 +	0
135.1899 +};
135.1900 +
135.1901 +static const long _vq_quantlist__16c2_s_p4_0[] = {
135.1902 +	8,
135.1903 +	7,
135.1904 +	9,
135.1905 +	6,
135.1906 +	10,
135.1907 +	5,
135.1908 +	11,
135.1909 +	4,
135.1910 +	12,
135.1911 +	3,
135.1912 +	13,
135.1913 +	2,
135.1914 +	14,
135.1915 +	1,
135.1916 +	15,
135.1917 +	0,
135.1918 +	16,
135.1919 +};
135.1920 +
135.1921 +static const long _vq_lengthlist__16c2_s_p4_0[] = {
135.1922 +	 2, 3, 3, 5, 5, 6, 6, 6, 6, 7, 7, 8, 8, 8, 8, 9,
135.1923 +	 9, 0, 0, 0, 6, 6, 7, 7, 8, 8, 8, 8, 9, 9,10,10,
135.1924 +	11,10, 0, 0, 0, 6, 6, 7, 7, 8, 8, 8, 8, 9, 9,10,
135.1925 +	10,10,10, 0, 0, 0, 6, 6, 8, 8, 9, 9, 9, 9,10,10,
135.1926 +	11,11,11,11, 0, 0, 0, 7, 6, 8, 8, 9, 9, 9, 9,10,
135.1927 +	10,11,11,11,11, 0, 0, 0, 7, 7, 8, 8, 9, 9,10,10,
135.1928 +	11,11,11,11,12,12, 0, 0, 0, 7, 7, 8, 8, 9, 9,10,
135.1929 +	10,11,11,11,11,12,12, 0, 0, 0, 7, 8, 8, 8, 9, 9,
135.1930 +	10,10,11,11,12,12,13,13, 0, 0, 0, 0, 0, 8, 8, 9,
135.1931 +	 9,10,10,11,11,12,12,13,13, 0, 0, 0, 0, 0, 0, 0,
135.1932 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1933 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1934 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1935 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1936 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1937 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1938 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1939 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.1940 +	 0,
135.1941 +};
135.1942 +
135.1943 +static const static_codebook _16c2_s_p4_0 = {
135.1944 +	2, 289,
135.1945 +	(long *)_vq_lengthlist__16c2_s_p4_0,
135.1946 +	1, -529530880, 1611661312, 5, 0,
135.1947 +	(long *)_vq_quantlist__16c2_s_p4_0,
135.1948 +	0
135.1949 +};
135.1950 +
135.1951 +static const long _vq_quantlist__16c2_s_p5_0[] = {
135.1952 +	1,
135.1953 +	0,
135.1954 +	2,
135.1955 +};
135.1956 +
135.1957 +static const long _vq_lengthlist__16c2_s_p5_0[] = {
135.1958 +	 1, 4, 4, 5, 7, 7, 6, 7, 7, 4, 6, 6,10,11,10,10,
135.1959 +	10,11, 4, 6, 6,10,10,11,10,11,10, 5,10,10, 9,12,
135.1960 +	11,10,12,12, 7,10,10,12,12,12,12,13,13, 7,11,10,
135.1961 +	11,12,12,12,13,13, 6,11,10,10,12,12,11,12,12, 7,
135.1962 +	11,10,12,13,13,12,12,12, 7,10,11,12,13,13,12,12,
135.1963 +	12,
135.1964 +};
135.1965 +
135.1966 +static const static_codebook _16c2_s_p5_0 = {
135.1967 +	4, 81,
135.1968 +	(long *)_vq_lengthlist__16c2_s_p5_0,
135.1969 +	1, -529137664, 1618345984, 2, 0,
135.1970 +	(long *)_vq_quantlist__16c2_s_p5_0,
135.1971 +	0
135.1972 +};
135.1973 +
135.1974 +static const long _vq_quantlist__16c2_s_p5_1[] = {
135.1975 +	5,
135.1976 +	4,
135.1977 +	6,
135.1978 +	3,
135.1979 +	7,
135.1980 +	2,
135.1981 +	8,
135.1982 +	1,
135.1983 +	9,
135.1984 +	0,
135.1985 +	10,
135.1986 +};
135.1987 +
135.1988 +static const long _vq_lengthlist__16c2_s_p5_1[] = {
135.1989 +	 2, 3, 3, 6, 6, 6, 6, 7, 7, 7, 7,11,10,10, 6, 6,
135.1990 +	 7, 7, 8, 8, 8, 8,10,10,10, 6, 6, 7, 7, 8, 8, 8,
135.1991 +	 8,11,11,11, 7, 7, 8, 8, 8, 8, 9, 9,11,11,11, 6,
135.1992 +	 7, 8, 8, 8, 8, 9, 9,11,11,11, 7, 7, 8, 8, 8, 8,
135.1993 +	 8, 8,11,11,11, 7, 7, 8, 8, 8, 8, 9, 9,11,11,11,
135.1994 +	 8, 8, 8, 8, 8, 8, 8, 8,11,11,11,11,11, 8, 8, 8,
135.1995 +	 8, 8, 8,12,11,11,11,11, 8, 8, 8, 8, 8, 8,12,11,
135.1996 +	11,11,11, 7, 7, 8, 8, 8, 8,
135.1997 +};
135.1998 +
135.1999 +static const static_codebook _16c2_s_p5_1 = {
135.2000 +	2, 121,
135.2001 +	(long *)_vq_lengthlist__16c2_s_p5_1,
135.2002 +	1, -531365888, 1611661312, 4, 0,
135.2003 +	(long *)_vq_quantlist__16c2_s_p5_1,
135.2004 +	0
135.2005 +};
135.2006 +
135.2007 +static const long _vq_quantlist__16c2_s_p6_0[] = {
135.2008 +	6,
135.2009 +	5,
135.2010 +	7,
135.2011 +	4,
135.2012 +	8,
135.2013 +	3,
135.2014 +	9,
135.2015 +	2,
135.2016 +	10,
135.2017 +	1,
135.2018 +	11,
135.2019 +	0,
135.2020 +	12,
135.2021 +};
135.2022 +
135.2023 +static const long _vq_lengthlist__16c2_s_p6_0[] = {
135.2024 +	 1, 4, 4, 6, 6, 8, 7, 8, 8, 9, 9,10,10, 5, 5, 5,
135.2025 +	 7, 7, 9, 9, 9, 9,11,11,12,12, 6, 5, 5, 7, 7, 9,
135.2026 +	 9,10, 9,11,11,12,12, 0, 7, 7, 7, 7, 9, 9,10,10,
135.2027 +	11,11,12,12, 0, 7, 7, 7, 7, 9, 9,10,10,11,11,12,
135.2028 +	12, 0,11,11, 8, 8,10,10,11,11,12,12,13,13, 0,12,
135.2029 +	12, 9, 9,10,10,11,11,12,12,13,13, 0, 0, 0, 0, 0,
135.2030 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2031 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2032 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2033 +	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2034 +	 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2035 +};
135.2036 +
135.2037 +static const static_codebook _16c2_s_p6_0 = {
135.2038 +	2, 169,
135.2039 +	(long *)_vq_lengthlist__16c2_s_p6_0,
135.2040 +	1, -526516224, 1616117760, 4, 0,
135.2041 +	(long *)_vq_quantlist__16c2_s_p6_0,
135.2042 +	0
135.2043 +};
135.2044 +
135.2045 +static const long _vq_quantlist__16c2_s_p6_1[] = {
135.2046 +	2,
135.2047 +	1,
135.2048 +	3,
135.2049 +	0,
135.2050 +	4,
135.2051 +};
135.2052 +
135.2053 +static const long _vq_lengthlist__16c2_s_p6_1[] = {
135.2054 +	 2, 3, 3, 5, 5, 6, 6, 6, 5, 5, 6, 6, 6, 5, 5, 6,
135.2055 +	 6, 6, 5, 5, 6, 6, 6, 5, 5,
135.2056 +};
135.2057 +
135.2058 +static const static_codebook _16c2_s_p6_1 = {
135.2059 +	2, 25,
135.2060 +	(long *)_vq_lengthlist__16c2_s_p6_1,
135.2061 +	1, -533725184, 1611661312, 3, 0,
135.2062 +	(long *)_vq_quantlist__16c2_s_p6_1,
135.2063 +	0
135.2064 +};
135.2065 +
135.2066 +static const long _vq_quantlist__16c2_s_p7_0[] = {
135.2067 +	6,
135.2068 +	5,
135.2069 +	7,
135.2070 +	4,
135.2071 +	8,
135.2072 +	3,
135.2073 +	9,
135.2074 +	2,
135.2075 +	10,
135.2076 +	1,
135.2077 +	11,
135.2078 +	0,
135.2079 +	12,
135.2080 +};
135.2081 +
135.2082 +static const long _vq_lengthlist__16c2_s_p7_0[] = {
135.2083 +	 1, 4, 4, 7, 7, 8, 8, 8, 8,10, 9,10,10, 5, 5, 5,
135.2084 +	 7, 7, 9, 9,10,10,11,10,12,11, 6, 5, 5, 7, 7, 9,
135.2085 +	 9,10,10,11,11,12,12,20, 7, 7, 7, 7, 9, 9,10,10,
135.2086 +	11,11,12,12,20, 7, 7, 7, 7, 9, 9,11,10,12,11,12,
135.2087 +	12,20,11,11, 8, 8,10,10,11,11,12,12,13,13,20,12,
135.2088 +	12, 8, 8, 9, 9,11,11,12,12,13,13,20,20,21,10,10,
135.2089 +	10,10,11,11,12,12,13,13,21,21,21,10,10,10,10,11,
135.2090 +	11,12,12,13,13,21,21,21,14,14,11,11,12,12,13,13,
135.2091 +	13,14,21,21,21,16,15,11,11,12,11,13,13,14,14,21,
135.2092 +	21,21,21,21,13,13,12,12,13,13,14,14,21,21,21,21,
135.2093 +	21,13,13,12,12,13,13,14,14,
135.2094 +};
135.2095 +
135.2096 +static const static_codebook _16c2_s_p7_0 = {
135.2097 +	2, 169,
135.2098 +	(long *)_vq_lengthlist__16c2_s_p7_0,
135.2099 +	1, -523206656, 1618345984, 4, 0,
135.2100 +	(long *)_vq_quantlist__16c2_s_p7_0,
135.2101 +	0
135.2102 +};
135.2103 +
135.2104 +static const long _vq_quantlist__16c2_s_p7_1[] = {
135.2105 +	5,
135.2106 +	4,
135.2107 +	6,
135.2108 +	3,
135.2109 +	7,
135.2110 +	2,
135.2111 +	8,
135.2112 +	1,
135.2113 +	9,
135.2114 +	0,
135.2115 +	10,
135.2116 +};
135.2117 +
135.2118 +static const long _vq_lengthlist__16c2_s_p7_1[] = {
135.2119 +	 2, 4, 4, 6, 6, 7, 7, 7, 7, 7, 7, 9, 9, 9, 6, 7,
135.2120 +	 7, 7, 7, 7, 8, 8, 9, 9, 9, 6, 6, 7, 7, 7, 7, 8,
135.2121 +	 8, 9, 9, 9, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 7,
135.2122 +	 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 7, 7, 7, 7, 8, 8,
135.2123 +	 8, 8, 9, 9, 9, 7, 7, 7, 7, 7, 7, 8, 8, 9, 9, 9,
135.2124 +	 7, 7, 8, 8, 7, 7, 8, 8, 9, 9, 9, 9, 9, 8, 8, 7,
135.2125 +	 7, 8, 8, 9, 9, 9, 9, 9, 8, 8, 7, 7, 8, 8, 9, 9,
135.2126 +	 9, 9, 9, 7, 7, 7, 7, 8, 8,
135.2127 +};
135.2128 +
135.2129 +static const static_codebook _16c2_s_p7_1 = {
135.2130 +	2, 121,
135.2131 +	(long *)_vq_lengthlist__16c2_s_p7_1,
135.2132 +	1, -531365888, 1611661312, 4, 0,
135.2133 +	(long *)_vq_quantlist__16c2_s_p7_1,
135.2134 +	0
135.2135 +};
135.2136 +
135.2137 +static const long _vq_quantlist__16c2_s_p8_0[] = {
135.2138 +	7,
135.2139 +	6,
135.2140 +	8,
135.2141 +	5,
135.2142 +	9,
135.2143 +	4,
135.2144 +	10,
135.2145 +	3,
135.2146 +	11,
135.2147 +	2,
135.2148 +	12,
135.2149 +	1,
135.2150 +	13,
135.2151 +	0,
135.2152 +	14,
135.2153 +};
135.2154 +
135.2155 +static const long _vq_lengthlist__16c2_s_p8_0[] = {
135.2156 +	 1, 4, 4, 6, 6, 7, 7, 7, 7, 8, 8, 9, 9,10,10, 6,
135.2157 +	 6, 6, 8, 8, 9, 9, 8, 8, 9, 9,10,10,11,11, 6, 5,
135.2158 +	 5, 8, 7, 9, 9, 8, 8, 9, 9,10,10,11,11,20, 8, 8,
135.2159 +	 8, 8, 9, 9, 9, 9,10,10,11,10,12,11,20, 8, 8, 8,
135.2160 +	 8, 9, 9, 9, 9,10,10,11,11,12,12,20,12,12, 9, 9,
135.2161 +	10,10,10,10,11,11,12,12,13,12,20,13,13, 9, 9,10,
135.2162 +	10,10,10,11,11,12,12,13,13,20,20,20, 9, 9, 9, 9,
135.2163 +	10,10,11,11,12,12,13,12,20,20,20, 9, 9, 9, 8,10,
135.2164 +	10,12,11,12,12,13,13,20,20,20,13,13,10,10,11,11,
135.2165 +	12,12,13,13,13,13,20,20,20,13,13,10,10,11,10,12,
135.2166 +	11,13,13,14,14,20,20,20,20,20,11,11,11,11,12,12,
135.2167 +	13,13,14,14,20,20,20,20,20,11,10,11,11,13,11,13,
135.2168 +	13,14,14,20,20,21,21,21,14,14,11,12,13,13,13,13,
135.2169 +	14,14,21,21,21,21,21,15,15,12,11,13,12,14,13,15,
135.2170 +	14,
135.2171 +};
135.2172 +
135.2173 +static const static_codebook _16c2_s_p8_0 = {
135.2174 +	2, 225,
135.2175 +	(long *)_vq_lengthlist__16c2_s_p8_0,
135.2176 +	1, -520986624, 1620377600, 4, 0,
135.2177 +	(long *)_vq_quantlist__16c2_s_p8_0,
135.2178 +	0
135.2179 +};
135.2180 +
135.2181 +static const long _vq_quantlist__16c2_s_p8_1[] = {
135.2182 +	10,
135.2183 +	9,
135.2184 +	11,
135.2185 +	8,
135.2186 +	12,
135.2187 +	7,
135.2188 +	13,
135.2189 +	6,
135.2190 +	14,
135.2191 +	5,
135.2192 +	15,
135.2193 +	4,
135.2194 +	16,
135.2195 +	3,
135.2196 +	17,
135.2197 +	2,
135.2198 +	18,
135.2199 +	1,
135.2200 +	19,
135.2201 +	0,
135.2202 +	20,
135.2203 +};
135.2204 +
135.2205 +static const long _vq_lengthlist__16c2_s_p8_1[] = {
135.2206 +	 2, 4, 4, 6, 6, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8,
135.2207 +	 8, 8, 8, 8, 8,11,11,11, 7, 7, 8, 8, 8, 8, 9, 9,
135.2208 +	 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,10,11,10, 7, 7, 8,
135.2209 +	 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,11,
135.2210 +	11,11, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
135.2211 +	 9, 9, 9, 9,11,11,11, 8, 8, 8, 8, 9, 9, 9, 9, 9,
135.2212 +	 9, 9, 9,10, 9,10,10,10,10,11,11,11, 8, 8, 9, 9,
135.2213 +	 9, 9, 9, 9, 9, 9,10,10,10,10,10,10,10,10,11,11,
135.2214 +	11, 8, 8, 9, 9, 9, 9, 9, 9, 9,10,10,10,10,10,10,
135.2215 +	10,10,10,11,11,11, 9, 9, 9, 9, 9, 9, 9, 9,10,10,
135.2216 +	10,10,10,10,10,10,10,10,11,11,11,11,11, 9, 9, 9,
135.2217 +	 9, 9, 9,10,10,10,10,10,10,10,10,10,10,11,11,11,
135.2218 +	11,11, 9, 9, 9, 9,10,10,10,10,10,10,10,10,10,10,
135.2219 +	10,10,11,11,11,11,11, 9, 9, 9, 9,10,10,10,10,10,
135.2220 +	10,10,10,10,10,10,10,11,11,11,11,11,10, 9,10,10,
135.2221 +	10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,
135.2222 +	11,11,11,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.2223 +	10,11,11,11,11,11,11,11,10,10,10,10,10,10,10,10,
135.2224 +	10,10,10,10,10,10,11,11,11,11,11,11,11,10,10,10,
135.2225 +	10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,
135.2226 +	11,11,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.2227 +	11,11,11,11,11,11,11,11,11,10,10,10,10,10,10,10,
135.2228 +	10,10,10,10,10,11,11,11,11,11,11,11,11,11,10,10,
135.2229 +	10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,
135.2230 +	11,11,11,10,10,10,10,10,10,10,10,10,10,10,10,11,
135.2231 +	11,11,11,11,11,11,11,11,10,10,10,10,10,10,10,10,
135.2232 +	10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,10,
135.2233 +	10,10,10,10,10,10,10,10,10,
135.2234 +};
135.2235 +
135.2236 +static const static_codebook _16c2_s_p8_1 = {
135.2237 +	2, 441,
135.2238 +	(long *)_vq_lengthlist__16c2_s_p8_1,
135.2239 +	1, -529268736, 1611661312, 5, 0,
135.2240 +	(long *)_vq_quantlist__16c2_s_p8_1,
135.2241 +	0
135.2242 +};
135.2243 +
135.2244 +static const long _vq_quantlist__16c2_s_p9_0[] = {
135.2245 +	8,
135.2246 +	7,
135.2247 +	9,
135.2248 +	6,
135.2249 +	10,
135.2250 +	5,
135.2251 +	11,
135.2252 +	4,
135.2253 +	12,
135.2254 +	3,
135.2255 +	13,
135.2256 +	2,
135.2257 +	14,
135.2258 +	1,
135.2259 +	15,
135.2260 +	0,
135.2261 +	16,
135.2262 +};
135.2263 +
135.2264 +static const long _vq_lengthlist__16c2_s_p9_0[] = {
135.2265 +	 1, 4, 3,10, 8,10,10,10,10,10,10,10,10,10,10,10,
135.2266 +	10, 6,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.2267 +	10,10, 6,10, 9,10,10,10,10,10,10,10,10,10,10,10,
135.2268 +	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.2269 +	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.2270 +	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.2271 +	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.2272 +	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.2273 +	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.2274 +	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.2275 +	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.2276 +	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.2277 +	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.2278 +	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.2279 +	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.2280 +	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.2281 +	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.2282 +	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.2283 +	10,
135.2284 +};
135.2285 +
135.2286 +static const static_codebook _16c2_s_p9_0 = {
135.2287 +	2, 289,
135.2288 +	(long *)_vq_lengthlist__16c2_s_p9_0,
135.2289 +	1, -509798400, 1631393792, 5, 0,
135.2290 +	(long *)_vq_quantlist__16c2_s_p9_0,
135.2291 +	0
135.2292 +};
135.2293 +
135.2294 +static const long _vq_quantlist__16c2_s_p9_1[] = {
135.2295 +	9,
135.2296 +	8,
135.2297 +	10,
135.2298 +	7,
135.2299 +	11,
135.2300 +	6,
135.2301 +	12,
135.2302 +	5,
135.2303 +	13,
135.2304 +	4,
135.2305 +	14,
135.2306 +	3,
135.2307 +	15,
135.2308 +	2,
135.2309 +	16,
135.2310 +	1,
135.2311 +	17,
135.2312 +	0,
135.2313 +	18,
135.2314 +};
135.2315 +
135.2316 +static const long _vq_lengthlist__16c2_s_p9_1[] = {
135.2317 +	 1, 4, 4, 7, 7, 7, 7, 7, 7, 8, 8,10, 9,11,10,13,
135.2318 +	11,14,13, 6, 6, 6, 8, 8, 8, 8, 8, 7, 9, 8,11, 9,
135.2319 +	13,11,14,12,14,13, 5, 6, 6, 8, 8, 8, 8, 8, 8, 9,
135.2320 +	 9,11,11,13,11,14,13,15,15,17, 8, 8, 8, 8, 9, 9,
135.2321 +	 9, 8,11, 9,12,10,13,11,14,12,14,13,17, 8, 8, 8,
135.2322 +	 8, 9, 9, 9, 9,10,10,11,11,13,13,13,14,16,15,17,
135.2323 +	12,12, 8, 8, 9, 9,10,10,11,11,12,11,13,12,13,12,
135.2324 +	14,13,16,12,12, 8, 8, 9, 9,10,10,11,11,12,12,13,
135.2325 +	13,14,14,15,15,17,17,17, 9, 9, 9, 9,11,11,12,12,
135.2326 +	12,13,13,13,16,14,14,14,17,17,17, 9, 8, 9, 8,11,
135.2327 +	10,12,12,13,13,14,14,15,15,16,16,17,17,17,12,12,
135.2328 +	10,10,11,12,12,13,13,14,13,15,15,14,16,15,17,17,
135.2329 +	17,12,12,10, 8,12, 9,13,12,14,14,15,14,15,16,16,
135.2330 +	16,17,17,17,17,17,11,11,12,12,14,14,14,16,15,16,
135.2331 +	15,16,15,17,17,17,17,17,17,11, 9,12,10,13,11,15,
135.2332 +	14,16,16,17,16,16,15,17,17,17,17,17,15,15,12,12,
135.2333 +	14,14,15,16,16,15,16,16,17,17,17,17,17,17,17,14,
135.2334 +	14,12,10,14,11,15,12,17,16,15,16,17,16,17,17,17,
135.2335 +	17,17,17,17,13,13,14,14,14,16,17,17,16,17,17,17,
135.2336 +	17,17,17,17,17,17,17,13, 9,13,12,15,13,16,16,17,
135.2337 +	17,17,17,17,17,17,17,17,17,17,15,17,14,14,15,16,
135.2338 +	16,17,16,17,16,17,17,17,17,17,17,17,17,17,17,14,
135.2339 +	13,15,16,16,17,16,17,17,17,
135.2340 +};
135.2341 +
135.2342 +static const static_codebook _16c2_s_p9_1 = {
135.2343 +	2, 361,
135.2344 +	(long *)_vq_lengthlist__16c2_s_p9_1,
135.2345 +	1, -518287360, 1622704128, 5, 0,
135.2346 +	(long *)_vq_quantlist__16c2_s_p9_1,
135.2347 +	0
135.2348 +};
135.2349 +
135.2350 +static const long _vq_quantlist__16c2_s_p9_2[] = {
135.2351 +	24,
135.2352 +	23,
135.2353 +	25,
135.2354 +	22,
135.2355 +	26,
135.2356 +	21,
135.2357 +	27,
135.2358 +	20,
135.2359 +	28,
135.2360 +	19,
135.2361 +	29,
135.2362 +	18,
135.2363 +	30,
135.2364 +	17,
135.2365 +	31,
135.2366 +	16,
135.2367 +	32,
135.2368 +	15,
135.2369 +	33,
135.2370 +	14,
135.2371 +	34,
135.2372 +	13,
135.2373 +	35,
135.2374 +	12,
135.2375 +	36,
135.2376 +	11,
135.2377 +	37,
135.2378 +	10,
135.2379 +	38,
135.2380 +	9,
135.2381 +	39,
135.2382 +	8,
135.2383 +	40,
135.2384 +	7,
135.2385 +	41,
135.2386 +	6,
135.2387 +	42,
135.2388 +	5,
135.2389 +	43,
135.2390 +	4,
135.2391 +	44,
135.2392 +	3,
135.2393 +	45,
135.2394 +	2,
135.2395 +	46,
135.2396 +	1,
135.2397 +	47,
135.2398 +	0,
135.2399 +	48,
135.2400 +};
135.2401 +
135.2402 +static const long _vq_lengthlist__16c2_s_p9_2[] = {
135.2403 +	 2, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6,
135.2404 +	 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
135.2405 +	 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
135.2406 +	 7,
135.2407 +};
135.2408 +
135.2409 +static const static_codebook _16c2_s_p9_2 = {
135.2410 +	1, 49,
135.2411 +	(long *)_vq_lengthlist__16c2_s_p9_2,
135.2412 +	1, -526909440, 1611661312, 6, 0,
135.2413 +	(long *)_vq_quantlist__16c2_s_p9_2,
135.2414 +	0
135.2415 +};
135.2416 +
135.2417 +static const long _huff_lengthlist__16c2_s_short[] = {
135.2418 +	 7,10,12,11,12,13,15,16,18,15,10, 8, 8, 8, 9,10,
135.2419 +	12,13,14,17,10, 7, 7, 7, 7, 8,10,12,15,18,10, 7,
135.2420 +	 7, 5, 5, 6, 8,10,13,15,10, 7, 6, 5, 4, 4, 6, 9,
135.2421 +	12,15,11, 7, 7, 5, 4, 3, 4, 7,11,13,12, 9, 8, 7,
135.2422 +	 5, 4, 4, 5,10,13,11,11,11, 9, 7, 5, 5, 5, 9,12,
135.2423 +	13,12,13,12,10, 8, 8, 7, 9,13,14,14,14,14,13,11,
135.2424 +	11,10,10,13,
135.2425 +};
135.2426 +
135.2427 +static const static_codebook _huff_book__16c2_s_short = {
135.2428 +	2, 100,
135.2429 +	(long *)_huff_lengthlist__16c2_s_short,
135.2430 +	0, 0, 0, 0, 0,
135.2431 +	NULL,
135.2432 +	0
135.2433 +};
135.2434 +
135.2435 +static const long _vq_quantlist__8c0_s_p1_0[] = {
135.2436 +        1,
135.2437 +        0,
135.2438 +        2,
135.2439 +};
135.2440 +
135.2441 +static const long _vq_lengthlist__8c0_s_p1_0[] = {
135.2442 +         1, 5, 4, 0, 0, 0, 0, 0, 0, 5, 7, 7, 0, 0, 0, 0,
135.2443 +         0, 0, 5, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2444 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2445 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2446 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2447 +         0, 5, 8, 8, 0, 0, 0, 0, 0, 0, 7, 8, 9, 0, 0, 0,
135.2448 +         0, 0, 0, 7, 8, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2449 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2450 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2451 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2452 +         0, 0, 5, 8, 8, 0, 0, 0, 0, 0, 0, 7, 9, 9, 0, 0,
135.2453 +         0, 0, 0, 0, 7, 9, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2454 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2455 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2456 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2457 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2458 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2459 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2460 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2461 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2462 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2463 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2464 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2465 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2466 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2467 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2468 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2469 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2470 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2471 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2472 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2473 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2474 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2475 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2476 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2477 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2478 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2479 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2480 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2481 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2482 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2483 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2484 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2485 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2486 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2487 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 8, 8, 0, 0, 0, 0,
135.2488 +         0, 0, 8,10,10, 0, 0, 0, 0, 0, 0, 8, 9, 9, 0, 0,
135.2489 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2490 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2491 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2492 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7,10, 9, 0, 0, 0,
135.2493 +         0, 0, 0, 8, 9,11, 0, 0, 0, 0, 0, 0, 9,11,11, 0,
135.2494 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2495 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2496 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2497 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 9,10, 0, 0,
135.2498 +         0, 0, 0, 0, 9,11,10, 0, 0, 0, 0, 0, 0, 9,11,11,
135.2499 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2500 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2501 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2502 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2503 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2504 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2505 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2506 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2507 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2508 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2509 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2510 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2511 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2512 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2513 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2514 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2515 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2516 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2517 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2518 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2519 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2520 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2521 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2522 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2523 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2524 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2525 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2526 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2527 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2528 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2529 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2530 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2531 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2532 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2533 +         0, 0, 5, 8, 8, 0, 0, 0, 0, 0, 0, 8, 9, 9, 0, 0,
135.2534 +         0, 0, 0, 0, 8, 9,10, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2535 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2536 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2537 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2538 +         0, 0, 0, 7, 9, 9, 0, 0, 0, 0, 0, 0, 9,11,11, 0,
135.2539 +         0, 0, 0, 0, 0, 9,10,11, 0, 0, 0, 0, 0, 0, 0, 0,
135.2540 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2541 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2542 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2543 +         0, 0, 0, 0, 7, 9,10, 0, 0, 0, 0, 0, 0, 9,11,11,
135.2544 +         0, 0, 0, 0, 0, 0, 8,11, 9, 0, 0, 0, 0, 0, 0, 0,
135.2545 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2546 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2547 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2548 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2549 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2550 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2551 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2552 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2553 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2554 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2555 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2556 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2557 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2558 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2559 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2560 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2561 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2562 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2563 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2564 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2565 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2566 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2567 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2568 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2569 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2570 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2571 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2572 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2573 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2574 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2575 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2576 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2577 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2578 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2579 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2580 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2581 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2582 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2583 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2584 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2585 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2586 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2587 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2588 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2589 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2590 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2591 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2592 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2593 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2594 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2595 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2596 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2597 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2598 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2599 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2600 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2601 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2602 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2603 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2604 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2605 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2606 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2607 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2608 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2609 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2610 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2611 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2612 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2613 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2614 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2615 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2616 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2617 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2618 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2619 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2620 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2621 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2622 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2623 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2624 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2625 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2626 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2627 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2628 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2629 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2630 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2631 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2632 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2633 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2634 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2635 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2636 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2637 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2638 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2639 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2640 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2641 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2642 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2643 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2644 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2645 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2646 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2647 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2648 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2649 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2650 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2651 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2652 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2653 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2654 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2655 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2656 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2657 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2658 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2659 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2660 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2661 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2662 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2663 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2664 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2665 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2666 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2667 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2668 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2669 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2670 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2671 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2672 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2673 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2674 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2675 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2676 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2677 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2678 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2679 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2680 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2681 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2682 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2683 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2684 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2685 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2686 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2687 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2688 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2689 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2690 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2691 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2692 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2693 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2694 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2695 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2696 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2697 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2698 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2699 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2700 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2701 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2702 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2703 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2704 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2705 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2706 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2707 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2708 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2709 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2710 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2711 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2712 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2713 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2714 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2715 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2716 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2717 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2718 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2719 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2720 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2721 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2722 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2723 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2724 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2725 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2726 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2727 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2728 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2729 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2730 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2731 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2732 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2733 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2734 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2735 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2736 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2737 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2738 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2739 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2740 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2741 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2742 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2743 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2744 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2745 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2746 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2747 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2748 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2749 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2750 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2751 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2752 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2753 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2754 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2755 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2756 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2757 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2758 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2759 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2760 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2761 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2762 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2763 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2764 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2765 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2766 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2767 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2768 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2769 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2770 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2771 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2772 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2773 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2774 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2775 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2776 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2777 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2778 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2779 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2780 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2781 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2782 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2783 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2784 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2785 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2786 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2787 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2788 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2789 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2790 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2791 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2792 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2793 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2794 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2795 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2796 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2797 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2798 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2799 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2800 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2801 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2802 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2803 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2804 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2805 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2806 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2807 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2808 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2809 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2810 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2811 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2812 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2813 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2814 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2815 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2816 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2817 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2818 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2819 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2820 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2821 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2822 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2823 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2824 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2825 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2826 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2827 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2828 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2829 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2830 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2831 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2832 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2833 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2834 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2835 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2836 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2837 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2838 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2839 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2840 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2841 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2842 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2843 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2844 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2845 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2846 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2847 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2848 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2849 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2850 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2851 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2852 +         0,
135.2853 +};
135.2854 +
135.2855 +static const static_codebook _8c0_s_p1_0 = {
135.2856 +        8, 6561,
135.2857 +        (long *)_vq_lengthlist__8c0_s_p1_0,
135.2858 +        1, -535822336, 1611661312, 2, 0,
135.2859 +        (long *)_vq_quantlist__8c0_s_p1_0,
135.2860 +        0
135.2861 +};
135.2862 +
135.2863 +static const long _vq_quantlist__8c0_s_p3_0[] = {
135.2864 +        2,
135.2865 +        1,
135.2866 +        3,
135.2867 +        0,
135.2868 +        4,
135.2869 +};
135.2870 +
135.2871 +static const long _vq_lengthlist__8c0_s_p3_0[] = {
135.2872 +         1, 4, 4, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2873 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, 6, 7, 7, 0, 0,
135.2874 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2875 +         0, 0, 4, 5, 5, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2876 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7, 7, 8, 8,
135.2877 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2878 +         0, 0, 0, 0, 6, 7, 7, 8, 8, 0, 0, 0, 0, 0, 0, 0,
135.2879 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2880 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2881 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2882 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2883 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2884 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2885 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2886 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2887 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2888 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2889 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2890 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2891 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2892 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2893 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2894 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2895 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2896 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2897 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2898 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2899 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2900 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2901 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2902 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2903 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2904 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2905 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2906 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2907 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2908 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2909 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2910 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2911 +         0,
135.2912 +};
135.2913 +
135.2914 +static const static_codebook _8c0_s_p3_0 = {
135.2915 +        4, 625,
135.2916 +        (long *)_vq_lengthlist__8c0_s_p3_0,
135.2917 +        1, -533725184, 1611661312, 3, 0,
135.2918 +        (long *)_vq_quantlist__8c0_s_p3_0,
135.2919 +        0
135.2920 +};
135.2921 +
135.2922 +static const long _vq_quantlist__8c0_s_p4_0[] = {
135.2923 +        4,
135.2924 +        3,
135.2925 +        5,
135.2926 +        2,
135.2927 +        6,
135.2928 +        1,
135.2929 +        7,
135.2930 +        0,
135.2931 +        8,
135.2932 +};
135.2933 +
135.2934 +static const long _vq_lengthlist__8c0_s_p4_0[] = {
135.2935 +         1, 2, 3, 7, 7, 0, 0, 0, 0, 0, 0, 0, 6, 6, 0, 0,
135.2936 +         0, 0, 0, 0, 0, 6, 6, 0, 0, 0, 0, 0, 0, 0, 7, 7,
135.2937 +         0, 0, 0, 0, 0, 0, 0, 7, 7, 0, 0, 0, 0, 0, 0, 0,
135.2938 +         8, 8, 0, 0, 0, 0, 0, 0, 0, 9, 8, 0, 0, 0, 0, 0,
135.2939 +         0, 0,10,10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.2940 +         0,
135.2941 +};
135.2942 +
135.2943 +static const static_codebook _8c0_s_p4_0 = {
135.2944 +        2, 81,
135.2945 +        (long *)_vq_lengthlist__8c0_s_p4_0,
135.2946 +        1, -531628032, 1611661312, 4, 0,
135.2947 +        (long *)_vq_quantlist__8c0_s_p4_0,
135.2948 +        0
135.2949 +};
135.2950 +
135.2951 +static const long _vq_quantlist__8c0_s_p5_0[] = {
135.2952 +        4,
135.2953 +        3,
135.2954 +        5,
135.2955 +        2,
135.2956 +        6,
135.2957 +        1,
135.2958 +        7,
135.2959 +        0,
135.2960 +        8,
135.2961 +};
135.2962 +
135.2963 +static const long _vq_lengthlist__8c0_s_p5_0[] = {
135.2964 +         1, 3, 3, 5, 5, 7, 6, 8, 8, 0, 0, 0, 7, 7, 7, 7,
135.2965 +         8, 8, 0, 0, 0, 7, 7, 7, 7, 8, 9, 0, 0, 0, 8, 8,
135.2966 +         8, 8, 9, 9, 0, 0, 0, 8, 8, 8, 8, 9, 9, 0, 0, 0,
135.2967 +         9, 9, 8, 8,10,10, 0, 0, 0, 9, 9, 8, 8,10,10, 0,
135.2968 +         0, 0,10,10, 9, 9,10,10, 0, 0, 0, 0, 0, 9, 9,10,
135.2969 +        10,
135.2970 +};
135.2971 +
135.2972 +static const static_codebook _8c0_s_p5_0 = {
135.2973 +        2, 81,
135.2974 +        (long *)_vq_lengthlist__8c0_s_p5_0,
135.2975 +        1, -531628032, 1611661312, 4, 0,
135.2976 +        (long *)_vq_quantlist__8c0_s_p5_0,
135.2977 +        0
135.2978 +};
135.2979 +
135.2980 +static const long _vq_quantlist__8c0_s_p6_0[] = {
135.2981 +        8,
135.2982 +        7,
135.2983 +        9,
135.2984 +        6,
135.2985 +        10,
135.2986 +        5,
135.2987 +        11,
135.2988 +        4,
135.2989 +        12,
135.2990 +        3,
135.2991 +        13,
135.2992 +        2,
135.2993 +        14,
135.2994 +        1,
135.2995 +        15,
135.2996 +        0,
135.2997 +        16,
135.2998 +};
135.2999 +
135.3000 +static const long _vq_lengthlist__8c0_s_p6_0[] = {
135.3001 +         1, 3, 3, 6, 6, 8, 8, 9, 9, 8, 8,10, 9,10,10,11,
135.3002 +        11, 0, 0, 0, 7, 7, 8, 8, 9, 9, 9, 9,10,10,11,11,
135.3003 +        11,12, 0, 0, 0, 7, 7, 8, 8, 9, 9, 9, 9,10,10,11,
135.3004 +        11,12,11, 0, 0, 0, 8, 8, 9, 9,10,10, 9, 9,10,10,
135.3005 +        11,11,12,12, 0, 0, 0, 8, 8, 9, 9,10,10, 9, 9,11,
135.3006 +        10,11,11,12,12, 0, 0, 0, 9, 9, 9, 9,10,10,10,10,
135.3007 +        11,11,11,12,12,12, 0, 0, 0, 9, 9, 9, 9,10,10,10,
135.3008 +        10,11,11,12,12,13,13, 0, 0, 0,10,10,10,10,11,11,
135.3009 +        10,10,11,11,12,12,13,13, 0, 0, 0, 0, 0,10, 9,10,
135.3010 +        11,10,10,11,11,12,12,13,13, 0, 0, 0, 0, 0, 9, 9,
135.3011 +        10, 9,10,11,12,12,13,13,14,13, 0, 0, 0, 0, 0, 9,
135.3012 +         9, 9,10,10,10,11,11,13,12,13,13, 0, 0, 0, 0, 0,
135.3013 +        10,10,10,10,11,11,12,12,13,13,14,14, 0, 0, 0, 0,
135.3014 +         0, 0, 0,10,10,11,11,12,12,13,13,13,14, 0, 0, 0,
135.3015 +         0, 0, 0, 0,11,11,11,11,12,12,13,14,14,14, 0, 0,
135.3016 +         0, 0, 0, 0, 0,11,11,11,11,12,12,13,13,14,13, 0,
135.3017 +         0, 0, 0, 0, 0, 0,11,11,12,12,13,13,14,14,14,14,
135.3018 +         0, 0, 0, 0, 0, 0, 0, 0, 0,12,12,12,12,13,13,14,
135.3019 +        14,
135.3020 +};
135.3021 +
135.3022 +static const static_codebook _8c0_s_p6_0 = {
135.3023 +        2, 289,
135.3024 +        (long *)_vq_lengthlist__8c0_s_p6_0,
135.3025 +        1, -529530880, 1611661312, 5, 0,
135.3026 +        (long *)_vq_quantlist__8c0_s_p6_0,
135.3027 +        0
135.3028 +};
135.3029 +
135.3030 +static const long _vq_quantlist__8c0_s_p7_0[] = {
135.3031 +        1,
135.3032 +        0,
135.3033 +        2,
135.3034 +};
135.3035 +
135.3036 +static const long _vq_lengthlist__8c0_s_p7_0[] = {
135.3037 +         1, 4, 4, 7, 6, 6, 7, 6, 6, 4, 7, 7,11, 9,10,12,
135.3038 +         9,10, 4, 7, 7,10,10,10,11, 9, 9, 6,11,10,11,11,
135.3039 +        12,11,11,11, 6,10,10,11,11,12,11,10,10, 6, 9,10,
135.3040 +        11,11,11,11,10,10, 7,10,11,12,11,11,12,11,12, 6,
135.3041 +         9, 9,10, 9, 9,11,10,10, 6, 9, 9,10,10,10,11,10,
135.3042 +        10,
135.3043 +};
135.3044 +
135.3045 +static const static_codebook _8c0_s_p7_0 = {
135.3046 +        4, 81,
135.3047 +        (long *)_vq_lengthlist__8c0_s_p7_0,
135.3048 +        1, -529137664, 1618345984, 2, 0,
135.3049 +        (long *)_vq_quantlist__8c0_s_p7_0,
135.3050 +        0
135.3051 +};
135.3052 +
135.3053 +static const long _vq_quantlist__8c0_s_p7_1[] = {
135.3054 +        5,
135.3055 +        4,
135.3056 +        6,
135.3057 +        3,
135.3058 +        7,
135.3059 +        2,
135.3060 +        8,
135.3061 +        1,
135.3062 +        9,
135.3063 +        0,
135.3064 +        10,
135.3065 +};
135.3066 +
135.3067 +static const long _vq_lengthlist__8c0_s_p7_1[] = {
135.3068 +         1, 3, 3, 6, 6, 8, 8, 9, 9, 9, 9,10,10,10, 7, 7,
135.3069 +         8, 8, 9, 9, 9, 9,10,10, 9, 7, 7, 8, 8, 9, 9, 9,
135.3070 +         9,10,10,10, 8, 8, 9, 9, 9, 9, 9, 9,10,10,10, 8,
135.3071 +         8, 9, 9, 9, 9, 8, 9,10,10,10, 8, 8, 9, 9, 9,10,
135.3072 +        10,10,10,10,10, 9, 9, 9, 9, 9, 9,10,10,11,10,11,
135.3073 +         9, 9, 9, 9,10,10,10,10,11,11,11,10,10, 9, 9,10,
135.3074 +        10,10, 9,11,10,10,10,10,10,10, 9, 9,10,10,11,11,
135.3075 +        10,10,10, 9, 9, 9,10,10,10,
135.3076 +};
135.3077 +
135.3078 +static const static_codebook _8c0_s_p7_1 = {
135.3079 +        2, 121,
135.3080 +        (long *)_vq_lengthlist__8c0_s_p7_1,
135.3081 +        1, -531365888, 1611661312, 4, 0,
135.3082 +        (long *)_vq_quantlist__8c0_s_p7_1,
135.3083 +        0
135.3084 +};
135.3085 +
135.3086 +static const long _vq_quantlist__8c0_s_p8_0[] = {
135.3087 +        6,
135.3088 +        5,
135.3089 +        7,
135.3090 +        4,
135.3091 +        8,
135.3092 +        3,
135.3093 +        9,
135.3094 +        2,
135.3095 +        10,
135.3096 +        1,
135.3097 +        11,
135.3098 +        0,
135.3099 +        12,
135.3100 +};
135.3101 +
135.3102 +static const long _vq_lengthlist__8c0_s_p8_0[] = {
135.3103 +         1, 4, 4, 7, 6, 7, 7, 7, 7, 8, 8, 9, 9, 7, 6, 6,
135.3104 +         7, 7, 8, 8, 7, 7, 8, 9,10,10, 7, 6, 6, 7, 7, 8,
135.3105 +         7, 7, 7, 9, 9,10,12, 0, 8, 8, 8, 8, 8, 9, 8, 8,
135.3106 +         9, 9,10,10, 0, 8, 8, 8, 8, 8, 9, 8, 9, 9, 9,11,
135.3107 +        10, 0, 0,13, 9, 8, 9, 9, 9, 9,10,10,11,11, 0,13,
135.3108 +         0, 9, 9, 9, 9, 9, 9,11,10,11,11, 0, 0, 0, 8, 9,
135.3109 +        10, 9,10,10,13,11,12,12, 0, 0, 0, 8, 9, 9, 9,10,
135.3110 +        10,13,12,12,13, 0, 0, 0,12, 0,10,10,12,11,10,11,
135.3111 +        12,12, 0, 0, 0,13,13,10,10,10,11,12, 0,13, 0, 0,
135.3112 +         0, 0, 0, 0,13,11, 0,12,12,12,13,12, 0, 0, 0, 0,
135.3113 +         0, 0,13,13,11,13,13,11,12,
135.3114 +};
135.3115 +
135.3116 +static const static_codebook _8c0_s_p8_0 = {
135.3117 +        2, 169,
135.3118 +        (long *)_vq_lengthlist__8c0_s_p8_0,
135.3119 +        1, -526516224, 1616117760, 4, 0,
135.3120 +        (long *)_vq_quantlist__8c0_s_p8_0,
135.3121 +        0
135.3122 +};
135.3123 +
135.3124 +static const long _vq_quantlist__8c0_s_p8_1[] = {
135.3125 +        2,
135.3126 +        1,
135.3127 +        3,
135.3128 +        0,
135.3129 +        4,
135.3130 +};
135.3131 +
135.3132 +static const long _vq_lengthlist__8c0_s_p8_1[] = {
135.3133 +         1, 3, 4, 5, 5, 7, 6, 6, 6, 5, 7, 7, 7, 6, 6, 7,
135.3134 +         7, 7, 6, 6, 7, 7, 7, 6, 6,
135.3135 +};
135.3136 +
135.3137 +static const static_codebook _8c0_s_p8_1 = {
135.3138 +        2, 25,
135.3139 +        (long *)_vq_lengthlist__8c0_s_p8_1,
135.3140 +        1, -533725184, 1611661312, 3, 0,
135.3141 +        (long *)_vq_quantlist__8c0_s_p8_1,
135.3142 +        0
135.3143 +};
135.3144 +
135.3145 +static const long _vq_quantlist__8c0_s_p9_0[] = {
135.3146 +        1,
135.3147 +        0,
135.3148 +        2,
135.3149 +};
135.3150 +
135.3151 +static const long _vq_lengthlist__8c0_s_p9_0[] = {
135.3152 +         1, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
135.3153 +         8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
135.3154 +         8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
135.3155 +         7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
135.3156 +         7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
135.3157 +         7,
135.3158 +};
135.3159 +
135.3160 +static const static_codebook _8c0_s_p9_0 = {
135.3161 +        4, 81,
135.3162 +        (long *)_vq_lengthlist__8c0_s_p9_0,
135.3163 +        1, -518803456, 1628680192, 2, 0,
135.3164 +        (long *)_vq_quantlist__8c0_s_p9_0,
135.3165 +        0
135.3166 +};
135.3167 +
135.3168 +static const long _vq_quantlist__8c0_s_p9_1[] = {
135.3169 +        7,
135.3170 +        6,
135.3171 +        8,
135.3172 +        5,
135.3173 +        9,
135.3174 +        4,
135.3175 +        10,
135.3176 +        3,
135.3177 +        11,
135.3178 +        2,
135.3179 +        12,
135.3180 +        1,
135.3181 +        13,
135.3182 +        0,
135.3183 +        14,
135.3184 +};
135.3185 +
135.3186 +static const long _vq_lengthlist__8c0_s_p9_1[] = {
135.3187 +         1, 4, 4, 5, 5,10, 8,11,11,11,11,11,11,11,11, 6,
135.3188 +         6, 6, 7, 6,11,10,11,11,11,11,11,11,11,11, 7, 5,
135.3189 +         6, 6, 6, 8, 7,11,11,11,11,11,11,11,11,11, 7, 8,
135.3190 +         8, 8, 9, 9,11,11,11,11,11,11,11,11,11, 9, 8, 7,
135.3191 +         8, 9,11,11,11,11,11,11,11,11,11,11,11,10,11,11,
135.3192 +        11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,
135.3193 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.3194 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.3195 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.3196 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.3197 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.3198 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.3199 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.3200 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.3201 +        11,
135.3202 +};
135.3203 +
135.3204 +static const static_codebook _8c0_s_p9_1 = {
135.3205 +        2, 225,
135.3206 +        (long *)_vq_lengthlist__8c0_s_p9_1,
135.3207 +        1, -520986624, 1620377600, 4, 0,
135.3208 +        (long *)_vq_quantlist__8c0_s_p9_1,
135.3209 +        0
135.3210 +};
135.3211 +
135.3212 +static const long _vq_quantlist__8c0_s_p9_2[] = {
135.3213 +        10,
135.3214 +        9,
135.3215 +        11,
135.3216 +        8,
135.3217 +        12,
135.3218 +        7,
135.3219 +        13,
135.3220 +        6,
135.3221 +        14,
135.3222 +        5,
135.3223 +        15,
135.3224 +        4,
135.3225 +        16,
135.3226 +        3,
135.3227 +        17,
135.3228 +        2,
135.3229 +        18,
135.3230 +        1,
135.3231 +        19,
135.3232 +        0,
135.3233 +        20,
135.3234 +};
135.3235 +
135.3236 +static const long _vq_lengthlist__8c0_s_p9_2[] = {
135.3237 +         1, 5, 5, 7, 7, 8, 7, 8, 8,10,10, 9, 9,10,10,10,
135.3238 +        11,11,10,12,11,12,12,12, 9, 8, 8, 8, 8, 8, 9,10,
135.3239 +        10,10,10,11,11,11,10,11,11,12,12,11,12, 8, 8, 7,
135.3240 +         7, 8, 9,10,10,10, 9,10,10, 9,10,10,11,11,11,11,
135.3241 +        11,11, 9, 9, 9, 9, 8, 9,10,10,11,10,10,11,11,12,
135.3242 +        10,10,12,12,11,11,10, 9, 9,10, 8, 9,10,10,10, 9,
135.3243 +        10,10,11,11,10,11,10,10,10,12,12,12, 9,10, 9,10,
135.3244 +         9, 9,10,10,11,11,11,11,10,10,10,11,12,11,12,11,
135.3245 +        12,10,11,10,11, 9,10, 9,10, 9,10,10, 9,10,10,11,
135.3246 +        10,11,11,11,11,12,11, 9,10,10,10,10,11,11,11,11,
135.3247 +        11,10,11,11,11,11,10,12,10,12,12,11,12,10,10,11,
135.3248 +        10, 9,11,10,11, 9,10,11,10,10,10,11,11,11,11,12,
135.3249 +        12,10, 9, 9,11,10, 9,12,11,10,12,12,11,11,11,11,
135.3250 +        10,11,11,12,11,10,12, 9,11,10,11,10,10,11,10,11,
135.3251 +         9,10,10,10,11,12,11,11,12,11,10,10,11,11, 9,10,
135.3252 +        10,12,10,11,10,10,10, 9,10,10,10,10, 9,10,10,11,
135.3253 +        11,11,11,12,11,10,10,10,10,11,11,10,11,11, 9,11,
135.3254 +        10,12,10,12,11,10,11,10,10,10,11,10,10,11,11,10,
135.3255 +        11,10,10,10,10,11,11,12,10,10,10,11,10,11,12,11,
135.3256 +        10,11,10,10,11,11,10,12,10, 9,10,10,11,11,11,10,
135.3257 +        12,10,10,11,11,11,10,10,11,10,10,10,11,10,11,10,
135.3258 +        12,11,11,10,10,10,12,10,10,11, 9,10,11,11,11,10,
135.3259 +        10,11,10,10, 9,11,11,12,12,11,12,11,11,11,11,11,
135.3260 +        11, 9,10,11,10,12,10,10,10,10,11,10,10,11,10,10,
135.3261 +        12,10,10,10,10,10, 9,12,10,10,10,10,12, 9,11,10,
135.3262 +        10,11,10,12,12,10,12,12,12,10,10,10,10, 9,10,11,
135.3263 +        10,10,12,10,10,12,11,10,11,10,10,12,11,10,12,10,
135.3264 +        10,11, 9,11,10, 9,10, 9,10,
135.3265 +};
135.3266 +
135.3267 +static const static_codebook _8c0_s_p9_2 = {
135.3268 +        2, 441,
135.3269 +        (long *)_vq_lengthlist__8c0_s_p9_2,
135.3270 +        1, -529268736, 1611661312, 5, 0,
135.3271 +        (long *)_vq_quantlist__8c0_s_p9_2,
135.3272 +        0
135.3273 +};
135.3274 +
135.3275 +static const long _huff_lengthlist__8c0_s_single[] = {
135.3276 +         4, 5,18, 7,10, 6, 7, 8, 9,10, 5, 2,18, 5, 7, 5,
135.3277 +         6, 7, 8,11,17,17,17,17,17,17,17,17,17,17, 7, 4,
135.3278 +        17, 6, 9, 6, 8,10,12,15,11, 7,17, 9, 6, 6, 7, 9,
135.3279 +        11,15, 6, 4,17, 6, 6, 4, 5, 8,11,16, 6, 6,17, 8,
135.3280 +         6, 5, 6, 9,13,16, 8, 9,17,11, 9, 8, 8,11,13,17,
135.3281 +         9,12,17,15,14,13,12,13,14,17,12,15,17,17,17,17,
135.3282 +        17,16,17,17,
135.3283 +};
135.3284 +
135.3285 +static const static_codebook _huff_book__8c0_s_single = {
135.3286 +        2, 100,
135.3287 +        (long *)_huff_lengthlist__8c0_s_single,
135.3288 +        0, 0, 0, 0, 0,
135.3289 +        NULL,
135.3290 +        0
135.3291 +};
135.3292 +
135.3293 +static const long _vq_quantlist__8c1_s_p1_0[] = {
135.3294 +        1,
135.3295 +        0,
135.3296 +        2,
135.3297 +};
135.3298 +
135.3299 +static const long _vq_lengthlist__8c1_s_p1_0[] = {
135.3300 +         1, 5, 5, 0, 0, 0, 0, 0, 0, 5, 7, 7, 0, 0, 0, 0,
135.3301 +         0, 0, 5, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3302 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3303 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3304 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3305 +         0, 5, 8, 7, 0, 0, 0, 0, 0, 0, 7, 8, 9, 0, 0, 0,
135.3306 +         0, 0, 0, 7, 8, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3307 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3308 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3309 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3310 +         0, 0, 5, 7, 8, 0, 0, 0, 0, 0, 0, 7, 9, 8, 0, 0,
135.3311 +         0, 0, 0, 0, 7, 9, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3312 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3313 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3314 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3315 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3316 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3317 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3318 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3319 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3320 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3321 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3322 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3323 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3324 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3325 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3326 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3327 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3328 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3329 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3330 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3331 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3332 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3333 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3334 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3335 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3336 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3337 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3338 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3339 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3340 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3341 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3342 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3343 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3344 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3345 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 8, 8, 0, 0, 0, 0,
135.3346 +         0, 0, 8, 9, 9, 0, 0, 0, 0, 0, 0, 8, 9, 9, 0, 0,
135.3347 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3348 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3349 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3350 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 9, 9, 0, 0, 0,
135.3351 +         0, 0, 0, 8, 8,10, 0, 0, 0, 0, 0, 0, 9,10,10, 0,
135.3352 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3353 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3354 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3355 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 9, 9, 0, 0,
135.3356 +         0, 0, 0, 0, 8,10, 9, 0, 0, 0, 0, 0, 0, 9,10,10,
135.3357 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3358 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3359 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3360 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3361 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3362 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3363 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3364 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3365 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3366 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3367 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3368 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3369 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3370 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3371 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3372 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3373 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3374 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3375 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3376 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3377 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3378 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3379 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3380 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3381 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3382 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3383 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3384 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3385 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3386 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3387 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3388 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3389 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3390 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3391 +         0, 0, 5, 8, 8, 0, 0, 0, 0, 0, 0, 8, 9, 9, 0, 0,
135.3392 +         0, 0, 0, 0, 8, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3393 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3394 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3395 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3396 +         0, 0, 0, 7, 9, 9, 0, 0, 0, 0, 0, 0, 9,10,10, 0,
135.3397 +         0, 0, 0, 0, 0, 8, 9,10, 0, 0, 0, 0, 0, 0, 0, 0,
135.3398 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3399 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3400 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3401 +         0, 0, 0, 0, 7, 9, 9, 0, 0, 0, 0, 0, 0, 9,10,10,
135.3402 +         0, 0, 0, 0, 0, 0, 8,10, 8, 0, 0, 0, 0, 0, 0, 0,
135.3403 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3404 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3405 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3406 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3407 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3408 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3409 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3410 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3411 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3412 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3413 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3414 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3415 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3416 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3417 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3418 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3419 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3420 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3421 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3422 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3423 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3424 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3425 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3426 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3427 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3428 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3429 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3430 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3431 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3432 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3433 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3434 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3435 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3436 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3437 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3438 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3439 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3440 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3441 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3442 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3443 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3444 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3445 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3446 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3447 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3448 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3449 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3450 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3451 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3452 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3453 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3454 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3455 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3456 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3457 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3458 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3459 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3460 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3461 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3462 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3463 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3464 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3465 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3466 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3467 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3468 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3469 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3470 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3471 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3472 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3473 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3474 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3475 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3476 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3477 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3478 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3479 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3480 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3481 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3482 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3483 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3484 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3485 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3486 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3487 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3488 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3489 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3490 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3491 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3492 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3493 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3494 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3495 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3496 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3497 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3498 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3499 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3500 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3501 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3502 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3503 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3504 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3505 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3506 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3507 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3508 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3509 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3510 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3511 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3512 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3513 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3514 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3515 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3516 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3517 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3518 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3519 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3520 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3521 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3522 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3523 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3524 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3525 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3526 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3527 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3528 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3529 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3530 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3531 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3532 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3533 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3534 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3535 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3536 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3537 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3538 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3539 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3540 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3541 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3542 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3543 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3544 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3545 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3546 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3547 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3548 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3549 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3550 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3551 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3552 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3553 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3554 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3555 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3556 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3557 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3558 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3559 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3560 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3561 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3562 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3563 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3564 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3565 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3566 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3567 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3568 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3569 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3570 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3571 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3572 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3573 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3574 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3575 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3576 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3577 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3578 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3579 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3580 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3581 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3582 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3583 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3584 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3585 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3586 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3587 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3588 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3589 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3590 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3591 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3592 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3593 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3594 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3595 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3596 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3597 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3598 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3599 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3600 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3601 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3602 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3603 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3604 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3605 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3606 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3607 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3608 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3609 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3610 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3611 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3612 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3613 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3614 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3615 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3616 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3617 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3618 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3619 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3620 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3621 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3622 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3623 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3624 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3625 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3626 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3627 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3628 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3629 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3630 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3631 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3632 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3633 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3634 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3635 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3636 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3637 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3638 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3639 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3640 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3641 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3642 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3643 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3644 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3645 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3646 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3647 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3648 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3649 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3650 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3651 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3652 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3653 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3654 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3655 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3656 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3657 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3658 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3659 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3660 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3661 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3662 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3663 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3664 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3665 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3666 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3667 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3668 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3669 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3670 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3671 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3672 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3673 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3674 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3675 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3676 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3677 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3678 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3679 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3680 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3681 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3682 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3683 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3684 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3685 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3686 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3687 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3688 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3689 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3690 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3691 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3692 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3693 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3694 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3695 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3696 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3697 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3698 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3699 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3700 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3701 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3702 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3703 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3704 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3705 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3706 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3707 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3708 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3709 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3710 +         0,
135.3711 +};
135.3712 +
135.3713 +static const static_codebook _8c1_s_p1_0 = {
135.3714 +        8, 6561,
135.3715 +        (long *)_vq_lengthlist__8c1_s_p1_0,
135.3716 +        1, -535822336, 1611661312, 2, 0,
135.3717 +        (long *)_vq_quantlist__8c1_s_p1_0,
135.3718 +        0
135.3719 +};
135.3720 +
135.3721 +static const long _vq_quantlist__8c1_s_p3_0[] = {
135.3722 +        2,
135.3723 +        1,
135.3724 +        3,
135.3725 +        0,
135.3726 +        4,
135.3727 +};
135.3728 +
135.3729 +static const long _vq_lengthlist__8c1_s_p3_0[] = {
135.3730 +         2, 4, 4, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3731 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 6, 6, 0, 0,
135.3732 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3733 +         0, 0, 4, 4, 4, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3734 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 6, 7, 7,
135.3735 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3736 +         0, 0, 0, 0, 6, 6, 6, 7, 7, 0, 0, 0, 0, 0, 0, 0,
135.3737 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3738 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3739 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3740 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3741 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3742 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3743 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3744 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3745 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3746 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3747 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3748 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3749 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3750 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3751 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3752 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3753 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3754 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3755 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3756 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3757 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3758 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3759 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3760 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3761 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3762 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3763 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3764 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3765 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3766 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3767 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3768 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3769 +         0,
135.3770 +};
135.3771 +
135.3772 +static const static_codebook _8c1_s_p3_0 = {
135.3773 +        4, 625,
135.3774 +        (long *)_vq_lengthlist__8c1_s_p3_0,
135.3775 +        1, -533725184, 1611661312, 3, 0,
135.3776 +        (long *)_vq_quantlist__8c1_s_p3_0,
135.3777 +        0
135.3778 +};
135.3779 +
135.3780 +static const long _vq_quantlist__8c1_s_p4_0[] = {
135.3781 +        4,
135.3782 +        3,
135.3783 +        5,
135.3784 +        2,
135.3785 +        6,
135.3786 +        1,
135.3787 +        7,
135.3788 +        0,
135.3789 +        8,
135.3790 +};
135.3791 +
135.3792 +static const long _vq_lengthlist__8c1_s_p4_0[] = {
135.3793 +         1, 2, 3, 7, 7, 0, 0, 0, 0, 0, 0, 0, 6, 6, 0, 0,
135.3794 +         0, 0, 0, 0, 0, 6, 6, 0, 0, 0, 0, 0, 0, 0, 7, 7,
135.3795 +         0, 0, 0, 0, 0, 0, 0, 7, 7, 0, 0, 0, 0, 0, 0, 0,
135.3796 +         8, 8, 0, 0, 0, 0, 0, 0, 0, 9, 8, 0, 0, 0, 0, 0,
135.3797 +         0, 0,10,10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.3798 +         0,
135.3799 +};
135.3800 +
135.3801 +static const static_codebook _8c1_s_p4_0 = {
135.3802 +        2, 81,
135.3803 +        (long *)_vq_lengthlist__8c1_s_p4_0,
135.3804 +        1, -531628032, 1611661312, 4, 0,
135.3805 +        (long *)_vq_quantlist__8c1_s_p4_0,
135.3806 +        0
135.3807 +};
135.3808 +
135.3809 +static const long _vq_quantlist__8c1_s_p5_0[] = {
135.3810 +        4,
135.3811 +        3,
135.3812 +        5,
135.3813 +        2,
135.3814 +        6,
135.3815 +        1,
135.3816 +        7,
135.3817 +        0,
135.3818 +        8,
135.3819 +};
135.3820 +
135.3821 +static const long _vq_lengthlist__8c1_s_p5_0[] = {
135.3822 +         1, 3, 3, 4, 5, 6, 6, 8, 8, 0, 0, 0, 8, 8, 7, 7,
135.3823 +         9, 9, 0, 0, 0, 8, 8, 7, 7, 9, 9, 0, 0, 0, 9,10,
135.3824 +         8, 8, 9, 9, 0, 0, 0,10,10, 8, 8, 9, 9, 0, 0, 0,
135.3825 +        11,10, 8, 8,10,10, 0, 0, 0,11,11, 8, 8,10,10, 0,
135.3826 +         0, 0,12,12, 9, 9,10,10, 0, 0, 0, 0, 0, 9, 9,10,
135.3827 +        10,
135.3828 +};
135.3829 +
135.3830 +static const static_codebook _8c1_s_p5_0 = {
135.3831 +        2, 81,
135.3832 +        (long *)_vq_lengthlist__8c1_s_p5_0,
135.3833 +        1, -531628032, 1611661312, 4, 0,
135.3834 +        (long *)_vq_quantlist__8c1_s_p5_0,
135.3835 +        0
135.3836 +};
135.3837 +
135.3838 +static const long _vq_quantlist__8c1_s_p6_0[] = {
135.3839 +        8,
135.3840 +        7,
135.3841 +        9,
135.3842 +        6,
135.3843 +        10,
135.3844 +        5,
135.3845 +        11,
135.3846 +        4,
135.3847 +        12,
135.3848 +        3,
135.3849 +        13,
135.3850 +        2,
135.3851 +        14,
135.3852 +        1,
135.3853 +        15,
135.3854 +        0,
135.3855 +        16,
135.3856 +};
135.3857 +
135.3858 +static const long _vq_lengthlist__8c1_s_p6_0[] = {
135.3859 +         1, 3, 3, 5, 5, 8, 8, 8, 8, 9, 9,10,10,11,11,11,
135.3860 +        11, 0, 0, 0, 8, 8, 8, 8, 9, 9, 9, 9,10,10,11,11,
135.3861 +        12,12, 0, 0, 0, 8, 8, 8, 8, 9, 9, 9, 9,10,10,11,
135.3862 +        11,12,12, 0, 0, 0, 9, 9, 8, 8,10,10,10,10,11,11,
135.3863 +        12,12,12,12, 0, 0, 0, 9, 9, 8, 8,10,10,10,10,11,
135.3864 +        11,12,12,12,12, 0, 0, 0,10,10, 9, 9,10,10,10,10,
135.3865 +        11,11,12,12,13,13, 0, 0, 0,10,10, 9, 9,10,10,10,
135.3866 +        10,11,11,12,12,13,13, 0, 0, 0,11,11, 9, 9,10,10,
135.3867 +        10,10,11,11,12,12,13,13, 0, 0, 0, 0, 0, 9, 9,10,
135.3868 +        10,10,10,11,11,12,12,13,13, 0, 0, 0, 0, 0, 9, 9,
135.3869 +        10,10,11,11,12,12,12,12,13,13, 0, 0, 0, 0, 0, 9,
135.3870 +         9,10,10,11,11,12,11,12,12,13,13, 0, 0, 0, 0, 0,
135.3871 +        10,10,11,11,11,11,12,12,13,12,13,13, 0, 0, 0, 0,
135.3872 +         0, 0, 0,11,10,11,11,12,12,13,13,13,13, 0, 0, 0,
135.3873 +         0, 0, 0, 0,11,11,12,12,12,12,13,13,13,14, 0, 0,
135.3874 +         0, 0, 0, 0, 0,11,11,12,12,12,12,13,13,14,13, 0,
135.3875 +         0, 0, 0, 0, 0, 0,12,12,12,12,13,13,13,13,14,14,
135.3876 +         0, 0, 0, 0, 0, 0, 0, 0, 0,12,12,13,13,13,13,14,
135.3877 +        14,
135.3878 +};
135.3879 +
135.3880 +static const static_codebook _8c1_s_p6_0 = {
135.3881 +        2, 289,
135.3882 +        (long *)_vq_lengthlist__8c1_s_p6_0,
135.3883 +        1, -529530880, 1611661312, 5, 0,
135.3884 +        (long *)_vq_quantlist__8c1_s_p6_0,
135.3885 +        0
135.3886 +};
135.3887 +
135.3888 +static const long _vq_quantlist__8c1_s_p7_0[] = {
135.3889 +        1,
135.3890 +        0,
135.3891 +        2,
135.3892 +};
135.3893 +
135.3894 +static const long _vq_lengthlist__8c1_s_p7_0[] = {
135.3895 +         1, 4, 4, 6, 6, 6, 7, 6, 6, 4, 7, 7,10, 9, 9,10,
135.3896 +         9, 9, 5, 7, 7,10, 9, 9,10, 9, 9, 6,10,10,10,10,
135.3897 +        10,11,10,10, 6, 9, 9,10, 9,10,11,10,10, 6, 9, 9,
135.3898 +        10, 9, 9,11, 9,10, 7,10,10,11,11,11,11,10,10, 6,
135.3899 +         9, 9,10,10,10,11, 9, 9, 6, 9, 9,10,10,10,10, 9,
135.3900 +         9,
135.3901 +};
135.3902 +
135.3903 +static const static_codebook _8c1_s_p7_0 = {
135.3904 +        4, 81,
135.3905 +        (long *)_vq_lengthlist__8c1_s_p7_0,
135.3906 +        1, -529137664, 1618345984, 2, 0,
135.3907 +        (long *)_vq_quantlist__8c1_s_p7_0,
135.3908 +        0
135.3909 +};
135.3910 +
135.3911 +static const long _vq_quantlist__8c1_s_p7_1[] = {
135.3912 +        5,
135.3913 +        4,
135.3914 +        6,
135.3915 +        3,
135.3916 +        7,
135.3917 +        2,
135.3918 +        8,
135.3919 +        1,
135.3920 +        9,
135.3921 +        0,
135.3922 +        10,
135.3923 +};
135.3924 +
135.3925 +static const long _vq_lengthlist__8c1_s_p7_1[] = {
135.3926 +         2, 3, 3, 5, 5, 7, 7, 7, 7, 7, 7,10,10, 9, 7, 7,
135.3927 +         7, 7, 8, 8, 8, 8, 9, 9, 9, 7, 7, 7, 7, 8, 8, 8,
135.3928 +         8,10,10,10, 7, 7, 7, 7, 8, 8, 8, 8,10,10,10, 7,
135.3929 +         7, 7, 7, 8, 8, 8, 8,10,10,10, 8, 8, 8, 8, 8, 8,
135.3930 +         8, 8,10,10,10, 8, 8, 8, 8, 8, 8, 8, 8,10,10,10,
135.3931 +         8, 8, 8, 8, 8, 8, 8, 8,10,10,10,10,10, 8, 8, 8,
135.3932 +         8, 8, 8,10,10,10,10,10, 8, 8, 8, 8, 8, 8,10,10,
135.3933 +        10,10,10, 8, 8, 8, 8, 8, 8,
135.3934 +};
135.3935 +
135.3936 +static const static_codebook _8c1_s_p7_1 = {
135.3937 +        2, 121,
135.3938 +        (long *)_vq_lengthlist__8c1_s_p7_1,
135.3939 +        1, -531365888, 1611661312, 4, 0,
135.3940 +        (long *)_vq_quantlist__8c1_s_p7_1,
135.3941 +        0
135.3942 +};
135.3943 +
135.3944 +static const long _vq_quantlist__8c1_s_p8_0[] = {
135.3945 +        6,
135.3946 +        5,
135.3947 +        7,
135.3948 +        4,
135.3949 +        8,
135.3950 +        3,
135.3951 +        9,
135.3952 +        2,
135.3953 +        10,
135.3954 +        1,
135.3955 +        11,
135.3956 +        0,
135.3957 +        12,
135.3958 +};
135.3959 +
135.3960 +static const long _vq_lengthlist__8c1_s_p8_0[] = {
135.3961 +         1, 4, 4, 6, 6, 8, 8, 8, 8, 9, 9,10,10, 7, 5, 5,
135.3962 +         7, 7, 8, 8, 8, 8, 9,10,11,11, 7, 5, 5, 7, 7, 8,
135.3963 +         8, 9, 9,10,10,11,11, 0, 8, 8, 8, 8, 9, 9, 9, 9,
135.3964 +         9,10,11,11, 0, 8, 8, 8, 8, 9, 9, 9, 9,10,10,11,
135.3965 +        11, 0,12,12, 9, 9, 9, 9,10, 9,10,11,11,11, 0,13,
135.3966 +        12, 9, 8, 9, 9,10,10,11,11,12,11, 0, 0, 0, 9, 9,
135.3967 +         9, 9,10,10,11,11,12,12, 0, 0, 0,10,10, 9, 9,10,
135.3968 +        10,11,11,12,12, 0, 0, 0,13,13,10,10,11,11,12,11,
135.3969 +        13,12, 0, 0, 0,14,14,10,10,11,10,11,11,12,12, 0,
135.3970 +         0, 0, 0, 0,12,12,11,11,12,12,13,13, 0, 0, 0, 0,
135.3971 +         0,12,12,11,10,12,11,13,12,
135.3972 +};
135.3973 +
135.3974 +static const static_codebook _8c1_s_p8_0 = {
135.3975 +        2, 169,
135.3976 +        (long *)_vq_lengthlist__8c1_s_p8_0,
135.3977 +        1, -526516224, 1616117760, 4, 0,
135.3978 +        (long *)_vq_quantlist__8c1_s_p8_0,
135.3979 +        0
135.3980 +};
135.3981 +
135.3982 +static const long _vq_quantlist__8c1_s_p8_1[] = {
135.3983 +        2,
135.3984 +        1,
135.3985 +        3,
135.3986 +        0,
135.3987 +        4,
135.3988 +};
135.3989 +
135.3990 +static const long _vq_lengthlist__8c1_s_p8_1[] = {
135.3991 +         2, 3, 3, 5, 5, 6, 6, 6, 5, 5, 6, 6, 6, 5, 5, 6,
135.3992 +         6, 6, 5, 5, 6, 6, 6, 5, 5,
135.3993 +};
135.3994 +
135.3995 +static const static_codebook _8c1_s_p8_1 = {
135.3996 +        2, 25,
135.3997 +        (long *)_vq_lengthlist__8c1_s_p8_1,
135.3998 +        1, -533725184, 1611661312, 3, 0,
135.3999 +        (long *)_vq_quantlist__8c1_s_p8_1,
135.4000 +        0
135.4001 +};
135.4002 +
135.4003 +static const long _vq_quantlist__8c1_s_p9_0[] = {
135.4004 +        6,
135.4005 +        5,
135.4006 +        7,
135.4007 +        4,
135.4008 +        8,
135.4009 +        3,
135.4010 +        9,
135.4011 +        2,
135.4012 +        10,
135.4013 +        1,
135.4014 +        11,
135.4015 +        0,
135.4016 +        12,
135.4017 +};
135.4018 +
135.4019 +static const long _vq_lengthlist__8c1_s_p9_0[] = {
135.4020 +         1, 3, 3,10,10,10,10,10,10,10,10,10,10, 5, 6, 6,
135.4021 +        10,10,10,10,10,10,10,10,10,10, 6, 7, 8,10,10,10,
135.4022 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.4023 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.4024 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.4025 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.4026 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.4027 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.4028 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.4029 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.4030 +        10,10,10,10,10, 9, 9, 9, 9,
135.4031 +};
135.4032 +
135.4033 +static const static_codebook _8c1_s_p9_0 = {
135.4034 +        2, 169,
135.4035 +        (long *)_vq_lengthlist__8c1_s_p9_0,
135.4036 +        1, -513964032, 1628680192, 4, 0,
135.4037 +        (long *)_vq_quantlist__8c1_s_p9_0,
135.4038 +        0
135.4039 +};
135.4040 +
135.4041 +static const long _vq_quantlist__8c1_s_p9_1[] = {
135.4042 +        7,
135.4043 +        6,
135.4044 +        8,
135.4045 +        5,
135.4046 +        9,
135.4047 +        4,
135.4048 +        10,
135.4049 +        3,
135.4050 +        11,
135.4051 +        2,
135.4052 +        12,
135.4053 +        1,
135.4054 +        13,
135.4055 +        0,
135.4056 +        14,
135.4057 +};
135.4058 +
135.4059 +static const long _vq_lengthlist__8c1_s_p9_1[] = {
135.4060 +         1, 4, 4, 5, 5, 7, 7, 9, 9,11,11,12,12,13,13, 6,
135.4061 +         5, 5, 6, 6, 9, 9,10,10,12,12,12,13,15,14, 6, 5,
135.4062 +         5, 7, 7, 9, 9,10,10,12,12,12,13,14,13,17, 7, 7,
135.4063 +         8, 8,10,10,11,11,12,13,13,13,13,13,17, 7, 7, 8,
135.4064 +         8,10,10,11,11,13,13,13,13,14,14,17,11,11, 9, 9,
135.4065 +        11,11,12,12,12,13,13,14,15,13,17,12,12, 9, 9,11,
135.4066 +        11,12,12,13,13,13,13,14,16,17,17,17,11,12,12,12,
135.4067 +        13,13,13,14,15,14,15,15,17,17,17,12,12,11,11,13,
135.4068 +        13,14,14,15,14,15,15,17,17,17,15,15,13,13,14,14,
135.4069 +        15,14,15,15,16,15,17,17,17,15,15,13,13,13,14,14,
135.4070 +        15,15,15,15,16,17,17,17,17,16,14,15,14,14,15,14,
135.4071 +        14,15,15,15,17,17,17,17,17,14,14,16,14,15,15,15,
135.4072 +        15,15,15,17,17,17,17,17,17,16,16,15,17,15,15,14,
135.4073 +        17,15,17,16,17,17,17,17,16,15,14,15,15,15,15,15,
135.4074 +        15,
135.4075 +};
135.4076 +
135.4077 +static const static_codebook _8c1_s_p9_1 = {
135.4078 +        2, 225,
135.4079 +        (long *)_vq_lengthlist__8c1_s_p9_1,
135.4080 +        1, -520986624, 1620377600, 4, 0,
135.4081 +        (long *)_vq_quantlist__8c1_s_p9_1,
135.4082 +        0
135.4083 +};
135.4084 +
135.4085 +static const long _vq_quantlist__8c1_s_p9_2[] = {
135.4086 +        10,
135.4087 +        9,
135.4088 +        11,
135.4089 +        8,
135.4090 +        12,
135.4091 +        7,
135.4092 +        13,
135.4093 +        6,
135.4094 +        14,
135.4095 +        5,
135.4096 +        15,
135.4097 +        4,
135.4098 +        16,
135.4099 +        3,
135.4100 +        17,
135.4101 +        2,
135.4102 +        18,
135.4103 +        1,
135.4104 +        19,
135.4105 +        0,
135.4106 +        20,
135.4107 +};
135.4108 +
135.4109 +static const long _vq_lengthlist__8c1_s_p9_2[] = {
135.4110 +         2, 4, 4, 6, 6, 7, 7, 8, 8, 8, 8, 9, 8, 9, 9, 9,
135.4111 +         9, 9, 9, 9, 9,11,11,12, 7, 7, 7, 7, 8, 8, 9, 9,
135.4112 +         9, 9,10,10,10,10,10,10,10,10,11,11,11, 7, 7, 7,
135.4113 +         7, 8, 8, 9, 8, 9, 9, 9, 9, 9, 9,10,10,10,10,11,
135.4114 +        11,12, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9,10,10,10,10,
135.4115 +        10,10,10,10,11,11,11, 7, 7, 8, 8, 8, 8, 9, 9, 9,
135.4116 +         9,10,10,10,10,10,10,10,10,11,11,11, 8, 8, 8, 8,
135.4117 +         9, 9, 9, 9, 9, 9,10,10,10,10,10,10,10,10,11,11,
135.4118 +        11, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9,10,10,10,10,10,
135.4119 +        10,10,10,11,12,11, 9, 9, 8, 9, 9, 9, 9, 9,10,10,
135.4120 +        10,10,10,10,10,10,10,10,11,11,11,11,11, 8, 8, 9,
135.4121 +         9, 9, 9,10,10,10,10,10,10,10,10,10,10,11,12,11,
135.4122 +        12,11, 9, 9, 9, 9, 9,10,10,10,10,10,10,10,10,10,
135.4123 +        10,10,11,11,11,11,11, 9, 9, 9, 9,10,10,10,10,10,
135.4124 +        10,10,10,10,10,10,10,12,11,12,11,11, 9, 9, 9,10,
135.4125 +        10,10,10,10,10,10,10,10,10,10,10,10,12,11,11,11,
135.4126 +        11,11,11,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.4127 +        11,11,11,12,11,11,12,11,10,10,10,10,10,10,10,10,
135.4128 +        10,10,10,10,11,10,11,11,11,11,11,11,11,10,10,10,
135.4129 +        10,10,10,10,10,10,10,10,10,10,10,11,11,12,11,12,
135.4130 +        11,11,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.4131 +        11,11,12,11,12,11,11,11,11,10,10,10,10,10,10,10,
135.4132 +        10,10,10,10,10,11,11,12,11,11,12,11,11,12,10,10,
135.4133 +        11,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,
135.4134 +        11,11,11,10,10,10,10,10,10,10,10,10,10,10,10,12,
135.4135 +        12,11,12,11,11,12,12,12,11,11,10,10,10,10,10,10,
135.4136 +        10,10,10,11,12,12,11,12,12,11,12,11,11,11,11,10,
135.4137 +        10,10,10,10,10,10,10,10,10,
135.4138 +};
135.4139 +
135.4140 +static const static_codebook _8c1_s_p9_2 = {
135.4141 +        2, 441,
135.4142 +        (long *)_vq_lengthlist__8c1_s_p9_2,
135.4143 +        1, -529268736, 1611661312, 5, 0,
135.4144 +        (long *)_vq_quantlist__8c1_s_p9_2,
135.4145 +        0
135.4146 +};
135.4147 +
135.4148 +static const long _huff_lengthlist__8c1_s_single[] = {
135.4149 +         4, 6,18, 8,11, 8, 8, 9, 9,10, 4, 4,18, 5, 9, 5,
135.4150 +         6, 7, 8,10,18,18,18,18,17,17,17,17,17,17, 7, 5,
135.4151 +        17, 6,11, 6, 7, 8, 9,12,12, 9,17,12, 8, 8, 9,10,
135.4152 +        10,13, 7, 5,17, 6, 8, 4, 5, 6, 8,10, 6, 5,17, 6,
135.4153 +         8, 5, 4, 5, 7, 9, 7, 7,17, 8, 9, 6, 5, 5, 6, 8,
135.4154 +         8, 8,17, 9,11, 8, 6, 6, 6, 7, 9,10,17,12,12,10,
135.4155 +         9, 7, 7, 8,
135.4156 +};
135.4157 +
135.4158 +static const static_codebook _huff_book__8c1_s_single = {
135.4159 +        2, 100,
135.4160 +        (long *)_huff_lengthlist__8c1_s_single,
135.4161 +        0, 0, 0, 0, 0,
135.4162 +        NULL,
135.4163 +        0
135.4164 +};
135.4165 +
135.4166 +static const long _huff_lengthlist__44c2_s_long[] = {
135.4167 +         6, 6,12,10,10,10, 9,10,12,12, 6, 1,10, 5, 6, 6,
135.4168 +         7, 9,11,14,12, 9, 8,11, 7, 8, 9,11,13,15,10, 5,
135.4169 +        12, 7, 8, 7, 9,12,14,15,10, 6, 7, 8, 5, 6, 7, 9,
135.4170 +        12,14, 9, 6, 8, 7, 6, 6, 7, 9,12,12, 9, 7, 9, 9,
135.4171 +         7, 6, 6, 7,10,10,10, 9,10,11, 8, 7, 6, 6, 8,10,
135.4172 +        12,11,13,13,11,10, 8, 8, 8,10,11,13,15,15,14,13,
135.4173 +        10, 8, 8, 9,
135.4174 +};
135.4175 +
135.4176 +static const static_codebook _huff_book__44c2_s_long = {
135.4177 +        2, 100,
135.4178 +        (long *)_huff_lengthlist__44c2_s_long,
135.4179 +        0, 0, 0, 0, 0,
135.4180 +        NULL,
135.4181 +        0
135.4182 +};
135.4183 +
135.4184 +static const long _vq_quantlist__44c2_s_p1_0[] = {
135.4185 +        1,
135.4186 +        0,
135.4187 +        2,
135.4188 +};
135.4189 +
135.4190 +static const long _vq_lengthlist__44c2_s_p1_0[] = {
135.4191 +         2, 4, 4, 0, 0, 0, 0, 0, 0, 5, 6, 6, 0, 0, 0, 0,
135.4192 +         0, 0, 5, 6, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4193 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4194 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4195 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4196 +         0, 5, 7, 7, 0, 0, 0, 0, 0, 0, 7, 8, 8, 0, 0, 0,
135.4197 +         0, 0, 0, 6, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4198 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4199 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4200 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4201 +         0, 0, 5, 7, 7, 0, 0, 0, 0, 0, 0, 6, 8, 7, 0, 0,
135.4202 +         0, 0, 0, 0, 7, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4203 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4204 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4205 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4206 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4207 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4208 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4209 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4210 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4211 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4212 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4213 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4214 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4215 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4216 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4217 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4218 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4219 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4220 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4221 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4222 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4223 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4224 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4225 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4226 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4227 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4228 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4229 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4230 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4231 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4232 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4233 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4234 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4235 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4236 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 7, 7, 0, 0, 0, 0,
135.4237 +         0, 0, 7, 8, 8, 0, 0, 0, 0, 0, 0, 7, 8, 8, 0, 0,
135.4238 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4239 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4240 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4241 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 8, 8, 0, 0, 0,
135.4242 +         0, 0, 0, 8, 9, 9, 0, 0, 0, 0, 0, 0, 8, 9, 9, 0,
135.4243 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4244 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4245 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4246 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 8, 8, 0, 0,
135.4247 +         0, 0, 0, 0, 8, 9, 8, 0, 0, 0, 0, 0, 0, 8, 9, 9,
135.4248 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4249 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4250 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4251 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4252 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4253 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4254 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4255 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4256 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4257 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4258 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4259 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4260 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4261 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4262 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4263 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4264 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4265 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4266 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4267 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4268 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4269 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4270 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4271 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4272 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4273 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4274 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4275 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4276 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4277 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4278 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4279 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4280 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4281 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4282 +         0, 0, 4, 7, 7, 0, 0, 0, 0, 0, 0, 7, 8, 8, 0, 0,
135.4283 +         0, 0, 0, 0, 7, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4284 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4285 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4286 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4287 +         0, 0, 0, 6, 8, 8, 0, 0, 0, 0, 0, 0, 8, 9, 9, 0,
135.4288 +         0, 0, 0, 0, 0, 8, 8, 9, 0, 0, 0, 0, 0, 0, 0, 0,
135.4289 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4290 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4291 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4292 +         0, 0, 0, 0, 7, 8, 8, 0, 0, 0, 0, 0, 0, 8, 9, 9,
135.4293 +         0, 0, 0, 0, 0, 0, 8, 9, 9, 0, 0, 0, 0, 0, 0, 0,
135.4294 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4295 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4296 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4297 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4298 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4299 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4300 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4301 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4302 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4303 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4304 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4305 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4306 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4307 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4308 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4309 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4310 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4311 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4312 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4313 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4314 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4315 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4316 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4317 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4318 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4319 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4320 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4321 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4322 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4323 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4324 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4325 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4326 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4327 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4328 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4329 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4330 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4331 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4332 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4333 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4334 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4335 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4336 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4337 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4338 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4339 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4340 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4341 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4342 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4343 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4344 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4345 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4346 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4347 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4348 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4349 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4350 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4351 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4352 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4353 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4354 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4355 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4356 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4357 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4358 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4359 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4360 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4361 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4362 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4363 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4364 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4365 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4366 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4367 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4368 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4369 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4370 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4371 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4372 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4373 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4374 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4375 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4376 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4377 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4378 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4379 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4380 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4381 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4382 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4383 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4384 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4385 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4386 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4387 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4388 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4389 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4390 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4391 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4392 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4393 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4394 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4395 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4396 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4397 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4398 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4399 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4400 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4401 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4402 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4403 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4404 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4405 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4406 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4407 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4408 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4409 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4410 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4411 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4412 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4413 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4414 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4415 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4416 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4417 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4418 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4419 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4420 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4421 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4422 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4423 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4424 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4425 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4426 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4427 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4428 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4429 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4430 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4431 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4432 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4433 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4434 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4435 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4436 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4437 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4438 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4439 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4440 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4441 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4442 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4443 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4444 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4445 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4446 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4447 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4448 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4449 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4450 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4451 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4452 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4453 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4454 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4455 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4456 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4457 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4458 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4459 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4460 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4461 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4462 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4463 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4464 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4465 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4466 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4467 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4468 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4469 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4470 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4471 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4472 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4473 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4474 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4475 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4476 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4477 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4478 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4479 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4480 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4481 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4482 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4483 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4484 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4485 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4486 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4487 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4488 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4489 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4490 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4491 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4492 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4493 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4494 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4495 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4496 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4497 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4498 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4499 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4500 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4501 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4502 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4503 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4504 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4505 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4506 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4507 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4508 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4509 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4510 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4511 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4512 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4513 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4514 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4515 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4516 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4517 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4518 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4519 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4520 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4521 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4522 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4523 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4524 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4525 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4526 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4527 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4528 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4529 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4530 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4531 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4532 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4533 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4534 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4535 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4536 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4537 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4538 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4539 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4540 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4541 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4542 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4543 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4544 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4545 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4546 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4547 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4548 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4549 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4550 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4551 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4552 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4553 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4554 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4555 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4556 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4557 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4558 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4559 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4560 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4561 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4562 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4563 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4564 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4565 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4566 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4567 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4568 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4569 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4570 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4571 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4572 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4573 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4574 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4575 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4576 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4577 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4578 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4579 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4580 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4581 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4582 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4583 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4584 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4585 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4586 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4587 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4588 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4589 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4590 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4591 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4592 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4593 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4594 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4595 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4596 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4597 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4598 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4599 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4600 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4601 +         0,
135.4602 +};
135.4603 +
135.4604 +static const static_codebook _44c2_s_p1_0 = {
135.4605 +        8, 6561,
135.4606 +        (long *)_vq_lengthlist__44c2_s_p1_0,
135.4607 +        1, -535822336, 1611661312, 2, 0,
135.4608 +        (long *)_vq_quantlist__44c2_s_p1_0,
135.4609 +        0
135.4610 +};
135.4611 +
135.4612 +static const long _vq_quantlist__44c2_s_p2_0[] = {
135.4613 +        2,
135.4614 +        1,
135.4615 +        3,
135.4616 +        0,
135.4617 +        4,
135.4618 +};
135.4619 +
135.4620 +static const long _vq_lengthlist__44c2_s_p2_0[] = {
135.4621 +         1, 4, 4, 0, 0, 0, 7, 7, 0, 0, 0, 7, 7, 0, 0, 0,
135.4622 +         8, 8, 0, 0, 0, 0, 0, 0, 0, 4, 6, 6, 0, 0, 0, 8,
135.4623 +         8, 0, 0, 0, 8, 8, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0,
135.4624 +         0, 0, 4, 6, 6, 0, 0, 0, 8, 8, 0, 0, 0, 8, 8, 0,
135.4625 +         0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4626 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4627 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4628 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4629 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4630 +         0, 0, 0, 0, 0, 0, 7, 8, 8, 0, 0, 0,11,11, 0, 0,
135.4631 +         0,11,11, 0, 0, 0,12,11, 0, 0, 0, 0, 0, 0, 0, 7,
135.4632 +         8, 8, 0, 0, 0,10,11, 0, 0, 0,11,11, 0, 0, 0,11,
135.4633 +        12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4634 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4635 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4636 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4637 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4638 +         0, 0, 0, 6, 8, 8, 0, 0, 0,11,11, 0, 0, 0,11,11,
135.4639 +         0, 0, 0,12,12, 0, 0, 0, 0, 0, 0, 0, 6, 8, 8, 0,
135.4640 +         0, 0,10,11, 0, 0, 0,10,11, 0, 0, 0,11,11, 0, 0,
135.4641 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4642 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4643 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4644 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4645 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4646 +         8, 9, 9, 0, 0, 0,11,12, 0, 0, 0,11,12, 0, 0, 0,
135.4647 +        12,11, 0, 0, 0, 0, 0, 0, 0, 8,10, 9, 0, 0, 0,12,
135.4648 +        11, 0, 0, 0,12,11, 0, 0, 0,11,12, 0, 0, 0, 0, 0,
135.4649 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4650 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4651 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4652 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4653 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4654 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4655 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4656 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4657 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4658 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4659 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4660 +         0,
135.4661 +};
135.4662 +
135.4663 +static const static_codebook _44c2_s_p2_0 = {
135.4664 +        4, 625,
135.4665 +        (long *)_vq_lengthlist__44c2_s_p2_0,
135.4666 +        1, -533725184, 1611661312, 3, 0,
135.4667 +        (long *)_vq_quantlist__44c2_s_p2_0,
135.4668 +        0
135.4669 +};
135.4670 +
135.4671 +static const long _vq_quantlist__44c2_s_p3_0[] = {
135.4672 +        2,
135.4673 +        1,
135.4674 +        3,
135.4675 +        0,
135.4676 +        4,
135.4677 +};
135.4678 +
135.4679 +static const long _vq_lengthlist__44c2_s_p3_0[] = {
135.4680 +         2, 4, 3, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4681 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 6, 6, 0, 0,
135.4682 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4683 +         0, 0, 4, 4, 4, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4684 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 6, 9, 9,
135.4685 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4686 +         0, 0, 0, 0, 6, 6, 7, 9, 9, 0, 0, 0, 0, 0, 0, 0,
135.4687 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4688 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4689 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4690 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4691 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4692 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4693 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4694 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4695 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4696 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4697 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4698 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4699 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4700 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4701 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4702 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4703 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4704 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4705 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4706 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4707 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4708 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4709 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4710 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4711 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4712 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4713 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4714 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4715 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4716 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4717 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4718 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4719 +         0,
135.4720 +};
135.4721 +
135.4722 +static const static_codebook _44c2_s_p3_0 = {
135.4723 +        4, 625,
135.4724 +        (long *)_vq_lengthlist__44c2_s_p3_0,
135.4725 +        1, -533725184, 1611661312, 3, 0,
135.4726 +        (long *)_vq_quantlist__44c2_s_p3_0,
135.4727 +        0
135.4728 +};
135.4729 +
135.4730 +static const long _vq_quantlist__44c2_s_p4_0[] = {
135.4731 +        4,
135.4732 +        3,
135.4733 +        5,
135.4734 +        2,
135.4735 +        6,
135.4736 +        1,
135.4737 +        7,
135.4738 +        0,
135.4739 +        8,
135.4740 +};
135.4741 +
135.4742 +static const long _vq_lengthlist__44c2_s_p4_0[] = {
135.4743 +         1, 3, 3, 6, 6, 0, 0, 0, 0, 0, 6, 6, 6, 6, 0, 0,
135.4744 +         0, 0, 0, 6, 6, 6, 6, 0, 0, 0, 0, 0, 7, 7, 6, 6,
135.4745 +         0, 0, 0, 0, 0, 0, 0, 6, 7, 0, 0, 0, 0, 0, 0, 0,
135.4746 +         7, 8, 0, 0, 0, 0, 0, 0, 0, 8, 8, 0, 0, 0, 0, 0,
135.4747 +         0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.4748 +         0,
135.4749 +};
135.4750 +
135.4751 +static const static_codebook _44c2_s_p4_0 = {
135.4752 +        2, 81,
135.4753 +        (long *)_vq_lengthlist__44c2_s_p4_0,
135.4754 +        1, -531628032, 1611661312, 4, 0,
135.4755 +        (long *)_vq_quantlist__44c2_s_p4_0,
135.4756 +        0
135.4757 +};
135.4758 +
135.4759 +static const long _vq_quantlist__44c2_s_p5_0[] = {
135.4760 +        4,
135.4761 +        3,
135.4762 +        5,
135.4763 +        2,
135.4764 +        6,
135.4765 +        1,
135.4766 +        7,
135.4767 +        0,
135.4768 +        8,
135.4769 +};
135.4770 +
135.4771 +static const long _vq_lengthlist__44c2_s_p5_0[] = {
135.4772 +         1, 3, 3, 6, 6, 7, 7, 9, 9, 0, 7, 7, 7, 7, 7, 7,
135.4773 +         9, 9, 0, 7, 7, 7, 7, 7, 7, 9, 9, 0, 8, 8, 7, 7,
135.4774 +         8, 8,10,10, 0, 0, 0, 7, 7, 8, 8,10,10, 0, 0, 0,
135.4775 +         9, 9, 8, 8,10,10, 0, 0, 0, 9, 9, 8, 8,10,10, 0,
135.4776 +         0, 0,10,10, 9, 9,11,11, 0, 0, 0, 0, 0, 9, 9,11,
135.4777 +        11,
135.4778 +};
135.4779 +
135.4780 +static const static_codebook _44c2_s_p5_0 = {
135.4781 +        2, 81,
135.4782 +        (long *)_vq_lengthlist__44c2_s_p5_0,
135.4783 +        1, -531628032, 1611661312, 4, 0,
135.4784 +        (long *)_vq_quantlist__44c2_s_p5_0,
135.4785 +        0
135.4786 +};
135.4787 +
135.4788 +static const long _vq_quantlist__44c2_s_p6_0[] = {
135.4789 +        8,
135.4790 +        7,
135.4791 +        9,
135.4792 +        6,
135.4793 +        10,
135.4794 +        5,
135.4795 +        11,
135.4796 +        4,
135.4797 +        12,
135.4798 +        3,
135.4799 +        13,
135.4800 +        2,
135.4801 +        14,
135.4802 +        1,
135.4803 +        15,
135.4804 +        0,
135.4805 +        16,
135.4806 +};
135.4807 +
135.4808 +static const long _vq_lengthlist__44c2_s_p6_0[] = {
135.4809 +         1, 4, 3, 6, 6, 8, 8, 9, 9, 9, 9, 9, 9,10,10,11,
135.4810 +        11, 0, 7, 7, 7, 7, 8, 8, 9, 9, 9, 9,10,10,11,11,
135.4811 +        12,11, 0, 7, 7, 7, 7, 8, 8, 9, 9, 9, 9,10,10,11,
135.4812 +        11,11,12, 0, 8, 8, 7, 7, 9, 9,10,10, 9, 9,10,10,
135.4813 +        11,11,12,12, 0, 0, 0, 7, 7, 9, 9,10,10,10, 9,10,
135.4814 +        10,11,11,12,12, 0, 0, 0, 8, 8, 9, 9,10,10,10,10,
135.4815 +        11,11,11,11,12,12, 0, 0, 0, 8, 8, 9, 9,10,10,10,
135.4816 +        10,11,11,12,12,12,12, 0, 0, 0, 9, 9, 9, 9,10,10,
135.4817 +        10,10,11,11,12,12,12,12, 0, 0, 0, 0, 0, 9, 9,10,
135.4818 +        10,10,10,11,11,12,12,13,13, 0, 0, 0, 0, 0, 9, 9,
135.4819 +        10,10,11,11,11,11,12,12,13,13, 0, 0, 0, 0, 0, 9,
135.4820 +         9,10,10,11,11,11,11,12,12,13,13, 0, 0, 0, 0, 0,
135.4821 +        10,10,10,10,11,11,12,12,13,12,13,13, 0, 0, 0, 0,
135.4822 +         0, 0, 0,10,10,11,11,12,12,13,13,13,13, 0, 0, 0,
135.4823 +         0, 0, 0, 0,11,11,12,12,12,12,13,13,13,14, 0, 0,
135.4824 +         0, 0, 0, 0, 0,11,11,12,12,12,12,13,13,13,14, 0,
135.4825 +         0, 0, 0, 0, 0, 0,12,12,12,12,13,13,13,13,14,14,
135.4826 +         0, 0, 0, 0, 0, 0, 0, 0, 0,12,12,13,13,13,13,14,
135.4827 +        14,
135.4828 +};
135.4829 +
135.4830 +static const static_codebook _44c2_s_p6_0 = {
135.4831 +        2, 289,
135.4832 +        (long *)_vq_lengthlist__44c2_s_p6_0,
135.4833 +        1, -529530880, 1611661312, 5, 0,
135.4834 +        (long *)_vq_quantlist__44c2_s_p6_0,
135.4835 +        0
135.4836 +};
135.4837 +
135.4838 +static const long _vq_quantlist__44c2_s_p7_0[] = {
135.4839 +        1,
135.4840 +        0,
135.4841 +        2,
135.4842 +};
135.4843 +
135.4844 +static const long _vq_lengthlist__44c2_s_p7_0[] = {
135.4845 +         1, 4, 4, 7, 6, 6, 7, 6, 6, 4, 7, 7,10, 9, 9,11,
135.4846 +         9, 9, 4, 7, 7,10, 9, 9,10, 9, 9, 7,10,10,11,10,
135.4847 +        11,11,10,11, 6, 9, 9,11,10,10,11,10,10, 6, 9, 9,
135.4848 +        11,10,11,11,10,10, 7,11,10,11,11,11,12,11,11, 6,
135.4849 +         9, 9,11,10,10,11,11,10, 6, 9, 9,11,10,10,12,10,
135.4850 +        11,
135.4851 +};
135.4852 +
135.4853 +static const static_codebook _44c2_s_p7_0 = {
135.4854 +        4, 81,
135.4855 +        (long *)_vq_lengthlist__44c2_s_p7_0,
135.4856 +        1, -529137664, 1618345984, 2, 0,
135.4857 +        (long *)_vq_quantlist__44c2_s_p7_0,
135.4858 +        0
135.4859 +};
135.4860 +
135.4861 +static const long _vq_quantlist__44c2_s_p7_1[] = {
135.4862 +        5,
135.4863 +        4,
135.4864 +        6,
135.4865 +        3,
135.4866 +        7,
135.4867 +        2,
135.4868 +        8,
135.4869 +        1,
135.4870 +        9,
135.4871 +        0,
135.4872 +        10,
135.4873 +};
135.4874 +
135.4875 +static const long _vq_lengthlist__44c2_s_p7_1[] = {
135.4876 +         2, 3, 4, 6, 6, 7, 7, 7, 7, 7, 7, 9, 7, 7, 6, 6,
135.4877 +         7, 7, 8, 8, 8, 8, 9, 6, 6, 6, 6, 7, 7, 8, 8, 8,
135.4878 +         8,10, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8,10,10,10, 7,
135.4879 +         7, 7, 7, 8, 8, 8, 8,10,10,10, 7, 7, 8, 8, 8, 8,
135.4880 +         8, 8,10,10,10, 7, 8, 8, 8, 8, 8, 8, 8,10,10,10,
135.4881 +         8, 8, 8, 8, 8, 8, 8, 8,10,10,10,10,10, 8, 8, 8,
135.4882 +         8, 8, 8,10,10,10,10,10, 9, 9, 8, 8, 8, 8,10,10,
135.4883 +        10,10,10, 8, 8, 8, 8, 8, 8,
135.4884 +};
135.4885 +
135.4886 +static const static_codebook _44c2_s_p7_1 = {
135.4887 +        2, 121,
135.4888 +        (long *)_vq_lengthlist__44c2_s_p7_1,
135.4889 +        1, -531365888, 1611661312, 4, 0,
135.4890 +        (long *)_vq_quantlist__44c2_s_p7_1,
135.4891 +        0
135.4892 +};
135.4893 +
135.4894 +static const long _vq_quantlist__44c2_s_p8_0[] = {
135.4895 +        6,
135.4896 +        5,
135.4897 +        7,
135.4898 +        4,
135.4899 +        8,
135.4900 +        3,
135.4901 +        9,
135.4902 +        2,
135.4903 +        10,
135.4904 +        1,
135.4905 +        11,
135.4906 +        0,
135.4907 +        12,
135.4908 +};
135.4909 +
135.4910 +static const long _vq_lengthlist__44c2_s_p8_0[] = {
135.4911 +         1, 4, 4, 6, 6, 7, 7, 7, 7, 8, 8, 9, 9, 6, 5, 5,
135.4912 +         7, 7, 8, 8, 8, 8, 9, 9,10,10, 7, 6, 5, 7, 7, 8,
135.4913 +         8, 8, 8, 9, 9,10,10, 0, 8, 8, 8, 8, 9, 9, 9, 9,
135.4914 +        10,10,11,11, 0, 8, 8, 8, 8, 9, 9, 9, 9,10,10,11,
135.4915 +        11, 0,12,12, 9, 9,10,10,10,10,11,11,11,11, 0,13,
135.4916 +        13, 9, 9,10,10,10,10,11,11,12,12, 0, 0, 0,10,10,
135.4917 +        10,10,11,11,12,12,12,13, 0, 0, 0,10,10,10,10,11,
135.4918 +        11,12,12,12,12, 0, 0, 0,14,14,10,11,11,11,12,12,
135.4919 +        13,13, 0, 0, 0,14,14,11,10,11,11,13,12,13,13, 0,
135.4920 +         0, 0, 0, 0,12,12,11,12,13,12,14,14, 0, 0, 0, 0,
135.4921 +         0,12,12,12,12,13,12,14,14,
135.4922 +};
135.4923 +
135.4924 +static const static_codebook _44c2_s_p8_0 = {
135.4925 +        2, 169,
135.4926 +        (long *)_vq_lengthlist__44c2_s_p8_0,
135.4927 +        1, -526516224, 1616117760, 4, 0,
135.4928 +        (long *)_vq_quantlist__44c2_s_p8_0,
135.4929 +        0
135.4930 +};
135.4931 +
135.4932 +static const long _vq_quantlist__44c2_s_p8_1[] = {
135.4933 +        2,
135.4934 +        1,
135.4935 +        3,
135.4936 +        0,
135.4937 +        4,
135.4938 +};
135.4939 +
135.4940 +static const long _vq_lengthlist__44c2_s_p8_1[] = {
135.4941 +         2, 4, 4, 5, 4, 6, 5, 5, 5, 5, 6, 5, 5, 5, 5, 6,
135.4942 +         5, 5, 5, 5, 6, 6, 6, 5, 5,
135.4943 +};
135.4944 +
135.4945 +static const static_codebook _44c2_s_p8_1 = {
135.4946 +        2, 25,
135.4947 +        (long *)_vq_lengthlist__44c2_s_p8_1,
135.4948 +        1, -533725184, 1611661312, 3, 0,
135.4949 +        (long *)_vq_quantlist__44c2_s_p8_1,
135.4950 +        0
135.4951 +};
135.4952 +
135.4953 +static const long _vq_quantlist__44c2_s_p9_0[] = {
135.4954 +        6,
135.4955 +        5,
135.4956 +        7,
135.4957 +        4,
135.4958 +        8,
135.4959 +        3,
135.4960 +        9,
135.4961 +        2,
135.4962 +        10,
135.4963 +        1,
135.4964 +        11,
135.4965 +        0,
135.4966 +        12,
135.4967 +};
135.4968 +
135.4969 +static const long _vq_lengthlist__44c2_s_p9_0[] = {
135.4970 +         1, 5, 4,12,12,12,12,12,12,12,12,12,12, 4, 9, 8,
135.4971 +        11,11,11,11,11,11,11,11,11,11, 2, 8, 7,11,11,11,
135.4972 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.4973 +        11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,
135.4974 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.4975 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.4976 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.4977 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.4978 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.4979 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.4980 +        11,11,11,11,11,11,11,11,11,
135.4981 +};
135.4982 +
135.4983 +static const static_codebook _44c2_s_p9_0 = {
135.4984 +        2, 169,
135.4985 +        (long *)_vq_lengthlist__44c2_s_p9_0,
135.4986 +        1, -514541568, 1627103232, 4, 0,
135.4987 +        (long *)_vq_quantlist__44c2_s_p9_0,
135.4988 +        0
135.4989 +};
135.4990 +
135.4991 +static const long _vq_quantlist__44c2_s_p9_1[] = {
135.4992 +        6,
135.4993 +        5,
135.4994 +        7,
135.4995 +        4,
135.4996 +        8,
135.4997 +        3,
135.4998 +        9,
135.4999 +        2,
135.5000 +        10,
135.5001 +        1,
135.5002 +        11,
135.5003 +        0,
135.5004 +        12,
135.5005 +};
135.5006 +
135.5007 +static const long _vq_lengthlist__44c2_s_p9_1[] = {
135.5008 +         1, 4, 4, 6, 6, 7, 6, 8, 8,10, 9,10,10, 6, 5, 5,
135.5009 +         7, 7, 8, 7,10, 9,11,11,12,13, 6, 5, 5, 7, 7, 8,
135.5010 +         8,10,10,11,11,13,13,18, 8, 8, 8, 8, 9, 9,10,10,
135.5011 +        12,12,12,13,18, 8, 8, 8, 8, 9, 9,10,10,12,12,13,
135.5012 +        13,18,11,11, 8, 8,10,10,11,11,12,11,13,12,18,11,
135.5013 +        11, 9, 7,10,10,11,11,11,12,12,13,17,17,17,10,10,
135.5014 +        11,11,12,12,12,10,12,12,17,17,17,11,10,11,10,13,
135.5015 +        12,11,12,12,12,17,17,17,15,14,11,11,12,11,13,10,
135.5016 +        13,12,17,17,17,14,14,12,10,11,11,13,13,13,13,17,
135.5017 +        17,16,17,16,13,13,12,10,13,10,14,13,17,16,17,16,
135.5018 +        17,13,12,12,10,13,11,14,14,
135.5019 +};
135.5020 +
135.5021 +static const static_codebook _44c2_s_p9_1 = {
135.5022 +        2, 169,
135.5023 +        (long *)_vq_lengthlist__44c2_s_p9_1,
135.5024 +        1, -522616832, 1620115456, 4, 0,
135.5025 +        (long *)_vq_quantlist__44c2_s_p9_1,
135.5026 +        0
135.5027 +};
135.5028 +
135.5029 +static const long _vq_quantlist__44c2_s_p9_2[] = {
135.5030 +        8,
135.5031 +        7,
135.5032 +        9,
135.5033 +        6,
135.5034 +        10,
135.5035 +        5,
135.5036 +        11,
135.5037 +        4,
135.5038 +        12,
135.5039 +        3,
135.5040 +        13,
135.5041 +        2,
135.5042 +        14,
135.5043 +        1,
135.5044 +        15,
135.5045 +        0,
135.5046 +        16,
135.5047 +};
135.5048 +
135.5049 +static const long _vq_lengthlist__44c2_s_p9_2[] = {
135.5050 +         2, 4, 4, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8,
135.5051 +         8,10, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9,
135.5052 +         9, 9,10, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9,
135.5053 +         9, 9, 9,10, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9,
135.5054 +         9, 9, 9, 9,10,10,10, 8, 7, 8, 8, 8, 8, 9, 9, 9,
135.5055 +         9, 9, 9, 9, 9,10,11,11, 8, 8, 8, 8, 9, 9, 9, 9,
135.5056 +         9, 9,10, 9, 9, 9,10,11,10, 8, 8, 8, 8, 9, 9, 9,
135.5057 +         9, 9, 9, 9,10,10,10,10,11,10, 8, 8, 9, 9, 9, 9,
135.5058 +         9, 9,10, 9, 9,10, 9,10,11,10,11,11,11, 8, 8, 9,
135.5059 +         9, 9, 9, 9, 9, 9, 9,10,10,11,11,11,11,11, 9, 9,
135.5060 +         9, 9, 9, 9,10, 9, 9, 9,10,10,11,11,11,11,11, 9,
135.5061 +         9, 9, 9, 9, 9, 9, 9, 9,10, 9,10,11,11,11,11,11,
135.5062 +         9, 9, 9, 9,10,10, 9, 9, 9,10,10,10,11,11,11,11,
135.5063 +        11,11,11, 9, 9, 9,10, 9, 9,10,10,10,10,11,11,10,
135.5064 +        11,11,11,11,10, 9,10,10, 9, 9, 9, 9,10,10,11,10,
135.5065 +        11,11,11,11,11, 9, 9, 9, 9,10, 9,10,10,10,10,11,
135.5066 +        10,11,11,11,11,11,10,10, 9, 9,10, 9,10,10,10,10,
135.5067 +        10,10,10,11,11,11,11,11,11, 9, 9,10, 9,10, 9,10,
135.5068 +        10,
135.5069 +};
135.5070 +
135.5071 +static const static_codebook _44c2_s_p9_2 = {
135.5072 +        2, 289,
135.5073 +        (long *)_vq_lengthlist__44c2_s_p9_2,
135.5074 +        1, -529530880, 1611661312, 5, 0,
135.5075 +        (long *)_vq_quantlist__44c2_s_p9_2,
135.5076 +        0
135.5077 +};
135.5078 +
135.5079 +static const long _huff_lengthlist__44c2_s_short[] = {
135.5080 +        11, 9,13,12,12,11,12,12,13,15, 8, 2,11, 4, 8, 5,
135.5081 +         7,10,12,15,13, 7,10, 9, 8, 8,10,13,17,17,11, 4,
135.5082 +        12, 5, 9, 5, 8,11,14,16,12, 6, 8, 7, 6, 6, 8,11,
135.5083 +        13,16,11, 4, 9, 5, 6, 4, 6,10,13,16,11, 6,11, 7,
135.5084 +         7, 6, 7,10,13,15,13, 9,12, 9, 8, 6, 8,10,12,14,
135.5085 +        14,10,10, 8, 6, 5, 6, 9,11,13,15,11,11, 9, 6, 5,
135.5086 +         6, 8, 9,12,
135.5087 +};
135.5088 +
135.5089 +static const static_codebook _huff_book__44c2_s_short = {
135.5090 +        2, 100,
135.5091 +        (long *)_huff_lengthlist__44c2_s_short,
135.5092 +        0, 0, 0, 0, 0,
135.5093 +        NULL,
135.5094 +        0
135.5095 +};
135.5096 +
135.5097 +static const long _huff_lengthlist__44c3_s_long[] = {
135.5098 +         5, 6,11,11,11,11,10,10,12,11, 5, 2,11, 5, 6, 6,
135.5099 +         7, 9,11,13,13,10, 7,11, 6, 7, 8, 9,10,12,11, 5,
135.5100 +        11, 6, 8, 7, 9,11,14,15,11, 6, 6, 8, 4, 5, 7, 8,
135.5101 +        10,13,10, 5, 7, 7, 5, 5, 6, 8,10,11,10, 7, 7, 8,
135.5102 +         6, 5, 5, 7, 9, 9,11, 8, 8,11, 8, 7, 6, 6, 7, 9,
135.5103 +        12,11,10,13, 9, 9, 7, 7, 7, 9,11,13,12,15,12,11,
135.5104 +         9, 8, 8, 8,
135.5105 +};
135.5106 +
135.5107 +static const static_codebook _huff_book__44c3_s_long = {
135.5108 +        2, 100,
135.5109 +        (long *)_huff_lengthlist__44c3_s_long,
135.5110 +        0, 0, 0, 0, 0,
135.5111 +        NULL,
135.5112 +        0
135.5113 +};
135.5114 +
135.5115 +static const long _vq_quantlist__44c3_s_p1_0[] = {
135.5116 +        1,
135.5117 +        0,
135.5118 +        2,
135.5119 +};
135.5120 +
135.5121 +static const long _vq_lengthlist__44c3_s_p1_0[] = {
135.5122 +         2, 4, 4, 0, 0, 0, 0, 0, 0, 5, 6, 6, 0, 0, 0, 0,
135.5123 +         0, 0, 5, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5124 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5125 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5126 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5127 +         0, 5, 7, 7, 0, 0, 0, 0, 0, 0, 7, 8, 8, 0, 0, 0,
135.5128 +         0, 0, 0, 6, 7, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5129 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5130 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5131 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5132 +         0, 0, 5, 7, 7, 0, 0, 0, 0, 0, 0, 6, 8, 7, 0, 0,
135.5133 +         0, 0, 0, 0, 7, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5134 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5135 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5136 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5137 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5138 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5139 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5140 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5141 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5142 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5143 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5144 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5145 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5146 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5147 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5148 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5149 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5150 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5151 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5152 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5153 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5154 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5155 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5156 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5157 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5158 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5159 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5160 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5161 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5162 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5163 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5164 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5165 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5166 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5167 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 7, 7, 0, 0, 0, 0,
135.5168 +         0, 0, 7, 8, 8, 0, 0, 0, 0, 0, 0, 7, 8, 8, 0, 0,
135.5169 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5170 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5171 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5172 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 8, 8, 0, 0, 0,
135.5173 +         0, 0, 0, 8, 8, 9, 0, 0, 0, 0, 0, 0, 8, 9, 9, 0,
135.5174 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5175 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5176 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5177 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 8, 8, 0, 0,
135.5178 +         0, 0, 0, 0, 7, 9, 8, 0, 0, 0, 0, 0, 0, 8, 9, 9,
135.5179 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5180 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5181 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5182 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5183 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5184 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5185 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5186 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5187 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5188 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5189 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5190 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5191 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5192 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5193 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5194 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5195 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5196 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5197 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5198 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5199 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5200 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5201 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5202 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5203 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5204 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5205 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5206 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5207 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5208 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5209 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5210 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5211 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5212 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5213 +         0, 0, 5, 7, 7, 0, 0, 0, 0, 0, 0, 7, 8, 8, 0, 0,
135.5214 +         0, 0, 0, 0, 7, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5215 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5216 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5217 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5218 +         0, 0, 0, 6, 8, 8, 0, 0, 0, 0, 0, 0, 8, 9, 9, 0,
135.5219 +         0, 0, 0, 0, 0, 7, 8, 9, 0, 0, 0, 0, 0, 0, 0, 0,
135.5220 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5221 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5222 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5223 +         0, 0, 0, 0, 6, 8, 8, 0, 0, 0, 0, 0, 0, 8, 9, 9,
135.5224 +         0, 0, 0, 0, 0, 0, 8, 9, 8, 0, 0, 0, 0, 0, 0, 0,
135.5225 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5226 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5227 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5228 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5229 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5230 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5231 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5232 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5233 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5234 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5235 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5236 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5237 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5238 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5239 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5240 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5241 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5242 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5243 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5244 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5245 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5246 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5247 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5248 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5249 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5250 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5251 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5252 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5253 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5254 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5255 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5256 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5257 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5258 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5259 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5260 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5261 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5262 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5263 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5264 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5265 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5266 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5267 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5268 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5269 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5270 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5271 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5272 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5273 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5274 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5275 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5276 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5277 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5278 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5279 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5280 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5281 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5282 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5283 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5284 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5285 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5286 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5287 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5288 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5289 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5290 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5291 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5292 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5293 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5294 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5295 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5296 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5297 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5298 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5299 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5300 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5301 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5302 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5303 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5304 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5305 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5306 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5307 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5308 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5309 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5310 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5311 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5312 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5313 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5314 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5315 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5316 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5317 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5318 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5319 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5320 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5321 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5322 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5323 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5324 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5325 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5326 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5327 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5328 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5329 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5330 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5331 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5332 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5333 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5334 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5335 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5336 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5337 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5338 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5339 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5340 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5341 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5342 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5343 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5344 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5345 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5346 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5347 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5348 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5349 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5350 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5351 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5352 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5353 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5354 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5355 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5356 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5357 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5358 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5359 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5360 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5361 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5362 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5363 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5364 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5365 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5366 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5367 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5368 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5369 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5370 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5371 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5372 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5373 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5374 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5375 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5376 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5377 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5378 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5379 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5380 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5381 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5382 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5383 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5384 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5385 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5386 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5387 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5388 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5389 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5390 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5391 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5392 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5393 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5394 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5395 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5396 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5397 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5398 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5399 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5400 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5401 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5402 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5403 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5404 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5405 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5406 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5407 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5408 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5409 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5410 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5411 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5412 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5413 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5414 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5415 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5416 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5417 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5418 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5419 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5420 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5421 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5422 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5423 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5424 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5425 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5426 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5427 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5428 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5429 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5430 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5431 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5432 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5433 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5434 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5435 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5436 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5437 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5438 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5439 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5440 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5441 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5442 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5443 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5444 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5445 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5446 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5447 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5448 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5449 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5450 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5451 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5452 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5453 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5454 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5455 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5456 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5457 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5458 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5459 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5460 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5461 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5462 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5463 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5464 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5465 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5466 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5467 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5468 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5469 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5470 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5471 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5472 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5473 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5474 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5475 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5476 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5477 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5478 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5479 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5480 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5481 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5482 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5483 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5484 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5485 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5486 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5487 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5488 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5489 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5490 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5491 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5492 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5493 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5494 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5495 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5496 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5497 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5498 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5499 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5500 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5501 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5502 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5503 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5504 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5505 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5506 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5507 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5508 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5509 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5510 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5511 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5512 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5513 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5514 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5515 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5516 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5517 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5518 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5519 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5520 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5521 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5522 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5523 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5524 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5525 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5526 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5527 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5528 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5529 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5530 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5531 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5532 +         0,
135.5533 +};
135.5534 +
135.5535 +static const static_codebook _44c3_s_p1_0 = {
135.5536 +        8, 6561,
135.5537 +        (long *)_vq_lengthlist__44c3_s_p1_0,
135.5538 +        1, -535822336, 1611661312, 2, 0,
135.5539 +        (long *)_vq_quantlist__44c3_s_p1_0,
135.5540 +        0
135.5541 +};
135.5542 +
135.5543 +static const long _vq_quantlist__44c3_s_p2_0[] = {
135.5544 +        2,
135.5545 +        1,
135.5546 +        3,
135.5547 +        0,
135.5548 +        4,
135.5549 +};
135.5550 +
135.5551 +static const long _vq_lengthlist__44c3_s_p2_0[] = {
135.5552 +         2, 5, 5, 0, 0, 0, 5, 5, 0, 0, 0, 5, 5, 0, 0, 0,
135.5553 +         7, 8, 0, 0, 0, 0, 0, 0, 0, 5, 6, 6, 0, 0, 0, 7,
135.5554 +         7, 0, 0, 0, 7, 7, 0, 0, 0,10,10, 0, 0, 0, 0, 0,
135.5555 +         0, 0, 5, 6, 6, 0, 0, 0, 7, 7, 0, 0, 0, 7, 7, 0,
135.5556 +         0, 0,10,10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5557 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5558 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5559 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5560 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5561 +         0, 0, 0, 0, 0, 0, 5, 7, 7, 0, 0, 0, 7, 7, 0, 0,
135.5562 +         0, 7, 7, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 5,
135.5563 +         7, 7, 0, 0, 0, 7, 7, 0, 0, 0, 7, 7, 0, 0, 0, 9,
135.5564 +         9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5565 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5566 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5567 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5568 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5569 +         0, 0, 0, 5, 7, 7, 0, 0, 0, 7, 7, 0, 0, 0, 7, 7,
135.5570 +         0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 5, 7, 7, 0,
135.5571 +         0, 0, 7, 7, 0, 0, 0, 7, 7, 0, 0, 0, 9, 9, 0, 0,
135.5572 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5573 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5574 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5575 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5576 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5577 +         8,10,10, 0, 0, 0, 9, 9, 0, 0, 0, 9, 9, 0, 0, 0,
135.5578 +        10,10, 0, 0, 0, 0, 0, 0, 0, 8,10,10, 0, 0, 0, 9,
135.5579 +         9, 0, 0, 0, 9, 9, 0, 0, 0,10,10, 0, 0, 0, 0, 0,
135.5580 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5581 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5582 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5583 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5584 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5585 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5586 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5587 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5588 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5589 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5590 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5591 +         0,
135.5592 +};
135.5593 +
135.5594 +static const static_codebook _44c3_s_p2_0 = {
135.5595 +        4, 625,
135.5596 +        (long *)_vq_lengthlist__44c3_s_p2_0,
135.5597 +        1, -533725184, 1611661312, 3, 0,
135.5598 +        (long *)_vq_quantlist__44c3_s_p2_0,
135.5599 +        0
135.5600 +};
135.5601 +
135.5602 +static const long _vq_quantlist__44c3_s_p3_0[] = {
135.5603 +        2,
135.5604 +        1,
135.5605 +        3,
135.5606 +        0,
135.5607 +        4,
135.5608 +};
135.5609 +
135.5610 +static const long _vq_lengthlist__44c3_s_p3_0[] = {
135.5611 +         2, 4, 3, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5612 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 6, 6, 0, 0,
135.5613 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5614 +         0, 0, 4, 4, 4, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5615 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 6, 9, 9,
135.5616 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5617 +         0, 0, 0, 0, 6, 6, 7, 9, 9, 0, 0, 0, 0, 0, 0, 0,
135.5618 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5619 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5620 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5621 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5622 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5623 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5624 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5625 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5626 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5627 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5628 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5629 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5630 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5631 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5632 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5633 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5634 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5635 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5636 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5637 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5638 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5639 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5640 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5641 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5642 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5643 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5644 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5645 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5646 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5647 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5648 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5649 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5650 +         0,
135.5651 +};
135.5652 +
135.5653 +static const static_codebook _44c3_s_p3_0 = {
135.5654 +        4, 625,
135.5655 +        (long *)_vq_lengthlist__44c3_s_p3_0,
135.5656 +        1, -533725184, 1611661312, 3, 0,
135.5657 +        (long *)_vq_quantlist__44c3_s_p3_0,
135.5658 +        0
135.5659 +};
135.5660 +
135.5661 +static const long _vq_quantlist__44c3_s_p4_0[] = {
135.5662 +        4,
135.5663 +        3,
135.5664 +        5,
135.5665 +        2,
135.5666 +        6,
135.5667 +        1,
135.5668 +        7,
135.5669 +        0,
135.5670 +        8,
135.5671 +};
135.5672 +
135.5673 +static const long _vq_lengthlist__44c3_s_p4_0[] = {
135.5674 +         2, 3, 3, 6, 6, 0, 0, 0, 0, 0, 4, 4, 6, 6, 0, 0,
135.5675 +         0, 0, 0, 4, 4, 6, 6, 0, 0, 0, 0, 0, 5, 5, 6, 6,
135.5676 +         0, 0, 0, 0, 0, 0, 0, 6, 6, 0, 0, 0, 0, 0, 0, 0,
135.5677 +         7, 8, 0, 0, 0, 0, 0, 0, 0, 7, 7, 0, 0, 0, 0, 0,
135.5678 +         0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.5679 +         0,
135.5680 +};
135.5681 +
135.5682 +static const static_codebook _44c3_s_p4_0 = {
135.5683 +        2, 81,
135.5684 +        (long *)_vq_lengthlist__44c3_s_p4_0,
135.5685 +        1, -531628032, 1611661312, 4, 0,
135.5686 +        (long *)_vq_quantlist__44c3_s_p4_0,
135.5687 +        0
135.5688 +};
135.5689 +
135.5690 +static const long _vq_quantlist__44c3_s_p5_0[] = {
135.5691 +        4,
135.5692 +        3,
135.5693 +        5,
135.5694 +        2,
135.5695 +        6,
135.5696 +        1,
135.5697 +        7,
135.5698 +        0,
135.5699 +        8,
135.5700 +};
135.5701 +
135.5702 +static const long _vq_lengthlist__44c3_s_p5_0[] = {
135.5703 +         1, 3, 4, 6, 6, 7, 7, 9, 9, 0, 5, 5, 7, 7, 7, 8,
135.5704 +         9, 9, 0, 5, 5, 7, 7, 8, 8, 9, 9, 0, 7, 7, 8, 8,
135.5705 +         8, 8,10,10, 0, 0, 0, 8, 8, 8, 8,10,10, 0, 0, 0,
135.5706 +         9, 9, 9, 9,10,10, 0, 0, 0, 9, 9, 9, 9,10,10, 0,
135.5707 +         0, 0,10,10,10,10,11,11, 0, 0, 0, 0, 0,10,10,11,
135.5708 +        11,
135.5709 +};
135.5710 +
135.5711 +static const static_codebook _44c3_s_p5_0 = {
135.5712 +        2, 81,
135.5713 +        (long *)_vq_lengthlist__44c3_s_p5_0,
135.5714 +        1, -531628032, 1611661312, 4, 0,
135.5715 +        (long *)_vq_quantlist__44c3_s_p5_0,
135.5716 +        0
135.5717 +};
135.5718 +
135.5719 +static const long _vq_quantlist__44c3_s_p6_0[] = {
135.5720 +        8,
135.5721 +        7,
135.5722 +        9,
135.5723 +        6,
135.5724 +        10,
135.5725 +        5,
135.5726 +        11,
135.5727 +        4,
135.5728 +        12,
135.5729 +        3,
135.5730 +        13,
135.5731 +        2,
135.5732 +        14,
135.5733 +        1,
135.5734 +        15,
135.5735 +        0,
135.5736 +        16,
135.5737 +};
135.5738 +
135.5739 +static const long _vq_lengthlist__44c3_s_p6_0[] = {
135.5740 +         2, 3, 3, 6, 6, 7, 7, 8, 8, 8, 8, 9, 9,10,10,11,
135.5741 +        10, 0, 5, 5, 7, 7, 8, 8, 9, 9, 9, 9,10,10,10,10,
135.5742 +        11,11, 0, 5, 5, 7, 7, 8, 8, 9, 9, 9, 9,10,10,10,
135.5743 +        10,11,11, 0, 6, 6, 7, 7, 8, 8, 9, 9, 9, 9,10,10,
135.5744 +        11,11,11,11, 0, 0, 0, 7, 7, 8, 8, 9, 9, 9, 9,10,
135.5745 +        10,11,11,11,12, 0, 0, 0, 8, 8, 8, 8, 9, 9, 9, 9,
135.5746 +        10,10,11,11,12,12, 0, 0, 0, 8, 8, 8, 8, 9, 9, 9,
135.5747 +         9,10,10,11,11,12,12, 0, 0, 0, 9, 9, 9, 9,10,10,
135.5748 +        10,10,11,10,11,11,12,12, 0, 0, 0, 0, 0, 9, 9,10,
135.5749 +        10,10,10,11,11,11,11,12,12, 0, 0, 0, 0, 0, 9, 8,
135.5750 +         9, 9,10,10,11,11,12,12,12,12, 0, 0, 0, 0, 0, 8,
135.5751 +         8, 9, 9,10,10,11,11,12,11,12,12, 0, 0, 0, 0, 0,
135.5752 +         9,10,10,10,11,11,11,11,12,12,13,13, 0, 0, 0, 0,
135.5753 +         0, 0, 0,10,10,10,10,11,11,12,12,13,13, 0, 0, 0,
135.5754 +         0, 0, 0, 0,11,11,11,11,12,12,12,12,13,13, 0, 0,
135.5755 +         0, 0, 0, 0, 0,11,11,11,11,12,12,12,12,13,13, 0,
135.5756 +         0, 0, 0, 0, 0, 0,11,11,12,12,12,12,13,13,13,13,
135.5757 +         0, 0, 0, 0, 0, 0, 0, 0, 0,12,12,12,12,13,13,13,
135.5758 +        13,
135.5759 +};
135.5760 +
135.5761 +static const static_codebook _44c3_s_p6_0 = {
135.5762 +        2, 289,
135.5763 +        (long *)_vq_lengthlist__44c3_s_p6_0,
135.5764 +        1, -529530880, 1611661312, 5, 0,
135.5765 +        (long *)_vq_quantlist__44c3_s_p6_0,
135.5766 +        0
135.5767 +};
135.5768 +
135.5769 +static const long _vq_quantlist__44c3_s_p7_0[] = {
135.5770 +        1,
135.5771 +        0,
135.5772 +        2,
135.5773 +};
135.5774 +
135.5775 +static const long _vq_lengthlist__44c3_s_p7_0[] = {
135.5776 +         1, 4, 4, 7, 6, 6, 7, 6, 6, 4, 7, 7,10, 9, 9,11,
135.5777 +         9, 9, 4, 7, 7,10, 9, 9,11, 9, 9, 7,10,10,11,11,
135.5778 +        10,12,11,11, 6, 9, 9,11,10,10,11,10,10, 6, 9, 9,
135.5779 +        11,10,10,11,10,10, 7,11,11,11,11,11,12,11,11, 6,
135.5780 +         9, 9,11,10,10,11,10,10, 6, 9, 9,11,10,10,11,10,
135.5781 +        10,
135.5782 +};
135.5783 +
135.5784 +static const static_codebook _44c3_s_p7_0 = {
135.5785 +        4, 81,
135.5786 +        (long *)_vq_lengthlist__44c3_s_p7_0,
135.5787 +        1, -529137664, 1618345984, 2, 0,
135.5788 +        (long *)_vq_quantlist__44c3_s_p7_0,
135.5789 +        0
135.5790 +};
135.5791 +
135.5792 +static const long _vq_quantlist__44c3_s_p7_1[] = {
135.5793 +        5,
135.5794 +        4,
135.5795 +        6,
135.5796 +        3,
135.5797 +        7,
135.5798 +        2,
135.5799 +        8,
135.5800 +        1,
135.5801 +        9,
135.5802 +        0,
135.5803 +        10,
135.5804 +};
135.5805 +
135.5806 +static const long _vq_lengthlist__44c3_s_p7_1[] = {
135.5807 +         2, 4, 4, 6, 6, 7, 7, 7, 7, 8, 8,10, 5, 5, 6, 6,
135.5808 +         7, 7, 8, 8, 8, 8,10, 5, 5, 6, 6, 7, 7, 8, 8, 8,
135.5809 +         8,10, 6, 6, 7, 7, 8, 8, 8, 8, 8, 8,10,10,10, 7,
135.5810 +         7, 8, 7, 8, 8, 8, 8,10,10,10, 8, 8, 8, 8, 8, 8,
135.5811 +         8, 8,10,10,10, 7, 8, 8, 8, 8, 8, 8, 8,10,10,10,
135.5812 +         8, 8, 8, 8, 8, 8, 8, 8,10,10,10,10,10, 8, 8, 8,
135.5813 +         8, 8, 8,10,10,10,10,10, 9, 9, 8, 8, 9, 8,10,10,
135.5814 +        10,10,10, 8, 8, 8, 8, 8, 8,
135.5815 +};
135.5816 +
135.5817 +static const static_codebook _44c3_s_p7_1 = {
135.5818 +        2, 121,
135.5819 +        (long *)_vq_lengthlist__44c3_s_p7_1,
135.5820 +        1, -531365888, 1611661312, 4, 0,
135.5821 +        (long *)_vq_quantlist__44c3_s_p7_1,
135.5822 +        0
135.5823 +};
135.5824 +
135.5825 +static const long _vq_quantlist__44c3_s_p8_0[] = {
135.5826 +        6,
135.5827 +        5,
135.5828 +        7,
135.5829 +        4,
135.5830 +        8,
135.5831 +        3,
135.5832 +        9,
135.5833 +        2,
135.5834 +        10,
135.5835 +        1,
135.5836 +        11,
135.5837 +        0,
135.5838 +        12,
135.5839 +};
135.5840 +
135.5841 +static const long _vq_lengthlist__44c3_s_p8_0[] = {
135.5842 +         1, 4, 4, 6, 6, 7, 7, 8, 8, 9, 9,10,10, 6, 5, 5,
135.5843 +         7, 7, 8, 8, 8, 8, 9, 9,10,10, 7, 5, 5, 7, 7, 8,
135.5844 +         8, 8, 8, 9, 9,11,10, 0, 8, 8, 8, 8, 9, 9, 9, 9,
135.5845 +        10,10,11,11, 0, 8, 8, 8, 8, 9, 9, 9, 9,10,10,11,
135.5846 +        11, 0,12,12, 9, 9,10,10,10,10,11,11,11,12, 0,13,
135.5847 +        13, 9, 9,10,10,10,10,11,11,12,12, 0, 0, 0,10,10,
135.5848 +        10,10,11,11,12,12,12,12, 0, 0, 0,10,10,10,10,11,
135.5849 +        11,12,12,12,12, 0, 0, 0,14,14,11,11,11,11,12,12,
135.5850 +        13,13, 0, 0, 0,14,14,11,11,11,11,12,12,13,13, 0,
135.5851 +         0, 0, 0, 0,12,12,12,12,13,13,14,13, 0, 0, 0, 0,
135.5852 +         0,13,13,12,12,13,12,14,13,
135.5853 +};
135.5854 +
135.5855 +static const static_codebook _44c3_s_p8_0 = {
135.5856 +        2, 169,
135.5857 +        (long *)_vq_lengthlist__44c3_s_p8_0,
135.5858 +        1, -526516224, 1616117760, 4, 0,
135.5859 +        (long *)_vq_quantlist__44c3_s_p8_0,
135.5860 +        0
135.5861 +};
135.5862 +
135.5863 +static const long _vq_quantlist__44c3_s_p8_1[] = {
135.5864 +        2,
135.5865 +        1,
135.5866 +        3,
135.5867 +        0,
135.5868 +        4,
135.5869 +};
135.5870 +
135.5871 +static const long _vq_lengthlist__44c3_s_p8_1[] = {
135.5872 +         2, 4, 4, 5, 5, 6, 5, 5, 5, 5, 6, 4, 5, 5, 5, 6,
135.5873 +         5, 5, 5, 5, 6, 6, 6, 5, 5,
135.5874 +};
135.5875 +
135.5876 +static const static_codebook _44c3_s_p8_1 = {
135.5877 +        2, 25,
135.5878 +        (long *)_vq_lengthlist__44c3_s_p8_1,
135.5879 +        1, -533725184, 1611661312, 3, 0,
135.5880 +        (long *)_vq_quantlist__44c3_s_p8_1,
135.5881 +        0
135.5882 +};
135.5883 +
135.5884 +static const long _vq_quantlist__44c3_s_p9_0[] = {
135.5885 +        6,
135.5886 +        5,
135.5887 +        7,
135.5888 +        4,
135.5889 +        8,
135.5890 +        3,
135.5891 +        9,
135.5892 +        2,
135.5893 +        10,
135.5894 +        1,
135.5895 +        11,
135.5896 +        0,
135.5897 +        12,
135.5898 +};
135.5899 +
135.5900 +static const long _vq_lengthlist__44c3_s_p9_0[] = {
135.5901 +         1, 4, 4,12,12,12,12,12,12,12,12,12,12, 4, 9, 8,
135.5902 +        12,12,12,12,12,12,12,12,12,12, 2, 9, 7,12,12,12,
135.5903 +        12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
135.5904 +        12,12,12,12,12,12,11,12,12,12,12,12,12,12,12,12,
135.5905 +        12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
135.5906 +        12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
135.5907 +        12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
135.5908 +        12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
135.5909 +        12,12,12,12,12,12,12,12,12,12,11,11,11,11,11,11,
135.5910 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.5911 +        11,11,11,11,11,11,11,11,11,
135.5912 +};
135.5913 +
135.5914 +static const static_codebook _44c3_s_p9_0 = {
135.5915 +        2, 169,
135.5916 +        (long *)_vq_lengthlist__44c3_s_p9_0,
135.5917 +        1, -514332672, 1627381760, 4, 0,
135.5918 +        (long *)_vq_quantlist__44c3_s_p9_0,
135.5919 +        0
135.5920 +};
135.5921 +
135.5922 +static const long _vq_quantlist__44c3_s_p9_1[] = {
135.5923 +        7,
135.5924 +        6,
135.5925 +        8,
135.5926 +        5,
135.5927 +        9,
135.5928 +        4,
135.5929 +        10,
135.5930 +        3,
135.5931 +        11,
135.5932 +        2,
135.5933 +        12,
135.5934 +        1,
135.5935 +        13,
135.5936 +        0,
135.5937 +        14,
135.5938 +};
135.5939 +
135.5940 +static const long _vq_lengthlist__44c3_s_p9_1[] = {
135.5941 +         1, 4, 4, 6, 6, 7, 7, 8, 7, 9, 9,10,10,10,10, 6,
135.5942 +         5, 5, 7, 7, 8, 8,10, 8,11,10,12,12,13,13, 6, 5,
135.5943 +         5, 7, 7, 8, 8,10, 9,11,11,12,12,13,12,18, 8, 8,
135.5944 +         8, 8, 9, 9,10, 9,11,10,12,12,13,13,18, 8, 8, 8,
135.5945 +         8, 9, 9,10,10,11,11,13,12,14,13,18,11,11, 9, 9,
135.5946 +        10,10,11,11,11,12,13,12,13,14,18,11,11, 9, 8,11,
135.5947 +        10,11,11,11,11,12,12,14,13,18,18,18,10,11,10,11,
135.5948 +        12,12,12,12,13,12,14,13,18,18,18,10,11,11, 9,12,
135.5949 +        11,12,12,12,13,13,13,18,18,17,14,14,11,11,12,12,
135.5950 +        13,12,14,12,14,13,18,18,18,14,14,11,10,12, 9,12,
135.5951 +        13,13,13,13,13,18,18,17,16,18,13,13,12,12,13,11,
135.5952 +        14,12,14,14,17,18,18,17,18,13,12,13,10,12,11,14,
135.5953 +        14,14,14,17,18,18,18,18,15,16,12,12,13,10,14,12,
135.5954 +        14,15,18,18,18,16,17,16,14,12,11,13,10,13,13,14,
135.5955 +        15,
135.5956 +};
135.5957 +
135.5958 +static const static_codebook _44c3_s_p9_1 = {
135.5959 +        2, 225,
135.5960 +        (long *)_vq_lengthlist__44c3_s_p9_1,
135.5961 +        1, -522338304, 1620115456, 4, 0,
135.5962 +        (long *)_vq_quantlist__44c3_s_p9_1,
135.5963 +        0
135.5964 +};
135.5965 +
135.5966 +static const long _vq_quantlist__44c3_s_p9_2[] = {
135.5967 +        8,
135.5968 +        7,
135.5969 +        9,
135.5970 +        6,
135.5971 +        10,
135.5972 +        5,
135.5973 +        11,
135.5974 +        4,
135.5975 +        12,
135.5976 +        3,
135.5977 +        13,
135.5978 +        2,
135.5979 +        14,
135.5980 +        1,
135.5981 +        15,
135.5982 +        0,
135.5983 +        16,
135.5984 +};
135.5985 +
135.5986 +static const long _vq_lengthlist__44c3_s_p9_2[] = {
135.5987 +         2, 5, 5, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8,
135.5988 +         8,10, 6, 6, 7, 7, 8, 7, 8, 8, 8, 8, 8, 9, 9, 9,
135.5989 +         9, 9,10, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9,
135.5990 +         9, 9, 9,10, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9,
135.5991 +         9, 9, 9, 9,10,10,10, 7, 7, 8, 8, 8, 9, 9, 9, 9,
135.5992 +         9, 9, 9, 9, 9,11,11,11, 8, 8, 8, 8, 9, 9, 9, 9,
135.5993 +         9, 9, 9, 9, 9, 9,10,10,10, 8, 8, 8, 8, 9, 9, 9,
135.5994 +         9, 9, 9, 9, 9, 9, 9,10,10,10, 8, 9, 9, 9, 9, 9,
135.5995 +         9, 9, 9, 9, 9, 9,10, 9,10,10,10,11,11, 9, 9, 9,
135.5996 +         9, 9, 9, 9, 9, 9, 9, 9, 9,11,10,11,11,11, 9, 9,
135.5997 +         9, 9, 9, 9,10,10, 9, 9,10, 9,11,10,11,11,11, 9,
135.5998 +         9, 9, 9, 9, 9, 9, 9,10,10,10, 9,11,11,11,11,11,
135.5999 +         9, 9, 9, 9,10,10, 9, 9, 9, 9,10, 9,11,11,11,11,
135.6000 +        11,11,11, 9, 9, 9, 9, 9, 9,10,10,10,10,11,11,11,
135.6001 +        11,11,11,11,10, 9,10,10, 9,10, 9, 9,10, 9,11,10,
135.6002 +        10,11,11,11,11, 9,10, 9, 9, 9, 9,10,10,10,10,11,
135.6003 +        11,11,11,11,11,10,10,10, 9, 9,10, 9,10, 9,10,10,
135.6004 +        10,10,11,11,11,11,11,11,11, 9, 9, 9, 9, 9,10,10,
135.6005 +        10,
135.6006 +};
135.6007 +
135.6008 +static const static_codebook _44c3_s_p9_2 = {
135.6009 +        2, 289,
135.6010 +        (long *)_vq_lengthlist__44c3_s_p9_2,
135.6011 +        1, -529530880, 1611661312, 5, 0,
135.6012 +        (long *)_vq_quantlist__44c3_s_p9_2,
135.6013 +        0
135.6014 +};
135.6015 +
135.6016 +static const long _huff_lengthlist__44c3_s_short[] = {
135.6017 +        10, 9,13,11,14,10,12,13,13,14, 7, 2,12, 5,10, 5,
135.6018 +         7,10,12,14,12, 6, 9, 8, 7, 7, 9,11,13,16,10, 4,
135.6019 +        12, 5,10, 6, 8,12,14,16,12, 6, 8, 7, 6, 5, 7,11,
135.6020 +        12,16,10, 4, 8, 5, 6, 4, 6, 9,13,16,10, 6,10, 7,
135.6021 +         7, 6, 7, 9,13,15,12, 9,11, 9, 8, 6, 7,10,12,14,
135.6022 +        14,11,10, 9, 6, 5, 6, 9,11,13,15,13,11,10, 6, 5,
135.6023 +         6, 8, 9,11,
135.6024 +};
135.6025 +
135.6026 +static const static_codebook _huff_book__44c3_s_short = {
135.6027 +        2, 100,
135.6028 +        (long *)_huff_lengthlist__44c3_s_short,
135.6029 +        0, 0, 0, 0, 0,
135.6030 +        NULL,
135.6031 +        0
135.6032 +};
135.6033 +
135.6034 +static const long _huff_lengthlist__44c4_s_long[] = {
135.6035 +         4, 7,11,11,11,11,10,11,12,11, 5, 2,11, 5, 6, 6,
135.6036 +         7, 9,11,12,11, 9, 6,10, 6, 7, 8, 9,10,11,11, 5,
135.6037 +        11, 7, 8, 8, 9,11,13,14,11, 6, 5, 8, 4, 5, 7, 8,
135.6038 +        10,11,10, 6, 7, 7, 5, 5, 6, 8, 9,11,10, 7, 8, 9,
135.6039 +         6, 6, 6, 7, 8, 9,11, 9, 9,11, 7, 7, 6, 6, 7, 9,
135.6040 +        12,12,10,13, 9, 8, 7, 7, 7, 8,11,13,11,14,11,10,
135.6041 +         9, 8, 7, 7,
135.6042 +};
135.6043 +
135.6044 +static const static_codebook _huff_book__44c4_s_long = {
135.6045 +        2, 100,
135.6046 +        (long *)_huff_lengthlist__44c4_s_long,
135.6047 +        0, 0, 0, 0, 0,
135.6048 +        NULL,
135.6049 +        0
135.6050 +};
135.6051 +
135.6052 +static const long _vq_quantlist__44c4_s_p1_0[] = {
135.6053 +        1,
135.6054 +        0,
135.6055 +        2,
135.6056 +};
135.6057 +
135.6058 +static const long _vq_lengthlist__44c4_s_p1_0[] = {
135.6059 +         2, 4, 4, 0, 0, 0, 0, 0, 0, 5, 6, 6, 0, 0, 0, 0,
135.6060 +         0, 0, 5, 6, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6061 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6062 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6063 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6064 +         0, 5, 7, 7, 0, 0, 0, 0, 0, 0, 7, 8, 8, 0, 0, 0,
135.6065 +         0, 0, 0, 6, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6066 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6067 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6068 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6069 +         0, 0, 5, 7, 7, 0, 0, 0, 0, 0, 0, 6, 8, 7, 0, 0,
135.6070 +         0, 0, 0, 0, 7, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6071 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6072 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6073 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6074 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6075 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6076 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6077 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6078 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6079 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6080 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6081 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6082 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6083 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6084 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6085 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6086 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6087 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6088 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6089 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6090 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6091 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6092 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6093 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6094 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6095 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6096 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6097 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6098 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6099 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6100 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6101 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6102 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6103 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6104 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 7, 7, 0, 0, 0, 0,
135.6105 +         0, 0, 7, 8, 8, 0, 0, 0, 0, 0, 0, 7, 8, 8, 0, 0,
135.6106 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6107 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6108 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6109 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 8, 8, 0, 0, 0,
135.6110 +         0, 0, 0, 8, 9, 9, 0, 0, 0, 0, 0, 0, 8, 9, 9, 0,
135.6111 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6112 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6113 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6114 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 8, 8, 0, 0,
135.6115 +         0, 0, 0, 0, 8, 9, 8, 0, 0, 0, 0, 0, 0, 8, 9, 9,
135.6116 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6117 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6118 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6119 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6120 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6121 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6122 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6123 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6124 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6125 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6126 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6127 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6128 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6129 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6130 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6131 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6132 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6133 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6134 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6135 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6136 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6137 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6138 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6139 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6140 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6141 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6142 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6143 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6144 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6145 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6146 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6147 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6148 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6149 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6150 +         0, 0, 4, 7, 7, 0, 0, 0, 0, 0, 0, 7, 8, 8, 0, 0,
135.6151 +         0, 0, 0, 0, 7, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6152 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6153 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6154 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6155 +         0, 0, 0, 6, 8, 8, 0, 0, 0, 0, 0, 0, 8, 9, 9, 0,
135.6156 +         0, 0, 0, 0, 0, 8, 8, 9, 0, 0, 0, 0, 0, 0, 0, 0,
135.6157 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6158 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6159 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6160 +         0, 0, 0, 0, 7, 8, 8, 0, 0, 0, 0, 0, 0, 8, 9, 9,
135.6161 +         0, 0, 0, 0, 0, 0, 8, 9, 9, 0, 0, 0, 0, 0, 0, 0,
135.6162 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6163 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6164 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6165 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6166 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6167 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6168 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6169 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6170 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6171 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6172 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6173 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6174 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6175 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6176 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6177 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6178 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6179 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6180 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6181 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6182 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6183 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6184 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6185 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6186 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6187 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6188 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6189 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6190 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6191 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6192 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6193 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6194 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6195 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6196 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6197 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6198 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6199 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6200 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6201 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6202 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6203 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6204 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6205 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6206 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6207 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6208 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6209 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6210 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6211 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6212 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6213 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6214 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6215 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6216 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6217 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6218 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6219 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6220 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6221 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6222 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6223 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6224 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6225 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6226 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6227 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6228 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6229 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6230 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6231 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6232 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6233 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6234 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6235 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6236 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6237 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6238 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6239 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6240 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6241 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6242 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6243 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6244 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6245 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6246 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6247 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6248 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6249 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6250 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6251 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6252 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6253 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6254 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6255 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6256 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6257 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6258 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6259 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6260 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6261 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6262 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6263 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6264 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6265 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6266 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6267 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6268 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6269 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6270 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6271 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6272 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6273 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6274 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6275 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6276 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6277 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6278 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6279 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6280 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6281 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6282 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6283 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6284 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6285 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6286 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6287 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6288 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6289 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6290 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6291 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6292 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6293 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6294 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6295 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6296 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6297 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6298 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6299 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6300 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6301 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6302 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6303 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6304 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6305 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6306 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6307 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6308 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6309 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6310 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6311 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6312 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6313 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6314 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6315 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6316 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6317 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6318 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6319 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6320 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6321 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6322 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6323 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6324 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6325 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6326 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6327 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6328 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6329 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6330 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6331 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6332 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6333 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6334 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6335 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6336 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6337 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6338 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6339 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6340 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6341 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6342 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6343 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6344 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6345 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6346 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6347 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6348 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6349 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6350 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6351 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6352 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6353 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6354 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6355 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6356 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6357 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6358 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6359 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6360 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6361 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6362 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6363 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6364 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6365 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6366 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6367 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6368 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6369 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6370 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6371 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6372 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6373 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6374 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6375 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6376 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6377 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6378 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6379 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6380 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6381 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6382 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6383 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6384 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6385 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6386 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6387 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6388 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6389 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6390 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6391 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6392 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6393 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6394 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6395 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6396 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6397 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6398 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6399 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6400 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6401 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6402 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6403 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6404 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6405 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6406 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6407 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6408 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6409 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6410 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6411 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6412 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6413 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6414 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6415 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6416 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6417 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6418 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6419 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6420 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6421 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6422 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6423 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6424 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6425 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6426 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6427 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6428 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6429 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6430 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6431 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6432 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6433 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6434 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6435 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6436 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6437 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6438 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6439 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6440 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6441 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6442 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6443 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6444 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6445 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6446 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6447 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6448 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6449 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6450 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6451 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6452 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6453 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6454 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6455 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6456 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6457 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6458 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6459 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6460 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6461 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6462 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6463 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6464 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6465 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6466 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6467 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6468 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6469 +         0,
135.6470 +};
135.6471 +
135.6472 +static const static_codebook _44c4_s_p1_0 = {
135.6473 +        8, 6561,
135.6474 +        (long *)_vq_lengthlist__44c4_s_p1_0,
135.6475 +        1, -535822336, 1611661312, 2, 0,
135.6476 +        (long *)_vq_quantlist__44c4_s_p1_0,
135.6477 +        0
135.6478 +};
135.6479 +
135.6480 +static const long _vq_quantlist__44c4_s_p2_0[] = {
135.6481 +        2,
135.6482 +        1,
135.6483 +        3,
135.6484 +        0,
135.6485 +        4,
135.6486 +};
135.6487 +
135.6488 +static const long _vq_lengthlist__44c4_s_p2_0[] = {
135.6489 +         2, 5, 5, 0, 0, 0, 5, 5, 0, 0, 0, 5, 5, 0, 0, 0,
135.6490 +         7, 7, 0, 0, 0, 0, 0, 0, 0, 5, 6, 6, 0, 0, 0, 7,
135.6491 +         7, 0, 0, 0, 7, 7, 0, 0, 0,10,10, 0, 0, 0, 0, 0,
135.6492 +         0, 0, 5, 6, 6, 0, 0, 0, 7, 7, 0, 0, 0, 7, 7, 0,
135.6493 +         0, 0,10,10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6494 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6495 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6496 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6497 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6498 +         0, 0, 0, 0, 0, 0, 5, 8, 7, 0, 0, 0, 7, 7, 0, 0,
135.6499 +         0, 7, 7, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 5,
135.6500 +         7, 8, 0, 0, 0, 7, 7, 0, 0, 0, 7, 7, 0, 0, 0, 9,
135.6501 +         9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6502 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6503 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6504 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6505 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6506 +         0, 0, 0, 5, 7, 7, 0, 0, 0, 7, 7, 0, 0, 0, 7, 7,
135.6507 +         0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 5, 7, 7, 0,
135.6508 +         0, 0, 7, 7, 0, 0, 0, 7, 7, 0, 0, 0, 9, 9, 0, 0,
135.6509 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6510 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6511 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6512 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6513 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6514 +         7,10,10, 0, 0, 0, 9, 9, 0, 0, 0, 9, 9, 0, 0, 0,
135.6515 +        10,10, 0, 0, 0, 0, 0, 0, 0, 8,10,10, 0, 0, 0, 9,
135.6516 +         9, 0, 0, 0, 9, 9, 0, 0, 0,10,10, 0, 0, 0, 0, 0,
135.6517 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6518 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6519 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6520 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6521 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6522 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6523 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6524 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6525 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6526 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6527 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6528 +         0,
135.6529 +};
135.6530 +
135.6531 +static const static_codebook _44c4_s_p2_0 = {
135.6532 +        4, 625,
135.6533 +        (long *)_vq_lengthlist__44c4_s_p2_0,
135.6534 +        1, -533725184, 1611661312, 3, 0,
135.6535 +        (long *)_vq_quantlist__44c4_s_p2_0,
135.6536 +        0
135.6537 +};
135.6538 +
135.6539 +static const long _vq_quantlist__44c4_s_p3_0[] = {
135.6540 +        2,
135.6541 +        1,
135.6542 +        3,
135.6543 +        0,
135.6544 +        4,
135.6545 +};
135.6546 +
135.6547 +static const long _vq_lengthlist__44c4_s_p3_0[] = {
135.6548 +         2, 3, 3, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6549 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, 4, 6, 6, 0, 0,
135.6550 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6551 +         0, 0, 4, 4, 5, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6552 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 6, 9, 9,
135.6553 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6554 +         0, 0, 0, 0, 6, 6, 7, 9, 9, 0, 0, 0, 0, 0, 0, 0,
135.6555 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6556 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6557 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6558 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6559 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6560 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6561 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6562 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6563 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6564 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6565 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6566 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6567 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6568 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6569 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6570 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6571 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6572 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6573 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6574 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6575 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6576 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6577 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6578 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6579 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6580 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6581 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6582 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6583 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6584 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6585 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6586 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6587 +         0,
135.6588 +};
135.6589 +
135.6590 +static const static_codebook _44c4_s_p3_0 = {
135.6591 +        4, 625,
135.6592 +        (long *)_vq_lengthlist__44c4_s_p3_0,
135.6593 +        1, -533725184, 1611661312, 3, 0,
135.6594 +        (long *)_vq_quantlist__44c4_s_p3_0,
135.6595 +        0
135.6596 +};
135.6597 +
135.6598 +static const long _vq_quantlist__44c4_s_p4_0[] = {
135.6599 +        4,
135.6600 +        3,
135.6601 +        5,
135.6602 +        2,
135.6603 +        6,
135.6604 +        1,
135.6605 +        7,
135.6606 +        0,
135.6607 +        8,
135.6608 +};
135.6609 +
135.6610 +static const long _vq_lengthlist__44c4_s_p4_0[] = {
135.6611 +         2, 3, 3, 6, 6, 0, 0, 0, 0, 0, 4, 4, 6, 6, 0, 0,
135.6612 +         0, 0, 0, 4, 4, 6, 6, 0, 0, 0, 0, 0, 5, 5, 6, 6,
135.6613 +         0, 0, 0, 0, 0, 0, 0, 6, 6, 0, 0, 0, 0, 0, 0, 0,
135.6614 +         7, 8, 0, 0, 0, 0, 0, 0, 0, 7, 7, 0, 0, 0, 0, 0,
135.6615 +         0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.6616 +         0,
135.6617 +};
135.6618 +
135.6619 +static const static_codebook _44c4_s_p4_0 = {
135.6620 +        2, 81,
135.6621 +        (long *)_vq_lengthlist__44c4_s_p4_0,
135.6622 +        1, -531628032, 1611661312, 4, 0,
135.6623 +        (long *)_vq_quantlist__44c4_s_p4_0,
135.6624 +        0
135.6625 +};
135.6626 +
135.6627 +static const long _vq_quantlist__44c4_s_p5_0[] = {
135.6628 +        4,
135.6629 +        3,
135.6630 +        5,
135.6631 +        2,
135.6632 +        6,
135.6633 +        1,
135.6634 +        7,
135.6635 +        0,
135.6636 +        8,
135.6637 +};
135.6638 +
135.6639 +static const long _vq_lengthlist__44c4_s_p5_0[] = {
135.6640 +         2, 3, 3, 6, 6, 7, 7, 9, 9, 0, 4, 4, 6, 6, 7, 7,
135.6641 +         9, 9, 0, 4, 5, 6, 6, 7, 7, 9, 9, 0, 6, 6, 7, 7,
135.6642 +         8, 8,10,10, 0, 0, 0, 7, 7, 8, 8,10, 9, 0, 0, 0,
135.6643 +         9, 8, 8, 8,10,10, 0, 0, 0, 8, 8, 8, 8,10,10, 0,
135.6644 +         0, 0,10,10, 9, 9,11,11, 0, 0, 0, 0, 0, 9, 9,10,
135.6645 +        10,
135.6646 +};
135.6647 +
135.6648 +static const static_codebook _44c4_s_p5_0 = {
135.6649 +        2, 81,
135.6650 +        (long *)_vq_lengthlist__44c4_s_p5_0,
135.6651 +        1, -531628032, 1611661312, 4, 0,
135.6652 +        (long *)_vq_quantlist__44c4_s_p5_0,
135.6653 +        0
135.6654 +};
135.6655 +
135.6656 +static const long _vq_quantlist__44c4_s_p6_0[] = {
135.6657 +        8,
135.6658 +        7,
135.6659 +        9,
135.6660 +        6,
135.6661 +        10,
135.6662 +        5,
135.6663 +        11,
135.6664 +        4,
135.6665 +        12,
135.6666 +        3,
135.6667 +        13,
135.6668 +        2,
135.6669 +        14,
135.6670 +        1,
135.6671 +        15,
135.6672 +        0,
135.6673 +        16,
135.6674 +};
135.6675 +
135.6676 +static const long _vq_lengthlist__44c4_s_p6_0[] = {
135.6677 +         2, 4, 4, 6, 6, 8, 8, 9, 9, 8, 8, 9, 9,10,10,11,
135.6678 +        11, 0, 4, 4, 6, 6, 8, 8, 9, 9, 9, 9,10,10,11,11,
135.6679 +        11,11, 0, 4, 4, 7, 6, 8, 8, 9, 9, 9, 9,10,10,11,
135.6680 +        11,11,11, 0, 6, 6, 7, 7, 8, 8, 9, 9, 9, 9,10,10,
135.6681 +        11,11,11,12, 0, 0, 0, 7, 7, 8, 8, 9, 9, 9, 9,10,
135.6682 +        10,11,11,12,12, 0, 0, 0, 8, 8, 8, 8, 9, 9, 9, 9,
135.6683 +        10,10,11,11,12,12, 0, 0, 0, 8, 8, 8, 8, 9, 9, 9,
135.6684 +         9,10,10,11,11,12,12, 0, 0, 0, 9, 9, 9, 9,10,10,
135.6685 +        10,10,11,11,11,11,12,12, 0, 0, 0, 0, 0, 9, 9,10,
135.6686 +        10,10,10,11,11,11,11,12,12, 0, 0, 0, 0, 0, 9, 9,
135.6687 +         9,10,10,10,11,11,11,11,12,12, 0, 0, 0, 0, 0, 9,
135.6688 +         9, 9, 9,10,10,11,11,11,12,12,12, 0, 0, 0, 0, 0,
135.6689 +        10,10,10,10,11,11,11,11,12,12,13,12, 0, 0, 0, 0,
135.6690 +         0, 0, 0,10,10,11,11,11,11,12,12,12,12, 0, 0, 0,
135.6691 +         0, 0, 0, 0,11,11,11,11,12,12,12,12,13,13, 0, 0,
135.6692 +         0, 0, 0, 0, 0,11,11,11,11,12,12,12,12,13,13, 0,
135.6693 +         0, 0, 0, 0, 0, 0,12,12,12,12,12,12,13,13,13,13,
135.6694 +         0, 0, 0, 0, 0, 0, 0, 0, 0,12,12,12,12,12,13,13,
135.6695 +        13,
135.6696 +};
135.6697 +
135.6698 +static const static_codebook _44c4_s_p6_0 = {
135.6699 +        2, 289,
135.6700 +        (long *)_vq_lengthlist__44c4_s_p6_0,
135.6701 +        1, -529530880, 1611661312, 5, 0,
135.6702 +        (long *)_vq_quantlist__44c4_s_p6_0,
135.6703 +        0
135.6704 +};
135.6705 +
135.6706 +static const long _vq_quantlist__44c4_s_p7_0[] = {
135.6707 +        1,
135.6708 +        0,
135.6709 +        2,
135.6710 +};
135.6711 +
135.6712 +static const long _vq_lengthlist__44c4_s_p7_0[] = {
135.6713 +         1, 4, 4, 7, 6, 6, 7, 6, 6, 4, 7, 7,10, 9, 9,11,
135.6714 +         9, 9, 4, 7, 7,10, 9, 9,11, 9, 9, 7,10,10,11,11,
135.6715 +        10,11,11,11, 6, 9, 9,11,10,10,11,10,10, 6, 9, 9,
135.6716 +        11,10,10,11,10,10, 7,11,11,12,11,11,12,11,11, 6,
135.6717 +         9, 9,11,10,10,11,10,10, 6, 9, 9,11,10,10,11,10,
135.6718 +        10,
135.6719 +};
135.6720 +
135.6721 +static const static_codebook _44c4_s_p7_0 = {
135.6722 +        4, 81,
135.6723 +        (long *)_vq_lengthlist__44c4_s_p7_0,
135.6724 +        1, -529137664, 1618345984, 2, 0,
135.6725 +        (long *)_vq_quantlist__44c4_s_p7_0,
135.6726 +        0
135.6727 +};
135.6728 +
135.6729 +static const long _vq_quantlist__44c4_s_p7_1[] = {
135.6730 +        5,
135.6731 +        4,
135.6732 +        6,
135.6733 +        3,
135.6734 +        7,
135.6735 +        2,
135.6736 +        8,
135.6737 +        1,
135.6738 +        9,
135.6739 +        0,
135.6740 +        10,
135.6741 +};
135.6742 +
135.6743 +static const long _vq_lengthlist__44c4_s_p7_1[] = {
135.6744 +         2, 4, 4, 6, 6, 7, 7, 7, 7, 8, 8,10, 5, 5, 6, 6,
135.6745 +         7, 7, 8, 8, 8, 8,10, 5, 5, 6, 6, 7, 7, 8, 8, 8,
135.6746 +         8,10, 6, 6, 7, 7, 8, 8, 8, 8, 8, 8,10,10,10, 7,
135.6747 +         7, 8, 8, 8, 8, 8, 8,10,10,10, 8, 7, 8, 8, 8, 8,
135.6748 +         8, 8,10,10,10, 7, 7, 8, 8, 8, 8, 8, 8,10,10,10,
135.6749 +         8, 8, 8, 8, 8, 8, 8, 8,10,10,10,10,10, 8, 8, 8,
135.6750 +         8, 8, 8,10,10,10,10,10, 9, 9, 8, 8, 9, 8,10,10,
135.6751 +        10,10,10, 8, 8, 8, 8, 9, 9,
135.6752 +};
135.6753 +
135.6754 +static const static_codebook _44c4_s_p7_1 = {
135.6755 +        2, 121,
135.6756 +        (long *)_vq_lengthlist__44c4_s_p7_1,
135.6757 +        1, -531365888, 1611661312, 4, 0,
135.6758 +        (long *)_vq_quantlist__44c4_s_p7_1,
135.6759 +        0
135.6760 +};
135.6761 +
135.6762 +static const long _vq_quantlist__44c4_s_p8_0[] = {
135.6763 +        6,
135.6764 +        5,
135.6765 +        7,
135.6766 +        4,
135.6767 +        8,
135.6768 +        3,
135.6769 +        9,
135.6770 +        2,
135.6771 +        10,
135.6772 +        1,
135.6773 +        11,
135.6774 +        0,
135.6775 +        12,
135.6776 +};
135.6777 +
135.6778 +static const long _vq_lengthlist__44c4_s_p8_0[] = {
135.6779 +         1, 4, 4, 6, 6, 7, 7, 8, 8, 9, 9,10,10, 6, 5, 5,
135.6780 +         7, 7, 8, 8, 8, 8, 9,10,11,11, 7, 5, 5, 7, 7, 8,
135.6781 +         8, 9, 9,10,10,11,11, 0, 8, 8, 8, 8, 9, 9, 9, 9,
135.6782 +        10,10,11,11, 0, 8, 8, 8, 8, 9, 9, 9, 9,10,10,11,
135.6783 +        11, 0,12,12, 9, 9, 9, 9,10,10,10,10,11,11, 0,13,
135.6784 +        13, 9, 9,10, 9,10,10,11,11,11,12, 0, 0, 0,10,10,
135.6785 +        10,10,10,10,11,11,12,12, 0, 0, 0,10,10,10,10,10,
135.6786 +        10,11,11,12,12, 0, 0, 0,14,14,11,11,11,11,12,12,
135.6787 +        12,12, 0, 0, 0,14,14,11,11,11,11,12,12,12,13, 0,
135.6788 +         0, 0, 0, 0,12,12,12,12,12,12,13,13, 0, 0, 0, 0,
135.6789 +         0,13,12,12,12,12,12,13,13,
135.6790 +};
135.6791 +
135.6792 +static const static_codebook _44c4_s_p8_0 = {
135.6793 +        2, 169,
135.6794 +        (long *)_vq_lengthlist__44c4_s_p8_0,
135.6795 +        1, -526516224, 1616117760, 4, 0,
135.6796 +        (long *)_vq_quantlist__44c4_s_p8_0,
135.6797 +        0
135.6798 +};
135.6799 +
135.6800 +static const long _vq_quantlist__44c4_s_p8_1[] = {
135.6801 +        2,
135.6802 +        1,
135.6803 +        3,
135.6804 +        0,
135.6805 +        4,
135.6806 +};
135.6807 +
135.6808 +static const long _vq_lengthlist__44c4_s_p8_1[] = {
135.6809 +         2, 4, 4, 5, 5, 6, 5, 5, 5, 5, 6, 5, 4, 5, 5, 6,
135.6810 +         5, 5, 5, 5, 6, 6, 6, 5, 5,
135.6811 +};
135.6812 +
135.6813 +static const static_codebook _44c4_s_p8_1 = {
135.6814 +        2, 25,
135.6815 +        (long *)_vq_lengthlist__44c4_s_p8_1,
135.6816 +        1, -533725184, 1611661312, 3, 0,
135.6817 +        (long *)_vq_quantlist__44c4_s_p8_1,
135.6818 +        0
135.6819 +};
135.6820 +
135.6821 +static const long _vq_quantlist__44c4_s_p9_0[] = {
135.6822 +        6,
135.6823 +        5,
135.6824 +        7,
135.6825 +        4,
135.6826 +        8,
135.6827 +        3,
135.6828 +        9,
135.6829 +        2,
135.6830 +        10,
135.6831 +        1,
135.6832 +        11,
135.6833 +        0,
135.6834 +        12,
135.6835 +};
135.6836 +
135.6837 +static const long _vq_lengthlist__44c4_s_p9_0[] = {
135.6838 +         1, 3, 3,12,12,12,12,12,12,12,12,12,12, 4, 7, 7,
135.6839 +        12,12,12,12,12,12,12,12,12,12, 3, 8, 8,12,12,12,
135.6840 +        12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
135.6841 +        12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
135.6842 +        12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
135.6843 +        12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
135.6844 +        12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
135.6845 +        12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
135.6846 +        12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
135.6847 +        12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
135.6848 +        12,12,12,12,12,12,12,12,12,
135.6849 +};
135.6850 +
135.6851 +static const static_codebook _44c4_s_p9_0 = {
135.6852 +        2, 169,
135.6853 +        (long *)_vq_lengthlist__44c4_s_p9_0,
135.6854 +        1, -513964032, 1628680192, 4, 0,
135.6855 +        (long *)_vq_quantlist__44c4_s_p9_0,
135.6856 +        0
135.6857 +};
135.6858 +
135.6859 +static const long _vq_quantlist__44c4_s_p9_1[] = {
135.6860 +        7,
135.6861 +        6,
135.6862 +        8,
135.6863 +        5,
135.6864 +        9,
135.6865 +        4,
135.6866 +        10,
135.6867 +        3,
135.6868 +        11,
135.6869 +        2,
135.6870 +        12,
135.6871 +        1,
135.6872 +        13,
135.6873 +        0,
135.6874 +        14,
135.6875 +};
135.6876 +
135.6877 +static const long _vq_lengthlist__44c4_s_p9_1[] = {
135.6878 +         1, 4, 4, 5, 5, 7, 7, 9, 8,10, 9,10,10,10,10, 6,
135.6879 +         5, 5, 7, 7, 9, 8,10, 9,11,10,12,12,13,13, 6, 5,
135.6880 +         5, 7, 7, 9, 9,10,10,11,11,12,12,12,13,19, 8, 8,
135.6881 +         8, 8, 9, 9,10,10,12,11,12,12,13,13,19, 8, 8, 8,
135.6882 +         8, 9, 9,11,11,12,12,13,13,13,13,19,12,12, 9, 9,
135.6883 +        11,11,11,11,12,11,13,12,13,13,18,12,12, 9, 9,11,
135.6884 +        10,11,11,12,12,12,13,13,14,19,18,18,11,11,11,11,
135.6885 +        12,12,13,12,13,13,14,14,16,18,18,11,11,11,10,12,
135.6886 +        11,13,13,13,13,13,14,17,18,18,14,15,11,12,12,13,
135.6887 +        13,13,13,14,14,14,18,18,18,15,15,12,10,13,10,13,
135.6888 +        13,13,13,13,14,18,17,18,17,18,12,13,12,13,13,13,
135.6889 +        14,14,16,14,18,17,18,18,17,13,12,13,10,12,12,14,
135.6890 +        14,14,14,17,18,18,18,18,14,15,12,12,13,12,14,14,
135.6891 +        15,15,18,18,18,17,18,15,14,12,11,12,12,14,14,14,
135.6892 +        15,
135.6893 +};
135.6894 +
135.6895 +static const static_codebook _44c4_s_p9_1 = {
135.6896 +        2, 225,
135.6897 +        (long *)_vq_lengthlist__44c4_s_p9_1,
135.6898 +        1, -520986624, 1620377600, 4, 0,
135.6899 +        (long *)_vq_quantlist__44c4_s_p9_1,
135.6900 +        0
135.6901 +};
135.6902 +
135.6903 +static const long _vq_quantlist__44c4_s_p9_2[] = {
135.6904 +        10,
135.6905 +        9,
135.6906 +        11,
135.6907 +        8,
135.6908 +        12,
135.6909 +        7,
135.6910 +        13,
135.6911 +        6,
135.6912 +        14,
135.6913 +        5,
135.6914 +        15,
135.6915 +        4,
135.6916 +        16,
135.6917 +        3,
135.6918 +        17,
135.6919 +        2,
135.6920 +        18,
135.6921 +        1,
135.6922 +        19,
135.6923 +        0,
135.6924 +        20,
135.6925 +};
135.6926 +
135.6927 +static const long _vq_lengthlist__44c4_s_p9_2[] = {
135.6928 +         2, 5, 5, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8,
135.6929 +         8, 9, 9, 9, 9,11, 6, 6, 7, 7, 8, 8, 8, 8, 9, 9,
135.6930 +         9, 9, 9, 9, 9, 9,10,10,10,10,11, 6, 6, 7, 7, 8,
135.6931 +         8, 8, 8, 9, 9, 9, 9, 9, 9,10, 9,10,10,10,10,11,
135.6932 +         7, 7, 7, 7, 8, 8, 9, 9, 9, 9, 9, 9, 9,10,10,10,
135.6933 +        10,10,10,10,12,11,11, 7, 7, 8, 8, 9, 9, 9, 9, 9,
135.6934 +         9,10,10,10,10,10,10,10,10,12,11,12, 8, 8, 8, 8,
135.6935 +         9, 9, 9, 9, 9,10,10,10,10,10,10,10,10,10,11,11,
135.6936 +        11, 8, 8, 8, 8, 9, 9, 9, 9,10,10,10,10,10,10,10,
135.6937 +        10,10,10,11,11,12, 9, 9, 9, 9, 9, 9,10, 9,10,10,
135.6938 +        10,10,10,10,10,10,10,10,11,11,11,11,11, 9, 9, 9,
135.6939 +         9,10,10,10,10,10,10,10,10,10,10,10,10,11,12,11,
135.6940 +        11,11, 9, 9, 9,10,10,10,10,10,10,10,10,10,10,10,
135.6941 +        10,10,11,11,11,11,11, 9, 9, 9, 9,10,10,10,10,10,
135.6942 +        10,10,10,10,10,10,10,11,11,11,12,12,10,10,10,10,
135.6943 +        10,10,10,10,10,10,10,10,10,10,10,10,11,12,11,12,
135.6944 +        11,11,11, 9,10,10,10,10,10,10,10,10,10,10,10,10,
135.6945 +        10,11,12,11,11,11,11,11,10,10,10,10,10,10,10,10,
135.6946 +        10,10,10,10,10,10,11,11,11,12,11,11,11,10,10,10,
135.6947 +        10,10,10,10,10,10,10,10,10,10,10,12,11,11,12,11,
135.6948 +        11,11,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.6949 +        11,11,11,11,11,11,11,11,11,10,10,10,10,10,10,10,
135.6950 +        10,10,10,10,10,11,11,11,11,12,12,11,11,11,11,11,
135.6951 +        11,11,10,10,10,10,10,10,10,10,12,12,12,11,11,11,
135.6952 +        12,11,11,11,10,10,10,10,10,10,10,10,10,10,10,12,
135.6953 +        11,12,12,12,12,12,11,12,11,11,10,10,10,10,10,10,
135.6954 +        10,10,10,10,12,12,12,12,11,11,11,11,11,11,11,10,
135.6955 +        10,10,10,10,10,10,10,10,10,
135.6956 +};
135.6957 +
135.6958 +static const static_codebook _44c4_s_p9_2 = {
135.6959 +        2, 441,
135.6960 +        (long *)_vq_lengthlist__44c4_s_p9_2,
135.6961 +        1, -529268736, 1611661312, 5, 0,
135.6962 +        (long *)_vq_quantlist__44c4_s_p9_2,
135.6963 +        0
135.6964 +};
135.6965 +
135.6966 +static const long _huff_lengthlist__44c4_s_short[] = {
135.6967 +         4, 7,14,10,15,10,12,15,16,15, 4, 2,11, 5,10, 6,
135.6968 +         8,11,14,14,14,10, 7,11, 6, 8,10,11,13,15, 9, 4,
135.6969 +        11, 5, 9, 6, 9,12,14,15,14, 9, 6, 9, 4, 5, 7,10,
135.6970 +        12,13, 9, 5, 7, 6, 5, 5, 7,10,13,13,10, 8, 9, 8,
135.6971 +         7, 6, 8,10,14,14,13,11,10,10, 7, 7, 8,11,14,15,
135.6972 +        13,12, 9, 9, 6, 5, 7,10,14,17,15,13,11,10, 6, 6,
135.6973 +         7, 9,12,17,
135.6974 +};
135.6975 +
135.6976 +static const static_codebook _huff_book__44c4_s_short = {
135.6977 +        2, 100,
135.6978 +        (long *)_huff_lengthlist__44c4_s_short,
135.6979 +        0, 0, 0, 0, 0,
135.6980 +        NULL,
135.6981 +        0
135.6982 +};
135.6983 +
135.6984 +static const long _huff_lengthlist__44c5_s_long[] = {
135.6985 +         3, 8, 9,13,10,12,12,12,12,12, 6, 4, 6, 8, 6, 8,
135.6986 +        10,10,11,12, 8, 5, 4,10, 4, 7, 8, 9,10,11,13, 8,
135.6987 +        10, 8, 9, 9,11,12,13,14,10, 6, 4, 9, 3, 5, 6, 8,
135.6988 +        10,11,11, 8, 6, 9, 5, 5, 6, 7, 9,11,12, 9, 7,11,
135.6989 +         6, 6, 6, 7, 8,10,12,11, 9,12, 7, 7, 6, 6, 7, 9,
135.6990 +        13,12,10,13, 9, 8, 7, 7, 7, 8,11,15,11,15,11,10,
135.6991 +         9, 8, 7, 7,
135.6992 +};
135.6993 +
135.6994 +static const static_codebook _huff_book__44c5_s_long = {
135.6995 +        2, 100,
135.6996 +        (long *)_huff_lengthlist__44c5_s_long,
135.6997 +        0, 0, 0, 0, 0,
135.6998 +        NULL,
135.6999 +        0
135.7000 +};
135.7001 +
135.7002 +static const long _vq_quantlist__44c5_s_p1_0[] = {
135.7003 +        1,
135.7004 +        0,
135.7005 +        2,
135.7006 +};
135.7007 +
135.7008 +static const long _vq_lengthlist__44c5_s_p1_0[] = {
135.7009 +         2, 4, 4, 0, 0, 0, 0, 0, 0, 4, 7, 7, 0, 0, 0, 0,
135.7010 +         0, 0, 4, 6, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7011 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7012 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7013 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7014 +         0, 5, 7, 7, 0, 0, 0, 0, 0, 0, 7, 9, 9, 0, 0, 0,
135.7015 +         0, 0, 0, 7, 8, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7016 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7017 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7018 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7019 +         0, 0, 4, 7, 7, 0, 0, 0, 0, 0, 0, 7, 9, 8, 0, 0,
135.7020 +         0, 0, 0, 0, 7, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7021 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7022 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7023 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7024 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7025 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7026 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7027 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7028 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7029 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7030 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7031 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7032 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7033 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7034 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7035 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7036 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7037 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7038 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7039 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7040 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7041 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7042 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7043 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7044 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7045 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7046 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7047 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7048 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7049 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7050 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7051 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7052 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7053 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7054 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 7, 7, 0, 0, 0, 0,
135.7055 +         0, 0, 7, 9, 9, 0, 0, 0, 0, 0, 0, 7, 9, 9, 0, 0,
135.7056 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7057 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7058 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7059 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 9, 9, 0, 0, 0,
135.7060 +         0, 0, 0, 9,10,11, 0, 0, 0, 0, 0, 0, 9,10,10, 0,
135.7061 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7062 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7063 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7064 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 9, 9, 0, 0,
135.7065 +         0, 0, 0, 0, 8,10, 9, 0, 0, 0, 0, 0, 0, 9,10,11,
135.7066 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7067 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7068 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7069 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7070 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7071 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7072 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7073 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7074 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7075 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7076 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7077 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7078 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7079 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7080 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7081 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7082 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7083 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7084 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7085 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7086 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7087 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7088 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7089 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7090 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7091 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7092 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7093 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7094 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7095 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7096 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7097 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7098 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7099 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7100 +         0, 0, 4, 7, 7, 0, 0, 0, 0, 0, 0, 7, 9, 9, 0, 0,
135.7101 +         0, 0, 0, 0, 7, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7102 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7103 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7104 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7105 +         0, 0, 0, 7, 9, 9, 0, 0, 0, 0, 0, 0, 9,11,10, 0,
135.7106 +         0, 0, 0, 0, 0, 8, 9,10, 0, 0, 0, 0, 0, 0, 0, 0,
135.7107 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7108 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7109 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7110 +         0, 0, 0, 0, 7, 9, 9, 0, 0, 0, 0, 0, 0, 9,10,10,
135.7111 +         0, 0, 0, 0, 0, 0, 9,11,10, 0, 0, 0, 0, 0, 0, 0,
135.7112 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7113 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7114 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7115 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7116 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7117 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7118 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7119 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7120 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7121 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7122 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7123 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7124 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7125 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7126 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7127 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7128 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7129 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7130 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7131 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7132 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7133 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7134 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7135 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7136 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7137 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7138 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7139 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7140 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7141 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7142 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7143 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7144 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7145 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7146 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7147 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7148 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7149 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7150 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7151 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7152 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7153 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7154 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7155 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7156 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7157 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7158 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7159 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7160 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7161 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7162 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7163 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7164 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7165 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7166 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7167 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7168 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7169 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7170 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7171 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7172 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7173 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7174 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7175 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7176 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7177 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7178 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7179 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7180 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7181 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7182 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7183 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7184 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7185 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7186 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7187 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7188 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7189 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7190 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7191 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7192 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7193 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7194 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7195 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7196 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7197 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7198 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7199 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7200 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7201 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7202 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7203 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7204 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7205 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7206 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7207 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7208 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7209 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7210 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7211 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7212 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7213 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7214 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7215 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7216 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7217 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7218 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7219 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7220 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7221 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7222 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7223 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7224 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7225 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7226 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7227 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7228 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7229 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7230 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7231 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7232 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7233 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7234 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7235 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7236 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7237 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7238 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7239 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7240 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7241 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7242 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7243 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7244 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7245 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7246 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7247 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7248 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7249 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7250 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7251 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7252 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7253 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7254 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7255 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7256 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7257 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7258 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7259 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7260 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7261 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7262 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7263 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7264 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7265 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7266 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7267 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7268 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7269 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7270 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7271 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7272 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7273 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7274 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7275 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7276 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7277 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7278 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7279 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7280 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7281 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7282 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7283 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7284 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7285 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7286 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7287 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7288 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7289 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7290 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7291 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7292 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7293 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7294 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7295 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7296 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7297 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7298 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7299 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7300 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7301 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7302 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7303 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7304 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7305 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7306 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7307 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7308 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7309 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7310 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7311 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7312 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7313 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7314 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7315 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7316 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7317 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7318 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7319 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7320 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7321 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7322 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7323 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7324 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7325 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7326 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7327 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7328 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7329 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7330 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7331 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7332 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7333 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7334 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7335 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7336 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7337 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7338 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7339 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7340 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7341 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7342 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7343 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7344 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7345 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7346 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7347 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7348 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7349 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7350 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7351 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7352 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7353 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7354 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7355 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7356 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7357 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7358 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7359 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7360 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7361 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7362 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7363 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7364 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7365 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7366 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7367 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7368 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7369 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7370 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7371 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7372 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7373 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7374 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7375 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7376 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7377 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7378 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7379 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7380 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7381 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7382 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7383 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7384 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7385 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7386 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7387 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7388 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7389 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7390 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7391 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7392 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7393 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7394 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7395 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7396 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7397 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7398 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7399 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7400 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7401 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7402 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7403 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7404 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7405 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7406 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7407 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7408 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7409 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7410 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7411 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7412 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7413 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7414 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7415 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7416 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7417 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7418 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7419 +         0,
135.7420 +};
135.7421 +
135.7422 +static const static_codebook _44c5_s_p1_0 = {
135.7423 +        8, 6561,
135.7424 +        (long *)_vq_lengthlist__44c5_s_p1_0,
135.7425 +        1, -535822336, 1611661312, 2, 0,
135.7426 +        (long *)_vq_quantlist__44c5_s_p1_0,
135.7427 +        0
135.7428 +};
135.7429 +
135.7430 +static const long _vq_quantlist__44c5_s_p2_0[] = {
135.7431 +        2,
135.7432 +        1,
135.7433 +        3,
135.7434 +        0,
135.7435 +        4,
135.7436 +};
135.7437 +
135.7438 +static const long _vq_lengthlist__44c5_s_p2_0[] = {
135.7439 +         2, 4, 4, 0, 0, 0, 5, 5, 0, 0, 0, 5, 5, 0, 0, 0,
135.7440 +         8, 7, 0, 0, 0, 0, 0, 0, 0, 4, 6, 6, 0, 0, 0, 8,
135.7441 +         8, 0, 0, 0, 8, 7, 0, 0, 0,10,10, 0, 0, 0, 0, 0,
135.7442 +         0, 0, 4, 6, 6, 0, 0, 0, 8, 8, 0, 0, 0, 7, 8, 0,
135.7443 +         0, 0,10,10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7444 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7445 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7446 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7447 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7448 +         0, 0, 0, 0, 0, 0, 5, 8, 7, 0, 0, 0, 8, 8, 0, 0,
135.7449 +         0, 8, 8, 0, 0, 0,10,10, 0, 0, 0, 0, 0, 0, 0, 5,
135.7450 +         7, 8, 0, 0, 0, 8, 8, 0, 0, 0, 8, 8, 0, 0, 0,10,
135.7451 +        10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7452 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7453 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7454 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7455 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7456 +         0, 0, 0, 5, 8, 8, 0, 0, 0, 8, 8, 0, 0, 0, 8, 8,
135.7457 +         0, 0, 0,10,10, 0, 0, 0, 0, 0, 0, 0, 5, 8, 8, 0,
135.7458 +         0, 0, 8, 8, 0, 0, 0, 8, 8, 0, 0, 0,10,10, 0, 0,
135.7459 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7460 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7461 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7462 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7463 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7464 +         8,10,10, 0, 0, 0,10,10, 0, 0, 0, 9,10, 0, 0, 0,
135.7465 +        11,10, 0, 0, 0, 0, 0, 0, 0, 8,10,10, 0, 0, 0,10,
135.7466 +        10, 0, 0, 0,10,10, 0, 0, 0,10,11, 0, 0, 0, 0, 0,
135.7467 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7468 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7469 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7470 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7471 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7472 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7473 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7474 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7475 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7476 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7477 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7478 +         0,
135.7479 +};
135.7480 +
135.7481 +static const static_codebook _44c5_s_p2_0 = {
135.7482 +        4, 625,
135.7483 +        (long *)_vq_lengthlist__44c5_s_p2_0,
135.7484 +        1, -533725184, 1611661312, 3, 0,
135.7485 +        (long *)_vq_quantlist__44c5_s_p2_0,
135.7486 +        0
135.7487 +};
135.7488 +
135.7489 +static const long _vq_quantlist__44c5_s_p3_0[] = {
135.7490 +        2,
135.7491 +        1,
135.7492 +        3,
135.7493 +        0,
135.7494 +        4,
135.7495 +};
135.7496 +
135.7497 +static const long _vq_lengthlist__44c5_s_p3_0[] = {
135.7498 +         2, 4, 3, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7499 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, 5, 6, 6, 0, 0,
135.7500 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7501 +         0, 0, 3, 5, 5, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7502 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 6, 8, 8,
135.7503 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7504 +         0, 0, 0, 0, 5, 6, 6, 8, 8, 0, 0, 0, 0, 0, 0, 0,
135.7505 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7506 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7507 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7508 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7509 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7510 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7511 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7512 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7513 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7514 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7515 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7516 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7517 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7518 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7519 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7520 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7521 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7522 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7523 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7524 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7525 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7526 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7527 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7528 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7529 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7530 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7531 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7532 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7533 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7534 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7535 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7536 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7537 +         0,
135.7538 +};
135.7539 +
135.7540 +static const static_codebook _44c5_s_p3_0 = {
135.7541 +        4, 625,
135.7542 +        (long *)_vq_lengthlist__44c5_s_p3_0,
135.7543 +        1, -533725184, 1611661312, 3, 0,
135.7544 +        (long *)_vq_quantlist__44c5_s_p3_0,
135.7545 +        0
135.7546 +};
135.7547 +
135.7548 +static const long _vq_quantlist__44c5_s_p4_0[] = {
135.7549 +        4,
135.7550 +        3,
135.7551 +        5,
135.7552 +        2,
135.7553 +        6,
135.7554 +        1,
135.7555 +        7,
135.7556 +        0,
135.7557 +        8,
135.7558 +};
135.7559 +
135.7560 +static const long _vq_lengthlist__44c5_s_p4_0[] = {
135.7561 +         2, 3, 3, 6, 6, 0, 0, 0, 0, 0, 4, 4, 6, 6, 0, 0,
135.7562 +         0, 0, 0, 4, 4, 6, 6, 0, 0, 0, 0, 0, 5, 5, 6, 6,
135.7563 +         0, 0, 0, 0, 0, 0, 0, 6, 6, 0, 0, 0, 0, 0, 0, 0,
135.7564 +         7, 7, 0, 0, 0, 0, 0, 0, 0, 8, 7, 0, 0, 0, 0, 0,
135.7565 +         0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.7566 +         0,
135.7567 +};
135.7568 +
135.7569 +static const static_codebook _44c5_s_p4_0 = {
135.7570 +        2, 81,
135.7571 +        (long *)_vq_lengthlist__44c5_s_p4_0,
135.7572 +        1, -531628032, 1611661312, 4, 0,
135.7573 +        (long *)_vq_quantlist__44c5_s_p4_0,
135.7574 +        0
135.7575 +};
135.7576 +
135.7577 +static const long _vq_quantlist__44c5_s_p5_0[] = {
135.7578 +        4,
135.7579 +        3,
135.7580 +        5,
135.7581 +        2,
135.7582 +        6,
135.7583 +        1,
135.7584 +        7,
135.7585 +        0,
135.7586 +        8,
135.7587 +};
135.7588 +
135.7589 +static const long _vq_lengthlist__44c5_s_p5_0[] = {
135.7590 +         2, 4, 3, 6, 6, 7, 7, 9, 9, 0, 4, 4, 6, 6, 7, 7,
135.7591 +         9, 9, 0, 4, 4, 6, 6, 7, 7, 9, 9, 0, 6, 6, 7, 7,
135.7592 +         7, 7, 9, 9, 0, 0, 0, 7, 6, 7, 7, 9, 9, 0, 0, 0,
135.7593 +         8, 8, 8, 8,10,10, 0, 0, 0, 8, 8, 8, 8,10,10, 0,
135.7594 +         0, 0, 9, 9, 9, 9,10,10, 0, 0, 0, 0, 0, 9, 9,10,
135.7595 +        10,
135.7596 +};
135.7597 +
135.7598 +static const static_codebook _44c5_s_p5_0 = {
135.7599 +        2, 81,
135.7600 +        (long *)_vq_lengthlist__44c5_s_p5_0,
135.7601 +        1, -531628032, 1611661312, 4, 0,
135.7602 +        (long *)_vq_quantlist__44c5_s_p5_0,
135.7603 +        0
135.7604 +};
135.7605 +
135.7606 +static const long _vq_quantlist__44c5_s_p6_0[] = {
135.7607 +        8,
135.7608 +        7,
135.7609 +        9,
135.7610 +        6,
135.7611 +        10,
135.7612 +        5,
135.7613 +        11,
135.7614 +        4,
135.7615 +        12,
135.7616 +        3,
135.7617 +        13,
135.7618 +        2,
135.7619 +        14,
135.7620 +        1,
135.7621 +        15,
135.7622 +        0,
135.7623 +        16,
135.7624 +};
135.7625 +
135.7626 +static const long _vq_lengthlist__44c5_s_p6_0[] = {
135.7627 +         2, 4, 4, 6, 6, 8, 8, 9, 9, 9, 9,10,10,10,10,11,
135.7628 +        11, 0, 4, 4, 6, 6, 8, 8, 9, 9, 9, 9,10,10,11,11,
135.7629 +        12,12, 0, 4, 4, 6, 6, 8, 8, 9, 9, 9, 9,10,10,11,
135.7630 +        11,12,12, 0, 6, 6, 7, 7, 8, 8, 9, 9, 9, 9,10,10,
135.7631 +        11,11,12,12, 0, 0, 0, 7, 7, 8, 8, 9, 9, 9, 9,10,
135.7632 +        10,11,11,12,12, 0, 0, 0, 7, 7, 9, 9,10,10,10,10,
135.7633 +        11,11,11,11,12,12, 0, 0, 0, 7, 7, 8, 9,10,10,10,
135.7634 +        10,11,11,11,11,12,12, 0, 0, 0, 8, 8, 9, 9,10,10,
135.7635 +        10,10,11,11,12,12,12,12, 0, 0, 0, 0, 0, 9, 9,10,
135.7636 +        10,10,10,11,11,12,12,12,12, 0, 0, 0, 0, 0, 9, 9,
135.7637 +        10,10,10,10,11,11,12,12,12,12, 0, 0, 0, 0, 0, 9,
135.7638 +         9, 9,10,10,10,11,11,12,12,12,12, 0, 0, 0, 0, 0,
135.7639 +        10,10,10,10,11,11,11,12,12,12,13,13, 0, 0, 0, 0,
135.7640 +         0, 0, 0,10,10,11,11,11,11,12,12,13,13, 0, 0, 0,
135.7641 +         0, 0, 0, 0,11,11,11,11,12,12,12,13,13,13, 0, 0,
135.7642 +         0, 0, 0, 0, 0,11,11,11,11,12,12,12,12,13,13, 0,
135.7643 +         0, 0, 0, 0, 0, 0,12,12,12,12,13,12,13,13,13,13,
135.7644 +         0, 0, 0, 0, 0, 0, 0, 0, 0,12,12,12,12,13,13,13,
135.7645 +        13,
135.7646 +};
135.7647 +
135.7648 +static const static_codebook _44c5_s_p6_0 = {
135.7649 +        2, 289,
135.7650 +        (long *)_vq_lengthlist__44c5_s_p6_0,
135.7651 +        1, -529530880, 1611661312, 5, 0,
135.7652 +        (long *)_vq_quantlist__44c5_s_p6_0,
135.7653 +        0
135.7654 +};
135.7655 +
135.7656 +static const long _vq_quantlist__44c5_s_p7_0[] = {
135.7657 +        1,
135.7658 +        0,
135.7659 +        2,
135.7660 +};
135.7661 +
135.7662 +static const long _vq_lengthlist__44c5_s_p7_0[] = {
135.7663 +         1, 4, 4, 7, 6, 6, 7, 6, 6, 4, 7, 7,10, 9, 9,11,
135.7664 +         9, 9, 4, 7, 7,10, 9, 9,11, 9, 9, 7,10,10,11,11,
135.7665 +        10,11,11,11, 6, 9, 9,11,10,10,11,10,10, 6, 9, 9,
135.7666 +        11,10,10,11,10,10, 7,11,11,12,11,11,12,11,11, 6,
135.7667 +         9, 9,11,10,10,11,10,10, 6, 9, 9,11,10,10,11,10,
135.7668 +        10,
135.7669 +};
135.7670 +
135.7671 +static const static_codebook _44c5_s_p7_0 = {
135.7672 +        4, 81,
135.7673 +        (long *)_vq_lengthlist__44c5_s_p7_0,
135.7674 +        1, -529137664, 1618345984, 2, 0,
135.7675 +        (long *)_vq_quantlist__44c5_s_p7_0,
135.7676 +        0
135.7677 +};
135.7678 +
135.7679 +static const long _vq_quantlist__44c5_s_p7_1[] = {
135.7680 +        5,
135.7681 +        4,
135.7682 +        6,
135.7683 +        3,
135.7684 +        7,
135.7685 +        2,
135.7686 +        8,
135.7687 +        1,
135.7688 +        9,
135.7689 +        0,
135.7690 +        10,
135.7691 +};
135.7692 +
135.7693 +static const long _vq_lengthlist__44c5_s_p7_1[] = {
135.7694 +         2, 4, 4, 6, 6, 7, 7, 8, 8, 8, 8,10, 5, 5, 6, 6,
135.7695 +         7, 7, 8, 8, 8, 8,10, 5, 5, 6, 6, 7, 7, 8, 8, 8,
135.7696 +         8,10, 6, 6, 7, 7, 8, 8, 8, 8, 8, 8,10,10,10, 7,
135.7697 +         7, 8, 8, 8, 8, 8, 8,10,10,10, 7, 7, 8, 8, 8, 8,
135.7698 +         8, 8,10,10,10, 7, 7, 8, 8, 8, 8, 8, 8,10,10,10,
135.7699 +         8, 8, 8, 8, 8, 8, 8, 9,10,10,10,10,10, 8, 8, 8,
135.7700 +         8, 8, 8,10,10,10,10,10, 9, 9, 8, 8, 8, 8,10,10,
135.7701 +        10,10,10, 8, 8, 8, 8, 8, 8,
135.7702 +};
135.7703 +
135.7704 +static const static_codebook _44c5_s_p7_1 = {
135.7705 +        2, 121,
135.7706 +        (long *)_vq_lengthlist__44c5_s_p7_1,
135.7707 +        1, -531365888, 1611661312, 4, 0,
135.7708 +        (long *)_vq_quantlist__44c5_s_p7_1,
135.7709 +        0
135.7710 +};
135.7711 +
135.7712 +static const long _vq_quantlist__44c5_s_p8_0[] = {
135.7713 +        6,
135.7714 +        5,
135.7715 +        7,
135.7716 +        4,
135.7717 +        8,
135.7718 +        3,
135.7719 +        9,
135.7720 +        2,
135.7721 +        10,
135.7722 +        1,
135.7723 +        11,
135.7724 +        0,
135.7725 +        12,
135.7726 +};
135.7727 +
135.7728 +static const long _vq_lengthlist__44c5_s_p8_0[] = {
135.7729 +         1, 4, 4, 6, 6, 7, 7, 8, 8, 9, 9,10,10, 6, 5, 5,
135.7730 +         7, 7, 8, 8, 8, 9,10,10,10,10, 7, 5, 5, 7, 7, 8,
135.7731 +         8, 9, 9,10,10,10,10, 0, 8, 8, 8, 8, 9, 9, 9, 9,
135.7732 +        10,10,11,11, 0, 8, 8, 8, 8, 9, 9, 9, 9,10,10,11,
135.7733 +        11, 0,12,12, 9, 9, 9,10,10,10,10,10,11,11, 0,13,
135.7734 +        13, 9, 9, 9, 9,10,10,11,11,11,11, 0, 0, 0,10,10,
135.7735 +        10,10,10,10,11,11,11,11, 0, 0, 0,10,10,10,10,10,
135.7736 +        10,11,11,12,12, 0, 0, 0,14,14,11,11,11,11,12,12,
135.7737 +        12,12, 0, 0, 0,14,14,11,11,11,11,12,12,12,12, 0,
135.7738 +         0, 0, 0, 0,12,12,12,12,12,12,13,13, 0, 0, 0, 0,
135.7739 +         0,12,12,12,12,12,12,13,13,
135.7740 +};
135.7741 +
135.7742 +static const static_codebook _44c5_s_p8_0 = {
135.7743 +        2, 169,
135.7744 +        (long *)_vq_lengthlist__44c5_s_p8_0,
135.7745 +        1, -526516224, 1616117760, 4, 0,
135.7746 +        (long *)_vq_quantlist__44c5_s_p8_0,
135.7747 +        0
135.7748 +};
135.7749 +
135.7750 +static const long _vq_quantlist__44c5_s_p8_1[] = {
135.7751 +        2,
135.7752 +        1,
135.7753 +        3,
135.7754 +        0,
135.7755 +        4,
135.7756 +};
135.7757 +
135.7758 +static const long _vq_lengthlist__44c5_s_p8_1[] = {
135.7759 +         2, 4, 4, 5, 5, 6, 5, 5, 5, 5, 6, 4, 5, 5, 5, 6,
135.7760 +         5, 5, 5, 5, 6, 6, 6, 5, 5,
135.7761 +};
135.7762 +
135.7763 +static const static_codebook _44c5_s_p8_1 = {
135.7764 +        2, 25,
135.7765 +        (long *)_vq_lengthlist__44c5_s_p8_1,
135.7766 +        1, -533725184, 1611661312, 3, 0,
135.7767 +        (long *)_vq_quantlist__44c5_s_p8_1,
135.7768 +        0
135.7769 +};
135.7770 +
135.7771 +static const long _vq_quantlist__44c5_s_p9_0[] = {
135.7772 +        7,
135.7773 +        6,
135.7774 +        8,
135.7775 +        5,
135.7776 +        9,
135.7777 +        4,
135.7778 +        10,
135.7779 +        3,
135.7780 +        11,
135.7781 +        2,
135.7782 +        12,
135.7783 +        1,
135.7784 +        13,
135.7785 +        0,
135.7786 +        14,
135.7787 +};
135.7788 +
135.7789 +static const long _vq_lengthlist__44c5_s_p9_0[] = {
135.7790 +         1, 3, 3,13,13,13,13,13,13,13,13,13,13,13,13, 4,
135.7791 +         7, 7,13,13,13,13,13,13,13,13,13,13,13,13, 3, 8,
135.7792 +         6,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
135.7793 +        13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
135.7794 +        13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
135.7795 +        13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
135.7796 +        13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
135.7797 +        13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
135.7798 +        13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
135.7799 +        13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
135.7800 +        13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
135.7801 +        13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
135.7802 +        13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
135.7803 +        13,13,13,13,13,13,13,13,13,12,12,12,12,12,12,12,
135.7804 +        12,
135.7805 +};
135.7806 +
135.7807 +static const static_codebook _44c5_s_p9_0 = {
135.7808 +        2, 225,
135.7809 +        (long *)_vq_lengthlist__44c5_s_p9_0,
135.7810 +        1, -512522752, 1628852224, 4, 0,
135.7811 +        (long *)_vq_quantlist__44c5_s_p9_0,
135.7812 +        0
135.7813 +};
135.7814 +
135.7815 +static const long _vq_quantlist__44c5_s_p9_1[] = {
135.7816 +        8,
135.7817 +        7,
135.7818 +        9,
135.7819 +        6,
135.7820 +        10,
135.7821 +        5,
135.7822 +        11,
135.7823 +        4,
135.7824 +        12,
135.7825 +        3,
135.7826 +        13,
135.7827 +        2,
135.7828 +        14,
135.7829 +        1,
135.7830 +        15,
135.7831 +        0,
135.7832 +        16,
135.7833 +};
135.7834 +
135.7835 +static const long _vq_lengthlist__44c5_s_p9_1[] = {
135.7836 +         1, 4, 4, 5, 5, 7, 7, 9, 8,10, 9,10,10,11,10,11,
135.7837 +        11, 6, 5, 5, 7, 7, 8, 9,10,10,11,10,12,11,12,11,
135.7838 +        13,12, 6, 5, 5, 7, 7, 9, 9,10,10,11,11,12,12,13,
135.7839 +        12,13,13,18, 8, 8, 8, 8, 9, 9,10,11,11,11,12,11,
135.7840 +        13,11,13,12,18, 8, 8, 8, 8,10,10,11,11,12,12,13,
135.7841 +        13,13,13,13,14,18,12,12, 9, 9,11,11,11,11,12,12,
135.7842 +        13,12,13,12,13,13,20,13,12, 9, 9,11,11,11,11,12,
135.7843 +        12,13,13,13,14,14,13,20,18,19,11,12,11,11,12,12,
135.7844 +        13,13,13,13,13,13,14,13,18,19,19,12,11,11,11,12,
135.7845 +        12,13,12,13,13,13,14,14,13,18,17,19,14,15,12,12,
135.7846 +        12,13,13,13,14,14,14,14,14,14,19,19,19,16,15,12,
135.7847 +        11,13,12,14,14,14,13,13,14,14,14,19,18,19,18,19,
135.7848 +        13,13,13,13,14,14,14,13,14,14,14,14,18,17,19,19,
135.7849 +        19,13,13,13,11,13,11,13,14,14,14,14,14,19,17,17,
135.7850 +        18,18,16,16,13,13,13,13,14,13,15,15,14,14,19,19,
135.7851 +        17,17,18,16,16,13,11,14,10,13,12,14,14,14,14,19,
135.7852 +        19,19,19,19,18,17,13,14,13,11,14,13,14,14,15,15,
135.7853 +        19,19,19,17,19,18,18,14,13,12,11,14,11,15,15,15,
135.7854 +        15,
135.7855 +};
135.7856 +
135.7857 +static const static_codebook _44c5_s_p9_1 = {
135.7858 +        2, 289,
135.7859 +        (long *)_vq_lengthlist__44c5_s_p9_1,
135.7860 +        1, -520814592, 1620377600, 5, 0,
135.7861 +        (long *)_vq_quantlist__44c5_s_p9_1,
135.7862 +        0
135.7863 +};
135.7864 +
135.7865 +static const long _vq_quantlist__44c5_s_p9_2[] = {
135.7866 +        10,
135.7867 +        9,
135.7868 +        11,
135.7869 +        8,
135.7870 +        12,
135.7871 +        7,
135.7872 +        13,
135.7873 +        6,
135.7874 +        14,
135.7875 +        5,
135.7876 +        15,
135.7877 +        4,
135.7878 +        16,
135.7879 +        3,
135.7880 +        17,
135.7881 +        2,
135.7882 +        18,
135.7883 +        1,
135.7884 +        19,
135.7885 +        0,
135.7886 +        20,
135.7887 +};
135.7888 +
135.7889 +static const long _vq_lengthlist__44c5_s_p9_2[] = {
135.7890 +         3, 5, 5, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8,
135.7891 +         8, 8, 8, 8, 9,11, 5, 6, 7, 7, 8, 7, 8, 8, 8, 8,
135.7892 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9,11, 5, 5, 7, 7, 7,
135.7893 +         7, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,11,
135.7894 +         7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9,
135.7895 +         9,10, 9,10,11,11,11, 7, 7, 8, 8, 8, 8, 9, 9, 9,
135.7896 +         9, 9, 9,10,10,10,10,10,10,11,11,11, 8, 8, 8, 8,
135.7897 +         9, 9, 9, 9, 9, 9, 9,10,10,10,10,10,10,10,11,11,
135.7898 +        11, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9,10,10,10,10,10,
135.7899 +        10,10,10,11,11,11, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
135.7900 +        10,10,10,10,10,10,10,10,11,11,11,11,11, 9, 9, 9,
135.7901 +         9, 9, 9,10, 9,10,10,10,10,10,10,10,10,11,11,11,
135.7902 +        11,11, 9, 9, 9, 9, 9, 9,10,10,10,10,10,10,10,10,
135.7903 +        10,10,11,11,11,11,11, 9, 9, 9, 9, 9, 9,10,10,10,
135.7904 +        10,10,10,10,10,10,10,11,11,11,11,11, 9, 9,10, 9,
135.7905 +        10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,
135.7906 +        11,11,11, 9, 9,10,10,10,10,10,10,10,10,10,10,10,
135.7907 +        10,11,11,11,11,11,11,11,10,10,10,10,10,10,10,10,
135.7908 +        10,10,10,10,10,10,11,11,11,11,11,11,11,10,10,10,
135.7909 +        10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,
135.7910 +        11,11,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.7911 +        11,11,11,11,11,11,11,11,11,10,10,10,10,10,10,10,
135.7912 +        10,10,10,10,10,11,11,11,11,11,11,11,11,11,10,10,
135.7913 +        10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,
135.7914 +        11,11,11,10,10,10,10,10,10,10,10,10,10,10,10,11,
135.7915 +        11,11,11,11,11,11,11,11,10,10,10,10,10,10,10,10,
135.7916 +        10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,10,
135.7917 +        10,10,10,10,10,10,10,10,10,
135.7918 +};
135.7919 +
135.7920 +static const static_codebook _44c5_s_p9_2 = {
135.7921 +        2, 441,
135.7922 +        (long *)_vq_lengthlist__44c5_s_p9_2,
135.7923 +        1, -529268736, 1611661312, 5, 0,
135.7924 +        (long *)_vq_quantlist__44c5_s_p9_2,
135.7925 +        0
135.7926 +};
135.7927 +
135.7928 +static const long _huff_lengthlist__44c5_s_short[] = {
135.7929 +         5, 8,10,14,11,11,12,16,15,17, 5, 5, 7, 9, 7, 8,
135.7930 +        10,13,17,17, 7, 5, 5,10, 5, 7, 8,11,13,15,10, 8,
135.7931 +        10, 8, 8, 8,11,15,18,18, 8, 5, 5, 8, 3, 4, 6,10,
135.7932 +        14,16, 9, 7, 6, 7, 4, 3, 5, 9,14,18,10, 9, 8,10,
135.7933 +         6, 5, 6, 9,14,18,12,12,11,12, 8, 7, 8,11,14,18,
135.7934 +        14,13,12,10, 7, 5, 6, 9,14,18,14,14,13,10, 6, 5,
135.7935 +         6, 8,11,16,
135.7936 +};
135.7937 +
135.7938 +static const static_codebook _huff_book__44c5_s_short = {
135.7939 +        2, 100,
135.7940 +        (long *)_huff_lengthlist__44c5_s_short,
135.7941 +        0, 0, 0, 0, 0,
135.7942 +        NULL,
135.7943 +        0
135.7944 +};
135.7945 +
135.7946 +static const long _huff_lengthlist__44c6_s_long[] = {
135.7947 +         3, 8,11,13,14,14,13,13,16,14, 6, 3, 4, 7, 9, 9,
135.7948 +        10,11,14,13,10, 4, 3, 5, 7, 7, 9,10,13,15,12, 7,
135.7949 +         4, 4, 6, 6, 8,10,13,15,12, 8, 6, 6, 6, 6, 8,10,
135.7950 +        13,14,11, 9, 7, 6, 6, 6, 7, 8,12,11,13,10, 9, 8,
135.7951 +         7, 6, 6, 7,11,11,13,11,10, 9, 9, 7, 7, 6,10,11,
135.7952 +        13,13,13,13,13,11, 9, 8,10,12,12,15,15,16,15,12,
135.7953 +        11,10,10,12,
135.7954 +};
135.7955 +
135.7956 +static const static_codebook _huff_book__44c6_s_long = {
135.7957 +        2, 100,
135.7958 +        (long *)_huff_lengthlist__44c6_s_long,
135.7959 +        0, 0, 0, 0, 0,
135.7960 +        NULL,
135.7961 +        0
135.7962 +};
135.7963 +
135.7964 +static const long _vq_quantlist__44c6_s_p1_0[] = {
135.7965 +        1,
135.7966 +        0,
135.7967 +        2,
135.7968 +};
135.7969 +
135.7970 +static const long _vq_lengthlist__44c6_s_p1_0[] = {
135.7971 +         1, 5, 5, 0, 5, 5, 0, 5, 5, 5, 8, 7, 0, 9, 9, 0,
135.7972 +         9, 8, 5, 7, 8, 0, 9, 9, 0, 8, 9, 0, 0, 0, 0, 0,
135.7973 +         0, 0, 0, 0, 5, 9, 8, 0, 8, 8, 0, 8, 8, 5, 8, 9,
135.7974 +         0, 8, 8, 0, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5,
135.7975 +         9, 9, 0, 8, 8, 0, 8, 8, 5, 9, 9, 0, 8, 8, 0, 8,
135.7976 +         8,
135.7977 +};
135.7978 +static const static_codebook _44c6_s_p1_0 = {
135.7979 +        4, 81,
135.7980 +        (long *)_vq_lengthlist__44c6_s_p1_0,
135.7981 +        1, -535822336, 1611661312, 2, 0,
135.7982 +        (long *)_vq_quantlist__44c6_s_p1_0,
135.7983 +        0
135.7984 +};
135.7985 +
135.7986 +static const long _vq_quantlist__44c6_s_p2_0[] = {
135.7987 +        2,
135.7988 +        1,
135.7989 +        3,
135.7990 +        0,
135.7991 +        4,
135.7992 +};
135.7993 +
135.7994 +static const long _vq_lengthlist__44c6_s_p2_0[] = {
135.7995 +         3, 5, 5, 8, 8, 0, 5, 5, 8, 8, 0, 5, 5, 8, 8, 0,
135.7996 +         7, 7, 9, 9, 0, 0, 0, 9, 9, 5, 7, 7, 9, 9, 0, 8,
135.7997 +         8,10,10, 0, 8, 7,10, 9, 0,10,10,11,11, 0, 0, 0,
135.7998 +        11,11, 5, 7, 7, 9, 9, 0, 8, 8,10,10, 0, 7, 8, 9,
135.7999 +        10, 0,10,10,11,11, 0, 0, 0,11,11, 8, 9, 9,11,11,
135.8000 +         0,11,11,12,12, 0,11,10,12,12, 0,13,14,14,14, 0,
135.8001 +         0, 0,14,13, 8, 9, 9,11,11, 0,11,11,12,12, 0,10,
135.8002 +        11,12,12, 0,14,13,14,14, 0, 0, 0,13,14, 0, 0, 0,
135.8003 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.8004 +         0, 0, 0, 0, 0, 0, 5, 8, 7,11,10, 0, 7, 7,10,10,
135.8005 +         0, 7, 7,10,10, 0, 9, 9,11,10, 0, 0, 0,11,11, 5,
135.8006 +         7, 8,10,11, 0, 7, 7,10,10, 0, 7, 7,10,10, 0, 9,
135.8007 +         9,10,11, 0, 0, 0,11,11, 8,10, 9,12,12, 0,10,10,
135.8008 +        12,12, 0,10,10,12,12, 0,12,12,13,13, 0, 0, 0,13,
135.8009 +        13, 8, 9,10,12,12, 0,10,10,11,12, 0,10,10,12,12,
135.8010 +         0,12,12,13,13, 0, 0, 0,13,13, 0, 0, 0, 0, 0, 0,
135.8011 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.8012 +         0, 0, 0, 5, 8, 8,11,11, 0, 7, 7,10,10, 0, 7, 7,
135.8013 +        10,10, 0, 9, 9,10,11, 0, 0, 0,11,10, 5, 8, 8,11,
135.8014 +        11, 0, 7, 7,10,10, 0, 7, 7,10,10, 0, 9, 9,11,11,
135.8015 +         0, 0, 0,10,11, 8,10,10,12,12, 0,10,10,12,12, 0,
135.8016 +        10,10,12,12, 0,12,13,13,13, 0, 0, 0,14,13, 8,10,
135.8017 +        10,12,12, 0,10,10,12,12, 0,10,10,12,12, 0,13,12,
135.8018 +        13,13, 0, 0, 0,13,13, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.8019 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.8020 +         7,10,10,14,13, 0, 9, 9,13,12, 0, 9, 9,12,12, 0,
135.8021 +        10,10,12,12, 0, 0, 0,12,12, 7,10,10,13,14, 0, 9,
135.8022 +         9,12,13, 0, 9, 9,12,12, 0,10,10,12,12, 0, 0, 0,
135.8023 +        12,12, 9,11,11,14,13, 0,11,10,14,13, 0,11,11,13,
135.8024 +        13, 0,12,12,13,13, 0, 0, 0,13,13, 9,11,11,13,14,
135.8025 +         0,10,11,13,14, 0,11,11,13,13, 0,12,12,13,13, 0,
135.8026 +         0, 0,13,13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.8027 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.8028 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.8029 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.8030 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9,
135.8031 +        11,11,14,14, 0,11,11,13,13, 0,11,10,13,13, 0,12,
135.8032 +        12,13,13, 0, 0, 0,13,13, 9,11,11,14,14, 0,11,11,
135.8033 +        13,13, 0,10,11,13,13, 0,12,12,14,13, 0, 0, 0,13,
135.8034 +        13,
135.8035 +};
135.8036 +
135.8037 +static const static_codebook _44c6_s_p2_0 = {
135.8038 +        4, 625,
135.8039 +        (long *)_vq_lengthlist__44c6_s_p2_0,
135.8040 +        1, -533725184, 1611661312, 3, 0,
135.8041 +        (long *)_vq_quantlist__44c6_s_p2_0,
135.8042 +        0
135.8043 +};
135.8044 +
135.8045 +static const long _vq_quantlist__44c6_s_p3_0[] = {
135.8046 +        4,
135.8047 +        3,
135.8048 +        5,
135.8049 +        2,
135.8050 +        6,
135.8051 +        1,
135.8052 +        7,
135.8053 +        0,
135.8054 +        8,
135.8055 +};
135.8056 +
135.8057 +static const long _vq_lengthlist__44c6_s_p3_0[] = {
135.8058 +         2, 3, 4, 6, 6, 7, 7, 9, 9, 0, 4, 4, 6, 6, 7, 7,
135.8059 +         9,10, 0, 4, 4, 6, 6, 7, 7,10, 9, 0, 5, 5, 7, 7,
135.8060 +         8, 8,10,10, 0, 0, 0, 7, 6, 8, 8,10,10, 0, 0, 0,
135.8061 +         7, 7, 9, 9,11,11, 0, 0, 0, 7, 7, 9, 9,11,11, 0,
135.8062 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.8063 +         0,
135.8064 +};
135.8065 +
135.8066 +static const static_codebook _44c6_s_p3_0 = {
135.8067 +        2, 81,
135.8068 +        (long *)_vq_lengthlist__44c6_s_p3_0,
135.8069 +        1, -531628032, 1611661312, 4, 0,
135.8070 +        (long *)_vq_quantlist__44c6_s_p3_0,
135.8071 +        0
135.8072 +};
135.8073 +
135.8074 +static const long _vq_quantlist__44c6_s_p4_0[] = {
135.8075 +        8,
135.8076 +        7,
135.8077 +        9,
135.8078 +        6,
135.8079 +        10,
135.8080 +        5,
135.8081 +        11,
135.8082 +        4,
135.8083 +        12,
135.8084 +        3,
135.8085 +        13,
135.8086 +        2,
135.8087 +        14,
135.8088 +        1,
135.8089 +        15,
135.8090 +        0,
135.8091 +        16,
135.8092 +};
135.8093 +
135.8094 +static const long _vq_lengthlist__44c6_s_p4_0[] = {
135.8095 +         2, 4, 4, 6, 6, 7, 7, 8, 8, 8, 8, 9, 9, 9,10,10,
135.8096 +        10, 0, 4, 4, 6, 6, 8, 8, 9, 9, 9, 9,10,10,10,10,
135.8097 +        11,11, 0, 4, 4, 6, 6, 8, 8, 9, 9, 9, 9,10,10,10,
135.8098 +        10,11,11, 0, 6, 6, 7, 7, 8, 8, 9, 9, 9, 9,10,10,
135.8099 +        11,11,11,11, 0, 0, 0, 7, 7, 8, 8, 9, 9, 9, 9,10,
135.8100 +        10,11,11,11,11, 0, 0, 0, 7, 7, 9, 9,10,10,10,10,
135.8101 +        11,11,11,11,12,12, 0, 0, 0, 7, 7, 9, 9,10,10,10,
135.8102 +        10,11,11,11,11,12,12, 0, 0, 0, 7, 7, 8, 8, 9, 9,
135.8103 +        10,10,11,11,12,12,12,12, 0, 0, 0, 0, 0, 8, 8, 9,
135.8104 +         9,10,10,11,11,12,12,12,12, 0, 0, 0, 0, 0, 0, 0,
135.8105 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.8106 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.8107 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.8108 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.8109 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.8110 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.8111 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.8112 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.8113 +         0,
135.8114 +};
135.8115 +
135.8116 +static const static_codebook _44c6_s_p4_0 = {
135.8117 +        2, 289,
135.8118 +        (long *)_vq_lengthlist__44c6_s_p4_0,
135.8119 +        1, -529530880, 1611661312, 5, 0,
135.8120 +        (long *)_vq_quantlist__44c6_s_p4_0,
135.8121 +        0
135.8122 +};
135.8123 +
135.8124 +static const long _vq_quantlist__44c6_s_p5_0[] = {
135.8125 +        1,
135.8126 +        0,
135.8127 +        2,
135.8128 +};
135.8129 +
135.8130 +static const long _vq_lengthlist__44c6_s_p5_0[] = {
135.8131 +         1, 4, 4, 5, 7, 7, 6, 7, 7, 4, 6, 6, 9, 9,10,10,
135.8132 +        10, 9, 4, 6, 6, 9,10, 9,10, 9,10, 6, 9, 9,10,12,
135.8133 +        11,10,11,11, 7,10, 9,11,12,12,12,12,12, 7,10,10,
135.8134 +        11,12,12,12,12,12, 6,10,10,10,12,12,11,12,12, 7,
135.8135 +         9,10,11,12,12,12,12,12, 7,10, 9,12,12,12,12,12,
135.8136 +        12,
135.8137 +};
135.8138 +
135.8139 +static const static_codebook _44c6_s_p5_0 = {
135.8140 +        4, 81,
135.8141 +        (long *)_vq_lengthlist__44c6_s_p5_0,
135.8142 +        1, -529137664, 1618345984, 2, 0,
135.8143 +        (long *)_vq_quantlist__44c6_s_p5_0,
135.8144 +        0
135.8145 +};
135.8146 +
135.8147 +static const long _vq_quantlist__44c6_s_p5_1[] = {
135.8148 +        5,
135.8149 +        4,
135.8150 +        6,
135.8151 +        3,
135.8152 +        7,
135.8153 +        2,
135.8154 +        8,
135.8155 +        1,
135.8156 +        9,
135.8157 +        0,
135.8158 +        10,
135.8159 +};
135.8160 +
135.8161 +static const long _vq_lengthlist__44c6_s_p5_1[] = {
135.8162 +         3, 5, 4, 6, 6, 7, 7, 8, 8, 8, 8,11, 4, 4, 6, 6,
135.8163 +         7, 7, 8, 8, 8, 8,11, 4, 4, 6, 6, 7, 7, 8, 8, 8,
135.8164 +         8,11, 6, 6, 6, 6, 8, 8, 8, 8, 9, 9,11,11,11, 6,
135.8165 +         6, 7, 8, 8, 8, 8, 9,11,11,11, 7, 7, 8, 8, 8, 8,
135.8166 +         8, 8,11,11,11, 7, 7, 8, 8, 8, 8, 8, 8,11,11,11,
135.8167 +         8, 8, 8, 8, 8, 8, 8, 8,11,11,11,10,10, 8, 8, 8,
135.8168 +         8, 8, 8,11,11,11,10,10, 8, 8, 8, 8, 8, 8,11,11,
135.8169 +        11,10,10, 7, 7, 8, 8, 8, 8,
135.8170 +};
135.8171 +
135.8172 +static const static_codebook _44c6_s_p5_1 = {
135.8173 +        2, 121,
135.8174 +        (long *)_vq_lengthlist__44c6_s_p5_1,
135.8175 +        1, -531365888, 1611661312, 4, 0,
135.8176 +        (long *)_vq_quantlist__44c6_s_p5_1,
135.8177 +        0
135.8178 +};
135.8179 +
135.8180 +static const long _vq_quantlist__44c6_s_p6_0[] = {
135.8181 +        6,
135.8182 +        5,
135.8183 +        7,
135.8184 +        4,
135.8185 +        8,
135.8186 +        3,
135.8187 +        9,
135.8188 +        2,
135.8189 +        10,
135.8190 +        1,
135.8191 +        11,
135.8192 +        0,
135.8193 +        12,
135.8194 +};
135.8195 +
135.8196 +static const long _vq_lengthlist__44c6_s_p6_0[] = {
135.8197 +         1, 4, 4, 6, 6, 8, 8, 8, 8,10, 9,10,10, 6, 5, 5,
135.8198 +         7, 7, 9, 9, 9, 9,10,10,11,11, 6, 5, 5, 7, 7, 9,
135.8199 +         9,10, 9,11,10,11,11, 0, 6, 6, 7, 7, 9, 9,10,10,
135.8200 +        11,11,12,12, 0, 7, 7, 7, 7, 9, 9,10,10,11,11,12,
135.8201 +        12, 0,11,11, 8, 8,10,10,11,11,12,12,12,12, 0,11,
135.8202 +        12, 9, 8,10,10,11,11,12,12,13,13, 0, 0, 0, 0, 0,
135.8203 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.8204 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.8205 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.8206 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.8207 +         0, 0, 0, 0, 0, 0, 0, 0, 0,
135.8208 +};
135.8209 +
135.8210 +static const static_codebook _44c6_s_p6_0 = {
135.8211 +        2, 169,
135.8212 +        (long *)_vq_lengthlist__44c6_s_p6_0,
135.8213 +        1, -526516224, 1616117760, 4, 0,
135.8214 +        (long *)_vq_quantlist__44c6_s_p6_0,
135.8215 +        0
135.8216 +};
135.8217 +
135.8218 +static const long _vq_quantlist__44c6_s_p6_1[] = {
135.8219 +        2,
135.8220 +        1,
135.8221 +        3,
135.8222 +        0,
135.8223 +        4,
135.8224 +};
135.8225 +
135.8226 +static const long _vq_lengthlist__44c6_s_p6_1[] = {
135.8227 +         3, 4, 4, 5, 5, 5, 4, 4, 5, 5, 5, 4, 4, 5, 5, 6,
135.8228 +         5, 5, 5, 5, 6, 6, 6, 5, 5,
135.8229 +};
135.8230 +
135.8231 +static const static_codebook _44c6_s_p6_1 = {
135.8232 +        2, 25,
135.8233 +        (long *)_vq_lengthlist__44c6_s_p6_1,
135.8234 +        1, -533725184, 1611661312, 3, 0,
135.8235 +        (long *)_vq_quantlist__44c6_s_p6_1,
135.8236 +        0
135.8237 +};
135.8238 +
135.8239 +static const long _vq_quantlist__44c6_s_p7_0[] = {
135.8240 +        6,
135.8241 +        5,
135.8242 +        7,
135.8243 +        4,
135.8244 +        8,
135.8245 +        3,
135.8246 +        9,
135.8247 +        2,
135.8248 +        10,
135.8249 +        1,
135.8250 +        11,
135.8251 +        0,
135.8252 +        12,
135.8253 +};
135.8254 +
135.8255 +static const long _vq_lengthlist__44c6_s_p7_0[] = {
135.8256 +         1, 4, 4, 6, 6, 8, 8, 8, 8,10,10,11,10, 6, 5, 5,
135.8257 +         7, 7, 8, 8, 9, 9,10,10,12,11, 6, 5, 5, 7, 7, 8,
135.8258 +         8, 9, 9,10,10,12,11,21, 7, 7, 7, 7, 9, 9,10,10,
135.8259 +        11,11,12,12,21, 7, 7, 7, 7, 9, 9,10,10,11,11,12,
135.8260 +        12,21,12,12, 9, 9,10,10,11,11,11,11,12,12,21,12,
135.8261 +        12, 9, 9,10,10,11,11,12,12,12,12,21,21,21,11,11,
135.8262 +        10,10,11,12,12,12,13,13,21,21,21,11,11,10,10,12,
135.8263 +        12,12,12,13,13,21,21,21,15,15,11,11,12,12,13,13,
135.8264 +        13,13,21,21,21,15,16,11,11,12,12,13,13,14,14,21,
135.8265 +        21,21,21,20,13,13,13,13,13,13,14,14,20,20,20,20,
135.8266 +        20,13,13,13,13,13,13,14,14,
135.8267 +};
135.8268 +
135.8269 +static const static_codebook _44c6_s_p7_0 = {
135.8270 +        2, 169,
135.8271 +        (long *)_vq_lengthlist__44c6_s_p7_0,
135.8272 +        1, -523206656, 1618345984, 4, 0,
135.8273 +        (long *)_vq_quantlist__44c6_s_p7_0,
135.8274 +        0
135.8275 +};
135.8276 +
135.8277 +static const long _vq_quantlist__44c6_s_p7_1[] = {
135.8278 +        5,
135.8279 +        4,
135.8280 +        6,
135.8281 +        3,
135.8282 +        7,
135.8283 +        2,
135.8284 +        8,
135.8285 +        1,
135.8286 +        9,
135.8287 +        0,
135.8288 +        10,
135.8289 +};
135.8290 +
135.8291 +static const long _vq_lengthlist__44c6_s_p7_1[] = {
135.8292 +         3, 5, 5, 6, 6, 7, 7, 7, 7, 7, 7, 9, 5, 5, 6, 6,
135.8293 +         7, 7, 7, 7, 8, 7, 8, 5, 5, 6, 6, 7, 7, 7, 7, 7,
135.8294 +         7, 9, 6, 6, 7, 7, 7, 7, 8, 7, 7, 8, 9, 9, 9, 7,
135.8295 +         7, 7, 7, 7, 7, 7, 8, 9, 9, 9, 7, 7, 7, 7, 8, 8,
135.8296 +         8, 8, 9, 9, 9, 7, 7, 7, 7, 7, 7, 8, 8, 9, 9, 9,
135.8297 +         8, 8, 8, 8, 7, 7, 8, 8, 9, 9, 9, 9, 8, 8, 8, 7,
135.8298 +         7, 8, 8, 9, 9, 9, 8, 8, 8, 8, 7, 7, 8, 8, 9, 9,
135.8299 +         9, 8, 8, 7, 7, 7, 7, 8, 8,
135.8300 +};
135.8301 +
135.8302 +static const static_codebook _44c6_s_p7_1 = {
135.8303 +        2, 121,
135.8304 +        (long *)_vq_lengthlist__44c6_s_p7_1,
135.8305 +        1, -531365888, 1611661312, 4, 0,
135.8306 +        (long *)_vq_quantlist__44c6_s_p7_1,
135.8307 +        0
135.8308 +};
135.8309 +
135.8310 +static const long _vq_quantlist__44c6_s_p8_0[] = {
135.8311 +        7,
135.8312 +        6,
135.8313 +        8,
135.8314 +        5,
135.8315 +        9,
135.8316 +        4,
135.8317 +        10,
135.8318 +        3,
135.8319 +        11,
135.8320 +        2,
135.8321 +        12,
135.8322 +        1,
135.8323 +        13,
135.8324 +        0,
135.8325 +        14,
135.8326 +};
135.8327 +
135.8328 +static const long _vq_lengthlist__44c6_s_p8_0[] = {
135.8329 +         1, 4, 4, 7, 7, 8, 8, 7, 7, 8, 7, 9, 8,10, 9, 6,
135.8330 +         5, 5, 8, 8, 9, 9, 8, 8, 9, 9,11,10,11,10, 6, 5,
135.8331 +         5, 8, 8, 9, 9, 8, 8, 9, 9,10,10,11,11,18, 8, 8,
135.8332 +         9, 8,10,10, 9, 9,10,10,10,10,11,10,18, 8, 8, 9,
135.8333 +         9,10,10, 9, 9,10,10,11,11,12,12,18,12,13, 9,10,
135.8334 +        10,10, 9,10,10,10,11,11,12,11,18,13,13, 9, 9,10,
135.8335 +        10,10,10,10,10,11,11,12,12,18,18,18,10,10, 9, 9,
135.8336 +        11,11,11,11,11,12,12,12,18,18,18,10, 9,10, 9,11,
135.8337 +        10,11,11,11,11,13,12,18,18,18,14,13,10,10,11,11,
135.8338 +        12,12,12,12,12,12,18,18,18,14,13,10,10,11,10,12,
135.8339 +        12,12,12,12,12,18,18,18,18,18,12,12,11,11,12,12,
135.8340 +        13,13,13,14,18,18,18,18,18,12,12,11,11,12,11,13,
135.8341 +        13,14,13,18,18,18,18,18,16,16,11,12,12,13,13,13,
135.8342 +        14,13,18,18,18,18,18,16,15,12,11,12,11,13,11,15,
135.8343 +        14,
135.8344 +};
135.8345 +
135.8346 +static const static_codebook _44c6_s_p8_0 = {
135.8347 +        2, 225,
135.8348 +        (long *)_vq_lengthlist__44c6_s_p8_0,
135.8349 +        1, -520986624, 1620377600, 4, 0,
135.8350 +        (long *)_vq_quantlist__44c6_s_p8_0,
135.8351 +        0
135.8352 +};
135.8353 +
135.8354 +static const long _vq_quantlist__44c6_s_p8_1[] = {
135.8355 +        10,
135.8356 +        9,
135.8357 +        11,
135.8358 +        8,
135.8359 +        12,
135.8360 +        7,
135.8361 +        13,
135.8362 +        6,
135.8363 +        14,
135.8364 +        5,
135.8365 +        15,
135.8366 +        4,
135.8367 +        16,
135.8368 +        3,
135.8369 +        17,
135.8370 +        2,
135.8371 +        18,
135.8372 +        1,
135.8373 +        19,
135.8374 +        0,
135.8375 +        20,
135.8376 +};
135.8377 +
135.8378 +static const long _vq_lengthlist__44c6_s_p8_1[] = {
135.8379 +         3, 5, 5, 6, 6, 7, 7, 7, 7, 8, 7, 8, 8, 8, 8, 8,
135.8380 +         8, 8, 8, 8, 8,10, 6, 6, 7, 7, 8, 8, 8, 8, 8, 8,
135.8381 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9,10, 6, 6, 7, 7, 8,
135.8382 +         8, 8, 8, 8, 8, 9, 8, 9, 9, 9, 9, 9, 9, 9, 9,10,
135.8383 +         7, 7, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9,
135.8384 +         9, 9, 9, 9,10,11,11, 8, 7, 8, 8, 8, 9, 9, 9, 9,
135.8385 +         9, 9, 9, 9, 9, 9, 9, 9, 9,11,11,11, 8, 8, 8, 8,
135.8386 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,11,11,
135.8387 +        11, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
135.8388 +         9, 9, 9,11,11,11, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
135.8389 +         9, 9, 9, 9, 9, 9, 9, 9,11,11,11,11,11, 9, 9, 9,
135.8390 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9,10,10, 9,11,11,11,
135.8391 +        11,11, 9, 9, 9, 9, 9, 9,10, 9, 9,10, 9,10, 9, 9,
135.8392 +        10, 9,11,11,11,11,11, 9, 9, 9, 9, 9, 9, 9,10,10,
135.8393 +        10,10, 9,10,10, 9,10,11,11,11,11,11, 9, 9, 9, 9,
135.8394 +        10,10,10, 9,10,10,10,10, 9,10,10, 9,11,11,11,11,
135.8395 +        11,11,11, 9, 9, 9, 9,10,10,10,10, 9,10,10,10,10,
135.8396 +        10,11,11,11,11,11,11,11,10, 9,10,10,10,10,10,10,
135.8397 +        10, 9,10, 9,10,10,11,11,11,11,11,11,11,10, 9,10,
135.8398 +         9,10,10, 9,10,10,10,10,10,10,10,11,11,11,11,11,
135.8399 +        11,11,10,10,10,10,10,10,10, 9,10,10,10,10,10, 9,
135.8400 +        11,11,11,11,11,11,11,11,11,10,10,10,10,10,10,10,
135.8401 +        10,10,10,10,10,11,11,11,11,11,11,11,11,11,10,10,
135.8402 +        10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,
135.8403 +        11,11,11,10,10,10,10,10,10,10,10,10, 9,10,10,11,
135.8404 +        11,11,11,11,11,11,11,11,10,10,10, 9,10,10,10,10,
135.8405 +        10,10,10,10,10,11,11,11,11,11,11,11,11,10,11, 9,
135.8406 +        10,10,10,10,10,10,10,10,10,
135.8407 +};
135.8408 +
135.8409 +static const static_codebook _44c6_s_p8_1 = {
135.8410 +        2, 441,
135.8411 +        (long *)_vq_lengthlist__44c6_s_p8_1,
135.8412 +        1, -529268736, 1611661312, 5, 0,
135.8413 +        (long *)_vq_quantlist__44c6_s_p8_1,
135.8414 +        0
135.8415 +};
135.8416 +
135.8417 +static const long _vq_quantlist__44c6_s_p9_0[] = {
135.8418 +        6,
135.8419 +        5,
135.8420 +        7,
135.8421 +        4,
135.8422 +        8,
135.8423 +        3,
135.8424 +        9,
135.8425 +        2,
135.8426 +        10,
135.8427 +        1,
135.8428 +        11,
135.8429 +        0,
135.8430 +        12,
135.8431 +};
135.8432 +
135.8433 +static const long _vq_lengthlist__44c6_s_p9_0[] = {
135.8434 +         1, 3, 3,11,11,11,11,11,11,11,11,11,11, 4, 7, 7,
135.8435 +        11,11,11,11,11,11,11,11,11,11, 5, 8, 9,11,11,11,
135.8436 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.8437 +        11,11,11,11,11,10,10,10,10,10,10,10,10,10,10,10,
135.8438 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.8439 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.8440 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.8441 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.8442 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.8443 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.8444 +        10,10,10,10,10,10,10,10,10,
135.8445 +};
135.8446 +
135.8447 +static const static_codebook _44c6_s_p9_0 = {
135.8448 +        2, 169,
135.8449 +        (long *)_vq_lengthlist__44c6_s_p9_0,
135.8450 +        1, -511845376, 1630791680, 4, 0,
135.8451 +        (long *)_vq_quantlist__44c6_s_p9_0,
135.8452 +        0
135.8453 +};
135.8454 +
135.8455 +static const long _vq_quantlist__44c6_s_p9_1[] = {
135.8456 +        6,
135.8457 +        5,
135.8458 +        7,
135.8459 +        4,
135.8460 +        8,
135.8461 +        3,
135.8462 +        9,
135.8463 +        2,
135.8464 +        10,
135.8465 +        1,
135.8466 +        11,
135.8467 +        0,
135.8468 +        12,
135.8469 +};
135.8470 +
135.8471 +static const long _vq_lengthlist__44c6_s_p9_1[] = {
135.8472 +         1, 4, 4, 7, 7, 7, 7, 7, 6, 8, 8, 8, 8, 6, 6, 6,
135.8473 +         8, 8, 8, 8, 8, 7, 9, 8,10,10, 5, 6, 6, 8, 8, 9,
135.8474 +         9, 8, 8,10,10,10,10,16, 9, 9, 9, 9, 9, 9, 9, 8,
135.8475 +        10, 9,11,11,16, 8, 9, 9, 9, 9, 9, 9, 9,10,10,11,
135.8476 +        11,16,13,13, 9, 9,10, 9, 9,10,11,11,11,12,16,13,
135.8477 +        14, 9, 8,10, 8, 9, 9,10,10,12,11,16,14,16, 9, 9,
135.8478 +         9, 9,11,11,12,11,12,11,16,16,16, 9, 7, 9, 6,11,
135.8479 +        11,11,10,11,11,16,16,16,11,12, 9,10,11,11,12,11,
135.8480 +        13,13,16,16,16,12,11,10, 7,12,10,12,12,12,12,16,
135.8481 +        16,15,16,16,10,11,10,11,13,13,14,12,16,16,16,15,
135.8482 +        15,12,10,11,11,13,11,12,13,
135.8483 +};
135.8484 +
135.8485 +static const static_codebook _44c6_s_p9_1 = {
135.8486 +        2, 169,
135.8487 +        (long *)_vq_lengthlist__44c6_s_p9_1,
135.8488 +        1, -518889472, 1622704128, 4, 0,
135.8489 +        (long *)_vq_quantlist__44c6_s_p9_1,
135.8490 +        0
135.8491 +};
135.8492 +
135.8493 +static const long _vq_quantlist__44c6_s_p9_2[] = {
135.8494 +        24,
135.8495 +        23,
135.8496 +        25,
135.8497 +        22,
135.8498 +        26,
135.8499 +        21,
135.8500 +        27,
135.8501 +        20,
135.8502 +        28,
135.8503 +        19,
135.8504 +        29,
135.8505 +        18,
135.8506 +        30,
135.8507 +        17,
135.8508 +        31,
135.8509 +        16,
135.8510 +        32,
135.8511 +        15,
135.8512 +        33,
135.8513 +        14,
135.8514 +        34,
135.8515 +        13,
135.8516 +        35,
135.8517 +        12,
135.8518 +        36,
135.8519 +        11,
135.8520 +        37,
135.8521 +        10,
135.8522 +        38,
135.8523 +        9,
135.8524 +        39,
135.8525 +        8,
135.8526 +        40,
135.8527 +        7,
135.8528 +        41,
135.8529 +        6,
135.8530 +        42,
135.8531 +        5,
135.8532 +        43,
135.8533 +        4,
135.8534 +        44,
135.8535 +        3,
135.8536 +        45,
135.8537 +        2,
135.8538 +        46,
135.8539 +        1,
135.8540 +        47,
135.8541 +        0,
135.8542 +        48,
135.8543 +};
135.8544 +
135.8545 +static const long _vq_lengthlist__44c6_s_p9_2[] = {
135.8546 +         2, 4, 3, 4, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6,
135.8547 +         6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
135.8548 +         7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
135.8549 +         7,
135.8550 +};
135.8551 +
135.8552 +static const static_codebook _44c6_s_p9_2 = {
135.8553 +        1, 49,
135.8554 +        (long *)_vq_lengthlist__44c6_s_p9_2,
135.8555 +        1, -526909440, 1611661312, 6, 0,
135.8556 +        (long *)_vq_quantlist__44c6_s_p9_2,
135.8557 +        0
135.8558 +};
135.8559 +
135.8560 +static const long _huff_lengthlist__44c6_s_short[] = {
135.8561 +         3, 9,11,11,13,14,19,17,17,19, 5, 4, 5, 8,10,10,
135.8562 +        13,16,18,19, 7, 4, 4, 5, 8, 9,12,14,17,19, 8, 6,
135.8563 +         5, 5, 7, 7,10,13,16,18,10, 8, 7, 6, 5, 5, 8,11,
135.8564 +        17,19,11, 9, 7, 7, 5, 4, 5, 8,17,19,13,11, 8, 7,
135.8565 +         7, 5, 5, 7,16,18,14,13, 8, 6, 6, 5, 5, 7,16,18,
135.8566 +        18,16,10, 8, 8, 7, 7, 9,16,18,18,18,12,10,10, 9,
135.8567 +         9,10,17,18,
135.8568 +};
135.8569 +
135.8570 +static const static_codebook _huff_book__44c6_s_short = {
135.8571 +        2, 100,
135.8572 +        (long *)_huff_lengthlist__44c6_s_short,
135.8573 +        0, 0, 0, 0, 0,
135.8574 +        NULL,
135.8575 +        0
135.8576 +};
135.8577 +
135.8578 +static const long _huff_lengthlist__44c7_s_long[] = {
135.8579 +         3, 8,11,13,15,14,14,13,15,14, 6, 4, 5, 7, 9,10,
135.8580 +        11,11,14,13,10, 4, 3, 5, 7, 8, 9,10,13,13,12, 7,
135.8581 +         4, 4, 5, 6, 8, 9,12,14,13, 9, 6, 5, 5, 6, 8, 9,
135.8582 +        12,14,12, 9, 7, 6, 5, 5, 6, 8,11,11,12,11, 9, 8,
135.8583 +         7, 6, 6, 7,10,11,13,11,10, 9, 8, 7, 6, 6, 9,11,
135.8584 +        13,13,12,12,12,10, 9, 8, 9,11,12,14,15,15,14,12,
135.8585 +        11,10,10,12,
135.8586 +};
135.8587 +
135.8588 +static const static_codebook _huff_book__44c7_s_long = {
135.8589 +        2, 100,
135.8590 +        (long *)_huff_lengthlist__44c7_s_long,
135.8591 +        0, 0, 0, 0, 0,
135.8592 +        NULL,
135.8593 +        0
135.8594 +};
135.8595 +
135.8596 +static const long _vq_quantlist__44c7_s_p1_0[] = {
135.8597 +        1,
135.8598 +        0,
135.8599 +        2,
135.8600 +};
135.8601 +
135.8602 +static const long _vq_lengthlist__44c7_s_p1_0[] = {
135.8603 +         1, 5, 5, 0, 5, 5, 0, 5, 5, 5, 8, 7, 0, 9, 9, 0,
135.8604 +         9, 8, 5, 7, 8, 0, 9, 9, 0, 8, 9, 0, 0, 0, 0, 0,
135.8605 +         0, 0, 0, 0, 5, 9, 9, 0, 8, 8, 0, 8, 8, 5, 8, 9,
135.8606 +         0, 8, 8, 0, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5,
135.8607 +         9, 9, 0, 8, 8, 0, 8, 8, 5, 8, 9, 0, 8, 8, 0, 8,
135.8608 +         8,
135.8609 +};
135.8610 +
135.8611 +static const static_codebook _44c7_s_p1_0 = {
135.8612 +        4, 81,
135.8613 +        (long *)_vq_lengthlist__44c7_s_p1_0,
135.8614 +        1, -535822336, 1611661312, 2, 0,
135.8615 +        (long *)_vq_quantlist__44c7_s_p1_0,
135.8616 +        0
135.8617 +};
135.8618 +
135.8619 +static const long _vq_quantlist__44c7_s_p2_0[] = {
135.8620 +        2,
135.8621 +        1,
135.8622 +        3,
135.8623 +        0,
135.8624 +        4,
135.8625 +};
135.8626 +
135.8627 +static const long _vq_lengthlist__44c7_s_p2_0[] = {
135.8628 +         3, 5, 5, 8, 8, 0, 5, 5, 8, 8, 0, 5, 5, 8, 8, 0,
135.8629 +         7, 7, 9, 9, 0, 0, 0, 9, 9, 5, 7, 7, 9, 9, 0, 8,
135.8630 +         8,10,10, 0, 8, 7,10, 9, 0,10,10,11,11, 0, 0, 0,
135.8631 +        11,11, 5, 7, 7, 9, 9, 0, 8, 8,10,10, 0, 7, 8, 9,
135.8632 +        10, 0,10,10,11,11, 0, 0, 0,11,11, 8, 9, 9,11,10,
135.8633 +         0,11,11,12,12, 0,11,10,12,12, 0,13,14,14,14, 0,
135.8634 +         0, 0,14,13, 8, 9, 9,10,11, 0,11,11,12,12, 0,10,
135.8635 +        11,12,12, 0,13,13,14,14, 0, 0, 0,13,14, 0, 0, 0,
135.8636 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.8637 +         0, 0, 0, 0, 0, 0, 5, 8, 7,11,10, 0, 7, 7,10,10,
135.8638 +         0, 7, 7,10,10, 0, 9, 9,11,10, 0, 0, 0,11,11, 5,
135.8639 +         7, 8,10,11, 0, 7, 7,10,10, 0, 7, 7,10,10, 0, 9,
135.8640 +         9,10,11, 0, 0, 0,11,11, 8,10, 9,12,12, 0,10,10,
135.8641 +        12,12, 0,10,10,12,12, 0,12,12,13,13, 0, 0, 0,13,
135.8642 +        13, 8, 9,10,12,12, 0,10,10,12,12, 0,10,10,11,12,
135.8643 +         0,12,12,13,13, 0, 0, 0,13,13, 0, 0, 0, 0, 0, 0,
135.8644 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.8645 +         0, 0, 0, 5, 8, 8,11,11, 0, 7, 7,10,10, 0, 7, 7,
135.8646 +        10,10, 0, 9, 9,10,11, 0, 0, 0,11,10, 5, 8, 8,10,
135.8647 +        11, 0, 7, 7,10,10, 0, 7, 7,10,10, 0, 9, 9,11,10,
135.8648 +         0, 0, 0,10,11, 9,10,10,12,12, 0,10,10,12,12, 0,
135.8649 +        10,10,12,12, 0,12,13,13,13, 0, 0, 0,13,12, 9,10,
135.8650 +        10,12,12, 0,10,10,12,12, 0,10,10,12,12, 0,13,12,
135.8651 +        13,13, 0, 0, 0,12,13, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.8652 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.8653 +         7,10,10,14,13, 0, 9, 9,12,12, 0, 9, 9,12,12, 0,
135.8654 +        10,10,12,12, 0, 0, 0,12,12, 7,10,10,13,14, 0, 9,
135.8655 +         9,12,13, 0, 9, 9,12,12, 0,10,10,12,12, 0, 0, 0,
135.8656 +        12,12, 9,11,11,14,13, 0,11,10,13,12, 0,11,11,13,
135.8657 +        13, 0,12,12,13,13, 0, 0, 0,13,13, 9,11,11,13,14,
135.8658 +         0,10,11,12,13, 0,11,11,13,13, 0,12,12,13,13, 0,
135.8659 +         0, 0,13,13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.8660 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.8661 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.8662 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.8663 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9,
135.8664 +        11,11,14,14, 0,10,11,13,13, 0,11,10,13,13, 0,12,
135.8665 +        12,13,13, 0, 0, 0,13,12, 9,11,11,14,14, 0,11,10,
135.8666 +        13,13, 0,10,11,13,13, 0,12,12,14,13, 0, 0, 0,13,
135.8667 +        13,
135.8668 +};
135.8669 +
135.8670 +static const static_codebook _44c7_s_p2_0 = {
135.8671 +        4, 625,
135.8672 +        (long *)_vq_lengthlist__44c7_s_p2_0,
135.8673 +        1, -533725184, 1611661312, 3, 0,
135.8674 +        (long *)_vq_quantlist__44c7_s_p2_0,
135.8675 +        0
135.8676 +};
135.8677 +
135.8678 +static const long _vq_quantlist__44c7_s_p3_0[] = {
135.8679 +        4,
135.8680 +        3,
135.8681 +        5,
135.8682 +        2,
135.8683 +        6,
135.8684 +        1,
135.8685 +        7,
135.8686 +        0,
135.8687 +        8,
135.8688 +};
135.8689 +
135.8690 +static const long _vq_lengthlist__44c7_s_p3_0[] = {
135.8691 +         2, 4, 4, 5, 5, 7, 7, 9, 9, 0, 4, 4, 6, 6, 7, 7,
135.8692 +         9, 9, 0, 4, 4, 6, 6, 7, 7, 9, 9, 0, 5, 5, 6, 6,
135.8693 +         8, 8,10,10, 0, 0, 0, 6, 6, 8, 8,10,10, 0, 0, 0,
135.8694 +         7, 7, 9, 9,10,10, 0, 0, 0, 7, 7, 8, 8,10,10, 0,
135.8695 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.8696 +         0,
135.8697 +};
135.8698 +
135.8699 +static const static_codebook _44c7_s_p3_0 = {
135.8700 +        2, 81,
135.8701 +        (long *)_vq_lengthlist__44c7_s_p3_0,
135.8702 +        1, -531628032, 1611661312, 4, 0,
135.8703 +        (long *)_vq_quantlist__44c7_s_p3_0,
135.8704 +        0
135.8705 +};
135.8706 +
135.8707 +static const long _vq_quantlist__44c7_s_p4_0[] = {
135.8708 +        8,
135.8709 +        7,
135.8710 +        9,
135.8711 +        6,
135.8712 +        10,
135.8713 +        5,
135.8714 +        11,
135.8715 +        4,
135.8716 +        12,
135.8717 +        3,
135.8718 +        13,
135.8719 +        2,
135.8720 +        14,
135.8721 +        1,
135.8722 +        15,
135.8723 +        0,
135.8724 +        16,
135.8725 +};
135.8726 +
135.8727 +static const long _vq_lengthlist__44c7_s_p4_0[] = {
135.8728 +         3, 4, 4, 5, 5, 7, 7, 8, 8, 8, 8, 9, 9,10,10,11,
135.8729 +        11, 0, 4, 4, 6, 6, 7, 7, 8, 8, 9, 9,10,10,11,11,
135.8730 +        12,12, 0, 4, 4, 6, 6, 7, 7, 8, 8, 9, 9,10,10,11,
135.8731 +        11,12,12, 0, 5, 5, 6, 6, 8, 8, 9, 9, 9, 9,10,10,
135.8732 +        11,12,12,12, 0, 0, 0, 6, 6, 8, 7, 9, 9, 9, 9,10,
135.8733 +        10,11,11,12,12, 0, 0, 0, 7, 7, 8, 8, 9, 9,10,10,
135.8734 +        11,11,12,12,13,12, 0, 0, 0, 7, 7, 8, 8, 9, 9,10,
135.8735 +        10,11,11,12,12,12,13, 0, 0, 0, 7, 7, 8, 8, 9, 9,
135.8736 +        10,10,11,11,12,12,13,13, 0, 0, 0, 0, 0, 8, 8, 9,
135.8737 +         9,10,10,11,11,12,12,13,13, 0, 0, 0, 0, 0, 0, 0,
135.8738 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.8739 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.8740 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.8741 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.8742 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.8743 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.8744 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.8745 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.8746 +         0,
135.8747 +};
135.8748 +
135.8749 +static const static_codebook _44c7_s_p4_0 = {
135.8750 +        2, 289,
135.8751 +        (long *)_vq_lengthlist__44c7_s_p4_0,
135.8752 +        1, -529530880, 1611661312, 5, 0,
135.8753 +        (long *)_vq_quantlist__44c7_s_p4_0,
135.8754 +        0
135.8755 +};
135.8756 +
135.8757 +static const long _vq_quantlist__44c7_s_p5_0[] = {
135.8758 +        1,
135.8759 +        0,
135.8760 +        2,
135.8761 +};
135.8762 +
135.8763 +static const long _vq_lengthlist__44c7_s_p5_0[] = {
135.8764 +         1, 4, 4, 5, 7, 7, 6, 7, 7, 4, 6, 7,10,10,10,10,
135.8765 +        10, 9, 4, 6, 6,10,10,10,10, 9,10, 5,10,10, 9,11,
135.8766 +        12,10,11,12, 7,10,10,11,12,12,12,12,12, 7,10,10,
135.8767 +        11,12,12,12,12,12, 6,10,10,10,12,12,11,12,12, 7,
135.8768 +        10,10,12,12,12,12,11,12, 7,10,10,11,12,12,12,12,
135.8769 +        12,
135.8770 +};
135.8771 +
135.8772 +static const static_codebook _44c7_s_p5_0 = {
135.8773 +        4, 81,
135.8774 +        (long *)_vq_lengthlist__44c7_s_p5_0,
135.8775 +        1, -529137664, 1618345984, 2, 0,
135.8776 +        (long *)_vq_quantlist__44c7_s_p5_0,
135.8777 +        0
135.8778 +};
135.8779 +
135.8780 +static const long _vq_quantlist__44c7_s_p5_1[] = {
135.8781 +        5,
135.8782 +        4,
135.8783 +        6,
135.8784 +        3,
135.8785 +        7,
135.8786 +        2,
135.8787 +        8,
135.8788 +        1,
135.8789 +        9,
135.8790 +        0,
135.8791 +        10,
135.8792 +};
135.8793 +
135.8794 +static const long _vq_lengthlist__44c7_s_p5_1[] = {
135.8795 +         3, 5, 5, 6, 6, 7, 7, 8, 8, 8, 8,11, 4, 4, 6, 6,
135.8796 +         7, 7, 8, 8, 9, 9,11, 4, 4, 6, 6, 7, 7, 8, 8, 9,
135.8797 +         9,12, 5, 5, 6, 6, 7, 7, 9, 9, 9, 9,12,12,12, 6,
135.8798 +         6, 7, 7, 9, 9, 9, 9,11,11,11, 7, 7, 7, 7, 8, 8,
135.8799 +         9, 9,11,11,11, 7, 7, 7, 7, 8, 8, 9, 9,11,11,11,
135.8800 +         7, 7, 8, 8, 8, 8, 9, 9,11,11,11,11,11, 8, 8, 8,
135.8801 +         8, 8, 9,11,11,11,11,11, 8, 8, 8, 8, 8, 8,11,11,
135.8802 +        11,11,11, 7, 7, 8, 8, 8, 8,
135.8803 +};
135.8804 +
135.8805 +static const static_codebook _44c7_s_p5_1 = {
135.8806 +        2, 121,
135.8807 +        (long *)_vq_lengthlist__44c7_s_p5_1,
135.8808 +        1, -531365888, 1611661312, 4, 0,
135.8809 +        (long *)_vq_quantlist__44c7_s_p5_1,
135.8810 +        0
135.8811 +};
135.8812 +
135.8813 +static const long _vq_quantlist__44c7_s_p6_0[] = {
135.8814 +        6,
135.8815 +        5,
135.8816 +        7,
135.8817 +        4,
135.8818 +        8,
135.8819 +        3,
135.8820 +        9,
135.8821 +        2,
135.8822 +        10,
135.8823 +        1,
135.8824 +        11,
135.8825 +        0,
135.8826 +        12,
135.8827 +};
135.8828 +
135.8829 +static const long _vq_lengthlist__44c7_s_p6_0[] = {
135.8830 +         1, 4, 4, 6, 6, 7, 7, 8, 7, 9, 8,10,10, 6, 5, 5,
135.8831 +         7, 7, 8, 8, 9, 9, 9,10,11,11, 7, 5, 5, 7, 7, 8,
135.8832 +         8, 9, 9,10,10,11,11, 0, 7, 7, 7, 7, 9, 8, 9, 9,
135.8833 +        10,10,11,11, 0, 8, 8, 7, 7, 8, 9, 9, 9,10,10,11,
135.8834 +        11, 0,11,11, 9, 9,10,10,11,10,11,11,12,12, 0,12,
135.8835 +        12, 9, 9,10,10,11,11,11,11,12,12, 0, 0, 0, 0, 0,
135.8836 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.8837 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.8838 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.8839 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.8840 +         0, 0, 0, 0, 0, 0, 0, 0, 0,
135.8841 +};
135.8842 +
135.8843 +static const static_codebook _44c7_s_p6_0 = {
135.8844 +        2, 169,
135.8845 +        (long *)_vq_lengthlist__44c7_s_p6_0,
135.8846 +        1, -526516224, 1616117760, 4, 0,
135.8847 +        (long *)_vq_quantlist__44c7_s_p6_0,
135.8848 +        0
135.8849 +};
135.8850 +
135.8851 +static const long _vq_quantlist__44c7_s_p6_1[] = {
135.8852 +        2,
135.8853 +        1,
135.8854 +        3,
135.8855 +        0,
135.8856 +        4,
135.8857 +};
135.8858 +
135.8859 +static const long _vq_lengthlist__44c7_s_p6_1[] = {
135.8860 +         3, 4, 4, 5, 5, 5, 4, 4, 5, 5, 5, 4, 4, 5, 5, 6,
135.8861 +         5, 5, 5, 5, 6, 6, 6, 5, 5,
135.8862 +};
135.8863 +
135.8864 +static const static_codebook _44c7_s_p6_1 = {
135.8865 +        2, 25,
135.8866 +        (long *)_vq_lengthlist__44c7_s_p6_1,
135.8867 +        1, -533725184, 1611661312, 3, 0,
135.8868 +        (long *)_vq_quantlist__44c7_s_p6_1,
135.8869 +        0
135.8870 +};
135.8871 +
135.8872 +static const long _vq_quantlist__44c7_s_p7_0[] = {
135.8873 +        6,
135.8874 +        5,
135.8875 +        7,
135.8876 +        4,
135.8877 +        8,
135.8878 +        3,
135.8879 +        9,
135.8880 +        2,
135.8881 +        10,
135.8882 +        1,
135.8883 +        11,
135.8884 +        0,
135.8885 +        12,
135.8886 +};
135.8887 +
135.8888 +static const long _vq_lengthlist__44c7_s_p7_0[] = {
135.8889 +         1, 4, 4, 6, 6, 7, 8, 9, 9,10,10,12,11, 6, 5, 5,
135.8890 +         7, 7, 8, 8, 9,10,11,11,12,12, 7, 5, 5, 7, 7, 8,
135.8891 +         8,10,10,11,11,12,12,20, 7, 7, 7, 7, 8, 9,10,10,
135.8892 +        11,11,12,13,20, 7, 7, 7, 7, 9, 9,10,10,11,12,13,
135.8893 +        13,20,11,11, 8, 8, 9, 9,11,11,12,12,13,13,20,11,
135.8894 +        11, 8, 8, 9, 9,11,11,12,12,13,13,20,20,20,10,10,
135.8895 +        10,10,12,12,13,13,13,13,20,20,20,10,10,10,10,12,
135.8896 +        12,13,13,13,14,20,20,20,14,14,11,11,12,12,13,13,
135.8897 +        14,14,20,20,20,14,14,11,11,12,12,13,13,14,14,20,
135.8898 +        20,20,20,19,13,13,13,13,14,14,15,14,19,19,19,19,
135.8899 +        19,13,13,13,13,14,14,15,15,
135.8900 +};
135.8901 +
135.8902 +static const static_codebook _44c7_s_p7_0 = {
135.8903 +        2, 169,
135.8904 +        (long *)_vq_lengthlist__44c7_s_p7_0,
135.8905 +        1, -523206656, 1618345984, 4, 0,
135.8906 +        (long *)_vq_quantlist__44c7_s_p7_0,
135.8907 +        0
135.8908 +};
135.8909 +
135.8910 +static const long _vq_quantlist__44c7_s_p7_1[] = {
135.8911 +        5,
135.8912 +        4,
135.8913 +        6,
135.8914 +        3,
135.8915 +        7,
135.8916 +        2,
135.8917 +        8,
135.8918 +        1,
135.8919 +        9,
135.8920 +        0,
135.8921 +        10,
135.8922 +};
135.8923 +
135.8924 +static const long _vq_lengthlist__44c7_s_p7_1[] = {
135.8925 +         4, 5, 5, 6, 6, 7, 7, 7, 7, 7, 7, 8, 6, 6, 7, 7,
135.8926 +         7, 7, 7, 7, 7, 7, 8, 6, 6, 6, 7, 7, 7, 7, 7, 7,
135.8927 +         7, 8, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 7,
135.8928 +         7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 7, 7, 7, 7, 7, 7,
135.8929 +         7, 7, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8,
135.8930 +         7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 7, 7, 7,
135.8931 +         7, 7, 7, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 8, 8,
135.8932 +         8, 8, 8, 7, 7, 7, 7, 7, 7,
135.8933 +};
135.8934 +
135.8935 +static const static_codebook _44c7_s_p7_1 = {
135.8936 +        2, 121,
135.8937 +        (long *)_vq_lengthlist__44c7_s_p7_1,
135.8938 +        1, -531365888, 1611661312, 4, 0,
135.8939 +        (long *)_vq_quantlist__44c7_s_p7_1,
135.8940 +        0
135.8941 +};
135.8942 +
135.8943 +static const long _vq_quantlist__44c7_s_p8_0[] = {
135.8944 +        7,
135.8945 +        6,
135.8946 +        8,
135.8947 +        5,
135.8948 +        9,
135.8949 +        4,
135.8950 +        10,
135.8951 +        3,
135.8952 +        11,
135.8953 +        2,
135.8954 +        12,
135.8955 +        1,
135.8956 +        13,
135.8957 +        0,
135.8958 +        14,
135.8959 +};
135.8960 +
135.8961 +static const long _vq_lengthlist__44c7_s_p8_0[] = {
135.8962 +         1, 4, 4, 7, 7, 8, 8, 8, 7, 9, 8, 9, 9,10,10, 6,
135.8963 +         5, 5, 7, 7, 9, 9, 8, 8,10, 9,11,10,12,11, 6, 5,
135.8964 +         5, 8, 7, 9, 9, 8, 8,10,10,11,11,12,11,19, 8, 8,
135.8965 +         8, 8,10,10, 9, 9,10,10,11,11,12,11,19, 8, 8, 8,
135.8966 +         8,10,10, 9, 9,10,10,11,11,12,12,19,12,12, 9, 9,
135.8967 +        10,10, 9,10,10,10,11,11,12,12,19,12,12, 9, 9,10,
135.8968 +        10,10,10,10,10,12,12,12,12,19,19,19, 9, 9, 9, 9,
135.8969 +        11,10,11,11,12,11,13,13,19,19,19, 9, 9, 9, 9,11,
135.8970 +        10,11,11,11,12,13,13,19,19,19,13,13,10,10,11,11,
135.8971 +        12,12,12,12,13,12,19,19,19,14,13,10,10,11,11,12,
135.8972 +        12,12,13,13,13,19,19,19,19,19,12,12,12,11,12,13,
135.8973 +        14,13,13,13,19,19,19,19,19,12,12,12,11,12,12,13,
135.8974 +        14,13,14,19,19,19,19,19,16,16,12,13,12,13,13,14,
135.8975 +        15,14,19,18,18,18,18,16,15,12,11,12,11,14,12,14,
135.8976 +        14,
135.8977 +};
135.8978 +
135.8979 +static const static_codebook _44c7_s_p8_0 = {
135.8980 +        2, 225,
135.8981 +        (long *)_vq_lengthlist__44c7_s_p8_0,
135.8982 +        1, -520986624, 1620377600, 4, 0,
135.8983 +        (long *)_vq_quantlist__44c7_s_p8_0,
135.8984 +        0
135.8985 +};
135.8986 +
135.8987 +static const long _vq_quantlist__44c7_s_p8_1[] = {
135.8988 +        10,
135.8989 +        9,
135.8990 +        11,
135.8991 +        8,
135.8992 +        12,
135.8993 +        7,
135.8994 +        13,
135.8995 +        6,
135.8996 +        14,
135.8997 +        5,
135.8998 +        15,
135.8999 +        4,
135.9000 +        16,
135.9001 +        3,
135.9002 +        17,
135.9003 +        2,
135.9004 +        18,
135.9005 +        1,
135.9006 +        19,
135.9007 +        0,
135.9008 +        20,
135.9009 +};
135.9010 +
135.9011 +static const long _vq_lengthlist__44c7_s_p8_1[] = {
135.9012 +         3, 5, 5, 7, 6, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8,
135.9013 +         8, 8, 8, 8, 8,10, 6, 6, 7, 7, 8, 8, 8, 8, 9, 9,
135.9014 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9,10, 6, 6, 7, 7, 8,
135.9015 +         8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,10,
135.9016 +         7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
135.9017 +         9, 9, 9, 9,10,10,10, 8, 8, 8, 8, 9, 9, 9, 9, 9,
135.9018 +         9, 9, 9, 9, 9, 9, 9, 9, 9,10,10,10, 8, 8, 8, 9,
135.9019 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,10,10,
135.9020 +        10, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
135.9021 +         9, 9, 9,10,10,10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
135.9022 +         9, 9, 9, 9, 9, 9, 9, 9,10,11,10,10,10, 9, 9, 9,
135.9023 +         9, 9, 9, 9, 9, 9, 9,10, 9, 9,10, 9, 9,10,11,10,
135.9024 +        11,10, 9, 9, 9, 9, 9, 9, 9,10,10,10, 9,10, 9, 9,
135.9025 +         9, 9,11,10,11,10,10, 9, 9, 9, 9, 9, 9,10, 9, 9,
135.9026 +        10, 9, 9,10, 9, 9,10,11,10,10,11,10, 9, 9, 9, 9,
135.9027 +         9,10,10, 9,10,10,10,10, 9,10,10,10,10,10,10,11,
135.9028 +        11,11,10, 9, 9, 9,10,10,10,10,10,10,10,10,10,10,
135.9029 +        10,10,10,11,11,10,10,10,10,10,10,10,10,10,10,10,
135.9030 +        10, 9,10,10, 9,10,11,11,10,11,10,11,10, 9,10,10,
135.9031 +         9,10,10,10,10,10,10,10,10,10,10,11,11,11,11,10,
135.9032 +        11,11,10,10,10,10,10,10, 9,10, 9,10,10, 9,10, 9,
135.9033 +        10,10,10,11,10,11,10,11,11,10,10,10,10,10,10, 9,
135.9034 +        10,10,10,10,10,10,10,11,10,10,10,10,10,10,10,10,
135.9035 +        10,10,10,10,10,10,10,10,10,10,10,10,10,11,10,11,
135.9036 +        11,10,10,10,10, 9, 9,10,10, 9, 9,10, 9,10,10,10,
135.9037 +        10,11,11,10,10,10,10,10,10,10, 9, 9,10,10,10, 9,
135.9038 +         9,10,10,10,10,10,11,10,11,10,10,10,10,10,10, 9,
135.9039 +        10,10,10,10,10,10,10,10,10,
135.9040 +};
135.9041 +
135.9042 +static const static_codebook _44c7_s_p8_1 = {
135.9043 +        2, 441,
135.9044 +        (long *)_vq_lengthlist__44c7_s_p8_1,
135.9045 +        1, -529268736, 1611661312, 5, 0,
135.9046 +        (long *)_vq_quantlist__44c7_s_p8_1,
135.9047 +        0
135.9048 +};
135.9049 +
135.9050 +static const long _vq_quantlist__44c7_s_p9_0[] = {
135.9051 +        6,
135.9052 +        5,
135.9053 +        7,
135.9054 +        4,
135.9055 +        8,
135.9056 +        3,
135.9057 +        9,
135.9058 +        2,
135.9059 +        10,
135.9060 +        1,
135.9061 +        11,
135.9062 +        0,
135.9063 +        12,
135.9064 +};
135.9065 +
135.9066 +static const long _vq_lengthlist__44c7_s_p9_0[] = {
135.9067 +         1, 3, 3,11,11,11,11,11,11,11,11,11,11, 4, 6, 6,
135.9068 +        11,11,11,11,11,11,11,11,11,11, 4, 7, 7,11,11,11,
135.9069 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.9070 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.9071 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.9072 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.9073 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.9074 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.9075 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.9076 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.9077 +        11,11,11,11,11,11,11,11,11,
135.9078 +};
135.9079 +
135.9080 +static const static_codebook _44c7_s_p9_0 = {
135.9081 +        2, 169,
135.9082 +        (long *)_vq_lengthlist__44c7_s_p9_0,
135.9083 +        1, -511845376, 1630791680, 4, 0,
135.9084 +        (long *)_vq_quantlist__44c7_s_p9_0,
135.9085 +        0
135.9086 +};
135.9087 +
135.9088 +static const long _vq_quantlist__44c7_s_p9_1[] = {
135.9089 +        6,
135.9090 +        5,
135.9091 +        7,
135.9092 +        4,
135.9093 +        8,
135.9094 +        3,
135.9095 +        9,
135.9096 +        2,
135.9097 +        10,
135.9098 +        1,
135.9099 +        11,
135.9100 +        0,
135.9101 +        12,
135.9102 +};
135.9103 +
135.9104 +static const long _vq_lengthlist__44c7_s_p9_1[] = {
135.9105 +         1, 4, 4, 7, 7, 7, 7, 7, 6, 8, 8, 8, 8, 6, 6, 6,
135.9106 +         8, 8, 9, 8, 8, 7, 9, 8,11,10, 5, 6, 6, 8, 8, 9,
135.9107 +         8, 8, 8,10, 9,11,11,16, 8, 8, 9, 8, 9, 9, 9, 8,
135.9108 +        10, 9,11,10,16, 8, 8, 9, 9,10,10, 9, 9,10,10,11,
135.9109 +        11,16,13,13, 9, 9,10,10, 9,10,11,11,12,11,16,13,
135.9110 +        13, 9, 8,10, 9,10,10,10,10,11,11,16,14,16, 8, 9,
135.9111 +         9, 9,11,10,11,11,12,11,16,16,16, 9, 7,10, 7,11,
135.9112 +        10,11,11,12,11,16,16,16,12,12, 9,10,11,11,12,11,
135.9113 +        12,12,16,16,16,12,10,10, 7,11, 8,12,11,12,12,16,
135.9114 +        16,15,16,16,11,12,10,10,12,11,12,12,16,16,16,15,
135.9115 +        15,11,11,10,10,12,12,12,12,
135.9116 +};
135.9117 +
135.9118 +static const static_codebook _44c7_s_p9_1 = {
135.9119 +        2, 169,
135.9120 +        (long *)_vq_lengthlist__44c7_s_p9_1,
135.9121 +        1, -518889472, 1622704128, 4, 0,
135.9122 +        (long *)_vq_quantlist__44c7_s_p9_1,
135.9123 +        0
135.9124 +};
135.9125 +
135.9126 +static const long _vq_quantlist__44c7_s_p9_2[] = {
135.9127 +        24,
135.9128 +        23,
135.9129 +        25,
135.9130 +        22,
135.9131 +        26,
135.9132 +        21,
135.9133 +        27,
135.9134 +        20,
135.9135 +        28,
135.9136 +        19,
135.9137 +        29,
135.9138 +        18,
135.9139 +        30,
135.9140 +        17,
135.9141 +        31,
135.9142 +        16,
135.9143 +        32,
135.9144 +        15,
135.9145 +        33,
135.9146 +        14,
135.9147 +        34,
135.9148 +        13,
135.9149 +        35,
135.9150 +        12,
135.9151 +        36,
135.9152 +        11,
135.9153 +        37,
135.9154 +        10,
135.9155 +        38,
135.9156 +        9,
135.9157 +        39,
135.9158 +        8,
135.9159 +        40,
135.9160 +        7,
135.9161 +        41,
135.9162 +        6,
135.9163 +        42,
135.9164 +        5,
135.9165 +        43,
135.9166 +        4,
135.9167 +        44,
135.9168 +        3,
135.9169 +        45,
135.9170 +        2,
135.9171 +        46,
135.9172 +        1,
135.9173 +        47,
135.9174 +        0,
135.9175 +        48,
135.9176 +};
135.9177 +
135.9178 +static const long _vq_lengthlist__44c7_s_p9_2[] = {
135.9179 +         2, 4, 3, 4, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6,
135.9180 +         6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
135.9181 +         7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
135.9182 +         7,
135.9183 +};
135.9184 +
135.9185 +static const static_codebook _44c7_s_p9_2 = {
135.9186 +        1, 49,
135.9187 +        (long *)_vq_lengthlist__44c7_s_p9_2,
135.9188 +        1, -526909440, 1611661312, 6, 0,
135.9189 +        (long *)_vq_quantlist__44c7_s_p9_2,
135.9190 +        0
135.9191 +};
135.9192 +
135.9193 +static const long _huff_lengthlist__44c7_s_short[] = {
135.9194 +         4,11,12,14,15,15,17,17,18,18, 5, 6, 6, 8, 9,10,
135.9195 +        13,17,18,19, 7, 5, 4, 6, 8, 9,11,15,19,19, 8, 6,
135.9196 +         5, 5, 6, 7,11,14,16,17, 9, 7, 7, 6, 7, 7,10,13,
135.9197 +        15,19,10, 8, 7, 6, 7, 6, 7, 9,14,16,12,10, 9, 7,
135.9198 +         7, 6, 4, 5,10,15,14,13,11, 7, 6, 6, 4, 2, 7,13,
135.9199 +        16,16,15, 9, 8, 8, 8, 6, 9,13,19,19,17,12,11,10,
135.9200 +        10, 9,11,14,
135.9201 +};
135.9202 +
135.9203 +static const static_codebook _huff_book__44c7_s_short = {
135.9204 +        2, 100,
135.9205 +        (long *)_huff_lengthlist__44c7_s_short,
135.9206 +        0, 0, 0, 0, 0,
135.9207 +        NULL,
135.9208 +        0
135.9209 +};
135.9210 +
135.9211 +static const long _huff_lengthlist__44c8_s_long[] = {
135.9212 +         3, 8,12,13,14,14,14,13,14,14, 6, 4, 5, 8,10,10,
135.9213 +        11,11,14,13, 9, 5, 4, 5, 7, 8, 9,10,13,13,12, 7,
135.9214 +         5, 4, 5, 6, 8, 9,12,13,13, 9, 6, 5, 5, 5, 7, 9,
135.9215 +        11,14,12,10, 7, 6, 5, 4, 6, 7,10,11,12,11, 9, 8,
135.9216 +         7, 5, 5, 6,10,10,13,12,10, 9, 8, 6, 6, 5, 8,10,
135.9217 +        14,13,12,12,11,10, 9, 7, 8,10,12,13,14,14,13,12,
135.9218 +        11, 9, 9,10,
135.9219 +};
135.9220 +
135.9221 +static const static_codebook _huff_book__44c8_s_long = {
135.9222 +        2, 100,
135.9223 +        (long *)_huff_lengthlist__44c8_s_long,
135.9224 +        0, 0, 0, 0, 0,
135.9225 +        NULL,
135.9226 +        0
135.9227 +};
135.9228 +
135.9229 +static const long _vq_quantlist__44c8_s_p1_0[] = {
135.9230 +        1,
135.9231 +        0,
135.9232 +        2,
135.9233 +};
135.9234 +
135.9235 +static const long _vq_lengthlist__44c8_s_p1_0[] = {
135.9236 +         1, 5, 5, 0, 5, 5, 0, 5, 5, 5, 7, 7, 0, 9, 8, 0,
135.9237 +         9, 8, 6, 7, 7, 0, 8, 9, 0, 8, 9, 0, 0, 0, 0, 0,
135.9238 +         0, 0, 0, 0, 5, 9, 8, 0, 8, 8, 0, 8, 8, 5, 8, 9,
135.9239 +         0, 8, 8, 0, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5,
135.9240 +         9, 8, 0, 8, 8, 0, 8, 8, 5, 8, 9, 0, 8, 8, 0, 8,
135.9241 +         8,
135.9242 +};
135.9243 +
135.9244 +static const static_codebook _44c8_s_p1_0 = {
135.9245 +        4, 81,
135.9246 +        (long *)_vq_lengthlist__44c8_s_p1_0,
135.9247 +        1, -535822336, 1611661312, 2, 0,
135.9248 +        (long *)_vq_quantlist__44c8_s_p1_0,
135.9249 +        0
135.9250 +};
135.9251 +
135.9252 +static const long _vq_quantlist__44c8_s_p2_0[] = {
135.9253 +        2,
135.9254 +        1,
135.9255 +        3,
135.9256 +        0,
135.9257 +        4,
135.9258 +};
135.9259 +
135.9260 +static const long _vq_lengthlist__44c8_s_p2_0[] = {
135.9261 +         3, 5, 5, 8, 8, 0, 5, 5, 8, 8, 0, 5, 5, 8, 8, 0,
135.9262 +         7, 7, 9, 9, 0, 0, 0, 9, 9, 5, 7, 7, 9, 9, 0, 8,
135.9263 +         7,10, 9, 0, 8, 7,10, 9, 0,10,10,11,11, 0, 0, 0,
135.9264 +        11,11, 5, 7, 7, 9, 9, 0, 7, 8, 9,10, 0, 7, 8, 9,
135.9265 +        10, 0,10,10,11,11, 0, 0, 0,11,11, 8, 9, 9,11,10,
135.9266 +         0,11,10,12,11, 0,11,10,12,12, 0,13,13,14,14, 0,
135.9267 +         0, 0,14,13, 8, 9, 9,10,11, 0,10,11,12,12, 0,10,
135.9268 +        11,12,12, 0,13,13,14,14, 0, 0, 0,13,14, 0, 0, 0,
135.9269 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.9270 +         0, 0, 0, 0, 0, 0, 5, 8, 7,11,10, 0, 7, 7,10,10,
135.9271 +         0, 7, 7,10,10, 0, 9, 9,10,10, 0, 0, 0,11,10, 5,
135.9272 +         7, 8,10,11, 0, 7, 7,10,10, 0, 7, 7,10,10, 0, 9,
135.9273 +         9,10,10, 0, 0, 0,10,10, 8,10, 9,12,12, 0,10,10,
135.9274 +        12,11, 0,10,10,12,12, 0,12,12,13,12, 0, 0, 0,13,
135.9275 +        12, 8, 9,10,12,12, 0,10,10,11,12, 0,10,10,11,12,
135.9276 +         0,12,12,13,13, 0, 0, 0,12,13, 0, 0, 0, 0, 0, 0,
135.9277 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.9278 +         0, 0, 0, 6, 8, 7,11,10, 0, 7, 7,10,10, 0, 7, 7,
135.9279 +        10,10, 0, 9, 9,10,11, 0, 0, 0,10,10, 6, 7, 8,10,
135.9280 +        11, 0, 7, 7,10,10, 0, 7, 7,10,10, 0, 9, 9,10,10,
135.9281 +         0, 0, 0,10,10, 9,10, 9,12,12, 0,10,10,12,12, 0,
135.9282 +        10,10,12,11, 0,12,12,13,13, 0, 0, 0,13,12, 8, 9,
135.9283 +        10,12,12, 0,10,10,12,12, 0,10,10,11,12, 0,12,12,
135.9284 +        13,13, 0, 0, 0,12,13, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.9285 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.9286 +         7,10,10,13,13, 0, 9, 9,12,12, 0, 9, 9,12,12, 0,
135.9287 +        10,10,12,12, 0, 0, 0,12,12, 7,10,10,13,13, 0, 9,
135.9288 +         9,12,12, 0, 9, 9,12,12, 0,10,10,12,12, 0, 0, 0,
135.9289 +        12,12, 9,11,11,14,13, 0,10,10,13,12, 0,11,10,13,
135.9290 +        12, 0,12,12,13,12, 0, 0, 0,13,13, 9,11,11,13,14,
135.9291 +         0,10,11,12,13, 0,10,11,13,13, 0,12,12,12,13, 0,
135.9292 +         0, 0,13,13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.9293 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.9294 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.9295 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.9296 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9,
135.9297 +        11,11,14,14, 0,10,11,13,13, 0,11,10,13,13, 0,11,
135.9298 +        12,13,13, 0, 0, 0,13,12, 9,11,11,14,14, 0,11,10,
135.9299 +        13,13, 0,10,11,13,13, 0,12,12,13,13, 0, 0, 0,12,
135.9300 +        13,
135.9301 +};
135.9302 +
135.9303 +static const static_codebook _44c8_s_p2_0 = {
135.9304 +        4, 625,
135.9305 +        (long *)_vq_lengthlist__44c8_s_p2_0,
135.9306 +        1, -533725184, 1611661312, 3, 0,
135.9307 +        (long *)_vq_quantlist__44c8_s_p2_0,
135.9308 +        0
135.9309 +};
135.9310 +
135.9311 +static const long _vq_quantlist__44c8_s_p3_0[] = {
135.9312 +        4,
135.9313 +        3,
135.9314 +        5,
135.9315 +        2,
135.9316 +        6,
135.9317 +        1,
135.9318 +        7,
135.9319 +        0,
135.9320 +        8,
135.9321 +};
135.9322 +
135.9323 +static const long _vq_lengthlist__44c8_s_p3_0[] = {
135.9324 +         2, 4, 4, 5, 5, 7, 7, 9, 9, 0, 4, 4, 6, 6, 7, 7,
135.9325 +         9, 9, 0, 4, 4, 6, 6, 7, 7, 9, 9, 0, 5, 5, 6, 6,
135.9326 +         8, 8,10,10, 0, 0, 0, 6, 6, 8, 8,10,10, 0, 0, 0,
135.9327 +         7, 7, 9, 9,10,10, 0, 0, 0, 7, 7, 8, 8,10,10, 0,
135.9328 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.9329 +         0,
135.9330 +};
135.9331 +
135.9332 +static const static_codebook _44c8_s_p3_0 = {
135.9333 +        2, 81,
135.9334 +        (long *)_vq_lengthlist__44c8_s_p3_0,
135.9335 +        1, -531628032, 1611661312, 4, 0,
135.9336 +        (long *)_vq_quantlist__44c8_s_p3_0,
135.9337 +        0
135.9338 +};
135.9339 +
135.9340 +static const long _vq_quantlist__44c8_s_p4_0[] = {
135.9341 +        8,
135.9342 +        7,
135.9343 +        9,
135.9344 +        6,
135.9345 +        10,
135.9346 +        5,
135.9347 +        11,
135.9348 +        4,
135.9349 +        12,
135.9350 +        3,
135.9351 +        13,
135.9352 +        2,
135.9353 +        14,
135.9354 +        1,
135.9355 +        15,
135.9356 +        0,
135.9357 +        16,
135.9358 +};
135.9359 +
135.9360 +static const long _vq_lengthlist__44c8_s_p4_0[] = {
135.9361 +         3, 4, 4, 5, 5, 7, 7, 8, 8, 8, 8, 9, 9,10,10,11,
135.9362 +        11, 0, 4, 4, 6, 6, 7, 7, 8, 8, 9, 8,10,10,11,11,
135.9363 +        11,11, 0, 4, 4, 6, 6, 7, 7, 8, 8, 9, 9,10,10,11,
135.9364 +        11,11,11, 0, 6, 5, 6, 6, 7, 7, 9, 9, 9, 9,10,10,
135.9365 +        11,11,12,12, 0, 0, 0, 6, 6, 7, 7, 9, 9, 9, 9,10,
135.9366 +        10,11,11,12,12, 0, 0, 0, 7, 7, 8, 8, 9, 9,10,10,
135.9367 +        11,11,11,12,12,12, 0, 0, 0, 7, 7, 8, 8, 9, 9,10,
135.9368 +        10,11,11,11,12,12,12, 0, 0, 0, 7, 7, 8, 8, 9, 9,
135.9369 +        10,10,11,11,12,12,13,13, 0, 0, 0, 0, 0, 8, 8, 9,
135.9370 +         9,10,10,11,11,12,12,13,13, 0, 0, 0, 0, 0, 0, 0,
135.9371 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.9372 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.9373 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.9374 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.9375 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.9376 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.9377 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.9378 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.9379 +         0,
135.9380 +};
135.9381 +
135.9382 +static const static_codebook _44c8_s_p4_0 = {
135.9383 +        2, 289,
135.9384 +        (long *)_vq_lengthlist__44c8_s_p4_0,
135.9385 +        1, -529530880, 1611661312, 5, 0,
135.9386 +        (long *)_vq_quantlist__44c8_s_p4_0,
135.9387 +        0
135.9388 +};
135.9389 +
135.9390 +static const long _vq_quantlist__44c8_s_p5_0[] = {
135.9391 +        1,
135.9392 +        0,
135.9393 +        2,
135.9394 +};
135.9395 +
135.9396 +static const long _vq_lengthlist__44c8_s_p5_0[] = {
135.9397 +         1, 4, 4, 5, 7, 7, 6, 7, 7, 4, 7, 6,10,10,10,10,
135.9398 +        10,10, 4, 6, 6,10,10,10,10, 9,10, 5,10,10, 9,11,
135.9399 +        11,10,11,11, 7,10,10,11,12,12,12,12,12, 7,10,10,
135.9400 +        11,12,12,12,12,12, 6,10,10,10,12,12,10,12,12, 7,
135.9401 +        10,10,11,12,12,12,12,12, 7,10,10,11,12,12,12,12,
135.9402 +        12,
135.9403 +};
135.9404 +
135.9405 +static const static_codebook _44c8_s_p5_0 = {
135.9406 +        4, 81,
135.9407 +        (long *)_vq_lengthlist__44c8_s_p5_0,
135.9408 +        1, -529137664, 1618345984, 2, 0,
135.9409 +        (long *)_vq_quantlist__44c8_s_p5_0,
135.9410 +        0
135.9411 +};
135.9412 +
135.9413 +static const long _vq_quantlist__44c8_s_p5_1[] = {
135.9414 +        5,
135.9415 +        4,
135.9416 +        6,
135.9417 +        3,
135.9418 +        7,
135.9419 +        2,
135.9420 +        8,
135.9421 +        1,
135.9422 +        9,
135.9423 +        0,
135.9424 +        10,
135.9425 +};
135.9426 +
135.9427 +static const long _vq_lengthlist__44c8_s_p5_1[] = {
135.9428 +         3, 5, 5, 6, 6, 7, 7, 8, 8, 8, 8,11, 4, 5, 6, 6,
135.9429 +         7, 7, 8, 8, 8, 8,11, 5, 5, 6, 6, 7, 7, 8, 8, 8,
135.9430 +         9,12, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9,12,12,12, 6,
135.9431 +         6, 7, 7, 8, 8, 9, 9,11,11,11, 6, 6, 7, 7, 8, 8,
135.9432 +         8, 8,11,11,11, 6, 6, 7, 7, 8, 8, 8, 8,11,11,11,
135.9433 +         7, 7, 7, 8, 8, 8, 8, 8,11,11,11,11,11, 7, 7, 8,
135.9434 +         8, 8, 8,11,11,11,11,11, 7, 7, 7, 7, 8, 8,11,11,
135.9435 +        11,11,11, 7, 7, 7, 7, 8, 8,
135.9436 +};
135.9437 +
135.9438 +static const static_codebook _44c8_s_p5_1 = {
135.9439 +        2, 121,
135.9440 +        (long *)_vq_lengthlist__44c8_s_p5_1,
135.9441 +        1, -531365888, 1611661312, 4, 0,
135.9442 +        (long *)_vq_quantlist__44c8_s_p5_1,
135.9443 +        0
135.9444 +};
135.9445 +
135.9446 +static const long _vq_quantlist__44c8_s_p6_0[] = {
135.9447 +        6,
135.9448 +        5,
135.9449 +        7,
135.9450 +        4,
135.9451 +        8,
135.9452 +        3,
135.9453 +        9,
135.9454 +        2,
135.9455 +        10,
135.9456 +        1,
135.9457 +        11,
135.9458 +        0,
135.9459 +        12,
135.9460 +};
135.9461 +
135.9462 +static const long _vq_lengthlist__44c8_s_p6_0[] = {
135.9463 +         1, 4, 4, 6, 6, 7, 7, 8, 8, 9, 9,10,10, 6, 5, 5,
135.9464 +         7, 7, 8, 8, 9, 9,10,10,11,11, 6, 5, 5, 7, 7, 8,
135.9465 +         8, 9, 9,10,10,11,11, 0, 7, 7, 7, 7, 9, 9,10,10,
135.9466 +        10,10,11,11, 0, 7, 7, 7, 7, 9, 9,10,10,10,10,11,
135.9467 +        11, 0,11,11, 9, 9,10,10,11,11,11,11,12,12, 0,12,
135.9468 +        12, 9, 9,10,10,11,11,12,12,12,12, 0, 0, 0, 0, 0,
135.9469 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.9470 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.9471 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.9472 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.9473 +         0, 0, 0, 0, 0, 0, 0, 0, 0,
135.9474 +};
135.9475 +
135.9476 +static const static_codebook _44c8_s_p6_0 = {
135.9477 +        2, 169,
135.9478 +        (long *)_vq_lengthlist__44c8_s_p6_0,
135.9479 +        1, -526516224, 1616117760, 4, 0,
135.9480 +        (long *)_vq_quantlist__44c8_s_p6_0,
135.9481 +        0
135.9482 +};
135.9483 +
135.9484 +static const long _vq_quantlist__44c8_s_p6_1[] = {
135.9485 +        2,
135.9486 +        1,
135.9487 +        3,
135.9488 +        0,
135.9489 +        4,
135.9490 +};
135.9491 +
135.9492 +static const long _vq_lengthlist__44c8_s_p6_1[] = {
135.9493 +         3, 4, 4, 5, 5, 5, 4, 4, 5, 5, 5, 4, 4, 5, 5, 6,
135.9494 +         5, 5, 5, 5, 6, 6, 6, 5, 5,
135.9495 +};
135.9496 +
135.9497 +static const static_codebook _44c8_s_p6_1 = {
135.9498 +        2, 25,
135.9499 +        (long *)_vq_lengthlist__44c8_s_p6_1,
135.9500 +        1, -533725184, 1611661312, 3, 0,
135.9501 +        (long *)_vq_quantlist__44c8_s_p6_1,
135.9502 +        0
135.9503 +};
135.9504 +
135.9505 +static const long _vq_quantlist__44c8_s_p7_0[] = {
135.9506 +        6,
135.9507 +        5,
135.9508 +        7,
135.9509 +        4,
135.9510 +        8,
135.9511 +        3,
135.9512 +        9,
135.9513 +        2,
135.9514 +        10,
135.9515 +        1,
135.9516 +        11,
135.9517 +        0,
135.9518 +        12,
135.9519 +};
135.9520 +
135.9521 +static const long _vq_lengthlist__44c8_s_p7_0[] = {
135.9522 +         1, 4, 4, 6, 6, 8, 7, 9, 9,10,10,12,12, 6, 5, 5,
135.9523 +         7, 7, 8, 8,10,10,11,11,12,12, 7, 5, 5, 7, 7, 8,
135.9524 +         8,10,10,11,11,12,12,21, 7, 7, 7, 7, 8, 9,10,10,
135.9525 +        11,11,12,12,21, 7, 7, 7, 7, 9, 9,10,10,12,12,13,
135.9526 +        13,21,11,11, 8, 8, 9, 9,11,11,12,12,13,13,21,11,
135.9527 +        11, 8, 8, 9, 9,11,11,12,12,13,13,21,21,21,10,10,
135.9528 +        10,10,11,11,12,13,13,13,21,21,21,10,10,10,10,11,
135.9529 +        11,13,13,14,13,21,21,21,13,13,11,11,12,12,13,13,
135.9530 +        14,14,21,21,21,14,14,11,11,12,12,13,13,14,14,21,
135.9531 +        21,21,21,20,13,13,13,12,14,14,16,15,20,20,20,20,
135.9532 +        20,13,13,13,13,14,13,15,15,
135.9533 +};
135.9534 +
135.9535 +static const static_codebook _44c8_s_p7_0 = {
135.9536 +        2, 169,
135.9537 +        (long *)_vq_lengthlist__44c8_s_p7_0,
135.9538 +        1, -523206656, 1618345984, 4, 0,
135.9539 +        (long *)_vq_quantlist__44c8_s_p7_0,
135.9540 +        0
135.9541 +};
135.9542 +
135.9543 +static const long _vq_quantlist__44c8_s_p7_1[] = {
135.9544 +        5,
135.9545 +        4,
135.9546 +        6,
135.9547 +        3,
135.9548 +        7,
135.9549 +        2,
135.9550 +        8,
135.9551 +        1,
135.9552 +        9,
135.9553 +        0,
135.9554 +        10,
135.9555 +};
135.9556 +
135.9557 +static const long _vq_lengthlist__44c8_s_p7_1[] = {
135.9558 +         4, 5, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 6, 6, 6, 7,
135.9559 +         7, 7, 7, 7, 7, 7, 8, 6, 6, 6, 6, 7, 7, 7, 7, 7,
135.9560 +         7, 8, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 7,
135.9561 +         7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 7, 7, 7, 7, 7, 7,
135.9562 +         7, 7, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8,
135.9563 +         7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 7, 7, 7,
135.9564 +         7, 7, 7, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 8, 8,
135.9565 +         8, 8, 8, 7, 7, 7, 7, 7, 7,
135.9566 +};
135.9567 +
135.9568 +static const static_codebook _44c8_s_p7_1 = {
135.9569 +        2, 121,
135.9570 +        (long *)_vq_lengthlist__44c8_s_p7_1,
135.9571 +        1, -531365888, 1611661312, 4, 0,
135.9572 +        (long *)_vq_quantlist__44c8_s_p7_1,
135.9573 +        0
135.9574 +};
135.9575 +
135.9576 +static const long _vq_quantlist__44c8_s_p8_0[] = {
135.9577 +        7,
135.9578 +        6,
135.9579 +        8,
135.9580 +        5,
135.9581 +        9,
135.9582 +        4,
135.9583 +        10,
135.9584 +        3,
135.9585 +        11,
135.9586 +        2,
135.9587 +        12,
135.9588 +        1,
135.9589 +        13,
135.9590 +        0,
135.9591 +        14,
135.9592 +};
135.9593 +
135.9594 +static const long _vq_lengthlist__44c8_s_p8_0[] = {
135.9595 +         1, 4, 4, 7, 6, 8, 8, 8, 7, 9, 8,10,10,11,10, 6,
135.9596 +         5, 5, 7, 7, 9, 9, 8, 8,10,10,11,11,12,11, 6, 5,
135.9597 +         5, 7, 7, 9, 9, 9, 9,10,10,11,11,12,12,20, 8, 8,
135.9598 +         8, 8, 9, 9, 9, 9,10,10,11,11,12,12,20, 8, 8, 8,
135.9599 +         8,10, 9, 9, 9,10,10,11,11,12,12,20,12,12, 9, 9,
135.9600 +        10,10,10,10,10,11,12,12,12,12,20,12,12, 9, 9,10,
135.9601 +        10,10,10,11,11,12,12,13,13,20,20,20, 9, 9, 9, 9,
135.9602 +        11,10,11,11,12,12,12,13,20,19,19, 9, 9, 9, 9,11,
135.9603 +        11,11,12,12,12,13,13,19,19,19,13,13,10,10,11,11,
135.9604 +        12,12,13,13,13,13,19,19,19,14,13,11,10,11,11,12,
135.9605 +        12,12,13,13,13,19,19,19,19,19,12,12,12,12,13,13,
135.9606 +        13,13,14,13,19,19,19,19,19,12,12,12,11,12,12,13,
135.9607 +        14,14,14,19,19,19,19,19,16,15,13,12,13,13,13,14,
135.9608 +        14,14,19,19,19,19,19,17,17,13,12,13,11,14,13,15,
135.9609 +        15,
135.9610 +};
135.9611 +
135.9612 +static const static_codebook _44c8_s_p8_0 = {
135.9613 +        2, 225,
135.9614 +        (long *)_vq_lengthlist__44c8_s_p8_0,
135.9615 +        1, -520986624, 1620377600, 4, 0,
135.9616 +        (long *)_vq_quantlist__44c8_s_p8_0,
135.9617 +        0
135.9618 +};
135.9619 +
135.9620 +static const long _vq_quantlist__44c8_s_p8_1[] = {
135.9621 +        10,
135.9622 +        9,
135.9623 +        11,
135.9624 +        8,
135.9625 +        12,
135.9626 +        7,
135.9627 +        13,
135.9628 +        6,
135.9629 +        14,
135.9630 +        5,
135.9631 +        15,
135.9632 +        4,
135.9633 +        16,
135.9634 +        3,
135.9635 +        17,
135.9636 +        2,
135.9637 +        18,
135.9638 +        1,
135.9639 +        19,
135.9640 +        0,
135.9641 +        20,
135.9642 +};
135.9643 +
135.9644 +static const long _vq_lengthlist__44c8_s_p8_1[] = {
135.9645 +         4, 5, 5, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8,
135.9646 +         8, 8, 8, 8, 8,10, 6, 6, 7, 7, 8, 8, 8, 8, 9, 9,
135.9647 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9,10, 6, 6, 7, 7, 8,
135.9648 +         8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,10,
135.9649 +         7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
135.9650 +         9, 9, 9, 9,10,10,10, 8, 8, 8, 8, 9, 9, 9, 9, 9,
135.9651 +         9, 9, 9, 9, 9, 9, 9, 9, 9,10,10,10, 8, 8, 8, 9,
135.9652 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,10,10,
135.9653 +        10, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
135.9654 +         9, 9, 9,10,10,10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
135.9655 +         9, 9, 9, 9, 9, 9, 9, 9,10,10,10,10,10, 9, 9, 9,
135.9656 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,10,10,10,
135.9657 +        10,10, 9, 9, 9, 9, 9, 9, 9, 9,10, 9, 9, 9, 9, 9,
135.9658 +         9, 9,10,10,10,10,10, 9, 9, 9, 9, 9, 9, 9, 9, 9,
135.9659 +         9, 9, 9, 9, 9, 9, 9,10,10,10,10,10, 9, 9, 9, 9,
135.9660 +         9, 9, 9, 9,10,10,10, 9, 9, 9, 9, 9,10,10,10,10,
135.9661 +        10,10,10, 9, 9, 9, 9, 9,10,10,10, 9, 9, 9, 9, 9,
135.9662 +         9,10,10,10,10,10,10,10, 9,10,10, 9,10,10,10,10,
135.9663 +         9,10, 9,10,10, 9,10,10,10,10,10,10,10, 9,10,10,
135.9664 +        10,10,10,10, 9, 9,10,10, 9,10,10,10,10,10,10,10,
135.9665 +        10,10,10,10,10,10,10,10, 9, 9, 9,10, 9, 9, 9, 9,
135.9666 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10, 9, 9,
135.9667 +        10, 9,10, 9,10,10,10,10,10,10,10,10,10,10,10,10,
135.9668 +        10,10,10,10, 9, 9,10, 9, 9, 9,10,10,10,10,10,10,
135.9669 +        10,10,10,10,10, 9, 9, 9, 9, 9, 9,10, 9, 9,10,10,
135.9670 +        10,10,10,10,10,10,10,10,10,10,10,10,10, 9,10, 9,
135.9671 +         9,10, 9, 9,10,10,10,10,10,10,10,10,10,10,10,10,
135.9672 +        10, 9, 9,10,10, 9,10, 9, 9,
135.9673 +};
135.9674 +
135.9675 +static const static_codebook _44c8_s_p8_1 = {
135.9676 +        2, 441,
135.9677 +        (long *)_vq_lengthlist__44c8_s_p8_1,
135.9678 +        1, -529268736, 1611661312, 5, 0,
135.9679 +        (long *)_vq_quantlist__44c8_s_p8_1,
135.9680 +        0
135.9681 +};
135.9682 +
135.9683 +static const long _vq_quantlist__44c8_s_p9_0[] = {
135.9684 +        8,
135.9685 +        7,
135.9686 +        9,
135.9687 +        6,
135.9688 +        10,
135.9689 +        5,
135.9690 +        11,
135.9691 +        4,
135.9692 +        12,
135.9693 +        3,
135.9694 +        13,
135.9695 +        2,
135.9696 +        14,
135.9697 +        1,
135.9698 +        15,
135.9699 +        0,
135.9700 +        16,
135.9701 +};
135.9702 +
135.9703 +static const long _vq_lengthlist__44c8_s_p9_0[] = {
135.9704 +         1, 4, 3,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.9705 +        11, 4, 7, 7,11,11,11,11,11,11,11,11,11,11,11,11,
135.9706 +        11,11, 4, 8,11,11,11,11,11,11,11,11,11,11,11,11,
135.9707 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.9708 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.9709 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.9710 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.9711 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.9712 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.9713 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.9714 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.9715 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.9716 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.9717 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.9718 +        11,11,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.9719 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.9720 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.9721 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.9722 +        10,
135.9723 +};
135.9724 +
135.9725 +static const static_codebook _44c8_s_p9_0 = {
135.9726 +        2, 289,
135.9727 +        (long *)_vq_lengthlist__44c8_s_p9_0,
135.9728 +        1, -509798400, 1631393792, 5, 0,
135.9729 +        (long *)_vq_quantlist__44c8_s_p9_0,
135.9730 +        0
135.9731 +};
135.9732 +
135.9733 +static const long _vq_quantlist__44c8_s_p9_1[] = {
135.9734 +        9,
135.9735 +        8,
135.9736 +        10,
135.9737 +        7,
135.9738 +        11,
135.9739 +        6,
135.9740 +        12,
135.9741 +        5,
135.9742 +        13,
135.9743 +        4,
135.9744 +        14,
135.9745 +        3,
135.9746 +        15,
135.9747 +        2,
135.9748 +        16,
135.9749 +        1,
135.9750 +        17,
135.9751 +        0,
135.9752 +        18,
135.9753 +};
135.9754 +
135.9755 +static const long _vq_lengthlist__44c8_s_p9_1[] = {
135.9756 +         1, 4, 4, 7, 6, 7, 7, 7, 7, 8, 8, 9, 9,10,10,10,
135.9757 +        10,11,11, 6, 6, 6, 8, 8, 9, 8, 8, 7,10, 8,11,10,
135.9758 +        12,11,12,12,13,13, 5, 5, 6, 8, 8, 9, 9, 8, 8,10,
135.9759 +         9,11,11,12,12,13,13,13,13,17, 8, 8, 9, 9, 9, 9,
135.9760 +         9, 9,10, 9,12,10,12,12,13,12,13,13,17, 9, 8, 9,
135.9761 +         9, 9, 9, 9, 9,10,10,12,12,12,12,13,13,13,13,17,
135.9762 +        13,13, 9, 9,10,10,10,10,11,11,12,11,13,12,13,13,
135.9763 +        14,15,17,13,13, 9, 8,10, 9,10,10,11,11,12,12,14,
135.9764 +        13,15,13,14,15,17,17,17, 9,10, 9,10,11,11,12,12,
135.9765 +        12,12,13,13,14,14,15,15,17,17,17, 9, 8, 9, 8,11,
135.9766 +        11,12,12,12,12,14,13,14,14,14,15,17,17,17,12,14,
135.9767 +         9,10,11,11,12,12,14,13,13,14,15,13,15,15,17,17,
135.9768 +        17,13,11,10, 8,11, 9,13,12,13,13,13,13,13,14,14,
135.9769 +        14,17,17,17,17,17,11,12,11,11,13,13,14,13,15,14,
135.9770 +        13,15,16,15,17,17,17,17,17,11,11,12, 8,13,12,14,
135.9771 +        13,17,14,15,14,15,14,17,17,17,17,17,15,15,12,12,
135.9772 +        12,12,13,14,14,14,15,14,17,14,17,17,17,17,17,16,
135.9773 +        17,12,12,13,12,13,13,14,14,14,14,14,14,17,17,17,
135.9774 +        17,17,17,17,14,14,13,12,13,13,15,15,14,13,15,17,
135.9775 +        17,17,17,17,17,17,17,13,14,13,13,13,13,14,15,15,
135.9776 +        15,14,15,17,17,17,17,17,17,17,16,15,13,14,13,13,
135.9777 +        14,14,15,14,14,16,17,17,17,17,17,17,17,16,16,13,
135.9778 +        14,13,13,14,14,15,14,15,14,
135.9779 +};
135.9780 +
135.9781 +static const static_codebook _44c8_s_p9_1 = {
135.9782 +        2, 361,
135.9783 +        (long *)_vq_lengthlist__44c8_s_p9_1,
135.9784 +        1, -518287360, 1622704128, 5, 0,
135.9785 +        (long *)_vq_quantlist__44c8_s_p9_1,
135.9786 +        0
135.9787 +};
135.9788 +
135.9789 +static const long _vq_quantlist__44c8_s_p9_2[] = {
135.9790 +        24,
135.9791 +        23,
135.9792 +        25,
135.9793 +        22,
135.9794 +        26,
135.9795 +        21,
135.9796 +        27,
135.9797 +        20,
135.9798 +        28,
135.9799 +        19,
135.9800 +        29,
135.9801 +        18,
135.9802 +        30,
135.9803 +        17,
135.9804 +        31,
135.9805 +        16,
135.9806 +        32,
135.9807 +        15,
135.9808 +        33,
135.9809 +        14,
135.9810 +        34,
135.9811 +        13,
135.9812 +        35,
135.9813 +        12,
135.9814 +        36,
135.9815 +        11,
135.9816 +        37,
135.9817 +        10,
135.9818 +        38,
135.9819 +        9,
135.9820 +        39,
135.9821 +        8,
135.9822 +        40,
135.9823 +        7,
135.9824 +        41,
135.9825 +        6,
135.9826 +        42,
135.9827 +        5,
135.9828 +        43,
135.9829 +        4,
135.9830 +        44,
135.9831 +        3,
135.9832 +        45,
135.9833 +        2,
135.9834 +        46,
135.9835 +        1,
135.9836 +        47,
135.9837 +        0,
135.9838 +        48,
135.9839 +};
135.9840 +
135.9841 +static const long _vq_lengthlist__44c8_s_p9_2[] = {
135.9842 +         2, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6,
135.9843 +         6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7,
135.9844 +         7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
135.9845 +         7,
135.9846 +};
135.9847 +
135.9848 +static const static_codebook _44c8_s_p9_2 = {
135.9849 +        1, 49,
135.9850 +        (long *)_vq_lengthlist__44c8_s_p9_2,
135.9851 +        1, -526909440, 1611661312, 6, 0,
135.9852 +        (long *)_vq_quantlist__44c8_s_p9_2,
135.9853 +        0
135.9854 +};
135.9855 +
135.9856 +static const long _huff_lengthlist__44c8_s_short[] = {
135.9857 +         4,11,13,14,15,15,18,17,19,17, 5, 6, 8, 9,10,10,
135.9858 +        12,15,19,19, 6, 6, 6, 6, 8, 8,11,14,18,19, 8, 6,
135.9859 +         5, 4, 6, 7,10,13,16,17, 9, 7, 6, 5, 6, 7, 9,12,
135.9860 +        15,19,10, 8, 7, 6, 6, 6, 7, 9,13,15,12,10, 9, 8,
135.9861 +         7, 6, 4, 5,10,15,13,13,11, 8, 6, 6, 4, 2, 7,12,
135.9862 +        17,15,16,10, 8, 8, 7, 6, 9,12,19,18,17,13,11,10,
135.9863 +        10, 9,11,14,
135.9864 +};
135.9865 +
135.9866 +static const static_codebook _huff_book__44c8_s_short = {
135.9867 +        2, 100,
135.9868 +        (long *)_huff_lengthlist__44c8_s_short,
135.9869 +        0, 0, 0, 0, 0,
135.9870 +        NULL,
135.9871 +        0
135.9872 +};
135.9873 +
135.9874 +static const long _huff_lengthlist__44c9_s_long[] = {
135.9875 +         3, 8,12,14,15,15,15,13,15,15, 6, 5, 8,10,12,12,
135.9876 +        13,12,14,13,10, 6, 5, 6, 8, 9,11,11,13,13,13, 8,
135.9877 +         5, 4, 5, 6, 8,10,11,13,14,10, 7, 5, 4, 5, 7, 9,
135.9878 +        11,12,13,11, 8, 6, 5, 4, 5, 7, 9,11,12,11,10, 8,
135.9879 +         7, 5, 4, 5, 9,10,13,13,11,10, 8, 6, 5, 4, 7, 9,
135.9880 +        15,14,13,12,10, 9, 8, 7, 8, 9,12,12,14,13,12,11,
135.9881 +        10, 9, 8, 9,
135.9882 +};
135.9883 +
135.9884 +static const static_codebook _huff_book__44c9_s_long = {
135.9885 +        2, 100,
135.9886 +        (long *)_huff_lengthlist__44c9_s_long,
135.9887 +        0, 0, 0, 0, 0,
135.9888 +        NULL,
135.9889 +        0
135.9890 +};
135.9891 +
135.9892 +static const long _vq_quantlist__44c9_s_p1_0[] = {
135.9893 +        1,
135.9894 +        0,
135.9895 +        2,
135.9896 +};
135.9897 +
135.9898 +static const long _vq_lengthlist__44c9_s_p1_0[] = {
135.9899 +         1, 5, 5, 0, 5, 5, 0, 5, 5, 6, 8, 8, 0, 9, 8, 0,
135.9900 +         9, 8, 6, 8, 8, 0, 8, 9, 0, 8, 9, 0, 0, 0, 0, 0,
135.9901 +         0, 0, 0, 0, 5, 8, 8, 0, 7, 7, 0, 8, 8, 5, 8, 8,
135.9902 +         0, 7, 8, 0, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5,
135.9903 +         9, 8, 0, 8, 8, 0, 7, 7, 5, 8, 9, 0, 8, 8, 0, 7,
135.9904 +         7,
135.9905 +};
135.9906 +
135.9907 +static const static_codebook _44c9_s_p1_0 = {
135.9908 +        4, 81,
135.9909 +        (long *)_vq_lengthlist__44c9_s_p1_0,
135.9910 +        1, -535822336, 1611661312, 2, 0,
135.9911 +        (long *)_vq_quantlist__44c9_s_p1_0,
135.9912 +        0
135.9913 +};
135.9914 +
135.9915 +static const long _vq_quantlist__44c9_s_p2_0[] = {
135.9916 +        2,
135.9917 +        1,
135.9918 +        3,
135.9919 +        0,
135.9920 +        4,
135.9921 +};
135.9922 +
135.9923 +static const long _vq_lengthlist__44c9_s_p2_0[] = {
135.9924 +         3, 5, 5, 8, 8, 0, 5, 5, 8, 8, 0, 5, 5, 8, 8, 0,
135.9925 +         7, 7, 9, 9, 0, 0, 0, 9, 9, 6, 7, 7, 9, 8, 0, 8,
135.9926 +         8, 9, 9, 0, 8, 7, 9, 9, 0, 9,10,10,10, 0, 0, 0,
135.9927 +        11,10, 6, 7, 7, 8, 9, 0, 8, 8, 9, 9, 0, 7, 8, 9,
135.9928 +         9, 0,10, 9,11,10, 0, 0, 0,10,10, 8, 9, 8,10,10,
135.9929 +         0,10,10,12,11, 0,10,10,11,11, 0,12,13,13,13, 0,
135.9930 +         0, 0,13,12, 8, 8, 9,10,10, 0,10,10,11,12, 0,10,
135.9931 +        10,11,11, 0,13,12,13,13, 0, 0, 0,13,13, 0, 0, 0,
135.9932 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.9933 +         0, 0, 0, 0, 0, 0, 6, 8, 7,10,10, 0, 7, 7,10, 9,
135.9934 +         0, 7, 7,10,10, 0, 9, 9,10,10, 0, 0, 0,10,10, 6,
135.9935 +         7, 8,10,10, 0, 7, 7, 9,10, 0, 7, 7,10,10, 0, 9,
135.9936 +         9,10,10, 0, 0, 0,10,10, 8, 9, 9,11,11, 0,10,10,
135.9937 +        11,11, 0,10,10,11,11, 0,12,12,12,12, 0, 0, 0,12,
135.9938 +        12, 8, 9,10,11,11, 0, 9,10,11,11, 0,10,10,11,11,
135.9939 +         0,12,12,12,12, 0, 0, 0,12,12, 0, 0, 0, 0, 0, 0,
135.9940 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.9941 +         0, 0, 0, 5, 8, 7,10,10, 0, 7, 7,10,10, 0, 7, 7,
135.9942 +        10, 9, 0, 9, 9,10,10, 0, 0, 0,10,10, 6, 7, 8,10,
135.9943 +        10, 0, 7, 7,10,10, 0, 7, 7, 9,10, 0, 9, 9,10,10,
135.9944 +         0, 0, 0,10,10, 8,10, 9,12,11, 0,10,10,12,11, 0,
135.9945 +        10, 9,11,11, 0,11,12,12,12, 0, 0, 0,12,12, 8, 9,
135.9946 +        10,11,12, 0,10,10,11,11, 0, 9,10,11,11, 0,12,11,
135.9947 +        12,12, 0, 0, 0,12,12, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.9948 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.9949 +         7,10, 9,12,12, 0, 9, 9,12,11, 0, 9, 9,11,11, 0,
135.9950 +        10,10,12,11, 0, 0, 0,11,12, 7, 9,10,12,12, 0, 9,
135.9951 +         9,11,12, 0, 9, 9,11,11, 0,10,10,11,12, 0, 0, 0,
135.9952 +        11,11, 9,11,10,13,12, 0,10,10,12,12, 0,10,10,12,
135.9953 +        12, 0,11,11,12,12, 0, 0, 0,13,12, 9,10,11,12,13,
135.9954 +         0,10,10,12,12, 0,10,10,12,12, 0,11,12,12,12, 0,
135.9955 +         0, 0,12,13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.9956 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.9957 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.9958 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.9959 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9,
135.9960 +        11,10,13,13, 0,10,10,12,12, 0,10,10,12,12, 0,11,
135.9961 +        12,12,12, 0, 0, 0,12,12, 9,10,11,13,13, 0,10,10,
135.9962 +        12,12, 0,10,10,12,12, 0,12,11,13,12, 0, 0, 0,12,
135.9963 +        12,
135.9964 +};
135.9965 +
135.9966 +static const static_codebook _44c9_s_p2_0 = {
135.9967 +        4, 625,
135.9968 +        (long *)_vq_lengthlist__44c9_s_p2_0,
135.9969 +        1, -533725184, 1611661312, 3, 0,
135.9970 +        (long *)_vq_quantlist__44c9_s_p2_0,
135.9971 +        0
135.9972 +};
135.9973 +
135.9974 +static const long _vq_quantlist__44c9_s_p3_0[] = {
135.9975 +        4,
135.9976 +        3,
135.9977 +        5,
135.9978 +        2,
135.9979 +        6,
135.9980 +        1,
135.9981 +        7,
135.9982 +        0,
135.9983 +        8,
135.9984 +};
135.9985 +
135.9986 +static const long _vq_lengthlist__44c9_s_p3_0[] = {
135.9987 +         3, 4, 4, 5, 5, 6, 6, 8, 8, 0, 4, 4, 5, 5, 6, 7,
135.9988 +         8, 8, 0, 4, 4, 5, 5, 7, 7, 8, 8, 0, 5, 5, 6, 6,
135.9989 +         7, 7, 9, 9, 0, 0, 0, 6, 6, 7, 7, 9, 9, 0, 0, 0,
135.9990 +         7, 7, 8, 8, 9, 9, 0, 0, 0, 7, 7, 8, 8, 9, 9, 0,
135.9991 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.9992 +         0,
135.9993 +};
135.9994 +
135.9995 +static const static_codebook _44c9_s_p3_0 = {
135.9996 +        2, 81,
135.9997 +        (long *)_vq_lengthlist__44c9_s_p3_0,
135.9998 +        1, -531628032, 1611661312, 4, 0,
135.9999 +        (long *)_vq_quantlist__44c9_s_p3_0,
135.10000 +        0
135.10001 +};
135.10002 +
135.10003 +static const long _vq_quantlist__44c9_s_p4_0[] = {
135.10004 +        8,
135.10005 +        7,
135.10006 +        9,
135.10007 +        6,
135.10008 +        10,
135.10009 +        5,
135.10010 +        11,
135.10011 +        4,
135.10012 +        12,
135.10013 +        3,
135.10014 +        13,
135.10015 +        2,
135.10016 +        14,
135.10017 +        1,
135.10018 +        15,
135.10019 +        0,
135.10020 +        16,
135.10021 +};
135.10022 +
135.10023 +static const long _vq_lengthlist__44c9_s_p4_0[] = {
135.10024 +         3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9,10,10,10,
135.10025 +        10, 0, 5, 4, 5, 5, 7, 7, 8, 8, 8, 8, 9, 9,10,10,
135.10026 +        11,11, 0, 5, 5, 6, 6, 7, 7, 8, 8, 8, 8, 9, 9,10,
135.10027 +        10,11,11, 0, 6, 5, 6, 6, 7, 7, 8, 8, 9, 9,10,10,
135.10028 +        11,11,11,12, 0, 0, 0, 6, 6, 7, 7, 8, 8, 9, 9,10,
135.10029 +        10,11,11,12,12, 0, 0, 0, 7, 7, 7, 7, 9, 9, 9, 9,
135.10030 +        10,10,11,11,12,12, 0, 0, 0, 7, 7, 7, 8, 9, 9, 9,
135.10031 +         9,10,10,11,11,12,12, 0, 0, 0, 7, 7, 8, 8, 9, 9,
135.10032 +        10,10,11,11,12,12,13,13, 0, 0, 0, 0, 0, 8, 8, 9,
135.10033 +         9,10,10,11,11,12,12,12,12, 0, 0, 0, 0, 0, 0, 0,
135.10034 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10035 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10036 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10037 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10038 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10039 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10040 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10041 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10042 +         0,
135.10043 +};
135.10044 +
135.10045 +static const static_codebook _44c9_s_p4_0 = {
135.10046 +        2, 289,
135.10047 +        (long *)_vq_lengthlist__44c9_s_p4_0,
135.10048 +        1, -529530880, 1611661312, 5, 0,
135.10049 +        (long *)_vq_quantlist__44c9_s_p4_0,
135.10050 +        0
135.10051 +};
135.10052 +
135.10053 +static const long _vq_quantlist__44c9_s_p5_0[] = {
135.10054 +        1,
135.10055 +        0,
135.10056 +        2,
135.10057 +};
135.10058 +
135.10059 +static const long _vq_lengthlist__44c9_s_p5_0[] = {
135.10060 +         1, 4, 4, 5, 7, 7, 6, 7, 7, 4, 7, 6, 9,10,10,10,
135.10061 +        10, 9, 4, 6, 7, 9,10,10,10, 9,10, 5, 9, 9, 9,11,
135.10062 +        11,10,11,11, 7,10, 9,11,12,11,12,12,12, 7, 9,10,
135.10063 +        11,11,12,12,12,12, 6,10,10,10,12,12,10,12,11, 7,
135.10064 +        10,10,11,12,12,11,12,12, 7,10,10,11,12,12,12,12,
135.10065 +        12,
135.10066 +};
135.10067 +
135.10068 +static const static_codebook _44c9_s_p5_0 = {
135.10069 +        4, 81,
135.10070 +        (long *)_vq_lengthlist__44c9_s_p5_0,
135.10071 +        1, -529137664, 1618345984, 2, 0,
135.10072 +        (long *)_vq_quantlist__44c9_s_p5_0,
135.10073 +        0
135.10074 +};
135.10075 +
135.10076 +static const long _vq_quantlist__44c9_s_p5_1[] = {
135.10077 +        5,
135.10078 +        4,
135.10079 +        6,
135.10080 +        3,
135.10081 +        7,
135.10082 +        2,
135.10083 +        8,
135.10084 +        1,
135.10085 +        9,
135.10086 +        0,
135.10087 +        10,
135.10088 +};
135.10089 +
135.10090 +static const long _vq_lengthlist__44c9_s_p5_1[] = {
135.10091 +         4, 5, 5, 6, 6, 7, 7, 7, 7, 7, 7,11, 5, 5, 6, 6,
135.10092 +         7, 7, 7, 7, 8, 8,11, 5, 5, 6, 6, 7, 7, 7, 7, 8,
135.10093 +         8,11, 5, 5, 6, 6, 7, 7, 8, 8, 8, 8,11,11,11, 6,
135.10094 +         6, 7, 7, 7, 8, 8, 8,11,11,11, 6, 6, 7, 7, 7, 8,
135.10095 +         8, 8,11,11,11, 6, 6, 7, 7, 7, 7, 8, 8,11,11,11,
135.10096 +         7, 7, 7, 7, 7, 7, 8, 8,11,11,11,10,10, 7, 7, 7,
135.10097 +         7, 8, 8,11,11,11,11,11, 7, 7, 7, 7, 7, 7,11,11,
135.10098 +        11,11,11, 7, 7, 7, 7, 7, 7,
135.10099 +};
135.10100 +
135.10101 +static const static_codebook _44c9_s_p5_1 = {
135.10102 +        2, 121,
135.10103 +        (long *)_vq_lengthlist__44c9_s_p5_1,
135.10104 +        1, -531365888, 1611661312, 4, 0,
135.10105 +        (long *)_vq_quantlist__44c9_s_p5_1,
135.10106 +        0
135.10107 +};
135.10108 +
135.10109 +static const long _vq_quantlist__44c9_s_p6_0[] = {
135.10110 +        6,
135.10111 +        5,
135.10112 +        7,
135.10113 +        4,
135.10114 +        8,
135.10115 +        3,
135.10116 +        9,
135.10117 +        2,
135.10118 +        10,
135.10119 +        1,
135.10120 +        11,
135.10121 +        0,
135.10122 +        12,
135.10123 +};
135.10124 +
135.10125 +static const long _vq_lengthlist__44c9_s_p6_0[] = {
135.10126 +         2, 4, 4, 6, 6, 7, 7, 7, 7, 8, 8, 9, 9, 5, 4, 4,
135.10127 +         6, 6, 8, 8, 9, 9, 9, 9,10,10, 6, 4, 4, 6, 6, 8,
135.10128 +         8, 9, 9, 9, 9,10,10, 0, 6, 6, 7, 7, 8, 8, 9, 9,
135.10129 +        10,10,11,11, 0, 6, 6, 7, 7, 8, 8, 9, 9,10,10,11,
135.10130 +        11, 0,10,10, 8, 8, 9, 9,10,10,11,11,12,12, 0,11,
135.10131 +        11, 8, 8, 9, 9,10,10,11,11,12,12, 0, 0, 0, 0, 0,
135.10132 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10133 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10134 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10135 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10136 +         0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10137 +};
135.10138 +
135.10139 +static const static_codebook _44c9_s_p6_0 = {
135.10140 +        2, 169,
135.10141 +        (long *)_vq_lengthlist__44c9_s_p6_0,
135.10142 +        1, -526516224, 1616117760, 4, 0,
135.10143 +        (long *)_vq_quantlist__44c9_s_p6_0,
135.10144 +        0
135.10145 +};
135.10146 +
135.10147 +static const long _vq_quantlist__44c9_s_p6_1[] = {
135.10148 +        2,
135.10149 +        1,
135.10150 +        3,
135.10151 +        0,
135.10152 +        4,
135.10153 +};
135.10154 +
135.10155 +static const long _vq_lengthlist__44c9_s_p6_1[] = {
135.10156 +         4, 4, 4, 5, 5, 5, 4, 4, 5, 5, 5, 4, 4, 5, 5, 5,
135.10157 +         5, 5, 5, 5, 5, 5, 5, 5, 5,
135.10158 +};
135.10159 +
135.10160 +static const static_codebook _44c9_s_p6_1 = {
135.10161 +        2, 25,
135.10162 +        (long *)_vq_lengthlist__44c9_s_p6_1,
135.10163 +        1, -533725184, 1611661312, 3, 0,
135.10164 +        (long *)_vq_quantlist__44c9_s_p6_1,
135.10165 +        0
135.10166 +};
135.10167 +
135.10168 +static const long _vq_quantlist__44c9_s_p7_0[] = {
135.10169 +        6,
135.10170 +        5,
135.10171 +        7,
135.10172 +        4,
135.10173 +        8,
135.10174 +        3,
135.10175 +        9,
135.10176 +        2,
135.10177 +        10,
135.10178 +        1,
135.10179 +        11,
135.10180 +        0,
135.10181 +        12,
135.10182 +};
135.10183 +
135.10184 +static const long _vq_lengthlist__44c9_s_p7_0[] = {
135.10185 +         2, 4, 4, 6, 6, 7, 7, 8, 8,10,10,11,11, 6, 4, 4,
135.10186 +         6, 6, 8, 8, 9, 9,10,10,12,12, 6, 4, 5, 6, 6, 8,
135.10187 +         8, 9, 9,10,10,12,12,20, 6, 6, 6, 6, 8, 8, 9,10,
135.10188 +        11,11,12,12,20, 6, 6, 6, 6, 8, 8,10,10,11,11,12,
135.10189 +        12,20,10,10, 7, 7, 9, 9,10,10,11,11,12,12,20,11,
135.10190 +        11, 7, 7, 9, 9,10,10,11,11,12,12,20,20,20, 9, 9,
135.10191 +         9, 9,11,11,12,12,13,13,20,20,20, 9, 9, 9, 9,11,
135.10192 +        11,12,12,13,13,20,20,20,13,13,10,10,11,11,12,13,
135.10193 +        13,13,20,20,20,13,13,10,10,11,11,12,13,13,13,20,
135.10194 +        20,20,20,19,12,12,12,12,13,13,14,15,19,19,19,19,
135.10195 +        19,12,12,12,12,13,13,14,14,
135.10196 +};
135.10197 +
135.10198 +static const static_codebook _44c9_s_p7_0 = {
135.10199 +        2, 169,
135.10200 +        (long *)_vq_lengthlist__44c9_s_p7_0,
135.10201 +        1, -523206656, 1618345984, 4, 0,
135.10202 +        (long *)_vq_quantlist__44c9_s_p7_0,
135.10203 +        0
135.10204 +};
135.10205 +
135.10206 +static const long _vq_quantlist__44c9_s_p7_1[] = {
135.10207 +        5,
135.10208 +        4,
135.10209 +        6,
135.10210 +        3,
135.10211 +        7,
135.10212 +        2,
135.10213 +        8,
135.10214 +        1,
135.10215 +        9,
135.10216 +        0,
135.10217 +        10,
135.10218 +};
135.10219 +
135.10220 +static const long _vq_lengthlist__44c9_s_p7_1[] = {
135.10221 +         5, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6,
135.10222 +         7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 7, 7, 7, 7, 7,
135.10223 +         7, 8, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 6,
135.10224 +         6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 7, 7, 7, 7, 7, 7,
135.10225 +         7, 7, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8,
135.10226 +         7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 7, 7, 7,
135.10227 +         7, 7, 7, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 8, 8,
135.10228 +         8, 8, 8, 7, 7, 7, 7, 7, 7,
135.10229 +};
135.10230 +
135.10231 +static const static_codebook _44c9_s_p7_1 = {
135.10232 +        2, 121,
135.10233 +        (long *)_vq_lengthlist__44c9_s_p7_1,
135.10234 +        1, -531365888, 1611661312, 4, 0,
135.10235 +        (long *)_vq_quantlist__44c9_s_p7_1,
135.10236 +        0
135.10237 +};
135.10238 +
135.10239 +static const long _vq_quantlist__44c9_s_p8_0[] = {
135.10240 +        7,
135.10241 +        6,
135.10242 +        8,
135.10243 +        5,
135.10244 +        9,
135.10245 +        4,
135.10246 +        10,
135.10247 +        3,
135.10248 +        11,
135.10249 +        2,
135.10250 +        12,
135.10251 +        1,
135.10252 +        13,
135.10253 +        0,
135.10254 +        14,
135.10255 +};
135.10256 +
135.10257 +static const long _vq_lengthlist__44c9_s_p8_0[] = {
135.10258 +         1, 4, 4, 7, 6, 8, 8, 8, 8, 9, 9,10,10,11,10, 6,
135.10259 +         5, 5, 7, 7, 9, 9, 8, 9,10,10,11,11,12,12, 6, 5,
135.10260 +         5, 7, 7, 9, 9, 9, 9,10,10,11,11,12,12,21, 7, 8,
135.10261 +         8, 8, 9, 9, 9, 9,10,10,11,11,12,12,21, 8, 8, 8,
135.10262 +         8, 9, 9, 9, 9,10,10,11,11,12,12,21,11,12, 9, 9,
135.10263 +        10,10,10,10,10,11,11,12,12,12,21,12,12, 9, 8,10,
135.10264 +        10,10,10,11,11,12,12,13,13,21,21,21, 9, 9, 9, 9,
135.10265 +        11,11,11,11,12,12,12,13,21,20,20, 9, 9, 9, 9,10,
135.10266 +        11,11,11,12,12,13,13,20,20,20,13,13,10,10,11,11,
135.10267 +        12,12,13,13,13,13,20,20,20,13,13,10,10,11,11,12,
135.10268 +        12,13,13,13,13,20,20,20,20,20,12,12,12,12,12,12,
135.10269 +        13,13,14,14,20,20,20,20,20,12,12,12,11,13,12,13,
135.10270 +        13,14,14,20,20,20,20,20,15,16,13,12,13,13,14,13,
135.10271 +        14,14,20,20,20,20,20,16,15,12,12,13,12,14,13,14,
135.10272 +        14,
135.10273 +};
135.10274 +
135.10275 +static const static_codebook _44c9_s_p8_0 = {
135.10276 +        2, 225,
135.10277 +        (long *)_vq_lengthlist__44c9_s_p8_0,
135.10278 +        1, -520986624, 1620377600, 4, 0,
135.10279 +        (long *)_vq_quantlist__44c9_s_p8_0,
135.10280 +        0
135.10281 +};
135.10282 +
135.10283 +static const long _vq_quantlist__44c9_s_p8_1[] = {
135.10284 +        10,
135.10285 +        9,
135.10286 +        11,
135.10287 +        8,
135.10288 +        12,
135.10289 +        7,
135.10290 +        13,
135.10291 +        6,
135.10292 +        14,
135.10293 +        5,
135.10294 +        15,
135.10295 +        4,
135.10296 +        16,
135.10297 +        3,
135.10298 +        17,
135.10299 +        2,
135.10300 +        18,
135.10301 +        1,
135.10302 +        19,
135.10303 +        0,
135.10304 +        20,
135.10305 +};
135.10306 +
135.10307 +static const long _vq_lengthlist__44c9_s_p8_1[] = {
135.10308 +         4, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8,
135.10309 +         8, 8, 8, 8, 8,10, 6, 6, 7, 7, 8, 8, 8, 8, 9, 9,
135.10310 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9,10, 6, 6, 7, 7, 8,
135.10311 +         8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,10,
135.10312 +         7, 7, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9,
135.10313 +         9, 9, 9, 9,10,10,10, 8, 8, 8, 8, 9, 9, 9, 9, 9,
135.10314 +         9, 9, 9, 9, 9, 9, 9, 9, 9,10,10,10, 8, 8, 8, 8,
135.10315 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,10,10,
135.10316 +        10, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
135.10317 +         9, 9, 9,10,10,10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
135.10318 +         9, 9, 9, 9, 9, 9, 9, 9,10,10,10,10,10, 9, 9, 9,
135.10319 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,10,10,10,
135.10320 +        10,10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
135.10321 +         9, 9,10,10,10,10,10, 9, 9, 9, 9, 9, 9, 9, 9, 9,
135.10322 +         9, 9, 9, 9, 9, 9, 9,10,10,10,10,10, 9, 9, 9, 9,
135.10323 +         9, 9, 9, 9, 9, 9, 9, 9,10, 9, 9, 9,10,10,10,10,
135.10324 +        10,10,10, 9, 9, 9, 9, 9, 9,10, 9, 9, 9, 9, 9, 9,
135.10325 +         9,10,10,10,10,10,10,10, 9, 9, 9,10,10,10,10,10,
135.10326 +         9, 9, 9, 9, 9, 9,10,10,10,10,10,10,10, 9, 9,10,
135.10327 +         9,10, 9, 9, 9, 9, 9, 9, 9, 9,10,10,10,10,10,10,
135.10328 +        10,10,10,10, 9, 9,10,10, 9, 9, 9, 9, 9, 9, 9, 9,
135.10329 +        10,10,10,10,10,10,10,10,10,10,10,10,10, 9, 9, 9,
135.10330 +         9, 9, 9, 9, 9,10,10,10,10,10,10,10,10,10,10,10,
135.10331 +        10,10, 9, 9,10, 9, 9, 9, 9, 9,10,10,10,10,10,10,
135.10332 +        10,10,10,10,10, 9, 9,10,10, 9, 9,10, 9, 9, 9,10,
135.10333 +        10,10,10,10,10,10,10,10,10,10, 9, 9,10, 9, 9, 9,
135.10334 +         9, 9, 9, 9,10,10,10,10,10,10,10,10,10,10,10, 9,
135.10335 +         9, 9, 9,10, 9, 9, 9, 9, 9,
135.10336 +};
135.10337 +
135.10338 +static const static_codebook _44c9_s_p8_1 = {
135.10339 +        2, 441,
135.10340 +        (long *)_vq_lengthlist__44c9_s_p8_1,
135.10341 +        1, -529268736, 1611661312, 5, 0,
135.10342 +        (long *)_vq_quantlist__44c9_s_p8_1,
135.10343 +        0
135.10344 +};
135.10345 +
135.10346 +static const long _vq_quantlist__44c9_s_p9_0[] = {
135.10347 +        9,
135.10348 +        8,
135.10349 +        10,
135.10350 +        7,
135.10351 +        11,
135.10352 +        6,
135.10353 +        12,
135.10354 +        5,
135.10355 +        13,
135.10356 +        4,
135.10357 +        14,
135.10358 +        3,
135.10359 +        15,
135.10360 +        2,
135.10361 +        16,
135.10362 +        1,
135.10363 +        17,
135.10364 +        0,
135.10365 +        18,
135.10366 +};
135.10367 +
135.10368 +static const long _vq_lengthlist__44c9_s_p9_0[] = {
135.10369 +         1, 4, 3,12,12,12,12,12,12,12,12,12,12,12,12,12,
135.10370 +        12,12,12, 4, 5, 6,12,12,12,12,12,12,12,12,12,12,
135.10371 +        12,12,12,12,12,12, 4, 6, 6,12,12,12,12,12,12,12,
135.10372 +        12,12,12,12,12,12,12,12,12,12,12,11,12,12,12,12,
135.10373 +        12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
135.10374 +        12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
135.10375 +        12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
135.10376 +        12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
135.10377 +        12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
135.10378 +        12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
135.10379 +        12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
135.10380 +        12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
135.10381 +        12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
135.10382 +        12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
135.10383 +        12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
135.10384 +        12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
135.10385 +        12,12,12,12,12,12,12,12,12,12,11,11,11,11,11,11,
135.10386 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.10387 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.10388 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.10389 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.10390 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.10391 +        11,11,11,11,11,11,11,11,11,
135.10392 +};
135.10393 +
135.10394 +static const static_codebook _44c9_s_p9_0 = {
135.10395 +        2, 361,
135.10396 +        (long *)_vq_lengthlist__44c9_s_p9_0,
135.10397 +        1, -508535424, 1631393792, 5, 0,
135.10398 +        (long *)_vq_quantlist__44c9_s_p9_0,
135.10399 +        0
135.10400 +};
135.10401 +
135.10402 +static const long _vq_quantlist__44c9_s_p9_1[] = {
135.10403 +        9,
135.10404 +        8,
135.10405 +        10,
135.10406 +        7,
135.10407 +        11,
135.10408 +        6,
135.10409 +        12,
135.10410 +        5,
135.10411 +        13,
135.10412 +        4,
135.10413 +        14,
135.10414 +        3,
135.10415 +        15,
135.10416 +        2,
135.10417 +        16,
135.10418 +        1,
135.10419 +        17,
135.10420 +        0,
135.10421 +        18,
135.10422 +};
135.10423 +
135.10424 +static const long _vq_lengthlist__44c9_s_p9_1[] = {
135.10425 +         1, 4, 4, 7, 7, 7, 7, 8, 7, 9, 8, 9, 9,10,10,11,
135.10426 +        11,11,11, 6, 5, 5, 8, 8, 9, 9, 9, 8,10, 9,11,10,
135.10427 +        12,12,13,12,13,13, 5, 5, 5, 8, 8, 9, 9, 9, 9,10,
135.10428 +        10,11,11,12,12,13,12,13,13,17, 8, 8, 9, 9, 9, 9,
135.10429 +         9, 9,10,10,12,11,13,12,13,13,13,13,18, 8, 8, 9,
135.10430 +         9, 9, 9, 9, 9,11,11,12,12,13,13,13,13,13,13,17,
135.10431 +        13,12, 9, 9,10,10,10,10,11,11,12,12,12,13,13,13,
135.10432 +        14,14,18,13,12, 9, 9,10,10,10,10,11,11,12,12,13,
135.10433 +        13,13,14,14,14,17,18,18,10,10,10,10,11,11,11,12,
135.10434 +        12,12,14,13,14,13,13,14,18,18,18,10, 9,10, 9,11,
135.10435 +        11,12,12,12,12,13,13,15,14,14,14,18,18,16,13,14,
135.10436 +        10,11,11,11,12,13,13,13,13,14,13,13,14,14,18,18,
135.10437 +        18,14,12,11, 9,11,10,13,12,13,13,13,14,14,14,13,
135.10438 +        14,18,18,17,18,18,11,12,12,12,13,13,14,13,14,14,
135.10439 +        13,14,14,14,18,18,18,18,17,12,10,12, 9,13,11,13,
135.10440 +        14,14,14,14,14,15,14,18,18,17,17,18,14,15,12,13,
135.10441 +        13,13,14,13,14,14,15,14,15,14,18,17,18,18,18,15,
135.10442 +        15,12,10,14,10,14,14,13,13,14,14,14,14,18,16,18,
135.10443 +        18,18,18,17,14,14,13,14,14,13,13,14,14,14,15,15,
135.10444 +        18,18,18,18,17,17,17,14,14,14,12,14,13,14,14,15,
135.10445 +        14,15,14,18,18,18,18,18,18,18,17,16,13,13,13,14,
135.10446 +        14,14,14,15,16,15,18,18,18,18,18,18,18,17,17,13,
135.10447 +        13,13,13,14,13,14,15,15,15,
135.10448 +};
135.10449 +
135.10450 +static const static_codebook _44c9_s_p9_1 = {
135.10451 +        2, 361,
135.10452 +        (long *)_vq_lengthlist__44c9_s_p9_1,
135.10453 +        1, -518287360, 1622704128, 5, 0,
135.10454 +        (long *)_vq_quantlist__44c9_s_p9_1,
135.10455 +        0
135.10456 +};
135.10457 +
135.10458 +static const long _vq_quantlist__44c9_s_p9_2[] = {
135.10459 +        24,
135.10460 +        23,
135.10461 +        25,
135.10462 +        22,
135.10463 +        26,
135.10464 +        21,
135.10465 +        27,
135.10466 +        20,
135.10467 +        28,
135.10468 +        19,
135.10469 +        29,
135.10470 +        18,
135.10471 +        30,
135.10472 +        17,
135.10473 +        31,
135.10474 +        16,
135.10475 +        32,
135.10476 +        15,
135.10477 +        33,
135.10478 +        14,
135.10479 +        34,
135.10480 +        13,
135.10481 +        35,
135.10482 +        12,
135.10483 +        36,
135.10484 +        11,
135.10485 +        37,
135.10486 +        10,
135.10487 +        38,
135.10488 +        9,
135.10489 +        39,
135.10490 +        8,
135.10491 +        40,
135.10492 +        7,
135.10493 +        41,
135.10494 +        6,
135.10495 +        42,
135.10496 +        5,
135.10497 +        43,
135.10498 +        4,
135.10499 +        44,
135.10500 +        3,
135.10501 +        45,
135.10502 +        2,
135.10503 +        46,
135.10504 +        1,
135.10505 +        47,
135.10506 +        0,
135.10507 +        48,
135.10508 +};
135.10509 +
135.10510 +static const long _vq_lengthlist__44c9_s_p9_2[] = {
135.10511 +         2, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6,
135.10512 +         6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7,
135.10513 +         7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
135.10514 +         7,
135.10515 +};
135.10516 +
135.10517 +static const static_codebook _44c9_s_p9_2 = {
135.10518 +        1, 49,
135.10519 +        (long *)_vq_lengthlist__44c9_s_p9_2,
135.10520 +        1, -526909440, 1611661312, 6, 0,
135.10521 +        (long *)_vq_quantlist__44c9_s_p9_2,
135.10522 +        0
135.10523 +};
135.10524 +
135.10525 +static const long _huff_lengthlist__44c9_s_short[] = {
135.10526 +         5,13,18,16,17,17,19,18,19,19, 5, 7,10,11,12,12,
135.10527 +        13,16,17,18, 6, 6, 7, 7, 9, 9,10,14,17,19, 8, 7,
135.10528 +         6, 5, 6, 7, 9,12,19,17, 8, 7, 7, 6, 5, 6, 8,11,
135.10529 +        15,19, 9, 8, 7, 6, 5, 5, 6, 8,13,15,11,10, 8, 8,
135.10530 +         7, 5, 4, 4,10,14,12,13,11, 9, 7, 6, 4, 2, 6,12,
135.10531 +        18,16,16,13, 8, 7, 7, 5, 8,13,16,17,18,15,11, 9,
135.10532 +         9, 8,10,13,
135.10533 +};
135.10534 +
135.10535 +static const static_codebook _huff_book__44c9_s_short = {
135.10536 +        2, 100,
135.10537 +        (long *)_huff_lengthlist__44c9_s_short,
135.10538 +        0, 0, 0, 0, 0,
135.10539 +        NULL,
135.10540 +        0
135.10541 +};
135.10542 +
135.10543 +static const long _huff_lengthlist__44c0_s_long[] = {
135.10544 +         5, 4, 8, 9, 8, 9,10,12,15, 4, 1, 5, 5, 6, 8,11,
135.10545 +        12,12, 8, 5, 8, 9, 9,11,13,12,12, 9, 5, 8, 5, 7,
135.10546 +         9,12,13,13, 8, 6, 8, 7, 7, 9,11,11,11, 9, 7, 9,
135.10547 +         7, 7, 7, 7,10,12,10,10,11, 9, 8, 7, 7, 9,11,11,
135.10548 +        12,13,12,11, 9, 8, 9,11,13,16,16,15,15,12,10,11,
135.10549 +        12,
135.10550 +};
135.10551 +
135.10552 +static const static_codebook _huff_book__44c0_s_long = {
135.10553 +        2, 81,
135.10554 +        (long *)_huff_lengthlist__44c0_s_long,
135.10555 +        0, 0, 0, 0, 0,
135.10556 +        NULL,
135.10557 +        0
135.10558 +};
135.10559 +
135.10560 +static const long _vq_quantlist__44c0_s_p1_0[] = {
135.10561 +        1,
135.10562 +        0,
135.10563 +        2,
135.10564 +};
135.10565 +
135.10566 +static const long _vq_lengthlist__44c0_s_p1_0[] = {
135.10567 +         1, 5, 5, 0, 0, 0, 0, 0, 0, 5, 7, 7, 0, 0, 0, 0,
135.10568 +         0, 0, 5, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10569 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10570 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10571 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10572 +         0, 5, 8, 7, 0, 0, 0, 0, 0, 0, 7, 9, 9, 0, 0, 0,
135.10573 +         0, 0, 0, 7, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10574 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10575 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10576 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10577 +         0, 0, 5, 7, 7, 0, 0, 0, 0, 0, 0, 7, 9, 9, 0, 0,
135.10578 +         0, 0, 0, 0, 7, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10579 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10580 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10581 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10582 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10583 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10584 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10585 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10586 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10587 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10588 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10589 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10590 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10591 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10592 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10593 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10594 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10595 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10596 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10597 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10598 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10599 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10600 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10601 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10602 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10603 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10604 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10605 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10606 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10607 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10608 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10609 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10610 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10611 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10612 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 7, 7, 0, 0, 0, 0,
135.10613 +         0, 0, 8,10, 9, 0, 0, 0, 0, 0, 0, 7, 9, 9, 0, 0,
135.10614 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10615 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10616 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10617 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 9, 9, 0, 0, 0,
135.10618 +         0, 0, 0, 9,10,11, 0, 0, 0, 0, 0, 0, 9,11,10, 0,
135.10619 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10620 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10621 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10622 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 9, 9, 0, 0,
135.10623 +         0, 0, 0, 0, 9,11, 9, 0, 0, 0, 0, 0, 0, 9,10,11,
135.10624 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10625 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10626 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10627 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10628 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10629 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10630 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10631 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10632 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10633 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10634 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10635 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10636 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10637 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10638 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10639 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10640 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10641 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10642 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10643 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10644 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10645 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10646 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10647 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10648 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10649 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10650 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10651 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10652 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10653 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10654 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10655 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10656 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10657 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10658 +         0, 0, 5, 7, 7, 0, 0, 0, 0, 0, 0, 7, 9, 9, 0, 0,
135.10659 +         0, 0, 0, 0, 8, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10660 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10661 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10662 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10663 +         0, 0, 0, 7, 9, 9, 0, 0, 0, 0, 0, 0, 9,11,10, 0,
135.10664 +         0, 0, 0, 0, 0, 9, 9,11, 0, 0, 0, 0, 0, 0, 0, 0,
135.10665 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10666 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10667 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10668 +         0, 0, 0, 0, 7, 9,10, 0, 0, 0, 0, 0, 0, 9,10,11,
135.10669 +         0, 0, 0, 0, 0, 0, 9,11,10, 0, 0, 0, 0, 0, 0, 0,
135.10670 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10671 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10672 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10673 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10674 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10675 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10676 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10677 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10678 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10679 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10680 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10681 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10682 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10683 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10684 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10685 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10686 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10687 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10688 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10689 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10690 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10691 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10692 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10693 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10694 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10695 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10696 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10697 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10698 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10699 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10700 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10701 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10702 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10703 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10704 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10705 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10706 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10707 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10708 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10709 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10710 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10711 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10712 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10713 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10714 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10715 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10716 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10717 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10718 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10719 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10720 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10721 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10722 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10723 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10724 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10725 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10726 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10727 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10728 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10729 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10730 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10731 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10732 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10733 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10734 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10735 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10736 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10737 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10738 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10739 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10740 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10741 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10742 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10743 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10744 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10745 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10746 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10747 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10748 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10749 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10750 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10751 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10752 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10753 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10754 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10755 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10756 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10757 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10758 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10759 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10760 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10761 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10762 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10763 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10764 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10765 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10766 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10767 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10768 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10769 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10770 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10771 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10772 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10773 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10774 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10775 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10776 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10777 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10778 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10779 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10780 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10781 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10782 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10783 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10784 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10785 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10786 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10787 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10788 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10789 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10790 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10791 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10792 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10793 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10794 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10795 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10796 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10797 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10798 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10799 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10800 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10801 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10802 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10803 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10804 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10805 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10806 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10807 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10808 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10809 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10810 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10811 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10812 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10813 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10814 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10815 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10816 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10817 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10818 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10819 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10820 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10821 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10822 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10823 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10824 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10825 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10826 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10827 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10828 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10829 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10830 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10831 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10832 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10833 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10834 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10835 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10836 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10837 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10838 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10839 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10840 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10841 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10842 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10843 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10844 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10845 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10846 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10847 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10848 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10849 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10850 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10851 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10852 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10853 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10854 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10855 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10856 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10857 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10858 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10859 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10860 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10861 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10862 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10863 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10864 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10865 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10866 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10867 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10868 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10869 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10870 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10871 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10872 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10873 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10874 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10875 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10876 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10877 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10878 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10879 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10880 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10881 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10882 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10883 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10884 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10885 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10886 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10887 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10888 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10889 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10890 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10891 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10892 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10893 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10894 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10895 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10896 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10897 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10898 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10899 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10900 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10901 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10902 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10903 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10904 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10905 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10906 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10907 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10908 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10909 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10910 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10911 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10912 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10913 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10914 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10915 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10916 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10917 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10918 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10919 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10920 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10921 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10922 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10923 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10924 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10925 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10926 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10927 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10928 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10929 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10930 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10931 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10932 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10933 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10934 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10935 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10936 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10937 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10938 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10939 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10940 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10941 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10942 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10943 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10944 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10945 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10946 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10947 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10948 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10949 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10950 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10951 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10952 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10953 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10954 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10955 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10956 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10957 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10958 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10959 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10960 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10961 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10962 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10963 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10964 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10965 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10966 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10967 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10968 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10969 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10970 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10971 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10972 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10973 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10974 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10975 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10976 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10977 +         0,
135.10978 +};
135.10979 +
135.10980 +static const static_codebook _44c0_s_p1_0 = {
135.10981 +        8, 6561,
135.10982 +        (long *)_vq_lengthlist__44c0_s_p1_0,
135.10983 +        1, -535822336, 1611661312, 2, 0,
135.10984 +        (long *)_vq_quantlist__44c0_s_p1_0,
135.10985 +        0
135.10986 +};
135.10987 +
135.10988 +static const long _vq_quantlist__44c0_s_p2_0[] = {
135.10989 +        2,
135.10990 +        1,
135.10991 +        3,
135.10992 +        0,
135.10993 +        4,
135.10994 +};
135.10995 +
135.10996 +static const long _vq_lengthlist__44c0_s_p2_0[] = {
135.10997 +         1, 4, 4, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.10998 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, 5, 7, 6, 0, 0,
135.10999 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11000 +         0, 0, 4, 5, 6, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11001 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7, 7, 9, 9,
135.11002 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11003 +         0, 0, 0, 0, 6, 7, 7, 9, 9, 0, 0, 0, 0, 0, 0, 0,
135.11004 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11005 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11006 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11007 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11008 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11009 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11010 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11011 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11012 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11013 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11014 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11015 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11016 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11017 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11018 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11019 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11020 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11021 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11022 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11023 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11024 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11025 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11026 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11027 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11028 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11029 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11030 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11031 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11032 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11033 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11034 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11035 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11036 +         0,
135.11037 +};
135.11038 +
135.11039 +static const static_codebook _44c0_s_p2_0 = {
135.11040 +        4, 625,
135.11041 +        (long *)_vq_lengthlist__44c0_s_p2_0,
135.11042 +        1, -533725184, 1611661312, 3, 0,
135.11043 +        (long *)_vq_quantlist__44c0_s_p2_0,
135.11044 +        0
135.11045 +};
135.11046 +
135.11047 +static const long _vq_quantlist__44c0_s_p3_0[] = {
135.11048 +        4,
135.11049 +        3,
135.11050 +        5,
135.11051 +        2,
135.11052 +        6,
135.11053 +        1,
135.11054 +        7,
135.11055 +        0,
135.11056 +        8,
135.11057 +};
135.11058 +
135.11059 +static const long _vq_lengthlist__44c0_s_p3_0[] = {
135.11060 +         1, 3, 2, 8, 7, 0, 0, 0, 0, 0, 0, 0, 6, 6, 0, 0,
135.11061 +         0, 0, 0, 0, 0, 6, 6, 0, 0, 0, 0, 0, 0, 0, 7, 7,
135.11062 +         0, 0, 0, 0, 0, 0, 0, 7, 7, 0, 0, 0, 0, 0, 0, 0,
135.11063 +         8, 8, 0, 0, 0, 0, 0, 0, 0, 8, 8, 0, 0, 0, 0, 0,
135.11064 +         0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11065 +         0,
135.11066 +};
135.11067 +
135.11068 +static const static_codebook _44c0_s_p3_0 = {
135.11069 +        2, 81,
135.11070 +        (long *)_vq_lengthlist__44c0_s_p3_0,
135.11071 +        1, -531628032, 1611661312, 4, 0,
135.11072 +        (long *)_vq_quantlist__44c0_s_p3_0,
135.11073 +        0
135.11074 +};
135.11075 +
135.11076 +static const long _vq_quantlist__44c0_s_p4_0[] = {
135.11077 +        4,
135.11078 +        3,
135.11079 +        5,
135.11080 +        2,
135.11081 +        6,
135.11082 +        1,
135.11083 +        7,
135.11084 +        0,
135.11085 +        8,
135.11086 +};
135.11087 +
135.11088 +static const long _vq_lengthlist__44c0_s_p4_0[] = {
135.11089 +         1, 3, 3, 6, 6, 6, 6, 8, 8, 0, 0, 0, 7, 7, 7, 7,
135.11090 +         9, 9, 0, 0, 0, 7, 7, 7, 7, 9, 9, 0, 0, 0, 7, 7,
135.11091 +         7, 8, 9, 9, 0, 0, 0, 7, 7, 7, 7, 9, 9, 0, 0, 0,
135.11092 +         9, 9, 8, 8,10,10, 0, 0, 0, 8, 9, 8, 8,10,10, 0,
135.11093 +         0, 0,10,10, 9, 9,10,10, 0, 0, 0, 0, 0, 9, 9,10,
135.11094 +        10,
135.11095 +};
135.11096 +
135.11097 +static const static_codebook _44c0_s_p4_0 = {
135.11098 +        2, 81,
135.11099 +        (long *)_vq_lengthlist__44c0_s_p4_0,
135.11100 +        1, -531628032, 1611661312, 4, 0,
135.11101 +        (long *)_vq_quantlist__44c0_s_p4_0,
135.11102 +        0
135.11103 +};
135.11104 +
135.11105 +static const long _vq_quantlist__44c0_s_p5_0[] = {
135.11106 +        8,
135.11107 +        7,
135.11108 +        9,
135.11109 +        6,
135.11110 +        10,
135.11111 +        5,
135.11112 +        11,
135.11113 +        4,
135.11114 +        12,
135.11115 +        3,
135.11116 +        13,
135.11117 +        2,
135.11118 +        14,
135.11119 +        1,
135.11120 +        15,
135.11121 +        0,
135.11122 +        16,
135.11123 +};
135.11124 +
135.11125 +static const long _vq_lengthlist__44c0_s_p5_0[] = {
135.11126 +         1, 4, 3, 6, 6, 8, 7, 8, 8, 8, 8, 9, 9,10,10,11,
135.11127 +        11, 0, 0, 0, 7, 7, 8, 8, 9, 9, 9, 9, 9,10,10,10,
135.11128 +        11,11, 0, 0, 0, 7, 7, 8, 8, 9, 9, 9, 9,10,10,10,
135.11129 +        10,11,11, 0, 0, 0, 7, 7, 8, 8, 9, 9, 9, 9,10,10,
135.11130 +        11,11,11,11, 0, 0, 0, 7, 7, 8, 8, 9, 9, 9, 9,10,
135.11131 +        10,11,11,11,11, 0, 0, 0, 8, 8, 9, 9, 9, 9,10,10,
135.11132 +        10,10,11,11,12,12, 0, 0, 0, 8, 8, 9, 9, 9, 9,10,
135.11133 +        10,10,10,11,11,12,12, 0, 0, 0, 9, 9, 9, 9,10,10,
135.11134 +        10,10,11,11,11,12,12,12, 0, 0, 0, 0, 0, 9, 9,10,
135.11135 +        10,10,10,11,11,11,11,12,12, 0, 0, 0, 0, 0, 9, 9,
135.11136 +        10,10,10,10,11,11,12,12,13,13, 0, 0, 0, 0, 0, 9,
135.11137 +         9,10,10,10,10,11,11,12,12,13,13, 0, 0, 0, 0, 0,
135.11138 +        10,10,11,11,11,11,11,12,12,12,13,13, 0, 0, 0, 0,
135.11139 +         0, 0, 0,11,10,11,11,11,11,12,12,13,13, 0, 0, 0,
135.11140 +         0, 0, 0, 0,11,11,12,11,12,12,12,12,13,13, 0, 0,
135.11141 +         0, 0, 0, 0, 0,11,11,11,12,12,12,12,13,13,13, 0,
135.11142 +         0, 0, 0, 0, 0, 0,12,12,12,12,12,13,13,13,14,14,
135.11143 +         0, 0, 0, 0, 0, 0, 0, 0, 0,12,12,12,12,13,13,14,
135.11144 +        14,
135.11145 +};
135.11146 +
135.11147 +static const static_codebook _44c0_s_p5_0 = {
135.11148 +        2, 289,
135.11149 +        (long *)_vq_lengthlist__44c0_s_p5_0,
135.11150 +        1, -529530880, 1611661312, 5, 0,
135.11151 +        (long *)_vq_quantlist__44c0_s_p5_0,
135.11152 +        0
135.11153 +};
135.11154 +
135.11155 +static const long _vq_quantlist__44c0_s_p6_0[] = {
135.11156 +        1,
135.11157 +        0,
135.11158 +        2,
135.11159 +};
135.11160 +
135.11161 +static const long _vq_lengthlist__44c0_s_p6_0[] = {
135.11162 +         1, 4, 4, 7, 6, 6, 7, 6, 6, 4, 7, 7,10, 9, 9,10,
135.11163 +         9, 9, 4, 6, 7,10, 9, 9,11, 9, 9, 7,10,10,11,11,
135.11164 +        11,12,10,11, 6, 9, 9,11,10,11,11,10,10, 6, 9, 9,
135.11165 +        11,10,11,11,10,10, 7,11,10,12,11,11,11,11,11, 7,
135.11166 +         9, 9,10,10,10,11,11,10, 6, 9, 9,11,10,10,11,10,
135.11167 +        10,
135.11168 +};
135.11169 +
135.11170 +static const static_codebook _44c0_s_p6_0 = {
135.11171 +        4, 81,
135.11172 +        (long *)_vq_lengthlist__44c0_s_p6_0,
135.11173 +        1, -529137664, 1618345984, 2, 0,
135.11174 +        (long *)_vq_quantlist__44c0_s_p6_0,
135.11175 +        0
135.11176 +};
135.11177 +
135.11178 +static const long _vq_quantlist__44c0_s_p6_1[] = {
135.11179 +        5,
135.11180 +        4,
135.11181 +        6,
135.11182 +        3,
135.11183 +        7,
135.11184 +        2,
135.11185 +        8,
135.11186 +        1,
135.11187 +        9,
135.11188 +        0,
135.11189 +        10,
135.11190 +};
135.11191 +
135.11192 +static const long _vq_lengthlist__44c0_s_p6_1[] = {
135.11193 +         2, 3, 3, 6, 6, 7, 7, 7, 7, 7, 8,10,10,10, 6, 6,
135.11194 +         7, 7, 8, 8, 8, 8,10,10,10, 6, 6, 7, 7, 8, 8, 8,
135.11195 +         8,10,10,10, 7, 7, 7, 7, 8, 8, 8, 8,10,10,10, 7,
135.11196 +         7, 7, 7, 8, 8, 8, 8,10,10,10, 8, 7, 8, 8, 8, 8,
135.11197 +         8, 8,10,10,10, 7, 7, 8, 8, 8, 8, 8, 8,10,10,10,
135.11198 +         8, 8, 8, 8, 8, 8, 8, 8,10,10,10,10,10, 8, 8, 8,
135.11199 +         8, 8, 8,10,10,10,10,10, 9, 9, 8, 8, 8, 8,10,10,
135.11200 +        10,10,10, 8, 8, 8, 8, 8, 8,
135.11201 +};
135.11202 +
135.11203 +static const static_codebook _44c0_s_p6_1 = {
135.11204 +        2, 121,
135.11205 +        (long *)_vq_lengthlist__44c0_s_p6_1,
135.11206 +        1, -531365888, 1611661312, 4, 0,
135.11207 +        (long *)_vq_quantlist__44c0_s_p6_1,
135.11208 +        0
135.11209 +};
135.11210 +
135.11211 +static const long _vq_quantlist__44c0_s_p7_0[] = {
135.11212 +        6,
135.11213 +        5,
135.11214 +        7,
135.11215 +        4,
135.11216 +        8,
135.11217 +        3,
135.11218 +        9,
135.11219 +        2,
135.11220 +        10,
135.11221 +        1,
135.11222 +        11,
135.11223 +        0,
135.11224 +        12,
135.11225 +};
135.11226 +
135.11227 +static const long _vq_lengthlist__44c0_s_p7_0[] = {
135.11228 +         1, 4, 4, 6, 6, 7, 7, 7, 7, 8, 8, 9, 9, 7, 5, 5,
135.11229 +         7, 7, 8, 8, 8, 8, 9, 9,10,10, 7, 5, 6, 7, 7, 8,
135.11230 +         8, 8, 8, 9, 9,10,10, 0, 8, 8, 8, 8, 9, 9, 9, 9,
135.11231 +        10,10,11,11, 0, 8, 8, 8, 8, 9, 9, 9, 9,10,10,11,
135.11232 +        11, 0,12,12, 9, 9,10,10,10,10,11,11,11,11, 0,13,
135.11233 +        13, 9, 9, 9, 9,10,10,11,11,11,12, 0, 0, 0,10,10,
135.11234 +        10,10,11,11,11,11,12,12, 0, 0, 0,10,10, 9, 9,11,
135.11235 +        11,11,12,12,12, 0, 0, 0,13,13,10,10,11,11,12,12,
135.11236 +        13,13, 0, 0, 0,14,14,10,10,11,11,12,12,13,13, 0,
135.11237 +         0, 0, 0, 0,11,11,11,11,13,12,13,13, 0, 0, 0, 0,
135.11238 +         0,12,12,11,11,12,12,13,13,
135.11239 +};
135.11240 +
135.11241 +static const static_codebook _44c0_s_p7_0 = {
135.11242 +        2, 169,
135.11243 +        (long *)_vq_lengthlist__44c0_s_p7_0,
135.11244 +        1, -526516224, 1616117760, 4, 0,
135.11245 +        (long *)_vq_quantlist__44c0_s_p7_0,
135.11246 +        0
135.11247 +};
135.11248 +
135.11249 +static const long _vq_quantlist__44c0_s_p7_1[] = {
135.11250 +        2,
135.11251 +        1,
135.11252 +        3,
135.11253 +        0,
135.11254 +        4,
135.11255 +};
135.11256 +
135.11257 +static const long _vq_lengthlist__44c0_s_p7_1[] = {
135.11258 +         2, 3, 3, 5, 5, 6, 6, 6, 5, 5, 6, 6, 6, 5, 5, 6,
135.11259 +         6, 6, 5, 5, 6, 6, 6, 5, 5,
135.11260 +};
135.11261 +
135.11262 +static const static_codebook _44c0_s_p7_1 = {
135.11263 +        2, 25,
135.11264 +        (long *)_vq_lengthlist__44c0_s_p7_1,
135.11265 +        1, -533725184, 1611661312, 3, 0,
135.11266 +        (long *)_vq_quantlist__44c0_s_p7_1,
135.11267 +        0
135.11268 +};
135.11269 +
135.11270 +static const long _vq_quantlist__44c0_s_p8_0[] = {
135.11271 +        2,
135.11272 +        1,
135.11273 +        3,
135.11274 +        0,
135.11275 +        4,
135.11276 +};
135.11277 +
135.11278 +static const long _vq_lengthlist__44c0_s_p8_0[] = {
135.11279 +         1, 5, 5,10,10, 6, 9, 8,10,10, 6,10, 9,10,10,10,
135.11280 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.11281 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.11282 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.11283 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.11284 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.11285 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.11286 +        10,10,10,10,10,10,10,10,10,10,10,10,10, 8,10,10,
135.11287 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.11288 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.11289 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.11290 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.11291 +        10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,
135.11292 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.11293 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.11294 +        11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,
135.11295 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.11296 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.11297 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.11298 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.11299 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.11300 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.11301 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.11302 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.11303 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.11304 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.11305 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.11306 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.11307 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.11308 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.11309 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.11310 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.11311 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.11312 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.11313 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.11314 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.11315 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.11316 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.11317 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.11318 +        11,
135.11319 +};
135.11320 +
135.11321 +static const static_codebook _44c0_s_p8_0 = {
135.11322 +        4, 625,
135.11323 +        (long *)_vq_lengthlist__44c0_s_p8_0,
135.11324 +        1, -518283264, 1627103232, 3, 0,
135.11325 +        (long *)_vq_quantlist__44c0_s_p8_0,
135.11326 +        0
135.11327 +};
135.11328 +
135.11329 +static const long _vq_quantlist__44c0_s_p8_1[] = {
135.11330 +        6,
135.11331 +        5,
135.11332 +        7,
135.11333 +        4,
135.11334 +        8,
135.11335 +        3,
135.11336 +        9,
135.11337 +        2,
135.11338 +        10,
135.11339 +        1,
135.11340 +        11,
135.11341 +        0,
135.11342 +        12,
135.11343 +};
135.11344 +
135.11345 +static const long _vq_lengthlist__44c0_s_p8_1[] = {
135.11346 +         1, 4, 4, 6, 6, 7, 7, 9, 9,11,12,13,12, 6, 5, 5,
135.11347 +         7, 7, 8, 8,10, 9,12,12,12,12, 6, 5, 5, 7, 7, 8,
135.11348 +         8,10, 9,12,11,11,13,16, 7, 7, 8, 8, 9, 9,10,10,
135.11349 +        12,12,13,12,16, 7, 7, 8, 7, 9, 9,10,10,11,12,12,
135.11350 +        13,16,10,10, 8, 8,10,10,11,12,12,12,13,13,16,11,
135.11351 +        10, 8, 7,11,10,11,11,12,11,13,13,16,16,16,10,10,
135.11352 +        10,10,11,11,13,12,13,13,16,16,16,11, 9,11, 9,15,
135.11353 +        13,12,13,13,13,16,16,16,15,13,11,11,12,13,12,12,
135.11354 +        14,13,16,16,16,14,13,11,11,13,12,14,13,13,13,16,
135.11355 +        16,16,16,16,13,13,13,12,14,13,14,14,16,16,16,16,
135.11356 +        16,13,13,12,12,14,14,15,13,
135.11357 +};
135.11358 +
135.11359 +static const static_codebook _44c0_s_p8_1 = {
135.11360 +        2, 169,
135.11361 +        (long *)_vq_lengthlist__44c0_s_p8_1,
135.11362 +        1, -522616832, 1620115456, 4, 0,
135.11363 +        (long *)_vq_quantlist__44c0_s_p8_1,
135.11364 +        0
135.11365 +};
135.11366 +
135.11367 +static const long _vq_quantlist__44c0_s_p8_2[] = {
135.11368 +        8,
135.11369 +        7,
135.11370 +        9,
135.11371 +        6,
135.11372 +        10,
135.11373 +        5,
135.11374 +        11,
135.11375 +        4,
135.11376 +        12,
135.11377 +        3,
135.11378 +        13,
135.11379 +        2,
135.11380 +        14,
135.11381 +        1,
135.11382 +        15,
135.11383 +        0,
135.11384 +        16,
135.11385 +};
135.11386 +
135.11387 +static const long _vq_lengthlist__44c0_s_p8_2[] = {
135.11388 +         2, 4, 4, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8,
135.11389 +         8,10,10,10, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9, 9,
135.11390 +         9, 9,10,10,10, 7, 7, 7, 7, 8, 8, 9, 9, 9, 9, 9,
135.11391 +         9, 9, 9,10,10,10, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9,
135.11392 +         9,10, 9, 9,10,10,10, 7, 7, 8, 8, 9, 8, 9, 9, 9,
135.11393 +         9,10, 9, 9,10,10,10,10, 8, 8, 8, 8, 9, 8, 9, 9,
135.11394 +         9, 9, 9,10, 9,10,10,10,10, 7, 7, 8, 8, 9, 9, 9,
135.11395 +         9, 9, 9,10, 9,10,10,10,10,10, 8, 8, 8, 9, 9, 9,
135.11396 +         9, 9, 9, 9,10,10,10, 9,11,10,10,10,10, 8, 8, 9,
135.11397 +         9, 9, 9, 9,10, 9, 9, 9,10,10,10,10,11,11, 9, 9,
135.11398 +         9, 9, 9, 9, 9, 9,10, 9, 9,10,11,10,10,11,11, 9,
135.11399 +         9, 9, 9, 9, 9, 9, 9, 9, 9,10, 9,11,11,10,11,11,
135.11400 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9,10, 9,11,10,10,11,
135.11401 +        11,11,11, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,10,10,10,
135.11402 +        11,11,11,11, 9,10, 9,10, 9, 9, 9, 9,10, 9,10,11,
135.11403 +        10,11,10,10,10,10,10, 9, 9, 9,10, 9, 9, 9,10,11,
135.11404 +        11,10,11,11,10,11,10,10,10, 9, 9, 9, 9,10, 9, 9,
135.11405 +        10,11,10,11,11,11,11,10,11,10,10, 9,10, 9, 9, 9,
135.11406 +        10,
135.11407 +};
135.11408 +
135.11409 +static const static_codebook _44c0_s_p8_2 = {
135.11410 +        2, 289,
135.11411 +        (long *)_vq_lengthlist__44c0_s_p8_2,
135.11412 +        1, -529530880, 1611661312, 5, 0,
135.11413 +        (long *)_vq_quantlist__44c0_s_p8_2,
135.11414 +        0
135.11415 +};
135.11416 +
135.11417 +static const long _huff_lengthlist__44c0_s_short[] = {
135.11418 +         9, 8,12,11,12,13,14,14,16, 6, 1, 5, 6, 6, 9,12,
135.11419 +        14,17, 9, 4, 5, 9, 7, 9,13,15,16, 8, 5, 8, 6, 8,
135.11420 +        10,13,17,17, 9, 6, 7, 7, 8, 9,13,15,17,11, 8, 9,
135.11421 +         9, 9,10,12,16,16,13, 7, 8, 7, 7, 9,12,14,15,13,
135.11422 +         6, 7, 5, 5, 7,10,13,13,14, 7, 8, 5, 6, 7, 9,10,
135.11423 +        12,
135.11424 +};
135.11425 +
135.11426 +static const static_codebook _huff_book__44c0_s_short = {
135.11427 +        2, 81,
135.11428 +        (long *)_huff_lengthlist__44c0_s_short,
135.11429 +        0, 0, 0, 0, 0,
135.11430 +        NULL,
135.11431 +        0
135.11432 +};
135.11433 +
135.11434 +static const long _huff_lengthlist__44c0_sm_long[] = {
135.11435 +         5, 4, 9,10, 9,10,11,12,13, 4, 1, 5, 7, 7, 9,11,
135.11436 +        12,14, 8, 5, 7, 9, 8,10,13,13,13,10, 7, 9, 4, 6,
135.11437 +         7,10,12,14, 9, 6, 7, 6, 6, 7,10,12,12, 9, 8, 9,
135.11438 +         7, 6, 7, 8,11,12,11,11,11, 9, 8, 7, 8,10,12,12,
135.11439 +        13,14,12,11, 9, 9, 9,12,12,17,17,15,16,12,10,11,
135.11440 +        13,
135.11441 +};
135.11442 +
135.11443 +static const static_codebook _huff_book__44c0_sm_long = {
135.11444 +        2, 81,
135.11445 +        (long *)_huff_lengthlist__44c0_sm_long,
135.11446 +        0, 0, 0, 0, 0,
135.11447 +        NULL,
135.11448 +        0
135.11449 +};
135.11450 +
135.11451 +static const long _vq_quantlist__44c0_sm_p1_0[] = {
135.11452 +        1,
135.11453 +        0,
135.11454 +        2,
135.11455 +};
135.11456 +
135.11457 +static const long _vq_lengthlist__44c0_sm_p1_0[] = {
135.11458 +         1, 5, 5, 0, 0, 0, 0, 0, 0, 5, 7, 7, 0, 0, 0, 0,
135.11459 +         0, 0, 5, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11460 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11461 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11462 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11463 +         0, 5, 8, 7, 0, 0, 0, 0, 0, 0, 7, 9, 9, 0, 0, 0,
135.11464 +         0, 0, 0, 7, 8, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11465 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11466 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11467 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11468 +         0, 0, 5, 7, 7, 0, 0, 0, 0, 0, 0, 7, 9, 8, 0, 0,
135.11469 +         0, 0, 0, 0, 7, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11470 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11471 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11472 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11473 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11474 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11475 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11476 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11477 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11478 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11479 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11480 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11481 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11482 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11483 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11484 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11485 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11486 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11487 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11488 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11489 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11490 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11491 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11492 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11493 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11494 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11495 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11496 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11497 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11498 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11499 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11500 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11501 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11502 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11503 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 8, 7, 0, 0, 0, 0,
135.11504 +         0, 0, 8, 9, 9, 0, 0, 0, 0, 0, 0, 8, 9, 9, 0, 0,
135.11505 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11506 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11507 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11508 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 9, 9, 0, 0, 0,
135.11509 +         0, 0, 0, 9,10,10, 0, 0, 0, 0, 0, 0, 9,10,10, 0,
135.11510 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11511 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11512 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11513 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 9, 9, 0, 0,
135.11514 +         0, 0, 0, 0, 8,10, 9, 0, 0, 0, 0, 0, 0, 9,10,10,
135.11515 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11516 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11517 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11518 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11519 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11520 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11521 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11522 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11523 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11524 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11525 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11526 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11527 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11528 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11529 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11530 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11531 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11532 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11533 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11534 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11535 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11536 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11537 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11538 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11539 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11540 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11541 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11542 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11543 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11544 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11545 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11546 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11547 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11548 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11549 +         0, 0, 5, 7, 8, 0, 0, 0, 0, 0, 0, 7, 9, 9, 0, 0,
135.11550 +         0, 0, 0, 0, 8, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11551 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11552 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11553 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11554 +         0, 0, 0, 7, 9, 9, 0, 0, 0, 0, 0, 0, 9,10,10, 0,
135.11555 +         0, 0, 0, 0, 0, 9, 9,10, 0, 0, 0, 0, 0, 0, 0, 0,
135.11556 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11557 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11558 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11559 +         0, 0, 0, 0, 7, 9, 9, 0, 0, 0, 0, 0, 0, 9,10,10,
135.11560 +         0, 0, 0, 0, 0, 0, 9,10,10, 0, 0, 0, 0, 0, 0, 0,
135.11561 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11562 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11563 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11564 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11565 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11566 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11567 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11568 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11569 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11570 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11571 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11572 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11573 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11574 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11575 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11576 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11577 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11578 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11579 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11580 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11581 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11582 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11583 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11584 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11585 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11586 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11587 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11588 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11589 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11590 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11591 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11592 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11593 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11594 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11595 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11596 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11597 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11598 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11599 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11600 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11601 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11602 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11603 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11604 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11605 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11606 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11607 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11608 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11609 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11610 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11611 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11612 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11613 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11614 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11615 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11616 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11617 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11618 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11619 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11620 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11621 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11622 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11623 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11624 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11625 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11626 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11627 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11628 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11629 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11630 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11631 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11632 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11633 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11634 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11635 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11636 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11637 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11638 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11639 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11640 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11641 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11642 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11643 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11644 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11645 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11646 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11647 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11648 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11649 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11650 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11651 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11652 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11653 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11654 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11655 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11656 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11657 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11658 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11659 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11660 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11661 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11662 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11663 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11664 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11665 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11666 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11667 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11668 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11669 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11670 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11671 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11672 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11673 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11674 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11675 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11676 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11677 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11678 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11679 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11680 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11681 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11682 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11683 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11684 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11685 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11686 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11687 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11688 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11689 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11690 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11691 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11692 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11693 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11694 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11695 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11696 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11697 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11698 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11699 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11700 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11701 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11702 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11703 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11704 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11705 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11706 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11707 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11708 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11709 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11710 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11711 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11712 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11713 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11714 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11715 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11716 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11717 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11718 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11719 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11720 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11721 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11722 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11723 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11724 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11725 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11726 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11727 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11728 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11729 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11730 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11731 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11732 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11733 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11734 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11735 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11736 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11737 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11738 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11739 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11740 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11741 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11742 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11743 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11744 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11745 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11746 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11747 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11748 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11749 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11750 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11751 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11752 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11753 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11754 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11755 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11756 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11757 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11758 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11759 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11760 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11761 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11762 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11763 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11764 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11765 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11766 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11767 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11768 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11769 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11770 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11771 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11772 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11773 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11774 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11775 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11776 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11777 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11778 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11779 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11780 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11781 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11782 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11783 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11784 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11785 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11786 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11787 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11788 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11789 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11790 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11791 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11792 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11793 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11794 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11795 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11796 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11797 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11798 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11799 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11800 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11801 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11802 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11803 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11804 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11805 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11806 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11807 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11808 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11809 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11810 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11811 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11812 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11813 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11814 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11815 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11816 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11817 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11818 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11819 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11820 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11821 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11822 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11823 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11824 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11825 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11826 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11827 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11828 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11829 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11830 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11831 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11832 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11833 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11834 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11835 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11836 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11837 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11838 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11839 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11840 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11841 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11842 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11843 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11844 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11845 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11846 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11847 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11848 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11849 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11850 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11851 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11852 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11853 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11854 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11855 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11856 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11857 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11858 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11859 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11860 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11861 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11862 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11863 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11864 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11865 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11866 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11867 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11868 +         0,
135.11869 +};
135.11870 +
135.11871 +static const static_codebook _44c0_sm_p1_0 = {
135.11872 +        8, 6561,
135.11873 +        (long *)_vq_lengthlist__44c0_sm_p1_0,
135.11874 +        1, -535822336, 1611661312, 2, 0,
135.11875 +        (long *)_vq_quantlist__44c0_sm_p1_0,
135.11876 +        0
135.11877 +};
135.11878 +
135.11879 +static const long _vq_quantlist__44c0_sm_p2_0[] = {
135.11880 +        2,
135.11881 +        1,
135.11882 +        3,
135.11883 +        0,
135.11884 +        4,
135.11885 +};
135.11886 +
135.11887 +static const long _vq_lengthlist__44c0_sm_p2_0[] = {
135.11888 +         1, 4, 4, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11889 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, 5, 7, 7, 0, 0,
135.11890 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11891 +         0, 0, 4, 5, 5, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11892 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7, 7, 9, 9,
135.11893 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11894 +         0, 0, 0, 0, 7, 7, 7, 9, 9, 0, 0, 0, 0, 0, 0, 0,
135.11895 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11896 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11897 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11898 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11899 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11900 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11901 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11902 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11903 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11904 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11905 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11906 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11907 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11908 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11909 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11910 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11911 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11912 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11913 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11914 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11915 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11916 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11917 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11918 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11919 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11920 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11921 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11922 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11923 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11924 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11925 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11926 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11927 +         0,
135.11928 +};
135.11929 +
135.11930 +static const static_codebook _44c0_sm_p2_0 = {
135.11931 +        4, 625,
135.11932 +        (long *)_vq_lengthlist__44c0_sm_p2_0,
135.11933 +        1, -533725184, 1611661312, 3, 0,
135.11934 +        (long *)_vq_quantlist__44c0_sm_p2_0,
135.11935 +        0
135.11936 +};
135.11937 +
135.11938 +static const long _vq_quantlist__44c0_sm_p3_0[] = {
135.11939 +        4,
135.11940 +        3,
135.11941 +        5,
135.11942 +        2,
135.11943 +        6,
135.11944 +        1,
135.11945 +        7,
135.11946 +        0,
135.11947 +        8,
135.11948 +};
135.11949 +
135.11950 +static const long _vq_lengthlist__44c0_sm_p3_0[] = {
135.11951 +         1, 3, 3, 7, 7, 0, 0, 0, 0, 0, 5, 4, 7, 7, 0, 0,
135.11952 +         0, 0, 0, 5, 5, 7, 7, 0, 0, 0, 0, 0, 6, 7, 8, 8,
135.11953 +         0, 0, 0, 0, 0, 0, 0, 8, 8, 0, 0, 0, 0, 0, 0, 0,
135.11954 +         9,10, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0,
135.11955 +         0, 0,11,11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.11956 +         0,
135.11957 +};
135.11958 +
135.11959 +static const static_codebook _44c0_sm_p3_0 = {
135.11960 +        2, 81,
135.11961 +        (long *)_vq_lengthlist__44c0_sm_p3_0,
135.11962 +        1, -531628032, 1611661312, 4, 0,
135.11963 +        (long *)_vq_quantlist__44c0_sm_p3_0,
135.11964 +        0
135.11965 +};
135.11966 +
135.11967 +static const long _vq_quantlist__44c0_sm_p4_0[] = {
135.11968 +        4,
135.11969 +        3,
135.11970 +        5,
135.11971 +        2,
135.11972 +        6,
135.11973 +        1,
135.11974 +        7,
135.11975 +        0,
135.11976 +        8,
135.11977 +};
135.11978 +
135.11979 +static const long _vq_lengthlist__44c0_sm_p4_0[] = {
135.11980 +         1, 4, 3, 6, 6, 7, 7, 9, 9, 0, 5, 5, 7, 7, 8, 7,
135.11981 +         9, 9, 0, 5, 5, 7, 7, 8, 8, 9, 9, 0, 7, 7, 8, 8,
135.11982 +         8, 8,10,10, 0, 0, 0, 8, 8, 8, 8,10,10, 0, 0, 0,
135.11983 +         9, 9, 9, 9,11,11, 0, 0, 0, 9, 9, 9, 9,11,11, 0,
135.11984 +         0, 0,10,10,10,10,11,11, 0, 0, 0, 0, 0, 9, 9,11,
135.11985 +        11,
135.11986 +};
135.11987 +
135.11988 +static const static_codebook _44c0_sm_p4_0 = {
135.11989 +        2, 81,
135.11990 +        (long *)_vq_lengthlist__44c0_sm_p4_0,
135.11991 +        1, -531628032, 1611661312, 4, 0,
135.11992 +        (long *)_vq_quantlist__44c0_sm_p4_0,
135.11993 +        0
135.11994 +};
135.11995 +
135.11996 +static const long _vq_quantlist__44c0_sm_p5_0[] = {
135.11997 +        8,
135.11998 +        7,
135.11999 +        9,
135.12000 +        6,
135.12001 +        10,
135.12002 +        5,
135.12003 +        11,
135.12004 +        4,
135.12005 +        12,
135.12006 +        3,
135.12007 +        13,
135.12008 +        2,
135.12009 +        14,
135.12010 +        1,
135.12011 +        15,
135.12012 +        0,
135.12013 +        16,
135.12014 +};
135.12015 +
135.12016 +static const long _vq_lengthlist__44c0_sm_p5_0[] = {
135.12017 +         1, 4, 4, 6, 6, 8, 8, 8, 8, 8, 8, 9, 9,10,10,11,
135.12018 +        11, 0, 6, 6, 7, 7, 8, 8, 9, 9, 9, 9,10,10,10,11,
135.12019 +        11,11, 0, 5, 6, 7, 7, 8, 8, 9, 9, 9, 9,10,10,10,
135.12020 +        11,11,11, 0, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9,10,10,
135.12021 +        11,11,12,12, 0, 0, 0, 8, 8, 8, 8, 9, 9, 9, 9,10,
135.12022 +        10,11,11,12,12, 0, 0, 0, 8, 8, 9, 9,10,10,10,10,
135.12023 +        11,11,11,11,12,12, 0, 0, 0, 8, 8, 9, 9,10,10,10,
135.12024 +        10,11,11,11,11,12,12, 0, 0, 0, 9, 9, 9, 9,10,10,
135.12025 +        10,10,11,11,12,12,12,13, 0, 0, 0, 0, 0, 9, 9,10,
135.12026 +        10,10,10,11,11,12,12,13,13, 0, 0, 0, 0, 0, 9, 9,
135.12027 +        10,10,11,11,11,11,12,12,13,13, 0, 0, 0, 0, 0, 9,
135.12028 +         9,10,10,11,10,11,11,12,12,13,13, 0, 0, 0, 0, 0,
135.12029 +        10,10,10,10,11,11,12,12,12,13,13,13, 0, 0, 0, 0,
135.12030 +         0, 0, 0,10,10,11,11,12,12,12,13,13,13, 0, 0, 0,
135.12031 +         0, 0, 0, 0,11,11,12,12,12,12,13,13,14,14, 0, 0,
135.12032 +         0, 0, 0, 0, 0,11,11,12,11,12,12,13,13,13,13, 0,
135.12033 +         0, 0, 0, 0, 0, 0,12,12,12,12,13,13,13,13,14,14,
135.12034 +         0, 0, 0, 0, 0, 0, 0, 0, 0,12,12,12,12,13,13,14,
135.12035 +        14,
135.12036 +};
135.12037 +
135.12038 +static const static_codebook _44c0_sm_p5_0 = {
135.12039 +        2, 289,
135.12040 +        (long *)_vq_lengthlist__44c0_sm_p5_0,
135.12041 +        1, -529530880, 1611661312, 5, 0,
135.12042 +        (long *)_vq_quantlist__44c0_sm_p5_0,
135.12043 +        0
135.12044 +};
135.12045 +
135.12046 +static const long _vq_quantlist__44c0_sm_p6_0[] = {
135.12047 +        1,
135.12048 +        0,
135.12049 +        2,
135.12050 +};
135.12051 +
135.12052 +static const long _vq_lengthlist__44c0_sm_p6_0[] = {
135.12053 +         1, 4, 4, 7, 6, 6, 7, 6, 6, 4, 7, 7,10, 9, 9,11,
135.12054 +         9, 9, 4, 7, 7,10, 9, 9,11, 9, 9, 7,10,10,10,11,
135.12055 +        11,11,10,10, 6, 9, 9,11,11,10,11,10,10, 6, 9, 9,
135.12056 +        11,10,11,11,10,10, 7,11,10,11,11,11,11,11,11, 6,
135.12057 +         9, 9,11,10,10,11,11,10, 6, 9, 9,11,10,10,11,10,
135.12058 +        11,
135.12059 +};
135.12060 +
135.12061 +static const static_codebook _44c0_sm_p6_0 = {
135.12062 +        4, 81,
135.12063 +        (long *)_vq_lengthlist__44c0_sm_p6_0,
135.12064 +        1, -529137664, 1618345984, 2, 0,
135.12065 +        (long *)_vq_quantlist__44c0_sm_p6_0,
135.12066 +        0
135.12067 +};
135.12068 +
135.12069 +static const long _vq_quantlist__44c0_sm_p6_1[] = {
135.12070 +        5,
135.12071 +        4,
135.12072 +        6,
135.12073 +        3,
135.12074 +        7,
135.12075 +        2,
135.12076 +        8,
135.12077 +        1,
135.12078 +        9,
135.12079 +        0,
135.12080 +        10,
135.12081 +};
135.12082 +
135.12083 +static const long _vq_lengthlist__44c0_sm_p6_1[] = {
135.12084 +         2, 4, 4, 6, 6, 7, 7, 7, 7, 7, 8, 9, 5, 5, 6, 6,
135.12085 +         7, 7, 8, 8, 8, 8, 9, 5, 5, 6, 6, 7, 7, 8, 8, 8,
135.12086 +         8,10, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8,10,10,10, 7,
135.12087 +         7, 7, 7, 8, 8, 8, 8,10,10,10, 8, 8, 8, 8, 8, 8,
135.12088 +         8, 8,10,10,10, 8, 8, 8, 8, 8, 8, 8, 8,10,10,10,
135.12089 +         8, 8, 8, 8, 8, 8, 8, 8,10,10,10,10,10, 8, 8, 8,
135.12090 +         8, 8, 8,10,10,10,10,10, 9, 9, 8, 8, 8, 8,10,10,
135.12091 +        10,10,10, 8, 8, 8, 8, 8, 8,
135.12092 +};
135.12093 +
135.12094 +static const static_codebook _44c0_sm_p6_1 = {
135.12095 +        2, 121,
135.12096 +        (long *)_vq_lengthlist__44c0_sm_p6_1,
135.12097 +        1, -531365888, 1611661312, 4, 0,
135.12098 +        (long *)_vq_quantlist__44c0_sm_p6_1,
135.12099 +        0
135.12100 +};
135.12101 +
135.12102 +static const long _vq_quantlist__44c0_sm_p7_0[] = {
135.12103 +        6,
135.12104 +        5,
135.12105 +        7,
135.12106 +        4,
135.12107 +        8,
135.12108 +        3,
135.12109 +        9,
135.12110 +        2,
135.12111 +        10,
135.12112 +        1,
135.12113 +        11,
135.12114 +        0,
135.12115 +        12,
135.12116 +};
135.12117 +
135.12118 +static const long _vq_lengthlist__44c0_sm_p7_0[] = {
135.12119 +         1, 4, 4, 6, 6, 7, 7, 7, 7, 8, 8, 9, 9, 7, 5, 5,
135.12120 +         7, 7, 8, 8, 8, 8, 9, 9,10,10, 7, 6, 5, 7, 7, 8,
135.12121 +         8, 8, 8, 9, 9,10,10, 0, 8, 8, 8, 8, 9, 9, 9, 9,
135.12122 +        10,10,11,11, 0, 8, 8, 8, 8, 9, 9, 9, 9,10,10,11,
135.12123 +        11, 0,12,12, 9, 9,10,10,10,10,11,11,11,11, 0,13,
135.12124 +        13, 9, 9, 9, 9,10,10,11,11,11,12, 0, 0, 0, 9,10,
135.12125 +        10,10,11,11,12,11,12,12, 0, 0, 0,10,10, 9, 9,11,
135.12126 +        11,12,12,12,12, 0, 0, 0,13,13,10,10,11,11,12,12,
135.12127 +        13,13, 0, 0, 0,14,14,10,10,11,11,12,12,13,13, 0,
135.12128 +         0, 0, 0, 0,11,12,11,11,13,12,13,13, 0, 0, 0, 0,
135.12129 +         0,12,12,11,11,13,12,14,14,
135.12130 +};
135.12131 +
135.12132 +static const static_codebook _44c0_sm_p7_0 = {
135.12133 +        2, 169,
135.12134 +        (long *)_vq_lengthlist__44c0_sm_p7_0,
135.12135 +        1, -526516224, 1616117760, 4, 0,
135.12136 +        (long *)_vq_quantlist__44c0_sm_p7_0,
135.12137 +        0
135.12138 +};
135.12139 +
135.12140 +static const long _vq_quantlist__44c0_sm_p7_1[] = {
135.12141 +        2,
135.12142 +        1,
135.12143 +        3,
135.12144 +        0,
135.12145 +        4,
135.12146 +};
135.12147 +
135.12148 +static const long _vq_lengthlist__44c0_sm_p7_1[] = {
135.12149 +         2, 4, 4, 4, 4, 6, 5, 5, 5, 5, 6, 5, 5, 5, 5, 6,
135.12150 +         6, 6, 5, 5, 6, 6, 6, 5, 5,
135.12151 +};
135.12152 +
135.12153 +static const static_codebook _44c0_sm_p7_1 = {
135.12154 +        2, 25,
135.12155 +        (long *)_vq_lengthlist__44c0_sm_p7_1,
135.12156 +        1, -533725184, 1611661312, 3, 0,
135.12157 +        (long *)_vq_quantlist__44c0_sm_p7_1,
135.12158 +        0
135.12159 +};
135.12160 +
135.12161 +static const long _vq_quantlist__44c0_sm_p8_0[] = {
135.12162 +        4,
135.12163 +        3,
135.12164 +        5,
135.12165 +        2,
135.12166 +        6,
135.12167 +        1,
135.12168 +        7,
135.12169 +        0,
135.12170 +        8,
135.12171 +};
135.12172 +
135.12173 +static const long _vq_lengthlist__44c0_sm_p8_0[] = {
135.12174 +         1, 3, 3,11,11,11,11,11,11, 3, 7, 6,11,11,11,11,
135.12175 +        11,11, 4, 8, 7,11,11,11,11,11,11,11,11,11,11,11,
135.12176 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.12177 +        11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
135.12178 +        12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
135.12179 +        12,
135.12180 +};
135.12181 +
135.12182 +static const static_codebook _44c0_sm_p8_0 = {
135.12183 +        2, 81,
135.12184 +        (long *)_vq_lengthlist__44c0_sm_p8_0,
135.12185 +        1, -516186112, 1627103232, 4, 0,
135.12186 +        (long *)_vq_quantlist__44c0_sm_p8_0,
135.12187 +        0
135.12188 +};
135.12189 +
135.12190 +static const long _vq_quantlist__44c0_sm_p8_1[] = {
135.12191 +        6,
135.12192 +        5,
135.12193 +        7,
135.12194 +        4,
135.12195 +        8,
135.12196 +        3,
135.12197 +        9,
135.12198 +        2,
135.12199 +        10,
135.12200 +        1,
135.12201 +        11,
135.12202 +        0,
135.12203 +        12,
135.12204 +};
135.12205 +
135.12206 +static const long _vq_lengthlist__44c0_sm_p8_1[] = {
135.12207 +         1, 4, 4, 6, 6, 7, 7, 9, 9,10,11,12,12, 6, 5, 5,
135.12208 +         7, 7, 8, 8,10,10,12,11,12,12, 6, 5, 5, 7, 7, 8,
135.12209 +         8,10,10,12,11,12,12,17, 7, 7, 8, 8, 9, 9,10,10,
135.12210 +        12,12,13,13,18, 7, 7, 8, 7, 9, 9,10,10,12,12,12,
135.12211 +        13,19,10,10, 8, 8,10,10,11,11,12,12,13,14,19,11,
135.12212 +        10, 8, 7,10,10,11,11,12,12,13,12,19,19,19,10,10,
135.12213 +        10,10,11,11,12,12,13,13,19,19,19,11, 9,11, 9,14,
135.12214 +        12,13,12,13,13,19,20,18,13,14,11,11,12,12,13,13,
135.12215 +        14,13,20,20,20,15,13,11,10,13,11,13,13,14,13,20,
135.12216 +        20,20,20,20,13,14,12,12,13,13,13,13,20,20,20,20,
135.12217 +        20,13,13,12,12,16,13,15,13,
135.12218 +};
135.12219 +
135.12220 +static const static_codebook _44c0_sm_p8_1 = {
135.12221 +        2, 169,
135.12222 +        (long *)_vq_lengthlist__44c0_sm_p8_1,
135.12223 +        1, -522616832, 1620115456, 4, 0,
135.12224 +        (long *)_vq_quantlist__44c0_sm_p8_1,
135.12225 +        0
135.12226 +};
135.12227 +
135.12228 +static const long _vq_quantlist__44c0_sm_p8_2[] = {
135.12229 +        8,
135.12230 +        7,
135.12231 +        9,
135.12232 +        6,
135.12233 +        10,
135.12234 +        5,
135.12235 +        11,
135.12236 +        4,
135.12237 +        12,
135.12238 +        3,
135.12239 +        13,
135.12240 +        2,
135.12241 +        14,
135.12242 +        1,
135.12243 +        15,
135.12244 +        0,
135.12245 +        16,
135.12246 +};
135.12247 +
135.12248 +static const long _vq_lengthlist__44c0_sm_p8_2[] = {
135.12249 +         2, 5, 5, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8,
135.12250 +         8,10, 6, 6, 7, 7, 7, 7, 8, 8, 9, 9, 9, 9, 9, 9,
135.12251 +         9, 9,10, 6, 6, 7, 7, 8, 7, 8, 8, 9, 9, 9, 9, 9,
135.12252 +         9, 9, 9,10, 7, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9,
135.12253 +         9, 9, 9, 9,10,10,10, 7, 7, 8, 8, 9, 8, 9, 9, 9,
135.12254 +         9,10, 9, 9,10,10,10,11, 8, 8, 8, 8, 9, 9, 9, 9,
135.12255 +         9, 9, 9,10, 9,10,10,10,10, 8, 8, 8, 8, 9, 9, 9,
135.12256 +         9, 9, 9, 9, 9,10,10,11,10,10, 8, 8, 9, 9, 9, 9,
135.12257 +         9, 9, 9, 9, 9, 9,10,10,10,10,10,11,11, 8, 8, 9,
135.12258 +         9, 9, 9, 9, 9, 9, 9, 9,10,11,11,11,11,11, 9, 9,
135.12259 +         9, 9, 9, 9, 9, 9,10, 9,10, 9,11,11,10,11,11, 9,
135.12260 +         9, 9, 9, 9, 9, 9, 9, 9, 9,10, 9,11,11,10,11,11,
135.12261 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9,10, 9,11,10,11,11,
135.12262 +        11,11,11, 9, 9,10, 9, 9, 9, 9, 9, 9, 9,10,11,10,
135.12263 +        11,11,11,11,10,10,10,10, 9, 9, 9, 9, 9, 9,10,11,
135.12264 +        11,11,11,11,11, 9,10, 9, 9, 9, 9, 9, 9, 9, 9,11,
135.12265 +        11,10,11,11,11,10,10,10, 9, 9, 9, 9, 9, 9, 9, 9,
135.12266 +        10,11,10,11,11,11,11,11,11, 9, 9, 9, 9, 9, 9, 9,
135.12267 +         9,
135.12268 +};
135.12269 +
135.12270 +static const static_codebook _44c0_sm_p8_2 = {
135.12271 +        2, 289,
135.12272 +        (long *)_vq_lengthlist__44c0_sm_p8_2,
135.12273 +        1, -529530880, 1611661312, 5, 0,
135.12274 +        (long *)_vq_quantlist__44c0_sm_p8_2,
135.12275 +        0
135.12276 +};
135.12277 +
135.12278 +static const long _huff_lengthlist__44c0_sm_short[] = {
135.12279 +         6, 6,12,13,13,14,16,17,17, 4, 2, 5, 8, 7, 9,12,
135.12280 +        15,15, 9, 4, 5, 9, 7, 9,12,16,18,11, 6, 7, 4, 6,
135.12281 +         8,11,14,18,10, 5, 6, 5, 5, 7,10,14,17,10, 5, 7,
135.12282 +         7, 6, 7,10,13,16,11, 5, 7, 7, 7, 8,10,12,15,13,
135.12283 +         6, 7, 5, 5, 7, 9,12,13,16, 8, 9, 6, 6, 7, 9,10,
135.12284 +        12,
135.12285 +};
135.12286 +
135.12287 +static const static_codebook _huff_book__44c0_sm_short = {
135.12288 +        2, 81,
135.12289 +        (long *)_huff_lengthlist__44c0_sm_short,
135.12290 +        0, 0, 0, 0, 0,
135.12291 +        NULL,
135.12292 +        0
135.12293 +};
135.12294 +
135.12295 +static const long _huff_lengthlist__44c1_s_long[] = {
135.12296 +         5, 5, 9,10, 9, 9,10,11,12, 5, 1, 5, 6, 6, 7,10,
135.12297 +        12,14, 9, 5, 6, 8, 8,10,12,14,14,10, 5, 8, 5, 6,
135.12298 +         8,11,13,14, 9, 5, 7, 6, 6, 8,10,12,11, 9, 7, 9,
135.12299 +         7, 6, 6, 7,10,10,10, 9,12, 9, 8, 7, 7,10,12,11,
135.12300 +        11,13,12,10, 9, 8, 9,11,11,14,15,15,13,11, 9, 9,
135.12301 +        11,
135.12302 +};
135.12303 +
135.12304 +static const static_codebook _huff_book__44c1_s_long = {
135.12305 +        2, 81,
135.12306 +        (long *)_huff_lengthlist__44c1_s_long,
135.12307 +        0, 0, 0, 0, 0,
135.12308 +        NULL,
135.12309 +        0
135.12310 +};
135.12311 +
135.12312 +static const long _vq_quantlist__44c1_s_p1_0[] = {
135.12313 +        1,
135.12314 +        0,
135.12315 +        2,
135.12316 +};
135.12317 +
135.12318 +static const long _vq_lengthlist__44c1_s_p1_0[] = {
135.12319 +         2, 4, 4, 0, 0, 0, 0, 0, 0, 5, 7, 6, 0, 0, 0, 0,
135.12320 +         0, 0, 5, 6, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12321 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12322 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12323 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12324 +         0, 5, 7, 7, 0, 0, 0, 0, 0, 0, 7, 8, 8, 0, 0, 0,
135.12325 +         0, 0, 0, 7, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12326 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12327 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12328 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12329 +         0, 0, 5, 7, 7, 0, 0, 0, 0, 0, 0, 7, 8, 8, 0, 0,
135.12330 +         0, 0, 0, 0, 7, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12331 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12332 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12333 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12334 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12335 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12336 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12337 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12338 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12339 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12340 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12341 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12342 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12343 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12344 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12345 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12346 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12347 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12348 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12349 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12350 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12351 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12352 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12353 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12354 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12355 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12356 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12357 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12358 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12359 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12360 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12361 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12362 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12363 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12364 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 7, 7, 0, 0, 0, 0,
135.12365 +         0, 0, 7, 8, 8, 0, 0, 0, 0, 0, 0, 7, 8, 8, 0, 0,
135.12366 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12367 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12368 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12369 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 8, 8, 0, 0, 0,
135.12370 +         0, 0, 0, 8, 9,10, 0, 0, 0, 0, 0, 0, 8, 9, 9, 0,
135.12371 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12372 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12373 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12374 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 8, 8, 0, 0,
135.12375 +         0, 0, 0, 0, 8, 9, 8, 0, 0, 0, 0, 0, 0, 8, 9, 9,
135.12376 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12377 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12378 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12379 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12380 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12381 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12382 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12383 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12384 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12385 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12386 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12387 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12388 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12389 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12390 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12391 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12392 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12393 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12394 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12395 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12396 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12397 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12398 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12399 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12400 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12401 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12402 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12403 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12404 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12405 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12406 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12407 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12408 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12409 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12410 +         0, 0, 4, 7, 7, 0, 0, 0, 0, 0, 0, 7, 8, 8, 0, 0,
135.12411 +         0, 0, 0, 0, 7, 8, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12412 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12413 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12414 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12415 +         0, 0, 0, 6, 8, 8, 0, 0, 0, 0, 0, 0, 8,10, 9, 0,
135.12416 +         0, 0, 0, 0, 0, 8, 8, 9, 0, 0, 0, 0, 0, 0, 0, 0,
135.12417 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12418 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12419 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12420 +         0, 0, 0, 0, 7, 8, 8, 0, 0, 0, 0, 0, 0, 8, 9, 9,
135.12421 +         0, 0, 0, 0, 0, 0, 8, 9, 9, 0, 0, 0, 0, 0, 0, 0,
135.12422 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12423 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12424 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12425 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12426 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12427 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12428 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12429 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12430 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12431 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12432 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12433 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12434 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12435 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12436 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12437 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12438 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12439 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12440 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12441 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12442 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12443 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12444 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12445 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12446 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12447 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12448 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12449 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12450 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12451 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12452 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12453 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12454 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12455 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12456 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12457 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12458 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12459 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12460 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12461 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12462 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12463 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12464 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12465 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12466 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12467 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12468 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12469 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12470 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12471 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12472 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12473 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12474 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12475 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12476 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12477 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12478 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12479 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12480 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12481 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12482 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12483 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12484 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12485 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12486 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12487 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12488 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12489 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12490 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12491 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12492 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12493 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12494 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12495 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12496 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12497 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12498 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12499 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12500 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12501 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12502 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12503 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12504 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12505 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12506 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12507 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12508 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12509 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12510 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12511 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12512 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12513 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12514 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12515 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12516 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12517 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12518 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12519 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12520 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12521 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12522 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12523 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12524 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12525 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12526 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12527 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12528 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12529 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12530 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12531 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12532 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12533 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12534 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12535 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12536 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12537 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12538 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12539 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12540 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12541 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12542 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12543 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12544 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12545 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12546 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12547 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12548 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12549 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12550 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12551 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12552 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12553 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12554 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12555 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12556 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12557 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12558 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12559 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12560 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12561 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12562 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12563 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12564 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12565 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12566 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12567 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12568 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12569 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12570 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12571 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12572 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12573 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12574 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12575 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12576 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12577 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12578 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12579 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12580 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12581 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12582 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12583 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12584 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12585 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12586 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12587 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12588 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12589 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12590 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12591 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12592 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12593 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12594 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12595 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12596 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12597 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12598 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12599 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12600 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12601 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12602 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12603 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12604 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12605 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12606 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12607 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12608 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12609 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12610 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12611 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12612 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12613 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12614 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12615 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12616 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12617 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12618 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12619 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12620 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12621 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12622 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12623 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12624 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12625 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12626 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12627 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12628 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12629 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12630 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12631 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12632 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12633 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12634 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12635 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12636 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12637 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12638 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12639 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12640 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12641 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12642 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12643 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12644 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12645 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12646 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12647 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12648 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12649 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12650 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12651 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12652 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12653 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12654 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12655 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12656 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12657 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12658 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12659 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12660 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12661 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12662 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12663 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12664 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12665 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12666 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12667 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12668 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12669 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12670 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12671 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12672 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12673 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12674 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12675 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12676 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12677 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12678 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12679 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12680 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12681 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12682 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12683 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12684 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12685 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12686 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12687 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12688 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12689 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12690 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12691 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12692 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12693 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12694 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12695 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12696 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12697 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12698 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12699 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12700 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12701 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12702 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12703 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12704 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12705 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12706 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12707 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12708 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12709 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12710 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12711 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12712 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12713 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12714 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12715 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12716 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12717 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12718 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12719 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12720 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12721 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12722 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12723 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12724 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12725 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12726 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12727 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12728 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12729 +         0,
135.12730 +};
135.12731 +
135.12732 +static const static_codebook _44c1_s_p1_0 = {
135.12733 +        8, 6561,
135.12734 +        (long *)_vq_lengthlist__44c1_s_p1_0,
135.12735 +        1, -535822336, 1611661312, 2, 0,
135.12736 +        (long *)_vq_quantlist__44c1_s_p1_0,
135.12737 +        0
135.12738 +};
135.12739 +
135.12740 +static const long _vq_quantlist__44c1_s_p2_0[] = {
135.12741 +        2,
135.12742 +        1,
135.12743 +        3,
135.12744 +        0,
135.12745 +        4,
135.12746 +};
135.12747 +
135.12748 +static const long _vq_lengthlist__44c1_s_p2_0[] = {
135.12749 +         2, 3, 4, 6, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12750 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 6, 6, 0, 0,
135.12751 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12752 +         0, 0, 4, 4, 5, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12753 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 6, 8, 8,
135.12754 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12755 +         0, 0, 0, 0, 6, 6, 6, 8, 8, 0, 0, 0, 0, 0, 0, 0,
135.12756 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12757 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12758 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12759 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12760 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12761 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12762 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12763 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12764 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12765 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12766 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12767 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12768 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12769 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12770 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12771 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12772 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12773 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12774 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12775 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12776 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12777 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12778 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12779 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12780 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12781 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12782 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12783 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12784 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12785 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12786 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12787 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12788 +         0,
135.12789 +};
135.12790 +
135.12791 +static const static_codebook _44c1_s_p2_0 = {
135.12792 +        4, 625,
135.12793 +        (long *)_vq_lengthlist__44c1_s_p2_0,
135.12794 +        1, -533725184, 1611661312, 3, 0,
135.12795 +        (long *)_vq_quantlist__44c1_s_p2_0,
135.12796 +        0
135.12797 +};
135.12798 +
135.12799 +static const long _vq_quantlist__44c1_s_p3_0[] = {
135.12800 +        4,
135.12801 +        3,
135.12802 +        5,
135.12803 +        2,
135.12804 +        6,
135.12805 +        1,
135.12806 +        7,
135.12807 +        0,
135.12808 +        8,
135.12809 +};
135.12810 +
135.12811 +static const long _vq_lengthlist__44c1_s_p3_0[] = {
135.12812 +         1, 3, 2, 7, 7, 0, 0, 0, 0, 0,13,13, 6, 6, 0, 0,
135.12813 +         0, 0, 0,12, 0, 6, 6, 0, 0, 0, 0, 0, 0, 0, 7, 7,
135.12814 +         0, 0, 0, 0, 0, 0, 0, 7, 7, 0, 0, 0, 0, 0, 0, 0,
135.12815 +         8, 9, 0, 0, 0, 0, 0, 0, 0, 8, 8, 0, 0, 0, 0, 0,
135.12816 +         0, 0,11,10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.12817 +         0,
135.12818 +};
135.12819 +
135.12820 +static const static_codebook _44c1_s_p3_0 = {
135.12821 +        2, 81,
135.12822 +        (long *)_vq_lengthlist__44c1_s_p3_0,
135.12823 +        1, -531628032, 1611661312, 4, 0,
135.12824 +        (long *)_vq_quantlist__44c1_s_p3_0,
135.12825 +        0
135.12826 +};
135.12827 +
135.12828 +static const long _vq_quantlist__44c1_s_p4_0[] = {
135.12829 +        4,
135.12830 +        3,
135.12831 +        5,
135.12832 +        2,
135.12833 +        6,
135.12834 +        1,
135.12835 +        7,
135.12836 +        0,
135.12837 +        8,
135.12838 +};
135.12839 +
135.12840 +static const long _vq_lengthlist__44c1_s_p4_0[] = {
135.12841 +         1, 3, 3, 6, 5, 6, 6, 8, 8, 0, 0, 0, 7, 7, 7, 7,
135.12842 +         9, 9, 0, 0, 0, 7, 7, 7, 7, 9, 9, 0, 0, 0, 7, 7,
135.12843 +         8, 8,10,10, 0, 0, 0, 7, 7, 8, 8,10,10, 0, 0, 0,
135.12844 +         9, 9, 8, 8,10,10, 0, 0, 0, 8, 8, 8, 8,10,10, 0,
135.12845 +         0, 0,10,10, 9, 9,11,11, 0, 0, 0, 0, 0, 9, 9,11,
135.12846 +        11,
135.12847 +};
135.12848 +
135.12849 +static const static_codebook _44c1_s_p4_0 = {
135.12850 +        2, 81,
135.12851 +        (long *)_vq_lengthlist__44c1_s_p4_0,
135.12852 +        1, -531628032, 1611661312, 4, 0,
135.12853 +        (long *)_vq_quantlist__44c1_s_p4_0,
135.12854 +        0
135.12855 +};
135.12856 +
135.12857 +static const long _vq_quantlist__44c1_s_p5_0[] = {
135.12858 +        8,
135.12859 +        7,
135.12860 +        9,
135.12861 +        6,
135.12862 +        10,
135.12863 +        5,
135.12864 +        11,
135.12865 +        4,
135.12866 +        12,
135.12867 +        3,
135.12868 +        13,
135.12869 +        2,
135.12870 +        14,
135.12871 +        1,
135.12872 +        15,
135.12873 +        0,
135.12874 +        16,
135.12875 +};
135.12876 +
135.12877 +static const long _vq_lengthlist__44c1_s_p5_0[] = {
135.12878 +         1, 4, 3, 6, 6, 7, 7, 8, 8, 8, 8, 9, 9,10,10,11,
135.12879 +        11, 0, 0, 0, 7, 7, 8, 8, 9, 9, 9, 9,10,10,10,10,
135.12880 +        11,11, 0, 0, 0, 7, 7, 8, 8, 9, 9, 9, 9,10,10,10,
135.12881 +        10,11,11, 0, 0, 0, 7, 7, 8, 8, 9, 9, 9, 9,10,10,
135.12882 +        11,11,11,11, 0, 0, 0, 7, 7, 8, 8, 9, 9, 9, 9,10,
135.12883 +        10,11,11,12,11, 0, 0, 0, 8, 8, 9, 9, 9,10,10,10,
135.12884 +        10,10,11,11,12,12, 0, 0, 0, 8, 8, 9, 9,10, 9,10,
135.12885 +        10,10,10,11,11,12,12, 0, 0, 0, 9, 9, 9, 9,10,10,
135.12886 +        10,10,11,11,12,12,12,12, 0, 0, 0, 0, 0, 9, 9,10,
135.12887 +        10,10,10,11,11,12,12,12,12, 0, 0, 0, 0, 0, 9, 9,
135.12888 +        10,10,10,11,11,11,12,12,13,13, 0, 0, 0, 0, 0, 9,
135.12889 +         9,10,10,10,10,11,11,12,12,13,13, 0, 0, 0, 0, 0,
135.12890 +        10,10,10,10,11,11,12,12,12,12,13,13, 0, 0, 0, 0,
135.12891 +         0, 0, 0,10,10,11,11,12,12,12,12,13,13, 0, 0, 0,
135.12892 +         0, 0, 0, 0,11,11,12,12,12,12,13,13,13,13, 0, 0,
135.12893 +         0, 0, 0, 0, 0,11,11,11,11,12,12,13,13,13,13, 0,
135.12894 +         0, 0, 0, 0, 0, 0,12,12,12,12,12,12,13,13,14,14,
135.12895 +         0, 0, 0, 0, 0, 0, 0, 0, 0,12,12,12,12,13,13,14,
135.12896 +        14,
135.12897 +};
135.12898 +
135.12899 +static const static_codebook _44c1_s_p5_0 = {
135.12900 +        2, 289,
135.12901 +        (long *)_vq_lengthlist__44c1_s_p5_0,
135.12902 +        1, -529530880, 1611661312, 5, 0,
135.12903 +        (long *)_vq_quantlist__44c1_s_p5_0,
135.12904 +        0
135.12905 +};
135.12906 +
135.12907 +static const long _vq_quantlist__44c1_s_p6_0[] = {
135.12908 +        1,
135.12909 +        0,
135.12910 +        2,
135.12911 +};
135.12912 +
135.12913 +static const long _vq_lengthlist__44c1_s_p6_0[] = {
135.12914 +         1, 4, 4, 7, 6, 6, 7, 6, 6, 4, 7, 7,10, 9, 9,11,
135.12915 +         9, 9, 4, 7, 7,10, 9, 9,11, 9, 9, 6,10,10,11,11,
135.12916 +        11,11,10,10, 6, 9, 9,11,10,10,11,10,10, 6, 9, 9,
135.12917 +        11,10,11,11,10,10, 7,11,10,11,11,11,12,11,11, 7,
135.12918 +         9, 9,11,10,10,11,11,10, 6, 9, 9,10,10,10,12,10,
135.12919 +        11,
135.12920 +};
135.12921 +
135.12922 +static const static_codebook _44c1_s_p6_0 = {
135.12923 +        4, 81,
135.12924 +        (long *)_vq_lengthlist__44c1_s_p6_0,
135.12925 +        1, -529137664, 1618345984, 2, 0,
135.12926 +        (long *)_vq_quantlist__44c1_s_p6_0,
135.12927 +        0
135.12928 +};
135.12929 +
135.12930 +static const long _vq_quantlist__44c1_s_p6_1[] = {
135.12931 +        5,
135.12932 +        4,
135.12933 +        6,
135.12934 +        3,
135.12935 +        7,
135.12936 +        2,
135.12937 +        8,
135.12938 +        1,
135.12939 +        9,
135.12940 +        0,
135.12941 +        10,
135.12942 +};
135.12943 +
135.12944 +static const long _vq_lengthlist__44c1_s_p6_1[] = {
135.12945 +         2, 3, 3, 6, 6, 7, 7, 7, 7, 8, 8,10,10,10, 6, 6,
135.12946 +         7, 7, 8, 8, 8, 8,10,10,10, 6, 6, 7, 7, 8, 8, 8,
135.12947 +         8,10,10,10, 7, 7, 7, 7, 8, 8, 8, 8,10,10,10, 7,
135.12948 +         7, 7, 7, 8, 8, 8, 8,10,10,10, 7, 7, 8, 8, 8, 8,
135.12949 +         8, 8,10,10,10, 7, 7, 8, 8, 8, 8, 8, 8,10,10,10,
135.12950 +         8, 8, 8, 8, 8, 8, 8, 8,10,10,10,10,10, 8, 8, 8,
135.12951 +         8, 8, 8,10,10,10,10,10, 9, 9, 8, 8, 8, 8,10,10,
135.12952 +        10,10,10, 8, 8, 8, 8, 8, 8,
135.12953 +};
135.12954 +
135.12955 +static const static_codebook _44c1_s_p6_1 = {
135.12956 +        2, 121,
135.12957 +        (long *)_vq_lengthlist__44c1_s_p6_1,
135.12958 +        1, -531365888, 1611661312, 4, 0,
135.12959 +        (long *)_vq_quantlist__44c1_s_p6_1,
135.12960 +        0
135.12961 +};
135.12962 +
135.12963 +static const long _vq_quantlist__44c1_s_p7_0[] = {
135.12964 +        6,
135.12965 +        5,
135.12966 +        7,
135.12967 +        4,
135.12968 +        8,
135.12969 +        3,
135.12970 +        9,
135.12971 +        2,
135.12972 +        10,
135.12973 +        1,
135.12974 +        11,
135.12975 +        0,
135.12976 +        12,
135.12977 +};
135.12978 +
135.12979 +static const long _vq_lengthlist__44c1_s_p7_0[] = {
135.12980 +         1, 4, 4, 6, 6, 7, 7, 7, 7, 8, 8,10, 9, 7, 5, 6,
135.12981 +         7, 7, 8, 8, 8, 8, 9, 9,10,10, 7, 5, 5, 7, 7, 8,
135.12982 +         8, 8, 8, 9, 9,10,10, 0, 8, 8, 8, 8, 9, 9, 9, 9,
135.12983 +        10,10,11,10, 0, 8, 8, 8, 8, 9, 9, 9, 9,10,10,11,
135.12984 +        11, 0,12,12, 9, 9, 9,10,10,10,11,11,11,11, 0,13,
135.12985 +        13, 9, 9, 9, 9,10,10,11,11,11,11, 0, 0, 0,10,10,
135.12986 +        10,10,11,11,12,11,12,12, 0, 0, 0,10,10,10, 9,11,
135.12987 +        11,12,11,13,12, 0, 0, 0,13,13,10,10,11,11,12,12,
135.12988 +        13,13, 0, 0, 0,14,14,10,10,11,11,12,12,13,13, 0,
135.12989 +         0, 0, 0, 0,11,12,11,11,12,12,14,13, 0, 0, 0, 0,
135.12990 +         0,12,11,11,11,13,10,14,13,
135.12991 +};
135.12992 +
135.12993 +static const static_codebook _44c1_s_p7_0 = {
135.12994 +        2, 169,
135.12995 +        (long *)_vq_lengthlist__44c1_s_p7_0,
135.12996 +        1, -526516224, 1616117760, 4, 0,
135.12997 +        (long *)_vq_quantlist__44c1_s_p7_0,
135.12998 +        0
135.12999 +};
135.13000 +
135.13001 +static const long _vq_quantlist__44c1_s_p7_1[] = {
135.13002 +        2,
135.13003 +        1,
135.13004 +        3,
135.13005 +        0,
135.13006 +        4,
135.13007 +};
135.13008 +
135.13009 +static const long _vq_lengthlist__44c1_s_p7_1[] = {
135.13010 +         2, 3, 3, 5, 5, 6, 6, 6, 5, 5, 6, 6, 6, 5, 5, 6,
135.13011 +         6, 6, 5, 5, 6, 6, 6, 5, 5,
135.13012 +};
135.13013 +
135.13014 +static const static_codebook _44c1_s_p7_1 = {
135.13015 +        2, 25,
135.13016 +        (long *)_vq_lengthlist__44c1_s_p7_1,
135.13017 +        1, -533725184, 1611661312, 3, 0,
135.13018 +        (long *)_vq_quantlist__44c1_s_p7_1,
135.13019 +        0
135.13020 +};
135.13021 +
135.13022 +static const long _vq_quantlist__44c1_s_p8_0[] = {
135.13023 +        6,
135.13024 +        5,
135.13025 +        7,
135.13026 +        4,
135.13027 +        8,
135.13028 +        3,
135.13029 +        9,
135.13030 +        2,
135.13031 +        10,
135.13032 +        1,
135.13033 +        11,
135.13034 +        0,
135.13035 +        12,
135.13036 +};
135.13037 +
135.13038 +static const long _vq_lengthlist__44c1_s_p8_0[] = {
135.13039 +         1, 4, 3,10,10,10,10,10,10,10,10,10,10, 4, 8, 6,
135.13040 +        10,10,10,10,10,10,10,10,10,10, 4, 8, 7,10,10,10,
135.13041 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.13042 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.13043 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.13044 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.13045 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.13046 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.13047 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.13048 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
135.13049 +        10,10,10,10,10,10,10,10,10,
135.13050 +};
135.13051 +
135.13052 +static const static_codebook _44c1_s_p8_0 = {
135.13053 +        2, 169,
135.13054 +        (long *)_vq_lengthlist__44c1_s_p8_0,
135.13055 +        1, -514541568, 1627103232, 4, 0,
135.13056 +        (long *)_vq_quantlist__44c1_s_p8_0,
135.13057 +        0
135.13058 +};
135.13059 +
135.13060 +static const long _vq_quantlist__44c1_s_p8_1[] = {
135.13061 +        6,
135.13062 +        5,
135.13063 +        7,
135.13064 +        4,
135.13065 +        8,
135.13066 +        3,
135.13067 +        9,
135.13068 +        2,
135.13069 +        10,
135.13070 +        1,
135.13071 +        11,
135.13072 +        0,
135.13073 +        12,
135.13074 +};
135.13075 +
135.13076 +static const long _vq_lengthlist__44c1_s_p8_1[] = {
135.13077 +         1, 4, 4, 6, 5, 7, 7, 9, 9,10,10,12,12, 6, 5, 5,
135.13078 +         7, 7, 8, 8,10,10,12,11,12,12, 6, 5, 5, 7, 7, 8,
135.13079 +         8,10,10,11,11,12,12,15, 7, 7, 8, 8, 9, 9,11,11,
135.13080 +        12,12,13,12,15, 8, 8, 8, 7, 9, 9,10,10,12,12,13,
135.13081 +        13,16,11,10, 8, 8,10,10,11,11,12,12,13,13,16,11,
135.13082 +        11, 9, 8,11,10,11,11,12,12,13,12,16,16,16,10,11,
135.13083 +        10,11,12,12,12,12,13,13,16,16,16,11, 9,11, 9,14,
135.13084 +        12,12,12,13,13,16,16,16,12,14,11,12,12,12,13,13,
135.13085 +        14,13,16,16,16,15,13,12,10,13,10,13,14,13,13,16,
135.13086 +        16,16,16,16,13,14,12,13,13,12,13,13,16,16,16,16,
135.13087 +        16,13,12,12,11,14,12,15,13,
135.13088 +};
135.13089 +
135.13090 +static const static_codebook _44c1_s_p8_1 = {
135.13091 +        2, 169,
135.13092 +        (long *)_vq_lengthlist__44c1_s_p8_1,
135.13093 +        1, -522616832, 1620115456, 4, 0,
135.13094 +        (long *)_vq_quantlist__44c1_s_p8_1,
135.13095 +        0
135.13096 +};
135.13097 +
135.13098 +static const long _vq_quantlist__44c1_s_p8_2[] = {
135.13099 +        8,
135.13100 +        7,
135.13101 +        9,
135.13102 +        6,
135.13103 +        10,
135.13104 +        5,
135.13105 +        11,
135.13106 +        4,
135.13107 +        12,
135.13108 +        3,
135.13109 +        13,
135.13110 +        2,
135.13111 +        14,
135.13112 +        1,
135.13113 +        15,
135.13114 +        0,
135.13115 +        16,
135.13116 +};
135.13117 +
135.13118 +static const long _vq_lengthlist__44c1_s_p8_2[] = {
135.13119 +         2, 4, 4, 6, 6, 6, 6, 7, 7, 8, 8, 8, 8, 8, 8, 8,
135.13120 +         8,10,10,10, 7, 7, 7, 7, 8, 8, 9, 9, 9, 9, 9, 9,
135.13121 +         9, 9,10,10,10, 7, 7, 8, 7, 8, 8, 9, 9, 9, 9, 9,
135.13122 +         9, 9, 9,10,10,10, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9,
135.13123 +         9,10, 9, 9,10,10,10, 7, 7, 8, 8, 9, 8, 9, 9, 9,
135.13124 +         9,10, 9, 9,10,10,11,11, 8, 8, 8, 8, 9, 9, 9, 9,
135.13125 +         9, 9,10, 9, 9,10,10,10,10, 8, 8, 8, 8, 9, 9, 9,
135.13126 +         9, 9, 9, 9, 9,10,10,11,11,11, 8, 8, 9, 9, 9, 9,
135.13127 +         9, 9, 9, 9, 9, 9,10,10,10,10,11,11,11, 8, 8, 9,
135.13128 +         9, 9, 9,10, 9, 9, 9, 9, 9,11,11,11,11,11, 9, 9,
135.13129 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9,11,10,10,11,11, 9,
135.13130 +         9, 9, 9, 9, 9, 9, 9, 9,10,10,10,10,11,10,11,11,
135.13131 +         9, 9, 9, 9, 9, 9, 9, 9, 9,10,10, 9,10,10,11,11,
135.13132 +        11,11,11, 9, 9, 9,10, 9, 9, 9, 9, 9, 9,10,11,11,
135.13133 +        11,11,11,11,10,10,10,10, 9, 9, 9, 9, 9, 9,10,11,
135.13134 +        11,11,11,11,11, 9,10, 9, 9, 9, 9,10, 9, 9, 9,11,
135.13135 +        11,11,11,11,11,11,10,10, 9, 9, 9, 9, 9, 9,10, 9,
135.13136 +        11,11,10,11,11,11,11,10,11, 9, 9, 9, 9, 9, 9, 9,
135.13137 +         9,
135.13138 +};
135.13139 +
135.13140 +static const static_codebook _44c1_s_p8_2 = {
135.13141 +        2, 289,
135.13142 +        (long *)_vq_lengthlist__44c1_s_p8_2,
135.13143 +        1, -529530880, 1611661312, 5, 0,
135.13144 +        (long *)_vq_quantlist__44c1_s_p8_2,
135.13145 +        0
135.13146 +};
135.13147 +
135.13148 +static const long _huff_lengthlist__44c1_s_short[] = {
135.13149 +         6, 8,13,12,13,14,15,16,16, 4, 2, 4, 7, 6, 8,11,
135.13150 +        13,15,10, 4, 4, 8, 6, 8,11,14,17,11, 5, 6, 5, 6,
135.13151 +         8,12,14,17,11, 5, 5, 6, 5, 7,10,13,16,12, 6, 7,
135.13152 +         8, 7, 8,10,13,15,13, 8, 8, 7, 7, 8,10,12,15,15,
135.13153 +         7, 7, 5, 5, 7, 9,12,14,15, 8, 8, 6, 6, 7, 8,10,
135.13154 +        11,
135.13155 +};
135.13156 +
135.13157 +static const static_codebook _huff_book__44c1_s_short = {
135.13158 +        2, 81,
135.13159 +        (long *)_huff_lengthlist__44c1_s_short,
135.13160 +        0, 0, 0, 0, 0,
135.13161 +        NULL,
135.13162 +        0
135.13163 +};
135.13164 +
135.13165 +static const long _huff_lengthlist__44c1_sm_long[] = {
135.13166 +         5, 4, 8,10, 9, 9,10,11,12, 4, 2, 5, 6, 6, 8,10,
135.13167 +        11,13, 8, 4, 6, 8, 7, 9,12,12,14,10, 6, 8, 4, 5,
135.13168 +         6, 9,11,12, 9, 5, 6, 5, 5, 6, 9,11,11, 9, 7, 9,
135.13169 +         6, 5, 5, 7,10,10,10, 9,11, 8, 7, 6, 7, 9,11,11,
135.13170 +        12,13,10,10, 9, 8, 9,11,11,15,15,12,13,11, 9,10,
135.13171 +        11,
135.13172 +};
135.13173 +
135.13174 +static const static_codebook _huff_book__44c1_sm_long = {
135.13175 +        2, 81,
135.13176 +        (long *)_huff_lengthlist__44c1_sm_long,
135.13177 +        0, 0, 0, 0, 0,
135.13178 +        NULL,
135.13179 +        0
135.13180 +};
135.13181 +
135.13182 +static const long _vq_quantlist__44c1_sm_p1_0[] = {
135.13183 +        1,
135.13184 +        0,
135.13185 +        2,
135.13186 +};
135.13187 +
135.13188 +static const long _vq_lengthlist__44c1_sm_p1_0[] = {
135.13189 +         1, 5, 5, 0, 0, 0, 0, 0, 0, 5, 7, 7, 0, 0, 0, 0,
135.13190 +         0, 0, 5, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13191 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13192 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13193 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13194 +         0, 5, 8, 7, 0, 0, 0, 0, 0, 0, 7, 9, 9, 0, 0, 0,
135.13195 +         0, 0, 0, 7, 8, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13196 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13197 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13198 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13199 +         0, 0, 5, 7, 7, 0, 0, 0, 0, 0, 0, 7, 9, 8, 0, 0,
135.13200 +         0, 0, 0, 0, 7, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13201 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13202 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13203 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13204 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13205 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13206 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13207 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13208 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13209 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13210 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13211 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13212 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13213 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13214 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13215 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13216 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13217 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13218 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13219 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13220 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13221 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13222 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13223 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13224 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13225 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13226 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13227 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13228 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13229 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13230 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13231 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13232 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13233 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13234 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 8, 7, 0, 0, 0, 0,
135.13235 +         0, 0, 8, 9, 9, 0, 0, 0, 0, 0, 0, 8, 9, 9, 0, 0,
135.13236 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13237 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13238 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13239 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 9, 9, 0, 0, 0,
135.13240 +         0, 0, 0, 9, 9,10, 0, 0, 0, 0, 0, 0, 9,10,10, 0,
135.13241 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13242 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13243 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13244 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 9, 9, 0, 0,
135.13245 +         0, 0, 0, 0, 8,10, 9, 0, 0, 0, 0, 0, 0, 9,10,10,
135.13246 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13247 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13248 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13249 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13250 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13251 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13252 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13253 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13254 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13255 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13256 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13257 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13258 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13259 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13260 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13261 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13262 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13263 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13264 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13265 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13266 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13267 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13268 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13269 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13270 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13271 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13272 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13273 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13274 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13275 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13276 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13277 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13278 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13279 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13280 +         0, 0, 5, 7, 8, 0, 0, 0, 0, 0, 0, 8, 9, 9, 0, 0,
135.13281 +         0, 0, 0, 0, 8, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13282 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13283 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13284 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13285 +         0, 0, 0, 7, 9, 9, 0, 0, 0, 0, 0, 0, 9,10,10, 0,
135.13286 +         0, 0, 0, 0, 0, 8, 9,10, 0, 0, 0, 0, 0, 0, 0, 0,
135.13287 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13288 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13289 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13290 +         0, 0, 0, 0, 7, 9, 9, 0, 0, 0, 0, 0, 0, 9,10,10,
135.13291 +         0, 0, 0, 0, 0, 0, 9,10, 9, 0, 0, 0, 0, 0, 0, 0,
135.13292 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13293 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13294 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13295 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13296 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13297 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13298 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13299 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13300 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13301 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13302 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13303 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13304 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13305 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13306 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13307 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13308 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13309 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13310 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13311 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13312 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13313 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13314 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13315 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13316 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13317 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13318 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13319 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13320 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13321 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13322 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13323 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13324 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13325 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13326 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13327 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13328 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13329 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13330 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13331 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13332 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13333 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13334 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13335 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13336 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13337 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13338 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13339 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13340 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13341 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13342 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13343 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13344 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13345 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13346 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13347 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13348 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13349 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13350 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13351 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13352 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13353 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13354 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13355 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13356 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13357 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13358 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13359 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13360 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13361 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13362 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13363 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13364 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13365 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13366 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13367 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13368 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13369 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13370 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13371 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13372 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13373 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13374 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13375 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13376 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13377 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13378 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13379 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13380 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13381 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13382 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13383 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13384 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13385 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13386 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13387 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13388 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13389 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13390 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13391 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13392 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13393 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13394 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13395 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13396 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13397 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13398 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13399 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13400 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13401 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13402 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13403 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13404 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13405 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13406 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13407 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13408 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13409 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13410 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13411 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13412 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13413 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13414 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13415 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13416 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13417 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13418 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13419 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13420 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13421 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13422 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13423 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13424 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13425 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13426 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13427 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13428 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13429 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13430 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13431 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13432 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13433 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13434 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13435 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13436 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13437 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13438 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13439 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13440 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13441 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13442 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13443 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13444 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13445 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13446 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13447 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13448 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13449 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13450 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13451 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13452 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13453 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13454 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13455 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13456 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13457 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13458 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13459 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13460 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13461 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13462 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13463 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13464 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13465 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13466 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13467 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13468 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13469 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13470 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13471 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13472 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13473 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13474 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13475 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13476 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13477 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13478 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13479 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13480 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13481 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13482 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13483 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13484 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13485 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13486 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13487 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13488 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13489 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13490 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13491 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13492 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13493 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13494 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13495 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13496 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13497 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13498 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13499 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13500 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13501 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13502 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13503 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13504 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13505 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13506 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13507 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13508 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13509 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13510 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13511 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13512 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13513 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13514 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13515 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13516 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13517 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13518 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13519 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13520 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13521 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13522 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13523 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13524 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13525 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13526 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13527 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13528 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13529 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13530 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13531 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13532 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13533 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13534 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13535 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13536 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13537 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13538 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13539 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13540 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13541 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13542 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13543 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13544 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13545 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13546 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13547 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13548 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13549 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13550 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13551 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13552 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13553 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13554 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13555 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13556 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13557 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13558 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13559 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13560 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13561 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13562 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13563 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13564 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13565 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13566 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13567 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13568 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13569 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13570 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13571 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13572 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13573 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13574 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13575 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13576 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13577 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13578 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13579 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13580 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13581 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13582 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13583 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13584 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13585 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13586 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13587 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13588 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13589 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13590 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13591 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13592 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13593 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13594 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13595 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13596 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13597 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13598 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13599 +         0,
135.13600 +};
135.13601 +
135.13602 +static const static_codebook _44c1_sm_p1_0 = {
135.13603 +        8, 6561,
135.13604 +        (long *)_vq_lengthlist__44c1_sm_p1_0,
135.13605 +        1, -535822336, 1611661312, 2, 0,
135.13606 +        (long *)_vq_quantlist__44c1_sm_p1_0,
135.13607 +        0
135.13608 +};
135.13609 +
135.13610 +static const long _vq_quantlist__44c1_sm_p2_0[] = {
135.13611 +        2,
135.13612 +        1,
135.13613 +        3,
135.13614 +        0,
135.13615 +        4,
135.13616 +};
135.13617 +
135.13618 +static const long _vq_lengthlist__44c1_sm_p2_0[] = {
135.13619 +         2, 3, 4, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13620 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 6, 6, 0, 0,
135.13621 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13622 +         0, 0, 4, 4, 4, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13623 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 6, 9, 9,
135.13624 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13625 +         0, 0, 0, 0, 6, 6, 7, 9, 9, 0, 0, 0, 0, 0, 0, 0,
135.13626 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13627 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13628 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13629 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13630 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13631 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13632 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13633 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13634 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13635 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13636 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13637 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13638 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13639 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13640 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13641 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13642 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13643 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13644 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13645 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13646 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13647 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13648 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13649 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13650 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13651 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13652 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13653 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13654 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13655 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13656 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13657 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13658 +         0,
135.13659 +};
135.13660 +
135.13661 +static const static_codebook _44c1_sm_p2_0 = {
135.13662 +        4, 625,
135.13663 +        (long *)_vq_lengthlist__44c1_sm_p2_0,
135.13664 +        1, -533725184, 1611661312, 3, 0,
135.13665 +        (long *)_vq_quantlist__44c1_sm_p2_0,
135.13666 +        0
135.13667 +};
135.13668 +
135.13669 +static const long _vq_quantlist__44c1_sm_p3_0[] = {
135.13670 +        4,
135.13671 +        3,
135.13672 +        5,
135.13673 +        2,
135.13674 +        6,
135.13675 +        1,
135.13676 +        7,
135.13677 +        0,
135.13678 +        8,
135.13679 +};
135.13680 +
135.13681 +static const long _vq_lengthlist__44c1_sm_p3_0[] = {
135.13682 +         1, 3, 3, 7, 7, 0, 0, 0, 0, 0, 5, 5, 6, 6, 0, 0,
135.13683 +         0, 0, 0, 5, 5, 7, 7, 0, 0, 0, 0, 0, 7, 7, 7, 7,
135.13684 +         0, 0, 0, 0, 0, 0, 0, 7, 7, 0, 0, 0, 0, 0, 0, 0,
135.13685 +         8, 9, 0, 0, 0, 0, 0, 0, 0, 8, 8, 0, 0, 0, 0, 0,
135.13686 +         0, 0,10,10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.13687 +         0,
135.13688 +};
135.13689 +
135.13690 +static const static_codebook _44c1_sm_p3_0 = {
135.13691 +        2, 81,
135.13692 +        (long *)_vq_lengthlist__44c1_sm_p3_0,
135.13693 +        1, -531628032, 1611661312, 4, 0,
135.13694 +        (long *)_vq_quantlist__44c1_sm_p3_0,
135.13695 +        0
135.13696 +};
135.13697 +
135.13698 +static const long _vq_quantlist__44c1_sm_p4_0[] = {
135.13699 +        4,
135.13700 +        3,
135.13701 +        5,
135.13702 +        2,
135.13703 +        6,
135.13704 +        1,
135.13705 +        7,
135.13706 +        0,
135.13707 +        8,
135.13708 +};
135.13709 +
135.13710 +static const long _vq_lengthlist__44c1_sm_p4_0[] = {
135.13711 +         1, 3, 3, 6, 6, 7, 7, 9, 9, 0, 6, 6, 7, 7, 8, 8,
135.13712 +         9, 9, 0, 6, 6, 7, 7, 8, 8, 9, 9, 0, 7, 7, 8, 8,
135.13713 +         8, 8,10,10, 0, 0, 0, 8, 8, 8, 8,10,10, 0, 0, 0,
135.13714 +         8, 8, 9, 9,11,11, 0, 0, 0, 9, 9, 9, 9,11,11, 0,
135.13715 +         0, 0,10,10,10,10,11,11, 0, 0, 0, 0, 0, 9, 9,11,
135.13716 +        11,
135.13717 +};
135.13718 +
135.13719 +static const static_codebook _44c1_sm_p4_0 = {
135.13720 +        2, 81,
135.13721 +        (long *)_vq_lengthlist__44c1_sm_p4_0,
135.13722 +        1, -531628032, 1611661312, 4, 0,
135.13723 +        (long *)_vq_quantlist__44c1_sm_p4_0,
135.13724 +        0
135.13725 +};
135.13726 +
135.13727 +static const long _vq_quantlist__44c1_sm_p5_0[] = {
135.13728 +        8,
135.13729 +        7,
135.13730 +        9,
135.13731 +        6,
135.13732 +        10,
135.13733 +        5,
135.13734 +        11,
135.13735 +        4,
135.13736 +        12,
135.13737 +        3,
135.13738 +        13,
135.13739 +        2,
135.13740 +        14,
135.13741 +        1,
135.13742 +        15,
135.13743 +        0,
135.13744 +        16,
135.13745 +};
135.13746 +
135.13747 +static const long _vq_lengthlist__44c1_sm_p5_0[] = {
135.13748 +         2, 3, 3, 6, 6, 7, 7, 8, 8, 8, 8, 9, 9,10,10,11,
135.13749 +        11, 0, 5, 5, 6, 6, 8, 8, 9, 9, 9, 9,10,10,10,10,
135.13750 +        11,11, 0, 5, 5, 6, 6, 8, 8, 9, 9, 9, 9,10,10,10,
135.13751 +        10,11,11, 0, 7, 7, 7, 7, 8, 8, 9, 9, 9, 9,10,10,
135.13752 +        11,11,12,12, 0, 0, 0, 7, 7, 8, 8, 9, 9, 9, 9,10,
135.13753 +        10,11,11,12,12, 0, 0, 0, 8, 8, 8, 8, 9, 9,10,10,
135.13754 +        10,11,11,11,12,12, 0, 0, 0, 8, 8, 8, 8, 9, 9,10,
135.13755 +        10,10,10,11,11,12,12, 0, 0, 0, 9, 9, 9, 9,10,10,
135.13756 +        10,10,11,11,12,12,12,12, 0, 0, 0, 0, 0, 9, 9,10,
135.13757 +        10,10,10,11,11,12,12,13,13, 0, 0, 0, 0, 0, 9, 9,
135.13758 +         9, 9,10,10,11,11,12,12,13,13, 0, 0, 0, 0, 0, 9,
135.13759 +         9, 9, 9,10,10,11,11,12,12,13,13, 0, 0, 0, 0, 0,
135.13760 +         9, 9,10,10,11,11,12,12,12,12,13,13, 0, 0, 0, 0,
135.13761 +         0, 0, 0,10,10,11,11,12,12,12,12,13,13, 0, 0, 0,
135.13762 +         0, 0, 0, 0,11,11,11,11,12,12,13,13,13,13, 0, 0,
135.13763 +         0, 0, 0, 0, 0,11,11,11,11,12,12,13,13,13,13, 0,
135.13764 +         0, 0, 0, 0, 0, 0,11,11,12,12,12,12,13,13,14,14,
135.13765 +         0, 0, 0, 0, 0, 0, 0, 0, 0,12,12,12,12,13,13,14,
135.13766 +        14,
135.13767 +};
135.13768 +
135.13769 +static const static_codebook _44c1_sm_p5_0 = {
135.13770 +        2, 289,
135.13771 +        (long *)_vq_lengthlist__44c1_sm_p5_0,
135.13772 +        1, -529530880, 1611661312, 5, 0,
135.13773 +        (long *)_vq_quantlist__44c1_sm_p5_0,
135.13774 +        0
135.13775 +};
135.13776 +
135.13777 +static const long _vq_quantlist__44c1_sm_p6_0[] = {
135.13778 +        1,
135.13779 +        0,
135.13780 +        2,
135.13781 +};
135.13782 +
135.13783 +static const long _vq_lengthlist__44c1_sm_p6_0[] = {
135.13784 +         1, 4, 4, 7, 6, 6, 7, 6, 6, 4, 7, 7,10, 9, 9,11,
135.13785 +         9, 9, 4, 7, 7,10, 9, 9,11, 9, 9, 7,10,10,10,11,
135.13786 +        11,11,10,10, 6, 9, 9,11,11,10,11,10,10, 6, 9, 9,
135.13787 +        11,10,11,11,10,10, 7,11,11,11,11,11,11,11,11, 6,
135.13788 +         9, 9,11,10,10,11,11,10, 6, 9, 9,10,10,10,11,10,
135.13789 +        11,
135.13790 +};
135.13791 +
135.13792 +static const static_codebook _44c1_sm_p6_0 = {
135.13793 +        4, 81,
135.13794 +        (long *)_vq_lengthlist__44c1_sm_p6_0,
135.13795 +        1, -529137664, 1618345984, 2, 0,
135.13796 +        (long *)_vq_quantlist__44c1_sm_p6_0,
135.13797 +        0
135.13798 +};
135.13799 +
135.13800 +static const long _vq_quantlist__44c1_sm_p6_1[] = {
135.13801 +        5,
135.13802 +        4,
135.13803 +        6,
135.13804 +        3,
135.13805 +        7,
135.13806 +        2,
135.13807 +        8,
135.13808 +        1,
135.13809 +        9,
135.13810 +        0,
135.13811 +        10,
135.13812 +};
135.13813 +
135.13814 +static const long _vq_lengthlist__44c1_sm_p6_1[] = {
135.13815 +         2, 4, 4, 6, 6, 7, 7, 7, 7, 8, 8,10, 5, 5, 6, 6,
135.13816 +         7, 7, 8, 8, 8, 8,10, 5, 5, 6, 6, 7, 7, 8, 8, 8,
135.13817 +         8,10, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8,10,10,10, 7,
135.13818 +         7, 7, 7, 8, 8, 8, 8,10,10,10, 7, 7, 8, 8, 8, 8,
135.13819 +         8, 8,10,10,10, 7, 7, 8, 8, 8, 8, 8, 8,10,10,10,
135.13820 +         8, 8, 8, 8, 8, 8, 9, 8,10,10,10,10,10, 8, 8, 8,
135.13821 +         8, 8, 8,10,10,10,10,10, 9, 9, 8, 8, 8, 8,10,10,
135.13822 +        10,10,10, 8, 8, 8, 8, 8, 8,
135.13823 +};
135.13824 +
135.13825 +static const static_codebook _44c1_sm_p6_1 = {
135.13826 +        2, 121,
135.13827 +        (long *)_vq_lengthlist__44c1_sm_p6_1,
135.13828 +        1, -531365888, 1611661312, 4, 0,
135.13829 +        (long *)_vq_quantlist__44c1_sm_p6_1,
135.13830 +        0
135.13831 +};
135.13832 +
135.13833 +static const long _vq_quantlist__44c1_sm_p7_0[] = {
135.13834 +        6,
135.13835 +        5,
135.13836 +        7,
135.13837 +        4,
135.13838 +        8,
135.13839 +        3,
135.13840 +        9,
135.13841 +        2,
135.13842 +        10,
135.13843 +        1,
135.13844 +        11,
135.13845 +        0,
135.13846 +        12,
135.13847 +};
135.13848 +
135.13849 +static const long _vq_lengthlist__44c1_sm_p7_0[] = {
135.13850 +         1, 4, 4, 6, 6, 7, 7, 7, 7, 8, 8, 9, 9, 7, 5, 5,
135.13851 +         7, 7, 8, 8, 8, 8, 9, 9,10,10, 7, 5, 6, 7, 7, 8,
135.13852 +         8, 8, 8, 9, 9,11,10, 0, 8, 8, 8, 8, 9, 9, 9, 9,
135.13853 +        10,10,11,11, 0, 8, 8, 8, 8, 9, 9, 9, 9,10,10,11,
135.13854 +        11, 0,12,12, 9, 9,10,10,10,10,11,11,11,11, 0,13,
135.13855 +        13, 9, 9, 9, 9,10,10,11,11,12,12, 0, 0, 0, 9,10,
135.13856 +         9,10,11,11,12,11,13,12, 0, 0, 0,10,10, 9, 9,11,
135.13857 +        11,12,12,13,12, 0, 0, 0,13,13,10,10,11,11,12,12,
135.13858 +        13,13, 0, 0, 0,14,14,10,10,11,11,12,12,13,13, 0,
135.13859 +         0, 0, 0, 0,11,12,11,11,12,13,14,13, 0, 0, 0, 0,
135.13860 +         0,12,12,11,11,13,12,14,13,
135.13861 +};
135.13862 +
135.13863 +static const static_codebook _44c1_sm_p7_0 = {
135.13864 +        2, 169,
135.13865 +        (long *)_vq_lengthlist__44c1_sm_p7_0,
135.13866 +        1, -526516224, 1616117760, 4, 0,
135.13867 +        (long *)_vq_quantlist__44c1_sm_p7_0,
135.13868 +        0
135.13869 +};
135.13870 +
135.13871 +static const long _vq_quantlist__44c1_sm_p7_1[] = {
135.13872 +        2,
135.13873 +        1,
135.13874 +        3,
135.13875 +        0,
135.13876 +        4,
135.13877 +};
135.13878 +
135.13879 +static const long _vq_lengthlist__44c1_sm_p7_1[] = {
135.13880 +         2, 4, 4, 4, 5, 6, 5, 5, 5, 5, 6, 5, 5, 5, 5, 6,
135.13881 +         5, 5, 5, 5, 6, 6, 6, 5, 5,
135.13882 +};
135.13883 +
135.13884 +static const static_codebook _44c1_sm_p7_1 = {
135.13885 +        2, 25,
135.13886 +        (long *)_vq_lengthlist__44c1_sm_p7_1,
135.13887 +        1, -533725184, 1611661312, 3, 0,
135.13888 +        (long *)_vq_quantlist__44c1_sm_p7_1,
135.13889 +        0
135.13890 +};
135.13891 +
135.13892 +static const long _vq_quantlist__44c1_sm_p8_0[] = {
135.13893 +        6,
135.13894 +        5,
135.13895 +        7,
135.13896 +        4,
135.13897 +        8,
135.13898 +        3,
135.13899 +        9,
135.13900 +        2,
135.13901 +        10,
135.13902 +        1,
135.13903 +        11,
135.13904 +        0,
135.13905 +        12,
135.13906 +};
135.13907 +
135.13908 +static const long _vq_lengthlist__44c1_sm_p8_0[] = {
135.13909 +         1, 3, 3,13,13,13,13,13,13,13,13,13,13, 3, 6, 6,
135.13910 +        13,13,13,13,13,13,13,13,13,13, 4, 8, 7,13,13,13,
135.13911 +        13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
135.13912 +        13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
135.13913 +        13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
135.13914 +        13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
135.13915 +        13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
135.13916 +        13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
135.13917 +        13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
135.13918 +        13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
135.13919 +        13,13,13,13,13,13,13,13,13,
135.13920 +};
135.13921 +
135.13922 +static const static_codebook _44c1_sm_p8_0 = {
135.13923 +        2, 169,
135.13924 +        (long *)_vq_lengthlist__44c1_sm_p8_0,
135.13925 +        1, -514541568, 1627103232, 4, 0,
135.13926 +        (long *)_vq_quantlist__44c1_sm_p8_0,
135.13927 +        0
135.13928 +};
135.13929 +
135.13930 +static const long _vq_quantlist__44c1_sm_p8_1[] = {
135.13931 +        6,
135.13932 +        5,
135.13933 +        7,
135.13934 +        4,
135.13935 +        8,
135.13936 +        3,
135.13937 +        9,
135.13938 +        2,
135.13939 +        10,
135.13940 +        1,
135.13941 +        11,
135.13942 +        0,
135.13943 +        12,
135.13944 +};
135.13945 +
135.13946 +static const long _vq_lengthlist__44c1_sm_p8_1[] = {
135.13947 +         1, 4, 4, 6, 6, 7, 7, 9, 9,10,11,12,12, 6, 5, 5,
135.13948 +         7, 7, 8, 7,10,10,11,11,12,12, 6, 5, 5, 7, 7, 8,
135.13949 +         8,10,10,11,11,12,12,16, 7, 7, 8, 8, 9, 9,11,11,
135.13950 +        12,12,13,13,17, 7, 7, 8, 7, 9, 9,11,10,12,12,13,
135.13951 +        13,19,11,10, 8, 8,10,10,11,11,12,12,13,13,19,11,
135.13952 +        11, 9, 7,11,10,11,11,12,12,13,12,19,19,19,10,10,
135.13953 +        10,10,11,12,12,12,13,14,18,19,19,11, 9,11, 9,13,
135.13954 +        12,12,12,13,13,19,20,19,13,15,11,11,12,12,13,13,
135.13955 +        14,13,18,19,20,15,13,12,10,13,10,13,13,13,14,20,
135.13956 +        20,20,20,20,13,14,12,12,13,12,13,13,20,20,20,20,
135.13957 +        20,13,12,12,12,14,12,14,13,
135.13958 +};
135.13959 +
135.13960 +static const static_codebook _44c1_sm_p8_1 = {
135.13961 +        2, 169,
135.13962 +        (long *)_vq_lengthlist__44c1_sm_p8_1,
135.13963 +        1, -522616832, 1620115456, 4, 0,
135.13964 +        (long *)_vq_quantlist__44c1_sm_p8_1,
135.13965 +        0
135.13966 +};
135.13967 +
135.13968 +static const long _vq_quantlist__44c1_sm_p8_2[] = {
135.13969 +        8,
135.13970 +        7,
135.13971 +        9,
135.13972 +        6,
135.13973 +        10,
135.13974 +        5,
135.13975 +        11,
135.13976 +        4,
135.13977 +        12,
135.13978 +        3,
135.13979 +        13,
135.13980 +        2,
135.13981 +        14,
135.13982 +        1,
135.13983 +        15,
135.13984 +        0,
135.13985 +        16,
135.13986 +};
135.13987 +
135.13988 +static const long _vq_lengthlist__44c1_sm_p8_2[] = {
135.13989 +         2, 5, 5, 6, 6, 7, 6, 7, 7, 8, 8, 8, 8, 8, 8, 8,
135.13990 +         8,10, 6, 6, 7, 7, 7, 7, 8, 8, 9, 9, 9, 9, 9, 9,
135.13991 +         9, 9,10, 6, 6, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9,
135.13992 +         9, 9, 9,10, 7, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9,
135.13993 +         9, 9, 9, 9,10,10,10, 7, 7, 8, 8, 9, 9, 9, 9, 9,
135.13994 +         9, 9, 9, 9, 9,10,11,11, 8, 8, 8, 8, 9, 9, 9, 9,
135.13995 +         9, 9,10,10, 9,10,10,10,10, 8, 8, 8, 8, 9, 9, 9,
135.13996 +         9, 9, 9, 9, 9,10,10,11,10,10, 8, 8, 9, 9, 9, 9,
135.13997 +         9, 9, 9, 9, 9, 9,10, 9,10,10,10,11,11, 8, 8, 9,
135.13998 +         9, 9, 9, 9, 9, 9, 9, 9, 9,11,11,11,11,11, 9, 9,
135.13999 +         9, 9, 9, 9, 9, 9,10, 9,10, 9,11,11,11,11,11, 9,
135.14000 +         8, 9, 9, 9, 9, 9, 9, 9,10,10, 9,11,11,10,11,11,
135.14001 +         9, 9, 9, 9, 9, 9, 9, 9, 9,10,10, 9,11,11,11,11,
135.14002 +        11,11,11, 9, 9,10, 9, 9, 9, 9,10, 9,10,10,11,10,
135.14003 +        11,11,11,11, 9,10,10,10, 9, 9, 9, 9, 9, 9,10,11,
135.14004 +        11,11,11,11,11, 9, 9, 9, 9, 9, 9, 9, 9,10, 9,11,
135.14005 +        11,10,11,11,11,11,10,10, 9, 9, 9, 9, 9, 9,10, 9,
135.14006 +        10,11,10,11,11,11,11,11,11, 9, 9,10, 9, 9, 9, 9,
135.14007 +         9,
135.14008 +};
135.14009 +
135.14010 +static const static_codebook _44c1_sm_p8_2 = {
135.14011 +        2, 289,
135.14012 +        (long *)_vq_lengthlist__44c1_sm_p8_2,
135.14013 +        1, -529530880, 1611661312, 5, 0,
135.14014 +        (long *)_vq_quantlist__44c1_sm_p8_2,
135.14015 +        0
135.14016 +};
135.14017 +
135.14018 +static const long _huff_lengthlist__44c1_sm_short[] = {
135.14019 +         4, 7,13,14,14,15,16,18,18, 4, 2, 5, 8, 7, 9,12,
135.14020 +        15,15,10, 4, 5,10, 6, 8,11,15,17,12, 5, 7, 5, 6,
135.14021 +         8,11,14,17,11, 5, 6, 6, 5, 6, 9,13,17,12, 6, 7,
135.14022 +         6, 5, 6, 8,12,14,14, 7, 8, 6, 6, 7, 9,11,14,14,
135.14023 +         8, 9, 6, 5, 6, 9,11,13,16,10,10, 7, 6, 7, 8,10,
135.14024 +        11,
135.14025 +};
135.14026 +
135.14027 +static const static_codebook _huff_book__44c1_sm_short = {
135.14028 +        2, 81,
135.14029 +        (long *)_huff_lengthlist__44c1_sm_short,
135.14030 +        0, 0, 0, 0, 0,
135.14031 +        NULL,
135.14032 +        0
135.14033 +};
135.14034 +
135.14035 +static const long _huff_lengthlist__44cn1_s_long[] = {
135.14036 +         4, 4, 7, 8, 7, 8,10,12,17, 3, 1, 6, 6, 7, 8,10,
135.14037 +        12,15, 7, 6, 9, 9, 9,11,12,14,17, 8, 6, 9, 6, 7,
135.14038 +         9,11,13,17, 7, 6, 9, 7, 7, 8, 9,12,15, 8, 8,10,
135.14039 +         8, 7, 7, 7,10,14, 9,10,12,10, 8, 8, 8,10,14,11,
135.14040 +        13,15,13,12,11,11,12,16,17,18,18,19,20,18,16,16,
135.14041 +        20,
135.14042 +};
135.14043 +
135.14044 +static const static_codebook _huff_book__44cn1_s_long = {
135.14045 +        2, 81,
135.14046 +        (long *)_huff_lengthlist__44cn1_s_long,
135.14047 +        0, 0, 0, 0, 0,
135.14048 +        NULL,
135.14049 +        0
135.14050 +};
135.14051 +
135.14052 +static const long _vq_quantlist__44cn1_s_p1_0[] = {
135.14053 +        1,
135.14054 +        0,
135.14055 +        2,
135.14056 +};
135.14057 +
135.14058 +static const long _vq_lengthlist__44cn1_s_p1_0[] = {
135.14059 +         1, 4, 4, 0, 0, 0, 0, 0, 0, 5, 7, 7, 0, 0, 0, 0,
135.14060 +         0, 0, 5, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14061 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14062 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14063 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14064 +         0, 5, 8, 8, 0, 0, 0, 0, 0, 0, 8, 9, 9, 0, 0, 0,
135.14065 +         0, 0, 0, 7, 9,10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14066 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14067 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14068 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14069 +         0, 0, 5, 8, 8, 0, 0, 0, 0, 0, 0, 7,10, 9, 0, 0,
135.14070 +         0, 0, 0, 0, 8,10, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14071 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14072 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14073 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14074 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14075 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14076 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14077 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14078 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14079 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14080 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14081 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14082 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14083 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14084 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14085 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14086 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14087 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14088 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14089 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14090 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14091 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14092 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14093 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14094 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14095 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14096 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14097 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14098 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14099 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14100 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14101 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14102 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14103 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14104 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 8, 8, 0, 0, 0, 0,
135.14105 +         0, 0, 8,10,10, 0, 0, 0, 0, 0, 0, 8, 9,10, 0, 0,
135.14106 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14107 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14108 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14109 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7,10,10, 0, 0, 0,
135.14110 +         0, 0, 0, 9, 9,11, 0, 0, 0, 0, 0, 0,10,11,11, 0,
135.14111 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14112 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14113 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14114 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7,10,10, 0, 0,
135.14115 +         0, 0, 0, 0, 9,11, 9, 0, 0, 0, 0, 0, 0,10,11,11,
135.14116 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14117 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14118 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14119 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14120 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14121 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14122 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14123 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14124 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14125 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14126 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14127 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14128 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14129 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14130 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14131 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14132 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14133 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14134 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14135 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14136 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14137 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14138 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14139 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14140 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14141 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14142 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14143 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14144 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14145 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14146 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14147 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14148 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14149 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14150 +         0, 0, 5, 8, 8, 0, 0, 0, 0, 0, 0, 8,10,10, 0, 0,
135.14151 +         0, 0, 0, 0, 8,10,10, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14152 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14153 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14154 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14155 +         0, 0, 0, 7,10,10, 0, 0, 0, 0, 0, 0,10,11,11, 0,
135.14156 +         0, 0, 0, 0, 0, 9, 9,11, 0, 0, 0, 0, 0, 0, 0, 0,
135.14157 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14158 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14159 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14160 +         0, 0, 0, 0, 7,10,10, 0, 0, 0, 0, 0, 0,10,11,11,
135.14161 +         0, 0, 0, 0, 0, 0, 9,11, 9, 0, 0, 0, 0, 0, 0, 0,
135.14162 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14163 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14164 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14165 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14166 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14167 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14168 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14169 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14170 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14171 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14172 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14173 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14174 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14175 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14176 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14177 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14178 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14179 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14180 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14181 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14182 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14183 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14184 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14185 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14186 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14187 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14188 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14189 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14190 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14191 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14192 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14193 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14194 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14195 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14196 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14197 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14198 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14199 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14200 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14201 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14202 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14203 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14204 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14205 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14206 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14207 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14208 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14209 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14210 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14211 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14212 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14213 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14214 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14215 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14216 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14217 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14218 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14219 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14220 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14221 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14222 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14223 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14224 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14225 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14226 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14227 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14228 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14229 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14230 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14231 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14232 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14233 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14234 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14235 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14236 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14237 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14238 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14239 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14240 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14241 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14242 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14243 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14244 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14245 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14246 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14247 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14248 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14249 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14250 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14251 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14252 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14253 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14254 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14255 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14256 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14257 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14258 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14259 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14260 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14261 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14262 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14263 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14264 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14265 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14266 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14267 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14268 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14269 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14270 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14271 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14272 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14273 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14274 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14275 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14276 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14277 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14278 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14279 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14280 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14281 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14282 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14283 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14284 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14285 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14286 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14287 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14288 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14289 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14290 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14291 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14292 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14293 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14294 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14295 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14296 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14297 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14298 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14299 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14300 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14301 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14302 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14303 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14304 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14305 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14306 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14307 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14308 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14309 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14310 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14311 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14312 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14313 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14314 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14315 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14316 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14317 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14318 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14319 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14320 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14321 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14322 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14323 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14324 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14325 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14326 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14327 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14328 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14329 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14330 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14331 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14332 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14333 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14334 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14335 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14336 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14337 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14338 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14339 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14340 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14341 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14342 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14343 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14344 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14345 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14346 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14347 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14348 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14349 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14350 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14351 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14352 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14353 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14354 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14355 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14356 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14357 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14358 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14359 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14360 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14361 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14362 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14363 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14364 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14365 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14366 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14367 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14368 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14369 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14370 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14371 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14372 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14373 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14374 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14375 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14376 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14377 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14378 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14379 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14380 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14381 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14382 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14383 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14384 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14385 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14386 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14387 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14388 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14389 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14390 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14391 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14392 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14393 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14394 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14395 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14396 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14397 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14398 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14399 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14400 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14401 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14402 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14403 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14404 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14405 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14406 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14407 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14408 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14409 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14410 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14411 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14412 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14413 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14414 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14415 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14416 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14417 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14418 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14419 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14420 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14421 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14422 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14423 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14424 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14425 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14426 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14427 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14428 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14429 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14430 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14431 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14432 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14433 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14434 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14435 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14436 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14437 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14438 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14439 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14440 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14441 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14442 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14443 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14444 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14445 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14446 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14447 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14448 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14449 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14450 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14451 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14452 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14453 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14454 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14455 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14456 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14457 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14458 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14459 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14460 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14461 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14462 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14463 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14464 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14465 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14466 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14467 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14468 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14469 +         0,
135.14470 +};
135.14471 +
135.14472 +static const static_codebook _44cn1_s_p1_0 = {
135.14473 +        8, 6561,
135.14474 +        (long *)_vq_lengthlist__44cn1_s_p1_0,
135.14475 +        1, -535822336, 1611661312, 2, 0,
135.14476 +        (long *)_vq_quantlist__44cn1_s_p1_0,
135.14477 +        0
135.14478 +};
135.14479 +
135.14480 +static const long _vq_quantlist__44cn1_s_p2_0[] = {
135.14481 +        2,
135.14482 +        1,
135.14483 +        3,
135.14484 +        0,
135.14485 +        4,
135.14486 +};
135.14487 +
135.14488 +static const long _vq_lengthlist__44cn1_s_p2_0[] = {
135.14489 +         1, 4, 4, 7, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14490 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, 5, 7, 7, 0, 0,
135.14491 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14492 +         0, 0, 4, 5, 5, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14493 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7, 7, 9, 9,
135.14494 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14495 +         0, 0, 0, 0, 6, 7, 7, 9, 9, 0, 0, 0, 0, 0, 0, 0,
135.14496 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14497 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14498 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14499 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14500 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14501 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14502 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14503 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14504 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14505 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14506 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14507 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14508 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14509 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14510 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14511 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14512 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14513 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14514 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14515 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14516 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14517 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14518 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14519 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14520 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14521 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14522 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14523 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14524 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14525 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14526 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14527 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14528 +         0,
135.14529 +};
135.14530 +
135.14531 +static const static_codebook _44cn1_s_p2_0 = {
135.14532 +        4, 625,
135.14533 +        (long *)_vq_lengthlist__44cn1_s_p2_0,
135.14534 +        1, -533725184, 1611661312, 3, 0,
135.14535 +        (long *)_vq_quantlist__44cn1_s_p2_0,
135.14536 +        0
135.14537 +};
135.14538 +
135.14539 +static const long _vq_quantlist__44cn1_s_p3_0[] = {
135.14540 +        4,
135.14541 +        3,
135.14542 +        5,
135.14543 +        2,
135.14544 +        6,
135.14545 +        1,
135.14546 +        7,
135.14547 +        0,
135.14548 +        8,
135.14549 +};
135.14550 +
135.14551 +static const long _vq_lengthlist__44cn1_s_p3_0[] = {
135.14552 +         1, 2, 3, 7, 7, 0, 0, 0, 0, 0, 0, 0, 6, 6, 0, 0,
135.14553 +         0, 0, 0, 0, 0, 6, 6, 0, 0, 0, 0, 0, 0, 0, 7, 7,
135.14554 +         0, 0, 0, 0, 0, 0, 0, 7, 7, 0, 0, 0, 0, 0, 0, 0,
135.14555 +         9, 8, 0, 0, 0, 0, 0, 0, 0, 8, 8, 0, 0, 0, 0, 0,
135.14556 +         0, 0,10,10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14557 +         0,
135.14558 +};
135.14559 +
135.14560 +static const static_codebook _44cn1_s_p3_0 = {
135.14561 +        2, 81,
135.14562 +        (long *)_vq_lengthlist__44cn1_s_p3_0,
135.14563 +        1, -531628032, 1611661312, 4, 0,
135.14564 +        (long *)_vq_quantlist__44cn1_s_p3_0,
135.14565 +        0
135.14566 +};
135.14567 +
135.14568 +static const long _vq_quantlist__44cn1_s_p4_0[] = {
135.14569 +        4,
135.14570 +        3,
135.14571 +        5,
135.14572 +        2,
135.14573 +        6,
135.14574 +        1,
135.14575 +        7,
135.14576 +        0,
135.14577 +        8,
135.14578 +};
135.14579 +
135.14580 +static const long _vq_lengthlist__44cn1_s_p4_0[] = {
135.14581 +         1, 3, 3, 6, 6, 6, 6, 8, 8, 0, 0, 0, 6, 6, 7, 7,
135.14582 +         9, 9, 0, 0, 0, 6, 6, 7, 7, 9, 9, 0, 0, 0, 7, 7,
135.14583 +         8, 8,10,10, 0, 0, 0, 7, 7, 8, 8,10,10, 0, 0, 0,
135.14584 +         9, 9, 9, 9,10,10, 0, 0, 0, 9, 9, 9, 9,10,10, 0,
135.14585 +         0, 0,10,10,10,10,11,11, 0, 0, 0, 0, 0,10,10,11,
135.14586 +        11,
135.14587 +};
135.14588 +
135.14589 +static const static_codebook _44cn1_s_p4_0 = {
135.14590 +        2, 81,
135.14591 +        (long *)_vq_lengthlist__44cn1_s_p4_0,
135.14592 +        1, -531628032, 1611661312, 4, 0,
135.14593 +        (long *)_vq_quantlist__44cn1_s_p4_0,
135.14594 +        0
135.14595 +};
135.14596 +
135.14597 +static const long _vq_quantlist__44cn1_s_p5_0[] = {
135.14598 +        8,
135.14599 +        7,
135.14600 +        9,
135.14601 +        6,
135.14602 +        10,
135.14603 +        5,
135.14604 +        11,
135.14605 +        4,
135.14606 +        12,
135.14607 +        3,
135.14608 +        13,
135.14609 +        2,
135.14610 +        14,
135.14611 +        1,
135.14612 +        15,
135.14613 +        0,
135.14614 +        16,
135.14615 +};
135.14616 +
135.14617 +static const long _vq_lengthlist__44cn1_s_p5_0[] = {
135.14618 +         1, 4, 3, 6, 6, 7, 7, 8, 8, 8, 8, 9, 9,10,10,10,
135.14619 +        10, 0, 0, 0, 7, 7, 8, 8, 9, 9, 9, 9,10,10,10,10,
135.14620 +        11,11, 0, 0, 0, 7, 7, 8, 8, 9, 9, 9, 9,10,10,10,
135.14621 +        10,11,11, 0, 0, 0, 7, 7, 8, 8, 9, 9, 9, 9,10,10,
135.14622 +        11,11,11,12, 0, 0, 0, 7, 7, 8, 8, 9, 9, 9, 9,10,
135.14623 +        10,11,11,11,11, 0, 0, 0, 8, 8, 9, 9, 9, 9,10,10,
135.14624 +        10,10,11,11,12,12, 0, 0, 0, 8, 8, 9, 9, 9, 9,10,
135.14625 +        10,10,11,11,11,12,12, 0, 0, 0, 9, 9,10, 9,10,10,
135.14626 +        10,10,11,11,11,11,12,12, 0, 0, 0, 0, 0, 9, 9,10,
135.14627 +        10,10,10,11,11,12,12,12,12, 0, 0, 0, 0, 0, 9, 9,
135.14628 +        10,10,10,11,11,11,12,12,13,13, 0, 0, 0, 0, 0, 9,
135.14629 +         9,10,10,10,10,11,11,12,12,13,13, 0, 0, 0, 0, 0,
135.14630 +        10,10,11,10,11,11,11,12,13,12,13,13, 0, 0, 0, 0,
135.14631 +         0, 0, 0,11,10,11,11,12,12,12,12,13,13, 0, 0, 0,
135.14632 +         0, 0, 0, 0,11,11,12,12,12,12,13,13,13,14, 0, 0,
135.14633 +         0, 0, 0, 0, 0,11,11,12,12,12,12,13,13,13,14, 0,
135.14634 +         0, 0, 0, 0, 0, 0,12,12,12,13,13,13,13,13,14,14,
135.14635 +         0, 0, 0, 0, 0, 0, 0, 0, 0,12,12,13,12,13,13,14,
135.14636 +        14,
135.14637 +};
135.14638 +
135.14639 +static const static_codebook _44cn1_s_p5_0 = {
135.14640 +        2, 289,
135.14641 +        (long *)_vq_lengthlist__44cn1_s_p5_0,
135.14642 +        1, -529530880, 1611661312, 5, 0,
135.14643 +        (long *)_vq_quantlist__44cn1_s_p5_0,
135.14644 +        0
135.14645 +};
135.14646 +
135.14647 +static const long _vq_quantlist__44cn1_s_p6_0[] = {
135.14648 +        1,
135.14649 +        0,
135.14650 +        2,
135.14651 +};
135.14652 +
135.14653 +static const long _vq_lengthlist__44cn1_s_p6_0[] = {
135.14654 +         1, 4, 4, 7, 6, 6, 7, 6, 6, 4, 6, 6,10, 9, 9,11,
135.14655 +         9, 9, 4, 6, 6,10, 9, 9,10, 9, 9, 7,10,10,11,11,
135.14656 +        11,12,11,11, 7, 9, 9,11,11,10,11,10,10, 7, 9, 9,
135.14657 +        11,10,11,11,10,10, 7,10,10,11,11,11,12,11,11, 7,
135.14658 +         9, 9,11,10,10,11,10,10, 7, 9, 9,11,10,10,11,10,
135.14659 +        10,
135.14660 +};
135.14661 +
135.14662 +static const static_codebook _44cn1_s_p6_0 = {
135.14663 +        4, 81,
135.14664 +        (long *)_vq_lengthlist__44cn1_s_p6_0,
135.14665 +        1, -529137664, 1618345984, 2, 0,
135.14666 +        (long *)_vq_quantlist__44cn1_s_p6_0,
135.14667 +        0
135.14668 +};
135.14669 +
135.14670 +static const long _vq_quantlist__44cn1_s_p6_1[] = {
135.14671 +        5,
135.14672 +        4,
135.14673 +        6,
135.14674 +        3,
135.14675 +        7,
135.14676 +        2,
135.14677 +        8,
135.14678 +        1,
135.14679 +        9,
135.14680 +        0,
135.14681 +        10,
135.14682 +};
135.14683 +
135.14684 +static const long _vq_lengthlist__44cn1_s_p6_1[] = {
135.14685 +         1, 4, 4, 6, 6, 7, 7, 8, 8, 8, 8,10,10,10, 7, 6,
135.14686 +         8, 8, 8, 8, 8, 8,10,10,10, 7, 6, 7, 7, 8, 8, 8,
135.14687 +         8,10,10,10, 7, 7, 8, 8, 8, 8, 8, 8,10,10,10, 7,
135.14688 +         7, 8, 8, 8, 8, 8, 8,10,10,10, 8, 8, 8, 8, 9, 9,
135.14689 +         9, 9,10,10,10, 8, 8, 8, 8, 9, 9, 9, 9,10,10,10,
135.14690 +         9, 9, 9, 9, 9, 9, 9, 9,10,10,10,10,10, 9, 9, 9,
135.14691 +         9, 9, 9,10,10,10,10,10, 9, 9, 9, 9, 9, 9,10,10,
135.14692 +        10,10,10, 9, 9, 9, 9, 9, 9,
135.14693 +};
135.14694 +
135.14695 +static const static_codebook _44cn1_s_p6_1 = {
135.14696 +        2, 121,
135.14697 +        (long *)_vq_lengthlist__44cn1_s_p6_1,
135.14698 +        1, -531365888, 1611661312, 4, 0,
135.14699 +        (long *)_vq_quantlist__44cn1_s_p6_1,
135.14700 +        0
135.14701 +};
135.14702 +
135.14703 +static const long _vq_quantlist__44cn1_s_p7_0[] = {
135.14704 +        6,
135.14705 +        5,
135.14706 +        7,
135.14707 +        4,
135.14708 +        8,
135.14709 +        3,
135.14710 +        9,
135.14711 +        2,
135.14712 +        10,
135.14713 +        1,
135.14714 +        11,
135.14715 +        0,
135.14716 +        12,
135.14717 +};
135.14718 +
135.14719 +static const long _vq_lengthlist__44cn1_s_p7_0[] = {
135.14720 +         1, 4, 4, 6, 6, 7, 7, 8, 8, 9, 9,10,10, 6, 5, 5,
135.14721 +         7, 7, 8, 8, 8, 8, 9, 9,11,11, 7, 5, 5, 7, 7, 8,
135.14722 +         8, 8, 8, 9,10,11,11, 0, 8, 8, 8, 8, 9, 9, 9, 9,
135.14723 +        10,10,11,11, 0, 8, 8, 8, 8, 9, 9, 9, 9,10,10,11,
135.14724 +        11, 0,12,12, 9, 9, 9,10,10,10,11,11,11,12, 0,13,
135.14725 +        13, 9, 9, 9, 9,10,10,11,11,11,12, 0, 0, 0,10,10,
135.14726 +        10,10,11,11,12,12,12,13, 0, 0, 0,10,10,10,10,11,
135.14727 +        11,12,12,13,12, 0, 0, 0,14,14,11,10,11,12,12,13,
135.14728 +        13,14, 0, 0, 0,15,15,11,11,12,11,12,12,14,13, 0,
135.14729 +         0, 0, 0, 0,12,12,12,12,13,13,14,14, 0, 0, 0, 0,
135.14730 +         0,13,13,12,12,13,13,13,14,
135.14731 +};
135.14732 +
135.14733 +static const static_codebook _44cn1_s_p7_0 = {
135.14734 +        2, 169,
135.14735 +        (long *)_vq_lengthlist__44cn1_s_p7_0,
135.14736 +        1, -526516224, 1616117760, 4, 0,
135.14737 +        (long *)_vq_quantlist__44cn1_s_p7_0,
135.14738 +        0
135.14739 +};
135.14740 +
135.14741 +static const long _vq_quantlist__44cn1_s_p7_1[] = {
135.14742 +        2,
135.14743 +        1,
135.14744 +        3,
135.14745 +        0,
135.14746 +        4,
135.14747 +};
135.14748 +
135.14749 +static const long _vq_lengthlist__44cn1_s_p7_1[] = {
135.14750 +         2, 3, 3, 5, 5, 6, 6, 6, 5, 5, 6, 6, 6, 5, 5, 6,
135.14751 +         6, 6, 5, 5, 6, 6, 6, 5, 5,
135.14752 +};
135.14753 +
135.14754 +static const static_codebook _44cn1_s_p7_1 = {
135.14755 +        2, 25,
135.14756 +        (long *)_vq_lengthlist__44cn1_s_p7_1,
135.14757 +        1, -533725184, 1611661312, 3, 0,
135.14758 +        (long *)_vq_quantlist__44cn1_s_p7_1,
135.14759 +        0
135.14760 +};
135.14761 +
135.14762 +static const long _vq_quantlist__44cn1_s_p8_0[] = {
135.14763 +        2,
135.14764 +        1,
135.14765 +        3,
135.14766 +        0,
135.14767 +        4,
135.14768 +};
135.14769 +
135.14770 +static const long _vq_lengthlist__44cn1_s_p8_0[] = {
135.14771 +         1, 7, 7,11,11, 8,11,11,11,11, 4,11, 3,11,11,11,
135.14772 +        11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,
135.14773 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.14774 +        11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,
135.14775 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.14776 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.14777 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.14778 +        11,11,11,11,11,11,11,11,11,11,11,11,11, 7,11,11,
135.14779 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.14780 +        11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,
135.14781 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,
135.14782 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.14783 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.14784 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.14785 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.14786 +        11,11,11,11,11,11,11,11,11,11, 8,11,11,11,11,11,
135.14787 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.14788 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.14789 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.14790 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.14791 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.14792 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.14793 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.14794 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.14795 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.14796 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.14797 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.14798 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.14799 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.14800 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.14801 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.14802 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.14803 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
135.14804 +        11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,
135.14805 +        12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
135.14806 +        12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
135.14807 +        12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
135.14808 +        12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
135.14809 +        12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
135.14810 +        12,
135.14811 +};
135.14812 +
135.14813 +static const static_codebook _44cn1_s_p8_0 = {
135.14814 +        4, 625,
135.14815 +        (long *)_vq_lengthlist__44cn1_s_p8_0,
135.14816 +        1, -518283264, 1627103232, 3, 0,
135.14817 +        (long *)_vq_quantlist__44cn1_s_p8_0,
135.14818 +        0
135.14819 +};
135.14820 +
135.14821 +static const long _vq_quantlist__44cn1_s_p8_1[] = {
135.14822 +        6,
135.14823 +        5,
135.14824 +        7,
135.14825 +        4,
135.14826 +        8,
135.14827 +        3,
135.14828 +        9,
135.14829 +        2,
135.14830 +        10,
135.14831 +        1,
135.14832 +        11,
135.14833 +        0,
135.14834 +        12,
135.14835 +};
135.14836 +
135.14837 +static const long _vq_lengthlist__44cn1_s_p8_1[] = {
135.14838 +         1, 4, 4, 6, 6, 8, 8, 9,10,10,11,11,11, 6, 5, 5,
135.14839 +         7, 7, 8, 8, 9,10, 9,11,11,12, 5, 5, 5, 7, 7, 8,
135.14840 +         9,10,10,12,12,14,13,15, 7, 7, 8, 8, 9,10,11,11,
135.14841 +        10,12,10,11,15, 7, 8, 8, 8, 9, 9,11,11,13,12,12,
135.14842 +        13,15,10,10, 8, 8,10,10,12,12,11,14,10,10,15,11,
135.14843 +        11, 8, 8,10,10,12,13,13,14,15,13,15,15,15,10,10,
135.14844 +        10,10,12,12,13,12,13,10,15,15,15,10,10,11,10,13,
135.14845 +        11,13,13,15,13,15,15,15,13,13,10,11,11,11,12,10,
135.14846 +        14,11,15,15,14,14,13,10,10,12,11,13,13,14,14,15,
135.14847 +        15,15,15,15,11,11,11,11,12,11,15,12,15,15,15,15,
135.14848 +        15,12,12,11,11,14,12,13,14,
135.14849 +};
135.14850 +
135.14851 +static const static_codebook _44cn1_s_p8_1 = {
135.14852 +        2, 169,
135.14853 +        (long *)_vq_lengthlist__44cn1_s_p8_1,
135.14854 +        1, -522616832, 1620115456, 4, 0,
135.14855 +        (long *)_vq_quantlist__44cn1_s_p8_1,
135.14856 +        0
135.14857 +};
135.14858 +
135.14859 +static const long _vq_quantlist__44cn1_s_p8_2[] = {
135.14860 +        8,
135.14861 +        7,
135.14862 +        9,
135.14863 +        6,
135.14864 +        10,
135.14865 +        5,
135.14866 +        11,
135.14867 +        4,
135.14868 +        12,
135.14869 +        3,
135.14870 +        13,
135.14871 +        2,
135.14872 +        14,
135.14873 +        1,
135.14874 +        15,
135.14875 +        0,
135.14876 +        16,
135.14877 +};
135.14878 +
135.14879 +static const long _vq_lengthlist__44cn1_s_p8_2[] = {
135.14880 +         3, 4, 3, 6, 6, 7, 7, 8, 8, 9, 9, 9, 9, 9, 9, 9,
135.14881 +         9,10,11,11, 6, 6, 7, 7, 8, 8, 9, 9, 9, 9, 9, 9,
135.14882 +         9, 9,10,10,10, 6, 6, 7, 7, 8, 8, 9, 9, 9, 9, 9,
135.14883 +         9, 9, 9,10,10,10, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9,
135.14884 +         9, 9,10, 9,10,11,10, 7, 6, 7, 7, 8, 8, 9, 9, 9,
135.14885 +         9, 9, 9, 9,10,10,10,11, 7, 7, 8, 8, 8, 8, 9, 9,
135.14886 +         9, 9, 9, 9, 9, 9,10,10,10, 7, 7, 8, 8, 8, 8, 9,
135.14887 +         9, 9, 9, 9, 9, 9,10,11,11,11, 8, 8, 8, 8, 8, 8,
135.14888 +         9, 9, 9, 9, 9, 9, 9, 9,11,10,10,11,11, 8, 8, 8,
135.14889 +         9, 9, 9, 9, 9, 9,10, 9,10,10,10,10,11,11, 9, 9,
135.14890 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9,11,11,10,11,11, 9,
135.14891 +         9, 9, 9, 9, 9, 9, 9, 9,10,10,10,10,11,10,11,11,
135.14892 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,11,10,10,11,
135.14893 +        11,11,11, 9, 9, 9, 9, 9, 9, 9, 9,10,10,10,11,11,
135.14894 +        10,11,11,11, 9,10,10, 9, 9, 9, 9, 9, 9, 9,10,11,
135.14895 +        11,11,11,11,11, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,11,
135.14896 +        11,11,11,11,11,11,10,10, 9, 9, 9, 9, 9, 9, 9, 9,
135.14897 +        11,11,11,10,11,11,11,11,11, 9, 9, 9,10, 9, 9, 9,
135.14898 +         9,
135.14899 +};
135.14900 +
135.14901 +static const static_codebook _44cn1_s_p8_2 = {
135.14902 +        2, 289,
135.14903 +        (long *)_vq_lengthlist__44cn1_s_p8_2,
135.14904 +        1, -529530880, 1611661312, 5, 0,
135.14905 +        (long *)_vq_quantlist__44cn1_s_p8_2,
135.14906 +        0
135.14907 +};
135.14908 +
135.14909 +static const long _huff_lengthlist__44cn1_s_short[] = {
135.14910 +        10, 9,12,15,12,13,16,14,16, 7, 1, 5,14, 7,10,13,
135.14911 +        16,16, 9, 4, 6,16, 8,11,16,16,16,14, 4, 7,16, 9,
135.14912 +        12,14,16,16,10, 5, 7,14, 9,12,14,15,15,13, 8, 9,
135.14913 +        14,10,12,13,14,15,13, 9, 9, 7, 6, 8,11,12,12,14,
135.14914 +         8, 8, 5, 4, 5, 8,11,12,16,10,10, 6, 5, 6, 8, 9,
135.14915 +        10,
135.14916 +};
135.14917 +
135.14918 +static const static_codebook _huff_book__44cn1_s_short = {
135.14919 +        2, 81,
135.14920 +        (long *)_huff_lengthlist__44cn1_s_short,
135.14921 +        0, 0, 0, 0, 0,
135.14922 +        NULL,
135.14923 +        0
135.14924 +};
135.14925 +
135.14926 +static const long _huff_lengthlist__44cn1_sm_long[] = {
135.14927 +         3, 3, 8, 8, 8, 8,10,12,14, 3, 2, 6, 7, 7, 8,10,
135.14928 +        12,16, 7, 6, 7, 9, 8,10,12,14,16, 8, 6, 8, 4, 5,
135.14929 +         7, 9,11,13, 7, 6, 8, 5, 6, 7, 9,11,14, 8, 8,10,
135.14930 +         7, 7, 6, 8,10,13, 9,11,12, 9, 9, 7, 8,10,12,10,
135.14931 +        13,15,11,11,10, 9,10,13,13,16,17,14,15,14,13,14,
135.14932 +        17,
135.14933 +};
135.14934 +
135.14935 +static const static_codebook _huff_book__44cn1_sm_long = {
135.14936 +        2, 81,
135.14937 +        (long *)_huff_lengthlist__44cn1_sm_long,
135.14938 +        0, 0, 0, 0, 0,
135.14939 +        NULL,
135.14940 +        0
135.14941 +};
135.14942 +
135.14943 +static const long _vq_quantlist__44cn1_sm_p1_0[] = {
135.14944 +        1,
135.14945 +        0,
135.14946 +        2,
135.14947 +};
135.14948 +
135.14949 +static const long _vq_lengthlist__44cn1_sm_p1_0[] = {
135.14950 +         1, 4, 5, 0, 0, 0, 0, 0, 0, 5, 7, 7, 0, 0, 0, 0,
135.14951 +         0, 0, 5, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14952 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14953 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14954 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14955 +         0, 5, 8, 8, 0, 0, 0, 0, 0, 0, 8, 9, 9, 0, 0, 0,
135.14956 +         0, 0, 0, 7, 8, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14957 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14958 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14959 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14960 +         0, 0, 5, 8, 8, 0, 0, 0, 0, 0, 0, 7, 9, 8, 0, 0,
135.14961 +         0, 0, 0, 0, 8, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14962 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14963 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14964 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14965 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14966 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14967 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14968 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14969 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14970 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14971 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14972 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14973 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14974 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14975 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14976 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14977 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14978 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14979 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14980 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14981 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14982 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14983 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14984 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14985 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14986 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14987 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14988 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14989 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14990 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14991 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14992 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14993 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14994 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14995 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 8, 8, 0, 0, 0, 0,
135.14996 +         0, 0, 8,10, 9, 0, 0, 0, 0, 0, 0, 8, 9, 9, 0, 0,
135.14997 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14998 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.14999 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15000 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7,10, 9, 0, 0, 0,
135.15001 +         0, 0, 0, 9, 9,10, 0, 0, 0, 0, 0, 0, 9,10,10, 0,
135.15002 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15003 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15004 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15005 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 9, 9, 0, 0,
135.15006 +         0, 0, 0, 0, 8,10, 9, 0, 0, 0, 0, 0, 0, 9,10,10,
135.15007 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15008 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15009 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15010 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15011 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15012 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15013 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15014 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15015 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15016 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15017 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15018 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15019 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15020 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15021 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15022 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15023 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15024 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15025 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15026 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15027 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15028 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15029 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15030 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15031 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15032 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15033 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15034 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15035 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15036 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15037 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15038 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15039 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15040 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15041 +         0, 0, 5, 8, 8, 0, 0, 0, 0, 0, 0, 8, 9, 9, 0, 0,
135.15042 +         0, 0, 0, 0, 8, 9,10, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15043 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15044 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15045 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15046 +         0, 0, 0, 7, 9, 9, 0, 0, 0, 0, 0, 0, 9,10,10, 0,
135.15047 +         0, 0, 0, 0, 0, 8, 9,10, 0, 0, 0, 0, 0, 0, 0, 0,
135.15048 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15049 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15050 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15051 +         0, 0, 0, 0, 7, 9,10, 0, 0, 0, 0, 0, 0, 9,10,10,
135.15052 +         0, 0, 0, 0, 0, 0, 9,10, 9, 0, 0, 0, 0, 0, 0, 0,
135.15053 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15054 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15055 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15056 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15057 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15058 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15059 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15060 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15061 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15062 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15063 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15064 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15065 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15066 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15067 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15068 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15069 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15070 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15071 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15072 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15073 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15074 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15075 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15076 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15077 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15078 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15079 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15080 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15081 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15082 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15083 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15084 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15085 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15086 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15087 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15088 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15089 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15090 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15091 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15092 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15093 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15094 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15095 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15096 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15097 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15098 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15099 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15100 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15101 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15102 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15103 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15104 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15105 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15106 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15107 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15108 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15109 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15110 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15111 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15112 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15113 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15114 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15115 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15116 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15117 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15118 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15119 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15120 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15121 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15122 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15123 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15124 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15125 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15126 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15127 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15128 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15129 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15130 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15131 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15132 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15133 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15134 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15135 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15136 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15137 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15138 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15139 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15140 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15141 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15142 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15143 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15144 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15145 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15146 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15147 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15148 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15149 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15150 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15151 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15152 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15153 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15154 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15155 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15156 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15157 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15158 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15159 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15160 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15161 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15162 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15163 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15164 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15165 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15166 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15167 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15168 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15169 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15170 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15171 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15172 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15173 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15174 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15175 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15176 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15177 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15178 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15179 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15180 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15181 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15182 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15183 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15184 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15185 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15186 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15187 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15188 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15189 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15190 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15191 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15192 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15193 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15194 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15195 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15196 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15197 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15198 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15199 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15200 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15201 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15202 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15203 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15204 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15205 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15206 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15207 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15208 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15209 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15210 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15211 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15212 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15213 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15214 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15215 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15216 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15217 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15218 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15219 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15220 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15221 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15222 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15223 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15224 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15225 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15226 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15227 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15228 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15229 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15230 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15231 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15232 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15233 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15234 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15235 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15236 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15237 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15238 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15239 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15240 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15241 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15242 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15243 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15244 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15245 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15246 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15247 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15248 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15249 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15250 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15251 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15252 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15253 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15254 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15255 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15256 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15257 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15258 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15259 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15260 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15261 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15262 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15263 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15264 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15265 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15266 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15267 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15268 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15269 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15270 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15271 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15272 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15273 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15274 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15275 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15276 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15277 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15278 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15279 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15280 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15281 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15282 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15283 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15284 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15285 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15286 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15287 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15288 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15289 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15290 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15291 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15292 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15293 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15294 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15295 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15296 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15297 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15298 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15299 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15300 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15301 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15302 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15303 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15304 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15305 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15306 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15307 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15308 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15309 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15310 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15311 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15312 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15313 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15314 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15315 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15316 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15317 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15318 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15319 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15320 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15321 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15322 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15323 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15324 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15325 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15326 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15327 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15328 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15329 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15330 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15331 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15332 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15333 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15334 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15335 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15336 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15337 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15338 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15339 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15340 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15341 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15342 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15343 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15344 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15345 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15346 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15347 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15348 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15349 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15350 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15351 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15352 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15353 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15354 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15355 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15356 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15357 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15358 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15359 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15360 +         0,
135.15361 +};
135.15362 +
135.15363 +static const static_codebook _44cn1_sm_p1_0 = {
135.15364 +        8, 6561,
135.15365 +        (long *)_vq_lengthlist__44cn1_sm_p1_0,
135.15366 +        1, -535822336, 1611661312, 2, 0,
135.15367 +        (long *)_vq_quantlist__44cn1_sm_p1_0,
135.15368 +        0
135.15369 +};
135.15370 +
135.15371 +static const long _vq_quantlist__44cn1_sm_p2_0[] = {
135.15372 +        2,
135.15373 +        1,
135.15374 +        3,
135.15375 +        0,
135.15376 +        4,
135.15377 +};
135.15378 +
135.15379 +static const long _vq_lengthlist__44cn1_sm_p2_0[] = {
135.15380 +         1, 4, 4, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15381 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, 5, 7, 7, 0, 0,
135.15382 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15383 +         0, 0, 4, 5, 5, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15384 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7, 7, 9, 9,
135.15385 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15386 +         0, 0, 0, 0, 7, 7, 7, 9, 9, 0, 0, 0, 0, 0, 0, 0,
135.15387 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15388 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15389 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15390 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15391 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15392 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15393 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15394 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15395 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15396 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15397 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15398 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15399 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15400 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15401 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15402 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15403 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15404 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15405 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15406 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15407 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15408 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15409 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15410 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15411 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15412 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15413 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15414 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15415 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15416 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15417 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15418 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15419 +         0,
135.15420 +};
135.15421 +
135.15422 +static const static_codebook _44cn1_sm_p2_0 = {
135.15423 +        4, 625,
135.15424 +        (long *)_vq_lengthlist__44cn1_sm_p2_0,
135.15425 +        1, -533725184, 1611661312, 3, 0,
135.15426 +        (long *)_vq_quantlist__44cn1_sm_p2_0,
135.15427 +        0
135.15428 +};
135.15429 +
135.15430 +static const long _vq_quantlist__44cn1_sm_p3_0[] = {
135.15431 +        4,
135.15432 +        3,
135.15433 +        5,
135.15434 +        2,
135.15435 +        6,
135.15436 +        1,
135.15437 +        7,
135.15438 +        0,
135.15439 +        8,
135.15440 +};
135.15441 +
135.15442 +static const long _vq_lengthlist__44cn1_sm_p3_0[] = {
135.15443 +         1, 3, 4, 7, 7, 0, 0, 0, 0, 0, 4, 4, 7, 7, 0, 0,
135.15444 +         0, 0, 0, 4, 5, 7, 7, 0, 0, 0, 0, 0, 6, 7, 8, 8,
135.15445 +         0, 0, 0, 0, 0, 0, 0, 8, 8, 0, 0, 0, 0, 0, 0, 0,
135.15446 +         9, 9, 0, 0, 0, 0, 0, 0, 0,10, 9, 0, 0, 0, 0, 0,
135.15447 +         0, 0,11,11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135.15448 +         0,
135.15449 +};
135.15450 +
135.15451 +static const static_codebook _44cn1_sm_p3_0 = {
135.15452 +        2, 81,
135.15453 +        (long *)_vq_lengthlist__44cn1_sm_p3_0,
135.15454 +        1, -531628032, 1611661312, 4, 0,
135.15455 +        (long *)_vq_quantlist__44cn1_sm_p3_0,
135.15456 +        0
135.15457 +};
135.15458 +
135.15459 +static const long _vq_quantlist__44cn1_sm_p4_0[] = {
135.15460 +        4,
135.15461 +        3,
135.15462 +        5,
135.15463 +        2,
135.15464 +        6,
135.15465 +        1,
135.15466 +        7,
135.15467 +        0,
135.15468 +        8,
135.15469 +};
135.15470 +
135.15471 +static const long _vq_lengthlist__44cn1_sm_p4_0[] = {
135.15472 +         1, 4, 3, 6, 6, 7, 7, 9, 9, 0, 5, 5, 7, 7, 8, 7,
135.15473 +         9, 9, 0, 5, 5, 7, 7, 8, 8, 9, 9, 0, 7, 7, 8, 8,
135.15474 +         8, 8,10,10, 0, 0, 0, 8, 8, 8, 8,10,10, 0, 0, 0,
135.15475 +         9, 9, 9, 9,10,10, 0, 0, 0, 9, 9, 9, 9,10,10, 0,
135.15476 +         0, 0,10,10,10,10,11,11, 0, 0, 0, 0, 0,10,10,11,
135.15477 +        11,
135.15478 +};
135.15479 +
135.15480 +static const static_codebook _44cn1_sm_p4_0 = {
135.15481 +        2, 81,
135.15482 +        (long *)_vq_lengthlist__44cn1_sm_p4_0,
135.15483 +        1, -531628032, 1611661312, 4, 0,
135.15484 +        (long *)_vq_quantlist__44cn1_sm_p4_0,
135.15485 +        0
135.15486 +};
135.15487 +
135.15488 +static const long _vq_quantlist__44cn1_sm_p5_0[] = {
135.15489 +        8,
135.15490 +        7,
135.15491 +        9,
135.15492 +        6,
135.15493 +        10,
135.15494 +        5,
135.15495 +        11,
135.15496 +        4,
135.15497 +        12,
135.15498 +        3,
135.15499 +        13,
135.15500 +        2,
135.15501 +        14,
135.15502 +        1,
135.15503 +        15,
135.15504 +        0,
135.15505 +        16,
135.15506 +};
135.15507 +
135.15508 +static const long _vq_lengthlist__44cn1_sm_p5_0[] = {
135.15509 +         1, 4, 4, 6, 6, 8, 8, 9, 9, 8, 8, 9, 9,10,10,11,
135.15510 +        11, 0, 6, 6, 7, 7, 8, 8, 9, 9, 9, 9,10,10,11,11,
135.15511 +        12,12, 0, 6, 5, 7, 7, 8, 8, 9, 9, 9, 9,10,10,11,
135.15512 +        11,12,12, 0, 7, 7, 7, 7, 8, 8, 9, 9, 9, 9,10,10,
135.15513 +        11,11,12,12, 0, 0, 0, 7, 7, 8, 8, 9, 9,10,10,11,
135.15514 +        11,11,11,12,12, 0, 0, 0, 8, 8, 9, 9,10,10,10,10,
135.15515 +        11,11,12,12,12,12, 0, 0, 0, 8, 8, 9, 9,10,10,10,
135.15516 +        10,11,11,12,12,12,12, 0, 0, 0, 9, 9, 9, 9,10,10,
135.15517 +        10,10,11,11,12,12,13,13, 0, 0, 0, 0, 0, 9, 9,10,
135.15518 +        10,10,10,11,11,12,12,13,13, 0, 0, 0, 0, 0, 9, 9,
135.15519 +        10,10,11,11,12,12,13,13,13,13, 0, 0, 0, 0, 0, 9,
135.15520 +         9,10,10,11,11,12,12,12,13,13,13, 0, 0, 0, 0, 0,
135.15521 +        10,10,11,11,11,11,12,12,13,13,14,14, 0, 0, 0, 0,
135.15522 +         0, 0, 0,11,11,11,11,12,12,13,13,14,14, 0, 0, 0,
135.15523 +         0, 0, 0, 0,11,11,12,12,13,13,13,13,14,14, 0, 0,
135.15524 +         0, 0, 0, 0, 0,11,11,12,12,13,13,13,13,14,14, 0,
135.15525 +         0, 0, 0, 0, 0, 0,12,12,12,13,13,13,14,14,14,14,
135.15526 +         0, 0, 0, 0, 0, 0, 0, 0, 0,12,12,13,13,14,14,14,
135.15527 +        14,
135.15528 +};
135.15529 +
135.15530 +static const static_codebook _44cn1_sm_p5_0 = {
135.15531 +        2, 289,
135.15532 +        (long *)_vq_lengthlist__44cn1_sm_p5_0,
135.15533 +        1, -529530880, 1611661312, 5, 0,
135.15534 +        (long *)_vq_quantlist__44cn1_sm_p5_0,
135.15535 +        0
135.15536 +};
135.15537 +
135.15538 +static const long _vq_quantlist__44cn1_sm_p6_0[] = {
135.15539 +        1,
135.15540 +        0,
135.15541 +        2,
135.15542 +};
135.15543 +
135.15544 +static const long _vq_lengthlist__44cn1_sm_p6_0[] = {
135.15545 +         1, 4, 4, 7, 6, 6, 7, 6, 6, 4, 7, 6,10, 9, 9,11,
135.15546 +         9, 9, 4, 6, 7,10, 9, 9,11, 9, 9, 7,10,10,10,11,
135.15547 +        11,11,11,10, 6, 9, 9,11,10,10,11,10,10, 6, 9, 9,
135.15548 +        11,10,11,11,10,10, 7,11,11,11,11,11,12,11,11, 7,
135.15549 +         9, 9,11,10,10,12,10,10, 7, 9, 9,11,10,10,11,10,
135.15550 +        10,
135.15551 +};
135.15552 +
135.15553 +static const static_codebook _44cn1_sm_p6_0 = {
135.15554 +        4, 81,
135.15555 +        (long *)_vq_lengthlist__44cn1_sm_p6_0,
135.15556 +        1, -529137664, 1618345984, 2, 0,
135.15557 +        (long *)_vq_quantlist__44cn1_sm_p6_0,
135.15558 +        0
135.15559 +};
135.15560 +
135.15561 +static const long _vq_quantlist__44cn1_sm_p6_1[] = {
135.15562 +        5,
135.15563 +        4,
135.15564 +        6,
135.15565 +        3,
135.15566 +        7,
135.15567 +        2,
135.15568 +        8,
135.15569 +        1,
135.15570 +        9,
135.15571 +        0,
135.15572 +        10,
135.15573 +};
135.15574 +
135.15575 +static const long _vq_lengthlist__44cn1_sm_p6_1[] = {
135.15576 +         2, 4, 4, 5, 5, 7, 7, 7, 7, 8, 8,10, 5, 5, 6, 6,
135.15577 +         7, 7, 8, 8, 8, 8,10, 5, 5, 6, 6, 7, 7, 8, 8, 8,
135.15578 +         8,10, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8,10,10,10, 7,
135.15579 +         7, 7, 7, 8, 8, 8, 8,10,10,10, 8, 8, 8, 8, 8, 8,
135.15580 +         8, 8,10,10,10, 8, 8, 8, 8, 8, 8, 8, 8,10,10,10,
135.15581 +         8, 8, 8, 8, 8, 8, 9, 9,10,10,10,10,10, 8, 8, 8,
135.15582 +         8, 9, 9,10,10,10,10,10, 9, 9, 9, 9, 8, 9,10,10,
135.15583 +        10,10,10, 8, 9, 8, 8, 9, 8,
135.15584 +};
135.15585 +
135.15586 +static const static_codebook _44cn1_sm_p6_1 = {
135.15587 +        2, 121,
135.15588 +        (long *)_vq_lengthlist__44cn1_sm_p6_1,
135.15589 +        1, -531365888, 1611661312, 4, 0,
135.15590 +        (long *)_vq_quantlist__44cn1_sm_p6_1,
135.15591 +        0
135.15592 +};
135.15593 +
135.15594 +static const long _vq_quantlist__44cn1_sm_p7_0[] = {
135.15595 +        6,
135.15596 +        5,
135.15597 +        7,
135.15598 +        4,
135.15599 +        8,
135.15600 +        3,
135.15601 +        9,
135.15602 +        2,
135.15603 +        10,
135.15604 +        1,
135.15605 +        11,
135.15606 +        0,
135.15607 +        12,
135.15608 +};
135.15609 +
135.15610 +static const long _vq_lengthlist__44cn1_sm_p7_0[] = {
135.15611 +         1, 4, 4, 6, 6, 7, 7, 7, 7, 9, 9,10,10, 7, 5, 5,
135.15612 +         7, 7, 8, 8, 8, 8,10, 9,11,10, 7, 5, 5, 7, 7, 8,
135.15613 +         8, 8, 8, 9,10,11,11, 0, 8, 8, 8, 8, 9, 9, 9, 9,
135.15614 +        10,10,11,11, 0, 8, 8, 8, 8, 9, 9, 9, 9,10,10,11,
135.15615 +        11, 0,12,12, 9, 9, 9,10,10,10,11,11,12,12, 0,13,
135.15616 +        13, 9, 9, 9, 9,10,10,11,11,12,12, 0, 0, 0,10,10,
135.15617 +        10,10,11,11,12,12,12,13, 0, 0, 0,10,10,10,10,11,
135.15618 +        11,12,12,12,12, 0, 0, 0,14,14,11,11,11,11,12,13,
135.15619 +        13,13, 0, 0, 0,14,14,11,10,11,11,12,12,13,13, 0,
135.15620 +         0, 0, 0, 0,12,12,12,12,13,13,13,14, 0, 0, 0, 0,
135.15621 +         0,13,12,12,12,13,13,13,14,
135.15622 +};
135.15623 +
135.15624 +static const static_codebook _44cn1_sm_p7_0 = {
135.15625 +        2, 169,
135.15626 +        (long *)_vq_lengthlist__44cn1_sm_p7_0,
135.15627 +        1, -526516224, 1616117760, 4, 0,
135.15628 +        (long *)_vq_quantlist__44cn1_sm_p7_0,
135.15629 +        0
135.15630 +};
135.15631 +
135.15632 +static const long _vq_quantlist__44cn1_sm_p7_1[] = {
135.15633 +        2,
135.15634 +        1,
135.15635 +        3,
135.15636 +        0,
135.15637 +        4,
135.15638 +};
135.15639 +
135.15640 +static const long _vq_lengthlist__44cn1_sm_p7_1[] = {
135.15641 +         2, 4, 4, 4, 5, 6, 5, 5, 5, 5, 6, 5, 5, 5, 5, 6,
135.15642 +         5, 5, 5, 5, 6, 6, 6, 5, 5,
135.15643 +};
135.15644 +
135.15645 +static const static_codebook _44cn1_sm_p7_1 = {
135.15646 +        2, 25,
135.15647 +        (long *)_vq_lengthlist__44cn1_sm_p7_1,
135.15648 +        1, -533725184, 1611661312, 3, 0,
135.15649 +        (long *)_vq_quantlist__44cn1_sm_p7_1,
135.15650 +        0
135.15651 +};
135.15652 +
135.15653 +static const long _vq_quantlist__44cn1_sm_p8_0[] = {
135.15654 +        4,
135.15655 +        3,
135.15656 +        5,
135.15657 +        2,
135.15658 +        6,
135.15659 +        1,
135.15660 +        7,
135.15661 +        0,
135.15662 +        8,
135.15663 +};
135.15664 +
135.15665 +static const long _vq_lengthlist__44cn1_sm_p8_0[] = {
135.15666 +         1, 4, 4,12,11,13,13,14,14, 4, 7, 7,11,13,14,14,
135.15667 +        14,14, 3, 8, 3,14,14,14,14,14,14,14,10,12,14,14,
135.15668 +        14,14,14,14,14,14, 5,14, 8,14,14,14,14,14,12,14,
135.15669 +        13,14,14,14,14,14,14,14,13,14,10,14,14,14,14,14,
135.15670 +        14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
135.15671 +        14,
135.15672 +};
135.15673 +
135.15674 +static const static_codebook _44cn1_sm_p8_0 = {
135.15675 +        2, 81,
135.15676 +        (long *)_vq_lengthlist__44cn1_sm_p8_0,
135.15677 +        1, -516186112, 1627103232, 4, 0,
135.15678 +        (long *)_vq_quantlist__44cn1_sm_p8_0,
135.15679 +        0
135.15680 +};
135.15681 +
135.15682 +static const long _vq_quantlist__44cn1_sm_p8_1[] = {
135.15683 +        6,
135.15684 +        5,
135.15685 +        7,
135.15686 +        4,
135.15687 +        8,
135.15688 +        3,
135.15689 +        9,
135.15690 +        2,
135.15691 +        10,
135.15692 +        1,
135.15693 +        11,
135.15694 +        0,
135.15695 +        12,
135.15696 +};
135.15697 +
135.15698 +static const long _vq_lengthlist__44cn1_sm_p8_1[] = {
135.15699 +         1, 4, 4, 6, 6, 8, 8, 9, 9,10,11,11,11, 6, 5, 5,
135.15700 +         7, 7, 8, 8,10,10,10,11,11,11, 6, 5, 5, 7, 7, 8,
135.15701 +         8,10,10,11,12,12,12,14, 7, 7, 7, 8, 9, 9,11,11,
135.15702 +        11,12,11,12,17, 7, 7, 8, 7, 9, 9,11,11,12,12,12,
135.15703 +        12,14,11,11, 8, 8,10,10,11,12,12,13,11,12,14,11,
135.15704 +        11, 8, 8,10,10,11,12,12,13,13,12,14,15,14,10,10,
135.15705 +        10,10,11,12,12,12,12,11,14,13,16,10,10,10, 9,12,
135.15706 +        11,12,12,13,14,14,15,14,14,13,10,10,11,11,12,11,
135.15707 +        13,11,14,12,15,13,14,11,10,12,10,12,12,13,13,13,
135.15708 +        13,14,15,15,12,12,11,11,12,11,13,12,14,14,14,14,
135.15709 +        17,12,12,11,10,13,11,13,13,
135.15710 +};
135.15711 +
135.15712 +static const static_codebook _44cn1_sm_p8_1 = {
135.15713 +        2, 169,
135.15714 +        (long *)_vq_lengthlist__44cn1_sm_p8_1,
135.15715 +        1, -522616832, 1620115456, 4, 0,
135.15716 +        (long *)_vq_quantlist__44cn1_sm_p8_1,
135.15717 +        0
135.15718 +};
135.15719 +
135.15720 +static const long _vq_quantlist__44cn1_sm_p8_2[] = {
135.15721 +        8,
135.15722 +        7,
135.15723 +        9,
135.15724 +        6,
135.15725 +        10,
135.15726 +        5,
135.15727 +        11,
135.15728 +        4,
135.15729 +        12,
135.15730 +        3,
135.15731 +        13,
135.15732 +        2,
135.15733 +        14,
135.15734 +        1,
135.15735 +        15,
135.15736 +        0,
135.15737 +        16,
135.15738 +};
135.15739 +
135.15740 +static const long _vq_lengthlist__44cn1_sm_p8_2[] = {
135.15741 +         3, 4, 4, 6, 6, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9,
135.15742 +         9,10, 6, 6, 6, 6, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9,
135.15743 +         9, 9,10, 6, 6, 6, 6, 7, 7, 8, 8, 8, 8, 9, 9, 9,
135.15744 +         9, 9, 9,10, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9,
135.15745 +         9, 9, 9, 9,10,10,10, 7, 7, 7, 8, 8, 8, 9, 9, 9,
135.15746 +         9, 9, 9, 9, 9,10,10,10, 8, 8, 8, 8, 8, 8, 9, 9,
135.15747 +         9, 9, 9, 9, 9, 9,10,10,10, 8, 8, 8, 8, 8, 8, 9,
135.15748 +         9, 9, 9, 9, 9, 9, 9,11,10,11, 8, 8, 8, 8, 8, 8,
135.15749 +         9, 9, 9, 9, 9, 9, 9, 9,10,10,10,11,11, 8, 8, 8,
135.15750 +         8, 9, 9, 9, 9, 9, 9, 9, 9,11,10,11,11,11, 9, 9,
135.15751 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9,10,11,10,11,11, 9,
135.15752 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9,10,11,11,10,11,11,
135.15753 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,11,10,11,11,
135.15754 +        11,11,11, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,10,11,11,
135.15755 +        11,11,11,11, 9,10,10,10, 9, 9, 9, 9, 9, 9,11,10,
135.15756 +        11,11,11,11,11, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,11,
135.15757 +        11,11,11,11,11,11,10,10, 9, 9, 9, 9, 9, 9, 9, 9,
135.15758 +        10,11,11,11,11,11,11,11,11, 9, 9, 9, 9, 9, 9, 9,
135.15759 +         9,
135.15760 +};
135.15761 +
135.15762 +static const static_codebook _44cn1_sm_p8_2 = {
135.15763 +        2, 289,
135.15764 +        (long *)_vq_lengthlist__44cn1_sm_p8_2,
135.15765 +        1, -529530880, 1611661312, 5, 0,
135.15766 +        (long *)_vq_quantlist__44cn1_sm_p8_2,
135.15767 +        0
135.15768 +};
135.15769 +
135.15770 +static const long _huff_lengthlist__44cn1_sm_short[] = {
135.15771 +         5, 6,12,14,12,14,16,17,18, 4, 2, 5,11, 7,10,12,
135.15772 +        14,15, 9, 4, 5,11, 7,10,13,15,18,15, 6, 7, 5, 6,
135.15773 +         8,11,13,16,11, 5, 6, 5, 5, 6, 9,13,15,12, 5, 7,
135.15774 +         6, 5, 6, 9,12,14,12, 6, 7, 8, 6, 7, 9,12,13,14,
135.15775 +         8, 8, 7, 5, 5, 8,10,12,16, 9, 9, 8, 6, 6, 7, 9,
135.15776 +         9,
135.15777 +};
135.15778 +
135.15779 +static const static_codebook _huff_book__44cn1_sm_short = {
135.15780 +        2, 81,
135.15781 +        (long *)_huff_lengthlist__44cn1_sm_short,
135.15782 +        0, 0, 0, 0, 0,
135.15783 +        NULL,
135.15784 +        0
135.15785 +};
135.15786 +
   136.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   136.2 +++ b/libs/vorbis/books/floor/floor_books.h	Sun Nov 01 00:36:56 2015 +0200
   136.3 @@ -0,0 +1,1547 @@
   136.4 +/********************************************************************
   136.5 + *                                                                  *
   136.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   136.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   136.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   136.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  136.10 + *                                                                  *
  136.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007             *
  136.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  136.13 + *                                                                  *
  136.14 + ********************************************************************
  136.15 +
  136.16 + function: static codebooks autogenerated by huff/huffbuld
  136.17 + last modified: $Id: floor_books.h 16939 2010-03-01 08:38:14Z xiphmont $
  136.18 +
  136.19 + ********************************************************************/
  136.20 +
  136.21 +#include "codebook.h"
  136.22 +
  136.23 +static const long _huff_lengthlist_line_256x7_0sub1[] = {
  136.24 +         0, 2, 3, 3, 3, 3, 4, 3, 4,
  136.25 +};
  136.26 +
  136.27 +static const static_codebook _huff_book_line_256x7_0sub1 = {
  136.28 +        1, 9,
  136.29 +        (long *)_huff_lengthlist_line_256x7_0sub1,
  136.30 +        0, 0, 0, 0, 0,
  136.31 +        NULL,
  136.32 +        0
  136.33 +};
  136.34 +
  136.35 +static const long _huff_lengthlist_line_256x7_0sub2[] = {
  136.36 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 3, 4, 3, 5, 3,
  136.37 +         6, 3, 6, 4, 6, 4, 7, 5, 7,
  136.38 +};
  136.39 +
  136.40 +static const static_codebook _huff_book_line_256x7_0sub2 = {
  136.41 +        1, 25,
  136.42 +        (long *)_huff_lengthlist_line_256x7_0sub2,
  136.43 +        0, 0, 0, 0, 0,
  136.44 +        NULL,
  136.45 +        0
  136.46 +};
  136.47 +
  136.48 +static const long _huff_lengthlist_line_256x7_0sub3[] = {
  136.49 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  136.50 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 5, 2, 5, 3, 5, 3,
  136.51 +         6, 3, 6, 4, 7, 6, 7, 8, 7, 9, 8, 9, 9, 9,10, 9,
  136.52 +        11,13,11,13,10,10,13,13,13,13,13,13,12,12,12,12,
  136.53 +};
  136.54 +
  136.55 +static const static_codebook _huff_book_line_256x7_0sub3 = {
  136.56 +        1, 64,
  136.57 +        (long *)_huff_lengthlist_line_256x7_0sub3,
  136.58 +        0, 0, 0, 0, 0,
  136.59 +        NULL,
  136.60 +        0
  136.61 +};
  136.62 +
  136.63 +static const long _huff_lengthlist_line_256x7_1sub1[] = {
  136.64 +         0, 3, 3, 3, 3, 2, 4, 3, 4,
  136.65 +};
  136.66 +
  136.67 +static const static_codebook _huff_book_line_256x7_1sub1 = {
  136.68 +        1, 9,
  136.69 +        (long *)_huff_lengthlist_line_256x7_1sub1,
  136.70 +        0, 0, 0, 0, 0,
  136.71 +        NULL,
  136.72 +        0
  136.73 +};
  136.74 +
  136.75 +static const long _huff_lengthlist_line_256x7_1sub2[] = {
  136.76 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 3, 4, 3, 4, 4,
  136.77 +         5, 4, 6, 5, 6, 7, 6, 8, 8,
  136.78 +};
  136.79 +
  136.80 +static const static_codebook _huff_book_line_256x7_1sub2 = {
  136.81 +        1, 25,
  136.82 +        (long *)_huff_lengthlist_line_256x7_1sub2,
  136.83 +        0, 0, 0, 0, 0,
  136.84 +        NULL,
  136.85 +        0
  136.86 +};
  136.87 +
  136.88 +static const long _huff_lengthlist_line_256x7_1sub3[] = {
  136.89 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  136.90 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2, 4, 3, 6, 3, 7,
  136.91 +         3, 8, 5, 8, 6, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
  136.92 +         8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7,
  136.93 +};
  136.94 +
  136.95 +static const static_codebook _huff_book_line_256x7_1sub3 = {
  136.96 +        1, 64,
  136.97 +        (long *)_huff_lengthlist_line_256x7_1sub3,
  136.98 +        0, 0, 0, 0, 0,
  136.99 +        NULL,
 136.100 +        0
 136.101 +};
 136.102 +
 136.103 +static const long _huff_lengthlist_line_256x7_class0[] = {
 136.104 +         7, 5, 5, 9, 9, 6, 6, 9,12, 8, 7, 8,11, 8, 9,15,
 136.105 +         6, 3, 3, 7, 7, 4, 3, 6, 9, 6, 5, 6, 8, 6, 8,15,
 136.106 +         8, 5, 5, 9, 8, 5, 4, 6,10, 7, 5, 5,11, 8, 7,15,
 136.107 +        14,15,13,13,13,13, 8,11,15,10, 7, 6,11, 9,10,15,
 136.108 +};
 136.109 +
 136.110 +static const static_codebook _huff_book_line_256x7_class0 = {
 136.111 +        1, 64,
 136.112 +        (long *)_huff_lengthlist_line_256x7_class0,
 136.113 +        0, 0, 0, 0, 0,
 136.114 +        NULL,
 136.115 +        0
 136.116 +};
 136.117 +
 136.118 +static const long _huff_lengthlist_line_256x7_class1[] = {
 136.119 +         5, 6, 8,15, 6, 9,10,15,10,11,12,15,15,15,15,15,
 136.120 +         4, 6, 7,15, 6, 7, 8,15, 9, 8, 9,15,15,15,15,15,
 136.121 +         6, 8, 9,15, 7, 7, 8,15,10, 9,10,15,15,15,15,15,
 136.122 +        15,13,15,15,15,10,11,15,15,13,13,15,15,15,15,15,
 136.123 +         4, 6, 7,15, 6, 8, 9,15,10,10,12,15,15,15,15,15,
 136.124 +         2, 5, 6,15, 5, 6, 7,15, 8, 6, 7,15,15,15,15,15,
 136.125 +         5, 6, 8,15, 5, 6, 7,15, 9, 6, 7,15,15,15,15,15,
 136.126 +        14,12,13,15,12,10,11,15,15,15,15,15,15,15,15,15,
 136.127 +         7, 8, 9,15, 9,10,10,15,15,14,14,15,15,15,15,15,
 136.128 +         5, 6, 7,15, 7, 8, 9,15,12, 9,10,15,15,15,15,15,
 136.129 +         7, 7, 9,15, 7, 7, 8,15,12, 8, 9,15,15,15,15,15,
 136.130 +        13,13,14,15,12,11,12,15,15,15,15,15,15,15,15,15,
 136.131 +        15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
 136.132 +        13,13,13,15,15,15,15,15,15,15,15,15,15,15,15,15,
 136.133 +        15,12,13,15,15,12,13,15,15,14,15,15,15,15,15,15,
 136.134 +        15,15,15,15,15,15,13,15,15,15,15,15,15,15,15,15,
 136.135 +};
 136.136 +
 136.137 +static const static_codebook _huff_book_line_256x7_class1 = {
 136.138 +        1, 256,
 136.139 +        (long *)_huff_lengthlist_line_256x7_class1,
 136.140 +        0, 0, 0, 0, 0,
 136.141 +        NULL,
 136.142 +        0
 136.143 +};
 136.144 +
 136.145 +static const long _huff_lengthlist_line_512x17_0sub0[] = {
 136.146 +         4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
 136.147 +         5, 6, 5, 6, 6, 6, 6, 5, 6, 6, 7, 6, 7, 6, 7, 6,
 136.148 +         7, 6, 8, 7, 8, 7, 8, 7, 8, 7, 8, 7, 9, 7, 9, 7,
 136.149 +         9, 7, 9, 8, 9, 8,10, 8,10, 8,10, 7,10, 6,10, 8,
 136.150 +        10, 8,11, 7,10, 7,11, 8,11,11,12,12,11,11,12,11,
 136.151 +        13,11,13,11,13,12,15,12,13,13,14,14,14,14,14,15,
 136.152 +        15,15,16,14,17,19,19,18,18,18,18,18,18,18,18,18,
 136.153 +        18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,
 136.154 +};
 136.155 +
 136.156 +static const static_codebook _huff_book_line_512x17_0sub0 = {
 136.157 +        1, 128,
 136.158 +        (long *)_huff_lengthlist_line_512x17_0sub0,
 136.159 +        0, 0, 0, 0, 0,
 136.160 +        NULL,
 136.161 +        0
 136.162 +};
 136.163 +
 136.164 +static const long _huff_lengthlist_line_512x17_1sub0[] = {
 136.165 +         2, 4, 5, 4, 5, 4, 5, 4, 5, 5, 5, 5, 5, 5, 6, 5,
 136.166 +         6, 5, 6, 6, 7, 6, 7, 6, 8, 7, 8, 7, 8, 7, 8, 7,
 136.167 +};
 136.168 +
 136.169 +static const static_codebook _huff_book_line_512x17_1sub0 = {
 136.170 +        1, 32,
 136.171 +        (long *)_huff_lengthlist_line_512x17_1sub0,
 136.172 +        0, 0, 0, 0, 0,
 136.173 +        NULL,
 136.174 +        0
 136.175 +};
 136.176 +
 136.177 +static const long _huff_lengthlist_line_512x17_1sub1[] = {
 136.178 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 136.179 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 136.180 +         4, 3, 5, 3, 5, 4, 5, 4, 5, 4, 5, 5, 5, 5, 6, 5,
 136.181 +         6, 5, 7, 5, 8, 6, 8, 6, 8, 6, 8, 6, 8, 7, 9, 7,
 136.182 +         9, 7,11, 9,11,11,12,11,14,12,14,16,14,16,13,16,
 136.183 +        14,16,12,15,13,16,14,16,13,14,12,15,13,15,13,13,
 136.184 +        13,15,12,14,14,15,13,15,12,15,15,15,15,15,15,15,
 136.185 +        15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
 136.186 +};
 136.187 +
 136.188 +static const static_codebook _huff_book_line_512x17_1sub1 = {
 136.189 +        1, 128,
 136.190 +        (long *)_huff_lengthlist_line_512x17_1sub1,
 136.191 +        0, 0, 0, 0, 0,
 136.192 +        NULL,
 136.193 +        0
 136.194 +};
 136.195 +
 136.196 +static const long _huff_lengthlist_line_512x17_2sub1[] = {
 136.197 +         0, 4, 5, 4, 4, 4, 5, 4, 4, 4, 5, 4, 5, 4, 5, 3,
 136.198 +         5, 3,
 136.199 +};
 136.200 +
 136.201 +static const static_codebook _huff_book_line_512x17_2sub1 = {
 136.202 +        1, 18,
 136.203 +        (long *)_huff_lengthlist_line_512x17_2sub1,
 136.204 +        0, 0, 0, 0, 0,
 136.205 +        NULL,
 136.206 +        0
 136.207 +};
 136.208 +
 136.209 +static const long _huff_lengthlist_line_512x17_2sub2[] = {
 136.210 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 136.211 +         0, 0, 4, 3, 4, 3, 4, 4, 5, 4, 5, 4, 6, 4, 6, 5,
 136.212 +         6, 5, 7, 5, 7, 6, 8, 6, 8, 6, 8, 7, 8, 7, 9, 7,
 136.213 +         9, 8,
 136.214 +};
 136.215 +
 136.216 +static const static_codebook _huff_book_line_512x17_2sub2 = {
 136.217 +        1, 50,
 136.218 +        (long *)_huff_lengthlist_line_512x17_2sub2,
 136.219 +        0, 0, 0, 0, 0,
 136.220 +        NULL,
 136.221 +        0
 136.222 +};
 136.223 +
 136.224 +static const long _huff_lengthlist_line_512x17_2sub3[] = {
 136.225 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 136.226 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 136.227 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 136.228 +         0, 0, 3, 3, 3, 3, 4, 3, 4, 4, 5, 5, 6, 6, 7, 7,
 136.229 +         7, 8, 8,11, 8, 9, 9, 9,10,11,11,11, 9,10,10,11,
 136.230 +        11,11,11,10,10,10,10,10,10,10,10,10,10,10,10,10,
 136.231 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
 136.232 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
 136.233 +};
 136.234 +
 136.235 +static const static_codebook _huff_book_line_512x17_2sub3 = {
 136.236 +        1, 128,
 136.237 +        (long *)_huff_lengthlist_line_512x17_2sub3,
 136.238 +        0, 0, 0, 0, 0,
 136.239 +        NULL,
 136.240 +        0
 136.241 +};
 136.242 +
 136.243 +static const long _huff_lengthlist_line_512x17_3sub1[] = {
 136.244 +         0, 4, 4, 4, 4, 4, 4, 3, 4, 4, 4, 4, 4, 5, 4, 5,
 136.245 +         5, 5,
 136.246 +};
 136.247 +
 136.248 +static const static_codebook _huff_book_line_512x17_3sub1 = {
 136.249 +        1, 18,
 136.250 +        (long *)_huff_lengthlist_line_512x17_3sub1,
 136.251 +        0, 0, 0, 0, 0,
 136.252 +        NULL,
 136.253 +        0
 136.254 +};
 136.255 +
 136.256 +static const long _huff_lengthlist_line_512x17_3sub2[] = {
 136.257 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 136.258 +         0, 0, 2, 3, 3, 4, 3, 5, 4, 6, 4, 6, 5, 7, 6, 7,
 136.259 +         6, 8, 6, 8, 7, 9, 8,10, 8,12, 9,13,10,15,10,15,
 136.260 +        11,14,
 136.261 +};
 136.262 +
 136.263 +static const static_codebook _huff_book_line_512x17_3sub2 = {
 136.264 +        1, 50,
 136.265 +        (long *)_huff_lengthlist_line_512x17_3sub2,
 136.266 +        0, 0, 0, 0, 0,
 136.267 +        NULL,
 136.268 +        0
 136.269 +};
 136.270 +
 136.271 +static const long _huff_lengthlist_line_512x17_3sub3[] = {
 136.272 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 136.273 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 136.274 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 136.275 +         0, 0, 4, 8, 4, 8, 4, 8, 4, 8, 5, 8, 5, 8, 6, 8,
 136.276 +         4, 8, 4, 8, 5, 8, 5, 7, 7, 7, 7, 7, 7, 7, 7, 7,
 136.277 +         7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
 136.278 +         7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
 136.279 +         7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
 136.280 +};
 136.281 +
 136.282 +static const static_codebook _huff_book_line_512x17_3sub3 = {
 136.283 +        1, 128,
 136.284 +        (long *)_huff_lengthlist_line_512x17_3sub3,
 136.285 +        0, 0, 0, 0, 0,
 136.286 +        NULL,
 136.287 +        0
 136.288 +};
 136.289 +
 136.290 +static const long _huff_lengthlist_line_512x17_class1[] = {
 136.291 +         1, 2, 3, 6, 5, 4, 7, 7,
 136.292 +};
 136.293 +
 136.294 +static const static_codebook _huff_book_line_512x17_class1 = {
 136.295 +        1, 8,
 136.296 +        (long *)_huff_lengthlist_line_512x17_class1,
 136.297 +        0, 0, 0, 0, 0,
 136.298 +        NULL,
 136.299 +        0
 136.300 +};
 136.301 +
 136.302 +static const long _huff_lengthlist_line_512x17_class2[] = {
 136.303 +         3, 3, 3,14, 5, 4, 4,11, 8, 6, 6,10,17,12,11,17,
 136.304 +         6, 5, 5,15, 5, 3, 4,11, 8, 5, 5, 8,16, 9,10,14,
 136.305 +        10, 8, 9,17, 8, 6, 6,13,10, 7, 7,10,16,11,13,14,
 136.306 +        17,17,17,17,17,16,16,16,16,15,16,16,16,16,16,16,
 136.307 +};
 136.308 +
 136.309 +static const static_codebook _huff_book_line_512x17_class2 = {
 136.310 +        1, 64,
 136.311 +        (long *)_huff_lengthlist_line_512x17_class2,
 136.312 +        0, 0, 0, 0, 0,
 136.313 +        NULL,
 136.314 +        0
 136.315 +};
 136.316 +
 136.317 +static const long _huff_lengthlist_line_512x17_class3[] = {
 136.318 +         2, 4, 6,17, 4, 5, 7,17, 8, 7,10,17,17,17,17,17,
 136.319 +         3, 4, 6,15, 3, 3, 6,15, 7, 6, 9,17,17,17,17,17,
 136.320 +         6, 8,10,17, 6, 6, 8,16, 9, 8,10,17,17,15,16,17,
 136.321 +        17,17,17,17,12,15,15,16,12,15,15,16,16,16,16,16,
 136.322 +};
 136.323 +
 136.324 +static const static_codebook _huff_book_line_512x17_class3 = {
 136.325 +        1, 64,
 136.326 +        (long *)_huff_lengthlist_line_512x17_class3,
 136.327 +        0, 0, 0, 0, 0,
 136.328 +        NULL,
 136.329 +        0
 136.330 +};
 136.331 +
 136.332 +static const long _huff_lengthlist_line_128x4_class0[] = {
 136.333 +         7, 7, 7,11, 6, 6, 7,11, 7, 6, 6,10,12,10,10,13,
 136.334 +         7, 7, 8,11, 7, 7, 7,11, 7, 6, 7,10,11,10,10,13,
 136.335 +        10,10, 9,12, 9, 9, 9,11, 8, 8, 8,11,13,11,10,14,
 136.336 +        15,15,14,15,15,14,13,14,15,12,12,17,17,17,17,17,
 136.337 +         7, 7, 6, 9, 6, 6, 6, 9, 7, 6, 6, 8,11,11,10,12,
 136.338 +         7, 7, 7, 9, 7, 6, 6, 9, 7, 6, 6, 9,13,10,10,11,
 136.339 +        10, 9, 8,10, 9, 8, 8,10, 8, 8, 7, 9,13,12,10,11,
 136.340 +        17,14,14,13,15,14,12,13,17,13,12,15,17,17,14,17,
 136.341 +         7, 6, 6, 7, 6, 6, 5, 7, 6, 6, 6, 6,11, 9, 9, 9,
 136.342 +         7, 7, 6, 7, 7, 6, 6, 7, 6, 6, 6, 6,10, 9, 8, 9,
 136.343 +        10, 9, 8, 8, 9, 8, 7, 8, 8, 7, 6, 8,11,10, 9,10,
 136.344 +        17,17,12,15,15,15,12,14,14,14,10,12,15,13,12,13,
 136.345 +        11,10, 8,10,11,10, 8, 8,10, 9, 7, 7,10, 9, 9,11,
 136.346 +        11,11, 9,10,11,10, 8, 9,10, 8, 6, 8,10, 9, 9,11,
 136.347 +        14,13,10,12,12,11,10,10, 8, 7, 8,10,10,11,11,12,
 136.348 +        17,17,15,17,17,17,17,17,17,13,12,17,17,17,14,17,
 136.349 +};
 136.350 +
 136.351 +static const static_codebook _huff_book_line_128x4_class0 = {
 136.352 +        1, 256,
 136.353 +        (long *)_huff_lengthlist_line_128x4_class0,
 136.354 +        0, 0, 0, 0, 0,
 136.355 +        NULL,
 136.356 +        0
 136.357 +};
 136.358 +
 136.359 +static const long _huff_lengthlist_line_128x4_0sub0[] = {
 136.360 +         2, 2, 2, 2,
 136.361 +};
 136.362 +
 136.363 +static const static_codebook _huff_book_line_128x4_0sub0 = {
 136.364 +        1, 4,
 136.365 +        (long *)_huff_lengthlist_line_128x4_0sub0,
 136.366 +        0, 0, 0, 0, 0,
 136.367 +        NULL,
 136.368 +        0
 136.369 +};
 136.370 +
 136.371 +static const long _huff_lengthlist_line_128x4_0sub1[] = {
 136.372 +         0, 0, 0, 0, 3, 2, 3, 2, 3, 3,
 136.373 +};
 136.374 +
 136.375 +static const static_codebook _huff_book_line_128x4_0sub1 = {
 136.376 +        1, 10,
 136.377 +        (long *)_huff_lengthlist_line_128x4_0sub1,
 136.378 +        0, 0, 0, 0, 0,
 136.379 +        NULL,
 136.380 +        0
 136.381 +};
 136.382 +
 136.383 +static const long _huff_lengthlist_line_128x4_0sub2[] = {
 136.384 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 4, 3, 4, 3,
 136.385 +         4, 4, 5, 4, 5, 4, 6, 5, 6,
 136.386 +};
 136.387 +
 136.388 +static const static_codebook _huff_book_line_128x4_0sub2 = {
 136.389 +        1, 25,
 136.390 +        (long *)_huff_lengthlist_line_128x4_0sub2,
 136.391 +        0, 0, 0, 0, 0,
 136.392 +        NULL,
 136.393 +        0
 136.394 +};
 136.395 +
 136.396 +static const long _huff_lengthlist_line_128x4_0sub3[] = {
 136.397 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 136.398 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 3, 5, 3, 5, 3,
 136.399 +         5, 4, 6, 5, 6, 5, 7, 6, 6, 7, 7, 9, 9,11,11,16,
 136.400 +        11,14,10,11,11,13,16,15,15,15,15,15,15,15,15,15,
 136.401 +};
 136.402 +
 136.403 +static const static_codebook _huff_book_line_128x4_0sub3 = {
 136.404 +        1, 64,
 136.405 +        (long *)_huff_lengthlist_line_128x4_0sub3,
 136.406 +        0, 0, 0, 0, 0,
 136.407 +        NULL,
 136.408 +        0
 136.409 +};
 136.410 +
 136.411 +static const long _huff_lengthlist_line_256x4_class0[] = {
 136.412 +         6, 7, 7,12, 6, 6, 7,12, 7, 6, 6,10,15,12,11,13,
 136.413 +         7, 7, 8,13, 7, 7, 8,12, 7, 7, 7,11,12,12,11,13,
 136.414 +        10, 9, 9,11, 9, 9, 9,10,10, 8, 8,12,14,12,12,14,
 136.415 +        11,11,12,14,11,12,11,15,15,12,13,15,15,15,15,15,
 136.416 +         6, 6, 7,10, 6, 6, 6,11, 7, 6, 6, 9,14,12,11,13,
 136.417 +         7, 7, 7,10, 6, 6, 7, 9, 7, 7, 6,10,13,12,10,12,
 136.418 +         9, 9, 9,11, 9, 9, 8, 9, 9, 8, 8,10,13,12,10,12,
 136.419 +        12,12,11,13,12,12,11,12,15,13,12,15,15,15,14,14,
 136.420 +         6, 6, 6, 8, 6, 6, 5, 6, 7, 7, 6, 5,11,10, 9, 8,
 136.421 +         7, 6, 6, 7, 6, 6, 5, 6, 7, 7, 6, 6,11,10, 9, 8,
 136.422 +         8, 8, 8, 9, 8, 8, 7, 8, 8, 8, 6, 7,11,10, 9, 9,
 136.423 +        14,11,10,14,14,11,10,15,13,11, 9,11,15,12,12,11,
 136.424 +        11, 9, 8, 8,10, 9, 8, 9,11,10, 9, 8,12,11,12,11,
 136.425 +        13,10, 8, 9,11,10, 8, 9,10, 9, 8, 9,10, 8,12,12,
 136.426 +        15,11,10,10,13,11,10,10, 8, 8, 7,12,10, 9,11,12,
 136.427 +        15,12,11,15,13,11,11,15,12,14,11,13,15,15,13,13,
 136.428 +};
 136.429 +
 136.430 +static const static_codebook _huff_book_line_256x4_class0 = {
 136.431 +        1, 256,
 136.432 +        (long *)_huff_lengthlist_line_256x4_class0,
 136.433 +        0, 0, 0, 0, 0,
 136.434 +        NULL,
 136.435 +        0
 136.436 +};
 136.437 +
 136.438 +static const long _huff_lengthlist_line_256x4_0sub0[] = {
 136.439 +         2, 2, 2, 2,
 136.440 +};
 136.441 +
 136.442 +static const static_codebook _huff_book_line_256x4_0sub0 = {
 136.443 +        1, 4,
 136.444 +        (long *)_huff_lengthlist_line_256x4_0sub0,
 136.445 +        0, 0, 0, 0, 0,
 136.446 +        NULL,
 136.447 +        0
 136.448 +};
 136.449 +
 136.450 +static const long _huff_lengthlist_line_256x4_0sub1[] = {
 136.451 +         0, 0, 0, 0, 2, 2, 3, 3, 3, 3,
 136.452 +};
 136.453 +
 136.454 +static const static_codebook _huff_book_line_256x4_0sub1 = {
 136.455 +        1, 10,
 136.456 +        (long *)_huff_lengthlist_line_256x4_0sub1,
 136.457 +        0, 0, 0, 0, 0,
 136.458 +        NULL,
 136.459 +        0
 136.460 +};
 136.461 +
 136.462 +static const long _huff_lengthlist_line_256x4_0sub2[] = {
 136.463 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 3, 4, 3, 4, 3,
 136.464 +         5, 3, 5, 4, 5, 4, 6, 4, 6,
 136.465 +};
 136.466 +
 136.467 +static const static_codebook _huff_book_line_256x4_0sub2 = {
 136.468 +        1, 25,
 136.469 +        (long *)_huff_lengthlist_line_256x4_0sub2,
 136.470 +        0, 0, 0, 0, 0,
 136.471 +        NULL,
 136.472 +        0
 136.473 +};
 136.474 +
 136.475 +static const long _huff_lengthlist_line_256x4_0sub3[] = {
 136.476 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 136.477 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 3, 5, 3, 5, 3,
 136.478 +         6, 4, 7, 4, 7, 5, 7, 6, 7, 6, 7, 8,10,13,13,13,
 136.479 +        13,13,13,13,13,13,13,13,13,13,13,12,12,12,12,12,
 136.480 +};
 136.481 +
 136.482 +static const static_codebook _huff_book_line_256x4_0sub3 = {
 136.483 +        1, 64,
 136.484 +        (long *)_huff_lengthlist_line_256x4_0sub3,
 136.485 +        0, 0, 0, 0, 0,
 136.486 +        NULL,
 136.487 +        0
 136.488 +};
 136.489 +
 136.490 +static const long _huff_lengthlist_line_128x7_class0[] = {
 136.491 +        10, 7, 8,13, 9, 6, 7,11,10, 8, 8,12,17,17,17,17,
 136.492 +         7, 5, 5, 9, 6, 4, 4, 8, 8, 5, 5, 8,16,14,13,16,
 136.493 +         7, 5, 5, 7, 6, 3, 3, 5, 8, 5, 4, 7,14,12,12,15,
 136.494 +        10, 7, 8, 9, 7, 5, 5, 6, 9, 6, 5, 5,15,12, 9,10,
 136.495 +};
 136.496 +
 136.497 +static const static_codebook _huff_book_line_128x7_class0 = {
 136.498 +        1, 64,
 136.499 +        (long *)_huff_lengthlist_line_128x7_class0,
 136.500 +        0, 0, 0, 0, 0,
 136.501 +        NULL,
 136.502 +        0
 136.503 +};
 136.504 +
 136.505 +static const long _huff_lengthlist_line_128x7_class1[] = {
 136.506 +         8,13,17,17, 8,11,17,17,11,13,17,17,17,17,17,17,
 136.507 +         6,10,16,17, 6,10,15,17, 8,10,16,17,17,17,17,17,
 136.508 +         9,13,15,17, 8,11,17,17,10,12,17,17,17,17,17,17,
 136.509 +        17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
 136.510 +         6,11,15,17, 7,10,15,17, 8,10,17,17,17,15,17,17,
 136.511 +         4, 8,13,17, 4, 7,13,17, 6, 8,15,17,16,15,17,17,
 136.512 +         6,11,15,17, 6, 9,13,17, 8,10,17,17,15,17,17,17,
 136.513 +        16,17,17,17,12,14,15,17,13,14,15,17,17,17,17,17,
 136.514 +         5,10,14,17, 5, 9,14,17, 7, 9,15,17,15,15,17,17,
 136.515 +         3, 7,12,17, 3, 6,11,17, 5, 7,13,17,12,12,17,17,
 136.516 +         5, 9,14,17, 3, 7,11,17, 5, 8,13,17,13,11,16,17,
 136.517 +        12,17,17,17, 9,14,15,17,10,11,14,17,16,14,17,17,
 136.518 +         8,12,17,17, 8,12,17,17,10,12,17,17,17,17,17,17,
 136.519 +         5,10,17,17, 5, 9,15,17, 7, 9,17,17,13,13,17,17,
 136.520 +         7,11,17,17, 6,10,15,17, 7, 9,15,17,12,11,17,17,
 136.521 +        12,15,17,17,11,14,17,17,11,10,15,17,17,16,17,17,
 136.522 +};
 136.523 +
 136.524 +static const static_codebook _huff_book_line_128x7_class1 = {
 136.525 +        1, 256,
 136.526 +        (long *)_huff_lengthlist_line_128x7_class1,
 136.527 +        0, 0, 0, 0, 0,
 136.528 +        NULL,
 136.529 +        0
 136.530 +};
 136.531 +
 136.532 +static const long _huff_lengthlist_line_128x7_0sub1[] = {
 136.533 +         0, 3, 3, 3, 3, 3, 3, 3, 3,
 136.534 +};
 136.535 +
 136.536 +static const static_codebook _huff_book_line_128x7_0sub1 = {
 136.537 +        1, 9,
 136.538 +        (long *)_huff_lengthlist_line_128x7_0sub1,
 136.539 +        0, 0, 0, 0, 0,
 136.540 +        NULL,
 136.541 +        0
 136.542 +};
 136.543 +
 136.544 +static const long _huff_lengthlist_line_128x7_0sub2[] = {
 136.545 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 4, 4, 4, 4,
 136.546 +         5, 4, 5, 4, 5, 4, 6, 4, 6,
 136.547 +};
 136.548 +
 136.549 +static const static_codebook _huff_book_line_128x7_0sub2 = {
 136.550 +        1, 25,
 136.551 +        (long *)_huff_lengthlist_line_128x7_0sub2,
 136.552 +        0, 0, 0, 0, 0,
 136.553 +        NULL,
 136.554 +        0
 136.555 +};
 136.556 +
 136.557 +static const long _huff_lengthlist_line_128x7_0sub3[] = {
 136.558 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 136.559 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 5, 3, 5, 3, 5, 4,
 136.560 +         5, 4, 5, 5, 5, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 5,
 136.561 +         7, 8, 9,11,13,13,13,13,13,13,13,13,13,13,13,13,
 136.562 +};
 136.563 +
 136.564 +static const static_codebook _huff_book_line_128x7_0sub3 = {
 136.565 +        1, 64,
 136.566 +        (long *)_huff_lengthlist_line_128x7_0sub3,
 136.567 +        0, 0, 0, 0, 0,
 136.568 +        NULL,
 136.569 +        0
 136.570 +};
 136.571 +
 136.572 +static const long _huff_lengthlist_line_128x7_1sub1[] = {
 136.573 +         0, 3, 3, 2, 3, 3, 4, 3, 4,
 136.574 +};
 136.575 +
 136.576 +static const static_codebook _huff_book_line_128x7_1sub1 = {
 136.577 +        1, 9,
 136.578 +        (long *)_huff_lengthlist_line_128x7_1sub1,
 136.579 +        0, 0, 0, 0, 0,
 136.580 +        NULL,
 136.581 +        0
 136.582 +};
 136.583 +
 136.584 +static const long _huff_lengthlist_line_128x7_1sub2[] = {
 136.585 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 3, 6, 3, 6, 3,
 136.586 +         6, 3, 7, 3, 8, 4, 9, 4, 9,
 136.587 +};
 136.588 +
 136.589 +static const static_codebook _huff_book_line_128x7_1sub2 = {
 136.590 +        1, 25,
 136.591 +        (long *)_huff_lengthlist_line_128x7_1sub2,
 136.592 +        0, 0, 0, 0, 0,
 136.593 +        NULL,
 136.594 +        0
 136.595 +};
 136.596 +
 136.597 +static const long _huff_lengthlist_line_128x7_1sub3[] = {
 136.598 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 136.599 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 7, 2, 7, 3, 8, 4,
 136.600 +         9, 5, 9, 8,10,11,11,12,14,14,14,14,14,14,14,14,
 136.601 +        14,14,14,14,14,14,14,14,14,14,14,14,13,13,13,13,
 136.602 +};
 136.603 +
 136.604 +static const static_codebook _huff_book_line_128x7_1sub3 = {
 136.605 +        1, 64,
 136.606 +        (long *)_huff_lengthlist_line_128x7_1sub3,
 136.607 +        0, 0, 0, 0, 0,
 136.608 +        NULL,
 136.609 +        0
 136.610 +};
 136.611 +
 136.612 +static const long _huff_lengthlist_line_128x11_class1[] = {
 136.613 +         1, 6, 3, 7, 2, 4, 5, 7,
 136.614 +};
 136.615 +
 136.616 +static const static_codebook _huff_book_line_128x11_class1 = {
 136.617 +        1, 8,
 136.618 +        (long *)_huff_lengthlist_line_128x11_class1,
 136.619 +        0, 0, 0, 0, 0,
 136.620 +        NULL,
 136.621 +        0
 136.622 +};
 136.623 +
 136.624 +static const long _huff_lengthlist_line_128x11_class2[] = {
 136.625 +         1, 6,12,16, 4,12,15,16, 9,15,16,16,16,16,16,16,
 136.626 +         2, 5,11,16, 5,11,13,16, 9,13,16,16,16,16,16,16,
 136.627 +         4, 8,12,16, 5, 9,12,16, 9,13,15,16,16,16,16,16,
 136.628 +        15,16,16,16,11,14,13,16,12,15,16,16,16,16,16,15,
 136.629 +};
 136.630 +
 136.631 +static const static_codebook _huff_book_line_128x11_class2 = {
 136.632 +        1, 64,
 136.633 +        (long *)_huff_lengthlist_line_128x11_class2,
 136.634 +        0, 0, 0, 0, 0,
 136.635 +        NULL,
 136.636 +        0
 136.637 +};
 136.638 +
 136.639 +static const long _huff_lengthlist_line_128x11_class3[] = {
 136.640 +         7, 6, 9,17, 7, 6, 8,17,12, 9,11,16,16,16,16,16,
 136.641 +         5, 4, 7,16, 5, 3, 6,14, 9, 6, 8,15,16,16,16,16,
 136.642 +         5, 4, 6,13, 3, 2, 4,11, 7, 4, 6,13,16,11,10,14,
 136.643 +        12,12,12,16, 9, 7,10,15,12, 9,11,16,16,15,15,16,
 136.644 +};
 136.645 +
 136.646 +static const static_codebook _huff_book_line_128x11_class3 = {
 136.647 +        1, 64,
 136.648 +        (long *)_huff_lengthlist_line_128x11_class3,
 136.649 +        0, 0, 0, 0, 0,
 136.650 +        NULL,
 136.651 +        0
 136.652 +};
 136.653 +
 136.654 +static const long _huff_lengthlist_line_128x11_0sub0[] = {
 136.655 +         5, 5, 5, 5, 5, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 5,
 136.656 +         6, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 6, 6, 6, 7, 6,
 136.657 +         7, 6, 7, 6, 7, 6, 7, 6, 7, 6, 8, 6, 8, 6, 8, 7,
 136.658 +         8, 7, 8, 7, 8, 7, 9, 7, 9, 8, 9, 8, 9, 8,10, 8,
 136.659 +        10, 9,10, 9,10, 9,11, 9,11, 9,10,10,11,10,11,10,
 136.660 +        11,11,11,11,11,11,12,13,14,14,14,15,15,16,16,16,
 136.661 +        17,15,16,15,16,16,17,17,16,17,17,17,17,17,17,17,
 136.662 +        17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
 136.663 +};
 136.664 +
 136.665 +static const static_codebook _huff_book_line_128x11_0sub0 = {
 136.666 +        1, 128,
 136.667 +        (long *)_huff_lengthlist_line_128x11_0sub0,
 136.668 +        0, 0, 0, 0, 0,
 136.669 +        NULL,
 136.670 +        0
 136.671 +};
 136.672 +
 136.673 +static const long _huff_lengthlist_line_128x11_1sub0[] = {
 136.674 +         2, 5, 5, 5, 5, 5, 5, 4, 5, 5, 5, 5, 5, 5, 5, 5,
 136.675 +         6, 5, 6, 5, 6, 5, 7, 6, 7, 6, 7, 6, 8, 6, 8, 6,
 136.676 +};
 136.677 +
 136.678 +static const static_codebook _huff_book_line_128x11_1sub0 = {
 136.679 +        1, 32,
 136.680 +        (long *)_huff_lengthlist_line_128x11_1sub0,
 136.681 +        0, 0, 0, 0, 0,
 136.682 +        NULL,
 136.683 +        0
 136.684 +};
 136.685 +
 136.686 +static const long _huff_lengthlist_line_128x11_1sub1[] = {
 136.687 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 136.688 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 136.689 +         5, 3, 5, 3, 6, 4, 6, 4, 7, 4, 7, 4, 7, 4, 8, 4,
 136.690 +         8, 4, 9, 5, 9, 5, 9, 5, 9, 6,10, 6,10, 6,11, 7,
 136.691 +        10, 7,10, 8,11, 9,11, 9,11,10,11,11,12,11,11,12,
 136.692 +        15,15,12,14,11,14,12,14,11,14,13,14,12,14,11,14,
 136.693 +        11,14,12,14,11,14,11,14,13,13,14,14,14,14,14,14,
 136.694 +        14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
 136.695 +};
 136.696 +
 136.697 +static const static_codebook _huff_book_line_128x11_1sub1 = {
 136.698 +        1, 128,
 136.699 +        (long *)_huff_lengthlist_line_128x11_1sub1,
 136.700 +        0, 0, 0, 0, 0,
 136.701 +        NULL,
 136.702 +        0
 136.703 +};
 136.704 +
 136.705 +static const long _huff_lengthlist_line_128x11_2sub1[] = {
 136.706 +         0, 4, 5, 4, 5, 4, 5, 3, 5, 3, 5, 3, 5, 4, 4, 4,
 136.707 +         5, 5,
 136.708 +};
 136.709 +
 136.710 +static const static_codebook _huff_book_line_128x11_2sub1 = {
 136.711 +        1, 18,
 136.712 +        (long *)_huff_lengthlist_line_128x11_2sub1,
 136.713 +        0, 0, 0, 0, 0,
 136.714 +        NULL,
 136.715 +        0
 136.716 +};
 136.717 +
 136.718 +static const long _huff_lengthlist_line_128x11_2sub2[] = {
 136.719 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 136.720 +         0, 0, 3, 3, 3, 4, 4, 4, 4, 5, 4, 5, 4, 6, 5, 7,
 136.721 +         5, 7, 6, 8, 6, 8, 6, 9, 7, 9, 7,10, 7, 9, 8,11,
 136.722 +         8,11,
 136.723 +};
 136.724 +
 136.725 +static const static_codebook _huff_book_line_128x11_2sub2 = {
 136.726 +        1, 50,
 136.727 +        (long *)_huff_lengthlist_line_128x11_2sub2,
 136.728 +        0, 0, 0, 0, 0,
 136.729 +        NULL,
 136.730 +        0
 136.731 +};
 136.732 +
 136.733 +static const long _huff_lengthlist_line_128x11_2sub3[] = {
 136.734 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 136.735 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 136.736 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 136.737 +         0, 0, 4, 8, 3, 8, 4, 8, 4, 8, 6, 8, 5, 8, 4, 8,
 136.738 +         4, 8, 6, 8, 7, 8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
 136.739 +         7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
 136.740 +         7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
 136.741 +         7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
 136.742 +};
 136.743 +
 136.744 +static const static_codebook _huff_book_line_128x11_2sub3 = {
 136.745 +        1, 128,
 136.746 +        (long *)_huff_lengthlist_line_128x11_2sub3,
 136.747 +        0, 0, 0, 0, 0,
 136.748 +        NULL,
 136.749 +        0
 136.750 +};
 136.751 +
 136.752 +static const long _huff_lengthlist_line_128x11_3sub1[] = {
 136.753 +         0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 4,
 136.754 +         5, 4,
 136.755 +};
 136.756 +
 136.757 +static const static_codebook _huff_book_line_128x11_3sub1 = {
 136.758 +        1, 18,
 136.759 +        (long *)_huff_lengthlist_line_128x11_3sub1,
 136.760 +        0, 0, 0, 0, 0,
 136.761 +        NULL,
 136.762 +        0
 136.763 +};
 136.764 +
 136.765 +static const long _huff_lengthlist_line_128x11_3sub2[] = {
 136.766 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 136.767 +         0, 0, 5, 3, 5, 4, 6, 4, 6, 4, 7, 4, 7, 4, 8, 4,
 136.768 +         8, 4, 9, 4, 9, 4,10, 4,10, 5,10, 5,11, 5,12, 6,
 136.769 +        12, 6,
 136.770 +};
 136.771 +
 136.772 +static const static_codebook _huff_book_line_128x11_3sub2 = {
 136.773 +        1, 50,
 136.774 +        (long *)_huff_lengthlist_line_128x11_3sub2,
 136.775 +        0, 0, 0, 0, 0,
 136.776 +        NULL,
 136.777 +        0
 136.778 +};
 136.779 +
 136.780 +static const long _huff_lengthlist_line_128x11_3sub3[] = {
 136.781 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 136.782 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 136.783 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 136.784 +         0, 0, 7, 1, 6, 3, 7, 3, 8, 4, 8, 5, 8, 8, 8, 9,
 136.785 +         7, 8, 8, 7, 7, 7, 8, 9,10, 9, 9,10,10,10,10,10,
 136.786 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
 136.787 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
 136.788 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10, 9, 9,
 136.789 +};
 136.790 +
 136.791 +static const static_codebook _huff_book_line_128x11_3sub3 = {
 136.792 +        1, 128,
 136.793 +        (long *)_huff_lengthlist_line_128x11_3sub3,
 136.794 +        0, 0, 0, 0, 0,
 136.795 +        NULL,
 136.796 +        0
 136.797 +};
 136.798 +
 136.799 +static const long _huff_lengthlist_line_128x17_class1[] = {
 136.800 +         1, 3, 4, 7, 2, 5, 6, 7,
 136.801 +};
 136.802 +
 136.803 +static const static_codebook _huff_book_line_128x17_class1 = {
 136.804 +        1, 8,
 136.805 +        (long *)_huff_lengthlist_line_128x17_class1,
 136.806 +        0, 0, 0, 0, 0,
 136.807 +        NULL,
 136.808 +        0
 136.809 +};
 136.810 +
 136.811 +static const long _huff_lengthlist_line_128x17_class2[] = {
 136.812 +         1, 4,10,19, 3, 8,13,19, 7,12,19,19,19,19,19,19,
 136.813 +         2, 6,11,19, 8,13,19,19, 9,11,19,19,19,19,19,19,
 136.814 +         6, 7,13,19, 9,13,19,19,10,13,18,18,18,18,18,18,
 136.815 +        18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,
 136.816 +};
 136.817 +
 136.818 +static const static_codebook _huff_book_line_128x17_class2 = {
 136.819 +        1, 64,
 136.820 +        (long *)_huff_lengthlist_line_128x17_class2,
 136.821 +        0, 0, 0, 0, 0,
 136.822 +        NULL,
 136.823 +        0
 136.824 +};
 136.825 +
 136.826 +static const long _huff_lengthlist_line_128x17_class3[] = {
 136.827 +         3, 6,10,17, 4, 8,11,20, 8,10,11,20,20,20,20,20,
 136.828 +         2, 4, 8,18, 4, 6, 8,17, 7, 8,10,20,20,17,20,20,
 136.829 +         3, 5, 8,17, 3, 4, 6,17, 8, 8,10,17,17,12,16,20,
 136.830 +        13,13,15,20,10,10,12,20,15,14,15,20,20,20,19,19,
 136.831 +};
 136.832 +
 136.833 +static const static_codebook _huff_book_line_128x17_class3 = {
 136.834 +        1, 64,
 136.835 +        (long *)_huff_lengthlist_line_128x17_class3,
 136.836 +        0, 0, 0, 0, 0,
 136.837 +        NULL,
 136.838 +        0
 136.839 +};
 136.840 +
 136.841 +static const long _huff_lengthlist_line_128x17_0sub0[] = {
 136.842 +         5, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 5,
 136.843 +         7, 5, 7, 5, 7, 5, 7, 5, 7, 5, 7, 5, 8, 5, 8, 5,
 136.844 +         8, 5, 8, 5, 8, 6, 8, 6, 8, 6, 9, 6, 9, 6, 9, 6,
 136.845 +         9, 6, 9, 7, 9, 7, 9, 7, 9, 7,10, 7,10, 8,10, 8,
 136.846 +        10, 8,10, 8,10, 8,11, 8,11, 8,11, 8,11, 8,11, 9,
 136.847 +        12, 9,12, 9,12, 9,12, 9,12,10,12,10,13,11,13,11,
 136.848 +        14,12,14,13,15,14,16,14,17,15,18,16,20,20,20,20,
 136.849 +        20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,
 136.850 +};
 136.851 +
 136.852 +static const static_codebook _huff_book_line_128x17_0sub0 = {
 136.853 +        1, 128,
 136.854 +        (long *)_huff_lengthlist_line_128x17_0sub0,
 136.855 +        0, 0, 0, 0, 0,
 136.856 +        NULL,
 136.857 +        0
 136.858 +};
 136.859 +
 136.860 +static const long _huff_lengthlist_line_128x17_1sub0[] = {
 136.861 +         2, 5, 5, 4, 5, 4, 5, 4, 5, 5, 5, 5, 5, 5, 6, 5,
 136.862 +         6, 5, 6, 5, 7, 6, 7, 6, 7, 6, 8, 6, 9, 7, 9, 7,
 136.863 +};
 136.864 +
 136.865 +static const static_codebook _huff_book_line_128x17_1sub0 = {
 136.866 +        1, 32,
 136.867 +        (long *)_huff_lengthlist_line_128x17_1sub0,
 136.868 +        0, 0, 0, 0, 0,
 136.869 +        NULL,
 136.870 +        0
 136.871 +};
 136.872 +
 136.873 +static const long _huff_lengthlist_line_128x17_1sub1[] = {
 136.874 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 136.875 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 136.876 +         4, 3, 5, 3, 5, 3, 6, 3, 6, 4, 6, 4, 7, 4, 7, 5,
 136.877 +         8, 5, 8, 6, 9, 7, 9, 7, 9, 8,10, 9,10, 9,11,10,
 136.878 +        11,11,11,11,11,11,12,12,12,13,12,13,12,14,12,15,
 136.879 +        12,14,12,16,13,17,13,17,14,17,14,16,13,17,14,17,
 136.880 +        14,17,15,17,15,15,16,17,17,17,17,17,17,17,17,17,
 136.881 +        17,17,17,17,17,17,16,16,16,16,16,16,16,16,16,16,
 136.882 +};
 136.883 +
 136.884 +static const static_codebook _huff_book_line_128x17_1sub1 = {
 136.885 +        1, 128,
 136.886 +        (long *)_huff_lengthlist_line_128x17_1sub1,
 136.887 +        0, 0, 0, 0, 0,
 136.888 +        NULL,
 136.889 +        0
 136.890 +};
 136.891 +
 136.892 +static const long _huff_lengthlist_line_128x17_2sub1[] = {
 136.893 +         0, 4, 5, 4, 6, 4, 8, 3, 9, 3, 9, 2, 9, 3, 8, 4,
 136.894 +         9, 4,
 136.895 +};
 136.896 +
 136.897 +static const static_codebook _huff_book_line_128x17_2sub1 = {
 136.898 +        1, 18,
 136.899 +        (long *)_huff_lengthlist_line_128x17_2sub1,
 136.900 +        0, 0, 0, 0, 0,
 136.901 +        NULL,
 136.902 +        0
 136.903 +};
 136.904 +
 136.905 +static const long _huff_lengthlist_line_128x17_2sub2[] = {
 136.906 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 136.907 +         0, 0, 5, 1, 5, 3, 5, 3, 5, 4, 7, 5,10, 7,10, 7,
 136.908 +        12,10,14,10,14, 9,14,11,14,14,14,13,13,13,13,13,
 136.909 +        13,13,
 136.910 +};
 136.911 +
 136.912 +static const static_codebook _huff_book_line_128x17_2sub2 = {
 136.913 +        1, 50,
 136.914 +        (long *)_huff_lengthlist_line_128x17_2sub2,
 136.915 +        0, 0, 0, 0, 0,
 136.916 +        NULL,
 136.917 +        0
 136.918 +};
 136.919 +
 136.920 +static const long _huff_lengthlist_line_128x17_2sub3[] = {
 136.921 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 136.922 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 136.923 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 136.924 +         0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
 136.925 +         7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6,
 136.926 +         6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
 136.927 +         6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
 136.928 +         6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
 136.929 +};
 136.930 +
 136.931 +static const static_codebook _huff_book_line_128x17_2sub3 = {
 136.932 +        1, 128,
 136.933 +        (long *)_huff_lengthlist_line_128x17_2sub3,
 136.934 +        0, 0, 0, 0, 0,
 136.935 +        NULL,
 136.936 +        0
 136.937 +};
 136.938 +
 136.939 +static const long _huff_lengthlist_line_128x17_3sub1[] = {
 136.940 +         0, 4, 4, 4, 4, 4, 4, 4, 5, 3, 5, 3, 5, 4, 6, 4,
 136.941 +         6, 4,
 136.942 +};
 136.943 +
 136.944 +static const static_codebook _huff_book_line_128x17_3sub1 = {
 136.945 +        1, 18,
 136.946 +        (long *)_huff_lengthlist_line_128x17_3sub1,
 136.947 +        0, 0, 0, 0, 0,
 136.948 +        NULL,
 136.949 +        0
 136.950 +};
 136.951 +
 136.952 +static const long _huff_lengthlist_line_128x17_3sub2[] = {
 136.953 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 136.954 +         0, 0, 5, 3, 6, 3, 6, 4, 7, 4, 7, 4, 7, 4, 8, 4,
 136.955 +         8, 4, 8, 4, 8, 4, 9, 4, 9, 5,10, 5,10, 7,10, 8,
 136.956 +        10, 8,
 136.957 +};
 136.958 +
 136.959 +static const static_codebook _huff_book_line_128x17_3sub2 = {
 136.960 +        1, 50,
 136.961 +        (long *)_huff_lengthlist_line_128x17_3sub2,
 136.962 +        0, 0, 0, 0, 0,
 136.963 +        NULL,
 136.964 +        0
 136.965 +};
 136.966 +
 136.967 +static const long _huff_lengthlist_line_128x17_3sub3[] = {
 136.968 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 136.969 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 136.970 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 136.971 +         0, 0, 3, 2, 4, 3, 4, 4, 4, 5, 4, 7, 5, 8, 5,11,
 136.972 +         6,10, 6,12, 7,12, 7,12, 8,12, 8,12,10,12,12,12,
 136.973 +        12,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
 136.974 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
 136.975 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
 136.976 +};
 136.977 +
 136.978 +static const static_codebook _huff_book_line_128x17_3sub3 = {
 136.979 +        1, 128,
 136.980 +        (long *)_huff_lengthlist_line_128x17_3sub3,
 136.981 +        0, 0, 0, 0, 0,
 136.982 +        NULL,
 136.983 +        0
 136.984 +};
 136.985 +
 136.986 +static const long _huff_lengthlist_line_1024x27_class1[] = {
 136.987 +         2,10, 8,14, 7,12,11,14, 1, 5, 3, 7, 4, 9, 7,13,
 136.988 +};
 136.989 +
 136.990 +static const static_codebook _huff_book_line_1024x27_class1 = {
 136.991 +        1, 16,
 136.992 +        (long *)_huff_lengthlist_line_1024x27_class1,
 136.993 +        0, 0, 0, 0, 0,
 136.994 +        NULL,
 136.995 +        0
 136.996 +};
 136.997 +
 136.998 +static const long _huff_lengthlist_line_1024x27_class2[] = {
 136.999 +         1, 4, 2, 6, 3, 7, 5, 7,
136.1000 +};
136.1001 +
136.1002 +static const static_codebook _huff_book_line_1024x27_class2 = {
136.1003 +        1, 8,
136.1004 +        (long *)_huff_lengthlist_line_1024x27_class2,
136.1005 +        0, 0, 0, 0, 0,
136.1006 +        NULL,
136.1007 +        0
136.1008 +};
136.1009 +
136.1010 +static const long _huff_lengthlist_line_1024x27_class3[] = {
136.1011 +         1, 5, 7,21, 5, 8, 9,21,10, 9,12,20,20,16,20,20,
136.1012 +         4, 8, 9,20, 6, 8, 9,20,11,11,13,20,20,15,17,20,
136.1013 +         9,11,14,20, 8,10,15,20,11,13,15,20,20,20,20,20,
136.1014 +        20,20,20,20,13,20,20,20,18,18,20,20,20,20,20,20,
136.1015 +         3, 6, 8,20, 6, 7, 9,20,10, 9,12,20,20,20,20,20,
136.1016 +         5, 7, 9,20, 6, 6, 9,20,10, 9,12,20,20,20,20,20,
136.1017 +         8,10,13,20, 8, 9,12,20,11,10,12,20,20,20,20,20,
136.1018 +        18,20,20,20,15,17,18,20,18,17,18,20,20,20,20,20,
136.1019 +         7,10,12,20, 8, 9,11,20,14,13,14,20,20,20,20,20,
136.1020 +         6, 9,12,20, 7, 8,11,20,12,11,13,20,20,20,20,20,
136.1021 +         9,11,15,20, 8,10,14,20,12,11,14,20,20,20,20,20,
136.1022 +        20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,
136.1023 +        11,16,18,20,15,15,17,20,20,17,20,20,20,20,20,20,
136.1024 +         9,14,16,20,12,12,15,20,17,15,18,20,20,20,20,20,
136.1025 +        16,19,18,20,15,16,20,20,17,17,20,20,20,20,20,20,
136.1026 +        20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,
136.1027 +};
136.1028 +
136.1029 +static const static_codebook _huff_book_line_1024x27_class3 = {
136.1030 +        1, 256,
136.1031 +        (long *)_huff_lengthlist_line_1024x27_class3,
136.1032 +        0, 0, 0, 0, 0,
136.1033 +        NULL,
136.1034 +        0
136.1035 +};
136.1036 +
136.1037 +static const long _huff_lengthlist_line_1024x27_class4[] = {
136.1038 +         2, 3, 7,13, 4, 4, 7,15, 8, 6, 9,17,21,16,15,21,
136.1039 +         2, 5, 7,11, 5, 5, 7,14, 9, 7,10,16,17,15,16,21,
136.1040 +         4, 7,10,17, 7, 7, 9,15,11, 9,11,16,21,18,15,21,
136.1041 +        18,21,21,21,15,17,17,19,21,19,18,20,21,21,21,20,
136.1042 +};
136.1043 +
136.1044 +static const static_codebook _huff_book_line_1024x27_class4 = {
136.1045 +        1, 64,
136.1046 +        (long *)_huff_lengthlist_line_1024x27_class4,
136.1047 +        0, 0, 0, 0, 0,
136.1048 +        NULL,
136.1049 +        0
136.1050 +};
136.1051 +
136.1052 +static const long _huff_lengthlist_line_1024x27_0sub0[] = {
136.1053 +         5, 5, 5, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 5,
136.1054 +         6, 5, 6, 5, 6, 5, 6, 5, 7, 5, 7, 5, 7, 5, 7, 5,
136.1055 +         8, 6, 8, 6, 8, 6, 9, 6, 9, 6,10, 6,10, 6,11, 6,
136.1056 +        11, 7,11, 7,12, 7,12, 7,12, 7,12, 7,12, 7,12, 7,
136.1057 +        12, 7,12, 8,13, 8,12, 8,12, 8,13, 8,13, 9,13, 9,
136.1058 +        13, 9,13, 9,12,10,12,10,13,10,14,11,14,12,14,13,
136.1059 +        14,13,14,14,15,16,15,15,15,14,15,17,21,22,22,21,
136.1060 +        22,22,22,22,22,22,21,21,21,21,21,21,21,21,21,21,
136.1061 +};
136.1062 +
136.1063 +static const static_codebook _huff_book_line_1024x27_0sub0 = {
136.1064 +        1, 128,
136.1065 +        (long *)_huff_lengthlist_line_1024x27_0sub0,
136.1066 +        0, 0, 0, 0, 0,
136.1067 +        NULL,
136.1068 +        0
136.1069 +};
136.1070 +
136.1071 +static const long _huff_lengthlist_line_1024x27_1sub0[] = {
136.1072 +         2, 5, 5, 4, 5, 4, 5, 4, 5, 4, 6, 5, 6, 5, 6, 5,
136.1073 +         6, 5, 7, 5, 7, 6, 8, 6, 8, 6, 8, 6, 9, 6, 9, 6,
136.1074 +};
136.1075 +
136.1076 +static const static_codebook _huff_book_line_1024x27_1sub0 = {
136.1077 +        1, 32,
136.1078 +        (long *)_huff_lengthlist_line_1024x27_1sub0,
136.1079 +        0, 0, 0, 0, 0,
136.1080 +        NULL,
136.1081 +        0
136.1082 +};
136.1083 +
136.1084 +static const long _huff_lengthlist_line_1024x27_1sub1[] = {
136.1085 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
136.1086 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
136.1087 +         8, 5, 8, 4, 9, 4, 9, 4, 9, 4, 9, 4, 9, 4, 9, 4,
136.1088 +         9, 4, 9, 4, 9, 4, 8, 4, 8, 4, 9, 5, 9, 5, 9, 5,
136.1089 +         9, 5, 9, 6,10, 6,10, 7,10, 8,11, 9,11,11,12,13,
136.1090 +        12,14,13,15,13,15,14,16,14,17,15,17,15,15,16,16,
136.1091 +        15,16,16,16,15,18,16,15,17,17,19,19,19,19,19,19,
136.1092 +        19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,
136.1093 +};
136.1094 +
136.1095 +static const static_codebook _huff_book_line_1024x27_1sub1 = {
136.1096 +        1, 128,
136.1097 +        (long *)_huff_lengthlist_line_1024x27_1sub1,
136.1098 +        0, 0, 0, 0, 0,
136.1099 +        NULL,
136.1100 +        0
136.1101 +};
136.1102 +
136.1103 +static const long _huff_lengthlist_line_1024x27_2sub0[] = {
136.1104 +         1, 5, 5, 5, 5, 5, 5, 5, 6, 5, 6, 5, 6, 5, 6, 5,
136.1105 +         6, 6, 7, 7, 7, 7, 8, 7, 8, 8, 9, 8,10, 9,10, 9,
136.1106 +};
136.1107 +
136.1108 +static const static_codebook _huff_book_line_1024x27_2sub0 = {
136.1109 +        1, 32,
136.1110 +        (long *)_huff_lengthlist_line_1024x27_2sub0,
136.1111 +        0, 0, 0, 0, 0,
136.1112 +        NULL,
136.1113 +        0
136.1114 +};
136.1115 +
136.1116 +static const long _huff_lengthlist_line_1024x27_2sub1[] = {
136.1117 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
136.1118 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
136.1119 +         4, 3, 4, 3, 4, 4, 5, 4, 5, 4, 5, 5, 6, 5, 6, 5,
136.1120 +         7, 5, 7, 6, 7, 6, 8, 7, 8, 7, 8, 7, 9, 8, 9, 9,
136.1121 +         9, 9,10,10,10,11, 9,12, 9,12, 9,15,10,14, 9,13,
136.1122 +        10,13,10,12,10,12,10,13,10,12,11,13,11,14,12,13,
136.1123 +        13,14,14,13,14,15,14,16,13,13,14,16,16,16,16,16,
136.1124 +        16,16,16,16,16,16,16,16,16,16,16,16,16,16,15,15,
136.1125 +};
136.1126 +
136.1127 +static const static_codebook _huff_book_line_1024x27_2sub1 = {
136.1128 +        1, 128,
136.1129 +        (long *)_huff_lengthlist_line_1024x27_2sub1,
136.1130 +        0, 0, 0, 0, 0,
136.1131 +        NULL,
136.1132 +        0
136.1133 +};
136.1134 +
136.1135 +static const long _huff_lengthlist_line_1024x27_3sub1[] = {
136.1136 +         0, 4, 5, 4, 5, 3, 5, 3, 5, 3, 5, 4, 4, 4, 4, 5,
136.1137 +         5, 5,
136.1138 +};
136.1139 +
136.1140 +static const static_codebook _huff_book_line_1024x27_3sub1 = {
136.1141 +        1, 18,
136.1142 +        (long *)_huff_lengthlist_line_1024x27_3sub1,
136.1143 +        0, 0, 0, 0, 0,
136.1144 +        NULL,
136.1145 +        0
136.1146 +};
136.1147 +
136.1148 +static const long _huff_lengthlist_line_1024x27_3sub2[] = {
136.1149 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
136.1150 +         0, 0, 3, 3, 4, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6,
136.1151 +         5, 7, 5, 8, 6, 8, 6, 9, 7,10, 7,10, 8,10, 8,11,
136.1152 +         9,11,
136.1153 +};
136.1154 +
136.1155 +static const static_codebook _huff_book_line_1024x27_3sub2 = {
136.1156 +        1, 50,
136.1157 +        (long *)_huff_lengthlist_line_1024x27_3sub2,
136.1158 +        0, 0, 0, 0, 0,
136.1159 +        NULL,
136.1160 +        0
136.1161 +};
136.1162 +
136.1163 +static const long _huff_lengthlist_line_1024x27_3sub3[] = {
136.1164 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
136.1165 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
136.1166 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
136.1167 +         0, 0, 3, 7, 3, 8, 3,10, 3, 8, 3, 9, 3, 8, 4, 9,
136.1168 +         4, 9, 5, 9, 6,10, 6, 9, 7,11, 7,12, 9,13,10,13,
136.1169 +        12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
136.1170 +        12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
136.1171 +        12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
136.1172 +};
136.1173 +
136.1174 +static const static_codebook _huff_book_line_1024x27_3sub3 = {
136.1175 +        1, 128,
136.1176 +        (long *)_huff_lengthlist_line_1024x27_3sub3,
136.1177 +        0, 0, 0, 0, 0,
136.1178 +        NULL,
136.1179 +        0
136.1180 +};
136.1181 +
136.1182 +static const long _huff_lengthlist_line_1024x27_4sub1[] = {
136.1183 +         0, 4, 5, 4, 5, 4, 5, 4, 5, 3, 5, 3, 5, 3, 5, 4,
136.1184 +         5, 4,
136.1185 +};
136.1186 +
136.1187 +static const static_codebook _huff_book_line_1024x27_4sub1 = {
136.1188 +        1, 18,
136.1189 +        (long *)_huff_lengthlist_line_1024x27_4sub1,
136.1190 +        0, 0, 0, 0, 0,
136.1191 +        NULL,
136.1192 +        0
136.1193 +};
136.1194 +
136.1195 +static const long _huff_lengthlist_line_1024x27_4sub2[] = {
136.1196 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
136.1197 +         0, 0, 4, 2, 4, 2, 5, 3, 5, 4, 6, 6, 6, 7, 7, 8,
136.1198 +         7, 8, 7, 8, 7, 9, 8, 9, 8, 9, 8,10, 8,11, 9,12,
136.1199 +         9,12,
136.1200 +};
136.1201 +
136.1202 +static const static_codebook _huff_book_line_1024x27_4sub2 = {
136.1203 +        1, 50,
136.1204 +        (long *)_huff_lengthlist_line_1024x27_4sub2,
136.1205 +        0, 0, 0, 0, 0,
136.1206 +        NULL,
136.1207 +        0
136.1208 +};
136.1209 +
136.1210 +static const long _huff_lengthlist_line_1024x27_4sub3[] = {
136.1211 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
136.1212 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
136.1213 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
136.1214 +         0, 0, 2, 5, 2, 6, 3, 6, 4, 7, 4, 7, 5, 9, 5,11,
136.1215 +         6,11, 6,11, 7,11, 6,11, 6,11, 9,11, 8,11,11,11,
136.1216 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
136.1217 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
136.1218 +        11,11,11,11,11,11,11,11,11,11,10,10,10,10,10,10,
136.1219 +};
136.1220 +
136.1221 +static const static_codebook _huff_book_line_1024x27_4sub3 = {
136.1222 +        1, 128,
136.1223 +        (long *)_huff_lengthlist_line_1024x27_4sub3,
136.1224 +        0, 0, 0, 0, 0,
136.1225 +        NULL,
136.1226 +        0
136.1227 +};
136.1228 +
136.1229 +static const long _huff_lengthlist_line_2048x27_class1[] = {
136.1230 +         2, 6, 8, 9, 7,11,13,13, 1, 3, 5, 5, 6, 6,12,10,
136.1231 +};
136.1232 +
136.1233 +static const static_codebook _huff_book_line_2048x27_class1 = {
136.1234 +        1, 16,
136.1235 +        (long *)_huff_lengthlist_line_2048x27_class1,
136.1236 +        0, 0, 0, 0, 0,
136.1237 +        NULL,
136.1238 +        0
136.1239 +};
136.1240 +
136.1241 +static const long _huff_lengthlist_line_2048x27_class2[] = {
136.1242 +         1, 2, 3, 6, 4, 7, 5, 7,
136.1243 +};
136.1244 +
136.1245 +static const static_codebook _huff_book_line_2048x27_class2 = {
136.1246 +        1, 8,
136.1247 +        (long *)_huff_lengthlist_line_2048x27_class2,
136.1248 +        0, 0, 0, 0, 0,
136.1249 +        NULL,
136.1250 +        0
136.1251 +};
136.1252 +
136.1253 +static const long _huff_lengthlist_line_2048x27_class3[] = {
136.1254 +         3, 3, 6,16, 5, 5, 7,16, 9, 8,11,16,16,16,16,16,
136.1255 +         5, 5, 8,16, 5, 5, 7,16, 8, 7, 9,16,16,16,16,16,
136.1256 +         9, 9,12,16, 6, 8,11,16, 9,10,11,16,16,16,16,16,
136.1257 +        16,16,16,16,13,16,16,16,15,16,16,16,16,16,16,16,
136.1258 +         5, 4, 7,16, 6, 5, 8,16, 9, 8,10,16,16,16,16,16,
136.1259 +         5, 5, 7,15, 5, 4, 6,15, 7, 6, 8,16,16,16,16,16,
136.1260 +         9, 9,11,15, 7, 7, 9,16, 8, 8, 9,16,16,16,16,16,
136.1261 +        16,16,16,16,15,15,15,16,15,15,14,16,16,16,16,16,
136.1262 +         8, 8,11,16, 8, 9,10,16,11,10,14,16,16,16,16,16,
136.1263 +         6, 8,10,16, 6, 7,10,16, 8, 8,11,16,14,16,16,16,
136.1264 +        10,11,14,16, 9, 9,11,16,10,10,11,16,16,16,16,16,
136.1265 +        16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
136.1266 +        16,16,16,16,15,16,16,16,16,16,16,16,16,16,16,16,
136.1267 +        12,16,15,16,12,14,16,16,16,16,16,16,16,16,16,16,
136.1268 +        16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
136.1269 +        16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
136.1270 +};
136.1271 +
136.1272 +static const static_codebook _huff_book_line_2048x27_class3 = {
136.1273 +        1, 256,
136.1274 +        (long *)_huff_lengthlist_line_2048x27_class3,
136.1275 +        0, 0, 0, 0, 0,
136.1276 +        NULL,
136.1277 +        0
136.1278 +};
136.1279 +
136.1280 +static const long _huff_lengthlist_line_2048x27_class4[] = {
136.1281 +         2, 4, 7,13, 4, 5, 7,15, 8, 7,10,16,16,14,16,16,
136.1282 +         2, 4, 7,16, 3, 4, 7,14, 8, 8,10,16,16,16,15,16,
136.1283 +         6, 8,11,16, 7, 7, 9,16,11, 9,13,16,16,16,15,16,
136.1284 +        16,16,16,16,14,16,16,16,16,16,16,16,16,16,16,16,
136.1285 +};
136.1286 +
136.1287 +static const static_codebook _huff_book_line_2048x27_class4 = {
136.1288 +        1, 64,
136.1289 +        (long *)_huff_lengthlist_line_2048x27_class4,
136.1290 +        0, 0, 0, 0, 0,
136.1291 +        NULL,
136.1292 +        0
136.1293 +};
136.1294 +
136.1295 +static const long _huff_lengthlist_line_2048x27_0sub0[] = {
136.1296 +         5, 5, 5, 5, 5, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 5,
136.1297 +         6, 5, 7, 5, 7, 5, 7, 5, 8, 5, 8, 5, 8, 5, 9, 5,
136.1298 +         9, 6,10, 6,10, 6,11, 6,11, 6,11, 6,11, 6,11, 6,
136.1299 +        11, 6,11, 6,12, 7,11, 7,11, 7,11, 7,11, 7,10, 7,
136.1300 +        11, 7,11, 7,12, 7,11, 8,11, 8,11, 8,11, 8,13, 8,
136.1301 +        12, 9,11, 9,11, 9,11,10,12,10,12, 9,12,10,12,11,
136.1302 +        14,12,16,12,12,11,14,16,17,17,17,17,17,17,17,17,
136.1303 +        17,17,17,17,17,17,17,17,17,17,17,17,16,16,16,16,
136.1304 +};
136.1305 +
136.1306 +static const static_codebook _huff_book_line_2048x27_0sub0 = {
136.1307 +        1, 128,
136.1308 +        (long *)_huff_lengthlist_line_2048x27_0sub0,
136.1309 +        0, 0, 0, 0, 0,
136.1310 +        NULL,
136.1311 +        0
136.1312 +};
136.1313 +
136.1314 +static const long _huff_lengthlist_line_2048x27_1sub0[] = {
136.1315 +         4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5,
136.1316 +         5, 5, 6, 6, 6, 6, 6, 6, 7, 6, 7, 6, 7, 6, 7, 6,
136.1317 +};
136.1318 +
136.1319 +static const static_codebook _huff_book_line_2048x27_1sub0 = {
136.1320 +        1, 32,
136.1321 +        (long *)_huff_lengthlist_line_2048x27_1sub0,
136.1322 +        0, 0, 0, 0, 0,
136.1323 +        NULL,
136.1324 +        0
136.1325 +};
136.1326 +
136.1327 +static const long _huff_lengthlist_line_2048x27_1sub1[] = {
136.1328 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
136.1329 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
136.1330 +         6, 5, 7, 5, 7, 4, 7, 4, 8, 4, 8, 4, 8, 4, 8, 3,
136.1331 +         8, 4, 9, 4, 9, 4, 9, 4, 9, 4, 9, 5, 9, 5, 9, 6,
136.1332 +         9, 7, 9, 8, 9, 9, 9,10, 9,11, 9,14, 9,15,10,15,
136.1333 +        10,15,10,15,10,15,11,15,10,14,12,14,11,14,13,14,
136.1334 +        13,15,15,15,12,15,15,15,13,15,13,15,13,15,15,15,
136.1335 +        15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,14,
136.1336 +};
136.1337 +
136.1338 +static const static_codebook _huff_book_line_2048x27_1sub1 = {
136.1339 +        1, 128,
136.1340 +        (long *)_huff_lengthlist_line_2048x27_1sub1,
136.1341 +        0, 0, 0, 0, 0,
136.1342 +        NULL,
136.1343 +        0
136.1344 +};
136.1345 +
136.1346 +static const long _huff_lengthlist_line_2048x27_2sub0[] = {
136.1347 +         2, 4, 5, 4, 5, 4, 5, 4, 5, 5, 5, 5, 5, 5, 6, 5,
136.1348 +         6, 5, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8,
136.1349 +};
136.1350 +
136.1351 +static const static_codebook _huff_book_line_2048x27_2sub0 = {
136.1352 +        1, 32,
136.1353 +        (long *)_huff_lengthlist_line_2048x27_2sub0,
136.1354 +        0, 0, 0, 0, 0,
136.1355 +        NULL,
136.1356 +        0
136.1357 +};
136.1358 +
136.1359 +static const long _huff_lengthlist_line_2048x27_2sub1[] = {
136.1360 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
136.1361 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
136.1362 +         3, 4, 3, 4, 3, 4, 4, 5, 4, 5, 5, 5, 6, 6, 6, 7,
136.1363 +         6, 8, 6, 8, 6, 9, 7,10, 7,10, 7,10, 7,12, 7,12,
136.1364 +         7,12, 9,12,11,12,10,12,10,12,11,12,12,12,10,12,
136.1365 +        10,12,10,12, 9,12,11,12,12,12,12,12,11,12,11,12,
136.1366 +        12,12,12,12,12,12,12,12,10,10,12,12,12,12,12,10,
136.1367 +        12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
136.1368 +};
136.1369 +
136.1370 +static const static_codebook _huff_book_line_2048x27_2sub1 = {
136.1371 +        1, 128,
136.1372 +        (long *)_huff_lengthlist_line_2048x27_2sub1,
136.1373 +        0, 0, 0, 0, 0,
136.1374 +        NULL,
136.1375 +        0
136.1376 +};
136.1377 +
136.1378 +static const long _huff_lengthlist_line_2048x27_3sub1[] = {
136.1379 +         0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
136.1380 +         5, 5,
136.1381 +};
136.1382 +
136.1383 +static const static_codebook _huff_book_line_2048x27_3sub1 = {
136.1384 +        1, 18,
136.1385 +        (long *)_huff_lengthlist_line_2048x27_3sub1,
136.1386 +        0, 0, 0, 0, 0,
136.1387 +        NULL,
136.1388 +        0
136.1389 +};
136.1390 +
136.1391 +static const long _huff_lengthlist_line_2048x27_3sub2[] = {
136.1392 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
136.1393 +         0, 0, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6,
136.1394 +         6, 7, 6, 7, 6, 8, 6, 9, 7, 9, 7, 9, 9,11, 9,12,
136.1395 +        10,12,
136.1396 +};
136.1397 +
136.1398 +static const static_codebook _huff_book_line_2048x27_3sub2 = {
136.1399 +        1, 50,
136.1400 +        (long *)_huff_lengthlist_line_2048x27_3sub2,
136.1401 +        0, 0, 0, 0, 0,
136.1402 +        NULL,
136.1403 +        0
136.1404 +};
136.1405 +
136.1406 +static const long _huff_lengthlist_line_2048x27_3sub3[] = {
136.1407 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
136.1408 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
136.1409 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
136.1410 +         0, 0, 3, 6, 3, 7, 3, 7, 5, 7, 7, 7, 7, 7, 6, 7,
136.1411 +         7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
136.1412 +         7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
136.1413 +         7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
136.1414 +         7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
136.1415 +};
136.1416 +
136.1417 +static const static_codebook _huff_book_line_2048x27_3sub3 = {
136.1418 +        1, 128,
136.1419 +        (long *)_huff_lengthlist_line_2048x27_3sub3,
136.1420 +        0, 0, 0, 0, 0,
136.1421 +        NULL,
136.1422 +        0
136.1423 +};
136.1424 +
136.1425 +static const long _huff_lengthlist_line_2048x27_4sub1[] = {
136.1426 +         0, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 4, 5, 4, 5, 4,
136.1427 +         4, 5,
136.1428 +};
136.1429 +
136.1430 +static const static_codebook _huff_book_line_2048x27_4sub1 = {
136.1431 +        1, 18,
136.1432 +        (long *)_huff_lengthlist_line_2048x27_4sub1,
136.1433 +        0, 0, 0, 0, 0,
136.1434 +        NULL,
136.1435 +        0
136.1436 +};
136.1437 +
136.1438 +static const long _huff_lengthlist_line_2048x27_4sub2[] = {
136.1439 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
136.1440 +         0, 0, 3, 2, 4, 3, 4, 4, 4, 5, 5, 6, 5, 6, 5, 7,
136.1441 +         6, 6, 6, 7, 7, 7, 8, 9, 9, 9,12,10,11,10,10,12,
136.1442 +        10,10,
136.1443 +};
136.1444 +
136.1445 +static const static_codebook _huff_book_line_2048x27_4sub2 = {
136.1446 +        1, 50,
136.1447 +        (long *)_huff_lengthlist_line_2048x27_4sub2,
136.1448 +        0, 0, 0, 0, 0,
136.1449 +        NULL,
136.1450 +        0
136.1451 +};
136.1452 +
136.1453 +static const long _huff_lengthlist_line_2048x27_4sub3[] = {
136.1454 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
136.1455 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
136.1456 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
136.1457 +         0, 0, 3, 6, 5, 7, 5, 7, 7, 7, 7, 7, 5, 7, 5, 7,
136.1458 +         5, 7, 5, 7, 7, 7, 7, 7, 4, 7, 7, 7, 7, 7, 7, 7,
136.1459 +         7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
136.1460 +         7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
136.1461 +         7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6,
136.1462 +};
136.1463 +
136.1464 +static const static_codebook _huff_book_line_2048x27_4sub3 = {
136.1465 +        1, 128,
136.1466 +        (long *)_huff_lengthlist_line_2048x27_4sub3,
136.1467 +        0, 0, 0, 0, 0,
136.1468 +        NULL,
136.1469 +        0
136.1470 +};
136.1471 +
136.1472 +static const long _huff_lengthlist_line_256x4low_class0[] = {
136.1473 +         4, 5, 6,11, 5, 5, 6,10, 7, 7, 6, 6,14,13, 9, 9,
136.1474 +         6, 6, 6,10, 6, 6, 6, 9, 8, 7, 7, 9,14,12, 8,11,
136.1475 +         8, 7, 7,11, 8, 8, 7,11, 9, 9, 7, 9,13,11, 9,13,
136.1476 +        19,19,18,19,15,16,16,19,11,11,10,13,10,10, 9,15,
136.1477 +         5, 5, 6,13, 6, 6, 6,11, 8, 7, 6, 7,14,11,10,11,
136.1478 +         6, 6, 6,12, 7, 6, 6,11, 8, 7, 7,11,13,11, 9,11,
136.1479 +         9, 7, 6,12, 8, 7, 6,12, 9, 8, 8,11,13,10, 7,13,
136.1480 +        19,19,17,19,17,14,14,19,12,10, 8,12,13,10, 9,16,
136.1481 +         7, 8, 7,12, 7, 7, 7,11, 8, 7, 7, 8,12,12,11,11,
136.1482 +         8, 8, 7,12, 8, 7, 6,11, 8, 7, 7,10,10,11,10,11,
136.1483 +         9, 8, 8,13, 9, 8, 7,12,10, 9, 7,11, 9, 8, 7,11,
136.1484 +        18,18,15,18,18,16,17,18,15,11,10,18,11, 9, 9,18,
136.1485 +        16,16,13,16,12,11,10,16,12,11, 9, 6,15,12,11,13,
136.1486 +        16,16,14,14,13,11,12,16,12, 9, 9,13,13,10,10,12,
136.1487 +        17,18,17,17,14,15,14,16,14,12,14,15,12,10,11,12,
136.1488 +        18,18,18,18,18,18,18,18,18,12,13,18,16,11, 9,18,
136.1489 +};
136.1490 +
136.1491 +static const static_codebook _huff_book_line_256x4low_class0 = {
136.1492 +        1, 256,
136.1493 +        (long *)_huff_lengthlist_line_256x4low_class0,
136.1494 +        0, 0, 0, 0, 0,
136.1495 +        NULL,
136.1496 +        0
136.1497 +};
136.1498 +
136.1499 +static const long _huff_lengthlist_line_256x4low_0sub0[] = {
136.1500 +         1, 3, 2, 3,
136.1501 +};
136.1502 +
136.1503 +static const static_codebook _huff_book_line_256x4low_0sub0 = {
136.1504 +        1, 4,
136.1505 +        (long *)_huff_lengthlist_line_256x4low_0sub0,
136.1506 +        0, 0, 0, 0, 0,
136.1507 +        NULL,
136.1508 +        0
136.1509 +};
136.1510 +
136.1511 +static const long _huff_lengthlist_line_256x4low_0sub1[] = {
136.1512 +         0, 0, 0, 0, 2, 3, 2, 3, 3, 3,
136.1513 +};
136.1514 +
136.1515 +static const static_codebook _huff_book_line_256x4low_0sub1 = {
136.1516 +        1, 10,
136.1517 +        (long *)_huff_lengthlist_line_256x4low_0sub1,
136.1518 +        0, 0, 0, 0, 0,
136.1519 +        NULL,
136.1520 +        0
136.1521 +};
136.1522 +
136.1523 +static const long _huff_lengthlist_line_256x4low_0sub2[] = {
136.1524 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 4, 3, 4,
136.1525 +         4, 4, 4, 4, 5, 5, 5, 6, 6,
136.1526 +};
136.1527 +
136.1528 +static const static_codebook _huff_book_line_256x4low_0sub2 = {
136.1529 +        1, 25,
136.1530 +        (long *)_huff_lengthlist_line_256x4low_0sub2,
136.1531 +        0, 0, 0, 0, 0,
136.1532 +        NULL,
136.1533 +        0
136.1534 +};
136.1535 +
136.1536 +static const long _huff_lengthlist_line_256x4low_0sub3[] = {
136.1537 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
136.1538 +         0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 2, 4, 3, 5, 4,
136.1539 +         5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 7, 7, 8, 6, 9,
136.1540 +         7,12,11,16,13,16,12,15,13,15,12,14,12,15,15,15,
136.1541 +};
136.1542 +
136.1543 +static const static_codebook _huff_book_line_256x4low_0sub3 = {
136.1544 +        1, 64,
136.1545 +        (long *)_huff_lengthlist_line_256x4low_0sub3,
136.1546 +        0, 0, 0, 0, 0,
136.1547 +        NULL,
136.1548 +        0
136.1549 +};
136.1550 +
   137.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   137.2 +++ b/libs/vorbis/books/uncoupled/res_books_uncoupled.h	Sun Nov 01 00:36:56 2015 +0200
   137.3 @@ -0,0 +1,7758 @@
   137.4 +/********************************************************************
   137.5 + *                                                                  *
   137.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   137.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   137.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   137.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  137.10 + *                                                                  *
  137.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007             *
  137.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  137.13 + *                                                                  *
  137.14 + ********************************************************************
  137.15 +
  137.16 + function: static codebooks autogenerated by huff/huffbuld
  137.17 + last modified: $Id: res_books_uncoupled.h 17022 2010-03-25 03:45:42Z xiphmont $
  137.18 +
  137.19 + ********************************************************************/
  137.20 +
  137.21 +#include "codebook.h"
  137.22 +
  137.23 +static const long _vq_quantlist__16u0__p1_0[] = {
  137.24 +        1,
  137.25 +        0,
  137.26 +        2,
  137.27 +};
  137.28 +
  137.29 +static const long _vq_lengthlist__16u0__p1_0[] = {
  137.30 +         1, 4, 4, 5, 7, 7, 5, 7, 8, 5, 8, 8, 8,10,10, 8,
  137.31 +        10,11, 5, 8, 8, 8,10,10, 8,10,10, 4, 9, 9, 9,12,
  137.32 +        11, 8,11,11, 8,12,11,10,12,14,10,13,13, 7,11,11,
  137.33 +        10,14,12,11,14,14, 4, 9, 9, 8,11,11, 9,11,12, 7,
  137.34 +        11,11,10,13,14,10,12,14, 8,11,12,10,14,14,10,13,
  137.35 +        12,
  137.36 +};
  137.37 +
  137.38 +static const static_codebook _16u0__p1_0 = {
  137.39 +        4, 81,
  137.40 +        (long *)_vq_lengthlist__16u0__p1_0,
  137.41 +        1, -535822336, 1611661312, 2, 0,
  137.42 +        (long *)_vq_quantlist__16u0__p1_0,
  137.43 +        0
  137.44 +};
  137.45 +
  137.46 +static const long _vq_quantlist__16u0__p2_0[] = {
  137.47 +        1,
  137.48 +        0,
  137.49 +        2,
  137.50 +};
  137.51 +
  137.52 +static const long _vq_lengthlist__16u0__p2_0[] = {
  137.53 +         2, 4, 4, 5, 6, 6, 5, 6, 6, 5, 7, 7, 7, 8, 9, 7,
  137.54 +         8, 9, 5, 7, 7, 7, 9, 8, 7, 9, 7, 4, 7, 7, 7, 9,
  137.55 +         9, 7, 8, 8, 6, 9, 8, 7, 8,11, 9,11,10, 6, 8, 9,
  137.56 +         8,11, 8, 9,10,11, 4, 7, 7, 7, 8, 8, 7, 9, 9, 6,
  137.57 +         9, 8, 9,11,10, 8, 8,11, 6, 8, 9, 9,10,11, 8,11,
  137.58 +         8,
  137.59 +};
  137.60 +
  137.61 +static const static_codebook _16u0__p2_0 = {
  137.62 +        4, 81,
  137.63 +        (long *)_vq_lengthlist__16u0__p2_0,
  137.64 +        1, -535822336, 1611661312, 2, 0,
  137.65 +        (long *)_vq_quantlist__16u0__p2_0,
  137.66 +        0
  137.67 +};
  137.68 +
  137.69 +static const long _vq_quantlist__16u0__p3_0[] = {
  137.70 +        2,
  137.71 +        1,
  137.72 +        3,
  137.73 +        0,
  137.74 +        4,
  137.75 +};
  137.76 +
  137.77 +static const long _vq_lengthlist__16u0__p3_0[] = {
  137.78 +         1, 5, 5, 7, 7, 6, 7, 7, 8, 8, 6, 7, 8, 8, 8, 8,
  137.79 +         9, 9,11,11, 8, 9, 9,11,11, 6, 9, 8,10,10, 8,10,
  137.80 +        10,11,11, 8,10,10,11,11,10,11,10,13,12, 9,11,10,
  137.81 +        13,13, 6, 8, 9,10,10, 8,10,10,11,11, 8,10,10,11,
  137.82 +        11, 9,10,11,13,12,10,10,11,12,12, 8,11,11,14,13,
  137.83 +        10,12,11,15,13, 9,12,11,15,14,12,14,13,16,14,12,
  137.84 +        13,13,17,14, 8,11,11,13,14, 9,11,12,14,15,10,11,
  137.85 +        12,13,15,11,13,13,14,16,12,13,14,14,16, 5, 9, 9,
  137.86 +        11,11, 9,11,11,12,12, 8,11,11,12,12,11,12,12,15,
  137.87 +        14,10,12,12,15,15, 8,11,11,13,12,10,12,12,13,13,
  137.88 +        10,12,12,14,13,12,12,13,14,15,11,13,13,17,16, 7,
  137.89 +        11,11,13,13,10,12,12,14,13,10,12,12,13,14,12,13,
  137.90 +        12,15,14,11,13,13,15,14, 9,12,12,16,15,11,13,13,
  137.91 +        17,16,10,13,13,16,16,13,14,15,15,16,13,15,14,19,
  137.92 +        17, 9,12,12,14,16,11,13,13,15,16,10,13,13,17,16,
  137.93 +        13,14,13,17,15,12,15,15,16,17, 5, 9, 9,11,11, 8,
  137.94 +        11,11,13,12, 9,11,11,12,12,10,12,12,14,15,11,12,
  137.95 +        12,14,14, 7,11,10,13,12,10,12,12,14,13,10,11,12,
  137.96 +        13,13,11,13,13,15,16,12,12,13,15,15, 7,11,11,13,
  137.97 +        13,10,13,13,14,14,10,12,12,13,13,11,13,13,16,15,
  137.98 +        12,13,13,15,14, 9,12,12,15,15,10,13,13,17,16,11,
  137.99 +        12,13,15,15,12,15,14,18,18,13,14,14,16,17, 9,12,
 137.100 +        12,15,16,10,13,13,15,16,11,13,13,15,16,13,15,15,
 137.101 +        17,17,13,15,14,16,15, 7,11,11,15,16,10,13,12,16,
 137.102 +        17,10,12,13,15,17,15,16,16,18,17,13,15,15,17,18,
 137.103 +         8,12,12,16,16,11,13,14,17,18,11,13,13,18,16,15,
 137.104 +        17,16,17,19,14,15,15,17,16, 8,12,12,16,15,11,14,
 137.105 +        13,18,17,11,13,14,18,17,15,16,16,18,17,13,16,16,
 137.106 +        18,18,11,15,14,18,17,13,14,15,18, 0,12,15,15, 0,
 137.107 +        17,17,16,17,17,18,14,16,18,18, 0,11,14,14,17, 0,
 137.108 +        12,15,14,17,19,12,15,14,18, 0,15,18,16, 0,17,14,
 137.109 +        18,16,18, 0, 7,11,11,16,15,10,12,12,18,16,10,13,
 137.110 +        13,16,15,13,15,14,17,17,14,16,16,19,18, 8,12,12,
 137.111 +        16,16,11,13,13,18,16,11,13,14,17,16,14,15,15,19,
 137.112 +        18,15,16,16, 0,19, 8,12,12,16,17,11,13,13,17,17,
 137.113 +        11,14,13,17,17,13,15,15,17,19,15,17,17,19, 0,11,
 137.114 +        14,15,19,17,12,15,16,18,18,12,14,15,19,17,14,16,
 137.115 +        17, 0,18,16,16,19,17, 0,11,14,14,18,19,12,15,14,
 137.116 +        17,17,13,16,14,17,16,14,17,16,18,18,15,18,15, 0,
 137.117 +        18,
 137.118 +};
 137.119 +
 137.120 +static const static_codebook _16u0__p3_0 = {
 137.121 +        4, 625,
 137.122 +        (long *)_vq_lengthlist__16u0__p3_0,
 137.123 +        1, -533725184, 1611661312, 3, 0,
 137.124 +        (long *)_vq_quantlist__16u0__p3_0,
 137.125 +        0
 137.126 +};
 137.127 +
 137.128 +static const long _vq_quantlist__16u0__p4_0[] = {
 137.129 +        2,
 137.130 +        1,
 137.131 +        3,
 137.132 +        0,
 137.133 +        4,
 137.134 +};
 137.135 +
 137.136 +static const long _vq_lengthlist__16u0__p4_0[] = {
 137.137 +         3, 5, 5, 8, 8, 6, 6, 6, 9, 9, 6, 6, 6, 9, 9, 9,
 137.138 +        10, 9,11,11, 9, 9, 9,11,11, 6, 7, 7,10,10, 7, 7,
 137.139 +         8,10,10, 7, 7, 8,10,10,10,10,10,11,12, 9,10,10,
 137.140 +        11,12, 6, 7, 7,10,10, 7, 8, 7,10,10, 7, 8, 7,10,
 137.141 +        10,10,11,10,12,11,10,10,10,13,10, 9,10,10,12,12,
 137.142 +        10,11,10,14,12, 9,11,11,13,13,11,12,13,13,13,11,
 137.143 +        12,12,15,13, 9,10,10,12,13, 9,11,10,12,13,10,10,
 137.144 +        11,12,13,11,12,12,12,13,11,12,12,13,13, 5, 7, 7,
 137.145 +        10,10, 7, 8, 8,10,10, 7, 8, 8,10,10,10,11,10,12,
 137.146 +        13,10,10,11,12,12, 6, 8, 8,11,10, 7, 8, 9,10,12,
 137.147 +         8, 9, 9,11,11,11,10,11,11,12,10,11,11,13,12, 7,
 137.148 +         8, 8,10,11, 8, 9, 8,11,10, 8, 9, 9,11,11,10,12,
 137.149 +        10,13,11,10,11,11,13,13,10,11,10,14,13,10,10,11,
 137.150 +        13,13,10,12,11,14,13,12,11,13,12,13,13,12,13,14,
 137.151 +        14,10,11,11,13,13,10,11,10,12,13,10,12,12,12,14,
 137.152 +        12,12,12,14,12,12,13,12,17,15, 5, 7, 7,10,10, 7,
 137.153 +         8, 8,10,10, 7, 8, 8,11,10,10,10,11,12,12,10,11,
 137.154 +        11,12,13, 6, 8, 8,11,10, 8, 9, 9,11,11, 7, 8, 9,
 137.155 +        10,11,11,11,11,12,12,10,10,11,12,13, 6, 8, 8,10,
 137.156 +        11, 8, 9, 9,11,11, 7, 9, 7,11,10,10,12,12,13,13,
 137.157 +        11,11,10,13,11, 9,11,10,14,13,11,11,11,15,13,10,
 137.158 +        10,11,13,13,12,13,13,14,14,12,11,12,12,13,10,11,
 137.159 +        11,12,13,10,11,12,13,13,10,11,10,13,12,12,12,13,
 137.160 +        14, 0,12,13,11,13,11, 8,10,10,13,13,10,11,11,14,
 137.161 +        13,10,11,11,13,12,13,14,14,14,15,12,12,12,15,14,
 137.162 +         9,11,10,13,12,10,10,11,13,14,11,11,11,15,12,13,
 137.163 +        12,14,15,16,13,13,13,14,13, 9,11,11,12,12,10,12,
 137.164 +        11,13,13,10,11,11,13,14,13,13,13,15,15,13,13,14,
 137.165 +        17,15,11,12,12,14,14,10,11,12,13,15,12,13,13, 0,
 137.166 +        15,13,11,14,12,16,14,16,14, 0,15,11,12,12,14,16,
 137.167 +        11,13,12,16,15,12,13,13,14,15,12,14,12,15,13,15,
 137.168 +        14,14,16,16, 8,10,10,13,13,10,11,10,13,14,10,11,
 137.169 +        11,13,13,13,13,12,14,14,14,13,13,16,17, 9,10,10,
 137.170 +        12,14,10,12,11,14,13,10,11,12,13,14,12,12,12,15,
 137.171 +        15,13,13,13,14,14, 9,10,10,13,13,10,11,12,12,14,
 137.172 +        10,11,10,13,13,13,13,13,14,16,13,13,13,14,14,11,
 137.173 +        12,13,15,13,12,14,13,14,16,12,12,13,13,14,13,14,
 137.174 +        14,17,15,13,12,17,13,16,11,12,13,14,15,12,13,14,
 137.175 +        14,17,11,12,11,14,14,13,16,14,16, 0,14,15,11,15,
 137.176 +        11,
 137.177 +};
 137.178 +
 137.179 +static const static_codebook _16u0__p4_0 = {
 137.180 +        4, 625,
 137.181 +        (long *)_vq_lengthlist__16u0__p4_0,
 137.182 +        1, -533725184, 1611661312, 3, 0,
 137.183 +        (long *)_vq_quantlist__16u0__p4_0,
 137.184 +        0
 137.185 +};
 137.186 +
 137.187 +static const long _vq_quantlist__16u0__p5_0[] = {
 137.188 +        4,
 137.189 +        3,
 137.190 +        5,
 137.191 +        2,
 137.192 +        6,
 137.193 +        1,
 137.194 +        7,
 137.195 +        0,
 137.196 +        8,
 137.197 +};
 137.198 +
 137.199 +static const long _vq_lengthlist__16u0__p5_0[] = {
 137.200 +         1, 4, 4, 7, 7, 7, 7, 9, 9, 4, 6, 6, 8, 8, 8, 8,
 137.201 +         9, 9, 4, 6, 6, 8, 8, 8, 8, 9, 9, 7, 8, 8, 9, 9,
 137.202 +         9, 9,11,10, 7, 8, 8, 9, 9, 9, 9,10,11, 7, 8, 8,
 137.203 +         9, 9,10,10,11,11, 7, 8, 8, 9, 9,10,10,11,11, 9,
 137.204 +         9, 9,10,10,11,11,12,12, 9, 9, 9,10,10,11,11,12,
 137.205 +        12,
 137.206 +};
 137.207 +
 137.208 +static const static_codebook _16u0__p5_0 = {
 137.209 +        2, 81,
 137.210 +        (long *)_vq_lengthlist__16u0__p5_0,
 137.211 +        1, -531628032, 1611661312, 4, 0,
 137.212 +        (long *)_vq_quantlist__16u0__p5_0,
 137.213 +        0
 137.214 +};
 137.215 +
 137.216 +static const long _vq_quantlist__16u0__p6_0[] = {
 137.217 +        6,
 137.218 +        5,
 137.219 +        7,
 137.220 +        4,
 137.221 +        8,
 137.222 +        3,
 137.223 +        9,
 137.224 +        2,
 137.225 +        10,
 137.226 +        1,
 137.227 +        11,
 137.228 +        0,
 137.229 +        12,
 137.230 +};
 137.231 +
 137.232 +static const long _vq_lengthlist__16u0__p6_0[] = {
 137.233 +         1, 4, 4, 7, 7,10,10,12,12,13,13,18,17, 3, 6, 6,
 137.234 +         9, 9,11,11,13,13,14,14,18,17, 3, 6, 6, 9, 9,11,
 137.235 +        11,13,13,14,14,17,18, 7, 9, 9,11,11,13,13,14,14,
 137.236 +        15,15, 0, 0, 7, 9, 9,11,11,13,13,14,14,15,16,19,
 137.237 +        18,10,11,11,13,13,14,14,16,15,17,18, 0, 0,10,11,
 137.238 +        11,13,13,14,14,15,15,16,18, 0, 0,11,13,13,14,14,
 137.239 +        15,15,17,17, 0,19, 0, 0,11,13,13,14,14,14,15,16,
 137.240 +        18, 0,19, 0, 0,13,14,14,15,15,18,17,18,18, 0,19,
 137.241 +         0, 0,13,14,14,15,16,16,16,18,18,19, 0, 0, 0,16,
 137.242 +        17,17, 0,17,19,19, 0,19, 0, 0, 0, 0,16,19,16,17,
 137.243 +        18, 0,19, 0, 0, 0, 0, 0, 0,
 137.244 +};
 137.245 +
 137.246 +static const static_codebook _16u0__p6_0 = {
 137.247 +        2, 169,
 137.248 +        (long *)_vq_lengthlist__16u0__p6_0,
 137.249 +        1, -526516224, 1616117760, 4, 0,
 137.250 +        (long *)_vq_quantlist__16u0__p6_0,
 137.251 +        0
 137.252 +};
 137.253 +
 137.254 +static const long _vq_quantlist__16u0__p6_1[] = {
 137.255 +        2,
 137.256 +        1,
 137.257 +        3,
 137.258 +        0,
 137.259 +        4,
 137.260 +};
 137.261 +
 137.262 +static const long _vq_lengthlist__16u0__p6_1[] = {
 137.263 +         1, 4, 5, 6, 6, 4, 6, 6, 6, 6, 4, 6, 6, 6, 6, 6,
 137.264 +         6, 6, 7, 7, 6, 6, 6, 7, 7,
 137.265 +};
 137.266 +
 137.267 +static const static_codebook _16u0__p6_1 = {
 137.268 +        2, 25,
 137.269 +        (long *)_vq_lengthlist__16u0__p6_1,
 137.270 +        1, -533725184, 1611661312, 3, 0,
 137.271 +        (long *)_vq_quantlist__16u0__p6_1,
 137.272 +        0
 137.273 +};
 137.274 +
 137.275 +static const long _vq_quantlist__16u0__p7_0[] = {
 137.276 +        1,
 137.277 +        0,
 137.278 +        2,
 137.279 +};
 137.280 +
 137.281 +static const long _vq_lengthlist__16u0__p7_0[] = {
 137.282 +         1, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
 137.283 +         8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
 137.284 +         8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
 137.285 +         7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
 137.286 +         7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
 137.287 +         7,
 137.288 +};
 137.289 +
 137.290 +static const static_codebook _16u0__p7_0 = {
 137.291 +        4, 81,
 137.292 +        (long *)_vq_lengthlist__16u0__p7_0,
 137.293 +        1, -518803456, 1628680192, 2, 0,
 137.294 +        (long *)_vq_quantlist__16u0__p7_0,
 137.295 +        0
 137.296 +};
 137.297 +
 137.298 +static const long _vq_quantlist__16u0__p7_1[] = {
 137.299 +        7,
 137.300 +        6,
 137.301 +        8,
 137.302 +        5,
 137.303 +        9,
 137.304 +        4,
 137.305 +        10,
 137.306 +        3,
 137.307 +        11,
 137.308 +        2,
 137.309 +        12,
 137.310 +        1,
 137.311 +        13,
 137.312 +        0,
 137.313 +        14,
 137.314 +};
 137.315 +
 137.316 +static const long _vq_lengthlist__16u0__p7_1[] = {
 137.317 +         1, 5, 5, 6, 5, 9,10,11,11,10,10,10,10,10,10, 5,
 137.318 +         8, 8, 8,10,10,10,10,10,10,10,10,10,10,10, 5, 8,
 137.319 +         9, 9, 9,10,10,10,10,10,10,10,10,10,10, 5,10, 8,
 137.320 +        10,10,10,10,10,10,10,10,10,10,10,10, 4, 8, 9,10,
 137.321 +        10,10,10,10,10,10,10,10,10,10,10, 9,10,10,10,10,
 137.322 +        10,10,10,10,10,10,10,10,10,10, 9,10,10,10,10,10,
 137.323 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
 137.324 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
 137.325 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
 137.326 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
 137.327 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
 137.328 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
 137.329 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
 137.330 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
 137.331 +        10,
 137.332 +};
 137.333 +
 137.334 +static const static_codebook _16u0__p7_1 = {
 137.335 +        2, 225,
 137.336 +        (long *)_vq_lengthlist__16u0__p7_1,
 137.337 +        1, -520986624, 1620377600, 4, 0,
 137.338 +        (long *)_vq_quantlist__16u0__p7_1,
 137.339 +        0
 137.340 +};
 137.341 +
 137.342 +static const long _vq_quantlist__16u0__p7_2[] = {
 137.343 +        10,
 137.344 +        9,
 137.345 +        11,
 137.346 +        8,
 137.347 +        12,
 137.348 +        7,
 137.349 +        13,
 137.350 +        6,
 137.351 +        14,
 137.352 +        5,
 137.353 +        15,
 137.354 +        4,
 137.355 +        16,
 137.356 +        3,
 137.357 +        17,
 137.358 +        2,
 137.359 +        18,
 137.360 +        1,
 137.361 +        19,
 137.362 +        0,
 137.363 +        20,
 137.364 +};
 137.365 +
 137.366 +static const long _vq_lengthlist__16u0__p7_2[] = {
 137.367 +         1, 6, 6, 7, 8, 7, 7,10, 9,10, 9,11,10, 9,11,10,
 137.368 +         9, 9, 9, 9,10, 6, 8, 7, 9, 9, 8, 8,10,10, 9,11,
 137.369 +        11,12,12,10, 9,11, 9,12,10, 9, 6, 9, 8, 9,12, 8,
 137.370 +         8,11, 9,11,11,12,11,12,12,10,11,11,10,10,11, 7,
 137.371 +        10, 9, 9, 9, 9, 9,10, 9,10, 9,10,10,12,10,10,10,
 137.372 +        11,12,10,10, 7, 9, 9, 9,10, 9, 9,10,10, 9, 9, 9,
 137.373 +        11,11,10,10,10,10, 9, 9,12, 7, 9,10, 9,11, 9,10,
 137.374 +         9,10,11,11,11,10,11,12, 9,12,11,10,10,10, 7, 9,
 137.375 +         9, 9, 9,10,12,10, 9,11,12,10,11,12,12,11, 9,10,
 137.376 +        11,10,11, 7, 9,10,10,11,10, 9,10,11,11,11,10,12,
 137.377 +        12,12,11,11,10,11,11,12, 8, 9,10,12,11,10,10,12,
 137.378 +        12,12,12,12,10,11,11, 9,11,10,12,11,11, 8, 9,10,
 137.379 +        10,11,12,11,11,10,10,10,12,12,12, 9,10,12,12,12,
 137.380 +        12,12, 8,10,11,10,10,12, 9,11,12,12,11,12,12,12,
 137.381 +        12,10,12,10,10,10,10, 8,12,11,11,11,10,10,11,12,
 137.382 +        12,12,12,11,12,12,12,11,11,11,12,10, 9,10,10,12,
 137.383 +        10,12,10,12,12,10,10,10,11,12,12,12,11,12,12,12,
 137.384 +        11,10,11,12,12,12,11,12,12,11,12,12,11,12,12,12,
 137.385 +        12,11,12,12,10,10,10,10,11,11,12,11,12,12,12,12,
 137.386 +        12,12,12,11,12,11,10,11,11,12,11,11, 9,10,10,10,
 137.387 +        12,10,10,11, 9,11,12,11,12,11,12,12,10,11,10,12,
 137.388 +         9, 9, 9,12,11,10,11,10,12,10,12,10,12,12,12,11,
 137.389 +        11,11,11,11,10, 9,10,10,11,10,11,11,12,11,10,11,
 137.390 +        12,12,12,11,11, 9,12,10,12, 9,10,12,10,10,11,10,
 137.391 +        11,11,12,11,10,11,10,11,11,11,11,12,11,11,10, 9,
 137.392 +        10,10,10, 9,11,11,10, 9,12,10,11,12,11,12,12,11,
 137.393 +        12,11,12,11,10,11,10,12,11,12,11,12,11,12,10,11,
 137.394 +        10,10,12,11,10,11,11,11,10,
 137.395 +};
 137.396 +
 137.397 +static const static_codebook _16u0__p7_2 = {
 137.398 +        2, 441,
 137.399 +        (long *)_vq_lengthlist__16u0__p7_2,
 137.400 +        1, -529268736, 1611661312, 5, 0,
 137.401 +        (long *)_vq_quantlist__16u0__p7_2,
 137.402 +        0
 137.403 +};
 137.404 +
 137.405 +static const long _huff_lengthlist__16u0__single[] = {
 137.406 +         3, 5, 8, 7,14, 8, 9,19, 5, 2, 5, 5, 9, 6, 9,19,
 137.407 +         8, 4, 5, 7, 8, 9,13,19, 7, 4, 6, 5, 9, 6, 9,19,
 137.408 +        12, 8, 7, 9,10,11,13,19, 8, 5, 8, 6, 9, 6, 7,19,
 137.409 +         8, 8,10, 7, 7, 4, 5,19,12,17,19,15,18,13,11,18,
 137.410 +};
 137.411 +
 137.412 +static const static_codebook _huff_book__16u0__single = {
 137.413 +        2, 64,
 137.414 +        (long *)_huff_lengthlist__16u0__single,
 137.415 +        0, 0, 0, 0, 0,
 137.416 +        NULL,
 137.417 +        0
 137.418 +};
 137.419 +
 137.420 +static const long _huff_lengthlist__16u1__long[] = {
 137.421 +         3, 6,10, 8,12, 8,14, 8,14,19, 5, 3, 5, 5, 7, 6,
 137.422 +        11, 7,16,19, 7, 5, 6, 7, 7, 9,11,12,19,19, 6, 4,
 137.423 +         7, 5, 7, 6,10, 7,18,18, 8, 6, 7, 7, 7, 7, 8, 9,
 137.424 +        18,18, 7, 5, 8, 5, 7, 5, 8, 6,18,18,12, 9,10, 9,
 137.425 +         9, 9, 8, 9,18,18, 8, 7,10, 6, 8, 5, 6, 4,11,18,
 137.426 +        11,15,16,12,11, 8, 8, 6, 9,18,14,18,18,18,16,16,
 137.427 +        16,13,16,18,
 137.428 +};
 137.429 +
 137.430 +static const static_codebook _huff_book__16u1__long = {
 137.431 +        2, 100,
 137.432 +        (long *)_huff_lengthlist__16u1__long,
 137.433 +        0, 0, 0, 0, 0,
 137.434 +        NULL,
 137.435 +        0
 137.436 +};
 137.437 +
 137.438 +static const long _vq_quantlist__16u1__p1_0[] = {
 137.439 +        1,
 137.440 +        0,
 137.441 +        2,
 137.442 +};
 137.443 +
 137.444 +static const long _vq_lengthlist__16u1__p1_0[] = {
 137.445 +         1, 4, 4, 5, 7, 7, 5, 7, 7, 5, 8, 7, 7,10,10, 7,
 137.446 +         9,10, 5, 7, 8, 7,10, 9, 7,10,10, 5, 8, 8, 8,10,
 137.447 +        10, 8,10,10, 7,10,10,10,11,12,10,12,13, 7,10,10,
 137.448 +         9,13,11,10,12,13, 5, 8, 8, 8,10,10, 8,10,10, 7,
 137.449 +        10,10,10,12,12, 9,11,12, 7,10,11,10,12,12,10,13,
 137.450 +        11,
 137.451 +};
 137.452 +
 137.453 +static const static_codebook _16u1__p1_0 = {
 137.454 +        4, 81,
 137.455 +        (long *)_vq_lengthlist__16u1__p1_0,
 137.456 +        1, -535822336, 1611661312, 2, 0,
 137.457 +        (long *)_vq_quantlist__16u1__p1_0,
 137.458 +        0
 137.459 +};
 137.460 +
 137.461 +static const long _vq_quantlist__16u1__p2_0[] = {
 137.462 +        1,
 137.463 +        0,
 137.464 +        2,
 137.465 +};
 137.466 +
 137.467 +static const long _vq_lengthlist__16u1__p2_0[] = {
 137.468 +         3, 4, 4, 5, 6, 6, 5, 6, 6, 5, 6, 6, 6, 7, 8, 6,
 137.469 +         7, 8, 5, 6, 6, 6, 8, 7, 6, 8, 7, 5, 6, 6, 6, 8,
 137.470 +         8, 6, 8, 8, 6, 8, 8, 7, 7,10, 8, 9, 9, 6, 8, 8,
 137.471 +         7, 9, 8, 8, 9,10, 5, 6, 6, 6, 8, 8, 7, 8, 8, 6,
 137.472 +         8, 8, 8,10, 9, 7, 8, 9, 6, 8, 8, 8, 9, 9, 7,10,
 137.473 +         8,
 137.474 +};
 137.475 +
 137.476 +static const static_codebook _16u1__p2_0 = {
 137.477 +        4, 81,
 137.478 +        (long *)_vq_lengthlist__16u1__p2_0,
 137.479 +        1, -535822336, 1611661312, 2, 0,
 137.480 +        (long *)_vq_quantlist__16u1__p2_0,
 137.481 +        0
 137.482 +};
 137.483 +
 137.484 +static const long _vq_quantlist__16u1__p3_0[] = {
 137.485 +        2,
 137.486 +        1,
 137.487 +        3,
 137.488 +        0,
 137.489 +        4,
 137.490 +};
 137.491 +
 137.492 +static const long _vq_lengthlist__16u1__p3_0[] = {
 137.493 +         1, 5, 5, 8, 8, 6, 7, 7, 9, 9, 5, 7, 7, 9, 9, 9,
 137.494 +        10, 9,11,11, 9, 9,10,11,11, 6, 8, 8,10,10, 8, 9,
 137.495 +        10,11,11, 8, 9,10,11,11,10,11,11,12,13,10,11,11,
 137.496 +        13,13, 6, 8, 8,10,10, 8,10, 9,11,11, 8,10, 9,11,
 137.497 +        11,10,11,11,13,13,10,11,11,13,12, 9,11,11,14,13,
 137.498 +        10,12,12,15,14,10,12,11,14,13,12,13,13,15,15,12,
 137.499 +        13,13,16,14, 9,11,11,13,14,10,11,12,14,14,10,12,
 137.500 +        12,14,15,12,13,13,14,15,12,13,14,15,16, 5, 8, 8,
 137.501 +        11,11, 8,10,10,12,12, 8,10,10,12,12,11,12,12,14,
 137.502 +        14,11,12,12,14,14, 8,10,10,12,12, 9,11,12,12,13,
 137.503 +        10,12,12,13,13,12,12,13,14,15,11,13,13,15,15, 7,
 137.504 +        10,10,12,12, 9,12,11,13,12,10,11,12,13,13,12,13,
 137.505 +        12,15,14,11,12,13,15,15,10,12,12,15,14,11,13,13,
 137.506 +        16,15,11,13,13,16,15,14,13,14,15,16,13,15,15,17,
 137.507 +        17,10,12,12,14,15,11,12,12,15,15,11,13,13,15,16,
 137.508 +        13,15,13,16,15,13,15,15,16,17, 5, 8, 8,11,11, 8,
 137.509 +        10,10,12,12, 8,10,10,12,12,11,12,12,14,14,11,12,
 137.510 +        12,14,14, 7,10,10,12,12,10,12,12,14,13, 9,11,12,
 137.511 +        12,13,12,13,13,15,15,12,12,13,13,15, 7,10,10,12,
 137.512 +        13,10,11,12,13,13,10,12,11,13,13,11,13,13,15,15,
 137.513 +        12,13,12,15,14, 9,12,12,15,14,11,13,13,15,15,11,
 137.514 +        12,13,15,15,13,14,14,17,19,13,13,14,16,16,10,12,
 137.515 +        12,14,15,11,13,13,15,16,11,13,12,16,15,13,15,15,
 137.516 +        17,18,14,15,13,16,15, 8,11,11,15,14,10,12,12,16,
 137.517 +        15,10,12,12,16,16,14,15,15,18,17,13,14,15,16,18,
 137.518 +         9,12,12,15,15,11,12,14,16,17,11,13,13,16,15,15,
 137.519 +        15,15,17,18,14,15,16,17,17, 9,12,12,15,15,11,14,
 137.520 +        13,16,16,11,13,13,16,16,15,16,15,17,18,14,16,15,
 137.521 +        17,16,12,14,14,17,16,12,14,15,18,17,13,15,15,17,
 137.522 +        17,15,15,18,16,20,15,16,17,18,18,11,14,14,16,17,
 137.523 +        13,15,14,18,17,13,15,15,17,17,15,17,15,18,17,15,
 137.524 +        17,16,19,18, 8,11,11,14,15,10,12,12,15,15,10,12,
 137.525 +        12,16,16,13,14,14,17,16,14,15,15,17,17, 9,12,12,
 137.526 +        15,16,11,13,13,16,16,11,12,13,16,16,14,16,15,20,
 137.527 +        17,14,16,16,17,17, 9,12,12,15,16,11,13,13,16,17,
 137.528 +        11,13,13,17,16,14,15,15,17,18,15,15,15,18,18,11,
 137.529 +        14,14,17,16,13,15,15,17,17,13,14,14,18,17,15,16,
 137.530 +        16,18,19,15,15,17,17,19,11,14,14,16,17,13,15,14,
 137.531 +        17,19,13,15,14,18,17,15,17,16,18,18,15,17,15,18,
 137.532 +        16,
 137.533 +};
 137.534 +
 137.535 +static const static_codebook _16u1__p3_0 = {
 137.536 +        4, 625,
 137.537 +        (long *)_vq_lengthlist__16u1__p3_0,
 137.538 +        1, -533725184, 1611661312, 3, 0,
 137.539 +        (long *)_vq_quantlist__16u1__p3_0,
 137.540 +        0
 137.541 +};
 137.542 +
 137.543 +static const long _vq_quantlist__16u1__p4_0[] = {
 137.544 +        2,
 137.545 +        1,
 137.546 +        3,
 137.547 +        0,
 137.548 +        4,
 137.549 +};
 137.550 +
 137.551 +static const long _vq_lengthlist__16u1__p4_0[] = {
 137.552 +         4, 5, 5, 8, 8, 6, 6, 7, 9, 9, 6, 6, 6, 9, 9, 9,
 137.553 +        10, 9,11,11, 9, 9,10,11,11, 6, 7, 7,10, 9, 7, 7,
 137.554 +         8, 9,10, 7, 7, 8,10,10,10,10,10,10,12, 9, 9,10,
 137.555 +        11,12, 6, 7, 7, 9, 9, 7, 8, 7,10,10, 7, 8, 7,10,
 137.556 +        10, 9,10, 9,12,11,10,10, 9,12,10, 9,10,10,12,11,
 137.557 +        10,10,10,12,12, 9,10,10,12,12,12,11,12,13,13,11,
 137.558 +        11,12,12,13, 9,10,10,11,12, 9,10,10,12,12,10,10,
 137.559 +        10,12,12,11,12,11,14,13,11,12,12,14,13, 5, 7, 7,
 137.560 +        10,10, 7, 8, 8,10,10, 7, 8, 7,10,10,10,10,10,12,
 137.561 +        12,10,10,10,12,12, 6, 8, 7,10,10, 7, 7, 9,10,11,
 137.562 +         8, 9, 9,11,10,10,10,11,11,13,10,10,11,12,13, 6,
 137.563 +         8, 8,10,10, 7, 9, 8,11,10, 8, 9, 9,10,11,10,11,
 137.564 +        10,13,11,10,11,10,12,12,10,11,10,12,11,10,10,10,
 137.565 +        12,13,10,11,11,13,12,11,11,13,11,14,12,12,13,14,
 137.566 +        14, 9,10,10,12,13,10,11,10,13,12,10,11,11,12,13,
 137.567 +        11,12,11,14,12,12,13,13,15,14, 5, 7, 7,10,10, 7,
 137.568 +         7, 8,10,10, 7, 8, 8,10,10,10,10,10,11,12,10,10,
 137.569 +        10,12,12, 7, 8, 8,10,10, 8, 9, 8,11,10, 7, 8, 9,
 137.570 +        10,11,10,11,11,12,12,10,10,11,11,13, 7, 7, 8,10,
 137.571 +        10, 8, 8, 9,10,11, 7, 9, 7,11,10,10,11,11,13,12,
 137.572 +        11,11,10,13,11, 9,10,10,12,12,10,11,11,13,12,10,
 137.573 +        10,11,12,12,12,13,13,14,14,11,11,12,12,14,10,10,
 137.574 +        11,12,12,10,11,11,12,13,10,10,10,13,12,12,13,13,
 137.575 +        15,14,12,13,10,14,11, 8,10,10,12,12,10,11,10,13,
 137.576 +        13, 9,10,10,12,12,12,13,13,15,14,11,12,12,13,13,
 137.577 +         9,10,10,13,12,10,10,11,13,13,10,11,10,13,12,12,
 137.578 +        12,13,14,15,12,13,12,15,13, 9,10,10,12,13,10,11,
 137.579 +        10,13,12,10,10,11,12,13,12,14,12,15,13,12,12,13,
 137.580 +        14,15,11,12,11,14,13,11,11,12,14,15,12,13,12,15,
 137.581 +        14,13,11,15,11,16,13,14,14,16,15,11,12,12,14,14,
 137.582 +        11,12,11,14,13,12,12,13,14,15,13,14,12,16,12,14,
 137.583 +        14,14,15,15, 8,10,10,12,12, 9,10,10,12,12,10,10,
 137.584 +        11,13,13,11,12,12,13,13,12,13,13,14,15, 9,10,10,
 137.585 +        13,12,10,11,11,13,12,10,10,11,13,13,12,13,12,15,
 137.586 +        14,12,12,13,13,16, 9, 9,10,12,13,10,10,11,12,13,
 137.587 +        10,11,10,13,13,12,12,13,13,15,13,13,12,15,13,11,
 137.588 +        12,12,14,14,12,13,12,15,14,11,11,12,13,14,14,14,
 137.589 +        14,16,15,13,12,15,12,16,11,11,12,13,14,12,13,13,
 137.590 +        14,15,10,12,11,14,13,14,15,14,16,16,13,14,11,15,
 137.591 +        11,
 137.592 +};
 137.593 +
 137.594 +static const static_codebook _16u1__p4_0 = {
 137.595 +        4, 625,
 137.596 +        (long *)_vq_lengthlist__16u1__p4_0,
 137.597 +        1, -533725184, 1611661312, 3, 0,
 137.598 +        (long *)_vq_quantlist__16u1__p4_0,
 137.599 +        0
 137.600 +};
 137.601 +
 137.602 +static const long _vq_quantlist__16u1__p5_0[] = {
 137.603 +        4,
 137.604 +        3,
 137.605 +        5,
 137.606 +        2,
 137.607 +        6,
 137.608 +        1,
 137.609 +        7,
 137.610 +        0,
 137.611 +        8,
 137.612 +};
 137.613 +
 137.614 +static const long _vq_lengthlist__16u1__p5_0[] = {
 137.615 +         1, 4, 4, 7, 7, 7, 7, 9, 9, 4, 6, 6, 8, 8, 8, 8,
 137.616 +        10,10, 4, 5, 6, 8, 8, 8, 8,10,10, 7, 8, 8, 9, 9,
 137.617 +         9, 9,11,11, 7, 8, 8, 9, 9, 9, 9,11,11, 7, 8, 8,
 137.618 +        10, 9,11,11,12,11, 7, 8, 8, 9, 9,11,11,12,12, 9,
 137.619 +        10,10,11,11,12,12,13,12, 9,10,10,11,11,12,12,12,
 137.620 +        13,
 137.621 +};
 137.622 +
 137.623 +static const static_codebook _16u1__p5_0 = {
 137.624 +        2, 81,
 137.625 +        (long *)_vq_lengthlist__16u1__p5_0,
 137.626 +        1, -531628032, 1611661312, 4, 0,
 137.627 +        (long *)_vq_quantlist__16u1__p5_0,
 137.628 +        0
 137.629 +};
 137.630 +
 137.631 +static const long _vq_quantlist__16u1__p6_0[] = {
 137.632 +        4,
 137.633 +        3,
 137.634 +        5,
 137.635 +        2,
 137.636 +        6,
 137.637 +        1,
 137.638 +        7,
 137.639 +        0,
 137.640 +        8,
 137.641 +};
 137.642 +
 137.643 +static const long _vq_lengthlist__16u1__p6_0[] = {
 137.644 +         3, 4, 4, 6, 6, 7, 7, 9, 9, 4, 4, 4, 6, 6, 8, 8,
 137.645 +         9, 9, 4, 4, 4, 6, 6, 7, 7, 9, 9, 6, 6, 6, 7, 7,
 137.646 +         8, 8,10, 9, 6, 6, 6, 7, 7, 8, 8, 9,10, 7, 8, 7,
 137.647 +         8, 8, 9, 9,10,10, 7, 8, 8, 8, 8, 9, 9,10,10, 9,
 137.648 +         9, 9,10,10,10,10,11,11, 9, 9, 9,10,10,10,10,11,
 137.649 +        11,
 137.650 +};
 137.651 +
 137.652 +static const static_codebook _16u1__p6_0 = {
 137.653 +        2, 81,
 137.654 +        (long *)_vq_lengthlist__16u1__p6_0,
 137.655 +        1, -531628032, 1611661312, 4, 0,
 137.656 +        (long *)_vq_quantlist__16u1__p6_0,
 137.657 +        0
 137.658 +};
 137.659 +
 137.660 +static const long _vq_quantlist__16u1__p7_0[] = {
 137.661 +        1,
 137.662 +        0,
 137.663 +        2,
 137.664 +};
 137.665 +
 137.666 +static const long _vq_lengthlist__16u1__p7_0[] = {
 137.667 +         1, 4, 4, 4, 8, 8, 4, 8, 8, 5,11, 9, 8,12,11, 8,
 137.668 +        12,11, 5,10,11, 8,11,12, 8,11,12, 4,11,11,11,14,
 137.669 +        13,10,13,13, 8,14,13,12,14,16,12,16,15, 8,14,14,
 137.670 +        13,16,14,12,15,16, 4,11,11,10,14,13,11,14,14, 8,
 137.671 +        15,14,12,15,15,12,14,16, 8,14,14,11,16,15,12,15,
 137.672 +        13,
 137.673 +};
 137.674 +
 137.675 +static const static_codebook _16u1__p7_0 = {
 137.676 +        4, 81,
 137.677 +        (long *)_vq_lengthlist__16u1__p7_0,
 137.678 +        1, -529137664, 1618345984, 2, 0,
 137.679 +        (long *)_vq_quantlist__16u1__p7_0,
 137.680 +        0
 137.681 +};
 137.682 +
 137.683 +static const long _vq_quantlist__16u1__p7_1[] = {
 137.684 +        5,
 137.685 +        4,
 137.686 +        6,
 137.687 +        3,
 137.688 +        7,
 137.689 +        2,
 137.690 +        8,
 137.691 +        1,
 137.692 +        9,
 137.693 +        0,
 137.694 +        10,
 137.695 +};
 137.696 +
 137.697 +static const long _vq_lengthlist__16u1__p7_1[] = {
 137.698 +         2, 4, 4, 6, 6, 7, 7, 8, 8, 8, 8, 4, 6, 5, 7, 7,
 137.699 +         8, 8, 8, 8, 8, 8, 4, 5, 6, 7, 7, 8, 8, 8, 8, 8,
 137.700 +         8, 6, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 6, 7, 7, 8,
 137.701 +         8, 8, 8, 9, 9, 9, 9, 7, 8, 8, 8, 8, 9, 9, 9,10,
 137.702 +         9,10, 7, 8, 8, 8, 8, 9, 9, 9, 9,10, 9, 8, 8, 8,
 137.703 +         9, 9,10,10,10,10,10,10, 8, 8, 8, 9, 9, 9, 9,10,
 137.704 +        10,10,10, 8, 8, 8, 9, 9, 9,10,10,10,10,10, 8, 8,
 137.705 +         8, 9, 9,10,10,10,10,10,10,
 137.706 +};
 137.707 +
 137.708 +static const static_codebook _16u1__p7_1 = {
 137.709 +        2, 121,
 137.710 +        (long *)_vq_lengthlist__16u1__p7_1,
 137.711 +        1, -531365888, 1611661312, 4, 0,
 137.712 +        (long *)_vq_quantlist__16u1__p7_1,
 137.713 +        0
 137.714 +};
 137.715 +
 137.716 +static const long _vq_quantlist__16u1__p8_0[] = {
 137.717 +        5,
 137.718 +        4,
 137.719 +        6,
 137.720 +        3,
 137.721 +        7,
 137.722 +        2,
 137.723 +        8,
 137.724 +        1,
 137.725 +        9,
 137.726 +        0,
 137.727 +        10,
 137.728 +};
 137.729 +
 137.730 +static const long _vq_lengthlist__16u1__p8_0[] = {
 137.731 +         1, 4, 4, 5, 5, 8, 8,10,10,12,12, 4, 7, 7, 8, 8,
 137.732 +         9, 9,12,11,14,13, 4, 7, 7, 7, 8, 9,10,11,11,13,
 137.733 +        12, 5, 8, 8, 9, 9,11,11,12,13,15,14, 5, 7, 8, 9,
 137.734 +         9,11,11,13,13,17,15, 8, 9,10,11,11,12,13,17,14,
 137.735 +        17,16, 8,10, 9,11,11,12,12,13,15,15,17,10,11,11,
 137.736 +        12,13,14,15,15,16,16,17, 9,11,11,12,12,14,15,17,
 137.737 +        15,15,16,11,14,12,14,15,16,15,16,16,16,15,11,13,
 137.738 +        13,14,14,15,15,16,16,15,16,
 137.739 +};
 137.740 +
 137.741 +static const static_codebook _16u1__p8_0 = {
 137.742 +        2, 121,
 137.743 +        (long *)_vq_lengthlist__16u1__p8_0,
 137.744 +        1, -524582912, 1618345984, 4, 0,
 137.745 +        (long *)_vq_quantlist__16u1__p8_0,
 137.746 +        0
 137.747 +};
 137.748 +
 137.749 +static const long _vq_quantlist__16u1__p8_1[] = {
 137.750 +        5,
 137.751 +        4,
 137.752 +        6,
 137.753 +        3,
 137.754 +        7,
 137.755 +        2,
 137.756 +        8,
 137.757 +        1,
 137.758 +        9,
 137.759 +        0,
 137.760 +        10,
 137.761 +};
 137.762 +
 137.763 +static const long _vq_lengthlist__16u1__p8_1[] = {
 137.764 +         2, 5, 5, 6, 6, 7, 7, 8, 8, 8, 8, 4, 6, 6, 7, 7,
 137.765 +         8, 7, 8, 8, 8, 8, 4, 6, 6, 7, 7, 7, 7, 8, 8, 8,
 137.766 +         8, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 9, 6, 7, 7, 7,
 137.767 +         7, 8, 8, 8, 8, 9, 9, 7, 7, 7, 8, 8, 8, 8, 9, 9,
 137.768 +         9, 9, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 8, 8, 8,
 137.769 +         8, 8, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 9, 9, 9,
 137.770 +         9, 9, 9, 8, 8, 8, 9, 8, 9, 9, 9, 9, 9, 9, 8, 8,
 137.771 +         8, 9, 9, 9, 9, 9, 9, 9, 9,
 137.772 +};
 137.773 +
 137.774 +static const static_codebook _16u1__p8_1 = {
 137.775 +        2, 121,
 137.776 +        (long *)_vq_lengthlist__16u1__p8_1,
 137.777 +        1, -531365888, 1611661312, 4, 0,
 137.778 +        (long *)_vq_quantlist__16u1__p8_1,
 137.779 +        0
 137.780 +};
 137.781 +
 137.782 +static const long _vq_quantlist__16u1__p9_0[] = {
 137.783 +        7,
 137.784 +        6,
 137.785 +        8,
 137.786 +        5,
 137.787 +        9,
 137.788 +        4,
 137.789 +        10,
 137.790 +        3,
 137.791 +        11,
 137.792 +        2,
 137.793 +        12,
 137.794 +        1,
 137.795 +        13,
 137.796 +        0,
 137.797 +        14,
 137.798 +};
 137.799 +
 137.800 +static const long _vq_lengthlist__16u1__p9_0[] = {
 137.801 +         1, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
 137.802 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
 137.803 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
 137.804 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
 137.805 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
 137.806 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
 137.807 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
 137.808 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
 137.809 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
 137.810 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
 137.811 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
 137.812 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
 137.813 +         9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
 137.814 +         8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
 137.815 +         8,
 137.816 +};
 137.817 +
 137.818 +static const static_codebook _16u1__p9_0 = {
 137.819 +        2, 225,
 137.820 +        (long *)_vq_lengthlist__16u1__p9_0,
 137.821 +        1, -514071552, 1627381760, 4, 0,
 137.822 +        (long *)_vq_quantlist__16u1__p9_0,
 137.823 +        0
 137.824 +};
 137.825 +
 137.826 +static const long _vq_quantlist__16u1__p9_1[] = {
 137.827 +        7,
 137.828 +        6,
 137.829 +        8,
 137.830 +        5,
 137.831 +        9,
 137.832 +        4,
 137.833 +        10,
 137.834 +        3,
 137.835 +        11,
 137.836 +        2,
 137.837 +        12,
 137.838 +        1,
 137.839 +        13,
 137.840 +        0,
 137.841 +        14,
 137.842 +};
 137.843 +
 137.844 +static const long _vq_lengthlist__16u1__p9_1[] = {
 137.845 +         1, 6, 5, 9, 9,10,10, 6, 7, 9, 9,10,10,10,10, 5,
 137.846 +        10, 8,10, 8,10,10, 8, 8,10, 9,10,10,10,10, 5, 8,
 137.847 +         9,10,10,10,10, 8,10,10,10,10,10,10,10, 9,10,10,
 137.848 +        10,10,10,10, 9, 9,10,10,10,10,10,10, 9, 9, 8, 9,
 137.849 +        10,10,10, 9,10,10,10,10,10,10,10,10,10,10,10,10,
 137.850 +        10,10,10,10,10,10,10,10,10,10,10, 8,10,10,10,10,
 137.851 +        10,10,10,10,10,10,10,10,10, 6, 8, 8,10,10,10, 8,
 137.852 +        10,10,10,10,10,10,10,10, 5, 8, 8,10,10,10, 9, 9,
 137.853 +        10,10,10,10,10,10,10,10, 9,10,10,10,10,10,10,10,
 137.854 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
 137.855 +        10,10,10,10,10,10,10,10, 9, 9, 9, 9, 9, 9, 9, 9,
 137.856 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
 137.857 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
 137.858 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
 137.859 +         9,
 137.860 +};
 137.861 +
 137.862 +static const static_codebook _16u1__p9_1 = {
 137.863 +        2, 225,
 137.864 +        (long *)_vq_lengthlist__16u1__p9_1,
 137.865 +        1, -522338304, 1620115456, 4, 0,
 137.866 +        (long *)_vq_quantlist__16u1__p9_1,
 137.867 +        0
 137.868 +};
 137.869 +
 137.870 +static const long _vq_quantlist__16u1__p9_2[] = {
 137.871 +        8,
 137.872 +        7,
 137.873 +        9,
 137.874 +        6,
 137.875 +        10,
 137.876 +        5,
 137.877 +        11,
 137.878 +        4,
 137.879 +        12,
 137.880 +        3,
 137.881 +        13,
 137.882 +        2,
 137.883 +        14,
 137.884 +        1,
 137.885 +        15,
 137.886 +        0,
 137.887 +        16,
 137.888 +};
 137.889 +
 137.890 +static const long _vq_lengthlist__16u1__p9_2[] = {
 137.891 +         1, 6, 6, 7, 8, 8,11,10, 9, 9,11, 9,10, 9,11,11,
 137.892 +         9, 6, 7, 6,11, 8,11, 9,10,10,11, 9,11,10,10,10,
 137.893 +        11, 9, 5, 7, 7, 8, 8,10,11, 8, 8,11, 9, 9,10,11,
 137.894 +         9,10,11, 8, 9, 6, 8, 8, 9, 9,10,10,11,11,11, 9,
 137.895 +        11,10, 9,11, 8, 8, 8, 9, 8, 9,10,11, 9, 9,11,11,
 137.896 +        10, 9, 9,11,10, 8,11, 8, 9, 8,11, 9,10, 9,10,11,
 137.897 +        11,10,10, 9,10,10, 8, 8, 9,10,10,10, 9,11, 9,10,
 137.898 +        11,11,11,11,10, 9,11, 9, 9,11,11,10, 8,11,11,11,
 137.899 +         9,10,10,11,10,11,11, 9,11,10, 9,11,10,10,10,10,
 137.900 +         9,11,10,11,10, 9, 9,10,11, 9, 8,10,11,11,10,10,
 137.901 +        11, 9,11,10,11,11,10,11, 9, 9, 8,10, 8, 9,11, 9,
 137.902 +         8,10,10, 9,11,10,11,10,11, 9,11, 8,10,11,11,11,
 137.903 +        11,10,10,11,11,11,11,10,11,11,10, 9, 8,10,10, 9,
 137.904 +        11,10,11,11,11, 9, 9, 9,11,11,11,10,10, 9, 9,10,
 137.905 +         9,11,11,11,11, 8,10,11,10,11,11,10,11,11, 9, 9,
 137.906 +         9,10, 9,11, 9,11,11,11,11,11,10,11,11,10,11,10,
 137.907 +        11,11, 9,11,10,11,10, 9,10, 9,10,10,11,11,11,11,
 137.908 +         9,10, 9,10,11,11,10,11,11,11,11,11,11,10,11,11,
 137.909 +        10,
 137.910 +};
 137.911 +
 137.912 +static const static_codebook _16u1__p9_2 = {
 137.913 +        2, 289,
 137.914 +        (long *)_vq_lengthlist__16u1__p9_2,
 137.915 +        1, -529530880, 1611661312, 5, 0,
 137.916 +        (long *)_vq_quantlist__16u1__p9_2,
 137.917 +        0
 137.918 +};
 137.919 +
 137.920 +static const long _huff_lengthlist__16u1__short[] = {
 137.921 +         5, 7,10, 9,11,10,15,11,13,16, 6, 4, 6, 6, 7, 7,
 137.922 +        10, 9,12,16,10, 6, 5, 6, 6, 7,10,11,16,16, 9, 6,
 137.923 +         7, 6, 7, 7,10, 8,14,16,11, 6, 5, 4, 5, 6, 8, 9,
 137.924 +        15,16, 9, 6, 6, 5, 6, 6, 9, 8,14,16,12, 7, 6, 6,
 137.925 +         5, 6, 6, 7,13,16, 8, 6, 7, 6, 5, 5, 4, 4,11,16,
 137.926 +         9, 8, 9, 9, 7, 7, 6, 5,13,16,14,14,16,15,16,15,
 137.927 +        16,16,16,16,
 137.928 +};
 137.929 +
 137.930 +static const static_codebook _huff_book__16u1__short = {
 137.931 +        2, 100,
 137.932 +        (long *)_huff_lengthlist__16u1__short,
 137.933 +        0, 0, 0, 0, 0,
 137.934 +        NULL,
 137.935 +        0
 137.936 +};
 137.937 +
 137.938 +static const long _huff_lengthlist__16u2__long[] = {
 137.939 +	 5, 8,10,10,10,11,11,12,14,18, 7, 5, 5, 6, 8, 9,
 137.940 +	10,12,14,17, 9, 5, 4, 5, 6, 8,10,11,13,19, 9, 5,
 137.941 +	 4, 4, 5, 6, 9,10,12,17, 8, 6, 5, 4, 4, 5, 7,10,
 137.942 +	11,15, 8, 7, 7, 6, 5, 5, 6, 9,11,14, 8, 9, 8, 7,
 137.943 +	 6, 5, 6, 7,11,14, 9,11,11, 9, 7, 6, 6, 6, 9,14,
 137.944 +	11,14,15,13, 9, 8, 7, 7, 9,14,13,15,19,17,12,11,
 137.945 +	10, 9,10,14,
 137.946 +};
 137.947 +
 137.948 +static const static_codebook _huff_book__16u2__long = {
 137.949 +	2, 100,
 137.950 +	(long *)_huff_lengthlist__16u2__long,
 137.951 +	0, 0, 0, 0, 0,
 137.952 +	NULL,
 137.953 +	0
 137.954 +};
 137.955 +
 137.956 +static const long _vq_quantlist__16u2_p1_0[] = {
 137.957 +	1,
 137.958 +	0,
 137.959 +	2,
 137.960 +};
 137.961 +
 137.962 +static const long _vq_lengthlist__16u2_p1_0[] = {
 137.963 +	 1, 5, 5, 5, 7, 7, 5, 7, 7, 5, 7, 7, 7, 9, 9, 7,
 137.964 +	 9, 9, 5, 7, 7, 7, 9, 9, 8, 9, 9, 5, 7, 7, 8, 9,
 137.965 +	 9, 7, 9, 9, 7, 9, 9, 9,10,11, 9,10,10, 7, 9, 9,
 137.966 +	 9,10, 9, 9,10,11, 5, 8, 7, 7, 9, 9, 8, 9, 9, 7,
 137.967 +	 9, 9, 9,11,10, 9, 9,10, 7, 9, 9, 9,10,10, 9,11,
 137.968 +	10,
 137.969 +};
 137.970 +
 137.971 +static const static_codebook _16u2_p1_0 = {
 137.972 +	4, 81,
 137.973 +	(long *)_vq_lengthlist__16u2_p1_0,
 137.974 +	1, -535822336, 1611661312, 2, 0,
 137.975 +	(long *)_vq_quantlist__16u2_p1_0,
 137.976 +	0
 137.977 +};
 137.978 +
 137.979 +static const long _vq_quantlist__16u2_p2_0[] = {
 137.980 +	2,
 137.981 +	1,
 137.982 +	3,
 137.983 +	0,
 137.984 +	4,
 137.985 +};
 137.986 +
 137.987 +static const long _vq_lengthlist__16u2_p2_0[] = {
 137.988 +	 3, 5, 5, 8, 8, 5, 7, 7, 9, 9, 5, 7, 7, 9, 9, 9,
 137.989 +	10, 9,11,11, 9, 9, 9,11,11, 5, 7, 7, 9, 9, 7, 8,
 137.990 +	 8,10,10, 7, 8, 8,10,10,10,10,10,12,12, 9,10,10,
 137.991 +	11,12, 5, 7, 7, 9, 9, 7, 8, 8,10,10, 7, 8, 8,10,
 137.992 +	10, 9,10,10,12,11,10,10,10,12,12, 9,10,10,12,12,
 137.993 +	10,10,10,12,12, 9,10,10,12,12,12,12,12,14,14,11,
 137.994 +	12,12,13,14, 9,10,10,12,12, 9,10,10,12,12,10,10,
 137.995 +	10,12,12,11,12,12,14,13,12,12,12,14,13, 5, 7, 7,
 137.996 +	 9, 9, 7, 8, 8,10,10, 7, 8, 8,10,10,10,10,10,12,
 137.997 +	12,10,10,10,12,12, 7, 8, 8,11,10, 8, 9, 9,11,11,
 137.998 +	 8, 9, 9,11,11,10,11,11,12,13,10,11,11,12,13, 7,
 137.999 +	 8, 8,10,10, 8, 9, 8,11,10, 8, 9, 9,11,11,10,11,
137.1000 +	10,13,12,10,11,11,13,13,10,11,10,13,12,10,11,11,
137.1001 +	13,13,10,11,11,13,13,12,12,13,13,14,12,13,13,14,
137.1002 +	14, 9,10,10,12,12,10,11,10,13,12,10,11,11,13,13,
137.1003 +	12,13,12,14,13,12,13,13,14,15, 5, 7, 7, 9,10, 7,
137.1004 +	 8, 8,10,10, 7, 8, 8,10,10,10,10,10,12,12,10,10,
137.1005 +	11,12,12, 7, 8, 8,10,10, 8, 9, 9,11,11, 8, 8, 9,
137.1006 +	10,11,10,11,11,13,13,10,10,11,12,13, 7, 8, 8,10,
137.1007 +	10, 8, 9, 9,11,11, 8, 9, 9,11,11,10,11,11,13,12,
137.1008 +	10,11,11,13,12, 9,10,10,12,12,10,11,11,13,13,10,
137.1009 +	10,11,12,13,12,13,13,15,14,12,12,13,12,14, 9,10,
137.1010 +	11,12,13,10,11,11,13,13,10,11,11,13,13,12,13,13,
137.1011 +	14,14,12,13,12,14,13, 8,10,10,12,12, 9,11,10,13,
137.1012 +	12, 9,10,10,12,13,12,13,13,14,14,12,12,12,14,14,
137.1013 +	 9,10,10,13,13,10,11,11,13,13,10,11,11,13,13,13,
137.1014 +	13,13,14,15,12,13,13,14,15, 9,10,10,12,13,10,11,
137.1015 +	10,13,13,10,11,11,12,13,12,13,12,15,14,12,13,13,
137.1016 +	14,15,11,12,12,15,14,12,12,13,14,15,12,13,13,15,
137.1017 +	14,13,13,15,14,16,14,14,14,16,15,11,12,12,14,14,
137.1018 +	11,12,12,14,14,12,13,13,14,15,13,14,13,15,13,14,
137.1019 +	14,14,15,16, 8, 9,10,12,12, 9,10,10,13,12, 9,10,
137.1020 +	11,12,13,12,12,12,14,14,12,13,13,14,14, 9,10,10,
137.1021 +	13,12,10,11,11,13,13,10,10,11,13,13,12,13,13,15,
137.1022 +	14,12,12,13,14,15, 9,10,10,13,13,10,11,11,13,13,
137.1023 +	10,11,11,13,13,12,13,13,14,14,13,13,13,15,15,11,
137.1024 +	12,12,14,13,12,13,13,15,14,11,12,12,14,14,14,14,
137.1025 +	14,16,15,13,13,14,13,16,11,12,12,14,14,12,13,13,
137.1026 +	14,15,12,13,12,14,14,14,14,14,16,16,14,15,13,16,
137.1027 +	14,
137.1028 +};
137.1029 +
137.1030 +static const static_codebook _16u2_p2_0 = {
137.1031 +	4, 625,
137.1032 +	(long *)_vq_lengthlist__16u2_p2_0,
137.1033 +	1, -533725184, 1611661312, 3, 0,
137.1034 +	(long *)_vq_quantlist__16u2_p2_0,
137.1035 +	0
137.1036 +};
137.1037 +
137.1038 +static const long _vq_quantlist__16u2_p3_0[] = {
137.1039 +	4,
137.1040 +	3,
137.1041 +	5,
137.1042 +	2,
137.1043 +	6,
137.1044 +	1,
137.1045 +	7,
137.1046 +	0,
137.1047 +	8,
137.1048 +};
137.1049 +
137.1050 +static const long _vq_lengthlist__16u2_p3_0[] = {
137.1051 +	 2, 4, 4, 6, 6, 7, 7, 9, 9, 4, 5, 5, 6, 6, 8, 7,
137.1052 +	 9, 9, 4, 5, 5, 6, 6, 7, 8, 9, 9, 6, 6, 6, 7, 7,
137.1053 +	 8, 8,10,10, 6, 6, 6, 7, 7, 8, 8,10,10, 7, 8, 7,
137.1054 +	 8, 8, 9, 9,11,10, 7, 7, 8, 8, 8, 9, 9,10,11, 9,
137.1055 +	 9, 9,10,10,11,10,11,11, 9, 9, 9,10,10,10,11,11,
137.1056 +	11,
137.1057 +};
137.1058 +
137.1059 +static const static_codebook _16u2_p3_0 = {
137.1060 +	2, 81,
137.1061 +	(long *)_vq_lengthlist__16u2_p3_0,
137.1062 +	1, -531628032, 1611661312, 4, 0,
137.1063 +	(long *)_vq_quantlist__16u2_p3_0,
137.1064 +	0
137.1065 +};
137.1066 +
137.1067 +static const long _vq_quantlist__16u2_p4_0[] = {
137.1068 +	8,
137.1069 +	7,
137.1070 +	9,
137.1071 +	6,
137.1072 +	10,
137.1073 +	5,
137.1074 +	11,
137.1075 +	4,
137.1076 +	12,
137.1077 +	3,
137.1078 +	13,
137.1079 +	2,
137.1080 +	14,
137.1081 +	1,
137.1082 +	15,
137.1083 +	0,
137.1084 +	16,
137.1085 +};
137.1086 +
137.1087 +static const long _vq_lengthlist__16u2_p4_0[] = {
137.1088 +	 2, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9,10,10,11,11,11,
137.1089 +	11, 5, 5, 5, 7, 6, 8, 7, 9, 9, 9, 9,10,10,11,11,
137.1090 +	12,12, 5, 5, 5, 6, 6, 7, 8, 8, 9, 9, 9,10,10,11,
137.1091 +	11,12,12, 6, 7, 6, 7, 7, 8, 8, 9, 9, 9, 9,10,10,
137.1092 +	11,11,12,12, 6, 6, 7, 7, 7, 8, 8, 9, 9, 9, 9,10,
137.1093 +	10,11,11,12,12, 7, 8, 8, 8, 8, 9, 9, 9, 9,10,10,
137.1094 +	11,11,11,11,12,12, 7, 7, 8, 8, 8, 9, 9, 9, 9,10,
137.1095 +	10,11,11,11,11,12,12, 8, 9, 9, 9, 9, 9, 9,10,10,
137.1096 +	10,10,11,11,12,12,12,12, 8, 9, 9, 9, 9, 9, 9,10,
137.1097 +	10,10,10,11,11,12,12,12,12, 9, 9, 9, 9, 9,10,10,
137.1098 +	10,10,10,11,11,11,12,12,13,13, 9, 9, 9, 9, 9,10,
137.1099 +	10,10,10,11,10,11,11,12,12,13,13,10,10,10,10,10,
137.1100 +	11,11,11,11,11,11,11,12,12,12,13,13,10,10,10,10,
137.1101 +	10,11,11,11,11,11,11,12,11,12,12,13,13,11,11,11,
137.1102 +	11,11,11,11,12,12,12,12,12,12,13,13,13,13,11,11,
137.1103 +	11,11,11,11,11,12,12,12,12,13,12,13,13,13,13,11,
137.1104 +	12,12,12,12,12,12,12,12,13,13,13,13,13,13,14,14,
137.1105 +	11,12,12,12,12,12,12,12,13,13,13,13,13,13,13,14,
137.1106 +	14,
137.1107 +};
137.1108 +
137.1109 +static const static_codebook _16u2_p4_0 = {
137.1110 +	2, 289,
137.1111 +	(long *)_vq_lengthlist__16u2_p4_0,
137.1112 +	1, -529530880, 1611661312, 5, 0,
137.1113 +	(long *)_vq_quantlist__16u2_p4_0,
137.1114 +	0
137.1115 +};
137.1116 +
137.1117 +static const long _vq_quantlist__16u2_p5_0[] = {
137.1118 +	1,
137.1119 +	0,
137.1120 +	2,
137.1121 +};
137.1122 +
137.1123 +static const long _vq_lengthlist__16u2_p5_0[] = {
137.1124 +	 1, 4, 4, 5, 7, 7, 5, 7, 7, 5, 8, 8, 7, 9, 9, 7,
137.1125 +	 9,10, 5, 8, 8, 7,10, 9, 7,10, 9, 5, 8, 8, 8,11,
137.1126 +	10, 8,10,10, 7,10,10, 9, 9,12,10,12,12, 7,10,10,
137.1127 +	 9,12,10,10,11,12, 5, 8, 8, 8,10,10, 8,11,11, 7,
137.1128 +	11,10,10,12,11, 9,10,12, 7,10,11,10,12,12, 9,12,
137.1129 +	 9,
137.1130 +};
137.1131 +
137.1132 +static const static_codebook _16u2_p5_0 = {
137.1133 +	4, 81,
137.1134 +	(long *)_vq_lengthlist__16u2_p5_0,
137.1135 +	1, -529137664, 1618345984, 2, 0,
137.1136 +	(long *)_vq_quantlist__16u2_p5_0,
137.1137 +	0
137.1138 +};
137.1139 +
137.1140 +static const long _vq_quantlist__16u2_p5_1[] = {
137.1141 +	5,
137.1142 +	4,
137.1143 +	6,
137.1144 +	3,
137.1145 +	7,
137.1146 +	2,
137.1147 +	8,
137.1148 +	1,
137.1149 +	9,
137.1150 +	0,
137.1151 +	10,
137.1152 +};
137.1153 +
137.1154 +static const long _vq_lengthlist__16u2_p5_1[] = {
137.1155 +	 2, 5, 5, 6, 6, 7, 7, 8, 8, 8, 8, 5, 6, 6, 7, 7,
137.1156 +	 7, 7, 8, 8, 8, 8, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8,
137.1157 +	 8, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 6, 7, 7, 7,
137.1158 +	 7, 8, 8, 8, 8, 8, 8, 7, 7, 7, 8, 8, 8, 8, 8, 8,
137.1159 +	 8, 8, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
137.1160 +	 8, 8, 8, 8, 8, 8, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8,
137.1161 +	 8, 9, 9, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 8, 8,
137.1162 +	 8, 8, 8, 8, 8, 9, 9, 9, 9,
137.1163 +};
137.1164 +
137.1165 +static const static_codebook _16u2_p5_1 = {
137.1166 +	2, 121,
137.1167 +	(long *)_vq_lengthlist__16u2_p5_1,
137.1168 +	1, -531365888, 1611661312, 4, 0,
137.1169 +	(long *)_vq_quantlist__16u2_p5_1,
137.1170 +	0
137.1171 +};
137.1172 +
137.1173 +static const long _vq_quantlist__16u2_p6_0[] = {
137.1174 +	6,
137.1175 +	5,
137.1176 +	7,
137.1177 +	4,
137.1178 +	8,
137.1179 +	3,
137.1180 +	9,
137.1181 +	2,
137.1182 +	10,
137.1183 +	1,
137.1184 +	11,
137.1185 +	0,
137.1186 +	12,
137.1187 +};
137.1188 +
137.1189 +static const long _vq_lengthlist__16u2_p6_0[] = {
137.1190 +	 1, 5, 4, 7, 7, 8, 8, 8, 8,10,10,11,11, 4, 6, 6,
137.1191 +	 7, 7, 9, 9, 9, 9,10,10,11,11, 4, 6, 6, 7, 7, 9,
137.1192 +	 9, 9, 9,10,10,11,11, 7, 8, 8, 9, 9, 9, 9,10,10,
137.1193 +	11,11,12,12, 7, 7, 7, 9, 8,10, 9,10,10,11,11,12,
137.1194 +	12, 8, 9, 9, 9,10,10,10,11,11,12,12,13,13, 8, 9,
137.1195 +	 9,10, 9,10,10,11,11,12,12,13,13, 8, 9, 9,10,10,
137.1196 +	11,11,11,11,12,12,13,13, 8, 9, 9,10,10,11,11,12,
137.1197 +	11,12,12,13,13,10,10,10,11,11,12,12,12,12,13,13,
137.1198 +	14,14,10,10,10,11,11,12,12,12,12,13,13,14,14,11,
137.1199 +	11,11,12,12,13,13,13,13,14,14,14,14,11,11,11,12,
137.1200 +	12,13,13,13,13,14,14,14,14,
137.1201 +};
137.1202 +
137.1203 +static const static_codebook _16u2_p6_0 = {
137.1204 +	2, 169,
137.1205 +	(long *)_vq_lengthlist__16u2_p6_0,
137.1206 +	1, -526516224, 1616117760, 4, 0,
137.1207 +	(long *)_vq_quantlist__16u2_p6_0,
137.1208 +	0
137.1209 +};
137.1210 +
137.1211 +static const long _vq_quantlist__16u2_p6_1[] = {
137.1212 +	2,
137.1213 +	1,
137.1214 +	3,
137.1215 +	0,
137.1216 +	4,
137.1217 +};
137.1218 +
137.1219 +static const long _vq_lengthlist__16u2_p6_1[] = {
137.1220 +	 2, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
137.1221 +	 5, 5, 5, 5, 5, 5, 5, 5, 5,
137.1222 +};
137.1223 +
137.1224 +static const static_codebook _16u2_p6_1 = {
137.1225 +	2, 25,
137.1226 +	(long *)_vq_lengthlist__16u2_p6_1,
137.1227 +	1, -533725184, 1611661312, 3, 0,
137.1228 +	(long *)_vq_quantlist__16u2_p6_1,
137.1229 +	0
137.1230 +};
137.1231 +
137.1232 +static const long _vq_quantlist__16u2_p7_0[] = {
137.1233 +	6,
137.1234 +	5,
137.1235 +	7,
137.1236 +	4,
137.1237 +	8,
137.1238 +	3,
137.1239 +	9,
137.1240 +	2,
137.1241 +	10,
137.1242 +	1,
137.1243 +	11,
137.1244 +	0,
137.1245 +	12,
137.1246 +};
137.1247 +
137.1248 +static const long _vq_lengthlist__16u2_p7_0[] = {
137.1249 +	 1, 4, 4, 7, 7, 8, 8, 8, 8, 9, 9,10,10, 4, 6, 6,
137.1250 +	 8, 8, 9, 9, 9, 9,10,10,11,10, 4, 6, 6, 8, 8, 9,
137.1251 +	 9, 9, 9,10,10,11,11, 7, 8, 8,10, 9,10,10,10,10,
137.1252 +	11,11,12,12, 7, 8, 8,10,10,10,10,10,10,11,11,12,
137.1253 +	12, 8, 9, 9,10,10,11,11,11,11,12,12,13,13, 8, 9,
137.1254 +	 9,10,10,11,11,11,11,12,12,13,13, 8, 9, 9,11,10,
137.1255 +	11,11,12,12,13,13,14,13, 8, 9, 9,10,10,11,11,12,
137.1256 +	12,13,13,13,13, 9,10,10,11,11,12,12,13,13,13,13,
137.1257 +	14,14, 9,10,10,11,11,12,12,13,13,13,13,14,14,10,
137.1258 +	11,11,12,12,13,13,14,13,14,14,15,14,10,11,11,12,
137.1259 +	12,13,13,14,13,14,14,15,14,
137.1260 +};
137.1261 +
137.1262 +static const static_codebook _16u2_p7_0 = {
137.1263 +	2, 169,
137.1264 +	(long *)_vq_lengthlist__16u2_p7_0,
137.1265 +	1, -523206656, 1618345984, 4, 0,
137.1266 +	(long *)_vq_quantlist__16u2_p7_0,
137.1267 +	0
137.1268 +};
137.1269 +
137.1270 +static const long _vq_quantlist__16u2_p7_1[] = {
137.1271 +	5,
137.1272 +	4,
137.1273 +	6,
137.1274 +	3,
137.1275 +	7,
137.1276 +	2,
137.1277 +	8,
137.1278 +	1,
137.1279 +	9,
137.1280 +	0,
137.1281 +	10,
137.1282 +};
137.1283 +
137.1284 +static const long _vq_lengthlist__16u2_p7_1[] = {
137.1285 +	 2, 5, 5, 7, 7, 7, 7, 7, 7, 8, 8, 5, 6, 6, 7, 7,
137.1286 +	 7, 7, 8, 8, 8, 8, 5, 6, 6, 7, 7, 7, 7, 8, 8, 8,
137.1287 +	 8, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7,
137.1288 +	 7, 8, 8, 8, 8, 8, 8, 7, 7, 7, 8, 8, 8, 8, 8, 8,
137.1289 +	 8, 8, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 7, 8, 8,
137.1290 +	 8, 8, 8, 8, 8, 8, 8, 8, 7, 8, 8, 8, 8, 8, 8, 8,
137.1291 +	 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
137.1292 +	 8, 8, 8, 8, 8, 8, 8, 8, 8,
137.1293 +};
137.1294 +
137.1295 +static const static_codebook _16u2_p7_1 = {
137.1296 +	2, 121,
137.1297 +	(long *)_vq_lengthlist__16u2_p7_1,
137.1298 +	1, -531365888, 1611661312, 4, 0,
137.1299 +	(long *)_vq_quantlist__16u2_p7_1,
137.1300 +	0
137.1301 +};
137.1302 +
137.1303 +static const long _vq_quantlist__16u2_p8_0[] = {
137.1304 +	7,
137.1305 +	6,
137.1306 +	8,
137.1307 +	5,
137.1308 +	9,
137.1309 +	4,
137.1310 +	10,
137.1311 +	3,
137.1312 +	11,
137.1313 +	2,
137.1314 +	12,
137.1315 +	1,
137.1316 +	13,
137.1317 +	0,
137.1318 +	14,
137.1319 +};
137.1320 +
137.1321 +static const long _vq_lengthlist__16u2_p8_0[] = {
137.1322 +	 1, 4, 4, 7, 7, 8, 8, 7, 7, 9, 8,10, 9,11,11, 4,
137.1323 +	 7, 6, 9, 8, 9, 9, 9, 9,10, 9,11, 9,12, 9, 4, 6,
137.1324 +	 7, 8, 8, 9, 9, 9, 9,10,10,10,11,11,12, 7, 9, 8,
137.1325 +	10,10,11,11,10,10,11,11,12,12,13,12, 7, 8, 8,10,
137.1326 +	10,10,11,10,10,11,11,11,12,12,13, 8, 9, 9,11,11,
137.1327 +	11,11,11,11,12,12,13,13,13,13, 8, 9, 9,11,11,11,
137.1328 +	11,11,11,12,12,13,13,13,14, 8, 9, 9,10,10,11,11,
137.1329 +	12,11,13,13,14,13,14,14, 8, 9, 9,10,10,11,11,12,
137.1330 +	12,12,12,13,13,14,14, 9,10,10,11,11,12,12,13,12,
137.1331 +	13,13,14,14,15,15, 9,10,10,11,11,12,12,12,13,13,
137.1332 +	13,14,14,14,15,10,11,11,12,12,13,13,14,13,14,14,
137.1333 +	15,14,15,15,10,11,11,12,12,13,12,13,14,14,14,14,
137.1334 +	14,15,15,11,12,12,13,13,13,13,14,14,15,14,15,15,
137.1335 +	16,16,11,12,12,13,13,13,13,14,14,14,15,15,15,16,
137.1336 +	16,
137.1337 +};
137.1338 +
137.1339 +static const static_codebook _16u2_p8_0 = {
137.1340 +	2, 225,
137.1341 +	(long *)_vq_lengthlist__16u2_p8_0,
137.1342 +	1, -520986624, 1620377600, 4, 0,
137.1343 +	(long *)_vq_quantlist__16u2_p8_0,
137.1344 +	0
137.1345 +};
137.1346 +
137.1347 +static const long _vq_quantlist__16u2_p8_1[] = {
137.1348 +	10,
137.1349 +	9,
137.1350 +	11,
137.1351 +	8,
137.1352 +	12,
137.1353 +	7,
137.1354 +	13,
137.1355 +	6,
137.1356 +	14,
137.1357 +	5,
137.1358 +	15,
137.1359 +	4,
137.1360 +	16,
137.1361 +	3,
137.1362 +	17,
137.1363 +	2,
137.1364 +	18,
137.1365 +	1,
137.1366 +	19,
137.1367 +	0,
137.1368 +	20,
137.1369 +};
137.1370 +
137.1371 +static const long _vq_lengthlist__16u2_p8_1[] = {
137.1372 +	 3, 5, 5, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9,
137.1373 +	 9, 9, 9, 9, 9, 5, 6, 6, 7, 7, 8, 8, 9, 9, 9, 9,
137.1374 +	 9, 9, 9, 9, 9, 9,10,10,10,10, 5, 6, 6, 7, 7, 8,
137.1375 +	 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 7,
137.1376 +	 7, 7, 8, 8, 9, 8, 9, 9, 9, 9, 9, 9,10,10,10,10,
137.1377 +	10,10,10,10, 7, 7, 7, 8, 8, 9, 9, 9, 9, 9, 9, 9,
137.1378 +	 9,10, 9,10,10,10, 9,10, 9, 8, 8, 8, 9, 8, 9, 9,
137.1379 +	 9, 9,10, 9,10,10,10,10,10,10,10,10,10,10, 8, 8,
137.1380 +	 8, 8, 9, 9, 9, 9, 9, 9, 9,10,10,10,10,10,10,10,
137.1381 +	10,10,10, 8, 9, 9, 9, 9, 9, 9, 9, 9,10,10,10,10,
137.1382 +	10,10,10,10,10,10,10,10, 8, 9, 9, 9, 9, 9, 9, 9,
137.1383 +	10,10,10,10,10,10,10,10,10,10,10,10,10, 9, 9, 9,
137.1384 +	 9, 9, 9, 9,10,10,10,10,10,10,10,10,10,10,10,10,
137.1385 +	10,10, 9, 9, 9, 9, 9, 9, 9,10,10,10,10,10,10,10,
137.1386 +	10,10,10,10,10,10,10, 9, 9, 9, 9, 9,10,10,10,10,
137.1387 +	10,10,10,10,10,10,10,10,10,10,10,10, 9, 9, 9, 9,
137.1388 +	 9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
137.1389 +	10, 9, 9, 9,10,10,10,10,10,10,10,10,10,10,10,10,
137.1390 +	10,10,10,10,10,10, 9, 9, 9,10,10,10,10,10,10,10,
137.1391 +	10,10,10,10,10,10,10,10,10,10,10, 9, 9,10,10,10,
137.1392 +	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
137.1393 +	 9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
137.1394 +	10,10,10,10,10, 9,10,10,10,10,10,10,10,10,10,10,
137.1395 +	10,10,10,10,10,10,10,10,10,10, 9,10,10,10,10,10,
137.1396 +	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, 9,
137.1397 +	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
137.1398 +	10,10,10,10, 9,10,10,10,10,10,10,10,10,10,10,10,
137.1399 +	10,10,10,10,10,10,10,10,10,
137.1400 +};
137.1401 +
137.1402 +static const static_codebook _16u2_p8_1 = {
137.1403 +	2, 441,
137.1404 +	(long *)_vq_lengthlist__16u2_p8_1,
137.1405 +	1, -529268736, 1611661312, 5, 0,
137.1406 +	(long *)_vq_quantlist__16u2_p8_1,
137.1407 +	0
137.1408 +};
137.1409 +
137.1410 +static const long _vq_quantlist__16u2_p9_0[] = {
137.1411 +	7,
137.1412 +	6,
137.1413 +	8,
137.1414 +	5,
137.1415 +	9,
137.1416 +	4,
137.1417 +	10,
137.1418 +	3,
137.1419 +	11,
137.1420 +	2,
137.1421 +	12,
137.1422 +	1,
137.1423 +	13,
137.1424 +	0,
137.1425 +	14,
137.1426 +};
137.1427 +
137.1428 +static const long _vq_lengthlist__16u2_p9_0[] = {
137.1429 +	 1, 5, 3, 9, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 5,
137.1430 +	 7, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 5, 7,
137.1431 +	 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
137.1432 +	 9, 9, 9, 9, 9, 9, 9,10,10,10,10,10,10,10,10,10,
137.1433 +	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
137.1434 +	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
137.1435 +	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
137.1436 +	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
137.1437 +	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
137.1438 +	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
137.1439 +	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
137.1440 +	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
137.1441 +	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
137.1442 +	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
137.1443 +	10,
137.1444 +};
137.1445 +
137.1446 +static const static_codebook _16u2_p9_0 = {
137.1447 +	2, 225,
137.1448 +	(long *)_vq_lengthlist__16u2_p9_0,
137.1449 +	1, -510036736, 1631393792, 4, 0,
137.1450 +	(long *)_vq_quantlist__16u2_p9_0,
137.1451 +	0
137.1452 +};
137.1453 +
137.1454 +static const long _vq_quantlist__16u2_p9_1[] = {
137.1455 +	9,
137.1456 +	8,
137.1457 +	10,
137.1458 +	7,
137.1459 +	11,
137.1460 +	6,
137.1461 +	12,
137.1462 +	5,
137.1463 +	13,
137.1464 +	4,
137.1465 +	14,
137.1466 +	3,
137.1467 +	15,
137.1468 +	2,
137.1469 +	16,
137.1470 +	1,
137.1471 +	17,
137.1472 +	0,
137.1473 +	18,
137.1474 +};
137.1475 +
137.1476 +static const long _vq_lengthlist__16u2_p9_1[] = {
137.1477 +	 1, 4, 4, 7, 7, 7, 7, 7, 6, 9, 7,10, 8,12,12,13,
137.1478 +	13,14,14, 4, 7, 7, 9, 9, 9, 8, 9, 8,10, 9,11, 9,
137.1479 +	14, 9,14,10,13,11, 4, 7, 7, 9, 9, 9, 9, 8, 9,10,
137.1480 +	10,11,11,12,13,12,13,14,15, 7, 9, 9,10,11,10,10,
137.1481 +	10,10,11,12,13,13,13,14,17,14,15,16, 7, 9, 9,10,
137.1482 +	10,10,10,10,10,11,12,13,13,14,14,15,15,18,18, 8,
137.1483 +	 9, 9,11,10,11,11,11,12,13,12,14,14,16,15,15,17,
137.1484 +	18,15, 8, 9, 9,10,10,11,11,11,11,13,13,14,14,15,
137.1485 +	15,15,16,16,18, 7, 9, 8,10,10,11,11,12,12,14,14,
137.1486 +	15,15,16,16,15,17,16,18, 8, 9, 9,10,10,11,12,12,
137.1487 +	12,13,13,16,15,17,16,17,18,17,18, 9,10,10,12,11,
137.1488 +	13,13,14,13,14,14,15,17,16,18,17,18,17,18, 9,10,
137.1489 +	10,12,11,12,13,13,14,15,16,14,15,16,18,18,18,18,
137.1490 +	17,11,11,11,13,13,14,14,16,15,15,15,16,15,15,18,
137.1491 +	18,18,17,16,11,11,12,13,13,15,14,15,16,16,16,17,
137.1492 +	16,15,18,17,18,16,18,12,13,13,15,15,15,16,18,16,
137.1493 +	17,16,17,16,17,17,17,18,18,17,13,13,13,15,13,16,
137.1494 +	15,17,16,16,16,18,18,18,18,16,17,17,18,13,15,14,
137.1495 +	15,15,18,17,18,18,18,16,18,17,18,17,18,16,17,17,
137.1496 +	14,14,14,15,16,17,16,18,18,18,17,18,17,18,18,18,
137.1497 +	16,16,16,14,17,16,17,15,16,18,18,17,18,17,18,17,
137.1498 +	18,18,18,17,18,17,15,16,15,18,15,18,17,16,18,18,
137.1499 +	18,18,18,18,17,18,16,18,17,
137.1500 +};
137.1501 +
137.1502 +static const static_codebook _16u2_p9_1 = {
137.1503 +	2, 361,
137.1504 +	(long *)_vq_lengthlist__16u2_p9_1,
137.1505 +	1, -518287360, 1622704128, 5, 0,
137.1506 +	(long *)_vq_quantlist__16u2_p9_1,
137.1507 +	0
137.1508 +};
137.1509 +
137.1510 +static const long _vq_quantlist__16u2_p9_2[] = {
137.1511 +	24,
137.1512 +	23,
137.1513 +	25,
137.1514 +	22,
137.1515 +	26,
137.1516 +	21,
137.1517 +	27,
137.1518 +	20,
137.1519 +	28,
137.1520 +	19,
137.1521 +	29,
137.1522 +	18,
137.1523 +	30,
137.1524 +	17,
137.1525 +	31,
137.1526 +	16,
137.1527 +	32,
137.1528 +	15,
137.1529 +	33,
137.1530 +	14,
137.1531 +	34,
137.1532 +	13,
137.1533 +	35,
137.1534 +	12,
137.1535 +	36,
137.1536 +	11,
137.1537 +	37,
137.1538 +	10,
137.1539 +	38,
137.1540 +	9,
137.1541 +	39,
137.1542 +	8,
137.1543 +	40,
137.1544 +	7,
137.1545 +	41,
137.1546 +	6,
137.1547 +	42,
137.1548 +	5,
137.1549 +	43,
137.1550 +	4,
137.1551 +	44,
137.1552 +	3,
137.1553 +	45,
137.1554 +	2,
137.1555 +	46,
137.1556 +	1,
137.1557 +	47,
137.1558 +	0,
137.1559 +	48,
137.1560 +};
137.1561 +
137.1562 +static const long _vq_lengthlist__16u2_p9_2[] = {
137.1563 +	 2, 3, 4, 4, 4, 5, 5, 6, 5, 6, 6, 6, 6, 6, 6, 7,
137.1564 +	 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
137.1565 +	 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 7, 8, 8, 8, 8, 8,
137.1566 +	 8,
137.1567 +};
137.1568 +
137.1569 +static const static_codebook _16u2_p9_2 = {
137.1570 +	1, 49,
137.1571 +	(long *)_vq_lengthlist__16u2_p9_2,
137.1572 +	1, -526909440, 1611661312, 6, 0,
137.1573 +	(long *)_vq_quantlist__16u2_p9_2,
137.1574 +	0
137.1575 +};
137.1576 +
137.1577 +static const long _huff_lengthlist__16u2__short[] = {
137.1578 +	 8,11,13,13,15,16,19,19,19,19,11, 8, 8, 9, 9,11,
137.1579 +	13,15,19,20,14, 8, 7, 7, 8, 9,12,13,15,20,15, 9,
137.1580 +	 6, 5, 5, 7,10,12,14,18,14, 9, 7, 5, 3, 4, 7,10,
137.1581 +	12,16,13,10, 8, 6, 3, 3, 5, 8,11,14,11,10, 9, 7,
137.1582 +	 5, 4, 4, 6,11,14,10,10,10, 8, 6, 5, 5, 6,10,14,
137.1583 +	10,10,10, 9, 8, 7, 7, 7,10,14,11,12,12,12,11,10,
137.1584 +	10,10,12,16,
137.1585 +};
137.1586 +
137.1587 +static const static_codebook _huff_book__16u2__short = {
137.1588 +	2, 100,
137.1589 +	(long *)_huff_lengthlist__16u2__short,
137.1590 +	0, 0, 0, 0, 0,
137.1591 +	NULL,
137.1592 +	0
137.1593 +};
137.1594 +
137.1595 +static const long _vq_quantlist__8u0__p1_0[] = {
137.1596 +        1,
137.1597 +        0,
137.1598 +        2,
137.1599 +};
137.1600 +
137.1601 +static const long _vq_lengthlist__8u0__p1_0[] = {
137.1602 +         1, 4, 4, 5, 7, 7, 5, 7, 7, 5, 8, 8, 8,10,10, 7,
137.1603 +        10,10, 5, 8, 8, 7,10,10, 8,10,10, 4, 9, 8, 8,11,
137.1604 +        11, 8,11,11, 7,11,11,10,11,13,10,13,13, 7,11,11,
137.1605 +        10,13,12,10,13,13, 5, 9, 8, 8,11,11, 8,11,11, 7,
137.1606 +        11,11, 9,13,13,10,12,13, 7,11,11,10,13,13,10,13,
137.1607 +        11,
137.1608 +};
137.1609 +
137.1610 +static const static_codebook _8u0__p1_0 = {
137.1611 +        4, 81,
137.1612 +        (long *)_vq_lengthlist__8u0__p1_0,
137.1613 +        1, -535822336, 1611661312, 2, 0,
137.1614 +        (long *)_vq_quantlist__8u0__p1_0,
137.1615 +        0
137.1616 +};
137.1617 +
137.1618 +static const long _vq_quantlist__8u0__p2_0[] = {
137.1619 +        1,
137.1620 +        0,
137.1621 +        2,
137.1622 +};
137.1623 +
137.1624 +static const long _vq_lengthlist__8u0__p2_0[] = {
137.1625 +         2, 4, 4, 5, 6, 6, 5, 6, 6, 5, 7, 7, 6, 7, 8, 6,
137.1626 +         7, 8, 5, 7, 7, 6, 8, 8, 7, 9, 7, 5, 7, 7, 7, 9,
137.1627 +         9, 7, 8, 8, 6, 9, 8, 7, 7,10, 8,10,10, 6, 8, 8,
137.1628 +         8,10, 8, 8,10,10, 5, 7, 7, 7, 8, 8, 7, 8, 9, 6,
137.1629 +         8, 8, 8,10,10, 8, 8,10, 6, 8, 9, 8,10,10, 7,10,
137.1630 +         8,
137.1631 +};
137.1632 +
137.1633 +static const static_codebook _8u0__p2_0 = {
137.1634 +        4, 81,
137.1635 +        (long *)_vq_lengthlist__8u0__p2_0,
137.1636 +        1, -535822336, 1611661312, 2, 0,
137.1637 +        (long *)_vq_quantlist__8u0__p2_0,
137.1638 +        0
137.1639 +};
137.1640 +
137.1641 +static const long _vq_quantlist__8u0__p3_0[] = {
137.1642 +        2,
137.1643 +        1,
137.1644 +        3,
137.1645 +        0,
137.1646 +        4,
137.1647 +};
137.1648 +
137.1649 +static const long _vq_lengthlist__8u0__p3_0[] = {
137.1650 +         1, 5, 5, 7, 7, 6, 7, 7, 9, 9, 6, 7, 7, 9, 9, 8,
137.1651 +        10, 9,11,11, 8, 9, 9,11,11, 6, 8, 8,10,10, 8,10,
137.1652 +        10,11,11, 8,10,10,11,11,10,11,11,12,12,10,11,11,
137.1653 +        12,13, 6, 8, 8,10,10, 8,10,10,11,11, 8,10,10,11,
137.1654 +        11, 9,10,11,12,12,10,11,11,12,12, 8,11,11,14,13,
137.1655 +        10,12,11,15,13,10,12,11,14,14,12,13,12,16,14,12,
137.1656 +        14,12,16,15, 8,11,11,13,14,10,11,12,13,15,10,11,
137.1657 +        12,13,15,11,12,13,14,15,12,12,14,14,16, 5, 8, 8,
137.1658 +        11,11, 9,11,11,12,12, 8,10,11,12,12,11,12,12,15,
137.1659 +        14,11,12,12,14,14, 7,11,10,13,12,10,11,12,13,14,
137.1660 +        10,12,12,14,13,12,13,13,14,15,12,13,13,15,15, 7,
137.1661 +        10,11,12,13,10,12,11,14,13,10,12,13,13,15,12,13,
137.1662 +        12,14,14,11,13,13,15,16, 9,12,12,15,14,11,13,13,
137.1663 +        15,16,11,13,13,16,16,13,14,15,15,15,12,14,15,17,
137.1664 +        16, 9,12,12,14,15,11,13,13,15,16,11,13,13,16,18,
137.1665 +        13,14,14,17,16,13,15,15,17,18, 5, 8, 9,11,11, 8,
137.1666 +        11,11,12,12, 8,10,11,12,12,11,12,12,14,14,11,12,
137.1667 +        12,14,15, 7,11,10,12,13,10,12,12,14,13,10,11,12,
137.1668 +        13,14,11,13,13,15,14,12,13,13,14,15, 7,10,11,13,
137.1669 +        13,10,12,12,13,14,10,12,12,13,13,11,13,13,16,16,
137.1670 +        12,13,13,15,14, 9,12,12,16,15,10,13,13,15,15,11,
137.1671 +        13,13,17,15,12,15,15,18,17,13,14,14,15,16, 9,12,
137.1672 +        12,15,15,11,13,13,15,16,11,13,13,15,15,12,15,15,
137.1673 +        16,16,13,15,14,17,15, 7,11,11,15,15,10,13,13,16,
137.1674 +        15,10,13,13,15,16,14,15,15,17,19,13,15,14,15,18,
137.1675 +         9,12,12,16,16,11,13,14,17,16,11,13,13,17,16,15,
137.1676 +        15,16,17,19,13,15,16, 0,18, 9,12,12,16,15,11,14,
137.1677 +        13,17,17,11,13,14,16,16,15,16,16,19,18,13,15,15,
137.1678 +        17,19,11,14,14,19,16,12,14,15, 0,18,12,16,15,18,
137.1679 +        17,15,15,18,16,19,14,15,17,19,19,11,14,14,18,19,
137.1680 +        13,15,14,19,19,12,16,15,18,17,15,17,15, 0,16,14,
137.1681 +        17,16,19, 0, 7,11,11,14,14,10,12,12,15,15,10,13,
137.1682 +        13,16,15,13,15,15,17, 0,14,15,15,16,19, 9,12,12,
137.1683 +        16,16,11,14,14,16,16,11,13,13,16,16,14,17,16,19,
137.1684 +         0,14,18,17,17,19, 9,12,12,15,16,11,13,13,15,17,
137.1685 +        12,14,13,19,16,13,15,15,17,19,15,17,16,17,19,11,
137.1686 +        14,14,19,16,12,15,15,19,17,13,14,15,17,19,14,16,
137.1687 +        17,19,19,16,15,16,17,19,11,15,14,16,16,12,15,15,
137.1688 +        19, 0,12,14,15,19,19,14,16,16, 0,18,15,19,14,18,
137.1689 +        16,
137.1690 +};
137.1691 +
137.1692 +static const static_codebook _8u0__p3_0 = {
137.1693 +        4, 625,
137.1694 +        (long *)_vq_lengthlist__8u0__p3_0,
137.1695 +        1, -533725184, 1611661312, 3, 0,
137.1696 +        (long *)_vq_quantlist__8u0__p3_0,
137.1697 +        0
137.1698 +};
137.1699 +
137.1700 +static const long _vq_quantlist__8u0__p4_0[] = {
137.1701 +        2,
137.1702 +        1,
137.1703 +        3,
137.1704 +        0,
137.1705 +        4,
137.1706 +};
137.1707 +
137.1708 +static const long _vq_lengthlist__8u0__p4_0[] = {
137.1709 +         3, 5, 5, 8, 8, 5, 6, 7, 9, 9, 6, 7, 6, 9, 9, 9,
137.1710 +         9, 9,10,11, 9, 9, 9,11,10, 6, 7, 7,10,10, 7, 7,
137.1711 +         8,10,10, 7, 8, 8,10,10,10,10,10,10,11, 9,10,10,
137.1712 +        11,12, 6, 7, 7,10,10, 7, 8, 8,10,10, 7, 8, 7,10,
137.1713 +        10, 9,10,10,12,11,10,10,10,11,10, 9,10,10,12,11,
137.1714 +        10,10,10,13,11, 9,10,10,12,12,11,11,12,12,13,11,
137.1715 +        11,11,12,13, 9,10,10,12,12,10,10,11,12,12,10,10,
137.1716 +        11,12,12,11,11,11,13,13,11,12,12,13,13, 5, 7, 7,
137.1717 +        10,10, 7, 8, 8,10,10, 7, 8, 8,10,10,10,11,11,12,
137.1718 +        12,10,11,10,12,12, 7, 8, 8,11,11, 7, 8, 9,10,11,
137.1719 +         8, 9, 9,11,11,11,10,11,10,12,10,11,11,12,13, 7,
137.1720 +         8, 8,10,11, 8, 9, 8,12,10, 8, 9, 9,11,12,10,11,
137.1721 +        10,13,11,10,11,11,13,12, 9,11,10,13,12,10,10,11,
137.1722 +        12,12,10,11,11,13,13,12,10,13,11,14,11,12,12,15,
137.1723 +        13, 9,11,11,13,13,10,11,11,13,12,10,11,11,12,14,
137.1724 +        12,13,11,14,12,12,12,12,14,14, 5, 7, 7,10,10, 7,
137.1725 +         8, 8,10,10, 7, 8, 8,11,10,10,11,11,12,12,10,11,
137.1726 +        10,12,12, 7, 8, 8,10,11, 8, 9, 9,12,11, 8, 8, 9,
137.1727 +        10,11,10,11,11,12,13,11,10,11,11,13, 6, 8, 8,10,
137.1728 +        11, 8, 9, 9,11,11, 7, 9, 7,11,10,10,11,11,12,12,
137.1729 +        10,11,10,13,10, 9,11,10,13,12,10,12,11,13,13,10,
137.1730 +        10,11,12,13,11,12,13,15,14,11,11,13,12,13, 9,10,
137.1731 +        11,12,13,10,11,11,12,13,10,11,10,13,12,12,13,13,
137.1732 +        13,14,12,12,11,14,11, 8,10,10,12,13,10,11,11,13,
137.1733 +        13,10,11,10,13,13,12,13,14,15,14,12,12,12,14,13,
137.1734 +         9,10,10,13,12,10,10,12,13,13,10,11,11,15,12,12,
137.1735 +        12,13,15,14,12,13,13,15,13, 9,10,11,12,13,10,12,
137.1736 +        10,13,12,10,11,11,12,13,12,14,12,15,13,12,12,12,
137.1737 +        15,14,11,12,11,14,13,11,11,12,14,14,12,13,13,14,
137.1738 +        13,13,11,15,11,15,14,14,14,16,15,11,12,12,13,14,
137.1739 +        11,13,11,14,14,12,12,13,14,15,12,14,12,15,12,13,
137.1740 +        15,14,16,15, 8,10,10,12,12,10,10,10,12,13,10,11,
137.1741 +        11,13,13,12,12,12,13,14,13,13,13,15,15, 9,10,10,
137.1742 +        12,12,10,11,11,13,12,10,10,11,13,13,12,12,12,14,
137.1743 +        14,12,12,13,15,14, 9,10,10,13,12,10,10,12,12,13,
137.1744 +        10,11,10,13,13,12,13,13,14,14,12,13,12,14,13,11,
137.1745 +        12,12,14,13,12,13,12,14,14,10,12,12,14,14,14,14,
137.1746 +        14,16,14,13,12,14,12,15,10,12,12,14,15,12,13,13,
137.1747 +        14,16,11,12,11,15,14,13,14,14,14,15,13,14,11,14,
137.1748 +        12,
137.1749 +};
137.1750 +
137.1751 +static const static_codebook _8u0__p4_0 = {
137.1752 +        4, 625,
137.1753 +        (long *)_vq_lengthlist__8u0__p4_0,
137.1754 +        1, -533725184, 1611661312, 3, 0,
137.1755 +        (long *)_vq_quantlist__8u0__p4_0,
137.1756 +        0
137.1757 +};
137.1758 +
137.1759 +static const long _vq_quantlist__8u0__p5_0[] = {
137.1760 +        4,
137.1761 +        3,
137.1762 +        5,
137.1763 +        2,
137.1764 +        6,
137.1765 +        1,
137.1766 +        7,
137.1767 +        0,
137.1768 +        8,
137.1769 +};
137.1770 +
137.1771 +static const long _vq_lengthlist__8u0__p5_0[] = {
137.1772 +         1, 4, 4, 7, 7, 7, 7, 9, 9, 4, 6, 6, 8, 7, 8, 8,
137.1773 +        10,10, 4, 6, 6, 8, 8, 8, 8,10,10, 6, 8, 8, 9, 9,
137.1774 +         9, 9,11,11, 7, 8, 8, 9, 9, 9, 9,11,11, 7, 8, 8,
137.1775 +         9, 9,10,10,12,11, 7, 8, 8, 9, 9,10,10,11,11, 9,
137.1776 +        10,10,11,11,11,12,12,12, 9,10,10,11,11,12,12,12,
137.1777 +        12,
137.1778 +};
137.1779 +
137.1780 +static const static_codebook _8u0__p5_0 = {
137.1781 +        2, 81,
137.1782 +        (long *)_vq_lengthlist__8u0__p5_0,
137.1783 +        1, -531628032, 1611661312, 4, 0,
137.1784 +        (long *)_vq_quantlist__8u0__p5_0,
137.1785 +        0
137.1786 +};
137.1787 +
137.1788 +static const long _vq_quantlist__8u0__p6_0[] = {
137.1789 +        6,
137.1790 +        5,
137.1791 +        7,
137.1792 +        4,
137.1793 +        8,
137.1794 +        3,
137.1795 +        9,
137.1796 +        2,
137.1797 +        10,
137.1798 +        1,
137.1799 +        11,
137.1800 +        0,
137.1801 +        12,
137.1802 +};
137.1803 +
137.1804 +static const long _vq_lengthlist__8u0__p6_0[] = {
137.1805 +         1, 4, 4, 7, 7, 9, 9,11,11,12,12,16,16, 3, 6, 6,
137.1806 +         9, 9,11,11,12,12,13,14,18,16, 3, 6, 7, 9, 9,11,
137.1807 +        11,13,12,14,14,17,16, 7, 9, 9,11,11,12,12,14,14,
137.1808 +        14,14,17,16, 7, 9, 9,11,11,13,12,13,13,14,14,17,
137.1809 +         0, 9,11,11,12,13,14,14,14,13,15,14,17,17, 9,11,
137.1810 +        11,12,12,14,14,13,14,14,15, 0, 0,11,12,12,15,14,
137.1811 +        15,14,15,14,15,16,17, 0,11,12,13,13,13,14,14,15,
137.1812 +        14,15,15, 0, 0,12,14,14,15,15,14,16,15,15,17,16,
137.1813 +         0,18,13,14,14,15,14,15,14,15,16,17,16, 0, 0,17,
137.1814 +        17,18, 0,16,18,16, 0, 0, 0,17, 0, 0,16, 0, 0,16,
137.1815 +        16, 0,15, 0,17, 0, 0, 0, 0,
137.1816 +};
137.1817 +
137.1818 +static const static_codebook _8u0__p6_0 = {
137.1819 +        2, 169,
137.1820 +        (long *)_vq_lengthlist__8u0__p6_0,
137.1821 +        1, -526516224, 1616117760, 4, 0,
137.1822 +        (long *)_vq_quantlist__8u0__p6_0,
137.1823 +        0
137.1824 +};
137.1825 +
137.1826 +static const long _vq_quantlist__8u0__p6_1[] = {
137.1827 +        2,
137.1828 +        1,
137.1829 +        3,
137.1830 +        0,
137.1831 +        4,
137.1832 +};
137.1833 +
137.1834 +static const long _vq_lengthlist__8u0__p6_1[] = {
137.1835 +         1, 4, 4, 6, 6, 4, 6, 5, 7, 7, 4, 5, 6, 7, 7, 6,
137.1836 +         7, 7, 7, 7, 6, 7, 7, 7, 7,
137.1837 +};
137.1838 +
137.1839 +static const static_codebook _8u0__p6_1 = {
137.1840 +        2, 25,
137.1841 +        (long *)_vq_lengthlist__8u0__p6_1,
137.1842 +        1, -533725184, 1611661312, 3, 0,
137.1843 +        (long *)_vq_quantlist__8u0__p6_1,
137.1844 +        0
137.1845 +};
137.1846 +
137.1847 +static const long _vq_quantlist__8u0__p7_0[] = {
137.1848 +        1,
137.1849 +        0,
137.1850 +        2,
137.1851 +};
137.1852 +
137.1853 +static const long _vq_lengthlist__8u0__p7_0[] = {
137.1854 +         1, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
137.1855 +         8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
137.1856 +         8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
137.1857 +         7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
137.1858 +         7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
137.1859 +         7,
137.1860 +};
137.1861 +
137.1862 +static const static_codebook _8u0__p7_0 = {
137.1863 +        4, 81,
137.1864 +        (long *)_vq_lengthlist__8u0__p7_0,
137.1865 +        1, -518803456, 1628680192, 2, 0,
137.1866 +        (long *)_vq_quantlist__8u0__p7_0,
137.1867 +        0
137.1868 +};
137.1869 +
137.1870 +static const long _vq_quantlist__8u0__p7_1[] = {
137.1871 +        7,
137.1872 +        6,
137.1873 +        8,
137.1874 +        5,
137.1875 +        9,
137.1876 +        4,
137.1877 +        10,
137.1878 +        3,
137.1879 +        11,
137.1880 +        2,
137.1881 +        12,
137.1882 +        1,
137.1883 +        13,
137.1884 +        0,
137.1885 +        14,
137.1886 +};
137.1887 +
137.1888 +static const long _vq_lengthlist__8u0__p7_1[] = {
137.1889 +         1, 5, 5, 5, 5,10,10,11,11,11,11,11,11,11,11, 5,
137.1890 +         7, 6, 8, 8, 9,10,11,11,11,11,11,11,11,11, 6, 6,
137.1891 +         7, 9, 7,11,10,11,11,11,11,11,11,11,11, 5, 6, 6,
137.1892 +        11, 8,11,11,11,11,11,11,11,11,11,11, 5, 6, 6, 9,
137.1893 +        10,11,10,11,11,11,11,11,11,11,11, 7,10,10,11,11,
137.1894 +        11,11,11,11,11,11,11,11,11,11, 7,11, 8,11,11,11,
137.1895 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.1896 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.1897 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.1898 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.1899 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.1900 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.1901 +        11,11,11,11,11,11,11,11,11,11,11,10,10,10,10,10,
137.1902 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
137.1903 +        10,
137.1904 +};
137.1905 +
137.1906 +static const static_codebook _8u0__p7_1 = {
137.1907 +        2, 225,
137.1908 +        (long *)_vq_lengthlist__8u0__p7_1,
137.1909 +        1, -520986624, 1620377600, 4, 0,
137.1910 +        (long *)_vq_quantlist__8u0__p7_1,
137.1911 +        0
137.1912 +};
137.1913 +
137.1914 +static const long _vq_quantlist__8u0__p7_2[] = {
137.1915 +        10,
137.1916 +        9,
137.1917 +        11,
137.1918 +        8,
137.1919 +        12,
137.1920 +        7,
137.1921 +        13,
137.1922 +        6,
137.1923 +        14,
137.1924 +        5,
137.1925 +        15,
137.1926 +        4,
137.1927 +        16,
137.1928 +        3,
137.1929 +        17,
137.1930 +        2,
137.1931 +        18,
137.1932 +        1,
137.1933 +        19,
137.1934 +        0,
137.1935 +        20,
137.1936 +};
137.1937 +
137.1938 +static const long _vq_lengthlist__8u0__p7_2[] = {
137.1939 +         1, 6, 5, 7, 7, 9, 9, 9, 9,10,12,12,10,11,11,10,
137.1940 +        11,11,11,10,11, 6, 8, 8, 9, 9,10,10, 9,10,11,11,
137.1941 +        10,11,11,11,11,10,11,11,11,11, 6, 7, 8, 9, 9, 9,
137.1942 +        10,11,10,11,12,11,10,11,11,11,11,11,11,12,10, 8,
137.1943 +         9, 9,10, 9,10,10, 9,10,10,10,10,10, 9,10,10,10,
137.1944 +        10, 9,10,10, 9, 9, 9, 9,10,10, 9, 9,10,10,11,10,
137.1945 +         9,12,10,11,10, 9,10,10,10, 8, 9, 9,10, 9,10, 9,
137.1946 +         9,10,10, 9,10, 9,11,10,10,10,10,10, 9,10, 8, 8,
137.1947 +         9, 9,10, 9,11, 9, 8, 9, 9,10,11,10,10,10,11,12,
137.1948 +         9, 9,11, 8, 9, 8,11,10,11,10,10, 9,11,10,10,10,
137.1949 +        10,10,10,10,11,11,11,11, 8, 9, 9, 9,10,10,10,11,
137.1950 +        11,12,11,12,11,10,10,10,12,11,11,11,10, 8,10, 9,
137.1951 +        11,10,10,11,12,10,11,12,11,11,12,11,12,12,10,11,
137.1952 +        11,10, 9, 9,10,11,12,10,10,10,11,10,11,11,10,12,
137.1953 +        12,10,11,10,11,12,10, 9,10,10,11,10,11,11,11,11,
137.1954 +        11,12,11,11,11, 9,11,10,11,10,11,10, 9, 9,10,11,
137.1955 +        11,11,10,10,11,12,12,11,12,11,11,11,12,12,12,12,
137.1956 +        11, 9,11,11,12,10,11,11,11,11,11,11,12,11,11,12,
137.1957 +        11,11,11,10,11,11, 9,11,10,11,11,11,10,10,10,11,
137.1958 +        11,11,12,10,11,10,11,11,11,11,12, 9,11,10,11,11,
137.1959 +        10,10,11,11, 9,11,11,12,10,10,10,10,10,11,11,10,
137.1960 +         9,10,11,11,12,11,10,10,12,11,11,12,11,12,11,11,
137.1961 +        10,10,11,11,10,12,11,10,11,10,11,10,10,10,11,11,
137.1962 +        10,10,11,11,11,11,10,10,10,12,11,11,11,11,10, 9,
137.1963 +        10,11,11,11,12,11,11,11,12,10,11,11,11, 9,10,11,
137.1964 +        11,11,11,11,11,10,10,11,11,12,11,10,11,12,11,10,
137.1965 +        10,11, 9,10,11,11,11,11,11,10,11,11,10,12,11,11,
137.1966 +        11,12,11,11,11,10,10,11,11,
137.1967 +};
137.1968 +
137.1969 +static const static_codebook _8u0__p7_2 = {
137.1970 +        2, 441,
137.1971 +        (long *)_vq_lengthlist__8u0__p7_2,
137.1972 +        1, -529268736, 1611661312, 5, 0,
137.1973 +        (long *)_vq_quantlist__8u0__p7_2,
137.1974 +        0
137.1975 +};
137.1976 +
137.1977 +static const long _huff_lengthlist__8u0__single[] = {
137.1978 +         4, 7,11, 9,12, 8, 7,10, 6, 4, 5, 5, 7, 5, 6,16,
137.1979 +         9, 5, 5, 6, 7, 7, 9,16, 7, 4, 6, 5, 7, 5, 7,17,
137.1980 +        10, 7, 7, 8, 7, 7, 8,18, 7, 5, 6, 4, 5, 4, 5,15,
137.1981 +         7, 6, 7, 5, 6, 4, 5,15,12,13,18,12,17,11, 9,17,
137.1982 +};
137.1983 +
137.1984 +static const static_codebook _huff_book__8u0__single = {
137.1985 +        2, 64,
137.1986 +        (long *)_huff_lengthlist__8u0__single,
137.1987 +        0, 0, 0, 0, 0,
137.1988 +        NULL,
137.1989 +        0
137.1990 +};
137.1991 +
137.1992 +static const long _vq_quantlist__8u1__p1_0[] = {
137.1993 +        1,
137.1994 +        0,
137.1995 +        2,
137.1996 +};
137.1997 +
137.1998 +static const long _vq_lengthlist__8u1__p1_0[] = {
137.1999 +         1, 4, 4, 5, 7, 7, 5, 7, 7, 5, 8, 8, 7, 9,10, 7,
137.2000 +         9, 9, 5, 8, 8, 7,10, 9, 7, 9, 9, 5, 8, 8, 8,10,
137.2001 +        10, 8,10,10, 7,10,10, 9,10,12,10,12,12, 7,10,10,
137.2002 +         9,12,11,10,12,12, 5, 8, 8, 8,10,10, 8,10,10, 7,
137.2003 +        10,10,10,12,12, 9,11,12, 7,10,10,10,12,12, 9,12,
137.2004 +        10,
137.2005 +};
137.2006 +
137.2007 +static const static_codebook _8u1__p1_0 = {
137.2008 +        4, 81,
137.2009 +        (long *)_vq_lengthlist__8u1__p1_0,
137.2010 +        1, -535822336, 1611661312, 2, 0,
137.2011 +        (long *)_vq_quantlist__8u1__p1_0,
137.2012 +        0
137.2013 +};
137.2014 +
137.2015 +static const long _vq_quantlist__8u1__p2_0[] = {
137.2016 +        1,
137.2017 +        0,
137.2018 +        2,
137.2019 +};
137.2020 +
137.2021 +static const long _vq_lengthlist__8u1__p2_0[] = {
137.2022 +         3, 4, 5, 5, 6, 6, 5, 6, 6, 5, 7, 6, 6, 7, 8, 6,
137.2023 +         7, 8, 5, 6, 6, 6, 8, 7, 6, 8, 7, 5, 6, 6, 7, 8,
137.2024 +         8, 6, 7, 7, 6, 8, 7, 7, 7, 9, 8, 9, 9, 6, 7, 8,
137.2025 +         7, 9, 7, 8, 9, 9, 5, 6, 6, 6, 7, 7, 7, 8, 8, 6,
137.2026 +         8, 7, 8, 9, 9, 7, 7, 9, 6, 7, 8, 8, 9, 9, 7, 9,
137.2027 +         7,
137.2028 +};
137.2029 +
137.2030 +static const static_codebook _8u1__p2_0 = {
137.2031 +        4, 81,
137.2032 +        (long *)_vq_lengthlist__8u1__p2_0,
137.2033 +        1, -535822336, 1611661312, 2, 0,
137.2034 +        (long *)_vq_quantlist__8u1__p2_0,
137.2035 +        0
137.2036 +};
137.2037 +
137.2038 +static const long _vq_quantlist__8u1__p3_0[] = {
137.2039 +        2,
137.2040 +        1,
137.2041 +        3,
137.2042 +        0,
137.2043 +        4,
137.2044 +};
137.2045 +
137.2046 +static const long _vq_lengthlist__8u1__p3_0[] = {
137.2047 +         1, 5, 5, 7, 7, 6, 7, 7, 9, 9, 6, 7, 7, 9, 9, 8,
137.2048 +        10, 9,11,11, 9, 9, 9,11,11, 6, 8, 8,10,10, 8,10,
137.2049 +        10,11,11, 8, 9,10,11,11,10,11,11,12,12,10,11,11,
137.2050 +        12,13, 6, 8, 8,10,10, 8,10, 9,11,11, 8,10, 9,11,
137.2051 +        11,10,11,11,12,12,10,11,11,12,12, 9,11,11,14,13,
137.2052 +        10,12,11,14,14,10,12,11,14,13,12,13,13,15,14,12,
137.2053 +        13,13,15,14, 8,11,11,13,14,10,11,12,13,15,10,11,
137.2054 +        12,14,14,12,13,13,14,15,12,13,13,14,15, 5, 8, 8,
137.2055 +        11,11, 8,10,10,12,12, 8,10,10,12,12,11,12,12,14,
137.2056 +        13,11,12,12,13,14, 8,10,10,12,12, 9,11,12,13,14,
137.2057 +        10,12,12,13,13,12,12,13,14,14,11,13,13,15,15, 7,
137.2058 +        10,10,12,12, 9,12,11,14,12,10,11,12,13,14,12,13,
137.2059 +        12,14,14,12,13,13,15,16,10,12,12,15,14,11,12,13,
137.2060 +        15,15,11,13,13,15,16,14,14,15,15,16,13,14,15,17,
137.2061 +        15, 9,12,12,14,15,11,13,12,15,15,11,13,13,15,15,
137.2062 +        13,14,13,15,14,13,14,14,17, 0, 5, 8, 8,11,11, 8,
137.2063 +        10,10,12,12, 8,10,10,12,12,11,12,12,14,14,11,12,
137.2064 +        12,14,14, 7,10,10,12,12,10,12,12,13,13, 9,11,12,
137.2065 +        12,13,11,12,13,15,15,11,12,13,14,15, 8,10,10,12,
137.2066 +        12,10,12,11,13,13,10,12,11,13,13,11,13,13,15,14,
137.2067 +        12,13,12,15,13, 9,12,12,14,14,11,13,13,16,15,11,
137.2068 +        12,13,16,15,13,14,15,16,16,13,13,15,15,16,10,12,
137.2069 +        12,15,14,11,13,13,14,16,11,13,13,15,16,13,15,15,
137.2070 +        16,17,13,15,14,16,15, 8,11,11,14,15,10,12,12,15,
137.2071 +        15,10,12,12,15,16,14,15,15,16,17,13,14,14,16,16,
137.2072 +         9,12,12,15,15,11,13,14,15,17,11,13,13,15,16,14,
137.2073 +        15,16,19,17,13,15,15, 0,17, 9,12,12,15,15,11,14,
137.2074 +        13,16,15,11,13,13,15,16,15,15,15,18,17,13,15,15,
137.2075 +        17,17,11,15,14,18,16,12,14,15,17,17,12,15,15,18,
137.2076 +        18,15,15,16,15,19,14,16,16, 0, 0,11,14,14,16,17,
137.2077 +        12,15,14,18,17,12,15,15,18,18,15,17,15,18,16,14,
137.2078 +        16,16,18,18, 7,11,11,14,14,10,12,12,15,15,10,12,
137.2079 +        13,15,15,13,14,15,16,16,14,15,15,18,18, 9,12,12,
137.2080 +        15,15,11,13,13,16,15,11,12,13,16,16,14,15,15,17,
137.2081 +        16,15,16,16,17,17, 9,12,12,15,15,11,13,13,15,17,
137.2082 +        11,14,13,16,15,13,15,15,17,17,15,15,15,18,17,11,
137.2083 +        14,14,17,15,12,14,15,17,18,13,13,15,17,17,14,16,
137.2084 +        16,19,18,16,15,17,17, 0,11,14,14,17,17,12,15,15,
137.2085 +        18, 0,12,15,14,18,16,14,17,17,19, 0,16,18,15, 0,
137.2086 +        16,
137.2087 +};
137.2088 +
137.2089 +static const static_codebook _8u1__p3_0 = {
137.2090 +        4, 625,
137.2091 +        (long *)_vq_lengthlist__8u1__p3_0,
137.2092 +        1, -533725184, 1611661312, 3, 0,
137.2093 +        (long *)_vq_quantlist__8u1__p3_0,
137.2094 +        0
137.2095 +};
137.2096 +
137.2097 +static const long _vq_quantlist__8u1__p4_0[] = {
137.2098 +        2,
137.2099 +        1,
137.2100 +        3,
137.2101 +        0,
137.2102 +        4,
137.2103 +};
137.2104 +
137.2105 +static const long _vq_lengthlist__8u1__p4_0[] = {
137.2106 +         4, 5, 5, 9, 9, 6, 7, 7, 9, 9, 6, 7, 7, 9, 9, 9,
137.2107 +         9, 9,11,11, 9, 9, 9,11,11, 6, 7, 7, 9, 9, 7, 7,
137.2108 +         8, 9,10, 7, 7, 8, 9,10, 9, 9,10,10,11, 9, 9,10,
137.2109 +        10,12, 6, 7, 7, 9, 9, 7, 8, 7,10, 9, 7, 8, 7,10,
137.2110 +         9, 9,10, 9,12,11,10,10, 9,12,10, 9,10,10,12,11,
137.2111 +         9,10,10,12,11, 9,10,10,12,12,11,11,12,12,13,11,
137.2112 +        11,12,12,13, 9, 9,10,12,11, 9,10,10,12,12,10,10,
137.2113 +        10,12,12,11,12,11,13,12,11,12,11,13,12, 6, 7, 7,
137.2114 +         9, 9, 7, 8, 8,10,10, 7, 8, 7,10, 9,10,10,10,12,
137.2115 +        12,10,10,10,12,11, 7, 8, 7,10,10, 7, 7, 9,10,11,
137.2116 +         8, 9, 9,11,10,10,10,11,10,12,10,10,11,12,12, 7,
137.2117 +         8, 8,10,10, 7, 9, 8,11,10, 8, 8, 9,11,11,10,11,
137.2118 +        10,12,11,10,11,11,12,12, 9,10,10,12,12, 9,10,10,
137.2119 +        12,12,10,11,11,13,12,11,10,12,10,14,12,12,12,13,
137.2120 +        14, 9,10,10,12,12, 9,11,10,12,12,10,11,11,12,12,
137.2121 +        11,12,11,14,12,12,12,12,14,14, 5, 7, 7, 9, 9, 7,
137.2122 +         7, 7, 9,10, 7, 8, 8,10,10,10,10,10,11,11,10,10,
137.2123 +        10,12,12, 7, 8, 8,10,10, 8, 9, 8,11,10, 7, 8, 9,
137.2124 +        10,11,10,10,10,11,12,10,10,11,11,13, 6, 7, 8,10,
137.2125 +        10, 8, 9, 9,10,10, 7, 9, 7,11,10,10,11,10,12,12,
137.2126 +        10,11,10,12,10, 9,10,10,12,12,10,11,11,13,12, 9,
137.2127 +        10,10,12,12,12,12,12,14,13,11,11,12,11,14, 9,10,
137.2128 +        10,11,12,10,11,11,12,13, 9,10,10,12,12,12,12,12,
137.2129 +        14,13,11,12,10,14,11, 9, 9,10,11,12, 9,10,10,12,
137.2130 +        12, 9,10,10,12,12,12,12,12,14,14,11,12,12,13,12,
137.2131 +         9,10, 9,12,12, 9,10,11,12,13,10,11,10,13,11,12,
137.2132 +        12,13,13,14,12,12,12,13,13, 9,10,10,12,12,10,11,
137.2133 +        10,13,12,10,10,11,12,13,12,13,12,14,13,12,12,12,
137.2134 +        13,14,11,12,11,14,13,10,10,11,13,13,12,12,12,14,
137.2135 +        13,12,10,14,10,15,13,14,14,14,14,11,11,12,13,14,
137.2136 +        10,12,11,13,13,12,12,12,13,15,12,13,11,15,12,13,
137.2137 +        13,14,14,14, 9,10, 9,12,12, 9,10,10,12,12,10,10,
137.2138 +        10,12,12,11,11,12,12,13,12,12,12,14,14, 9,10,10,
137.2139 +        12,12,10,11,10,13,12,10,10,11,12,13,12,12,12,14,
137.2140 +        13,12,12,13,13,14, 9,10,10,12,13,10,10,11,11,12,
137.2141 +         9,11,10,13,12,12,12,12,13,14,12,13,12,14,13,11,
137.2142 +        12,11,13,13,12,13,12,14,13,10,11,12,13,13,13,13,
137.2143 +        13,14,15,12,11,14,12,14,11,11,12,12,13,12,12,12,
137.2144 +        13,14,10,12,10,14,13,13,13,13,14,15,12,14,11,15,
137.2145 +        10,
137.2146 +};
137.2147 +
137.2148 +static const static_codebook _8u1__p4_0 = {
137.2149 +        4, 625,
137.2150 +        (long *)_vq_lengthlist__8u1__p4_0,
137.2151 +        1, -533725184, 1611661312, 3, 0,
137.2152 +        (long *)_vq_quantlist__8u1__p4_0,
137.2153 +        0
137.2154 +};
137.2155 +
137.2156 +static const long _vq_quantlist__8u1__p5_0[] = {
137.2157 +        4,
137.2158 +        3,
137.2159 +        5,
137.2160 +        2,
137.2161 +        6,
137.2162 +        1,
137.2163 +        7,
137.2164 +        0,
137.2165 +        8,
137.2166 +};
137.2167 +
137.2168 +static const long _vq_lengthlist__8u1__p5_0[] = {
137.2169 +         1, 4, 4, 7, 7, 7, 7, 9, 9, 4, 6, 5, 8, 7, 8, 8,
137.2170 +        10,10, 4, 6, 6, 8, 8, 8, 8,10,10, 7, 8, 8, 9, 9,
137.2171 +         9, 9,11,11, 7, 8, 8, 9, 9, 9, 9,11,11, 8, 8, 8,
137.2172 +         9, 9,10,10,12,11, 8, 8, 8, 9, 9,10,10,11,11, 9,
137.2173 +        10,10,11,11,11,11,13,12, 9,10,10,11,11,12,12,12,
137.2174 +        13,
137.2175 +};
137.2176 +
137.2177 +static const static_codebook _8u1__p5_0 = {
137.2178 +        2, 81,
137.2179 +        (long *)_vq_lengthlist__8u1__p5_0,
137.2180 +        1, -531628032, 1611661312, 4, 0,
137.2181 +        (long *)_vq_quantlist__8u1__p5_0,
137.2182 +        0
137.2183 +};
137.2184 +
137.2185 +static const long _vq_quantlist__8u1__p6_0[] = {
137.2186 +        4,
137.2187 +        3,
137.2188 +        5,
137.2189 +        2,
137.2190 +        6,
137.2191 +        1,
137.2192 +        7,
137.2193 +        0,
137.2194 +        8,
137.2195 +};
137.2196 +
137.2197 +static const long _vq_lengthlist__8u1__p6_0[] = {
137.2198 +         3, 4, 4, 6, 6, 7, 7, 9, 9, 4, 4, 5, 6, 6, 7, 7,
137.2199 +         9, 9, 4, 4, 4, 6, 6, 7, 7, 9, 9, 6, 6, 6, 7, 7,
137.2200 +         8, 8, 9, 9, 6, 6, 6, 7, 7, 8, 8, 9, 9, 7, 7, 7,
137.2201 +         8, 8, 8, 9,10,10, 7, 7, 7, 8, 8, 9, 8,10,10, 9,
137.2202 +         9, 9, 9, 9,10,10,10,10, 9, 9, 9, 9, 9,10,10,10,
137.2203 +        10,
137.2204 +};
137.2205 +
137.2206 +static const static_codebook _8u1__p6_0 = {
137.2207 +        2, 81,
137.2208 +        (long *)_vq_lengthlist__8u1__p6_0,
137.2209 +        1, -531628032, 1611661312, 4, 0,
137.2210 +        (long *)_vq_quantlist__8u1__p6_0,
137.2211 +        0
137.2212 +};
137.2213 +
137.2214 +static const long _vq_quantlist__8u1__p7_0[] = {
137.2215 +        1,
137.2216 +        0,
137.2217 +        2,
137.2218 +};
137.2219 +
137.2220 +static const long _vq_lengthlist__8u1__p7_0[] = {
137.2221 +         1, 4, 4, 5, 7, 7, 5, 7, 7, 5, 9, 9, 8,10,10, 8,
137.2222 +        10,10, 5, 9, 9, 7,10,10, 8,10,10, 4,10,10, 9,12,
137.2223 +        12, 9,11,11, 7,12,11,10,11,13,10,13,13, 7,12,12,
137.2224 +        10,13,12,10,13,13, 4,10,10, 9,12,12, 9,12,12, 7,
137.2225 +        12,12,10,13,13,10,12,13, 7,11,12,10,13,13,10,13,
137.2226 +        11,
137.2227 +};
137.2228 +
137.2229 +static const static_codebook _8u1__p7_0 = {
137.2230 +        4, 81,
137.2231 +        (long *)_vq_lengthlist__8u1__p7_0,
137.2232 +        1, -529137664, 1618345984, 2, 0,
137.2233 +        (long *)_vq_quantlist__8u1__p7_0,
137.2234 +        0
137.2235 +};
137.2236 +
137.2237 +static const long _vq_quantlist__8u1__p7_1[] = {
137.2238 +        5,
137.2239 +        4,
137.2240 +        6,
137.2241 +        3,
137.2242 +        7,
137.2243 +        2,
137.2244 +        8,
137.2245 +        1,
137.2246 +        9,
137.2247 +        0,
137.2248 +        10,
137.2249 +};
137.2250 +
137.2251 +static const long _vq_lengthlist__8u1__p7_1[] = {
137.2252 +         2, 4, 4, 6, 6, 7, 7, 8, 8, 8, 8, 4, 5, 5, 7, 7,
137.2253 +         8, 8, 9, 9, 9, 9, 4, 5, 5, 7, 7, 8, 8, 9, 9, 9,
137.2254 +         9, 6, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 6, 7, 7, 8,
137.2255 +         8, 8, 8, 9, 9, 9, 9, 8, 8, 8, 8, 8, 9, 9, 9, 9,
137.2256 +         9, 9, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 8, 9, 9,
137.2257 +         9, 9, 9, 9,10,10,10,10, 8, 9, 9, 9, 9, 9, 9,10,
137.2258 +        10,10,10, 8, 9, 9, 9, 9, 9, 9,10,10,10,10, 8, 9,
137.2259 +         9, 9, 9, 9, 9,10,10,10,10,
137.2260 +};
137.2261 +
137.2262 +static const static_codebook _8u1__p7_1 = {
137.2263 +        2, 121,
137.2264 +        (long *)_vq_lengthlist__8u1__p7_1,
137.2265 +        1, -531365888, 1611661312, 4, 0,
137.2266 +        (long *)_vq_quantlist__8u1__p7_1,
137.2267 +        0
137.2268 +};
137.2269 +
137.2270 +static const long _vq_quantlist__8u1__p8_0[] = {
137.2271 +        5,
137.2272 +        4,
137.2273 +        6,
137.2274 +        3,
137.2275 +        7,
137.2276 +        2,
137.2277 +        8,
137.2278 +        1,
137.2279 +        9,
137.2280 +        0,
137.2281 +        10,
137.2282 +};
137.2283 +
137.2284 +static const long _vq_lengthlist__8u1__p8_0[] = {
137.2285 +         1, 4, 4, 6, 6, 8, 8,10,10,11,11, 4, 6, 6, 7, 7,
137.2286 +         9, 9,11,11,13,12, 4, 6, 6, 7, 7, 9, 9,11,11,12,
137.2287 +        12, 6, 7, 7, 9, 9,11,11,12,12,13,13, 6, 7, 7, 9,
137.2288 +         9,11,11,12,12,13,13, 8, 9, 9,11,11,12,12,13,13,
137.2289 +        14,14, 8, 9, 9,11,11,12,12,13,13,14,14, 9,11,11,
137.2290 +        12,12,13,13,14,14,15,15, 9,11,11,12,12,13,13,14,
137.2291 +        14,15,14,11,12,12,13,13,14,14,15,15,16,16,11,12,
137.2292 +        12,13,13,14,14,15,15,15,15,
137.2293 +};
137.2294 +
137.2295 +static const static_codebook _8u1__p8_0 = {
137.2296 +        2, 121,
137.2297 +        (long *)_vq_lengthlist__8u1__p8_0,
137.2298 +        1, -524582912, 1618345984, 4, 0,
137.2299 +        (long *)_vq_quantlist__8u1__p8_0,
137.2300 +        0
137.2301 +};
137.2302 +
137.2303 +static const long _vq_quantlist__8u1__p8_1[] = {
137.2304 +        5,
137.2305 +        4,
137.2306 +        6,
137.2307 +        3,
137.2308 +        7,
137.2309 +        2,
137.2310 +        8,
137.2311 +        1,
137.2312 +        9,
137.2313 +        0,
137.2314 +        10,
137.2315 +};
137.2316 +
137.2317 +static const long _vq_lengthlist__8u1__p8_1[] = {
137.2318 +         2, 5, 5, 6, 6, 7, 7, 7, 7, 8, 8, 5, 6, 6, 7, 7,
137.2319 +         7, 7, 8, 8, 8, 8, 5, 6, 6, 7, 7, 7, 7, 8, 8, 8,
137.2320 +         8, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 6, 7, 7, 7,
137.2321 +         7, 8, 8, 8, 8, 8, 8, 7, 7, 7, 8, 8, 8, 8, 8, 8,
137.2322 +         8, 8, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
137.2323 +         8, 8, 8, 8, 9, 8, 9, 9, 7, 8, 8, 8, 8, 8, 8, 9,
137.2324 +         8, 9, 9, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 8, 8,
137.2325 +         8, 8, 8, 8, 8, 9, 9, 9, 9,
137.2326 +};
137.2327 +
137.2328 +static const static_codebook _8u1__p8_1 = {
137.2329 +        2, 121,
137.2330 +        (long *)_vq_lengthlist__8u1__p8_1,
137.2331 +        1, -531365888, 1611661312, 4, 0,
137.2332 +        (long *)_vq_quantlist__8u1__p8_1,
137.2333 +        0
137.2334 +};
137.2335 +
137.2336 +static const long _vq_quantlist__8u1__p9_0[] = {
137.2337 +        7,
137.2338 +        6,
137.2339 +        8,
137.2340 +        5,
137.2341 +        9,
137.2342 +        4,
137.2343 +        10,
137.2344 +        3,
137.2345 +        11,
137.2346 +        2,
137.2347 +        12,
137.2348 +        1,
137.2349 +        13,
137.2350 +        0,
137.2351 +        14,
137.2352 +};
137.2353 +
137.2354 +static const long _vq_lengthlist__8u1__p9_0[] = {
137.2355 +         1, 4, 4,11,11,11,11,11,11,11,11,11,11,11,11, 3,
137.2356 +        11, 8,11,11,11,11,11,11,11,11,11,11,11,11, 3, 9,
137.2357 +         9,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.2358 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.2359 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.2360 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.2361 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.2362 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.2363 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.2364 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.2365 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.2366 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.2367 +        11,11,11,11,11,11,11,11,11,11,10,10,10,10,10,10,
137.2368 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
137.2369 +        10,
137.2370 +};
137.2371 +
137.2372 +static const static_codebook _8u1__p9_0 = {
137.2373 +        2, 225,
137.2374 +        (long *)_vq_lengthlist__8u1__p9_0,
137.2375 +        1, -514071552, 1627381760, 4, 0,
137.2376 +        (long *)_vq_quantlist__8u1__p9_0,
137.2377 +        0
137.2378 +};
137.2379 +
137.2380 +static const long _vq_quantlist__8u1__p9_1[] = {
137.2381 +        7,
137.2382 +        6,
137.2383 +        8,
137.2384 +        5,
137.2385 +        9,
137.2386 +        4,
137.2387 +        10,
137.2388 +        3,
137.2389 +        11,
137.2390 +        2,
137.2391 +        12,
137.2392 +        1,
137.2393 +        13,
137.2394 +        0,
137.2395 +        14,
137.2396 +};
137.2397 +
137.2398 +static const long _vq_lengthlist__8u1__p9_1[] = {
137.2399 +         1, 4, 4, 7, 7, 9, 9, 7, 7, 8, 8,10,10,11,11, 4,
137.2400 +         7, 7, 9, 9,10,10, 8, 8,10,10,10,11,10,11, 4, 7,
137.2401 +         7, 9, 9,10,10, 8, 8,10, 9,11,11,11,11, 7, 9, 9,
137.2402 +        12,12,11,12,10,10,11,10,12,11,11,11, 7, 9, 9,11,
137.2403 +        11,13,12, 9, 9,11,10,11,11,12,11, 9,10,10,12,12,
137.2404 +        14,14,10,10,11,12,12,11,11,11, 9,10,11,11,13,14,
137.2405 +        13,10,11,11,11,12,11,12,12, 7, 8, 8,10, 9,11,10,
137.2406 +        11,12,12,11,12,14,12,13, 7, 8, 8, 9,10,10,11,12,
137.2407 +        12,12,11,12,12,12,13, 9, 9, 9,11,11,13,12,12,12,
137.2408 +        12,11,12,12,13,12, 8,10,10,11,10,11,12,12,12,12,
137.2409 +        12,12,14,12,12, 9,11,11,11,12,12,12,12,13,13,12,
137.2410 +        12,13,13,12,10,11,11,12,11,12,12,12,11,12,13,12,
137.2411 +        12,12,13,11,11,12,12,12,13,12,12,11,12,13,13,12,
137.2412 +        12,13,12,11,12,12,13,13,12,13,12,13,13,13,13,14,
137.2413 +        13,
137.2414 +};
137.2415 +
137.2416 +static const static_codebook _8u1__p9_1 = {
137.2417 +        2, 225,
137.2418 +        (long *)_vq_lengthlist__8u1__p9_1,
137.2419 +        1, -522338304, 1620115456, 4, 0,
137.2420 +        (long *)_vq_quantlist__8u1__p9_1,
137.2421 +        0
137.2422 +};
137.2423 +
137.2424 +static const long _vq_quantlist__8u1__p9_2[] = {
137.2425 +        8,
137.2426 +        7,
137.2427 +        9,
137.2428 +        6,
137.2429 +        10,
137.2430 +        5,
137.2431 +        11,
137.2432 +        4,
137.2433 +        12,
137.2434 +        3,
137.2435 +        13,
137.2436 +        2,
137.2437 +        14,
137.2438 +        1,
137.2439 +        15,
137.2440 +        0,
137.2441 +        16,
137.2442 +};
137.2443 +
137.2444 +static const long _vq_lengthlist__8u1__p9_2[] = {
137.2445 +         2, 5, 4, 6, 6, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9,
137.2446 +         9, 5, 6, 6, 7, 7, 8, 8, 9, 8, 9, 9, 9, 9, 9, 9,
137.2447 +         9, 9, 5, 6, 6, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9, 9,
137.2448 +         9, 9, 9, 7, 7, 7, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9,
137.2449 +         9,10,10, 9, 7, 7, 7, 8, 8, 9, 9, 9, 9, 9, 9, 9,
137.2450 +         9, 9, 9,10,10, 8, 8, 8, 9, 9, 9, 9,10,10,10, 9,
137.2451 +        10,10,10,10,10,10, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9,
137.2452 +        10,10,10,10,10,10,10, 9, 9, 9, 9, 9, 9, 9, 9,10,
137.2453 +        10,10,10,10,10,10,10,10, 9, 9, 9, 9, 9,10,10,10,
137.2454 +        10,10,10,10,10,10,10,10,10, 9, 9, 9, 9, 9, 9,10,
137.2455 +        10,10,10,10,10,10,10,10,10,10, 9, 9, 9, 9, 9,10,
137.2456 +        10,10,10,10,10,10,10,10,10,10,10, 9, 9, 9, 9,10,
137.2457 +        10,10,10,10,10,10,10,10,10,10,10,10, 9, 9, 9, 9,
137.2458 +         9,10,10,10,10,10,10,10,10,10,10,10,10, 9, 9, 9,
137.2459 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10, 9,10,
137.2460 +         9, 9, 9,10,10,10,10,10,10,10,10,10,10,10,10, 9,
137.2461 +        10, 9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
137.2462 +         9, 9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
137.2463 +        10,
137.2464 +};
137.2465 +
137.2466 +static const static_codebook _8u1__p9_2 = {
137.2467 +        2, 289,
137.2468 +        (long *)_vq_lengthlist__8u1__p9_2,
137.2469 +        1, -529530880, 1611661312, 5, 0,
137.2470 +        (long *)_vq_quantlist__8u1__p9_2,
137.2471 +        0
137.2472 +};
137.2473 +
137.2474 +static const long _huff_lengthlist__8u1__single[] = {
137.2475 +         4, 7,13, 9,15, 9,16, 8,10,13, 7, 5, 8, 6, 9, 7,
137.2476 +        10, 7,10,11,11, 6, 7, 8, 8, 9, 9, 9,12,16, 8, 5,
137.2477 +         8, 6, 8, 6, 9, 7,10,12,11, 7, 7, 7, 6, 7, 7, 7,
137.2478 +        11,15, 7, 5, 8, 6, 7, 5, 7, 6, 9,13,13, 9, 9, 8,
137.2479 +         6, 6, 5, 5, 9,14, 8, 6, 8, 6, 6, 4, 5, 3, 5,13,
137.2480 +         9, 9,11, 8,10, 7, 8, 4, 5,12,11,16,17,15,17,12,
137.2481 +        13, 8, 8,15,
137.2482 +};
137.2483 +
137.2484 +static const static_codebook _huff_book__8u1__single = {
137.2485 +        2, 100,
137.2486 +        (long *)_huff_lengthlist__8u1__single,
137.2487 +        0, 0, 0, 0, 0,
137.2488 +        NULL,
137.2489 +        0
137.2490 +};
137.2491 +
137.2492 +static const long _huff_lengthlist__44u0__long[] = {
137.2493 +         5, 8,13,10,17,11,11,15, 7, 2, 4, 5, 8, 7, 9,16,
137.2494 +        13, 4, 3, 5, 6, 8,11,20,10, 4, 5, 5, 7, 6, 8,18,
137.2495 +        15, 7, 6, 7, 8,10,14,20,10, 6, 7, 6, 9, 7, 8,17,
137.2496 +         9, 8,10, 8,10, 5, 4,11,12,17,19,14,16,10, 7,12,
137.2497 +};
137.2498 +
137.2499 +static const static_codebook _huff_book__44u0__long = {
137.2500 +        2, 64,
137.2501 +        (long *)_huff_lengthlist__44u0__long,
137.2502 +        0, 0, 0, 0, 0,
137.2503 +        NULL,
137.2504 +        0
137.2505 +};
137.2506 +
137.2507 +static const long _vq_quantlist__44u0__p1_0[] = {
137.2508 +        1,
137.2509 +        0,
137.2510 +        2,
137.2511 +};
137.2512 +
137.2513 +static const long _vq_lengthlist__44u0__p1_0[] = {
137.2514 +         1, 4, 4, 5, 8, 7, 5, 7, 8, 5, 8, 8, 8,11,11, 8,
137.2515 +        10,10, 5, 8, 8, 8,11,10, 8,11,11, 4, 8, 8, 8,11,
137.2516 +        11, 8,11,11, 8,12,11,11,13,13,11,13,14, 7,11,11,
137.2517 +        10,13,12,11,13,14, 4, 8, 8, 8,11,11, 8,11,12, 8,
137.2518 +        11,11,11,13,13,10,12,13, 8,11,11,11,14,13,11,14,
137.2519 +        13,
137.2520 +};
137.2521 +
137.2522 +static const static_codebook _44u0__p1_0 = {
137.2523 +        4, 81,
137.2524 +        (long *)_vq_lengthlist__44u0__p1_0,
137.2525 +        1, -535822336, 1611661312, 2, 0,
137.2526 +        (long *)_vq_quantlist__44u0__p1_0,
137.2527 +        0
137.2528 +};
137.2529 +
137.2530 +static const long _vq_quantlist__44u0__p2_0[] = {
137.2531 +        1,
137.2532 +        0,
137.2533 +        2,
137.2534 +};
137.2535 +
137.2536 +static const long _vq_lengthlist__44u0__p2_0[] = {
137.2537 +         2, 4, 4, 5, 6, 6, 5, 6, 6, 5, 7, 7, 7, 8, 8, 6,
137.2538 +         8, 8, 5, 7, 7, 6, 8, 8, 7, 8, 8, 4, 7, 7, 7, 8,
137.2539 +         8, 7, 8, 8, 7, 8, 8, 8, 9,10, 8,10,10, 6, 8, 8,
137.2540 +         8,10, 8, 8,10,10, 5, 7, 7, 7, 8, 8, 7, 8, 8, 6,
137.2541 +         8, 8, 8,10,10, 8, 8,10, 6, 8, 8, 8,10,10, 8,10,
137.2542 +         9,
137.2543 +};
137.2544 +
137.2545 +static const static_codebook _44u0__p2_0 = {
137.2546 +        4, 81,
137.2547 +        (long *)_vq_lengthlist__44u0__p2_0,
137.2548 +        1, -535822336, 1611661312, 2, 0,
137.2549 +        (long *)_vq_quantlist__44u0__p2_0,
137.2550 +        0
137.2551 +};
137.2552 +
137.2553 +static const long _vq_quantlist__44u0__p3_0[] = {
137.2554 +        2,
137.2555 +        1,
137.2556 +        3,
137.2557 +        0,
137.2558 +        4,
137.2559 +};
137.2560 +
137.2561 +static const long _vq_lengthlist__44u0__p3_0[] = {
137.2562 +         1, 5, 5, 8, 8, 5, 8, 7, 9, 9, 5, 7, 8, 9, 9, 9,
137.2563 +        10, 9,12,12, 9, 9,10,12,12, 6, 8, 8,11,10, 8,10,
137.2564 +        10,11,11, 8, 9,10,11,11,10,11,11,14,13,10,11,11,
137.2565 +        13,13, 5, 8, 8,10,10, 8,10,10,11,11, 8,10,10,11,
137.2566 +        11,10,11,11,13,13,10,11,11,13,13, 9,11,11,15,14,
137.2567 +        10,12,12,15,14,10,12,11,15,14,13,14,14,16,16,12,
137.2568 +        14,13,17,15, 9,11,11,14,15,10,11,12,14,16,10,11,
137.2569 +        12,14,16,12,13,14,16,16,13,13,15,15,18, 5, 8, 8,
137.2570 +        11,11, 8,10,10,12,12, 8,10,10,12,13,11,12,12,14,
137.2571 +        14,11,12,12,15,15, 8,10,10,13,13,10,12,12,13,13,
137.2572 +        10,12,12,14,14,12,13,13,15,15,12,13,13,16,16, 7,
137.2573 +        10,10,12,12,10,12,11,13,13,10,12,12,13,14,12,13,
137.2574 +        12,15,14,12,13,13,16,16,10,12,12,17,16,12,13,13,
137.2575 +        16,15,11,13,13,17,17,15,15,15,16,17,14,15,15,19,
137.2576 +        19,10,12,12,15,16,11,13,12,15,18,11,13,13,16,16,
137.2577 +        14,15,15,17,17,14,15,15,17,19, 5, 8, 8,11,11, 8,
137.2578 +        10,10,12,12, 8,10,10,12,12,11,12,12,16,15,11,12,
137.2579 +        12,14,15, 7,10,10,13,13,10,12,12,14,13,10,11,12,
137.2580 +        13,13,12,13,13,16,16,12,12,13,15,15, 8,10,10,13,
137.2581 +        13,10,12,12,14,14,10,12,12,13,13,12,13,13,16,16,
137.2582 +        12,13,13,15,15,10,12,12,16,15,11,13,13,17,16,11,
137.2583 +        12,13,16,15,13,15,15,19,17,14,15,14,17,16,10,12,
137.2584 +        12,16,16,11,13,13,16,17,12,13,13,15,17,14,15,15,
137.2585 +        17,19,14,15,15,17,17, 8,11,11,16,16,10,13,12,17,
137.2586 +        17,10,12,13,16,16,15,17,16,20,19,14,15,17,18,19,
137.2587 +         9,12,12,16,17,11,13,14,17,18,11,13,13,19,18,16,
137.2588 +        17,18,19,19,15,16,16,19,19, 9,12,12,16,17,11,14,
137.2589 +        13,18,17,11,13,13,17,17,16,17,16,20,19,14,16,16,
137.2590 +        18,18,12,15,15,19,17,14,15,16, 0,20,13,15,16,20,
137.2591 +        17,18,16,20, 0, 0,15,16,19,20, 0,12,15,14,18,19,
137.2592 +        13,16,15,20,19,13,16,15,20,18,17,18,17, 0,20,16,
137.2593 +        17,16, 0, 0, 8,11,11,16,15,10,12,12,17,17,10,13,
137.2594 +        13,17,16,14,16,15,18,20,15,16,16,19,19, 9,12,12,
137.2595 +        16,16,11,13,13,17,16,11,13,14,17,18,15,15,16,20,
137.2596 +        20,16,16,17,19,19, 9,13,12,16,17,11,14,13,17,17,
137.2597 +        11,14,14,18,17,14,16,15,18,19,16,17,18,18,19,12,
137.2598 +        14,15,19,18,13,15,16,18, 0,13,14,15, 0, 0,16,16,
137.2599 +        17,20, 0,17,17,20,20, 0,12,15,15,19,20,13,15,15,
137.2600 +         0, 0,14,16,15, 0, 0,15,18,16, 0, 0,17,18,16, 0,
137.2601 +        19,
137.2602 +};
137.2603 +
137.2604 +static const static_codebook _44u0__p3_0 = {
137.2605 +        4, 625,
137.2606 +        (long *)_vq_lengthlist__44u0__p3_0,
137.2607 +        1, -533725184, 1611661312, 3, 0,
137.2608 +        (long *)_vq_quantlist__44u0__p3_0,
137.2609 +        0
137.2610 +};
137.2611 +
137.2612 +static const long _vq_quantlist__44u0__p4_0[] = {
137.2613 +        2,
137.2614 +        1,
137.2615 +        3,
137.2616 +        0,
137.2617 +        4,
137.2618 +};
137.2619 +
137.2620 +static const long _vq_lengthlist__44u0__p4_0[] = {
137.2621 +         4, 5, 5, 9, 9, 5, 6, 6, 9, 9, 5, 6, 6, 9, 9, 9,
137.2622 +        10, 9,12,12, 9, 9,10,12,12, 5, 7, 7,10,10, 7, 7,
137.2623 +         8,10,10, 6, 7, 8,10,10,10,10,10,11,13,10, 9,10,
137.2624 +        12,13, 5, 7, 7,10,10, 6, 8, 7,10,10, 7, 8, 7,10,
137.2625 +        10, 9,10,10,12,12,10,10,10,13,11, 9,10,10,13,13,
137.2626 +        10,11,10,13,13,10,10,10,13,13,12,12,13,14,14,12,
137.2627 +        12,13,14,14, 9,10,10,13,13,10,10,10,13,13,10,10,
137.2628 +        10,13,13,12,13,12,15,14,12,13,12,15,15, 5, 7, 6,
137.2629 +        10,10, 7, 8, 8,10,10, 7, 8, 8,10,10,10,11,10,13,
137.2630 +        13,10,10,10,12,12, 7, 8, 8,11,10, 8, 8, 9,10,11,
137.2631 +         8, 9, 9,11,11,11,10,11,11,14,11,11,11,13,13, 6,
137.2632 +         8, 8,10,10, 7, 9, 8,11,10, 8, 9, 9,11,11,10,11,
137.2633 +        10,14,11,10,11,11,13,13,10,11,11,14,13,10,10,11,
137.2634 +        14,13,10,11,11,14,14,12,11,13,12,16,13,14,14,15,
137.2635 +        15,10,10,11,13,14,10,11,10,14,13,10,11,11,14,14,
137.2636 +        12,13,12,15,13,13,13,14,15,16, 5, 7, 7,10,10, 7,
137.2637 +         8, 8,10,10, 7, 8, 8,10,10,10,10,10,13,13,10,10,
137.2638 +        11,12,13, 6, 8, 8,11,10, 8, 9, 9,11,11, 7, 8, 9,
137.2639 +        10,11,10,11,11,13,13,10,10,11,11,13, 6, 8, 8,10,
137.2640 +        11, 8, 9, 9,11,11, 8, 9, 8,12,10,10,11,11,13,13,
137.2641 +        10,11,10,14,11,10,10,10,14,13,10,11,11,14,13,10,
137.2642 +        10,11,13,13,12,14,14,16,16,12,12,13,13,15,10,11,
137.2643 +        11,13,14,10,11,11,14,15,10,11,10,13,13,13,14,13,
137.2644 +        16,16,12,13,11,15,12, 9,10,10,13,13,10,11,11,14,
137.2645 +        13,10,10,11,13,14,13,14,13,16,16,13,13,13,15,16,
137.2646 +         9,10,10,13,13,10,10,11,13,14,10,11,11,15,13,13,
137.2647 +        13,14,14,18,13,13,14,16,15, 9,10,10,13,14,10,11,
137.2648 +        10,14,13,10,11,11,13,14,13,14,13,16,15,13,13,14,
137.2649 +        15,16,12,13,12,16,14,11,11,13,15,15,13,14,13,16,
137.2650 +        15,15,12,16,12,17,14,15,15,17,17,12,13,13,14,16,
137.2651 +        11,13,11,16,15,12,13,14,15,16,14,15,13, 0,14,14,
137.2652 +        16,16, 0, 0, 9,10,10,13,13,10,11,10,14,14,10,11,
137.2653 +        11,13,13,12,13,13,14,16,13,14,14,16,16, 9,10,10,
137.2654 +        14,14,11,11,11,14,13,10,10,11,14,14,13,13,13,16,
137.2655 +        16,13,13,14,14,17, 9,10,10,13,14,10,11,11,13,15,
137.2656 +        10,11,10,14,14,13,13,13,14,17,13,14,13,17,14,12,
137.2657 +        13,13,16,14,13,14,13,16,15,12,12,13,15,16,15,15,
137.2658 +        16,18,16,15,13,15,14, 0,12,12,13,14,16,13,13,14,
137.2659 +        15,16,11,12,11,16,14,15,16,16,17,17,14,15,12,17,
137.2660 +        12,
137.2661 +};
137.2662 +
137.2663 +static const static_codebook _44u0__p4_0 = {
137.2664 +        4, 625,
137.2665 +        (long *)_vq_lengthlist__44u0__p4_0,
137.2666 +        1, -533725184, 1611661312, 3, 0,
137.2667 +        (long *)_vq_quantlist__44u0__p4_0,
137.2668 +        0
137.2669 +};
137.2670 +
137.2671 +static const long _vq_quantlist__44u0__p5_0[] = {
137.2672 +        4,
137.2673 +        3,
137.2674 +        5,
137.2675 +        2,
137.2676 +        6,
137.2677 +        1,
137.2678 +        7,
137.2679 +        0,
137.2680 +        8,
137.2681 +};
137.2682 +
137.2683 +static const long _vq_lengthlist__44u0__p5_0[] = {
137.2684 +         1, 4, 4, 7, 7, 7, 7, 9, 9, 4, 6, 6, 8, 8, 8, 8,
137.2685 +         9, 9, 4, 6, 6, 8, 8, 8, 8, 9, 9, 7, 8, 8, 9, 9,
137.2686 +         9, 9,11,10, 7, 8, 8, 9, 9, 9, 9,10,10, 7, 8, 8,
137.2687 +         9, 9,10,10,11,11, 7, 8, 8, 9, 9,10,10,11,11, 9,
137.2688 +         9, 9,10,10,11,11,12,12, 9, 9, 9,10,11,11,11,12,
137.2689 +        12,
137.2690 +};
137.2691 +
137.2692 +static const static_codebook _44u0__p5_0 = {
137.2693 +        2, 81,
137.2694 +        (long *)_vq_lengthlist__44u0__p5_0,
137.2695 +        1, -531628032, 1611661312, 4, 0,
137.2696 +        (long *)_vq_quantlist__44u0__p5_0,
137.2697 +        0
137.2698 +};
137.2699 +
137.2700 +static const long _vq_quantlist__44u0__p6_0[] = {
137.2701 +        6,
137.2702 +        5,
137.2703 +        7,
137.2704 +        4,
137.2705 +        8,
137.2706 +        3,
137.2707 +        9,
137.2708 +        2,
137.2709 +        10,
137.2710 +        1,
137.2711 +        11,
137.2712 +        0,
137.2713 +        12,
137.2714 +};
137.2715 +
137.2716 +static const long _vq_lengthlist__44u0__p6_0[] = {
137.2717 +         1, 4, 4, 6, 6, 8, 8,10, 9,11,10,14,13, 4, 6, 5,
137.2718 +         8, 8, 9, 9,11,10,11,11,14,14, 4, 5, 6, 8, 8, 9,
137.2719 +         9,10,10,11,11,14,14, 6, 8, 8, 9, 9,10,10,11,11,
137.2720 +        12,12,16,15, 7, 8, 8, 9, 9,10,10,11,11,12,12,15,
137.2721 +        15, 9,10,10,10,10,11,11,12,12,12,12,15,15, 9,10,
137.2722 +         9,10,11,11,11,12,12,12,13,15,15,10,10,11,11,11,
137.2723 +        12,12,13,12,13,13,16,15,10,11,11,11,11,12,12,13,
137.2724 +        12,13,13,16,17,11,11,12,12,12,13,13,13,14,14,15,
137.2725 +        17,17,11,11,12,12,12,13,13,13,14,14,14,16,18,14,
137.2726 +        15,15,15,15,16,16,16,16,17,18, 0, 0,14,15,15,15,
137.2727 +        15,17,16,17,18,17,17,18, 0,
137.2728 +};
137.2729 +
137.2730 +static const static_codebook _44u0__p6_0 = {
137.2731 +        2, 169,
137.2732 +        (long *)_vq_lengthlist__44u0__p6_0,
137.2733 +        1, -526516224, 1616117760, 4, 0,
137.2734 +        (long *)_vq_quantlist__44u0__p6_0,
137.2735 +        0
137.2736 +};
137.2737 +
137.2738 +static const long _vq_quantlist__44u0__p6_1[] = {
137.2739 +        2,
137.2740 +        1,
137.2741 +        3,
137.2742 +        0,
137.2743 +        4,
137.2744 +};
137.2745 +
137.2746 +static const long _vq_lengthlist__44u0__p6_1[] = {
137.2747 +         2, 4, 4, 5, 5, 4, 5, 5, 5, 5, 4, 5, 5, 5, 5, 5,
137.2748 +         6, 6, 6, 6, 5, 6, 6, 6, 6,
137.2749 +};
137.2750 +
137.2751 +static const static_codebook _44u0__p6_1 = {
137.2752 +        2, 25,
137.2753 +        (long *)_vq_lengthlist__44u0__p6_1,
137.2754 +        1, -533725184, 1611661312, 3, 0,
137.2755 +        (long *)_vq_quantlist__44u0__p6_1,
137.2756 +        0
137.2757 +};
137.2758 +
137.2759 +static const long _vq_quantlist__44u0__p7_0[] = {
137.2760 +        2,
137.2761 +        1,
137.2762 +        3,
137.2763 +        0,
137.2764 +        4,
137.2765 +};
137.2766 +
137.2767 +static const long _vq_lengthlist__44u0__p7_0[] = {
137.2768 +         1, 4, 4,11,11, 9,11,11,11,11,11,11,11,11,11,11,
137.2769 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.2770 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.2771 +        11,11, 9,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.2772 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.2773 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.2774 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.2775 +        11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,
137.2776 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.2777 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.2778 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.2779 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.2780 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.2781 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.2782 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.2783 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.2784 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.2785 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.2786 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.2787 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.2788 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.2789 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.2790 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.2791 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.2792 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.2793 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.2794 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.2795 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.2796 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.2797 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.2798 +        11,11,11,11,11,11,10,10,10,10,10,10,10,10,10,10,
137.2799 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
137.2800 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
137.2801 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
137.2802 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
137.2803 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
137.2804 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
137.2805 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
137.2806 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
137.2807 +        10,
137.2808 +};
137.2809 +
137.2810 +static const static_codebook _44u0__p7_0 = {
137.2811 +        4, 625,
137.2812 +        (long *)_vq_lengthlist__44u0__p7_0,
137.2813 +        1, -518709248, 1626677248, 3, 0,
137.2814 +        (long *)_vq_quantlist__44u0__p7_0,
137.2815 +        0
137.2816 +};
137.2817 +
137.2818 +static const long _vq_quantlist__44u0__p7_1[] = {
137.2819 +        6,
137.2820 +        5,
137.2821 +        7,
137.2822 +        4,
137.2823 +        8,
137.2824 +        3,
137.2825 +        9,
137.2826 +        2,
137.2827 +        10,
137.2828 +        1,
137.2829 +        11,
137.2830 +        0,
137.2831 +        12,
137.2832 +};
137.2833 +
137.2834 +static const long _vq_lengthlist__44u0__p7_1[] = {
137.2835 +         1, 4, 4, 6, 6, 6, 6, 7, 7, 8, 8, 9, 9, 5, 7, 7,
137.2836 +         8, 7, 7, 7, 9, 8,10, 9,10,11, 5, 7, 7, 8, 8, 7,
137.2837 +         7, 8, 9,10,10,11,11, 6, 8, 8, 9, 9, 9, 9,11,10,
137.2838 +        12,12,15,12, 6, 8, 8, 9, 9, 9, 9,11,11,12,11,14,
137.2839 +        12, 7, 8, 8,10,10,12,12,13,13,13,15,13,13, 7, 8,
137.2840 +         8,10,10,11,11,13,12,14,15,15,15, 9,10,10,11,12,
137.2841 +        13,13,14,15,14,15,14,15, 8,10,10,12,12,14,14,15,
137.2842 +        14,14,15,15,14,10,12,12,14,14,15,14,15,15,15,14,
137.2843 +        15,15,10,12,12,13,14,15,14,15,15,14,15,15,15,12,
137.2844 +        15,13,15,14,15,15,15,15,15,15,15,15,13,13,15,15,
137.2845 +        15,15,15,15,15,15,15,15,15,
137.2846 +};
137.2847 +
137.2848 +static const static_codebook _44u0__p7_1 = {
137.2849 +        2, 169,
137.2850 +        (long *)_vq_lengthlist__44u0__p7_1,
137.2851 +        1, -523010048, 1618608128, 4, 0,
137.2852 +        (long *)_vq_quantlist__44u0__p7_1,
137.2853 +        0
137.2854 +};
137.2855 +
137.2856 +static const long _vq_quantlist__44u0__p7_2[] = {
137.2857 +        6,
137.2858 +        5,
137.2859 +        7,
137.2860 +        4,
137.2861 +        8,
137.2862 +        3,
137.2863 +        9,
137.2864 +        2,
137.2865 +        10,
137.2866 +        1,
137.2867 +        11,
137.2868 +        0,
137.2869 +        12,
137.2870 +};
137.2871 +
137.2872 +static const long _vq_lengthlist__44u0__p7_2[] = {
137.2873 +         2, 5, 4, 6, 6, 7, 7, 8, 8, 8, 8, 9, 8, 5, 5, 6,
137.2874 +         7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 5, 6, 5, 7, 7, 8,
137.2875 +         8, 8, 8, 9, 9, 9, 9, 6, 7, 7, 8, 8, 8, 8, 9, 8,
137.2876 +         9, 9, 9, 9, 6, 7, 7, 8, 7, 8, 8, 9, 9, 9, 9, 9,
137.2877 +         9, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 7, 8,
137.2878 +         8, 9, 8, 9, 8, 9, 9, 9, 9, 9, 9, 8, 9, 8, 9, 9,
137.2879 +         9, 9, 9, 9, 9, 9,10,10, 8, 8, 9, 9, 9, 9, 9, 9,
137.2880 +         9, 9,10, 9,10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
137.2881 +         9, 9, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
137.2882 +         9, 9, 9, 9, 9, 9, 9, 9,10,10,10, 9, 9, 9, 9, 9,
137.2883 +         9, 9, 9,10, 9, 9,10,10, 9,
137.2884 +};
137.2885 +
137.2886 +static const static_codebook _44u0__p7_2 = {
137.2887 +        2, 169,
137.2888 +        (long *)_vq_lengthlist__44u0__p7_2,
137.2889 +        1, -531103744, 1611661312, 4, 0,
137.2890 +        (long *)_vq_quantlist__44u0__p7_2,
137.2891 +        0
137.2892 +};
137.2893 +
137.2894 +static const long _huff_lengthlist__44u0__short[] = {
137.2895 +        12,13,14,13,17,12,15,17, 5, 5, 6,10,10,11,15,16,
137.2896 +         4, 3, 3, 7, 5, 7,10,16, 7, 7, 7,10, 9,11,12,16,
137.2897 +         6, 5, 5, 9, 5, 6,10,16, 8, 7, 7, 9, 6, 7, 9,16,
137.2898 +        11, 7, 3, 6, 4, 5, 8,16,12, 9, 4, 8, 5, 7, 9,16,
137.2899 +};
137.2900 +
137.2901 +static const static_codebook _huff_book__44u0__short = {
137.2902 +        2, 64,
137.2903 +        (long *)_huff_lengthlist__44u0__short,
137.2904 +        0, 0, 0, 0, 0,
137.2905 +        NULL,
137.2906 +        0
137.2907 +};
137.2908 +
137.2909 +static const long _huff_lengthlist__44u1__long[] = {
137.2910 +         5, 8,13,10,17,11,11,15, 7, 2, 4, 5, 8, 7, 9,16,
137.2911 +        13, 4, 3, 5, 6, 8,11,20,10, 4, 5, 5, 7, 6, 8,18,
137.2912 +        15, 7, 6, 7, 8,10,14,20,10, 6, 7, 6, 9, 7, 8,17,
137.2913 +         9, 8,10, 8,10, 5, 4,11,12,17,19,14,16,10, 7,12,
137.2914 +};
137.2915 +
137.2916 +static const static_codebook _huff_book__44u1__long = {
137.2917 +        2, 64,
137.2918 +        (long *)_huff_lengthlist__44u1__long,
137.2919 +        0, 0, 0, 0, 0,
137.2920 +        NULL,
137.2921 +        0
137.2922 +};
137.2923 +
137.2924 +static const long _vq_quantlist__44u1__p1_0[] = {
137.2925 +        1,
137.2926 +        0,
137.2927 +        2,
137.2928 +};
137.2929 +
137.2930 +static const long _vq_lengthlist__44u1__p1_0[] = {
137.2931 +         1, 4, 4, 5, 8, 7, 5, 7, 8, 5, 8, 8, 8,11,11, 8,
137.2932 +        10,10, 5, 8, 8, 8,11,10, 8,11,11, 4, 8, 8, 8,11,
137.2933 +        11, 8,11,11, 8,12,11,11,13,13,11,13,14, 7,11,11,
137.2934 +        10,13,12,11,13,14, 4, 8, 8, 8,11,11, 8,11,12, 8,
137.2935 +        11,11,11,13,13,10,12,13, 8,11,11,11,14,13,11,14,
137.2936 +        13,
137.2937 +};
137.2938 +
137.2939 +static const static_codebook _44u1__p1_0 = {
137.2940 +        4, 81,
137.2941 +        (long *)_vq_lengthlist__44u1__p1_0,
137.2942 +        1, -535822336, 1611661312, 2, 0,
137.2943 +        (long *)_vq_quantlist__44u1__p1_0,
137.2944 +        0
137.2945 +};
137.2946 +
137.2947 +static const long _vq_quantlist__44u1__p2_0[] = {
137.2948 +        1,
137.2949 +        0,
137.2950 +        2,
137.2951 +};
137.2952 +
137.2953 +static const long _vq_lengthlist__44u1__p2_0[] = {
137.2954 +         2, 4, 4, 5, 6, 6, 5, 6, 6, 5, 7, 7, 7, 8, 8, 6,
137.2955 +         8, 8, 5, 7, 7, 6, 8, 8, 7, 8, 8, 4, 7, 7, 7, 8,
137.2956 +         8, 7, 8, 8, 7, 8, 8, 8, 9,10, 8,10,10, 6, 8, 8,
137.2957 +         8,10, 8, 8,10,10, 5, 7, 7, 7, 8, 8, 7, 8, 8, 6,
137.2958 +         8, 8, 8,10,10, 8, 8,10, 6, 8, 8, 8,10,10, 8,10,
137.2959 +         9,
137.2960 +};
137.2961 +
137.2962 +static const static_codebook _44u1__p2_0 = {
137.2963 +        4, 81,
137.2964 +        (long *)_vq_lengthlist__44u1__p2_0,
137.2965 +        1, -535822336, 1611661312, 2, 0,
137.2966 +        (long *)_vq_quantlist__44u1__p2_0,
137.2967 +        0
137.2968 +};
137.2969 +
137.2970 +static const long _vq_quantlist__44u1__p3_0[] = {
137.2971 +        2,
137.2972 +        1,
137.2973 +        3,
137.2974 +        0,
137.2975 +        4,
137.2976 +};
137.2977 +
137.2978 +static const long _vq_lengthlist__44u1__p3_0[] = {
137.2979 +         1, 5, 5, 8, 8, 5, 8, 7, 9, 9, 5, 7, 8, 9, 9, 9,
137.2980 +        10, 9,12,12, 9, 9,10,12,12, 6, 8, 8,11,10, 8,10,
137.2981 +        10,11,11, 8, 9,10,11,11,10,11,11,14,13,10,11,11,
137.2982 +        13,13, 5, 8, 8,10,10, 8,10,10,11,11, 8,10,10,11,
137.2983 +        11,10,11,11,13,13,10,11,11,13,13, 9,11,11,15,14,
137.2984 +        10,12,12,15,14,10,12,11,15,14,13,14,14,16,16,12,
137.2985 +        14,13,17,15, 9,11,11,14,15,10,11,12,14,16,10,11,
137.2986 +        12,14,16,12,13,14,16,16,13,13,15,15,18, 5, 8, 8,
137.2987 +        11,11, 8,10,10,12,12, 8,10,10,12,13,11,12,12,14,
137.2988 +        14,11,12,12,15,15, 8,10,10,13,13,10,12,12,13,13,
137.2989 +        10,12,12,14,14,12,13,13,15,15,12,13,13,16,16, 7,
137.2990 +        10,10,12,12,10,12,11,13,13,10,12,12,13,14,12,13,
137.2991 +        12,15,14,12,13,13,16,16,10,12,12,17,16,12,13,13,
137.2992 +        16,15,11,13,13,17,17,15,15,15,16,17,14,15,15,19,
137.2993 +        19,10,12,12,15,16,11,13,12,15,18,11,13,13,16,16,
137.2994 +        14,15,15,17,17,14,15,15,17,19, 5, 8, 8,11,11, 8,
137.2995 +        10,10,12,12, 8,10,10,12,12,11,12,12,16,15,11,12,
137.2996 +        12,14,15, 7,10,10,13,13,10,12,12,14,13,10,11,12,
137.2997 +        13,13,12,13,13,16,16,12,12,13,15,15, 8,10,10,13,
137.2998 +        13,10,12,12,14,14,10,12,12,13,13,12,13,13,16,16,
137.2999 +        12,13,13,15,15,10,12,12,16,15,11,13,13,17,16,11,
137.3000 +        12,13,16,15,13,15,15,19,17,14,15,14,17,16,10,12,
137.3001 +        12,16,16,11,13,13,16,17,12,13,13,15,17,14,15,15,
137.3002 +        17,19,14,15,15,17,17, 8,11,11,16,16,10,13,12,17,
137.3003 +        17,10,12,13,16,16,15,17,16,20,19,14,15,17,18,19,
137.3004 +         9,12,12,16,17,11,13,14,17,18,11,13,13,19,18,16,
137.3005 +        17,18,19,19,15,16,16,19,19, 9,12,12,16,17,11,14,
137.3006 +        13,18,17,11,13,13,17,17,16,17,16,20,19,14,16,16,
137.3007 +        18,18,12,15,15,19,17,14,15,16, 0,20,13,15,16,20,
137.3008 +        17,18,16,20, 0, 0,15,16,19,20, 0,12,15,14,18,19,
137.3009 +        13,16,15,20,19,13,16,15,20,18,17,18,17, 0,20,16,
137.3010 +        17,16, 0, 0, 8,11,11,16,15,10,12,12,17,17,10,13,
137.3011 +        13,17,16,14,16,15,18,20,15,16,16,19,19, 9,12,12,
137.3012 +        16,16,11,13,13,17,16,11,13,14,17,18,15,15,16,20,
137.3013 +        20,16,16,17,19,19, 9,13,12,16,17,11,14,13,17,17,
137.3014 +        11,14,14,18,17,14,16,15,18,19,16,17,18,18,19,12,
137.3015 +        14,15,19,18,13,15,16,18, 0,13,14,15, 0, 0,16,16,
137.3016 +        17,20, 0,17,17,20,20, 0,12,15,15,19,20,13,15,15,
137.3017 +         0, 0,14,16,15, 0, 0,15,18,16, 0, 0,17,18,16, 0,
137.3018 +        19,
137.3019 +};
137.3020 +
137.3021 +static const static_codebook _44u1__p3_0 = {
137.3022 +        4, 625,
137.3023 +        (long *)_vq_lengthlist__44u1__p3_0,
137.3024 +        1, -533725184, 1611661312, 3, 0,
137.3025 +        (long *)_vq_quantlist__44u1__p3_0,
137.3026 +        0
137.3027 +};
137.3028 +
137.3029 +static const long _vq_quantlist__44u1__p4_0[] = {
137.3030 +        2,
137.3031 +        1,
137.3032 +        3,
137.3033 +        0,
137.3034 +        4,
137.3035 +};
137.3036 +
137.3037 +static const long _vq_lengthlist__44u1__p4_0[] = {
137.3038 +         4, 5, 5, 9, 9, 5, 6, 6, 9, 9, 5, 6, 6, 9, 9, 9,
137.3039 +        10, 9,12,12, 9, 9,10,12,12, 5, 7, 7,10,10, 7, 7,
137.3040 +         8,10,10, 6, 7, 8,10,10,10,10,10,11,13,10, 9,10,
137.3041 +        12,13, 5, 7, 7,10,10, 6, 8, 7,10,10, 7, 8, 7,10,
137.3042 +        10, 9,10,10,12,12,10,10,10,13,11, 9,10,10,13,13,
137.3043 +        10,11,10,13,13,10,10,10,13,13,12,12,13,14,14,12,
137.3044 +        12,13,14,14, 9,10,10,13,13,10,10,10,13,13,10,10,
137.3045 +        10,13,13,12,13,12,15,14,12,13,12,15,15, 5, 7, 6,
137.3046 +        10,10, 7, 8, 8,10,10, 7, 8, 8,10,10,10,11,10,13,
137.3047 +        13,10,10,10,12,12, 7, 8, 8,11,10, 8, 8, 9,10,11,
137.3048 +         8, 9, 9,11,11,11,10,11,11,14,11,11,11,13,13, 6,
137.3049 +         8, 8,10,10, 7, 9, 8,11,10, 8, 9, 9,11,11,10,11,
137.3050 +        10,14,11,10,11,11,13,13,10,11,11,14,13,10,10,11,
137.3051 +        14,13,10,11,11,14,14,12,11,13,12,16,13,14,14,15,
137.3052 +        15,10,10,11,13,14,10,11,10,14,13,10,11,11,14,14,
137.3053 +        12,13,12,15,13,13,13,14,15,16, 5, 7, 7,10,10, 7,
137.3054 +         8, 8,10,10, 7, 8, 8,10,10,10,10,10,13,13,10,10,
137.3055 +        11,12,13, 6, 8, 8,11,10, 8, 9, 9,11,11, 7, 8, 9,
137.3056 +        10,11,10,11,11,13,13,10,10,11,11,13, 6, 8, 8,10,
137.3057 +        11, 8, 9, 9,11,11, 8, 9, 8,12,10,10,11,11,13,13,
137.3058 +        10,11,10,14,11,10,10,10,14,13,10,11,11,14,13,10,
137.3059 +        10,11,13,13,12,14,14,16,16,12,12,13,13,15,10,11,
137.3060 +        11,13,14,10,11,11,14,15,10,11,10,13,13,13,14,13,
137.3061 +        16,16,12,13,11,15,12, 9,10,10,13,13,10,11,11,14,
137.3062 +        13,10,10,11,13,14,13,14,13,16,16,13,13,13,15,16,
137.3063 +         9,10,10,13,13,10,10,11,13,14,10,11,11,15,13,13,
137.3064 +        13,14,14,18,13,13,14,16,15, 9,10,10,13,14,10,11,
137.3065 +        10,14,13,10,11,11,13,14,13,14,13,16,15,13,13,14,
137.3066 +        15,16,12,13,12,16,14,11,11,13,15,15,13,14,13,16,
137.3067 +        15,15,12,16,12,17,14,15,15,17,17,12,13,13,14,16,
137.3068 +        11,13,11,16,15,12,13,14,15,16,14,15,13, 0,14,14,
137.3069 +        16,16, 0, 0, 9,10,10,13,13,10,11,10,14,14,10,11,
137.3070 +        11,13,13,12,13,13,14,16,13,14,14,16,16, 9,10,10,
137.3071 +        14,14,11,11,11,14,13,10,10,11,14,14,13,13,13,16,
137.3072 +        16,13,13,14,14,17, 9,10,10,13,14,10,11,11,13,15,
137.3073 +        10,11,10,14,14,13,13,13,14,17,13,14,13,17,14,12,
137.3074 +        13,13,16,14,13,14,13,16,15,12,12,13,15,16,15,15,
137.3075 +        16,18,16,15,13,15,14, 0,12,12,13,14,16,13,13,14,
137.3076 +        15,16,11,12,11,16,14,15,16,16,17,17,14,15,12,17,
137.3077 +        12,
137.3078 +};
137.3079 +
137.3080 +static const static_codebook _44u1__p4_0 = {
137.3081 +        4, 625,
137.3082 +        (long *)_vq_lengthlist__44u1__p4_0,
137.3083 +        1, -533725184, 1611661312, 3, 0,
137.3084 +        (long *)_vq_quantlist__44u1__p4_0,
137.3085 +        0
137.3086 +};
137.3087 +
137.3088 +static const long _vq_quantlist__44u1__p5_0[] = {
137.3089 +        4,
137.3090 +        3,
137.3091 +        5,
137.3092 +        2,
137.3093 +        6,
137.3094 +        1,
137.3095 +        7,
137.3096 +        0,
137.3097 +        8,
137.3098 +};
137.3099 +
137.3100 +static const long _vq_lengthlist__44u1__p5_0[] = {
137.3101 +         1, 4, 4, 7, 7, 7, 7, 9, 9, 4, 6, 6, 8, 8, 8, 8,
137.3102 +         9, 9, 4, 6, 6, 8, 8, 8, 8, 9, 9, 7, 8, 8, 9, 9,
137.3103 +         9, 9,11,10, 7, 8, 8, 9, 9, 9, 9,10,10, 7, 8, 8,
137.3104 +         9, 9,10,10,11,11, 7, 8, 8, 9, 9,10,10,11,11, 9,
137.3105 +         9, 9,10,10,11,11,12,12, 9, 9, 9,10,11,11,11,12,
137.3106 +        12,
137.3107 +};
137.3108 +
137.3109 +static const static_codebook _44u1__p5_0 = {
137.3110 +        2, 81,
137.3111 +        (long *)_vq_lengthlist__44u1__p5_0,
137.3112 +        1, -531628032, 1611661312, 4, 0,
137.3113 +        (long *)_vq_quantlist__44u1__p5_0,
137.3114 +        0
137.3115 +};
137.3116 +
137.3117 +static const long _vq_quantlist__44u1__p6_0[] = {
137.3118 +        6,
137.3119 +        5,
137.3120 +        7,
137.3121 +        4,
137.3122 +        8,
137.3123 +        3,
137.3124 +        9,
137.3125 +        2,
137.3126 +        10,
137.3127 +        1,
137.3128 +        11,
137.3129 +        0,
137.3130 +        12,
137.3131 +};
137.3132 +
137.3133 +static const long _vq_lengthlist__44u1__p6_0[] = {
137.3134 +         1, 4, 4, 6, 6, 8, 8,10, 9,11,10,14,13, 4, 6, 5,
137.3135 +         8, 8, 9, 9,11,10,11,11,14,14, 4, 5, 6, 8, 8, 9,
137.3136 +         9,10,10,11,11,14,14, 6, 8, 8, 9, 9,10,10,11,11,
137.3137 +        12,12,16,15, 7, 8, 8, 9, 9,10,10,11,11,12,12,15,
137.3138 +        15, 9,10,10,10,10,11,11,12,12,12,12,15,15, 9,10,
137.3139 +         9,10,11,11,11,12,12,12,13,15,15,10,10,11,11,11,
137.3140 +        12,12,13,12,13,13,16,15,10,11,11,11,11,12,12,13,
137.3141 +        12,13,13,16,17,11,11,12,12,12,13,13,13,14,14,15,
137.3142 +        17,17,11,11,12,12,12,13,13,13,14,14,14,16,18,14,
137.3143 +        15,15,15,15,16,16,16,16,17,18, 0, 0,14,15,15,15,
137.3144 +        15,17,16,17,18,17,17,18, 0,
137.3145 +};
137.3146 +
137.3147 +static const static_codebook _44u1__p6_0 = {
137.3148 +        2, 169,
137.3149 +        (long *)_vq_lengthlist__44u1__p6_0,
137.3150 +        1, -526516224, 1616117760, 4, 0,
137.3151 +        (long *)_vq_quantlist__44u1__p6_0,
137.3152 +        0
137.3153 +};
137.3154 +
137.3155 +static const long _vq_quantlist__44u1__p6_1[] = {
137.3156 +        2,
137.3157 +        1,
137.3158 +        3,
137.3159 +        0,
137.3160 +        4,
137.3161 +};
137.3162 +
137.3163 +static const long _vq_lengthlist__44u1__p6_1[] = {
137.3164 +         2, 4, 4, 5, 5, 4, 5, 5, 5, 5, 4, 5, 5, 5, 5, 5,
137.3165 +         6, 6, 6, 6, 5, 6, 6, 6, 6,
137.3166 +};
137.3167 +
137.3168 +static const static_codebook _44u1__p6_1 = {
137.3169 +        2, 25,
137.3170 +        (long *)_vq_lengthlist__44u1__p6_1,
137.3171 +        1, -533725184, 1611661312, 3, 0,
137.3172 +        (long *)_vq_quantlist__44u1__p6_1,
137.3173 +        0
137.3174 +};
137.3175 +
137.3176 +static const long _vq_quantlist__44u1__p7_0[] = {
137.3177 +        3,
137.3178 +        2,
137.3179 +        4,
137.3180 +        1,
137.3181 +        5,
137.3182 +        0,
137.3183 +        6,
137.3184 +};
137.3185 +
137.3186 +static const long _vq_lengthlist__44u1__p7_0[] = {
137.3187 +         1, 3, 2, 9, 9, 7, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
137.3188 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
137.3189 +         9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
137.3190 +         8,
137.3191 +};
137.3192 +
137.3193 +static const static_codebook _44u1__p7_0 = {
137.3194 +        2, 49,
137.3195 +        (long *)_vq_lengthlist__44u1__p7_0,
137.3196 +        1, -518017024, 1626677248, 3, 0,
137.3197 +        (long *)_vq_quantlist__44u1__p7_0,
137.3198 +        0
137.3199 +};
137.3200 +
137.3201 +static const long _vq_quantlist__44u1__p7_1[] = {
137.3202 +        6,
137.3203 +        5,
137.3204 +        7,
137.3205 +        4,
137.3206 +        8,
137.3207 +        3,
137.3208 +        9,
137.3209 +        2,
137.3210 +        10,
137.3211 +        1,
137.3212 +        11,
137.3213 +        0,
137.3214 +        12,
137.3215 +};
137.3216 +
137.3217 +static const long _vq_lengthlist__44u1__p7_1[] = {
137.3218 +         1, 4, 4, 6, 6, 6, 6, 7, 7, 8, 8, 9, 9, 5, 7, 7,
137.3219 +         8, 7, 7, 7, 9, 8,10, 9,10,11, 5, 7, 7, 8, 8, 7,
137.3220 +         7, 8, 9,10,10,11,11, 6, 8, 8, 9, 9, 9, 9,11,10,
137.3221 +        12,12,15,12, 6, 8, 8, 9, 9, 9, 9,11,11,12,11,14,
137.3222 +        12, 7, 8, 8,10,10,12,12,13,13,13,15,13,13, 7, 8,
137.3223 +         8,10,10,11,11,13,12,14,15,15,15, 9,10,10,11,12,
137.3224 +        13,13,14,15,14,15,14,15, 8,10,10,12,12,14,14,15,
137.3225 +        14,14,15,15,14,10,12,12,14,14,15,14,15,15,15,14,
137.3226 +        15,15,10,12,12,13,14,15,14,15,15,14,15,15,15,12,
137.3227 +        15,13,15,14,15,15,15,15,15,15,15,15,13,13,15,15,
137.3228 +        15,15,15,15,15,15,15,15,15,
137.3229 +};
137.3230 +
137.3231 +static const static_codebook _44u1__p7_1 = {
137.3232 +        2, 169,
137.3233 +        (long *)_vq_lengthlist__44u1__p7_1,
137.3234 +        1, -523010048, 1618608128, 4, 0,
137.3235 +        (long *)_vq_quantlist__44u1__p7_1,
137.3236 +        0
137.3237 +};
137.3238 +
137.3239 +static const long _vq_quantlist__44u1__p7_2[] = {
137.3240 +        6,
137.3241 +        5,
137.3242 +        7,
137.3243 +        4,
137.3244 +        8,
137.3245 +        3,
137.3246 +        9,
137.3247 +        2,
137.3248 +        10,
137.3249 +        1,
137.3250 +        11,
137.3251 +        0,
137.3252 +        12,
137.3253 +};
137.3254 +
137.3255 +static const long _vq_lengthlist__44u1__p7_2[] = {
137.3256 +         2, 5, 4, 6, 6, 7, 7, 8, 8, 8, 8, 9, 8, 5, 5, 6,
137.3257 +         7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 5, 6, 5, 7, 7, 8,
137.3258 +         8, 8, 8, 9, 9, 9, 9, 6, 7, 7, 8, 8, 8, 8, 9, 8,
137.3259 +         9, 9, 9, 9, 6, 7, 7, 8, 7, 8, 8, 9, 9, 9, 9, 9,
137.3260 +         9, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 7, 8,
137.3261 +         8, 9, 8, 9, 8, 9, 9, 9, 9, 9, 9, 8, 9, 8, 9, 9,
137.3262 +         9, 9, 9, 9, 9, 9,10,10, 8, 8, 9, 9, 9, 9, 9, 9,
137.3263 +         9, 9,10, 9,10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
137.3264 +         9, 9, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
137.3265 +         9, 9, 9, 9, 9, 9, 9, 9,10,10,10, 9, 9, 9, 9, 9,
137.3266 +         9, 9, 9,10, 9, 9,10,10, 9,
137.3267 +};
137.3268 +
137.3269 +static const static_codebook _44u1__p7_2 = {
137.3270 +        2, 169,
137.3271 +        (long *)_vq_lengthlist__44u1__p7_2,
137.3272 +        1, -531103744, 1611661312, 4, 0,
137.3273 +        (long *)_vq_quantlist__44u1__p7_2,
137.3274 +        0
137.3275 +};
137.3276 +
137.3277 +static const long _huff_lengthlist__44u1__short[] = {
137.3278 +        12,13,14,13,17,12,15,17, 5, 5, 6,10,10,11,15,16,
137.3279 +         4, 3, 3, 7, 5, 7,10,16, 7, 7, 7,10, 9,11,12,16,
137.3280 +         6, 5, 5, 9, 5, 6,10,16, 8, 7, 7, 9, 6, 7, 9,16,
137.3281 +        11, 7, 3, 6, 4, 5, 8,16,12, 9, 4, 8, 5, 7, 9,16,
137.3282 +};
137.3283 +
137.3284 +static const static_codebook _huff_book__44u1__short = {
137.3285 +        2, 64,
137.3286 +        (long *)_huff_lengthlist__44u1__short,
137.3287 +        0, 0, 0, 0, 0,
137.3288 +        NULL,
137.3289 +        0
137.3290 +};
137.3291 +
137.3292 +static const long _huff_lengthlist__44u2__long[] = {
137.3293 +         5, 9,14,12,15,13,10,13, 7, 4, 5, 6, 8, 7, 8,12,
137.3294 +        13, 4, 3, 5, 5, 6, 9,15,12, 6, 5, 6, 6, 6, 7,14,
137.3295 +        14, 7, 4, 6, 4, 6, 8,15,12, 6, 6, 5, 5, 5, 6,14,
137.3296 +         9, 7, 8, 6, 7, 5, 4,10,10,13,14,14,15,10, 6, 8,
137.3297 +};
137.3298 +
137.3299 +static const static_codebook _huff_book__44u2__long = {
137.3300 +        2, 64,
137.3301 +        (long *)_huff_lengthlist__44u2__long,
137.3302 +        0, 0, 0, 0, 0,
137.3303 +        NULL,
137.3304 +        0
137.3305 +};
137.3306 +
137.3307 +static const long _vq_quantlist__44u2__p1_0[] = {
137.3308 +        1,
137.3309 +        0,
137.3310 +        2,
137.3311 +};
137.3312 +
137.3313 +static const long _vq_lengthlist__44u2__p1_0[] = {
137.3314 +         1, 4, 4, 5, 8, 7, 5, 7, 8, 5, 8, 8, 8,11,11, 8,
137.3315 +        10,11, 5, 8, 8, 8,11,10, 8,11,11, 4, 8, 8, 8,11,
137.3316 +        11, 8,11,11, 8,11,11,11,13,14,11,13,13, 7,11,11,
137.3317 +        10,13,12,11,14,14, 4, 8, 8, 8,11,11, 8,11,11, 8,
137.3318 +        11,11,11,14,13,10,12,13, 8,11,11,11,13,13,11,13,
137.3319 +        13,
137.3320 +};
137.3321 +
137.3322 +static const static_codebook _44u2__p1_0 = {
137.3323 +        4, 81,
137.3324 +        (long *)_vq_lengthlist__44u2__p1_0,
137.3325 +        1, -535822336, 1611661312, 2, 0,
137.3326 +        (long *)_vq_quantlist__44u2__p1_0,
137.3327 +        0
137.3328 +};
137.3329 +
137.3330 +static const long _vq_quantlist__44u2__p2_0[] = {
137.3331 +        1,
137.3332 +        0,
137.3333 +        2,
137.3334 +};
137.3335 +
137.3336 +static const long _vq_lengthlist__44u2__p2_0[] = {
137.3337 +         2, 5, 5, 5, 6, 6, 5, 6, 6, 5, 6, 6, 7, 8, 8, 6,
137.3338 +         8, 8, 5, 6, 6, 6, 8, 7, 7, 8, 8, 5, 6, 6, 7, 8,
137.3339 +         8, 6, 8, 8, 6, 8, 8, 8, 9,10, 8,10,10, 6, 8, 8,
137.3340 +         7,10, 8, 8,10,10, 5, 6, 6, 6, 8, 8, 7, 8, 8, 6,
137.3341 +         8, 8, 8,10,10, 8, 8,10, 6, 8, 8, 8,10,10, 8,10,
137.3342 +         9,
137.3343 +};
137.3344 +
137.3345 +static const static_codebook _44u2__p2_0 = {
137.3346 +        4, 81,
137.3347 +        (long *)_vq_lengthlist__44u2__p2_0,
137.3348 +        1, -535822336, 1611661312, 2, 0,
137.3349 +        (long *)_vq_quantlist__44u2__p2_0,
137.3350 +        0
137.3351 +};
137.3352 +
137.3353 +static const long _vq_quantlist__44u2__p3_0[] = {
137.3354 +        2,
137.3355 +        1,
137.3356 +        3,
137.3357 +        0,
137.3358 +        4,
137.3359 +};
137.3360 +
137.3361 +static const long _vq_lengthlist__44u2__p3_0[] = {
137.3362 +         2, 4, 4, 7, 8, 5, 7, 7, 9, 9, 5, 7, 7, 9, 9, 8,
137.3363 +         9, 9,12,11, 8, 9, 9,11,12, 5, 7, 7,10,10, 7, 9,
137.3364 +         9,11,11, 7, 9, 9,10,11,10,11,11,13,13, 9,10,11,
137.3365 +        12,13, 5, 7, 7,10,10, 7, 9, 9,11,10, 7, 9, 9,11,
137.3366 +        11, 9,11,10,13,13,10,11,11,13,13, 8,10,10,14,13,
137.3367 +        10,11,11,15,14, 9,11,11,15,14,13,14,13,16,14,12,
137.3368 +        13,13,15,16, 8,10,10,13,14, 9,11,11,14,15,10,11,
137.3369 +        11,14,15,12,13,13,15,15,12,13,14,15,16, 5, 7, 7,
137.3370 +        10,10, 7, 9, 9,11,11, 7, 9, 9,11,12,10,11,11,14,
137.3371 +        13,10,11,11,14,14, 7, 9, 9,12,12, 9,11,11,13,13,
137.3372 +         9,11,11,13,13,12,13,12,14,14,11,12,13,15,15, 7,
137.3373 +         9, 9,12,12, 8,11,10,13,12, 9,11,11,13,13,11,13,
137.3374 +        12,15,13,11,13,13,15,16, 9,12,11,15,15,11,12,12,
137.3375 +        16,15,11,12,13,16,16,13,14,15,16,15,13,15,15,17,
137.3376 +        17, 9,11,11,14,15,10,12,12,15,15,11,13,12,15,16,
137.3377 +        13,15,14,16,16,13,15,15,17,19, 5, 7, 7,10,10, 7,
137.3378 +         9, 9,12,11, 7, 9, 9,11,11,10,11,11,14,14,10,11,
137.3379 +        11,13,14, 7, 9, 9,12,12, 9,11,11,13,13, 9,10,11,
137.3380 +        12,13,11,13,12,16,15,11,12,12,14,15, 7, 9, 9,12,
137.3381 +        12, 9,11,11,13,13, 9,11,11,13,12,11,13,12,15,16,
137.3382 +        12,13,13,15,14, 9,11,11,15,14,11,13,12,16,15,10,
137.3383 +        11,12,15,15,13,14,14,18,17,13,14,14,15,17,10,11,
137.3384 +        11,14,15,11,13,12,15,17,11,13,12,15,16,13,15,14,
137.3385 +        18,17,14,15,15,16,18, 7,10,10,14,14,10,12,12,15,
137.3386 +        15,10,12,12,15,15,14,15,15,18,17,13,15,15,16,16,
137.3387 +         9,11,11,16,15,11,13,13,16,18,11,13,13,16,16,15,
137.3388 +        16,16, 0, 0,14,15,16,18,17, 9,11,11,15,15,10,13,
137.3389 +        12,17,16,11,12,13,16,17,14,15,16,19,19,14,15,15,
137.3390 +         0,20,12,14,14, 0, 0,13,14,16,19,18,13,15,16,20,
137.3391 +        17,16,18, 0, 0, 0,15,16,17,18,19,11,14,14, 0,19,
137.3392 +        12,15,14,17,17,13,15,15, 0, 0,16,17,15,20,19,15,
137.3393 +        17,16,19, 0, 8,10,10,14,15,10,12,11,15,15,10,11,
137.3394 +        12,16,15,13,14,14,19,17,14,15,15, 0, 0, 9,11,11,
137.3395 +        16,15,11,13,13,17,16,10,12,13,16,17,14,15,15,18,
137.3396 +        18,14,15,16,20,19, 9,12,12, 0,15,11,13,13,16,17,
137.3397 +        11,13,13,19,17,14,16,16,18,17,15,16,16,17,19,11,
137.3398 +        14,14,18,18,13,14,15, 0, 0,12,14,15,19,18,15,16,
137.3399 +        19, 0,19,15,16,19,19,17,12,14,14,16,19,13,15,15,
137.3400 +         0,17,13,15,14,18,18,15,16,15, 0,18,16,17,17, 0,
137.3401 +         0,
137.3402 +};
137.3403 +
137.3404 +static const static_codebook _44u2__p3_0 = {
137.3405 +        4, 625,
137.3406 +        (long *)_vq_lengthlist__44u2__p3_0,
137.3407 +        1, -533725184, 1611661312, 3, 0,
137.3408 +        (long *)_vq_quantlist__44u2__p3_0,
137.3409 +        0
137.3410 +};
137.3411 +
137.3412 +static const long _vq_quantlist__44u2__p4_0[] = {
137.3413 +        2,
137.3414 +        1,
137.3415 +        3,
137.3416 +        0,
137.3417 +        4,
137.3418 +};
137.3419 +
137.3420 +static const long _vq_lengthlist__44u2__p4_0[] = {
137.3421 +         4, 5, 5, 8, 8, 5, 7, 6, 9, 9, 5, 6, 7, 9, 9, 9,
137.3422 +         9, 9,11,11, 9, 9, 9,11,11, 5, 7, 7, 9, 9, 7, 8,
137.3423 +         8,10,10, 7, 7, 8,10,10,10,10,10,11,12, 9,10,10,
137.3424 +        11,12, 5, 7, 7, 9, 9, 6, 8, 7,10,10, 7, 8, 8,10,
137.3425 +        10, 9,10,10,12,11, 9,10,10,12,11, 9,10,10,12,12,
137.3426 +        10,10,10,13,12, 9,10,10,12,13,12,12,12,14,14,11,
137.3427 +        12,12,13,14, 9,10,10,12,12, 9,10,10,12,13,10,10,
137.3428 +        10,12,13,11,12,12,14,13,12,12,12,14,13, 5, 7, 7,
137.3429 +        10, 9, 7, 8, 8,10,10, 7, 8, 8,10,10,10,10,10,12,
137.3430 +        12,10,10,10,12,12, 7, 8, 8,11,10, 8, 8, 9,11,11,
137.3431 +         8, 9, 9,11,11,10,11,11,12,13,10,11,11,13,13, 6,
137.3432 +         8, 8,10,10, 7, 9, 8,11,10, 8, 9, 9,11,11,10,11,
137.3433 +        10,13,11,10,11,11,13,13, 9,10,10,13,13,10,11,11,
137.3434 +        13,13,10,11,11,14,13,12,11,13,12,15,12,13,13,15,
137.3435 +        15, 9,10,10,12,13,10,11,10,13,13,10,11,11,13,13,
137.3436 +        12,13,11,15,13,12,13,13,15,15, 5, 7, 7, 9,10, 7,
137.3437 +         8, 8,10,10, 7, 8, 8,10,10,10,10,10,12,12,10,10,
137.3438 +        11,12,12, 6, 8, 8,10,10, 8, 9, 9,11,11, 7, 8, 9,
137.3439 +        10,11,10,11,11,13,13,10,10,11,11,13, 7, 8, 8,10,
137.3440 +        11, 8, 9, 9,11,11, 8, 9, 8,11,11,10,11,11,13,13,
137.3441 +        10,11,11,13,12, 9,10,10,13,12,10,11,11,14,13,10,
137.3442 +        10,11,13,13,12,13,13,15,15,12,11,13,12,14, 9,10,
137.3443 +        10,12,13,10,11,11,13,14,10,11,11,13,13,12,13,13,
137.3444 +        15,15,12,13,12,15,12, 8, 9, 9,12,12, 9,11,10,13,
137.3445 +        13, 9,10,10,13,13,12,13,13,15,15,12,12,12,14,14,
137.3446 +         9,10,10,13,13,10,11,11,13,14,10,11,11,14,12,13,
137.3447 +        13,14,14,16,12,13,13,15,14, 9,10,10,13,13,10,11,
137.3448 +        10,14,13,10,11,11,13,14,12,14,13,16,14,13,13,13,
137.3449 +        14,15,11,13,12,15,14,11,12,13,14,15,12,13,13,16,
137.3450 +        15,14,12,15,12,16,14,15,15,17,16,11,12,12,14,15,
137.3451 +        11,13,11,15,14,12,13,13,15,16,13,15,12,17,13,14,
137.3452 +        15,15,16,16, 8, 9, 9,12,12, 9,10,10,13,13, 9,10,
137.3453 +        10,13,13,12,13,12,14,14,12,13,13,15,15, 9,10,10,
137.3454 +        13,13,10,11,11,14,13,10,10,11,13,14,12,13,13,15,
137.3455 +        14,12,12,14,14,16, 9,10,10,13,13,10,11,11,13,14,
137.3456 +        10,11,11,14,13,13,13,13,15,15,13,14,13,16,14,11,
137.3457 +        12,12,14,14,12,13,13,16,15,11,12,13,14,15,14,15,
137.3458 +        15,16,16,14,13,15,13,17,11,12,12,14,15,12,13,13,
137.3459 +        15,16,11,13,12,15,15,14,15,14,16,16,14,15,12,17,
137.3460 +        13,
137.3461 +};
137.3462 +
137.3463 +static const static_codebook _44u2__p4_0 = {
137.3464 +        4, 625,
137.3465 +        (long *)_vq_lengthlist__44u2__p4_0,
137.3466 +        1, -533725184, 1611661312, 3, 0,
137.3467 +        (long *)_vq_quantlist__44u2__p4_0,
137.3468 +        0
137.3469 +};
137.3470 +
137.3471 +static const long _vq_quantlist__44u2__p5_0[] = {
137.3472 +        4,
137.3473 +        3,
137.3474 +        5,
137.3475 +        2,
137.3476 +        6,
137.3477 +        1,
137.3478 +        7,
137.3479 +        0,
137.3480 +        8,
137.3481 +};
137.3482 +
137.3483 +static const long _vq_lengthlist__44u2__p5_0[] = {
137.3484 +         1, 4, 4, 7, 7, 8, 8, 9, 9, 4, 6, 5, 8, 8, 8, 8,
137.3485 +        10,10, 4, 5, 6, 8, 8, 8, 8,10,10, 7, 8, 8, 9, 9,
137.3486 +         9, 9,11,11, 7, 8, 8, 9, 9, 9, 9,11,11, 8, 8, 8,
137.3487 +         9, 9,10,11,12,12, 8, 8, 8, 9, 9,10,10,12,12,10,
137.3488 +        10,10,11,11,12,12,13,13,10,10,10,11,11,12,12,13,
137.3489 +        13,
137.3490 +};
137.3491 +
137.3492 +static const static_codebook _44u2__p5_0 = {
137.3493 +        2, 81,
137.3494 +        (long *)_vq_lengthlist__44u2__p5_0,
137.3495 +        1, -531628032, 1611661312, 4, 0,
137.3496 +        (long *)_vq_quantlist__44u2__p5_0,
137.3497 +        0
137.3498 +};
137.3499 +
137.3500 +static const long _vq_quantlist__44u2__p6_0[] = {
137.3501 +        6,
137.3502 +        5,
137.3503 +        7,
137.3504 +        4,
137.3505 +        8,
137.3506 +        3,
137.3507 +        9,
137.3508 +        2,
137.3509 +        10,
137.3510 +        1,
137.3511 +        11,
137.3512 +        0,
137.3513 +        12,
137.3514 +};
137.3515 +
137.3516 +static const long _vq_lengthlist__44u2__p6_0[] = {
137.3517 +         1, 4, 4, 6, 6, 8, 8,10,10,11,11,14,13, 4, 6, 5,
137.3518 +         8, 8, 9, 9,11,10,12,11,15,14, 4, 5, 6, 8, 8, 9,
137.3519 +         9,11,11,11,11,14,14, 6, 8, 8,10, 9,11,11,11,11,
137.3520 +        12,12,15,15, 6, 8, 8, 9, 9,11,11,11,12,12,12,15,
137.3521 +        15, 8,10,10,11,11,11,11,12,12,13,13,15,16, 8,10,
137.3522 +        10,11,11,11,11,12,12,13,13,16,16,10,11,11,12,12,
137.3523 +        12,12,13,13,13,13,17,16,10,11,11,12,12,12,12,13,
137.3524 +        13,13,14,16,17,11,12,12,13,13,13,13,14,14,15,14,
137.3525 +        18,17,11,12,12,13,13,13,13,14,14,14,15,19,18,14,
137.3526 +        15,15,15,15,16,16,18,19,18,18, 0, 0,14,15,15,16,
137.3527 +        15,17,17,16,18,17,18, 0, 0,
137.3528 +};
137.3529 +
137.3530 +static const static_codebook _44u2__p6_0 = {
137.3531 +        2, 169,
137.3532 +        (long *)_vq_lengthlist__44u2__p6_0,
137.3533 +        1, -526516224, 1616117760, 4, 0,
137.3534 +        (long *)_vq_quantlist__44u2__p6_0,
137.3535 +        0
137.3536 +};
137.3537 +
137.3538 +static const long _vq_quantlist__44u2__p6_1[] = {
137.3539 +        2,
137.3540 +        1,
137.3541 +        3,
137.3542 +        0,
137.3543 +        4,
137.3544 +};
137.3545 +
137.3546 +static const long _vq_lengthlist__44u2__p6_1[] = {
137.3547 +         2, 4, 4, 5, 5, 4, 5, 5, 6, 5, 4, 5, 5, 5, 6, 5,
137.3548 +         6, 5, 6, 6, 5, 5, 6, 6, 6,
137.3549 +};
137.3550 +
137.3551 +static const static_codebook _44u2__p6_1 = {
137.3552 +        2, 25,
137.3553 +        (long *)_vq_lengthlist__44u2__p6_1,
137.3554 +        1, -533725184, 1611661312, 3, 0,
137.3555 +        (long *)_vq_quantlist__44u2__p6_1,
137.3556 +        0
137.3557 +};
137.3558 +
137.3559 +static const long _vq_quantlist__44u2__p7_0[] = {
137.3560 +        4,
137.3561 +        3,
137.3562 +        5,
137.3563 +        2,
137.3564 +        6,
137.3565 +        1,
137.3566 +        7,
137.3567 +        0,
137.3568 +        8,
137.3569 +};
137.3570 +
137.3571 +static const long _vq_lengthlist__44u2__p7_0[] = {
137.3572 +         1, 3, 2,12,12,12,12,12,12, 4,12,12,12,12,12,12,
137.3573 +        12,12, 5,12,12,12,12,12,12,12,12,12,12,11,11,11,
137.3574 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.3575 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.3576 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.3577 +        11,
137.3578 +};
137.3579 +
137.3580 +static const static_codebook _44u2__p7_0 = {
137.3581 +        2, 81,
137.3582 +        (long *)_vq_lengthlist__44u2__p7_0,
137.3583 +        1, -516612096, 1626677248, 4, 0,
137.3584 +        (long *)_vq_quantlist__44u2__p7_0,
137.3585 +        0
137.3586 +};
137.3587 +
137.3588 +static const long _vq_quantlist__44u2__p7_1[] = {
137.3589 +        6,
137.3590 +        5,
137.3591 +        7,
137.3592 +        4,
137.3593 +        8,
137.3594 +        3,
137.3595 +        9,
137.3596 +        2,
137.3597 +        10,
137.3598 +        1,
137.3599 +        11,
137.3600 +        0,
137.3601 +        12,
137.3602 +};
137.3603 +
137.3604 +static const long _vq_lengthlist__44u2__p7_1[] = {
137.3605 +         1, 4, 4, 7, 6, 7, 6, 8, 7, 9, 7, 9, 8, 4, 7, 6,
137.3606 +         8, 8, 9, 8,10, 9,10,10,11,11, 4, 7, 7, 8, 8, 8,
137.3607 +         8, 9,10,11,11,11,11, 6, 8, 8,10,10,10,10,11,11,
137.3608 +        12,12,12,12, 7, 8, 8,10,10,10,10,11,11,12,12,13,
137.3609 +        13, 7, 9, 9,11,10,12,12,13,13,14,13,14,14, 7, 9,
137.3610 +         9,10,11,11,12,13,13,13,13,16,14, 9,10,10,12,12,
137.3611 +        13,13,14,14,15,16,15,16, 9,10,10,12,12,12,13,14,
137.3612 +        14,14,15,16,15,10,12,12,13,13,15,13,16,16,15,17,
137.3613 +        17,17,10,11,11,12,14,14,14,15,15,17,17,15,17,11,
137.3614 +        12,12,14,14,14,15,15,15,17,16,17,17,10,12,12,13,
137.3615 +        14,14,14,17,15,17,17,17,17,
137.3616 +};
137.3617 +
137.3618 +static const static_codebook _44u2__p7_1 = {
137.3619 +        2, 169,
137.3620 +        (long *)_vq_lengthlist__44u2__p7_1,
137.3621 +        1, -523010048, 1618608128, 4, 0,
137.3622 +        (long *)_vq_quantlist__44u2__p7_1,
137.3623 +        0
137.3624 +};
137.3625 +
137.3626 +static const long _vq_quantlist__44u2__p7_2[] = {
137.3627 +        6,
137.3628 +        5,
137.3629 +        7,
137.3630 +        4,
137.3631 +        8,
137.3632 +        3,
137.3633 +        9,
137.3634 +        2,
137.3635 +        10,
137.3636 +        1,
137.3637 +        11,
137.3638 +        0,
137.3639 +        12,
137.3640 +};
137.3641 +
137.3642 +static const long _vq_lengthlist__44u2__p7_2[] = {
137.3643 +         2, 5, 5, 6, 6, 7, 7, 8, 7, 8, 8, 8, 8, 5, 6, 6,
137.3644 +         7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 5, 6, 6, 7, 7, 8,
137.3645 +         7, 8, 8, 8, 8, 8, 8, 6, 7, 7, 7, 8, 8, 8, 8, 8,
137.3646 +         9, 9, 9, 9, 6, 7, 7, 8, 7, 8, 8, 9, 9, 9, 9, 9,
137.3647 +         9, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 7, 8,
137.3648 +         8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 9,
137.3649 +         9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 9, 9, 9, 9, 9,
137.3650 +         9, 9, 9, 9, 9, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9,
137.3651 +         9, 9, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8,
137.3652 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 9, 9, 9,
137.3653 +         9, 9, 9, 9, 9, 9, 9, 9, 9,
137.3654 +};
137.3655 +
137.3656 +static const static_codebook _44u2__p7_2 = {
137.3657 +        2, 169,
137.3658 +        (long *)_vq_lengthlist__44u2__p7_2,
137.3659 +        1, -531103744, 1611661312, 4, 0,
137.3660 +        (long *)_vq_quantlist__44u2__p7_2,
137.3661 +        0
137.3662 +};
137.3663 +
137.3664 +static const long _huff_lengthlist__44u2__short[] = {
137.3665 +        13,15,17,17,15,15,12,17,11, 9, 7,10,10, 9,12,17,
137.3666 +        10, 6, 3, 6, 5, 7,10,17,15,10, 6, 9, 8, 9,11,17,
137.3667 +        15, 8, 4, 7, 3, 5, 9,16,16,10, 5, 8, 4, 5, 8,16,
137.3668 +        13,11, 5, 8, 3, 3, 5,14,13,12, 7,10, 5, 5, 7,14,
137.3669 +};
137.3670 +
137.3671 +static const static_codebook _huff_book__44u2__short = {
137.3672 +        2, 64,
137.3673 +        (long *)_huff_lengthlist__44u2__short,
137.3674 +        0, 0, 0, 0, 0,
137.3675 +        NULL,
137.3676 +        0
137.3677 +};
137.3678 +
137.3679 +static const long _huff_lengthlist__44u3__long[] = {
137.3680 +         6, 9,13,12,14,11,10,13, 8, 4, 5, 7, 8, 7, 8,12,
137.3681 +        11, 4, 3, 5, 5, 7, 9,14,11, 6, 5, 6, 6, 6, 7,13,
137.3682 +        13, 7, 5, 6, 4, 5, 7,14,11, 7, 6, 6, 5, 5, 6,13,
137.3683 +         9, 7, 8, 6, 7, 5, 3, 9, 9,12,13,12,14,10, 6, 7,
137.3684 +};
137.3685 +
137.3686 +static const static_codebook _huff_book__44u3__long = {
137.3687 +        2, 64,
137.3688 +        (long *)_huff_lengthlist__44u3__long,
137.3689 +        0, 0, 0, 0, 0,
137.3690 +        NULL,
137.3691 +        0
137.3692 +};
137.3693 +
137.3694 +static const long _vq_quantlist__44u3__p1_0[] = {
137.3695 +        1,
137.3696 +        0,
137.3697 +        2,
137.3698 +};
137.3699 +
137.3700 +static const long _vq_lengthlist__44u3__p1_0[] = {
137.3701 +         1, 4, 4, 5, 8, 7, 5, 7, 8, 5, 8, 8, 8,10,11, 8,
137.3702 +        10,11, 5, 8, 8, 8,11,10, 8,11,11, 4, 8, 8, 8,11,
137.3703 +        11, 8,11,11, 8,11,11,11,13,14,11,14,14, 8,11,11,
137.3704 +        10,14,12,11,14,14, 4, 8, 8, 8,11,11, 8,11,11, 7,
137.3705 +        11,11,11,14,14,10,12,14, 8,11,11,11,14,14,11,14,
137.3706 +        13,
137.3707 +};
137.3708 +
137.3709 +static const static_codebook _44u3__p1_0 = {
137.3710 +        4, 81,
137.3711 +        (long *)_vq_lengthlist__44u3__p1_0,
137.3712 +        1, -535822336, 1611661312, 2, 0,
137.3713 +        (long *)_vq_quantlist__44u3__p1_0,
137.3714 +        0
137.3715 +};
137.3716 +
137.3717 +static const long _vq_quantlist__44u3__p2_0[] = {
137.3718 +        1,
137.3719 +        0,
137.3720 +        2,
137.3721 +};
137.3722 +
137.3723 +static const long _vq_lengthlist__44u3__p2_0[] = {
137.3724 +         2, 5, 4, 5, 6, 6, 5, 6, 6, 5, 6, 6, 7, 8, 8, 6,
137.3725 +         8, 8, 5, 6, 6, 6, 8, 8, 7, 8, 8, 5, 7, 6, 7, 8,
137.3726 +         8, 6, 8, 8, 7, 8, 8, 8, 9,10, 8,10,10, 6, 8, 8,
137.3727 +         8,10, 8, 8,10,10, 5, 6, 6, 6, 8, 8, 7, 8, 8, 6,
137.3728 +         8, 8, 8,10,10, 8, 8,10, 7, 8, 8, 8,10,10, 8,10,
137.3729 +         9,
137.3730 +};
137.3731 +
137.3732 +static const static_codebook _44u3__p2_0 = {
137.3733 +        4, 81,
137.3734 +        (long *)_vq_lengthlist__44u3__p2_0,
137.3735 +        1, -535822336, 1611661312, 2, 0,
137.3736 +        (long *)_vq_quantlist__44u3__p2_0,
137.3737 +        0
137.3738 +};
137.3739 +
137.3740 +static const long _vq_quantlist__44u3__p3_0[] = {
137.3741 +        2,
137.3742 +        1,
137.3743 +        3,
137.3744 +        0,
137.3745 +        4,
137.3746 +};
137.3747 +
137.3748 +static const long _vq_lengthlist__44u3__p3_0[] = {
137.3749 +         2, 4, 4, 7, 7, 5, 7, 7, 9, 9, 5, 7, 7, 9, 9, 8,
137.3750 +         9, 9,12,12, 8, 9, 9,11,12, 5, 7, 7,10,10, 7, 9,
137.3751 +         9,11,11, 7, 9, 9,10,11,10,11,11,13,13, 9,10,11,
137.3752 +        13,13, 5, 7, 7,10,10, 7, 9, 9,11,10, 7, 9, 9,11,
137.3753 +        11, 9,11,10,13,13,10,11,11,14,13, 8,10,10,14,13,
137.3754 +        10,11,11,15,14, 9,11,11,14,14,13,14,13,16,16,12,
137.3755 +        13,13,15,15, 8,10,10,13,14, 9,11,11,14,14,10,11,
137.3756 +        11,14,15,12,13,13,15,15,13,14,14,15,16, 5, 7, 7,
137.3757 +        10,10, 7, 9, 9,11,11, 7, 9, 9,11,12,10,11,11,14,
137.3758 +        14,10,11,11,14,14, 7, 9, 9,12,12, 9,11,11,13,13,
137.3759 +         9,11,11,13,13,12,12,13,15,15,11,12,13,15,16, 7,
137.3760 +         9, 9,11,11, 8,11,10,13,12, 9,11,11,13,13,11,13,
137.3761 +        12,15,13,11,13,13,15,16, 9,12,11,15,14,11,12,13,
137.3762 +        16,15,11,13,13,15,16,14,14,15,17,16,13,15,16, 0,
137.3763 +        17, 9,11,11,15,15,10,13,12,15,15,11,13,13,15,16,
137.3764 +        13,15,13,16,15,14,16,15, 0,19, 5, 7, 7,10,10, 7,
137.3765 +         9, 9,11,11, 7, 9, 9,11,11,10,12,11,14,14,10,11,
137.3766 +        12,14,14, 7, 9, 9,12,12, 9,11,11,14,13, 9,10,11,
137.3767 +        12,13,11,13,13,16,16,11,12,13,13,16, 7, 9, 9,12,
137.3768 +        12, 9,11,11,13,13, 9,11,11,13,13,11,13,13,15,15,
137.3769 +        12,13,12,15,14, 9,11,11,15,14,11,13,12,16,16,10,
137.3770 +        12,12,15,15,13,15,15,17,19,13,14,15,16,17,10,12,
137.3771 +        12,15,15,11,13,13,16,16,11,13,13,15,16,13,15,15,
137.3772 +         0, 0,14,15,15,16,16, 8,10,10,14,14,10,12,12,15,
137.3773 +        15,10,12,11,15,16,14,15,15,19,20,13,14,14,18,16,
137.3774 +         9,11,11,15,15,11,13,13,17,16,11,13,13,16,16,15,
137.3775 +        17,17,20,20,14,15,16,17,20, 9,11,11,15,15,10,13,
137.3776 +        12,16,15,11,13,13,15,17,14,16,15,18, 0,14,16,15,
137.3777 +        18,20,12,14,14, 0, 0,14,14,16, 0, 0,13,16,15, 0,
137.3778 +         0,17,17,18, 0, 0,16,17,19,19, 0,12,14,14,18, 0,
137.3779 +        12,16,14, 0,17,13,15,15,18, 0,16,18,17, 0,17,16,
137.3780 +        18,17, 0, 0, 7,10,10,14,14,10,12,11,15,15,10,12,
137.3781 +        12,16,15,13,15,15,18, 0,14,15,15,17, 0, 9,11,11,
137.3782 +        15,15,11,13,13,16,16,11,12,13,16,16,14,15,16,17,
137.3783 +        17,14,16,16,16,18, 9,11,12,16,16,11,13,13,17,17,
137.3784 +        11,14,13,20,17,15,16,16,19, 0,15,16,17, 0,19,11,
137.3785 +        13,14,17,16,14,15,15,20,18,13,14,15,17,19,16,18,
137.3786 +        18, 0,20,16,16,19,17, 0,12,15,14,17, 0,14,15,15,
137.3787 +        18,19,13,16,15,19,20,15,18,18, 0,20,17, 0,16, 0,
137.3788 +         0,
137.3789 +};
137.3790 +
137.3791 +static const static_codebook _44u3__p3_0 = {
137.3792 +        4, 625,
137.3793 +        (long *)_vq_lengthlist__44u3__p3_0,
137.3794 +        1, -533725184, 1611661312, 3, 0,
137.3795 +        (long *)_vq_quantlist__44u3__p3_0,
137.3796 +        0
137.3797 +};
137.3798 +
137.3799 +static const long _vq_quantlist__44u3__p4_0[] = {
137.3800 +        2,
137.3801 +        1,
137.3802 +        3,
137.3803 +        0,
137.3804 +        4,
137.3805 +};
137.3806 +
137.3807 +static const long _vq_lengthlist__44u3__p4_0[] = {
137.3808 +         4, 5, 5, 8, 8, 5, 7, 6, 9, 9, 5, 6, 7, 9, 9, 9,
137.3809 +         9, 9,11,11, 9, 9, 9,11,11, 5, 7, 7, 9, 9, 7, 8,
137.3810 +         8,10,10, 7, 7, 8,10,10, 9,10,10,11,12, 9,10,10,
137.3811 +        11,12, 5, 7, 7, 9, 9, 7, 8, 7,10,10, 7, 8, 8,10,
137.3812 +        10, 9,10, 9,12,11, 9,10,10,12,11, 9,10, 9,12,12,
137.3813 +         9,10,10,13,12, 9,10,10,12,13,12,12,12,14,14,11,
137.3814 +        12,12,13,14, 9, 9,10,12,12, 9,10,10,12,12, 9,10,
137.3815 +        10,12,13,11,12,11,14,13,12,12,12,14,13, 5, 7, 7,
137.3816 +         9, 9, 7, 8, 8,10,10, 7, 8, 8,10,10,10,10,10,12,
137.3817 +        12, 9,10,10,12,12, 7, 8, 8,11,10, 8, 8, 9,11,11,
137.3818 +         8, 9, 9,11,11,11,11,11,12,13,10,11,11,13,13, 6,
137.3819 +         8, 8,10,10, 7, 9, 8,11,10, 8, 9, 9,11,11,10,11,
137.3820 +        10,13,11,10,11,11,13,13, 9,11,10,13,12,10,11,11,
137.3821 +        13,13,10,11,11,13,13,12,12,13,12,15,12,13,13,15,
137.3822 +        15, 9,10,10,12,13,10,11,10,13,12,10,11,11,13,14,
137.3823 +        12,13,11,15,13,12,13,13,15,15, 5, 7, 7, 9, 9, 7,
137.3824 +         8, 8,10,10, 7, 8, 8,10,10, 9,10,10,12,12,10,10,
137.3825 +        11,12,12, 6, 8, 8,10,10, 8, 9, 9,11,11, 7, 8, 9,
137.3826 +        10,11,10,11,11,13,13,10,10,11,11,13, 7, 8, 8,10,
137.3827 +        10, 8, 9, 9,11,11, 8, 9, 9,11,11,10,11,11,13,13,
137.3828 +        11,11,11,13,12, 9,10,10,13,12,10,11,11,14,13,10,
137.3829 +        10,11,12,13,12,13,13,15,15,12,11,13,13,14, 9,10,
137.3830 +        11,12,13,10,11,11,13,13,10,11,11,13,13,12,13,13,
137.3831 +        15,15,12,13,12,15,12, 8, 9, 9,12,12, 9,11,10,13,
137.3832 +        13, 9,10,10,13,13,12,13,13,15,14,12,12,12,14,13,
137.3833 +         9,10,10,13,12,10,11,11,13,13,10,11,11,14,12,13,
137.3834 +        13,14,14,16,12,13,13,15,15, 9,10,10,13,13,10,11,
137.3835 +        10,14,13,10,11,11,13,14,12,14,13,15,14,13,13,13,
137.3836 +        15,15,11,13,12,15,14,11,12,13,14,15,12,13,13,16,
137.3837 +        14,14,12,15,12,16,14,15,15,17,15,11,12,12,14,14,
137.3838 +        11,13,11,15,14,12,13,13,15,15,13,15,12,17,13,14,
137.3839 +        15,15,16,16, 8, 9, 9,12,12, 9,10,10,12,13, 9,10,
137.3840 +        10,13,13,12,12,12,14,14,12,13,13,15,15, 9,10,10,
137.3841 +        13,12,10,11,11,14,13,10,10,11,13,14,12,13,13,15,
137.3842 +        15,12,12,13,14,16, 9,10,10,13,13,10,11,11,13,14,
137.3843 +        10,11,11,14,13,12,13,13,14,15,13,14,13,16,14,11,
137.3844 +        12,12,14,14,12,13,13,15,14,11,12,13,14,15,14,15,
137.3845 +        15,16,16,13,13,15,13,16,11,12,12,14,15,12,13,13,
137.3846 +        14,15,11,13,12,15,14,14,15,15,16,16,14,15,12,16,
137.3847 +        13,
137.3848 +};
137.3849 +
137.3850 +static const static_codebook _44u3__p4_0 = {
137.3851 +        4, 625,
137.3852 +        (long *)_vq_lengthlist__44u3__p4_0,
137.3853 +        1, -533725184, 1611661312, 3, 0,
137.3854 +        (long *)_vq_quantlist__44u3__p4_0,
137.3855 +        0
137.3856 +};
137.3857 +
137.3858 +static const long _vq_quantlist__44u3__p5_0[] = {
137.3859 +        4,
137.3860 +        3,
137.3861 +        5,
137.3862 +        2,
137.3863 +        6,
137.3864 +        1,
137.3865 +        7,
137.3866 +        0,
137.3867 +        8,
137.3868 +};
137.3869 +
137.3870 +static const long _vq_lengthlist__44u3__p5_0[] = {
137.3871 +         2, 3, 3, 6, 6, 7, 7, 9, 9, 4, 5, 5, 7, 7, 8, 8,
137.3872 +        10,10, 4, 5, 5, 7, 7, 8, 8,10,10, 6, 7, 7, 8, 8,
137.3873 +         9, 9,11,10, 6, 7, 7, 8, 8, 9, 9,10,10, 7, 8, 8,
137.3874 +         9, 9,10,10,11,11, 7, 8, 8, 9, 9,10,10,11,11, 9,
137.3875 +        10,10,11,10,11,11,12,12, 9,10,10,10,10,11,11,12,
137.3876 +        12,
137.3877 +};
137.3878 +
137.3879 +static const static_codebook _44u3__p5_0 = {
137.3880 +        2, 81,
137.3881 +        (long *)_vq_lengthlist__44u3__p5_0,
137.3882 +        1, -531628032, 1611661312, 4, 0,
137.3883 +        (long *)_vq_quantlist__44u3__p5_0,
137.3884 +        0
137.3885 +};
137.3886 +
137.3887 +static const long _vq_quantlist__44u3__p6_0[] = {
137.3888 +        6,
137.3889 +        5,
137.3890 +        7,
137.3891 +        4,
137.3892 +        8,
137.3893 +        3,
137.3894 +        9,
137.3895 +        2,
137.3896 +        10,
137.3897 +        1,
137.3898 +        11,
137.3899 +        0,
137.3900 +        12,
137.3901 +};
137.3902 +
137.3903 +static const long _vq_lengthlist__44u3__p6_0[] = {
137.3904 +         1, 4, 4, 6, 6, 8, 8, 9, 9,10,11,13,14, 4, 6, 5,
137.3905 +         8, 8, 9, 9,10,10,11,11,14,14, 4, 6, 6, 8, 8, 9,
137.3906 +         9,10,10,11,11,14,14, 6, 8, 8, 9, 9,10,10,11,11,
137.3907 +        12,12,15,15, 6, 8, 8, 9, 9,10,11,11,11,12,12,15,
137.3908 +        15, 8, 9, 9,11,10,11,11,12,12,13,13,15,16, 8, 9,
137.3909 +         9,10,11,11,11,12,12,13,13,16,16,10,10,11,11,11,
137.3910 +        12,12,13,13,13,14,17,16, 9,10,11,12,11,12,12,13,
137.3911 +        13,13,13,16,18,11,12,11,12,12,13,13,13,14,15,14,
137.3912 +        17,17,11,11,12,12,12,13,13,13,14,14,15,18,17,14,
137.3913 +        15,15,15,15,16,16,17,17,19,18, 0,20,14,15,14,15,
137.3914 +        15,16,16,16,17,18,16,20,18,
137.3915 +};
137.3916 +
137.3917 +static const static_codebook _44u3__p6_0 = {
137.3918 +        2, 169,
137.3919 +        (long *)_vq_lengthlist__44u3__p6_0,
137.3920 +        1, -526516224, 1616117760, 4, 0,
137.3921 +        (long *)_vq_quantlist__44u3__p6_0,
137.3922 +        0
137.3923 +};
137.3924 +
137.3925 +static const long _vq_quantlist__44u3__p6_1[] = {
137.3926 +        2,
137.3927 +        1,
137.3928 +        3,
137.3929 +        0,
137.3930 +        4,
137.3931 +};
137.3932 +
137.3933 +static const long _vq_lengthlist__44u3__p6_1[] = {
137.3934 +         2, 4, 4, 5, 5, 4, 5, 5, 6, 5, 4, 5, 5, 5, 6, 5,
137.3935 +         6, 5, 6, 6, 5, 5, 6, 6, 6,
137.3936 +};
137.3937 +
137.3938 +static const static_codebook _44u3__p6_1 = {
137.3939 +        2, 25,
137.3940 +        (long *)_vq_lengthlist__44u3__p6_1,
137.3941 +        1, -533725184, 1611661312, 3, 0,
137.3942 +        (long *)_vq_quantlist__44u3__p6_1,
137.3943 +        0
137.3944 +};
137.3945 +
137.3946 +static const long _vq_quantlist__44u3__p7_0[] = {
137.3947 +        4,
137.3948 +        3,
137.3949 +        5,
137.3950 +        2,
137.3951 +        6,
137.3952 +        1,
137.3953 +        7,
137.3954 +        0,
137.3955 +        8,
137.3956 +};
137.3957 +
137.3958 +static const long _vq_lengthlist__44u3__p7_0[] = {
137.3959 +         1, 3, 3,10,10,10,10,10,10, 4,10,10,10,10,10,10,
137.3960 +        10,10, 4,10,10,10,10,10,10,10,10,10,10, 9, 9, 9,
137.3961 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
137.3962 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
137.3963 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
137.3964 +         9,
137.3965 +};
137.3966 +
137.3967 +static const static_codebook _44u3__p7_0 = {
137.3968 +        2, 81,
137.3969 +        (long *)_vq_lengthlist__44u3__p7_0,
137.3970 +        1, -515907584, 1627381760, 4, 0,
137.3971 +        (long *)_vq_quantlist__44u3__p7_0,
137.3972 +        0
137.3973 +};
137.3974 +
137.3975 +static const long _vq_quantlist__44u3__p7_1[] = {
137.3976 +        7,
137.3977 +        6,
137.3978 +        8,
137.3979 +        5,
137.3980 +        9,
137.3981 +        4,
137.3982 +        10,
137.3983 +        3,
137.3984 +        11,
137.3985 +        2,
137.3986 +        12,
137.3987 +        1,
137.3988 +        13,
137.3989 +        0,
137.3990 +        14,
137.3991 +};
137.3992 +
137.3993 +static const long _vq_lengthlist__44u3__p7_1[] = {
137.3994 +         1, 4, 4, 6, 6, 7, 6, 8, 7, 9, 8,10, 9,11,11, 4,
137.3995 +         7, 7, 8, 7, 9, 9,10,10,11,11,11,11,12,12, 4, 7,
137.3996 +         7, 7, 7, 9, 9,10,10,11,11,12,12,12,11, 6, 8, 8,
137.3997 +         9, 9,10,10,11,11,12,12,13,12,13,13, 6, 8, 8, 9,
137.3998 +         9,10,11,11,11,12,12,13,14,13,13, 8, 9, 9,11,11,
137.3999 +        12,12,12,13,14,13,14,14,14,15, 8, 9, 9,11,11,11,
137.4000 +        12,13,14,13,14,15,17,14,15, 9,10,10,12,12,13,13,
137.4001 +        13,14,15,15,15,16,16,16, 9,11,11,12,12,13,13,14,
137.4002 +        14,14,15,16,16,16,16,10,12,12,13,13,14,14,15,15,
137.4003 +        15,16,17,17,17,17,10,12,11,13,13,15,14,15,14,16,
137.4004 +        17,16,16,16,16,11,13,12,14,14,14,14,15,16,17,16,
137.4005 +        17,17,17,17,11,13,12,14,14,14,15,17,16,17,17,17,
137.4006 +        17,17,17,12,13,13,15,16,15,16,17,17,16,16,17,17,
137.4007 +        17,17,12,13,13,15,15,15,16,17,17,17,16,17,16,17,
137.4008 +        17,
137.4009 +};
137.4010 +
137.4011 +static const static_codebook _44u3__p7_1 = {
137.4012 +        2, 225,
137.4013 +        (long *)_vq_lengthlist__44u3__p7_1,
137.4014 +        1, -522338304, 1620115456, 4, 0,
137.4015 +        (long *)_vq_quantlist__44u3__p7_1,
137.4016 +        0
137.4017 +};
137.4018 +
137.4019 +static const long _vq_quantlist__44u3__p7_2[] = {
137.4020 +        8,
137.4021 +        7,
137.4022 +        9,
137.4023 +        6,
137.4024 +        10,
137.4025 +        5,
137.4026 +        11,
137.4027 +        4,
137.4028 +        12,
137.4029 +        3,
137.4030 +        13,
137.4031 +        2,
137.4032 +        14,
137.4033 +        1,
137.4034 +        15,
137.4035 +        0,
137.4036 +        16,
137.4037 +};
137.4038 +
137.4039 +static const long _vq_lengthlist__44u3__p7_2[] = {
137.4040 +         2, 5, 5, 7, 6, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9,
137.4041 +         9, 5, 6, 6, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9,
137.4042 +        10,10, 5, 6, 6, 7, 7, 8, 8, 8, 8, 9, 8, 9, 9, 9,
137.4043 +         9,10, 9, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9,
137.4044 +        10,10,10,10, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9,10,
137.4045 +         9,10,10,10,10, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9,
137.4046 +        10,10,10,10,10,10, 7, 8, 8, 9, 8, 9, 9, 9, 9,10,
137.4047 +         9,10,10,10,10,10,10, 8, 8, 8, 9, 9, 9, 9, 9, 9,
137.4048 +         9,10,10,10,10,10,10,10, 8, 9, 8, 9, 9, 9, 9,10,
137.4049 +         9,10,10,10,10,10,10,10,10, 9, 9, 9, 9, 9, 9,10,
137.4050 +         9,10,10,10,10,10,10,10,10,10, 9, 9, 9, 9, 9,10,
137.4051 +         9,10,10,10,10,10,10,10,10,10,10, 9, 9, 9,10, 9,
137.4052 +        10,10,10,10,10,10,10,10,10,10,10,10, 9, 9, 9,10,
137.4053 +        10,10,10,10,10,10,10,10,10,10,10,10,10, 9, 9, 9,
137.4054 +        10,10,10,10,10,10,10,10,10,10,10,10,10,11, 9,10,
137.4055 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,11, 9,
137.4056 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
137.4057 +         9,10,10,10,10,10,10,10,10,10,10,10,11,11,11,10,
137.4058 +        11,
137.4059 +};
137.4060 +
137.4061 +static const static_codebook _44u3__p7_2 = {
137.4062 +        2, 289,
137.4063 +        (long *)_vq_lengthlist__44u3__p7_2,
137.4064 +        1, -529530880, 1611661312, 5, 0,
137.4065 +        (long *)_vq_quantlist__44u3__p7_2,
137.4066 +        0
137.4067 +};
137.4068 +
137.4069 +static const long _huff_lengthlist__44u3__short[] = {
137.4070 +        14,14,14,15,13,15,12,16,10, 8, 7, 9, 9, 8,12,16,
137.4071 +        10, 5, 4, 6, 5, 6, 9,16,14, 8, 6, 8, 7, 8,10,16,
137.4072 +        14, 7, 4, 6, 3, 5, 8,16,15, 9, 5, 7, 4, 4, 7,16,
137.4073 +        13,10, 6, 7, 4, 3, 4,13,13,12, 7, 9, 5, 5, 6,12,
137.4074 +};
137.4075 +
137.4076 +static const static_codebook _huff_book__44u3__short = {
137.4077 +        2, 64,
137.4078 +        (long *)_huff_lengthlist__44u3__short,
137.4079 +        0, 0, 0, 0, 0,
137.4080 +        NULL,
137.4081 +        0
137.4082 +};
137.4083 +
137.4084 +static const long _huff_lengthlist__44u4__long[] = {
137.4085 +         3, 8,12,12,13,12,11,13, 5, 4, 6, 7, 8, 8, 9,13,
137.4086 +         9, 5, 4, 5, 5, 7, 9,13, 9, 6, 5, 6, 6, 7, 8,12,
137.4087 +        12, 7, 5, 6, 4, 5, 8,13,11, 7, 6, 6, 5, 5, 6,12,
137.4088 +        10, 8, 8, 7, 7, 5, 3, 8,10,12,13,12,12, 9, 6, 7,
137.4089 +};
137.4090 +
137.4091 +static const static_codebook _huff_book__44u4__long = {
137.4092 +        2, 64,
137.4093 +        (long *)_huff_lengthlist__44u4__long,
137.4094 +        0, 0, 0, 0, 0,
137.4095 +        NULL,
137.4096 +        0
137.4097 +};
137.4098 +
137.4099 +static const long _vq_quantlist__44u4__p1_0[] = {
137.4100 +        1,
137.4101 +        0,
137.4102 +        2,
137.4103 +};
137.4104 +
137.4105 +static const long _vq_lengthlist__44u4__p1_0[] = {
137.4106 +         1, 4, 4, 5, 8, 7, 5, 7, 8, 5, 8, 8, 8,10,11, 8,
137.4107 +        10,11, 5, 8, 8, 8,11,10, 8,11,11, 4, 8, 8, 8,11,
137.4108 +        11, 8,11,11, 8,11,11,11,13,14,11,15,14, 8,11,11,
137.4109 +        10,13,12,11,14,14, 4, 8, 8, 8,11,11, 8,11,11, 7,
137.4110 +        11,11,11,15,14,10,12,14, 8,11,11,11,14,14,11,14,
137.4111 +        13,
137.4112 +};
137.4113 +
137.4114 +static const static_codebook _44u4__p1_0 = {
137.4115 +        4, 81,
137.4116 +        (long *)_vq_lengthlist__44u4__p1_0,
137.4117 +        1, -535822336, 1611661312, 2, 0,
137.4118 +        (long *)_vq_quantlist__44u4__p1_0,
137.4119 +        0
137.4120 +};
137.4121 +
137.4122 +static const long _vq_quantlist__44u4__p2_0[] = {
137.4123 +        1,
137.4124 +        0,
137.4125 +        2,
137.4126 +};
137.4127 +
137.4128 +static const long _vq_lengthlist__44u4__p2_0[] = {
137.4129 +         2, 5, 5, 5, 6, 6, 5, 6, 6, 5, 6, 6, 7, 8, 8, 6,
137.4130 +         8, 8, 5, 6, 6, 6, 8, 8, 7, 8, 8, 5, 7, 6, 6, 8,
137.4131 +         8, 6, 8, 8, 6, 8, 8, 8, 9,10, 8,10,10, 6, 8, 8,
137.4132 +         8,10, 8, 8,10,10, 5, 6, 6, 6, 8, 8, 6, 8, 8, 6,
137.4133 +         8, 8, 8,10,10, 8, 8,10, 6, 8, 8, 8,10,10, 8,10,
137.4134 +         9,
137.4135 +};
137.4136 +
137.4137 +static const static_codebook _44u4__p2_0 = {
137.4138 +        4, 81,
137.4139 +        (long *)_vq_lengthlist__44u4__p2_0,
137.4140 +        1, -535822336, 1611661312, 2, 0,
137.4141 +        (long *)_vq_quantlist__44u4__p2_0,
137.4142 +        0
137.4143 +};
137.4144 +
137.4145 +static const long _vq_quantlist__44u4__p3_0[] = {
137.4146 +        2,
137.4147 +        1,
137.4148 +        3,
137.4149 +        0,
137.4150 +        4,
137.4151 +};
137.4152 +
137.4153 +static const long _vq_lengthlist__44u4__p3_0[] = {
137.4154 +         2, 4, 4, 8, 8, 5, 7, 7, 9, 9, 5, 7, 7, 9, 9, 8,
137.4155 +        10, 9,12,12, 8, 9,10,12,12, 5, 7, 7,10,10, 7, 9,
137.4156 +         9,11,11, 7, 9, 9,11,11,10,12,11,14,14, 9,10,11,
137.4157 +        13,14, 5, 7, 7,10,10, 7, 9, 9,11,11, 7, 9, 9,11,
137.4158 +        11, 9,11,10,14,13,10,11,11,14,14, 8,10,10,14,13,
137.4159 +        10,12,12,15,14, 9,11,11,15,14,13,14,14,17,17,12,
137.4160 +        14,14,16,16, 8,10,10,14,14, 9,11,11,14,15,10,12,
137.4161 +        12,14,15,12,14,13,16,16,13,14,15,15,18, 4, 7, 7,
137.4162 +        10,10, 7, 9, 9,12,11, 7, 9, 9,11,12,10,12,11,15,
137.4163 +        14,10,11,12,14,15, 7, 9, 9,12,12, 9,11,12,13,13,
137.4164 +         9,11,12,13,13,12,13,13,15,16,11,13,13,15,16, 7,
137.4165 +         9, 9,12,12, 9,11,10,13,12, 9,11,12,13,14,11,13,
137.4166 +        12,16,14,12,13,13,15,16,10,12,12,16,15,11,13,13,
137.4167 +        17,16,11,13,13,17,16,14,15,15,17,17,14,16,16,18,
137.4168 +        20, 9,11,11,15,16,11,13,12,16,16,11,13,13,16,17,
137.4169 +        14,15,14,18,16,14,16,16,17,20, 5, 7, 7,10,10, 7,
137.4170 +         9, 9,12,11, 7, 9,10,11,12,10,12,11,15,15,10,12,
137.4171 +        12,14,14, 7, 9, 9,12,12, 9,12,11,14,13, 9,10,11,
137.4172 +        12,13,12,13,14,16,16,11,12,13,14,16, 7, 9, 9,12,
137.4173 +        12, 9,12,11,13,13, 9,12,11,13,13,11,13,13,16,16,
137.4174 +        12,13,13,16,15, 9,11,11,16,14,11,13,13,16,16,11,
137.4175 +        12,13,16,16,14,16,16,17,17,13,14,15,16,17,10,12,
137.4176 +        12,15,15,11,13,13,16,17,11,13,13,16,16,14,16,15,
137.4177 +        19,19,14,15,15,17,18, 8,10,10,14,14,10,12,12,15,
137.4178 +        15,10,12,12,16,16,14,16,15,20,19,13,15,15,17,16,
137.4179 +         9,12,12,16,16,11,13,13,16,18,11,14,13,16,17,16,
137.4180 +        17,16,20, 0,15,16,18,18,20, 9,11,11,15,15,11,14,
137.4181 +        12,17,16,11,13,13,17,17,15,17,15,20,20,14,16,16,
137.4182 +        17, 0,13,15,14,18,16,14,15,16, 0,18,14,16,16, 0,
137.4183 +         0,18,16, 0, 0,20,16,18,18, 0, 0,12,14,14,17,18,
137.4184 +        13,15,14,20,18,14,16,15,19,19,16,20,16, 0,18,16,
137.4185 +        19,17,19, 0, 8,10,10,14,14,10,12,12,16,15,10,12,
137.4186 +        12,16,16,13,15,15,18,17,14,16,16,19, 0, 9,11,11,
137.4187 +        16,15,11,14,13,18,17,11,12,13,17,18,14,17,16,18,
137.4188 +        18,15,16,17,18,18, 9,12,12,16,16,11,13,13,16,18,
137.4189 +        11,14,13,17,17,15,16,16,18,20,16,17,17,20,20,12,
137.4190 +        14,14,18,17,14,16,16, 0,19,13,14,15,18, 0,16, 0,
137.4191 +         0, 0, 0,16,16, 0,19,20,13,15,14, 0, 0,14,16,16,
137.4192 +        18,19,14,16,15, 0,20,16,20,18, 0,20,17,20,17, 0,
137.4193 +         0,
137.4194 +};
137.4195 +
137.4196 +static const static_codebook _44u4__p3_0 = {
137.4197 +        4, 625,
137.4198 +        (long *)_vq_lengthlist__44u4__p3_0,
137.4199 +        1, -533725184, 1611661312, 3, 0,
137.4200 +        (long *)_vq_quantlist__44u4__p3_0,
137.4201 +        0
137.4202 +};
137.4203 +
137.4204 +static const long _vq_quantlist__44u4__p4_0[] = {
137.4205 +        2,
137.4206 +        1,
137.4207 +        3,
137.4208 +        0,
137.4209 +        4,
137.4210 +};
137.4211 +
137.4212 +static const long _vq_lengthlist__44u4__p4_0[] = {
137.4213 +         4, 5, 5, 8, 8, 5, 7, 6, 9, 9, 5, 6, 7, 9, 9, 9,
137.4214 +         9, 9,11,11, 8, 9, 9,11,11, 5, 7, 7, 9, 9, 7, 8,
137.4215 +         8,10,10, 7, 7, 8,10,10, 9,10,10,11,12, 9,10,10,
137.4216 +        11,12, 5, 7, 7, 9, 9, 7, 8, 7,10,10, 7, 8, 8,10,
137.4217 +        10, 9,10,10,12,11, 9,10,10,12,11, 9,10, 9,12,12,
137.4218 +         9,10,10,13,12, 9,10,10,12,12,12,12,12,14,14,11,
137.4219 +        12,12,13,14, 9, 9,10,12,12, 9,10,10,13,13, 9,10,
137.4220 +        10,12,13,11,12,12,14,13,11,12,12,14,14, 5, 7, 7,
137.4221 +         9, 9, 7, 8, 8,10,10, 7, 8, 8,10,10,10,10,10,12,
137.4222 +        12, 9,10,10,12,12, 7, 8, 8,11,10, 8, 8, 9,11,11,
137.4223 +         8, 9, 9,11,11,11,11,11,12,13,10,11,11,13,13, 6,
137.4224 +         8, 8,10,10, 7, 9, 8,11,10, 8, 9, 9,11,11,10,11,
137.4225 +        10,13,11,10,11,11,13,13, 9,11,10,13,12,10,11,11,
137.4226 +        13,14,10,11,11,14,13,12,12,13,12,15,12,13,13,15,
137.4227 +        15, 9,10,10,12,13,10,11,10,13,12,10,11,11,13,14,
137.4228 +        12,13,11,15,13,13,13,13,15,15, 5, 7, 7, 9, 9, 7,
137.4229 +         8, 8,10,10, 7, 8, 8,10,10, 9,10,10,12,12,10,10,
137.4230 +        11,12,13, 6, 8, 8,10,10, 8, 9, 9,11,11, 7, 8, 9,
137.4231 +        10,11,10,11,11,13,13,10,10,11,11,13, 7, 8, 8,10,
137.4232 +        11, 8, 9, 9,11,11, 8, 9, 8,11,11,10,11,11,13,13,
137.4233 +        11,12,11,13,12, 9,10,10,13,12,10,11,11,14,13,10,
137.4234 +        10,11,12,13,12,13,13,15,15,12,11,13,13,14, 9,10,
137.4235 +        11,12,13,10,11,11,13,14,10,11,11,13,13,12,13,13,
137.4236 +        15,15,12,13,12,15,12, 8, 9, 9,12,12, 9,11,10,13,
137.4237 +        13, 9,10,10,13,13,12,13,13,15,15,12,12,12,14,14,
137.4238 +         9,10,10,13,13,10,11,11,13,14,10,11,11,14,13,13,
137.4239 +        13,14,14,16,13,13,13,15,15, 9,10,10,13,13,10,11,
137.4240 +        10,14,13,10,11,11,13,14,12,14,13,16,14,12,13,13,
137.4241 +        14,15,11,12,12,15,14,11,12,13,14,15,12,13,13,16,
137.4242 +        15,14,12,15,12,16,14,15,15,16,16,11,12,12,14,14,
137.4243 +        11,13,12,15,14,12,13,13,15,16,13,15,13,17,13,14,
137.4244 +        15,15,16,17, 8, 9, 9,12,12, 9,10,10,12,13, 9,10,
137.4245 +        10,13,13,12,12,12,14,14,12,13,13,15,15, 9,10,10,
137.4246 +        13,12,10,11,11,14,13,10,10,11,13,14,13,13,13,15,
137.4247 +        15,12,13,14,14,16, 9,10,10,13,13,10,11,11,13,14,
137.4248 +        10,11,11,14,14,13,13,13,15,15,13,14,13,16,14,11,
137.4249 +        12,12,15,14,12,13,13,16,15,11,12,13,14,15,14,15,
137.4250 +        15,17,16,13,13,15,13,16,11,12,13,14,15,13,13,13,
137.4251 +        15,16,11,13,12,15,14,14,15,15,16,16,14,15,12,17,
137.4252 +        13,
137.4253 +};
137.4254 +
137.4255 +static const static_codebook _44u4__p4_0 = {
137.4256 +        4, 625,
137.4257 +        (long *)_vq_lengthlist__44u4__p4_0,
137.4258 +        1, -533725184, 1611661312, 3, 0,
137.4259 +        (long *)_vq_quantlist__44u4__p4_0,
137.4260 +        0
137.4261 +};
137.4262 +
137.4263 +static const long _vq_quantlist__44u4__p5_0[] = {
137.4264 +        4,
137.4265 +        3,
137.4266 +        5,
137.4267 +        2,
137.4268 +        6,
137.4269 +        1,
137.4270 +        7,
137.4271 +        0,
137.4272 +        8,
137.4273 +};
137.4274 +
137.4275 +static const long _vq_lengthlist__44u4__p5_0[] = {
137.4276 +         2, 3, 3, 6, 6, 7, 7, 9, 9, 4, 5, 5, 7, 7, 8, 8,
137.4277 +        10, 9, 4, 5, 5, 7, 7, 8, 8,10,10, 6, 7, 7, 8, 8,
137.4278 +         9, 9,11,10, 6, 7, 7, 8, 8, 9, 9,10,11, 7, 8, 8,
137.4279 +         9, 9,10,10,11,11, 7, 8, 8, 9, 9,10,10,11,11, 9,
137.4280 +        10,10,11,10,11,11,12,12, 9,10,10,10,11,11,11,12,
137.4281 +        12,
137.4282 +};
137.4283 +
137.4284 +static const static_codebook _44u4__p5_0 = {
137.4285 +        2, 81,
137.4286 +        (long *)_vq_lengthlist__44u4__p5_0,
137.4287 +        1, -531628032, 1611661312, 4, 0,
137.4288 +        (long *)_vq_quantlist__44u4__p5_0,
137.4289 +        0
137.4290 +};
137.4291 +
137.4292 +static const long _vq_quantlist__44u4__p6_0[] = {
137.4293 +        6,
137.4294 +        5,
137.4295 +        7,
137.4296 +        4,
137.4297 +        8,
137.4298 +        3,
137.4299 +        9,
137.4300 +        2,
137.4301 +        10,
137.4302 +        1,
137.4303 +        11,
137.4304 +        0,
137.4305 +        12,
137.4306 +};
137.4307 +
137.4308 +static const long _vq_lengthlist__44u4__p6_0[] = {
137.4309 +         1, 4, 4, 6, 6, 8, 8, 9, 9,11,10,13,13, 4, 6, 5,
137.4310 +         8, 8, 9, 9,10,10,11,11,14,14, 4, 6, 6, 8, 8, 9,
137.4311 +         9,10,10,11,11,14,14, 6, 8, 8, 9, 9,10,10,11,11,
137.4312 +        12,12,15,15, 6, 8, 8, 9, 9,10,11,11,11,12,12,15,
137.4313 +        15, 8, 9, 9,11,10,11,11,12,12,13,13,16,16, 8, 9,
137.4314 +         9,10,10,11,11,12,12,13,13,16,16,10,10,10,12,11,
137.4315 +        12,12,13,13,14,14,16,16,10,10,10,11,12,12,12,13,
137.4316 +        13,13,14,16,17,11,12,11,12,12,13,13,14,14,15,14,
137.4317 +        18,17,11,11,12,12,12,13,13,14,14,14,15,19,18,14,
137.4318 +        15,14,15,15,17,16,17,17,17,17,21, 0,14,15,15,16,
137.4319 +        16,16,16,17,17,18,17,20,21,
137.4320 +};
137.4321 +
137.4322 +static const static_codebook _44u4__p6_0 = {
137.4323 +        2, 169,
137.4324 +        (long *)_vq_lengthlist__44u4__p6_0,
137.4325 +        1, -526516224, 1616117760, 4, 0,
137.4326 +        (long *)_vq_quantlist__44u4__p6_0,
137.4327 +        0
137.4328 +};
137.4329 +
137.4330 +static const long _vq_quantlist__44u4__p6_1[] = {
137.4331 +        2,
137.4332 +        1,
137.4333 +        3,
137.4334 +        0,
137.4335 +        4,
137.4336 +};
137.4337 +
137.4338 +static const long _vq_lengthlist__44u4__p6_1[] = {
137.4339 +         2, 4, 4, 5, 5, 4, 5, 5, 6, 5, 4, 5, 5, 5, 6, 5,
137.4340 +         6, 5, 6, 6, 5, 5, 6, 6, 6,
137.4341 +};
137.4342 +
137.4343 +static const static_codebook _44u4__p6_1 = {
137.4344 +        2, 25,
137.4345 +        (long *)_vq_lengthlist__44u4__p6_1,
137.4346 +        1, -533725184, 1611661312, 3, 0,
137.4347 +        (long *)_vq_quantlist__44u4__p6_1,
137.4348 +        0
137.4349 +};
137.4350 +
137.4351 +static const long _vq_quantlist__44u4__p7_0[] = {
137.4352 +        6,
137.4353 +        5,
137.4354 +        7,
137.4355 +        4,
137.4356 +        8,
137.4357 +        3,
137.4358 +        9,
137.4359 +        2,
137.4360 +        10,
137.4361 +        1,
137.4362 +        11,
137.4363 +        0,
137.4364 +        12,
137.4365 +};
137.4366 +
137.4367 +static const long _vq_lengthlist__44u4__p7_0[] = {
137.4368 +         1, 3, 3,12,12,12,12,12,12,12,12,12,12, 3,12,11,
137.4369 +        12,12,12,12,12,12,12,12,12,12, 4,11,10,12,12,12,
137.4370 +        12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
137.4371 +        12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
137.4372 +        12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
137.4373 +        12,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.4374 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.4375 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.4376 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.4377 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.4378 +        11,11,11,11,11,11,11,11,11,
137.4379 +};
137.4380 +
137.4381 +static const static_codebook _44u4__p7_0 = {
137.4382 +        2, 169,
137.4383 +        (long *)_vq_lengthlist__44u4__p7_0,
137.4384 +        1, -514332672, 1627381760, 4, 0,
137.4385 +        (long *)_vq_quantlist__44u4__p7_0,
137.4386 +        0
137.4387 +};
137.4388 +
137.4389 +static const long _vq_quantlist__44u4__p7_1[] = {
137.4390 +        7,
137.4391 +        6,
137.4392 +        8,
137.4393 +        5,
137.4394 +        9,
137.4395 +        4,
137.4396 +        10,
137.4397 +        3,
137.4398 +        11,
137.4399 +        2,
137.4400 +        12,
137.4401 +        1,
137.4402 +        13,
137.4403 +        0,
137.4404 +        14,
137.4405 +};
137.4406 +
137.4407 +static const long _vq_lengthlist__44u4__p7_1[] = {
137.4408 +         1, 4, 4, 6, 6, 7, 7, 9, 8,10, 8,10, 9,11,11, 4,
137.4409 +         7, 6, 8, 7, 9, 9,10,10,11,10,11,10,12,10, 4, 6,
137.4410 +         7, 8, 8, 9, 9,10,10,11,11,11,11,12,12, 6, 8, 8,
137.4411 +        10, 9,11,10,12,11,12,12,12,12,13,13, 6, 8, 8,10,
137.4412 +        10,10,11,11,11,12,12,13,12,13,13, 8, 9, 9,11,11,
137.4413 +        12,11,12,12,13,13,13,13,13,13, 8, 9, 9,11,11,11,
137.4414 +        12,12,12,13,13,13,13,13,13, 9,10,10,12,11,13,13,
137.4415 +        13,13,14,13,13,14,14,14, 9,10,11,11,12,12,13,13,
137.4416 +        13,13,13,14,15,14,14,10,11,11,12,12,13,13,14,14,
137.4417 +        14,14,14,15,16,16,10,11,11,12,13,13,13,13,15,14,
137.4418 +        14,15,16,15,16,10,12,12,13,13,14,14,14,15,15,15,
137.4419 +        15,15,15,16,11,12,12,13,13,14,14,14,15,15,15,16,
137.4420 +        15,17,16,11,12,12,13,13,13,15,15,14,16,16,16,16,
137.4421 +        16,17,11,12,12,13,13,14,14,15,14,15,15,17,17,16,
137.4422 +        16,
137.4423 +};
137.4424 +
137.4425 +static const static_codebook _44u4__p7_1 = {
137.4426 +        2, 225,
137.4427 +        (long *)_vq_lengthlist__44u4__p7_1,
137.4428 +        1, -522338304, 1620115456, 4, 0,
137.4429 +        (long *)_vq_quantlist__44u4__p7_1,
137.4430 +        0
137.4431 +};
137.4432 +
137.4433 +static const long _vq_quantlist__44u4__p7_2[] = {
137.4434 +        8,
137.4435 +        7,
137.4436 +        9,
137.4437 +        6,
137.4438 +        10,
137.4439 +        5,
137.4440 +        11,
137.4441 +        4,
137.4442 +        12,
137.4443 +        3,
137.4444 +        13,
137.4445 +        2,
137.4446 +        14,
137.4447 +        1,
137.4448 +        15,
137.4449 +        0,
137.4450 +        16,
137.4451 +};
137.4452 +
137.4453 +static const long _vq_lengthlist__44u4__p7_2[] = {
137.4454 +         2, 5, 5, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9,
137.4455 +         9, 5, 6, 6, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9,
137.4456 +         9, 9, 5, 6, 6, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9,
137.4457 +         9, 9, 9, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9,
137.4458 +        10,10,10,10, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9,10,
137.4459 +         9,10, 9,10,10, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9,
137.4460 +        10,10,10,10,10,10, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9,
137.4461 +         9,10,10,10,10,10,10, 8, 9, 8, 9, 9, 9, 9, 9, 9,
137.4462 +        10,10,10,10,10,10,10,10, 8, 8, 8, 9, 9, 9, 9, 9,
137.4463 +        10,10,10,10,10,10,10,10,10, 9, 9, 9, 9, 9,10,10,
137.4464 +        10,10,10,10,10,10,10,10,10,10, 9, 9, 9, 9, 9,10,
137.4465 +        10,10,10,10,10,10,10,10,10,10,10, 9, 9, 9, 9,10,
137.4466 +        10,10,10,10,10,10,10,10,10,10,10,10, 9, 9, 9, 9,
137.4467 +        10,10,10,10,10,10,10,10,10,11,10,10,10, 9, 9, 9,
137.4468 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10, 9, 9,
137.4469 +         9,10,10,10,10,10,10,10,10,10,10,10,10,10,10, 9,
137.4470 +        10, 9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
137.4471 +         9,10, 9,10,10,10,10,10,10,10,10,10,10,11,10,10,
137.4472 +        10,
137.4473 +};
137.4474 +
137.4475 +static const static_codebook _44u4__p7_2 = {
137.4476 +        2, 289,
137.4477 +        (long *)_vq_lengthlist__44u4__p7_2,
137.4478 +        1, -529530880, 1611661312, 5, 0,
137.4479 +        (long *)_vq_quantlist__44u4__p7_2,
137.4480 +        0
137.4481 +};
137.4482 +
137.4483 +static const long _huff_lengthlist__44u4__short[] = {
137.4484 +        14,17,15,17,16,14,13,16,10, 7, 7,10,13,10,15,16,
137.4485 +         9, 4, 4, 6, 5, 7, 9,16,12, 8, 7, 8, 8, 8,11,16,
137.4486 +        14, 7, 4, 6, 3, 5, 8,15,13, 8, 5, 7, 4, 5, 7,16,
137.4487 +        12, 9, 6, 8, 3, 3, 5,16,14,13, 7,10, 5, 5, 7,15,
137.4488 +};
137.4489 +
137.4490 +static const static_codebook _huff_book__44u4__short = {
137.4491 +        2, 64,
137.4492 +        (long *)_huff_lengthlist__44u4__short,
137.4493 +        0, 0, 0, 0, 0,
137.4494 +        NULL,
137.4495 +        0
137.4496 +};
137.4497 +
137.4498 +static const long _huff_lengthlist__44u5__long[] = {
137.4499 +         3, 8,13,12,14,12,16,11,13,14, 5, 4, 5, 6, 7, 8,
137.4500 +        10, 9,12,15,10, 5, 5, 5, 6, 8, 9, 9,13,15,10, 5,
137.4501 +         5, 6, 6, 7, 8, 8,11,13,12, 7, 5, 6, 4, 6, 7, 7,
137.4502 +        11,14,11, 7, 7, 6, 6, 6, 7, 6,10,14,14, 9, 8, 8,
137.4503 +         6, 7, 7, 7,11,16,11, 8, 8, 7, 6, 6, 7, 4, 7,12,
137.4504 +        10,10,12,10,10, 9,10, 5, 6, 9,10,12,15,13,14,14,
137.4505 +        14, 8, 7, 8,
137.4506 +};
137.4507 +
137.4508 +static const static_codebook _huff_book__44u5__long = {
137.4509 +        2, 100,
137.4510 +        (long *)_huff_lengthlist__44u5__long,
137.4511 +        0, 0, 0, 0, 0,
137.4512 +        NULL,
137.4513 +        0
137.4514 +};
137.4515 +
137.4516 +static const long _vq_quantlist__44u5__p1_0[] = {
137.4517 +        1,
137.4518 +        0,
137.4519 +        2,
137.4520 +};
137.4521 +
137.4522 +static const long _vq_lengthlist__44u5__p1_0[] = {
137.4523 +         1, 4, 4, 5, 8, 7, 5, 7, 7, 5, 8, 8, 8,10,10, 7,
137.4524 +         9,10, 5, 8, 8, 7,10, 9, 8,10,10, 5, 8, 8, 8,10,
137.4525 +        10, 8,10,10, 8,10,10,10,12,13,10,13,13, 7,10,10,
137.4526 +        10,13,11,10,13,13, 4, 8, 8, 8,11,10, 8,10,10, 7,
137.4527 +        10,10,10,13,13,10,11,13, 8,10,11,10,13,13,10,13,
137.4528 +        12,
137.4529 +};
137.4530 +
137.4531 +static const static_codebook _44u5__p1_0 = {
137.4532 +        4, 81,
137.4533 +        (long *)_vq_lengthlist__44u5__p1_0,
137.4534 +        1, -535822336, 1611661312, 2, 0,
137.4535 +        (long *)_vq_quantlist__44u5__p1_0,
137.4536 +        0
137.4537 +};
137.4538 +
137.4539 +static const long _vq_quantlist__44u5__p2_0[] = {
137.4540 +        1,
137.4541 +        0,
137.4542 +        2,
137.4543 +};
137.4544 +
137.4545 +static const long _vq_lengthlist__44u5__p2_0[] = {
137.4546 +         3, 4, 4, 5, 6, 6, 5, 6, 6, 5, 6, 6, 6, 8, 8, 6,
137.4547 +         7, 8, 5, 6, 6, 6, 8, 7, 6, 8, 8, 5, 6, 6, 6, 8,
137.4548 +         8, 6, 8, 8, 6, 8, 8, 8, 9, 9, 8, 9, 9, 6, 8, 7,
137.4549 +         7, 9, 8, 8, 9, 9, 5, 6, 6, 6, 8, 7, 6, 8, 8, 6,
137.4550 +         8, 7, 8, 9, 9, 7, 8, 9, 6, 8, 8, 8, 9, 9, 8, 9,
137.4551 +         9,
137.4552 +};
137.4553 +
137.4554 +static const static_codebook _44u5__p2_0 = {
137.4555 +        4, 81,
137.4556 +        (long *)_vq_lengthlist__44u5__p2_0,
137.4557 +        1, -535822336, 1611661312, 2, 0,
137.4558 +        (long *)_vq_quantlist__44u5__p2_0,
137.4559 +        0
137.4560 +};
137.4561 +
137.4562 +static const long _vq_quantlist__44u5__p3_0[] = {
137.4563 +        2,
137.4564 +        1,
137.4565 +        3,
137.4566 +        0,
137.4567 +        4,
137.4568 +};
137.4569 +
137.4570 +static const long _vq_lengthlist__44u5__p3_0[] = {
137.4571 +         2, 4, 5, 8, 8, 5, 7, 6, 9, 9, 5, 6, 7, 9, 9, 8,
137.4572 +        10, 9,13,12, 8, 9,10,12,12, 5, 7, 7,10,10, 7, 9,
137.4573 +         9,11,11, 6, 8, 9,11,11,10,11,11,14,14, 9,10,11,
137.4574 +        13,14, 5, 7, 7, 9,10, 7, 9, 8,11,11, 7, 9, 9,11,
137.4575 +        11, 9,11,10,14,13,10,11,11,14,14, 8,10,10,13,13,
137.4576 +        10,11,11,15,14, 9,11,11,14,14,13,14,14,17,16,12,
137.4577 +        13,13,15,16, 8,10,10,13,13, 9,11,11,14,15,10,11,
137.4578 +        11,14,15,12,14,13,16,16,13,15,14,15,17, 5, 7, 7,
137.4579 +        10,10, 7, 9, 9,11,11, 7, 9, 9,11,11,10,11,11,14,
137.4580 +        14,10,11,12,14,14, 7, 9, 9,12,11, 9,11,11,13,13,
137.4581 +         9,11,11,13,13,12,13,13,15,16,11,12,13,15,16, 6,
137.4582 +         9, 9,11,11, 8,11,10,13,12, 9,11,11,13,14,11,13,
137.4583 +        12,16,14,11,13,13,16,17,10,12,11,15,15,11,13,13,
137.4584 +        16,16,11,13,13,17,16,14,15,15,17,17,14,16,16,17,
137.4585 +        18, 9,11,11,14,15,10,12,12,15,15,11,13,13,16,17,
137.4586 +        13,15,13,17,15,14,15,16,18, 0, 5, 7, 7,10,10, 7,
137.4587 +         9, 9,11,11, 7, 9, 9,11,11,10,11,11,14,14,10,11,
137.4588 +        12,14,15, 6, 9, 9,12,11, 9,11,11,13,13, 8,10,11,
137.4589 +        12,13,11,13,13,16,15,11,12,13,14,15, 7, 9, 9,11,
137.4590 +        12, 9,11,11,13,13, 9,11,11,13,13,11,13,13,15,16,
137.4591 +        11,13,13,15,14, 9,11,11,15,14,11,13,13,17,15,10,
137.4592 +        12,12,15,15,14,16,16,17,17,13,13,15,15,17,10,11,
137.4593 +        12,15,15,11,13,13,16,16,11,13,13,15,15,14,15,15,
137.4594 +        18,18,14,15,15,17,17, 8,10,10,13,13,10,12,11,15,
137.4595 +        15,10,11,12,15,15,14,15,15,18,18,13,14,14,18,18,
137.4596 +         9,11,11,15,16,11,13,13,17,17,11,13,13,16,16,15,
137.4597 +        15,16,17, 0,14,15,17, 0, 0, 9,11,11,15,15,10,13,
137.4598 +        12,18,16,11,13,13,15,16,14,16,15,20,20,14,15,16,
137.4599 +        17, 0,13,14,14,20,16,14,15,16,19,18,14,15,15,19,
137.4600 +         0,18,16, 0,20,20,16,18,18, 0, 0,12,14,14,18,18,
137.4601 +        13,15,14,18,16,14,15,16,18,20,16,19,16, 0,17,17,
137.4602 +        18,18,19, 0, 8,10,10,14,14,10,11,11,14,15,10,11,
137.4603 +        12,15,15,13,15,14,19,17,13,15,15,17, 0, 9,11,11,
137.4604 +        16,15,11,13,13,16,16,10,12,13,15,17,14,16,16,18,
137.4605 +        18,14,15,15,18, 0, 9,11,11,15,15,11,13,13,16,17,
137.4606 +        11,13,13,18,17,14,18,16,18,18,15,17,17,18, 0,12,
137.4607 +        14,14,18,18,14,15,15,20, 0,13,14,15,17, 0,16,18,
137.4608 +        17, 0, 0,16,16, 0,17,20,12,14,14,18,18,14,16,15,
137.4609 +         0,18,14,16,15,18, 0,16,19,17, 0, 0,17,18,16, 0,
137.4610 +         0,
137.4611 +};
137.4612 +
137.4613 +static const static_codebook _44u5__p3_0 = {
137.4614 +        4, 625,
137.4615 +        (long *)_vq_lengthlist__44u5__p3_0,
137.4616 +        1, -533725184, 1611661312, 3, 0,
137.4617 +        (long *)_vq_quantlist__44u5__p3_0,
137.4618 +        0
137.4619 +};
137.4620 +
137.4621 +static const long _vq_quantlist__44u5__p4_0[] = {
137.4622 +        2,
137.4623 +        1,
137.4624 +        3,
137.4625 +        0,
137.4626 +        4,
137.4627 +};
137.4628 +
137.4629 +static const long _vq_lengthlist__44u5__p4_0[] = {
137.4630 +         4, 5, 5, 8, 8, 6, 7, 6, 9, 9, 6, 6, 7, 9, 9, 8,
137.4631 +         9, 9,11,11, 8, 9, 9,11,11, 6, 7, 7, 9, 9, 7, 8,
137.4632 +         8,10,10, 6, 7, 8, 9,10, 9,10,10,11,12, 9, 9,10,
137.4633 +        11,12, 6, 7, 7, 9, 9, 6, 8, 7,10, 9, 7, 8, 8,10,
137.4634 +        10, 9,10, 9,12,11, 9,10,10,12,11, 8, 9, 9,12,11,
137.4635 +         9,10,10,12,12, 9,10,10,12,12,11,12,12,13,14,11,
137.4636 +        11,12,13,14, 8, 9, 9,11,12, 9,10,10,12,12, 9,10,
137.4637 +        10,12,12,11,12,11,14,13,11,12,12,13,13, 5, 7, 7,
137.4638 +         9, 9, 7, 8, 8,10,10, 7, 8, 8,10,10, 9,10,10,12,
137.4639 +        12, 9,10,10,12,12, 7, 8, 8,10,10, 8, 8, 9,10,11,
137.4640 +         8, 9, 9,11,11,10,10,11,11,13,10,11,11,12,13, 6,
137.4641 +         7, 8,10,10, 7, 9, 8,11,10, 8, 9, 9,11,11,10,11,
137.4642 +        10,13,11,10,11,11,12,12, 9,10,10,12,12,10,10,11,
137.4643 +        12,13,10,11,11,13,13,12,11,13,12,15,12,13,13,14,
137.4644 +        15, 9,10,10,12,12, 9,11,10,13,12,10,11,11,13,13,
137.4645 +        11,13,11,14,12,12,13,13,14,15, 5, 7, 7, 9, 9, 7,
137.4646 +         8, 8,10,10, 7, 8, 8,10,10, 9,10,10,12,12, 9,10,
137.4647 +        10,12,12, 6, 8, 7,10,10, 8, 9, 9,11,11, 7, 8, 9,
137.4648 +        10,11,10,11,11,12,12,10,10,11,11,13, 7, 8, 8,10,
137.4649 +        10, 8, 9, 9,11,11, 8, 9, 8,11,10,10,11,11,13,12,
137.4650 +        10,11,10,13,11, 9,10,10,12,12,10,11,11,13,12, 9,
137.4651 +        10,10,12,13,12,13,13,14,15,11,11,13,12,14, 9,10,
137.4652 +        10,12,12,10,11,11,13,13,10,11,10,13,12,12,13,13,
137.4653 +        14,14,12,13,11,14,12, 8, 9, 9,12,12, 9,10,10,12,
137.4654 +        12, 9,10,10,12,12,12,12,12,14,14,11,12,12,14,13,
137.4655 +         9,10,10,12,12,10,11,11,13,13,10,11,11,13,12,12,
137.4656 +        12,13,14,15,12,13,13,15,14, 9,10,10,12,12,10,11,
137.4657 +        10,13,12,10,11,11,12,13,12,13,12,15,13,12,13,13,
137.4658 +        14,15,11,12,12,14,13,11,12,12,14,15,12,13,13,15,
137.4659 +        14,13,12,14,12,16,13,14,14,15,15,11,11,12,14,14,
137.4660 +        11,12,11,14,13,12,13,13,14,15,13,14,12,16,12,14,
137.4661 +        14,15,16,16, 8, 9, 9,11,12, 9,10,10,12,12, 9,10,
137.4662 +        10,12,13,11,12,12,13,13,12,12,13,14,14, 9,10,10,
137.4663 +        12,12,10,11,10,13,12,10,10,11,12,13,12,13,13,15,
137.4664 +        14,12,12,13,13,15, 9,10,10,12,13,10,11,11,12,13,
137.4665 +        10,11,11,13,13,12,13,13,14,15,12,13,12,15,14,11,
137.4666 +        12,11,14,13,12,13,13,15,14,11,11,12,13,14,14,15,
137.4667 +        14,16,15,13,12,14,13,16,11,12,12,13,14,12,13,13,
137.4668 +        14,15,11,12,11,14,14,14,14,14,15,16,13,15,12,16,
137.4669 +        12,
137.4670 +};
137.4671 +
137.4672 +static const static_codebook _44u5__p4_0 = {
137.4673 +        4, 625,
137.4674 +        (long *)_vq_lengthlist__44u5__p4_0,
137.4675 +        1, -533725184, 1611661312, 3, 0,
137.4676 +        (long *)_vq_quantlist__44u5__p4_0,
137.4677 +        0
137.4678 +};
137.4679 +
137.4680 +static const long _vq_quantlist__44u5__p5_0[] = {
137.4681 +        4,
137.4682 +        3,
137.4683 +        5,
137.4684 +        2,
137.4685 +        6,
137.4686 +        1,
137.4687 +        7,
137.4688 +        0,
137.4689 +        8,
137.4690 +};
137.4691 +
137.4692 +static const long _vq_lengthlist__44u5__p5_0[] = {
137.4693 +         2, 3, 3, 6, 6, 8, 8,10,10, 4, 5, 5, 8, 7, 8, 8,
137.4694 +        11,10, 3, 5, 5, 7, 8, 8, 8,10,11, 6, 8, 7,10, 9,
137.4695 +        10,10,11,11, 6, 7, 8, 9, 9, 9,10,11,12, 8, 8, 8,
137.4696 +        10,10,11,11,13,12, 8, 8, 9, 9,10,11,11,12,13,10,
137.4697 +        11,10,12,11,13,12,14,14,10,10,11,11,12,12,13,14,
137.4698 +        14,
137.4699 +};
137.4700 +
137.4701 +static const static_codebook _44u5__p5_0 = {
137.4702 +        2, 81,
137.4703 +        (long *)_vq_lengthlist__44u5__p5_0,
137.4704 +        1, -531628032, 1611661312, 4, 0,
137.4705 +        (long *)_vq_quantlist__44u5__p5_0,
137.4706 +        0
137.4707 +};
137.4708 +
137.4709 +static const long _vq_quantlist__44u5__p6_0[] = {
137.4710 +        4,
137.4711 +        3,
137.4712 +        5,
137.4713 +        2,
137.4714 +        6,
137.4715 +        1,
137.4716 +        7,
137.4717 +        0,
137.4718 +        8,
137.4719 +};
137.4720 +
137.4721 +static const long _vq_lengthlist__44u5__p6_0[] = {
137.4722 +         3, 4, 4, 5, 5, 7, 7, 9, 9, 4, 5, 4, 6, 6, 7, 7,
137.4723 +         9, 9, 4, 4, 5, 6, 6, 7, 7, 9, 9, 5, 6, 6, 7, 7,
137.4724 +         8, 8,10,10, 6, 6, 6, 7, 7, 8, 8,10,10, 7, 7, 7,
137.4725 +         8, 8, 9, 9,11,10, 7, 7, 7, 8, 8, 9, 9,10,11, 9,
137.4726 +         9, 9,10,10,11,10,11,11, 9, 9, 9,10,10,11,10,11,
137.4727 +        11,
137.4728 +};
137.4729 +
137.4730 +static const static_codebook _44u5__p6_0 = {
137.4731 +        2, 81,
137.4732 +        (long *)_vq_lengthlist__44u5__p6_0,
137.4733 +        1, -531628032, 1611661312, 4, 0,
137.4734 +        (long *)_vq_quantlist__44u5__p6_0,
137.4735 +        0
137.4736 +};
137.4737 +
137.4738 +static const long _vq_quantlist__44u5__p7_0[] = {
137.4739 +        1,
137.4740 +        0,
137.4741 +        2,
137.4742 +};
137.4743 +
137.4744 +static const long _vq_lengthlist__44u5__p7_0[] = {
137.4745 +         1, 4, 4, 5, 7, 7, 5, 7, 7, 5, 9, 9, 8,11,10, 7,
137.4746 +        11,10, 5, 9, 9, 7,10,10, 8,10,11, 4, 9, 9, 9,12,
137.4747 +        12, 9,12,12, 8,12,12,11,12,12,10,12,13, 7,12,12,
137.4748 +        11,12,12,10,12,13, 4, 9, 9, 9,12,12, 9,12,12, 7,
137.4749 +        12,11,10,13,13,11,12,12, 7,12,12,10,13,13,11,12,
137.4750 +        12,
137.4751 +};
137.4752 +
137.4753 +static const static_codebook _44u5__p7_0 = {
137.4754 +        4, 81,
137.4755 +        (long *)_vq_lengthlist__44u5__p7_0,
137.4756 +        1, -529137664, 1618345984, 2, 0,
137.4757 +        (long *)_vq_quantlist__44u5__p7_0,
137.4758 +        0
137.4759 +};
137.4760 +
137.4761 +static const long _vq_quantlist__44u5__p7_1[] = {
137.4762 +        5,
137.4763 +        4,
137.4764 +        6,
137.4765 +        3,
137.4766 +        7,
137.4767 +        2,
137.4768 +        8,
137.4769 +        1,
137.4770 +        9,
137.4771 +        0,
137.4772 +        10,
137.4773 +};
137.4774 +
137.4775 +static const long _vq_lengthlist__44u5__p7_1[] = {
137.4776 +         2, 4, 4, 6, 6, 7, 7, 8, 8, 8, 8, 4, 5, 5, 7, 7,
137.4777 +         8, 8, 9, 8, 8, 9, 4, 5, 5, 7, 7, 8, 8, 9, 9, 8,
137.4778 +         9, 6, 7, 7, 8, 8, 9, 8, 9, 9, 9, 9, 6, 7, 7, 8,
137.4779 +         8, 9, 9, 9, 9, 9, 9, 7, 8, 8, 9, 9, 9, 9, 9, 9,
137.4780 +         9, 9, 7, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 8, 9, 9,
137.4781 +         9, 9, 9, 9,10,10,10,10, 8, 9, 9, 9, 9, 9, 9,10,
137.4782 +        10,10,10, 8, 9, 9, 9, 9, 9, 9,10,10,10,10, 8, 9,
137.4783 +         9, 9, 9, 9, 9,10,10,10,10,
137.4784 +};
137.4785 +
137.4786 +static const static_codebook _44u5__p7_1 = {
137.4787 +        2, 121,
137.4788 +        (long *)_vq_lengthlist__44u5__p7_1,
137.4789 +        1, -531365888, 1611661312, 4, 0,
137.4790 +        (long *)_vq_quantlist__44u5__p7_1,
137.4791 +        0
137.4792 +};
137.4793 +
137.4794 +static const long _vq_quantlist__44u5__p8_0[] = {
137.4795 +        5,
137.4796 +        4,
137.4797 +        6,
137.4798 +        3,
137.4799 +        7,
137.4800 +        2,
137.4801 +        8,
137.4802 +        1,
137.4803 +        9,
137.4804 +        0,
137.4805 +        10,
137.4806 +};
137.4807 +
137.4808 +static const long _vq_lengthlist__44u5__p8_0[] = {
137.4809 +         1, 4, 4, 6, 6, 8, 8, 9, 9,10,10, 4, 6, 6, 7, 7,
137.4810 +         9, 9,10,10,11,11, 4, 6, 6, 7, 7, 9, 9,10,10,11,
137.4811 +        11, 6, 8, 7, 9, 9,10,10,11,11,13,12, 6, 8, 8, 9,
137.4812 +         9,10,10,11,11,12,13, 8, 9, 9,10,10,12,12,13,12,
137.4813 +        14,13, 8, 9, 9,10,10,12,12,13,13,14,14, 9,11,11,
137.4814 +        12,12,13,13,14,14,15,14, 9,11,11,12,12,13,13,14,
137.4815 +        14,15,14,11,12,12,13,13,14,14,15,14,15,14,11,11,
137.4816 +        12,13,13,14,14,14,14,15,15,
137.4817 +};
137.4818 +
137.4819 +static const static_codebook _44u5__p8_0 = {
137.4820 +        2, 121,
137.4821 +        (long *)_vq_lengthlist__44u5__p8_0,
137.4822 +        1, -524582912, 1618345984, 4, 0,
137.4823 +        (long *)_vq_quantlist__44u5__p8_0,
137.4824 +        0
137.4825 +};
137.4826 +
137.4827 +static const long _vq_quantlist__44u5__p8_1[] = {
137.4828 +        5,
137.4829 +        4,
137.4830 +        6,
137.4831 +        3,
137.4832 +        7,
137.4833 +        2,
137.4834 +        8,
137.4835 +        1,
137.4836 +        9,
137.4837 +        0,
137.4838 +        10,
137.4839 +};
137.4840 +
137.4841 +static const long _vq_lengthlist__44u5__p8_1[] = {
137.4842 +         3, 5, 5, 6, 6, 7, 7, 7, 7, 7, 7, 5, 6, 5, 7, 6,
137.4843 +         7, 7, 8, 8, 8, 8, 5, 5, 5, 6, 6, 7, 7, 8, 8, 8,
137.4844 +         8, 6, 7, 6, 7, 7, 8, 8, 8, 8, 8, 8, 6, 6, 7, 7,
137.4845 +         7, 8, 8, 8, 8, 8, 8, 7, 7, 7, 8, 8, 8, 8, 8, 8,
137.4846 +         8, 8, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 7, 8, 8,
137.4847 +         8, 8, 8, 8, 8, 8, 8, 8, 7, 8, 8, 8, 8, 8, 8, 8,
137.4848 +         8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
137.4849 +         8, 8, 8, 8, 8, 8, 8, 8, 8,
137.4850 +};
137.4851 +
137.4852 +static const static_codebook _44u5__p8_1 = {
137.4853 +        2, 121,
137.4854 +        (long *)_vq_lengthlist__44u5__p8_1,
137.4855 +        1, -531365888, 1611661312, 4, 0,
137.4856 +        (long *)_vq_quantlist__44u5__p8_1,
137.4857 +        0
137.4858 +};
137.4859 +
137.4860 +static const long _vq_quantlist__44u5__p9_0[] = {
137.4861 +        6,
137.4862 +        5,
137.4863 +        7,
137.4864 +        4,
137.4865 +        8,
137.4866 +        3,
137.4867 +        9,
137.4868 +        2,
137.4869 +        10,
137.4870 +        1,
137.4871 +        11,
137.4872 +        0,
137.4873 +        12,
137.4874 +};
137.4875 +
137.4876 +static const long _vq_lengthlist__44u5__p9_0[] = {
137.4877 +         1, 3, 2,12,10,13,13,13,13,13,13,13,13, 4, 9, 9,
137.4878 +        13,13,13,13,13,13,13,13,13,13, 5,10, 9,13,13,13,
137.4879 +        13,13,13,13,13,13,13,12,13,13,13,13,13,13,13,13,
137.4880 +        13,13,13,13,11,13,13,13,13,13,13,13,13,13,13,13,
137.4881 +        13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
137.4882 +        13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
137.4883 +        13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
137.4884 +        13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
137.4885 +        13,13,13,13,13,13,13,13,13,13,13,13,13,12,12,12,
137.4886 +        12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
137.4887 +        12,12,12,12,12,12,12,12,12,
137.4888 +};
137.4889 +
137.4890 +static const static_codebook _44u5__p9_0 = {
137.4891 +        2, 169,
137.4892 +        (long *)_vq_lengthlist__44u5__p9_0,
137.4893 +        1, -514332672, 1627381760, 4, 0,
137.4894 +        (long *)_vq_quantlist__44u5__p9_0,
137.4895 +        0
137.4896 +};
137.4897 +
137.4898 +static const long _vq_quantlist__44u5__p9_1[] = {
137.4899 +        7,
137.4900 +        6,
137.4901 +        8,
137.4902 +        5,
137.4903 +        9,
137.4904 +        4,
137.4905 +        10,
137.4906 +        3,
137.4907 +        11,
137.4908 +        2,
137.4909 +        12,
137.4910 +        1,
137.4911 +        13,
137.4912 +        0,
137.4913 +        14,
137.4914 +};
137.4915 +
137.4916 +static const long _vq_lengthlist__44u5__p9_1[] = {
137.4917 +         1, 4, 4, 7, 7, 8, 8, 8, 7, 8, 7, 9, 8, 9, 9, 4,
137.4918 +         7, 6, 9, 8,10,10, 9, 8, 9, 9, 9, 9, 9, 8, 5, 6,
137.4919 +         6, 8, 9,10,10, 9, 9, 9,10,10,10,10,11, 7, 8, 8,
137.4920 +        10,10,11,11,10,10,11,11,11,12,11,11, 7, 8, 8,10,
137.4921 +        10,11,11,10,10,11,11,12,11,11,11, 8, 9, 9,11,11,
137.4922 +        12,12,11,11,12,11,12,12,12,12, 8, 9,10,11,11,12,
137.4923 +        12,11,11,12,12,12,12,12,12, 8, 9, 9,10,10,12,11,
137.4924 +        12,12,12,12,12,12,12,13, 8, 9, 9,11,11,11,11,12,
137.4925 +        12,12,12,13,12,13,13, 9,10,10,11,11,12,12,12,13,
137.4926 +        12,13,13,13,14,13, 9,10,10,11,11,12,12,12,13,13,
137.4927 +        12,13,13,14,13, 9,11,10,12,11,13,12,12,13,13,13,
137.4928 +        13,13,13,14, 9,10,10,12,12,12,12,12,13,13,13,13,
137.4929 +        13,14,14,10,11,11,12,12,12,13,13,13,14,14,13,14,
137.4930 +        14,14,10,11,11,12,12,12,12,13,12,13,14,13,14,14,
137.4931 +        14,
137.4932 +};
137.4933 +
137.4934 +static const static_codebook _44u5__p9_1 = {
137.4935 +        2, 225,
137.4936 +        (long *)_vq_lengthlist__44u5__p9_1,
137.4937 +        1, -522338304, 1620115456, 4, 0,
137.4938 +        (long *)_vq_quantlist__44u5__p9_1,
137.4939 +        0
137.4940 +};
137.4941 +
137.4942 +static const long _vq_quantlist__44u5__p9_2[] = {
137.4943 +        8,
137.4944 +        7,
137.4945 +        9,
137.4946 +        6,
137.4947 +        10,
137.4948 +        5,
137.4949 +        11,
137.4950 +        4,
137.4951 +        12,
137.4952 +        3,
137.4953 +        13,
137.4954 +        2,
137.4955 +        14,
137.4956 +        1,
137.4957 +        15,
137.4958 +        0,
137.4959 +        16,
137.4960 +};
137.4961 +
137.4962 +static const long _vq_lengthlist__44u5__p9_2[] = {
137.4963 +         2, 5, 5, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9,
137.4964 +         9, 5, 6, 6, 7, 7, 8, 8, 9, 8, 9, 9, 9, 9, 9, 9,
137.4965 +         9, 9, 5, 6, 6, 7, 7, 8, 8, 9, 8, 9, 9, 9, 9, 9,
137.4966 +         9, 9, 9, 7, 7, 7, 8, 8, 9, 8, 9, 9, 9, 9, 9, 9,
137.4967 +         9, 9, 9, 9, 7, 7, 7, 8, 8, 9, 8, 9, 9, 9, 9, 9,
137.4968 +         9, 9, 9, 9, 9, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9,
137.4969 +         9,10, 9,10,10,10, 8, 8, 8, 9, 8, 9, 9, 9, 9, 9,
137.4970 +         9, 9,10, 9,10, 9,10, 8, 9, 9, 9, 9, 9, 9, 9, 9,
137.4971 +         9,10, 9,10,10,10,10,10, 8, 9, 9, 9, 9, 9, 9,10,
137.4972 +         9,10, 9,10,10,10,10,10,10, 9, 9, 9, 9, 9,10, 9,
137.4973 +        10,10,10,10,10,10,10,10,10,10, 9, 9, 9, 9, 9, 9,
137.4974 +         9,10, 9,10, 9,10,10,10,10,10,10, 9, 9, 9, 9, 9,
137.4975 +        10,10,10,10,10,10,10,10,10,10,10,10, 9, 9, 9, 9,
137.4976 +         9, 9,10,10,10,10,10,10,10,10,10,10,10, 9, 9, 9,
137.4977 +         9,10,10, 9,10,10,10,10,10,10,10,10,10,10, 9, 9,
137.4978 +         9, 9, 9,10,10,10,10,10,10,10,10,10,10,10,10, 9,
137.4979 +         9, 9, 9, 9,10,10,10,10,10,10,10,10,10,10,10,10,
137.4980 +         9, 9, 9,10, 9,10,10,10,10,10,10,10,10,10,10,10,
137.4981 +        10,
137.4982 +};
137.4983 +
137.4984 +static const static_codebook _44u5__p9_2 = {
137.4985 +        2, 289,
137.4986 +        (long *)_vq_lengthlist__44u5__p9_2,
137.4987 +        1, -529530880, 1611661312, 5, 0,
137.4988 +        (long *)_vq_quantlist__44u5__p9_2,
137.4989 +        0
137.4990 +};
137.4991 +
137.4992 +static const long _huff_lengthlist__44u5__short[] = {
137.4993 +         4,10,17,13,17,13,17,17,17,17, 3, 6, 8, 9,11, 9,
137.4994 +        15,12,16,17, 6, 5, 5, 7, 7, 8,10,11,17,17, 7, 8,
137.4995 +         7, 9, 9,10,13,13,17,17, 8, 6, 5, 7, 4, 7, 5, 8,
137.4996 +        14,17, 9, 9, 8, 9, 7, 9, 8,10,16,17,12,10, 7, 8,
137.4997 +         4, 7, 4, 7,16,17,12,11, 9,10, 6, 9, 5, 7,14,17,
137.4998 +        14,13,10,15, 4, 8, 3, 5,14,17,17,14,11,15, 6,10,
137.4999 +         6, 8,15,17,
137.5000 +};
137.5001 +
137.5002 +static const static_codebook _huff_book__44u5__short = {
137.5003 +        2, 100,
137.5004 +        (long *)_huff_lengthlist__44u5__short,
137.5005 +        0, 0, 0, 0, 0,
137.5006 +        NULL,
137.5007 +        0
137.5008 +};
137.5009 +
137.5010 +static const long _huff_lengthlist__44u6__long[] = {
137.5011 +         3, 9,14,13,14,13,16,12,13,14, 5, 4, 6, 6, 8, 9,
137.5012 +        11,10,12,15,10, 5, 5, 6, 6, 8,10,10,13,16,10, 6,
137.5013 +         6, 6, 6, 8, 9, 9,12,14,13, 7, 6, 6, 4, 6, 6, 7,
137.5014 +        11,14,10, 7, 7, 7, 6, 6, 6, 7,10,13,15,10, 9, 8,
137.5015 +         5, 6, 5, 6,10,14,10, 9, 8, 8, 6, 6, 5, 4, 6,11,
137.5016 +        11,11,12,11,10, 9, 9, 5, 5, 9,10,12,15,13,13,13,
137.5017 +        13, 8, 7, 7,
137.5018 +};
137.5019 +
137.5020 +static const static_codebook _huff_book__44u6__long = {
137.5021 +        2, 100,
137.5022 +        (long *)_huff_lengthlist__44u6__long,
137.5023 +        0, 0, 0, 0, 0,
137.5024 +        NULL,
137.5025 +        0
137.5026 +};
137.5027 +
137.5028 +static const long _vq_quantlist__44u6__p1_0[] = {
137.5029 +        1,
137.5030 +        0,
137.5031 +        2,
137.5032 +};
137.5033 +
137.5034 +static const long _vq_lengthlist__44u6__p1_0[] = {
137.5035 +         1, 4, 4, 4, 8, 7, 5, 7, 7, 5, 8, 8, 8,10,10, 7,
137.5036 +         9,10, 5, 8, 8, 7,10, 9, 8,10,10, 5, 8, 8, 8,10,
137.5037 +        10, 8,10,10, 8,10,10,10,12,13,10,13,13, 7,10,10,
137.5038 +        10,13,11,10,13,13, 5, 8, 8, 8,11,10, 8,10,10, 7,
137.5039 +        10,10,10,13,13,10,11,13, 8,10,11,10,13,13,10,13,
137.5040 +        12,
137.5041 +};
137.5042 +
137.5043 +static const static_codebook _44u6__p1_0 = {
137.5044 +        4, 81,
137.5045 +        (long *)_vq_lengthlist__44u6__p1_0,
137.5046 +        1, -535822336, 1611661312, 2, 0,
137.5047 +        (long *)_vq_quantlist__44u6__p1_0,
137.5048 +        0
137.5049 +};
137.5050 +
137.5051 +static const long _vq_quantlist__44u6__p2_0[] = {
137.5052 +        1,
137.5053 +        0,
137.5054 +        2,
137.5055 +};
137.5056 +
137.5057 +static const long _vq_lengthlist__44u6__p2_0[] = {
137.5058 +         3, 4, 4, 5, 6, 6, 5, 6, 6, 5, 6, 6, 6, 8, 8, 6,
137.5059 +         7, 8, 5, 6, 6, 6, 8, 7, 6, 8, 8, 5, 6, 6, 6, 8,
137.5060 +         8, 6, 8, 8, 6, 8, 8, 8, 9, 9, 8, 9, 9, 6, 7, 7,
137.5061 +         7, 9, 8, 8, 9, 9, 5, 6, 6, 6, 8, 7, 6, 8, 8, 6,
137.5062 +         8, 8, 8, 9, 9, 7, 8, 9, 6, 8, 8, 8, 9, 9, 8, 9,
137.5063 +         9,
137.5064 +};
137.5065 +
137.5066 +static const static_codebook _44u6__p2_0 = {
137.5067 +        4, 81,
137.5068 +        (long *)_vq_lengthlist__44u6__p2_0,
137.5069 +        1, -535822336, 1611661312, 2, 0,
137.5070 +        (long *)_vq_quantlist__44u6__p2_0,
137.5071 +        0
137.5072 +};
137.5073 +
137.5074 +static const long _vq_quantlist__44u6__p3_0[] = {
137.5075 +        2,
137.5076 +        1,
137.5077 +        3,
137.5078 +        0,
137.5079 +        4,
137.5080 +};
137.5081 +
137.5082 +static const long _vq_lengthlist__44u6__p3_0[] = {
137.5083 +         2, 5, 4, 8, 8, 5, 7, 6, 9, 9, 5, 6, 7, 9, 9, 8,
137.5084 +         9, 9,13,12, 8, 9,10,12,13, 5, 7, 7,10, 9, 7, 9,
137.5085 +         9,11,11, 7, 8, 9,11,11,10,11,11,14,14, 9,10,11,
137.5086 +        13,14, 5, 7, 7, 9,10, 6, 9, 8,11,11, 7, 9, 9,11,
137.5087 +        11, 9,11,10,14,13,10,11,11,14,13, 8,10,10,13,13,
137.5088 +        10,11,11,15,15, 9,11,11,14,14,13,14,14,17,16,12,
137.5089 +        13,14,16,16, 8,10,10,13,14, 9,11,11,14,15,10,11,
137.5090 +        12,14,15,12,14,13,16,15,13,14,14,15,17, 5, 7, 7,
137.5091 +        10,10, 7, 9, 9,11,11, 7, 9, 9,11,11,10,12,11,14,
137.5092 +        14,10,11,11,14,14, 7, 9, 9,12,11, 9,11,11,13,13,
137.5093 +         9,11,11,13,13,11,13,13,14,15,11,12,13,15,16, 6,
137.5094 +         9, 9,11,12, 8,11,10,13,12, 9,11,11,13,14,11,13,
137.5095 +        12,16,14,11,13,13,15,16,10,12,11,14,15,11,13,13,
137.5096 +        15,17,11,13,13,17,16,15,15,16,17,16,14,15,16,18,
137.5097 +         0, 9,11,11,14,15,10,12,12,16,15,11,13,13,16,16,
137.5098 +        13,15,14,18,15,14,16,16, 0, 0, 5, 7, 7,10,10, 7,
137.5099 +         9, 9,11,11, 7, 9, 9,11,11,10,11,11,14,14,10,11,
137.5100 +        12,14,14, 6, 9, 9,11,11, 9,11,11,13,13, 8,10,11,
137.5101 +        12,13,11,13,13,16,15,11,12,13,14,16, 7, 9, 9,11,
137.5102 +        12, 9,11,11,13,13, 9,11,11,13,13,11,13,13,16,15,
137.5103 +        11,13,12,15,15, 9,11,11,15,14,11,13,13,17,16,10,
137.5104 +        12,13,15,16,14,16,16, 0,18,14,14,15,15,17,10,11,
137.5105 +        12,15,15,11,13,13,16,16,11,13,13,16,16,14,16,16,
137.5106 +        19,17,14,15,15,17,17, 8,10,10,14,14,10,12,11,15,
137.5107 +        15,10,11,12,16,15,14,15,15,18,20,13,14,16,17,18,
137.5108 +         9,11,11,15,16,11,13,13,17,17,11,13,13,17,16,15,
137.5109 +        16,16, 0, 0,15,16,16, 0, 0, 9,11,11,15,15,10,13,
137.5110 +        12,17,15,11,13,13,17,16,15,17,15,20,19,15,16,16,
137.5111 +        19, 0,13,15,14, 0,17,14,15,16, 0,20,15,16,16, 0,
137.5112 +        19,17,18, 0, 0, 0,16,17,18, 0, 0,12,14,14,19,18,
137.5113 +        13,15,14, 0,17,14,15,16,19,19,16,18,16, 0,19,19,
137.5114 +        20,17,20, 0, 8,10,10,13,14,10,11,11,15,15,10,12,
137.5115 +        12,15,16,14,15,14,19,16,14,15,15, 0,18, 9,11,11,
137.5116 +        16,15,11,13,13, 0,16,11,12,13,16,17,14,16,17, 0,
137.5117 +        19,15,16,16,18, 0, 9,11,11,15,16,11,13,13,16,16,
137.5118 +        11,14,13,18,17,15,16,16,18,20,15,17,19, 0, 0,12,
137.5119 +        14,14,17,17,14,16,15, 0, 0,13,14,15,19, 0,16,18,
137.5120 +        20, 0, 0,16,16,18,18, 0,12,14,14,17,20,14,16,16,
137.5121 +        19, 0,14,16,14, 0,20,16,20,17, 0, 0,17, 0,15, 0,
137.5122 +        19,
137.5123 +};
137.5124 +
137.5125 +static const static_codebook _44u6__p3_0 = {
137.5126 +        4, 625,
137.5127 +        (long *)_vq_lengthlist__44u6__p3_0,
137.5128 +        1, -533725184, 1611661312, 3, 0,
137.5129 +        (long *)_vq_quantlist__44u6__p3_0,
137.5130 +        0
137.5131 +};
137.5132 +
137.5133 +static const long _vq_quantlist__44u6__p4_0[] = {
137.5134 +        2,
137.5135 +        1,
137.5136 +        3,
137.5137 +        0,
137.5138 +        4,
137.5139 +};
137.5140 +
137.5141 +static const long _vq_lengthlist__44u6__p4_0[] = {
137.5142 +         4, 5, 5, 8, 8, 6, 7, 6, 9, 9, 6, 6, 7, 9, 9, 8,
137.5143 +         9, 9,11,11, 8, 9, 9,11,11, 6, 7, 7, 9, 9, 7, 8,
137.5144 +         8,10,10, 7, 7, 8, 9,10, 9,10,10,11,11, 9, 9,10,
137.5145 +        11,12, 6, 7, 7, 9, 9, 7, 8, 7,10, 9, 7, 8, 8,10,
137.5146 +        10, 9,10, 9,12,11, 9,10,10,12,11, 8, 9, 9,11,11,
137.5147 +         9,10,10,12,12, 9,10,10,12,12,11,12,12,14,13,11,
137.5148 +        11,12,13,13, 8, 9, 9,11,11, 9,10,10,12,12, 9,10,
137.5149 +        10,12,12,11,12,11,13,12,11,12,12,13,13, 5, 7, 7,
137.5150 +         9, 9, 7, 8, 7,10,10, 7, 7, 8,10,10, 9,10,10,12,
137.5151 +        11, 9,10,10,11,12, 7, 8, 8,10,10, 8, 8, 9,11,11,
137.5152 +         8, 9, 9,11,11,10,10,11,12,13,10,10,11,12,12, 6,
137.5153 +         7, 7,10,10, 7, 9, 8,11,10, 8, 8, 9,10,11,10,11,
137.5154 +        10,13,11,10,11,11,12,12, 9,10,10,12,12,10,10,11,
137.5155 +        13,13,10,11,11,12,13,12,12,12,13,14,12,12,13,14,
137.5156 +        14, 9,10,10,12,12, 9,10,10,13,12,10,11,11,13,13,
137.5157 +        11,12,11,14,12,12,13,13,14,14, 6, 7, 7, 9, 9, 7,
137.5158 +         8, 7,10,10, 7, 8, 8,10,10, 9,10,10,12,11, 9,10,
137.5159 +        10,11,12, 6, 7, 7,10,10, 8, 9, 8,11,10, 7, 8, 9,
137.5160 +        10,11,10,11,11,12,12,10,10,11,11,13, 7, 8, 8,10,
137.5161 +        10, 8, 9, 9,11,11, 8, 9, 8,11,11,10,11,10,13,12,
137.5162 +        10,11,11,13,12, 9,10,10,12,12,10,11,11,13,12, 9,
137.5163 +        10,10,12,13,12,13,12,14,14,11,11,12,12,14, 9,10,
137.5164 +        10,12,12,10,11,11,13,13,10,11,10,13,12,12,12,12,
137.5165 +        14,14,12,13,12,14,13, 8, 9, 9,11,11, 9,10,10,12,
137.5166 +        12, 9,10,10,12,12,11,12,12,14,13,11,12,12,13,14,
137.5167 +         9,10,10,12,12,10,11,11,13,13,10,11,11,13,13,12,
137.5168 +        12,13,14,15,12,12,13,14,14, 9,10,10,12,12, 9,11,
137.5169 +        10,13,12,10,10,11,12,13,12,13,12,14,13,12,12,13,
137.5170 +        14,15,11,12,12,14,13,11,12,12,14,14,12,13,13,14,
137.5171 +        14,13,13,14,14,16,13,14,14,15,15,11,12,11,13,13,
137.5172 +        11,12,11,14,13,12,12,13,14,15,12,14,12,15,12,13,
137.5173 +        14,15,15,16, 8, 9, 9,11,11, 9,10,10,12,12, 9,10,
137.5174 +        10,12,12,11,12,12,14,13,11,12,12,13,13, 9,10,10,
137.5175 +        12,12,10,11,10,13,12, 9,10,11,12,13,12,13,12,14,
137.5176 +        14,12,12,13,13,14, 9,10,10,12,12,10,11,11,13,13,
137.5177 +        10,11,11,13,13,12,13,12,14,14,12,13,13,14,14,11,
137.5178 +        11,11,13,13,12,13,12,14,14,11,11,12,13,14,14,14,
137.5179 +        14,16,15,12,12,14,12,15,11,12,12,13,14,12,13,13,
137.5180 +        14,15,11,12,12,14,14,13,14,14,16,16,13,14,13,16,
137.5181 +        13,
137.5182 +};
137.5183 +
137.5184 +static const static_codebook _44u6__p4_0 = {
137.5185 +        4, 625,
137.5186 +        (long *)_vq_lengthlist__44u6__p4_0,
137.5187 +        1, -533725184, 1611661312, 3, 0,
137.5188 +        (long *)_vq_quantlist__44u6__p4_0,
137.5189 +        0
137.5190 +};
137.5191 +
137.5192 +static const long _vq_quantlist__44u6__p5_0[] = {
137.5193 +        4,
137.5194 +        3,
137.5195 +        5,
137.5196 +        2,
137.5197 +        6,
137.5198 +        1,
137.5199 +        7,
137.5200 +        0,
137.5201 +        8,
137.5202 +};
137.5203 +
137.5204 +static const long _vq_lengthlist__44u6__p5_0[] = {
137.5205 +         2, 3, 3, 6, 6, 8, 8,10,10, 4, 5, 5, 8, 7, 8, 8,
137.5206 +        11,11, 3, 5, 5, 7, 8, 8, 8,11,11, 6, 8, 7, 9, 9,
137.5207 +        10, 9,12,11, 6, 7, 8, 9, 9, 9,10,11,12, 8, 8, 8,
137.5208 +        10, 9,12,11,13,13, 8, 8, 9, 9,10,11,12,13,13,10,
137.5209 +        11,11,12,12,13,13,14,14,10,10,11,11,12,13,13,14,
137.5210 +        14,
137.5211 +};
137.5212 +
137.5213 +static const static_codebook _44u6__p5_0 = {
137.5214 +        2, 81,
137.5215 +        (long *)_vq_lengthlist__44u6__p5_0,
137.5216 +        1, -531628032, 1611661312, 4, 0,
137.5217 +        (long *)_vq_quantlist__44u6__p5_0,
137.5218 +        0
137.5219 +};
137.5220 +
137.5221 +static const long _vq_quantlist__44u6__p6_0[] = {
137.5222 +        4,
137.5223 +        3,
137.5224 +        5,
137.5225 +        2,
137.5226 +        6,
137.5227 +        1,
137.5228 +        7,
137.5229 +        0,
137.5230 +        8,
137.5231 +};
137.5232 +
137.5233 +static const long _vq_lengthlist__44u6__p6_0[] = {
137.5234 +         3, 4, 4, 5, 5, 7, 7, 9, 9, 4, 5, 4, 6, 6, 7, 7,
137.5235 +         9, 9, 4, 4, 5, 6, 6, 7, 8, 9, 9, 5, 6, 6, 7, 7,
137.5236 +         8, 8,10,10, 5, 6, 6, 7, 7, 8, 8,10,10, 7, 8, 7,
137.5237 +         8, 8,10, 9,11,11, 7, 7, 8, 8, 8, 9,10,10,11, 9,
137.5238 +         9, 9,10,10,11,11,12,11, 9, 9, 9,10,10,11,11,11,
137.5239 +        12,
137.5240 +};
137.5241 +
137.5242 +static const static_codebook _44u6__p6_0 = {
137.5243 +        2, 81,
137.5244 +        (long *)_vq_lengthlist__44u6__p6_0,
137.5245 +        1, -531628032, 1611661312, 4, 0,
137.5246 +        (long *)_vq_quantlist__44u6__p6_0,
137.5247 +        0
137.5248 +};
137.5249 +
137.5250 +static const long _vq_quantlist__44u6__p7_0[] = {
137.5251 +        1,
137.5252 +        0,
137.5253 +        2,
137.5254 +};
137.5255 +
137.5256 +static const long _vq_lengthlist__44u6__p7_0[] = {
137.5257 +         1, 4, 4, 5, 7, 7, 5, 7, 7, 5, 9, 8, 7,10,10, 8,
137.5258 +        10,10, 5, 8, 9, 7,10,10, 7,10, 9, 4, 8, 8, 9,11,
137.5259 +        11, 8,11,11, 7,11,11,10,10,13,10,13,13, 7,11,11,
137.5260 +        10,13,12,10,13,13, 5, 9, 8, 8,11,11, 9,11,11, 7,
137.5261 +        11,11,10,13,13,10,12,13, 7,11,11,10,13,13, 9,13,
137.5262 +        10,
137.5263 +};
137.5264 +
137.5265 +static const static_codebook _44u6__p7_0 = {
137.5266 +        4, 81,
137.5267 +        (long *)_vq_lengthlist__44u6__p7_0,
137.5268 +        1, -529137664, 1618345984, 2, 0,
137.5269 +        (long *)_vq_quantlist__44u6__p7_0,
137.5270 +        0
137.5271 +};
137.5272 +
137.5273 +static const long _vq_quantlist__44u6__p7_1[] = {
137.5274 +        5,
137.5275 +        4,
137.5276 +        6,
137.5277 +        3,
137.5278 +        7,
137.5279 +        2,
137.5280 +        8,
137.5281 +        1,
137.5282 +        9,
137.5283 +        0,
137.5284 +        10,
137.5285 +};
137.5286 +
137.5287 +static const long _vq_lengthlist__44u6__p7_1[] = {
137.5288 +         3, 4, 4, 6, 6, 7, 7, 8, 8, 8, 8, 4, 5, 5, 7, 6,
137.5289 +         8, 8, 8, 8, 8, 8, 4, 5, 5, 6, 7, 8, 8, 8, 8, 8,
137.5290 +         8, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 6, 7, 7, 7,
137.5291 +         7, 8, 8, 8, 8, 8, 8, 7, 8, 8, 8, 8, 8, 8, 9, 9,
137.5292 +         9, 9, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 8, 8, 8,
137.5293 +         8, 8, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 9, 9, 9,
137.5294 +         9, 9, 9, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 8, 8,
137.5295 +         8, 8, 8, 9, 9, 9, 9, 9, 9,
137.5296 +};
137.5297 +
137.5298 +static const static_codebook _44u6__p7_1 = {
137.5299 +        2, 121,
137.5300 +        (long *)_vq_lengthlist__44u6__p7_1,
137.5301 +        1, -531365888, 1611661312, 4, 0,
137.5302 +        (long *)_vq_quantlist__44u6__p7_1,
137.5303 +        0
137.5304 +};
137.5305 +
137.5306 +static const long _vq_quantlist__44u6__p8_0[] = {
137.5307 +        5,
137.5308 +        4,
137.5309 +        6,
137.5310 +        3,
137.5311 +        7,
137.5312 +        2,
137.5313 +        8,
137.5314 +        1,
137.5315 +        9,
137.5316 +        0,
137.5317 +        10,
137.5318 +};
137.5319 +
137.5320 +static const long _vq_lengthlist__44u6__p8_0[] = {
137.5321 +         1, 4, 4, 6, 6, 8, 8, 9, 9,10,10, 4, 6, 6, 7, 7,
137.5322 +         9, 9,10,10,11,11, 4, 6, 6, 7, 7, 9, 9,10,10,11,
137.5323 +        11, 6, 8, 8, 9, 9,10,10,11,11,12,12, 6, 8, 8, 9,
137.5324 +         9,10,10,11,11,12,12, 8, 9, 9,10,10,11,11,12,12,
137.5325 +        13,13, 8, 9, 9,10,10,11,11,12,12,13,13,10,10,10,
137.5326 +        11,11,13,13,13,13,15,14, 9,10,10,12,11,12,13,13,
137.5327 +        13,14,15,11,12,12,13,13,13,13,15,14,15,15,11,11,
137.5328 +        12,13,13,14,14,14,15,15,15,
137.5329 +};
137.5330 +
137.5331 +static const static_codebook _44u6__p8_0 = {
137.5332 +        2, 121,
137.5333 +        (long *)_vq_lengthlist__44u6__p8_0,
137.5334 +        1, -524582912, 1618345984, 4, 0,
137.5335 +        (long *)_vq_quantlist__44u6__p8_0,
137.5336 +        0
137.5337 +};
137.5338 +
137.5339 +static const long _vq_quantlist__44u6__p8_1[] = {
137.5340 +        5,
137.5341 +        4,
137.5342 +        6,
137.5343 +        3,
137.5344 +        7,
137.5345 +        2,
137.5346 +        8,
137.5347 +        1,
137.5348 +        9,
137.5349 +        0,
137.5350 +        10,
137.5351 +};
137.5352 +
137.5353 +static const long _vq_lengthlist__44u6__p8_1[] = {
137.5354 +         3, 5, 5, 6, 6, 7, 7, 7, 7, 7, 7, 5, 6, 5, 7, 7,
137.5355 +         7, 7, 8, 7, 8, 8, 5, 5, 6, 6, 7, 7, 7, 7, 7, 8,
137.5356 +         8, 6, 7, 7, 7, 7, 8, 7, 8, 8, 8, 8, 6, 6, 7, 7,
137.5357 +         7, 7, 8, 8, 8, 8, 8, 7, 7, 7, 8, 8, 8, 8, 8, 8,
137.5358 +         8, 8, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7,
137.5359 +         8, 8, 8, 8, 8, 8, 8, 8, 7, 8, 8, 8, 8, 8, 8, 8,
137.5360 +         8, 8, 8, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 8,
137.5361 +         8, 8, 8, 8, 8, 8, 8, 8, 8,
137.5362 +};
137.5363 +
137.5364 +static const static_codebook _44u6__p8_1 = {
137.5365 +        2, 121,
137.5366 +        (long *)_vq_lengthlist__44u6__p8_1,
137.5367 +        1, -531365888, 1611661312, 4, 0,
137.5368 +        (long *)_vq_quantlist__44u6__p8_1,
137.5369 +        0
137.5370 +};
137.5371 +
137.5372 +static const long _vq_quantlist__44u6__p9_0[] = {
137.5373 +        7,
137.5374 +        6,
137.5375 +        8,
137.5376 +        5,
137.5377 +        9,
137.5378 +        4,
137.5379 +        10,
137.5380 +        3,
137.5381 +        11,
137.5382 +        2,
137.5383 +        12,
137.5384 +        1,
137.5385 +        13,
137.5386 +        0,
137.5387 +        14,
137.5388 +};
137.5389 +
137.5390 +static const long _vq_lengthlist__44u6__p9_0[] = {
137.5391 +         1, 3, 2, 9, 8,15,15,15,15,15,15,15,15,15,15, 4,
137.5392 +         8, 9,13,14,14,14,14,14,14,14,14,14,14,14, 5, 8,
137.5393 +         9,14,14,14,14,14,14,14,14,14,14,14,14,11,14,14,
137.5394 +        14,14,14,14,14,14,14,14,14,14,14,14,11,14,14,14,
137.5395 +        14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
137.5396 +        14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
137.5397 +        14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
137.5398 +        14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
137.5399 +        14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
137.5400 +        14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
137.5401 +        14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
137.5402 +        14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
137.5403 +        14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
137.5404 +        14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
137.5405 +        14,
137.5406 +};
137.5407 +
137.5408 +static const static_codebook _44u6__p9_0 = {
137.5409 +        2, 225,
137.5410 +        (long *)_vq_lengthlist__44u6__p9_0,
137.5411 +        1, -514071552, 1627381760, 4, 0,
137.5412 +        (long *)_vq_quantlist__44u6__p9_0,
137.5413 +        0
137.5414 +};
137.5415 +
137.5416 +static const long _vq_quantlist__44u6__p9_1[] = {
137.5417 +        7,
137.5418 +        6,
137.5419 +        8,
137.5420 +        5,
137.5421 +        9,
137.5422 +        4,
137.5423 +        10,
137.5424 +        3,
137.5425 +        11,
137.5426 +        2,
137.5427 +        12,
137.5428 +        1,
137.5429 +        13,
137.5430 +        0,
137.5431 +        14,
137.5432 +};
137.5433 +
137.5434 +static const long _vq_lengthlist__44u6__p9_1[] = {
137.5435 +         1, 4, 4, 7, 7, 8, 9, 8, 8, 9, 8, 9, 8, 9, 9, 4,
137.5436 +         7, 6, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 4, 7,
137.5437 +         6, 9, 9,10,10, 9, 9,10,10,10,10,11,11, 7, 9, 8,
137.5438 +        10,10,11,11,10,10,11,11,11,11,11,11, 7, 8, 9,10,
137.5439 +        10,11,11,10,10,11,11,11,11,11,12, 8,10,10,11,11,
137.5440 +        12,12,11,11,12,12,12,12,13,12, 8,10,10,11,11,12,
137.5441 +        11,11,11,11,12,12,12,12,13, 8, 9, 9,11,10,11,11,
137.5442 +        12,12,12,12,13,12,13,12, 8, 9, 9,11,11,11,11,12,
137.5443 +        12,12,12,12,13,13,13, 9,10,10,11,12,12,12,12,12,
137.5444 +        13,13,13,13,13,13, 9,10,10,11,11,12,12,12,12,13,
137.5445 +        13,13,13,14,13,10,10,10,12,11,12,12,13,13,13,13,
137.5446 +        13,13,13,13,10,10,11,11,11,12,12,13,13,13,13,13,
137.5447 +        13,13,13,10,11,11,12,12,13,12,12,13,13,13,13,13,
137.5448 +        13,14,10,11,11,12,12,13,12,13,13,13,14,13,13,14,
137.5449 +        13,
137.5450 +};
137.5451 +
137.5452 +static const static_codebook _44u6__p9_1 = {
137.5453 +        2, 225,
137.5454 +        (long *)_vq_lengthlist__44u6__p9_1,
137.5455 +        1, -522338304, 1620115456, 4, 0,
137.5456 +        (long *)_vq_quantlist__44u6__p9_1,
137.5457 +        0
137.5458 +};
137.5459 +
137.5460 +static const long _vq_quantlist__44u6__p9_2[] = {
137.5461 +        8,
137.5462 +        7,
137.5463 +        9,
137.5464 +        6,
137.5465 +        10,
137.5466 +        5,
137.5467 +        11,
137.5468 +        4,
137.5469 +        12,
137.5470 +        3,
137.5471 +        13,
137.5472 +        2,
137.5473 +        14,
137.5474 +        1,
137.5475 +        15,
137.5476 +        0,
137.5477 +        16,
137.5478 +};
137.5479 +
137.5480 +static const long _vq_lengthlist__44u6__p9_2[] = {
137.5481 +         3, 5, 5, 7, 7, 8, 8, 8, 8, 8, 8, 9, 8, 8, 9, 9,
137.5482 +         9, 5, 6, 6, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9,
137.5483 +         9, 9, 5, 6, 6, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9,
137.5484 +         9, 9, 9, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9,
137.5485 +         9, 9, 9, 9, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9,
137.5486 +         9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9,
137.5487 +         9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9,
137.5488 +         9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 9, 9, 9, 9, 9, 9,
137.5489 +         9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 9, 9, 9, 9, 9,
137.5490 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 9, 9, 9, 9, 9, 9,
137.5491 +         9, 9, 9, 9, 9, 9, 9, 9,10, 9, 8, 9, 9, 9, 9, 9,
137.5492 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
137.5493 +         9, 9, 9, 9, 9, 9, 9, 9, 9,10,10, 9, 9, 9, 9, 9,
137.5494 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,10, 9, 9, 9,
137.5495 +         9, 9, 9, 9, 9, 9, 9, 9,10, 9, 9, 9,10, 9, 9, 9,
137.5496 +         9, 9, 9, 9, 9, 9, 9,10, 9, 9, 9,10, 9, 9,10, 9,
137.5497 +         9, 9, 9, 9, 9, 9, 9, 9,10,10,10, 9,10, 9,10,10,
137.5498 +         9, 9, 9, 9, 9, 9, 9, 9, 9,10,10, 9,10,10, 9, 9,
137.5499 +        10,
137.5500 +};
137.5501 +
137.5502 +static const static_codebook _44u6__p9_2 = {
137.5503 +        2, 289,
137.5504 +        (long *)_vq_lengthlist__44u6__p9_2,
137.5505 +        1, -529530880, 1611661312, 5, 0,
137.5506 +        (long *)_vq_quantlist__44u6__p9_2,
137.5507 +        0
137.5508 +};
137.5509 +
137.5510 +static const long _huff_lengthlist__44u6__short[] = {
137.5511 +         4,11,16,13,17,13,17,16,17,17, 4, 7, 9, 9,13,10,
137.5512 +        16,12,16,17, 7, 6, 5, 7, 8, 9,12,12,16,17, 6, 9,
137.5513 +         7, 9,10,10,15,15,17,17, 6, 7, 5, 7, 5, 7, 7,10,
137.5514 +        16,17, 7, 9, 8, 9, 8,10,11,11,15,17, 7, 7, 7, 8,
137.5515 +         5, 8, 8, 9,15,17, 8, 7, 9, 9, 7, 8, 7, 2, 7,15,
137.5516 +        14,13,13,15, 5,10, 4, 3, 6,17,17,15,13,17, 7,11,
137.5517 +         7, 6, 9,16,
137.5518 +};
137.5519 +
137.5520 +static const static_codebook _huff_book__44u6__short = {
137.5521 +        2, 100,
137.5522 +        (long *)_huff_lengthlist__44u6__short,
137.5523 +        0, 0, 0, 0, 0,
137.5524 +        NULL,
137.5525 +        0
137.5526 +};
137.5527 +
137.5528 +static const long _huff_lengthlist__44u7__long[] = {
137.5529 +         3, 9,14,13,15,14,16,13,13,14, 5, 5, 7, 7, 8, 9,
137.5530 +        11,10,12,15,10, 6, 5, 6, 6, 9,10,10,13,16,10, 6,
137.5531 +         6, 6, 6, 8, 9, 9,12,15,14, 7, 6, 6, 5, 6, 6, 8,
137.5532 +        12,15,10, 8, 7, 7, 6, 7, 7, 7,11,13,14,10, 9, 8,
137.5533 +         5, 6, 4, 5, 9,12,10, 9, 9, 8, 6, 6, 5, 3, 6,11,
137.5534 +        12,11,12,12,10, 9, 8, 5, 5, 8,10,11,15,13,13,13,
137.5535 +        12, 8, 6, 7,
137.5536 +};
137.5537 +
137.5538 +static const static_codebook _huff_book__44u7__long = {
137.5539 +        2, 100,
137.5540 +        (long *)_huff_lengthlist__44u7__long,
137.5541 +        0, 0, 0, 0, 0,
137.5542 +        NULL,
137.5543 +        0
137.5544 +};
137.5545 +
137.5546 +static const long _vq_quantlist__44u7__p1_0[] = {
137.5547 +        1,
137.5548 +        0,
137.5549 +        2,
137.5550 +};
137.5551 +
137.5552 +static const long _vq_lengthlist__44u7__p1_0[] = {
137.5553 +         1, 4, 4, 4, 7, 7, 5, 7, 7, 5, 8, 8, 8,10,10, 7,
137.5554 +        10,10, 5, 8, 8, 7,10,10, 8,10,10, 5, 8, 8, 8,11,
137.5555 +        10, 8,10,10, 8,10,10,10,12,13,10,13,13, 7,10,10,
137.5556 +        10,13,12,10,13,13, 5, 8, 8, 8,11,10, 8,10,11, 7,
137.5557 +        10,10,10,13,13,10,12,13, 8,11,11,10,13,13,10,13,
137.5558 +        12,
137.5559 +};
137.5560 +
137.5561 +static const static_codebook _44u7__p1_0 = {
137.5562 +        4, 81,
137.5563 +        (long *)_vq_lengthlist__44u7__p1_0,
137.5564 +        1, -535822336, 1611661312, 2, 0,
137.5565 +        (long *)_vq_quantlist__44u7__p1_0,
137.5566 +        0
137.5567 +};
137.5568 +
137.5569 +static const long _vq_quantlist__44u7__p2_0[] = {
137.5570 +        1,
137.5571 +        0,
137.5572 +        2,
137.5573 +};
137.5574 +
137.5575 +static const long _vq_lengthlist__44u7__p2_0[] = {
137.5576 +         3, 4, 4, 5, 6, 6, 5, 6, 6, 5, 6, 6, 6, 8, 8, 6,
137.5577 +         7, 8, 5, 6, 6, 6, 8, 7, 6, 8, 8, 5, 6, 6, 6, 8,
137.5578 +         7, 6, 8, 8, 6, 8, 8, 8, 9, 9, 8, 9, 9, 6, 8, 7,
137.5579 +         7, 9, 8, 8, 9, 9, 5, 6, 6, 6, 8, 7, 6, 8, 8, 6,
137.5580 +         8, 8, 8, 9, 9, 7, 8, 9, 6, 8, 8, 8, 9, 9, 8, 9,
137.5581 +         9,
137.5582 +};
137.5583 +
137.5584 +static const static_codebook _44u7__p2_0 = {
137.5585 +        4, 81,
137.5586 +        (long *)_vq_lengthlist__44u7__p2_0,
137.5587 +        1, -535822336, 1611661312, 2, 0,
137.5588 +        (long *)_vq_quantlist__44u7__p2_0,
137.5589 +        0
137.5590 +};
137.5591 +
137.5592 +static const long _vq_quantlist__44u7__p3_0[] = {
137.5593 +        2,
137.5594 +        1,
137.5595 +        3,
137.5596 +        0,
137.5597 +        4,
137.5598 +};
137.5599 +
137.5600 +static const long _vq_lengthlist__44u7__p3_0[] = {
137.5601 +         2, 5, 4, 8, 8, 5, 7, 6, 9, 9, 5, 6, 7, 9, 9, 8,
137.5602 +         9, 9,13,12, 8, 9,10,12,13, 5, 7, 7,10, 9, 7, 9,
137.5603 +         9,11,11, 6, 8, 9,11,11,10,11,11,14,14, 9,10,11,
137.5604 +        13,14, 5, 7, 7, 9, 9, 7, 9, 8,11,11, 7, 9, 9,11,
137.5605 +        11, 9,11,10,14,13,10,11,11,14,14, 8,10,10,14,13,
137.5606 +        10,11,12,15,14, 9,11,11,15,14,13,14,14,16,16,12,
137.5607 +        13,14,17,16, 8,10,10,13,13, 9,11,11,14,15,10,11,
137.5608 +        12,14,15,12,14,13,16,16,13,14,15,15,17, 5, 7, 7,
137.5609 +        10,10, 7, 9, 9,11,11, 7, 9, 9,11,11,10,12,11,15,
137.5610 +        14,10,11,12,14,14, 7, 9, 9,12,12, 9,11,11,13,13,
137.5611 +         9,11,11,13,13,11,13,13,14,17,11,13,13,15,16, 6,
137.5612 +         9, 9,11,11, 8,11,10,13,12, 9,11,11,13,13,11,13,
137.5613 +        12,16,14,11,13,13,16,16,10,12,12,15,15,11,13,13,
137.5614 +        16,16,11,13,13,16,15,14,16,17,17,19,14,16,16,18,
137.5615 +         0, 9,11,11,14,15,10,13,12,16,15,11,13,13,16,16,
137.5616 +        14,15,14, 0,16,14,16,16,18, 0, 5, 7, 7,10,10, 7,
137.5617 +         9, 9,12,11, 7, 9, 9,11,12,10,11,11,15,14,10,11,
137.5618 +        12,14,14, 6, 9, 9,11,11, 9,11,11,13,13, 8,10,11,
137.5619 +        12,13,11,13,13,17,15,11,12,13,14,15, 7, 9, 9,11,
137.5620 +        12, 9,11,11,13,13, 9,11,11,13,13,11,13,12,16,16,
137.5621 +        11,13,13,15,14, 9,11,11,14,15,11,13,13,16,15,10,
137.5622 +        12,13,16,16,15,16,16, 0, 0,14,13,15,16,18,10,11,
137.5623 +        11,15,15,11,13,14,16,18,11,13,13,16,15,15,16,16,
137.5624 +        19, 0,14,15,15,16,16, 8,10,10,13,13,10,12,11,16,
137.5625 +        15,10,11,11,16,15,13,15,16,18, 0,13,14,15,17,17,
137.5626 +         9,11,11,15,15,11,13,13,16,18,11,13,13,16,17,15,
137.5627 +        16,16, 0, 0,15,18,16, 0,17, 9,11,11,15,15,11,13,
137.5628 +        12,17,15,11,13,14,16,17,15,18,15, 0,17,15,16,16,
137.5629 +        18,19,13,15,14, 0,18,14,16,16,19,18,14,16,15,19,
137.5630 +        19,16,18,19, 0, 0,16,17, 0, 0, 0,12,14,14,17,17,
137.5631 +        13,16,14, 0,18,14,16,15,18, 0,16,18,16,19,17,18,
137.5632 +        19,17, 0, 0, 8,10,10,14,14, 9,12,11,15,15,10,11,
137.5633 +        12,15,17,13,15,15,18,16,14,16,15,18,17, 9,11,11,
137.5634 +        16,15,11,13,13, 0,16,11,12,13,16,15,15,16,16, 0,
137.5635 +        17,15,15,16,18,17, 9,12,11,15,17,11,13,13,16,16,
137.5636 +        11,14,13,16,16,15,15,16,18,19,16,18,16, 0, 0,12,
137.5637 +        14,14, 0,16,14,16,16, 0,18,13,14,15,16, 0,17,16,
137.5638 +        18, 0, 0,16,16,17,19, 0,13,14,14,17, 0,14,17,16,
137.5639 +         0,19,14,15,15,18,19,17,16,18, 0, 0,15,19,16, 0,
137.5640 +         0,
137.5641 +};
137.5642 +
137.5643 +static const static_codebook _44u7__p3_0 = {
137.5644 +        4, 625,
137.5645 +        (long *)_vq_lengthlist__44u7__p3_0,
137.5646 +        1, -533725184, 1611661312, 3, 0,
137.5647 +        (long *)_vq_quantlist__44u7__p3_0,
137.5648 +        0
137.5649 +};
137.5650 +
137.5651 +static const long _vq_quantlist__44u7__p4_0[] = {
137.5652 +        2,
137.5653 +        1,
137.5654 +        3,
137.5655 +        0,
137.5656 +        4,
137.5657 +};
137.5658 +
137.5659 +static const long _vq_lengthlist__44u7__p4_0[] = {
137.5660 +         4, 5, 5, 8, 8, 6, 7, 6, 9, 9, 6, 6, 7, 9, 9, 8,
137.5661 +         9, 9,11,11, 8, 9, 9,10,11, 6, 7, 7, 9, 9, 7, 8,
137.5662 +         8,10,10, 6, 7, 8, 9,10, 9,10,10,12,12, 9, 9,10,
137.5663 +        11,12, 6, 7, 7, 9, 9, 6, 8, 7,10, 9, 7, 8, 8,10,
137.5664 +        10, 9,10, 9,12,11, 9,10,10,12,11, 8, 9, 9,11,11,
137.5665 +         9,10,10,12,12, 9,10,10,12,12,11,12,12,13,14,11,
137.5666 +        11,12,13,13, 8, 9, 9,11,11, 9,10,10,12,11, 9,10,
137.5667 +        10,12,12,11,12,11,13,13,11,12,12,13,13, 6, 7, 7,
137.5668 +         9, 9, 7, 8, 7,10,10, 7, 7, 8,10,10, 9,10,10,12,
137.5669 +        11, 9,10,10,12,12, 7, 8, 8,10,10, 8, 8, 9,11,11,
137.5670 +         8, 9, 9,11,11,10,11,11,12,12,10,10,11,12,13, 6,
137.5671 +         7, 7,10,10, 7, 9, 8,11,10, 8, 8, 9,10,11,10,11,
137.5672 +        10,13,11,10,11,11,12,12, 9,10,10,12,12,10,10,11,
137.5673 +        13,13,10,11,11,13,12,12,12,13,13,14,12,12,13,14,
137.5674 +        14, 9,10,10,12,12, 9,10,10,12,12,10,11,11,13,13,
137.5675 +        11,12,11,14,12,12,13,13,14,14, 6, 7, 7, 9, 9, 7,
137.5676 +         8, 7,10,10, 7, 7, 8,10,10, 9,10,10,12,11, 9,10,
137.5677 +        10,11,12, 6, 7, 7,10,10, 8, 9, 8,11,10, 7, 8, 9,
137.5678 +        10,11,10,11,11,13,12,10,10,11,11,13, 7, 8, 8,10,
137.5679 +        10, 8, 9, 9,11,11, 8, 9, 9,11,11,10,11,10,13,12,
137.5680 +        10,11,11,12,12, 9,10,10,12,12,10,11,11,13,12, 9,
137.5681 +        10,10,12,13,12,13,12,14,14,11,11,12,12,14, 9,10,
137.5682 +        10,12,12,10,11,11,13,13,10,11,11,13,13,12,13,12,
137.5683 +        14,14,12,13,12,14,13, 8, 9, 9,11,11, 9,10,10,12,
137.5684 +        12, 9,10,10,12,12,11,12,12,14,13,11,12,12,13,13,
137.5685 +         9,10,10,12,12,10,11,11,13,13,10,11,11,13,12,12,
137.5686 +        13,13,14,14,12,12,13,14,14, 9,10,10,12,12, 9,11,
137.5687 +        10,13,12,10,10,11,12,13,11,13,12,14,13,12,12,13,
137.5688 +        14,14,11,12,12,13,13,11,12,13,14,14,12,13,13,14,
137.5689 +        14,13,13,14,14,16,13,14,14,16,16,11,11,11,13,13,
137.5690 +        11,12,11,14,13,12,12,13,14,15,13,14,12,16,13,14,
137.5691 +        14,14,15,16, 8, 9, 9,11,11, 9,10,10,12,12, 9,10,
137.5692 +        10,12,12,11,12,12,14,13,11,12,12,13,14, 9,10,10,
137.5693 +        12,12,10,11,10,13,12, 9,10,11,12,13,12,13,12,14,
137.5694 +        14,12,12,13,13,14, 9,10,10,12,12,10,11,11,12,13,
137.5695 +        10,11,11,13,13,12,13,12,14,14,12,13,13,14,14,11,
137.5696 +        12,12,13,13,12,13,12,14,14,11,11,12,13,14,13,15,
137.5697 +        14,16,15,13,12,14,13,16,11,12,12,13,13,12,13,13,
137.5698 +        14,14,12,12,12,14,14,13,14,14,15,15,13,14,13,16,
137.5699 +        14,
137.5700 +};
137.5701 +
137.5702 +static const static_codebook _44u7__p4_0 = {
137.5703 +        4, 625,
137.5704 +        (long *)_vq_lengthlist__44u7__p4_0,
137.5705 +        1, -533725184, 1611661312, 3, 0,
137.5706 +        (long *)_vq_quantlist__44u7__p4_0,
137.5707 +        0
137.5708 +};
137.5709 +
137.5710 +static const long _vq_quantlist__44u7__p5_0[] = {
137.5711 +        4,
137.5712 +        3,
137.5713 +        5,
137.5714 +        2,
137.5715 +        6,
137.5716 +        1,
137.5717 +        7,
137.5718 +        0,
137.5719 +        8,
137.5720 +};
137.5721 +
137.5722 +static const long _vq_lengthlist__44u7__p5_0[] = {
137.5723 +         2, 3, 3, 6, 6, 7, 8,10,10, 4, 5, 5, 8, 7, 8, 8,
137.5724 +        11,11, 3, 5, 5, 7, 7, 8, 9,11,11, 6, 8, 7, 9, 9,
137.5725 +        10,10,12,12, 6, 7, 8, 9,10,10,10,12,12, 8, 8, 8,
137.5726 +        10,10,12,11,13,13, 8, 8, 9,10,10,11,11,13,13,10,
137.5727 +        11,11,12,12,13,13,14,14,10,11,11,12,12,13,13,14,
137.5728 +        14,
137.5729 +};
137.5730 +
137.5731 +static const static_codebook _44u7__p5_0 = {
137.5732 +        2, 81,
137.5733 +        (long *)_vq_lengthlist__44u7__p5_0,
137.5734 +        1, -531628032, 1611661312, 4, 0,
137.5735 +        (long *)_vq_quantlist__44u7__p5_0,
137.5736 +        0
137.5737 +};
137.5738 +
137.5739 +static const long _vq_quantlist__44u7__p6_0[] = {
137.5740 +        4,
137.5741 +        3,
137.5742 +        5,
137.5743 +        2,
137.5744 +        6,
137.5745 +        1,
137.5746 +        7,
137.5747 +        0,
137.5748 +        8,
137.5749 +};
137.5750 +
137.5751 +static const long _vq_lengthlist__44u7__p6_0[] = {
137.5752 +         3, 4, 4, 5, 5, 7, 7, 9, 9, 4, 5, 4, 6, 6, 8, 7,
137.5753 +         9, 9, 4, 4, 5, 6, 6, 7, 7, 9, 9, 5, 6, 6, 7, 7,
137.5754 +         8, 8,10,10, 5, 6, 6, 7, 7, 8, 8,10,10, 7, 8, 7,
137.5755 +         8, 8,10, 9,11,11, 7, 7, 8, 8, 8, 9,10,11,11, 9,
137.5756 +         9, 9,10,10,11,10,12,11, 9, 9, 9,10,10,11,11,11,
137.5757 +        12,
137.5758 +};
137.5759 +
137.5760 +static const static_codebook _44u7__p6_0 = {
137.5761 +        2, 81,
137.5762 +        (long *)_vq_lengthlist__44u7__p6_0,
137.5763 +        1, -531628032, 1611661312, 4, 0,
137.5764 +        (long *)_vq_quantlist__44u7__p6_0,
137.5765 +        0
137.5766 +};
137.5767 +
137.5768 +static const long _vq_quantlist__44u7__p7_0[] = {
137.5769 +        1,
137.5770 +        0,
137.5771 +        2,
137.5772 +};
137.5773 +
137.5774 +static const long _vq_lengthlist__44u7__p7_0[] = {
137.5775 +         1, 4, 4, 5, 7, 7, 5, 7, 7, 5, 9, 8, 8, 9, 9, 7,
137.5776 +        10,10, 5, 8, 9, 7, 9,10, 8, 9, 9, 4, 9, 9, 9,11,
137.5777 +        10, 8,10,10, 7,11,10,10,10,12,10,12,12, 7,10,10,
137.5778 +        10,12,11,10,12,12, 5, 9, 9, 8,10,10, 9,11,11, 7,
137.5779 +        11,10,10,12,12,10,11,12, 7,10,11,10,12,12,10,12,
137.5780 +        10,
137.5781 +};
137.5782 +
137.5783 +static const static_codebook _44u7__p7_0 = {
137.5784 +        4, 81,
137.5785 +        (long *)_vq_lengthlist__44u7__p7_0,
137.5786 +        1, -529137664, 1618345984, 2, 0,
137.5787 +        (long *)_vq_quantlist__44u7__p7_0,
137.5788 +        0
137.5789 +};
137.5790 +
137.5791 +static const long _vq_quantlist__44u7__p7_1[] = {
137.5792 +        5,
137.5793 +        4,
137.5794 +        6,
137.5795 +        3,
137.5796 +        7,
137.5797 +        2,
137.5798 +        8,
137.5799 +        1,
137.5800 +        9,
137.5801 +        0,
137.5802 +        10,
137.5803 +};
137.5804 +
137.5805 +static const long _vq_lengthlist__44u7__p7_1[] = {
137.5806 +         3, 4, 4, 6, 6, 7, 7, 8, 8, 8, 8, 4, 5, 5, 6, 6,
137.5807 +         8, 7, 8, 8, 8, 8, 4, 5, 5, 6, 6, 7, 8, 8, 8, 8,
137.5808 +         8, 6, 7, 6, 7, 7, 8, 8, 9, 9, 9, 9, 6, 6, 7, 7,
137.5809 +         7, 8, 8, 9, 9, 9, 9, 7, 8, 7, 8, 8, 9, 9, 9, 9,
137.5810 +         9, 9, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9, 9, 8, 8, 8,
137.5811 +         9, 9, 9, 9,10, 9, 9, 9, 8, 8, 8, 9, 9, 9, 9, 9,
137.5812 +         9, 9,10, 8, 8, 8, 9, 9, 9, 9,10, 9,10,10, 8, 8,
137.5813 +         8, 9, 9, 9, 9, 9,10,10,10,
137.5814 +};
137.5815 +
137.5816 +static const static_codebook _44u7__p7_1 = {
137.5817 +        2, 121,
137.5818 +        (long *)_vq_lengthlist__44u7__p7_1,
137.5819 +        1, -531365888, 1611661312, 4, 0,
137.5820 +        (long *)_vq_quantlist__44u7__p7_1,
137.5821 +        0
137.5822 +};
137.5823 +
137.5824 +static const long _vq_quantlist__44u7__p8_0[] = {
137.5825 +        5,
137.5826 +        4,
137.5827 +        6,
137.5828 +        3,
137.5829 +        7,
137.5830 +        2,
137.5831 +        8,
137.5832 +        1,
137.5833 +        9,
137.5834 +        0,
137.5835 +        10,
137.5836 +};
137.5837 +
137.5838 +static const long _vq_lengthlist__44u7__p8_0[] = {
137.5839 +         1, 4, 4, 6, 6, 8, 8,10,10,11,11, 4, 6, 6, 7, 7,
137.5840 +         9, 9,11,10,12,12, 5, 6, 5, 7, 7, 9, 9,10,11,12,
137.5841 +        12, 6, 7, 7, 8, 8,10,10,11,11,13,13, 6, 7, 7, 8,
137.5842 +         8,10,10,11,12,13,13, 8, 9, 9,10,10,11,11,12,12,
137.5843 +        14,14, 8, 9, 9,10,10,11,11,12,12,14,14,10,10,10,
137.5844 +        11,11,13,12,14,14,15,15,10,10,10,12,12,13,13,14,
137.5845 +        14,15,15,11,12,12,13,13,14,14,15,14,16,15,11,12,
137.5846 +        12,13,13,14,14,15,15,15,16,
137.5847 +};
137.5848 +
137.5849 +static const static_codebook _44u7__p8_0 = {
137.5850 +        2, 121,
137.5851 +        (long *)_vq_lengthlist__44u7__p8_0,
137.5852 +        1, -524582912, 1618345984, 4, 0,
137.5853 +        (long *)_vq_quantlist__44u7__p8_0,
137.5854 +        0
137.5855 +};
137.5856 +
137.5857 +static const long _vq_quantlist__44u7__p8_1[] = {
137.5858 +        5,
137.5859 +        4,
137.5860 +        6,
137.5861 +        3,
137.5862 +        7,
137.5863 +        2,
137.5864 +        8,
137.5865 +        1,
137.5866 +        9,
137.5867 +        0,
137.5868 +        10,
137.5869 +};
137.5870 +
137.5871 +static const long _vq_lengthlist__44u7__p8_1[] = {
137.5872 +         4, 5, 5, 6, 6, 7, 7, 7, 7, 7, 7, 5, 6, 6, 7, 7,
137.5873 +         7, 7, 7, 7, 7, 7, 5, 6, 6, 6, 7, 7, 7, 7, 7, 7,
137.5874 +         7, 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 6, 7, 7, 7,
137.5875 +         7, 7, 7, 7, 7, 8, 8, 7, 7, 7, 7, 7, 8, 7, 8, 8,
137.5876 +         8, 8, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 7, 7, 7,
137.5877 +         7, 7, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 8, 8, 8,
137.5878 +         8, 8, 8, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7,
137.5879 +         7, 8, 8, 8, 8, 8, 8, 8, 8,
137.5880 +};
137.5881 +
137.5882 +static const static_codebook _44u7__p8_1 = {
137.5883 +        2, 121,
137.5884 +        (long *)_vq_lengthlist__44u7__p8_1,
137.5885 +        1, -531365888, 1611661312, 4, 0,
137.5886 +        (long *)_vq_quantlist__44u7__p8_1,
137.5887 +        0
137.5888 +};
137.5889 +
137.5890 +static const long _vq_quantlist__44u7__p9_0[] = {
137.5891 +        5,
137.5892 +        4,
137.5893 +        6,
137.5894 +        3,
137.5895 +        7,
137.5896 +        2,
137.5897 +        8,
137.5898 +        1,
137.5899 +        9,
137.5900 +        0,
137.5901 +        10,
137.5902 +};
137.5903 +
137.5904 +static const long _vq_lengthlist__44u7__p9_0[] = {
137.5905 +         1, 3, 3,10,10,10,10,10,10,10,10, 4,10,10,10,10,
137.5906 +        10,10,10,10,10,10, 4,10,10,10,10,10,10,10,10,10,
137.5907 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
137.5908 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
137.5909 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
137.5910 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
137.5911 +        10,10,10,10,10,10,10,10,10,10,10,10,10, 9, 9, 9,
137.5912 +         9, 9, 9, 9, 9, 9, 9, 9, 9,
137.5913 +};
137.5914 +
137.5915 +static const static_codebook _44u7__p9_0 = {
137.5916 +        2, 121,
137.5917 +        (long *)_vq_lengthlist__44u7__p9_0,
137.5918 +        1, -512171520, 1630791680, 4, 0,
137.5919 +        (long *)_vq_quantlist__44u7__p9_0,
137.5920 +        0
137.5921 +};
137.5922 +
137.5923 +static const long _vq_quantlist__44u7__p9_1[] = {
137.5924 +        6,
137.5925 +        5,
137.5926 +        7,
137.5927 +        4,
137.5928 +        8,
137.5929 +        3,
137.5930 +        9,
137.5931 +        2,
137.5932 +        10,
137.5933 +        1,
137.5934 +        11,
137.5935 +        0,
137.5936 +        12,
137.5937 +};
137.5938 +
137.5939 +static const long _vq_lengthlist__44u7__p9_1[] = {
137.5940 +         1, 4, 4, 6, 5, 8, 6, 9, 8,10, 9,11,10, 4, 6, 6,
137.5941 +         8, 8, 9, 9,11,10,11,11,11,11, 4, 6, 6, 8, 8,10,
137.5942 +         9,11,11,11,11,11,12, 6, 8, 8,10,10,11,11,12,12,
137.5943 +        13,12,13,13, 6, 8, 8,10,10,11,11,12,12,12,13,14,
137.5944 +        13, 8,10,10,11,11,12,13,14,14,14,14,15,15, 8,10,
137.5945 +        10,11,12,12,13,13,14,14,14,14,15, 9,11,11,13,13,
137.5946 +        14,14,15,14,16,15,17,15, 9,11,11,12,13,14,14,15,
137.5947 +        14,15,15,15,16,10,12,12,13,14,15,15,15,15,16,17,
137.5948 +        16,17,10,13,12,13,14,14,16,16,16,16,15,16,17,11,
137.5949 +        13,13,14,15,14,17,15,16,17,17,17,17,11,13,13,14,
137.5950 +        15,15,15,15,17,17,16,17,16,
137.5951 +};
137.5952 +
137.5953 +static const static_codebook _44u7__p9_1 = {
137.5954 +        2, 169,
137.5955 +        (long *)_vq_lengthlist__44u7__p9_1,
137.5956 +        1, -518889472, 1622704128, 4, 0,
137.5957 +        (long *)_vq_quantlist__44u7__p9_1,
137.5958 +        0
137.5959 +};
137.5960 +
137.5961 +static const long _vq_quantlist__44u7__p9_2[] = {
137.5962 +        24,
137.5963 +        23,
137.5964 +        25,
137.5965 +        22,
137.5966 +        26,
137.5967 +        21,
137.5968 +        27,
137.5969 +        20,
137.5970 +        28,
137.5971 +        19,
137.5972 +        29,
137.5973 +        18,
137.5974 +        30,
137.5975 +        17,
137.5976 +        31,
137.5977 +        16,
137.5978 +        32,
137.5979 +        15,
137.5980 +        33,
137.5981 +        14,
137.5982 +        34,
137.5983 +        13,
137.5984 +        35,
137.5985 +        12,
137.5986 +        36,
137.5987 +        11,
137.5988 +        37,
137.5989 +        10,
137.5990 +        38,
137.5991 +        9,
137.5992 +        39,
137.5993 +        8,
137.5994 +        40,
137.5995 +        7,
137.5996 +        41,
137.5997 +        6,
137.5998 +        42,
137.5999 +        5,
137.6000 +        43,
137.6001 +        4,
137.6002 +        44,
137.6003 +        3,
137.6004 +        45,
137.6005 +        2,
137.6006 +        46,
137.6007 +        1,
137.6008 +        47,
137.6009 +        0,
137.6010 +        48,
137.6011 +};
137.6012 +
137.6013 +static const long _vq_lengthlist__44u7__p9_2[] = {
137.6014 +         2, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6,
137.6015 +         6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
137.6016 +         7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8,
137.6017 +         8,
137.6018 +};
137.6019 +
137.6020 +static const static_codebook _44u7__p9_2 = {
137.6021 +        1, 49,
137.6022 +        (long *)_vq_lengthlist__44u7__p9_2,
137.6023 +        1, -526909440, 1611661312, 6, 0,
137.6024 +        (long *)_vq_quantlist__44u7__p9_2,
137.6025 +        0
137.6026 +};
137.6027 +
137.6028 +static const long _huff_lengthlist__44u7__short[] = {
137.6029 +         5,12,17,16,16,17,17,17,17,17, 4, 7,11,11,12, 9,
137.6030 +        17,10,17,17, 7, 7, 8, 9, 7, 9,11,10,15,17, 7, 9,
137.6031 +        10,11,10,12,14,12,16,17, 7, 8, 5, 7, 4, 7, 7, 8,
137.6032 +        16,16, 6,10, 9,10, 7,10,11,11,16,17, 6, 8, 8, 9,
137.6033 +         5, 7, 5, 8,16,17, 5, 5, 8, 7, 6, 7, 7, 6, 6,14,
137.6034 +        12,10,12,11, 7,11, 4, 4, 2, 7,17,15,15,15, 8,15,
137.6035 +         6, 8, 5, 9,
137.6036 +};
137.6037 +
137.6038 +static const static_codebook _huff_book__44u7__short = {
137.6039 +        2, 100,
137.6040 +        (long *)_huff_lengthlist__44u7__short,
137.6041 +        0, 0, 0, 0, 0,
137.6042 +        NULL,
137.6043 +        0
137.6044 +};
137.6045 +
137.6046 +static const long _huff_lengthlist__44u8__long[] = {
137.6047 +         3, 9,13,14,14,15,14,14,15,15, 5, 4, 6, 8,10,12,
137.6048 +        12,14,15,15, 9, 5, 4, 5, 8,10,11,13,16,16,10, 7,
137.6049 +         4, 3, 5, 7, 9,11,13,13,10, 9, 7, 4, 4, 6, 8,10,
137.6050 +        12,14,13,11, 9, 6, 5, 5, 6, 8,12,14,13,11,10, 8,
137.6051 +         7, 6, 6, 7,10,14,13,11,12,10, 8, 7, 6, 6, 9,13,
137.6052 +        12,11,14,12,11, 9, 8, 7, 9,11,11,12,14,13,14,11,
137.6053 +        10, 8, 8, 9,
137.6054 +};
137.6055 +
137.6056 +static const static_codebook _huff_book__44u8__long = {
137.6057 +        2, 100,
137.6058 +        (long *)_huff_lengthlist__44u8__long,
137.6059 +        0, 0, 0, 0, 0,
137.6060 +        NULL,
137.6061 +        0
137.6062 +};
137.6063 +
137.6064 +static const long _huff_lengthlist__44u8__short[] = {
137.6065 +         6,14,18,18,17,17,17,17,17,17, 4, 7, 9, 9,10,13,
137.6066 +        15,17,17,17, 6, 7, 5, 6, 8,11,16,17,16,17, 5, 7,
137.6067 +         5, 4, 6,10,14,17,17,17, 6, 6, 6, 5, 7,10,13,16,
137.6068 +        17,17, 7, 6, 7, 7, 7, 8, 7,10,15,16,12, 9, 9, 6,
137.6069 +         6, 5, 3, 5,11,15,14,14,13, 5, 5, 7, 3, 4, 8,15,
137.6070 +        17,17,13, 7, 7,10, 6, 6,10,15,17,17,16,10,11,14,
137.6071 +        10,10,15,17,
137.6072 +};
137.6073 +
137.6074 +static const static_codebook _huff_book__44u8__short = {
137.6075 +        2, 100,
137.6076 +        (long *)_huff_lengthlist__44u8__short,
137.6077 +        0, 0, 0, 0, 0,
137.6078 +        NULL,
137.6079 +        0
137.6080 +};
137.6081 +
137.6082 +static const long _vq_quantlist__44u8_p1_0[] = {
137.6083 +        1,
137.6084 +        0,
137.6085 +        2,
137.6086 +};
137.6087 +
137.6088 +static const long _vq_lengthlist__44u8_p1_0[] = {
137.6089 +         1, 5, 5, 5, 7, 7, 5, 7, 7, 5, 7, 7, 8, 9, 9, 7,
137.6090 +         9, 9, 5, 7, 7, 7, 9, 9, 8, 9, 9, 5, 7, 7, 7, 9,
137.6091 +         9, 7, 9, 9, 7, 9, 9, 9,10,11, 9,11,10, 7, 9, 9,
137.6092 +         9,11,10, 9,10,11, 5, 7, 7, 7, 9, 9, 7, 9, 9, 7,
137.6093 +         9, 9, 9,11,10, 9,10,10, 8, 9, 9, 9,11,11, 9,11,
137.6094 +        10,
137.6095 +};
137.6096 +
137.6097 +static const static_codebook _44u8_p1_0 = {
137.6098 +        4, 81,
137.6099 +        (long *)_vq_lengthlist__44u8_p1_0,
137.6100 +        1, -535822336, 1611661312, 2, 0,
137.6101 +        (long *)_vq_quantlist__44u8_p1_0,
137.6102 +        0
137.6103 +};
137.6104 +
137.6105 +static const long _vq_quantlist__44u8_p2_0[] = {
137.6106 +        2,
137.6107 +        1,
137.6108 +        3,
137.6109 +        0,
137.6110 +        4,
137.6111 +};
137.6112 +
137.6113 +static const long _vq_lengthlist__44u8_p2_0[] = {
137.6114 +         4, 5, 5, 8, 8, 5, 7, 6, 9, 9, 5, 6, 7, 9, 9, 8,
137.6115 +         9, 9,11,11, 8, 9, 9,11,11, 5, 7, 7, 9, 9, 7, 8,
137.6116 +         8,10,10, 7, 8, 8,10,10, 9,10,10,12,12, 9,10,10,
137.6117 +        11,12, 5, 7, 7, 9, 9, 7, 8, 7,10,10, 7, 8, 8,10,
137.6118 +        10, 9,10, 9,12,11, 9,10,10,12,12, 8, 9, 9,12,11,
137.6119 +         9,10,10,12,12, 9,10,10,12,12,11,12,12,14,14,11,
137.6120 +        11,12,13,14, 8, 9, 9,11,11, 9,10,10,12,12, 9,10,
137.6121 +        10,12,12,11,12,11,13,13,11,12,12,14,14, 5, 7, 7,
137.6122 +         9, 9, 7, 8, 8,10,10, 7, 8, 8,10,10, 9,10,10,12,
137.6123 +        12, 9,10,10,11,12, 7, 8, 8,10,10, 8, 9, 9,11,11,
137.6124 +         8, 9, 9,11,11,10,11,11,12,13,10,11,11,12,13, 6,
137.6125 +         8, 8,10,10, 8, 9, 8,11,10, 8, 9, 9,11,11,10,11,
137.6126 +        10,13,12,10,11,11,13,13, 9,10,10,12,12,10,11,11,
137.6127 +        13,13,10,11,11,13,13,12,12,13,13,14,12,13,13,14,
137.6128 +        14, 9,10,10,12,12,10,11,10,13,12,10,11,11,13,13,
137.6129 +        11,13,12,14,13,12,13,13,14,14, 5, 7, 7, 9, 9, 7,
137.6130 +         8, 8,10,10, 7, 8, 8,10,10, 9,10,10,12,12, 9,10,
137.6131 +        10,12,12, 7, 8, 8,10,10, 8, 9, 9,11,11, 8, 8, 9,
137.6132 +        10,11,10,11,11,13,13,10,10,11,12,13, 7, 8, 8,10,
137.6133 +        10, 8, 9, 9,11,11, 8, 9, 9,11,11,10,11,11,13,13,
137.6134 +        10,11,11,13,12, 9,10,10,12,12,10,11,11,13,13,10,
137.6135 +        10,11,12,13,12,13,13,14,14,12,12,13,13,14, 9,10,
137.6136 +        10,12,12,10,11,11,13,13,10,11,11,13,13,12,13,13,
137.6137 +        15,14,12,13,13,14,13, 8, 9, 9,11,11, 9,10,10,12,
137.6138 +        12, 9,10,10,12,12,12,12,12,14,13,11,12,12,14,14,
137.6139 +         9,10,10,12,12,10,11,11,13,13,10,11,11,13,13,12,
137.6140 +        13,13,14,15,12,13,13,14,15, 9,10,10,12,12,10,11,
137.6141 +        10,13,12,10,11,11,13,13,12,13,12,15,14,12,13,13,
137.6142 +        14,15,11,12,12,14,14,12,13,13,14,14,12,13,13,15,
137.6143 +        14,14,14,14,14,16,14,14,15,16,16,11,12,12,14,14,
137.6144 +        11,12,12,14,14,12,13,13,14,15,13,14,13,16,14,14,
137.6145 +        14,14,16,16, 8, 9, 9,11,11, 9,10,10,12,12, 9,10,
137.6146 +        10,12,12,11,12,12,14,13,11,12,12,14,14, 9,10,10,
137.6147 +        12,12,10,11,11,13,13,10,10,11,12,13,12,13,13,15,
137.6148 +        14,12,12,13,13,14, 9,10,10,12,12,10,11,11,13,13,
137.6149 +        10,11,11,13,13,12,13,13,14,14,12,13,13,15,14,11,
137.6150 +        12,12,14,13,12,13,13,15,14,11,12,12,13,14,14,15,
137.6151 +        14,16,15,13,13,14,13,16,11,12,12,14,14,12,13,13,
137.6152 +        14,15,12,13,12,15,14,14,14,14,16,15,14,15,13,16,
137.6153 +        14,
137.6154 +};
137.6155 +
137.6156 +static const static_codebook _44u8_p2_0 = {
137.6157 +        4, 625,
137.6158 +        (long *)_vq_lengthlist__44u8_p2_0,
137.6159 +        1, -533725184, 1611661312, 3, 0,
137.6160 +        (long *)_vq_quantlist__44u8_p2_0,
137.6161 +        0
137.6162 +};
137.6163 +
137.6164 +static const long _vq_quantlist__44u8_p3_0[] = {
137.6165 +        4,
137.6166 +        3,
137.6167 +        5,
137.6168 +        2,
137.6169 +        6,
137.6170 +        1,
137.6171 +        7,
137.6172 +        0,
137.6173 +        8,
137.6174 +};
137.6175 +
137.6176 +static const long _vq_lengthlist__44u8_p3_0[] = {
137.6177 +         3, 4, 4, 5, 5, 7, 7, 9, 9, 4, 5, 4, 6, 6, 7, 7,
137.6178 +         9, 9, 4, 4, 5, 6, 6, 7, 7, 9, 9, 5, 6, 6, 7, 7,
137.6179 +         8, 8,10,10, 6, 6, 6, 7, 7, 8, 8,10,10, 7, 7, 7,
137.6180 +         8, 8, 9, 9,11,10, 7, 7, 7, 8, 8, 9, 9,10,11, 9,
137.6181 +         9, 9,10,10,11,10,12,11, 9, 9, 9, 9,10,11,11,11,
137.6182 +        12,
137.6183 +};
137.6184 +
137.6185 +static const static_codebook _44u8_p3_0 = {
137.6186 +        2, 81,
137.6187 +        (long *)_vq_lengthlist__44u8_p3_0,
137.6188 +        1, -531628032, 1611661312, 4, 0,
137.6189 +        (long *)_vq_quantlist__44u8_p3_0,
137.6190 +        0
137.6191 +};
137.6192 +
137.6193 +static const long _vq_quantlist__44u8_p4_0[] = {
137.6194 +        8,
137.6195 +        7,
137.6196 +        9,
137.6197 +        6,
137.6198 +        10,
137.6199 +        5,
137.6200 +        11,
137.6201 +        4,
137.6202 +        12,
137.6203 +        3,
137.6204 +        13,
137.6205 +        2,
137.6206 +        14,
137.6207 +        1,
137.6208 +        15,
137.6209 +        0,
137.6210 +        16,
137.6211 +};
137.6212 +
137.6213 +static const long _vq_lengthlist__44u8_p4_0[] = {
137.6214 +         4, 4, 4, 6, 6, 7, 7, 8, 8, 8, 8,10,10,11,11,11,
137.6215 +        11, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9,10,10,11,11,
137.6216 +        12,12, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9,10,10,11,
137.6217 +        11,12,12, 6, 6, 6, 7, 7, 8, 8, 9, 9, 9, 9,10,10,
137.6218 +        11,11,12,12, 6, 6, 6, 7, 7, 8, 8, 9, 9, 9, 9,10,
137.6219 +        10,11,11,12,12, 7, 7, 7, 8, 8, 9, 8,10, 9,10, 9,
137.6220 +        11,10,12,11,13,12, 7, 7, 7, 8, 8, 8, 9, 9,10, 9,
137.6221 +        10,10,11,11,12,12,13, 8, 8, 8, 9, 9, 9, 9,10,10,
137.6222 +        11,10,11,11,12,12,13,13, 8, 8, 8, 9, 9, 9,10,10,
137.6223 +        10,10,11,11,11,12,12,12,13, 8, 9, 9, 9, 9,10, 9,
137.6224 +        11,10,11,11,12,11,13,12,13,13, 8, 9, 9, 9, 9, 9,
137.6225 +        10,10,11,11,11,11,12,12,13,13,13,10,10,10,10,10,
137.6226 +        11,10,11,11,12,11,13,12,13,13,14,13,10,10,10,10,
137.6227 +        10,10,11,11,11,11,12,12,13,13,13,13,14,11,11,11,
137.6228 +        11,11,12,11,12,12,13,12,13,13,14,13,14,14,11,11,
137.6229 +        11,11,11,11,12,12,12,12,13,13,13,13,14,14,14,11,
137.6230 +        12,12,12,12,13,12,13,12,13,13,14,13,14,14,14,14,
137.6231 +        11,12,12,12,12,12,12,13,13,13,13,13,14,14,14,14,
137.6232 +        14,
137.6233 +};
137.6234 +
137.6235 +static const static_codebook _44u8_p4_0 = {
137.6236 +        2, 289,
137.6237 +        (long *)_vq_lengthlist__44u8_p4_0,
137.6238 +        1, -529530880, 1611661312, 5, 0,
137.6239 +        (long *)_vq_quantlist__44u8_p4_0,
137.6240 +        0
137.6241 +};
137.6242 +
137.6243 +static const long _vq_quantlist__44u8_p5_0[] = {
137.6244 +        1,
137.6245 +        0,
137.6246 +        2,
137.6247 +};
137.6248 +
137.6249 +static const long _vq_lengthlist__44u8_p5_0[] = {
137.6250 +         1, 4, 4, 5, 7, 7, 5, 7, 7, 5, 8, 8, 8, 9, 9, 7,
137.6251 +         9, 9, 5, 8, 8, 7, 9, 9, 8, 9, 9, 5, 8, 8, 8,10,
137.6252 +        10, 8,10,10, 7,10,10, 9,10,12, 9,12,11, 7,10,10,
137.6253 +         9,11,10, 9,11,12, 5, 8, 8, 8,10,10, 8,10,10, 7,
137.6254 +        10,10, 9,11,11, 9,10,11, 7,10,10, 9,11,11,10,12,
137.6255 +        10,
137.6256 +};
137.6257 +
137.6258 +static const static_codebook _44u8_p5_0 = {
137.6259 +        4, 81,
137.6260 +        (long *)_vq_lengthlist__44u8_p5_0,
137.6261 +        1, -529137664, 1618345984, 2, 0,
137.6262 +        (long *)_vq_quantlist__44u8_p5_0,
137.6263 +        0
137.6264 +};
137.6265 +
137.6266 +static const long _vq_quantlist__44u8_p5_1[] = {
137.6267 +        5,
137.6268 +        4,
137.6269 +        6,
137.6270 +        3,
137.6271 +        7,
137.6272 +        2,
137.6273 +        8,
137.6274 +        1,
137.6275 +        9,
137.6276 +        0,
137.6277 +        10,
137.6278 +};
137.6279 +
137.6280 +static const long _vq_lengthlist__44u8_p5_1[] = {
137.6281 +         4, 5, 5, 6, 6, 7, 7, 7, 7, 8, 8, 5, 5, 5, 6, 6,
137.6282 +         7, 7, 8, 8, 8, 8, 5, 5, 5, 6, 6, 7, 7, 7, 8, 8,
137.6283 +         8, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 6, 6, 6, 7,
137.6284 +         7, 7, 7, 8, 8, 8, 8, 7, 7, 7, 7, 7, 8, 8, 8, 8,
137.6285 +         8, 8, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 7, 8, 7,
137.6286 +         8, 8, 8, 8, 8, 8, 8, 8, 7, 8, 8, 8, 8, 8, 8, 8,
137.6287 +         8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 8, 8,
137.6288 +         8, 8, 8, 8, 8, 8, 8, 9, 9,
137.6289 +};
137.6290 +
137.6291 +static const static_codebook _44u8_p5_1 = {
137.6292 +        2, 121,
137.6293 +        (long *)_vq_lengthlist__44u8_p5_1,
137.6294 +        1, -531365888, 1611661312, 4, 0,
137.6295 +        (long *)_vq_quantlist__44u8_p5_1,
137.6296 +        0
137.6297 +};
137.6298 +
137.6299 +static const long _vq_quantlist__44u8_p6_0[] = {
137.6300 +        6,
137.6301 +        5,
137.6302 +        7,
137.6303 +        4,
137.6304 +        8,
137.6305 +        3,
137.6306 +        9,
137.6307 +        2,
137.6308 +        10,
137.6309 +        1,
137.6310 +        11,
137.6311 +        0,
137.6312 +        12,
137.6313 +};
137.6314 +
137.6315 +static const long _vq_lengthlist__44u8_p6_0[] = {
137.6316 +         2, 4, 4, 6, 6, 7, 7, 8, 8, 9, 9,10,10, 4, 6, 5,
137.6317 +         7, 7, 8, 8, 8, 8, 9, 9,10,10, 4, 6, 6, 7, 7, 8,
137.6318 +         8, 8, 8, 9, 9,10,10, 6, 7, 7, 7, 8, 8, 8, 8, 9,
137.6319 +         9,10,10,10, 6, 7, 7, 8, 8, 8, 8, 9, 8,10, 9,11,
137.6320 +        10, 7, 8, 8, 8, 8, 8, 9, 9, 9,10,10,11,11, 7, 8,
137.6321 +         8, 8, 8, 9, 8, 9, 9,10,10,11,11, 8, 8, 8, 9, 9,
137.6322 +         9, 9, 9,10,10,10,11,11, 8, 8, 8, 9, 9, 9, 9,10,
137.6323 +         9,10,10,11,11, 9, 9, 9, 9,10,10,10,10,10,10,11,
137.6324 +        11,12, 9, 9, 9,10, 9,10,10,10,10,11,10,12,11,10,
137.6325 +        10,10,10,10,11,11,11,11,11,12,12,12,10,10,10,10,
137.6326 +        11,11,11,11,11,12,11,12,12,
137.6327 +};
137.6328 +
137.6329 +static const static_codebook _44u8_p6_0 = {
137.6330 +        2, 169,
137.6331 +        (long *)_vq_lengthlist__44u8_p6_0,
137.6332 +        1, -526516224, 1616117760, 4, 0,
137.6333 +        (long *)_vq_quantlist__44u8_p6_0,
137.6334 +        0
137.6335 +};
137.6336 +
137.6337 +static const long _vq_quantlist__44u8_p6_1[] = {
137.6338 +        2,
137.6339 +        1,
137.6340 +        3,
137.6341 +        0,
137.6342 +        4,
137.6343 +};
137.6344 +
137.6345 +static const long _vq_lengthlist__44u8_p6_1[] = {
137.6346 +         3, 4, 4, 5, 5, 4, 5, 5, 5, 5, 4, 5, 5, 5, 5, 5,
137.6347 +         5, 5, 5, 5, 5, 5, 5, 5, 5,
137.6348 +};
137.6349 +
137.6350 +static const static_codebook _44u8_p6_1 = {
137.6351 +        2, 25,
137.6352 +        (long *)_vq_lengthlist__44u8_p6_1,
137.6353 +        1, -533725184, 1611661312, 3, 0,
137.6354 +        (long *)_vq_quantlist__44u8_p6_1,
137.6355 +        0
137.6356 +};
137.6357 +
137.6358 +static const long _vq_quantlist__44u8_p7_0[] = {
137.6359 +        6,
137.6360 +        5,
137.6361 +        7,
137.6362 +        4,
137.6363 +        8,
137.6364 +        3,
137.6365 +        9,
137.6366 +        2,
137.6367 +        10,
137.6368 +        1,
137.6369 +        11,
137.6370 +        0,
137.6371 +        12,
137.6372 +};
137.6373 +
137.6374 +static const long _vq_lengthlist__44u8_p7_0[] = {
137.6375 +         1, 4, 5, 6, 6, 7, 7, 8, 8,10,10,11,11, 5, 6, 6,
137.6376 +         7, 7, 8, 8, 9, 9,11,10,12,11, 5, 6, 6, 7, 7, 8,
137.6377 +         8, 9, 9,10,11,11,12, 6, 7, 7, 8, 8, 9, 9,10,10,
137.6378 +        11,11,12,12, 6, 7, 7, 8, 8, 9, 9,10,10,11,12,13,
137.6379 +        12, 7, 8, 8, 9, 9,10,10,11,11,12,12,13,13, 8, 8,
137.6380 +         8, 9, 9,10,10,11,11,12,12,13,13, 9, 9, 9,10,10,
137.6381 +        11,11,12,12,13,13,14,14, 9, 9, 9,10,10,11,11,12,
137.6382 +        12,13,13,14,14,10,11,11,12,11,13,12,13,13,14,14,
137.6383 +        15,15,10,11,11,11,12,12,13,13,14,14,14,15,15,11,
137.6384 +        12,12,13,13,14,13,15,14,15,15,16,15,11,11,12,13,
137.6385 +        13,13,14,14,14,15,15,15,16,
137.6386 +};
137.6387 +
137.6388 +static const static_codebook _44u8_p7_0 = {
137.6389 +        2, 169,
137.6390 +        (long *)_vq_lengthlist__44u8_p7_0,
137.6391 +        1, -523206656, 1618345984, 4, 0,
137.6392 +        (long *)_vq_quantlist__44u8_p7_0,
137.6393 +        0
137.6394 +};
137.6395 +
137.6396 +static const long _vq_quantlist__44u8_p7_1[] = {
137.6397 +        5,
137.6398 +        4,
137.6399 +        6,
137.6400 +        3,
137.6401 +        7,
137.6402 +        2,
137.6403 +        8,
137.6404 +        1,
137.6405 +        9,
137.6406 +        0,
137.6407 +        10,
137.6408 +};
137.6409 +
137.6410 +static const long _vq_lengthlist__44u8_p7_1[] = {
137.6411 +         4, 5, 5, 6, 6, 7, 7, 7, 7, 7, 7, 5, 6, 6, 7, 7,
137.6412 +         7, 7, 7, 7, 7, 7, 5, 6, 6, 7, 7, 7, 7, 7, 7, 7,
137.6413 +         7, 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 6, 7, 7, 7,
137.6414 +         7, 7, 7, 7, 7, 7, 8, 7, 7, 7, 7, 7, 7, 7, 8, 8,
137.6415 +         8, 8, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 7, 7, 7,
137.6416 +         8, 7, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 8, 8, 8,
137.6417 +         8, 8, 8, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7,
137.6418 +         7, 8, 8, 8, 8, 8, 8, 8, 8,
137.6419 +};
137.6420 +
137.6421 +static const static_codebook _44u8_p7_1 = {
137.6422 +        2, 121,
137.6423 +        (long *)_vq_lengthlist__44u8_p7_1,
137.6424 +        1, -531365888, 1611661312, 4, 0,
137.6425 +        (long *)_vq_quantlist__44u8_p7_1,
137.6426 +        0
137.6427 +};
137.6428 +
137.6429 +static const long _vq_quantlist__44u8_p8_0[] = {
137.6430 +        7,
137.6431 +        6,
137.6432 +        8,
137.6433 +        5,
137.6434 +        9,
137.6435 +        4,
137.6436 +        10,
137.6437 +        3,
137.6438 +        11,
137.6439 +        2,
137.6440 +        12,
137.6441 +        1,
137.6442 +        13,
137.6443 +        0,
137.6444 +        14,
137.6445 +};
137.6446 +
137.6447 +static const long _vq_lengthlist__44u8_p8_0[] = {
137.6448 +         1, 4, 4, 7, 7, 8, 8, 8, 7, 9, 8,10, 9,11,10, 4,
137.6449 +         6, 6, 8, 8,10, 9, 9, 9,10,10,11,10,12,10, 4, 6,
137.6450 +         6, 8, 8,10,10, 9, 9,10,10,11,11,11,12, 7, 8, 8,
137.6451 +        10,10,11,11,11,10,12,11,12,12,13,11, 7, 8, 8,10,
137.6452 +        10,11,11,10,10,11,11,12,12,13,13, 8,10,10,11,11,
137.6453 +        12,11,12,11,13,12,13,12,14,13, 8,10, 9,11,11,12,
137.6454 +        12,12,12,12,12,13,13,14,13, 8, 9, 9,11,10,12,11,
137.6455 +        13,12,13,13,14,13,14,13, 8, 9, 9,10,11,12,12,12,
137.6456 +        12,13,13,14,15,14,14, 9,10,10,12,11,13,12,13,13,
137.6457 +        14,13,14,14,14,14, 9,10,10,12,12,12,12,13,13,14,
137.6458 +        14,14,15,14,14,10,11,11,13,12,13,12,14,14,14,14,
137.6459 +        14,14,15,15,10,11,11,12,12,13,13,14,14,14,15,15,
137.6460 +        14,16,15,11,12,12,13,12,14,14,14,13,15,14,15,15,
137.6461 +        15,17,11,12,12,13,13,14,14,14,15,15,14,15,15,14,
137.6462 +        17,
137.6463 +};
137.6464 +
137.6465 +static const static_codebook _44u8_p8_0 = {
137.6466 +        2, 225,
137.6467 +        (long *)_vq_lengthlist__44u8_p8_0,
137.6468 +        1, -520986624, 1620377600, 4, 0,
137.6469 +        (long *)_vq_quantlist__44u8_p8_0,
137.6470 +        0
137.6471 +};
137.6472 +
137.6473 +static const long _vq_quantlist__44u8_p8_1[] = {
137.6474 +        10,
137.6475 +        9,
137.6476 +        11,
137.6477 +        8,
137.6478 +        12,
137.6479 +        7,
137.6480 +        13,
137.6481 +        6,
137.6482 +        14,
137.6483 +        5,
137.6484 +        15,
137.6485 +        4,
137.6486 +        16,
137.6487 +        3,
137.6488 +        17,
137.6489 +        2,
137.6490 +        18,
137.6491 +        1,
137.6492 +        19,
137.6493 +        0,
137.6494 +        20,
137.6495 +};
137.6496 +
137.6497 +static const long _vq_lengthlist__44u8_p8_1[] = {
137.6498 +         4, 6, 6, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9,
137.6499 +         9, 9, 9, 9, 9, 6, 6, 6, 7, 7, 8, 8, 8, 8, 9, 9,
137.6500 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 5, 6, 6, 7, 7, 8,
137.6501 +         8, 9, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 7,
137.6502 +         7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
137.6503 +         9, 9, 9, 9, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9,
137.6504 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 9, 9,
137.6505 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9,10,10, 9,10, 8, 8,
137.6506 +         8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,10, 9,10,
137.6507 +        10, 9,10, 8, 9, 8, 9, 9, 9, 9, 9, 9, 9, 9,10, 9,
137.6508 +        10,10,10,10,10,10,10,10, 8, 9, 8, 9, 9, 9, 9, 9,
137.6509 +         9, 9, 9, 9, 9, 9,10,10,10,10, 9,10,10, 9, 9, 9,
137.6510 +         9, 9, 9, 9, 9, 9, 9, 9,10, 9,10,10,10,10,10,10,
137.6511 +        10,10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,10, 9,10,
137.6512 +        10,10,10,10,10,10,10, 9, 9, 9, 9, 9, 9, 9,10, 9,
137.6513 +        10,10,10,10,10,10,10,10,10,10,10,10, 9, 9, 9, 9,
137.6514 +         9, 9, 9, 9, 9, 9,10,10,10,10,10,10,10,10,10,10,
137.6515 +        10, 9, 9, 9, 9, 9, 9,10,10,10,10,10,10,10,10,10,
137.6516 +        10,10,10,10,10,10, 9, 9, 9, 9, 9, 9, 9,10,10,10,
137.6517 +        10,10,10,10,10,10,10,10,10,10,10, 9, 9, 9, 9, 9,
137.6518 +         9, 9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
137.6519 +         9, 9, 9, 9, 9,10,10,10,10,10,10,10,10,10,10,10,
137.6520 +        10,10,10,10,10, 9, 9, 9,10, 9,10,10,10,10,10,10,
137.6521 +        10,10,10,10,10,10,10,10,10,10, 9, 9, 9, 9, 9,10,
137.6522 +         9,10,10,10,10,10,10,10,10,10,10,10,10,10,10, 9,
137.6523 +         9, 9, 9, 9, 9,10,10,10,10,10,10,10,10,10,10,10,
137.6524 +        10,10,10,10, 9, 9, 9,10, 9,10, 9,10,10,10,10,10,
137.6525 +        10,10,10,10,10,10,10,10,10,
137.6526 +};
137.6527 +
137.6528 +static const static_codebook _44u8_p8_1 = {
137.6529 +        2, 441,
137.6530 +        (long *)_vq_lengthlist__44u8_p8_1,
137.6531 +        1, -529268736, 1611661312, 5, 0,
137.6532 +        (long *)_vq_quantlist__44u8_p8_1,
137.6533 +        0
137.6534 +};
137.6535 +
137.6536 +static const long _vq_quantlist__44u8_p9_0[] = {
137.6537 +        4,
137.6538 +        3,
137.6539 +        5,
137.6540 +        2,
137.6541 +        6,
137.6542 +        1,
137.6543 +        7,
137.6544 +        0,
137.6545 +        8,
137.6546 +};
137.6547 +
137.6548 +static const long _vq_lengthlist__44u8_p9_0[] = {
137.6549 +         1, 3, 3, 9, 9, 9, 9, 9, 9, 4, 9, 9, 9, 9, 9, 9,
137.6550 +         9, 9, 5, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
137.6551 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
137.6552 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
137.6553 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8,
137.6554 +         8,
137.6555 +};
137.6556 +
137.6557 +static const static_codebook _44u8_p9_0 = {
137.6558 +        2, 81,
137.6559 +        (long *)_vq_lengthlist__44u8_p9_0,
137.6560 +        1, -511895552, 1631393792, 4, 0,
137.6561 +        (long *)_vq_quantlist__44u8_p9_0,
137.6562 +        0
137.6563 +};
137.6564 +
137.6565 +static const long _vq_quantlist__44u8_p9_1[] = {
137.6566 +        9,
137.6567 +        8,
137.6568 +        10,
137.6569 +        7,
137.6570 +        11,
137.6571 +        6,
137.6572 +        12,
137.6573 +        5,
137.6574 +        13,
137.6575 +        4,
137.6576 +        14,
137.6577 +        3,
137.6578 +        15,
137.6579 +        2,
137.6580 +        16,
137.6581 +        1,
137.6582 +        17,
137.6583 +        0,
137.6584 +        18,
137.6585 +};
137.6586 +
137.6587 +static const long _vq_lengthlist__44u8_p9_1[] = {
137.6588 +         1, 4, 4, 7, 7, 8, 7, 8, 6, 9, 7,10, 8,11,10,11,
137.6589 +        11,11,11, 4, 7, 6, 9, 9,10, 9, 9, 9,10,10,11,10,
137.6590 +        11,10,11,11,13,11, 4, 7, 7, 9, 9, 9, 9, 9, 9,10,
137.6591 +        10,11,10,11,11,11,12,11,12, 7, 9, 8,11,11,11,11,
137.6592 +        10,10,11,11,12,12,12,12,12,12,14,13, 7, 8, 9,10,
137.6593 +        11,11,11,10,10,11,11,11,11,12,12,14,12,13,14, 8,
137.6594 +         9, 9,11,11,11,11,11,11,12,12,14,12,15,14,14,14,
137.6595 +        15,14, 8, 9, 9,11,11,11,11,12,11,12,12,13,13,13,
137.6596 +        13,13,13,14,14, 8, 9, 9,11,10,12,11,12,12,13,13,
137.6597 +        13,13,15,14,14,14,16,16, 8, 9, 9,10,11,11,12,12,
137.6598 +        12,13,13,13,14,14,14,15,16,15,15, 9,10,10,11,12,
137.6599 +        12,13,13,13,14,14,16,14,14,16,16,16,16,15, 9,10,
137.6600 +        10,11,11,12,13,13,14,15,14,16,14,15,16,16,16,16,
137.6601 +        15,10,11,11,12,13,13,14,15,15,15,15,15,16,15,16,
137.6602 +        15,16,15,15,10,11,11,13,13,14,13,13,15,14,15,15,
137.6603 +        16,15,15,15,16,15,16,10,12,12,14,14,14,14,14,16,
137.6604 +        16,15,15,15,16,16,16,16,16,16,11,12,12,14,14,14,
137.6605 +        14,15,15,16,15,16,15,16,15,16,16,16,16,12,12,13,
137.6606 +        14,14,15,16,16,16,16,16,16,15,16,16,16,16,16,16,
137.6607 +        12,13,13,14,14,14,14,15,16,15,16,16,16,16,16,16,
137.6608 +        16,16,16,12,13,14,14,14,16,15,16,15,16,16,16,16,
137.6609 +        16,16,16,16,16,16,12,14,13,14,15,15,15,16,15,16,
137.6610 +        16,15,16,16,16,16,16,16,16,
137.6611 +};
137.6612 +
137.6613 +static const static_codebook _44u8_p9_1 = {
137.6614 +        2, 361,
137.6615 +        (long *)_vq_lengthlist__44u8_p9_1,
137.6616 +        1, -518287360, 1622704128, 5, 0,
137.6617 +        (long *)_vq_quantlist__44u8_p9_1,
137.6618 +        0
137.6619 +};
137.6620 +
137.6621 +static const long _vq_quantlist__44u8_p9_2[] = {
137.6622 +        24,
137.6623 +        23,
137.6624 +        25,
137.6625 +        22,
137.6626 +        26,
137.6627 +        21,
137.6628 +        27,
137.6629 +        20,
137.6630 +        28,
137.6631 +        19,
137.6632 +        29,
137.6633 +        18,
137.6634 +        30,
137.6635 +        17,
137.6636 +        31,
137.6637 +        16,
137.6638 +        32,
137.6639 +        15,
137.6640 +        33,
137.6641 +        14,
137.6642 +        34,
137.6643 +        13,
137.6644 +        35,
137.6645 +        12,
137.6646 +        36,
137.6647 +        11,
137.6648 +        37,
137.6649 +        10,
137.6650 +        38,
137.6651 +        9,
137.6652 +        39,
137.6653 +        8,
137.6654 +        40,
137.6655 +        7,
137.6656 +        41,
137.6657 +        6,
137.6658 +        42,
137.6659 +        5,
137.6660 +        43,
137.6661 +        4,
137.6662 +        44,
137.6663 +        3,
137.6664 +        45,
137.6665 +        2,
137.6666 +        46,
137.6667 +        1,
137.6668 +        47,
137.6669 +        0,
137.6670 +        48,
137.6671 +};
137.6672 +
137.6673 +static const long _vq_lengthlist__44u8_p9_2[] = {
137.6674 +         2, 3, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6,
137.6675 +         6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
137.6676 +         7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
137.6677 +         7,
137.6678 +};
137.6679 +
137.6680 +static const static_codebook _44u8_p9_2 = {
137.6681 +        1, 49,
137.6682 +        (long *)_vq_lengthlist__44u8_p9_2,
137.6683 +        1, -526909440, 1611661312, 6, 0,
137.6684 +        (long *)_vq_quantlist__44u8_p9_2,
137.6685 +        0
137.6686 +};
137.6687 +
137.6688 +static const long _huff_lengthlist__44u9__long[] = {
137.6689 +         3, 9,13,13,14,15,14,14,15,15, 5, 5, 9,10,12,12,
137.6690 +        13,14,16,15,10, 6, 6, 6, 8,11,12,13,16,15,11, 7,
137.6691 +         5, 3, 5, 8,10,12,15,15,10,10, 7, 4, 3, 5, 8,10,
137.6692 +        12,12,12,12, 9, 7, 5, 4, 6, 8,10,13,13,12,11, 9,
137.6693 +         7, 5, 5, 6, 9,12,14,12,12,10, 8, 6, 6, 6, 7,11,
137.6694 +        13,12,14,13,10, 8, 7, 7, 7,10,11,11,12,13,12,11,
137.6695 +        10, 8, 8, 9,
137.6696 +};
137.6697 +
137.6698 +static const static_codebook _huff_book__44u9__long = {
137.6699 +        2, 100,
137.6700 +        (long *)_huff_lengthlist__44u9__long,
137.6701 +        0, 0, 0, 0, 0,
137.6702 +        NULL,
137.6703 +        0
137.6704 +};
137.6705 +
137.6706 +static const long _huff_lengthlist__44u9__short[] = {
137.6707 +         9,16,18,18,17,17,17,17,17,17, 5, 8,11,12,11,12,
137.6708 +        17,17,16,16, 6, 6, 8, 8, 9,10,14,15,16,16, 6, 7,
137.6709 +         7, 4, 6, 9,13,16,16,16, 6, 6, 7, 4, 5, 8,11,15,
137.6710 +        17,16, 7, 6, 7, 6, 6, 8, 9,10,14,16,11, 8, 8, 7,
137.6711 +         6, 6, 3, 4,10,15,14,12,12,10, 5, 6, 3, 3, 8,13,
137.6712 +        15,17,15,11, 6, 8, 6, 6, 9,14,17,15,15,12, 8,10,
137.6713 +         9, 9,12,15,
137.6714 +};
137.6715 +
137.6716 +static const static_codebook _huff_book__44u9__short = {
137.6717 +        2, 100,
137.6718 +        (long *)_huff_lengthlist__44u9__short,
137.6719 +        0, 0, 0, 0, 0,
137.6720 +        NULL,
137.6721 +        0
137.6722 +};
137.6723 +
137.6724 +static const long _vq_quantlist__44u9_p1_0[] = {
137.6725 +        1,
137.6726 +        0,
137.6727 +        2,
137.6728 +};
137.6729 +
137.6730 +static const long _vq_lengthlist__44u9_p1_0[] = {
137.6731 +         1, 5, 5, 5, 7, 7, 5, 7, 7, 5, 7, 7, 7, 9, 9, 7,
137.6732 +         9, 9, 5, 7, 7, 7, 9, 9, 7, 9, 9, 5, 7, 7, 7, 9,
137.6733 +         9, 7, 9, 9, 8, 9, 9, 9,10,11, 9,11,11, 7, 9, 9,
137.6734 +         9,11,10, 9,11,11, 5, 7, 7, 7, 9, 9, 8, 9,10, 7,
137.6735 +         9, 9, 9,11,11, 9,10,11, 7, 9,10, 9,11,11, 9,11,
137.6736 +        10,
137.6737 +};
137.6738 +
137.6739 +static const static_codebook _44u9_p1_0 = {
137.6740 +        4, 81,
137.6741 +        (long *)_vq_lengthlist__44u9_p1_0,
137.6742 +        1, -535822336, 1611661312, 2, 0,
137.6743 +        (long *)_vq_quantlist__44u9_p1_0,
137.6744 +        0
137.6745 +};
137.6746 +
137.6747 +static const long _vq_quantlist__44u9_p2_0[] = {
137.6748 +        2,
137.6749 +        1,
137.6750 +        3,
137.6751 +        0,
137.6752 +        4,
137.6753 +};
137.6754 +
137.6755 +static const long _vq_lengthlist__44u9_p2_0[] = {
137.6756 +         3, 5, 5, 8, 8, 5, 7, 7, 9, 9, 6, 7, 7, 9, 9, 8,
137.6757 +         9, 9,11,10, 8, 9, 9,11,11, 6, 7, 7, 9, 9, 7, 8,
137.6758 +         8,10,10, 7, 8, 8, 9,10, 9,10,10,11,11, 9, 9,10,
137.6759 +        11,11, 6, 7, 7, 9, 9, 7, 8, 8,10, 9, 7, 8, 8,10,
137.6760 +        10, 9,10, 9,11,11, 9,10,10,11,11, 8, 9, 9,11,11,
137.6761 +         9,10,10,12,11, 9,10,10,11,12,11,11,11,13,13,11,
137.6762 +        11,11,12,13, 8, 9, 9,11,11, 9,10,10,11,11, 9,10,
137.6763 +        10,12,11,11,12,11,13,12,11,11,12,13,13, 6, 7, 7,
137.6764 +         9, 9, 7, 8, 8,10,10, 7, 8, 8,10,10, 9,10,10,12,
137.6765 +        11, 9,10,10,11,12, 7, 8, 8,10,10, 8, 9, 9,11,11,
137.6766 +         8, 9, 9,10,10,10,11,11,12,12,10,10,11,12,12, 7,
137.6767 +         8, 8,10,10, 8, 9, 8,10,10, 8, 9, 9,10,10,10,11,
137.6768 +        10,12,11,10,10,11,12,12, 9,10,10,11,12,10,11,11,
137.6769 +        12,12,10,11,10,12,12,12,12,12,13,13,11,12,12,13,
137.6770 +        13, 9,10,10,11,11, 9,10,10,12,12,10,11,11,12,13,
137.6771 +        11,12,11,13,12,12,12,12,13,14, 6, 7, 7, 9, 9, 7,
137.6772 +         8, 8,10,10, 7, 8, 8,10,10, 9,10,10,11,11, 9,10,
137.6773 +        10,11,12, 7, 8, 8,10,10, 8, 9, 9,11,10, 8, 8, 9,
137.6774 +        10,10,10,11,10,12,12,10,10,11,11,12, 7, 8, 8,10,
137.6775 +        10, 8, 9, 9,10,10, 8, 9, 9,10,10,10,11,10,12,12,
137.6776 +        10,11,10,12,12, 9,10,10,12,11,10,11,11,12,12, 9,
137.6777 +        10,10,12,12,12,12,12,13,13,11,11,12,12,14, 9,10,
137.6778 +        10,11,12,10,11,11,12,12,10,11,11,12,12,11,12,12,
137.6779 +        14,14,12,12,12,13,13, 8, 9, 9,11,11, 9,10,10,12,
137.6780 +        11, 9,10,10,12,12,11,12,11,13,13,11,11,12,13,13,
137.6781 +         9,10,10,12,12,10,11,11,12,12,10,11,11,12,12,12,
137.6782 +        12,12,14,14,12,12,12,13,13, 9,10,10,12,11,10,11,
137.6783 +        10,12,12,10,11,11,12,12,11,12,12,14,13,12,12,12,
137.6784 +        13,14,11,12,11,13,13,11,12,12,13,13,12,12,12,14,
137.6785 +        14,13,13,13,13,15,13,13,14,15,15,11,11,11,13,13,
137.6786 +        11,12,11,13,13,11,12,12,13,13,12,13,12,15,13,13,
137.6787 +        13,14,14,15, 8, 9, 9,11,11, 9,10,10,11,12, 9,10,
137.6788 +        10,11,12,11,12,11,13,13,11,12,12,13,13, 9,10,10,
137.6789 +        11,12,10,11,10,12,12,10,10,11,12,13,12,12,12,14,
137.6790 +        13,11,12,12,13,14, 9,10,10,12,12,10,11,11,12,12,
137.6791 +        10,11,11,12,12,12,12,12,14,13,12,12,12,14,13,11,
137.6792 +        11,11,13,13,11,12,12,14,13,11,11,12,13,13,13,13,
137.6793 +        13,15,14,12,12,13,13,15,11,12,12,13,13,12,12,12,
137.6794 +        13,14,11,12,12,13,13,13,13,14,14,15,13,13,13,14,
137.6795 +        14,
137.6796 +};
137.6797 +
137.6798 +static const static_codebook _44u9_p2_0 = {
137.6799 +        4, 625,
137.6800 +        (long *)_vq_lengthlist__44u9_p2_0,
137.6801 +        1, -533725184, 1611661312, 3, 0,
137.6802 +        (long *)_vq_quantlist__44u9_p2_0,
137.6803 +        0
137.6804 +};
137.6805 +
137.6806 +static const long _vq_quantlist__44u9_p3_0[] = {
137.6807 +        4,
137.6808 +        3,
137.6809 +        5,
137.6810 +        2,
137.6811 +        6,
137.6812 +        1,
137.6813 +        7,
137.6814 +        0,
137.6815 +        8,
137.6816 +};
137.6817 +
137.6818 +static const long _vq_lengthlist__44u9_p3_0[] = {
137.6819 +         3, 4, 4, 5, 5, 7, 7, 8, 8, 4, 5, 5, 6, 6, 7, 7,
137.6820 +         9, 9, 4, 4, 5, 6, 6, 7, 7, 9, 9, 5, 6, 6, 7, 7,
137.6821 +         8, 8, 9, 9, 5, 6, 6, 7, 7, 8, 8, 9, 9, 7, 7, 7,
137.6822 +         8, 8, 9, 9,10,10, 7, 7, 7, 8, 8, 9, 9,10,10, 8,
137.6823 +         9, 9,10, 9,10,10,11,11, 8, 9, 9, 9,10,10,10,11,
137.6824 +        11,
137.6825 +};
137.6826 +
137.6827 +static const static_codebook _44u9_p3_0 = {
137.6828 +        2, 81,
137.6829 +        (long *)_vq_lengthlist__44u9_p3_0,
137.6830 +        1, -531628032, 1611661312, 4, 0,
137.6831 +        (long *)_vq_quantlist__44u9_p3_0,
137.6832 +        0
137.6833 +};
137.6834 +
137.6835 +static const long _vq_quantlist__44u9_p4_0[] = {
137.6836 +        8,
137.6837 +        7,
137.6838 +        9,
137.6839 +        6,
137.6840 +        10,
137.6841 +        5,
137.6842 +        11,
137.6843 +        4,
137.6844 +        12,
137.6845 +        3,
137.6846 +        13,
137.6847 +        2,
137.6848 +        14,
137.6849 +        1,
137.6850 +        15,
137.6851 +        0,
137.6852 +        16,
137.6853 +};
137.6854 +
137.6855 +static const long _vq_lengthlist__44u9_p4_0[] = {
137.6856 +         4, 5, 5, 6, 6, 7, 7, 8, 8, 8, 8, 9, 9,10,10,11,
137.6857 +        11, 5, 5, 5, 6, 6, 7, 7, 8, 8, 8, 8, 9, 9,10,10,
137.6858 +        11,11, 5, 5, 5, 6, 6, 7, 7, 8, 8, 8, 8, 9, 9,10,
137.6859 +        10,11,11, 6, 6, 6, 7, 6, 7, 7, 8, 8, 9, 9,10,10,
137.6860 +        11,11,12,11, 6, 6, 6, 6, 7, 7, 7, 8, 8, 9, 9,10,
137.6861 +        10,11,11,11,12, 7, 7, 7, 7, 7, 8, 8, 9, 9, 9, 9,
137.6862 +        10,10,11,11,12,12, 7, 7, 7, 7, 7, 8, 8, 9, 9, 9,
137.6863 +         9,10,10,11,11,12,12, 8, 8, 8, 8, 8, 9, 8,10, 9,
137.6864 +        10,10,11,10,12,11,13,12, 8, 8, 8, 8, 8, 9, 9, 9,
137.6865 +        10,10,10,10,11,11,12,12,12, 8, 8, 8, 9, 9, 9, 9,
137.6866 +        10,10,11,10,12,11,12,12,13,12, 8, 8, 8, 9, 9, 9,
137.6867 +         9,10,10,10,11,11,11,12,12,12,13, 9, 9, 9,10,10,
137.6868 +        10,10,11,10,11,11,12,11,13,12,13,13, 9, 9,10,10,
137.6869 +        10,10,10,10,11,11,11,11,12,12,13,13,13,10,11,10,
137.6870 +        11,11,11,11,12,11,12,12,13,12,13,13,14,13,10,10,
137.6871 +        10,11,11,11,11,11,12,12,12,12,13,13,13,13,14,11,
137.6872 +        11,11,12,11,12,12,12,12,13,13,13,13,14,13,14,14,
137.6873 +        11,11,11,11,12,12,12,12,12,12,13,13,13,13,14,14,
137.6874 +        14,
137.6875 +};
137.6876 +
137.6877 +static const static_codebook _44u9_p4_0 = {
137.6878 +        2, 289,
137.6879 +        (long *)_vq_lengthlist__44u9_p4_0,
137.6880 +        1, -529530880, 1611661312, 5, 0,
137.6881 +        (long *)_vq_quantlist__44u9_p4_0,
137.6882 +        0
137.6883 +};
137.6884 +
137.6885 +static const long _vq_quantlist__44u9_p5_0[] = {
137.6886 +        1,
137.6887 +        0,
137.6888 +        2,
137.6889 +};
137.6890 +
137.6891 +static const long _vq_lengthlist__44u9_p5_0[] = {
137.6892 +         1, 4, 4, 5, 7, 7, 5, 7, 7, 5, 8, 8, 8, 9, 9, 7,
137.6893 +         9, 9, 5, 8, 8, 7, 9, 9, 8, 9, 9, 5, 8, 8, 8,10,
137.6894 +        10, 8,10,10, 7,10,10, 9,10,12, 9,11,11, 7,10,10,
137.6895 +         9,11,10, 9,11,12, 5, 8, 8, 8,10,10, 8,10,10, 7,
137.6896 +        10,10, 9,12,11, 9,10,11, 7,10,10, 9,11,11,10,12,
137.6897 +        10,
137.6898 +};
137.6899 +
137.6900 +static const static_codebook _44u9_p5_0 = {
137.6901 +        4, 81,
137.6902 +        (long *)_vq_lengthlist__44u9_p5_0,
137.6903 +        1, -529137664, 1618345984, 2, 0,
137.6904 +        (long *)_vq_quantlist__44u9_p5_0,
137.6905 +        0
137.6906 +};
137.6907 +
137.6908 +static const long _vq_quantlist__44u9_p5_1[] = {
137.6909 +        5,
137.6910 +        4,
137.6911 +        6,
137.6912 +        3,
137.6913 +        7,
137.6914 +        2,
137.6915 +        8,
137.6916 +        1,
137.6917 +        9,
137.6918 +        0,
137.6919 +        10,
137.6920 +};
137.6921 +
137.6922 +static const long _vq_lengthlist__44u9_p5_1[] = {
137.6923 +         5, 5, 5, 6, 6, 7, 7, 7, 7, 7, 7, 5, 6, 6, 6, 6,
137.6924 +         7, 7, 7, 7, 8, 7, 5, 6, 6, 6, 6, 7, 7, 7, 7, 7,
137.6925 +         7, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 6, 6, 6, 7,
137.6926 +         7, 7, 7, 7, 7, 8, 8, 7, 7, 7, 7, 7, 8, 7, 8, 8,
137.6927 +         8, 8, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 7, 7, 7,
137.6928 +         8, 7, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 8, 8, 8, 8,
137.6929 +         8, 8, 8, 7, 8, 7, 8, 8, 8, 8, 8, 8, 8, 8, 7, 8,
137.6930 +         8, 8, 8, 8, 8, 8, 8, 8, 8,
137.6931 +};
137.6932 +
137.6933 +static const static_codebook _44u9_p5_1 = {
137.6934 +        2, 121,
137.6935 +        (long *)_vq_lengthlist__44u9_p5_1,
137.6936 +        1, -531365888, 1611661312, 4, 0,
137.6937 +        (long *)_vq_quantlist__44u9_p5_1,
137.6938 +        0
137.6939 +};
137.6940 +
137.6941 +static const long _vq_quantlist__44u9_p6_0[] = {
137.6942 +        6,
137.6943 +        5,
137.6944 +        7,
137.6945 +        4,
137.6946 +        8,
137.6947 +        3,
137.6948 +        9,
137.6949 +        2,
137.6950 +        10,
137.6951 +        1,
137.6952 +        11,
137.6953 +        0,
137.6954 +        12,
137.6955 +};
137.6956 +
137.6957 +static const long _vq_lengthlist__44u9_p6_0[] = {
137.6958 +         2, 4, 4, 6, 6, 7, 7, 8, 8, 9, 9,10,10, 4, 6, 5,
137.6959 +         7, 7, 8, 8, 8, 8, 9, 9,10,10, 4, 5, 6, 7, 7, 8,
137.6960 +         8, 8, 8, 9, 9,10,10, 6, 7, 7, 8, 8, 8, 8, 9, 9,
137.6961 +        10,10,10,10, 6, 7, 7, 8, 8, 8, 8, 9, 9,10,10,10,
137.6962 +        10, 7, 8, 8, 8, 8, 9, 9, 9, 9,10,10,11,11, 7, 8,
137.6963 +         8, 8, 8, 9, 9, 9, 9,10,10,11,11, 8, 8, 8, 9, 9,
137.6964 +         9, 9, 9,10,10,10,11,11, 8, 8, 8, 9, 9, 9, 9,10,
137.6965 +         9,10,10,11,11, 9, 9, 9,10,10,10,10,10,11,11,11,
137.6966 +        11,12, 9, 9, 9,10,10,10,10,10,10,11,10,12,11,10,
137.6967 +        10,10,10,10,11,11,11,11,11,12,12,12,10,10,10,10,
137.6968 +        10,11,11,11,11,12,11,12,12,
137.6969 +};
137.6970 +
137.6971 +static const static_codebook _44u9_p6_0 = {
137.6972 +        2, 169,
137.6973 +        (long *)_vq_lengthlist__44u9_p6_0,
137.6974 +        1, -526516224, 1616117760, 4, 0,
137.6975 +        (long *)_vq_quantlist__44u9_p6_0,
137.6976 +        0
137.6977 +};
137.6978 +
137.6979 +static const long _vq_quantlist__44u9_p6_1[] = {
137.6980 +        2,
137.6981 +        1,
137.6982 +        3,
137.6983 +        0,
137.6984 +        4,
137.6985 +};
137.6986 +
137.6987 +static const long _vq_lengthlist__44u9_p6_1[] = {
137.6988 +         4, 4, 4, 5, 5, 4, 5, 4, 5, 5, 4, 4, 5, 5, 5, 5,
137.6989 +         5, 5, 5, 5, 5, 5, 5, 5, 5,
137.6990 +};
137.6991 +
137.6992 +static const static_codebook _44u9_p6_1 = {
137.6993 +        2, 25,
137.6994 +        (long *)_vq_lengthlist__44u9_p6_1,
137.6995 +        1, -533725184, 1611661312, 3, 0,
137.6996 +        (long *)_vq_quantlist__44u9_p6_1,
137.6997 +        0
137.6998 +};
137.6999 +
137.7000 +static const long _vq_quantlist__44u9_p7_0[] = {
137.7001 +        6,
137.7002 +        5,
137.7003 +        7,
137.7004 +        4,
137.7005 +        8,
137.7006 +        3,
137.7007 +        9,
137.7008 +        2,
137.7009 +        10,
137.7010 +        1,
137.7011 +        11,
137.7012 +        0,
137.7013 +        12,
137.7014 +};
137.7015 +
137.7016 +static const long _vq_lengthlist__44u9_p7_0[] = {
137.7017 +         1, 4, 5, 6, 6, 7, 7, 8, 9,10,10,11,11, 5, 6, 6,
137.7018 +         7, 7, 8, 8, 9, 9,10,10,11,11, 5, 6, 6, 7, 7, 8,
137.7019 +         8, 9, 9,10,10,11,11, 6, 7, 7, 8, 8, 9, 9,10,10,
137.7020 +        11,11,12,12, 6, 7, 7, 8, 8, 9, 9,10,10,11,11,12,
137.7021 +        12, 8, 8, 8, 9, 9,10,10,11,11,12,12,13,13, 8, 8,
137.7022 +         8, 9, 9,10,10,11,11,12,12,13,13, 9, 9, 9,10,10,
137.7023 +        11,11,12,12,13,13,13,13, 9, 9, 9,10,10,11,11,12,
137.7024 +        12,13,13,14,14,10,10,10,11,11,12,12,13,13,14,13,
137.7025 +        15,14,10,10,10,11,11,12,12,13,13,14,14,14,14,11,
137.7026 +        11,12,12,12,13,13,14,14,14,14,15,15,11,11,12,12,
137.7027 +        12,13,13,14,14,14,15,15,15,
137.7028 +};
137.7029 +
137.7030 +static const static_codebook _44u9_p7_0 = {
137.7031 +        2, 169,
137.7032 +        (long *)_vq_lengthlist__44u9_p7_0,
137.7033 +        1, -523206656, 1618345984, 4, 0,
137.7034 +        (long *)_vq_quantlist__44u9_p7_0,
137.7035 +        0
137.7036 +};
137.7037 +
137.7038 +static const long _vq_quantlist__44u9_p7_1[] = {
137.7039 +        5,
137.7040 +        4,
137.7041 +        6,
137.7042 +        3,
137.7043 +        7,
137.7044 +        2,
137.7045 +        8,
137.7046 +        1,
137.7047 +        9,
137.7048 +        0,
137.7049 +        10,
137.7050 +};
137.7051 +
137.7052 +static const long _vq_lengthlist__44u9_p7_1[] = {
137.7053 +         5, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 7, 7,
137.7054 +         7, 7, 7, 7, 7, 7, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7,
137.7055 +         7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 7, 7, 7,
137.7056 +         7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
137.7057 +         7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
137.7058 +         7, 7, 7, 7, 8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
137.7059 +         7, 8, 8, 7, 7, 7, 7, 7, 7, 7, 8, 7, 8, 8, 7, 7,
137.7060 +         7, 7, 7, 7, 7, 8, 8, 8, 8,
137.7061 +};
137.7062 +
137.7063 +static const static_codebook _44u9_p7_1 = {
137.7064 +        2, 121,
137.7065 +        (long *)_vq_lengthlist__44u9_p7_1,
137.7066 +        1, -531365888, 1611661312, 4, 0,
137.7067 +        (long *)_vq_quantlist__44u9_p7_1,
137.7068 +        0
137.7069 +};
137.7070 +
137.7071 +static const long _vq_quantlist__44u9_p8_0[] = {
137.7072 +        7,
137.7073 +        6,
137.7074 +        8,
137.7075 +        5,
137.7076 +        9,
137.7077 +        4,
137.7078 +        10,
137.7079 +        3,
137.7080 +        11,
137.7081 +        2,
137.7082 +        12,
137.7083 +        1,
137.7084 +        13,
137.7085 +        0,
137.7086 +        14,
137.7087 +};
137.7088 +
137.7089 +static const long _vq_lengthlist__44u9_p8_0[] = {
137.7090 +         1, 4, 4, 7, 7, 8, 8, 8, 8, 9, 9,10, 9,11,10, 4,
137.7091 +         6, 6, 8, 8, 9, 9, 9, 9,10,10,11,10,12,10, 4, 6,
137.7092 +         6, 8, 8, 9,10, 9, 9,10,10,11,11,12,12, 7, 8, 8,
137.7093 +        10,10,11,11,10,10,11,11,12,12,13,12, 7, 8, 8,10,
137.7094 +        10,11,11,10,10,11,11,12,12,12,13, 8,10, 9,11,11,
137.7095 +        12,12,11,11,12,12,13,13,14,13, 8, 9, 9,11,11,12,
137.7096 +        12,11,12,12,12,13,13,14,13, 8, 9, 9,10,10,12,11,
137.7097 +        13,12,13,13,14,13,15,14, 8, 9, 9,10,10,11,12,12,
137.7098 +        12,13,13,13,14,14,14, 9,10,10,12,11,13,12,13,13,
137.7099 +        14,13,14,14,14,15, 9,10,10,11,12,12,12,13,13,14,
137.7100 +        14,14,15,15,15,10,11,11,12,12,13,13,14,14,14,14,
137.7101 +        15,14,16,15,10,11,11,12,12,13,13,13,14,14,14,14,
137.7102 +        14,15,16,11,12,12,13,13,14,13,14,14,15,14,15,16,
137.7103 +        16,16,11,12,12,13,13,14,13,14,14,15,15,15,16,15,
137.7104 +        15,
137.7105 +};
137.7106 +
137.7107 +static const static_codebook _44u9_p8_0 = {
137.7108 +        2, 225,
137.7109 +        (long *)_vq_lengthlist__44u9_p8_0,
137.7110 +        1, -520986624, 1620377600, 4, 0,
137.7111 +        (long *)_vq_quantlist__44u9_p8_0,
137.7112 +        0
137.7113 +};
137.7114 +
137.7115 +static const long _vq_quantlist__44u9_p8_1[] = {
137.7116 +        10,
137.7117 +        9,
137.7118 +        11,
137.7119 +        8,
137.7120 +        12,
137.7121 +        7,
137.7122 +        13,
137.7123 +        6,
137.7124 +        14,
137.7125 +        5,
137.7126 +        15,
137.7127 +        4,
137.7128 +        16,
137.7129 +        3,
137.7130 +        17,
137.7131 +        2,
137.7132 +        18,
137.7133 +        1,
137.7134 +        19,
137.7135 +        0,
137.7136 +        20,
137.7137 +};
137.7138 +
137.7139 +static const long _vq_lengthlist__44u9_p8_1[] = {
137.7140 +         4, 6, 6, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9,
137.7141 +         9, 9, 9, 9, 9, 6, 6, 6, 7, 7, 8, 8, 8, 8, 9, 9,
137.7142 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 6, 6, 6, 7, 7, 8,
137.7143 +         8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 7,
137.7144 +         7, 7, 8, 8, 8, 8, 9, 8, 9, 9, 9, 9, 9, 9, 9, 9,
137.7145 +         9, 9, 9, 9, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9,
137.7146 +         9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 9, 9,
137.7147 +         9, 9, 9, 9, 9, 9, 9, 9, 9,10, 9,10,10,10, 8, 8,
137.7148 +         8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
137.7149 +         9,10,10, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
137.7150 +        10, 9,10, 9,10,10,10,10, 8, 8, 8, 9, 9, 9, 9, 9,
137.7151 +         9, 9, 9, 9, 9,10,10, 9,10,10,10,10,10, 9, 9, 9,
137.7152 +         9, 9, 9, 9, 9, 9, 9, 9,10, 9,10,10,10,10,10,10,
137.7153 +        10,10, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,10,10,10,
137.7154 +        10,10,10,10,10,10,10, 9, 9, 9, 9, 9, 9, 9, 9, 9,
137.7155 +         9, 9,10,10,10,10,10,10,10,10,10,10, 9, 9, 9, 9,
137.7156 +         9, 9, 9, 9, 9, 9, 9,10,10,10,10,10,10,10,10,10,
137.7157 +        10, 9, 9, 9, 9, 9, 9, 9,10, 9,10,10,10,10,10,10,
137.7158 +        10,10,10,10,10,10, 9, 9, 9, 9, 9, 9, 9, 9,10,10,
137.7159 +        10,10,10,10,10,10,10,10,10,10,10, 9, 9, 9, 9, 9,
137.7160 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
137.7161 +         9, 9, 9, 9,10, 9, 9,10,10,10,10,10,10,10,10,10,
137.7162 +        10,10,10,10,10, 9, 9, 9,10, 9,10, 9,10,10,10,10,
137.7163 +        10,10,10,10,10,10,10,10,10,10, 9, 9, 9,10, 9,10,
137.7164 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, 9,
137.7165 +         9, 9, 9, 9,10,10,10,10,10,10,10,10,10,10,10,10,
137.7166 +        10,10,10,10, 9, 9, 9,10,10,10,10,10,10,10,10,10,
137.7167 +        10,10,10,10,10,10,10,10,10,
137.7168 +};
137.7169 +
137.7170 +static const static_codebook _44u9_p8_1 = {
137.7171 +        2, 441,
137.7172 +        (long *)_vq_lengthlist__44u9_p8_1,
137.7173 +        1, -529268736, 1611661312, 5, 0,
137.7174 +        (long *)_vq_quantlist__44u9_p8_1,
137.7175 +        0
137.7176 +};
137.7177 +
137.7178 +static const long _vq_quantlist__44u9_p9_0[] = {
137.7179 +        7,
137.7180 +        6,
137.7181 +        8,
137.7182 +        5,
137.7183 +        9,
137.7184 +        4,
137.7185 +        10,
137.7186 +        3,
137.7187 +        11,
137.7188 +        2,
137.7189 +        12,
137.7190 +        1,
137.7191 +        13,
137.7192 +        0,
137.7193 +        14,
137.7194 +};
137.7195 +
137.7196 +static const long _vq_lengthlist__44u9_p9_0[] = {
137.7197 +         1, 3, 3,11,11,11,11,11,11,11,11,11,11,11,11, 4,
137.7198 +        10,11,11,11,11,11,11,11,11,11,11,11,11,11, 4,10,
137.7199 +        10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.7200 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.7201 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.7202 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.7203 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.7204 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.7205 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.7206 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.7207 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.7208 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.7209 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
137.7210 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
137.7211 +        10,
137.7212 +};
137.7213 +
137.7214 +static const static_codebook _44u9_p9_0 = {
137.7215 +        2, 225,
137.7216 +        (long *)_vq_lengthlist__44u9_p9_0,
137.7217 +        1, -510036736, 1631393792, 4, 0,
137.7218 +        (long *)_vq_quantlist__44u9_p9_0,
137.7219 +        0
137.7220 +};
137.7221 +
137.7222 +static const long _vq_quantlist__44u9_p9_1[] = {
137.7223 +        9,
137.7224 +        8,
137.7225 +        10,
137.7226 +        7,
137.7227 +        11,
137.7228 +        6,
137.7229 +        12,
137.7230 +        5,
137.7231 +        13,
137.7232 +        4,
137.7233 +        14,
137.7234 +        3,
137.7235 +        15,
137.7236 +        2,
137.7237 +        16,
137.7238 +        1,
137.7239 +        17,
137.7240 +        0,
137.7241 +        18,
137.7242 +};
137.7243 +
137.7244 +static const long _vq_lengthlist__44u9_p9_1[] = {
137.7245 +         1, 4, 4, 7, 7, 8, 7, 8, 7, 9, 8,10, 9,10,10,11,
137.7246 +        11,12,12, 4, 7, 6, 9, 9,10, 9, 9, 8,10,10,11,10,
137.7247 +        12,10,13,12,13,12, 4, 6, 6, 9, 9, 9, 9, 9, 9,10,
137.7248 +        10,11,11,11,12,12,12,12,12, 7, 9, 8,11,10,10,10,
137.7249 +        11,10,11,11,12,12,13,12,13,13,13,13, 7, 8, 9,10,
137.7250 +        10,11,11,10,10,11,11,11,12,13,13,13,13,14,14, 8,
137.7251 +         9, 9,11,11,12,11,12,12,13,12,12,13,13,14,15,14,
137.7252 +        14,14, 8, 9, 9,10,11,11,11,12,12,13,12,13,13,14,
137.7253 +        14,14,15,14,16, 8, 9, 9,11,10,12,12,12,12,15,13,
137.7254 +        13,13,17,14,15,15,15,14, 8, 9, 9,10,11,11,12,13,
137.7255 +        12,13,13,13,14,15,14,14,14,16,15, 9,11,10,12,12,
137.7256 +        13,13,13,13,14,14,16,15,14,14,14,15,15,17, 9,10,
137.7257 +        10,11,11,13,13,13,14,14,13,15,14,15,14,15,16,15,
137.7258 +        16,10,11,11,12,12,13,14,15,14,15,14,14,15,17,16,
137.7259 +        15,15,17,17,10,12,11,13,12,14,14,13,14,15,15,15,
137.7260 +        15,16,17,17,15,17,16,11,12,12,14,13,15,14,15,16,
137.7261 +        17,15,17,15,17,15,15,16,17,15,11,11,12,14,14,14,
137.7262 +        14,14,15,15,16,15,17,17,17,16,17,16,15,12,12,13,
137.7263 +        14,14,14,15,14,15,15,16,16,17,16,17,15,17,17,16,
137.7264 +        12,14,12,14,14,15,15,15,14,14,16,16,16,15,16,16,
137.7265 +        15,17,15,12,13,13,14,15,14,15,17,15,17,16,17,17,
137.7266 +        17,16,17,16,17,17,12,13,13,14,16,15,15,15,16,15,
137.7267 +        17,17,15,17,15,17,16,16,17,
137.7268 +};
137.7269 +
137.7270 +static const static_codebook _44u9_p9_1 = {
137.7271 +        2, 361,
137.7272 +        (long *)_vq_lengthlist__44u9_p9_1,
137.7273 +        1, -518287360, 1622704128, 5, 0,
137.7274 +        (long *)_vq_quantlist__44u9_p9_1,
137.7275 +        0
137.7276 +};
137.7277 +
137.7278 +static const long _vq_quantlist__44u9_p9_2[] = {
137.7279 +        24,
137.7280 +        23,
137.7281 +        25,
137.7282 +        22,
137.7283 +        26,
137.7284 +        21,
137.7285 +        27,
137.7286 +        20,
137.7287 +        28,
137.7288 +        19,
137.7289 +        29,
137.7290 +        18,
137.7291 +        30,
137.7292 +        17,
137.7293 +        31,
137.7294 +        16,
137.7295 +        32,
137.7296 +        15,
137.7297 +        33,
137.7298 +        14,
137.7299 +        34,
137.7300 +        13,
137.7301 +        35,
137.7302 +        12,
137.7303 +        36,
137.7304 +        11,
137.7305 +        37,
137.7306 +        10,
137.7307 +        38,
137.7308 +        9,
137.7309 +        39,
137.7310 +        8,
137.7311 +        40,
137.7312 +        7,
137.7313 +        41,
137.7314 +        6,
137.7315 +        42,
137.7316 +        5,
137.7317 +        43,
137.7318 +        4,
137.7319 +        44,
137.7320 +        3,
137.7321 +        45,
137.7322 +        2,
137.7323 +        46,
137.7324 +        1,
137.7325 +        47,
137.7326 +        0,
137.7327 +        48,
137.7328 +};
137.7329 +
137.7330 +static const long _vq_lengthlist__44u9_p9_2[] = {
137.7331 +         2, 4, 4, 5, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6,
137.7332 +         6, 6, 6, 7, 6, 7, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7,
137.7333 +         7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
137.7334 +         7,
137.7335 +};
137.7336 +
137.7337 +static const static_codebook _44u9_p9_2 = {
137.7338 +        1, 49,
137.7339 +        (long *)_vq_lengthlist__44u9_p9_2,
137.7340 +        1, -526909440, 1611661312, 6, 0,
137.7341 +        (long *)_vq_quantlist__44u9_p9_2,
137.7342 +        0
137.7343 +};
137.7344 +
137.7345 +static const long _huff_lengthlist__44un1__long[] = {
137.7346 +         5, 6,12, 9,14, 9, 9,19, 6, 1, 5, 5, 8, 7, 9,19,
137.7347 +        12, 4, 4, 7, 7, 9,11,18, 9, 5, 6, 6, 8, 7, 8,17,
137.7348 +        14, 8, 7, 8, 8,10,12,18, 9, 6, 8, 6, 8, 6, 8,18,
137.7349 +         9, 8,11, 8,11, 7, 5,15,16,18,18,18,17,15,11,18,
137.7350 +};
137.7351 +
137.7352 +static const static_codebook _huff_book__44un1__long = {
137.7353 +        2, 64,
137.7354 +        (long *)_huff_lengthlist__44un1__long,
137.7355 +        0, 0, 0, 0, 0,
137.7356 +        NULL,
137.7357 +        0
137.7358 +};
137.7359 +
137.7360 +static const long _vq_quantlist__44un1__p1_0[] = {
137.7361 +        1,
137.7362 +        0,
137.7363 +        2,
137.7364 +};
137.7365 +
137.7366 +static const long _vq_lengthlist__44un1__p1_0[] = {
137.7367 +         1, 4, 4, 5, 8, 7, 5, 7, 8, 5, 8, 8, 8,10,11, 8,
137.7368 +        10,11, 5, 8, 8, 8,11,10, 8,11,10, 4, 9, 9, 8,11,
137.7369 +        11, 8,11,11, 8,12,11,10,12,14,11,13,13, 7,11,11,
137.7370 +        10,13,11,11,13,14, 4, 8, 9, 8,11,11, 8,11,12, 7,
137.7371 +        11,11,11,14,13,10,11,13, 8,11,12,11,13,13,10,14,
137.7372 +        12,
137.7373 +};
137.7374 +
137.7375 +static const static_codebook _44un1__p1_0 = {
137.7376 +        4, 81,
137.7377 +        (long *)_vq_lengthlist__44un1__p1_0,
137.7378 +        1, -535822336, 1611661312, 2, 0,
137.7379 +        (long *)_vq_quantlist__44un1__p1_0,
137.7380 +        0
137.7381 +};
137.7382 +
137.7383 +static const long _vq_quantlist__44un1__p2_0[] = {
137.7384 +        1,
137.7385 +        0,
137.7386 +        2,
137.7387 +};
137.7388 +
137.7389 +static const long _vq_lengthlist__44un1__p2_0[] = {
137.7390 +         2, 4, 4, 5, 6, 6, 5, 6, 6, 5, 7, 7, 7, 8, 8, 6,
137.7391 +         7, 9, 5, 7, 7, 6, 8, 7, 7, 9, 8, 4, 7, 7, 7, 9,
137.7392 +         8, 7, 8, 8, 7, 9, 8, 8, 8,10, 9,10,10, 6, 8, 8,
137.7393 +         7,10, 8, 9,10,10, 5, 7, 7, 7, 8, 8, 7, 8, 9, 6,
137.7394 +         8, 8, 9,10,10, 7, 8,10, 6, 8, 9, 9,10,10, 8,10,
137.7395 +         8,
137.7396 +};
137.7397 +
137.7398 +static const static_codebook _44un1__p2_0 = {
137.7399 +        4, 81,
137.7400 +        (long *)_vq_lengthlist__44un1__p2_0,
137.7401 +        1, -535822336, 1611661312, 2, 0,
137.7402 +        (long *)_vq_quantlist__44un1__p2_0,
137.7403 +        0
137.7404 +};
137.7405 +
137.7406 +static const long _vq_quantlist__44un1__p3_0[] = {
137.7407 +        2,
137.7408 +        1,
137.7409 +        3,
137.7410 +        0,
137.7411 +        4,
137.7412 +};
137.7413 +
137.7414 +static const long _vq_lengthlist__44un1__p3_0[] = {
137.7415 +         1, 5, 5, 8, 8, 5, 8, 7, 9, 9, 5, 7, 8, 9, 9, 9,
137.7416 +        10, 9,12,12, 9, 9,10,11,12, 6, 8, 8,10,10, 8,10,
137.7417 +        10,11,11, 8, 9,10,11,11,10,11,11,13,13,10,11,11,
137.7418 +        12,13, 6, 8, 8,10,10, 8,10, 9,11,11, 8,10,10,11,
137.7419 +        11,10,11,11,13,12,10,11,11,13,12, 9,11,11,15,13,
137.7420 +        10,12,11,15,13,10,11,11,15,14,12,14,13,16,15,12,
137.7421 +        13,13,17,16, 9,11,11,13,15,10,11,12,14,15,10,11,
137.7422 +        12,14,15,12,13,13,15,16,12,13,13,16,16, 5, 8, 8,
137.7423 +        11,11, 8,10,10,12,12, 8,10,10,12,12,11,12,12,14,
137.7424 +        14,11,12,12,14,14, 8,11,10,13,12,10,11,12,12,13,
137.7425 +        10,12,12,13,13,12,12,13,13,15,11,12,13,15,14, 7,
137.7426 +        10,10,12,12, 9,12,11,13,12,10,12,12,13,14,12,13,
137.7427 +        12,15,13,11,13,12,14,15,10,12,12,16,14,11,12,12,
137.7428 +        16,15,11,13,12,17,16,13,13,15,15,17,13,15,15,20,
137.7429 +        17,10,12,12,14,16,11,12,12,15,15,11,13,13,15,18,
137.7430 +        13,14,13,15,15,13,15,14,16,16, 5, 8, 8,11,11, 8,
137.7431 +        10,10,12,12, 8,10,10,12,12,11,12,12,14,14,11,12,
137.7432 +        12,14,15, 7,10,10,13,12,10,12,12,14,13, 9,10,12,
137.7433 +        12,13,11,13,13,15,15,11,12,13,13,15, 8,10,10,12,
137.7434 +        13,10,12,12,13,13,10,12,11,13,13,11,13,12,15,15,
137.7435 +        12,13,12,15,13,10,12,12,16,14,11,12,12,16,15,10,
137.7436 +        12,12,16,14,14,15,14,18,16,13,13,14,15,16,10,12,
137.7437 +        12,14,16,11,13,13,16,16,11,13,12,14,16,13,15,15,
137.7438 +        18,18,13,15,13,16,14, 8,11,11,16,16,10,13,13,17,
137.7439 +        16,10,12,12,16,15,14,16,15,20,17,13,14,14,17,17,
137.7440 +         9,12,12,16,16,11,13,14,16,17,11,13,13,16,16,15,
137.7441 +        15,19,18, 0,14,15,15,18,18, 9,12,12,17,16,11,13,
137.7442 +        12,17,16,11,12,13,15,17,15,16,15, 0,19,14,15,14,
137.7443 +        19,18,12,14,14, 0,16,13,14,14,19,18,13,15,16,17,
137.7444 +        16,15,15,17,18, 0,14,16,16,19, 0,12,14,14,16,18,
137.7445 +        13,15,13,17,18,13,15,14,17,18,15,18,14,18,18,16,
137.7446 +        17,16, 0,17, 8,11,11,15,15,10,12,12,16,16,10,13,
137.7447 +        13,16,16,13,15,14,17,17,14,15,17,17,18, 9,12,12,
137.7448 +        16,15,11,13,13,16,16,11,12,13,17,17,14,14,15,17,
137.7449 +        17,14,15,16, 0,18, 9,12,12,16,17,11,13,13,16,17,
137.7450 +        11,14,13,18,17,14,16,14,17,17,15,17,17,18,18,12,
137.7451 +        14,14, 0,16,13,15,15,19, 0,12,13,15, 0, 0,14,17,
137.7452 +        16,19, 0,16,15,18,18, 0,12,14,14,17, 0,13,14,14,
137.7453 +        17, 0,13,15,14, 0,18,15,16,16, 0,18,15,18,15, 0,
137.7454 +        17,
137.7455 +};
137.7456 +
137.7457 +static const static_codebook _44un1__p3_0 = {
137.7458 +        4, 625,
137.7459 +        (long *)_vq_lengthlist__44un1__p3_0,
137.7460 +        1, -533725184, 1611661312, 3, 0,
137.7461 +        (long *)_vq_quantlist__44un1__p3_0,
137.7462 +        0
137.7463 +};
137.7464 +
137.7465 +static const long _vq_quantlist__44un1__p4_0[] = {
137.7466 +        2,
137.7467 +        1,
137.7468 +        3,
137.7469 +        0,
137.7470 +        4,
137.7471 +};
137.7472 +
137.7473 +static const long _vq_lengthlist__44un1__p4_0[] = {
137.7474 +         3, 5, 5, 9, 9, 5, 6, 6,10, 9, 5, 6, 6, 9,10,10,
137.7475 +        10,10,12,11, 9,10,10,12,12, 5, 7, 7,10,10, 7, 7,
137.7476 +         8,10,11, 7, 7, 8,10,11,10,10,11,11,13,10,10,11,
137.7477 +        11,13, 6, 7, 7,10,10, 7, 8, 7,11,10, 7, 8, 7,10,
137.7478 +        10,10,11, 9,13,11,10,11,10,13,11,10,10,10,14,13,
137.7479 +        10,11,11,14,13,10,10,11,13,14,12,12,13,15,15,12,
137.7480 +        12,13,13,14,10,10,10,12,13,10,11,10,13,13,10,11,
137.7481 +        11,13,13,12,13,12,14,13,12,13,13,14,13, 5, 7, 7,
137.7482 +        10,10, 7, 8, 8,11,10, 7, 8, 8,10,10,11,11,11,13,
137.7483 +        13,10,11,11,12,12, 7, 8, 8,11,11, 7, 8, 9,10,12,
137.7484 +         8, 9, 9,11,11,11,10,12,11,14,11,11,12,13,13, 6,
137.7485 +         8, 8,10,11, 7, 9, 7,12,10, 8, 9,10,11,12,10,12,
137.7486 +        10,14,11,11,12,11,13,13,10,11,11,14,14,10,10,11,
137.7487 +        13,14,11,12,12,15,13,12,11,14,12,16,12,13,14,15,
137.7488 +        16,10,10,11,13,14,10,11,10,14,12,11,12,12,13,14,
137.7489 +        12,13,11,15,12,14,14,14,15,15, 5, 7, 7,10,10, 7,
137.7490 +         8, 8,10,10, 7, 8, 8,10,11,10,11,10,12,12,10,11,
137.7491 +        11,12,13, 6, 8, 8,11,11, 8, 9, 9,12,11, 7, 7, 9,
137.7492 +        10,12,11,11,11,12,13,11,10,12,11,15, 7, 8, 8,11,
137.7493 +        11, 8, 9, 9,11,11, 7, 9, 8,12,10,11,12,11,13,12,
137.7494 +        11,12,10,15,11,10,11,10,14,12,11,12,11,14,13,10,
137.7495 +        10,11,13,14,13,13,13,17,15,12,11,14,12,15,10,10,
137.7496 +        11,13,14,11,12,12,14,14,10,11,10,14,13,13,14,13,
137.7497 +        16,17,12,14,11,16,12, 9,10,10,14,13,10,11,10,14,
137.7498 +        14,10,11,11,13,13,13,14,14,16,15,12,13,13,14,14,
137.7499 +         9,11,10,14,13,10,10,12,13,14,11,12,11,14,13,13,
137.7500 +        14,14,14,15,13,14,14,15,15, 9,10,11,13,14,10,11,
137.7501 +        10,15,13,11,11,12,12,15,13,14,12,15,14,13,13,14,
137.7502 +        14,15,12,13,12,16,14,11,11,12,15,14,13,15,13,16,
137.7503 +        14,13,12,15,12,17,15,16,15,16,16,12,12,13,13,15,
137.7504 +        11,13,11,15,14,13,13,14,15,17,13,14,12, 0,13,14,
137.7505 +        15,14,15, 0, 9,10,10,13,13,10,11,11,13,13,10,11,
137.7506 +        11,13,13,12,13,12,14,14,13,14,14,15,17, 9,10,10,
137.7507 +        13,13,11,12,11,15,12,10,10,11,13,16,13,14,13,15,
137.7508 +        14,13,13,14,15,16,10,10,11,13,14,11,11,12,13,14,
137.7509 +        10,12,11,14,14,13,13,13,14,15,13,15,13,16,15,12,
137.7510 +        13,12,15,13,12,15,13,15,15,11,11,13,14,15,15,15,
137.7511 +        15,15,17,13,12,14,13,17,12,12,14,14,15,13,13,14,
137.7512 +        14,16,11,13,11,16,15,14,16,16,17, 0,14,13,11,16,
137.7513 +        12,
137.7514 +};
137.7515 +
137.7516 +static const static_codebook _44un1__p4_0 = {
137.7517 +        4, 625,
137.7518 +        (long *)_vq_lengthlist__44un1__p4_0,
137.7519 +        1, -533725184, 1611661312, 3, 0,
137.7520 +        (long *)_vq_quantlist__44un1__p4_0,
137.7521 +        0
137.7522 +};
137.7523 +
137.7524 +static const long _vq_quantlist__44un1__p5_0[] = {
137.7525 +        4,
137.7526 +        3,
137.7527 +        5,
137.7528 +        2,
137.7529 +        6,
137.7530 +        1,
137.7531 +        7,
137.7532 +        0,
137.7533 +        8,
137.7534 +};
137.7535 +
137.7536 +static const long _vq_lengthlist__44un1__p5_0[] = {
137.7537 +         1, 4, 4, 7, 7, 8, 8, 9, 9, 4, 6, 5, 8, 7, 8, 8,
137.7538 +        10, 9, 4, 6, 6, 8, 8, 8, 8,10,10, 7, 8, 7, 9, 9,
137.7539 +         9, 9,11,10, 7, 8, 8, 9, 9, 9, 9,10,11, 8, 8, 8,
137.7540 +         9, 9,10,10,11,11, 8, 8, 8, 9, 9,10,10,11,11, 9,
137.7541 +        10,10,11,10,11,11,12,12, 9,10,10,10,11,11,11,12,
137.7542 +        12,
137.7543 +};
137.7544 +
137.7545 +static const static_codebook _44un1__p5_0 = {
137.7546 +        2, 81,
137.7547 +        (long *)_vq_lengthlist__44un1__p5_0,
137.7548 +        1, -531628032, 1611661312, 4, 0,
137.7549 +        (long *)_vq_quantlist__44un1__p5_0,
137.7550 +        0
137.7551 +};
137.7552 +
137.7553 +static const long _vq_quantlist__44un1__p6_0[] = {
137.7554 +        6,
137.7555 +        5,
137.7556 +        7,
137.7557 +        4,
137.7558 +        8,
137.7559 +        3,
137.7560 +        9,
137.7561 +        2,
137.7562 +        10,
137.7563 +        1,
137.7564 +        11,
137.7565 +        0,
137.7566 +        12,
137.7567 +};
137.7568 +
137.7569 +static const long _vq_lengthlist__44un1__p6_0[] = {
137.7570 +         1, 4, 4, 6, 6, 8, 8,10,10,11,11,15,15, 4, 5, 5,
137.7571 +         8, 8, 9, 9,11,11,12,12,16,16, 4, 5, 6, 8, 8, 9,
137.7572 +         9,11,11,12,12,14,14, 7, 8, 8, 9, 9,10,10,11,12,
137.7573 +        13,13,16,17, 7, 8, 8, 9, 9,10,10,12,12,12,13,15,
137.7574 +        15, 9,10,10,10,10,11,11,12,12,13,13,15,16, 9, 9,
137.7575 +         9,10,10,11,11,13,12,13,13,17,17,10,11,11,11,12,
137.7576 +        12,12,13,13,14,15, 0,18,10,11,11,12,12,12,13,14,
137.7577 +        13,14,14,17,16,11,12,12,13,13,14,14,14,14,15,16,
137.7578 +        17,16,11,12,12,13,13,14,14,14,14,15,15,17,17,14,
137.7579 +        15,15,16,16,16,17,17,16, 0,17, 0,18,14,15,15,16,
137.7580 +        16, 0,15,18,18, 0,16, 0, 0,
137.7581 +};
137.7582 +
137.7583 +static const static_codebook _44un1__p6_0 = {
137.7584 +        2, 169,
137.7585 +        (long *)_vq_lengthlist__44un1__p6_0,
137.7586 +        1, -526516224, 1616117760, 4, 0,
137.7587 +        (long *)_vq_quantlist__44un1__p6_0,
137.7588 +        0
137.7589 +};
137.7590 +
137.7591 +static const long _vq_quantlist__44un1__p6_1[] = {
137.7592 +        2,
137.7593 +        1,
137.7594 +        3,
137.7595 +        0,
137.7596 +        4,
137.7597 +};
137.7598 +
137.7599 +static const long _vq_lengthlist__44un1__p6_1[] = {
137.7600 +         2, 4, 4, 5, 5, 4, 5, 5, 5, 5, 4, 5, 5, 6, 5, 5,
137.7601 +         6, 5, 6, 6, 5, 6, 6, 6, 6,
137.7602 +};
137.7603 +
137.7604 +static const static_codebook _44un1__p6_1 = {
137.7605 +        2, 25,
137.7606 +        (long *)_vq_lengthlist__44un1__p6_1,
137.7607 +        1, -533725184, 1611661312, 3, 0,
137.7608 +        (long *)_vq_quantlist__44un1__p6_1,
137.7609 +        0
137.7610 +};
137.7611 +
137.7612 +static const long _vq_quantlist__44un1__p7_0[] = {
137.7613 +        2,
137.7614 +        1,
137.7615 +        3,
137.7616 +        0,
137.7617 +        4,
137.7618 +};
137.7619 +
137.7620 +static const long _vq_lengthlist__44un1__p7_0[] = {
137.7621 +         1, 5, 3,11,11,11,11,11,11,11, 8,11,11,11,11,11,
137.7622 +        11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,
137.7623 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.7624 +        11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.7625 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.7626 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.7627 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.7628 +        11,11,11,11,11,11,11,11,11,11,11,11,11, 8,11,11,
137.7629 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.7630 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.7631 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,
137.7632 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.7633 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.7634 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.7635 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.7636 +        11,11,11,11,11,11,11,11,11,11, 7,11,11,11,11,11,
137.7637 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.7638 +        11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,
137.7639 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.7640 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.7641 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.7642 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.7643 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.7644 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.7645 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.7646 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.7647 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.7648 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.7649 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.7650 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.7651 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.7652 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.7653 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.7654 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.7655 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.7656 +        11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
137.7657 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
137.7658 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
137.7659 +        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
137.7660 +        10,
137.7661 +};
137.7662 +
137.7663 +static const static_codebook _44un1__p7_0 = {
137.7664 +        4, 625,
137.7665 +        (long *)_vq_lengthlist__44un1__p7_0,
137.7666 +        1, -518709248, 1626677248, 3, 0,
137.7667 +        (long *)_vq_quantlist__44un1__p7_0,
137.7668 +        0
137.7669 +};
137.7670 +
137.7671 +static const long _vq_quantlist__44un1__p7_1[] = {
137.7672 +        6,
137.7673 +        5,
137.7674 +        7,
137.7675 +        4,
137.7676 +        8,
137.7677 +        3,
137.7678 +        9,
137.7679 +        2,
137.7680 +        10,
137.7681 +        1,
137.7682 +        11,
137.7683 +        0,
137.7684 +        12,
137.7685 +};
137.7686 +
137.7687 +static const long _vq_lengthlist__44un1__p7_1[] = {
137.7688 +         1, 4, 4, 6, 6, 6, 6, 9, 8, 9, 8, 8, 8, 5, 7, 7,
137.7689 +         7, 7, 8, 8, 8,10, 8,10, 8, 9, 5, 7, 7, 8, 7, 7,
137.7690 +         8,10,10,11,10,12,11, 7, 8, 8, 9, 9, 9,10,11,11,
137.7691 +        11,11,11,11, 7, 8, 8, 8, 9, 9, 9,10,10,10,11,11,
137.7692 +        12, 7, 8, 8, 9, 9,10,11,11,12,11,12,11,11, 7, 8,
137.7693 +         8, 9, 9,10,10,11,11,11,12,12,11, 8,10,10,10,10,
137.7694 +        11,11,14,11,12,12,12,13, 9,10,10,10,10,12,11,14,
137.7695 +        11,14,11,12,13,10,11,11,11,11,13,11,14,14,13,13,
137.7696 +        13,14,11,11,11,12,11,12,12,12,13,14,14,13,14,12,
137.7697 +        11,12,12,12,12,13,13,13,14,13,14,14,11,12,12,14,
137.7698 +        12,13,13,12,13,13,14,14,14,
137.7699 +};
137.7700 +
137.7701 +static const static_codebook _44un1__p7_1 = {
137.7702 +        2, 169,
137.7703 +        (long *)_vq_lengthlist__44un1__p7_1,
137.7704 +        1, -523010048, 1618608128, 4, 0,
137.7705 +        (long *)_vq_quantlist__44un1__p7_1,
137.7706 +        0
137.7707 +};
137.7708 +
137.7709 +static const long _vq_quantlist__44un1__p7_2[] = {
137.7710 +        6,
137.7711 +        5,
137.7712 +        7,
137.7713 +        4,
137.7714 +        8,
137.7715 +        3,
137.7716 +        9,
137.7717 +        2,
137.7718 +        10,
137.7719 +        1,
137.7720 +        11,
137.7721 +        0,
137.7722 +        12,
137.7723 +};
137.7724 +
137.7725 +static const long _vq_lengthlist__44un1__p7_2[] = {
137.7726 +         3, 4, 4, 6, 6, 7, 7, 8, 8, 9, 9, 9, 8, 4, 5, 5,
137.7727 +         6, 6, 8, 8, 9, 8, 9, 9, 9, 9, 4, 5, 5, 7, 6, 8,
137.7728 +         8, 8, 8, 9, 8, 9, 8, 6, 7, 7, 7, 8, 8, 8, 9, 9,
137.7729 +         9, 9, 9, 9, 6, 7, 7, 7, 7, 8, 8, 9, 9, 9, 9, 9,
137.7730 +         9, 7, 8, 8, 8, 8, 9, 8, 9, 9,10, 9, 9,10, 7, 8,
137.7731 +         8, 8, 8, 9, 9, 9, 9, 9, 9,10,10, 8, 9, 9, 9, 9,
137.7732 +         9, 9, 9, 9,10,10, 9,10, 8, 9, 9, 9, 9, 9, 9, 9,
137.7733 +         9, 9, 9,10,10, 9, 9, 9,10, 9, 9,10, 9, 9,10,10,
137.7734 +        10,10, 9, 9, 9, 9, 9, 9, 9,10, 9,10,10,10,10, 9,
137.7735 +         9, 9,10, 9, 9,10,10, 9,10,10,10,10, 9, 9, 9,10,
137.7736 +         9, 9, 9,10,10,10,10,10,10,
137.7737 +};
137.7738 +
137.7739 +static const static_codebook _44un1__p7_2 = {
137.7740 +        2, 169,
137.7741 +        (long *)_vq_lengthlist__44un1__p7_2,
137.7742 +        1, -531103744, 1611661312, 4, 0,
137.7743 +        (long *)_vq_quantlist__44un1__p7_2,
137.7744 +        0
137.7745 +};
137.7746 +
137.7747 +static const long _huff_lengthlist__44un1__short[] = {
137.7748 +        12,12,14,12,14,14,14,14,12, 6, 6, 8, 9, 9,11,14,
137.7749 +        12, 4, 2, 6, 6, 7,11,14,13, 6, 5, 7, 8, 9,11,14,
137.7750 +        13, 8, 5, 8, 6, 8,12,14,12, 7, 7, 8, 8, 8,10,14,
137.7751 +        12, 6, 3, 4, 4, 4, 7,14,11, 7, 4, 6, 6, 6, 8,14,
137.7752 +};
137.7753 +
137.7754 +static const static_codebook _huff_book__44un1__short = {
137.7755 +        2, 64,
137.7756 +        (long *)_huff_lengthlist__44un1__short,
137.7757 +        0, 0, 0, 0, 0,
137.7758 +        NULL,
137.7759 +        0
137.7760 +};
137.7761 +
   138.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   138.2 +++ b/libs/vorbis/codebook.c	Sun Nov 01 00:36:56 2015 +0200
   138.3 @@ -0,0 +1,484 @@
   138.4 +/********************************************************************
   138.5 + *                                                                  *
   138.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   138.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   138.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   138.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  138.10 + *                                                                  *
  138.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
  138.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  138.13 + *                                                                  *
  138.14 + ********************************************************************
  138.15 +
  138.16 + function: basic codebook pack/unpack/code/decode operations
  138.17 + last mod: $Id: codebook.c 18183 2012-02-03 20:51:27Z xiphmont $
  138.18 +
  138.19 + ********************************************************************/
  138.20 +
  138.21 +#include <stdlib.h>
  138.22 +#include <string.h>
  138.23 +#include <math.h>
  138.24 +#include <ogg/ogg.h>
  138.25 +#include "vorbis/codec.h"
  138.26 +#include "codebook.h"
  138.27 +#include "scales.h"
  138.28 +#include "misc.h"
  138.29 +#include "os.h"
  138.30 +
  138.31 +/* packs the given codebook into the bitstream **************************/
  138.32 +
  138.33 +int vorbis_staticbook_pack(const static_codebook *c,oggpack_buffer *opb){
  138.34 +  long i,j;
  138.35 +  int ordered=0;
  138.36 +
  138.37 +  /* first the basic parameters */
  138.38 +  oggpack_write(opb,0x564342,24);
  138.39 +  oggpack_write(opb,c->dim,16);
  138.40 +  oggpack_write(opb,c->entries,24);
  138.41 +
  138.42 +  /* pack the codewords.  There are two packings; length ordered and
  138.43 +     length random.  Decide between the two now. */
  138.44 +
  138.45 +  for(i=1;i<c->entries;i++)
  138.46 +    if(c->lengthlist[i-1]==0 || c->lengthlist[i]<c->lengthlist[i-1])break;
  138.47 +  if(i==c->entries)ordered=1;
  138.48 +
  138.49 +  if(ordered){
  138.50 +    /* length ordered.  We only need to say how many codewords of
  138.51 +       each length.  The actual codewords are generated
  138.52 +       deterministically */
  138.53 +
  138.54 +    long count=0;
  138.55 +    oggpack_write(opb,1,1);  /* ordered */
  138.56 +    oggpack_write(opb,c->lengthlist[0]-1,5); /* 1 to 32 */
  138.57 +
  138.58 +    for(i=1;i<c->entries;i++){
  138.59 +      long this=c->lengthlist[i];
  138.60 +      long last=c->lengthlist[i-1];
  138.61 +      if(this>last){
  138.62 +        for(j=last;j<this;j++){
  138.63 +          oggpack_write(opb,i-count,_ilog(c->entries-count));
  138.64 +          count=i;
  138.65 +        }
  138.66 +      }
  138.67 +    }
  138.68 +    oggpack_write(opb,i-count,_ilog(c->entries-count));
  138.69 +
  138.70 +  }else{
  138.71 +    /* length random.  Again, we don't code the codeword itself, just
  138.72 +       the length.  This time, though, we have to encode each length */
  138.73 +    oggpack_write(opb,0,1);   /* unordered */
  138.74 +
  138.75 +    /* algortihmic mapping has use for 'unused entries', which we tag
  138.76 +       here.  The algorithmic mapping happens as usual, but the unused
  138.77 +       entry has no codeword. */
  138.78 +    for(i=0;i<c->entries;i++)
  138.79 +      if(c->lengthlist[i]==0)break;
  138.80 +
  138.81 +    if(i==c->entries){
  138.82 +      oggpack_write(opb,0,1); /* no unused entries */
  138.83 +      for(i=0;i<c->entries;i++)
  138.84 +        oggpack_write(opb,c->lengthlist[i]-1,5);
  138.85 +    }else{
  138.86 +      oggpack_write(opb,1,1); /* we have unused entries; thus we tag */
  138.87 +      for(i=0;i<c->entries;i++){
  138.88 +        if(c->lengthlist[i]==0){
  138.89 +          oggpack_write(opb,0,1);
  138.90 +        }else{
  138.91 +          oggpack_write(opb,1,1);
  138.92 +          oggpack_write(opb,c->lengthlist[i]-1,5);
  138.93 +        }
  138.94 +      }
  138.95 +    }
  138.96 +  }
  138.97 +
  138.98 +  /* is the entry number the desired return value, or do we have a
  138.99 +     mapping? If we have a mapping, what type? */
 138.100 +  oggpack_write(opb,c->maptype,4);
 138.101 +  switch(c->maptype){
 138.102 +  case 0:
 138.103 +    /* no mapping */
 138.104 +    break;
 138.105 +  case 1:case 2:
 138.106 +    /* implicitly populated value mapping */
 138.107 +    /* explicitly populated value mapping */
 138.108 +
 138.109 +    if(!c->quantlist){
 138.110 +      /* no quantlist?  error */
 138.111 +      return(-1);
 138.112 +    }
 138.113 +
 138.114 +    /* values that define the dequantization */
 138.115 +    oggpack_write(opb,c->q_min,32);
 138.116 +    oggpack_write(opb,c->q_delta,32);
 138.117 +    oggpack_write(opb,c->q_quant-1,4);
 138.118 +    oggpack_write(opb,c->q_sequencep,1);
 138.119 +
 138.120 +    {
 138.121 +      int quantvals;
 138.122 +      switch(c->maptype){
 138.123 +      case 1:
 138.124 +        /* a single column of (c->entries/c->dim) quantized values for
 138.125 +           building a full value list algorithmically (square lattice) */
 138.126 +        quantvals=_book_maptype1_quantvals(c);
 138.127 +        break;
 138.128 +      case 2:
 138.129 +        /* every value (c->entries*c->dim total) specified explicitly */
 138.130 +        quantvals=c->entries*c->dim;
 138.131 +        break;
 138.132 +      default: /* NOT_REACHABLE */
 138.133 +        quantvals=-1;
 138.134 +      }
 138.135 +
 138.136 +      /* quantized values */
 138.137 +      for(i=0;i<quantvals;i++)
 138.138 +        oggpack_write(opb,labs(c->quantlist[i]),c->q_quant);
 138.139 +
 138.140 +    }
 138.141 +    break;
 138.142 +  default:
 138.143 +    /* error case; we don't have any other map types now */
 138.144 +    return(-1);
 138.145 +  }
 138.146 +
 138.147 +  return(0);
 138.148 +}
 138.149 +
 138.150 +/* unpacks a codebook from the packet buffer into the codebook struct,
 138.151 +   readies the codebook auxiliary structures for decode *************/
 138.152 +static_codebook *vorbis_staticbook_unpack(oggpack_buffer *opb){
 138.153 +  long i,j;
 138.154 +  static_codebook *s=_ogg_calloc(1,sizeof(*s));
 138.155 +  s->allocedp=1;
 138.156 +
 138.157 +  /* make sure alignment is correct */
 138.158 +  if(oggpack_read(opb,24)!=0x564342)goto _eofout;
 138.159 +
 138.160 +  /* first the basic parameters */
 138.161 +  s->dim=oggpack_read(opb,16);
 138.162 +  s->entries=oggpack_read(opb,24);
 138.163 +  if(s->entries==-1)goto _eofout;
 138.164 +
 138.165 +  if(_ilog(s->dim)+_ilog(s->entries)>24)goto _eofout;
 138.166 +
 138.167 +  /* codeword ordering.... length ordered or unordered? */
 138.168 +  switch((int)oggpack_read(opb,1)){
 138.169 +  case 0:{
 138.170 +    long unused;
 138.171 +    /* allocated but unused entries? */
 138.172 +    unused=oggpack_read(opb,1);
 138.173 +    if((s->entries*(unused?1:5)+7)>>3>opb->storage-oggpack_bytes(opb))
 138.174 +      goto _eofout;
 138.175 +    /* unordered */
 138.176 +    s->lengthlist=_ogg_malloc(sizeof(*s->lengthlist)*s->entries);
 138.177 +
 138.178 +    /* allocated but unused entries? */
 138.179 +    if(unused){
 138.180 +      /* yes, unused entries */
 138.181 +
 138.182 +      for(i=0;i<s->entries;i++){
 138.183 +        if(oggpack_read(opb,1)){
 138.184 +          long num=oggpack_read(opb,5);
 138.185 +          if(num==-1)goto _eofout;
 138.186 +          s->lengthlist[i]=num+1;
 138.187 +        }else
 138.188 +          s->lengthlist[i]=0;
 138.189 +      }
 138.190 +    }else{
 138.191 +      /* all entries used; no tagging */
 138.192 +      for(i=0;i<s->entries;i++){
 138.193 +        long num=oggpack_read(opb,5);
 138.194 +        if(num==-1)goto _eofout;
 138.195 +        s->lengthlist[i]=num+1;
 138.196 +      }
 138.197 +    }
 138.198 +
 138.199 +    break;
 138.200 +  }
 138.201 +  case 1:
 138.202 +    /* ordered */
 138.203 +    {
 138.204 +      long length=oggpack_read(opb,5)+1;
 138.205 +      if(length==0)goto _eofout;
 138.206 +      s->lengthlist=_ogg_malloc(sizeof(*s->lengthlist)*s->entries);
 138.207 +
 138.208 +      for(i=0;i<s->entries;){
 138.209 +        long num=oggpack_read(opb,_ilog(s->entries-i));
 138.210 +        if(num==-1)goto _eofout;
 138.211 +        if(length>32 || num>s->entries-i ||
 138.212 +           (num>0 && (num-1)>>(length-1)>1)){
 138.213 +          goto _errout;
 138.214 +        }
 138.215 +        if(length>32)goto _errout;
 138.216 +        for(j=0;j<num;j++,i++)
 138.217 +          s->lengthlist[i]=length;
 138.218 +        length++;
 138.219 +      }
 138.220 +    }
 138.221 +    break;
 138.222 +  default:
 138.223 +    /* EOF */
 138.224 +    goto _eofout;
 138.225 +  }
 138.226 +
 138.227 +  /* Do we have a mapping to unpack? */
 138.228 +  switch((s->maptype=oggpack_read(opb,4))){
 138.229 +  case 0:
 138.230 +    /* no mapping */
 138.231 +    break;
 138.232 +  case 1: case 2:
 138.233 +    /* implicitly populated value mapping */
 138.234 +    /* explicitly populated value mapping */
 138.235 +
 138.236 +    s->q_min=oggpack_read(opb,32);
 138.237 +    s->q_delta=oggpack_read(opb,32);
 138.238 +    s->q_quant=oggpack_read(opb,4)+1;
 138.239 +    s->q_sequencep=oggpack_read(opb,1);
 138.240 +    if(s->q_sequencep==-1)goto _eofout;
 138.241 +
 138.242 +    {
 138.243 +      int quantvals=0;
 138.244 +      switch(s->maptype){
 138.245 +      case 1:
 138.246 +        quantvals=(s->dim==0?0:_book_maptype1_quantvals(s));
 138.247 +        break;
 138.248 +      case 2:
 138.249 +        quantvals=s->entries*s->dim;
 138.250 +        break;
 138.251 +      }
 138.252 +
 138.253 +      /* quantized values */
 138.254 +      if(((quantvals*s->q_quant+7)>>3)>opb->storage-oggpack_bytes(opb))
 138.255 +        goto _eofout;
 138.256 +      s->quantlist=_ogg_malloc(sizeof(*s->quantlist)*quantvals);
 138.257 +      for(i=0;i<quantvals;i++)
 138.258 +        s->quantlist[i]=oggpack_read(opb,s->q_quant);
 138.259 +
 138.260 +      if(quantvals&&s->quantlist[quantvals-1]==-1)goto _eofout;
 138.261 +    }
 138.262 +    break;
 138.263 +  default:
 138.264 +    goto _errout;
 138.265 +  }
 138.266 +
 138.267 +  /* all set */
 138.268 +  return(s);
 138.269 +
 138.270 + _errout:
 138.271 + _eofout:
 138.272 +  vorbis_staticbook_destroy(s);
 138.273 +  return(NULL);
 138.274 +}
 138.275 +
 138.276 +/* returns the number of bits ************************************************/
 138.277 +int vorbis_book_encode(codebook *book, int a, oggpack_buffer *b){
 138.278 +  if(a<0 || a>=book->c->entries)return(0);
 138.279 +  oggpack_write(b,book->codelist[a],book->c->lengthlist[a]);
 138.280 +  return(book->c->lengthlist[a]);
 138.281 +}
 138.282 +
 138.283 +/* the 'eliminate the decode tree' optimization actually requires the
 138.284 +   codewords to be MSb first, not LSb.  This is an annoying inelegancy
 138.285 +   (and one of the first places where carefully thought out design
 138.286 +   turned out to be wrong; Vorbis II and future Ogg codecs should go
 138.287 +   to an MSb bitpacker), but not actually the huge hit it appears to
 138.288 +   be.  The first-stage decode table catches most words so that
 138.289 +   bitreverse is not in the main execution path. */
 138.290 +
 138.291 +static ogg_uint32_t bitreverse(ogg_uint32_t x){
 138.292 +  x=    ((x>>16)&0x0000ffff) | ((x<<16)&0xffff0000);
 138.293 +  x=    ((x>> 8)&0x00ff00ff) | ((x<< 8)&0xff00ff00);
 138.294 +  x=    ((x>> 4)&0x0f0f0f0f) | ((x<< 4)&0xf0f0f0f0);
 138.295 +  x=    ((x>> 2)&0x33333333) | ((x<< 2)&0xcccccccc);
 138.296 +  return((x>> 1)&0x55555555) | ((x<< 1)&0xaaaaaaaa);
 138.297 +}
 138.298 +
 138.299 +STIN long decode_packed_entry_number(codebook *book, oggpack_buffer *b){
 138.300 +  int  read=book->dec_maxlength;
 138.301 +  long lo,hi;
 138.302 +  long lok = oggpack_look(b,book->dec_firsttablen);
 138.303 +
 138.304 +  if (lok >= 0) {
 138.305 +    long entry = book->dec_firsttable[lok];
 138.306 +    if(entry&0x80000000UL){
 138.307 +      lo=(entry>>15)&0x7fff;
 138.308 +      hi=book->used_entries-(entry&0x7fff);
 138.309 +    }else{
 138.310 +      oggpack_adv(b, book->dec_codelengths[entry-1]);
 138.311 +      return(entry-1);
 138.312 +    }
 138.313 +  }else{
 138.314 +    lo=0;
 138.315 +    hi=book->used_entries;
 138.316 +  }
 138.317 +
 138.318 +  lok = oggpack_look(b, read);
 138.319 +
 138.320 +  while(lok<0 && read>1)
 138.321 +    lok = oggpack_look(b, --read);
 138.322 +  if(lok<0)return -1;
 138.323 +
 138.324 +  /* bisect search for the codeword in the ordered list */
 138.325 +  {
 138.326 +    ogg_uint32_t testword=bitreverse((ogg_uint32_t)lok);
 138.327 +
 138.328 +    while(hi-lo>1){
 138.329 +      long p=(hi-lo)>>1;
 138.330 +      long test=book->codelist[lo+p]>testword;
 138.331 +      lo+=p&(test-1);
 138.332 +      hi-=p&(-test);
 138.333 +      }
 138.334 +
 138.335 +    if(book->dec_codelengths[lo]<=read){
 138.336 +      oggpack_adv(b, book->dec_codelengths[lo]);
 138.337 +      return(lo);
 138.338 +    }
 138.339 +  }
 138.340 +
 138.341 +  oggpack_adv(b, read);
 138.342 +
 138.343 +  return(-1);
 138.344 +}
 138.345 +
 138.346 +/* Decode side is specced and easier, because we don't need to find
 138.347 +   matches using different criteria; we simply read and map.  There are
 138.348 +   two things we need to do 'depending':
 138.349 +
 138.350 +   We may need to support interleave.  We don't really, but it's
 138.351 +   convenient to do it here rather than rebuild the vector later.
 138.352 +
 138.353 +   Cascades may be additive or multiplicitive; this is not inherent in
 138.354 +   the codebook, but set in the code using the codebook.  Like
 138.355 +   interleaving, it's easiest to do it here.
 138.356 +   addmul==0 -> declarative (set the value)
 138.357 +   addmul==1 -> additive
 138.358 +   addmul==2 -> multiplicitive */
 138.359 +
 138.360 +/* returns the [original, not compacted] entry number or -1 on eof *********/
 138.361 +long vorbis_book_decode(codebook *book, oggpack_buffer *b){
 138.362 +  if(book->used_entries>0){
 138.363 +    long packed_entry=decode_packed_entry_number(book,b);
 138.364 +    if(packed_entry>=0)
 138.365 +      return(book->dec_index[packed_entry]);
 138.366 +  }
 138.367 +
 138.368 +  /* if there's no dec_index, the codebook unpacking isn't collapsed */
 138.369 +  return(-1);
 138.370 +}
 138.371 +
 138.372 +/* returns 0 on OK or -1 on eof *************************************/
 138.373 +/* decode vector / dim granularity gaurding is done in the upper layer */
 138.374 +long vorbis_book_decodevs_add(codebook *book,float *a,oggpack_buffer *b,int n){
 138.375 +  if(book->used_entries>0){
 138.376 +    int step=n/book->dim;
 138.377 +    long *entry = alloca(sizeof(*entry)*step);
 138.378 +    float **t = alloca(sizeof(*t)*step);
 138.379 +    int i,j,o;
 138.380 +
 138.381 +    for (i = 0; i < step; i++) {
 138.382 +      entry[i]=decode_packed_entry_number(book,b);
 138.383 +      if(entry[i]==-1)return(-1);
 138.384 +      t[i] = book->valuelist+entry[i]*book->dim;
 138.385 +    }
 138.386 +    for(i=0,o=0;i<book->dim;i++,o+=step)
 138.387 +      for (j=0;j<step;j++)
 138.388 +        a[o+j]+=t[j][i];
 138.389 +  }
 138.390 +  return(0);
 138.391 +}
 138.392 +
 138.393 +/* decode vector / dim granularity gaurding is done in the upper layer */
 138.394 +long vorbis_book_decodev_add(codebook *book,float *a,oggpack_buffer *b,int n){
 138.395 +  if(book->used_entries>0){
 138.396 +    int i,j,entry;
 138.397 +    float *t;
 138.398 +
 138.399 +    if(book->dim>8){
 138.400 +      for(i=0;i<n;){
 138.401 +        entry = decode_packed_entry_number(book,b);
 138.402 +        if(entry==-1)return(-1);
 138.403 +        t     = book->valuelist+entry*book->dim;
 138.404 +        for (j=0;j<book->dim;)
 138.405 +          a[i++]+=t[j++];
 138.406 +      }
 138.407 +    }else{
 138.408 +      for(i=0;i<n;){
 138.409 +        entry = decode_packed_entry_number(book,b);
 138.410 +        if(entry==-1)return(-1);
 138.411 +        t     = book->valuelist+entry*book->dim;
 138.412 +        j=0;
 138.413 +        switch((int)book->dim){
 138.414 +        case 8:
 138.415 +          a[i++]+=t[j++];
 138.416 +        case 7:
 138.417 +          a[i++]+=t[j++];
 138.418 +        case 6:
 138.419 +          a[i++]+=t[j++];
 138.420 +        case 5:
 138.421 +          a[i++]+=t[j++];
 138.422 +        case 4:
 138.423 +          a[i++]+=t[j++];
 138.424 +        case 3:
 138.425 +          a[i++]+=t[j++];
 138.426 +        case 2:
 138.427 +          a[i++]+=t[j++];
 138.428 +        case 1:
 138.429 +          a[i++]+=t[j++];
 138.430 +        case 0:
 138.431 +          break;
 138.432 +        }
 138.433 +      }
 138.434 +    }
 138.435 +  }
 138.436 +  return(0);
 138.437 +}
 138.438 +
 138.439 +/* unlike the others, we guard against n not being an integer number
 138.440 +   of <dim> internally rather than in the upper layer (called only by
 138.441 +   floor0) */
 138.442 +long vorbis_book_decodev_set(codebook *book,float *a,oggpack_buffer *b,int n){
 138.443 +  if(book->used_entries>0){
 138.444 +    int i,j,entry;
 138.445 +    float *t;
 138.446 +
 138.447 +    for(i=0;i<n;){
 138.448 +      entry = decode_packed_entry_number(book,b);
 138.449 +      if(entry==-1)return(-1);
 138.450 +      t     = book->valuelist+entry*book->dim;
 138.451 +      for (j=0;i<n && j<book->dim;){
 138.452 +        a[i++]=t[j++];
 138.453 +      }
 138.454 +    }
 138.455 +  }else{
 138.456 +    int i;
 138.457 +
 138.458 +    for(i=0;i<n;){
 138.459 +      a[i++]=0.f;
 138.460 +    }
 138.461 +  }
 138.462 +  return(0);
 138.463 +}
 138.464 +
 138.465 +long vorbis_book_decodevv_add(codebook *book,float **a,long offset,int ch,
 138.466 +                              oggpack_buffer *b,int n){
 138.467 +
 138.468 +  long i,j,entry;
 138.469 +  int chptr=0;
 138.470 +  if(book->used_entries>0){
 138.471 +    for(i=offset/ch;i<(offset+n)/ch;){
 138.472 +      entry = decode_packed_entry_number(book,b);
 138.473 +      if(entry==-1)return(-1);
 138.474 +      {
 138.475 +        const float *t = book->valuelist+entry*book->dim;
 138.476 +        for (j=0;j<book->dim;j++){
 138.477 +          a[chptr++][i]+=t[j];
 138.478 +          if(chptr==ch){
 138.479 +            chptr=0;
 138.480 +            i++;
 138.481 +          }
 138.482 +        }
 138.483 +      }
 138.484 +    }
 138.485 +  }
 138.486 +  return(0);
 138.487 +}
   139.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   139.2 +++ b/libs/vorbis/codebook.h	Sun Nov 01 00:36:56 2015 +0200
   139.3 @@ -0,0 +1,119 @@
   139.4 +/********************************************************************
   139.5 + *                                                                  *
   139.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   139.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   139.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   139.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  139.10 + *                                                                  *
  139.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
  139.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  139.13 + *                                                                  *
  139.14 + ********************************************************************
  139.15 +
  139.16 + function: basic shared codebook operations
  139.17 + last mod: $Id: codebook.h 17030 2010-03-25 06:52:55Z xiphmont $
  139.18 +
  139.19 + ********************************************************************/
  139.20 +
  139.21 +#ifndef _V_CODEBOOK_H_
  139.22 +#define _V_CODEBOOK_H_
  139.23 +
  139.24 +#include <ogg/ogg.h>
  139.25 +
  139.26 +/* This structure encapsulates huffman and VQ style encoding books; it
  139.27 +   doesn't do anything specific to either.
  139.28 +
  139.29 +   valuelist/quantlist are nonNULL (and q_* significant) only if
  139.30 +   there's entry->value mapping to be done.
  139.31 +
  139.32 +   If encode-side mapping must be done (and thus the entry needs to be
  139.33 +   hunted), the auxiliary encode pointer will point to a decision
  139.34 +   tree.  This is true of both VQ and huffman, but is mostly useful
  139.35 +   with VQ.
  139.36 +
  139.37 +*/
  139.38 +
  139.39 +typedef struct static_codebook{
  139.40 +  long   dim;            /* codebook dimensions (elements per vector) */
  139.41 +  long   entries;        /* codebook entries */
  139.42 +  long  *lengthlist;     /* codeword lengths in bits */
  139.43 +
  139.44 +  /* mapping ***************************************************************/
  139.45 +  int    maptype;        /* 0=none
  139.46 +                            1=implicitly populated values from map column
  139.47 +                            2=listed arbitrary values */
  139.48 +
  139.49 +  /* The below does a linear, single monotonic sequence mapping. */
  139.50 +  long     q_min;       /* packed 32 bit float; quant value 0 maps to minval */
  139.51 +  long     q_delta;     /* packed 32 bit float; val 1 - val 0 == delta */
  139.52 +  int      q_quant;     /* bits: 0 < quant <= 16 */
  139.53 +  int      q_sequencep; /* bitflag */
  139.54 +
  139.55 +  long     *quantlist;  /* map == 1: (int)(entries^(1/dim)) element column map
  139.56 +                           map == 2: list of dim*entries quantized entry vals
  139.57 +                        */
  139.58 +  int allocedp;
  139.59 +} static_codebook;
  139.60 +
  139.61 +typedef struct codebook{
  139.62 +  long dim;           /* codebook dimensions (elements per vector) */
  139.63 +  long entries;       /* codebook entries */
  139.64 +  long used_entries;  /* populated codebook entries */
  139.65 +  const static_codebook *c;
  139.66 +
  139.67 +  /* for encode, the below are entry-ordered, fully populated */
  139.68 +  /* for decode, the below are ordered by bitreversed codeword and only
  139.69 +     used entries are populated */
  139.70 +  float        *valuelist;  /* list of dim*entries actual entry values */
  139.71 +  ogg_uint32_t *codelist;   /* list of bitstream codewords for each entry */
  139.72 +
  139.73 +  int          *dec_index;  /* only used if sparseness collapsed */
  139.74 +  char         *dec_codelengths;
  139.75 +  ogg_uint32_t *dec_firsttable;
  139.76 +  int           dec_firsttablen;
  139.77 +  int           dec_maxlength;
  139.78 +
  139.79 +  /* The current encoder uses only centered, integer-only lattice books. */
  139.80 +  int           quantvals;
  139.81 +  int           minval;
  139.82 +  int           delta;
  139.83 +} codebook;
  139.84 +
  139.85 +extern void vorbis_staticbook_destroy(static_codebook *b);
  139.86 +extern int vorbis_book_init_encode(codebook *dest,const static_codebook *source);
  139.87 +extern int vorbis_book_init_decode(codebook *dest,const static_codebook *source);
  139.88 +extern void vorbis_book_clear(codebook *b);
  139.89 +
  139.90 +extern float *_book_unquantize(const static_codebook *b,int n,int *map);
  139.91 +extern float *_book_logdist(const static_codebook *b,float *vals);
  139.92 +extern float _float32_unpack(long val);
  139.93 +extern long   _float32_pack(float val);
  139.94 +extern int  _best(codebook *book, float *a, int step);
  139.95 +extern int _ilog(unsigned int v);
  139.96 +extern long _book_maptype1_quantvals(const static_codebook *b);
  139.97 +
  139.98 +extern int vorbis_book_besterror(codebook *book,float *a,int step,int addmul);
  139.99 +extern long vorbis_book_codeword(codebook *book,int entry);
 139.100 +extern long vorbis_book_codelen(codebook *book,int entry);
 139.101 +
 139.102 +
 139.103 +
 139.104 +extern int vorbis_staticbook_pack(const static_codebook *c,oggpack_buffer *b);
 139.105 +extern static_codebook *vorbis_staticbook_unpack(oggpack_buffer *b);
 139.106 +
 139.107 +extern int vorbis_book_encode(codebook *book, int a, oggpack_buffer *b);
 139.108 +
 139.109 +extern long vorbis_book_decode(codebook *book, oggpack_buffer *b);
 139.110 +extern long vorbis_book_decodevs_add(codebook *book, float *a,
 139.111 +                                     oggpack_buffer *b,int n);
 139.112 +extern long vorbis_book_decodev_set(codebook *book, float *a,
 139.113 +                                    oggpack_buffer *b,int n);
 139.114 +extern long vorbis_book_decodev_add(codebook *book, float *a,
 139.115 +                                    oggpack_buffer *b,int n);
 139.116 +extern long vorbis_book_decodevv_add(codebook *book, float **a,
 139.117 +                                     long off,int ch,
 139.118 +                                    oggpack_buffer *b,int n);
 139.119 +
 139.120 +
 139.121 +
 139.122 +#endif
   140.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   140.2 +++ b/libs/vorbis/codec.h	Sun Nov 01 00:36:56 2015 +0200
   140.3 @@ -0,0 +1,243 @@
   140.4 +/********************************************************************
   140.5 + *                                                                  *
   140.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   140.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   140.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   140.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  140.10 + *                                                                  *
  140.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001             *
  140.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  140.13 +
  140.14 + ********************************************************************
  140.15 +
  140.16 + function: libvorbis codec headers
  140.17 + last mod: $Id: codec.h 17021 2010-03-24 09:29:41Z xiphmont $
  140.18 +
  140.19 + ********************************************************************/
  140.20 +
  140.21 +#ifndef _vorbis_codec_h_
  140.22 +#define _vorbis_codec_h_
  140.23 +
  140.24 +#ifdef __cplusplus
  140.25 +extern "C"
  140.26 +{
  140.27 +#endif /* __cplusplus */
  140.28 +
  140.29 +#include <ogg/ogg.h>
  140.30 +
  140.31 +typedef struct vorbis_info{
  140.32 +  int version;
  140.33 +  int channels;
  140.34 +  long rate;
  140.35 +
  140.36 +  /* The below bitrate declarations are *hints*.
  140.37 +     Combinations of the three values carry the following implications:
  140.38 +
  140.39 +     all three set to the same value:
  140.40 +       implies a fixed rate bitstream
  140.41 +     only nominal set:
  140.42 +       implies a VBR stream that averages the nominal bitrate.  No hard
  140.43 +       upper/lower limit
  140.44 +     upper and or lower set:
  140.45 +       implies a VBR bitstream that obeys the bitrate limits. nominal
  140.46 +       may also be set to give a nominal rate.
  140.47 +     none set:
  140.48 +       the coder does not care to speculate.
  140.49 +  */
  140.50 +
  140.51 +  long bitrate_upper;
  140.52 +  long bitrate_nominal;
  140.53 +  long bitrate_lower;
  140.54 +  long bitrate_window;
  140.55 +
  140.56 +  void *codec_setup;
  140.57 +} vorbis_info;
  140.58 +
  140.59 +/* vorbis_dsp_state buffers the current vorbis audio
  140.60 +   analysis/synthesis state.  The DSP state belongs to a specific
  140.61 +   logical bitstream ****************************************************/
  140.62 +typedef struct vorbis_dsp_state{
  140.63 +  int analysisp;
  140.64 +  vorbis_info *vi;
  140.65 +
  140.66 +  float **pcm;
  140.67 +  float **pcmret;
  140.68 +  int      pcm_storage;
  140.69 +  int      pcm_current;
  140.70 +  int      pcm_returned;
  140.71 +
  140.72 +  int  preextrapolate;
  140.73 +  int  eofflag;
  140.74 +
  140.75 +  long lW;
  140.76 +  long W;
  140.77 +  long nW;
  140.78 +  long centerW;
  140.79 +
  140.80 +  ogg_int64_t granulepos;
  140.81 +  ogg_int64_t sequence;
  140.82 +
  140.83 +  ogg_int64_t glue_bits;
  140.84 +  ogg_int64_t time_bits;
  140.85 +  ogg_int64_t floor_bits;
  140.86 +  ogg_int64_t res_bits;
  140.87 +
  140.88 +  void       *backend_state;
  140.89 +} vorbis_dsp_state;
  140.90 +
  140.91 +typedef struct vorbis_block{
  140.92 +  /* necessary stream state for linking to the framing abstraction */
  140.93 +  float  **pcm;       /* this is a pointer into local storage */
  140.94 +  oggpack_buffer opb;
  140.95 +
  140.96 +  long  lW;
  140.97 +  long  W;
  140.98 +  long  nW;
  140.99 +  int   pcmend;
 140.100 +  int   mode;
 140.101 +
 140.102 +  int         eofflag;
 140.103 +  ogg_int64_t granulepos;
 140.104 +  ogg_int64_t sequence;
 140.105 +  vorbis_dsp_state *vd; /* For read-only access of configuration */
 140.106 +
 140.107 +  /* local storage to avoid remallocing; it's up to the mapping to
 140.108 +     structure it */
 140.109 +  void               *localstore;
 140.110 +  long                localtop;
 140.111 +  long                localalloc;
 140.112 +  long                totaluse;
 140.113 +  struct alloc_chain *reap;
 140.114 +
 140.115 +  /* bitmetrics for the frame */
 140.116 +  long glue_bits;
 140.117 +  long time_bits;
 140.118 +  long floor_bits;
 140.119 +  long res_bits;
 140.120 +
 140.121 +  void *internal;
 140.122 +
 140.123 +} vorbis_block;
 140.124 +
 140.125 +/* vorbis_block is a single block of data to be processed as part of
 140.126 +the analysis/synthesis stream; it belongs to a specific logical
 140.127 +bitstream, but is independent from other vorbis_blocks belonging to
 140.128 +that logical bitstream. *************************************************/
 140.129 +
 140.130 +struct alloc_chain{
 140.131 +  void *ptr;
 140.132 +  struct alloc_chain *next;
 140.133 +};
 140.134 +
 140.135 +/* vorbis_info contains all the setup information specific to the
 140.136 +   specific compression/decompression mode in progress (eg,
 140.137 +   psychoacoustic settings, channel setup, options, codebook
 140.138 +   etc). vorbis_info and substructures are in backends.h.
 140.139 +*********************************************************************/
 140.140 +
 140.141 +/* the comments are not part of vorbis_info so that vorbis_info can be
 140.142 +   static storage */
 140.143 +typedef struct vorbis_comment{
 140.144 +  /* unlimited user comment fields.  libvorbis writes 'libvorbis'
 140.145 +     whatever vendor is set to in encode */
 140.146 +  char **user_comments;
 140.147 +  int   *comment_lengths;
 140.148 +  int    comments;
 140.149 +  char  *vendor;
 140.150 +
 140.151 +} vorbis_comment;
 140.152 +
 140.153 +
 140.154 +/* libvorbis encodes in two abstraction layers; first we perform DSP
 140.155 +   and produce a packet (see docs/analysis.txt).  The packet is then
 140.156 +   coded into a framed OggSquish bitstream by the second layer (see
 140.157 +   docs/framing.txt).  Decode is the reverse process; we sync/frame
 140.158 +   the bitstream and extract individual packets, then decode the
 140.159 +   packet back into PCM audio.
 140.160 +
 140.161 +   The extra framing/packetizing is used in streaming formats, such as
 140.162 +   files.  Over the net (such as with UDP), the framing and
 140.163 +   packetization aren't necessary as they're provided by the transport
 140.164 +   and the streaming layer is not used */
 140.165 +
 140.166 +/* Vorbis PRIMITIVES: general ***************************************/
 140.167 +
 140.168 +extern void     vorbis_info_init(vorbis_info *vi);
 140.169 +extern void     vorbis_info_clear(vorbis_info *vi);
 140.170 +extern int      vorbis_info_blocksize(vorbis_info *vi,int zo);
 140.171 +extern void     vorbis_comment_init(vorbis_comment *vc);
 140.172 +extern void     vorbis_comment_add(vorbis_comment *vc, const char *comment);
 140.173 +extern void     vorbis_comment_add_tag(vorbis_comment *vc,
 140.174 +                                       const char *tag, const char *contents);
 140.175 +extern char    *vorbis_comment_query(vorbis_comment *vc, const char *tag, int count);
 140.176 +extern int      vorbis_comment_query_count(vorbis_comment *vc, const char *tag);
 140.177 +extern void     vorbis_comment_clear(vorbis_comment *vc);
 140.178 +
 140.179 +extern int      vorbis_block_init(vorbis_dsp_state *v, vorbis_block *vb);
 140.180 +extern int      vorbis_block_clear(vorbis_block *vb);
 140.181 +extern void     vorbis_dsp_clear(vorbis_dsp_state *v);
 140.182 +extern double   vorbis_granule_time(vorbis_dsp_state *v,
 140.183 +                                    ogg_int64_t granulepos);
 140.184 +
 140.185 +extern const char *vorbis_version_string(void);
 140.186 +
 140.187 +/* Vorbis PRIMITIVES: analysis/DSP layer ****************************/
 140.188 +
 140.189 +extern int      vorbis_analysis_init(vorbis_dsp_state *v,vorbis_info *vi);
 140.190 +extern int      vorbis_commentheader_out(vorbis_comment *vc, ogg_packet *op);
 140.191 +extern int      vorbis_analysis_headerout(vorbis_dsp_state *v,
 140.192 +                                          vorbis_comment *vc,
 140.193 +                                          ogg_packet *op,
 140.194 +                                          ogg_packet *op_comm,
 140.195 +                                          ogg_packet *op_code);
 140.196 +extern float  **vorbis_analysis_buffer(vorbis_dsp_state *v,int vals);
 140.197 +extern int      vorbis_analysis_wrote(vorbis_dsp_state *v,int vals);
 140.198 +extern int      vorbis_analysis_blockout(vorbis_dsp_state *v,vorbis_block *vb);
 140.199 +extern int      vorbis_analysis(vorbis_block *vb,ogg_packet *op);
 140.200 +
 140.201 +extern int      vorbis_bitrate_addblock(vorbis_block *vb);
 140.202 +extern int      vorbis_bitrate_flushpacket(vorbis_dsp_state *vd,
 140.203 +                                           ogg_packet *op);
 140.204 +
 140.205 +/* Vorbis PRIMITIVES: synthesis layer *******************************/
 140.206 +extern int      vorbis_synthesis_idheader(ogg_packet *op);
 140.207 +extern int      vorbis_synthesis_headerin(vorbis_info *vi,vorbis_comment *vc,
 140.208 +                                          ogg_packet *op);
 140.209 +
 140.210 +extern int      vorbis_synthesis_init(vorbis_dsp_state *v,vorbis_info *vi);
 140.211 +extern int      vorbis_synthesis_restart(vorbis_dsp_state *v);
 140.212 +extern int      vorbis_synthesis(vorbis_block *vb,ogg_packet *op);
 140.213 +extern int      vorbis_synthesis_trackonly(vorbis_block *vb,ogg_packet *op);
 140.214 +extern int      vorbis_synthesis_blockin(vorbis_dsp_state *v,vorbis_block *vb);
 140.215 +extern int      vorbis_synthesis_pcmout(vorbis_dsp_state *v,float ***pcm);
 140.216 +extern int      vorbis_synthesis_lapout(vorbis_dsp_state *v,float ***pcm);
 140.217 +extern int      vorbis_synthesis_read(vorbis_dsp_state *v,int samples);
 140.218 +extern long     vorbis_packet_blocksize(vorbis_info *vi,ogg_packet *op);
 140.219 +
 140.220 +extern int      vorbis_synthesis_halfrate(vorbis_info *v,int flag);
 140.221 +extern int      vorbis_synthesis_halfrate_p(vorbis_info *v);
 140.222 +
 140.223 +/* Vorbis ERRORS and return codes ***********************************/
 140.224 +
 140.225 +#define OV_FALSE      -1
 140.226 +#define OV_EOF        -2
 140.227 +#define OV_HOLE       -3
 140.228 +
 140.229 +#define OV_EREAD      -128
 140.230 +#define OV_EFAULT     -129
 140.231 +#define OV_EIMPL      -130
 140.232 +#define OV_EINVAL     -131
 140.233 +#define OV_ENOTVORBIS -132
 140.234 +#define OV_EBADHEADER -133
 140.235 +#define OV_EVERSION   -134
 140.236 +#define OV_ENOTAUDIO  -135
 140.237 +#define OV_EBADPACKET -136
 140.238 +#define OV_EBADLINK   -137
 140.239 +#define OV_ENOSEEK    -138
 140.240 +
 140.241 +#ifdef __cplusplus
 140.242 +}
 140.243 +#endif /* __cplusplus */
 140.244 +
 140.245 +#endif
 140.246 +
   141.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   141.2 +++ b/libs/vorbis/codec_internal.h	Sun Nov 01 00:36:56 2015 +0200
   141.3 @@ -0,0 +1,167 @@
   141.4 +/********************************************************************
   141.5 + *                                                                  *
   141.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   141.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   141.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   141.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  141.10 + *                                                                  *
  141.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
  141.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  141.13 + *                                                                  *
  141.14 + ********************************************************************
  141.15 +
  141.16 + function: libvorbis codec headers
  141.17 + last mod: $Id: codec_internal.h 16227 2009-07-08 06:58:46Z xiphmont $
  141.18 +
  141.19 + ********************************************************************/
  141.20 +
  141.21 +#ifndef _V_CODECI_H_
  141.22 +#define _V_CODECI_H_
  141.23 +
  141.24 +#include "envelope.h"
  141.25 +#include "codebook.h"
  141.26 +
  141.27 +#define BLOCKTYPE_IMPULSE    0
  141.28 +#define BLOCKTYPE_PADDING    1
  141.29 +#define BLOCKTYPE_TRANSITION 0
  141.30 +#define BLOCKTYPE_LONG       1
  141.31 +
  141.32 +#define PACKETBLOBS 15
  141.33 +
  141.34 +typedef struct vorbis_block_internal{
  141.35 +  float  **pcmdelay;  /* this is a pointer into local storage */
  141.36 +  float  ampmax;
  141.37 +  int    blocktype;
  141.38 +
  141.39 +  oggpack_buffer *packetblob[PACKETBLOBS]; /* initialized, must be freed;
  141.40 +                                              blob [PACKETBLOBS/2] points to
  141.41 +                                              the oggpack_buffer in the
  141.42 +                                              main vorbis_block */
  141.43 +} vorbis_block_internal;
  141.44 +
  141.45 +typedef void vorbis_look_floor;
  141.46 +typedef void vorbis_look_residue;
  141.47 +typedef void vorbis_look_transform;
  141.48 +
  141.49 +/* mode ************************************************************/
  141.50 +typedef struct {
  141.51 +  int blockflag;
  141.52 +  int windowtype;
  141.53 +  int transformtype;
  141.54 +  int mapping;
  141.55 +} vorbis_info_mode;
  141.56 +
  141.57 +typedef void vorbis_info_floor;
  141.58 +typedef void vorbis_info_residue;
  141.59 +typedef void vorbis_info_mapping;
  141.60 +
  141.61 +#include "psy.h"
  141.62 +#include "bitrate.h"
  141.63 +
  141.64 +typedef struct private_state {
  141.65 +  /* local lookup storage */
  141.66 +  envelope_lookup        *ve; /* envelope lookup */
  141.67 +  int                     window[2];
  141.68 +  vorbis_look_transform **transform[2];    /* block, type */
  141.69 +  drft_lookup             fft_look[2];
  141.70 +
  141.71 +  int                     modebits;
  141.72 +  vorbis_look_floor     **flr;
  141.73 +  vorbis_look_residue   **residue;
  141.74 +  vorbis_look_psy        *psy;
  141.75 +  vorbis_look_psy_global *psy_g_look;
  141.76 +
  141.77 +  /* local storage, only used on the encoding side.  This way the
  141.78 +     application does not need to worry about freeing some packets'
  141.79 +     memory and not others'; packet storage is always tracked.
  141.80 +     Cleared next call to a _dsp_ function */
  141.81 +  unsigned char *header;
  141.82 +  unsigned char *header1;
  141.83 +  unsigned char *header2;
  141.84 +
  141.85 +  bitrate_manager_state bms;
  141.86 +
  141.87 +  ogg_int64_t sample_count;
  141.88 +} private_state;
  141.89 +
  141.90 +/* codec_setup_info contains all the setup information specific to the
  141.91 +   specific compression/decompression mode in progress (eg,
  141.92 +   psychoacoustic settings, channel setup, options, codebook
  141.93 +   etc).
  141.94 +*********************************************************************/
  141.95 +
  141.96 +#include "highlevel.h"
  141.97 +typedef struct codec_setup_info {
  141.98 +
  141.99 +  /* Vorbis supports only short and long blocks, but allows the
 141.100 +     encoder to choose the sizes */
 141.101 +
 141.102 +  long blocksizes[2];
 141.103 +
 141.104 +  /* modes are the primary means of supporting on-the-fly different
 141.105 +     blocksizes, different channel mappings (LR or M/A),
 141.106 +     different residue backends, etc.  Each mode consists of a
 141.107 +     blocksize flag and a mapping (along with the mapping setup */
 141.108 +
 141.109 +  int        modes;
 141.110 +  int        maps;
 141.111 +  int        floors;
 141.112 +  int        residues;
 141.113 +  int        books;
 141.114 +  int        psys;     /* encode only */
 141.115 +
 141.116 +  vorbis_info_mode       *mode_param[64];
 141.117 +  int                     map_type[64];
 141.118 +  vorbis_info_mapping    *map_param[64];
 141.119 +  int                     floor_type[64];
 141.120 +  vorbis_info_floor      *floor_param[64];
 141.121 +  int                     residue_type[64];
 141.122 +  vorbis_info_residue    *residue_param[64];
 141.123 +  static_codebook        *book_param[256];
 141.124 +  codebook               *fullbooks;
 141.125 +
 141.126 +  vorbis_info_psy        *psy_param[4]; /* encode only */
 141.127 +  vorbis_info_psy_global psy_g_param;
 141.128 +
 141.129 +  bitrate_manager_info   bi;
 141.130 +  highlevel_encode_setup hi; /* used only by vorbisenc.c.  It's a
 141.131 +                                highly redundant structure, but
 141.132 +                                improves clarity of program flow. */
 141.133 +  int         halfrate_flag; /* painless downsample for decode */
 141.134 +} codec_setup_info;
 141.135 +
 141.136 +extern vorbis_look_psy_global *_vp_global_look(vorbis_info *vi);
 141.137 +extern void _vp_global_free(vorbis_look_psy_global *look);
 141.138 +
 141.139 +
 141.140 +
 141.141 +typedef struct {
 141.142 +  int sorted_index[VIF_POSIT+2];
 141.143 +  int forward_index[VIF_POSIT+2];
 141.144 +  int reverse_index[VIF_POSIT+2];
 141.145 +
 141.146 +  int hineighbor[VIF_POSIT];
 141.147 +  int loneighbor[VIF_POSIT];
 141.148 +  int posts;
 141.149 +
 141.150 +  int n;
 141.151 +  int quant_q;
 141.152 +  vorbis_info_floor1 *vi;
 141.153 +
 141.154 +  long phrasebits;
 141.155 +  long postbits;
 141.156 +  long frames;
 141.157 +} vorbis_look_floor1;
 141.158 +
 141.159 +
 141.160 +
 141.161 +extern int *floor1_fit(vorbis_block *vb,vorbis_look_floor1 *look,
 141.162 +                          const float *logmdct,   /* in */
 141.163 +                          const float *logmask);
 141.164 +extern int *floor1_interpolate_fit(vorbis_block *vb,vorbis_look_floor1 *look,
 141.165 +                          int *A,int *B,
 141.166 +                          int del);
 141.167 +extern int floor1_encode(oggpack_buffer *opb,vorbis_block *vb,
 141.168 +                  vorbis_look_floor1 *look,
 141.169 +                  int *post,int *ilogmask);
 141.170 +#endif
   142.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   142.2 +++ b/libs/vorbis/envelope.c	Sun Nov 01 00:36:56 2015 +0200
   142.3 @@ -0,0 +1,375 @@
   142.4 +/********************************************************************
   142.5 + *                                                                  *
   142.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   142.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   142.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   142.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  142.10 + *                                                                  *
  142.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
  142.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  142.13 + *                                                                  *
  142.14 + ********************************************************************
  142.15 +
  142.16 + function: PCM data envelope analysis
  142.17 + last mod: $Id: envelope.c 16227 2009-07-08 06:58:46Z xiphmont $
  142.18 +
  142.19 + ********************************************************************/
  142.20 +
  142.21 +#include <stdlib.h>
  142.22 +#include <string.h>
  142.23 +#include <stdio.h>
  142.24 +#include <math.h>
  142.25 +#include <ogg/ogg.h>
  142.26 +#include "vorbis/codec.h"
  142.27 +#include "codec_internal.h"
  142.28 +
  142.29 +#include "os.h"
  142.30 +#include "scales.h"
  142.31 +#include "envelope.h"
  142.32 +#include "mdct.h"
  142.33 +#include "misc.h"
  142.34 +
  142.35 +void _ve_envelope_init(envelope_lookup *e,vorbis_info *vi){
  142.36 +  codec_setup_info *ci=vi->codec_setup;
  142.37 +  vorbis_info_psy_global *gi=&ci->psy_g_param;
  142.38 +  int ch=vi->channels;
  142.39 +  int i,j;
  142.40 +  int n=e->winlength=128;
  142.41 +  e->searchstep=64; /* not random */
  142.42 +
  142.43 +  e->minenergy=gi->preecho_minenergy;
  142.44 +  e->ch=ch;
  142.45 +  e->storage=128;
  142.46 +  e->cursor=ci->blocksizes[1]/2;
  142.47 +  e->mdct_win=_ogg_calloc(n,sizeof(*e->mdct_win));
  142.48 +  mdct_init(&e->mdct,n);
  142.49 +
  142.50 +  for(i=0;i<n;i++){
  142.51 +    e->mdct_win[i]=sin(i/(n-1.)*M_PI);
  142.52 +    e->mdct_win[i]*=e->mdct_win[i];
  142.53 +  }
  142.54 +
  142.55 +  /* magic follows */
  142.56 +  e->band[0].begin=2;  e->band[0].end=4;
  142.57 +  e->band[1].begin=4;  e->band[1].end=5;
  142.58 +  e->band[2].begin=6;  e->band[2].end=6;
  142.59 +  e->band[3].begin=9;  e->band[3].end=8;
  142.60 +  e->band[4].begin=13;  e->band[4].end=8;
  142.61 +  e->band[5].begin=17;  e->band[5].end=8;
  142.62 +  e->band[6].begin=22;  e->band[6].end=8;
  142.63 +
  142.64 +  for(j=0;j<VE_BANDS;j++){
  142.65 +    n=e->band[j].end;
  142.66 +    e->band[j].window=_ogg_malloc(n*sizeof(*e->band[0].window));
  142.67 +    for(i=0;i<n;i++){
  142.68 +      e->band[j].window[i]=sin((i+.5)/n*M_PI);
  142.69 +      e->band[j].total+=e->band[j].window[i];
  142.70 +    }
  142.71 +    e->band[j].total=1./e->band[j].total;
  142.72 +  }
  142.73 +
  142.74 +  e->filter=_ogg_calloc(VE_BANDS*ch,sizeof(*e->filter));
  142.75 +  e->mark=_ogg_calloc(e->storage,sizeof(*e->mark));
  142.76 +
  142.77 +}
  142.78 +
  142.79 +void _ve_envelope_clear(envelope_lookup *e){
  142.80 +  int i;
  142.81 +  mdct_clear(&e->mdct);
  142.82 +  for(i=0;i<VE_BANDS;i++)
  142.83 +    _ogg_free(e->band[i].window);
  142.84 +  _ogg_free(e->mdct_win);
  142.85 +  _ogg_free(e->filter);
  142.86 +  _ogg_free(e->mark);
  142.87 +  memset(e,0,sizeof(*e));
  142.88 +}
  142.89 +
  142.90 +/* fairly straight threshhold-by-band based until we find something
  142.91 +   that works better and isn't patented. */
  142.92 +
  142.93 +static int _ve_amp(envelope_lookup *ve,
  142.94 +                   vorbis_info_psy_global *gi,
  142.95 +                   float *data,
  142.96 +                   envelope_band *bands,
  142.97 +                   envelope_filter_state *filters){
  142.98 +  long n=ve->winlength;
  142.99 +  int ret=0;
 142.100 +  long i,j;
 142.101 +  float decay;
 142.102 +
 142.103 +  /* we want to have a 'minimum bar' for energy, else we're just
 142.104 +     basing blocks on quantization noise that outweighs the signal
 142.105 +     itself (for low power signals) */
 142.106 +
 142.107 +  float minV=ve->minenergy;
 142.108 +  float *vec=alloca(n*sizeof(*vec));
 142.109 +
 142.110 +  /* stretch is used to gradually lengthen the number of windows
 142.111 +     considered prevoius-to-potential-trigger */
 142.112 +  int stretch=max(VE_MINSTRETCH,ve->stretch/2);
 142.113 +  float penalty=gi->stretch_penalty-(ve->stretch/2-VE_MINSTRETCH);
 142.114 +  if(penalty<0.f)penalty=0.f;
 142.115 +  if(penalty>gi->stretch_penalty)penalty=gi->stretch_penalty;
 142.116 +
 142.117 +  /*_analysis_output_always("lpcm",seq2,data,n,0,0,
 142.118 +    totalshift+pos*ve->searchstep);*/
 142.119 +
 142.120 + /* window and transform */
 142.121 +  for(i=0;i<n;i++)
 142.122 +    vec[i]=data[i]*ve->mdct_win[i];
 142.123 +  mdct_forward(&ve->mdct,vec,vec);
 142.124 +
 142.125 +  /*_analysis_output_always("mdct",seq2,vec,n/2,0,1,0); */
 142.126 +
 142.127 +  /* near-DC spreading function; this has nothing to do with
 142.128 +     psychoacoustics, just sidelobe leakage and window size */
 142.129 +  {
 142.130 +    float temp=vec[0]*vec[0]+.7*vec[1]*vec[1]+.2*vec[2]*vec[2];
 142.131 +    int ptr=filters->nearptr;
 142.132 +
 142.133 +    /* the accumulation is regularly refreshed from scratch to avoid
 142.134 +       floating point creep */
 142.135 +    if(ptr==0){
 142.136 +      decay=filters->nearDC_acc=filters->nearDC_partialacc+temp;
 142.137 +      filters->nearDC_partialacc=temp;
 142.138 +    }else{
 142.139 +      decay=filters->nearDC_acc+=temp;
 142.140 +      filters->nearDC_partialacc+=temp;
 142.141 +    }
 142.142 +    filters->nearDC_acc-=filters->nearDC[ptr];
 142.143 +    filters->nearDC[ptr]=temp;
 142.144 +
 142.145 +    decay*=(1./(VE_NEARDC+1));
 142.146 +    filters->nearptr++;
 142.147 +    if(filters->nearptr>=VE_NEARDC)filters->nearptr=0;
 142.148 +    decay=todB(&decay)*.5-15.f;
 142.149 +  }
 142.150 +
 142.151 +  /* perform spreading and limiting, also smooth the spectrum.  yes,
 142.152 +     the MDCT results in all real coefficients, but it still *behaves*
 142.153 +     like real/imaginary pairs */
 142.154 +  for(i=0;i<n/2;i+=2){
 142.155 +    float val=vec[i]*vec[i]+vec[i+1]*vec[i+1];
 142.156 +    val=todB(&val)*.5f;
 142.157 +    if(val<decay)val=decay;
 142.158 +    if(val<minV)val=minV;
 142.159 +    vec[i>>1]=val;
 142.160 +    decay-=8.;
 142.161 +  }
 142.162 +
 142.163 +  /*_analysis_output_always("spread",seq2++,vec,n/4,0,0,0);*/
 142.164 +
 142.165 +  /* perform preecho/postecho triggering by band */
 142.166 +  for(j=0;j<VE_BANDS;j++){
 142.167 +    float acc=0.;
 142.168 +    float valmax,valmin;
 142.169 +
 142.170 +    /* accumulate amplitude */
 142.171 +    for(i=0;i<bands[j].end;i++)
 142.172 +      acc+=vec[i+bands[j].begin]*bands[j].window[i];
 142.173 +
 142.174 +    acc*=bands[j].total;
 142.175 +
 142.176 +    /* convert amplitude to delta */
 142.177 +    {
 142.178 +      int p,this=filters[j].ampptr;
 142.179 +      float postmax,postmin,premax=-99999.f,premin=99999.f;
 142.180 +
 142.181 +      p=this;
 142.182 +      p--;
 142.183 +      if(p<0)p+=VE_AMP;
 142.184 +      postmax=max(acc,filters[j].ampbuf[p]);
 142.185 +      postmin=min(acc,filters[j].ampbuf[p]);
 142.186 +
 142.187 +      for(i=0;i<stretch;i++){
 142.188 +        p--;
 142.189 +        if(p<0)p+=VE_AMP;
 142.190 +        premax=max(premax,filters[j].ampbuf[p]);
 142.191 +        premin=min(premin,filters[j].ampbuf[p]);
 142.192 +      }
 142.193 +
 142.194 +      valmin=postmin-premin;
 142.195 +      valmax=postmax-premax;
 142.196 +
 142.197 +      /*filters[j].markers[pos]=valmax;*/
 142.198 +      filters[j].ampbuf[this]=acc;
 142.199 +      filters[j].ampptr++;
 142.200 +      if(filters[j].ampptr>=VE_AMP)filters[j].ampptr=0;
 142.201 +    }
 142.202 +
 142.203 +    /* look at min/max, decide trigger */
 142.204 +    if(valmax>gi->preecho_thresh[j]+penalty){
 142.205 +      ret|=1;
 142.206 +      ret|=4;
 142.207 +    }
 142.208 +    if(valmin<gi->postecho_thresh[j]-penalty)ret|=2;
 142.209 +  }
 142.210 +
 142.211 +  return(ret);
 142.212 +}
 142.213 +
 142.214 +#if 0
 142.215 +static int seq=0;
 142.216 +static ogg_int64_t totalshift=-1024;
 142.217 +#endif
 142.218 +
 142.219 +long _ve_envelope_search(vorbis_dsp_state *v){
 142.220 +  vorbis_info *vi=v->vi;
 142.221 +  codec_setup_info *ci=vi->codec_setup;
 142.222 +  vorbis_info_psy_global *gi=&ci->psy_g_param;
 142.223 +  envelope_lookup *ve=((private_state *)(v->backend_state))->ve;
 142.224 +  long i,j;
 142.225 +
 142.226 +  int first=ve->current/ve->searchstep;
 142.227 +  int last=v->pcm_current/ve->searchstep-VE_WIN;
 142.228 +  if(first<0)first=0;
 142.229 +
 142.230 +  /* make sure we have enough storage to match the PCM */
 142.231 +  if(last+VE_WIN+VE_POST>ve->storage){
 142.232 +    ve->storage=last+VE_WIN+VE_POST; /* be sure */
 142.233 +    ve->mark=_ogg_realloc(ve->mark,ve->storage*sizeof(*ve->mark));
 142.234 +  }
 142.235 +
 142.236 +  for(j=first;j<last;j++){
 142.237 +    int ret=0;
 142.238 +
 142.239 +    ve->stretch++;
 142.240 +    if(ve->stretch>VE_MAXSTRETCH*2)
 142.241 +      ve->stretch=VE_MAXSTRETCH*2;
 142.242 +
 142.243 +    for(i=0;i<ve->ch;i++){
 142.244 +      float *pcm=v->pcm[i]+ve->searchstep*(j);
 142.245 +      ret|=_ve_amp(ve,gi,pcm,ve->band,ve->filter+i*VE_BANDS);
 142.246 +    }
 142.247 +
 142.248 +    ve->mark[j+VE_POST]=0;
 142.249 +    if(ret&1){
 142.250 +      ve->mark[j]=1;
 142.251 +      ve->mark[j+1]=1;
 142.252 +    }
 142.253 +
 142.254 +    if(ret&2){
 142.255 +      ve->mark[j]=1;
 142.256 +      if(j>0)ve->mark[j-1]=1;
 142.257 +    }
 142.258 +
 142.259 +    if(ret&4)ve->stretch=-1;
 142.260 +  }
 142.261 +
 142.262 +  ve->current=last*ve->searchstep;
 142.263 +
 142.264 +  {
 142.265 +    long centerW=v->centerW;
 142.266 +    long testW=
 142.267 +      centerW+
 142.268 +      ci->blocksizes[v->W]/4+
 142.269 +      ci->blocksizes[1]/2+
 142.270 +      ci->blocksizes[0]/4;
 142.271 +
 142.272 +    j=ve->cursor;
 142.273 +
 142.274 +    while(j<ve->current-(ve->searchstep)){/* account for postecho
 142.275 +                                             working back one window */
 142.276 +      if(j>=testW)return(1);
 142.277 +
 142.278 +      ve->cursor=j;
 142.279 +
 142.280 +      if(ve->mark[j/ve->searchstep]){
 142.281 +        if(j>centerW){
 142.282 +
 142.283 +#if 0
 142.284 +          if(j>ve->curmark){
 142.285 +            float *marker=alloca(v->pcm_current*sizeof(*marker));
 142.286 +            int l,m;
 142.287 +            memset(marker,0,sizeof(*marker)*v->pcm_current);
 142.288 +            fprintf(stderr,"mark! seq=%d, cursor:%fs time:%fs\n",
 142.289 +                    seq,
 142.290 +                    (totalshift+ve->cursor)/44100.,
 142.291 +                    (totalshift+j)/44100.);
 142.292 +            _analysis_output_always("pcmL",seq,v->pcm[0],v->pcm_current,0,0,totalshift);
 142.293 +            _analysis_output_always("pcmR",seq,v->pcm[1],v->pcm_current,0,0,totalshift);
 142.294 +
 142.295 +            _analysis_output_always("markL",seq,v->pcm[0],j,0,0,totalshift);
 142.296 +            _analysis_output_always("markR",seq,v->pcm[1],j,0,0,totalshift);
 142.297 +
 142.298 +            for(m=0;m<VE_BANDS;m++){
 142.299 +              char buf[80];
 142.300 +              sprintf(buf,"delL%d",m);
 142.301 +              for(l=0;l<last;l++)marker[l*ve->searchstep]=ve->filter[m].markers[l]*.1;
 142.302 +              _analysis_output_always(buf,seq,marker,v->pcm_current,0,0,totalshift);
 142.303 +            }
 142.304 +
 142.305 +            for(m=0;m<VE_BANDS;m++){
 142.306 +              char buf[80];
 142.307 +              sprintf(buf,"delR%d",m);
 142.308 +              for(l=0;l<last;l++)marker[l*ve->searchstep]=ve->filter[m+VE_BANDS].markers[l]*.1;
 142.309 +              _analysis_output_always(buf,seq,marker,v->pcm_current,0,0,totalshift);
 142.310 +            }
 142.311 +
 142.312 +            for(l=0;l<last;l++)marker[l*ve->searchstep]=ve->mark[l]*.4;
 142.313 +            _analysis_output_always("mark",seq,marker,v->pcm_current,0,0,totalshift);
 142.314 +
 142.315 +
 142.316 +            seq++;
 142.317 +
 142.318 +          }
 142.319 +#endif
 142.320 +
 142.321 +          ve->curmark=j;
 142.322 +          if(j>=testW)return(1);
 142.323 +          return(0);
 142.324 +        }
 142.325 +      }
 142.326 +      j+=ve->searchstep;
 142.327 +    }
 142.328 +  }
 142.329 +
 142.330 +  return(-1);
 142.331 +}
 142.332 +
 142.333 +int _ve_envelope_mark(vorbis_dsp_state *v){
 142.334 +  envelope_lookup *ve=((private_state *)(v->backend_state))->ve;
 142.335 +  vorbis_info *vi=v->vi;
 142.336 +  codec_setup_info *ci=vi->codec_setup;
 142.337 +  long centerW=v->centerW;
 142.338 +  long beginW=centerW-ci->blocksizes[v->W]/4;
 142.339 +  long endW=centerW+ci->blocksizes[v->W]/4;
 142.340 +  if(v->W){
 142.341 +    beginW-=ci->blocksizes[v->lW]/4;
 142.342 +    endW+=ci->blocksizes[v->nW]/4;
 142.343 +  }else{
 142.344 +    beginW-=ci->blocksizes[0]/4;
 142.345 +    endW+=ci->blocksizes[0]/4;
 142.346 +  }
 142.347 +
 142.348 +  if(ve->curmark>=beginW && ve->curmark<endW)return(1);
 142.349 +  {
 142.350 +    long first=beginW/ve->searchstep;
 142.351 +    long last=endW/ve->searchstep;
 142.352 +    long i;
 142.353 +    for(i=first;i<last;i++)
 142.354 +      if(ve->mark[i])return(1);
 142.355 +  }
 142.356 +  return(0);
 142.357 +}
 142.358 +
 142.359 +void _ve_envelope_shift(envelope_lookup *e,long shift){
 142.360 +  int smallsize=e->current/e->searchstep+VE_POST; /* adjust for placing marks
 142.361 +                                                     ahead of ve->current */
 142.362 +  int smallshift=shift/e->searchstep;
 142.363 +
 142.364 +  memmove(e->mark,e->mark+smallshift,(smallsize-smallshift)*sizeof(*e->mark));
 142.365 +
 142.366 +#if 0
 142.367 +  for(i=0;i<VE_BANDS*e->ch;i++)
 142.368 +    memmove(e->filter[i].markers,
 142.369 +            e->filter[i].markers+smallshift,
 142.370 +            (1024-smallshift)*sizeof(*(*e->filter).markers));
 142.371 +  totalshift+=shift;
 142.372 +#endif
 142.373 +
 142.374 +  e->current-=shift;
 142.375 +  if(e->curmark>=0)
 142.376 +    e->curmark-=shift;
 142.377 +  e->cursor-=shift;
 142.378 +}
   143.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   143.2 +++ b/libs/vorbis/envelope.h	Sun Nov 01 00:36:56 2015 +0200
   143.3 @@ -0,0 +1,80 @@
   143.4 +/********************************************************************
   143.5 + *                                                                  *
   143.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   143.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   143.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   143.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  143.10 + *                                                                  *
  143.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
  143.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  143.13 + *                                                                  *
  143.14 + ********************************************************************
  143.15 +
  143.16 + function: PCM data envelope analysis and manipulation
  143.17 + last mod: $Id: envelope.h 16227 2009-07-08 06:58:46Z xiphmont $
  143.18 +
  143.19 + ********************************************************************/
  143.20 +
  143.21 +#ifndef _V_ENVELOPE_
  143.22 +#define _V_ENVELOPE_
  143.23 +
  143.24 +#include "mdct.h"
  143.25 +
  143.26 +#define VE_PRE    16
  143.27 +#define VE_WIN    4
  143.28 +#define VE_POST   2
  143.29 +#define VE_AMP    (VE_PRE+VE_POST-1)
  143.30 +
  143.31 +#define VE_BANDS  7
  143.32 +#define VE_NEARDC 15
  143.33 +
  143.34 +#define VE_MINSTRETCH 2   /* a bit less than short block */
  143.35 +#define VE_MAXSTRETCH 12  /* one-third full block */
  143.36 +
  143.37 +typedef struct {
  143.38 +  float ampbuf[VE_AMP];
  143.39 +  int   ampptr;
  143.40 +
  143.41 +  float nearDC[VE_NEARDC];
  143.42 +  float nearDC_acc;
  143.43 +  float nearDC_partialacc;
  143.44 +  int   nearptr;
  143.45 +
  143.46 +} envelope_filter_state;
  143.47 +
  143.48 +typedef struct {
  143.49 +  int begin;
  143.50 +  int end;
  143.51 +  float *window;
  143.52 +  float total;
  143.53 +} envelope_band;
  143.54 +
  143.55 +typedef struct {
  143.56 +  int ch;
  143.57 +  int winlength;
  143.58 +  int searchstep;
  143.59 +  float minenergy;
  143.60 +
  143.61 +  mdct_lookup  mdct;
  143.62 +  float       *mdct_win;
  143.63 +
  143.64 +  envelope_band          band[VE_BANDS];
  143.65 +  envelope_filter_state *filter;
  143.66 +  int   stretch;
  143.67 +
  143.68 +  int                   *mark;
  143.69 +
  143.70 +  long storage;
  143.71 +  long current;
  143.72 +  long curmark;
  143.73 +  long cursor;
  143.74 +} envelope_lookup;
  143.75 +
  143.76 +extern void _ve_envelope_init(envelope_lookup *e,vorbis_info *vi);
  143.77 +extern void _ve_envelope_clear(envelope_lookup *e);
  143.78 +extern long _ve_envelope_search(vorbis_dsp_state *v);
  143.79 +extern void _ve_envelope_shift(envelope_lookup *e,long shift);
  143.80 +extern int  _ve_envelope_mark(vorbis_dsp_state *v);
  143.81 +
  143.82 +
  143.83 +#endif
   144.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   144.2 +++ b/libs/vorbis/floor0.c	Sun Nov 01 00:36:56 2015 +0200
   144.3 @@ -0,0 +1,221 @@
   144.4 +/********************************************************************
   144.5 + *                                                                  *
   144.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   144.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   144.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   144.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  144.10 + *                                                                  *
  144.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
  144.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  144.13 + *                                                                  *
  144.14 + ********************************************************************
  144.15 +
  144.16 + function: floor backend 0 implementation
  144.17 + last mod: $Id: floor0.c 18184 2012-02-03 20:55:12Z xiphmont $
  144.18 +
  144.19 + ********************************************************************/
  144.20 +
  144.21 +#include <stdlib.h>
  144.22 +#include <string.h>
  144.23 +#include <math.h>
  144.24 +#include <ogg/ogg.h>
  144.25 +#include "vorbis/codec.h"
  144.26 +#include "codec_internal.h"
  144.27 +#include "registry.h"
  144.28 +#include "lpc.h"
  144.29 +#include "lsp.h"
  144.30 +#include "codebook.h"
  144.31 +#include "scales.h"
  144.32 +#include "misc.h"
  144.33 +#include "os.h"
  144.34 +
  144.35 +#include "misc.h"
  144.36 +#include <stdio.h>
  144.37 +
  144.38 +typedef struct {
  144.39 +  int ln;
  144.40 +  int  m;
  144.41 +  int **linearmap;
  144.42 +  int  n[2];
  144.43 +
  144.44 +  vorbis_info_floor0 *vi;
  144.45 +
  144.46 +  long bits;
  144.47 +  long frames;
  144.48 +} vorbis_look_floor0;
  144.49 +
  144.50 +
  144.51 +/***********************************************/
  144.52 +
  144.53 +static void floor0_free_info(vorbis_info_floor *i){
  144.54 +  vorbis_info_floor0 *info=(vorbis_info_floor0 *)i;
  144.55 +  if(info){
  144.56 +    memset(info,0,sizeof(*info));
  144.57 +    _ogg_free(info);
  144.58 +  }
  144.59 +}
  144.60 +
  144.61 +static void floor0_free_look(vorbis_look_floor *i){
  144.62 +  vorbis_look_floor0 *look=(vorbis_look_floor0 *)i;
  144.63 +  if(look){
  144.64 +
  144.65 +    if(look->linearmap){
  144.66 +
  144.67 +      if(look->linearmap[0])_ogg_free(look->linearmap[0]);
  144.68 +      if(look->linearmap[1])_ogg_free(look->linearmap[1]);
  144.69 +
  144.70 +      _ogg_free(look->linearmap);
  144.71 +    }
  144.72 +    memset(look,0,sizeof(*look));
  144.73 +    _ogg_free(look);
  144.74 +  }
  144.75 +}
  144.76 +
  144.77 +static vorbis_info_floor *floor0_unpack (vorbis_info *vi,oggpack_buffer *opb){
  144.78 +  codec_setup_info     *ci=vi->codec_setup;
  144.79 +  int j;
  144.80 +
  144.81 +  vorbis_info_floor0 *info=_ogg_malloc(sizeof(*info));
  144.82 +  info->order=oggpack_read(opb,8);
  144.83 +  info->rate=oggpack_read(opb,16);
  144.84 +  info->barkmap=oggpack_read(opb,16);
  144.85 +  info->ampbits=oggpack_read(opb,6);
  144.86 +  info->ampdB=oggpack_read(opb,8);
  144.87 +  info->numbooks=oggpack_read(opb,4)+1;
  144.88 +
  144.89 +  if(info->order<1)goto err_out;
  144.90 +  if(info->rate<1)goto err_out;
  144.91 +  if(info->barkmap<1)goto err_out;
  144.92 +  if(info->numbooks<1)goto err_out;
  144.93 +
  144.94 +  for(j=0;j<info->numbooks;j++){
  144.95 +    info->books[j]=oggpack_read(opb,8);
  144.96 +    if(info->books[j]<0 || info->books[j]>=ci->books)goto err_out;
  144.97 +    if(ci->book_param[info->books[j]]->maptype==0)goto err_out;
  144.98 +    if(ci->book_param[info->books[j]]->dim<1)goto err_out;
  144.99 +  }
 144.100 +  return(info);
 144.101 +
 144.102 + err_out:
 144.103 +  floor0_free_info(info);
 144.104 +  return(NULL);
 144.105 +}
 144.106 +
 144.107 +/* initialize Bark scale and normalization lookups.  We could do this
 144.108 +   with static tables, but Vorbis allows a number of possible
 144.109 +   combinations, so it's best to do it computationally.
 144.110 +
 144.111 +   The below is authoritative in terms of defining scale mapping.
 144.112 +   Note that the scale depends on the sampling rate as well as the
 144.113 +   linear block and mapping sizes */
 144.114 +
 144.115 +static void floor0_map_lazy_init(vorbis_block      *vb,
 144.116 +                                 vorbis_info_floor *infoX,
 144.117 +                                 vorbis_look_floor0 *look){
 144.118 +  if(!look->linearmap[vb->W]){
 144.119 +    vorbis_dsp_state   *vd=vb->vd;
 144.120 +    vorbis_info        *vi=vd->vi;
 144.121 +    codec_setup_info   *ci=vi->codec_setup;
 144.122 +    vorbis_info_floor0 *info=(vorbis_info_floor0 *)infoX;
 144.123 +    int W=vb->W;
 144.124 +    int n=ci->blocksizes[W]/2,j;
 144.125 +
 144.126 +    /* we choose a scaling constant so that:
 144.127 +       floor(bark(rate/2-1)*C)=mapped-1
 144.128 +     floor(bark(rate/2)*C)=mapped */
 144.129 +    float scale=look->ln/toBARK(info->rate/2.f);
 144.130 +
 144.131 +    /* the mapping from a linear scale to a smaller bark scale is
 144.132 +       straightforward.  We do *not* make sure that the linear mapping
 144.133 +       does not skip bark-scale bins; the decoder simply skips them and
 144.134 +       the encoder may do what it wishes in filling them.  They're
 144.135 +       necessary in some mapping combinations to keep the scale spacing
 144.136 +       accurate */
 144.137 +    look->linearmap[W]=_ogg_malloc((n+1)*sizeof(**look->linearmap));
 144.138 +    for(j=0;j<n;j++){
 144.139 +      int val=floor( toBARK((info->rate/2.f)/n*j)
 144.140 +                     *scale); /* bark numbers represent band edges */
 144.141 +      if(val>=look->ln)val=look->ln-1; /* guard against the approximation */
 144.142 +      look->linearmap[W][j]=val;
 144.143 +    }
 144.144 +    look->linearmap[W][j]=-1;
 144.145 +    look->n[W]=n;
 144.146 +  }
 144.147 +}
 144.148 +
 144.149 +static vorbis_look_floor *floor0_look(vorbis_dsp_state *vd,
 144.150 +                                      vorbis_info_floor *i){
 144.151 +  vorbis_info_floor0 *info=(vorbis_info_floor0 *)i;
 144.152 +  vorbis_look_floor0 *look=_ogg_calloc(1,sizeof(*look));
 144.153 +  look->m=info->order;
 144.154 +  look->ln=info->barkmap;
 144.155 +  look->vi=info;
 144.156 +
 144.157 +  look->linearmap=_ogg_calloc(2,sizeof(*look->linearmap));
 144.158 +
 144.159 +  return look;
 144.160 +}
 144.161 +
 144.162 +static void *floor0_inverse1(vorbis_block *vb,vorbis_look_floor *i){
 144.163 +  vorbis_look_floor0 *look=(vorbis_look_floor0 *)i;
 144.164 +  vorbis_info_floor0 *info=look->vi;
 144.165 +  int j,k;
 144.166 +
 144.167 +  int ampraw=oggpack_read(&vb->opb,info->ampbits);
 144.168 +  if(ampraw>0){ /* also handles the -1 out of data case */
 144.169 +    long maxval=(1<<info->ampbits)-1;
 144.170 +    float amp=(float)ampraw/maxval*info->ampdB;
 144.171 +    int booknum=oggpack_read(&vb->opb,_ilog(info->numbooks));
 144.172 +
 144.173 +    if(booknum!=-1 && booknum<info->numbooks){ /* be paranoid */
 144.174 +      codec_setup_info  *ci=vb->vd->vi->codec_setup;
 144.175 +      codebook *b=ci->fullbooks+info->books[booknum];
 144.176 +      float last=0.f;
 144.177 +
 144.178 +      /* the additional b->dim is a guard against any possible stack
 144.179 +         smash; b->dim is provably more than we can overflow the
 144.180 +         vector */
 144.181 +      float *lsp=_vorbis_block_alloc(vb,sizeof(*lsp)*(look->m+b->dim+1));
 144.182 +
 144.183 +      if(vorbis_book_decodev_set(b,lsp,&vb->opb,look->m)==-1)goto eop;
 144.184 +      for(j=0;j<look->m;){
 144.185 +        for(k=0;j<look->m && k<b->dim;k++,j++)lsp[j]+=last;
 144.186 +        last=lsp[j-1];
 144.187 +      }
 144.188 +
 144.189 +      lsp[look->m]=amp;
 144.190 +      return(lsp);
 144.191 +    }
 144.192 +  }
 144.193 + eop:
 144.194 +  return(NULL);
 144.195 +}
 144.196 +
 144.197 +static int floor0_inverse2(vorbis_block *vb,vorbis_look_floor *i,
 144.198 +                           void *memo,float *out){
 144.199 +  vorbis_look_floor0 *look=(vorbis_look_floor0 *)i;
 144.200 +  vorbis_info_floor0 *info=look->vi;
 144.201 +
 144.202 +  floor0_map_lazy_init(vb,info,look);
 144.203 +
 144.204 +  if(memo){
 144.205 +    float *lsp=(float *)memo;
 144.206 +    float amp=lsp[look->m];
 144.207 +
 144.208 +    /* take the coefficients back to a spectral envelope curve */
 144.209 +    vorbis_lsp_to_curve(out,
 144.210 +                        look->linearmap[vb->W],
 144.211 +                        look->n[vb->W],
 144.212 +                        look->ln,
 144.213 +                        lsp,look->m,amp,(float)info->ampdB);
 144.214 +    return(1);
 144.215 +  }
 144.216 +  memset(out,0,sizeof(*out)*look->n[vb->W]);
 144.217 +  return(0);
 144.218 +}
 144.219 +
 144.220 +/* export hooks */
 144.221 +const vorbis_func_floor floor0_exportbundle={
 144.222 +  NULL,&floor0_unpack,&floor0_look,&floor0_free_info,
 144.223 +  &floor0_free_look,&floor0_inverse1,&floor0_inverse2
 144.224 +};
   145.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   145.2 +++ b/libs/vorbis/floor1.c	Sun Nov 01 00:36:56 2015 +0200
   145.3 @@ -0,0 +1,1100 @@
   145.4 +/********************************************************************
   145.5 + *                                                                  *
   145.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   145.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   145.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   145.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  145.10 + *                                                                  *
  145.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
  145.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  145.13 + *                                                                  *
  145.14 + ********************************************************************
  145.15 +
  145.16 + function: floor backend 1 implementation
  145.17 + last mod: $Id: floor1.c 18151 2012-01-20 07:35:26Z xiphmont $
  145.18 +
  145.19 + ********************************************************************/
  145.20 +
  145.21 +#include <stdlib.h>
  145.22 +#include <string.h>
  145.23 +#include <math.h>
  145.24 +#include <ogg/ogg.h>
  145.25 +#include "vorbis/codec.h"
  145.26 +#include "codec_internal.h"
  145.27 +#include "registry.h"
  145.28 +#include "codebook.h"
  145.29 +#include "misc.h"
  145.30 +#include "scales.h"
  145.31 +
  145.32 +#include <stdio.h>
  145.33 +
  145.34 +#define floor1_rangedB 140 /* floor 1 fixed at -140dB to 0dB range */
  145.35 +
  145.36 +typedef struct lsfit_acc{
  145.37 +  int x0;
  145.38 +  int x1;
  145.39 +
  145.40 +  int xa;
  145.41 +  int ya;
  145.42 +  int x2a;
  145.43 +  int y2a;
  145.44 +  int xya;
  145.45 +  int an;
  145.46 +
  145.47 +  int xb;
  145.48 +  int yb;
  145.49 +  int x2b;
  145.50 +  int y2b;
  145.51 +  int xyb;
  145.52 +  int bn;
  145.53 +} lsfit_acc;
  145.54 +
  145.55 +/***********************************************/
  145.56 +
  145.57 +static void floor1_free_info(vorbis_info_floor *i){
  145.58 +  vorbis_info_floor1 *info=(vorbis_info_floor1 *)i;
  145.59 +  if(info){
  145.60 +    memset(info,0,sizeof(*info));
  145.61 +    _ogg_free(info);
  145.62 +  }
  145.63 +}
  145.64 +
  145.65 +static void floor1_free_look(vorbis_look_floor *i){
  145.66 +  vorbis_look_floor1 *look=(vorbis_look_floor1 *)i;
  145.67 +  if(look){
  145.68 +    /*fprintf(stderr,"floor 1 bit usage %f:%f (%f total)\n",
  145.69 +            (float)look->phrasebits/look->frames,
  145.70 +            (float)look->postbits/look->frames,
  145.71 +            (float)(look->postbits+look->phrasebits)/look->frames);*/
  145.72 +
  145.73 +    memset(look,0,sizeof(*look));
  145.74 +    _ogg_free(look);
  145.75 +  }
  145.76 +}
  145.77 +
  145.78 +static int ilog(unsigned int v){
  145.79 +  int ret=0;
  145.80 +  while(v){
  145.81 +    ret++;
  145.82 +    v>>=1;
  145.83 +  }
  145.84 +  return(ret);
  145.85 +}
  145.86 +
  145.87 +static int ilog2(unsigned int v){
  145.88 +  int ret=0;
  145.89 +  if(v)--v;
  145.90 +  while(v){
  145.91 +    ret++;
  145.92 +    v>>=1;
  145.93 +  }
  145.94 +  return(ret);
  145.95 +}
  145.96 +
  145.97 +static void floor1_pack (vorbis_info_floor *i,oggpack_buffer *opb){
  145.98 +  vorbis_info_floor1 *info=(vorbis_info_floor1 *)i;
  145.99 +  int j,k;
 145.100 +  int count=0;
 145.101 +  int rangebits;
 145.102 +  int maxposit=info->postlist[1];
 145.103 +  int maxclass=-1;
 145.104 +
 145.105 +  /* save out partitions */
 145.106 +  oggpack_write(opb,info->partitions,5); /* only 0 to 31 legal */
 145.107 +  for(j=0;j<info->partitions;j++){
 145.108 +    oggpack_write(opb,info->partitionclass[j],4); /* only 0 to 15 legal */
 145.109 +    if(maxclass<info->partitionclass[j])maxclass=info->partitionclass[j];
 145.110 +  }
 145.111 +
 145.112 +  /* save out partition classes */
 145.113 +  for(j=0;j<maxclass+1;j++){
 145.114 +    oggpack_write(opb,info->class_dim[j]-1,3); /* 1 to 8 */
 145.115 +    oggpack_write(opb,info->class_subs[j],2); /* 0 to 3 */
 145.116 +    if(info->class_subs[j])oggpack_write(opb,info->class_book[j],8);
 145.117 +    for(k=0;k<(1<<info->class_subs[j]);k++)
 145.118 +      oggpack_write(opb,info->class_subbook[j][k]+1,8);
 145.119 +  }
 145.120 +
 145.121 +  /* save out the post list */
 145.122 +  oggpack_write(opb,info->mult-1,2);     /* only 1,2,3,4 legal now */
 145.123 +  oggpack_write(opb,ilog2(maxposit),4);
 145.124 +  rangebits=ilog2(maxposit);
 145.125 +
 145.126 +  for(j=0,k=0;j<info->partitions;j++){
 145.127 +    count+=info->class_dim[info->partitionclass[j]];
 145.128 +    for(;k<count;k++)
 145.129 +      oggpack_write(opb,info->postlist[k+2],rangebits);
 145.130 +  }
 145.131 +}
 145.132 +
 145.133 +static int icomp(const void *a,const void *b){
 145.134 +  return(**(int **)a-**(int **)b);
 145.135 +}
 145.136 +
 145.137 +static vorbis_info_floor *floor1_unpack (vorbis_info *vi,oggpack_buffer *opb){
 145.138 +  codec_setup_info     *ci=vi->codec_setup;
 145.139 +  int j,k,count=0,maxclass=-1,rangebits;
 145.140 +
 145.141 +  vorbis_info_floor1 *info=_ogg_calloc(1,sizeof(*info));
 145.142 +  /* read partitions */
 145.143 +  info->partitions=oggpack_read(opb,5); /* only 0 to 31 legal */
 145.144 +  for(j=0;j<info->partitions;j++){
 145.145 +    info->partitionclass[j]=oggpack_read(opb,4); /* only 0 to 15 legal */
 145.146 +    if(info->partitionclass[j]<0)goto err_out;
 145.147 +    if(maxclass<info->partitionclass[j])maxclass=info->partitionclass[j];
 145.148 +  }
 145.149 +
 145.150 +  /* read partition classes */
 145.151 +  for(j=0;j<maxclass+1;j++){
 145.152 +    info->class_dim[j]=oggpack_read(opb,3)+1; /* 1 to 8 */
 145.153 +    info->class_subs[j]=oggpack_read(opb,2); /* 0,1,2,3 bits */
 145.154 +    if(info->class_subs[j]<0)
 145.155 +      goto err_out;
 145.156 +    if(info->class_subs[j])info->class_book[j]=oggpack_read(opb,8);
 145.157 +    if(info->class_book[j]<0 || info->class_book[j]>=ci->books)
 145.158 +      goto err_out;
 145.159 +    for(k=0;k<(1<<info->class_subs[j]);k++){
 145.160 +      info->class_subbook[j][k]=oggpack_read(opb,8)-1;
 145.161 +      if(info->class_subbook[j][k]<-1 || info->class_subbook[j][k]>=ci->books)
 145.162 +        goto err_out;
 145.163 +    }
 145.164 +  }
 145.165 +
 145.166 +  /* read the post list */
 145.167 +  info->mult=oggpack_read(opb,2)+1;     /* only 1,2,3,4 legal now */
 145.168 +  rangebits=oggpack_read(opb,4);
 145.169 +  if(rangebits<0)goto err_out;
 145.170 +
 145.171 +  for(j=0,k=0;j<info->partitions;j++){
 145.172 +    count+=info->class_dim[info->partitionclass[j]];
 145.173 +    if(count>VIF_POSIT) goto err_out;
 145.174 +    for(;k<count;k++){
 145.175 +      int t=info->postlist[k+2]=oggpack_read(opb,rangebits);
 145.176 +      if(t<0 || t>=(1<<rangebits))
 145.177 +        goto err_out;
 145.178 +    }
 145.179 +  }
 145.180 +  info->postlist[0]=0;
 145.181 +  info->postlist[1]=1<<rangebits;
 145.182 +
 145.183 +  /* don't allow repeated values in post list as they'd result in
 145.184 +     zero-length segments */
 145.185 +  {
 145.186 +    int *sortpointer[VIF_POSIT+2];
 145.187 +    for(j=0;j<count+2;j++)sortpointer[j]=info->postlist+j;
 145.188 +    qsort(sortpointer,count+2,sizeof(*sortpointer),icomp);
 145.189 +
 145.190 +    for(j=1;j<count+2;j++)
 145.191 +      if(*sortpointer[j-1]==*sortpointer[j])goto err_out;
 145.192 +  }
 145.193 +
 145.194 +  return(info);
 145.195 +
 145.196 + err_out:
 145.197 +  floor1_free_info(info);
 145.198 +  return(NULL);
 145.199 +}
 145.200 +
 145.201 +static vorbis_look_floor *floor1_look(vorbis_dsp_state *vd,
 145.202 +                                      vorbis_info_floor *in){
 145.203 +
 145.204 +  int *sortpointer[VIF_POSIT+2];
 145.205 +  vorbis_info_floor1 *info=(vorbis_info_floor1 *)in;
 145.206 +  vorbis_look_floor1 *look=_ogg_calloc(1,sizeof(*look));
 145.207 +  int i,j,n=0;
 145.208 +
 145.209 +  look->vi=info;
 145.210 +  look->n=info->postlist[1];
 145.211 +
 145.212 +  /* we drop each position value in-between already decoded values,
 145.213 +     and use linear interpolation to predict each new value past the
 145.214 +     edges.  The positions are read in the order of the position
 145.215 +     list... we precompute the bounding positions in the lookup.  Of
 145.216 +     course, the neighbors can change (if a position is declined), but
 145.217 +     this is an initial mapping */
 145.218 +
 145.219 +  for(i=0;i<info->partitions;i++)n+=info->class_dim[info->partitionclass[i]];
 145.220 +  n+=2;
 145.221 +  look->posts=n;
 145.222 +
 145.223 +  /* also store a sorted position index */
 145.224 +  for(i=0;i<n;i++)sortpointer[i]=info->postlist+i;
 145.225 +  qsort(sortpointer,n,sizeof(*sortpointer),icomp);
 145.226 +
 145.227 +  /* points from sort order back to range number */
 145.228 +  for(i=0;i<n;i++)look->forward_index[i]=sortpointer[i]-info->postlist;
 145.229 +  /* points from range order to sorted position */
 145.230 +  for(i=0;i<n;i++)look->reverse_index[look->forward_index[i]]=i;
 145.231 +  /* we actually need the post values too */
 145.232 +  for(i=0;i<n;i++)look->sorted_index[i]=info->postlist[look->forward_index[i]];
 145.233 +
 145.234 +  /* quantize values to multiplier spec */
 145.235 +  switch(info->mult){
 145.236 +  case 1: /* 1024 -> 256 */
 145.237 +    look->quant_q=256;
 145.238 +    break;
 145.239 +  case 2: /* 1024 -> 128 */
 145.240 +    look->quant_q=128;
 145.241 +    break;
 145.242 +  case 3: /* 1024 -> 86 */
 145.243 +    look->quant_q=86;
 145.244 +    break;
 145.245 +  case 4: /* 1024 -> 64 */
 145.246 +    look->quant_q=64;
 145.247 +    break;
 145.248 +  }
 145.249 +
 145.250 +  /* discover our neighbors for decode where we don't use fit flags
 145.251 +     (that would push the neighbors outward) */
 145.252 +  for(i=0;i<n-2;i++){
 145.253 +    int lo=0;
 145.254 +    int hi=1;
 145.255 +    int lx=0;
 145.256 +    int hx=look->n;
 145.257 +    int currentx=info->postlist[i+2];
 145.258 +    for(j=0;j<i+2;j++){
 145.259 +      int x=info->postlist[j];
 145.260 +      if(x>lx && x<currentx){
 145.261 +        lo=j;
 145.262 +        lx=x;
 145.263 +      }
 145.264 +      if(x<hx && x>currentx){
 145.265 +        hi=j;
 145.266 +        hx=x;
 145.267 +      }
 145.268 +    }
 145.269 +    look->loneighbor[i]=lo;
 145.270 +    look->hineighbor[i]=hi;
 145.271 +  }
 145.272 +
 145.273 +  return(look);
 145.274 +}
 145.275 +
 145.276 +static int render_point(int x0,int x1,int y0,int y1,int x){
 145.277 +  y0&=0x7fff; /* mask off flag */
 145.278 +  y1&=0x7fff;
 145.279 +
 145.280 +  {
 145.281 +    int dy=y1-y0;
 145.282 +    int adx=x1-x0;
 145.283 +    int ady=abs(dy);
 145.284 +    int err=ady*(x-x0);
 145.285 +
 145.286 +    int off=err/adx;
 145.287 +    if(dy<0)return(y0-off);
 145.288 +    return(y0+off);
 145.289 +  }
 145.290 +}
 145.291 +
 145.292 +static int vorbis_dBquant(const float *x){
 145.293 +  int i= *x*7.3142857f+1023.5f;
 145.294 +  if(i>1023)return(1023);
 145.295 +  if(i<0)return(0);
 145.296 +  return i;
 145.297 +}
 145.298 +
 145.299 +static const float FLOOR1_fromdB_LOOKUP[256]={
 145.300 +  1.0649863e-07F, 1.1341951e-07F, 1.2079015e-07F, 1.2863978e-07F,
 145.301 +  1.3699951e-07F, 1.4590251e-07F, 1.5538408e-07F, 1.6548181e-07F,
 145.302 +  1.7623575e-07F, 1.8768855e-07F, 1.9988561e-07F, 2.128753e-07F,
 145.303 +  2.2670913e-07F, 2.4144197e-07F, 2.5713223e-07F, 2.7384213e-07F,
 145.304 +  2.9163793e-07F, 3.1059021e-07F, 3.3077411e-07F, 3.5226968e-07F,
 145.305 +  3.7516214e-07F, 3.9954229e-07F, 4.2550680e-07F, 4.5315863e-07F,
 145.306 +  4.8260743e-07F, 5.1396998e-07F, 5.4737065e-07F, 5.8294187e-07F,
 145.307 +  6.2082472e-07F, 6.6116941e-07F, 7.0413592e-07F, 7.4989464e-07F,
 145.308 +  7.9862701e-07F, 8.5052630e-07F, 9.0579828e-07F, 9.6466216e-07F,
 145.309 +  1.0273513e-06F, 1.0941144e-06F, 1.1652161e-06F, 1.2409384e-06F,
 145.310 +  1.3215816e-06F, 1.4074654e-06F, 1.4989305e-06F, 1.5963394e-06F,
 145.311 +  1.7000785e-06F, 1.8105592e-06F, 1.9282195e-06F, 2.0535261e-06F,
 145.312 +  2.1869758e-06F, 2.3290978e-06F, 2.4804557e-06F, 2.6416497e-06F,
 145.313 +  2.8133190e-06F, 2.9961443e-06F, 3.1908506e-06F, 3.3982101e-06F,
 145.314 +  3.6190449e-06F, 3.8542308e-06F, 4.1047004e-06F, 4.3714470e-06F,
 145.315 +  4.6555282e-06F, 4.9580707e-06F, 5.2802740e-06F, 5.6234160e-06F,
 145.316 +  5.9888572e-06F, 6.3780469e-06F, 6.7925283e-06F, 7.2339451e-06F,
 145.317 +  7.7040476e-06F, 8.2047000e-06F, 8.7378876e-06F, 9.3057248e-06F,
 145.318 +  9.9104632e-06F, 1.0554501e-05F, 1.1240392e-05F, 1.1970856e-05F,
 145.319 +  1.2748789e-05F, 1.3577278e-05F, 1.4459606e-05F, 1.5399272e-05F,
 145.320 +  1.6400004e-05F, 1.7465768e-05F, 1.8600792e-05F, 1.9809576e-05F,
 145.321 +  2.1096914e-05F, 2.2467911e-05F, 2.3928002e-05F, 2.5482978e-05F,
 145.322 +  2.7139006e-05F, 2.8902651e-05F, 3.0780908e-05F, 3.2781225e-05F,
 145.323 +  3.4911534e-05F, 3.7180282e-05F, 3.9596466e-05F, 4.2169667e-05F,
 145.324 +  4.4910090e-05F, 4.7828601e-05F, 5.0936773e-05F, 5.4246931e-05F,
 145.325 +  5.7772202e-05F, 6.1526565e-05F, 6.5524908e-05F, 6.9783085e-05F,
 145.326 +  7.4317983e-05F, 7.9147585e-05F, 8.4291040e-05F, 8.9768747e-05F,
 145.327 +  9.5602426e-05F, 0.00010181521F, 0.00010843174F, 0.00011547824F,
 145.328 +  0.00012298267F, 0.00013097477F, 0.00013948625F, 0.00014855085F,
 145.329 +  0.00015820453F, 0.00016848555F, 0.00017943469F, 0.00019109536F,
 145.330 +  0.00020351382F, 0.00021673929F, 0.00023082423F, 0.00024582449F,
 145.331 +  0.00026179955F, 0.00027881276F, 0.00029693158F, 0.00031622787F,
 145.332 +  0.00033677814F, 0.00035866388F, 0.00038197188F, 0.00040679456F,
 145.333 +  0.00043323036F, 0.00046138411F, 0.00049136745F, 0.00052329927F,
 145.334 +  0.00055730621F, 0.00059352311F, 0.00063209358F, 0.00067317058F,
 145.335 +  0.00071691700F, 0.00076350630F, 0.00081312324F, 0.00086596457F,
 145.336 +  0.00092223983F, 0.00098217216F, 0.0010459992F, 0.0011139742F,
 145.337 +  0.0011863665F, 0.0012634633F, 0.0013455702F, 0.0014330129F,
 145.338 +  0.0015261382F, 0.0016253153F, 0.0017309374F, 0.0018434235F,
 145.339 +  0.0019632195F, 0.0020908006F, 0.0022266726F, 0.0023713743F,
 145.340 +  0.0025254795F, 0.0026895994F, 0.0028643847F, 0.0030505286F,
 145.341 +  0.0032487691F, 0.0034598925F, 0.0036847358F, 0.0039241906F,
 145.342 +  0.0041792066F, 0.0044507950F, 0.0047400328F, 0.0050480668F,
 145.343 +  0.0053761186F, 0.0057254891F, 0.0060975636F, 0.0064938176F,
 145.344 +  0.0069158225F, 0.0073652516F, 0.0078438871F, 0.0083536271F,
 145.345 +  0.0088964928F, 0.009474637F, 0.010090352F, 0.010746080F,
 145.346 +  0.011444421F, 0.012188144F, 0.012980198F, 0.013823725F,
 145.347 +  0.014722068F, 0.015678791F, 0.016697687F, 0.017782797F,
 145.348 +  0.018938423F, 0.020169149F, 0.021479854F, 0.022875735F,
 145.349 +  0.024362330F, 0.025945531F, 0.027631618F, 0.029427276F,
 145.350 +  0.031339626F, 0.033376252F, 0.035545228F, 0.037855157F,
 145.351 +  0.040315199F, 0.042935108F, 0.045725273F, 0.048696758F,
 145.352 +  0.051861348F, 0.055231591F, 0.058820850F, 0.062643361F,
 145.353 +  0.066714279F, 0.071049749F, 0.075666962F, 0.080584227F,
 145.354 +  0.085821044F, 0.091398179F, 0.097337747F, 0.10366330F,
 145.355 +  0.11039993F, 0.11757434F, 0.12521498F, 0.13335215F,
 145.356 +  0.14201813F, 0.15124727F, 0.16107617F, 0.17154380F,
 145.357 +  0.18269168F, 0.19456402F, 0.20720788F, 0.22067342F,
 145.358 +  0.23501402F, 0.25028656F, 0.26655159F, 0.28387361F,
 145.359 +  0.30232132F, 0.32196786F, 0.34289114F, 0.36517414F,
 145.360 +  0.38890521F, 0.41417847F, 0.44109412F, 0.46975890F,
 145.361 +  0.50028648F, 0.53279791F, 0.56742212F, 0.60429640F,
 145.362 +  0.64356699F, 0.68538959F, 0.72993007F, 0.77736504F,
 145.363 +  0.82788260F, 0.88168307F, 0.9389798F, 1.F,
 145.364 +};
 145.365 +
 145.366 +static void render_line(int n, int x0,int x1,int y0,int y1,float *d){
 145.367 +  int dy=y1-y0;
 145.368 +  int adx=x1-x0;
 145.369 +  int ady=abs(dy);
 145.370 +  int base=dy/adx;
 145.371 +  int sy=(dy<0?base-1:base+1);
 145.372 +  int x=x0;
 145.373 +  int y=y0;
 145.374 +  int err=0;
 145.375 +
 145.376 +  ady-=abs(base*adx);
 145.377 +
 145.378 +  if(n>x1)n=x1;
 145.379 +
 145.380 +  if(x<n)
 145.381 +    d[x]*=FLOOR1_fromdB_LOOKUP[y];
 145.382 +
 145.383 +  while(++x<n){
 145.384 +    err=err+ady;
 145.385 +    if(err>=adx){
 145.386 +      err-=adx;
 145.387 +      y+=sy;
 145.388 +    }else{
 145.389 +      y+=base;
 145.390 +    }
 145.391 +    d[x]*=FLOOR1_fromdB_LOOKUP[y];
 145.392 +  }
 145.393 +}
 145.394 +
 145.395 +static void render_line0(int n, int x0,int x1,int y0,int y1,int *d){
 145.396 +  int dy=y1-y0;
 145.397 +  int adx=x1-x0;
 145.398 +  int ady=abs(dy);
 145.399 +  int base=dy/adx;
 145.400 +  int sy=(dy<0?base-1:base+1);
 145.401 +  int x=x0;
 145.402 +  int y=y0;
 145.403 +  int err=0;
 145.404 +
 145.405 +  ady-=abs(base*adx);
 145.406 +
 145.407 +  if(n>x1)n=x1;
 145.408 +
 145.409 +  if(x<n)
 145.410 +    d[x]=y;
 145.411 +
 145.412 +  while(++x<n){
 145.413 +    err=err+ady;
 145.414 +    if(err>=adx){
 145.415 +      err-=adx;
 145.416 +      y+=sy;
 145.417 +    }else{
 145.418 +      y+=base;
 145.419 +    }
 145.420 +    d[x]=y;
 145.421 +  }
 145.422 +}
 145.423 +
 145.424 +/* the floor has already been filtered to only include relevant sections */
 145.425 +static int accumulate_fit(const float *flr,const float *mdct,
 145.426 +                          int x0, int x1,lsfit_acc *a,
 145.427 +                          int n,vorbis_info_floor1 *info){
 145.428 +  long i;
 145.429 +
 145.430 +  int xa=0,ya=0,x2a=0,y2a=0,xya=0,na=0, xb=0,yb=0,x2b=0,y2b=0,xyb=0,nb=0;
 145.431 +
 145.432 +  memset(a,0,sizeof(*a));
 145.433 +  a->x0=x0;
 145.434 +  a->x1=x1;
 145.435 +  if(x1>=n)x1=n-1;
 145.436 +
 145.437 +  for(i=x0;i<=x1;i++){
 145.438 +    int quantized=vorbis_dBquant(flr+i);
 145.439 +    if(quantized){
 145.440 +      if(mdct[i]+info->twofitatten>=flr[i]){
 145.441 +        xa  += i;
 145.442 +        ya  += quantized;
 145.443 +        x2a += i*i;
 145.444 +        y2a += quantized*quantized;
 145.445 +        xya += i*quantized;
 145.446 +        na++;
 145.447 +      }else{
 145.448 +        xb  += i;
 145.449 +        yb  += quantized;
 145.450 +        x2b += i*i;
 145.451 +        y2b += quantized*quantized;
 145.452 +        xyb += i*quantized;
 145.453 +        nb++;
 145.454 +      }
 145.455 +    }
 145.456 +  }
 145.457 +
 145.458 +  a->xa=xa;
 145.459 +  a->ya=ya;
 145.460 +  a->x2a=x2a;
 145.461 +  a->y2a=y2a;
 145.462 +  a->xya=xya;
 145.463 +  a->an=na;
 145.464 +
 145.465 +  a->xb=xb;
 145.466 +  a->yb=yb;
 145.467 +  a->x2b=x2b;
 145.468 +  a->y2b=y2b;
 145.469 +  a->xyb=xyb;
 145.470 +  a->bn=nb;
 145.471 +
 145.472 +  return(na);
 145.473 +}
 145.474 +
 145.475 +static int fit_line(lsfit_acc *a,int fits,int *y0,int *y1,
 145.476 +                    vorbis_info_floor1 *info){
 145.477 +  double xb=0,yb=0,x2b=0,y2b=0,xyb=0,bn=0;
 145.478 +  int i;
 145.479 +  int x0=a[0].x0;
 145.480 +  int x1=a[fits-1].x1;
 145.481 +
 145.482 +  for(i=0;i<fits;i++){
 145.483 +    double weight = (a[i].bn+a[i].an)*info->twofitweight/(a[i].an+1)+1.;
 145.484 +
 145.485 +    xb+=a[i].xb + a[i].xa * weight;
 145.486 +    yb+=a[i].yb + a[i].ya * weight;
 145.487 +    x2b+=a[i].x2b + a[i].x2a * weight;
 145.488 +    y2b+=a[i].y2b + a[i].y2a * weight;
 145.489 +    xyb+=a[i].xyb + a[i].xya * weight;
 145.490 +    bn+=a[i].bn + a[i].an * weight;
 145.491 +  }
 145.492 +
 145.493 +  if(*y0>=0){
 145.494 +    xb+=   x0;
 145.495 +    yb+=  *y0;
 145.496 +    x2b+=  x0 *  x0;
 145.497 +    y2b+= *y0 * *y0;
 145.498 +    xyb+= *y0 *  x0;
 145.499 +    bn++;
 145.500 +  }
 145.501 +
 145.502 +  if(*y1>=0){
 145.503 +    xb+=   x1;
 145.504 +    yb+=  *y1;
 145.505 +    x2b+=  x1 *  x1;
 145.506 +    y2b+= *y1 * *y1;
 145.507 +    xyb+= *y1 *  x1;
 145.508 +    bn++;
 145.509 +  }
 145.510 +
 145.511 +  {
 145.512 +    double denom=(bn*x2b-xb*xb);
 145.513 +
 145.514 +    if(denom>0.){
 145.515 +      double a=(yb*x2b-xyb*xb)/denom;
 145.516 +      double b=(bn*xyb-xb*yb)/denom;
 145.517 +      *y0=rint(a+b*x0);
 145.518 +      *y1=rint(a+b*x1);
 145.519 +
 145.520 +      /* limit to our range! */
 145.521 +      if(*y0>1023)*y0=1023;
 145.522 +      if(*y1>1023)*y1=1023;
 145.523 +      if(*y0<0)*y0=0;
 145.524 +      if(*y1<0)*y1=0;
 145.525 +
 145.526 +      return 0;
 145.527 +    }else{
 145.528 +      *y0=0;
 145.529 +      *y1=0;
 145.530 +      return 1;
 145.531 +    }
 145.532 +  }
 145.533 +}
 145.534 +
 145.535 +static int inspect_error(int x0,int x1,int y0,int y1,const float *mask,
 145.536 +                         const float *mdct,
 145.537 +                         vorbis_info_floor1 *info){
 145.538 +  int dy=y1-y0;
 145.539 +  int adx=x1-x0;
 145.540 +  int ady=abs(dy);
 145.541 +  int base=dy/adx;
 145.542 +  int sy=(dy<0?base-1:base+1);
 145.543 +  int x=x0;
 145.544 +  int y=y0;
 145.545 +  int err=0;
 145.546 +  int val=vorbis_dBquant(mask+x);
 145.547 +  int mse=0;
 145.548 +  int n=0;
 145.549 +
 145.550 +  ady-=abs(base*adx);
 145.551 +
 145.552 +  mse=(y-val);
 145.553 +  mse*=mse;
 145.554 +  n++;
 145.555 +  if(mdct[x]+info->twofitatten>=mask[x]){
 145.556 +    if(y+info->maxover<val)return(1);
 145.557 +    if(y-info->maxunder>val)return(1);
 145.558 +  }
 145.559 +
 145.560 +  while(++x<x1){
 145.561 +    err=err+ady;
 145.562 +    if(err>=adx){
 145.563 +      err-=adx;
 145.564 +      y+=sy;
 145.565 +    }else{
 145.566 +      y+=base;
 145.567 +    }
 145.568 +
 145.569 +    val=vorbis_dBquant(mask+x);
 145.570 +    mse+=((y-val)*(y-val));
 145.571 +    n++;
 145.572 +    if(mdct[x]+info->twofitatten>=mask[x]){
 145.573 +      if(val){
 145.574 +        if(y+info->maxover<val)return(1);
 145.575 +        if(y-info->maxunder>val)return(1);
 145.576 +      }
 145.577 +    }
 145.578 +  }
 145.579 +
 145.580 +  if(info->maxover*info->maxover/n>info->maxerr)return(0);
 145.581 +  if(info->maxunder*info->maxunder/n>info->maxerr)return(0);
 145.582 +  if(mse/n>info->maxerr)return(1);
 145.583 +  return(0);
 145.584 +}
 145.585 +
 145.586 +static int post_Y(int *A,int *B,int pos){
 145.587 +  if(A[pos]<0)
 145.588 +    return B[pos];
 145.589 +  if(B[pos]<0)
 145.590 +    return A[pos];
 145.591 +
 145.592 +  return (A[pos]+B[pos])>>1;
 145.593 +}
 145.594 +
 145.595 +int *floor1_fit(vorbis_block *vb,vorbis_look_floor1 *look,
 145.596 +                          const float *logmdct,   /* in */
 145.597 +                          const float *logmask){
 145.598 +  long i,j;
 145.599 +  vorbis_info_floor1 *info=look->vi;
 145.600 +  long n=look->n;
 145.601 +  long posts=look->posts;
 145.602 +  long nonzero=0;
 145.603 +  lsfit_acc fits[VIF_POSIT+1];
 145.604 +  int fit_valueA[VIF_POSIT+2]; /* index by range list position */
 145.605 +  int fit_valueB[VIF_POSIT+2]; /* index by range list position */
 145.606 +
 145.607 +  int loneighbor[VIF_POSIT+2]; /* sorted index of range list position (+2) */
 145.608 +  int hineighbor[VIF_POSIT+2];
 145.609 +  int *output=NULL;
 145.610 +  int memo[VIF_POSIT+2];
 145.611 +
 145.612 +  for(i=0;i<posts;i++)fit_valueA[i]=-200; /* mark all unused */
 145.613 +  for(i=0;i<posts;i++)fit_valueB[i]=-200; /* mark all unused */
 145.614 +  for(i=0;i<posts;i++)loneighbor[i]=0; /* 0 for the implicit 0 post */
 145.615 +  for(i=0;i<posts;i++)hineighbor[i]=1; /* 1 for the implicit post at n */
 145.616 +  for(i=0;i<posts;i++)memo[i]=-1;      /* no neighbor yet */
 145.617 +
 145.618 +  /* quantize the relevant floor points and collect them into line fit
 145.619 +     structures (one per minimal division) at the same time */
 145.620 +  if(posts==0){
 145.621 +    nonzero+=accumulate_fit(logmask,logmdct,0,n,fits,n,info);
 145.622 +  }else{
 145.623 +    for(i=0;i<posts-1;i++)
 145.624 +      nonzero+=accumulate_fit(logmask,logmdct,look->sorted_index[i],
 145.625 +                              look->sorted_index[i+1],fits+i,
 145.626 +                              n,info);
 145.627 +  }
 145.628 +
 145.629 +  if(nonzero){
 145.630 +    /* start by fitting the implicit base case.... */
 145.631 +    int y0=-200;
 145.632 +    int y1=-200;
 145.633 +    fit_line(fits,posts-1,&y0,&y1,info);
 145.634 +
 145.635 +    fit_valueA[0]=y0;
 145.636 +    fit_valueB[0]=y0;
 145.637 +    fit_valueB[1]=y1;
 145.638 +    fit_valueA[1]=y1;
 145.639 +
 145.640 +    /* Non degenerate case */
 145.641 +    /* start progressive splitting.  This is a greedy, non-optimal
 145.642 +       algorithm, but simple and close enough to the best
 145.643 +       answer. */
 145.644 +    for(i=2;i<posts;i++){
 145.645 +      int sortpos=look->reverse_index[i];
 145.646 +      int ln=loneighbor[sortpos];
 145.647 +      int hn=hineighbor[sortpos];
 145.648 +
 145.649 +      /* eliminate repeat searches of a particular range with a memo */
 145.650 +      if(memo[ln]!=hn){
 145.651 +        /* haven't performed this error search yet */
 145.652 +        int lsortpos=look->reverse_index[ln];
 145.653 +        int hsortpos=look->reverse_index[hn];
 145.654 +        memo[ln]=hn;
 145.655 +
 145.656 +        {
 145.657 +          /* A note: we want to bound/minimize *local*, not global, error */
 145.658 +          int lx=info->postlist[ln];
 145.659 +          int hx=info->postlist[hn];
 145.660 +          int ly=post_Y(fit_valueA,fit_valueB,ln);
 145.661 +          int hy=post_Y(fit_valueA,fit_valueB,hn);
 145.662 +
 145.663 +          if(ly==-1 || hy==-1){
 145.664 +            exit(1);
 145.665 +          }
 145.666 +
 145.667 +          if(inspect_error(lx,hx,ly,hy,logmask,logmdct,info)){
 145.668 +            /* outside error bounds/begin search area.  Split it. */
 145.669 +            int ly0=-200;
 145.670 +            int ly1=-200;
 145.671 +            int hy0=-200;
 145.672 +            int hy1=-200;
 145.673 +            int ret0=fit_line(fits+lsortpos,sortpos-lsortpos,&ly0,&ly1,info);
 145.674 +            int ret1=fit_line(fits+sortpos,hsortpos-sortpos,&hy0,&hy1,info);
 145.675 +
 145.676 +            if(ret0){
 145.677 +              ly0=ly;
 145.678 +              ly1=hy0;
 145.679 +            }
 145.680 +            if(ret1){
 145.681 +              hy0=ly1;
 145.682 +              hy1=hy;
 145.683 +            }
 145.684 +
 145.685 +            if(ret0 && ret1){
 145.686 +              fit_valueA[i]=-200;
 145.687 +              fit_valueB[i]=-200;
 145.688 +            }else{
 145.689 +              /* store new edge values */
 145.690 +              fit_valueB[ln]=ly0;
 145.691 +              if(ln==0)fit_valueA[ln]=ly0;
 145.692 +              fit_valueA[i]=ly1;
 145.693 +              fit_valueB[i]=hy0;
 145.694 +              fit_valueA[hn]=hy1;
 145.695 +              if(hn==1)fit_valueB[hn]=hy1;
 145.696 +
 145.697 +              if(ly1>=0 || hy0>=0){
 145.698 +                /* store new neighbor values */
 145.699 +                for(j=sortpos-1;j>=0;j--)
 145.700 +                  if(hineighbor[j]==hn)
 145.701 +                    hineighbor[j]=i;
 145.702 +                  else
 145.703 +                    break;
 145.704 +                for(j=sortpos+1;j<posts;j++)
 145.705 +                  if(loneighbor[j]==ln)
 145.706 +                    loneighbor[j]=i;
 145.707 +                  else
 145.708 +                    break;
 145.709 +              }
 145.710 +            }
 145.711 +          }else{
 145.712 +            fit_valueA[i]=-200;
 145.713 +            fit_valueB[i]=-200;
 145.714 +          }
 145.715 +        }
 145.716 +      }
 145.717 +    }
 145.718 +
 145.719 +    output=_vorbis_block_alloc(vb,sizeof(*output)*posts);
 145.720 +
 145.721 +    output[0]=post_Y(fit_valueA,fit_valueB,0);
 145.722 +    output[1]=post_Y(fit_valueA,fit_valueB,1);
 145.723 +
 145.724 +    /* fill in posts marked as not using a fit; we will zero
 145.725 +       back out to 'unused' when encoding them so long as curve
 145.726 +       interpolation doesn't force them into use */
 145.727 +    for(i=2;i<posts;i++){
 145.728 +      int ln=look->loneighbor[i-2];
 145.729 +      int hn=look->hineighbor[i-2];
 145.730 +      int x0=info->postlist[ln];
 145.731 +      int x1=info->postlist[hn];
 145.732 +      int y0=output[ln];
 145.733 +      int y1=output[hn];
 145.734 +
 145.735 +      int predicted=render_point(x0,x1,y0,y1,info->postlist[i]);
 145.736 +      int vx=post_Y(fit_valueA,fit_valueB,i);
 145.737 +
 145.738 +      if(vx>=0 && predicted!=vx){
 145.739 +        output[i]=vx;
 145.740 +      }else{
 145.741 +        output[i]= predicted|0x8000;
 145.742 +      }
 145.743 +    }
 145.744 +  }
 145.745 +
 145.746 +  return(output);
 145.747 +
 145.748 +}
 145.749 +
 145.750 +int *floor1_interpolate_fit(vorbis_block *vb,vorbis_look_floor1 *look,
 145.751 +                          int *A,int *B,
 145.752 +                          int del){
 145.753 +
 145.754 +  long i;
 145.755 +  long posts=look->posts;
 145.756 +  int *output=NULL;
 145.757 +
 145.758 +  if(A && B){
 145.759 +    output=_vorbis_block_alloc(vb,sizeof(*output)*posts);
 145.760 +
 145.761 +    /* overly simpleminded--- look again post 1.2 */
 145.762 +    for(i=0;i<posts;i++){
 145.763 +      output[i]=((65536-del)*(A[i]&0x7fff)+del*(B[i]&0x7fff)+32768)>>16;
 145.764 +      if(A[i]&0x8000 && B[i]&0x8000)output[i]|=0x8000;
 145.765 +    }
 145.766 +  }
 145.767 +
 145.768 +  return(output);
 145.769 +}
 145.770 +
 145.771 +
 145.772 +int floor1_encode(oggpack_buffer *opb,vorbis_block *vb,
 145.773 +                  vorbis_look_floor1 *look,
 145.774 +                  int *post,int *ilogmask){
 145.775 +
 145.776 +  long i,j;
 145.777 +  vorbis_info_floor1 *info=look->vi;
 145.778 +  long posts=look->posts;
 145.779 +  codec_setup_info *ci=vb->vd->vi->codec_setup;
 145.780 +  int out[VIF_POSIT+2];
 145.781 +  static_codebook **sbooks=ci->book_param;
 145.782 +  codebook *books=ci->fullbooks;
 145.783 +
 145.784 +  /* quantize values to multiplier spec */
 145.785 +  if(post){
 145.786 +    for(i=0;i<posts;i++){
 145.787 +      int val=post[i]&0x7fff;
 145.788 +      switch(info->mult){
 145.789 +      case 1: /* 1024 -> 256 */
 145.790 +        val>>=2;
 145.791 +        break;
 145.792 +      case 2: /* 1024 -> 128 */
 145.793 +        val>>=3;
 145.794 +        break;
 145.795 +      case 3: /* 1024 -> 86 */
 145.796 +        val/=12;
 145.797 +        break;
 145.798 +      case 4: /* 1024 -> 64 */
 145.799 +        val>>=4;
 145.800 +        break;
 145.801 +      }
 145.802 +      post[i]=val | (post[i]&0x8000);
 145.803 +    }
 145.804 +
 145.805 +    out[0]=post[0];
 145.806 +    out[1]=post[1];
 145.807 +
 145.808 +    /* find prediction values for each post and subtract them */
 145.809 +    for(i=2;i<posts;i++){
 145.810 +      int ln=look->loneighbor[i-2];
 145.811 +      int hn=look->hineighbor[i-2];
 145.812 +      int x0=info->postlist[ln];
 145.813 +      int x1=info->postlist[hn];
 145.814 +      int y0=post[ln];
 145.815 +      int y1=post[hn];
 145.816 +
 145.817 +      int predicted=render_point(x0,x1,y0,y1,info->postlist[i]);
 145.818 +
 145.819 +      if((post[i]&0x8000) || (predicted==post[i])){
 145.820 +        post[i]=predicted|0x8000; /* in case there was roundoff jitter
 145.821 +                                     in interpolation */
 145.822 +        out[i]=0;
 145.823 +      }else{
 145.824 +        int headroom=(look->quant_q-predicted<predicted?
 145.825 +                      look->quant_q-predicted:predicted);
 145.826 +
 145.827 +        int val=post[i]-predicted;
 145.828 +
 145.829 +        /* at this point the 'deviation' value is in the range +/- max
 145.830 +           range, but the real, unique range can always be mapped to
 145.831 +           only [0-maxrange).  So we want to wrap the deviation into
 145.832 +           this limited range, but do it in the way that least screws
 145.833 +           an essentially gaussian probability distribution. */
 145.834 +
 145.835 +        if(val<0)
 145.836 +          if(val<-headroom)
 145.837 +            val=headroom-val-1;
 145.838 +          else
 145.839 +            val=-1-(val<<1);
 145.840 +        else
 145.841 +          if(val>=headroom)
 145.842 +            val= val+headroom;
 145.843 +          else
 145.844 +            val<<=1;
 145.845 +
 145.846 +        out[i]=val;
 145.847 +        post[ln]&=0x7fff;
 145.848 +        post[hn]&=0x7fff;
 145.849 +      }
 145.850 +    }
 145.851 +
 145.852 +    /* we have everything we need. pack it out */
 145.853 +    /* mark nontrivial floor */
 145.854 +    oggpack_write(opb,1,1);
 145.855 +
 145.856 +    /* beginning/end post */
 145.857 +    look->frames++;
 145.858 +    look->postbits+=ilog(look->quant_q-1)*2;
 145.859 +    oggpack_write(opb,out[0],ilog(look->quant_q-1));
 145.860 +    oggpack_write(opb,out[1],ilog(look->quant_q-1));
 145.861 +
 145.862 +
 145.863 +    /* partition by partition */
 145.864 +    for(i=0,j=2;i<info->partitions;i++){
 145.865 +      int class=info->partitionclass[i];
 145.866 +      int cdim=info->class_dim[class];
 145.867 +      int csubbits=info->class_subs[class];
 145.868 +      int csub=1<<csubbits;
 145.869 +      int bookas[8]={0,0,0,0,0,0,0,0};
 145.870 +      int cval=0;
 145.871 +      int cshift=0;
 145.872 +      int k,l;
 145.873 +
 145.874 +      /* generate the partition's first stage cascade value */
 145.875 +      if(csubbits){
 145.876 +        int maxval[8];
 145.877 +        for(k=0;k<csub;k++){
 145.878 +          int booknum=info->class_subbook[class][k];
 145.879 +          if(booknum<0){
 145.880 +            maxval[k]=1;
 145.881 +          }else{
 145.882 +            maxval[k]=sbooks[info->class_subbook[class][k]]->entries;
 145.883 +          }
 145.884 +        }
 145.885 +        for(k=0;k<cdim;k++){
 145.886 +          for(l=0;l<csub;l++){
 145.887 +            int val=out[j+k];
 145.888 +            if(val<maxval[l]){
 145.889 +              bookas[k]=l;
 145.890 +              break;
 145.891 +            }
 145.892 +          }
 145.893 +          cval|= bookas[k]<<cshift;
 145.894 +          cshift+=csubbits;
 145.895 +        }
 145.896 +        /* write it */
 145.897 +        look->phrasebits+=
 145.898 +          vorbis_book_encode(books+info->class_book[class],cval,opb);
 145.899 +
 145.900 +#ifdef TRAIN_FLOOR1
 145.901 +        {
 145.902 +          FILE *of;
 145.903 +          char buffer[80];
 145.904 +          sprintf(buffer,"line_%dx%ld_class%d.vqd",
 145.905 +                  vb->pcmend/2,posts-2,class);
 145.906 +          of=fopen(buffer,"a");
 145.907 +          fprintf(of,"%d\n",cval);
 145.908 +          fclose(of);
 145.909 +        }
 145.910 +#endif
 145.911 +      }
 145.912 +
 145.913 +      /* write post values */
 145.914 +      for(k=0;k<cdim;k++){
 145.915 +        int book=info->class_subbook[class][bookas[k]];
 145.916 +        if(book>=0){
 145.917 +          /* hack to allow training with 'bad' books */
 145.918 +          if(out[j+k]<(books+book)->entries)
 145.919 +            look->postbits+=vorbis_book_encode(books+book,
 145.920 +                                               out[j+k],opb);
 145.921 +          /*else
 145.922 +            fprintf(stderr,"+!");*/
 145.923 +
 145.924 +#ifdef TRAIN_FLOOR1
 145.925 +          {
 145.926 +            FILE *of;
 145.927 +            char buffer[80];
 145.928 +            sprintf(buffer,"line_%dx%ld_%dsub%d.vqd",
 145.929 +                    vb->pcmend/2,posts-2,class,bookas[k]);
 145.930 +            of=fopen(buffer,"a");
 145.931 +            fprintf(of,"%d\n",out[j+k]);
 145.932 +            fclose(of);
 145.933 +          }
 145.934 +#endif
 145.935 +        }
 145.936 +      }
 145.937 +      j+=cdim;
 145.938 +    }
 145.939 +
 145.940 +    {
 145.941 +      /* generate quantized floor equivalent to what we'd unpack in decode */
 145.942 +      /* render the lines */
 145.943 +      int hx=0;
 145.944 +      int lx=0;
 145.945 +      int ly=post[0]*info->mult;
 145.946 +      int n=ci->blocksizes[vb->W]/2;
 145.947 +
 145.948 +      for(j=1;j<look->posts;j++){
 145.949 +        int current=look->forward_index[j];
 145.950 +        int hy=post[current]&0x7fff;
 145.951 +        if(hy==post[current]){
 145.952 +
 145.953 +          hy*=info->mult;
 145.954 +          hx=info->postlist[current];
 145.955 +
 145.956 +          render_line0(n,lx,hx,ly,hy,ilogmask);
 145.957 +
 145.958 +          lx=hx;
 145.959 +          ly=hy;
 145.960 +        }
 145.961 +      }
 145.962 +      for(j=hx;j<vb->pcmend/2;j++)ilogmask[j]=ly; /* be certain */
 145.963 +      return(1);
 145.964 +    }
 145.965 +  }else{
 145.966 +    oggpack_write(opb,0,1);
 145.967 +    memset(ilogmask,0,vb->pcmend/2*sizeof(*ilogmask));
 145.968 +    return(0);
 145.969 +  }
 145.970 +}
 145.971 +
 145.972 +static void *floor1_inverse1(vorbis_block *vb,vorbis_look_floor *in){
 145.973 +  vorbis_look_floor1 *look=(vorbis_look_floor1 *)in;
 145.974 +  vorbis_info_floor1 *info=look->vi;
 145.975 +  codec_setup_info   *ci=vb->vd->vi->codec_setup;
 145.976 +
 145.977 +  int i,j,k;
 145.978 +  codebook *books=ci->fullbooks;
 145.979 +
 145.980 +  /* unpack wrapped/predicted values from stream */
 145.981 +  if(oggpack_read(&vb->opb,1)==1){
 145.982 +    int *fit_value=_vorbis_block_alloc(vb,(look->posts)*sizeof(*fit_value));
 145.983 +
 145.984 +    fit_value[0]=oggpack_read(&vb->opb,ilog(look->quant_q-1));
 145.985 +    fit_value[1]=oggpack_read(&vb->opb,ilog(look->quant_q-1));
 145.986 +
 145.987 +    /* partition by partition */
 145.988 +    for(i=0,j=2;i<info->partitions;i++){
 145.989 +      int class=info->partitionclass[i];
 145.990 +      int cdim=info->class_dim[class];
 145.991 +      int csubbits=info->class_subs[class];
 145.992 +      int csub=1<<csubbits;
 145.993 +      int cval=0;
 145.994 +
 145.995 +      /* decode the partition's first stage cascade value */
 145.996 +      if(csubbits){
 145.997 +        cval=vorbis_book_decode(books+info->class_book[class],&vb->opb);
 145.998 +
 145.999 +        if(cval==-1)goto eop;
145.1000 +      }
145.1001 +
145.1002 +      for(k=0;k<cdim;k++){
145.1003 +        int book=info->class_subbook[class][cval&(csub-1)];
145.1004 +        cval>>=csubbits;
145.1005 +        if(book>=0){
145.1006 +          if((fit_value[j+k]=vorbis_book_decode(books+book,&vb->opb))==-1)
145.1007 +            goto eop;
145.1008 +        }else{
145.1009 +          fit_value[j+k]=0;
145.1010 +        }
145.1011 +      }
145.1012 +      j+=cdim;
145.1013 +    }
145.1014 +
145.1015 +    /* unwrap positive values and reconsitute via linear interpolation */
145.1016 +    for(i=2;i<look->posts;i++){
145.1017 +      int predicted=render_point(info->postlist[look->loneighbor[i-2]],
145.1018 +                                 info->postlist[look->hineighbor[i-2]],
145.1019 +                                 fit_value[look->loneighbor[i-2]],
145.1020 +                                 fit_value[look->hineighbor[i-2]],
145.1021 +                                 info->postlist[i]);
145.1022 +      int hiroom=look->quant_q-predicted;
145.1023 +      int loroom=predicted;
145.1024 +      int room=(hiroom<loroom?hiroom:loroom)<<1;
145.1025 +      int val=fit_value[i];
145.1026 +
145.1027 +      if(val){
145.1028 +        if(val>=room){
145.1029 +          if(hiroom>loroom){
145.1030 +            val = val-loroom;
145.1031 +          }else{
145.1032 +            val = -1-(val-hiroom);
145.1033 +          }
145.1034 +        }else{
145.1035 +          if(val&1){
145.1036 +            val= -((val+1)>>1);
145.1037 +          }else{
145.1038 +            val>>=1;
145.1039 +          }
145.1040 +        }
145.1041 +
145.1042 +        fit_value[i]=(val+predicted)&0x7fff;
145.1043 +        fit_value[look->loneighbor[i-2]]&=0x7fff;
145.1044 +        fit_value[look->hineighbor[i-2]]&=0x7fff;
145.1045 +
145.1046 +      }else{
145.1047 +        fit_value[i]=predicted|0x8000;
145.1048 +      }
145.1049 +
145.1050 +    }
145.1051 +
145.1052 +    return(fit_value);
145.1053 +  }
145.1054 + eop:
145.1055 +  return(NULL);
145.1056 +}
145.1057 +
145.1058 +static int floor1_inverse2(vorbis_block *vb,vorbis_look_floor *in,void *memo,
145.1059 +                          float *out){
145.1060 +  vorbis_look_floor1 *look=(vorbis_look_floor1 *)in;
145.1061 +  vorbis_info_floor1 *info=look->vi;
145.1062 +
145.1063 +  codec_setup_info   *ci=vb->vd->vi->codec_setup;
145.1064 +  int                  n=ci->blocksizes[vb->W]/2;
145.1065 +  int j;
145.1066 +
145.1067 +  if(memo){
145.1068 +    /* render the lines */
145.1069 +    int *fit_value=(int *)memo;
145.1070 +    int hx=0;
145.1071 +    int lx=0;
145.1072 +    int ly=fit_value[0]*info->mult;
145.1073 +    /* guard lookup against out-of-range values */
145.1074 +    ly=(ly<0?0:ly>255?255:ly);
145.1075 +
145.1076 +    for(j=1;j<look->posts;j++){
145.1077 +      int current=look->forward_index[j];
145.1078 +      int hy=fit_value[current]&0x7fff;
145.1079 +      if(hy==fit_value[current]){
145.1080 +
145.1081 +        hx=info->postlist[current];
145.1082 +        hy*=info->mult;
145.1083 +        /* guard lookup against out-of-range values */
145.1084 +        hy=(hy<0?0:hy>255?255:hy);
145.1085 +
145.1086 +        render_line(n,lx,hx,ly,hy,out);
145.1087 +
145.1088 +        lx=hx;
145.1089 +        ly=hy;
145.1090 +      }
145.1091 +    }
145.1092 +    for(j=hx;j<n;j++)out[j]*=FLOOR1_fromdB_LOOKUP[ly]; /* be certain */
145.1093 +    return(1);
145.1094 +  }
145.1095 +  memset(out,0,sizeof(*out)*n);
145.1096 +  return(0);
145.1097 +}
145.1098 +
145.1099 +/* export hooks */
145.1100 +const vorbis_func_floor floor1_exportbundle={
145.1101 +  &floor1_pack,&floor1_unpack,&floor1_look,&floor1_free_info,
145.1102 +  &floor1_free_look,&floor1_inverse1,&floor1_inverse2
145.1103 +};
   146.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   146.2 +++ b/libs/vorbis/highlevel.h	Sun Nov 01 00:36:56 2015 +0200
   146.3 @@ -0,0 +1,58 @@
   146.4 +/********************************************************************
   146.5 + *                                                                  *
   146.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   146.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   146.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   146.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  146.10 + *                                                                  *
  146.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
  146.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  146.13 + *                                                                  *
  146.14 + ********************************************************************
  146.15 +
  146.16 + function: highlevel encoder setup struct separated out for vorbisenc clarity
  146.17 + last mod: $Id: highlevel.h 17195 2010-05-05 21:49:51Z giles $
  146.18 +
  146.19 + ********************************************************************/
  146.20 +
  146.21 +typedef struct highlevel_byblocktype {
  146.22 +  double tone_mask_setting;
  146.23 +  double tone_peaklimit_setting;
  146.24 +  double noise_bias_setting;
  146.25 +  double noise_compand_setting;
  146.26 +} highlevel_byblocktype;
  146.27 +
  146.28 +typedef struct highlevel_encode_setup {
  146.29 +  int   set_in_stone;
  146.30 +  const void *setup;
  146.31 +  double base_setting;
  146.32 +
  146.33 +  double impulse_noisetune;
  146.34 +
  146.35 +  /* bitrate management below all settable */
  146.36 +  float  req;
  146.37 +  int    managed;
  146.38 +  long   bitrate_min;
  146.39 +  long   bitrate_av;
  146.40 +  double bitrate_av_damp;
  146.41 +  long   bitrate_max;
  146.42 +  long   bitrate_reservoir;
  146.43 +  double bitrate_reservoir_bias;
  146.44 +
  146.45 +  int impulse_block_p;
  146.46 +  int noise_normalize_p;
  146.47 +  int coupling_p;
  146.48 +
  146.49 +  double stereo_point_setting;
  146.50 +  double lowpass_kHz;
  146.51 +  int    lowpass_altered;
  146.52 +
  146.53 +  double ath_floating_dB;
  146.54 +  double ath_absolute_dB;
  146.55 +
  146.56 +  double amplitude_track_dBpersec;
  146.57 +  double trigger_setting;
  146.58 +
  146.59 +  highlevel_byblocktype block[4]; /* padding, impulse, transition, long */
  146.60 +
  146.61 +} highlevel_encode_setup;
   147.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   147.2 +++ b/libs/vorbis/info.c	Sun Nov 01 00:36:56 2015 +0200
   147.3 @@ -0,0 +1,668 @@
   147.4 +/********************************************************************
   147.5 + *                                                                  *
   147.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   147.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   147.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   147.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  147.10 + *                                                                  *
  147.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2010             *
  147.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  147.13 + *                                                                  *
  147.14 + ********************************************************************
  147.15 +
  147.16 + function: maintain the info structure, info <-> header packets
  147.17 + last mod: $Id: info.c 18186 2012-02-03 22:08:44Z xiphmont $
  147.18 +
  147.19 + ********************************************************************/
  147.20 +
  147.21 +/* general handling of the header and the vorbis_info structure (and
  147.22 +   substructures) */
  147.23 +
  147.24 +#include <stdlib.h>
  147.25 +#include <string.h>
  147.26 +#include <ctype.h>
  147.27 +#include <ogg/ogg.h>
  147.28 +#include "vorbis/codec.h"
  147.29 +#include "codec_internal.h"
  147.30 +#include "codebook.h"
  147.31 +#include "registry.h"
  147.32 +#include "window.h"
  147.33 +#include "psy.h"
  147.34 +#include "misc.h"
  147.35 +#include "os.h"
  147.36 +
  147.37 +#define GENERAL_VENDOR_STRING "Xiph.Org libVorbis 1.3.3"
  147.38 +#define ENCODE_VENDOR_STRING "Xiph.Org libVorbis I 20120203 (Omnipresent)"
  147.39 +
  147.40 +/* helpers */
  147.41 +static int ilog2(unsigned int v){
  147.42 +  int ret=0;
  147.43 +  if(v)--v;
  147.44 +  while(v){
  147.45 +    ret++;
  147.46 +    v>>=1;
  147.47 +  }
  147.48 +  return(ret);
  147.49 +}
  147.50 +
  147.51 +static void _v_writestring(oggpack_buffer *o,const char *s, int bytes){
  147.52 +
  147.53 +  while(bytes--){
  147.54 +    oggpack_write(o,*s++,8);
  147.55 +  }
  147.56 +}
  147.57 +
  147.58 +static void _v_readstring(oggpack_buffer *o,char *buf,int bytes){
  147.59 +  while(bytes--){
  147.60 +    *buf++=oggpack_read(o,8);
  147.61 +  }
  147.62 +}
  147.63 +
  147.64 +void vorbis_comment_init(vorbis_comment *vc){
  147.65 +  memset(vc,0,sizeof(*vc));
  147.66 +}
  147.67 +
  147.68 +void vorbis_comment_add(vorbis_comment *vc,const char *comment){
  147.69 +  vc->user_comments=_ogg_realloc(vc->user_comments,
  147.70 +                            (vc->comments+2)*sizeof(*vc->user_comments));
  147.71 +  vc->comment_lengths=_ogg_realloc(vc->comment_lengths,
  147.72 +                                  (vc->comments+2)*sizeof(*vc->comment_lengths));
  147.73 +  vc->comment_lengths[vc->comments]=strlen(comment);
  147.74 +  vc->user_comments[vc->comments]=_ogg_malloc(vc->comment_lengths[vc->comments]+1);
  147.75 +  strcpy(vc->user_comments[vc->comments], comment);
  147.76 +  vc->comments++;
  147.77 +  vc->user_comments[vc->comments]=NULL;
  147.78 +}
  147.79 +
  147.80 +void vorbis_comment_add_tag(vorbis_comment *vc, const char *tag, const char *contents){
  147.81 +  char *comment=alloca(strlen(tag)+strlen(contents)+2); /* +2 for = and \0 */
  147.82 +  strcpy(comment, tag);
  147.83 +  strcat(comment, "=");
  147.84 +  strcat(comment, contents);
  147.85 +  vorbis_comment_add(vc, comment);
  147.86 +}
  147.87 +
  147.88 +/* This is more or less the same as strncasecmp - but that doesn't exist
  147.89 + * everywhere, and this is a fairly trivial function, so we include it */
  147.90 +static int tagcompare(const char *s1, const char *s2, int n){
  147.91 +  int c=0;
  147.92 +  while(c < n){
  147.93 +    if(toupper(s1[c]) != toupper(s2[c]))
  147.94 +      return !0;
  147.95 +    c++;
  147.96 +  }
  147.97 +  return 0;
  147.98 +}
  147.99 +
 147.100 +char *vorbis_comment_query(vorbis_comment *vc, const char *tag, int count){
 147.101 +  long i;
 147.102 +  int found = 0;
 147.103 +  int taglen = strlen(tag)+1; /* +1 for the = we append */
 147.104 +  char *fulltag = alloca(taglen+ 1);
 147.105 +
 147.106 +  strcpy(fulltag, tag);
 147.107 +  strcat(fulltag, "=");
 147.108 +
 147.109 +  for(i=0;i<vc->comments;i++){
 147.110 +    if(!tagcompare(vc->user_comments[i], fulltag, taglen)){
 147.111 +      if(count == found)
 147.112 +        /* We return a pointer to the data, not a copy */
 147.113 +              return vc->user_comments[i] + taglen;
 147.114 +      else
 147.115 +        found++;
 147.116 +    }
 147.117 +  }
 147.118 +  return NULL; /* didn't find anything */
 147.119 +}
 147.120 +
 147.121 +int vorbis_comment_query_count(vorbis_comment *vc, const char *tag){
 147.122 +  int i,count=0;
 147.123 +  int taglen = strlen(tag)+1; /* +1 for the = we append */
 147.124 +  char *fulltag = alloca(taglen+1);
 147.125 +  strcpy(fulltag,tag);
 147.126 +  strcat(fulltag, "=");
 147.127 +
 147.128 +  for(i=0;i<vc->comments;i++){
 147.129 +    if(!tagcompare(vc->user_comments[i], fulltag, taglen))
 147.130 +      count++;
 147.131 +  }
 147.132 +
 147.133 +  return count;
 147.134 +}
 147.135 +
 147.136 +void vorbis_comment_clear(vorbis_comment *vc){
 147.137 +  if(vc){
 147.138 +    long i;
 147.139 +    if(vc->user_comments){
 147.140 +      for(i=0;i<vc->comments;i++)
 147.141 +        if(vc->user_comments[i])_ogg_free(vc->user_comments[i]);
 147.142 +      _ogg_free(vc->user_comments);
 147.143 +    }
 147.144 +    if(vc->comment_lengths)_ogg_free(vc->comment_lengths);
 147.145 +    if(vc->vendor)_ogg_free(vc->vendor);
 147.146 +    memset(vc,0,sizeof(*vc));
 147.147 +  }
 147.148 +}
 147.149 +
 147.150 +/* blocksize 0 is guaranteed to be short, 1 is guaranteed to be long.
 147.151 +   They may be equal, but short will never ge greater than long */
 147.152 +int vorbis_info_blocksize(vorbis_info *vi,int zo){
 147.153 +  codec_setup_info *ci = vi->codec_setup;
 147.154 +  return ci ? ci->blocksizes[zo] : -1;
 147.155 +}
 147.156 +
 147.157 +/* used by synthesis, which has a full, alloced vi */
 147.158 +void vorbis_info_init(vorbis_info *vi){
 147.159 +  memset(vi,0,sizeof(*vi));
 147.160 +  vi->codec_setup=_ogg_calloc(1,sizeof(codec_setup_info));
 147.161 +}
 147.162 +
 147.163 +void vorbis_info_clear(vorbis_info *vi){
 147.164 +  codec_setup_info     *ci=vi->codec_setup;
 147.165 +  int i;
 147.166 +
 147.167 +  if(ci){
 147.168 +
 147.169 +    for(i=0;i<ci->modes;i++)
 147.170 +      if(ci->mode_param[i])_ogg_free(ci->mode_param[i]);
 147.171 +
 147.172 +    for(i=0;i<ci->maps;i++) /* unpack does the range checking */
 147.173 +      if(ci->map_param[i]) /* this may be cleaning up an aborted
 147.174 +                              unpack, in which case the below type
 147.175 +                              cannot be trusted */
 147.176 +        _mapping_P[ci->map_type[i]]->free_info(ci->map_param[i]);
 147.177 +
 147.178 +    for(i=0;i<ci->floors;i++) /* unpack does the range checking */
 147.179 +      if(ci->floor_param[i]) /* this may be cleaning up an aborted
 147.180 +                                unpack, in which case the below type
 147.181 +                                cannot be trusted */
 147.182 +        _floor_P[ci->floor_type[i]]->free_info(ci->floor_param[i]);
 147.183 +
 147.184 +    for(i=0;i<ci->residues;i++) /* unpack does the range checking */
 147.185 +      if(ci->residue_param[i]) /* this may be cleaning up an aborted
 147.186 +                                  unpack, in which case the below type
 147.187 +                                  cannot be trusted */
 147.188 +        _residue_P[ci->residue_type[i]]->free_info(ci->residue_param[i]);
 147.189 +
 147.190 +    for(i=0;i<ci->books;i++){
 147.191 +      if(ci->book_param[i]){
 147.192 +        /* knows if the book was not alloced */
 147.193 +        vorbis_staticbook_destroy(ci->book_param[i]);
 147.194 +      }
 147.195 +      if(ci->fullbooks)
 147.196 +        vorbis_book_clear(ci->fullbooks+i);
 147.197 +    }
 147.198 +    if(ci->fullbooks)
 147.199 +        _ogg_free(ci->fullbooks);
 147.200 +
 147.201 +    for(i=0;i<ci->psys;i++)
 147.202 +      _vi_psy_free(ci->psy_param[i]);
 147.203 +
 147.204 +    _ogg_free(ci);
 147.205 +  }
 147.206 +
 147.207 +  memset(vi,0,sizeof(*vi));
 147.208 +}
 147.209 +
 147.210 +/* Header packing/unpacking ********************************************/
 147.211 +
 147.212 +static int _vorbis_unpack_info(vorbis_info *vi,oggpack_buffer *opb){
 147.213 +  codec_setup_info     *ci=vi->codec_setup;
 147.214 +  if(!ci)return(OV_EFAULT);
 147.215 +
 147.216 +  vi->version=oggpack_read(opb,32);
 147.217 +  if(vi->version!=0)return(OV_EVERSION);
 147.218 +
 147.219 +  vi->channels=oggpack_read(opb,8);
 147.220 +  vi->rate=oggpack_read(opb,32);
 147.221 +
 147.222 +  vi->bitrate_upper=oggpack_read(opb,32);
 147.223 +  vi->bitrate_nominal=oggpack_read(opb,32);
 147.224 +  vi->bitrate_lower=oggpack_read(opb,32);
 147.225 +
 147.226 +  ci->blocksizes[0]=1<<oggpack_read(opb,4);
 147.227 +  ci->blocksizes[1]=1<<oggpack_read(opb,4);
 147.228 +
 147.229 +  if(vi->rate<1)goto err_out;
 147.230 +  if(vi->channels<1)goto err_out;
 147.231 +  if(ci->blocksizes[0]<64)goto err_out;
 147.232 +  if(ci->blocksizes[1]<ci->blocksizes[0])goto err_out;
 147.233 +  if(ci->blocksizes[1]>8192)goto err_out;
 147.234 +
 147.235 +  if(oggpack_read(opb,1)!=1)goto err_out; /* EOP check */
 147.236 +
 147.237 +  return(0);
 147.238 + err_out:
 147.239 +  vorbis_info_clear(vi);
 147.240 +  return(OV_EBADHEADER);
 147.241 +}
 147.242 +
 147.243 +static int _vorbis_unpack_comment(vorbis_comment *vc,oggpack_buffer *opb){
 147.244 +  int i;
 147.245 +  int vendorlen=oggpack_read(opb,32);
 147.246 +  if(vendorlen<0)goto err_out;
 147.247 +  if(vendorlen>opb->storage-8)goto err_out;
 147.248 +  vc->vendor=_ogg_calloc(vendorlen+1,1);
 147.249 +  _v_readstring(opb,vc->vendor,vendorlen);
 147.250 +  i=oggpack_read(opb,32);
 147.251 +  if(i<0)goto err_out;
 147.252 +  if(i>((opb->storage-oggpack_bytes(opb))>>2))goto err_out;
 147.253 +  vc->comments=i;
 147.254 +  vc->user_comments=_ogg_calloc(vc->comments+1,sizeof(*vc->user_comments));
 147.255 +  vc->comment_lengths=_ogg_calloc(vc->comments+1, sizeof(*vc->comment_lengths));
 147.256 +
 147.257 +  for(i=0;i<vc->comments;i++){
 147.258 +    int len=oggpack_read(opb,32);
 147.259 +    if(len<0)goto err_out;
 147.260 +    if(len>opb->storage-oggpack_bytes(opb))goto err_out;
 147.261 +    vc->comment_lengths[i]=len;
 147.262 +    vc->user_comments[i]=_ogg_calloc(len+1,1);
 147.263 +    _v_readstring(opb,vc->user_comments[i],len);
 147.264 +  }
 147.265 +  if(oggpack_read(opb,1)!=1)goto err_out; /* EOP check */
 147.266 +
 147.267 +  return(0);
 147.268 + err_out:
 147.269 +  vorbis_comment_clear(vc);
 147.270 +  return(OV_EBADHEADER);
 147.271 +}
 147.272 +
 147.273 +/* all of the real encoding details are here.  The modes, books,
 147.274 +   everything */
 147.275 +static int _vorbis_unpack_books(vorbis_info *vi,oggpack_buffer *opb){
 147.276 +  codec_setup_info     *ci=vi->codec_setup;
 147.277 +  int i;
 147.278 +  if(!ci)return(OV_EFAULT);
 147.279 +
 147.280 +  /* codebooks */
 147.281 +  ci->books=oggpack_read(opb,8)+1;
 147.282 +  if(ci->books<=0)goto err_out;
 147.283 +  for(i=0;i<ci->books;i++){
 147.284 +    ci->book_param[i]=vorbis_staticbook_unpack(opb);
 147.285 +    if(!ci->book_param[i])goto err_out;
 147.286 +  }
 147.287 +
 147.288 +  /* time backend settings; hooks are unused */
 147.289 +  {
 147.290 +    int times=oggpack_read(opb,6)+1;
 147.291 +    if(times<=0)goto err_out;
 147.292 +    for(i=0;i<times;i++){
 147.293 +      int test=oggpack_read(opb,16);
 147.294 +      if(test<0 || test>=VI_TIMEB)goto err_out;
 147.295 +    }
 147.296 +  }
 147.297 +
 147.298 +  /* floor backend settings */
 147.299 +  ci->floors=oggpack_read(opb,6)+1;
 147.300 +  if(ci->floors<=0)goto err_out;
 147.301 +  for(i=0;i<ci->floors;i++){
 147.302 +    ci->floor_type[i]=oggpack_read(opb,16);
 147.303 +    if(ci->floor_type[i]<0 || ci->floor_type[i]>=VI_FLOORB)goto err_out;
 147.304 +    ci->floor_param[i]=_floor_P[ci->floor_type[i]]->unpack(vi,opb);
 147.305 +    if(!ci->floor_param[i])goto err_out;
 147.306 +  }
 147.307 +
 147.308 +  /* residue backend settings */
 147.309 +  ci->residues=oggpack_read(opb,6)+1;
 147.310 +  if(ci->residues<=0)goto err_out;
 147.311 +  for(i=0;i<ci->residues;i++){
 147.312 +    ci->residue_type[i]=oggpack_read(opb,16);
 147.313 +    if(ci->residue_type[i]<0 || ci->residue_type[i]>=VI_RESB)goto err_out;
 147.314 +    ci->residue_param[i]=_residue_P[ci->residue_type[i]]->unpack(vi,opb);
 147.315 +    if(!ci->residue_param[i])goto err_out;
 147.316 +  }
 147.317 +
 147.318 +  /* map backend settings */
 147.319 +  ci->maps=oggpack_read(opb,6)+1;
 147.320 +  if(ci->maps<=0)goto err_out;
 147.321 +  for(i=0;i<ci->maps;i++){
 147.322 +    ci->map_type[i]=oggpack_read(opb,16);
 147.323 +    if(ci->map_type[i]<0 || ci->map_type[i]>=VI_MAPB)goto err_out;
 147.324 +    ci->map_param[i]=_mapping_P[ci->map_type[i]]->unpack(vi,opb);
 147.325 +    if(!ci->map_param[i])goto err_out;
 147.326 +  }
 147.327 +
 147.328 +  /* mode settings */
 147.329 +  ci->modes=oggpack_read(opb,6)+1;
 147.330 +  if(ci->modes<=0)goto err_out;
 147.331 +  for(i=0;i<ci->modes;i++){
 147.332 +    ci->mode_param[i]=_ogg_calloc(1,sizeof(*ci->mode_param[i]));
 147.333 +    ci->mode_param[i]->blockflag=oggpack_read(opb,1);
 147.334 +    ci->mode_param[i]->windowtype=oggpack_read(opb,16);
 147.335 +    ci->mode_param[i]->transformtype=oggpack_read(opb,16);
 147.336 +    ci->mode_param[i]->mapping=oggpack_read(opb,8);
 147.337 +
 147.338 +    if(ci->mode_param[i]->windowtype>=VI_WINDOWB)goto err_out;
 147.339 +    if(ci->mode_param[i]->transformtype>=VI_WINDOWB)goto err_out;
 147.340 +    if(ci->mode_param[i]->mapping>=ci->maps)goto err_out;
 147.341 +    if(ci->mode_param[i]->mapping<0)goto err_out;
 147.342 +  }
 147.343 +
 147.344 +  if(oggpack_read(opb,1)!=1)goto err_out; /* top level EOP check */
 147.345 +
 147.346 +  return(0);
 147.347 + err_out:
 147.348 +  vorbis_info_clear(vi);
 147.349 +  return(OV_EBADHEADER);
 147.350 +}
 147.351 +
 147.352 +/* Is this packet a vorbis ID header? */
 147.353 +int vorbis_synthesis_idheader(ogg_packet *op){
 147.354 +  oggpack_buffer opb;
 147.355 +  char buffer[6];
 147.356 +
 147.357 +  if(op){
 147.358 +    oggpack_readinit(&opb,op->packet,op->bytes);
 147.359 +
 147.360 +    if(!op->b_o_s)
 147.361 +      return(0); /* Not the initial packet */
 147.362 +
 147.363 +    if(oggpack_read(&opb,8) != 1)
 147.364 +      return 0; /* not an ID header */
 147.365 +
 147.366 +    memset(buffer,0,6);
 147.367 +    _v_readstring(&opb,buffer,6);
 147.368 +    if(memcmp(buffer,"vorbis",6))
 147.369 +      return 0; /* not vorbis */
 147.370 +
 147.371 +    return 1;
 147.372 +  }
 147.373 +
 147.374 +  return 0;
 147.375 +}
 147.376 +
 147.377 +/* The Vorbis header is in three packets; the initial small packet in
 147.378 +   the first page that identifies basic parameters, a second packet
 147.379 +   with bitstream comments and a third packet that holds the
 147.380 +   codebook. */
 147.381 +
 147.382 +int vorbis_synthesis_headerin(vorbis_info *vi,vorbis_comment *vc,ogg_packet *op){
 147.383 +  oggpack_buffer opb;
 147.384 +
 147.385 +  if(op){
 147.386 +    oggpack_readinit(&opb,op->packet,op->bytes);
 147.387 +
 147.388 +    /* Which of the three types of header is this? */
 147.389 +    /* Also verify header-ness, vorbis */
 147.390 +    {
 147.391 +      char buffer[6];
 147.392 +      int packtype=oggpack_read(&opb,8);
 147.393 +      memset(buffer,0,6);
 147.394 +      _v_readstring(&opb,buffer,6);
 147.395 +      if(memcmp(buffer,"vorbis",6)){
 147.396 +        /* not a vorbis header */
 147.397 +        return(OV_ENOTVORBIS);
 147.398 +      }
 147.399 +      switch(packtype){
 147.400 +      case 0x01: /* least significant *bit* is read first */
 147.401 +        if(!op->b_o_s){
 147.402 +          /* Not the initial packet */
 147.403 +          return(OV_EBADHEADER);
 147.404 +        }
 147.405 +        if(vi->rate!=0){
 147.406 +          /* previously initialized info header */
 147.407 +          return(OV_EBADHEADER);
 147.408 +        }
 147.409 +
 147.410 +        return(_vorbis_unpack_info(vi,&opb));
 147.411 +
 147.412 +      case 0x03: /* least significant *bit* is read first */
 147.413 +        if(vi->rate==0){
 147.414 +          /* um... we didn't get the initial header */
 147.415 +          return(OV_EBADHEADER);
 147.416 +        }
 147.417 +
 147.418 +        return(_vorbis_unpack_comment(vc,&opb));
 147.419 +
 147.420 +      case 0x05: /* least significant *bit* is read first */
 147.421 +        if(vi->rate==0 || vc->vendor==NULL){
 147.422 +          /* um... we didn;t get the initial header or comments yet */
 147.423 +          return(OV_EBADHEADER);
 147.424 +        }
 147.425 +
 147.426 +        return(_vorbis_unpack_books(vi,&opb));
 147.427 +
 147.428 +      default:
 147.429 +        /* Not a valid vorbis header type */
 147.430 +        return(OV_EBADHEADER);
 147.431 +        break;
 147.432 +      }
 147.433 +    }
 147.434 +  }
 147.435 +  return(OV_EBADHEADER);
 147.436 +}
 147.437 +
 147.438 +/* pack side **********************************************************/
 147.439 +
 147.440 +static int _vorbis_pack_info(oggpack_buffer *opb,vorbis_info *vi){
 147.441 +  codec_setup_info     *ci=vi->codec_setup;
 147.442 +  if(!ci)return(OV_EFAULT);
 147.443 +
 147.444 +  /* preamble */
 147.445 +  oggpack_write(opb,0x01,8);
 147.446 +  _v_writestring(opb,"vorbis", 6);
 147.447 +
 147.448 +  /* basic information about the stream */
 147.449 +  oggpack_write(opb,0x00,32);
 147.450 +  oggpack_write(opb,vi->channels,8);
 147.451 +  oggpack_write(opb,vi->rate,32);
 147.452 +
 147.453 +  oggpack_write(opb,vi->bitrate_upper,32);
 147.454 +  oggpack_write(opb,vi->bitrate_nominal,32);
 147.455 +  oggpack_write(opb,vi->bitrate_lower,32);
 147.456 +
 147.457 +  oggpack_write(opb,ilog2(ci->blocksizes[0]),4);
 147.458 +  oggpack_write(opb,ilog2(ci->blocksizes[1]),4);
 147.459 +  oggpack_write(opb,1,1);
 147.460 +
 147.461 +  return(0);
 147.462 +}
 147.463 +
 147.464 +static int _vorbis_pack_comment(oggpack_buffer *opb,vorbis_comment *vc){
 147.465 +  int bytes = strlen(ENCODE_VENDOR_STRING);
 147.466 +
 147.467 +  /* preamble */
 147.468 +  oggpack_write(opb,0x03,8);
 147.469 +  _v_writestring(opb,"vorbis", 6);
 147.470 +
 147.471 +  /* vendor */
 147.472 +  oggpack_write(opb,bytes,32);
 147.473 +  _v_writestring(opb,ENCODE_VENDOR_STRING, bytes);
 147.474 +
 147.475 +  /* comments */
 147.476 +
 147.477 +  oggpack_write(opb,vc->comments,32);
 147.478 +  if(vc->comments){
 147.479 +    int i;
 147.480 +    for(i=0;i<vc->comments;i++){
 147.481 +      if(vc->user_comments[i]){
 147.482 +        oggpack_write(opb,vc->comment_lengths[i],32);
 147.483 +        _v_writestring(opb,vc->user_comments[i], vc->comment_lengths[i]);
 147.484 +      }else{
 147.485 +        oggpack_write(opb,0,32);
 147.486 +      }
 147.487 +    }
 147.488 +  }
 147.489 +  oggpack_write(opb,1,1);
 147.490 +
 147.491 +  return(0);
 147.492 +}
 147.493 +
 147.494 +static int _vorbis_pack_books(oggpack_buffer *opb,vorbis_info *vi){
 147.495 +  codec_setup_info     *ci=vi->codec_setup;
 147.496 +  int i;
 147.497 +  if(!ci)return(OV_EFAULT);
 147.498 +
 147.499 +  oggpack_write(opb,0x05,8);
 147.500 +  _v_writestring(opb,"vorbis", 6);
 147.501 +
 147.502 +  /* books */
 147.503 +  oggpack_write(opb,ci->books-1,8);
 147.504 +  for(i=0;i<ci->books;i++)
 147.505 +    if(vorbis_staticbook_pack(ci->book_param[i],opb))goto err_out;
 147.506 +
 147.507 +  /* times; hook placeholders */
 147.508 +  oggpack_write(opb,0,6);
 147.509 +  oggpack_write(opb,0,16);
 147.510 +
 147.511 +  /* floors */
 147.512 +  oggpack_write(opb,ci->floors-1,6);
 147.513 +  for(i=0;i<ci->floors;i++){
 147.514 +    oggpack_write(opb,ci->floor_type[i],16);
 147.515 +    if(_floor_P[ci->floor_type[i]]->pack)
 147.516 +      _floor_P[ci->floor_type[i]]->pack(ci->floor_param[i],opb);
 147.517 +    else
 147.518 +      goto err_out;
 147.519 +  }
 147.520 +
 147.521 +  /* residues */
 147.522 +  oggpack_write(opb,ci->residues-1,6);
 147.523 +  for(i=0;i<ci->residues;i++){
 147.524 +    oggpack_write(opb,ci->residue_type[i],16);
 147.525 +    _residue_P[ci->residue_type[i]]->pack(ci->residue_param[i],opb);
 147.526 +  }
 147.527 +
 147.528 +  /* maps */
 147.529 +  oggpack_write(opb,ci->maps-1,6);
 147.530 +  for(i=0;i<ci->maps;i++){
 147.531 +    oggpack_write(opb,ci->map_type[i],16);
 147.532 +    _mapping_P[ci->map_type[i]]->pack(vi,ci->map_param[i],opb);
 147.533 +  }
 147.534 +
 147.535 +  /* modes */
 147.536 +  oggpack_write(opb,ci->modes-1,6);
 147.537 +  for(i=0;i<ci->modes;i++){
 147.538 +    oggpack_write(opb,ci->mode_param[i]->blockflag,1);
 147.539 +    oggpack_write(opb,ci->mode_param[i]->windowtype,16);
 147.540 +    oggpack_write(opb,ci->mode_param[i]->transformtype,16);
 147.541 +    oggpack_write(opb,ci->mode_param[i]->mapping,8);
 147.542 +  }
 147.543 +  oggpack_write(opb,1,1);
 147.544 +
 147.545 +  return(0);
 147.546 +err_out:
 147.547 +  return(-1);
 147.548 +}
 147.549 +
 147.550 +int vorbis_commentheader_out(vorbis_comment *vc,
 147.551 +                                          ogg_packet *op){
 147.552 +
 147.553 +  oggpack_buffer opb;
 147.554 +
 147.555 +  oggpack_writeinit(&opb);
 147.556 +  if(_vorbis_pack_comment(&opb,vc)){
 147.557 +    oggpack_writeclear(&opb);
 147.558 +    return OV_EIMPL;
 147.559 +  }
 147.560 +
 147.561 +  op->packet = _ogg_malloc(oggpack_bytes(&opb));
 147.562 +  memcpy(op->packet, opb.buffer, oggpack_bytes(&opb));
 147.563 +
 147.564 +  op->bytes=oggpack_bytes(&opb);
 147.565 +  op->b_o_s=0;
 147.566 +  op->e_o_s=0;
 147.567 +  op->granulepos=0;
 147.568 +  op->packetno=1;
 147.569 +
 147.570 +  oggpack_writeclear(&opb);
 147.571 +  return 0;
 147.572 +}
 147.573 +
 147.574 +int vorbis_analysis_headerout(vorbis_dsp_state *v,
 147.575 +                              vorbis_comment *vc,
 147.576 +                              ogg_packet *op,
 147.577 +                              ogg_packet *op_comm,
 147.578 +                              ogg_packet *op_code){
 147.579 +  int ret=OV_EIMPL;
 147.580 +  vorbis_info *vi=v->vi;
 147.581 +  oggpack_buffer opb;
 147.582 +  private_state *b=v->backend_state;
 147.583 +
 147.584 +  if(!b){
 147.585 +    ret=OV_EFAULT;
 147.586 +    goto err_out;
 147.587 +  }
 147.588 +
 147.589 +  /* first header packet **********************************************/
 147.590 +
 147.591 +  oggpack_writeinit(&opb);
 147.592 +  if(_vorbis_pack_info(&opb,vi))goto err_out;
 147.593 +
 147.594 +  /* build the packet */
 147.595 +  if(b->header)_ogg_free(b->header);
 147.596 +  b->header=_ogg_malloc(oggpack_bytes(&opb));
 147.597 +  memcpy(b->header,opb.buffer,oggpack_bytes(&opb));
 147.598 +  op->packet=b->header;
 147.599 +  op->bytes=oggpack_bytes(&opb);
 147.600 +  op->b_o_s=1;
 147.601 +  op->e_o_s=0;
 147.602 +  op->granulepos=0;
 147.603 +  op->packetno=0;
 147.604 +
 147.605 +  /* second header packet (comments) **********************************/
 147.606 +
 147.607 +  oggpack_reset(&opb);
 147.608 +  if(_vorbis_pack_comment(&opb,vc))goto err_out;
 147.609 +
 147.610 +  if(b->header1)_ogg_free(b->header1);
 147.611 +  b->header1=_ogg_malloc(oggpack_bytes(&opb));
 147.612 +  memcpy(b->header1,opb.buffer,oggpack_bytes(&opb));
 147.613 +  op_comm->packet=b->header1;
 147.614 +  op_comm->bytes=oggpack_bytes(&opb);
 147.615 +  op_comm->b_o_s=0;
 147.616 +  op_comm->e_o_s=0;
 147.617 +  op_comm->granulepos=0;
 147.618 +  op_comm->packetno=1;
 147.619 +
 147.620 +  /* third header packet (modes/codebooks) ****************************/
 147.621 +
 147.622 +  oggpack_reset(&opb);
 147.623 +  if(_vorbis_pack_books(&opb,vi))goto err_out;
 147.624 +
 147.625 +  if(b->header2)_ogg_free(b->header2);
 147.626 +  b->header2=_ogg_malloc(oggpack_bytes(&opb));
 147.627 +  memcpy(b->header2,opb.buffer,oggpack_bytes(&opb));
 147.628 +  op_code->packet=b->header2;
 147.629 +  op_code->bytes=oggpack_bytes(&opb);
 147.630 +  op_code->b_o_s=0;
 147.631 +  op_code->e_o_s=0;
 147.632 +  op_code->granulepos=0;
 147.633 +  op_code->packetno=2;
 147.634 +
 147.635 +  oggpack_writeclear(&opb);
 147.636 +  return(0);
 147.637 + err_out:
 147.638 +  memset(op,0,sizeof(*op));
 147.639 +  memset(op_comm,0,sizeof(*op_comm));
 147.640 +  memset(op_code,0,sizeof(*op_code));
 147.641 +
 147.642 +  if(b){
 147.643 +    oggpack_writeclear(&opb);
 147.644 +    if(b->header)_ogg_free(b->header);
 147.645 +    if(b->header1)_ogg_free(b->header1);
 147.646 +    if(b->header2)_ogg_free(b->header2);
 147.647 +    b->header=NULL;
 147.648 +    b->header1=NULL;
 147.649 +    b->header2=NULL;
 147.650 +  }
 147.651 +  return(ret);
 147.652 +}
 147.653 +
 147.654 +double vorbis_granule_time(vorbis_dsp_state *v,ogg_int64_t granulepos){
 147.655 +  if(granulepos == -1) return -1;
 147.656 +
 147.657 +  /* We're not guaranteed a 64 bit unsigned type everywhere, so we
 147.658 +     have to put the unsigned granpo in a signed type. */
 147.659 +  if(granulepos>=0){
 147.660 +    return((double)granulepos/v->vi->rate);
 147.661 +  }else{
 147.662 +    ogg_int64_t granuleoff=0xffffffff;
 147.663 +    granuleoff<<=31;
 147.664 +    granuleoff|=0x7ffffffff;
 147.665 +    return(((double)granulepos+2+granuleoff+granuleoff)/v->vi->rate);
 147.666 +  }
 147.667 +}
 147.668 +
 147.669 +const char *vorbis_version_string(void){
 147.670 +  return GENERAL_VENDOR_STRING;
 147.671 +}
   148.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   148.2 +++ b/libs/vorbis/lookup.c	Sun Nov 01 00:36:56 2015 +0200
   148.3 @@ -0,0 +1,94 @@
   148.4 +/********************************************************************
   148.5 + *                                                                  *
   148.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   148.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   148.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   148.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  148.10 + *                                                                  *
  148.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
  148.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  148.13 + *                                                                  *
  148.14 + ********************************************************************
  148.15 +
  148.16 +  function: lookup based functions
  148.17 +  last mod: $Id: lookup.c 16227 2009-07-08 06:58:46Z xiphmont $
  148.18 +
  148.19 + ********************************************************************/
  148.20 +
  148.21 +#include <math.h>
  148.22 +#include "lookup.h"
  148.23 +#include "lookup_data.h"
  148.24 +#include "os.h"
  148.25 +#include "misc.h"
  148.26 +
  148.27 +#ifdef FLOAT_LOOKUP
  148.28 +
  148.29 +/* interpolated lookup based cos function, domain 0 to PI only */
  148.30 +float vorbis_coslook(float a){
  148.31 +  double d=a*(.31830989*(float)COS_LOOKUP_SZ);
  148.32 +  int i=vorbis_ftoi(d-.5);
  148.33 +
  148.34 +  return COS_LOOKUP[i]+ (d-i)*(COS_LOOKUP[i+1]-COS_LOOKUP[i]);
  148.35 +}
  148.36 +
  148.37 +/* interpolated 1./sqrt(p) where .5 <= p < 1. */
  148.38 +float vorbis_invsqlook(float a){
  148.39 +  double d=a*(2.f*(float)INVSQ_LOOKUP_SZ)-(float)INVSQ_LOOKUP_SZ;
  148.40 +  int i=vorbis_ftoi(d-.5f);
  148.41 +  return INVSQ_LOOKUP[i]+ (d-i)*(INVSQ_LOOKUP[i+1]-INVSQ_LOOKUP[i]);
  148.42 +}
  148.43 +
  148.44 +/* interpolated 1./sqrt(p) where .5 <= p < 1. */
  148.45 +float vorbis_invsq2explook(int a){
  148.46 +  return INVSQ2EXP_LOOKUP[a-INVSQ2EXP_LOOKUP_MIN];
  148.47 +}
  148.48 +
  148.49 +#include <stdio.h>
  148.50 +/* interpolated lookup based fromdB function, domain -140dB to 0dB only */
  148.51 +float vorbis_fromdBlook(float a){
  148.52 +  int i=vorbis_ftoi(a*((float)(-(1<<FROMdB2_SHIFT)))-.5f);
  148.53 +  return (i<0)?1.f:
  148.54 +    ((i>=(FROMdB_LOOKUP_SZ<<FROMdB_SHIFT))?0.f:
  148.55 +     FROMdB_LOOKUP[i>>FROMdB_SHIFT]*FROMdB2_LOOKUP[i&FROMdB2_MASK]);
  148.56 +}
  148.57 +
  148.58 +#endif
  148.59 +
  148.60 +#ifdef INT_LOOKUP
  148.61 +/* interpolated 1./sqrt(p) where .5 <= a < 1. (.100000... to .111111...) in
  148.62 +   16.16 format
  148.63 +
  148.64 +   returns in m.8 format */
  148.65 +long vorbis_invsqlook_i(long a,long e){
  148.66 +  long i=(a&0x7fff)>>(INVSQ_LOOKUP_I_SHIFT-1);
  148.67 +  long d=(a&INVSQ_LOOKUP_I_MASK)<<(16-INVSQ_LOOKUP_I_SHIFT); /*  0.16 */
  148.68 +  long val=INVSQ_LOOKUP_I[i]-                                /*  1.16 */
  148.69 +    (((INVSQ_LOOKUP_I[i]-INVSQ_LOOKUP_I[i+1])*               /*  0.16 */
  148.70 +      d)>>16);                                               /* result 1.16 */
  148.71 +
  148.72 +  e+=32;
  148.73 +  if(e&1)val=(val*5792)>>13; /* multiply val by 1/sqrt(2) */
  148.74 +  e=(e>>1)-8;
  148.75 +
  148.76 +  return(val>>e);
  148.77 +}
  148.78 +
  148.79 +/* interpolated lookup based fromdB function, domain -140dB to 0dB only */
  148.80 +/* a is in n.12 format */
  148.81 +float vorbis_fromdBlook_i(long a){
  148.82 +  int i=(-a)>>(12-FROMdB2_SHIFT);
  148.83 +  return (i<0)?1.f:
  148.84 +    ((i>=(FROMdB_LOOKUP_SZ<<FROMdB_SHIFT))?0.f:
  148.85 +     FROMdB_LOOKUP[i>>FROMdB_SHIFT]*FROMdB2_LOOKUP[i&FROMdB2_MASK]);
  148.86 +}
  148.87 +
  148.88 +/* interpolated lookup based cos function, domain 0 to PI only */
  148.89 +/* a is in 0.16 format, where 0==0, 2^^16-1==PI, return 0.14 */
  148.90 +long vorbis_coslook_i(long a){
  148.91 +  int i=a>>COS_LOOKUP_I_SHIFT;
  148.92 +  int d=a&COS_LOOKUP_I_MASK;
  148.93 +  return COS_LOOKUP_I[i]- ((d*(COS_LOOKUP_I[i]-COS_LOOKUP_I[i+1]))>>
  148.94 +                           COS_LOOKUP_I_SHIFT);
  148.95 +}
  148.96 +
  148.97 +#endif
   149.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   149.2 +++ b/libs/vorbis/lookup.h	Sun Nov 01 00:36:56 2015 +0200
   149.3 @@ -0,0 +1,32 @@
   149.4 +/********************************************************************
   149.5 + *                                                                  *
   149.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   149.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   149.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   149.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  149.10 + *                                                                  *
  149.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
  149.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  149.13 + *                                                                  *
  149.14 + ********************************************************************
  149.15 +
  149.16 +  function: lookup based functions
  149.17 +  last mod: $Id: lookup.h 16227 2009-07-08 06:58:46Z xiphmont $
  149.18 +
  149.19 + ********************************************************************/
  149.20 +
  149.21 +#ifndef _V_LOOKUP_H_
  149.22 +
  149.23 +#ifdef FLOAT_LOOKUP
  149.24 +extern float vorbis_coslook(float a);
  149.25 +extern float vorbis_invsqlook(float a);
  149.26 +extern float vorbis_invsq2explook(int a);
  149.27 +extern float vorbis_fromdBlook(float a);
  149.28 +#endif
  149.29 +#ifdef INT_LOOKUP
  149.30 +extern long vorbis_invsqlook_i(long a,long e);
  149.31 +extern long vorbis_coslook_i(long a);
  149.32 +extern float vorbis_fromdBlook_i(long a);
  149.33 +#endif
  149.34 +
  149.35 +#endif
   150.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   150.2 +++ b/libs/vorbis/lookup_data.h	Sun Nov 01 00:36:56 2015 +0200
   150.3 @@ -0,0 +1,192 @@
   150.4 +/********************************************************************
   150.5 + *                                                                  *
   150.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   150.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   150.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   150.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  150.10 + *                                                                  *
  150.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007             *
  150.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  150.13 + *                                                                  *
  150.14 + ********************************************************************
  150.15 +
  150.16 +  function: lookup data; generated by lookups.pl; edit there
  150.17 +  last mod: $Id: lookup_data.h 16037 2009-05-26 21:10:58Z xiphmont $
  150.18 +
  150.19 + ********************************************************************/
  150.20 +
  150.21 +#ifndef _V_LOOKUP_DATA_H_
  150.22 +
  150.23 +#ifdef FLOAT_LOOKUP
  150.24 +#define COS_LOOKUP_SZ 128
  150.25 +static const float COS_LOOKUP[COS_LOOKUP_SZ+1]={
  150.26 +        +1.0000000000000f,+0.9996988186962f,+0.9987954562052f,+0.9972904566787f,
  150.27 +        +0.9951847266722f,+0.9924795345987f,+0.9891765099648f,+0.9852776423889f,
  150.28 +        +0.9807852804032f,+0.9757021300385f,+0.9700312531945f,+0.9637760657954f,
  150.29 +        +0.9569403357322f,+0.9495281805930f,+0.9415440651830f,+0.9329927988347f,
  150.30 +        +0.9238795325113f,+0.9142097557035f,+0.9039892931234f,+0.8932243011955f,
  150.31 +        +0.8819212643484f,+0.8700869911087f,+0.8577286100003f,+0.8448535652497f,
  150.32 +        +0.8314696123025f,+0.8175848131516f,+0.8032075314806f,+0.7883464276266f,
  150.33 +        +0.7730104533627f,+0.7572088465065f,+0.7409511253550f,+0.7242470829515f,
  150.34 +        +0.7071067811865f,+0.6895405447371f,+0.6715589548470f,+0.6531728429538f,
  150.35 +        +0.6343932841636f,+0.6152315905806f,+0.5956993044924f,+0.5758081914178f,
  150.36 +        +0.5555702330196f,+0.5349976198871f,+0.5141027441932f,+0.4928981922298f,
  150.37 +        +0.4713967368260f,+0.4496113296546f,+0.4275550934303f,+0.4052413140050f,
  150.38 +        +0.3826834323651f,+0.3598950365350f,+0.3368898533922f,+0.3136817403989f,
  150.39 +        +0.2902846772545f,+0.2667127574749f,+0.2429801799033f,+0.2191012401569f,
  150.40 +        +0.1950903220161f,+0.1709618887603f,+0.1467304744554f,+0.1224106751992f,
  150.41 +        +0.0980171403296f,+0.0735645635997f,+0.0490676743274f,+0.0245412285229f,
  150.42 +        +0.0000000000000f,-0.0245412285229f,-0.0490676743274f,-0.0735645635997f,
  150.43 +        -0.0980171403296f,-0.1224106751992f,-0.1467304744554f,-0.1709618887603f,
  150.44 +        -0.1950903220161f,-0.2191012401569f,-0.2429801799033f,-0.2667127574749f,
  150.45 +        -0.2902846772545f,-0.3136817403989f,-0.3368898533922f,-0.3598950365350f,
  150.46 +        -0.3826834323651f,-0.4052413140050f,-0.4275550934303f,-0.4496113296546f,
  150.47 +        -0.4713967368260f,-0.4928981922298f,-0.5141027441932f,-0.5349976198871f,
  150.48 +        -0.5555702330196f,-0.5758081914178f,-0.5956993044924f,-0.6152315905806f,
  150.49 +        -0.6343932841636f,-0.6531728429538f,-0.6715589548470f,-0.6895405447371f,
  150.50 +        -0.7071067811865f,-0.7242470829515f,-0.7409511253550f,-0.7572088465065f,
  150.51 +        -0.7730104533627f,-0.7883464276266f,-0.8032075314806f,-0.8175848131516f,
  150.52 +        -0.8314696123025f,-0.8448535652497f,-0.8577286100003f,-0.8700869911087f,
  150.53 +        -0.8819212643484f,-0.8932243011955f,-0.9039892931234f,-0.9142097557035f,
  150.54 +        -0.9238795325113f,-0.9329927988347f,-0.9415440651830f,-0.9495281805930f,
  150.55 +        -0.9569403357322f,-0.9637760657954f,-0.9700312531945f,-0.9757021300385f,
  150.56 +        -0.9807852804032f,-0.9852776423889f,-0.9891765099648f,-0.9924795345987f,
  150.57 +        -0.9951847266722f,-0.9972904566787f,-0.9987954562052f,-0.9996988186962f,
  150.58 +        -1.0000000000000f,
  150.59 +};
  150.60 +
  150.61 +#define INVSQ_LOOKUP_SZ 32
  150.62 +static const float INVSQ_LOOKUP[INVSQ_LOOKUP_SZ+1]={
  150.63 +        1.414213562373f,1.392621247646f,1.371988681140f,1.352246807566f,
  150.64 +        1.333333333333f,1.315191898443f,1.297771369046f,1.281025230441f,
  150.65 +        1.264911064067f,1.249390095109f,1.234426799697f,1.219988562661f,
  150.66 +        1.206045378311f,1.192569588000f,1.179535649239f,1.166919931983f,
  150.67 +        1.154700538379f,1.142857142857f,1.131370849898f,1.120224067222f,
  150.68 +        1.109400392450f,1.098884511590f,1.088662107904f,1.078719779941f,
  150.69 +        1.069044967650f,1.059625885652f,1.050451462878f,1.041511287847f,
  150.70 +        1.032795558989f,1.024295039463f,1.016001016002f,1.007905261358f,
  150.71 +        1.000000000000f,
  150.72 +};
  150.73 +
  150.74 +#define INVSQ2EXP_LOOKUP_MIN (-32)
  150.75 +#define INVSQ2EXP_LOOKUP_MAX 32
  150.76 +static const float INVSQ2EXP_LOOKUP[INVSQ2EXP_LOOKUP_MAX-\
  150.77 +                              INVSQ2EXP_LOOKUP_MIN+1]={
  150.78 +                 65536.f,    46340.95001f,         32768.f,    23170.47501f,
  150.79 +                 16384.f,     11585.2375f,          8192.f,    5792.618751f,
  150.80 +                  4096.f,    2896.309376f,          2048.f,    1448.154688f,
  150.81 +                  1024.f,    724.0773439f,           512.f,     362.038672f,
  150.82 +                   256.f,     181.019336f,           128.f,    90.50966799f,
  150.83 +                    64.f,      45.254834f,            32.f,      22.627417f,
  150.84 +                    16.f,     11.3137085f,             8.f,    5.656854249f,
  150.85 +                     4.f,    2.828427125f,             2.f,    1.414213562f,
  150.86 +                     1.f,   0.7071067812f,            0.5f,   0.3535533906f,
  150.87 +                   0.25f,   0.1767766953f,          0.125f,  0.08838834765f,
  150.88 +                 0.0625f,  0.04419417382f,        0.03125f,  0.02209708691f,
  150.89 +               0.015625f,  0.01104854346f,      0.0078125f, 0.005524271728f,
  150.90 +             0.00390625f, 0.002762135864f,    0.001953125f, 0.001381067932f,
  150.91 +           0.0009765625f, 0.000690533966f,  0.00048828125f, 0.000345266983f,
  150.92 +         0.000244140625f,0.0001726334915f,0.0001220703125f,8.631674575e-05f,
  150.93 +        6.103515625e-05f,4.315837288e-05f,3.051757812e-05f,2.157918644e-05f,
  150.94 +        1.525878906e-05f,
  150.95 +};
  150.96 +
  150.97 +#endif
  150.98 +
  150.99 +#define FROMdB_LOOKUP_SZ 35
 150.100 +#define FROMdB2_LOOKUP_SZ 32
 150.101 +#define FROMdB_SHIFT 5
 150.102 +#define FROMdB2_SHIFT 3
 150.103 +#define FROMdB2_MASK 31
 150.104 +
 150.105 +#ifdef FLOAT_LOOKUP
 150.106 +static const float FROMdB_LOOKUP[FROMdB_LOOKUP_SZ]={
 150.107 +                     1.f,   0.6309573445f,   0.3981071706f,   0.2511886432f,
 150.108 +           0.1584893192f,            0.1f,  0.06309573445f,  0.03981071706f,
 150.109 +          0.02511886432f,  0.01584893192f,           0.01f, 0.006309573445f,
 150.110 +         0.003981071706f, 0.002511886432f, 0.001584893192f,          0.001f,
 150.111 +        0.0006309573445f,0.0003981071706f,0.0002511886432f,0.0001584893192f,
 150.112 +                 0.0001f,6.309573445e-05f,3.981071706e-05f,2.511886432e-05f,
 150.113 +        1.584893192e-05f,          1e-05f,6.309573445e-06f,3.981071706e-06f,
 150.114 +        2.511886432e-06f,1.584893192e-06f,          1e-06f,6.309573445e-07f,
 150.115 +        3.981071706e-07f,2.511886432e-07f,1.584893192e-07f,
 150.116 +};
 150.117 +
 150.118 +static const float FROMdB2_LOOKUP[FROMdB2_LOOKUP_SZ]={
 150.119 +           0.9928302478f,   0.9786445908f,   0.9646616199f,   0.9508784391f,
 150.120 +           0.9372921937f,     0.92390007f,   0.9106992942f,   0.8976871324f,
 150.121 +           0.8848608897f,   0.8722179097f,   0.8597555737f,   0.8474713009f,
 150.122 +            0.835362547f,   0.8234268041f,   0.8116616003f,   0.8000644989f,
 150.123 +           0.7886330981f,   0.7773650302f,   0.7662579617f,    0.755309592f,
 150.124 +           0.7445176537f,   0.7338799116f,   0.7233941627f,   0.7130582353f,
 150.125 +           0.7028699885f,   0.6928273125f,   0.6829281272f,   0.6731703824f,
 150.126 +           0.6635520573f,   0.6540711597f,   0.6447257262f,   0.6355138211f,
 150.127 +};
 150.128 +#endif
 150.129 +
 150.130 +#ifdef INT_LOOKUP
 150.131 +
 150.132 +#define INVSQ_LOOKUP_I_SHIFT 10
 150.133 +#define INVSQ_LOOKUP_I_MASK 1023
 150.134 +static const long INVSQ_LOOKUP_I[64+1]={
 150.135 +           92682l,   91966l,   91267l,   90583l,
 150.136 +           89915l,   89261l,   88621l,   87995l,
 150.137 +           87381l,   86781l,   86192l,   85616l,
 150.138 +           85051l,   84497l,   83953l,   83420l,
 150.139 +           82897l,   82384l,   81880l,   81385l,
 150.140 +           80899l,   80422l,   79953l,   79492l,
 150.141 +           79039l,   78594l,   78156l,   77726l,
 150.142 +           77302l,   76885l,   76475l,   76072l,
 150.143 +           75674l,   75283l,   74898l,   74519l,
 150.144 +           74146l,   73778l,   73415l,   73058l,
 150.145 +           72706l,   72359l,   72016l,   71679l,
 150.146 +           71347l,   71019l,   70695l,   70376l,
 150.147 +           70061l,   69750l,   69444l,   69141l,
 150.148 +           68842l,   68548l,   68256l,   67969l,
 150.149 +           67685l,   67405l,   67128l,   66855l,
 150.150 +           66585l,   66318l,   66054l,   65794l,
 150.151 +           65536l,
 150.152 +};
 150.153 +
 150.154 +#define COS_LOOKUP_I_SHIFT 9
 150.155 +#define COS_LOOKUP_I_MASK 511
 150.156 +#define COS_LOOKUP_I_SZ 128
 150.157 +static const long COS_LOOKUP_I[COS_LOOKUP_I_SZ+1]={
 150.158 +           16384l,   16379l,   16364l,   16340l,
 150.159 +           16305l,   16261l,   16207l,   16143l,
 150.160 +           16069l,   15986l,   15893l,   15791l,
 150.161 +           15679l,   15557l,   15426l,   15286l,
 150.162 +           15137l,   14978l,   14811l,   14635l,
 150.163 +           14449l,   14256l,   14053l,   13842l,
 150.164 +           13623l,   13395l,   13160l,   12916l,
 150.165 +           12665l,   12406l,   12140l,   11866l,
 150.166 +           11585l,   11297l,   11003l,   10702l,
 150.167 +           10394l,   10080l,    9760l,    9434l,
 150.168 +            9102l,    8765l,    8423l,    8076l,
 150.169 +            7723l,    7366l,    7005l,    6639l,
 150.170 +            6270l,    5897l,    5520l,    5139l,
 150.171 +            4756l,    4370l,    3981l,    3590l,
 150.172 +            3196l,    2801l,    2404l,    2006l,
 150.173 +            1606l,    1205l,     804l,     402l,
 150.174 +               0l,    -401l,    -803l,   -1204l,
 150.175 +           -1605l,   -2005l,   -2403l,   -2800l,
 150.176 +           -3195l,   -3589l,   -3980l,   -4369l,
 150.177 +           -4755l,   -5138l,   -5519l,   -5896l,
 150.178 +           -6269l,   -6638l,   -7004l,   -7365l,
 150.179 +           -7722l,   -8075l,   -8422l,   -8764l,
 150.180 +           -9101l,   -9433l,   -9759l,  -10079l,
 150.181 +          -10393l,  -10701l,  -11002l,  -11296l,
 150.182 +          -11584l,  -11865l,  -12139l,  -12405l,
 150.183 +          -12664l,  -12915l,  -13159l,  -13394l,
 150.184 +          -13622l,  -13841l,  -14052l,  -14255l,
 150.185 +          -14448l,  -14634l,  -14810l,  -14977l,
 150.186 +          -15136l,  -15285l,  -15425l,  -15556l,
 150.187 +          -15678l,  -15790l,  -15892l,  -15985l,
 150.188 +          -16068l,  -16142l,  -16206l,  -16260l,
 150.189 +          -16304l,  -16339l,  -16363l,  -16378l,
 150.190 +          -16383l,
 150.191 +};
 150.192 +
 150.193 +#endif
 150.194 +
 150.195 +#endif
   151.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   151.2 +++ b/libs/vorbis/lpc.c	Sun Nov 01 00:36:56 2015 +0200
   151.3 @@ -0,0 +1,160 @@
   151.4 +/********************************************************************
   151.5 + *                                                                  *
   151.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   151.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   151.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   151.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  151.10 + *                                                                  *
  151.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
  151.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  151.13 + *                                                                  *
  151.14 + ********************************************************************
  151.15 +
  151.16 +  function: LPC low level routines
  151.17 +  last mod: $Id: lpc.c 16227 2009-07-08 06:58:46Z xiphmont $
  151.18 +
  151.19 + ********************************************************************/
  151.20 +
  151.21 +/* Some of these routines (autocorrelator, LPC coefficient estimator)
  151.22 +   are derived from code written by Jutta Degener and Carsten Bormann;
  151.23 +   thus we include their copyright below.  The entirety of this file
  151.24 +   is freely redistributable on the condition that both of these
  151.25 +   copyright notices are preserved without modification.  */
  151.26 +
  151.27 +/* Preserved Copyright: *********************************************/
  151.28 +
  151.29 +/* Copyright 1992, 1993, 1994 by Jutta Degener and Carsten Bormann,
  151.30 +Technische Universita"t Berlin
  151.31 +
  151.32 +Any use of this software is permitted provided that this notice is not
  151.33 +removed and that neither the authors nor the Technische Universita"t
  151.34 +Berlin are deemed to have made any representations as to the
  151.35 +suitability of this software for any purpose nor are held responsible
  151.36 +for any defects of this software. THERE IS ABSOLUTELY NO WARRANTY FOR
  151.37 +THIS SOFTWARE.
  151.38 +
  151.39 +As a matter of courtesy, the authors request to be informed about uses
  151.40 +this software has found, about bugs in this software, and about any
  151.41 +improvements that may be of general interest.
  151.42 +
  151.43 +Berlin, 28.11.1994
  151.44 +Jutta Degener
  151.45 +Carsten Bormann
  151.46 +
  151.47 +*********************************************************************/
  151.48 +
  151.49 +#include <stdlib.h>
  151.50 +#include <string.h>
  151.51 +#include <math.h>
  151.52 +#include "os.h"
  151.53 +#include "smallft.h"
  151.54 +#include "lpc.h"
  151.55 +#include "scales.h"
  151.56 +#include "misc.h"
  151.57 +
  151.58 +/* Autocorrelation LPC coeff generation algorithm invented by
  151.59 +   N. Levinson in 1947, modified by J. Durbin in 1959. */
  151.60 +
  151.61 +/* Input : n elements of time doamin data
  151.62 +   Output: m lpc coefficients, excitation energy */
  151.63 +
  151.64 +float vorbis_lpc_from_data(float *data,float *lpci,int n,int m){
  151.65 +  double *aut=alloca(sizeof(*aut)*(m+1));
  151.66 +  double *lpc=alloca(sizeof(*lpc)*(m));
  151.67 +  double error;
  151.68 +  double epsilon;
  151.69 +  int i,j;
  151.70 +
  151.71 +  /* autocorrelation, p+1 lag coefficients */
  151.72 +  j=m+1;
  151.73 +  while(j--){
  151.74 +    double d=0; /* double needed for accumulator depth */
  151.75 +    for(i=j;i<n;i++)d+=(double)data[i]*data[i-j];
  151.76 +    aut[j]=d;
  151.77 +  }
  151.78 +
  151.79 +  /* Generate lpc coefficients from autocorr values */
  151.80 +
  151.81 +  /* set our noise floor to about -100dB */
  151.82 +  error=aut[0] * (1. + 1e-10);
  151.83 +  epsilon=1e-9*aut[0]+1e-10;
  151.84 +
  151.85 +  for(i=0;i<m;i++){
  151.86 +    double r= -aut[i+1];
  151.87 +
  151.88 +    if(error<epsilon){
  151.89 +      memset(lpc+i,0,(m-i)*sizeof(*lpc));
  151.90 +      goto done;
  151.91 +    }
  151.92 +
  151.93 +    /* Sum up this iteration's reflection coefficient; note that in
  151.94 +       Vorbis we don't save it.  If anyone wants to recycle this code
  151.95 +       and needs reflection coefficients, save the results of 'r' from
  151.96 +       each iteration. */
  151.97 +
  151.98 +    for(j=0;j<i;j++)r-=lpc[j]*aut[i-j];
  151.99 +    r/=error;
 151.100 +
 151.101 +    /* Update LPC coefficients and total error */
 151.102 +
 151.103 +    lpc[i]=r;
 151.104 +    for(j=0;j<i/2;j++){
 151.105 +      double tmp=lpc[j];
 151.106 +
 151.107 +      lpc[j]+=r*lpc[i-1-j];
 151.108 +      lpc[i-1-j]+=r*tmp;
 151.109 +    }
 151.110 +    if(i&1)lpc[j]+=lpc[j]*r;
 151.111 +
 151.112 +    error*=1.-r*r;
 151.113 +
 151.114 +  }
 151.115 +
 151.116 + done:
 151.117 +
 151.118 +  /* slightly damp the filter */
 151.119 +  {
 151.120 +    double g = .99;
 151.121 +    double damp = g;
 151.122 +    for(j=0;j<m;j++){
 151.123 +      lpc[j]*=damp;
 151.124 +      damp*=g;
 151.125 +    }
 151.126 +  }
 151.127 +
 151.128 +  for(j=0;j<m;j++)lpci[j]=(float)lpc[j];
 151.129 +
 151.130 +  /* we need the error value to know how big an impulse to hit the
 151.131 +     filter with later */
 151.132 +
 151.133 +  return error;
 151.134 +}
 151.135 +
 151.136 +void vorbis_lpc_predict(float *coeff,float *prime,int m,
 151.137 +                     float *data,long n){
 151.138 +
 151.139 +  /* in: coeff[0...m-1] LPC coefficients
 151.140 +         prime[0...m-1] initial values (allocated size of n+m-1)
 151.141 +    out: data[0...n-1] data samples */
 151.142 +
 151.143 +  long i,j,o,p;
 151.144 +  float y;
 151.145 +  float *work=alloca(sizeof(*work)*(m+n));
 151.146 +
 151.147 +  if(!prime)
 151.148 +    for(i=0;i<m;i++)
 151.149 +      work[i]=0.f;
 151.150 +  else
 151.151 +    for(i=0;i<m;i++)
 151.152 +      work[i]=prime[i];
 151.153 +
 151.154 +  for(i=0;i<n;i++){
 151.155 +    y=0;
 151.156 +    o=i;
 151.157 +    p=m;
 151.158 +    for(j=0;j<m;j++)
 151.159 +      y-=work[o++]*coeff[--p];
 151.160 +
 151.161 +    data[i]=work[o]=y;
 151.162 +  }
 151.163 +}
   152.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   152.2 +++ b/libs/vorbis/lpc.h	Sun Nov 01 00:36:56 2015 +0200
   152.3 @@ -0,0 +1,29 @@
   152.4 +/********************************************************************
   152.5 + *                                                                  *
   152.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   152.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   152.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   152.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  152.10 + *                                                                  *
  152.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007             *
  152.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  152.13 + *                                                                  *
  152.14 + ********************************************************************
  152.15 +
  152.16 +  function: LPC low level routines
  152.17 +  last mod: $Id: lpc.h 16037 2009-05-26 21:10:58Z xiphmont $
  152.18 +
  152.19 + ********************************************************************/
  152.20 +
  152.21 +#ifndef _V_LPC_H_
  152.22 +#define _V_LPC_H_
  152.23 +
  152.24 +#include "vorbis/codec.h"
  152.25 +
  152.26 +/* simple linear scale LPC code */
  152.27 +extern float vorbis_lpc_from_data(float *data,float *lpc,int n,int m);
  152.28 +
  152.29 +extern void vorbis_lpc_predict(float *coeff,float *prime,int m,
  152.30 +                               float *data,long n);
  152.31 +
  152.32 +#endif
   153.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   153.2 +++ b/libs/vorbis/lsp.c	Sun Nov 01 00:36:56 2015 +0200
   153.3 @@ -0,0 +1,454 @@
   153.4 +/********************************************************************
   153.5 + *                                                                  *
   153.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   153.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   153.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   153.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  153.10 + *                                                                  *
  153.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
  153.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  153.13 + *                                                                  *
  153.14 + ********************************************************************
  153.15 +
  153.16 +  function: LSP (also called LSF) conversion routines
  153.17 +  last mod: $Id: lsp.c 17538 2010-10-15 02:52:29Z tterribe $
  153.18 +
  153.19 +  The LSP generation code is taken (with minimal modification and a
  153.20 +  few bugfixes) from "On the Computation of the LSP Frequencies" by
  153.21 +  Joseph Rothweiler (see http://www.rothweiler.us for contact info).
  153.22 +  The paper is available at:
  153.23 +
  153.24 +  http://www.myown1.com/joe/lsf
  153.25 +
  153.26 + ********************************************************************/
  153.27 +
  153.28 +/* Note that the lpc-lsp conversion finds the roots of polynomial with
  153.29 +   an iterative root polisher (CACM algorithm 283).  It *is* possible
  153.30 +   to confuse this algorithm into not converging; that should only
  153.31 +   happen with absurdly closely spaced roots (very sharp peaks in the
  153.32 +   LPC f response) which in turn should be impossible in our use of
  153.33 +   the code.  If this *does* happen anyway, it's a bug in the floor
  153.34 +   finder; find the cause of the confusion (probably a single bin
  153.35 +   spike or accidental near-float-limit resolution problems) and
  153.36 +   correct it. */
  153.37 +
  153.38 +#include <math.h>
  153.39 +#include <string.h>
  153.40 +#include <stdlib.h>
  153.41 +#include "lsp.h"
  153.42 +#include "os.h"
  153.43 +#include "misc.h"
  153.44 +#include "lookup.h"
  153.45 +#include "scales.h"
  153.46 +
  153.47 +/* three possible LSP to f curve functions; the exact computation
  153.48 +   (float), a lookup based float implementation, and an integer
  153.49 +   implementation.  The float lookup is likely the optimal choice on
  153.50 +   any machine with an FPU.  The integer implementation is *not* fixed
  153.51 +   point (due to the need for a large dynamic range and thus a
  153.52 +   separately tracked exponent) and thus much more complex than the
  153.53 +   relatively simple float implementations. It's mostly for future
  153.54 +   work on a fully fixed point implementation for processors like the
  153.55 +   ARM family. */
  153.56 +
  153.57 +/* define either of these (preferably FLOAT_LOOKUP) to have faster
  153.58 +   but less precise implementation. */
  153.59 +#undef FLOAT_LOOKUP
  153.60 +#undef INT_LOOKUP
  153.61 +
  153.62 +#ifdef FLOAT_LOOKUP
  153.63 +#include "lookup.c" /* catch this in the build system; we #include for
  153.64 +                       compilers (like gcc) that can't inline across
  153.65 +                       modules */
  153.66 +
  153.67 +/* side effect: changes *lsp to cosines of lsp */
  153.68 +void vorbis_lsp_to_curve(float *curve,int *map,int n,int ln,float *lsp,int m,
  153.69 +                            float amp,float ampoffset){
  153.70 +  int i;
  153.71 +  float wdel=M_PI/ln;
  153.72 +  vorbis_fpu_control fpu;
  153.73 +
  153.74 +  vorbis_fpu_setround(&fpu);
  153.75 +  for(i=0;i<m;i++)lsp[i]=vorbis_coslook(lsp[i]);
  153.76 +
  153.77 +  i=0;
  153.78 +  while(i<n){
  153.79 +    int k=map[i];
  153.80 +    int qexp;
  153.81 +    float p=.7071067812f;
  153.82 +    float q=.7071067812f;
  153.83 +    float w=vorbis_coslook(wdel*k);
  153.84 +    float *ftmp=lsp;
  153.85 +    int c=m>>1;
  153.86 +
  153.87 +    while(c--){
  153.88 +      q*=ftmp[0]-w;
  153.89 +      p*=ftmp[1]-w;
  153.90 +      ftmp+=2;
  153.91 +    }
  153.92 +
  153.93 +    if(m&1){
  153.94 +      /* odd order filter; slightly assymetric */
  153.95 +      /* the last coefficient */
  153.96 +      q*=ftmp[0]-w;
  153.97 +      q*=q;
  153.98 +      p*=p*(1.f-w*w);
  153.99 +    }else{
 153.100 +      /* even order filter; still symmetric */
 153.101 +      q*=q*(1.f+w);
 153.102 +      p*=p*(1.f-w);
 153.103 +    }
 153.104 +
 153.105 +    q=frexp(p+q,&qexp);
 153.106 +    q=vorbis_fromdBlook(amp*
 153.107 +                        vorbis_invsqlook(q)*
 153.108 +                        vorbis_invsq2explook(qexp+m)-
 153.109 +                        ampoffset);
 153.110 +
 153.111 +    do{
 153.112 +      curve[i++]*=q;
 153.113 +    }while(map[i]==k);
 153.114 +  }
 153.115 +  vorbis_fpu_restore(fpu);
 153.116 +}
 153.117 +
 153.118 +#else
 153.119 +
 153.120 +#ifdef INT_LOOKUP
 153.121 +#include "lookup.c" /* catch this in the build system; we #include for
 153.122 +                       compilers (like gcc) that can't inline across
 153.123 +                       modules */
 153.124 +
 153.125 +static const int MLOOP_1[64]={
 153.126 +   0,10,11,11, 12,12,12,12, 13,13,13,13, 13,13,13,13,
 153.127 +  14,14,14,14, 14,14,14,14, 14,14,14,14, 14,14,14,14,
 153.128 +  15,15,15,15, 15,15,15,15, 15,15,15,15, 15,15,15,15,
 153.129 +  15,15,15,15, 15,15,15,15, 15,15,15,15, 15,15,15,15,
 153.130 +};
 153.131 +
 153.132 +static const int MLOOP_2[64]={
 153.133 +  0,4,5,5, 6,6,6,6, 7,7,7,7, 7,7,7,7,
 153.134 +  8,8,8,8, 8,8,8,8, 8,8,8,8, 8,8,8,8,
 153.135 +  9,9,9,9, 9,9,9,9, 9,9,9,9, 9,9,9,9,
 153.136 +  9,9,9,9, 9,9,9,9, 9,9,9,9, 9,9,9,9,
 153.137 +};
 153.138 +
 153.139 +static const int MLOOP_3[8]={0,1,2,2,3,3,3,3};
 153.140 +
 153.141 +
 153.142 +/* side effect: changes *lsp to cosines of lsp */
 153.143 +void vorbis_lsp_to_curve(float *curve,int *map,int n,int ln,float *lsp,int m,
 153.144 +                            float amp,float ampoffset){
 153.145 +
 153.146 +  /* 0 <= m < 256 */
 153.147 +
 153.148 +  /* set up for using all int later */
 153.149 +  int i;
 153.150 +  int ampoffseti=rint(ampoffset*4096.f);
 153.151 +  int ampi=rint(amp*16.f);
 153.152 +  long *ilsp=alloca(m*sizeof(*ilsp));
 153.153 +  for(i=0;i<m;i++)ilsp[i]=vorbis_coslook_i(lsp[i]/M_PI*65536.f+.5f);
 153.154 +
 153.155 +  i=0;
 153.156 +  while(i<n){
 153.157 +    int j,k=map[i];
 153.158 +    unsigned long pi=46341; /* 2**-.5 in 0.16 */
 153.159 +    unsigned long qi=46341;
 153.160 +    int qexp=0,shift;
 153.161 +    long wi=vorbis_coslook_i(k*65536/ln);
 153.162 +
 153.163 +    qi*=labs(ilsp[0]-wi);
 153.164 +    pi*=labs(ilsp[1]-wi);
 153.165 +
 153.166 +    for(j=3;j<m;j+=2){
 153.167 +      if(!(shift=MLOOP_1[(pi|qi)>>25]))
 153.168 +        if(!(shift=MLOOP_2[(pi|qi)>>19]))
 153.169 +          shift=MLOOP_3[(pi|qi)>>16];
 153.170 +      qi=(qi>>shift)*labs(ilsp[j-1]-wi);
 153.171 +      pi=(pi>>shift)*labs(ilsp[j]-wi);
 153.172 +      qexp+=shift;
 153.173 +    }
 153.174 +    if(!(shift=MLOOP_1[(pi|qi)>>25]))
 153.175 +      if(!(shift=MLOOP_2[(pi|qi)>>19]))
 153.176 +        shift=MLOOP_3[(pi|qi)>>16];
 153.177 +
 153.178 +    /* pi,qi normalized collectively, both tracked using qexp */
 153.179 +
 153.180 +    if(m&1){
 153.181 +      /* odd order filter; slightly assymetric */
 153.182 +      /* the last coefficient */
 153.183 +      qi=(qi>>shift)*labs(ilsp[j-1]-wi);
 153.184 +      pi=(pi>>shift)<<14;
 153.185 +      qexp+=shift;
 153.186 +
 153.187 +      if(!(shift=MLOOP_1[(pi|qi)>>25]))
 153.188 +        if(!(shift=MLOOP_2[(pi|qi)>>19]))
 153.189 +          shift=MLOOP_3[(pi|qi)>>16];
 153.190 +
 153.191 +      pi>>=shift;
 153.192 +      qi>>=shift;
 153.193 +      qexp+=shift-14*((m+1)>>1);
 153.194 +
 153.195 +      pi=((pi*pi)>>16);
 153.196 +      qi=((qi*qi)>>16);
 153.197 +      qexp=qexp*2+m;
 153.198 +
 153.199 +      pi*=(1<<14)-((wi*wi)>>14);
 153.200 +      qi+=pi>>14;
 153.201 +
 153.202 +    }else{
 153.203 +      /* even order filter; still symmetric */
 153.204 +
 153.205 +      /* p*=p(1-w), q*=q(1+w), let normalization drift because it isn't
 153.206 +         worth tracking step by step */
 153.207 +
 153.208 +      pi>>=shift;
 153.209 +      qi>>=shift;
 153.210 +      qexp+=shift-7*m;
 153.211 +
 153.212 +      pi=((pi*pi)>>16);
 153.213 +      qi=((qi*qi)>>16);
 153.214 +      qexp=qexp*2+m;
 153.215 +
 153.216 +      pi*=(1<<14)-wi;
 153.217 +      qi*=(1<<14)+wi;
 153.218 +      qi=(qi+pi)>>14;
 153.219 +
 153.220 +    }
 153.221 +
 153.222 +
 153.223 +    /* we've let the normalization drift because it wasn't important;
 153.224 +       however, for the lookup, things must be normalized again.  We
 153.225 +       need at most one right shift or a number of left shifts */
 153.226 +
 153.227 +    if(qi&0xffff0000){ /* checks for 1.xxxxxxxxxxxxxxxx */
 153.228 +      qi>>=1; qexp++;
 153.229 +    }else
 153.230 +      while(qi && !(qi&0x8000)){ /* checks for 0.0xxxxxxxxxxxxxxx or less*/
 153.231 +        qi<<=1; qexp--;
 153.232 +      }
 153.233 +
 153.234 +    amp=vorbis_fromdBlook_i(ampi*                     /*  n.4         */
 153.235 +                            vorbis_invsqlook_i(qi,qexp)-
 153.236 +                                                      /*  m.8, m+n<=8 */
 153.237 +                            ampoffseti);              /*  8.12[0]     */
 153.238 +
 153.239 +    curve[i]*=amp;
 153.240 +    while(map[++i]==k)curve[i]*=amp;
 153.241 +  }
 153.242 +}
 153.243 +
 153.244 +#else
 153.245 +
 153.246 +/* old, nonoptimized but simple version for any poor sap who needs to
 153.247 +   figure out what the hell this code does, or wants the other
 153.248 +   fraction of a dB precision */
 153.249 +
 153.250 +/* side effect: changes *lsp to cosines of lsp */
 153.251 +void vorbis_lsp_to_curve(float *curve,int *map,int n,int ln,float *lsp,int m,
 153.252 +                            float amp,float ampoffset){
 153.253 +  int i;
 153.254 +  float wdel=M_PI/ln;
 153.255 +  for(i=0;i<m;i++)lsp[i]=2.f*cos(lsp[i]);
 153.256 +
 153.257 +  i=0;
 153.258 +  while(i<n){
 153.259 +    int j,k=map[i];
 153.260 +    float p=.5f;
 153.261 +    float q=.5f;
 153.262 +    float w=2.f*cos(wdel*k);
 153.263 +    for(j=1;j<m;j+=2){
 153.264 +      q *= w-lsp[j-1];
 153.265 +      p *= w-lsp[j];
 153.266 +    }
 153.267 +    if(j==m){
 153.268 +      /* odd order filter; slightly assymetric */
 153.269 +      /* the last coefficient */
 153.270 +      q*=w-lsp[j-1];
 153.271 +      p*=p*(4.f-w*w);
 153.272 +      q*=q;
 153.273 +    }else{
 153.274 +      /* even order filter; still symmetric */
 153.275 +      p*=p*(2.f-w);
 153.276 +      q*=q*(2.f+w);
 153.277 +    }
 153.278 +
 153.279 +    q=fromdB(amp/sqrt(p+q)-ampoffset);
 153.280 +
 153.281 +    curve[i]*=q;
 153.282 +    while(map[++i]==k)curve[i]*=q;
 153.283 +  }
 153.284 +}
 153.285 +
 153.286 +#endif
 153.287 +#endif
 153.288 +
 153.289 +static void cheby(float *g, int ord) {
 153.290 +  int i, j;
 153.291 +
 153.292 +  g[0] *= .5f;
 153.293 +  for(i=2; i<= ord; i++) {
 153.294 +    for(j=ord; j >= i; j--) {
 153.295 +      g[j-2] -= g[j];
 153.296 +      g[j] += g[j];
 153.297 +    }
 153.298 +  }
 153.299 +}
 153.300 +
 153.301 +static int comp(const void *a,const void *b){
 153.302 +  return (*(float *)a<*(float *)b)-(*(float *)a>*(float *)b);
 153.303 +}
 153.304 +
 153.305 +/* Newton-Raphson-Maehly actually functioned as a decent root finder,
 153.306 +   but there are root sets for which it gets into limit cycles
 153.307 +   (exacerbated by zero suppression) and fails.  We can't afford to
 153.308 +   fail, even if the failure is 1 in 100,000,000, so we now use
 153.309 +   Laguerre and later polish with Newton-Raphson (which can then
 153.310 +   afford to fail) */
 153.311 +
 153.312 +#define EPSILON 10e-7
 153.313 +static int Laguerre_With_Deflation(float *a,int ord,float *r){
 153.314 +  int i,m;
 153.315 +  double *defl=alloca(sizeof(*defl)*(ord+1));
 153.316 +  for(i=0;i<=ord;i++)defl[i]=a[i];
 153.317 +
 153.318 +  for(m=ord;m>0;m--){
 153.319 +    double new=0.f,delta;
 153.320 +
 153.321 +    /* iterate a root */
 153.322 +    while(1){
 153.323 +      double p=defl[m],pp=0.f,ppp=0.f,denom;
 153.324 +
 153.325 +      /* eval the polynomial and its first two derivatives */
 153.326 +      for(i=m;i>0;i--){
 153.327 +        ppp = new*ppp + pp;
 153.328 +        pp  = new*pp  + p;
 153.329 +        p   = new*p   + defl[i-1];
 153.330 +      }
 153.331 +
 153.332 +      /* Laguerre's method */
 153.333 +      denom=(m-1) * ((m-1)*pp*pp - m*p*ppp);
 153.334 +      if(denom<0)
 153.335 +        return(-1);  /* complex root!  The LPC generator handed us a bad filter */
 153.336 +
 153.337 +      if(pp>0){
 153.338 +        denom = pp + sqrt(denom);
 153.339 +        if(denom<EPSILON)denom=EPSILON;
 153.340 +      }else{
 153.341 +        denom = pp - sqrt(denom);
 153.342 +        if(denom>-(EPSILON))denom=-(EPSILON);
 153.343 +      }
 153.344 +
 153.345 +      delta  = m*p/denom;
 153.346 +      new   -= delta;
 153.347 +
 153.348 +      if(delta<0.f)delta*=-1;
 153.349 +
 153.350 +      if(fabs(delta/new)<10e-12)break;
 153.351 +    }
 153.352 +
 153.353 +    r[m-1]=new;
 153.354 +
 153.355 +    /* forward deflation */
 153.356 +
 153.357 +    for(i=m;i>0;i--)
 153.358 +      defl[i-1]+=new*defl[i];
 153.359 +    defl++;
 153.360 +
 153.361 +  }
 153.362 +  return(0);
 153.363 +}
 153.364 +
 153.365 +
 153.366 +/* for spit-and-polish only */
 153.367 +static int Newton_Raphson(float *a,int ord,float *r){
 153.368 +  int i, k, count=0;
 153.369 +  double error=1.f;
 153.370 +  double *root=alloca(ord*sizeof(*root));
 153.371 +
 153.372 +  for(i=0; i<ord;i++) root[i] = r[i];
 153.373 +
 153.374 +  while(error>1e-20){
 153.375 +    error=0;
 153.376 +
 153.377 +    for(i=0; i<ord; i++) { /* Update each point. */
 153.378 +      double pp=0.,delta;
 153.379 +      double rooti=root[i];
 153.380 +      double p=a[ord];
 153.381 +      for(k=ord-1; k>= 0; k--) {
 153.382 +
 153.383 +        pp= pp* rooti + p;
 153.384 +        p = p * rooti + a[k];
 153.385 +      }
 153.386 +
 153.387 +      delta = p/pp;
 153.388 +      root[i] -= delta;
 153.389 +      error+= delta*delta;
 153.390 +    }
 153.391 +
 153.392 +    if(count>40)return(-1);
 153.393 +
 153.394 +    count++;
 153.395 +  }
 153.396 +
 153.397 +  /* Replaced the original bubble sort with a real sort.  With your
 153.398 +     help, we can eliminate the bubble sort in our lifetime. --Monty */
 153.399 +
 153.400 +  for(i=0; i<ord;i++) r[i] = root[i];
 153.401 +  return(0);
 153.402 +}
 153.403 +
 153.404 +
 153.405 +/* Convert lpc coefficients to lsp coefficients */
 153.406 +int vorbis_lpc_to_lsp(float *lpc,float *lsp,int m){
 153.407 +  int order2=(m+1)>>1;
 153.408 +  int g1_order,g2_order;
 153.409 +  float *g1=alloca(sizeof(*g1)*(order2+1));
 153.410 +  float *g2=alloca(sizeof(*g2)*(order2+1));
 153.411 +  float *g1r=alloca(sizeof(*g1r)*(order2+1));
 153.412 +  float *g2r=alloca(sizeof(*g2r)*(order2+1));
 153.413 +  int i;
 153.414 +
 153.415 +  /* even and odd are slightly different base cases */
 153.416 +  g1_order=(m+1)>>1;
 153.417 +  g2_order=(m)  >>1;
 153.418 +
 153.419 +  /* Compute the lengths of the x polynomials. */
 153.420 +  /* Compute the first half of K & R F1 & F2 polynomials. */
 153.421 +  /* Compute half of the symmetric and antisymmetric polynomials. */
 153.422 +  /* Remove the roots at +1 and -1. */
 153.423 +
 153.424 +  g1[g1_order] = 1.f;
 153.425 +  for(i=1;i<=g1_order;i++) g1[g1_order-i] = lpc[i-1]+lpc[m-i];
 153.426 +  g2[g2_order] = 1.f;
 153.427 +  for(i=1;i<=g2_order;i++) g2[g2_order-i] = lpc[i-1]-lpc[m-i];
 153.428 +
 153.429 +  if(g1_order>g2_order){
 153.430 +    for(i=2; i<=g2_order;i++) g2[g2_order-i] += g2[g2_order-i+2];
 153.431 +  }else{
 153.432 +    for(i=1; i<=g1_order;i++) g1[g1_order-i] -= g1[g1_order-i+1];
 153.433 +    for(i=1; i<=g2_order;i++) g2[g2_order-i] += g2[g2_order-i+1];
 153.434 +  }
 153.435 +
 153.436 +  /* Convert into polynomials in cos(alpha) */
 153.437 +  cheby(g1,g1_order);
 153.438 +  cheby(g2,g2_order);
 153.439 +
 153.440 +  /* Find the roots of the 2 even polynomials.*/
 153.441 +  if(Laguerre_With_Deflation(g1,g1_order,g1r) ||
 153.442 +     Laguerre_With_Deflation(g2,g2_order,g2r))
 153.443 +    return(-1);
 153.444 +
 153.445 +  Newton_Raphson(g1,g1_order,g1r); /* if it fails, it leaves g1r alone */
 153.446 +  Newton_Raphson(g2,g2_order,g2r); /* if it fails, it leaves g2r alone */
 153.447 +
 153.448 +  qsort(g1r,g1_order,sizeof(*g1r),comp);
 153.449 +  qsort(g2r,g2_order,sizeof(*g2r),comp);
 153.450 +
 153.451 +  for(i=0;i<g1_order;i++)
 153.452 +    lsp[i*2] = acos(g1r[i]);
 153.453 +
 153.454 +  for(i=0;i<g2_order;i++)
 153.455 +    lsp[i*2+1] = acos(g2r[i]);
 153.456 +  return(0);
 153.457 +}
   154.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   154.2 +++ b/libs/vorbis/lsp.h	Sun Nov 01 00:36:56 2015 +0200
   154.3 @@ -0,0 +1,28 @@
   154.4 +/********************************************************************
   154.5 + *                                                                  *
   154.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   154.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   154.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   154.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  154.10 + *                                                                  *
  154.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
  154.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  154.13 + *                                                                  *
  154.14 + ********************************************************************
  154.15 +
  154.16 +  function: LSP (also called LSF) conversion routines
  154.17 +  last mod: $Id: lsp.h 16227 2009-07-08 06:58:46Z xiphmont $
  154.18 +
  154.19 + ********************************************************************/
  154.20 +
  154.21 +
  154.22 +#ifndef _V_LSP_H_
  154.23 +#define _V_LSP_H_
  154.24 +
  154.25 +extern int vorbis_lpc_to_lsp(float *lpc,float *lsp,int m);
  154.26 +
  154.27 +extern void vorbis_lsp_to_curve(float *curve,int *map,int n,int ln,
  154.28 +                                float *lsp,int m,
  154.29 +                                float amp,float ampoffset);
  154.30 +
  154.31 +#endif
   155.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   155.2 +++ b/libs/vorbis/mapping0.c	Sun Nov 01 00:36:56 2015 +0200
   155.3 @@ -0,0 +1,816 @@
   155.4 +/********************************************************************
   155.5 + *                                                                  *
   155.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   155.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   155.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   155.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  155.10 + *                                                                  *
  155.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2010             *
  155.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  155.13 + *                                                                  *
  155.14 + ********************************************************************
  155.15 +
  155.16 + function: channel mapping 0 implementation
  155.17 + last mod: $Id: mapping0.c 17022 2010-03-25 03:45:42Z xiphmont $
  155.18 +
  155.19 + ********************************************************************/
  155.20 +
  155.21 +#include <stdlib.h>
  155.22 +#include <stdio.h>
  155.23 +#include <string.h>
  155.24 +#include <math.h>
  155.25 +#include <ogg/ogg.h>
  155.26 +#include "vorbis/codec.h"
  155.27 +#include "codec_internal.h"
  155.28 +#include "codebook.h"
  155.29 +#include "window.h"
  155.30 +#include "registry.h"
  155.31 +#include "psy.h"
  155.32 +#include "misc.h"
  155.33 +
  155.34 +/* simplistic, wasteful way of doing this (unique lookup for each
  155.35 +   mode/submapping); there should be a central repository for
  155.36 +   identical lookups.  That will require minor work, so I'm putting it
  155.37 +   off as low priority.
  155.38 +
  155.39 +   Why a lookup for each backend in a given mode?  Because the
  155.40 +   blocksize is set by the mode, and low backend lookups may require
  155.41 +   parameters from other areas of the mode/mapping */
  155.42 +
  155.43 +static void mapping0_free_info(vorbis_info_mapping *i){
  155.44 +  vorbis_info_mapping0 *info=(vorbis_info_mapping0 *)i;
  155.45 +  if(info){
  155.46 +    memset(info,0,sizeof(*info));
  155.47 +    _ogg_free(info);
  155.48 +  }
  155.49 +}
  155.50 +
  155.51 +static int ilog(unsigned int v){
  155.52 +  int ret=0;
  155.53 +  if(v)--v;
  155.54 +  while(v){
  155.55 +    ret++;
  155.56 +    v>>=1;
  155.57 +  }
  155.58 +  return(ret);
  155.59 +}
  155.60 +
  155.61 +static void mapping0_pack(vorbis_info *vi,vorbis_info_mapping *vm,
  155.62 +                          oggpack_buffer *opb){
  155.63 +  int i;
  155.64 +  vorbis_info_mapping0 *info=(vorbis_info_mapping0 *)vm;
  155.65 +
  155.66 +  /* another 'we meant to do it this way' hack...  up to beta 4, we
  155.67 +     packed 4 binary zeros here to signify one submapping in use.  We
  155.68 +     now redefine that to mean four bitflags that indicate use of
  155.69 +     deeper features; bit0:submappings, bit1:coupling,
  155.70 +     bit2,3:reserved. This is backward compatable with all actual uses
  155.71 +     of the beta code. */
  155.72 +
  155.73 +  if(info->submaps>1){
  155.74 +    oggpack_write(opb,1,1);
  155.75 +    oggpack_write(opb,info->submaps-1,4);
  155.76 +  }else
  155.77 +    oggpack_write(opb,0,1);
  155.78 +
  155.79 +  if(info->coupling_steps>0){
  155.80 +    oggpack_write(opb,1,1);
  155.81 +    oggpack_write(opb,info->coupling_steps-1,8);
  155.82 +
  155.83 +    for(i=0;i<info->coupling_steps;i++){
  155.84 +      oggpack_write(opb,info->coupling_mag[i],ilog(vi->channels));
  155.85 +      oggpack_write(opb,info->coupling_ang[i],ilog(vi->channels));
  155.86 +    }
  155.87 +  }else
  155.88 +    oggpack_write(opb,0,1);
  155.89 +
  155.90 +  oggpack_write(opb,0,2); /* 2,3:reserved */
  155.91 +
  155.92 +  /* we don't write the channel submappings if we only have one... */
  155.93 +  if(info->submaps>1){
  155.94 +    for(i=0;i<vi->channels;i++)
  155.95 +      oggpack_write(opb,info->chmuxlist[i],4);
  155.96 +  }
  155.97 +  for(i=0;i<info->submaps;i++){
  155.98 +    oggpack_write(opb,0,8); /* time submap unused */
  155.99 +    oggpack_write(opb,info->floorsubmap[i],8);
 155.100 +    oggpack_write(opb,info->residuesubmap[i],8);
 155.101 +  }
 155.102 +}
 155.103 +
 155.104 +/* also responsible for range checking */
 155.105 +static vorbis_info_mapping *mapping0_unpack(vorbis_info *vi,oggpack_buffer *opb){
 155.106 +  int i,b;
 155.107 +  vorbis_info_mapping0 *info=_ogg_calloc(1,sizeof(*info));
 155.108 +  codec_setup_info     *ci=vi->codec_setup;
 155.109 +  memset(info,0,sizeof(*info));
 155.110 +
 155.111 +  b=oggpack_read(opb,1);
 155.112 +  if(b<0)goto err_out;
 155.113 +  if(b){
 155.114 +    info->submaps=oggpack_read(opb,4)+1;
 155.115 +    if(info->submaps<=0)goto err_out;
 155.116 +  }else
 155.117 +    info->submaps=1;
 155.118 +
 155.119 +  b=oggpack_read(opb,1);
 155.120 +  if(b<0)goto err_out;
 155.121 +  if(b){
 155.122 +    info->coupling_steps=oggpack_read(opb,8)+1;
 155.123 +    if(info->coupling_steps<=0)goto err_out;
 155.124 +    for(i=0;i<info->coupling_steps;i++){
 155.125 +      int testM=info->coupling_mag[i]=oggpack_read(opb,ilog(vi->channels));
 155.126 +      int testA=info->coupling_ang[i]=oggpack_read(opb,ilog(vi->channels));
 155.127 +
 155.128 +      if(testM<0 ||
 155.129 +         testA<0 ||
 155.130 +         testM==testA ||
 155.131 +         testM>=vi->channels ||
 155.132 +         testA>=vi->channels) goto err_out;
 155.133 +    }
 155.134 +
 155.135 +  }
 155.136 +
 155.137 +  if(oggpack_read(opb,2)!=0)goto err_out; /* 2,3:reserved */
 155.138 +
 155.139 +  if(info->submaps>1){
 155.140 +    for(i=0;i<vi->channels;i++){
 155.141 +      info->chmuxlist[i]=oggpack_read(opb,4);
 155.142 +      if(info->chmuxlist[i]>=info->submaps || info->chmuxlist[i]<0)goto err_out;
 155.143 +    }
 155.144 +  }
 155.145 +  for(i=0;i<info->submaps;i++){
 155.146 +    oggpack_read(opb,8); /* time submap unused */
 155.147 +    info->floorsubmap[i]=oggpack_read(opb,8);
 155.148 +    if(info->floorsubmap[i]>=ci->floors || info->floorsubmap[i]<0)goto err_out;
 155.149 +    info->residuesubmap[i]=oggpack_read(opb,8);
 155.150 +    if(info->residuesubmap[i]>=ci->residues || info->residuesubmap[i]<0)goto err_out;
 155.151 +  }
 155.152 +
 155.153 +  return info;
 155.154 +
 155.155 + err_out:
 155.156 +  mapping0_free_info(info);
 155.157 +  return(NULL);
 155.158 +}
 155.159 +
 155.160 +#include "os.h"
 155.161 +#include "lpc.h"
 155.162 +#include "lsp.h"
 155.163 +#include "envelope.h"
 155.164 +#include "mdct.h"
 155.165 +#include "psy.h"
 155.166 +#include "scales.h"
 155.167 +
 155.168 +#if 0
 155.169 +static long seq=0;
 155.170 +static ogg_int64_t total=0;
 155.171 +static float FLOOR1_fromdB_LOOKUP[256]={
 155.172 +  1.0649863e-07F, 1.1341951e-07F, 1.2079015e-07F, 1.2863978e-07F,
 155.173 +  1.3699951e-07F, 1.4590251e-07F, 1.5538408e-07F, 1.6548181e-07F,
 155.174 +  1.7623575e-07F, 1.8768855e-07F, 1.9988561e-07F, 2.128753e-07F,
 155.175 +  2.2670913e-07F, 2.4144197e-07F, 2.5713223e-07F, 2.7384213e-07F,
 155.176 +  2.9163793e-07F, 3.1059021e-07F, 3.3077411e-07F, 3.5226968e-07F,
 155.177 +  3.7516214e-07F, 3.9954229e-07F, 4.2550680e-07F, 4.5315863e-07F,
 155.178 +  4.8260743e-07F, 5.1396998e-07F, 5.4737065e-07F, 5.8294187e-07F,
 155.179 +  6.2082472e-07F, 6.6116941e-07F, 7.0413592e-07F, 7.4989464e-07F,
 155.180 +  7.9862701e-07F, 8.5052630e-07F, 9.0579828e-07F, 9.6466216e-07F,
 155.181 +  1.0273513e-06F, 1.0941144e-06F, 1.1652161e-06F, 1.2409384e-06F,
 155.182 +  1.3215816e-06F, 1.4074654e-06F, 1.4989305e-06F, 1.5963394e-06F,
 155.183 +  1.7000785e-06F, 1.8105592e-06F, 1.9282195e-06F, 2.0535261e-06F,
 155.184 +  2.1869758e-06F, 2.3290978e-06F, 2.4804557e-06F, 2.6416497e-06F,
 155.185 +  2.8133190e-06F, 2.9961443e-06F, 3.1908506e-06F, 3.3982101e-06F,
 155.186 +  3.6190449e-06F, 3.8542308e-06F, 4.1047004e-06F, 4.3714470e-06F,
 155.187 +  4.6555282e-06F, 4.9580707e-06F, 5.2802740e-06F, 5.6234160e-06F,
 155.188 +  5.9888572e-06F, 6.3780469e-06F, 6.7925283e-06F, 7.2339451e-06F,
 155.189 +  7.7040476e-06F, 8.2047000e-06F, 8.7378876e-06F, 9.3057248e-06F,
 155.190 +  9.9104632e-06F, 1.0554501e-05F, 1.1240392e-05F, 1.1970856e-05F,
 155.191 +  1.2748789e-05F, 1.3577278e-05F, 1.4459606e-05F, 1.5399272e-05F,
 155.192 +  1.6400004e-05F, 1.7465768e-05F, 1.8600792e-05F, 1.9809576e-05F,
 155.193 +  2.1096914e-05F, 2.2467911e-05F, 2.3928002e-05F, 2.5482978e-05F,
 155.194 +  2.7139006e-05F, 2.8902651e-05F, 3.0780908e-05F, 3.2781225e-05F,
 155.195 +  3.4911534e-05F, 3.7180282e-05F, 3.9596466e-05F, 4.2169667e-05F,
 155.196 +  4.4910090e-05F, 4.7828601e-05F, 5.0936773e-05F, 5.4246931e-05F,
 155.197 +  5.7772202e-05F, 6.1526565e-05F, 6.5524908e-05F, 6.9783085e-05F,
 155.198 +  7.4317983e-05F, 7.9147585e-05F, 8.4291040e-05F, 8.9768747e-05F,
 155.199 +  9.5602426e-05F, 0.00010181521F, 0.00010843174F, 0.00011547824F,
 155.200 +  0.00012298267F, 0.00013097477F, 0.00013948625F, 0.00014855085F,
 155.201 +  0.00015820453F, 0.00016848555F, 0.00017943469F, 0.00019109536F,
 155.202 +  0.00020351382F, 0.00021673929F, 0.00023082423F, 0.00024582449F,
 155.203 +  0.00026179955F, 0.00027881276F, 0.00029693158F, 0.00031622787F,
 155.204 +  0.00033677814F, 0.00035866388F, 0.00038197188F, 0.00040679456F,
 155.205 +  0.00043323036F, 0.00046138411F, 0.00049136745F, 0.00052329927F,
 155.206 +  0.00055730621F, 0.00059352311F, 0.00063209358F, 0.00067317058F,
 155.207 +  0.00071691700F, 0.00076350630F, 0.00081312324F, 0.00086596457F,
 155.208 +  0.00092223983F, 0.00098217216F, 0.0010459992F, 0.0011139742F,
 155.209 +  0.0011863665F, 0.0012634633F, 0.0013455702F, 0.0014330129F,
 155.210 +  0.0015261382F, 0.0016253153F, 0.0017309374F, 0.0018434235F,
 155.211 +  0.0019632195F, 0.0020908006F, 0.0022266726F, 0.0023713743F,
 155.212 +  0.0025254795F, 0.0026895994F, 0.0028643847F, 0.0030505286F,
 155.213 +  0.0032487691F, 0.0034598925F, 0.0036847358F, 0.0039241906F,
 155.214 +  0.0041792066F, 0.0044507950F, 0.0047400328F, 0.0050480668F,
 155.215 +  0.0053761186F, 0.0057254891F, 0.0060975636F, 0.0064938176F,
 155.216 +  0.0069158225F, 0.0073652516F, 0.0078438871F, 0.0083536271F,
 155.217 +  0.0088964928F, 0.009474637F, 0.010090352F, 0.010746080F,
 155.218 +  0.011444421F, 0.012188144F, 0.012980198F, 0.013823725F,
 155.219 +  0.014722068F, 0.015678791F, 0.016697687F, 0.017782797F,
 155.220 +  0.018938423F, 0.020169149F, 0.021479854F, 0.022875735F,
 155.221 +  0.024362330F, 0.025945531F, 0.027631618F, 0.029427276F,
 155.222 +  0.031339626F, 0.033376252F, 0.035545228F, 0.037855157F,
 155.223 +  0.040315199F, 0.042935108F, 0.045725273F, 0.048696758F,
 155.224 +  0.051861348F, 0.055231591F, 0.058820850F, 0.062643361F,
 155.225 +  0.066714279F, 0.071049749F, 0.075666962F, 0.080584227F,
 155.226 +  0.085821044F, 0.091398179F, 0.097337747F, 0.10366330F,
 155.227 +  0.11039993F, 0.11757434F, 0.12521498F, 0.13335215F,
 155.228 +  0.14201813F, 0.15124727F, 0.16107617F, 0.17154380F,
 155.229 +  0.18269168F, 0.19456402F, 0.20720788F, 0.22067342F,
 155.230 +  0.23501402F, 0.25028656F, 0.26655159F, 0.28387361F,
 155.231 +  0.30232132F, 0.32196786F, 0.34289114F, 0.36517414F,
 155.232 +  0.38890521F, 0.41417847F, 0.44109412F, 0.46975890F,
 155.233 +  0.50028648F, 0.53279791F, 0.56742212F, 0.60429640F,
 155.234 +  0.64356699F, 0.68538959F, 0.72993007F, 0.77736504F,
 155.235 +  0.82788260F, 0.88168307F, 0.9389798F, 1.F,
 155.236 +};
 155.237 +
 155.238 +#endif
 155.239 +
 155.240 +
 155.241 +static int mapping0_forward(vorbis_block *vb){
 155.242 +  vorbis_dsp_state      *vd=vb->vd;
 155.243 +  vorbis_info           *vi=vd->vi;
 155.244 +  codec_setup_info      *ci=vi->codec_setup;
 155.245 +  private_state         *b=vb->vd->backend_state;
 155.246 +  vorbis_block_internal *vbi=(vorbis_block_internal *)vb->internal;
 155.247 +  int                    n=vb->pcmend;
 155.248 +  int i,j,k;
 155.249 +
 155.250 +  int    *nonzero    = alloca(sizeof(*nonzero)*vi->channels);
 155.251 +  float  **gmdct     = _vorbis_block_alloc(vb,vi->channels*sizeof(*gmdct));
 155.252 +  int    **iwork      = _vorbis_block_alloc(vb,vi->channels*sizeof(*iwork));
 155.253 +  int ***floor_posts = _vorbis_block_alloc(vb,vi->channels*sizeof(*floor_posts));
 155.254 +
 155.255 +  float global_ampmax=vbi->ampmax;
 155.256 +  float *local_ampmax=alloca(sizeof(*local_ampmax)*vi->channels);
 155.257 +  int blocktype=vbi->blocktype;
 155.258 +
 155.259 +  int modenumber=vb->W;
 155.260 +  vorbis_info_mapping0 *info=ci->map_param[modenumber];
 155.261 +  vorbis_look_psy *psy_look=b->psy+blocktype+(vb->W?2:0);
 155.262 +
 155.263 +  vb->mode=modenumber;
 155.264 +
 155.265 +  for(i=0;i<vi->channels;i++){
 155.266 +    float scale=4.f/n;
 155.267 +    float scale_dB;
 155.268 +
 155.269 +    float *pcm     =vb->pcm[i];
 155.270 +    float *logfft  =pcm;
 155.271 +
 155.272 +    iwork[i]=_vorbis_block_alloc(vb,n/2*sizeof(**iwork));
 155.273 +    gmdct[i]=_vorbis_block_alloc(vb,n/2*sizeof(**gmdct));
 155.274 +
 155.275 +    scale_dB=todB(&scale) + .345; /* + .345 is a hack; the original
 155.276 +                                     todB estimation used on IEEE 754
 155.277 +                                     compliant machines had a bug that
 155.278 +                                     returned dB values about a third
 155.279 +                                     of a decibel too high.  The bug
 155.280 +                                     was harmless because tunings
 155.281 +                                     implicitly took that into
 155.282 +                                     account.  However, fixing the bug
 155.283 +                                     in the estimator requires
 155.284 +                                     changing all the tunings as well.
 155.285 +                                     For now, it's easier to sync
 155.286 +                                     things back up here, and
 155.287 +                                     recalibrate the tunings in the
 155.288 +                                     next major model upgrade. */
 155.289 +
 155.290 +#if 0
 155.291 +    if(vi->channels==2){
 155.292 +      if(i==0)
 155.293 +        _analysis_output("pcmL",seq,pcm,n,0,0,total-n/2);
 155.294 +      else
 155.295 +        _analysis_output("pcmR",seq,pcm,n,0,0,total-n/2);
 155.296 +    }else{
 155.297 +      _analysis_output("pcm",seq,pcm,n,0,0,total-n/2);
 155.298 +    }
 155.299 +#endif
 155.300 +
 155.301 +    /* window the PCM data */
 155.302 +    _vorbis_apply_window(pcm,b->window,ci->blocksizes,vb->lW,vb->W,vb->nW);
 155.303 +
 155.304 +#if 0
 155.305 +    if(vi->channels==2){
 155.306 +      if(i==0)
 155.307 +        _analysis_output("windowedL",seq,pcm,n,0,0,total-n/2);
 155.308 +      else
 155.309 +        _analysis_output("windowedR",seq,pcm,n,0,0,total-n/2);
 155.310 +    }else{
 155.311 +      _analysis_output("windowed",seq,pcm,n,0,0,total-n/2);
 155.312 +    }
 155.313 +#endif
 155.314 +
 155.315 +    /* transform the PCM data */
 155.316 +    /* only MDCT right now.... */
 155.317 +    mdct_forward(b->transform[vb->W][0],pcm,gmdct[i]);
 155.318 +
 155.319 +    /* FFT yields more accurate tonal estimation (not phase sensitive) */
 155.320 +    drft_forward(&b->fft_look[vb->W],pcm);
 155.321 +    logfft[0]=scale_dB+todB(pcm)  + .345; /* + .345 is a hack; the
 155.322 +                                     original todB estimation used on
 155.323 +                                     IEEE 754 compliant machines had a
 155.324 +                                     bug that returned dB values about
 155.325 +                                     a third of a decibel too high.
 155.326 +                                     The bug was harmless because
 155.327 +                                     tunings implicitly took that into
 155.328 +                                     account.  However, fixing the bug
 155.329 +                                     in the estimator requires
 155.330 +                                     changing all the tunings as well.
 155.331 +                                     For now, it's easier to sync
 155.332 +                                     things back up here, and
 155.333 +                                     recalibrate the tunings in the
 155.334 +                                     next major model upgrade. */
 155.335 +    local_ampmax[i]=logfft[0];
 155.336 +    for(j=1;j<n-1;j+=2){
 155.337 +      float temp=pcm[j]*pcm[j]+pcm[j+1]*pcm[j+1];
 155.338 +      temp=logfft[(j+1)>>1]=scale_dB+.5f*todB(&temp)  + .345; /* +
 155.339 +                                     .345 is a hack; the original todB
 155.340 +                                     estimation used on IEEE 754
 155.341 +                                     compliant machines had a bug that
 155.342 +                                     returned dB values about a third
 155.343 +                                     of a decibel too high.  The bug
 155.344 +                                     was harmless because tunings
 155.345 +                                     implicitly took that into
 155.346 +                                     account.  However, fixing the bug
 155.347 +                                     in the estimator requires
 155.348 +                                     changing all the tunings as well.
 155.349 +                                     For now, it's easier to sync
 155.350 +                                     things back up here, and
 155.351 +                                     recalibrate the tunings in the
 155.352 +                                     next major model upgrade. */
 155.353 +      if(temp>local_ampmax[i])local_ampmax[i]=temp;
 155.354 +    }
 155.355 +
 155.356 +    if(local_ampmax[i]>0.f)local_ampmax[i]=0.f;
 155.357 +    if(local_ampmax[i]>global_ampmax)global_ampmax=local_ampmax[i];
 155.358 +
 155.359 +#if 0
 155.360 +    if(vi->channels==2){
 155.361 +      if(i==0){
 155.362 +        _analysis_output("fftL",seq,logfft,n/2,1,0,0);
 155.363 +      }else{
 155.364 +        _analysis_output("fftR",seq,logfft,n/2,1,0,0);
 155.365 +      }
 155.366 +    }else{
 155.367 +      _analysis_output("fft",seq,logfft,n/2,1,0,0);
 155.368 +    }
 155.369 +#endif
 155.370 +
 155.371 +  }
 155.372 +
 155.373 +  {
 155.374 +    float   *noise        = _vorbis_block_alloc(vb,n/2*sizeof(*noise));
 155.375 +    float   *tone         = _vorbis_block_alloc(vb,n/2*sizeof(*tone));
 155.376 +
 155.377 +    for(i=0;i<vi->channels;i++){
 155.378 +      /* the encoder setup assumes that all the modes used by any
 155.379 +         specific bitrate tweaking use the same floor */
 155.380 +
 155.381 +      int submap=info->chmuxlist[i];
 155.382 +
 155.383 +      /* the following makes things clearer to *me* anyway */
 155.384 +      float *mdct    =gmdct[i];
 155.385 +      float *logfft  =vb->pcm[i];
 155.386 +
 155.387 +      float *logmdct =logfft+n/2;
 155.388 +      float *logmask =logfft;
 155.389 +
 155.390 +      vb->mode=modenumber;
 155.391 +
 155.392 +      floor_posts[i]=_vorbis_block_alloc(vb,PACKETBLOBS*sizeof(**floor_posts));
 155.393 +      memset(floor_posts[i],0,sizeof(**floor_posts)*PACKETBLOBS);
 155.394 +
 155.395 +      for(j=0;j<n/2;j++)
 155.396 +        logmdct[j]=todB(mdct+j)  + .345; /* + .345 is a hack; the original
 155.397 +                                     todB estimation used on IEEE 754
 155.398 +                                     compliant machines had a bug that
 155.399 +                                     returned dB values about a third
 155.400 +                                     of a decibel too high.  The bug
 155.401 +                                     was harmless because tunings
 155.402 +                                     implicitly took that into
 155.403 +                                     account.  However, fixing the bug
 155.404 +                                     in the estimator requires
 155.405 +                                     changing all the tunings as well.
 155.406 +                                     For now, it's easier to sync
 155.407 +                                     things back up here, and
 155.408 +                                     recalibrate the tunings in the
 155.409 +                                     next major model upgrade. */
 155.410 +
 155.411 +#if 0
 155.412 +      if(vi->channels==2){
 155.413 +        if(i==0)
 155.414 +          _analysis_output("mdctL",seq,logmdct,n/2,1,0,0);
 155.415 +        else
 155.416 +          _analysis_output("mdctR",seq,logmdct,n/2,1,0,0);
 155.417 +      }else{
 155.418 +        _analysis_output("mdct",seq,logmdct,n/2,1,0,0);
 155.419 +      }
 155.420 +#endif
 155.421 +
 155.422 +      /* first step; noise masking.  Not only does 'noise masking'
 155.423 +         give us curves from which we can decide how much resolution
 155.424 +         to give noise parts of the spectrum, it also implicitly hands
 155.425 +         us a tonality estimate (the larger the value in the
 155.426 +         'noise_depth' vector, the more tonal that area is) */
 155.427 +
 155.428 +      _vp_noisemask(psy_look,
 155.429 +                    logmdct,
 155.430 +                    noise); /* noise does not have by-frequency offset
 155.431 +                               bias applied yet */
 155.432 +#if 0
 155.433 +      if(vi->channels==2){
 155.434 +        if(i==0)
 155.435 +          _analysis_output("noiseL",seq,noise,n/2,1,0,0);
 155.436 +        else
 155.437 +          _analysis_output("noiseR",seq,noise,n/2,1,0,0);
 155.438 +      }else{
 155.439 +        _analysis_output("noise",seq,noise,n/2,1,0,0);
 155.440 +      }
 155.441 +#endif
 155.442 +
 155.443 +      /* second step: 'all the other crap'; all the stuff that isn't
 155.444 +         computed/fit for bitrate management goes in the second psy
 155.445 +         vector.  This includes tone masking, peak limiting and ATH */
 155.446 +
 155.447 +      _vp_tonemask(psy_look,
 155.448 +                   logfft,
 155.449 +                   tone,
 155.450 +                   global_ampmax,
 155.451 +                   local_ampmax[i]);
 155.452 +
 155.453 +#if 0
 155.454 +      if(vi->channels==2){
 155.455 +        if(i==0)
 155.456 +          _analysis_output("toneL",seq,tone,n/2,1,0,0);
 155.457 +        else
 155.458 +          _analysis_output("toneR",seq,tone,n/2,1,0,0);
 155.459 +      }else{
 155.460 +        _analysis_output("tone",seq,tone,n/2,1,0,0);
 155.461 +      }
 155.462 +#endif
 155.463 +
 155.464 +      /* third step; we offset the noise vectors, overlay tone
 155.465 +         masking.  We then do a floor1-specific line fit.  If we're
 155.466 +         performing bitrate management, the line fit is performed
 155.467 +         multiple times for up/down tweakage on demand. */
 155.468 +
 155.469 +#if 0
 155.470 +      {
 155.471 +      float aotuv[psy_look->n];
 155.472 +#endif
 155.473 +
 155.474 +        _vp_offset_and_mix(psy_look,
 155.475 +                           noise,
 155.476 +                           tone,
 155.477 +                           1,
 155.478 +                           logmask,
 155.479 +                           mdct,
 155.480 +                           logmdct);
 155.481 +
 155.482 +#if 0
 155.483 +        if(vi->channels==2){
 155.484 +          if(i==0)
 155.485 +            _analysis_output("aotuvM1_L",seq,aotuv,psy_look->n,1,1,0);
 155.486 +          else
 155.487 +            _analysis_output("aotuvM1_R",seq,aotuv,psy_look->n,1,1,0);
 155.488 +        }else{
 155.489 +          _analysis_output("aotuvM1",seq,aotuv,psy_look->n,1,1,0);
 155.490 +        }
 155.491 +      }
 155.492 +#endif
 155.493 +
 155.494 +
 155.495 +#if 0
 155.496 +      if(vi->channels==2){
 155.497 +        if(i==0)
 155.498 +          _analysis_output("mask1L",seq,logmask,n/2,1,0,0);
 155.499 +        else
 155.500 +          _analysis_output("mask1R",seq,logmask,n/2,1,0,0);
 155.501 +      }else{
 155.502 +        _analysis_output("mask1",seq,logmask,n/2,1,0,0);
 155.503 +      }
 155.504 +#endif
 155.505 +
 155.506 +      /* this algorithm is hardwired to floor 1 for now; abort out if
 155.507 +         we're *not* floor1.  This won't happen unless someone has
 155.508 +         broken the encode setup lib.  Guard it anyway. */
 155.509 +      if(ci->floor_type[info->floorsubmap[submap]]!=1)return(-1);
 155.510 +
 155.511 +      floor_posts[i][PACKETBLOBS/2]=
 155.512 +        floor1_fit(vb,b->flr[info->floorsubmap[submap]],
 155.513 +                   logmdct,
 155.514 +                   logmask);
 155.515 +
 155.516 +      /* are we managing bitrate?  If so, perform two more fits for
 155.517 +         later rate tweaking (fits represent hi/lo) */
 155.518 +      if(vorbis_bitrate_managed(vb) && floor_posts[i][PACKETBLOBS/2]){
 155.519 +        /* higher rate by way of lower noise curve */
 155.520 +
 155.521 +        _vp_offset_and_mix(psy_look,
 155.522 +                           noise,
 155.523 +                           tone,
 155.524 +                           2,
 155.525 +                           logmask,
 155.526 +                           mdct,
 155.527 +                           logmdct);
 155.528 +
 155.529 +#if 0
 155.530 +        if(vi->channels==2){
 155.531 +          if(i==0)
 155.532 +            _analysis_output("mask2L",seq,logmask,n/2,1,0,0);
 155.533 +          else
 155.534 +            _analysis_output("mask2R",seq,logmask,n/2,1,0,0);
 155.535 +        }else{
 155.536 +          _analysis_output("mask2",seq,logmask,n/2,1,0,0);
 155.537 +        }
 155.538 +#endif
 155.539 +
 155.540 +        floor_posts[i][PACKETBLOBS-1]=
 155.541 +          floor1_fit(vb,b->flr[info->floorsubmap[submap]],
 155.542 +                     logmdct,
 155.543 +                     logmask);
 155.544 +
 155.545 +        /* lower rate by way of higher noise curve */
 155.546 +        _vp_offset_and_mix(psy_look,
 155.547 +                           noise,
 155.548 +                           tone,
 155.549 +                           0,
 155.550 +                           logmask,
 155.551 +                           mdct,
 155.552 +                           logmdct);
 155.553 +
 155.554 +#if 0
 155.555 +        if(vi->channels==2){
 155.556 +          if(i==0)
 155.557 +            _analysis_output("mask0L",seq,logmask,n/2,1,0,0);
 155.558 +          else
 155.559 +            _analysis_output("mask0R",seq,logmask,n/2,1,0,0);
 155.560 +        }else{
 155.561 +          _analysis_output("mask0",seq,logmask,n/2,1,0,0);
 155.562 +        }
 155.563 +#endif
 155.564 +
 155.565 +        floor_posts[i][0]=
 155.566 +          floor1_fit(vb,b->flr[info->floorsubmap[submap]],
 155.567 +                     logmdct,
 155.568 +                     logmask);
 155.569 +
 155.570 +        /* we also interpolate a range of intermediate curves for
 155.571 +           intermediate rates */
 155.572 +        for(k=1;k<PACKETBLOBS/2;k++)
 155.573 +          floor_posts[i][k]=
 155.574 +            floor1_interpolate_fit(vb,b->flr[info->floorsubmap[submap]],
 155.575 +                                   floor_posts[i][0],
 155.576 +                                   floor_posts[i][PACKETBLOBS/2],
 155.577 +                                   k*65536/(PACKETBLOBS/2));
 155.578 +        for(k=PACKETBLOBS/2+1;k<PACKETBLOBS-1;k++)
 155.579 +          floor_posts[i][k]=
 155.580 +            floor1_interpolate_fit(vb,b->flr[info->floorsubmap[submap]],
 155.581 +                                   floor_posts[i][PACKETBLOBS/2],
 155.582 +                                   floor_posts[i][PACKETBLOBS-1],
 155.583 +                                   (k-PACKETBLOBS/2)*65536/(PACKETBLOBS/2));
 155.584 +      }
 155.585 +    }
 155.586 +  }
 155.587 +  vbi->ampmax=global_ampmax;
 155.588 +
 155.589 +  /*
 155.590 +    the next phases are performed once for vbr-only and PACKETBLOB
 155.591 +    times for bitrate managed modes.
 155.592 +
 155.593 +    1) encode actual mode being used
 155.594 +    2) encode the floor for each channel, compute coded mask curve/res
 155.595 +    3) normalize and couple.
 155.596 +    4) encode residue
 155.597 +    5) save packet bytes to the packetblob vector
 155.598 +
 155.599 +  */
 155.600 +
 155.601 +  /* iterate over the many masking curve fits we've created */
 155.602 +
 155.603 +  {
 155.604 +    int **couple_bundle=alloca(sizeof(*couple_bundle)*vi->channels);
 155.605 +    int *zerobundle=alloca(sizeof(*zerobundle)*vi->channels);
 155.606 +
 155.607 +    for(k=(vorbis_bitrate_managed(vb)?0:PACKETBLOBS/2);
 155.608 +        k<=(vorbis_bitrate_managed(vb)?PACKETBLOBS-1:PACKETBLOBS/2);
 155.609 +        k++){
 155.610 +      oggpack_buffer *opb=vbi->packetblob[k];
 155.611 +
 155.612 +      /* start out our new packet blob with packet type and mode */
 155.613 +      /* Encode the packet type */
 155.614 +      oggpack_write(opb,0,1);
 155.615 +      /* Encode the modenumber */
 155.616 +      /* Encode frame mode, pre,post windowsize, then dispatch */
 155.617 +      oggpack_write(opb,modenumber,b->modebits);
 155.618 +      if(vb->W){
 155.619 +        oggpack_write(opb,vb->lW,1);
 155.620 +        oggpack_write(opb,vb->nW,1);
 155.621 +      }
 155.622 +
 155.623 +      /* encode floor, compute masking curve, sep out residue */
 155.624 +      for(i=0;i<vi->channels;i++){
 155.625 +        int submap=info->chmuxlist[i];
 155.626 +        int *ilogmask=iwork[i];
 155.627 +
 155.628 +        nonzero[i]=floor1_encode(opb,vb,b->flr[info->floorsubmap[submap]],
 155.629 +                                 floor_posts[i][k],
 155.630 +                                 ilogmask);
 155.631 +#if 0
 155.632 +        {
 155.633 +          char buf[80];
 155.634 +          sprintf(buf,"maskI%c%d",i?'R':'L',k);
 155.635 +          float work[n/2];
 155.636 +          for(j=0;j<n/2;j++)
 155.637 +            work[j]=FLOOR1_fromdB_LOOKUP[iwork[i][j]];
 155.638 +          _analysis_output(buf,seq,work,n/2,1,1,0);
 155.639 +        }
 155.640 +#endif
 155.641 +      }
 155.642 +
 155.643 +      /* our iteration is now based on masking curve, not prequant and
 155.644 +         coupling.  Only one prequant/coupling step */
 155.645 +
 155.646 +      /* quantize/couple */
 155.647 +      /* incomplete implementation that assumes the tree is all depth
 155.648 +         one, or no tree at all */
 155.649 +      _vp_couple_quantize_normalize(k,
 155.650 +                                    &ci->psy_g_param,
 155.651 +                                    psy_look,
 155.652 +                                    info,
 155.653 +                                    gmdct,
 155.654 +                                    iwork,
 155.655 +                                    nonzero,
 155.656 +                                    ci->psy_g_param.sliding_lowpass[vb->W][k],
 155.657 +                                    vi->channels);
 155.658 +
 155.659 +#if 0
 155.660 +      for(i=0;i<vi->channels;i++){
 155.661 +        char buf[80];
 155.662 +        sprintf(buf,"res%c%d",i?'R':'L',k);
 155.663 +        float work[n/2];
 155.664 +        for(j=0;j<n/2;j++)
 155.665 +          work[j]=iwork[i][j];
 155.666 +        _analysis_output(buf,seq,work,n/2,1,0,0);
 155.667 +      }
 155.668 +#endif
 155.669 +
 155.670 +      /* classify and encode by submap */
 155.671 +      for(i=0;i<info->submaps;i++){
 155.672 +        int ch_in_bundle=0;
 155.673 +        long **classifications;
 155.674 +        int resnum=info->residuesubmap[i];
 155.675 +
 155.676 +        for(j=0;j<vi->channels;j++){
 155.677 +          if(info->chmuxlist[j]==i){
 155.678 +            zerobundle[ch_in_bundle]=0;
 155.679 +            if(nonzero[j])zerobundle[ch_in_bundle]=1;
 155.680 +            couple_bundle[ch_in_bundle++]=iwork[j];
 155.681 +          }
 155.682 +        }
 155.683 +
 155.684 +        classifications=_residue_P[ci->residue_type[resnum]]->
 155.685 +          class(vb,b->residue[resnum],couple_bundle,zerobundle,ch_in_bundle);
 155.686 +
 155.687 +        ch_in_bundle=0;
 155.688 +        for(j=0;j<vi->channels;j++)
 155.689 +          if(info->chmuxlist[j]==i)
 155.690 +            couple_bundle[ch_in_bundle++]=iwork[j];
 155.691 +
 155.692 +        _residue_P[ci->residue_type[resnum]]->
 155.693 +          forward(opb,vb,b->residue[resnum],
 155.694 +                  couple_bundle,zerobundle,ch_in_bundle,classifications,i);
 155.695 +      }
 155.696 +
 155.697 +      /* ok, done encoding.  Next protopacket. */
 155.698 +    }
 155.699 +
 155.700 +  }
 155.701 +
 155.702 +#if 0
 155.703 +  seq++;
 155.704 +  total+=ci->blocksizes[vb->W]/4+ci->blocksizes[vb->nW]/4;
 155.705 +#endif
 155.706 +  return(0);
 155.707 +}
 155.708 +
 155.709 +static int mapping0_inverse(vorbis_block *vb,vorbis_info_mapping *l){
 155.710 +  vorbis_dsp_state     *vd=vb->vd;
 155.711 +  vorbis_info          *vi=vd->vi;
 155.712 +  codec_setup_info     *ci=vi->codec_setup;
 155.713 +  private_state        *b=vd->backend_state;
 155.714 +  vorbis_info_mapping0 *info=(vorbis_info_mapping0 *)l;
 155.715 +
 155.716 +  int                   i,j;
 155.717 +  long                  n=vb->pcmend=ci->blocksizes[vb->W];
 155.718 +
 155.719 +  float **pcmbundle=alloca(sizeof(*pcmbundle)*vi->channels);
 155.720 +  int    *zerobundle=alloca(sizeof(*zerobundle)*vi->channels);
 155.721 +
 155.722 +  int   *nonzero  =alloca(sizeof(*nonzero)*vi->channels);
 155.723 +  void **floormemo=alloca(sizeof(*floormemo)*vi->channels);
 155.724 +
 155.725 +  /* recover the spectral envelope; store it in the PCM vector for now */
 155.726 +  for(i=0;i<vi->channels;i++){
 155.727 +    int submap=info->chmuxlist[i];
 155.728 +    floormemo[i]=_floor_P[ci->floor_type[info->floorsubmap[submap]]]->
 155.729 +      inverse1(vb,b->flr[info->floorsubmap[submap]]);
 155.730 +    if(floormemo[i])
 155.731 +      nonzero[i]=1;
 155.732 +    else
 155.733 +      nonzero[i]=0;
 155.734 +    memset(vb->pcm[i],0,sizeof(*vb->pcm[i])*n/2);
 155.735 +  }
 155.736 +
 155.737 +  /* channel coupling can 'dirty' the nonzero listing */
 155.738 +  for(i=0;i<info->coupling_steps;i++){
 155.739 +    if(nonzero[info->coupling_mag[i]] ||
 155.740 +       nonzero[info->coupling_ang[i]]){
 155.741 +      nonzero[info->coupling_mag[i]]=1;
 155.742 +      nonzero[info->coupling_ang[i]]=1;
 155.743 +    }
 155.744 +  }
 155.745 +
 155.746 +  /* recover the residue into our working vectors */
 155.747 +  for(i=0;i<info->submaps;i++){
 155.748 +    int ch_in_bundle=0;
 155.749 +    for(j=0;j<vi->channels;j++){
 155.750 +      if(info->chmuxlist[j]==i){
 155.751 +        if(nonzero[j])
 155.752 +          zerobundle[ch_in_bundle]=1;
 155.753 +        else
 155.754 +          zerobundle[ch_in_bundle]=0;
 155.755 +        pcmbundle[ch_in_bundle++]=vb->pcm[j];
 155.756 +      }
 155.757 +    }
 155.758 +
 155.759 +    _residue_P[ci->residue_type[info->residuesubmap[i]]]->
 155.760 +      inverse(vb,b->residue[info->residuesubmap[i]],
 155.761 +              pcmbundle,zerobundle,ch_in_bundle);
 155.762 +  }
 155.763 +
 155.764 +  /* channel coupling */
 155.765 +  for(i=info->coupling_steps-1;i>=0;i--){
 155.766 +    float *pcmM=vb->pcm[info->coupling_mag[i]];
 155.767 +    float *pcmA=vb->pcm[info->coupling_ang[i]];
 155.768 +
 155.769 +    for(j=0;j<n/2;j++){
 155.770 +      float mag=pcmM[j];
 155.771 +      float ang=pcmA[j];
 155.772 +
 155.773 +      if(mag>0)
 155.774 +        if(ang>0){
 155.775 +          pcmM[j]=mag;
 155.776 +          pcmA[j]=mag-ang;
 155.777 +        }else{
 155.778 +          pcmA[j]=mag;
 155.779 +          pcmM[j]=mag+ang;
 155.780 +        }
 155.781 +      else
 155.782 +        if(ang>0){
 155.783 +          pcmM[j]=mag;
 155.784 +          pcmA[j]=mag+ang;
 155.785 +        }else{
 155.786 +          pcmA[j]=mag;
 155.787 +          pcmM[j]=mag-ang;
 155.788 +        }
 155.789 +    }
 155.790 +  }
 155.791 +
 155.792 +  /* compute and apply spectral envelope */
 155.793 +  for(i=0;i<vi->channels;i++){
 155.794 +    float *pcm=vb->pcm[i];
 155.795 +    int submap=info->chmuxlist[i];
 155.796 +    _floor_P[ci->floor_type[info->floorsubmap[submap]]]->
 155.797 +      inverse2(vb,b->flr[info->floorsubmap[submap]],
 155.798 +               floormemo[i],pcm);
 155.799 +  }
 155.800 +
 155.801 +  /* transform the PCM data; takes PCM vector, vb; modifies PCM vector */
 155.802 +  /* only MDCT right now.... */
 155.803 +  for(i=0;i<vi->channels;i++){
 155.804 +    float *pcm=vb->pcm[i];
 155.805 +    mdct_backward(b->transform[vb->W][0],pcm,pcm);
 155.806 +  }
 155.807 +
 155.808 +  /* all done! */
 155.809 +  return(0);
 155.810 +}
 155.811 +
 155.812 +/* export hooks */
 155.813 +const vorbis_func_mapping mapping0_exportbundle={
 155.814 +  &mapping0_pack,
 155.815 +  &mapping0_unpack,
 155.816 +  &mapping0_free_info,
 155.817 +  &mapping0_forward,
 155.818 +  &mapping0_inverse
 155.819 +};
   156.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   156.2 +++ b/libs/vorbis/masking.h	Sun Nov 01 00:36:56 2015 +0200
   156.3 @@ -0,0 +1,785 @@
   156.4 +/********************************************************************
   156.5 + *                                                                  *
   156.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   156.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   156.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   156.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  156.10 + *                                                                  *
  156.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
  156.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  156.13 + *                                                                  *
  156.14 + ********************************************************************
  156.15 +
  156.16 + function: masking curve data for psychoacoustics
  156.17 + last mod: $Id: masking.h 16227 2009-07-08 06:58:46Z xiphmont $
  156.18 +
  156.19 + ********************************************************************/
  156.20 +
  156.21 +#ifndef _V_MASKING_H_
  156.22 +#define _V_MASKING_H_
  156.23 +
  156.24 +/* more detailed ATH; the bass if flat to save stressing the floor
  156.25 +   overly for only a bin or two of savings. */
  156.26 +
  156.27 +#define MAX_ATH 88
  156.28 +static const float ATH[]={
  156.29 +  /*15*/  -51, -52, -53, -54, -55, -56, -57, -58,
  156.30 +  /*31*/  -59, -60, -61, -62, -63, -64, -65, -66,
  156.31 +  /*63*/  -67, -68, -69, -70, -71, -72, -73, -74,
  156.32 +  /*125*/ -75, -76, -77, -78, -80, -81, -82, -83,
  156.33 +  /*250*/ -84, -85, -86, -87, -88, -88, -89, -89,
  156.34 +  /*500*/ -90, -91, -91, -92, -93, -94, -95, -96,
  156.35 +  /*1k*/  -96, -97, -98, -98, -99, -99,-100,-100,
  156.36 +  /*2k*/ -101,-102,-103,-104,-106,-107,-107,-107,
  156.37 +  /*4k*/ -107,-105,-103,-102,-101, -99, -98, -96,
  156.38 +  /*8k*/  -95, -95, -96, -97, -96, -95, -93, -90,
  156.39 +  /*16k*/ -80, -70, -50, -40, -30, -30, -30, -30
  156.40 +};
  156.41 +
  156.42 +/* The tone masking curves from Ehmer's and Fielder's papers have been
  156.43 +   replaced by an empirically collected data set.  The previously
  156.44 +   published values were, far too often, simply on crack. */
  156.45 +
  156.46 +#define EHMER_OFFSET 16
  156.47 +#define EHMER_MAX 56
  156.48 +
  156.49 +/* masking tones from -50 to 0dB, 62.5 through 16kHz at half octaves
  156.50 +   test tones from -2 octaves to +5 octaves sampled at eighth octaves */
  156.51 +/* (Vorbis 0dB, the loudest possible tone, is assumed to be ~100dB SPL
  156.52 +   for collection of these curves) */
  156.53 +
  156.54 +static const float tonemasks[P_BANDS][6][EHMER_MAX]={
  156.55 +  /* 62.5 Hz */
  156.56 +  {{ -60,  -60,  -60,  -60,  -60,  -60,  -60,  -60,
  156.57 +     -60,  -60,  -60,  -60,  -62,  -62,  -65,  -73,
  156.58 +     -69,  -68,  -68,  -67,  -70,  -70,  -72,  -74,
  156.59 +     -75,  -79,  -79,  -80,  -83,  -88,  -93, -100,
  156.60 +     -110, -999, -999, -999, -999, -999, -999, -999,
  156.61 +     -999, -999, -999, -999, -999, -999, -999, -999,
  156.62 +     -999, -999, -999, -999, -999, -999, -999, -999},
  156.63 +   { -48,  -48,  -48,  -48,  -48,  -48,  -48,  -48,
  156.64 +     -48,  -48,  -48,  -48,  -48,  -53,  -61,  -66,
  156.65 +     -66,  -68,  -67,  -70,  -76,  -76,  -72,  -73,
  156.66 +     -75,  -76,  -78,  -79,  -83,  -88,  -93, -100,
  156.67 +     -110, -999, -999, -999, -999, -999, -999, -999,
  156.68 +     -999, -999, -999, -999, -999, -999, -999, -999,
  156.69 +     -999, -999, -999, -999, -999, -999, -999, -999},
  156.70 +   { -37,  -37,  -37,  -37,  -37,  -37,  -37,  -37,
  156.71 +     -38,  -40,  -42,  -46,  -48,  -53,  -55,  -62,
  156.72 +     -65,  -58,  -56,  -56,  -61,  -60,  -65,  -67,
  156.73 +     -69,  -71,  -77,  -77,  -78,  -80,  -82,  -84,
  156.74 +     -88,  -93,  -98, -106, -112, -999, -999, -999,
  156.75 +     -999, -999, -999, -999, -999, -999, -999, -999,
  156.76 +     -999, -999, -999, -999, -999, -999, -999, -999},
  156.77 +   { -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,
  156.78 +     -25,  -26,  -27,  -29,  -32,  -38,  -48,  -52,
  156.79 +     -52,  -50,  -48,  -48,  -51,  -52,  -54,  -60,
  156.80 +     -67,  -67,  -66,  -68,  -69,  -73,  -73,  -76,
  156.81 +     -80,  -81,  -81,  -85,  -85,  -86,  -88,  -93,
  156.82 +     -100, -110, -999, -999, -999, -999, -999, -999,
  156.83 +     -999, -999, -999, -999, -999, -999, -999, -999},
  156.84 +   { -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16,
  156.85 +     -17,  -19,  -20,  -22,  -26,  -28,  -31,  -40,
  156.86 +     -47,  -39,  -39,  -40,  -42,  -43,  -47,  -51,
  156.87 +     -57,  -52,  -55,  -55,  -60,  -58,  -62,  -63,
  156.88 +     -70,  -67,  -69,  -72,  -73,  -77,  -80,  -82,
  156.89 +     -83,  -87,  -90,  -94,  -98, -104, -115, -999,
  156.90 +     -999, -999, -999, -999, -999, -999, -999, -999},
  156.91 +   {  -8,   -8,   -8,   -8,   -8,   -8,   -8,   -8,
  156.92 +      -8,   -8,  -10,  -11,  -15,  -19,  -25,  -30,
  156.93 +      -34,  -31,  -30,  -31,  -29,  -32,  -35,  -42,
  156.94 +      -48,  -42,  -44,  -46,  -50,  -50,  -51,  -52,
  156.95 +      -59,  -54,  -55,  -55,  -58,  -62,  -63,  -66,
  156.96 +      -72,  -73,  -76,  -75,  -78,  -80,  -80,  -81,
  156.97 +      -84,  -88,  -90,  -94,  -98, -101, -106, -110}},
  156.98 +  /* 88Hz */
  156.99 +  {{ -66,  -66,  -66,  -66,  -66,  -66,  -66,  -66,
 156.100 +     -66,  -66,  -66,  -66,  -66,  -67,  -67,  -67,
 156.101 +     -76,  -72,  -71,  -74,  -76,  -76,  -75,  -78,
 156.102 +     -79,  -79,  -81,  -83,  -86,  -89,  -93,  -97,
 156.103 +     -100, -105, -110, -999, -999, -999, -999, -999,
 156.104 +     -999, -999, -999, -999, -999, -999, -999, -999,
 156.105 +     -999, -999, -999, -999, -999, -999, -999, -999},
 156.106 +   { -47,  -47,  -47,  -47,  -47,  -47,  -47,  -47,
 156.107 +     -47,  -47,  -47,  -48,  -51,  -55,  -59,  -66,
 156.108 +     -66,  -66,  -67,  -66,  -68,  -69,  -70,  -74,
 156.109 +     -79,  -77,  -77,  -78,  -80,  -81,  -82,  -84,
 156.110 +     -86,  -88,  -91,  -95, -100, -108, -116, -999,
 156.111 +     -999, -999, -999, -999, -999, -999, -999, -999,
 156.112 +     -999, -999, -999, -999, -999, -999, -999, -999},
 156.113 +   { -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,
 156.114 +     -36,  -37,  -37,  -41,  -44,  -48,  -51,  -58,
 156.115 +     -62,  -60,  -57,  -59,  -59,  -60,  -63,  -65,
 156.116 +     -72,  -71,  -70,  -72,  -74,  -77,  -76,  -78,
 156.117 +     -81,  -81,  -80,  -83,  -86,  -91,  -96, -100,
 156.118 +     -105, -110, -999, -999, -999, -999, -999, -999,
 156.119 +     -999, -999, -999, -999, -999, -999, -999, -999},
 156.120 +   { -28,  -28,  -28,  -28,  -28,  -28,  -28,  -28,
 156.121 +     -28,  -30,  -32,  -32,  -33,  -35,  -41,  -49,
 156.122 +     -50,  -49,  -47,  -48,  -48,  -52,  -51,  -57,
 156.123 +     -65,  -61,  -59,  -61,  -64,  -69,  -70,  -74,
 156.124 +     -77,  -77,  -78,  -81,  -84,  -85,  -87,  -90,
 156.125 +     -92,  -96, -100, -107, -112, -999, -999, -999,
 156.126 +     -999, -999, -999, -999, -999, -999, -999, -999},
 156.127 +   { -19,  -19,  -19,  -19,  -19,  -19,  -19,  -19,
 156.128 +     -20,  -21,  -23,  -27,  -30,  -35,  -36,  -41,
 156.129 +     -46,  -44,  -42,  -40,  -41,  -41,  -43,  -48,
 156.130 +     -55,  -53,  -52,  -53,  -56,  -59,  -58,  -60,
 156.131 +     -67,  -66,  -69,  -71,  -72,  -75,  -79,  -81,
 156.132 +     -84,  -87,  -90,  -93,  -97, -101, -107, -114,
 156.133 +     -999, -999, -999, -999, -999, -999, -999, -999},
 156.134 +   {  -9,   -9,   -9,   -9,   -9,   -9,   -9,   -9,
 156.135 +      -11,  -12,  -12,  -15,  -16,  -20,  -23,  -30,
 156.136 +      -37,  -34,  -33,  -34,  -31,  -32,  -32,  -38,
 156.137 +      -47,  -44,  -41,  -40,  -47,  -49,  -46,  -46,
 156.138 +      -58,  -50,  -50,  -54,  -58,  -62,  -64,  -67,
 156.139 +      -67,  -70,  -72,  -76,  -79,  -83,  -87,  -91,
 156.140 +      -96, -100, -104, -110, -999, -999, -999, -999}},
 156.141 +  /* 125 Hz */
 156.142 +  {{ -62,  -62,  -62,  -62,  -62,  -62,  -62,  -62,
 156.143 +     -62,  -62,  -63,  -64,  -66,  -67,  -66,  -68,
 156.144 +     -75,  -72,  -76,  -75,  -76,  -78,  -79,  -82,
 156.145 +     -84,  -85,  -90,  -94, -101, -110, -999, -999,
 156.146 +     -999, -999, -999, -999, -999, -999, -999, -999,
 156.147 +     -999, -999, -999, -999, -999, -999, -999, -999,
 156.148 +     -999, -999, -999, -999, -999, -999, -999, -999},
 156.149 +   { -59,  -59,  -59,  -59,  -59,  -59,  -59,  -59,
 156.150 +     -59,  -59,  -59,  -60,  -60,  -61,  -63,  -66,
 156.151 +     -71,  -68,  -70,  -70,  -71,  -72,  -72,  -75,
 156.152 +     -81,  -78,  -79,  -82,  -83,  -86,  -90,  -97,
 156.153 +     -103, -113, -999, -999, -999, -999, -999, -999,
 156.154 +     -999, -999, -999, -999, -999, -999, -999, -999,
 156.155 +     -999, -999, -999, -999, -999, -999, -999, -999},
 156.156 +   { -53,  -53,  -53,  -53,  -53,  -53,  -53,  -53,
 156.157 +     -53,  -54,  -55,  -57,  -56,  -57,  -55,  -61,
 156.158 +     -65,  -60,  -60,  -62,  -63,  -63,  -66,  -68,
 156.159 +     -74,  -73,  -75,  -75,  -78,  -80,  -80,  -82,
 156.160 +     -85,  -90,  -96, -101, -108, -999, -999, -999,
 156.161 +     -999, -999, -999, -999, -999, -999, -999, -999,
 156.162 +     -999, -999, -999, -999, -999, -999, -999, -999},
 156.163 +   { -46,  -46,  -46,  -46,  -46,  -46,  -46,  -46,
 156.164 +     -46,  -46,  -47,  -47,  -47,  -47,  -48,  -51,
 156.165 +     -57,  -51,  -49,  -50,  -51,  -53,  -54,  -59,
 156.166 +     -66,  -60,  -62,  -67,  -67,  -70,  -72,  -75,
 156.167 +     -76,  -78,  -81,  -85,  -88,  -94,  -97, -104,
 156.168 +     -112, -999, -999, -999, -999, -999, -999, -999,
 156.169 +     -999, -999, -999, -999, -999, -999, -999, -999},
 156.170 +   { -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,
 156.171 +     -39,  -41,  -42,  -42,  -39,  -38,  -41,  -43,
 156.172 +     -52,  -44,  -40,  -39,  -37,  -37,  -40,  -47,
 156.173 +     -54,  -50,  -48,  -50,  -55,  -61,  -59,  -62,
 156.174 +     -66,  -66,  -66,  -69,  -69,  -73,  -74,  -74,
 156.175 +     -75,  -77,  -79,  -82,  -87,  -91,  -95, -100,
 156.176 +     -108, -115, -999, -999, -999, -999, -999, -999},
 156.177 +   { -28,  -26,  -24,  -22,  -20,  -20,  -23,  -29,
 156.178 +     -30,  -31,  -28,  -27,  -28,  -28,  -28,  -35,
 156.179 +     -40,  -33,  -32,  -29,  -30,  -30,  -30,  -37,
 156.180 +     -45,  -41,  -37,  -38,  -45,  -47,  -47,  -48,
 156.181 +     -53,  -49,  -48,  -50,  -49,  -49,  -51,  -52,
 156.182 +     -58,  -56,  -57,  -56,  -60,  -61,  -62,  -70,
 156.183 +     -72,  -74,  -78,  -83,  -88,  -93, -100, -106}},
 156.184 +  /* 177 Hz */
 156.185 +  {{-999, -999, -999, -999, -999, -999, -999, -999,
 156.186 +    -999, -110, -105, -100,  -95,  -91,  -87,  -83,
 156.187 +    -80,  -78,  -76,  -78,  -78,  -81,  -83,  -85,
 156.188 +    -86,  -85,  -86,  -87,  -90,  -97, -107, -999,
 156.189 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.190 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.191 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.192 +   {-999, -999, -999, -110, -105, -100,  -95,  -90,
 156.193 +    -85,  -81,  -77,  -73,  -70,  -67,  -67,  -68,
 156.194 +    -75,  -73,  -70,  -69,  -70,  -72,  -75,  -79,
 156.195 +    -84,  -83,  -84,  -86,  -88,  -89,  -89,  -93,
 156.196 +    -98, -105, -112, -999, -999, -999, -999, -999,
 156.197 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.198 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.199 +   {-105, -100,  -95,  -90,  -85,  -80,  -76,  -71,
 156.200 +    -68,  -68,  -65,  -63,  -63,  -62,  -62,  -64,
 156.201 +    -65,  -64,  -61,  -62,  -63,  -64,  -66,  -68,
 156.202 +    -73,  -73,  -74,  -75,  -76,  -81,  -83,  -85,
 156.203 +    -88,  -89,  -92,  -95, -100, -108, -999, -999,
 156.204 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.205 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.206 +   { -80,  -75,  -71,  -68,  -65,  -63,  -62,  -61,
 156.207 +     -61,  -61,  -61,  -59,  -56,  -57,  -53,  -50,
 156.208 +     -58,  -52,  -50,  -50,  -52,  -53,  -54,  -58,
 156.209 +     -67,  -63,  -67,  -68,  -72,  -75,  -78,  -80,
 156.210 +     -81,  -81,  -82,  -85,  -89,  -90,  -93,  -97,
 156.211 +     -101, -107, -114, -999, -999, -999, -999, -999,
 156.212 +     -999, -999, -999, -999, -999, -999, -999, -999},
 156.213 +   { -65,  -61,  -59,  -57,  -56,  -55,  -55,  -56,
 156.214 +     -56,  -57,  -55,  -53,  -52,  -47,  -44,  -44,
 156.215 +     -50,  -44,  -41,  -39,  -39,  -42,  -40,  -46,
 156.216 +     -51,  -49,  -50,  -53,  -54,  -63,  -60,  -61,
 156.217 +     -62,  -66,  -66,  -66,  -70,  -73,  -74,  -75,
 156.218 +     -76,  -75,  -79,  -85,  -89,  -91,  -96, -102,
 156.219 +     -110, -999, -999, -999, -999, -999, -999, -999},
 156.220 +   { -52,  -50,  -49,  -49,  -48,  -48,  -48,  -49,
 156.221 +     -50,  -50,  -49,  -46,  -43,  -39,  -35,  -33,
 156.222 +     -38,  -36,  -32,  -29,  -32,  -32,  -32,  -35,
 156.223 +     -44,  -39,  -38,  -38,  -46,  -50,  -45,  -46,
 156.224 +     -53,  -50,  -50,  -50,  -54,  -54,  -53,  -53,
 156.225 +     -56,  -57,  -59,  -66,  -70,  -72,  -74,  -79,
 156.226 +     -83,  -85,  -90, -97, -114, -999, -999, -999}},
 156.227 +  /* 250 Hz */
 156.228 +  {{-999, -999, -999, -999, -999, -999, -110, -105,
 156.229 +    -100,  -95,  -90,  -86,  -80,  -75,  -75,  -79,
 156.230 +    -80,  -79,  -80,  -81,  -82,  -88,  -95, -103,
 156.231 +    -110, -999, -999, -999, -999, -999, -999, -999,
 156.232 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.233 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.234 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.235 +   {-999, -999, -999, -999, -108, -103,  -98,  -93,
 156.236 +    -88,  -83,  -79,  -78,  -75,  -71,  -67,  -68,
 156.237 +    -73,  -73,  -72,  -73,  -75,  -77,  -80,  -82,
 156.238 +    -88,  -93, -100, -107, -114, -999, -999, -999,
 156.239 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.240 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.241 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.242 +   {-999, -999, -999, -110, -105, -101,  -96,  -90,
 156.243 +    -86,  -81,  -77,  -73,  -69,  -66,  -61,  -62,
 156.244 +    -66,  -64,  -62,  -65,  -66,  -70,  -72,  -76,
 156.245 +    -81,  -80,  -84,  -90,  -95, -102, -110, -999,
 156.246 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.247 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.248 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.249 +   {-999, -999, -999, -107, -103,  -97,  -92,  -88,
 156.250 +    -83,  -79,  -74,  -70,  -66,  -59,  -53,  -58,
 156.251 +    -62,  -55,  -54,  -54,  -54,  -58,  -61,  -62,
 156.252 +    -72,  -70,  -72,  -75,  -78,  -80,  -81,  -80,
 156.253 +    -83,  -83,  -88,  -93, -100, -107, -115, -999,
 156.254 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.255 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.256 +   {-999, -999, -999, -105, -100,  -95,  -90,  -85,
 156.257 +    -80,  -75,  -70,  -66,  -62,  -56,  -48,  -44,
 156.258 +    -48,  -46,  -46,  -43,  -46,  -48,  -48,  -51,
 156.259 +    -58,  -58,  -59,  -60,  -62,  -62,  -61,  -61,
 156.260 +    -65,  -64,  -65,  -68,  -70,  -74,  -75,  -78,
 156.261 +    -81,  -86,  -95, -110, -999, -999, -999, -999,
 156.262 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.263 +   {-999,  -999, -105, -100,  -95,  -90,  -85,  -80,
 156.264 +    -75,  -70,  -65,  -61,  -55,  -49,  -39,  -33,
 156.265 +    -40,  -35,  -32,  -38,  -40,  -33,  -35,  -37,
 156.266 +    -46,  -41,  -45,  -44,  -46,  -42,  -45,  -46,
 156.267 +    -52,  -50,  -50,  -50,  -54,  -54,  -55,  -57,
 156.268 +    -62,  -64,  -66,  -68,  -70,  -76,  -81,  -90,
 156.269 +    -100, -110, -999, -999, -999, -999, -999, -999}},
 156.270 +  /* 354 hz */
 156.271 +  {{-999, -999, -999, -999, -999, -999, -999, -999,
 156.272 +    -105,  -98,  -90,  -85,  -82,  -83,  -80,  -78,
 156.273 +    -84,  -79,  -80,  -83,  -87,  -89,  -91,  -93,
 156.274 +    -99, -106, -117, -999, -999, -999, -999, -999,
 156.275 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.276 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.277 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.278 +   {-999, -999, -999, -999, -999, -999, -999, -999,
 156.279 +    -105,  -98,  -90,  -85,  -80,  -75,  -70,  -68,
 156.280 +    -74,  -72,  -74,  -77,  -80,  -82,  -85,  -87,
 156.281 +    -92,  -89,  -91,  -95, -100, -106, -112, -999,
 156.282 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.283 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.284 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.285 +   {-999, -999, -999, -999, -999, -999, -999, -999,
 156.286 +    -105,  -98,  -90,  -83,  -75,  -71,  -63,  -64,
 156.287 +    -67,  -62,  -64,  -67,  -70,  -73,  -77,  -81,
 156.288 +    -84,  -83,  -85,  -89,  -90,  -93,  -98, -104,
 156.289 +    -109, -114, -999, -999, -999, -999, -999, -999,
 156.290 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.291 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.292 +   {-999, -999, -999, -999, -999, -999, -999, -999,
 156.293 +    -103,  -96,  -88,  -81,  -75,  -68,  -58,  -54,
 156.294 +    -56,  -54,  -56,  -56,  -58,  -60,  -63,  -66,
 156.295 +    -74,  -69,  -72,  -72,  -75,  -74,  -77,  -81,
 156.296 +    -81,  -82,  -84,  -87,  -93,  -96,  -99, -104,
 156.297 +    -110, -999, -999, -999, -999, -999, -999, -999,
 156.298 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.299 +   {-999, -999, -999, -999, -999, -108, -102,  -96,
 156.300 +    -91,  -85,  -80,  -74,  -68,  -60,  -51,  -46,
 156.301 +    -48,  -46,  -43,  -45,  -47,  -47,  -49,  -48,
 156.302 +    -56,  -53,  -55,  -58,  -57,  -63,  -58,  -60,
 156.303 +    -66,  -64,  -67,  -70,  -70,  -74,  -77,  -84,
 156.304 +    -86,  -89,  -91,  -93,  -94, -101, -109, -118,
 156.305 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.306 +   {-999, -999, -999, -108, -103,  -98,  -93,  -88,
 156.307 +    -83,  -78,  -73,  -68,  -60,  -53,  -44,  -35,
 156.308 +    -38,  -38,  -34,  -34,  -36,  -40,  -41,  -44,
 156.309 +    -51,  -45,  -46,  -47,  -46,  -54,  -50,  -49,
 156.310 +    -50,  -50,  -50,  -51,  -54,  -57,  -58,  -60,
 156.311 +    -66,  -66,  -66,  -64,  -65,  -68,  -77,  -82,
 156.312 +    -87,  -95, -110, -999, -999, -999, -999, -999}},
 156.313 +  /* 500 Hz */
 156.314 +  {{-999, -999, -999, -999, -999, -999, -999, -999,
 156.315 +    -107, -102,  -97,  -92,  -87,  -83,  -78,  -75,
 156.316 +    -82,  -79,  -83,  -85,  -89,  -92,  -95,  -98,
 156.317 +    -101, -105, -109, -113, -999, -999, -999, -999,
 156.318 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.319 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.320 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.321 +   {-999, -999, -999, -999, -999, -999, -999, -106,
 156.322 +    -100,  -95,  -90,  -86,  -81,  -78,  -74,  -69,
 156.323 +    -74,  -74,  -76,  -79,  -83,  -84,  -86,  -89,
 156.324 +    -92,  -97,  -93, -100, -103, -107, -110, -999,
 156.325 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.326 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.327 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.328 +   {-999, -999, -999, -999, -999, -999, -106, -100,
 156.329 +    -95, -90, -87, -83, -80, -75, -69, -60,
 156.330 +    -66, -66, -68, -70, -74, -78, -79, -81,
 156.331 +    -81, -83, -84, -87, -93, -96, -99, -103,
 156.332 +    -107, -110, -999, -999, -999, -999, -999, -999,
 156.333 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.334 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.335 +   {-999, -999, -999, -999, -999, -108, -103, -98,
 156.336 +    -93, -89, -85, -82, -78, -71, -62, -55,
 156.337 +    -58, -58, -54, -54, -55, -59, -61, -62,
 156.338 +    -70, -66, -66, -67, -70, -72, -75, -78,
 156.339 +    -84, -84, -84, -88, -91, -90, -95, -98,
 156.340 +    -102, -103, -106, -110, -999, -999, -999, -999,
 156.341 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.342 +   {-999, -999, -999, -999, -108, -103,  -98,  -94,
 156.343 +    -90,  -87,  -82,  -79,  -73,  -67,  -58,  -47,
 156.344 +    -50,  -45,  -41,  -45,  -48,  -44,  -44,  -49,
 156.345 +    -54,  -51,  -48,  -47,  -49,  -50,  -51,  -57,
 156.346 +    -58,  -60,  -63,  -69,  -70,  -69,  -71,  -74,
 156.347 +    -78,  -82,  -90,  -95, -101, -105, -110, -999,
 156.348 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.349 +   {-999, -999, -999, -105, -101, -97, -93, -90,
 156.350 +    -85, -80, -77, -72, -65, -56, -48, -37,
 156.351 +    -40, -36, -34, -40, -50, -47, -38, -41,
 156.352 +    -47, -38, -35, -39, -38, -43, -40, -45,
 156.353 +    -50, -45, -44, -47, -50, -55, -48, -48,
 156.354 +    -52, -66, -70, -76, -82, -90, -97, -105,
 156.355 +    -110, -999, -999, -999, -999, -999, -999, -999}},
 156.356 +  /* 707 Hz */
 156.357 +  {{-999, -999, -999, -999, -999, -999, -999, -999,
 156.358 +    -999, -108, -103,  -98,  -93,  -86,  -79,  -76,
 156.359 +    -83,  -81,  -85,  -87,  -89,  -93,  -98, -102,
 156.360 +    -107, -112, -999, -999, -999, -999, -999, -999,
 156.361 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.362 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.363 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.364 +   {-999, -999, -999, -999, -999, -999, -999, -999,
 156.365 +    -999, -108, -103,  -98,  -93,  -86,  -79,  -71,
 156.366 +    -77,  -74,  -77,  -79,  -81,  -84,  -85,  -90,
 156.367 +    -92,  -93,  -92,  -98, -101, -108, -112, -999,
 156.368 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.369 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.370 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.371 +   {-999, -999, -999, -999, -999, -999, -999, -999,
 156.372 +    -108, -103,  -98,  -93,  -87,  -78,  -68,  -65,
 156.373 +    -66,  -62,  -65,  -67,  -70,  -73,  -75,  -78,
 156.374 +    -82,  -82,  -83,  -84,  -91,  -93,  -98, -102,
 156.375 +    -106, -110, -999, -999, -999, -999, -999, -999,
 156.376 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.377 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.378 +   {-999, -999, -999, -999, -999, -999, -999, -999,
 156.379 +    -105, -100, -95, -90, -82, -74, -62, -57,
 156.380 +    -58, -56, -51, -52, -52, -54, -54, -58,
 156.381 +    -66, -59, -60, -63, -66, -69, -73, -79,
 156.382 +    -83, -84, -80, -81, -81, -82, -88, -92,
 156.383 +    -98, -105, -113, -999, -999, -999, -999, -999,
 156.384 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.385 +   {-999, -999, -999, -999, -999, -999, -999, -107,
 156.386 +    -102,  -97,  -92,  -84,  -79,  -69,  -57,  -47,
 156.387 +    -52,  -47,  -44,  -45,  -50,  -52,  -42,  -42,
 156.388 +    -53,  -43,  -43,  -48,  -51,  -56,  -55,  -52,
 156.389 +    -57,  -59,  -61,  -62,  -67,  -71,  -78,  -83,
 156.390 +    -86,  -94,  -98, -103, -110, -999, -999, -999,
 156.391 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.392 +   {-999, -999, -999, -999, -999, -999, -105, -100,
 156.393 +    -95,  -90,  -84,  -78,  -70,  -61,  -51,  -41,
 156.394 +    -40,  -38,  -40,  -46,  -52,  -51,  -41,  -40,
 156.395 +    -46,  -40,  -38,  -38,  -41,  -46,  -41,  -46,
 156.396 +    -47,  -43,  -43,  -45,  -41,  -45,  -56,  -67,
 156.397 +    -68,  -83,  -87,  -90,  -95, -102, -107, -113,
 156.398 +    -999, -999, -999, -999, -999, -999, -999, -999}},
 156.399 +  /* 1000 Hz */
 156.400 +  {{-999, -999, -999, -999, -999, -999, -999, -999,
 156.401 +    -999, -109, -105, -101,  -96,  -91,  -84,  -77,
 156.402 +    -82,  -82,  -85,  -89,  -94, -100, -106, -110,
 156.403 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.404 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.405 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.406 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.407 +   {-999, -999, -999, -999, -999, -999, -999, -999,
 156.408 +    -999, -106, -103,  -98,  -92,  -85,  -80,  -71,
 156.409 +    -75,  -72,  -76,  -80,  -84,  -86,  -89,  -93,
 156.410 +    -100, -107, -113, -999, -999, -999, -999, -999,
 156.411 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.412 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.413 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.414 +   {-999, -999, -999, -999, -999, -999, -999, -107,
 156.415 +    -104, -101,  -97,  -92,  -88,  -84,  -80,  -64,
 156.416 +    -66,  -63,  -64,  -66,  -69,  -73,  -77,  -83,
 156.417 +    -83,  -86,  -91,  -98, -104, -111, -999, -999,
 156.418 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.419 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.420 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.421 +   {-999, -999, -999, -999, -999, -999, -999, -107,
 156.422 +    -104, -101,  -97,  -92,  -90,  -84,  -74,  -57,
 156.423 +    -58,  -52,  -55,  -54,  -50,  -52,  -50,  -52,
 156.424 +    -63,  -62,  -69,  -76,  -77,  -78,  -78,  -79,
 156.425 +    -82,  -88,  -94, -100, -106, -111, -999, -999,
 156.426 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.427 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.428 +   {-999, -999, -999, -999, -999, -999, -106, -102,
 156.429 +    -98,  -95,  -90,  -85,  -83,  -78,  -70,  -50,
 156.430 +    -50,  -41,  -44,  -49,  -47,  -50,  -50,  -44,
 156.431 +    -55,  -46,  -47,  -48,  -48,  -54,  -49,  -49,
 156.432 +    -58,  -62,  -71,  -81,  -87,  -92,  -97, -102,
 156.433 +    -108, -114, -999, -999, -999, -999, -999, -999,
 156.434 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.435 +   {-999, -999, -999, -999, -999, -999, -106, -102,
 156.436 +    -98,  -95,  -90,  -85,  -83,  -78,  -70,  -45,
 156.437 +    -43,  -41,  -47,  -50,  -51,  -50,  -49,  -45,
 156.438 +    -47,  -41,  -44,  -41,  -39,  -43,  -38,  -37,
 156.439 +    -40,  -41,  -44,  -50,  -58,  -65,  -73,  -79,
 156.440 +    -85,  -92,  -97, -101, -105, -109, -113, -999,
 156.441 +    -999, -999, -999, -999, -999, -999, -999, -999}},
 156.442 +  /* 1414 Hz */
 156.443 +  {{-999, -999, -999, -999, -999, -999, -999, -999,
 156.444 +    -999, -999, -999, -107, -100,  -95,  -87,  -81,
 156.445 +    -85,  -83,  -88,  -93, -100, -107, -114, -999,
 156.446 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.447 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.448 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.449 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.450 +   {-999, -999, -999, -999, -999, -999, -999, -999,
 156.451 +    -999, -999, -107, -101,  -95,  -88,  -83,  -76,
 156.452 +    -73,  -72,  -79,  -84,  -90,  -95, -100, -105,
 156.453 +    -110, -115, -999, -999, -999, -999, -999, -999,
 156.454 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.455 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.456 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.457 +   {-999, -999, -999, -999, -999, -999, -999, -999,
 156.458 +    -999, -999, -104,  -98,  -92,  -87,  -81,  -70,
 156.459 +    -65,  -62,  -67,  -71,  -74,  -80,  -85,  -91,
 156.460 +    -95,  -99, -103, -108, -111, -114, -999, -999,
 156.461 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.462 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.463 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.464 +   {-999, -999, -999, -999, -999, -999, -999, -999,
 156.465 +    -999, -999, -103,  -97,  -90,  -85,  -76,  -60,
 156.466 +    -56,  -54,  -60,  -62,  -61,  -56,  -63,  -65,
 156.467 +    -73,  -74,  -77,  -75,  -78,  -81,  -86,  -87,
 156.468 +    -88,  -91,  -94,  -98, -103, -110, -999, -999,
 156.469 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.470 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.471 +   {-999, -999, -999, -999, -999, -999, -999, -105,
 156.472 +    -100,  -97,  -92,  -86,  -81,  -79,  -70,  -57,
 156.473 +    -51,  -47,  -51,  -58,  -60,  -56,  -53,  -50,
 156.474 +    -58,  -52,  -50,  -50,  -53,  -55,  -64,  -69,
 156.475 +    -71,  -85,  -82,  -78,  -81,  -85,  -95, -102,
 156.476 +    -112, -999, -999, -999, -999, -999, -999, -999,
 156.477 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.478 +   {-999, -999, -999, -999, -999, -999, -999, -105,
 156.479 +    -100,  -97,  -92,  -85,  -83,  -79,  -72,  -49,
 156.480 +    -40,  -43,  -43,  -54,  -56,  -51,  -50,  -40,
 156.481 +    -43,  -38,  -36,  -35,  -37,  -38,  -37,  -44,
 156.482 +    -54,  -60,  -57,  -60,  -70,  -75,  -84,  -92,
 156.483 +    -103, -112, -999, -999, -999, -999, -999, -999,
 156.484 +    -999, -999, -999, -999, -999, -999, -999, -999}},
 156.485 +  /* 2000 Hz */
 156.486 +  {{-999, -999, -999, -999, -999, -999, -999, -999,
 156.487 +    -999, -999, -999, -110, -102,  -95,  -89,  -82,
 156.488 +    -83,  -84,  -90,  -92,  -99, -107, -113, -999,
 156.489 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.490 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.491 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.492 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.493 +   {-999, -999, -999, -999, -999, -999, -999, -999,
 156.494 +    -999, -999, -107, -101,  -95,  -89,  -83,  -72,
 156.495 +    -74,  -78,  -85,  -88,  -88,  -90,  -92,  -98,
 156.496 +    -105, -111, -999, -999, -999, -999, -999, -999,
 156.497 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.498 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.499 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.500 +   {-999, -999, -999, -999, -999, -999, -999, -999,
 156.501 +    -999, -109, -103, -97, -93, -87, -81, -70,
 156.502 +    -70, -67, -75, -73, -76, -79, -81, -83,
 156.503 +    -88, -89, -97, -103, -110, -999, -999, -999,
 156.504 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.505 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.506 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.507 +   {-999, -999, -999, -999, -999, -999, -999, -999,
 156.508 +    -999, -107, -100,  -94,  -88,  -83,  -75,  -63,
 156.509 +    -59,  -59,  -63,  -66,  -60,  -62,  -67,  -67,
 156.510 +    -77,  -76,  -81,  -88,  -86,  -92,  -96, -102,
 156.511 +    -109, -116, -999, -999, -999, -999, -999, -999,
 156.512 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.513 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.514 +   {-999, -999, -999, -999, -999, -999, -999, -999,
 156.515 +    -999, -105,  -98,  -92,  -86,  -81,  -73,  -56,
 156.516 +    -52,  -47,  -55,  -60,  -58,  -52,  -51,  -45,
 156.517 +    -49,  -50,  -53,  -54,  -61,  -71,  -70,  -69,
 156.518 +    -78,  -79,  -87,  -90,  -96, -104, -112, -999,
 156.519 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.520 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.521 +   {-999, -999, -999, -999, -999, -999, -999, -999,
 156.522 +    -999, -103,  -96,  -90,  -86,  -78,  -70,  -51,
 156.523 +    -42,  -47,  -48,  -55,  -54,  -54,  -53,  -42,
 156.524 +    -35,  -28,  -33,  -38,  -37,  -44,  -47,  -49,
 156.525 +    -54,  -63,  -68,  -78,  -82,  -89,  -94,  -99,
 156.526 +    -104, -109, -114, -999, -999, -999, -999, -999,
 156.527 +    -999, -999, -999, -999, -999, -999, -999, -999}},
 156.528 +  /* 2828 Hz */
 156.529 +  {{-999, -999, -999, -999, -999, -999, -999, -999,
 156.530 +    -999, -999, -999, -999, -110, -100,  -90,  -79,
 156.531 +    -85,  -81,  -82,  -82,  -89,  -94,  -99, -103,
 156.532 +    -109, -115, -999, -999, -999, -999, -999, -999,
 156.533 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.534 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.535 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.536 +   {-999, -999, -999, -999, -999, -999, -999, -999,
 156.537 +    -999, -999, -999, -999, -105,  -97,  -85,  -72,
 156.538 +    -74,  -70,  -70,  -70,  -76,  -85,  -91,  -93,
 156.539 +    -97, -103, -109, -115, -999, -999, -999, -999,
 156.540 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.541 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.542 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.543 +   {-999, -999, -999, -999, -999, -999, -999, -999,
 156.544 +    -999, -999, -999, -999, -112,  -93,  -81,  -68,
 156.545 +    -62,  -60,  -60,  -57,  -63,  -70,  -77,  -82,
 156.546 +    -90,  -93,  -98, -104, -109, -113, -999, -999,
 156.547 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.548 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.549 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.550 +   {-999, -999, -999, -999, -999, -999, -999, -999,
 156.551 +    -999, -999, -999, -113, -100,  -93,  -84,  -63,
 156.552 +    -58,  -48,  -53,  -54,  -52,  -52,  -57,  -64,
 156.553 +    -66,  -76,  -83,  -81,  -85,  -85,  -90,  -95,
 156.554 +    -98, -101, -103, -106, -108, -111, -999, -999,
 156.555 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.556 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.557 +   {-999, -999, -999, -999, -999, -999, -999, -999,
 156.558 +    -999, -999, -999, -105,  -95,  -86,  -74,  -53,
 156.559 +    -50,  -38,  -43,  -49,  -43,  -42,  -39,  -39,
 156.560 +    -46,  -52,  -57,  -56,  -72,  -69,  -74,  -81,
 156.561 +    -87,  -92,  -94,  -97,  -99, -102, -105, -108,
 156.562 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.563 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.564 +   {-999, -999, -999, -999, -999, -999, -999, -999,
 156.565 +    -999, -999, -108,  -99,  -90,  -76,  -66,  -45,
 156.566 +    -43,  -41,  -44,  -47,  -43,  -47,  -40,  -30,
 156.567 +    -31,  -31,  -39,  -33,  -40,  -41,  -43,  -53,
 156.568 +    -59,  -70,  -73,  -77,  -79,  -82,  -84,  -87,
 156.569 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.570 +    -999, -999, -999, -999, -999, -999, -999, -999}},
 156.571 +  /* 4000 Hz */
 156.572 +  {{-999, -999, -999, -999, -999, -999, -999, -999,
 156.573 +    -999, -999, -999, -999, -999, -110,  -91,  -76,
 156.574 +    -75,  -85,  -93,  -98, -104, -110, -999, -999,
 156.575 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.576 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.577 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.578 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.579 +   {-999, -999, -999, -999, -999, -999, -999, -999,
 156.580 +    -999, -999, -999, -999, -999, -110,  -91,  -70,
 156.581 +    -70,  -75,  -86,  -89,  -94,  -98, -101, -106,
 156.582 +    -110, -999, -999, -999, -999, -999, -999, -999,
 156.583 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.584 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.585 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.586 +   {-999, -999, -999, -999, -999, -999, -999, -999,
 156.587 +    -999, -999, -999, -999, -110,  -95,  -80,  -60,
 156.588 +    -65,  -64,  -74,  -83,  -88,  -91,  -95,  -99,
 156.589 +    -103, -107, -110, -999, -999, -999, -999, -999,
 156.590 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.591 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.592 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.593 +   {-999, -999, -999, -999, -999, -999, -999, -999,
 156.594 +    -999, -999, -999, -999, -110,  -95,  -80,  -58,
 156.595 +    -55,  -49,  -66,  -68,  -71,  -78,  -78,  -80,
 156.596 +    -88,  -85,  -89,  -97, -100, -105, -110, -999,
 156.597 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.598 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.599 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.600 +   {-999, -999, -999, -999, -999, -999, -999, -999,
 156.601 +    -999, -999, -999, -999, -110,  -95,  -80,  -53,
 156.602 +    -52,  -41,  -59,  -59,  -49,  -58,  -56,  -63,
 156.603 +    -86,  -79,  -90,  -93,  -98, -103, -107, -112,
 156.604 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.605 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.606 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.607 +   {-999, -999, -999, -999, -999, -999, -999, -999,
 156.608 +    -999, -999, -999, -110,  -97,  -91,  -73,  -45,
 156.609 +    -40,  -33,  -53,  -61,  -49,  -54,  -50,  -50,
 156.610 +    -60,  -52,  -67,  -74,  -81,  -92,  -96, -100,
 156.611 +    -105, -110, -999, -999, -999, -999, -999, -999,
 156.612 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.613 +    -999, -999, -999, -999, -999, -999, -999, -999}},
 156.614 +  /* 5657 Hz */
 156.615 +  {{-999, -999, -999, -999, -999, -999, -999, -999,
 156.616 +    -999, -999, -999, -113, -106,  -99,  -92,  -77,
 156.617 +    -80,  -88,  -97, -106, -115, -999, -999, -999,
 156.618 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.619 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.620 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.621 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.622 +   {-999, -999, -999, -999, -999, -999, -999, -999,
 156.623 +    -999, -999, -116, -109, -102,  -95,  -89,  -74,
 156.624 +    -72,  -88,  -87,  -95, -102, -109, -116, -999,
 156.625 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.626 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.627 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.628 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.629 +   {-999, -999, -999, -999, -999, -999, -999, -999,
 156.630 +    -999, -999, -116, -109, -102,  -95,  -89,  -75,
 156.631 +    -66,  -74,  -77,  -78,  -86,  -87,  -90,  -96,
 156.632 +    -105, -115, -999, -999, -999, -999, -999, -999,
 156.633 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.634 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.635 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.636 +   {-999, -999, -999, -999, -999, -999, -999, -999,
 156.637 +    -999, -999, -115, -108, -101,  -94,  -88,  -66,
 156.638 +    -56,  -61,  -70,  -65,  -78,  -72,  -83,  -84,
 156.639 +    -93,  -98, -105, -110, -999, -999, -999, -999,
 156.640 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.641 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.642 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.643 +   {-999, -999, -999, -999, -999, -999, -999, -999,
 156.644 +    -999, -999, -110, -105,  -95,  -89,  -82,  -57,
 156.645 +    -52,  -52,  -59,  -56,  -59,  -58,  -69,  -67,
 156.646 +    -88,  -82,  -82,  -89,  -94, -100, -108, -999,
 156.647 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.648 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.649 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.650 +   {-999, -999, -999, -999, -999, -999, -999, -999,
 156.651 +    -999, -110, -101,  -96,  -90,  -83,  -77,  -54,
 156.652 +    -43,  -38,  -50,  -48,  -52,  -48,  -42,  -42,
 156.653 +    -51,  -52,  -53,  -59,  -65,  -71,  -78,  -85,
 156.654 +    -95, -999, -999, -999, -999, -999, -999, -999,
 156.655 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.656 +    -999, -999, -999, -999, -999, -999, -999, -999}},
 156.657 +  /* 8000 Hz */
 156.658 +  {{-999, -999, -999, -999, -999, -999, -999, -999,
 156.659 +    -999, -999, -999, -999, -120, -105,  -86,  -68,
 156.660 +    -78,  -79,  -90, -100, -110, -999, -999, -999,
 156.661 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.662 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.663 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.664 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.665 +   {-999, -999, -999, -999, -999, -999, -999, -999,
 156.666 +    -999, -999, -999, -999, -120, -105,  -86,  -66,
 156.667 +    -73,  -77,  -88,  -96, -105, -115, -999, -999,
 156.668 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.669 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.670 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.671 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.672 +   {-999, -999, -999, -999, -999, -999, -999, -999,
 156.673 +    -999, -999, -999, -120, -105,  -92,  -80,  -61,
 156.674 +    -64,  -68,  -80,  -87,  -92, -100, -110, -999,
 156.675 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.676 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.677 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.678 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.679 +   {-999, -999, -999, -999, -999, -999, -999, -999,
 156.680 +    -999, -999, -999, -120, -104,  -91,  -79,  -52,
 156.681 +    -60,  -54,  -64,  -69,  -77,  -80,  -82,  -84,
 156.682 +    -85,  -87,  -88,  -90, -999, -999, -999, -999,
 156.683 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.684 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.685 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.686 +   {-999, -999, -999, -999, -999, -999, -999, -999,
 156.687 +    -999, -999, -999, -118, -100,  -87,  -77,  -49,
 156.688 +    -50,  -44,  -58,  -61,  -61,  -67,  -65,  -62,
 156.689 +    -62,  -62,  -65,  -68, -999, -999, -999, -999,
 156.690 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.691 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.692 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.693 +   {-999, -999, -999, -999, -999, -999, -999, -999,
 156.694 +    -999, -999, -999, -115,  -98,  -84,  -62,  -49,
 156.695 +    -44,  -38,  -46,  -49,  -49,  -46,  -39,  -37,
 156.696 +    -39,  -40,  -42,  -43, -999, -999, -999, -999,
 156.697 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.698 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.699 +    -999, -999, -999, -999, -999, -999, -999, -999}},
 156.700 +  /* 11314 Hz */
 156.701 +  {{-999, -999, -999, -999, -999, -999, -999, -999,
 156.702 +    -999, -999, -999, -999, -999, -110,  -88,  -74,
 156.703 +    -77,  -82,  -82,  -85,  -90,  -94,  -99, -104,
 156.704 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.705 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.706 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.707 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.708 +   {-999, -999, -999, -999, -999, -999, -999, -999,
 156.709 +    -999, -999, -999, -999, -999, -110,  -88,  -66,
 156.710 +    -70,  -81,  -80,  -81,  -84,  -88,  -91,  -93,
 156.711 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.712 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.713 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.714 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.715 +   {-999, -999, -999, -999, -999, -999, -999, -999,
 156.716 +    -999, -999, -999, -999, -999, -110,  -88,  -61,
 156.717 +    -63,  -70,  -71,  -74,  -77,  -80,  -83,  -85,
 156.718 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.719 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.720 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.721 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.722 +   {-999, -999, -999, -999, -999, -999, -999, -999,
 156.723 +    -999, -999, -999, -999, -999, -110, -86, -62,
 156.724 +    -63,  -62,  -62,  -58,  -52,  -50,  -50,  -52,
 156.725 +    -54, -999, -999, -999, -999, -999, -999, -999,
 156.726 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.727 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.728 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.729 +   {-999, -999, -999, -999, -999, -999, -999, -999,
 156.730 +    -999, -999, -999, -999, -118, -108,  -84,  -53,
 156.731 +    -50,  -50,  -50,  -55,  -47,  -45,  -40,  -40,
 156.732 +    -40, -999, -999, -999, -999, -999, -999, -999,
 156.733 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.734 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.735 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.736 +   {-999, -999, -999, -999, -999, -999, -999, -999,
 156.737 +    -999, -999, -999, -999, -118, -100,  -73,  -43,
 156.738 +    -37,  -42,  -43,  -53,  -38,  -37,  -35,  -35,
 156.739 +    -38, -999, -999, -999, -999, -999, -999, -999,
 156.740 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.741 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.742 +    -999, -999, -999, -999, -999, -999, -999, -999}},
 156.743 +  /* 16000 Hz */
 156.744 +  {{-999, -999, -999, -999, -999, -999, -999, -999,
 156.745 +    -999, -999, -999, -110, -100,  -91,  -84,  -74,
 156.746 +    -80,  -80,  -80,  -80,  -80, -999, -999, -999,
 156.747 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.748 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.749 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.750 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.751 +   {-999, -999, -999, -999, -999, -999, -999, -999,
 156.752 +    -999, -999, -999, -110, -100,  -91,  -84,  -74,
 156.753 +    -68,  -68,  -68,  -68,  -68, -999, -999, -999,
 156.754 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.755 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.756 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.757 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.758 +   {-999, -999, -999, -999, -999, -999, -999, -999,
 156.759 +    -999, -999, -999, -110, -100,  -86,  -78,  -70,
 156.760 +    -60,  -45,  -30,  -21, -999, -999, -999, -999,
 156.761 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.762 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.763 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.764 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.765 +   {-999, -999, -999, -999, -999, -999, -999, -999,
 156.766 +    -999, -999, -999, -110, -100,  -87,  -78,  -67,
 156.767 +    -48,  -38,  -29,  -21, -999, -999, -999, -999,
 156.768 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.769 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.770 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.771 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.772 +   {-999, -999, -999, -999, -999, -999, -999, -999,
 156.773 +    -999, -999, -999, -110, -100,  -86,  -69,  -56,
 156.774 +    -45,  -35,  -33,  -29, -999, -999, -999, -999,
 156.775 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.776 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.777 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.778 +    -999, -999, -999, -999, -999, -999, -999, -999},
 156.779 +   {-999, -999, -999, -999, -999, -999, -999, -999,
 156.780 +    -999, -999, -999, -110, -100,  -83,  -71,  -48,
 156.781 +    -27,  -38,  -37,  -34, -999, -999, -999, -999,
 156.782 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.783 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.784 +    -999, -999, -999, -999, -999, -999, -999, -999,
 156.785 +    -999, -999, -999, -999, -999, -999, -999, -999}}
 156.786 +};
 156.787 +
 156.788 +#endif
   157.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   157.2 +++ b/libs/vorbis/mdct.c	Sun Nov 01 00:36:56 2015 +0200
   157.3 @@ -0,0 +1,563 @@
   157.4 +/********************************************************************
   157.5 + *                                                                  *
   157.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   157.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   157.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   157.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  157.10 + *                                                                  *
  157.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
  157.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  157.13 + *                                                                  *
  157.14 + ********************************************************************
  157.15 +
  157.16 + function: normalized modified discrete cosine transform
  157.17 +           power of two length transform only [64 <= n ]
  157.18 + last mod: $Id: mdct.c 16227 2009-07-08 06:58:46Z xiphmont $
  157.19 +
  157.20 + Original algorithm adapted long ago from _The use of multirate filter
  157.21 + banks for coding of high quality digital audio_, by T. Sporer,
  157.22 + K. Brandenburg and B. Edler, collection of the European Signal
  157.23 + Processing Conference (EUSIPCO), Amsterdam, June 1992, Vol.1, pp
  157.24 + 211-214
  157.25 +
  157.26 + The below code implements an algorithm that no longer looks much like
  157.27 + that presented in the paper, but the basic structure remains if you
  157.28 + dig deep enough to see it.
  157.29 +
  157.30 + This module DOES NOT INCLUDE code to generate/apply the window
  157.31 + function.  Everybody has their own weird favorite including me... I
  157.32 + happen to like the properties of y=sin(.5PI*sin^2(x)), but others may
  157.33 + vehemently disagree.
  157.34 +
  157.35 + ********************************************************************/
  157.36 +
  157.37 +/* this can also be run as an integer transform by uncommenting a
  157.38 +   define in mdct.h; the integerization is a first pass and although
  157.39 +   it's likely stable for Vorbis, the dynamic range is constrained and
  157.40 +   roundoff isn't done (so it's noisy).  Consider it functional, but
  157.41 +   only a starting point.  There's no point on a machine with an FPU */
  157.42 +
  157.43 +#include <stdio.h>
  157.44 +#include <stdlib.h>
  157.45 +#include <string.h>
  157.46 +#include <math.h>
  157.47 +#include "vorbis/codec.h"
  157.48 +#include "mdct.h"
  157.49 +#include "os.h"
  157.50 +#include "misc.h"
  157.51 +
  157.52 +/* build lookups for trig functions; also pre-figure scaling and
  157.53 +   some window function algebra. */
  157.54 +
  157.55 +void mdct_init(mdct_lookup *lookup,int n){
  157.56 +  int   *bitrev=_ogg_malloc(sizeof(*bitrev)*(n/4));
  157.57 +  DATA_TYPE *T=_ogg_malloc(sizeof(*T)*(n+n/4));
  157.58 +
  157.59 +  int i;
  157.60 +  int n2=n>>1;
  157.61 +  int log2n=lookup->log2n=rint(log((float)n)/log(2.f));
  157.62 +  lookup->n=n;
  157.63 +  lookup->trig=T;
  157.64 +  lookup->bitrev=bitrev;
  157.65 +
  157.66 +/* trig lookups... */
  157.67 +
  157.68 +  for(i=0;i<n/4;i++){
  157.69 +    T[i*2]=FLOAT_CONV(cos((M_PI/n)*(4*i)));
  157.70 +    T[i*2+1]=FLOAT_CONV(-sin((M_PI/n)*(4*i)));
  157.71 +    T[n2+i*2]=FLOAT_CONV(cos((M_PI/(2*n))*(2*i+1)));
  157.72 +    T[n2+i*2+1]=FLOAT_CONV(sin((M_PI/(2*n))*(2*i+1)));
  157.73 +  }
  157.74 +  for(i=0;i<n/8;i++){
  157.75 +    T[n+i*2]=FLOAT_CONV(cos((M_PI/n)*(4*i+2))*.5);
  157.76 +    T[n+i*2+1]=FLOAT_CONV(-sin((M_PI/n)*(4*i+2))*.5);
  157.77 +  }
  157.78 +
  157.79 +  /* bitreverse lookup... */
  157.80 +
  157.81 +  {
  157.82 +    int mask=(1<<(log2n-1))-1,i,j;
  157.83 +    int msb=1<<(log2n-2);
  157.84 +    for(i=0;i<n/8;i++){
  157.85 +      int acc=0;
  157.86 +      for(j=0;msb>>j;j++)
  157.87 +        if((msb>>j)&i)acc|=1<<j;
  157.88 +      bitrev[i*2]=((~acc)&mask)-1;
  157.89 +      bitrev[i*2+1]=acc;
  157.90 +
  157.91 +    }
  157.92 +  }
  157.93 +  lookup->scale=FLOAT_CONV(4.f/n);
  157.94 +}
  157.95 +
  157.96 +/* 8 point butterfly (in place, 4 register) */
  157.97 +STIN void mdct_butterfly_8(DATA_TYPE *x){
  157.98 +  REG_TYPE r0   = x[6] + x[2];
  157.99 +  REG_TYPE r1   = x[6] - x[2];
 157.100 +  REG_TYPE r2   = x[4] + x[0];
 157.101 +  REG_TYPE r3   = x[4] - x[0];
 157.102 +
 157.103 +           x[6] = r0   + r2;
 157.104 +           x[4] = r0   - r2;
 157.105 +
 157.106 +           r0   = x[5] - x[1];
 157.107 +           r2   = x[7] - x[3];
 157.108 +           x[0] = r1   + r0;
 157.109 +           x[2] = r1   - r0;
 157.110 +
 157.111 +           r0   = x[5] + x[1];
 157.112 +           r1   = x[7] + x[3];
 157.113 +           x[3] = r2   + r3;
 157.114 +           x[1] = r2   - r3;
 157.115 +           x[7] = r1   + r0;
 157.116 +           x[5] = r1   - r0;
 157.117 +
 157.118 +}
 157.119 +
 157.120 +/* 16 point butterfly (in place, 4 register) */
 157.121 +STIN void mdct_butterfly_16(DATA_TYPE *x){
 157.122 +  REG_TYPE r0     = x[1]  - x[9];
 157.123 +  REG_TYPE r1     = x[0]  - x[8];
 157.124 +
 157.125 +           x[8]  += x[0];
 157.126 +           x[9]  += x[1];
 157.127 +           x[0]   = MULT_NORM((r0   + r1) * cPI2_8);
 157.128 +           x[1]   = MULT_NORM((r0   - r1) * cPI2_8);
 157.129 +
 157.130 +           r0     = x[3]  - x[11];
 157.131 +           r1     = x[10] - x[2];
 157.132 +           x[10] += x[2];
 157.133 +           x[11] += x[3];
 157.134 +           x[2]   = r0;
 157.135 +           x[3]   = r1;
 157.136 +
 157.137 +           r0     = x[12] - x[4];
 157.138 +           r1     = x[13] - x[5];
 157.139 +           x[12] += x[4];
 157.140 +           x[13] += x[5];
 157.141 +           x[4]   = MULT_NORM((r0   - r1) * cPI2_8);
 157.142 +           x[5]   = MULT_NORM((r0   + r1) * cPI2_8);
 157.143 +
 157.144 +           r0     = x[14] - x[6];
 157.145 +           r1     = x[15] - x[7];
 157.146 +           x[14] += x[6];
 157.147 +           x[15] += x[7];
 157.148 +           x[6]  = r0;
 157.149 +           x[7]  = r1;
 157.150 +
 157.151 +           mdct_butterfly_8(x);
 157.152 +           mdct_butterfly_8(x+8);
 157.153 +}
 157.154 +
 157.155 +/* 32 point butterfly (in place, 4 register) */
 157.156 +STIN void mdct_butterfly_32(DATA_TYPE *x){
 157.157 +  REG_TYPE r0     = x[30] - x[14];
 157.158 +  REG_TYPE r1     = x[31] - x[15];
 157.159 +
 157.160 +           x[30] +=         x[14];
 157.161 +           x[31] +=         x[15];
 157.162 +           x[14]  =         r0;
 157.163 +           x[15]  =         r1;
 157.164 +
 157.165 +           r0     = x[28] - x[12];
 157.166 +           r1     = x[29] - x[13];
 157.167 +           x[28] +=         x[12];
 157.168 +           x[29] +=         x[13];
 157.169 +           x[12]  = MULT_NORM( r0 * cPI1_8  -  r1 * cPI3_8 );
 157.170 +           x[13]  = MULT_NORM( r0 * cPI3_8  +  r1 * cPI1_8 );
 157.171 +
 157.172 +           r0     = x[26] - x[10];
 157.173 +           r1     = x[27] - x[11];
 157.174 +           x[26] +=         x[10];
 157.175 +           x[27] +=         x[11];
 157.176 +           x[10]  = MULT_NORM(( r0  - r1 ) * cPI2_8);
 157.177 +           x[11]  = MULT_NORM(( r0  + r1 ) * cPI2_8);
 157.178 +
 157.179 +           r0     = x[24] - x[8];
 157.180 +           r1     = x[25] - x[9];
 157.181 +           x[24] += x[8];
 157.182 +           x[25] += x[9];
 157.183 +           x[8]   = MULT_NORM( r0 * cPI3_8  -  r1 * cPI1_8 );
 157.184 +           x[9]   = MULT_NORM( r1 * cPI3_8  +  r0 * cPI1_8 );
 157.185 +
 157.186 +           r0     = x[22] - x[6];
 157.187 +           r1     = x[7]  - x[23];
 157.188 +           x[22] += x[6];
 157.189 +           x[23] += x[7];
 157.190 +           x[6]   = r1;
 157.191 +           x[7]   = r0;
 157.192 +
 157.193 +           r0     = x[4]  - x[20];
 157.194 +           r1     = x[5]  - x[21];
 157.195 +           x[20] += x[4];
 157.196 +           x[21] += x[5];
 157.197 +           x[4]   = MULT_NORM( r1 * cPI1_8  +  r0 * cPI3_8 );
 157.198 +           x[5]   = MULT_NORM( r1 * cPI3_8  -  r0 * cPI1_8 );
 157.199 +
 157.200 +           r0     = x[2]  - x[18];
 157.201 +           r1     = x[3]  - x[19];
 157.202 +           x[18] += x[2];
 157.203 +           x[19] += x[3];
 157.204 +           x[2]   = MULT_NORM(( r1  + r0 ) * cPI2_8);
 157.205 +           x[3]   = MULT_NORM(( r1  - r0 ) * cPI2_8);
 157.206 +
 157.207 +           r0     = x[0]  - x[16];
 157.208 +           r1     = x[1]  - x[17];
 157.209 +           x[16] += x[0];
 157.210 +           x[17] += x[1];
 157.211 +           x[0]   = MULT_NORM( r1 * cPI3_8  +  r0 * cPI1_8 );
 157.212 +           x[1]   = MULT_NORM( r1 * cPI1_8  -  r0 * cPI3_8 );
 157.213 +
 157.214 +           mdct_butterfly_16(x);
 157.215 +           mdct_butterfly_16(x+16);
 157.216 +
 157.217 +}
 157.218 +
 157.219 +/* N point first stage butterfly (in place, 2 register) */
 157.220 +STIN void mdct_butterfly_first(DATA_TYPE *T,
 157.221 +                                        DATA_TYPE *x,
 157.222 +                                        int points){
 157.223 +
 157.224 +  DATA_TYPE *x1        = x          + points      - 8;
 157.225 +  DATA_TYPE *x2        = x          + (points>>1) - 8;
 157.226 +  REG_TYPE   r0;
 157.227 +  REG_TYPE   r1;
 157.228 +
 157.229 +  do{
 157.230 +
 157.231 +               r0      = x1[6]      -  x2[6];
 157.232 +               r1      = x1[7]      -  x2[7];
 157.233 +               x1[6]  += x2[6];
 157.234 +               x1[7]  += x2[7];
 157.235 +               x2[6]   = MULT_NORM(r1 * T[1]  +  r0 * T[0]);
 157.236 +               x2[7]   = MULT_NORM(r1 * T[0]  -  r0 * T[1]);
 157.237 +
 157.238 +               r0      = x1[4]      -  x2[4];
 157.239 +               r1      = x1[5]      -  x2[5];
 157.240 +               x1[4]  += x2[4];
 157.241 +               x1[5]  += x2[5];
 157.242 +               x2[4]   = MULT_NORM(r1 * T[5]  +  r0 * T[4]);
 157.243 +               x2[5]   = MULT_NORM(r1 * T[4]  -  r0 * T[5]);
 157.244 +
 157.245 +               r0      = x1[2]      -  x2[2];
 157.246 +               r1      = x1[3]      -  x2[3];
 157.247 +               x1[2]  += x2[2];
 157.248 +               x1[3]  += x2[3];
 157.249 +               x2[2]   = MULT_NORM(r1 * T[9]  +  r0 * T[8]);
 157.250 +               x2[3]   = MULT_NORM(r1 * T[8]  -  r0 * T[9]);
 157.251 +
 157.252 +               r0      = x1[0]      -  x2[0];
 157.253 +               r1      = x1[1]      -  x2[1];
 157.254 +               x1[0]  += x2[0];
 157.255 +               x1[1]  += x2[1];
 157.256 +               x2[0]   = MULT_NORM(r1 * T[13] +  r0 * T[12]);
 157.257 +               x2[1]   = MULT_NORM(r1 * T[12] -  r0 * T[13]);
 157.258 +
 157.259 +    x1-=8;
 157.260 +    x2-=8;
 157.261 +    T+=16;
 157.262 +
 157.263 +  }while(x2>=x);
 157.264 +}
 157.265 +
 157.266 +/* N/stage point generic N stage butterfly (in place, 2 register) */
 157.267 +STIN void mdct_butterfly_generic(DATA_TYPE *T,
 157.268 +                                          DATA_TYPE *x,
 157.269 +                                          int points,
 157.270 +                                          int trigint){
 157.271 +
 157.272 +  DATA_TYPE *x1        = x          + points      - 8;
 157.273 +  DATA_TYPE *x2        = x          + (points>>1) - 8;
 157.274 +  REG_TYPE   r0;
 157.275 +  REG_TYPE   r1;
 157.276 +
 157.277 +  do{
 157.278 +
 157.279 +               r0      = x1[6]      -  x2[6];
 157.280 +               r1      = x1[7]      -  x2[7];
 157.281 +               x1[6]  += x2[6];
 157.282 +               x1[7]  += x2[7];
 157.283 +               x2[6]   = MULT_NORM(r1 * T[1]  +  r0 * T[0]);
 157.284 +               x2[7]   = MULT_NORM(r1 * T[0]  -  r0 * T[1]);
 157.285 +
 157.286 +               T+=trigint;
 157.287 +
 157.288 +               r0      = x1[4]      -  x2[4];
 157.289 +               r1      = x1[5]      -  x2[5];
 157.290 +               x1[4]  += x2[4];
 157.291 +               x1[5]  += x2[5];
 157.292 +               x2[4]   = MULT_NORM(r1 * T[1]  +  r0 * T[0]);
 157.293 +               x2[5]   = MULT_NORM(r1 * T[0]  -  r0 * T[1]);
 157.294 +
 157.295 +               T+=trigint;
 157.296 +
 157.297 +               r0      = x1[2]      -  x2[2];
 157.298 +               r1      = x1[3]      -  x2[3];
 157.299 +               x1[2]  += x2[2];
 157.300 +               x1[3]  += x2[3];
 157.301 +               x2[2]   = MULT_NORM(r1 * T[1]  +  r0 * T[0]);
 157.302 +               x2[3]   = MULT_NORM(r1 * T[0]  -  r0 * T[1]);
 157.303 +
 157.304 +               T+=trigint;
 157.305 +
 157.306 +               r0      = x1[0]      -  x2[0];
 157.307 +               r1      = x1[1]      -  x2[1];
 157.308 +               x1[0]  += x2[0];
 157.309 +               x1[1]  += x2[1];
 157.310 +               x2[0]   = MULT_NORM(r1 * T[1]  +  r0 * T[0]);
 157.311 +               x2[1]   = MULT_NORM(r1 * T[0]  -  r0 * T[1]);
 157.312 +
 157.313 +               T+=trigint;
 157.314 +    x1-=8;
 157.315 +    x2-=8;
 157.316 +
 157.317 +  }while(x2>=x);
 157.318 +}
 157.319 +
 157.320 +STIN void mdct_butterflies(mdct_lookup *init,
 157.321 +                             DATA_TYPE *x,
 157.322 +                             int points){
 157.323 +
 157.324 +  DATA_TYPE *T=init->trig;
 157.325 +  int stages=init->log2n-5;
 157.326 +  int i,j;
 157.327 +
 157.328 +  if(--stages>0){
 157.329 +    mdct_butterfly_first(T,x,points);
 157.330 +  }
 157.331 +
 157.332 +  for(i=1;--stages>0;i++){
 157.333 +    for(j=0;j<(1<<i);j++)
 157.334 +      mdct_butterfly_generic(T,x+(points>>i)*j,points>>i,4<<i);
 157.335 +  }
 157.336 +
 157.337 +  for(j=0;j<points;j+=32)
 157.338 +    mdct_butterfly_32(x+j);
 157.339 +
 157.340 +}
 157.341 +
 157.342 +void mdct_clear(mdct_lookup *l){
 157.343 +  if(l){
 157.344 +    if(l->trig)_ogg_free(l->trig);
 157.345 +    if(l->bitrev)_ogg_free(l->bitrev);
 157.346 +    memset(l,0,sizeof(*l));
 157.347 +  }
 157.348 +}
 157.349 +
 157.350 +STIN void mdct_bitreverse(mdct_lookup *init,
 157.351 +                            DATA_TYPE *x){
 157.352 +  int        n       = init->n;
 157.353 +  int       *bit     = init->bitrev;
 157.354 +  DATA_TYPE *w0      = x;
 157.355 +  DATA_TYPE *w1      = x = w0+(n>>1);
 157.356 +  DATA_TYPE *T       = init->trig+n;
 157.357 +
 157.358 +  do{
 157.359 +    DATA_TYPE *x0    = x+bit[0];
 157.360 +    DATA_TYPE *x1    = x+bit[1];
 157.361 +
 157.362 +    REG_TYPE  r0     = x0[1]  - x1[1];
 157.363 +    REG_TYPE  r1     = x0[0]  + x1[0];
 157.364 +    REG_TYPE  r2     = MULT_NORM(r1     * T[0]   + r0 * T[1]);
 157.365 +    REG_TYPE  r3     = MULT_NORM(r1     * T[1]   - r0 * T[0]);
 157.366 +
 157.367 +              w1    -= 4;
 157.368 +
 157.369 +              r0     = HALVE(x0[1] + x1[1]);
 157.370 +              r1     = HALVE(x0[0] - x1[0]);
 157.371 +
 157.372 +              w0[0]  = r0     + r2;
 157.373 +              w1[2]  = r0     - r2;
 157.374 +              w0[1]  = r1     + r3;
 157.375 +              w1[3]  = r3     - r1;
 157.376 +
 157.377 +              x0     = x+bit[2];
 157.378 +              x1     = x+bit[3];
 157.379 +
 157.380 +              r0     = x0[1]  - x1[1];
 157.381 +              r1     = x0[0]  + x1[0];
 157.382 +              r2     = MULT_NORM(r1     * T[2]   + r0 * T[3]);
 157.383 +              r3     = MULT_NORM(r1     * T[3]   - r0 * T[2]);
 157.384 +
 157.385 +              r0     = HALVE(x0[1] + x1[1]);
 157.386 +              r1     = HALVE(x0[0] - x1[0]);
 157.387 +
 157.388 +              w0[2]  = r0     + r2;
 157.389 +              w1[0]  = r0     - r2;
 157.390 +              w0[3]  = r1     + r3;
 157.391 +              w1[1]  = r3     - r1;
 157.392 +
 157.393 +              T     += 4;
 157.394 +              bit   += 4;
 157.395 +              w0    += 4;
 157.396 +
 157.397 +  }while(w0<w1);
 157.398 +}
 157.399 +
 157.400 +void mdct_backward(mdct_lookup *init, DATA_TYPE *in, DATA_TYPE *out){
 157.401 +  int n=init->n;
 157.402 +  int n2=n>>1;
 157.403 +  int n4=n>>2;
 157.404 +
 157.405 +  /* rotate */
 157.406 +
 157.407 +  DATA_TYPE *iX = in+n2-7;
 157.408 +  DATA_TYPE *oX = out+n2+n4;
 157.409 +  DATA_TYPE *T  = init->trig+n4;
 157.410 +
 157.411 +  do{
 157.412 +    oX         -= 4;
 157.413 +    oX[0]       = MULT_NORM(-iX[2] * T[3] - iX[0]  * T[2]);
 157.414 +    oX[1]       = MULT_NORM (iX[0] * T[3] - iX[2]  * T[2]);
 157.415 +    oX[2]       = MULT_NORM(-iX[6] * T[1] - iX[4]  * T[0]);
 157.416 +    oX[3]       = MULT_NORM (iX[4] * T[1] - iX[6]  * T[0]);
 157.417 +    iX         -= 8;
 157.418 +    T          += 4;
 157.419 +  }while(iX>=in);
 157.420 +
 157.421 +  iX            = in+n2-8;
 157.422 +  oX            = out+n2+n4;
 157.423 +  T             = init->trig+n4;
 157.424 +
 157.425 +  do{
 157.426 +    T          -= 4;
 157.427 +    oX[0]       =  MULT_NORM (iX[4] * T[3] + iX[6] * T[2]);
 157.428 +    oX[1]       =  MULT_NORM (iX[4] * T[2] - iX[6] * T[3]);
 157.429 +    oX[2]       =  MULT_NORM (iX[0] * T[1] + iX[2] * T[0]);
 157.430 +    oX[3]       =  MULT_NORM (iX[0] * T[0] - iX[2] * T[1]);
 157.431 +    iX         -= 8;
 157.432 +    oX         += 4;
 157.433 +  }while(iX>=in);
 157.434 +
 157.435 +  mdct_butterflies(init,out+n2,n2);
 157.436 +  mdct_bitreverse(init,out);
 157.437 +
 157.438 +  /* roatate + window */
 157.439 +
 157.440 +  {
 157.441 +    DATA_TYPE *oX1=out+n2+n4;
 157.442 +    DATA_TYPE *oX2=out+n2+n4;
 157.443 +    DATA_TYPE *iX =out;
 157.444 +    T             =init->trig+n2;
 157.445 +
 157.446 +    do{
 157.447 +      oX1-=4;
 157.448 +
 157.449 +      oX1[3]  =  MULT_NORM (iX[0] * T[1] - iX[1] * T[0]);
 157.450 +      oX2[0]  = -MULT_NORM (iX[0] * T[0] + iX[1] * T[1]);
 157.451 +
 157.452 +      oX1[2]  =  MULT_NORM (iX[2] * T[3] - iX[3] * T[2]);
 157.453 +      oX2[1]  = -MULT_NORM (iX[2] * T[2] + iX[3] * T[3]);
 157.454 +
 157.455 +      oX1[1]  =  MULT_NORM (iX[4] * T[5] - iX[5] * T[4]);
 157.456 +      oX2[2]  = -MULT_NORM (iX[4] * T[4] + iX[5] * T[5]);
 157.457 +
 157.458 +      oX1[0]  =  MULT_NORM (iX[6] * T[7] - iX[7] * T[6]);
 157.459 +      oX2[3]  = -MULT_NORM (iX[6] * T[6] + iX[7] * T[7]);
 157.460 +
 157.461 +      oX2+=4;
 157.462 +      iX    +=   8;
 157.463 +      T     +=   8;
 157.464 +    }while(iX<oX1);
 157.465 +
 157.466 +    iX=out+n2+n4;
 157.467 +    oX1=out+n4;
 157.468 +    oX2=oX1;
 157.469 +
 157.470 +    do{
 157.471 +      oX1-=4;
 157.472 +      iX-=4;
 157.473 +
 157.474 +      oX2[0] = -(oX1[3] = iX[3]);
 157.475 +      oX2[1] = -(oX1[2] = iX[2]);
 157.476 +      oX2[2] = -(oX1[1] = iX[1]);
 157.477 +      oX2[3] = -(oX1[0] = iX[0]);
 157.478 +
 157.479 +      oX2+=4;
 157.480 +    }while(oX2<iX);
 157.481 +
 157.482 +    iX=out+n2+n4;
 157.483 +    oX1=out+n2+n4;
 157.484 +    oX2=out+n2;
 157.485 +    do{
 157.486 +      oX1-=4;
 157.487 +      oX1[0]= iX[3];
 157.488 +      oX1[1]= iX[2];
 157.489 +      oX1[2]= iX[1];
 157.490 +      oX1[3]= iX[0];
 157.491 +      iX+=4;
 157.492 +    }while(oX1>oX2);
 157.493 +  }
 157.494 +}
 157.495 +
 157.496 +void mdct_forward(mdct_lookup *init, DATA_TYPE *in, DATA_TYPE *out){
 157.497 +  int n=init->n;
 157.498 +  int n2=n>>1;
 157.499 +  int n4=n>>2;
 157.500 +  int n8=n>>3;
 157.501 +  DATA_TYPE *w=alloca(n*sizeof(*w)); /* forward needs working space */
 157.502 +  DATA_TYPE *w2=w+n2;
 157.503 +
 157.504 +  /* rotate */
 157.505 +
 157.506 +  /* window + rotate + step 1 */
 157.507 +
 157.508 +  REG_TYPE r0;
 157.509 +  REG_TYPE r1;
 157.510 +  DATA_TYPE *x0=in+n2+n4;
 157.511 +  DATA_TYPE *x1=x0+1;
 157.512 +  DATA_TYPE *T=init->trig+n2;
 157.513 +
 157.514 +  int i=0;
 157.515 +
 157.516 +  for(i=0;i<n8;i+=2){
 157.517 +    x0 -=4;
 157.518 +    T-=2;
 157.519 +    r0= x0[2] + x1[0];
 157.520 +    r1= x0[0] + x1[2];
 157.521 +    w2[i]=   MULT_NORM(r1*T[1] + r0*T[0]);
 157.522 +    w2[i+1]= MULT_NORM(r1*T[0] - r0*T[1]);
 157.523 +    x1 +=4;
 157.524 +  }
 157.525 +
 157.526 +  x1=in+1;
 157.527 +
 157.528 +  for(;i<n2-n8;i+=2){
 157.529 +    T-=2;
 157.530 +    x0 -=4;
 157.531 +    r0= x0[2] - x1[0];
 157.532 +    r1= x0[0] - x1[2];
 157.533 +    w2[i]=   MULT_NORM(r1*T[1] + r0*T[0]);
 157.534 +    w2[i+1]= MULT_NORM(r1*T[0] - r0*T[1]);
 157.535 +    x1 +=4;
 157.536 +  }
 157.537 +
 157.538 +  x0=in+n;
 157.539 +
 157.540 +  for(;i<n2;i+=2){
 157.541 +    T-=2;
 157.542 +    x0 -=4;
 157.543 +    r0= -x0[2] - x1[0];
 157.544 +    r1= -x0[0] - x1[2];
 157.545 +    w2[i]=   MULT_NORM(r1*T[1] + r0*T[0]);
 157.546 +    w2[i+1]= MULT_NORM(r1*T[0] - r0*T[1]);
 157.547 +    x1 +=4;
 157.548 +  }
 157.549 +
 157.550 +
 157.551 +  mdct_butterflies(init,w+n2,n2);
 157.552 +  mdct_bitreverse(init,w);
 157.553 +
 157.554 +  /* roatate + window */
 157.555 +
 157.556 +  T=init->trig+n2;
 157.557 +  x0=out+n2;
 157.558 +
 157.559 +  for(i=0;i<n4;i++){
 157.560 +    x0--;
 157.561 +    out[i] =MULT_NORM((w[0]*T[0]+w[1]*T[1])*init->scale);
 157.562 +    x0[0]  =MULT_NORM((w[0]*T[1]-w[1]*T[0])*init->scale);
 157.563 +    w+=2;
 157.564 +    T+=2;
 157.565 +  }
 157.566 +}
   158.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   158.2 +++ b/libs/vorbis/mdct.h	Sun Nov 01 00:36:56 2015 +0200
   158.3 @@ -0,0 +1,71 @@
   158.4 +/********************************************************************
   158.5 + *                                                                  *
   158.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   158.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   158.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   158.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  158.10 + *                                                                  *
  158.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
  158.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  158.13 + *                                                                  *
  158.14 + ********************************************************************
  158.15 +
  158.16 + function: modified discrete cosine transform prototypes
  158.17 + last mod: $Id: mdct.h 16227 2009-07-08 06:58:46Z xiphmont $
  158.18 +
  158.19 + ********************************************************************/
  158.20 +
  158.21 +#ifndef _OGG_mdct_H_
  158.22 +#define _OGG_mdct_H_
  158.23 +
  158.24 +#include "vorbis/codec.h"
  158.25 +
  158.26 +
  158.27 +
  158.28 +
  158.29 +
  158.30 +/*#define MDCT_INTEGERIZED  <- be warned there could be some hurt left here*/
  158.31 +#ifdef MDCT_INTEGERIZED
  158.32 +
  158.33 +#define DATA_TYPE int
  158.34 +#define REG_TYPE  register int
  158.35 +#define TRIGBITS 14
  158.36 +#define cPI3_8 6270
  158.37 +#define cPI2_8 11585
  158.38 +#define cPI1_8 15137
  158.39 +
  158.40 +#define FLOAT_CONV(x) ((int)((x)*(1<<TRIGBITS)+.5))
  158.41 +#define MULT_NORM(x) ((x)>>TRIGBITS)
  158.42 +#define HALVE(x) ((x)>>1)
  158.43 +
  158.44 +#else
  158.45 +
  158.46 +#define DATA_TYPE float
  158.47 +#define REG_TYPE  float
  158.48 +#define cPI3_8 .38268343236508977175F
  158.49 +#define cPI2_8 .70710678118654752441F
  158.50 +#define cPI1_8 .92387953251128675613F
  158.51 +
  158.52 +#define FLOAT_CONV(x) (x)
  158.53 +#define MULT_NORM(x) (x)
  158.54 +#define HALVE(x) ((x)*.5f)
  158.55 +
  158.56 +#endif
  158.57 +
  158.58 +
  158.59 +typedef struct {
  158.60 +  int n;
  158.61 +  int log2n;
  158.62 +
  158.63 +  DATA_TYPE *trig;
  158.64 +  int       *bitrev;
  158.65 +
  158.66 +  DATA_TYPE scale;
  158.67 +} mdct_lookup;
  158.68 +
  158.69 +extern void mdct_init(mdct_lookup *lookup,int n);
  158.70 +extern void mdct_clear(mdct_lookup *l);
  158.71 +extern void mdct_forward(mdct_lookup *init, DATA_TYPE *in, DATA_TYPE *out);
  158.72 +extern void mdct_backward(mdct_lookup *init, DATA_TYPE *in, DATA_TYPE *out);
  158.73 +
  158.74 +#endif
   159.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   159.2 +++ b/libs/vorbis/misc.h	Sun Nov 01 00:36:56 2015 +0200
   159.3 @@ -0,0 +1,57 @@
   159.4 +/********************************************************************
   159.5 + *                                                                  *
   159.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   159.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   159.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   159.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  159.10 + *                                                                  *
  159.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
  159.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  159.13 + *                                                                  *
  159.14 + ********************************************************************
  159.15 +
  159.16 + function: miscellaneous prototypes
  159.17 + last mod: $Id: misc.h 16227 2009-07-08 06:58:46Z xiphmont $
  159.18 +
  159.19 + ********************************************************************/
  159.20 +
  159.21 +#ifndef _V_RANDOM_H_
  159.22 +#define _V_RANDOM_H_
  159.23 +#include "vorbis/codec.h"
  159.24 +
  159.25 +extern void *_vorbis_block_alloc(vorbis_block *vb,long bytes);
  159.26 +extern void _vorbis_block_ripcord(vorbis_block *vb);
  159.27 +
  159.28 +#ifdef ANALYSIS
  159.29 +extern int analysis_noisy;
  159.30 +extern void _analysis_output(char *base,int i,float *v,int n,int bark,int dB,
  159.31 +                             ogg_int64_t off);
  159.32 +extern void _analysis_output_always(char *base,int i,float *v,int n,int bark,int dB,
  159.33 +                             ogg_int64_t off);
  159.34 +#endif
  159.35 +
  159.36 +#ifdef DEBUG_MALLOC
  159.37 +
  159.38 +#define _VDBG_GRAPHFILE "malloc.m"
  159.39 +#undef _VDBG_GRAPHFILE
  159.40 +extern void *_VDBG_malloc(void *ptr,long bytes,char *file,long line);
  159.41 +extern void _VDBG_free(void *ptr,char *file,long line);
  159.42 +
  159.43 +#ifndef MISC_C
  159.44 +#undef _ogg_malloc
  159.45 +#undef _ogg_calloc
  159.46 +#undef _ogg_realloc
  159.47 +#undef _ogg_free
  159.48 +
  159.49 +#define _ogg_malloc(x) _VDBG_malloc(NULL,(x),__FILE__,__LINE__)
  159.50 +#define _ogg_calloc(x,y) _VDBG_malloc(NULL,(x)*(y),__FILE__,__LINE__)
  159.51 +#define _ogg_realloc(x,y) _VDBG_malloc((x),(y),__FILE__,__LINE__)
  159.52 +#define _ogg_free(x) _VDBG_free((x),__FILE__,__LINE__)
  159.53 +#endif
  159.54 +#endif
  159.55 +
  159.56 +#endif
  159.57 +
  159.58 +
  159.59 +
  159.60 +
   160.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   160.2 +++ b/libs/vorbis/modes/floor_all.h	Sun Nov 01 00:36:56 2015 +0200
   160.3 @@ -0,0 +1,260 @@
   160.4 +/********************************************************************
   160.5 + *                                                                  *
   160.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   160.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   160.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   160.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  160.10 + *                                                                  *
  160.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
  160.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  160.13 + *                                                                  *
  160.14 + ********************************************************************
  160.15 +
  160.16 + function: key floor settings
  160.17 + last mod: $Id: floor_all.h 17050 2010-03-26 01:34:42Z xiphmont $
  160.18 +
  160.19 + ********************************************************************/
  160.20 +
  160.21 +#include "vorbis/codec.h"
  160.22 +#include "backends.h"
  160.23 +#include "books/floor/floor_books.h"
  160.24 +
  160.25 +static const static_codebook*const _floor_128x4_books[]={
  160.26 +  &_huff_book_line_128x4_class0,
  160.27 +  &_huff_book_line_128x4_0sub0,
  160.28 +  &_huff_book_line_128x4_0sub1,
  160.29 +  &_huff_book_line_128x4_0sub2,
  160.30 +  &_huff_book_line_128x4_0sub3,
  160.31 +};
  160.32 +static const static_codebook*const _floor_256x4_books[]={
  160.33 +  &_huff_book_line_256x4_class0,
  160.34 +  &_huff_book_line_256x4_0sub0,
  160.35 +  &_huff_book_line_256x4_0sub1,
  160.36 +  &_huff_book_line_256x4_0sub2,
  160.37 +  &_huff_book_line_256x4_0sub3,
  160.38 +};
  160.39 +static const static_codebook*const _floor_128x7_books[]={
  160.40 +  &_huff_book_line_128x7_class0,
  160.41 +  &_huff_book_line_128x7_class1,
  160.42 +
  160.43 +  &_huff_book_line_128x7_0sub1,
  160.44 +  &_huff_book_line_128x7_0sub2,
  160.45 +  &_huff_book_line_128x7_0sub3,
  160.46 +  &_huff_book_line_128x7_1sub1,
  160.47 +  &_huff_book_line_128x7_1sub2,
  160.48 +  &_huff_book_line_128x7_1sub3,
  160.49 +};
  160.50 +static const static_codebook*const _floor_256x7_books[]={
  160.51 +  &_huff_book_line_256x7_class0,
  160.52 +  &_huff_book_line_256x7_class1,
  160.53 +
  160.54 +  &_huff_book_line_256x7_0sub1,
  160.55 +  &_huff_book_line_256x7_0sub2,
  160.56 +  &_huff_book_line_256x7_0sub3,
  160.57 +  &_huff_book_line_256x7_1sub1,
  160.58 +  &_huff_book_line_256x7_1sub2,
  160.59 +  &_huff_book_line_256x7_1sub3,
  160.60 +};
  160.61 +static const static_codebook*const _floor_128x11_books[]={
  160.62 +  &_huff_book_line_128x11_class1,
  160.63 +  &_huff_book_line_128x11_class2,
  160.64 +  &_huff_book_line_128x11_class3,
  160.65 +
  160.66 +  &_huff_book_line_128x11_0sub0,
  160.67 +  &_huff_book_line_128x11_1sub0,
  160.68 +  &_huff_book_line_128x11_1sub1,
  160.69 +  &_huff_book_line_128x11_2sub1,
  160.70 +  &_huff_book_line_128x11_2sub2,
  160.71 +  &_huff_book_line_128x11_2sub3,
  160.72 +  &_huff_book_line_128x11_3sub1,
  160.73 +  &_huff_book_line_128x11_3sub2,
  160.74 +  &_huff_book_line_128x11_3sub3,
  160.75 +};
  160.76 +static const static_codebook*const _floor_128x17_books[]={
  160.77 +  &_huff_book_line_128x17_class1,
  160.78 +  &_huff_book_line_128x17_class2,
  160.79 +  &_huff_book_line_128x17_class3,
  160.80 +
  160.81 +  &_huff_book_line_128x17_0sub0,
  160.82 +  &_huff_book_line_128x17_1sub0,
  160.83 +  &_huff_book_line_128x17_1sub1,
  160.84 +  &_huff_book_line_128x17_2sub1,
  160.85 +  &_huff_book_line_128x17_2sub2,
  160.86 +  &_huff_book_line_128x17_2sub3,
  160.87 +  &_huff_book_line_128x17_3sub1,
  160.88 +  &_huff_book_line_128x17_3sub2,
  160.89 +  &_huff_book_line_128x17_3sub3,
  160.90 +};
  160.91 +static const static_codebook*const _floor_256x4low_books[]={
  160.92 +  &_huff_book_line_256x4low_class0,
  160.93 +  &_huff_book_line_256x4low_0sub0,
  160.94 +  &_huff_book_line_256x4low_0sub1,
  160.95 +  &_huff_book_line_256x4low_0sub2,
  160.96 +  &_huff_book_line_256x4low_0sub3,
  160.97 +};
  160.98 +static const static_codebook*const _floor_1024x27_books[]={
  160.99 +  &_huff_book_line_1024x27_class1,
 160.100 +  &_huff_book_line_1024x27_class2,
 160.101 +  &_huff_book_line_1024x27_class3,
 160.102 +  &_huff_book_line_1024x27_class4,
 160.103 +
 160.104 +  &_huff_book_line_1024x27_0sub0,
 160.105 +  &_huff_book_line_1024x27_1sub0,
 160.106 +  &_huff_book_line_1024x27_1sub1,
 160.107 +  &_huff_book_line_1024x27_2sub0,
 160.108 +  &_huff_book_line_1024x27_2sub1,
 160.109 +  &_huff_book_line_1024x27_3sub1,
 160.110 +  &_huff_book_line_1024x27_3sub2,
 160.111 +  &_huff_book_line_1024x27_3sub3,
 160.112 +  &_huff_book_line_1024x27_4sub1,
 160.113 +  &_huff_book_line_1024x27_4sub2,
 160.114 +  &_huff_book_line_1024x27_4sub3,
 160.115 +};
 160.116 +static const static_codebook*const _floor_2048x27_books[]={
 160.117 +  &_huff_book_line_2048x27_class1,
 160.118 +  &_huff_book_line_2048x27_class2,
 160.119 +  &_huff_book_line_2048x27_class3,
 160.120 +  &_huff_book_line_2048x27_class4,
 160.121 +
 160.122 +  &_huff_book_line_2048x27_0sub0,
 160.123 +  &_huff_book_line_2048x27_1sub0,
 160.124 +  &_huff_book_line_2048x27_1sub1,
 160.125 +  &_huff_book_line_2048x27_2sub0,
 160.126 +  &_huff_book_line_2048x27_2sub1,
 160.127 +  &_huff_book_line_2048x27_3sub1,
 160.128 +  &_huff_book_line_2048x27_3sub2,
 160.129 +  &_huff_book_line_2048x27_3sub3,
 160.130 +  &_huff_book_line_2048x27_4sub1,
 160.131 +  &_huff_book_line_2048x27_4sub2,
 160.132 +  &_huff_book_line_2048x27_4sub3,
 160.133 +};
 160.134 +
 160.135 +static const static_codebook*const _floor_512x17_books[]={
 160.136 +  &_huff_book_line_512x17_class1,
 160.137 +  &_huff_book_line_512x17_class2,
 160.138 +  &_huff_book_line_512x17_class3,
 160.139 +
 160.140 +  &_huff_book_line_512x17_0sub0,
 160.141 +  &_huff_book_line_512x17_1sub0,
 160.142 +  &_huff_book_line_512x17_1sub1,
 160.143 +  &_huff_book_line_512x17_2sub1,
 160.144 +  &_huff_book_line_512x17_2sub2,
 160.145 +  &_huff_book_line_512x17_2sub3,
 160.146 +  &_huff_book_line_512x17_3sub1,
 160.147 +  &_huff_book_line_512x17_3sub2,
 160.148 +  &_huff_book_line_512x17_3sub3,
 160.149 +};
 160.150 +
 160.151 +static const static_codebook*const _floor_Xx0_books[]={
 160.152 +  0
 160.153 +};
 160.154 +
 160.155 +static const static_codebook*const *const _floor_books[11]={
 160.156 +  _floor_128x4_books,
 160.157 +  _floor_256x4_books,
 160.158 +  _floor_128x7_books,
 160.159 +  _floor_256x7_books,
 160.160 +  _floor_128x11_books,
 160.161 +  _floor_128x17_books,
 160.162 +  _floor_256x4low_books,
 160.163 +  _floor_1024x27_books,
 160.164 +  _floor_2048x27_books,
 160.165 +  _floor_512x17_books,
 160.166 +  _floor_Xx0_books,
 160.167 +};
 160.168 +
 160.169 +static const vorbis_info_floor1 _floor[11]={
 160.170 +  /* 0: 128 x 4 */
 160.171 +  {
 160.172 +    1,{0},{4},{2},{0},
 160.173 +    {{1,2,3,4}},
 160.174 +    4,{0,128, 33,8,16,70},
 160.175 +
 160.176 +    60,30,500,   1.,18.,  128
 160.177 +  },
 160.178 +  /* 1: 256 x 4 */
 160.179 +  {
 160.180 +    1,{0},{4},{2},{0},
 160.181 +    {{1,2,3,4}},
 160.182 +    4,{0,256, 66,16,32,140},
 160.183 +
 160.184 +    60,30,500,   1.,18.,  256
 160.185 +  },
 160.186 +  /* 2: 128 x 7 */
 160.187 +  {
 160.188 +    2,{0,1},{3,4},{2,2},{0,1},
 160.189 +    {{-1,2,3,4},{-1,5,6,7}},
 160.190 +    4,{0,128, 14,4,58, 2,8,28,90},
 160.191 +
 160.192 +    60,30,500,   1.,18.,  128
 160.193 +  },
 160.194 +  /* 3: 256 x 7 */
 160.195 +  {
 160.196 +    2,{0,1},{3,4},{2,2},{0,1},
 160.197 +    {{-1,2,3,4},{-1,5,6,7}},
 160.198 +    4,{0,256, 28,8,116, 4,16,56,180},
 160.199 +
 160.200 +    60,30,500,   1.,18.,  256
 160.201 +  },
 160.202 +  /* 4: 128 x 11 */
 160.203 +  {
 160.204 +    4,{0,1,2,3},{2,3,3,3},{0,1,2,2},{-1,0,1,2},
 160.205 +    {{3},{4,5},{-1,6,7,8},{-1,9,10,11}},
 160.206 +
 160.207 +    2,{0,128,  8,33,  4,16,70,  2,6,12,  23,46,90},
 160.208 +
 160.209 +     60,30,500,   1,18.,  128
 160.210 +  },
 160.211 +  /* 5: 128 x 17 */
 160.212 +  {
 160.213 +    6,{0,1,1,2,3,3},{2,3,3,3},{0,1,2,2},{-1,0,1,2},
 160.214 +    {{3},{4,5},{-1,6,7,8},{-1,9,10,11}},
 160.215 +    2,{0,128,  12,46,  4,8,16,  23,33,70,  2,6,10,  14,19,28,  39,58,90},
 160.216 +
 160.217 +    60,30,500,    1,18.,  128
 160.218 +  },
 160.219 +  /* 6: 256 x 4 (low bitrate version) */
 160.220 +  {
 160.221 +    1,{0},{4},{2},{0},
 160.222 +    {{1,2,3,4}},
 160.223 +    4,{0,256, 66,16,32,140},
 160.224 +
 160.225 +    60,30,500,   1.,18.,  256
 160.226 +  },
 160.227 +  /* 7: 1024 x 27 */
 160.228 +  {
 160.229 +    8,{0,1,2,2,3,3,4,4},{3,4,3,4,3},{0,1,1,2,2},{-1,0,1,2,3},
 160.230 +    {{4},{5,6},{7,8},{-1,9,10,11},{-1,12,13,14}},
 160.231 +    2,{0,1024,   93,23,372, 6,46,186,750,  14,33,65, 130,260,556,
 160.232 +       3,10,18,28,  39,55,79,111,  158,220,312,  464,650,850},
 160.233 +
 160.234 +    60,30,500,    3,18.,  1024
 160.235 +  },
 160.236 +  /* 8: 2048 x 27 */
 160.237 +  {
 160.238 +    8,{0,1,2,2,3,3,4,4},{3,4,3,4,3},{0,1,1,2,2},{-1,0,1,2,3},
 160.239 +    {{4},{5,6},{7,8},{-1,9,10,11},{-1,12,13,14}},
 160.240 +    2,{0,2048,   186,46,744, 12,92,372,1500,  28,66,130, 260,520,1112,
 160.241 +       6,20,36,56,  78,110,158,222,  316,440,624,  928,1300,1700},
 160.242 +
 160.243 +    60,30,500,    3,18.,  2048
 160.244 +  },
 160.245 +  /* 9: 512 x 17 */
 160.246 +  {
 160.247 +    6,{0,1,1,2,3,3},{2,3,3,3},{0,1,2,2},{-1,0,1,2},
 160.248 +    {{3},{4,5},{-1,6,7,8},{-1,9,10,11}},
 160.249 +    2,{0,512,  46,186,  16,33,65,  93,130,278,
 160.250 +       7,23,39,  55,79,110,  156,232,360},
 160.251 +
 160.252 +    60,30,500,    1,18.,  512
 160.253 +  },
 160.254 +
 160.255 +  /* 10: X x 0 (LFE floor; edge posts only) */
 160.256 +  {
 160.257 +    0,{0}, {0},{0},{-1},
 160.258 +    {{-1}},
 160.259 +    2,{0,12},
 160.260 +    60,30,500,   1.,18.,  10
 160.261 +  },
 160.262 +
 160.263 +};
   161.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   161.2 +++ b/libs/vorbis/modes/psych_11.h	Sun Nov 01 00:36:56 2015 +0200
   161.3 @@ -0,0 +1,51 @@
   161.4 +/********************************************************************
   161.5 + *                                                                  *
   161.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   161.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   161.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   161.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  161.10 + *                                                                  *
  161.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
  161.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  161.13 + *                                                                  *
  161.14 + ********************************************************************
  161.15 +
  161.16 + function: 11kHz settings
  161.17 + last mod: $Id: psych_11.h 16227 2009-07-08 06:58:46Z xiphmont $
  161.18 +
  161.19 + ********************************************************************/
  161.20 +
  161.21 +static const double _psy_lowpass_11[3]={4.5,5.5,30.,};
  161.22 +
  161.23 +static const att3 _psy_tone_masteratt_11[3]={
  161.24 +  {{ 30,  25,  12},  0,   0},  /* 0 */
  161.25 +  {{ 30,  25,  12},  0,   0},  /* 0 */
  161.26 +  {{ 20,   0, -14},  0,   0}, /* 0 */
  161.27 +};
  161.28 +
  161.29 +static const vp_adjblock _vp_tonemask_adj_11[3]={
  161.30 +  /* adjust for mode zero */
  161.31 +  /* 63     125     250     500     1     2     4     8    16 */
  161.32 +  {{-20,-20,-20,-20,-20,-16,-10, 0, 0, 0, 0,10, 2, 0,99,99,99}}, /* 0 */
  161.33 +  {{-20,-20,-20,-20,-20,-16,-10, 0, 0, 0, 0, 5, 0, 0,99,99,99}}, /* 1 */
  161.34 +  {{-20,-20,-20,-20,-20,-16,-10, 0, 0, 0, 0, 0, 0, 0,99,99,99}}, /* 2 */
  161.35 +};
  161.36 +
  161.37 +
  161.38 +static const noise3 _psy_noisebias_11[3]={
  161.39 +  /*  63     125     250     500      1k       2k      4k      8k     16k*/
  161.40 +  {{{-10,-10,-10,-10, -5, -5, -5,  0,  4, 10, 10, 12, 12, 12, 99, 99, 99},
  161.41 +    {-15,-15,-15,-15,-10,-10, -5,  0,  0,  4,  4,  5,  5, 10, 99, 99, 99},
  161.42 +    {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, 99, 99, 99}}},
  161.43 +
  161.44 +  {{{-10,-10,-10,-10, -5, -5, -5,  0,  4, 10, 10, 12, 12, 12, 99, 99, 99},
  161.45 +    {-15,-15,-15,-15,-10,-10, -5, -5, -5,  0,  0,  0,  0,  0, 99, 99, 99},
  161.46 +    {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, 99, 99, 99}}},
  161.47 +
  161.48 +  {{{-15,-15,-15,-15,-15,-12,-10, -8,  0,  2,  4,  4,  5,  5, 99, 99, 99},
  161.49 +    {-30,-30,-30,-30,-26,-22,-20,-14,-12,-12,-10,-10,-10,-10, 99, 99, 99},
  161.50 +    {-30,-30,-30,-30,-26,-26,-26,-26,-26,-26,-26,-26,-26,-24, 99, 99, 99}}},
  161.51 +};
  161.52 +
  161.53 +static const double _noise_thresh_11[3]={ .3,.5,.5 };
  161.54 +
   162.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   162.2 +++ b/libs/vorbis/modes/psych_16.h	Sun Nov 01 00:36:56 2015 +0200
   162.3 @@ -0,0 +1,133 @@
   162.4 +/********************************************************************
   162.5 + *                                                                  *
   162.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   162.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   162.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   162.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  162.10 + *                                                                  *
  162.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
  162.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  162.13 + *                                                                  *
  162.14 + ********************************************************************
  162.15 +
  162.16 + function: 16kHz settings
  162.17 + last mod: $Id: psych_16.h 16227 2009-07-08 06:58:46Z xiphmont $
  162.18 +
  162.19 + ********************************************************************/
  162.20 +
  162.21 +/* stereo mode by base quality level */
  162.22 +static const adj_stereo _psy_stereo_modes_16[4]={
  162.23 +  /*  0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  */
  162.24 +  {{  4,  4,  4,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3},
  162.25 +   {  6,  5,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4},
  162.26 +   {  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  3,  3,  4,  4},
  162.27 +   { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
  162.28 +  {{  4,  4,  4,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3},
  162.29 +   {  6,  5,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4},
  162.30 +   {  2,  2,  2,  2,  2,  2,  2,  2,  2,  3,  4,  4,  4,  4,  4},
  162.31 +   { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
  162.32 +  {{  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3},
  162.33 +   {  5,  4,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3},
  162.34 +   {  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4},
  162.35 +   { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
  162.36 +  {{  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
  162.37 +   {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
  162.38 +   {  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8},
  162.39 +   { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
  162.40 +};
  162.41 +
  162.42 +static const double _psy_lowpass_16[4]={6.5,8,30.,99.};
  162.43 +
  162.44 +static const att3 _psy_tone_masteratt_16[4]={
  162.45 +  {{ 30,  25,  12},  0,   0},  /* 0 */
  162.46 +  {{ 25,  22,  12},  0,   0},  /* 0 */
  162.47 +  {{ 20,  12,   0},  0,   0},  /* 0 */
  162.48 +  {{ 15,   0, -14},  0,   0}, /* 0 */
  162.49 +};
  162.50 +
  162.51 +static const vp_adjblock _vp_tonemask_adj_16[4]={
  162.52 +  /* adjust for mode zero */
  162.53 +  /* 63     125     250     500       1     2     4     8    16 */
  162.54 +  {{-20,-20,-20,-20,-20,-16,-10,  0,  0, 0, 0,10, 0, 0, 0, 0, 0}}, /* 0 */
  162.55 +  {{-20,-20,-20,-20,-20,-16,-10,  0,  0, 0, 0,10, 0, 0, 0, 0, 0}}, /* 1 */
  162.56 +  {{-20,-20,-20,-20,-20,-16,-10,  0,  0, 0, 0, 0, 0, 0, 0, 0, 0}}, /* 2 */
  162.57 +  {{-30,-30,-30,-30,-30,-26,-20,-10, -5, 0, 0, 0, 0, 0, 0, 0, 0}}, /* 2 */
  162.58 +};
  162.59 +
  162.60 +
  162.61 +static const noise3 _psy_noisebias_16_short[4]={
  162.62 +  /*  63     125     250     500      1k       2k      4k      8k     16k*/
  162.63 +  {{{-15,-15,-15,-15,-15,-10,-10,-5,   4, 10, 10, 10, 10, 12, 12, 14, 20},
  162.64 +    {-15,-15,-15,-15,-15,-10,-10, -5,  0,  0,  4,  5,  5,  6,  8,  8, 15},
  162.65 +    {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -6, -6}}},
  162.66 +
  162.67 +  {{{-15,-15,-15,-15,-15,-10,-10,-5,   4,  6,  6,  6,  6,  8, 10, 12, 20},
  162.68 +    {-15,-15,-15,-15,-15,-15,-15,-10, -5, -5, -5,  4,  5,  6,  8,  8, 15},
  162.69 +    {-30,-30,-30,-30,-30,-24,-20,-14,-10,-10,-10,-10,-10,-10,-10,-10,-10}}},
  162.70 +
  162.71 +  {{{-15,-15,-15,-15,-15,-12,-10, -8,  0,  2,  4,  4,  5,  5,  5,  8, 12},
  162.72 +    {-20,-20,-20,-20,-16,-12,-20,-14,-10,-10, -8,  0,  0,  0,  0,  2,  5},
  162.73 +    {-30,-30,-30,-30,-26,-26,-26,-26,-26,-26,-26,-26,-26,-24,-20,-20,-20}}},
  162.74 +
  162.75 +  {{{-15,-15,-15,-15,-15,-12,-10, -8, -5, -5, -5, -5, -5,  0,  0,  0,  6},
  162.76 +    {-30,-30,-30,-30,-26,-22,-20,-14,-12,-12,-10,-10,-10,-10,-10,-10, -6},
  162.77 +    {-30,-30,-30,-30,-26,-26,-26,-26,-26,-26,-26,-26,-26,-24,-20,-20,-20}}},
  162.78 +};
  162.79 +
  162.80 +static const noise3 _psy_noisebias_16_impulse[4]={
  162.81 +  /*  63     125     250     500      1k       2k      4k      8k     16k*/
  162.82 +  {{{-15,-15,-15,-15,-15,-10,-10,-5,   4, 10, 10, 10, 10, 12, 12, 14, 20},
  162.83 +    {-15,-15,-15,-15,-15,-10,-10, -5,  0,  0,  4,  5,  5,  6,  8,  8, 15},
  162.84 +    {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -6, -6}}},
  162.85 +
  162.86 +  {{{-15,-15,-15,-15,-15,-10,-10,-5,   4,  4,  4,  4,  5,  5,  6,  8, 15},
  162.87 +    {-15,-15,-15,-15,-15,-15,-15,-10, -5, -5, -5,  0,  0,  0,  0,  4, 10},
  162.88 +    {-30,-30,-30,-30,-30,-24,-20,-14,-10,-10,-10,-10,-10,-10,-10,-10,-10}}},
  162.89 +
  162.90 +  {{{-15,-15,-15,-15,-15,-12,-10, -8,  0,  0,  0,  0,  0,  0,  0,  4, 10},
  162.91 +    {-20,-20,-20,-20,-16,-12,-20,-14,-10,-10,-10,-10,-10,-10,-10, -7, -5},
  162.92 +    {-30,-30,-30,-30,-26,-26,-26,-26,-26,-26,-26,-26,-26,-24,-20,-20,-20}}},
  162.93 +
  162.94 +  {{{-15,-15,-15,-15,-15,-12,-10, -8, -5, -5, -5, -5, -5,  0,  0,  0,  6},
  162.95 +    {-30,-30,-30,-30,-26,-22,-20,-18,-18,-18,-20,-20,-20,-20,-20,-20,-16},
  162.96 +    {-30,-30,-30,-30,-26,-26,-26,-26,-26,-26,-26,-26,-26,-24,-20,-20,-20}}},
  162.97 +};
  162.98 +
  162.99 +static const noise3 _psy_noisebias_16[4]={
 162.100 +  /*  63     125     250     500      1k       2k      4k      8k     16k*/
 162.101 +  {{{-10,-10,-10,-10, -5, -5, -5,  0,  4,  6,  8,  8, 10, 10, 10, 14, 20},
 162.102 +    {-10,-10,-10,-10,-10, -5, -2, -2,  0,  0,  0,  4,  5,  6,  8,  8, 15},
 162.103 +    {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -6, -6}}},
 162.104 +
 162.105 +  {{{-10,-10,-10,-10, -5, -5, -5,  0,  4,  6,  6,  6,  6,  8, 10, 12, 20},
 162.106 +    {-15,-15,-15,-15,-15,-10, -5, -5,  0,  0,  0,  4,  5,  6,  8,  8, 15},
 162.107 +    {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -6, -6}}},
 162.108 +
 162.109 +  {{{-15,-15,-15,-15,-15,-12,-10, -8,  0,  2,  4,  4,  5,  5,  5,  8, 12},
 162.110 +    {-20,-20,-20,-20,-16,-12,-20,-10, -5, -5,  0,  0,  0,  0,  0,  2,  5},
 162.111 +    {-30,-30,-30,-30,-26,-26,-26,-26,-26,-26,-26,-26,-26,-24,-20,-20,-20}}},
 162.112 +
 162.113 +  {{{-15,-15,-15,-15,-15,-12,-10, -8, -5, -5, -5, -5, -5,  0,  0,  0,  6},
 162.114 +    {-30,-30,-30,-30,-26,-22,-20,-14,-12,-12,-10,-10,-10,-10,-10,-10, -6},
 162.115 +    {-30,-30,-30,-30,-26,-26,-26,-26,-26,-26,-26,-26,-26,-24,-20,-20,-20}}},
 162.116 +};
 162.117 +
 162.118 +static const noiseguard _psy_noiseguards_16[4]={
 162.119 +  {10,10,-1},
 162.120 +  {10,10,-1},
 162.121 +  {20,20,-1},
 162.122 +  {20,20,-1},
 162.123 +};
 162.124 +
 162.125 +static const double _noise_thresh_16[4]={ .3,.5,.5,.5 };
 162.126 +
 162.127 +static const int _noise_start_16[3]={ 256,256,9999 };
 162.128 +static const int _noise_part_16[4]={ 8,8,8,8 };
 162.129 +
 162.130 +static const int _psy_ath_floater_16[4]={
 162.131 +  -100,-100,-100,-105,
 162.132 +};
 162.133 +
 162.134 +static const int _psy_ath_abs_16[4]={
 162.135 +  -130,-130,-130,-140,
 162.136 +};
   163.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   163.2 +++ b/libs/vorbis/modes/psych_44.h	Sun Nov 01 00:36:56 2015 +0200
   163.3 @@ -0,0 +1,642 @@
   163.4 +/********************************************************************
   163.5 + *                                                                  *
   163.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   163.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   163.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   163.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  163.10 + *                                                                  *
  163.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
  163.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  163.13 + *                                                                  *
  163.14 + ********************************************************************
  163.15 +
  163.16 + function: key psychoacoustic settings for 44.1/48kHz
  163.17 + last mod: $Id: psych_44.h 16962 2010-03-11 07:30:34Z xiphmont $
  163.18 +
  163.19 + ********************************************************************/
  163.20 +
  163.21 +
  163.22 +/* preecho trigger settings *****************************************/
  163.23 +
  163.24 +static const vorbis_info_psy_global _psy_global_44[5]={
  163.25 +
  163.26 +  {8,   /* lines per eighth octave */
  163.27 +   {20.f,14.f,12.f,12.f,12.f,12.f,12.f},
  163.28 +   {-60.f,-30.f,-40.f,-40.f,-40.f,-40.f,-40.f}, 2,-75.f,
  163.29 +   -6.f,
  163.30 +   {99.},{{99.},{99.}},{0},{0},{{0.},{0.}}
  163.31 +  },
  163.32 +  {8,   /* lines per eighth octave */
  163.33 +   {14.f,10.f,10.f,10.f,10.f,10.f,10.f},
  163.34 +   {-40.f,-30.f,-25.f,-25.f,-25.f,-25.f,-25.f}, 2,-80.f,
  163.35 +   -6.f,
  163.36 +   {99.},{{99.},{99.}},{0},{0},{{0.},{0.}}
  163.37 +  },
  163.38 +  {8,   /* lines per eighth octave */
  163.39 +   {12.f,10.f,10.f,10.f,10.f,10.f,10.f},
  163.40 +   {-20.f,-20.f,-15.f,-15.f,-15.f,-15.f,-15.f}, 0,-80.f,
  163.41 +   -6.f,
  163.42 +   {99.},{{99.},{99.}},{0},{0},{{0.},{0.}}
  163.43 +  },
  163.44 +  {8,   /* lines per eighth octave */
  163.45 +   {10.f,8.f,8.f,8.f,8.f,8.f,8.f},
  163.46 +   {-20.f,-15.f,-12.f,-12.f,-12.f,-12.f,-12.f}, 0,-80.f,
  163.47 +   -6.f,
  163.48 +   {99.},{{99.},{99.}},{0},{0},{{0.},{0.}}
  163.49 +  },
  163.50 +  {8,   /* lines per eighth octave */
  163.51 +   {10.f,6.f,6.f,6.f,6.f,6.f,6.f},
  163.52 +   {-15.f,-15.f,-12.f,-12.f,-12.f,-12.f,-12.f}, 0,-85.f,
  163.53 +   -6.f,
  163.54 +   {99.},{{99.},{99.}},{0},{0},{{0.},{0.}}
  163.55 +  },
  163.56 +};
  163.57 +
  163.58 +/* noise compander lookups * low, mid, high quality ****************/
  163.59 +static const compandblock _psy_compand_44[6]={
  163.60 +  /* sub-mode Z short */
  163.61 +  {{
  163.62 +    0, 1, 2, 3, 4, 5, 6,  7,     /* 7dB */
  163.63 +    8, 9,10,11,12,13,14, 15,     /* 15dB */
  163.64 +    16,17,18,19,20,21,22, 23,     /* 23dB */
  163.65 +    24,25,26,27,28,29,30, 31,     /* 31dB */
  163.66 +    32,33,34,35,36,37,38, 39,     /* 39dB */
  163.67 +  }},
  163.68 +  /* mode_Z nominal short */
  163.69 +  {{
  163.70 +     0, 1, 2, 3, 4, 5, 6,  6,     /* 7dB */
  163.71 +     7, 7, 7, 7, 6, 6, 6,  7,     /* 15dB */
  163.72 +     7, 8, 9,10,11,12,13, 14,     /* 23dB */
  163.73 +    15,16,17,17,17,18,18, 19,     /* 31dB */
  163.74 +    19,19,20,21,22,23,24, 25,     /* 39dB */
  163.75 +  }},
  163.76 +  /* mode A short */
  163.77 +  {{
  163.78 +    0, 1, 2, 3, 4, 5, 5,  5,     /* 7dB */
  163.79 +    6, 6, 6, 5, 4, 4, 4,  4,     /* 15dB */
  163.80 +    4, 4, 5, 5, 5, 6, 6,  6,     /* 23dB */
  163.81 +    7, 7, 7, 8, 8, 8, 9, 10,     /* 31dB */
  163.82 +    11,12,13,14,15,16,17, 18,     /* 39dB */
  163.83 +  }},
  163.84 +  /* sub-mode Z long */
  163.85 +  {{
  163.86 +     0, 1, 2, 3, 4, 5, 6,  7,     /* 7dB */
  163.87 +     8, 9,10,11,12,13,14, 15,     /* 15dB */
  163.88 +    16,17,18,19,20,21,22, 23,     /* 23dB */
  163.89 +    24,25,26,27,28,29,30, 31,     /* 31dB */
  163.90 +    32,33,34,35,36,37,38, 39,     /* 39dB */
  163.91 +  }},
  163.92 +  /* mode_Z nominal long */
  163.93 +  {{
  163.94 +    0, 1, 2, 3, 4, 5, 6,  7,     /* 7dB */
  163.95 +    8, 9,10,11,12,12,13, 13,     /* 15dB */
  163.96 +    13,14,14,14,15,15,15, 15,     /* 23dB */
  163.97 +    16,16,17,17,17,18,18, 19,     /* 31dB */
  163.98 +    19,19,20,21,22,23,24, 25,     /* 39dB */
  163.99 +  }},
 163.100 +  /* mode A long */
 163.101 +  {{
 163.102 +    0, 1, 2, 3, 4, 5, 6,  7,     /* 7dB */
 163.103 +    8, 8, 7, 6, 5, 4, 4,  4,     /* 15dB */
 163.104 +    4, 4, 5, 5, 5, 6, 6,  6,     /* 23dB */
 163.105 +    7, 7, 7, 8, 8, 8, 9, 10,     /* 31dB */
 163.106 +    11,12,13,14,15,16,17, 18,     /* 39dB */
 163.107 +  }}
 163.108 +};
 163.109 +
 163.110 +/* tonal masking curve level adjustments *************************/
 163.111 +
 163.112 +static const vp_adjblock _vp_tonemask_adj_longblock[12]={
 163.113 +
 163.114 +   /* 63     125     250     500       1       2       4       8      16 */
 163.115 +
 163.116 +   {{ -3, -8,-13,-15,-10,-10,-10,-10,-10,-10,-10,  0,  0,  0,  0,  0,  0}}, /* -1 */
 163.117 +
 163.118 +/* {{-15,-15,-15,-15,-10, -8, -4, -2,  0,  0,  0, 10,  0,  0,  0,  0,  0}},    0 */
 163.119 +   {{ -4,-10,-14,-16,-15,-14,-13,-12,-12,-12,-11, -1, -1, -1, -1, -1,  0}}, /* 0 */
 163.120 +
 163.121 +/* {{-15,-15,-15,-15,-15,-12,-10, -8,  0,  0,  0,  5,  0,  0,  0,  0,  0}},    1 */
 163.122 +   {{ -6,-12,-14,-16,-15,-15,-14,-13,-13,-12,-12, -2, -2, -1, -1, -1,  0}}, /* 1 */
 163.123 +
 163.124 +/* {{-15,-15,-15,-15,-15,-12,-10, -8,  0,  0,  0,  0,  0,  0,  0,  0,  0}},    2 */
 163.125 +   {{-12,-13,-14,-16,-16,-16,-15,-14,-13,-12,-12, -6, -3, -1, -1, -1,  0}}, /* 2 */
 163.126 +
 163.127 +/* {{-15,-15,-15,-15,-15,-12,-10, -8,  0,  0,  0,  0,  0,  0,  0,  0,  0}},    3 */
 163.128 +   {{-15,-15,-15,-16,-16,-16,-16,-14,-13,-13,-13,-10, -4, -2, -1, -1,  0}}, /* 3 */
 163.129 +
 163.130 +/* {{-15,-15,-15,-15,-15,-12,-10, -8,  0,  0,  0,  0,  0,  0,  0,  0,  0}}, *//* 4 */
 163.131 +   {{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-13,-11, -7  -3, -1, -1 , 0}}, /* 4 */
 163.132 +
 163.133 +/* {{-15,-15,-15,-15,-15,-12,-10, -8,  0,  0,  0,  0,  0,  0,  0,  0,  0}},    5 */
 163.134 +   {{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-13,-11, -7  -3, -1, -1 , 0}}, /* 5 */
 163.135 +
 163.136 +/* {{-15,-15,-15,-15,-15,-12,-10, -8,  0,  0,  0,  0,  0,  0,  0,  0,  0}},    6 */
 163.137 +   {{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -8, -4, -2, -2,  0}}, /* 6 */
 163.138 +
 163.139 +/* {{-15,-15,-15,-15,-15,-12,-10, -8,  0,  0,  0,  0,  0,  0,  0,  0,  0}},    7 */
 163.140 +   {{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -9, -4, -2, -2,  0}}, /* 7 */
 163.141 +
 163.142 +/* {{-15,-15,-15,-15,-15,-12,-10, -8,  0,  0,  0,  0,  0,  0,  0,  0,  0}},    8 */
 163.143 +   {{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -9, -4, -2, -2,  0}}, /* 8 */
 163.144 +
 163.145 +/* {{-15,-15,-15,-15,-15,-12,-10, -8,  0,  0,  0,  0,  0,  0,  0,  0,  0}},    9 */
 163.146 +   {{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -9, -4, -2, -2,  0}}, /* 9 */
 163.147 +
 163.148 +/* {{-15,-15,-15,-15,-15,-12,-10, -8,  0,  0,  0,  0,  0,  0,  0,  0,  0}},    10 */
 163.149 +   {{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -9, -4, -2, -2,  0}}, /* 10 */
 163.150 +};
 163.151 +
 163.152 +static const vp_adjblock _vp_tonemask_adj_otherblock[12]={
 163.153 +   /* 63     125     250     500       1       2       4       8      16 */
 163.154 +
 163.155 +   {{ -3, -8,-13,-15,-10,-10, -9, -9, -9, -9, -9,  1,  1,  1,  1,  1,  1}}, /* -1 */
 163.156 +
 163.157 +/* {{-20,-20,-20,-20,-14,-12,-10, -8, -4,  0,  0, 10,  0,  0,  0,  0,  0}},    0 */
 163.158 +   {{ -4,-10,-14,-16,-14,-13,-12,-12,-11,-11,-10,  0,  0,  0,  0,  0,  0}}, /* 0 */
 163.159 +
 163.160 +/* {{-20,-20,-20,-20,-20,-18,-16,-14,-10,  0,  0,  5,  0,  0,  0,  0,  0}},    1 */
 163.161 +   {{ -6,-12,-14,-16,-15,-15,-14,-13,-13,-12,-12, -2, -2, -1,  0,  0,  0}}, /* 1 */
 163.162 +
 163.163 +/* {{-20,-20,-20,-20,-20,-18,-16,-14,-10,  0,  0,  0,  0,  0,  0,  0,  0}},    2 */
 163.164 +   {{-12,-13,-14,-16,-16,-16,-15,-14,-13,-12,-12, -5, -2, -1,  0,  0,  0}}, /* 2 */
 163.165 +
 163.166 +/* {{-20,-20,-20,-20,-20,-18,-16,-14,-10,  0,  0,  0,  0,  0,  0,  0,  0}},    3 */
 163.167 +   {{-15,-15,-15,-16,-16,-16,-16,-14,-13,-13,-13,-10, -4, -2,  0,  0,  0}}, /* 3 */
 163.168 +
 163.169 +/* {{-20,-20,-20,-20,-20,-18,-16,-14,-10,  0,  0,  0,  0,  0,  0,  0,  0}},    4 */
 163.170 +   {{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-13,-11, -7  -3, -1, -1 , 0}}, /* 4 */
 163.171 +
 163.172 +/* {{-20,-20,-20,-20,-20,-18,-16,-14,-10,  0,  0,  0,  0,  0,  0,  0,  0}},    5 */
 163.173 +   {{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-13,-11, -7  -3, -1, -1 , 0}}, /* 5 */
 163.174 +
 163.175 +/* {{-20,-20,-20,-20,-20,-18,-16,-14,-10,  0,  0,  0,  0,  0,  0,  0,  0}},    6 */
 163.176 +   {{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -8, -4, -2, -2,  0}}, /* 6 */
 163.177 +
 163.178 +/* {{-20,-20,-20,-20,-20,-18,-16,-14,-10,  0,  0,  0,  0,  0,  0,  0,  0}},    7 */
 163.179 +   {{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -9, -4, -2, -2,  0}}, /* 7 */
 163.180 +
 163.181 +/* {{-20,-20,-20,-20,-20,-18,-16,-14,-10,  0,  0,  0,  0,  0,  0,  0,  0}},    8 */
 163.182 +   {{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -9, -4, -2, -2,  0}}, /* 8 */
 163.183 +
 163.184 +/* {{-20,-20,-20,-20,-20,-18,-16,-14,-10,  0,  0,  0,  0,  0,  0,  0,  0}},    9 */
 163.185 +   {{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -9, -4, -2, -2,  0}}, /* 9 */
 163.186 +
 163.187 +/* {{-20,-20,-20,-20,-20,-18,-16,-14,-10,  0,  0,  0,  0,  0,  0,  0,  0}},    10 */
 163.188 +   {{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -9, -4, -2, -2,  0}}, /* 10 */
 163.189 +};
 163.190 +
 163.191 +/* noise bias (transition block) */
 163.192 +static const noise3 _psy_noisebias_trans[12]={
 163.193 +  /*  63     125     250     500      1k       2k      4k      8k     16k*/
 163.194 +  /* -1 */
 163.195 +  {{{-10,-10,-10,-10,-10, -4,  0,  0,  4,  8,  8,  8,  8, 10, 12, 14, 20},
 163.196 +    {-30,-30,-30,-30,-26,-20,-16, -8, -6, -6, -2,  2,  2,  3,  6,  6, 15},
 163.197 +    {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -4, -2}}},
 163.198 +  /* 0
 163.199 +  {{{-15,-15,-15,-15,-15,-12,-10, -8,  0,  2,  4,  4,  5,  5,  5,  8,  10},
 163.200 +    {-30,-30,-30,-30,-26,-22,-20,-14, -8, -4,  0,  0,  0,  0,  2,  4,  10},
 163.201 +    {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -6, -4, -4, -4,  -2}}},*/
 163.202 +  {{{-15,-15,-15,-15,-15,-12, -6, -4,  0,  2,  4,  4,  5,  5,  5,  8,  10},
 163.203 +    {-30,-30,-30,-30,-26,-22,-20,-14, -8, -4,  0,  0,  0,  0,  2,  3,   6},
 163.204 +    {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -6, -4, -4, -4,  -2}}},
 163.205 +  /* 1
 163.206 +  {{{-15,-15,-15,-15,-15,-12,-10, -8,  0,  2,  4,  4,  5,  5,  5,  8,  10},
 163.207 +    {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -2, -2, -2, -2,  0,  2,  8},
 163.208 +    {-30,-30,-30,-30,-26,-22,-20,-14,-10, -8, -8, -8, -8, -6, -6, -6, -4}}},*/
 163.209 +  {{{-15,-15,-15,-15,-15,-12,-10, -8,  0,  2,  4,  4,  5,  5,  5,  8,  10},
 163.210 +    {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -2, -2, -2, -2,  0,  1,   4},
 163.211 +    {-30,-30,-30,-30,-26,-22,-20,-14,-10, -8, -8, -8, -8, -6, -6, -6,  -4}}},
 163.212 +  /* 2
 163.213 +  {{{-15,-15,-15,-15,-15,-12,-10, -8,  0,  2,  2,  2,  4,  4,  5,  6,  10},
 163.214 +    {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -2, -2, -2, -2,  0,  2,  6},
 163.215 +    {-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}}, */
 163.216 +  {{{-15,-15,-15,-15,-15,-12,-10, -8,  0,  2,  2,  2,  4,  4,  5,  6,  10},
 163.217 +    {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -3, -3, -3, -2, -1,  0,  3},
 163.218 +    {-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10, -8, -8, -7, -4}}},
 163.219 +  /* 3
 163.220 +  {{{-15,-15,-15,-15,-15,-12,-10, -8,  0,  2,  2,  2,  4,  4,  4,  5,  8},
 163.221 +    {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -3, -3, -3, -3, -1,  1,  6},
 163.222 +    {-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},*/
 163.223 +  {{{-15,-15,-15,-15,-15,-12,-10, -8,  0,  2,  2,  2,  4,  4,  4,  5,  8},
 163.224 +    {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -3, -3, -3, -3, -2,  0,  2},
 163.225 +    {-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},
 163.226 +  /* 4
 163.227 +  {{{-20,-20,-20,-20,-20,-18,-14, -8, -1,  1,  1,  1,  2,  3,  3,  4,  7},
 163.228 +    {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -3, -3, -3, -3, -1,  1,  5},
 163.229 +    {-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},*/
 163.230 +  {{{-20,-20,-20,-20,-20,-18,-14, -8, -1,  1,  1,  1,  2,  3,  3,  4,  7},
 163.231 +    {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -3, -3, -3, -3, -2, -1,  1},
 163.232 +    {-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},
 163.233 +  /* 5
 163.234 +  {{{-24,-24,-24,-24,-20,-18,-14, -8, -1,  1,  1,  1,  2,  3,  3,  4,  7},
 163.235 +    {-32,-32,-32,-32,-28,-24,-22,-16,-12, -6, -4, -4, -4, -4, -2, -1,  2},
 163.236 +    {-34,-34,-34,-34,-30,-24,-24,-18,-14,-12,-12,-12,-12,-10,-10, -9, -5}}}, */
 163.237 +  {{{-24,-24,-24,-24,-20,-18,-14, -8, -1,  1,  1,  1,  2,  3,  3,  4,  7},
 163.238 +    {-32,-32,-32,-32,-28,-24,-22,-16,-12, -6, -4, -4, -4, -4, -3, -1,  0},
 163.239 +    {-34,-34,-34,-34,-30,-24,-24,-18,-14,-12,-12,-12,-12,-10,-10, -9, -5}}},
 163.240 +  /* 6
 163.241 +  {{{-24,-24,-24,-24,-20,-18,-14, -8, -1,  1,  1,  1,  2,  3,  3,  4,  7},
 163.242 +    {-32,-32,-32,-32,-28,-24,-24,-18,-14, -8, -6, -6, -6, -6, -4, -2,  1},
 163.243 +    {-34,-34,-34,-34,-30,-26,-24,-18,-17,-15,-15,-15,-15,-13,-13,-12, -8}}},*/
 163.244 +  {{{-24,-24,-24,-24,-20,-18,-14, -8, -1,  1,  1,  1,  2,  3,  3,  4,  7},
 163.245 +    {-32,-32,-32,-32,-28,-24,-24,-18,-14, -8, -6, -6, -6, -6, -5, -2,  0},
 163.246 +    {-34,-34,-34,-34,-30,-26,-26,-24,-22,-19,-19,-19,-19,-18,-17,-16,-12}}},
 163.247 +  /* 7
 163.248 +  {{{-24,-24,-24,-24,-20,-18,-14, -8, -1,  1,  1,  1,  2,  3,  3,  4,  7},
 163.249 +    {-32,-32,-32,-32,-28,-24,-24,-18,-14,-12,-10, -8, -8, -8, -6, -4,  0},
 163.250 +    {-34,-34,-34,-34,-30,-26,-26,-24,-22,-19,-19,-19,-19,-18,-17,-16,-12}}},*/
 163.251 +  {{{-24,-24,-24,-24,-20,-18,-14, -8, -1,  1,  1,  1,  2,  3,  3,  4,  7},
 163.252 +    {-32,-32,-32,-32,-28,-24,-24,-24,-18,-14,-12,-10,-10,-10, -8, -6, -2},
 163.253 +    {-34,-34,-34,-34,-30,-26,-26,-26,-24,-24,-24,-24,-24,-24,-24,-20,-16}}},
 163.254 +  /* 8
 163.255 +  {{{-24,-24,-24,-24,-22,-20,-15,-10, -8, -2,  0,  0,  0,  1,  2,  3,  7},
 163.256 +    {-36,-36,-36,-36,-30,-30,-30,-24,-18,-14,-12,-10,-10,-10, -8, -6, -2},
 163.257 +    {-36,-36,-36,-36,-34,-30,-28,-26,-24,-24,-24,-24,-24,-24,-24,-20,-16}}},*/
 163.258 +  {{{-24,-24,-24,-24,-22,-20,-15,-10, -8, -2,  0,  0,  0,  1,  2,  3,  7},
 163.259 +    {-36,-36,-36,-36,-30,-30,-30,-24,-20,-16,-16,-16,-16,-14,-12,-10, -7},
 163.260 +    {-36,-36,-36,-36,-34,-30,-28,-26,-24,-30,-30,-30,-30,-30,-30,-24,-20}}},
 163.261 +  /* 9
 163.262 +  {{{-28,-28,-28,-28,-28,-28,-28,-20,-14, -8, -4, -4, -4, -4, -4, -2,  2},
 163.263 +    {-36,-36,-36,-36,-34,-32,-32,-28,-20,-16,-16,-16,-16,-14,-12,-10, -7},
 163.264 +    {-40,-40,-40,-40,-40,-40,-40,-32,-30,-30,-30,-30,-30,-30,-30,-24,-20}}},*/
 163.265 +  {{{-28,-28,-28,-28,-28,-28,-28,-20,-14, -8, -4, -4, -4, -4, -4, -2,  2},
 163.266 +    {-38,-38,-38,-38,-36,-34,-34,-30,-24,-20,-20,-20,-20,-18,-16,-12,-10},
 163.267 +    {-40,-40,-40,-40,-40,-40,-40,-38,-35,-35,-35,-35,-35,-35,-35,-35,-30}}},
 163.268 +  /* 10 */
 163.269 +  {{{-30,-30,-30,-30,-30,-30,-30,-28,-20,-14,-14,-14,-14,-14,-14,-12,-10},
 163.270 +    {-40,-40,-40,-40,-40,-40,-40,-40,-35,-30,-30,-30,-30,-30,-30,-30,-20},
 163.271 +    {-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40}}},
 163.272 +};
 163.273 +
 163.274 +/*  noise bias (long block) */
 163.275 +static const noise3 _psy_noisebias_long[12]={
 163.276 +  /*63     125     250     500      1k       2k      4k      8k     16k*/
 163.277 +  /* -1 */
 163.278 +  {{{-10,-10,-10,-10,-10, -4,  0,  0,  0,  6,  6,  6,  6, 10, 10, 12,  20},
 163.279 +    {-20,-20,-20,-20,-20,-20,-10, -2,  0,  0,  0,  0,  0,  2,  4,  6,  15},
 163.280 +    {-20,-20,-20,-20,-20,-20,-20,-10, -6, -6, -6, -6, -6, -4, -4, -4, -2}}},
 163.281 +
 163.282 +  /* 0 */
 163.283 +  /*  {{{-10,-10,-10,-10,-10,-10, -8,  2,  2,  2,  4,  4,  5,  5,  5,  8,  10},
 163.284 +      {-20,-20,-20,-20,-20,-20,-20,-14, -6,  0,  0,  0,  0,  0,  2,  4,  10},
 163.285 +      {-20,-20,-20,-20,-20,-20,-20,-14, -8, -6, -6, -6, -6, -4, -4, -4, -2}}},*/
 163.286 +  {{{-10,-10,-10,-10,-10,-10, -8,  2,  2,  2,  4,  4,  5,  5,  5,  8,  10},
 163.287 +    {-20,-20,-20,-20,-20,-20,-20,-14, -6,  0,  0,  0,  0,  0,  2,  3,  6},
 163.288 +    {-20,-20,-20,-20,-20,-20,-20,-14, -8, -6, -6, -6, -6, -4, -4, -4, -2}}},
 163.289 +  /* 1 */
 163.290 +  /*  {{{-10,-10,-10,-10,-10,-10, -8, -4,  0,  2,  4,  4,  5,  5,  5,  8,  10},
 163.291 +      {-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -2, -2, -2, -2,  0,  2,  8},
 163.292 +      {-20,-20,-20,-20,-20,-20,-20,-14,-10, -8, -8, -8, -8, -6, -6, -6, -4}}},*/
 163.293 +  {{{-10,-10,-10,-10,-10,-10, -8, -4,  0,  2,  4,  4,  5,  5,  5,  8,  10},
 163.294 +    {-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -2, -2, -2, -2,  0,  1,  4},
 163.295 +    {-20,-20,-20,-20,-20,-20,-20,-14,-10, -8, -8, -8, -8, -6, -6, -6, -4}}},
 163.296 +  /* 2 */
 163.297 +  /*  {{{-10,-10,-10,-10,-10,-10,-10, -8,  0,  2,  2,  2,  4,  4,  5,  6,  10},
 163.298 +      {-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -2, -2, -2, -2,  0,  2,  6},
 163.299 +      {-20,-20,-20,-20,-20,-20,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},*/
 163.300 +  {{{-10,-10,-10,-10,-10,-10,-10, -8,  0,  2,  2,  2,  4,  4,  5,  6,  10},
 163.301 +    {-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -3, -3, -3, -2, -1,  0,  3},
 163.302 +    {-20,-20,-20,-20,-20,-20,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},
 163.303 +  /* 3 */
 163.304 +  /*  {{{-10,-10,-10,-10,-10,-10,-10, -8,  0,  2,  2,  2,  4,  4,  4,  5,  8},
 163.305 +      {-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -3, -3, -3, -3, -1,  1,  6},
 163.306 +      {-20,-20,-20,-20,-20,-20,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},*/
 163.307 +  {{{-10,-10,-10,-10,-10,-10,-10, -8,  0,  2,  2,  2,  4,  4,  4,  5,  8},
 163.308 +    {-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -3, -3, -3, -3, -2,  0,  2},
 163.309 +    {-20,-20,-20,-20,-20,-20,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -5}}},
 163.310 +  /* 4 */
 163.311 +  /*  {{{-15,-15,-15,-15,-15,-15,-15,-10, -4,  1,  1,  1,  2,  3,  3,  4,  7},
 163.312 +      {-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -3, -3, -3, -3, -1,  1,  5},
 163.313 +      {-20,-20,-20,-20,-20,-20,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},*/
 163.314 +  {{{-15,-15,-15,-15,-15,-15,-15,-10, -4,  1,  1,  1,  2,  3,  3,  4,  7},
 163.315 +    {-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -3, -3, -3, -3, -2, -1,  1},
 163.316 +    {-20,-20,-20,-20,-20,-20,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -7}}},
 163.317 +  /* 5 */
 163.318 +  /*  {{{-15,-15,-15,-15,-15,-15,-15,-10, -4,  1,  1,  1,  2,  3,  3,  4,  7},
 163.319 +      {-22,-22,-22,-22,-22,-22,-22,-16,-12, -6, -4, -4, -4, -4, -2, -1,  2},
 163.320 +      {-24,-24,-24,-24,-24,-24,-24,-18,-14,-12,-12,-12,-12,-10,-10, -9, -5}}},*/
 163.321 +  {{{-15,-15,-15,-15,-15,-15,-15,-10, -4,  1,  1,  1,  2,  3,  3,  4,  7},
 163.322 +    {-22,-22,-22,-22,-22,-22,-22,-16,-12, -6, -4, -4, -4, -4, -3, -1,  0},
 163.323 +    {-24,-24,-24,-24,-24,-24,-24,-18,-14,-12,-12,-12,-12,-10,-10, -9, -8}}},
 163.324 +  /* 6 */
 163.325 +  /*  {{{-15,-15,-15,-15,-15,-15,-15,-10, -4,  1,  1,  1,  2,  3,  3,  4,  7},
 163.326 +      {-24,-24,-24,-24,-24,-24,-24,-18,-14, -8, -6, -6, -6, -6, -4, -2,  1},
 163.327 +      {-26,-26,-26,-26,-26,-26,-26,-18,-16,-15,-15,-15,-15,-13,-13,-12, -8}}},*/
 163.328 +  {{{-15,-15,-15,-15,-15,-15,-15,-10, -4,  1,  1,  1,  2,  3,  3,  4,  7},
 163.329 +    {-24,-24,-24,-24,-24,-24,-24,-18,-14, -8, -6, -6, -6, -6, -5, -2,  0},
 163.330 +    {-26,-26,-26,-26,-26,-26,-26,-18,-16,-15,-15,-15,-15,-13,-13,-12,-10}}},
 163.331 +  /* 7 */
 163.332 +  {{{-15,-15,-15,-15,-15,-15,-15,-10, -4,  1,  1,  1,  2,  3,  3,  4,  7},
 163.333 +    {-24,-24,-24,-24,-24,-24,-24,-18,-14,-10, -8, -8, -8, -8, -6, -4,  0},
 163.334 +    {-26,-26,-26,-26,-26,-26,-26,-22,-20,-19,-19,-19,-19,-18,-17,-16,-12}}},
 163.335 +  /* 8 */
 163.336 +  {{{-15,-15,-15,-15,-15,-15,-15,-10, -4,  0,  0,  0,  0,  1,  2,  3,  7},
 163.337 +    {-26,-26,-26,-26,-26,-26,-26,-20,-16,-12,-10,-10,-10,-10, -8, -6, -2},
 163.338 +    {-28,-28,-28,-28,-28,-28,-28,-26,-24,-24,-24,-24,-24,-24,-24,-20,-16}}},
 163.339 +  /* 9 */
 163.340 +  {{{-22,-22,-22,-22,-22,-22,-22,-18,-14, -8, -4, -4, -4, -4, -4, -2,  2},
 163.341 +    {-26,-26,-26,-26,-26,-26,-26,-22,-18,-16,-16,-16,-16,-14,-12,-10, -7},
 163.342 +    {-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-24,-20}}},
 163.343 +  /* 10 */
 163.344 +  {{{-24,-24,-24,-24,-24,-24,-24,-24,-24,-18,-14,-14,-14,-14,-14,-12,-10},
 163.345 +    {-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-20},
 163.346 +    {-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40}}},
 163.347 +};
 163.348 +
 163.349 +/* noise bias (impulse block) */
 163.350 +static const noise3 _psy_noisebias_impulse[12]={
 163.351 +  /*  63     125     250     500      1k      2k      4k      8k     16k*/
 163.352 +  /* -1 */
 163.353 +  {{{-10,-10,-10,-10,-10, -4,  0,  0,  4,  8,  8,  8,  8, 10, 12, 14, 20},
 163.354 +    {-30,-30,-30,-30,-26,-20,-16, -8, -6, -6, -2,  2,  2,  3,  6,  6, 15},
 163.355 +    {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -4, -2}}},
 163.356 +
 163.357 +  /* 0 */
 163.358 +  /*  {{{-10,-10,-10,-10,-10, -4,  0,  0,  4,  4,  8,  8,  8, 10, 12, 14, 20},
 163.359 +      {-30,-30,-30,-30,-26,-22,-20,-14, -6, -2,  0,  0,  0,  0,  2,  4,  10},
 163.360 +      {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -4, -2}}},*/
 163.361 +  {{{-10,-10,-10,-10,-10, -4,  0,  0,  4,  4,  8,  8,  8, 10, 12, 14, 20},
 163.362 +    {-30,-30,-30,-30,-26,-22,-20,-14, -6, -2,  0,  0,  0,  0,  2,  3,  6},
 163.363 +    {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -4, -2}}},
 163.364 +  /* 1 */
 163.365 +  {{{-12,-12,-12,-12,-12, -8, -6, -4,  0,  4,  4,  4,  4, 10, 12, 14, 20},
 163.366 +    {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -4, -4, -2, -2, -2, -2,  2},
 163.367 +    {-30,-30,-30,-30,-26,-22,-20,-14,-10, -8,-10,-10, -8, -8, -8, -6, -4}}},
 163.368 +  /* 2 */
 163.369 +  {{{-14,-14,-14,-14,-14,-10, -8, -6, -2,  2,  2,  2,  2,  8, 10, 10, 16},
 163.370 +    {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -4, -4, -4, -2,  0},
 163.371 +    {-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10,-10,-10, -8, -4}}},
 163.372 +  /* 3 */
 163.373 +  {{{-14,-14,-14,-14,-14,-10, -8, -6, -2,  2,  2,  2,  2,  6,  8,  8, 14},
 163.374 +    {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -4, -4, -4, -2,  0},
 163.375 +    {-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10,-10,-10, -8, -4}}},
 163.376 +  /* 4 */
 163.377 +  {{{-16,-16,-16,-16,-16,-12,-10, -6, -2,  0,  0,  0,  0,  4,  6,  6, 12},
 163.378 +    {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -4, -4, -4, -2,  0},
 163.379 +    {-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10,-10,-10, -8, -4}}},
 163.380 +  /* 5 */
 163.381 +  {{{-20,-20,-20,-20,-20,-18,-14,-10, -4,  0,  0,  0,  0,  4,  4,  6, 11},
 163.382 +    {-32,-32,-32,-32,-28,-24,-22,-16,-10, -6, -8, -8, -6, -6, -6, -4, -2},
 163.383 +    {-34,-34,-34,-34,-30,-26,-24,-18,-14,-12,-12,-12,-12,-12,-10, -9, -5}}},
 163.384 +  /* 6
 163.385 +  {{{-20,-20,-20,-20,-20,-18,-14,-10, -4,  0,  0,  0,  0,  4,  4,  6, 11},
 163.386 +      {-34,-34,-34,-34,-30,-30,-24,-20,-12,-12,-14,-14,-10, -9, -8, -6, -4},
 163.387 +      {-34,-34,-34,-34,-34,-30,-26,-20,-16,-15,-15,-15,-15,-15,-13,-12, -8}}},*/
 163.388 +  {{{-20,-20,-20,-20,-20,-18,-14,-10, -4,  0,  0,  0,  0,  4,  4,  6, 11},
 163.389 +    {-34,-34,-34,-34,-30,-30,-30,-24,-16,-16,-16,-16,-16,-16,-14,-14,-12},
 163.390 +    {-36,-36,-36,-36,-36,-34,-28,-24,-20,-20,-20,-20,-20,-20,-20,-18,-16}}},
 163.391 +  /* 7 */
 163.392 +  /*  {{{-22,-22,-22,-22,-22,-20,-14,-10, -6,  0,  0,  0,  0,  4,  4,  6, 11},
 163.393 +      {-34,-34,-34,-34,-30,-30,-24,-20,-14,-14,-16,-16,-14,-12,-10,-10,-10},
 163.394 +      {-34,-34,-34,-34,-32,-32,-30,-24,-20,-19,-19,-19,-19,-19,-17,-16,-12}}},*/
 163.395 +  {{{-22,-22,-22,-22,-22,-20,-14,-10, -6,  0,  0,  0,  0,  4,  4,  6, 11},
 163.396 +    {-34,-34,-34,-34,-30,-30,-30,-30,-26,-26,-26,-26,-26,-26,-26,-24,-22},
 163.397 +    {-40,-40,-40,-40,-40,-40,-40,-32,-30,-30,-30,-30,-30,-30,-30,-30,-24}}},
 163.398 +  /* 8 */
 163.399 +  /*  {{{-24,-24,-24,-24,-24,-22,-14,-10, -6, -1, -1, -1, -1,  3,  3,  5, 10},
 163.400 +      {-34,-34,-34,-34,-30,-30,-30,-24,-20,-20,-20,-20,-20,-18,-16,-16,-14},
 163.401 +      {-36,-36,-36,-36,-36,-34,-28,-24,-24,-24,-24,-24,-24,-24,-24,-20,-16}}},*/
 163.402 +  {{{-24,-24,-24,-24,-24,-22,-14,-10, -6, -1, -1, -1, -1,  3,  3,  5, 10},
 163.403 +    {-34,-34,-34,-34,-34,-32,-32,-30,-26,-26,-26,-26,-26,-26,-26,-26,-24},
 163.404 +    {-40,-40,-40,-40,-40,-40,-40,-32,-30,-30,-30,-30,-30,-30,-30,-30,-24}}},
 163.405 +  /* 9 */
 163.406 +  /*  {{{-28,-28,-28,-28,-28,-28,-28,-20,-14, -8, -4, -4, -4, -4, -4, -2,  2},
 163.407 +      {-36,-36,-36,-36,-34,-32,-32,-30,-26,-26,-26,-26,-26,-22,-20,-20,-18},
 163.408 +      {-40,-40,-40,-40,-40,-40,-40,-32,-30,-30,-30,-30,-30,-30,-30,-24,-20}}},*/
 163.409 +  {{{-28,-28,-28,-28,-28,-28,-28,-20,-14, -8, -4, -4, -4, -4, -4, -2,  2},
 163.410 +    {-36,-36,-36,-36,-34,-32,-32,-30,-26,-26,-26,-26,-26,-26,-26,-26,-26},
 163.411 +    {-40,-40,-40,-40,-40,-40,-40,-32,-30,-30,-30,-30,-30,-30,-30,-24,-20}}},
 163.412 +  /* 10 */
 163.413 +  {{{-30,-30,-30,-30,-30,-26,-24,-24,-24,-20,-16,-16,-16,-16,-16,-14,-12},
 163.414 +    {-40,-40,-40,-40,-40,-40,-40,-40,-35,-30,-30,-30,-30,-30,-30,-30,-26},
 163.415 +    {-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40}}},
 163.416 +};
 163.417 +
 163.418 +/* noise bias (padding block) */
 163.419 +static const noise3 _psy_noisebias_padding[12]={
 163.420 +  /*  63     125     250     500      1k       2k      4k      8k     16k*/
 163.421 +
 163.422 +  /* -1 */
 163.423 +  {{{-10,-10,-10,-10,-10, -4,  0,  0,  4,  8,  8,  8,  8, 10, 12, 14, 20},
 163.424 +    {-30,-30,-30,-30,-26,-20,-16, -8, -6, -6, -2,  2,  2,  3,  6,  6, 15},
 163.425 +    {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -4, -2}}},
 163.426 +
 163.427 +  /* 0 */
 163.428 +  {{{-10,-10,-10,-10,-10, -4,  0,  0,  4,  8,  8,  8,  8, 10, 12, 14, 20},
 163.429 +    {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -2,  2,  3,  6,  6,  8, 10},
 163.430 +    {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -4, -4, -4, -4, -2,  0,  2}}},
 163.431 +  /* 1 */
 163.432 +  {{{-12,-12,-12,-12,-12, -8, -6, -4,  0,  4,  4,  4,  4, 10, 12, 14, 20},
 163.433 +    {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4,  0,  0,  0,  2,  2,  4,  8},
 163.434 +    {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -6, -6, -4, -2,  0}}},
 163.435 +  /* 2 */
 163.436 +  /*  {{{-14,-14,-14,-14,-14,-10, -8, -6, -2,  2,  2,  2,  2,  8, 10, 10, 16},
 163.437 +      {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4,  0,  0,  0,  2,  2,  4,  8},
 163.438 +      {-30,-30,-30,-30,-26,-22,-20,-14,-10, -8, -8, -8, -8, -8, -6, -4, -2}}},*/
 163.439 +  {{{-14,-14,-14,-14,-14,-10, -8, -6, -2,  2,  2,  2,  2,  8, 10, 10, 16},
 163.440 +    {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -1, -1, -1,  0,  0,  2,  6},
 163.441 +    {-30,-30,-30,-30,-26,-22,-20,-14,-10, -8, -8, -8, -8, -8, -6, -4, -2}}},
 163.442 +  /* 3 */
 163.443 +  {{{-14,-14,-14,-14,-14,-10, -8, -6, -2,  2,  2,  2,  2,  6,  8,  8, 14},
 163.444 +    {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -1, -1, -1,  0,  0,  2,  6},
 163.445 +    {-30,-30,-30,-30,-26,-22,-20,-14,-10, -8, -8, -8, -8, -8, -6, -4, -2}}},
 163.446 +  /* 4 */
 163.447 +  {{{-16,-16,-16,-16,-16,-12,-10, -6, -2,  0,  0,  0,  0,  4,  6,  6, 12},
 163.448 +    {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -1, -1, -1, -1,  0,  2,  6},
 163.449 +    {-30,-30,-30,-30,-26,-22,-20,-14,-10, -8, -8, -8, -8, -8, -6, -4, -2}}},
 163.450 +  /* 5 */
 163.451 +  {{{-20,-20,-20,-20,-20,-18,-14,-10, -4,  0,  0,  0,  0,  4,  6,  6, 12},
 163.452 +    {-32,-32,-32,-32,-28,-24,-22,-16,-12, -6, -3, -3, -3, -3, -2,  0,  4},
 163.453 +    {-34,-34,-34,-34,-30,-26,-24,-18,-14,-10,-10,-10,-10,-10, -8, -5, -3}}},
 163.454 +  /* 6 */
 163.455 +  {{{-20,-20,-20,-20,-20,-18,-14,-10, -4,  0,  0,  0,  0,  4,  6,  6, 12},
 163.456 +    {-34,-34,-34,-34,-30,-30,-24,-20,-14, -8, -4, -4, -4, -4, -3, -1,  4},
 163.457 +    {-34,-34,-34,-34,-34,-30,-26,-20,-16,-13,-13,-13,-13,-13,-11, -8, -6}}},
 163.458 +  /* 7 */
 163.459 +  {{{-20,-20,-20,-20,-20,-18,-14,-10, -4,  0,  0,  0,  0,  4,  6,  6, 12},
 163.460 +    {-34,-34,-34,-34,-30,-30,-30,-24,-16,-10, -8, -6, -6, -6, -5, -3,  1},
 163.461 +    {-34,-34,-34,-34,-32,-32,-28,-22,-18,-16,-16,-16,-16,-16,-14,-12,-10}}},
 163.462 +  /* 8 */
 163.463 +  {{{-22,-22,-22,-22,-22,-20,-14,-10, -4,  0,  0,  0,  0,  3,  5,  5, 11},
 163.464 +    {-34,-34,-34,-34,-30,-30,-30,-24,-16,-12,-10, -8, -8, -8, -7, -5, -2},
 163.465 +    {-36,-36,-36,-36,-36,-34,-28,-22,-20,-20,-20,-20,-20,-20,-20,-16,-14}}},
 163.466 +  /* 9 */
 163.467 +  {{{-28,-28,-28,-28,-28,-28,-28,-20,-14, -8, -2, -2, -2, -2,  0,  2,  6},
 163.468 +    {-36,-36,-36,-36,-34,-32,-32,-24,-16,-12,-12,-12,-12,-12,-10, -8, -5},
 163.469 +    {-40,-40,-40,-40,-40,-40,-40,-32,-26,-24,-24,-24,-24,-24,-24,-20,-18}}},
 163.470 +  /* 10 */
 163.471 +  {{{-30,-30,-30,-30,-30,-26,-24,-24,-24,-20,-12,-12,-12,-12,-12,-10, -8},
 163.472 +    {-40,-40,-40,-40,-40,-40,-40,-40,-35,-30,-25,-25,-25,-25,-25,-25,-15},
 163.473 +    {-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40}}},
 163.474 +};
 163.475 +
 163.476 +
 163.477 +static const noiseguard _psy_noiseguards_44[4]={
 163.478 +  {3,3,15},
 163.479 +  {3,3,15},
 163.480 +  {10,10,100},
 163.481 +  {10,10,100},
 163.482 +};
 163.483 +
 163.484 +static const int _psy_tone_suppress[12]={
 163.485 +  -20,-20,-20,-20,-20,-24,-30,-40,-40,-45,-45,-45,
 163.486 +};
 163.487 +static const int _psy_tone_0dB[12]={
 163.488 +  90,90,95,95,95,95,105,105,105,105,105,105,
 163.489 +};
 163.490 +static const int _psy_noise_suppress[12]={
 163.491 +  -20,-20,-24,-24,-24,-24,-30,-40,-40,-45,-45,-45,
 163.492 +};
 163.493 +
 163.494 +static const vorbis_info_psy _psy_info_template={
 163.495 +  /* blockflag */
 163.496 +  -1,
 163.497 +  /* ath_adjatt, ath_maxatt */
 163.498 +  -140.,-140.,
 163.499 +  /* tonemask att boost/decay,suppr,curves */
 163.500 +  {0.f,0.f,0.f},     0.,0.,    -40.f, {0.},
 163.501 +
 163.502 +  /*noisemaskp,supp, low/high window, low/hi guard, minimum */
 163.503 +  1,          -0.f,           .5f, .5f,         0,0,0,
 163.504 +  /* noiseoffset*3, noisecompand, max_curve_dB */
 163.505 +  {{-1},{-1},{-1}},{-1},105.f,
 163.506 +  /* noise normalization - noise_p, start, partition, thresh. */
 163.507 +  0,-1,-1,0.,
 163.508 +};
 163.509 +
 163.510 +/* ath ****************/
 163.511 +
 163.512 +static const int _psy_ath_floater[12]={
 163.513 +  -100,-100,-100,-100,-100,-100,-105,-105,-105,-105,-110,-120,
 163.514 +};
 163.515 +static const int _psy_ath_abs[12]={
 163.516 +  -130,-130,-130,-130,-140,-140,-140,-140,-140,-140,-140,-150,
 163.517 +};
 163.518 +
 163.519 +/* stereo setup.  These don't map directly to quality level, there's
 163.520 +   an additional indirection as several of the below may be used in a
 163.521 +   single bitmanaged stream
 163.522 +
 163.523 +****************/
 163.524 +
 163.525 +/* various stereo possibilities */
 163.526 +
 163.527 +/* stereo mode by base quality level */
 163.528 +static const adj_stereo _psy_stereo_modes_44[12]={
 163.529 +  /*  0   1   2   3   4   5   6   7   8   9  10  11  12  13  14         -1  */
 163.530 +  {{  4,  4,  4,  4,  4,  4,  4,  3,  2,  2,  1,  0,  0,  0,  0},
 163.531 +   {  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  5,  4,  3},
 163.532 +   {  1,  2,  3,  4,  4,  4,  4,  4,  4,  5,  6,  7,  8,  8,  8},
 163.533 +   { 12,12.5, 13,13.5, 14,14.5, 15, 99, 99, 99, 99, 99, 99, 99, 99}},
 163.534 +
 163.535 +/*    0   1   2   3   4   5   6   7   8   9  10  11  12  13  14         0  */
 163.536 +  {{  4,  4,  4,  4,  4,  4,  4,  3,  2,  1,  0,  0,  0,  0,  0},
 163.537 +   {  8,  8,  8,  8,  6,  6,  5,  5,  5,  5,  5,  5,  5,  4,  3},
 163.538 +   {  1,  2,  3,  4,  4,  5,  6,  6,  6,  6,  6,  8,  8,  8,  8},
 163.539 +   { 12,12.5, 13,13.5, 14,14.5, 15, 99, 99, 99, 99, 99, 99, 99, 99}},
 163.540 +
 163.541 +
 163.542 +  /*  0   1   2   3   4   5   6   7   8   9  10  11  12  13  14         1  */
 163.543 +  {{  3,  3,  3,  3,  3,  3,  3,  3,  2,  1,  0,  0,  0,  0,  0},
 163.544 +   {  8,  8,  8,  8,  6,  6,  5,  5,  5,  5,  5,  5,  5,  4,  3},
 163.545 +   {  1,  2,  3,  4,  4,  5,  6,  6,  6,  6,  6,  8,  8,  8,  8},
 163.546 +   { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
 163.547 +
 163.548 +
 163.549 +  /*  0   1   2   3   4   5   6   7   8   9  10  11  12  13  14         2  */
 163.550 +  {{  3,  3,  3,  3,  3,  3,  3,  2,  1,  1,  0,  0,  0,  0,  0},
 163.551 +   {  8,  8,  6,  6,  5,  5,  4,  4,  4,  4,  4,  4,  3,  2,  1},
 163.552 +   {  3,  4,  4,  5,  5,  6,  6,  6,  6,  6,  6,  8,  8,  8,  8},
 163.553 +   { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
 163.554 +  /*  0   1   2   3   4   5   6   7   8   9  10  11  12  13  14         3  */
 163.555 +  {{  2,  2,  2,  2,  2,  1,  1,  1,  1,  0,  0,  0,  0,  0,  0},
 163.556 +   {  5,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  3,  2,  1},
 163.557 +   {  4,  4,  5,  6,  6,  6,  6,  6,  8,  8, 10, 10, 10, 10, 10},
 163.558 +   { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
 163.559 +  /*  0   1   2   3   4   5   6   7   8   9  10  11  12  13  14         4  */
 163.560 +  {{  2,  2,  2,  1,  1,  1,  0,  0,  0,  0,  0,  0,  0,  0,  0},
 163.561 +   {  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  3,  3,  2,  1,  0},
 163.562 +   {  6,  6,  6,  8,  8,  8,  8,  8,  8,  8, 10, 10, 10, 10, 10},
 163.563 +   { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
 163.564 +  /*  0   1   2   3   4   5   6   7   8   9  10  11  12  13  14         5  */
 163.565 +  {{  2,  2,  2,  1,  1,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
 163.566 +   {  3,  3,  3,  3,  3,  2,  2,  2,  2,  2,  2,  0,  0,  0,  0},
 163.567 +   {  6,  7,  8,  8,  8, 10, 10, 12, 12, 12, 12, 12, 12, 12, 12},
 163.568 +   { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
 163.569 +  /*  0   1   2   3   4   5   6   7   8   9  10  11  12  13  14         6  */
 163.570 +  {{  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
 163.571 +   {  3,  3,  3,  2,  2,  2,  0,  0,  0,  0,  0,  0,  0,  0,  0},
 163.572 +   {  8,  8,  8, 10, 10, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12},
 163.573 +   { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
 163.574 +  /*  0   1   2   3   4   5   6   7   8   9  10  11  12  13  14         7  */
 163.575 +  {{  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
 163.576 +   {  3,  3,  3,  2,  2,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
 163.577 +   {  8,  8, 10, 10, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12},
 163.578 +   { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
 163.579 +  /*  0   1   2   3   4   5   6   7   8   9  10  11  12  13  14         8  */
 163.580 +  {{  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
 163.581 +   {  2,  2,  2,  2,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
 163.582 +   {  8, 10, 10, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12},
 163.583 +   { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
 163.584 +  /*  0   1   2   3   4   5   6   7   8   9  10  11  12  13  14         9  */
 163.585 +  {{  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
 163.586 +   {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
 163.587 +   {  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4},
 163.588 +   { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
 163.589 +  /*  0   1   2   3   4   5   6   7   8   9  10  11  12  13  14        10  */
 163.590 +  {{  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
 163.591 +   {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
 163.592 +   {  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4},
 163.593 +   { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
 163.594 +};
 163.595 +
 163.596 +/* tone master attenuation by base quality mode and bitrate tweak */
 163.597 +static const att3 _psy_tone_masteratt_44[12]={
 163.598 +  {{ 35,  21,   9},  0,    0}, /* -1 */
 163.599 +  {{ 30,  20,   8}, -2, 1.25}, /* 0 */
 163.600 +  /*  {{ 25,  14,   4},  0,    0}, *//* 1 */
 163.601 +  {{ 25,  12,   2},  0,    0}, /* 1 */
 163.602 +  /*  {{ 20,  10,  -2},  0,    0}, *//* 2 */
 163.603 +  {{ 20,   9,  -3},  0,    0}, /* 2 */
 163.604 +  {{ 20,   9,  -4},  0,    0}, /* 3 */
 163.605 +  {{ 20,   9,  -4},  0,    0}, /* 4 */
 163.606 +  {{ 20,   6,  -6},  0,    0}, /* 5 */
 163.607 +  {{ 20,   3, -10},  0,    0}, /* 6 */
 163.608 +  {{ 18,   1, -14},  0,    0}, /* 7 */
 163.609 +  {{ 18,   0, -16},  0,    0}, /* 8 */
 163.610 +  {{ 18,  -2, -16},  0,    0}, /* 9 */
 163.611 +  {{ 12,  -2, -20},  0,    0}, /* 10 */
 163.612 +};
 163.613 +
 163.614 +/* lowpass by mode **************/
 163.615 +static const double _psy_lowpass_44[12]={
 163.616 +  /*  15.1,15.8,16.5,17.9,20.5,48.,999.,999.,999.,999.,999. */
 163.617 +  13.9,15.1,15.8,16.5,17.2,18.9,20.1,48.,999.,999.,999.,999.
 163.618 +};
 163.619 +
 163.620 +/* noise normalization **********/
 163.621 +
 163.622 +static const int _noise_start_short_44[11]={
 163.623 +  /*  16,16,16,16,32,32,9999,9999,9999,9999 */
 163.624 +  32,16,16,16,32,9999,9999,9999,9999,9999,9999
 163.625 +};
 163.626 +static const int _noise_start_long_44[11]={
 163.627 +  /*  128,128,128,256,512,512,9999,9999,9999,9999 */
 163.628 +  256,128,128,256,512,9999,9999,9999,9999,9999,9999
 163.629 +};
 163.630 +
 163.631 +static const int _noise_part_short_44[11]={
 163.632 +    8,8,8,8,8,8,8,8,8,8,8
 163.633 +};
 163.634 +static const int _noise_part_long_44[11]={
 163.635 +    32,32,32,32,32,32,32,32,32,32,32
 163.636 +};
 163.637 +
 163.638 +static const double _noise_thresh_44[11]={
 163.639 +  /*  .2,.2,.3,.4,.5,.5,9999.,9999.,9999.,9999., */
 163.640 +   .2,.2,.2,.4,.6,9999.,9999.,9999.,9999.,9999.,9999.,
 163.641 +};
 163.642 +
 163.643 +static const double _noise_thresh_5only[2]={
 163.644 + .5,.5,
 163.645 +};
   164.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   164.2 +++ b/libs/vorbis/modes/psych_8.h	Sun Nov 01 00:36:56 2015 +0200
   164.3 @@ -0,0 +1,101 @@
   164.4 +/********************************************************************
   164.5 + *                                                                  *
   164.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   164.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   164.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   164.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  164.10 + *                                                                  *
  164.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
  164.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  164.13 + *                                                                  *
  164.14 + ********************************************************************
  164.15 +
  164.16 + function: 8kHz psychoacoustic settings
  164.17 + last mod: $Id: psych_8.h 16227 2009-07-08 06:58:46Z xiphmont $
  164.18 +
  164.19 + ********************************************************************/
  164.20 +
  164.21 +static const att3 _psy_tone_masteratt_8[3]={
  164.22 +  {{ 32,  25,  12},  0,   0},  /* 0 */
  164.23 +  {{ 30,  25,  12},  0,   0},  /* 0 */
  164.24 +  {{ 20,   0, -14},  0,   0}, /* 0 */
  164.25 +};
  164.26 +
  164.27 +static const vp_adjblock _vp_tonemask_adj_8[3]={
  164.28 +  /* adjust for mode zero */
  164.29 +  /* 63     125     250     500     1     2     4     8    16 */
  164.30 +  {{-15,-15,-15,-15,-10,-10, -6, 0, 0, 0, 0,10, 0, 0,99,99,99}}, /* 1 */
  164.31 +  {{-15,-15,-15,-15,-10,-10, -6, 0, 0, 0, 0,10, 0, 0,99,99,99}}, /* 1 */
  164.32 +  {{-15,-15,-15,-15,-10,-10, -6, 0, 0, 0, 0, 0, 0, 0,99,99,99}}, /* 1 */
  164.33 +};
  164.34 +
  164.35 +
  164.36 +static const noise3 _psy_noisebias_8[3]={
  164.37 +  /*  63     125     250     500      1k       2k      4k      8k     16k*/
  164.38 +  {{{-10,-10,-10,-10, -5, -5, -5,  0,  4,  8,  8,  8, 10, 10, 99, 99, 99},
  164.39 +    {-10,-10,-10,-10, -5, -5, -5,  0,  0,  4,  4,  4,  4,  4, 99, 99, 99},
  164.40 +    {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, 99, 99, 99}}},
  164.41 +
  164.42 +  {{{-10,-10,-10,-10, -5, -5, -5,  0,  4,  8,  8,  8, 10, 10, 99, 99, 99},
  164.43 +    {-10,-10,-10,-10,-10,-10, -5, -5, -5,  0,  0,  0,  0,  0, 99, 99, 99},
  164.44 +    {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, 99, 99, 99}}},
  164.45 +
  164.46 +  {{{-15,-15,-15,-15,-15,-12,-10, -8,  0,  2,  4,  4,  5,  5, 99, 99, 99},
  164.47 +    {-30,-30,-30,-30,-26,-22,-20,-14,-12,-12,-10,-10,-10,-10, 99, 99, 99},
  164.48 +    {-30,-30,-30,-30,-26,-26,-26,-26,-26,-26,-26,-26,-26,-24, 99, 99, 99}}},
  164.49 +};
  164.50 +
  164.51 +/* stereo mode by base quality level */
  164.52 +static const adj_stereo _psy_stereo_modes_8[3]={
  164.53 +  /*  0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  */
  164.54 +  {{  4,  4,  4,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3},
  164.55 +   {  6,  5,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4},
  164.56 +   {  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1},
  164.57 +   { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
  164.58 +  {{  4,  4,  4,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3},
  164.59 +   {  6,  5,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4},
  164.60 +   {  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1},
  164.61 +   { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
  164.62 +  {{  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3},
  164.63 +   {  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4},
  164.64 +   {  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1},
  164.65 +   { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
  164.66 +};
  164.67 +
  164.68 +static const noiseguard _psy_noiseguards_8[2]={
  164.69 +  {10,10,-1},
  164.70 +  {10,10,-1},
  164.71 +};
  164.72 +
  164.73 +static const compandblock _psy_compand_8[2]={
  164.74 +  {{
  164.75 +     0, 1, 2, 3, 4, 5, 6,  7,     /* 7dB */
  164.76 +     8, 8, 9, 9,10,10,11, 11,     /* 15dB */
  164.77 +    12,12,13,13,14,14,15, 15,     /* 23dB */
  164.78 +    16,16,17,17,17,18,18, 19,     /* 31dB */
  164.79 +    19,19,20,21,22,23,24, 25,     /* 39dB */
  164.80 +  }},
  164.81 +  {{
  164.82 +     0, 1, 2, 3, 4, 5, 6,  6,     /* 7dB */
  164.83 +     7, 7, 6, 6, 5, 5, 4,  4,     /* 15dB */
  164.84 +     3, 3, 3, 4, 5, 6, 7,  8,     /* 23dB */
  164.85 +     9,10,11,12,13,14,15, 16,     /* 31dB */
  164.86 +    17,18,19,20,21,22,23, 24,     /* 39dB */
  164.87 +  }},
  164.88 +};
  164.89 +
  164.90 +static const double _psy_lowpass_8[3]={3.,4.,4.};
  164.91 +static const int _noise_start_8[2]={
  164.92 +  64,64,
  164.93 +};
  164.94 +static const int _noise_part_8[2]={
  164.95 +  8,8,
  164.96 +};
  164.97 +
  164.98 +static const int _psy_ath_floater_8[3]={
  164.99 +  -100,-100,-105,
 164.100 +};
 164.101 +
 164.102 +static const int _psy_ath_abs_8[3]={
 164.103 +  -130,-130,-140,
 164.104 +};
   165.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   165.2 +++ b/libs/vorbis/modes/residue_16.h	Sun Nov 01 00:36:56 2015 +0200
   165.3 @@ -0,0 +1,163 @@
   165.4 +/********************************************************************
   165.5 + *                                                                  *
   165.6 + * This FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   165.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   165.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   165.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  165.10 + *                                                                  *
  165.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
  165.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  165.13 + *                                                                  *
  165.14 + ********************************************************************
  165.15 +
  165.16 + function: toplevel residue templates 16/22kHz
  165.17 + last mod: $Id: residue_16.h 16962 2010-03-11 07:30:34Z xiphmont $
  165.18 +
  165.19 + ********************************************************************/
  165.20 +
  165.21 +/***** residue backends *********************************************/
  165.22 +
  165.23 +static const static_bookblock _resbook_16s_0={
  165.24 +  {
  165.25 +    {0},
  165.26 +    {0,0,&_16c0_s_p1_0},
  165.27 +    {0},
  165.28 +    {0,0,&_16c0_s_p3_0},
  165.29 +    {0,0,&_16c0_s_p4_0},
  165.30 +    {0,0,&_16c0_s_p5_0},
  165.31 +    {0,0,&_16c0_s_p6_0},
  165.32 +    {&_16c0_s_p7_0,&_16c0_s_p7_1},
  165.33 +    {&_16c0_s_p8_0,&_16c0_s_p8_1},
  165.34 +    {&_16c0_s_p9_0,&_16c0_s_p9_1,&_16c0_s_p9_2}
  165.35 +   }
  165.36 +};
  165.37 +static const static_bookblock _resbook_16s_1={
  165.38 +  {
  165.39 +    {0},
  165.40 +    {0,0,&_16c1_s_p1_0},
  165.41 +    {0},
  165.42 +    {0,0,&_16c1_s_p3_0},
  165.43 +    {0,0,&_16c1_s_p4_0},
  165.44 +    {0,0,&_16c1_s_p5_0},
  165.45 +    {0,0,&_16c1_s_p6_0},
  165.46 +    {&_16c1_s_p7_0,&_16c1_s_p7_1},
  165.47 +    {&_16c1_s_p8_0,&_16c1_s_p8_1},
  165.48 +    {&_16c1_s_p9_0,&_16c1_s_p9_1,&_16c1_s_p9_2}
  165.49 +   }
  165.50 +};
  165.51 +static const static_bookblock _resbook_16s_2={
  165.52 +  {
  165.53 +    {0},
  165.54 +    {0,0,&_16c2_s_p1_0},
  165.55 +    {0,0,&_16c2_s_p2_0},
  165.56 +    {0,0,&_16c2_s_p3_0},
  165.57 +    {0,0,&_16c2_s_p4_0},
  165.58 +    {&_16c2_s_p5_0,&_16c2_s_p5_1},
  165.59 +    {&_16c2_s_p6_0,&_16c2_s_p6_1},
  165.60 +    {&_16c2_s_p7_0,&_16c2_s_p7_1},
  165.61 +    {&_16c2_s_p8_0,&_16c2_s_p8_1},
  165.62 +    {&_16c2_s_p9_0,&_16c2_s_p9_1,&_16c2_s_p9_2}
  165.63 +   }
  165.64 +};
  165.65 +
  165.66 +static const vorbis_residue_template _res_16s_0[]={
  165.67 +  {2,0,32,  &_residue_44_mid,
  165.68 +   &_huff_book__16c0_s_single,&_huff_book__16c0_s_single,
  165.69 +   &_resbook_16s_0,&_resbook_16s_0},
  165.70 +};
  165.71 +static const vorbis_residue_template _res_16s_1[]={
  165.72 +  {2,0,32,  &_residue_44_mid,
  165.73 +   &_huff_book__16c1_s_short,&_huff_book__16c1_s_short,
  165.74 +   &_resbook_16s_1,&_resbook_16s_1},
  165.75 +
  165.76 +  {2,0,32,  &_residue_44_mid,
  165.77 +   &_huff_book__16c1_s_long,&_huff_book__16c1_s_long,
  165.78 +   &_resbook_16s_1,&_resbook_16s_1}
  165.79 +};
  165.80 +static const vorbis_residue_template _res_16s_2[]={
  165.81 +  {2,0,32,  &_residue_44_high,
  165.82 +   &_huff_book__16c2_s_short,&_huff_book__16c2_s_short,
  165.83 +   &_resbook_16s_2,&_resbook_16s_2},
  165.84 +
  165.85 +  {2,0,32,  &_residue_44_high,
  165.86 +   &_huff_book__16c2_s_long,&_huff_book__16c2_s_long,
  165.87 +   &_resbook_16s_2,&_resbook_16s_2}
  165.88 +};
  165.89 +
  165.90 +static const vorbis_mapping_template _mapres_template_16_stereo[3]={
  165.91 +  { _map_nominal, _res_16s_0 }, /* 0 */
  165.92 +  { _map_nominal, _res_16s_1 }, /* 1 */
  165.93 +  { _map_nominal, _res_16s_2 }, /* 2 */
  165.94 +};
  165.95 +
  165.96 +static const static_bookblock _resbook_16u_0={
  165.97 +  {
  165.98 +    {0},
  165.99 +    {0,0,&_16u0__p1_0},
 165.100 +    {0,0,&_16u0__p2_0},
 165.101 +    {0,0,&_16u0__p3_0},
 165.102 +    {0,0,&_16u0__p4_0},
 165.103 +    {0,0,&_16u0__p5_0},
 165.104 +    {&_16u0__p6_0,&_16u0__p6_1},
 165.105 +    {&_16u0__p7_0,&_16u0__p7_1,&_16u0__p7_2}
 165.106 +   }
 165.107 +};
 165.108 +static const static_bookblock _resbook_16u_1={
 165.109 +  {
 165.110 +    {0},
 165.111 +    {0,0,&_16u1__p1_0},
 165.112 +    {0,0,&_16u1__p2_0},
 165.113 +    {0,0,&_16u1__p3_0},
 165.114 +    {0,0,&_16u1__p4_0},
 165.115 +    {0,0,&_16u1__p5_0},
 165.116 +    {0,0,&_16u1__p6_0},
 165.117 +    {&_16u1__p7_0,&_16u1__p7_1},
 165.118 +    {&_16u1__p8_0,&_16u1__p8_1},
 165.119 +    {&_16u1__p9_0,&_16u1__p9_1,&_16u1__p9_2}
 165.120 +   }
 165.121 +};
 165.122 +static const static_bookblock _resbook_16u_2={
 165.123 +  {
 165.124 +    {0},
 165.125 +    {0,0,&_16u2_p1_0},
 165.126 +    {0,0,&_16u2_p2_0},
 165.127 +    {0,0,&_16u2_p3_0},
 165.128 +    {0,0,&_16u2_p4_0},
 165.129 +    {&_16u2_p5_0,&_16u2_p5_1},
 165.130 +    {&_16u2_p6_0,&_16u2_p6_1},
 165.131 +    {&_16u2_p7_0,&_16u2_p7_1},
 165.132 +    {&_16u2_p8_0,&_16u2_p8_1},
 165.133 +    {&_16u2_p9_0,&_16u2_p9_1,&_16u2_p9_2}
 165.134 +   }
 165.135 +};
 165.136 +
 165.137 +static const vorbis_residue_template _res_16u_0[]={
 165.138 +  {1,0,32,  &_residue_44_low_un,
 165.139 +   &_huff_book__16u0__single,&_huff_book__16u0__single,
 165.140 +   &_resbook_16u_0,&_resbook_16u_0},
 165.141 +};
 165.142 +static const vorbis_residue_template _res_16u_1[]={
 165.143 +  {1,0,32,  &_residue_44_mid_un,
 165.144 +   &_huff_book__16u1__short,&_huff_book__16u1__short,
 165.145 +   &_resbook_16u_1,&_resbook_16u_1},
 165.146 +
 165.147 +  {1,0,32,  &_residue_44_mid_un,
 165.148 +   &_huff_book__16u1__long,&_huff_book__16u1__long,
 165.149 +   &_resbook_16u_1,&_resbook_16u_1}
 165.150 +};
 165.151 +static const vorbis_residue_template _res_16u_2[]={
 165.152 +  {1,0,32,  &_residue_44_hi_un,
 165.153 +   &_huff_book__16u2__short,&_huff_book__16u2__short,
 165.154 +   &_resbook_16u_2,&_resbook_16u_2},
 165.155 +
 165.156 +  {1,0,32,  &_residue_44_hi_un,
 165.157 +   &_huff_book__16u2__long,&_huff_book__16u2__long,
 165.158 +   &_resbook_16u_2,&_resbook_16u_2}
 165.159 +};
 165.160 +
 165.161 +
 165.162 +static const vorbis_mapping_template _mapres_template_16_uncoupled[3]={
 165.163 +  { _map_nominal_u, _res_16u_0 }, /* 0 */
 165.164 +  { _map_nominal_u, _res_16u_1 }, /* 1 */
 165.165 +  { _map_nominal_u, _res_16u_2 }, /* 2 */
 165.166 +};
   166.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   166.2 +++ b/libs/vorbis/modes/residue_44.h	Sun Nov 01 00:36:56 2015 +0200
   166.3 @@ -0,0 +1,292 @@
   166.4 +/********************************************************************
   166.5 + *                                                                  *
   166.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   166.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   166.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   166.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  166.10 + *                                                                  *
  166.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
  166.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  166.13 + *                                                                  *
  166.14 + ********************************************************************
  166.15 +
  166.16 + function: toplevel residue templates for 32/44.1/48kHz
  166.17 + last mod: $Id: residue_44.h 16962 2010-03-11 07:30:34Z xiphmont $
  166.18 +
  166.19 + ********************************************************************/
  166.20 +
  166.21 +#include "vorbis/codec.h"
  166.22 +#include "backends.h"
  166.23 +#include "books/coupled/res_books_stereo.h"
  166.24 +
  166.25 +/***** residue backends *********************************************/
  166.26 +
  166.27 +static const vorbis_info_residue0 _residue_44_low={
  166.28 +  0,-1, -1, 9,-1,-1,
  166.29 +  /* 0   1   2   3   4   5   6   7  */
  166.30 +  {0},
  166.31 +  {-1},
  166.32 +  {  0,  1,  2,  2,  4,  8, 16, 32},
  166.33 +  {  0,  0,  0,999,  4,  8, 16, 32},
  166.34 +};
  166.35 +
  166.36 +static const vorbis_info_residue0 _residue_44_mid={
  166.37 +  0,-1, -1, 10,-1,-1,
  166.38 +  /* 0   1   2   3   4   5   6   7   8  */
  166.39 +  {0},
  166.40 +  {-1},
  166.41 +  {  0,  1,  1,  2,  2,  4,  8, 16, 32},
  166.42 +  {  0,  0,999,  0,999,  4,  8, 16, 32},
  166.43 +};
  166.44 +
  166.45 +static const vorbis_info_residue0 _residue_44_high={
  166.46 +  0,-1, -1, 10,-1,-1,
  166.47 +  /* 0   1   2   3   4   5   6   7   8  */
  166.48 +  {0},
  166.49 +  {-1},
  166.50 +  {  0,  1,  2,  4,  8, 16, 32, 71,157},
  166.51 +  {  0,  1,  2,  3,  4,  8, 16, 71,157},
  166.52 +};
  166.53 +
  166.54 +static const static_bookblock _resbook_44s_n1={
  166.55 +  {
  166.56 +    {0},{0,0,&_44cn1_s_p1_0},{0,0,&_44cn1_s_p2_0},
  166.57 +    {0,0,&_44cn1_s_p3_0},{0,0,&_44cn1_s_p4_0},{0,0,&_44cn1_s_p5_0},
  166.58 +    {&_44cn1_s_p6_0,&_44cn1_s_p6_1},{&_44cn1_s_p7_0,&_44cn1_s_p7_1},
  166.59 +    {&_44cn1_s_p8_0,&_44cn1_s_p8_1,&_44cn1_s_p8_2}
  166.60 +   }
  166.61 +};
  166.62 +static const static_bookblock _resbook_44sm_n1={
  166.63 +  {
  166.64 +    {0},{0,0,&_44cn1_sm_p1_0},{0,0,&_44cn1_sm_p2_0},
  166.65 +    {0,0,&_44cn1_sm_p3_0},{0,0,&_44cn1_sm_p4_0},{0,0,&_44cn1_sm_p5_0},
  166.66 +    {&_44cn1_sm_p6_0,&_44cn1_sm_p6_1},{&_44cn1_sm_p7_0,&_44cn1_sm_p7_1},
  166.67 +    {&_44cn1_sm_p8_0,&_44cn1_sm_p8_1,&_44cn1_sm_p8_2}
  166.68 +   }
  166.69 +};
  166.70 +
  166.71 +static const static_bookblock _resbook_44s_0={
  166.72 +  {
  166.73 +    {0},{0,0,&_44c0_s_p1_0},{0,0,&_44c0_s_p2_0},
  166.74 +    {0,0,&_44c0_s_p3_0},{0,0,&_44c0_s_p4_0},{0,0,&_44c0_s_p5_0},
  166.75 +    {&_44c0_s_p6_0,&_44c0_s_p6_1},{&_44c0_s_p7_0,&_44c0_s_p7_1},
  166.76 +    {&_44c0_s_p8_0,&_44c0_s_p8_1,&_44c0_s_p8_2}
  166.77 +   }
  166.78 +};
  166.79 +static const static_bookblock _resbook_44sm_0={
  166.80 +  {
  166.81 +    {0},{0,0,&_44c0_sm_p1_0},{0,0,&_44c0_sm_p2_0},
  166.82 +    {0,0,&_44c0_sm_p3_0},{0,0,&_44c0_sm_p4_0},{0,0,&_44c0_sm_p5_0},
  166.83 +    {&_44c0_sm_p6_0,&_44c0_sm_p6_1},{&_44c0_sm_p7_0,&_44c0_sm_p7_1},
  166.84 +    {&_44c0_sm_p8_0,&_44c0_sm_p8_1,&_44c0_sm_p8_2}
  166.85 +   }
  166.86 +};
  166.87 +
  166.88 +static const static_bookblock _resbook_44s_1={
  166.89 +  {
  166.90 +    {0},{0,0,&_44c1_s_p1_0},{0,0,&_44c1_s_p2_0},
  166.91 +    {0,0,&_44c1_s_p3_0},{0,0,&_44c1_s_p4_0},{0,0,&_44c1_s_p5_0},
  166.92 +    {&_44c1_s_p6_0,&_44c1_s_p6_1},{&_44c1_s_p7_0,&_44c1_s_p7_1},
  166.93 +    {&_44c1_s_p8_0,&_44c1_s_p8_1,&_44c1_s_p8_2}
  166.94 +   }
  166.95 +};
  166.96 +static const static_bookblock _resbook_44sm_1={
  166.97 +  {
  166.98 +    {0},{0,0,&_44c1_sm_p1_0},{0,0,&_44c1_sm_p2_0},
  166.99 +    {0,0,&_44c1_sm_p3_0},{0,0,&_44c1_sm_p4_0},{0,0,&_44c1_sm_p5_0},
 166.100 +    {&_44c1_sm_p6_0,&_44c1_sm_p6_1},{&_44c1_sm_p7_0,&_44c1_sm_p7_1},
 166.101 +    {&_44c1_sm_p8_0,&_44c1_sm_p8_1,&_44c1_sm_p8_2}
 166.102 +   }
 166.103 +};
 166.104 +
 166.105 +static const static_bookblock _resbook_44s_2={
 166.106 +  {
 166.107 +    {0},{0,0,&_44c2_s_p1_0},{0,0,&_44c2_s_p2_0},{0,0,&_44c2_s_p3_0},
 166.108 +    {0,0,&_44c2_s_p4_0},{0,0,&_44c2_s_p5_0},{0,0,&_44c2_s_p6_0},
 166.109 +    {&_44c2_s_p7_0,&_44c2_s_p7_1},{&_44c2_s_p8_0,&_44c2_s_p8_1},
 166.110 +    {&_44c2_s_p9_0,&_44c2_s_p9_1,&_44c2_s_p9_2}
 166.111 +   }
 166.112 +};
 166.113 +static const static_bookblock _resbook_44s_3={
 166.114 +  {
 166.115 +    {0},{0,0,&_44c3_s_p1_0},{0,0,&_44c3_s_p2_0},{0,0,&_44c3_s_p3_0},
 166.116 +    {0,0,&_44c3_s_p4_0},{0,0,&_44c3_s_p5_0},{0,0,&_44c3_s_p6_0},
 166.117 +    {&_44c3_s_p7_0,&_44c3_s_p7_1},{&_44c3_s_p8_0,&_44c3_s_p8_1},
 166.118 +    {&_44c3_s_p9_0,&_44c3_s_p9_1,&_44c3_s_p9_2}
 166.119 +   }
 166.120 +};
 166.121 +static const static_bookblock _resbook_44s_4={
 166.122 +  {
 166.123 +    {0},{0,0,&_44c4_s_p1_0},{0,0,&_44c4_s_p2_0},{0,0,&_44c4_s_p3_0},
 166.124 +    {0,0,&_44c4_s_p4_0},{0,0,&_44c4_s_p5_0},{0,0,&_44c4_s_p6_0},
 166.125 +    {&_44c4_s_p7_0,&_44c4_s_p7_1},{&_44c4_s_p8_0,&_44c4_s_p8_1},
 166.126 +    {&_44c4_s_p9_0,&_44c4_s_p9_1,&_44c4_s_p9_2}
 166.127 +   }
 166.128 +};
 166.129 +static const static_bookblock _resbook_44s_5={
 166.130 +  {
 166.131 +    {0},{0,0,&_44c5_s_p1_0},{0,0,&_44c5_s_p2_0},{0,0,&_44c5_s_p3_0},
 166.132 +    {0,0,&_44c5_s_p4_0},{0,0,&_44c5_s_p5_0},{0,0,&_44c5_s_p6_0},
 166.133 +    {&_44c5_s_p7_0,&_44c5_s_p7_1},{&_44c5_s_p8_0,&_44c5_s_p8_1},
 166.134 +    {&_44c5_s_p9_0,&_44c5_s_p9_1,&_44c5_s_p9_2}
 166.135 +   }
 166.136 +};
 166.137 +static const static_bookblock _resbook_44s_6={
 166.138 +  {
 166.139 +    {0},{0,0,&_44c6_s_p1_0},{0,0,&_44c6_s_p2_0},{0,0,&_44c6_s_p3_0},
 166.140 +    {0,0,&_44c6_s_p4_0},
 166.141 +    {&_44c6_s_p5_0,&_44c6_s_p5_1},
 166.142 +    {&_44c6_s_p6_0,&_44c6_s_p6_1},
 166.143 +    {&_44c6_s_p7_0,&_44c6_s_p7_1},
 166.144 +    {&_44c6_s_p8_0,&_44c6_s_p8_1},
 166.145 +    {&_44c6_s_p9_0,&_44c6_s_p9_1,&_44c6_s_p9_2}
 166.146 +   }
 166.147 +};
 166.148 +static const static_bookblock _resbook_44s_7={
 166.149 +  {
 166.150 +    {0},{0,0,&_44c7_s_p1_0},{0,0,&_44c7_s_p2_0},{0,0,&_44c7_s_p3_0},
 166.151 +    {0,0,&_44c7_s_p4_0},
 166.152 +    {&_44c7_s_p5_0,&_44c7_s_p5_1},
 166.153 +    {&_44c7_s_p6_0,&_44c7_s_p6_1},
 166.154 +    {&_44c7_s_p7_0,&_44c7_s_p7_1},
 166.155 +    {&_44c7_s_p8_0,&_44c7_s_p8_1},
 166.156 +    {&_44c7_s_p9_0,&_44c7_s_p9_1,&_44c7_s_p9_2}
 166.157 +   }
 166.158 +};
 166.159 +static const static_bookblock _resbook_44s_8={
 166.160 +  {
 166.161 +    {0},{0,0,&_44c8_s_p1_0},{0,0,&_44c8_s_p2_0},{0,0,&_44c8_s_p3_0},
 166.162 +    {0,0,&_44c8_s_p4_0},
 166.163 +    {&_44c8_s_p5_0,&_44c8_s_p5_1},
 166.164 +    {&_44c8_s_p6_0,&_44c8_s_p6_1},
 166.165 +    {&_44c8_s_p7_0,&_44c8_s_p7_1},
 166.166 +    {&_44c8_s_p8_0,&_44c8_s_p8_1},
 166.167 +    {&_44c8_s_p9_0,&_44c8_s_p9_1,&_44c8_s_p9_2}
 166.168 +   }
 166.169 +};
 166.170 +static const static_bookblock _resbook_44s_9={
 166.171 +  {
 166.172 +    {0},{0,0,&_44c9_s_p1_0},{0,0,&_44c9_s_p2_0},{0,0,&_44c9_s_p3_0},
 166.173 +    {0,0,&_44c9_s_p4_0},
 166.174 +    {&_44c9_s_p5_0,&_44c9_s_p5_1},
 166.175 +    {&_44c9_s_p6_0,&_44c9_s_p6_1},
 166.176 +    {&_44c9_s_p7_0,&_44c9_s_p7_1},
 166.177 +    {&_44c9_s_p8_0,&_44c9_s_p8_1},
 166.178 +    {&_44c9_s_p9_0,&_44c9_s_p9_1,&_44c9_s_p9_2}
 166.179 +   }
 166.180 +};
 166.181 +
 166.182 +static const vorbis_residue_template _res_44s_n1[]={
 166.183 +  {2,0,32,  &_residue_44_low,
 166.184 +   &_huff_book__44cn1_s_short,&_huff_book__44cn1_sm_short,
 166.185 +   &_resbook_44s_n1,&_resbook_44sm_n1},
 166.186 +
 166.187 +  {2,0,32,  &_residue_44_low,
 166.188 +   &_huff_book__44cn1_s_long,&_huff_book__44cn1_sm_long,
 166.189 +   &_resbook_44s_n1,&_resbook_44sm_n1}
 166.190 +};
 166.191 +static const vorbis_residue_template _res_44s_0[]={
 166.192 +  {2,0,16,  &_residue_44_low,
 166.193 +   &_huff_book__44c0_s_short,&_huff_book__44c0_sm_short,
 166.194 +   &_resbook_44s_0,&_resbook_44sm_0},
 166.195 +
 166.196 +  {2,0,32,  &_residue_44_low,
 166.197 +   &_huff_book__44c0_s_long,&_huff_book__44c0_sm_long,
 166.198 +   &_resbook_44s_0,&_resbook_44sm_0}
 166.199 +};
 166.200 +static const vorbis_residue_template _res_44s_1[]={
 166.201 +  {2,0,16,  &_residue_44_low,
 166.202 +   &_huff_book__44c1_s_short,&_huff_book__44c1_sm_short,
 166.203 +   &_resbook_44s_1,&_resbook_44sm_1},
 166.204 +
 166.205 +  {2,0,32,  &_residue_44_low,
 166.206 +   &_huff_book__44c1_s_long,&_huff_book__44c1_sm_long,
 166.207 +   &_resbook_44s_1,&_resbook_44sm_1}
 166.208 +};
 166.209 +
 166.210 +static const vorbis_residue_template _res_44s_2[]={
 166.211 +  {2,0,16,  &_residue_44_mid,
 166.212 +   &_huff_book__44c2_s_short,&_huff_book__44c2_s_short,
 166.213 +   &_resbook_44s_2,&_resbook_44s_2},
 166.214 +
 166.215 +  {2,0,32,  &_residue_44_mid,
 166.216 +   &_huff_book__44c2_s_long,&_huff_book__44c2_s_long,
 166.217 +   &_resbook_44s_2,&_resbook_44s_2}
 166.218 +};
 166.219 +static const vorbis_residue_template _res_44s_3[]={
 166.220 +  {2,0,16,  &_residue_44_mid,
 166.221 +   &_huff_book__44c3_s_short,&_huff_book__44c3_s_short,
 166.222 +   &_resbook_44s_3,&_resbook_44s_3},
 166.223 +
 166.224 +  {2,0,32,  &_residue_44_mid,
 166.225 +   &_huff_book__44c3_s_long,&_huff_book__44c3_s_long,
 166.226 +   &_resbook_44s_3,&_resbook_44s_3}
 166.227 +};
 166.228 +static const vorbis_residue_template _res_44s_4[]={
 166.229 +  {2,0,16,  &_residue_44_mid,
 166.230 +   &_huff_book__44c4_s_short,&_huff_book__44c4_s_short,
 166.231 +   &_resbook_44s_4,&_resbook_44s_4},
 166.232 +
 166.233 +  {2,0,32,  &_residue_44_mid,
 166.234 +   &_huff_book__44c4_s_long,&_huff_book__44c4_s_long,
 166.235 +   &_resbook_44s_4,&_resbook_44s_4}
 166.236 +};
 166.237 +static const vorbis_residue_template _res_44s_5[]={
 166.238 +  {2,0,16,  &_residue_44_mid,
 166.239 +   &_huff_book__44c5_s_short,&_huff_book__44c5_s_short,
 166.240 +   &_resbook_44s_5,&_resbook_44s_5},
 166.241 +
 166.242 +  {2,0,32,  &_residue_44_mid,
 166.243 +   &_huff_book__44c5_s_long,&_huff_book__44c5_s_long,
 166.244 +   &_resbook_44s_5,&_resbook_44s_5}
 166.245 +};
 166.246 +static const vorbis_residue_template _res_44s_6[]={
 166.247 +  {2,0,16,  &_residue_44_high,
 166.248 +   &_huff_book__44c6_s_short,&_huff_book__44c6_s_short,
 166.249 +   &_resbook_44s_6,&_resbook_44s_6},
 166.250 +
 166.251 +  {2,0,32,  &_residue_44_high,
 166.252 +   &_huff_book__44c6_s_long,&_huff_book__44c6_s_long,
 166.253 +   &_resbook_44s_6,&_resbook_44s_6}
 166.254 +};
 166.255 +static const vorbis_residue_template _res_44s_7[]={
 166.256 +  {2,0,16,  &_residue_44_high,
 166.257 +   &_huff_book__44c7_s_short,&_huff_book__44c7_s_short,
 166.258 +   &_resbook_44s_7,&_resbook_44s_7},
 166.259 +
 166.260 +  {2,0,32,  &_residue_44_high,
 166.261 +   &_huff_book__44c7_s_long,&_huff_book__44c7_s_long,
 166.262 +   &_resbook_44s_7,&_resbook_44s_7}
 166.263 +};
 166.264 +static const vorbis_residue_template _res_44s_8[]={
 166.265 +  {2,0,16,  &_residue_44_high,
 166.266 +   &_huff_book__44c8_s_short,&_huff_book__44c8_s_short,
 166.267 +   &_resbook_44s_8,&_resbook_44s_8},
 166.268 +
 166.269 +  {2,0,32,  &_residue_44_high,
 166.270 +   &_huff_book__44c8_s_long,&_huff_book__44c8_s_long,
 166.271 +   &_resbook_44s_8,&_resbook_44s_8}
 166.272 +};
 166.273 +static const vorbis_residue_template _res_44s_9[]={
 166.274 +  {2,0,16,  &_residue_44_high,
 166.275 +   &_huff_book__44c9_s_short,&_huff_book__44c9_s_short,
 166.276 +   &_resbook_44s_9,&_resbook_44s_9},
 166.277 +
 166.278 +  {2,0,32,  &_residue_44_high,
 166.279 +   &_huff_book__44c9_s_long,&_huff_book__44c9_s_long,
 166.280 +   &_resbook_44s_9,&_resbook_44s_9}
 166.281 +};
 166.282 +
 166.283 +static const vorbis_mapping_template _mapres_template_44_stereo[]={
 166.284 +  { _map_nominal, _res_44s_n1 }, /* -1 */
 166.285 +  { _map_nominal, _res_44s_0 }, /* 0 */
 166.286 +  { _map_nominal, _res_44s_1 }, /* 1 */
 166.287 +  { _map_nominal, _res_44s_2 }, /* 2 */
 166.288 +  { _map_nominal, _res_44s_3 }, /* 3 */
 166.289 +  { _map_nominal, _res_44s_4 }, /* 4 */
 166.290 +  { _map_nominal, _res_44s_5 }, /* 5 */
 166.291 +  { _map_nominal, _res_44s_6 }, /* 6 */
 166.292 +  { _map_nominal, _res_44s_7 }, /* 7 */
 166.293 +  { _map_nominal, _res_44s_8 }, /* 8 */
 166.294 +  { _map_nominal, _res_44s_9 }, /* 9 */
 166.295 +};
   167.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   167.2 +++ b/libs/vorbis/modes/residue_44p51.h	Sun Nov 01 00:36:56 2015 +0200
   167.3 @@ -0,0 +1,451 @@
   167.4 +/********************************************************************
   167.5 + *                                                                  *
   167.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   167.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   167.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   167.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  167.10 + *                                                                  *
  167.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2010             *
  167.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  167.13 + *                                                                  *
  167.14 + ********************************************************************
  167.15 +
  167.16 + function: toplevel residue templates for 32/44.1/48kHz uncoupled
  167.17 + last mod: $Id$
  167.18 +
  167.19 + ********************************************************************/
  167.20 +
  167.21 +#include "vorbis/codec.h"
  167.22 +#include "backends.h"
  167.23 +
  167.24 +#include "books/coupled/res_books_51.h"
  167.25 +
  167.26 +/***** residue backends *********************************************/
  167.27 +
  167.28 +static const vorbis_info_residue0 _residue_44p_lo={
  167.29 +  0,-1, -1, 7,-1,-1,
  167.30 +  /* 0   1   2   3   4   5   6   7   8  */
  167.31 +  {0},
  167.32 +  {-1},
  167.33 +  {  0,  1,  2,  7, 17, 31},
  167.34 +  {  0,  0, 99,  7, 17, 31},
  167.35 +};
  167.36 +
  167.37 +static const vorbis_info_residue0 _residue_44p={
  167.38 +  0,-1, -1, 8,-1,-1,
  167.39 +  /* 0   1   2   3   4   5   6   7   8  */
  167.40 +  {0},
  167.41 +  {-1},
  167.42 +  {  0,  1,  1,   2,  7, 17, 31},
  167.43 +  {  0,  0, 99,  99,  7, 17, 31},
  167.44 +};
  167.45 +
  167.46 +static const vorbis_info_residue0 _residue_44p_hi={
  167.47 +  0,-1, -1, 8,-1,-1,
  167.48 +  /* 0   1   2   3   4   5   6   7   8  */
  167.49 +  {0},
  167.50 +  {-1},
  167.51 +  {  0,  1,  2,  4,  7, 17, 31},
  167.52 +  {  0,  1,  2,  4,  7, 17, 31},
  167.53 +};
  167.54 +
  167.55 +static const vorbis_info_residue0 _residue_44p_lfe={
  167.56 +  0,-1, -1, 2,-1,-1,
  167.57 +  /* 0   1   2   3   4   5   6   7   8  */
  167.58 +  {0},
  167.59 +  {-1},
  167.60 +  { 32},
  167.61 +  { -1}
  167.62 +};
  167.63 +
  167.64 +static const static_bookblock _resbook_44p_n1={
  167.65 +  {
  167.66 +    {0},
  167.67 +    {0,&_44pn1_p1_0},
  167.68 +
  167.69 +    {&_44pn1_p2_0,&_44pn1_p2_1,0},
  167.70 +    {&_44pn1_p3_0,&_44pn1_p3_1,0},
  167.71 +    {&_44pn1_p4_0,&_44pn1_p4_1,0},
  167.72 +
  167.73 +    {&_44pn1_p5_0,&_44pn1_p5_1,&_44pn1_p4_1},
  167.74 +    {&_44pn1_p6_0,&_44pn1_p6_1,&_44pn1_p6_2},
  167.75 +   }
  167.76 +};
  167.77 +
  167.78 +static const static_bookblock _resbook_44p_0={
  167.79 +  {
  167.80 +    {0},
  167.81 +    {0,&_44p0_p1_0},
  167.82 +
  167.83 +    {&_44p0_p2_0,&_44p0_p2_1,0},
  167.84 +    {&_44p0_p3_0,&_44p0_p3_1,0},
  167.85 +    {&_44p0_p4_0,&_44p0_p4_1,0},
  167.86 +
  167.87 +    {&_44p0_p5_0,&_44p0_p5_1,&_44p0_p4_1},
  167.88 +    {&_44p0_p6_0,&_44p0_p6_1,&_44p0_p6_2},
  167.89 +   }
  167.90 +};
  167.91 +
  167.92 +static const static_bookblock _resbook_44p_1={
  167.93 +  {
  167.94 +    {0},
  167.95 +    {0,&_44p1_p1_0},
  167.96 +
  167.97 +    {&_44p1_p2_0,&_44p1_p2_1,0},
  167.98 +    {&_44p1_p3_0,&_44p1_p3_1,0},
  167.99 +    {&_44p1_p4_0,&_44p1_p4_1,0},
 167.100 +
 167.101 +    {&_44p1_p5_0,&_44p1_p5_1,&_44p1_p4_1},
 167.102 +    {&_44p1_p6_0,&_44p1_p6_1,&_44p1_p6_2},
 167.103 +   }
 167.104 +};
 167.105 +
 167.106 +static const static_bookblock _resbook_44p_2={
 167.107 +  {
 167.108 +    {0},
 167.109 +    {0,0,&_44p2_p1_0},
 167.110 +    {0,&_44p2_p2_0,0},
 167.111 +
 167.112 +    {&_44p2_p3_0,&_44p2_p3_1,0},
 167.113 +    {&_44p2_p4_0,&_44p2_p4_1,0},
 167.114 +    {&_44p2_p5_0,&_44p2_p5_1,0},
 167.115 +
 167.116 +    {&_44p2_p6_0,&_44p2_p6_1,&_44p2_p5_1},
 167.117 +    {&_44p2_p7_0,&_44p2_p7_1,&_44p2_p7_2,&_44p2_p7_3}
 167.118 +   }
 167.119 +};
 167.120 +static const static_bookblock _resbook_44p_3={
 167.121 +  {
 167.122 +    {0},
 167.123 +    {0,0,&_44p3_p1_0},
 167.124 +    {0,&_44p3_p2_0,0},
 167.125 +
 167.126 +    {&_44p3_p3_0,&_44p3_p3_1,0},
 167.127 +    {&_44p3_p4_0,&_44p3_p4_1,0},
 167.128 +    {&_44p3_p5_0,&_44p3_p5_1,0},
 167.129 +
 167.130 +    {&_44p3_p6_0,&_44p3_p6_1,&_44p3_p5_1},
 167.131 +    {&_44p3_p7_0,&_44p3_p7_1,&_44p3_p7_2,&_44p3_p7_3}
 167.132 +   }
 167.133 +};
 167.134 +static const static_bookblock _resbook_44p_4={
 167.135 +  {
 167.136 +    {0},
 167.137 +    {0,0,&_44p4_p1_0},
 167.138 +    {0,&_44p4_p2_0,0},
 167.139 +
 167.140 +    {&_44p4_p3_0,&_44p4_p3_1,0},
 167.141 +    {&_44p4_p4_0,&_44p4_p4_1,0},
 167.142 +    {&_44p4_p5_0,&_44p4_p5_1,0},
 167.143 +
 167.144 +    {&_44p4_p6_0,&_44p4_p6_1,&_44p4_p5_1},
 167.145 +    {&_44p4_p7_0,&_44p4_p7_1,&_44p4_p7_2,&_44p4_p7_3}
 167.146 +   }
 167.147 +};
 167.148 +static const static_bookblock _resbook_44p_5={
 167.149 +  {
 167.150 +    {0},
 167.151 +    {0,0,&_44p5_p1_0},
 167.152 +    {0,&_44p5_p2_0,0},
 167.153 +
 167.154 +    {&_44p5_p3_0,&_44p5_p3_1,0},
 167.155 +    {&_44p5_p4_0,&_44p5_p4_1,0},
 167.156 +    {&_44p5_p5_0,&_44p5_p5_1,0},
 167.157 +
 167.158 +    {&_44p5_p6_0,&_44p5_p6_1,&_44p5_p5_1},
 167.159 +    {&_44p5_p7_0,&_44p5_p7_1,&_44p5_p7_2,&_44p5_p7_3}
 167.160 +   }
 167.161 +};
 167.162 +static const static_bookblock _resbook_44p_6={
 167.163 +  {
 167.164 +    {0},
 167.165 +    {0,0,&_44p6_p1_0},
 167.166 +    {0,&_44p6_p2_0,0},
 167.167 +
 167.168 +    {&_44p6_p3_0,&_44p6_p3_1,0},
 167.169 +    {&_44p6_p4_0,&_44p6_p4_1,0},
 167.170 +    {&_44p6_p5_0,&_44p6_p5_1,0},
 167.171 +
 167.172 +    {&_44p6_p6_0,&_44p6_p6_1,&_44p6_p5_1},
 167.173 +    {&_44p6_p7_0,&_44p6_p7_1,&_44p6_p7_2,&_44p6_p7_3}
 167.174 +   }
 167.175 +};
 167.176 +static const static_bookblock _resbook_44p_7={
 167.177 +  {
 167.178 +    {0},
 167.179 +    {0,0,&_44p7_p1_0},
 167.180 +    {0,&_44p7_p2_0,0},
 167.181 +
 167.182 +    {&_44p7_p3_0,&_44p7_p3_1,0},
 167.183 +    {&_44p7_p4_0,&_44p7_p4_1,0},
 167.184 +    {&_44p7_p5_0,&_44p7_p5_1,0},
 167.185 +
 167.186 +    {&_44p7_p6_0,&_44p7_p6_1,&_44p7_p5_1},
 167.187 +    {&_44p7_p7_0,&_44p7_p7_1,&_44p7_p7_2,&_44p7_p7_3}
 167.188 +   }
 167.189 +};
 167.190 +static const static_bookblock _resbook_44p_8={
 167.191 +  {
 167.192 +    {0},
 167.193 +    {0,0,&_44p8_p1_0},
 167.194 +    {0,&_44p8_p2_0,0},
 167.195 +
 167.196 +    {&_44p8_p3_0,&_44p8_p3_1,0},
 167.197 +    {&_44p8_p4_0,&_44p8_p4_1,0},
 167.198 +    {&_44p8_p5_0,&_44p8_p5_1,0},
 167.199 +
 167.200 +    {&_44p8_p6_0,&_44p8_p6_1,&_44p8_p5_1},
 167.201 +    {&_44p8_p7_0,&_44p8_p7_1,&_44p8_p7_2,&_44p8_p7_3}
 167.202 +   }
 167.203 +};
 167.204 +static const static_bookblock _resbook_44p_9={
 167.205 +  {
 167.206 +    {0},
 167.207 +    {0,0,&_44p9_p1_0},
 167.208 +    {0,&_44p9_p2_0,0},
 167.209 +
 167.210 +    {&_44p9_p3_0,&_44p9_p3_1,0},
 167.211 +    {&_44p9_p4_0,&_44p9_p4_1,0},
 167.212 +    {&_44p9_p5_0,&_44p9_p5_1,0},
 167.213 +
 167.214 +    {&_44p9_p6_0,&_44p9_p6_1,&_44p9_p5_1},
 167.215 +    {&_44p9_p7_0,&_44p9_p7_1,&_44p9_p7_2,&_44p9_p7_3}
 167.216 +   }
 167.217 +};
 167.218 +
 167.219 +static const static_bookblock _resbook_44p_ln1={
 167.220 +  {
 167.221 +    {&_44pn1_l0_0,&_44pn1_l0_1,0},
 167.222 +    {&_44pn1_l1_0,&_44pn1_p6_1,&_44pn1_p6_2},
 167.223 +   }
 167.224 +};
 167.225 +static const static_bookblock _resbook_44p_l0={
 167.226 +  {
 167.227 +    {&_44p0_l0_0,&_44p0_l0_1,0},
 167.228 +    {&_44p0_l1_0,&_44p0_p6_1,&_44p0_p6_2},
 167.229 +   }
 167.230 +};
 167.231 +static const static_bookblock _resbook_44p_l1={
 167.232 +  {
 167.233 +    {&_44p1_l0_0,&_44p1_l0_1,0},
 167.234 +    {&_44p1_l1_0,&_44p1_p6_1,&_44p1_p6_2},
 167.235 +   }
 167.236 +};
 167.237 +static const static_bookblock _resbook_44p_l2={
 167.238 +  {
 167.239 +    {&_44p2_l0_0,&_44p2_l0_1,0},
 167.240 +    {&_44p2_l1_0,&_44p2_p7_2,&_44p2_p7_3},
 167.241 +   }
 167.242 +};
 167.243 +static const static_bookblock _resbook_44p_l3={
 167.244 +  {
 167.245 +    {&_44p3_l0_0,&_44p3_l0_1,0},
 167.246 +    {&_44p3_l1_0,&_44p3_p7_2,&_44p3_p7_3},
 167.247 +   }
 167.248 +};
 167.249 +static const static_bookblock _resbook_44p_l4={
 167.250 +  {
 167.251 +    {&_44p4_l0_0,&_44p4_l0_1,0},
 167.252 +    {&_44p4_l1_0,&_44p4_p7_2,&_44p4_p7_3},
 167.253 +   }
 167.254 +};
 167.255 +static const static_bookblock _resbook_44p_l5={
 167.256 +  {
 167.257 +    {&_44p5_l0_0,&_44p5_l0_1,0},
 167.258 +    {&_44p5_l1_0,&_44p5_p7_2,&_44p5_p7_3},
 167.259 +   }
 167.260 +};
 167.261 +static const static_bookblock _resbook_44p_l6={
 167.262 +  {
 167.263 +    {&_44p6_l0_0,&_44p6_l0_1,0},
 167.264 +    {&_44p6_l1_0,&_44p6_p7_2,&_44p6_p7_3},
 167.265 +   }
 167.266 +};
 167.267 +static const static_bookblock _resbook_44p_l7={
 167.268 +  {
 167.269 +    {&_44p7_l0_0,&_44p7_l0_1,0},
 167.270 +    {&_44p7_l1_0,&_44p7_p7_2,&_44p7_p7_3},
 167.271 +   }
 167.272 +};
 167.273 +static const static_bookblock _resbook_44p_l8={
 167.274 +  {
 167.275 +    {&_44p8_l0_0,&_44p8_l0_1,0},
 167.276 +    {&_44p8_l1_0,&_44p8_p7_2,&_44p8_p7_3},
 167.277 +   }
 167.278 +};
 167.279 +static const static_bookblock _resbook_44p_l9={
 167.280 +  {
 167.281 +    {&_44p9_l0_0,&_44p9_l0_1,0},
 167.282 +    {&_44p9_l1_0,&_44p9_p7_2,&_44p9_p7_3},
 167.283 +   }
 167.284 +};
 167.285 +
 167.286 +
 167.287 +static const vorbis_info_mapping0 _map_nominal_51[2]={
 167.288 +  {2, {0,0,0,0,0,1}, {0,2}, {0,2}, 4,{0,3,0,0},{2,4,1,3}},
 167.289 +  {2, {0,0,0,0,0,1}, {1,2}, {1,2}, 4,{0,3,0,0},{2,4,1,3}}
 167.290 +};
 167.291 +static const vorbis_info_mapping0 _map_nominal_51u[2]={
 167.292 +  {2, {0,0,0,0,0,1}, {0,2}, {0,2}, 0,{0},{0}},
 167.293 +  {2, {0,0,0,0,0,1}, {1,2}, {1,2}, 0,{0},{0}}
 167.294 +};
 167.295 +
 167.296 +static const vorbis_residue_template _res_44p51_n1[]={
 167.297 +  {2,0,30,  &_residue_44p_lo,
 167.298 +   &_huff_book__44pn1_short,&_huff_book__44pn1_short,
 167.299 +   &_resbook_44p_n1,&_resbook_44p_n1},
 167.300 +
 167.301 +  {2,0,30,  &_residue_44p_lo,
 167.302 +   &_huff_book__44pn1_long,&_huff_book__44pn1_long,
 167.303 +   &_resbook_44p_n1,&_resbook_44p_n1},
 167.304 +
 167.305 +  {1,2,6,  &_residue_44p_lfe,
 167.306 +   &_huff_book__44pn1_lfe,&_huff_book__44pn1_lfe,
 167.307 +   &_resbook_44p_ln1,&_resbook_44p_ln1}
 167.308 +};
 167.309 +static const vorbis_residue_template _res_44p51_0[]={
 167.310 +  {2,0,15,  &_residue_44p_lo,
 167.311 +   &_huff_book__44p0_short,&_huff_book__44p0_short,
 167.312 +   &_resbook_44p_0,&_resbook_44p_0},
 167.313 +
 167.314 +  {2,0,30,  &_residue_44p_lo,
 167.315 +   &_huff_book__44p0_long,&_huff_book__44p0_long,
 167.316 +   &_resbook_44p_0,&_resbook_44p_0},
 167.317 +
 167.318 +  {1,2,6,  &_residue_44p_lfe,
 167.319 +   &_huff_book__44p0_lfe,&_huff_book__44p0_lfe,
 167.320 +   &_resbook_44p_l0,&_resbook_44p_l0}
 167.321 +};
 167.322 +static const vorbis_residue_template _res_44p51_1[]={
 167.323 +  {2,0,15,  &_residue_44p_lo,
 167.324 +   &_huff_book__44p1_short,&_huff_book__44p1_short,
 167.325 +   &_resbook_44p_1,&_resbook_44p_1},
 167.326 +
 167.327 +  {2,0,30,  &_residue_44p_lo,
 167.328 +   &_huff_book__44p1_long,&_huff_book__44p1_long,
 167.329 +   &_resbook_44p_1,&_resbook_44p_1},
 167.330 +
 167.331 +  {1,2,6,  &_residue_44p_lfe,
 167.332 +   &_huff_book__44p1_lfe,&_huff_book__44p1_lfe,
 167.333 +   &_resbook_44p_l1,&_resbook_44p_l1}
 167.334 +};
 167.335 +static const vorbis_residue_template _res_44p51_2[]={
 167.336 +  {2,0,15,  &_residue_44p,
 167.337 +   &_huff_book__44p2_short,&_huff_book__44p2_short,
 167.338 +   &_resbook_44p_2,&_resbook_44p_2},
 167.339 +
 167.340 +  {2,0,30,  &_residue_44p,
 167.341 +   &_huff_book__44p2_long,&_huff_book__44p2_long,
 167.342 +   &_resbook_44p_2,&_resbook_44p_2},
 167.343 +
 167.344 +  {1,2,6,  &_residue_44p_lfe,
 167.345 +   &_huff_book__44p2_lfe,&_huff_book__44p2_lfe,
 167.346 +   &_resbook_44p_l2,&_resbook_44p_l2}
 167.347 +};
 167.348 +static const vorbis_residue_template _res_44p51_3[]={
 167.349 +  {2,0,15,  &_residue_44p,
 167.350 +   &_huff_book__44p3_short,&_huff_book__44p3_short,
 167.351 +   &_resbook_44p_3,&_resbook_44p_3},
 167.352 +
 167.353 +  {2,0,30,  &_residue_44p,
 167.354 +   &_huff_book__44p3_long,&_huff_book__44p3_long,
 167.355 +   &_resbook_44p_3,&_resbook_44p_3},
 167.356 +
 167.357 +  {1,2,6,  &_residue_44p_lfe,
 167.358 +   &_huff_book__44p3_lfe,&_huff_book__44p3_lfe,
 167.359 +   &_resbook_44p_l3,&_resbook_44p_l3}
 167.360 +};
 167.361 +static const vorbis_residue_template _res_44p51_4[]={
 167.362 +  {2,0,15,  &_residue_44p,
 167.363 +   &_huff_book__44p4_short,&_huff_book__44p4_short,
 167.364 +   &_resbook_44p_4,&_resbook_44p_4},
 167.365 +
 167.366 +  {2,0,30,  &_residue_44p,
 167.367 +   &_huff_book__44p4_long,&_huff_book__44p4_long,
 167.368 +   &_resbook_44p_4,&_resbook_44p_4},
 167.369 +
 167.370 +  {1,2,6,  &_residue_44p_lfe,
 167.371 +   &_huff_book__44p4_lfe,&_huff_book__44p4_lfe,
 167.372 +   &_resbook_44p_l4,&_resbook_44p_l4}
 167.373 +};
 167.374 +static const vorbis_residue_template _res_44p51_5[]={
 167.375 +  {2,0,15,  &_residue_44p_hi,
 167.376 +   &_huff_book__44p5_short,&_huff_book__44p5_short,
 167.377 +   &_resbook_44p_5,&_resbook_44p_5},
 167.378 +
 167.379 +  {2,0,30,  &_residue_44p_hi,
 167.380 +   &_huff_book__44p5_long,&_huff_book__44p5_long,
 167.381 +   &_resbook_44p_5,&_resbook_44p_5},
 167.382 +
 167.383 +  {1,2,6,  &_residue_44p_lfe,
 167.384 +   &_huff_book__44p5_lfe,&_huff_book__44p5_lfe,
 167.385 +   &_resbook_44p_l5,&_resbook_44p_l5}
 167.386 +};
 167.387 +static const vorbis_residue_template _res_44p51_6[]={
 167.388 +  {2,0,15,  &_residue_44p_hi,
 167.389 +   &_huff_book__44p6_short,&_huff_book__44p6_short,
 167.390 +   &_resbook_44p_6,&_resbook_44p_6},
 167.391 +
 167.392 +  {2,0,30,  &_residue_44p_hi,
 167.393 +   &_huff_book__44p6_long,&_huff_book__44p6_long,
 167.394 +   &_resbook_44p_6,&_resbook_44p_6},
 167.395 +
 167.396 +  {1,2,6,  &_residue_44p_lfe,
 167.397 +   &_huff_book__44p6_lfe,&_huff_book__44p6_lfe,
 167.398 +   &_resbook_44p_l6,&_resbook_44p_l6}
 167.399 +};
 167.400 +
 167.401 +
 167.402 +static const vorbis_residue_template _res_44p51_7[]={
 167.403 +  {2,0,15,  &_residue_44p_hi,
 167.404 +   &_huff_book__44p7_short,&_huff_book__44p7_short,
 167.405 +   &_resbook_44p_7,&_resbook_44p_7},
 167.406 +
 167.407 +  {2,0,30,  &_residue_44p_hi,
 167.408 +   &_huff_book__44p7_long,&_huff_book__44p7_long,
 167.409 +   &_resbook_44p_7,&_resbook_44p_7},
 167.410 +
 167.411 +  {1,2,6,  &_residue_44p_lfe,
 167.412 +   &_huff_book__44p6_lfe,&_huff_book__44p6_lfe,
 167.413 +   &_resbook_44p_l6,&_resbook_44p_l6}
 167.414 +};
 167.415 +static const vorbis_residue_template _res_44p51_8[]={
 167.416 +  {2,0,15,  &_residue_44p_hi,
 167.417 +   &_huff_book__44p8_short,&_huff_book__44p8_short,
 167.418 +   &_resbook_44p_8,&_resbook_44p_8},
 167.419 +
 167.420 +  {2,0,30,  &_residue_44p_hi,
 167.421 +   &_huff_book__44p8_long,&_huff_book__44p8_long,
 167.422 +   &_resbook_44p_8,&_resbook_44p_8},
 167.423 +
 167.424 +  {1,2,6,  &_residue_44p_lfe,
 167.425 +   &_huff_book__44p6_lfe,&_huff_book__44p6_lfe,
 167.426 +   &_resbook_44p_l6,&_resbook_44p_l6}
 167.427 +};
 167.428 +static const vorbis_residue_template _res_44p51_9[]={
 167.429 +  {2,0,15,  &_residue_44p_hi,
 167.430 +   &_huff_book__44p9_short,&_huff_book__44p9_short,
 167.431 +   &_resbook_44p_9,&_resbook_44p_9},
 167.432 +
 167.433 +  {2,0,30,  &_residue_44p_hi,
 167.434 +   &_huff_book__44p9_long,&_huff_book__44p9_long,
 167.435 +   &_resbook_44p_9,&_resbook_44p_9},
 167.436 +
 167.437 +  {1,2,6,  &_residue_44p_lfe,
 167.438 +   &_huff_book__44p6_lfe,&_huff_book__44p6_lfe,
 167.439 +   &_resbook_44p_l6,&_resbook_44p_l6}
 167.440 +};
 167.441 +
 167.442 +static const vorbis_mapping_template _mapres_template_44_51[]={
 167.443 +  { _map_nominal_51, _res_44p51_n1 }, /* -1 */
 167.444 +  { _map_nominal_51, _res_44p51_0 }, /* 0 */
 167.445 +  { _map_nominal_51, _res_44p51_1 }, /* 1 */
 167.446 +  { _map_nominal_51, _res_44p51_2 }, /* 2 */
 167.447 +  { _map_nominal_51, _res_44p51_3 }, /* 3 */
 167.448 +  { _map_nominal_51, _res_44p51_4 }, /* 4 */
 167.449 +  { _map_nominal_51u, _res_44p51_5 }, /* 5 */
 167.450 +  { _map_nominal_51u, _res_44p51_6 }, /* 6 */
 167.451 +  { _map_nominal_51u, _res_44p51_7 }, /* 7 */
 167.452 +  { _map_nominal_51u, _res_44p51_8 }, /* 8 */
 167.453 +  { _map_nominal_51u, _res_44p51_9 }, /* 9 */
 167.454 +};
   168.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   168.2 +++ b/libs/vorbis/modes/residue_44u.h	Sun Nov 01 00:36:56 2015 +0200
   168.3 @@ -0,0 +1,318 @@
   168.4 +/********************************************************************
   168.5 + *                                                                  *
   168.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   168.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   168.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   168.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  168.10 + *                                                                  *
  168.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007             *
  168.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  168.13 + *                                                                  *
  168.14 + ********************************************************************
  168.15 +
  168.16 + function: toplevel residue templates for 32/44.1/48kHz uncoupled
  168.17 + last mod: $Id: residue_44u.h 16962 2010-03-11 07:30:34Z xiphmont $
  168.18 +
  168.19 + ********************************************************************/
  168.20 +
  168.21 +#include "vorbis/codec.h"
  168.22 +#include "backends.h"
  168.23 +#include "books/uncoupled/res_books_uncoupled.h"
  168.24 +
  168.25 +/***** residue backends *********************************************/
  168.26 +
  168.27 +
  168.28 +static const vorbis_info_residue0 _residue_44_low_un={
  168.29 +  0,-1, -1, 8,-1,-1,
  168.30 +  {0},
  168.31 +  {-1},
  168.32 +  {  0,  1,  1,  2,  2,  4, 28},
  168.33 +  { -1, 25, -1, 45, -1, -1, -1}
  168.34 +};
  168.35 +
  168.36 +static const vorbis_info_residue0 _residue_44_mid_un={
  168.37 +  0,-1, -1, 10,-1,-1,
  168.38 +  /* 0   1   2   3   4   5   6   7   8   9 */
  168.39 +  {0},
  168.40 +  {-1},
  168.41 +  {  0,  1,  1,  2,  2,  4,  4, 16, 60},
  168.42 +  { -1, 30, -1, 50, -1, 80, -1, -1, -1}
  168.43 +};
  168.44 +
  168.45 +static const vorbis_info_residue0 _residue_44_hi_un={
  168.46 +  0,-1, -1, 10,-1,-1,
  168.47 +  /* 0   1   2   3   4   5   6   7   8   9 */
  168.48 +  {0},
  168.49 +  {-1},
  168.50 +  {  0,  1,  2,  4,  8, 16, 32, 71,157},
  168.51 +  { -1, -1, -1, -1, -1, -1, -1, -1, -1}
  168.52 +};
  168.53 +
  168.54 +/* mapping conventions:
  168.55 +   only one submap (this would change for efficient 5.1 support for example)*/
  168.56 +/* Four psychoacoustic profiles are used, one for each blocktype */
  168.57 +static const vorbis_info_mapping0 _map_nominal_u[2]={
  168.58 +  {1, {0,0,0,0,0,0}, {0}, {0}, 0,{0},{0}},
  168.59 +  {1, {0,0,0,0,0,0}, {1}, {1}, 0,{0},{0}}
  168.60 +};
  168.61 +
  168.62 +static const static_bookblock _resbook_44u_n1={
  168.63 +  {
  168.64 +    {0},
  168.65 +    {0,0,&_44un1__p1_0},
  168.66 +    {0,0,&_44un1__p2_0},
  168.67 +    {0,0,&_44un1__p3_0},
  168.68 +    {0,0,&_44un1__p4_0},
  168.69 +    {0,0,&_44un1__p5_0},
  168.70 +    {&_44un1__p6_0,&_44un1__p6_1},
  168.71 +    {&_44un1__p7_0,&_44un1__p7_1,&_44un1__p7_2}
  168.72 +   }
  168.73 +};
  168.74 +static const static_bookblock _resbook_44u_0={
  168.75 +  {
  168.76 +    {0},
  168.77 +    {0,0,&_44u0__p1_0},
  168.78 +    {0,0,&_44u0__p2_0},
  168.79 +    {0,0,&_44u0__p3_0},
  168.80 +    {0,0,&_44u0__p4_0},
  168.81 +    {0,0,&_44u0__p5_0},
  168.82 +    {&_44u0__p6_0,&_44u0__p6_1},
  168.83 +    {&_44u0__p7_0,&_44u0__p7_1,&_44u0__p7_2}
  168.84 +   }
  168.85 +};
  168.86 +static const static_bookblock _resbook_44u_1={
  168.87 +  {
  168.88 +    {0},
  168.89 +    {0,0,&_44u1__p1_0},
  168.90 +    {0,0,&_44u1__p2_0},
  168.91 +    {0,0,&_44u1__p3_0},
  168.92 +    {0,0,&_44u1__p4_0},
  168.93 +    {0,0,&_44u1__p5_0},
  168.94 +    {&_44u1__p6_0,&_44u1__p6_1},
  168.95 +    {&_44u1__p7_0,&_44u1__p7_1,&_44u1__p7_2}
  168.96 +   }
  168.97 +};
  168.98 +static const static_bookblock _resbook_44u_2={
  168.99 +  {
 168.100 +    {0},
 168.101 +    {0,0,&_44u2__p1_0},
 168.102 +    {0,0,&_44u2__p2_0},
 168.103 +    {0,0,&_44u2__p3_0},
 168.104 +    {0,0,&_44u2__p4_0},
 168.105 +    {0,0,&_44u2__p5_0},
 168.106 +    {&_44u2__p6_0,&_44u2__p6_1},
 168.107 +    {&_44u2__p7_0,&_44u2__p7_1,&_44u2__p7_2}
 168.108 +   }
 168.109 +};
 168.110 +static const static_bookblock _resbook_44u_3={
 168.111 +  {
 168.112 +    {0},
 168.113 +    {0,0,&_44u3__p1_0},
 168.114 +    {0,0,&_44u3__p2_0},
 168.115 +    {0,0,&_44u3__p3_0},
 168.116 +    {0,0,&_44u3__p4_0},
 168.117 +    {0,0,&_44u3__p5_0},
 168.118 +    {&_44u3__p6_0,&_44u3__p6_1},
 168.119 +    {&_44u3__p7_0,&_44u3__p7_1,&_44u3__p7_2}
 168.120 +   }
 168.121 +};
 168.122 +static const static_bookblock _resbook_44u_4={
 168.123 +  {
 168.124 +    {0},
 168.125 +    {0,0,&_44u4__p1_0},
 168.126 +    {0,0,&_44u4__p2_0},
 168.127 +    {0,0,&_44u4__p3_0},
 168.128 +    {0,0,&_44u4__p4_0},
 168.129 +    {0,0,&_44u4__p5_0},
 168.130 +    {&_44u4__p6_0,&_44u4__p6_1},
 168.131 +    {&_44u4__p7_0,&_44u4__p7_1,&_44u4__p7_2}
 168.132 +   }
 168.133 +};
 168.134 +static const static_bookblock _resbook_44u_5={
 168.135 +  {
 168.136 +    {0},
 168.137 +    {0,0,&_44u5__p1_0},
 168.138 +    {0,0,&_44u5__p2_0},
 168.139 +    {0,0,&_44u5__p3_0},
 168.140 +    {0,0,&_44u5__p4_0},
 168.141 +    {0,0,&_44u5__p5_0},
 168.142 +    {0,0,&_44u5__p6_0},
 168.143 +    {&_44u5__p7_0,&_44u5__p7_1},
 168.144 +    {&_44u5__p8_0,&_44u5__p8_1},
 168.145 +    {&_44u5__p9_0,&_44u5__p9_1,&_44u5__p9_2}
 168.146 +   }
 168.147 +};
 168.148 +static const static_bookblock _resbook_44u_6={
 168.149 +  {
 168.150 +    {0},
 168.151 +    {0,0,&_44u6__p1_0},
 168.152 +    {0,0,&_44u6__p2_0},
 168.153 +    {0,0,&_44u6__p3_0},
 168.154 +    {0,0,&_44u6__p4_0},
 168.155 +    {0,0,&_44u6__p5_0},
 168.156 +    {0,0,&_44u6__p6_0},
 168.157 +    {&_44u6__p7_0,&_44u6__p7_1},
 168.158 +    {&_44u6__p8_0,&_44u6__p8_1},
 168.159 +    {&_44u6__p9_0,&_44u6__p9_1,&_44u6__p9_2}
 168.160 +   }
 168.161 +};
 168.162 +static const static_bookblock _resbook_44u_7={
 168.163 +  {
 168.164 +    {0},
 168.165 +    {0,0,&_44u7__p1_0},
 168.166 +    {0,0,&_44u7__p2_0},
 168.167 +    {0,0,&_44u7__p3_0},
 168.168 +    {0,0,&_44u7__p4_0},
 168.169 +    {0,0,&_44u7__p5_0},
 168.170 +    {0,0,&_44u7__p6_0},
 168.171 +    {&_44u7__p7_0,&_44u7__p7_1},
 168.172 +    {&_44u7__p8_0,&_44u7__p8_1},
 168.173 +    {&_44u7__p9_0,&_44u7__p9_1,&_44u7__p9_2}
 168.174 +   }
 168.175 +};
 168.176 +static const static_bookblock _resbook_44u_8={
 168.177 +  {
 168.178 +    {0},
 168.179 +    {0,0,&_44u8_p1_0},
 168.180 +    {0,0,&_44u8_p2_0},
 168.181 +    {0,0,&_44u8_p3_0},
 168.182 +    {0,0,&_44u8_p4_0},
 168.183 +    {&_44u8_p5_0,&_44u8_p5_1},
 168.184 +    {&_44u8_p6_0,&_44u8_p6_1},
 168.185 +    {&_44u8_p7_0,&_44u8_p7_1},
 168.186 +    {&_44u8_p8_0,&_44u8_p8_1},
 168.187 +    {&_44u8_p9_0,&_44u8_p9_1,&_44u8_p9_2}
 168.188 +   }
 168.189 +};
 168.190 +static const static_bookblock _resbook_44u_9={
 168.191 +  {
 168.192 +    {0},
 168.193 +    {0,0,&_44u9_p1_0},
 168.194 +    {0,0,&_44u9_p2_0},
 168.195 +    {0,0,&_44u9_p3_0},
 168.196 +    {0,0,&_44u9_p4_0},
 168.197 +    {&_44u9_p5_0,&_44u9_p5_1},
 168.198 +    {&_44u9_p6_0,&_44u9_p6_1},
 168.199 +    {&_44u9_p7_0,&_44u9_p7_1},
 168.200 +    {&_44u9_p8_0,&_44u9_p8_1},
 168.201 +    {&_44u9_p9_0,&_44u9_p9_1,&_44u9_p9_2}
 168.202 +   }
 168.203 +};
 168.204 +
 168.205 +static const vorbis_residue_template _res_44u_n1[]={
 168.206 +  {1,0,32,  &_residue_44_low_un,
 168.207 +   &_huff_book__44un1__short,&_huff_book__44un1__short,
 168.208 +   &_resbook_44u_n1,&_resbook_44u_n1},
 168.209 +
 168.210 +  {1,0,32,  &_residue_44_low_un,
 168.211 +   &_huff_book__44un1__long,&_huff_book__44un1__long,
 168.212 +   &_resbook_44u_n1,&_resbook_44u_n1}
 168.213 +};
 168.214 +static const vorbis_residue_template _res_44u_0[]={
 168.215 +  {1,0,16,  &_residue_44_low_un,
 168.216 +   &_huff_book__44u0__short,&_huff_book__44u0__short,
 168.217 +   &_resbook_44u_0,&_resbook_44u_0},
 168.218 +
 168.219 +  {1,0,32,  &_residue_44_low_un,
 168.220 +   &_huff_book__44u0__long,&_huff_book__44u0__long,
 168.221 +   &_resbook_44u_0,&_resbook_44u_0}
 168.222 +};
 168.223 +static const vorbis_residue_template _res_44u_1[]={
 168.224 +  {1,0,16,  &_residue_44_low_un,
 168.225 +   &_huff_book__44u1__short,&_huff_book__44u1__short,
 168.226 +   &_resbook_44u_1,&_resbook_44u_1},
 168.227 +
 168.228 +  {1,0,32,  &_residue_44_low_un,
 168.229 +   &_huff_book__44u1__long,&_huff_book__44u1__long,
 168.230 +   &_resbook_44u_1,&_resbook_44u_1}
 168.231 +};
 168.232 +static const vorbis_residue_template _res_44u_2[]={
 168.233 +  {1,0,16,  &_residue_44_low_un,
 168.234 +   &_huff_book__44u2__short,&_huff_book__44u2__short,
 168.235 +   &_resbook_44u_2,&_resbook_44u_2},
 168.236 +
 168.237 +  {1,0,32,  &_residue_44_low_un,
 168.238 +   &_huff_book__44u2__long,&_huff_book__44u2__long,
 168.239 +   &_resbook_44u_2,&_resbook_44u_2}
 168.240 +};
 168.241 +static const vorbis_residue_template _res_44u_3[]={
 168.242 +  {1,0,16,  &_residue_44_low_un,
 168.243 +   &_huff_book__44u3__short,&_huff_book__44u3__short,
 168.244 +   &_resbook_44u_3,&_resbook_44u_3},
 168.245 +
 168.246 +  {1,0,32,  &_residue_44_low_un,
 168.247 +   &_huff_book__44u3__long,&_huff_book__44u3__long,
 168.248 +   &_resbook_44u_3,&_resbook_44u_3}
 168.249 +};
 168.250 +static const vorbis_residue_template _res_44u_4[]={
 168.251 +  {1,0,16,  &_residue_44_low_un,
 168.252 +   &_huff_book__44u4__short,&_huff_book__44u4__short,
 168.253 +   &_resbook_44u_4,&_resbook_44u_4},
 168.254 +
 168.255 +  {1,0,32,  &_residue_44_low_un,
 168.256 +   &_huff_book__44u4__long,&_huff_book__44u4__long,
 168.257 +   &_resbook_44u_4,&_resbook_44u_4}
 168.258 +};
 168.259 +
 168.260 +static const vorbis_residue_template _res_44u_5[]={
 168.261 +  {1,0,16,  &_residue_44_mid_un,
 168.262 +   &_huff_book__44u5__short,&_huff_book__44u5__short,
 168.263 +   &_resbook_44u_5,&_resbook_44u_5},
 168.264 +
 168.265 +  {1,0,32,  &_residue_44_mid_un,
 168.266 +   &_huff_book__44u5__long,&_huff_book__44u5__long,
 168.267 +   &_resbook_44u_5,&_resbook_44u_5}
 168.268 +};
 168.269 +
 168.270 +static const vorbis_residue_template _res_44u_6[]={
 168.271 +  {1,0,16,  &_residue_44_mid_un,
 168.272 +   &_huff_book__44u6__short,&_huff_book__44u6__short,
 168.273 +   &_resbook_44u_6,&_resbook_44u_6},
 168.274 +
 168.275 +  {1,0,32,  &_residue_44_mid_un,
 168.276 +   &_huff_book__44u6__long,&_huff_book__44u6__long,
 168.277 +   &_resbook_44u_6,&_resbook_44u_6}
 168.278 +};
 168.279 +
 168.280 +static const vorbis_residue_template _res_44u_7[]={
 168.281 +  {1,0,16,  &_residue_44_mid_un,
 168.282 +   &_huff_book__44u7__short,&_huff_book__44u7__short,
 168.283 +   &_resbook_44u_7,&_resbook_44u_7},
 168.284 +
 168.285 +  {1,0,32,  &_residue_44_mid_un,
 168.286 +   &_huff_book__44u7__long,&_huff_book__44u7__long,
 168.287 +   &_resbook_44u_7,&_resbook_44u_7}
 168.288 +};
 168.289 +
 168.290 +static const vorbis_residue_template _res_44u_8[]={
 168.291 +  {1,0,16,  &_residue_44_hi_un,
 168.292 +   &_huff_book__44u8__short,&_huff_book__44u8__short,
 168.293 +   &_resbook_44u_8,&_resbook_44u_8},
 168.294 +
 168.295 +  {1,0,32,  &_residue_44_hi_un,
 168.296 +   &_huff_book__44u8__long,&_huff_book__44u8__long,
 168.297 +   &_resbook_44u_8,&_resbook_44u_8}
 168.298 +};
 168.299 +static const vorbis_residue_template _res_44u_9[]={
 168.300 +  {1,0,16,  &_residue_44_hi_un,
 168.301 +   &_huff_book__44u9__short,&_huff_book__44u9__short,
 168.302 +   &_resbook_44u_9,&_resbook_44u_9},
 168.303 +
 168.304 +  {1,0,32,  &_residue_44_hi_un,
 168.305 +   &_huff_book__44u9__long,&_huff_book__44u9__long,
 168.306 +   &_resbook_44u_9,&_resbook_44u_9}
 168.307 +};
 168.308 +
 168.309 +static const vorbis_mapping_template _mapres_template_44_uncoupled[]={
 168.310 +  { _map_nominal_u, _res_44u_n1 }, /* -1 */
 168.311 +  { _map_nominal_u, _res_44u_0 }, /* 0 */
 168.312 +  { _map_nominal_u, _res_44u_1 }, /* 1 */
 168.313 +  { _map_nominal_u, _res_44u_2 }, /* 2 */
 168.314 +  { _map_nominal_u, _res_44u_3 }, /* 3 */
 168.315 +  { _map_nominal_u, _res_44u_4 }, /* 4 */
 168.316 +  { _map_nominal_u, _res_44u_5 }, /* 5 */
 168.317 +  { _map_nominal_u, _res_44u_6 }, /* 6 */
 168.318 +  { _map_nominal_u, _res_44u_7 }, /* 7 */
 168.319 +  { _map_nominal_u, _res_44u_8 }, /* 8 */
 168.320 +  { _map_nominal_u, _res_44u_9 }, /* 9 */
 168.321 +};
   169.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   169.2 +++ b/libs/vorbis/modes/residue_8.h	Sun Nov 01 00:36:56 2015 +0200
   169.3 @@ -0,0 +1,109 @@
   169.4 +/********************************************************************
   169.5 + *                                                                  *
   169.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   169.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   169.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   169.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  169.10 + *                                                                  *
  169.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007             *
  169.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  169.13 + *                                                                  *
  169.14 + ********************************************************************
  169.15 +
  169.16 + function: toplevel residue templates 8/11kHz
  169.17 + last mod: $Id: residue_8.h 16962 2010-03-11 07:30:34Z xiphmont $
  169.18 +
  169.19 + ********************************************************************/
  169.20 +
  169.21 +#include "vorbis/codec.h"
  169.22 +#include "backends.h"
  169.23 +
  169.24 +/***** residue backends *********************************************/
  169.25 +
  169.26 +static const static_bookblock _resbook_8s_0={
  169.27 +  {
  169.28 +    {0},
  169.29 +    {0,0,&_8c0_s_p1_0},
  169.30 +    {0},
  169.31 +    {0,0,&_8c0_s_p3_0},
  169.32 +    {0,0,&_8c0_s_p4_0},
  169.33 +    {0,0,&_8c0_s_p5_0},
  169.34 +    {0,0,&_8c0_s_p6_0},
  169.35 +    {&_8c0_s_p7_0,&_8c0_s_p7_1},
  169.36 +    {&_8c0_s_p8_0,&_8c0_s_p8_1},
  169.37 +    {&_8c0_s_p9_0,&_8c0_s_p9_1,&_8c0_s_p9_2}
  169.38 +   }
  169.39 +};
  169.40 +static const static_bookblock _resbook_8s_1={
  169.41 +  {
  169.42 +    {0},
  169.43 +    {0,0,&_8c1_s_p1_0},
  169.44 +    {0},
  169.45 +    {0,0,&_8c1_s_p3_0},
  169.46 +    {0,0,&_8c1_s_p4_0},
  169.47 +    {0,0,&_8c1_s_p5_0},
  169.48 +    {0,0,&_8c1_s_p6_0},
  169.49 +    {&_8c1_s_p7_0,&_8c1_s_p7_1},
  169.50 +    {&_8c1_s_p8_0,&_8c1_s_p8_1},
  169.51 +    {&_8c1_s_p9_0,&_8c1_s_p9_1,&_8c1_s_p9_2}
  169.52 +   }
  169.53 +};
  169.54 +
  169.55 +static const vorbis_residue_template _res_8s_0[]={
  169.56 +  {2,0,32,  &_residue_44_mid,
  169.57 +   &_huff_book__8c0_s_single,&_huff_book__8c0_s_single,
  169.58 +   &_resbook_8s_0,&_resbook_8s_0},
  169.59 +};
  169.60 +static const vorbis_residue_template _res_8s_1[]={
  169.61 +  {2,0,32,  &_residue_44_mid,
  169.62 +   &_huff_book__8c1_s_single,&_huff_book__8c1_s_single,
  169.63 +   &_resbook_8s_1,&_resbook_8s_1},
  169.64 +};
  169.65 +
  169.66 +static const vorbis_mapping_template _mapres_template_8_stereo[2]={
  169.67 +  { _map_nominal, _res_8s_0 }, /* 0 */
  169.68 +  { _map_nominal, _res_8s_1 }, /* 1 */
  169.69 +};
  169.70 +
  169.71 +static const static_bookblock _resbook_8u_0={
  169.72 +  {
  169.73 +    {0},
  169.74 +    {0,0,&_8u0__p1_0},
  169.75 +    {0,0,&_8u0__p2_0},
  169.76 +    {0,0,&_8u0__p3_0},
  169.77 +    {0,0,&_8u0__p4_0},
  169.78 +    {0,0,&_8u0__p5_0},
  169.79 +    {&_8u0__p6_0,&_8u0__p6_1},
  169.80 +    {&_8u0__p7_0,&_8u0__p7_1,&_8u0__p7_2}
  169.81 +   }
  169.82 +};
  169.83 +static const static_bookblock _resbook_8u_1={
  169.84 +  {
  169.85 +    {0},
  169.86 +    {0,0,&_8u1__p1_0},
  169.87 +    {0,0,&_8u1__p2_0},
  169.88 +    {0,0,&_8u1__p3_0},
  169.89 +    {0,0,&_8u1__p4_0},
  169.90 +    {0,0,&_8u1__p5_0},
  169.91 +    {0,0,&_8u1__p6_0},
  169.92 +    {&_8u1__p7_0,&_8u1__p7_1},
  169.93 +    {&_8u1__p8_0,&_8u1__p8_1},
  169.94 +    {&_8u1__p9_0,&_8u1__p9_1,&_8u1__p9_2}
  169.95 +   }
  169.96 +};
  169.97 +
  169.98 +static const vorbis_residue_template _res_8u_0[]={
  169.99 +  {1,0,32,  &_residue_44_low_un,
 169.100 +   &_huff_book__8u0__single,&_huff_book__8u0__single,
 169.101 +   &_resbook_8u_0,&_resbook_8u_0},
 169.102 +};
 169.103 +static const vorbis_residue_template _res_8u_1[]={
 169.104 +  {1,0,32,  &_residue_44_mid_un,
 169.105 +   &_huff_book__8u1__single,&_huff_book__8u1__single,
 169.106 +   &_resbook_8u_1,&_resbook_8u_1},
 169.107 +};
 169.108 +
 169.109 +static const vorbis_mapping_template _mapres_template_8_uncoupled[2]={
 169.110 +  { _map_nominal_u, _res_8u_0 }, /* 0 */
 169.111 +  { _map_nominal_u, _res_8u_1 }, /* 1 */
 169.112 +};
   170.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   170.2 +++ b/libs/vorbis/modes/setup_11.h	Sun Nov 01 00:36:56 2015 +0200
   170.3 @@ -0,0 +1,143 @@
   170.4 +/********************************************************************
   170.5 + *                                                                  *
   170.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   170.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   170.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   170.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  170.10 + *                                                                  *
  170.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
  170.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  170.13 + *                                                                  *
  170.14 + ********************************************************************
  170.15 +
  170.16 + function: 11kHz settings
  170.17 + last mod: $Id: setup_11.h 16894 2010-02-12 20:32:12Z xiphmont $
  170.18 +
  170.19 + ********************************************************************/
  170.20 +
  170.21 +#include "psych_11.h"
  170.22 +
  170.23 +static const int blocksize_11[2]={
  170.24 +  512,512
  170.25 +};
  170.26 +
  170.27 +static const int _floor_mapping_11a[]={
  170.28 +  6,6
  170.29 +};
  170.30 +static const int *_floor_mapping_11[]={
  170.31 +  _floor_mapping_11a
  170.32 +};
  170.33 +
  170.34 +static const double rate_mapping_11[3]={
  170.35 +  8000.,13000.,44000.,
  170.36 +};
  170.37 +
  170.38 +static const double rate_mapping_11_uncoupled[3]={
  170.39 +  12000.,20000.,50000.,
  170.40 +};
  170.41 +
  170.42 +static const double quality_mapping_11[3]={
  170.43 +  -.1,.0,1.
  170.44 +};
  170.45 +
  170.46 +static const ve_setup_data_template ve_setup_11_stereo={
  170.47 +  2,
  170.48 +  rate_mapping_11,
  170.49 +  quality_mapping_11,
  170.50 +  2,
  170.51 +  9000,
  170.52 +  15000,
  170.53 +
  170.54 +  blocksize_11,
  170.55 +  blocksize_11,
  170.56 +
  170.57 +  _psy_tone_masteratt_11,
  170.58 +  _psy_tone_0dB,
  170.59 +  _psy_tone_suppress,
  170.60 +
  170.61 +  _vp_tonemask_adj_11,
  170.62 +  NULL,
  170.63 +  _vp_tonemask_adj_11,
  170.64 +
  170.65 +  _psy_noiseguards_8,
  170.66 +  _psy_noisebias_11,
  170.67 +  _psy_noisebias_11,
  170.68 +  NULL,
  170.69 +  NULL,
  170.70 +  _psy_noise_suppress,
  170.71 +
  170.72 +  _psy_compand_8,
  170.73 +  _psy_compand_8_mapping,
  170.74 +  NULL,
  170.75 +
  170.76 +  {_noise_start_8,_noise_start_8},
  170.77 +  {_noise_part_8,_noise_part_8},
  170.78 +  _noise_thresh_11,
  170.79 +
  170.80 +  _psy_ath_floater_8,
  170.81 +  _psy_ath_abs_8,
  170.82 +
  170.83 +  _psy_lowpass_11,
  170.84 +
  170.85 +  _psy_global_44,
  170.86 +  _global_mapping_8,
  170.87 +  _psy_stereo_modes_8,
  170.88 +
  170.89 +  _floor_books,
  170.90 +  _floor,
  170.91 +  1,
  170.92 +  _floor_mapping_11,
  170.93 +
  170.94 +  _mapres_template_8_stereo
  170.95 +};
  170.96 +
  170.97 +static const ve_setup_data_template ve_setup_11_uncoupled={
  170.98 +  2,
  170.99 +  rate_mapping_11_uncoupled,
 170.100 +  quality_mapping_11,
 170.101 +  -1,
 170.102 +  9000,
 170.103 +  15000,
 170.104 +
 170.105 +  blocksize_11,
 170.106 +  blocksize_11,
 170.107 +
 170.108 +  _psy_tone_masteratt_11,
 170.109 +  _psy_tone_0dB,
 170.110 +  _psy_tone_suppress,
 170.111 +
 170.112 +  _vp_tonemask_adj_11,
 170.113 +  NULL,
 170.114 +  _vp_tonemask_adj_11,
 170.115 +
 170.116 +  _psy_noiseguards_8,
 170.117 +  _psy_noisebias_11,
 170.118 +  _psy_noisebias_11,
 170.119 +  NULL,
 170.120 +  NULL,
 170.121 +  _psy_noise_suppress,
 170.122 +
 170.123 +  _psy_compand_8,
 170.124 +  _psy_compand_8_mapping,
 170.125 +  NULL,
 170.126 +
 170.127 +  {_noise_start_8,_noise_start_8},
 170.128 +  {_noise_part_8,_noise_part_8},
 170.129 +  _noise_thresh_11,
 170.130 +
 170.131 +  _psy_ath_floater_8,
 170.132 +  _psy_ath_abs_8,
 170.133 +
 170.134 +  _psy_lowpass_11,
 170.135 +
 170.136 +  _psy_global_44,
 170.137 +  _global_mapping_8,
 170.138 +  _psy_stereo_modes_8,
 170.139 +
 170.140 +  _floor_books,
 170.141 +  _floor,
 170.142 +  1,
 170.143 +  _floor_mapping_11,
 170.144 +
 170.145 +  _mapres_template_8_uncoupled
 170.146 +};
   171.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   171.2 +++ b/libs/vorbis/modes/setup_16.h	Sun Nov 01 00:36:56 2015 +0200
   171.3 @@ -0,0 +1,153 @@
   171.4 +/********************************************************************
   171.5 + *                                                                  *
   171.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   171.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   171.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   171.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  171.10 + *                                                                  *
  171.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
  171.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  171.13 + *                                                                  *
  171.14 + ********************************************************************
  171.15 +
  171.16 + function: 16kHz settings
  171.17 + last mod: $Id: setup_16.h 16894 2010-02-12 20:32:12Z xiphmont $
  171.18 +
  171.19 + ********************************************************************/
  171.20 +
  171.21 +#include "psych_16.h"
  171.22 +#include "residue_16.h"
  171.23 +
  171.24 +static const int blocksize_16_short[3]={
  171.25 +  1024,512,512
  171.26 +};
  171.27 +static const int blocksize_16_long[3]={
  171.28 +  1024,1024,1024
  171.29 +};
  171.30 +
  171.31 +static const int _floor_mapping_16a[]={
  171.32 +  9,3,3
  171.33 +};
  171.34 +static const int _floor_mapping_16b[]={
  171.35 +  9,9,9
  171.36 +};
  171.37 +static const int *_floor_mapping_16[]={
  171.38 +  _floor_mapping_16a,
  171.39 +  _floor_mapping_16b
  171.40 +};
  171.41 +
  171.42 +static const double rate_mapping_16[4]={
  171.43 +  12000.,20000.,44000.,86000.
  171.44 +};
  171.45 +
  171.46 +static const double rate_mapping_16_uncoupled[4]={
  171.47 +  16000.,28000.,64000.,100000.
  171.48 +};
  171.49 +
  171.50 +static const double _global_mapping_16[4]={ 1., 2., 3., 4. };
  171.51 +
  171.52 +static const double quality_mapping_16[4]={ -.1,.05,.5,1. };
  171.53 +
  171.54 +static const double _psy_compand_16_mapping[4]={ 0., .8, 1., 1.};
  171.55 +
  171.56 +static const ve_setup_data_template ve_setup_16_stereo={
  171.57 +  3,
  171.58 +  rate_mapping_16,
  171.59 +  quality_mapping_16,
  171.60 +  2,
  171.61 +  15000,
  171.62 +  19000,
  171.63 +
  171.64 +  blocksize_16_short,
  171.65 +  blocksize_16_long,
  171.66 +
  171.67 +  _psy_tone_masteratt_16,
  171.68 +  _psy_tone_0dB,
  171.69 +  _psy_tone_suppress,
  171.70 +
  171.71 +  _vp_tonemask_adj_16,
  171.72 +  _vp_tonemask_adj_16,
  171.73 +  _vp_tonemask_adj_16,
  171.74 +
  171.75 +  _psy_noiseguards_16,
  171.76 +  _psy_noisebias_16_impulse,
  171.77 +  _psy_noisebias_16_short,
  171.78 +  _psy_noisebias_16_short,
  171.79 +  _psy_noisebias_16,
  171.80 +  _psy_noise_suppress,
  171.81 +
  171.82 +  _psy_compand_8,
  171.83 +  _psy_compand_16_mapping,
  171.84 +  _psy_compand_16_mapping,
  171.85 +
  171.86 +  {_noise_start_16,_noise_start_16},
  171.87 +  { _noise_part_16, _noise_part_16},
  171.88 +  _noise_thresh_16,
  171.89 +
  171.90 +  _psy_ath_floater_16,
  171.91 +  _psy_ath_abs_16,
  171.92 +
  171.93 +  _psy_lowpass_16,
  171.94 +
  171.95 +  _psy_global_44,
  171.96 +  _global_mapping_16,
  171.97 +  _psy_stereo_modes_16,
  171.98 +
  171.99 +  _floor_books,
 171.100 +  _floor,
 171.101 +  2,
 171.102 +  _floor_mapping_16,
 171.103 +
 171.104 +  _mapres_template_16_stereo
 171.105 +};
 171.106 +
 171.107 +static const ve_setup_data_template ve_setup_16_uncoupled={
 171.108 +  3,
 171.109 +  rate_mapping_16_uncoupled,
 171.110 +  quality_mapping_16,
 171.111 +  -1,
 171.112 +  15000,
 171.113 +  19000,
 171.114 +
 171.115 +  blocksize_16_short,
 171.116 +  blocksize_16_long,
 171.117 +
 171.118 +  _psy_tone_masteratt_16,
 171.119 +  _psy_tone_0dB,
 171.120 +  _psy_tone_suppress,
 171.121 +
 171.122 +  _vp_tonemask_adj_16,
 171.123 +  _vp_tonemask_adj_16,
 171.124 +  _vp_tonemask_adj_16,
 171.125 +
 171.126 +  _psy_noiseguards_16,
 171.127 +  _psy_noisebias_16_impulse,
 171.128 +  _psy_noisebias_16_short,
 171.129 +  _psy_noisebias_16_short,
 171.130 +  _psy_noisebias_16,
 171.131 +  _psy_noise_suppress,
 171.132 +
 171.133 +  _psy_compand_8,
 171.134 +  _psy_compand_16_mapping,
 171.135 +  _psy_compand_16_mapping,
 171.136 +
 171.137 +  {_noise_start_16,_noise_start_16},
 171.138 +  { _noise_part_16, _noise_part_16},
 171.139 +  _noise_thresh_16,
 171.140 +
 171.141 +  _psy_ath_floater_16,
 171.142 +  _psy_ath_abs_16,
 171.143 +
 171.144 +  _psy_lowpass_16,
 171.145 +
 171.146 +  _psy_global_44,
 171.147 +  _global_mapping_16,
 171.148 +  _psy_stereo_modes_16,
 171.149 +
 171.150 +  _floor_books,
 171.151 +  _floor,
 171.152 +  2,
 171.153 +  _floor_mapping_16,
 171.154 +
 171.155 +  _mapres_template_16_uncoupled
 171.156 +};
   172.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   172.2 +++ b/libs/vorbis/modes/setup_22.h	Sun Nov 01 00:36:56 2015 +0200
   172.3 @@ -0,0 +1,128 @@
   172.4 +/********************************************************************
   172.5 + *                                                                  *
   172.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   172.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   172.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   172.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  172.10 + *                                                                  *
  172.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
  172.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  172.13 + *                                                                  *
  172.14 + ********************************************************************
  172.15 +
  172.16 + function: 22kHz settings
  172.17 + last mod: $Id: setup_22.h 17026 2010-03-25 05:00:27Z xiphmont $
  172.18 +
  172.19 + ********************************************************************/
  172.20 +
  172.21 +static const double rate_mapping_22[4]={
  172.22 +  15000.,20000.,44000.,86000.
  172.23 +};
  172.24 +
  172.25 +static const double rate_mapping_22_uncoupled[4]={
  172.26 +  16000.,28000.,50000.,90000.
  172.27 +};
  172.28 +
  172.29 +static const double _psy_lowpass_22[4]={9.5,11.,30.,99.};
  172.30 +
  172.31 +static const ve_setup_data_template ve_setup_22_stereo={
  172.32 +  3,
  172.33 +  rate_mapping_22,
  172.34 +  quality_mapping_16,
  172.35 +  2,
  172.36 +  19000,
  172.37 +  26000,
  172.38 +
  172.39 +  blocksize_16_short,
  172.40 +  blocksize_16_long,
  172.41 +
  172.42 +  _psy_tone_masteratt_16,
  172.43 +  _psy_tone_0dB,
  172.44 +  _psy_tone_suppress,
  172.45 +
  172.46 +  _vp_tonemask_adj_16,
  172.47 +  _vp_tonemask_adj_16,
  172.48 +  _vp_tonemask_adj_16,
  172.49 +
  172.50 +  _psy_noiseguards_16,
  172.51 +  _psy_noisebias_16_impulse,
  172.52 +  _psy_noisebias_16_short,
  172.53 +  _psy_noisebias_16_short,
  172.54 +  _psy_noisebias_16,
  172.55 +  _psy_noise_suppress,
  172.56 +
  172.57 +  _psy_compand_8,
  172.58 +  _psy_compand_16_mapping,
  172.59 +  _psy_compand_16_mapping,
  172.60 +
  172.61 +  {_noise_start_16,_noise_start_16},
  172.62 +  { _noise_part_16, _noise_part_16},
  172.63 +  _noise_thresh_16,
  172.64 +
  172.65 +  _psy_ath_floater_16,
  172.66 +  _psy_ath_abs_16,
  172.67 +
  172.68 +  _psy_lowpass_22,
  172.69 +
  172.70 +  _psy_global_44,
  172.71 +  _global_mapping_16,
  172.72 +  _psy_stereo_modes_16,
  172.73 +
  172.74 +  _floor_books,
  172.75 +  _floor,
  172.76 +  2,
  172.77 +  _floor_mapping_16,
  172.78 +
  172.79 +  _mapres_template_16_stereo
  172.80 +};
  172.81 +
  172.82 +static const ve_setup_data_template ve_setup_22_uncoupled={
  172.83 +  3,
  172.84 +  rate_mapping_22_uncoupled,
  172.85 +  quality_mapping_16,
  172.86 +  -1,
  172.87 +  19000,
  172.88 +  26000,
  172.89 +
  172.90 +  blocksize_16_short,
  172.91 +  blocksize_16_long,
  172.92 +
  172.93 +  _psy_tone_masteratt_16,
  172.94 +  _psy_tone_0dB,
  172.95 +  _psy_tone_suppress,
  172.96 +
  172.97 +  _vp_tonemask_adj_16,
  172.98 +  _vp_tonemask_adj_16,
  172.99 +  _vp_tonemask_adj_16,
 172.100 +
 172.101 +  _psy_noiseguards_16,
 172.102 +  _psy_noisebias_16_impulse,
 172.103 +  _psy_noisebias_16_short,
 172.104 +  _psy_noisebias_16_short,
 172.105 +  _psy_noisebias_16,
 172.106 +  _psy_noise_suppress,
 172.107 +
 172.108 +  _psy_compand_8,
 172.109 +  _psy_compand_16_mapping,
 172.110 +  _psy_compand_16_mapping,
 172.111 +
 172.112 +  {_noise_start_16,_noise_start_16},
 172.113 +  { _noise_part_16, _noise_part_16},
 172.114 +  _noise_thresh_16,
 172.115 +
 172.116 +  _psy_ath_floater_16,
 172.117 +  _psy_ath_abs_16,
 172.118 +
 172.119 +  _psy_lowpass_22,
 172.120 +
 172.121 +  _psy_global_44,
 172.122 +  _global_mapping_16,
 172.123 +  _psy_stereo_modes_16,
 172.124 +
 172.125 +  _floor_books,
 172.126 +  _floor,
 172.127 +  2,
 172.128 +  _floor_mapping_16,
 172.129 +
 172.130 +  _mapres_template_16_uncoupled
 172.131 +};
   173.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   173.2 +++ b/libs/vorbis/modes/setup_32.h	Sun Nov 01 00:36:56 2015 +0200
   173.3 @@ -0,0 +1,132 @@
   173.4 +/********************************************************************
   173.5 + *                                                                  *
   173.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   173.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   173.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   173.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  173.10 + *                                                                  *
  173.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
  173.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  173.13 + *                                                                  *
  173.14 + ********************************************************************
  173.15 +
  173.16 + function: toplevel settings for 32kHz
  173.17 + last mod: $Id: setup_32.h 16894 2010-02-12 20:32:12Z xiphmont $
  173.18 +
  173.19 + ********************************************************************/
  173.20 +
  173.21 +static const double rate_mapping_32[12]={
  173.22 +  18000.,28000.,35000.,45000.,56000.,60000.,
  173.23 +  75000.,90000.,100000.,115000.,150000.,190000.,
  173.24 +};
  173.25 +
  173.26 +static const double rate_mapping_32_un[12]={
  173.27 +  30000.,42000.,52000.,64000.,72000.,78000.,
  173.28 +  86000.,92000.,110000.,120000.,140000.,190000.,
  173.29 +};
  173.30 +
  173.31 +static const double _psy_lowpass_32[12]={
  173.32 +  12.3,13.,13.,14.,15.,99.,99.,99.,99.,99.,99.,99.
  173.33 +};
  173.34 +
  173.35 +static const ve_setup_data_template ve_setup_32_stereo={
  173.36 +  11,
  173.37 +  rate_mapping_32,
  173.38 +  quality_mapping_44,
  173.39 +  2,
  173.40 +  26000,
  173.41 +  40000,
  173.42 +
  173.43 +  blocksize_short_44,
  173.44 +  blocksize_long_44,
  173.45 +
  173.46 +  _psy_tone_masteratt_44,
  173.47 +  _psy_tone_0dB,
  173.48 +  _psy_tone_suppress,
  173.49 +
  173.50 +  _vp_tonemask_adj_otherblock,
  173.51 +  _vp_tonemask_adj_longblock,
  173.52 +  _vp_tonemask_adj_otherblock,
  173.53 +
  173.54 +  _psy_noiseguards_44,
  173.55 +  _psy_noisebias_impulse,
  173.56 +  _psy_noisebias_padding,
  173.57 +  _psy_noisebias_trans,
  173.58 +  _psy_noisebias_long,
  173.59 +  _psy_noise_suppress,
  173.60 +
  173.61 +  _psy_compand_44,
  173.62 +  _psy_compand_short_mapping,
  173.63 +  _psy_compand_long_mapping,
  173.64 +
  173.65 +  {_noise_start_short_44,_noise_start_long_44},
  173.66 +  {_noise_part_short_44,_noise_part_long_44},
  173.67 +  _noise_thresh_44,
  173.68 +
  173.69 +  _psy_ath_floater,
  173.70 +  _psy_ath_abs,
  173.71 +
  173.72 +  _psy_lowpass_32,
  173.73 +
  173.74 +  _psy_global_44,
  173.75 +  _global_mapping_44,
  173.76 +  _psy_stereo_modes_44,
  173.77 +
  173.78 +  _floor_books,
  173.79 +  _floor,
  173.80 +  2,
  173.81 +  _floor_mapping_44,
  173.82 +
  173.83 +  _mapres_template_44_stereo
  173.84 +};
  173.85 +
  173.86 +static const ve_setup_data_template ve_setup_32_uncoupled={
  173.87 +  11,
  173.88 +  rate_mapping_32_un,
  173.89 +  quality_mapping_44,
  173.90 +  -1,
  173.91 +  26000,
  173.92 +  40000,
  173.93 +
  173.94 +  blocksize_short_44,
  173.95 +  blocksize_long_44,
  173.96 +
  173.97 +  _psy_tone_masteratt_44,
  173.98 +  _psy_tone_0dB,
  173.99 +  _psy_tone_suppress,
 173.100 +
 173.101 +  _vp_tonemask_adj_otherblock,
 173.102 +  _vp_tonemask_adj_longblock,
 173.103 +  _vp_tonemask_adj_otherblock,
 173.104 +
 173.105 +  _psy_noiseguards_44,
 173.106 +  _psy_noisebias_impulse,
 173.107 +  _psy_noisebias_padding,
 173.108 +  _psy_noisebias_trans,
 173.109 +  _psy_noisebias_long,
 173.110 +  _psy_noise_suppress,
 173.111 +
 173.112 +  _psy_compand_44,
 173.113 +  _psy_compand_short_mapping,
 173.114 +  _psy_compand_long_mapping,
 173.115 +
 173.116 +  {_noise_start_short_44,_noise_start_long_44},
 173.117 +  {_noise_part_short_44,_noise_part_long_44},
 173.118 +  _noise_thresh_44,
 173.119 +
 173.120 +  _psy_ath_floater,
 173.121 +  _psy_ath_abs,
 173.122 +
 173.123 +  _psy_lowpass_32,
 173.124 +
 173.125 +  _psy_global_44,
 173.126 +  _global_mapping_44,
 173.127 +  NULL,
 173.128 +
 173.129 +  _floor_books,
 173.130 +  _floor,
 173.131 +  2,
 173.132 +  _floor_mapping_44,
 173.133 +
 173.134 +  _mapres_template_44_uncoupled
 173.135 +};
   174.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   174.2 +++ b/libs/vorbis/modes/setup_44.h	Sun Nov 01 00:36:56 2015 +0200
   174.3 @@ -0,0 +1,117 @@
   174.4 +/********************************************************************
   174.5 + *                                                                  *
   174.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   174.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   174.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   174.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  174.10 + *                                                                  *
  174.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
  174.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  174.13 + *                                                                  *
  174.14 + ********************************************************************
  174.15 +
  174.16 + function: toplevel settings for 44.1/48kHz
  174.17 + last mod: $Id: setup_44.h 16962 2010-03-11 07:30:34Z xiphmont $
  174.18 +
  174.19 + ********************************************************************/
  174.20 +
  174.21 +#include "modes/floor_all.h"
  174.22 +#include "modes/residue_44.h"
  174.23 +#include "modes/psych_44.h"
  174.24 +
  174.25 +static const double rate_mapping_44_stereo[12]={
  174.26 +  22500.,32000.,40000.,48000.,56000.,64000.,
  174.27 +  80000.,96000.,112000.,128000.,160000.,250001.
  174.28 +};
  174.29 +
  174.30 +static const double quality_mapping_44[12]={
  174.31 +  -.1,.0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1.0
  174.32 +};
  174.33 +
  174.34 +static const int blocksize_short_44[11]={
  174.35 +  512,256,256,256,256,256,256,256,256,256,256
  174.36 +};
  174.37 +static const int blocksize_long_44[11]={
  174.38 +  4096,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048
  174.39 +};
  174.40 +
  174.41 +static const double _psy_compand_short_mapping[12]={
  174.42 +  0.5, 1., 1., 1.3, 1.6, 2., 2., 2., 2., 2., 2., 2.
  174.43 +};
  174.44 +static const double _psy_compand_long_mapping[12]={
  174.45 +  3.5, 4., 4., 4.3, 4.6, 5., 5., 5., 5., 5., 5., 5.
  174.46 +};
  174.47 +
  174.48 +static const double _global_mapping_44[12]={
  174.49 +  /* 1., 1., 1.5, 2., 2., 2.5, 2.7, 3.0, 3.5, 4., 4. */
  174.50 + 0., 1., 1., 1.5, 2., 2., 2.5, 2.7, 3.0, 3.7, 4., 4.
  174.51 +};
  174.52 +
  174.53 +static const int _floor_mapping_44a[11]={
  174.54 +  1,0,0,2,2,4,5,5,5,5,5
  174.55 +};
  174.56 +
  174.57 +static const int _floor_mapping_44b[11]={
  174.58 +  8,7,7,7,7,7,7,7,7,7,7
  174.59 +};
  174.60 +
  174.61 +static const int _floor_mapping_44c[11]={
  174.62 +  10,10,10,10,10,10,10,10,10,10,10
  174.63 +};
  174.64 +
  174.65 +static const int *_floor_mapping_44[]={
  174.66 +  _floor_mapping_44a,
  174.67 +  _floor_mapping_44b,
  174.68 +  _floor_mapping_44c,
  174.69 +};
  174.70 +
  174.71 +static const ve_setup_data_template ve_setup_44_stereo={
  174.72 +  11,
  174.73 +  rate_mapping_44_stereo,
  174.74 +  quality_mapping_44,
  174.75 +  2,
  174.76 +  40000,
  174.77 +  50000,
  174.78 +
  174.79 +  blocksize_short_44,
  174.80 +  blocksize_long_44,
  174.81 +
  174.82 +  _psy_tone_masteratt_44,
  174.83 +  _psy_tone_0dB,
  174.84 +  _psy_tone_suppress,
  174.85 +
  174.86 +  _vp_tonemask_adj_otherblock,
  174.87 +  _vp_tonemask_adj_longblock,
  174.88 +  _vp_tonemask_adj_otherblock,
  174.89 +
  174.90 +  _psy_noiseguards_44,
  174.91 +  _psy_noisebias_impulse,
  174.92 +  _psy_noisebias_padding,
  174.93 +  _psy_noisebias_trans,
  174.94 +  _psy_noisebias_long,
  174.95 +  _psy_noise_suppress,
  174.96 +
  174.97 +  _psy_compand_44,
  174.98 +  _psy_compand_short_mapping,
  174.99 +  _psy_compand_long_mapping,
 174.100 +
 174.101 +  {_noise_start_short_44,_noise_start_long_44},
 174.102 +  {_noise_part_short_44,_noise_part_long_44},
 174.103 +  _noise_thresh_44,
 174.104 +
 174.105 +  _psy_ath_floater,
 174.106 +  _psy_ath_abs,
 174.107 +
 174.108 +  _psy_lowpass_44,
 174.109 +
 174.110 +  _psy_global_44,
 174.111 +  _global_mapping_44,
 174.112 +  _psy_stereo_modes_44,
 174.113 +
 174.114 +  _floor_books,
 174.115 +  _floor,
 174.116 +  2,
 174.117 +  _floor_mapping_44,
 174.118 +
 174.119 +  _mapres_template_44_stereo
 174.120 +};
   175.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   175.2 +++ b/libs/vorbis/modes/setup_44p51.h	Sun Nov 01 00:36:56 2015 +0200
   175.3 @@ -0,0 +1,74 @@
   175.4 +/********************************************************************
   175.5 + *                                                                  *
   175.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   175.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   175.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   175.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  175.10 + *                                                                  *
  175.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2010             *
  175.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  175.13 + *                                                                  *
  175.14 + ********************************************************************
  175.15 +
  175.16 + function: toplevel settings for 44.1/48kHz 5.1 surround modes
  175.17 + last mod: $Id$
  175.18 +
  175.19 + ********************************************************************/
  175.20 +
  175.21 +#include "modes/residue_44p51.h"
  175.22 +
  175.23 +static const double rate_mapping_44p51[12]={
  175.24 +  14000.,20000.,28000.,38000.,46000.,54000.,
  175.25 +  75000.,96000.,120000.,140000.,180000.,240001.
  175.26 +};
  175.27 +
  175.28 +static const ve_setup_data_template ve_setup_44_51={
  175.29 +  11,
  175.30 +  rate_mapping_44p51,
  175.31 +  quality_mapping_44,
  175.32 +  6,
  175.33 +  40000,
  175.34 +  70000,
  175.35 +
  175.36 +  blocksize_short_44,
  175.37 +  blocksize_long_44,
  175.38 +
  175.39 +  _psy_tone_masteratt_44,
  175.40 +  _psy_tone_0dB,
  175.41 +  _psy_tone_suppress,
  175.42 +
  175.43 +  _vp_tonemask_adj_otherblock,
  175.44 +  _vp_tonemask_adj_longblock,
  175.45 +  _vp_tonemask_adj_otherblock,
  175.46 +
  175.47 +  _psy_noiseguards_44,
  175.48 +  _psy_noisebias_impulse,
  175.49 +  _psy_noisebias_padding,
  175.50 +  _psy_noisebias_trans,
  175.51 +  _psy_noisebias_long,
  175.52 +  _psy_noise_suppress,
  175.53 +
  175.54 +  _psy_compand_44,
  175.55 +  _psy_compand_short_mapping,
  175.56 +  _psy_compand_long_mapping,
  175.57 +
  175.58 +  {_noise_start_short_44,_noise_start_long_44},
  175.59 +  {_noise_part_short_44,_noise_part_long_44},
  175.60 +  _noise_thresh_44,
  175.61 +
  175.62 +  _psy_ath_floater,
  175.63 +  _psy_ath_abs,
  175.64 +
  175.65 +  _psy_lowpass_44,
  175.66 +
  175.67 +  _psy_global_44,
  175.68 +  _global_mapping_44,
  175.69 +  _psy_stereo_modes_44,
  175.70 +
  175.71 +  _floor_books,
  175.72 +  _floor,
  175.73 +  3,
  175.74 +  _floor_mapping_44,
  175.75 +
  175.76 +  _mapres_template_44_51
  175.77 +};
   176.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   176.2 +++ b/libs/vorbis/modes/setup_44u.h	Sun Nov 01 00:36:56 2015 +0200
   176.3 @@ -0,0 +1,74 @@
   176.4 +/********************************************************************
   176.5 + *                                                                  *
   176.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   176.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   176.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   176.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  176.10 + *                                                                  *
  176.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
  176.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  176.13 + *                                                                  *
  176.14 + ********************************************************************
  176.15 +
  176.16 + function: toplevel settings for 44.1/48kHz uncoupled modes
  176.17 + last mod: $Id: setup_44u.h 16962 2010-03-11 07:30:34Z xiphmont $
  176.18 +
  176.19 + ********************************************************************/
  176.20 +
  176.21 +#include "modes/residue_44u.h"
  176.22 +
  176.23 +static const double rate_mapping_44_un[12]={
  176.24 +  32000.,48000.,60000.,70000.,80000.,86000.,
  176.25 +  96000.,110000.,120000.,140000.,160000.,240001.
  176.26 +};
  176.27 +
  176.28 +static const ve_setup_data_template ve_setup_44_uncoupled={
  176.29 +  11,
  176.30 +  rate_mapping_44_un,
  176.31 +  quality_mapping_44,
  176.32 +  -1,
  176.33 +  40000,
  176.34 +  50000,
  176.35 +
  176.36 +  blocksize_short_44,
  176.37 +  blocksize_long_44,
  176.38 +
  176.39 +  _psy_tone_masteratt_44,
  176.40 +  _psy_tone_0dB,
  176.41 +  _psy_tone_suppress,
  176.42 +
  176.43 +  _vp_tonemask_adj_otherblock,
  176.44 +  _vp_tonemask_adj_longblock,
  176.45 +  _vp_tonemask_adj_otherblock,
  176.46 +
  176.47 +  _psy_noiseguards_44,
  176.48 +  _psy_noisebias_impulse,
  176.49 +  _psy_noisebias_padding,
  176.50 +  _psy_noisebias_trans,
  176.51 +  _psy_noisebias_long,
  176.52 +  _psy_noise_suppress,
  176.53 +
  176.54 +  _psy_compand_44,
  176.55 +  _psy_compand_short_mapping,
  176.56 +  _psy_compand_long_mapping,
  176.57 +
  176.58 +  {_noise_start_short_44,_noise_start_long_44},
  176.59 +  {_noise_part_short_44,_noise_part_long_44},
  176.60 +  _noise_thresh_44,
  176.61 +
  176.62 +  _psy_ath_floater,
  176.63 +  _psy_ath_abs,
  176.64 +
  176.65 +  _psy_lowpass_44,
  176.66 +
  176.67 +  _psy_global_44,
  176.68 +  _global_mapping_44,
  176.69 +  _psy_stereo_modes_44,
  176.70 +
  176.71 +  _floor_books,
  176.72 +  _floor,
  176.73 +  2,
  176.74 +  _floor_mapping_44,
  176.75 +
  176.76 +  _mapres_template_44_uncoupled
  176.77 +};
   177.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   177.2 +++ b/libs/vorbis/modes/setup_8.h	Sun Nov 01 00:36:56 2015 +0200
   177.3 @@ -0,0 +1,149 @@
   177.4 +/********************************************************************
   177.5 + *                                                                  *
   177.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   177.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   177.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   177.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  177.10 + *                                                                  *
  177.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
  177.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  177.13 + *                                                                  *
  177.14 + ********************************************************************
  177.15 +
  177.16 + function: 8kHz settings
  177.17 + last mod: $Id: setup_8.h 16894 2010-02-12 20:32:12Z xiphmont $
  177.18 +
  177.19 + ********************************************************************/
  177.20 +
  177.21 +#include "psych_8.h"
  177.22 +#include "residue_8.h"
  177.23 +
  177.24 +static const int blocksize_8[2]={
  177.25 +  512,512
  177.26 +};
  177.27 +
  177.28 +static const int _floor_mapping_8a[]={
  177.29 +  6,6
  177.30 +};
  177.31 +
  177.32 +static const int *_floor_mapping_8[]={
  177.33 +  _floor_mapping_8a
  177.34 +};
  177.35 +
  177.36 +static const double rate_mapping_8[3]={
  177.37 +  6000.,9000.,32000.,
  177.38 +};
  177.39 +
  177.40 +static const double rate_mapping_8_uncoupled[3]={
  177.41 +  8000.,14000.,42000.,
  177.42 +};
  177.43 +
  177.44 +static const double quality_mapping_8[3]={
  177.45 +  -.1,.0,1.
  177.46 +};
  177.47 +
  177.48 +static const double _psy_compand_8_mapping[3]={ 0., 1., 1.};
  177.49 +
  177.50 +static const double _global_mapping_8[3]={ 1., 2., 3. };
  177.51 +
  177.52 +static const ve_setup_data_template ve_setup_8_stereo={
  177.53 +  2,
  177.54 +  rate_mapping_8,
  177.55 +  quality_mapping_8,
  177.56 +  2,
  177.57 +  8000,
  177.58 +  9000,
  177.59 +
  177.60 +  blocksize_8,
  177.61 +  blocksize_8,
  177.62 +
  177.63 +  _psy_tone_masteratt_8,
  177.64 +  _psy_tone_0dB,
  177.65 +  _psy_tone_suppress,
  177.66 +
  177.67 +  _vp_tonemask_adj_8,
  177.68 +  NULL,
  177.69 +  _vp_tonemask_adj_8,
  177.70 +
  177.71 +  _psy_noiseguards_8,
  177.72 +  _psy_noisebias_8,
  177.73 +  _psy_noisebias_8,
  177.74 +  NULL,
  177.75 +  NULL,
  177.76 +  _psy_noise_suppress,
  177.77 +
  177.78 +  _psy_compand_8,
  177.79 +  _psy_compand_8_mapping,
  177.80 +  NULL,
  177.81 +
  177.82 +  {_noise_start_8,_noise_start_8},
  177.83 +  {_noise_part_8,_noise_part_8},
  177.84 +  _noise_thresh_5only,
  177.85 +
  177.86 +  _psy_ath_floater_8,
  177.87 +  _psy_ath_abs_8,
  177.88 +
  177.89 +  _psy_lowpass_8,
  177.90 +
  177.91 +  _psy_global_44,
  177.92 +  _global_mapping_8,
  177.93 +  _psy_stereo_modes_8,
  177.94 +
  177.95 +  _floor_books,
  177.96 +  _floor,
  177.97 +  1,
  177.98 +  _floor_mapping_8,
  177.99 +
 177.100 +  _mapres_template_8_stereo
 177.101 +};
 177.102 +
 177.103 +static const ve_setup_data_template ve_setup_8_uncoupled={
 177.104 +  2,
 177.105 +  rate_mapping_8_uncoupled,
 177.106 +  quality_mapping_8,
 177.107 +  -1,
 177.108 +  8000,
 177.109 +  9000,
 177.110 +
 177.111 +  blocksize_8,
 177.112 +  blocksize_8,
 177.113 +
 177.114 +  _psy_tone_masteratt_8,
 177.115 +  _psy_tone_0dB,
 177.116 +  _psy_tone_suppress,
 177.117 +
 177.118 +  _vp_tonemask_adj_8,
 177.119 +  NULL,
 177.120 +  _vp_tonemask_adj_8,
 177.121 +
 177.122 +  _psy_noiseguards_8,
 177.123 +  _psy_noisebias_8,
 177.124 +  _psy_noisebias_8,
 177.125 +  NULL,
 177.126 +  NULL,
 177.127 +  _psy_noise_suppress,
 177.128 +
 177.129 +  _psy_compand_8,
 177.130 +  _psy_compand_8_mapping,
 177.131 +  NULL,
 177.132 +
 177.133 +  {_noise_start_8,_noise_start_8},
 177.134 +  {_noise_part_8,_noise_part_8},
 177.135 +  _noise_thresh_5only,
 177.136 +
 177.137 +  _psy_ath_floater_8,
 177.138 +  _psy_ath_abs_8,
 177.139 +
 177.140 +  _psy_lowpass_8,
 177.141 +
 177.142 +  _psy_global_44,
 177.143 +  _global_mapping_8,
 177.144 +  _psy_stereo_modes_8,
 177.145 +
 177.146 +  _floor_books,
 177.147 +  _floor,
 177.148 +  1,
 177.149 +  _floor_mapping_8,
 177.150 +
 177.151 +  _mapres_template_8_uncoupled
 177.152 +};
   178.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   178.2 +++ b/libs/vorbis/modes/setup_X.h	Sun Nov 01 00:36:56 2015 +0200
   178.3 @@ -0,0 +1,225 @@
   178.4 +/********************************************************************
   178.5 + *                                                                  *
   178.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   178.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   178.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   178.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  178.10 + *                                                                  *
  178.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
  178.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  178.13 + *                                                                  *
  178.14 + ********************************************************************
  178.15 +
  178.16 + function: catch-all toplevel settings for q modes only
  178.17 + last mod: $Id: setup_X.h 16894 2010-02-12 20:32:12Z xiphmont $
  178.18 +
  178.19 + ********************************************************************/
  178.20 +
  178.21 +static const double rate_mapping_X[12]={
  178.22 +  -1.,-1.,-1.,-1.,-1.,-1.,
  178.23 +  -1.,-1.,-1.,-1.,-1.,-1.
  178.24 +};
  178.25 +
  178.26 +static const ve_setup_data_template ve_setup_X_stereo={
  178.27 +  11,
  178.28 +  rate_mapping_X,
  178.29 +  quality_mapping_44,
  178.30 +  2,
  178.31 +  50000,
  178.32 +  200000,
  178.33 +
  178.34 +  blocksize_short_44,
  178.35 +  blocksize_long_44,
  178.36 +
  178.37 +  _psy_tone_masteratt_44,
  178.38 +  _psy_tone_0dB,
  178.39 +  _psy_tone_suppress,
  178.40 +
  178.41 +  _vp_tonemask_adj_otherblock,
  178.42 +  _vp_tonemask_adj_longblock,
  178.43 +  _vp_tonemask_adj_otherblock,
  178.44 +
  178.45 +  _psy_noiseguards_44,
  178.46 +  _psy_noisebias_impulse,
  178.47 +  _psy_noisebias_padding,
  178.48 +  _psy_noisebias_trans,
  178.49 +  _psy_noisebias_long,
  178.50 +  _psy_noise_suppress,
  178.51 +
  178.52 +  _psy_compand_44,
  178.53 +  _psy_compand_short_mapping,
  178.54 +  _psy_compand_long_mapping,
  178.55 +
  178.56 +  {_noise_start_short_44,_noise_start_long_44},
  178.57 +  {_noise_part_short_44,_noise_part_long_44},
  178.58 +  _noise_thresh_44,
  178.59 +
  178.60 +  _psy_ath_floater,
  178.61 +  _psy_ath_abs,
  178.62 +
  178.63 +  _psy_lowpass_44,
  178.64 +
  178.65 +  _psy_global_44,
  178.66 +  _global_mapping_44,
  178.67 +  _psy_stereo_modes_44,
  178.68 +
  178.69 +  _floor_books,
  178.70 +  _floor,
  178.71 +  2,
  178.72 +  _floor_mapping_44,
  178.73 +
  178.74 +  _mapres_template_44_stereo
  178.75 +};
  178.76 +
  178.77 +static const ve_setup_data_template ve_setup_X_uncoupled={
  178.78 +  11,
  178.79 +  rate_mapping_X,
  178.80 +  quality_mapping_44,
  178.81 +  -1,
  178.82 +  50000,
  178.83 +  200000,
  178.84 +
  178.85 +  blocksize_short_44,
  178.86 +  blocksize_long_44,
  178.87 +
  178.88 +  _psy_tone_masteratt_44,
  178.89 +  _psy_tone_0dB,
  178.90 +  _psy_tone_suppress,
  178.91 +
  178.92 +  _vp_tonemask_adj_otherblock,
  178.93 +  _vp_tonemask_adj_longblock,
  178.94 +  _vp_tonemask_adj_otherblock,
  178.95 +
  178.96 +  _psy_noiseguards_44,
  178.97 +  _psy_noisebias_impulse,
  178.98 +  _psy_noisebias_padding,
  178.99 +  _psy_noisebias_trans,
 178.100 +  _psy_noisebias_long,
 178.101 +  _psy_noise_suppress,
 178.102 +
 178.103 +  _psy_compand_44,
 178.104 +  _psy_compand_short_mapping,
 178.105 +  _psy_compand_long_mapping,
 178.106 +
 178.107 +  {_noise_start_short_44,_noise_start_long_44},
 178.108 +  {_noise_part_short_44,_noise_part_long_44},
 178.109 +  _noise_thresh_44,
 178.110 +
 178.111 +  _psy_ath_floater,
 178.112 +  _psy_ath_abs,
 178.113 +
 178.114 +  _psy_lowpass_44,
 178.115 +
 178.116 +  _psy_global_44,
 178.117 +  _global_mapping_44,
 178.118 +  NULL,
 178.119 +
 178.120 +  _floor_books,
 178.121 +  _floor,
 178.122 +  2,
 178.123 +  _floor_mapping_44,
 178.124 +
 178.125 +  _mapres_template_44_uncoupled
 178.126 +};
 178.127 +
 178.128 +static const ve_setup_data_template ve_setup_XX_stereo={
 178.129 +  2,
 178.130 +  rate_mapping_X,
 178.131 +  quality_mapping_8,
 178.132 +  2,
 178.133 +  0,
 178.134 +  8000,
 178.135 +
 178.136 +  blocksize_8,
 178.137 +  blocksize_8,
 178.138 +
 178.139 +  _psy_tone_masteratt_8,
 178.140 +  _psy_tone_0dB,
 178.141 +  _psy_tone_suppress,
 178.142 +
 178.143 +  _vp_tonemask_adj_8,
 178.144 +  NULL,
 178.145 +  _vp_tonemask_adj_8,
 178.146 +
 178.147 +  _psy_noiseguards_8,
 178.148 +  _psy_noisebias_8,
 178.149 +  _psy_noisebias_8,
 178.150 +  NULL,
 178.151 +  NULL,
 178.152 +  _psy_noise_suppress,
 178.153 +
 178.154 +  _psy_compand_8,
 178.155 +  _psy_compand_8_mapping,
 178.156 +  NULL,
 178.157 +
 178.158 +  {_noise_start_8,_noise_start_8},
 178.159 +  {_noise_part_8,_noise_part_8},
 178.160 +  _noise_thresh_5only,
 178.161 +
 178.162 +  _psy_ath_floater_8,
 178.163 +  _psy_ath_abs_8,
 178.164 +
 178.165 +  _psy_lowpass_8,
 178.166 +
 178.167 +  _psy_global_44,
 178.168 +  _global_mapping_8,
 178.169 +  _psy_stereo_modes_8,
 178.170 +
 178.171 +  _floor_books,
 178.172 +  _floor,
 178.173 +  1,
 178.174 +  _floor_mapping_8,
 178.175 +
 178.176 +  _mapres_template_8_stereo
 178.177 +};
 178.178 +
 178.179 +static const ve_setup_data_template ve_setup_XX_uncoupled={
 178.180 +  2,
 178.181 +  rate_mapping_X,
 178.182 +  quality_mapping_8,
 178.183 +  -1,
 178.184 +  0,
 178.185 +  8000,
 178.186 +
 178.187 +  blocksize_8,
 178.188 +  blocksize_8,
 178.189 +
 178.190 +  _psy_tone_masteratt_8,
 178.191 +  _psy_tone_0dB,
 178.192 +  _psy_tone_suppress,
 178.193 +
 178.194 +  _vp_tonemask_adj_8,
 178.195 +  NULL,
 178.196 +  _vp_tonemask_adj_8,
 178.197 +
 178.198 +  _psy_noiseguards_8,
 178.199 +  _psy_noisebias_8,
 178.200 +  _psy_noisebias_8,
 178.201 +  NULL,
 178.202 +  NULL,
 178.203 +  _psy_noise_suppress,
 178.204 +
 178.205 +  _psy_compand_8,
 178.206 +  _psy_compand_8_mapping,
 178.207 +  NULL,
 178.208 +
 178.209 +  {_noise_start_8,_noise_start_8},
 178.210 +  {_noise_part_8,_noise_part_8},
 178.211 +  _noise_thresh_5only,
 178.212 +
 178.213 +  _psy_ath_floater_8,
 178.214 +  _psy_ath_abs_8,
 178.215 +
 178.216 +  _psy_lowpass_8,
 178.217 +
 178.218 +  _psy_global_44,
 178.219 +  _global_mapping_8,
 178.220 +  _psy_stereo_modes_8,
 178.221 +
 178.222 +  _floor_books,
 178.223 +  _floor,
 178.224 +  1,
 178.225 +  _floor_mapping_8,
 178.226 +
 178.227 +  _mapres_template_8_uncoupled
 178.228 +};
   179.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   179.2 +++ b/libs/vorbis/os.h	Sun Nov 01 00:36:56 2015 +0200
   179.3 @@ -0,0 +1,186 @@
   179.4 +#ifndef _OS_H
   179.5 +#define _OS_H
   179.6 +/********************************************************************
   179.7 + *                                                                  *
   179.8 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   179.9 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
  179.10 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
  179.11 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  179.12 + *                                                                  *
  179.13 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
  179.14 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  179.15 + *                                                                  *
  179.16 + ********************************************************************
  179.17 +
  179.18 + function: #ifdef jail to whip a few platforms into the UNIX ideal.
  179.19 + last mod: $Id: os.h 16227 2009-07-08 06:58:46Z xiphmont $
  179.20 +
  179.21 + ********************************************************************/
  179.22 +
  179.23 +#ifdef HAVE_CONFIG_H
  179.24 +#include "config.h"
  179.25 +#endif
  179.26 +
  179.27 +#include <math.h>
  179.28 +#include <ogg/os_types.h>
  179.29 +
  179.30 +#include "misc.h"
  179.31 +
  179.32 +#ifndef _V_IFDEFJAIL_H_
  179.33 +#  define _V_IFDEFJAIL_H_
  179.34 +
  179.35 +#  ifdef __GNUC__
  179.36 +#    define STIN static __inline__
  179.37 +#  elif _WIN32
  179.38 +#    define STIN static __inline
  179.39 +#  else
  179.40 +#    define STIN static
  179.41 +#  endif
  179.42 +
  179.43 +#ifdef DJGPP
  179.44 +#  define rint(x)   (floor((x)+0.5f))
  179.45 +#endif
  179.46 +
  179.47 +#ifndef M_PI
  179.48 +#  define M_PI (3.1415926536f)
  179.49 +#endif
  179.50 +
  179.51 +#if defined(_WIN32) && !defined(__SYMBIAN32__)
  179.52 +#  include <malloc.h>
  179.53 +#  define rint(x)   (floor((x)+0.5f))
  179.54 +#  define NO_FLOAT_MATH_LIB
  179.55 +#  define FAST_HYPOT(a, b) sqrt((a)*(a) + (b)*(b))
  179.56 +#endif
  179.57 +
  179.58 +#if defined(__SYMBIAN32__) && defined(__WINS__)
  179.59 +void *_alloca(size_t size);
  179.60 +#  define alloca _alloca
  179.61 +#endif
  179.62 +
  179.63 +#ifndef FAST_HYPOT
  179.64 +#  define FAST_HYPOT hypot
  179.65 +#endif
  179.66 +
  179.67 +#endif
  179.68 +
  179.69 +#ifdef HAVE_ALLOCA_H
  179.70 +#  include <alloca.h>
  179.71 +#endif
  179.72 +
  179.73 +#ifdef USE_MEMORY_H
  179.74 +#  include <memory.h>
  179.75 +#endif
  179.76 +
  179.77 +#ifndef min
  179.78 +#  define min(x,y)  ((x)>(y)?(y):(x))
  179.79 +#endif
  179.80 +
  179.81 +#ifndef max
  179.82 +#  define max(x,y)  ((x)<(y)?(y):(x))
  179.83 +#endif
  179.84 +
  179.85 +
  179.86 +/* Special i386 GCC implementation */
  179.87 +#if defined(__i386__) && defined(__GNUC__) && !defined(__BEOS__)
  179.88 +#  define VORBIS_FPU_CONTROL
  179.89 +/* both GCC and MSVC are kinda stupid about rounding/casting to int.
  179.90 +   Because of encapsulation constraints (GCC can't see inside the asm
  179.91 +   block and so we end up doing stupid things like a store/load that
  179.92 +   is collectively a noop), we do it this way */
  179.93 +
  179.94 +/* we must set up the fpu before this works!! */
  179.95 +
  179.96 +typedef ogg_int16_t vorbis_fpu_control;
  179.97 +
  179.98 +static inline void vorbis_fpu_setround(vorbis_fpu_control *fpu){
  179.99 +  ogg_int16_t ret;
 179.100 +  ogg_int16_t temp;
 179.101 +  __asm__ __volatile__("fnstcw %0\n\t"
 179.102 +          "movw %0,%%dx\n\t"
 179.103 +          "andw $62463,%%dx\n\t"
 179.104 +          "movw %%dx,%1\n\t"
 179.105 +          "fldcw %1\n\t":"=m"(ret):"m"(temp): "dx");
 179.106 +  *fpu=ret;
 179.107 +}
 179.108 +
 179.109 +static inline void vorbis_fpu_restore(vorbis_fpu_control fpu){
 179.110 +  __asm__ __volatile__("fldcw %0":: "m"(fpu));
 179.111 +}
 179.112 +
 179.113 +/* assumes the FPU is in round mode! */
 179.114 +static inline int vorbis_ftoi(double f){  /* yes, double!  Otherwise,
 179.115 +                                             we get extra fst/fld to
 179.116 +                                             truncate precision */
 179.117 +  int i;
 179.118 +  __asm__("fistl %0": "=m"(i) : "t"(f));
 179.119 +  return(i);
 179.120 +}
 179.121 +#endif /* Special i386 GCC implementation */
 179.122 +
 179.123 +
 179.124 +/* MSVC inline assembly. 32 bit only; inline ASM isn't implemented in the
 179.125 + * 64 bit compiler */
 179.126 +#if defined(_MSC_VER) && !defined(_WIN64) && !defined(_WIN32_WCE)
 179.127 +#  define VORBIS_FPU_CONTROL
 179.128 +
 179.129 +typedef ogg_int16_t vorbis_fpu_control;
 179.130 +
 179.131 +static __inline int vorbis_ftoi(double f){
 179.132 +        int i;
 179.133 +        __asm{
 179.134 +                fld f
 179.135 +                fistp i
 179.136 +        }
 179.137 +        return i;
 179.138 +}
 179.139 +
 179.140 +static __inline void vorbis_fpu_setround(vorbis_fpu_control *fpu){
 179.141 +}
 179.142 +
 179.143 +static __inline void vorbis_fpu_restore(vorbis_fpu_control fpu){
 179.144 +}
 179.145 +
 179.146 +#endif /* Special MSVC 32 bit implementation */
 179.147 +
 179.148 +
 179.149 +/* Optimized code path for x86_64 builds. Uses SSE2 intrinsics. This can be
 179.150 +   done safely because all x86_64 CPUs supports SSE2. */
 179.151 +#if (defined(_MSC_VER) && defined(_WIN64)) || (defined(__GNUC__) && defined (__x86_64__))
 179.152 +#  define VORBIS_FPU_CONTROL
 179.153 +
 179.154 +typedef ogg_int16_t vorbis_fpu_control;
 179.155 +
 179.156 +#include <emmintrin.h>
 179.157 +static __inline int vorbis_ftoi(double f){
 179.158 +        return _mm_cvtsd_si32(_mm_load_sd(&f));
 179.159 +}
 179.160 +
 179.161 +static __inline void vorbis_fpu_setround(vorbis_fpu_control *fpu){
 179.162 +}
 179.163 +
 179.164 +static __inline void vorbis_fpu_restore(vorbis_fpu_control fpu){
 179.165 +}
 179.166 +
 179.167 +#endif /* Special MSVC x64 implementation */
 179.168 +
 179.169 +
 179.170 +/* If no special implementation was found for the current compiler / platform,
 179.171 +   use the default implementation here: */
 179.172 +#ifndef VORBIS_FPU_CONTROL
 179.173 +
 179.174 +typedef int vorbis_fpu_control;
 179.175 +
 179.176 +static int vorbis_ftoi(double f){
 179.177 +        /* Note: MSVC and GCC (at least on some systems) round towards zero, thus,
 179.178 +           the floor() call is required to ensure correct roudning of
 179.179 +           negative numbers */
 179.180 +        return (int)floor(f+.5);
 179.181 +}
 179.182 +
 179.183 +/* We don't have special code for this compiler/arch, so do it the slow way */
 179.184 +#  define vorbis_fpu_setround(vorbis_fpu_control) {}
 179.185 +#  define vorbis_fpu_restore(vorbis_fpu_control) {}
 179.186 +
 179.187 +#endif /* default implementation */
 179.188 +
 179.189 +#endif /* _OS_H */
   180.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   180.2 +++ b/libs/vorbis/psy.c	Sun Nov 01 00:36:56 2015 +0200
   180.3 @@ -0,0 +1,1206 @@
   180.4 +/********************************************************************
   180.5 + *                                                                  *
   180.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   180.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   180.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   180.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  180.10 + *                                                                  *
  180.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2010             *
  180.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  180.13 + *                                                                  *
  180.14 + ********************************************************************
  180.15 +
  180.16 + function: psychoacoustics not including preecho
  180.17 + last mod: $Id: psy.c 18077 2011-09-02 02:49:00Z giles $
  180.18 +
  180.19 + ********************************************************************/
  180.20 +
  180.21 +#include <stdlib.h>
  180.22 +#include <math.h>
  180.23 +#include <string.h>
  180.24 +#include "vorbis/codec.h"
  180.25 +#include "codec_internal.h"
  180.26 +
  180.27 +#include "masking.h"
  180.28 +#include "psy.h"
  180.29 +#include "os.h"
  180.30 +#include "lpc.h"
  180.31 +#include "smallft.h"
  180.32 +#include "scales.h"
  180.33 +#include "misc.h"
  180.34 +
  180.35 +#define NEGINF -9999.f
  180.36 +static const double stereo_threshholds[]={0.0, .5, 1.0, 1.5, 2.5, 4.5, 8.5, 16.5, 9e10};
  180.37 +static const double stereo_threshholds_limited[]={0.0, .5, 1.0, 1.5, 2.0, 2.5, 4.5, 8.5, 9e10};
  180.38 +
  180.39 +vorbis_look_psy_global *_vp_global_look(vorbis_info *vi){
  180.40 +  codec_setup_info *ci=vi->codec_setup;
  180.41 +  vorbis_info_psy_global *gi=&ci->psy_g_param;
  180.42 +  vorbis_look_psy_global *look=_ogg_calloc(1,sizeof(*look));
  180.43 +
  180.44 +  look->channels=vi->channels;
  180.45 +
  180.46 +  look->ampmax=-9999.;
  180.47 +  look->gi=gi;
  180.48 +  return(look);
  180.49 +}
  180.50 +
  180.51 +void _vp_global_free(vorbis_look_psy_global *look){
  180.52 +  if(look){
  180.53 +    memset(look,0,sizeof(*look));
  180.54 +    _ogg_free(look);
  180.55 +  }
  180.56 +}
  180.57 +
  180.58 +void _vi_gpsy_free(vorbis_info_psy_global *i){
  180.59 +  if(i){
  180.60 +    memset(i,0,sizeof(*i));
  180.61 +    _ogg_free(i);
  180.62 +  }
  180.63 +}
  180.64 +
  180.65 +void _vi_psy_free(vorbis_info_psy *i){
  180.66 +  if(i){
  180.67 +    memset(i,0,sizeof(*i));
  180.68 +    _ogg_free(i);
  180.69 +  }
  180.70 +}
  180.71 +
  180.72 +static void min_curve(float *c,
  180.73 +                       float *c2){
  180.74 +  int i;
  180.75 +  for(i=0;i<EHMER_MAX;i++)if(c2[i]<c[i])c[i]=c2[i];
  180.76 +}
  180.77 +static void max_curve(float *c,
  180.78 +                       float *c2){
  180.79 +  int i;
  180.80 +  for(i=0;i<EHMER_MAX;i++)if(c2[i]>c[i])c[i]=c2[i];
  180.81 +}
  180.82 +
  180.83 +static void attenuate_curve(float *c,float att){
  180.84 +  int i;
  180.85 +  for(i=0;i<EHMER_MAX;i++)
  180.86 +    c[i]+=att;
  180.87 +}
  180.88 +
  180.89 +static float ***setup_tone_curves(float curveatt_dB[P_BANDS],float binHz,int n,
  180.90 +                                  float center_boost, float center_decay_rate){
  180.91 +  int i,j,k,m;
  180.92 +  float ath[EHMER_MAX];
  180.93 +  float workc[P_BANDS][P_LEVELS][EHMER_MAX];
  180.94 +  float athc[P_LEVELS][EHMER_MAX];
  180.95 +  float *brute_buffer=alloca(n*sizeof(*brute_buffer));
  180.96 +
  180.97 +  float ***ret=_ogg_malloc(sizeof(*ret)*P_BANDS);
  180.98 +
  180.99 +  memset(workc,0,sizeof(workc));
 180.100 +
 180.101 +  for(i=0;i<P_BANDS;i++){
 180.102 +    /* we add back in the ATH to avoid low level curves falling off to
 180.103 +       -infinity and unnecessarily cutting off high level curves in the
 180.104 +       curve limiting (last step). */
 180.105 +
 180.106 +    /* A half-band's settings must be valid over the whole band, and
 180.107 +       it's better to mask too little than too much */
 180.108 +    int ath_offset=i*4;
 180.109 +    for(j=0;j<EHMER_MAX;j++){
 180.110 +      float min=999.;
 180.111 +      for(k=0;k<4;k++)
 180.112 +        if(j+k+ath_offset<MAX_ATH){
 180.113 +          if(min>ATH[j+k+ath_offset])min=ATH[j+k+ath_offset];
 180.114 +        }else{
 180.115 +          if(min>ATH[MAX_ATH-1])min=ATH[MAX_ATH-1];
 180.116 +        }
 180.117 +      ath[j]=min;
 180.118 +    }
 180.119 +
 180.120 +    /* copy curves into working space, replicate the 50dB curve to 30
 180.121 +       and 40, replicate the 100dB curve to 110 */
 180.122 +    for(j=0;j<6;j++)
 180.123 +      memcpy(workc[i][j+2],tonemasks[i][j],EHMER_MAX*sizeof(*tonemasks[i][j]));
 180.124 +    memcpy(workc[i][0],tonemasks[i][0],EHMER_MAX*sizeof(*tonemasks[i][0]));
 180.125 +    memcpy(workc[i][1],tonemasks[i][0],EHMER_MAX*sizeof(*tonemasks[i][0]));
 180.126 +
 180.127 +    /* apply centered curve boost/decay */
 180.128 +    for(j=0;j<P_LEVELS;j++){
 180.129 +      for(k=0;k<EHMER_MAX;k++){
 180.130 +        float adj=center_boost+abs(EHMER_OFFSET-k)*center_decay_rate;
 180.131 +        if(adj<0. && center_boost>0)adj=0.;
 180.132 +        if(adj>0. && center_boost<0)adj=0.;
 180.133 +        workc[i][j][k]+=adj;
 180.134 +      }
 180.135 +    }
 180.136 +
 180.137 +    /* normalize curves so the driving amplitude is 0dB */
 180.138 +    /* make temp curves with the ATH overlayed */
 180.139 +    for(j=0;j<P_LEVELS;j++){
 180.140 +      attenuate_curve(workc[i][j],curveatt_dB[i]+100.-(j<2?2:j)*10.-P_LEVEL_0);
 180.141 +      memcpy(athc[j],ath,EHMER_MAX*sizeof(**athc));
 180.142 +      attenuate_curve(athc[j],+100.-j*10.f-P_LEVEL_0);
 180.143 +      max_curve(athc[j],workc[i][j]);
 180.144 +    }
 180.145 +
 180.146 +    /* Now limit the louder curves.
 180.147 +
 180.148 +       the idea is this: We don't know what the playback attenuation
 180.149 +       will be; 0dB SL moves every time the user twiddles the volume
 180.150 +       knob. So that means we have to use a single 'most pessimal' curve
 180.151 +       for all masking amplitudes, right?  Wrong.  The *loudest* sound
 180.152 +       can be in (we assume) a range of ...+100dB] SL.  However, sounds
 180.153 +       20dB down will be in a range ...+80], 40dB down is from ...+60],
 180.154 +       etc... */
 180.155 +
 180.156 +    for(j=1;j<P_LEVELS;j++){
 180.157 +      min_curve(athc[j],athc[j-1]);
 180.158 +      min_curve(workc[i][j],athc[j]);
 180.159 +    }
 180.160 +  }
 180.161 +
 180.162 +  for(i=0;i<P_BANDS;i++){
 180.163 +    int hi_curve,lo_curve,bin;
 180.164 +    ret[i]=_ogg_malloc(sizeof(**ret)*P_LEVELS);
 180.165 +
 180.166 +    /* low frequency curves are measured with greater resolution than
 180.167 +       the MDCT/FFT will actually give us; we want the curve applied
 180.168 +       to the tone data to be pessimistic and thus apply the minimum
 180.169 +       masking possible for a given bin.  That means that a single bin
 180.170 +       could span more than one octave and that the curve will be a
 180.171 +       composite of multiple octaves.  It also may mean that a single
 180.172 +       bin may span > an eighth of an octave and that the eighth
 180.173 +       octave values may also be composited. */
 180.174 +
 180.175 +    /* which octave curves will we be compositing? */
 180.176 +    bin=floor(fromOC(i*.5)/binHz);
 180.177 +    lo_curve=  ceil(toOC(bin*binHz+1)*2);
 180.178 +    hi_curve=  floor(toOC((bin+1)*binHz)*2);
 180.179 +    if(lo_curve>i)lo_curve=i;
 180.180 +    if(lo_curve<0)lo_curve=0;
 180.181 +    if(hi_curve>=P_BANDS)hi_curve=P_BANDS-1;
 180.182 +
 180.183 +    for(m=0;m<P_LEVELS;m++){
 180.184 +      ret[i][m]=_ogg_malloc(sizeof(***ret)*(EHMER_MAX+2));
 180.185 +
 180.186 +      for(j=0;j<n;j++)brute_buffer[j]=999.;
 180.187 +
 180.188 +      /* render the curve into bins, then pull values back into curve.
 180.189 +         The point is that any inherent subsampling aliasing results in
 180.190 +         a safe minimum */
 180.191 +      for(k=lo_curve;k<=hi_curve;k++){
 180.192 +        int l=0;
 180.193 +
 180.194 +        for(j=0;j<EHMER_MAX;j++){
 180.195 +          int lo_bin= fromOC(j*.125+k*.5-2.0625)/binHz;
 180.196 +          int hi_bin= fromOC(j*.125+k*.5-1.9375)/binHz+1;
 180.197 +
 180.198 +          if(lo_bin<0)lo_bin=0;
 180.199 +          if(lo_bin>n)lo_bin=n;
 180.200 +          if(lo_bin<l)l=lo_bin;
 180.201 +          if(hi_bin<0)hi_bin=0;
 180.202 +          if(hi_bin>n)hi_bin=n;
 180.203 +
 180.204 +          for(;l<hi_bin && l<n;l++)
 180.205 +            if(brute_buffer[l]>workc[k][m][j])
 180.206 +              brute_buffer[l]=workc[k][m][j];
 180.207 +        }
 180.208 +
 180.209 +        for(;l<n;l++)
 180.210 +          if(brute_buffer[l]>workc[k][m][EHMER_MAX-1])
 180.211 +            brute_buffer[l]=workc[k][m][EHMER_MAX-1];
 180.212 +
 180.213 +      }
 180.214 +
 180.215 +      /* be equally paranoid about being valid up to next half ocatve */
 180.216 +      if(i+1<P_BANDS){
 180.217 +        int l=0;
 180.218 +        k=i+1;
 180.219 +        for(j=0;j<EHMER_MAX;j++){
 180.220 +          int lo_bin= fromOC(j*.125+i*.5-2.0625)/binHz;
 180.221 +          int hi_bin= fromOC(j*.125+i*.5-1.9375)/binHz+1;
 180.222 +
 180.223 +          if(lo_bin<0)lo_bin=0;
 180.224 +          if(lo_bin>n)lo_bin=n;
 180.225 +          if(lo_bin<l)l=lo_bin;
 180.226 +          if(hi_bin<0)hi_bin=0;
 180.227 +          if(hi_bin>n)hi_bin=n;
 180.228 +
 180.229 +          for(;l<hi_bin && l<n;l++)
 180.230 +            if(brute_buffer[l]>workc[k][m][j])
 180.231 +              brute_buffer[l]=workc[k][m][j];
 180.232 +        }
 180.233 +
 180.234 +        for(;l<n;l++)
 180.235 +          if(brute_buffer[l]>workc[k][m][EHMER_MAX-1])
 180.236 +            brute_buffer[l]=workc[k][m][EHMER_MAX-1];
 180.237 +
 180.238 +      }
 180.239 +
 180.240 +
 180.241 +      for(j=0;j<EHMER_MAX;j++){
 180.242 +        int bin=fromOC(j*.125+i*.5-2.)/binHz;
 180.243 +        if(bin<0){
 180.244 +          ret[i][m][j+2]=-999.;
 180.245 +        }else{
 180.246 +          if(bin>=n){
 180.247 +            ret[i][m][j+2]=-999.;
 180.248 +          }else{
 180.249 +            ret[i][m][j+2]=brute_buffer[bin];
 180.250 +          }
 180.251 +        }
 180.252 +      }
 180.253 +
 180.254 +      /* add fenceposts */
 180.255 +      for(j=0;j<EHMER_OFFSET;j++)
 180.256 +        if(ret[i][m][j+2]>-200.f)break;
 180.257 +      ret[i][m][0]=j;
 180.258 +
 180.259 +      for(j=EHMER_MAX-1;j>EHMER_OFFSET+1;j--)
 180.260 +        if(ret[i][m][j+2]>-200.f)
 180.261 +          break;
 180.262 +      ret[i][m][1]=j;
 180.263 +
 180.264 +    }
 180.265 +  }
 180.266 +
 180.267 +  return(ret);
 180.268 +}
 180.269 +
 180.270 +void _vp_psy_init(vorbis_look_psy *p,vorbis_info_psy *vi,
 180.271 +                  vorbis_info_psy_global *gi,int n,long rate){
 180.272 +  long i,j,lo=-99,hi=1;
 180.273 +  long maxoc;
 180.274 +  memset(p,0,sizeof(*p));
 180.275 +
 180.276 +  p->eighth_octave_lines=gi->eighth_octave_lines;
 180.277 +  p->shiftoc=rint(log(gi->eighth_octave_lines*8.f)/log(2.f))-1;
 180.278 +
 180.279 +  p->firstoc=toOC(.25f*rate*.5/n)*(1<<(p->shiftoc+1))-gi->eighth_octave_lines;
 180.280 +  maxoc=toOC((n+.25f)*rate*.5/n)*(1<<(p->shiftoc+1))+.5f;
 180.281 +  p->total_octave_lines=maxoc-p->firstoc+1;
 180.282 +  p->ath=_ogg_malloc(n*sizeof(*p->ath));
 180.283 +
 180.284 +  p->octave=_ogg_malloc(n*sizeof(*p->octave));
 180.285 +  p->bark=_ogg_malloc(n*sizeof(*p->bark));
 180.286 +  p->vi=vi;
 180.287 +  p->n=n;
 180.288 +  p->rate=rate;
 180.289 +
 180.290 +  /* AoTuV HF weighting */
 180.291 +  p->m_val = 1.;
 180.292 +  if(rate < 26000) p->m_val = 0;
 180.293 +  else if(rate < 38000) p->m_val = .94;   /* 32kHz */
 180.294 +  else if(rate > 46000) p->m_val = 1.275; /* 48kHz */
 180.295 +
 180.296 +  /* set up the lookups for a given blocksize and sample rate */
 180.297 +
 180.298 +  for(i=0,j=0;i<MAX_ATH-1;i++){
 180.299 +    int endpos=rint(fromOC((i+1)*.125-2.)*2*n/rate);
 180.300 +    float base=ATH[i];
 180.301 +    if(j<endpos){
 180.302 +      float delta=(ATH[i+1]-base)/(endpos-j);
 180.303 +      for(;j<endpos && j<n;j++){
 180.304 +        p->ath[j]=base+100.;
 180.305 +        base+=delta;
 180.306 +      }
 180.307 +    }
 180.308 +  }
 180.309 +
 180.310 +  for(;j<n;j++){
 180.311 +    p->ath[j]=p->ath[j-1];
 180.312 +  }
 180.313 +
 180.314 +  for(i=0;i<n;i++){
 180.315 +    float bark=toBARK(rate/(2*n)*i);
 180.316 +
 180.317 +    for(;lo+vi->noisewindowlomin<i &&
 180.318 +          toBARK(rate/(2*n)*lo)<(bark-vi->noisewindowlo);lo++);
 180.319 +
 180.320 +    for(;hi<=n && (hi<i+vi->noisewindowhimin ||
 180.321 +          toBARK(rate/(2*n)*hi)<(bark+vi->noisewindowhi));hi++);
 180.322 +
 180.323 +    p->bark[i]=((lo-1)<<16)+(hi-1);
 180.324 +
 180.325 +  }
 180.326 +
 180.327 +  for(i=0;i<n;i++)
 180.328 +    p->octave[i]=toOC((i+.25f)*.5*rate/n)*(1<<(p->shiftoc+1))+.5f;
 180.329 +
 180.330 +  p->tonecurves=setup_tone_curves(vi->toneatt,rate*.5/n,n,
 180.331 +                                  vi->tone_centerboost,vi->tone_decay);
 180.332 +
 180.333 +  /* set up rolling noise median */
 180.334 +  p->noiseoffset=_ogg_malloc(P_NOISECURVES*sizeof(*p->noiseoffset));
 180.335 +  for(i=0;i<P_NOISECURVES;i++)
 180.336 +    p->noiseoffset[i]=_ogg_malloc(n*sizeof(**p->noiseoffset));
 180.337 +
 180.338 +  for(i=0;i<n;i++){
 180.339 +    float halfoc=toOC((i+.5)*rate/(2.*n))*2.;
 180.340 +    int inthalfoc;
 180.341 +    float del;
 180.342 +
 180.343 +    if(halfoc<0)halfoc=0;
 180.344 +    if(halfoc>=P_BANDS-1)halfoc=P_BANDS-1;
 180.345 +    inthalfoc=(int)halfoc;
 180.346 +    del=halfoc-inthalfoc;
 180.347 +
 180.348 +    for(j=0;j<P_NOISECURVES;j++)
 180.349 +      p->noiseoffset[j][i]=
 180.350 +        p->vi->noiseoff[j][inthalfoc]*(1.-del) +
 180.351 +        p->vi->noiseoff[j][inthalfoc+1]*del;
 180.352 +
 180.353 +  }
 180.354 +#if 0
 180.355 +  {
 180.356 +    static int ls=0;
 180.357 +    _analysis_output_always("noiseoff0",ls,p->noiseoffset[0],n,1,0,0);
 180.358 +    _analysis_output_always("noiseoff1",ls,p->noiseoffset[1],n,1,0,0);
 180.359 +    _analysis_output_always("noiseoff2",ls++,p->noiseoffset[2],n,1,0,0);
 180.360 +  }
 180.361 +#endif
 180.362 +}
 180.363 +
 180.364 +void _vp_psy_clear(vorbis_look_psy *p){
 180.365 +  int i,j;
 180.366 +  if(p){
 180.367 +    if(p->ath)_ogg_free(p->ath);
 180.368 +    if(p->octave)_ogg_free(p->octave);
 180.369 +    if(p->bark)_ogg_free(p->bark);
 180.370 +    if(p->tonecurves){
 180.371 +      for(i=0;i<P_BANDS;i++){
 180.372 +        for(j=0;j<P_LEVELS;j++){
 180.373 +          _ogg_free(p->tonecurves[i][j]);
 180.374 +        }
 180.375 +        _ogg_free(p->tonecurves[i]);
 180.376 +      }
 180.377 +      _ogg_free(p->tonecurves);
 180.378 +    }
 180.379 +    if(p->noiseoffset){
 180.380 +      for(i=0;i<P_NOISECURVES;i++){
 180.381 +        _ogg_free(p->noiseoffset[i]);
 180.382 +      }
 180.383 +      _ogg_free(p->noiseoffset);
 180.384 +    }
 180.385 +    memset(p,0,sizeof(*p));
 180.386 +  }
 180.387 +}
 180.388 +
 180.389 +/* octave/(8*eighth_octave_lines) x scale and dB y scale */
 180.390 +static void seed_curve(float *seed,
 180.391 +                       const float **curves,
 180.392 +                       float amp,
 180.393 +                       int oc, int n,
 180.394 +                       int linesper,float dBoffset){
 180.395 +  int i,post1;
 180.396 +  int seedptr;
 180.397 +  const float *posts,*curve;
 180.398 +
 180.399 +  int choice=(int)((amp+dBoffset-P_LEVEL_0)*.1f);
 180.400 +  choice=max(choice,0);
 180.401 +  choice=min(choice,P_LEVELS-1);
 180.402 +  posts=curves[choice];
 180.403 +  curve=posts+2;
 180.404 +  post1=(int)posts[1];
 180.405 +  seedptr=oc+(posts[0]-EHMER_OFFSET)*linesper-(linesper>>1);
 180.406 +
 180.407 +  for(i=posts[0];i<post1;i++){
 180.408 +    if(seedptr>0){
 180.409 +      float lin=amp+curve[i];
 180.410 +      if(seed[seedptr]<lin)seed[seedptr]=lin;
 180.411 +    }
 180.412 +    seedptr+=linesper;
 180.413 +    if(seedptr>=n)break;
 180.414 +  }
 180.415 +}
 180.416 +
 180.417 +static void seed_loop(vorbis_look_psy *p,
 180.418 +                      const float ***curves,
 180.419 +                      const float *f,
 180.420 +                      const float *flr,
 180.421 +                      float *seed,
 180.422 +                      float specmax){
 180.423 +  vorbis_info_psy *vi=p->vi;
 180.424 +  long n=p->n,i;
 180.425 +  float dBoffset=vi->max_curve_dB-specmax;
 180.426 +
 180.427 +  /* prime the working vector with peak values */
 180.428 +
 180.429 +  for(i=0;i<n;i++){
 180.430 +    float max=f[i];
 180.431 +    long oc=p->octave[i];
 180.432 +    while(i+1<n && p->octave[i+1]==oc){
 180.433 +      i++;
 180.434 +      if(f[i]>max)max=f[i];
 180.435 +    }
 180.436 +
 180.437 +    if(max+6.f>flr[i]){
 180.438 +      oc=oc>>p->shiftoc;
 180.439 +
 180.440 +      if(oc>=P_BANDS)oc=P_BANDS-1;
 180.441 +      if(oc<0)oc=0;
 180.442 +
 180.443 +      seed_curve(seed,
 180.444 +                 curves[oc],
 180.445 +                 max,
 180.446 +                 p->octave[i]-p->firstoc,
 180.447 +                 p->total_octave_lines,
 180.448 +                 p->eighth_octave_lines,
 180.449 +                 dBoffset);
 180.450 +    }
 180.451 +  }
 180.452 +}
 180.453 +
 180.454 +static void seed_chase(float *seeds, int linesper, long n){
 180.455 +  long  *posstack=alloca(n*sizeof(*posstack));
 180.456 +  float *ampstack=alloca(n*sizeof(*ampstack));
 180.457 +  long   stack=0;
 180.458 +  long   pos=0;
 180.459 +  long   i;
 180.460 +
 180.461 +  for(i=0;i<n;i++){
 180.462 +    if(stack<2){
 180.463 +      posstack[stack]=i;
 180.464 +      ampstack[stack++]=seeds[i];
 180.465 +    }else{
 180.466 +      while(1){
 180.467 +        if(seeds[i]<ampstack[stack-1]){
 180.468 +          posstack[stack]=i;
 180.469 +          ampstack[stack++]=seeds[i];
 180.470 +          break;
 180.471 +        }else{
 180.472 +          if(i<posstack[stack-1]+linesper){
 180.473 +            if(stack>1 && ampstack[stack-1]<=ampstack[stack-2] &&
 180.474 +               i<posstack[stack-2]+linesper){
 180.475 +              /* we completely overlap, making stack-1 irrelevant.  pop it */
 180.476 +              stack--;
 180.477 +              continue;
 180.478 +            }
 180.479 +          }
 180.480 +          posstack[stack]=i;
 180.481 +          ampstack[stack++]=seeds[i];
 180.482 +          break;
 180.483 +
 180.484 +        }
 180.485 +      }
 180.486 +    }
 180.487 +  }
 180.488 +
 180.489 +  /* the stack now contains only the positions that are relevant. Scan
 180.490 +     'em straight through */
 180.491 +
 180.492 +  for(i=0;i<stack;i++){
 180.493 +    long endpos;
 180.494 +    if(i<stack-1 && ampstack[i+1]>ampstack[i]){
 180.495 +      endpos=posstack[i+1];
 180.496 +    }else{
 180.497 +      endpos=posstack[i]+linesper+1; /* +1 is important, else bin 0 is
 180.498 +                                        discarded in short frames */
 180.499 +    }
 180.500 +    if(endpos>n)endpos=n;
 180.501 +    for(;pos<endpos;pos++)
 180.502 +      seeds[pos]=ampstack[i];
 180.503 +  }
 180.504 +
 180.505 +  /* there.  Linear time.  I now remember this was on a problem set I
 180.506 +     had in Grad Skool... I didn't solve it at the time ;-) */
 180.507 +
 180.508 +}
 180.509 +
 180.510 +/* bleaugh, this is more complicated than it needs to be */
 180.511 +#include<stdio.h>
 180.512 +static void max_seeds(vorbis_look_psy *p,
 180.513 +                      float *seed,
 180.514 +                      float *flr){
 180.515 +  long   n=p->total_octave_lines;
 180.516 +  int    linesper=p->eighth_octave_lines;
 180.517 +  long   linpos=0;
 180.518 +  long   pos;
 180.519 +
 180.520 +  seed_chase(seed,linesper,n); /* for masking */
 180.521 +
 180.522 +  pos=p->octave[0]-p->firstoc-(linesper>>1);
 180.523 +
 180.524 +  while(linpos+1<p->n){
 180.525 +    float minV=seed[pos];
 180.526 +    long end=((p->octave[linpos]+p->octave[linpos+1])>>1)-p->firstoc;
 180.527 +    if(minV>p->vi->tone_abs_limit)minV=p->vi->tone_abs_limit;
 180.528 +    while(pos+1<=end){
 180.529 +      pos++;
 180.530 +      if((seed[pos]>NEGINF && seed[pos]<minV) || minV==NEGINF)
 180.531 +        minV=seed[pos];
 180.532 +    }
 180.533 +
 180.534 +    end=pos+p->firstoc;
 180.535 +    for(;linpos<p->n && p->octave[linpos]<=end;linpos++)
 180.536 +      if(flr[linpos]<minV)flr[linpos]=minV;
 180.537 +  }
 180.538 +
 180.539 +  {
 180.540 +    float minV=seed[p->total_octave_lines-1];
 180.541 +    for(;linpos<p->n;linpos++)
 180.542 +      if(flr[linpos]<minV)flr[linpos]=minV;
 180.543 +  }
 180.544 +
 180.545 +}
 180.546 +
 180.547 +static void bark_noise_hybridmp(int n,const long *b,
 180.548 +                                const float *f,
 180.549 +                                float *noise,
 180.550 +                                const float offset,
 180.551 +                                const int fixed){
 180.552 +
 180.553 +  float *N=alloca(n*sizeof(*N));
 180.554 +  float *X=alloca(n*sizeof(*N));
 180.555 +  float *XX=alloca(n*sizeof(*N));
 180.556 +  float *Y=alloca(n*sizeof(*N));
 180.557 +  float *XY=alloca(n*sizeof(*N));
 180.558 +
 180.559 +  float tN, tX, tXX, tY, tXY;
 180.560 +  int i;
 180.561 +
 180.562 +  int lo, hi;
 180.563 +  float R=0.f;
 180.564 +  float A=0.f;
 180.565 +  float B=0.f;
 180.566 +  float D=1.f;
 180.567 +  float w, x, y;
 180.568 +
 180.569 +  tN = tX = tXX = tY = tXY = 0.f;
 180.570 +
 180.571 +  y = f[0] + offset;
 180.572 +  if (y < 1.f) y = 1.f;
 180.573 +
 180.574 +  w = y * y * .5;
 180.575 +
 180.576 +  tN += w;
 180.577 +  tX += w;
 180.578 +  tY += w * y;
 180.579 +
 180.580 +  N[0] = tN;
 180.581 +  X[0] = tX;
 180.582 +  XX[0] = tXX;
 180.583 +  Y[0] = tY;
 180.584 +  XY[0] = tXY;
 180.585 +
 180.586 +  for (i = 1, x = 1.f; i < n; i++, x += 1.f) {
 180.587 +
 180.588 +    y = f[i] + offset;
 180.589 +    if (y < 1.f) y = 1.f;
 180.590 +
 180.591 +    w = y * y;
 180.592 +
 180.593 +    tN += w;
 180.594 +    tX += w * x;
 180.595 +    tXX += w * x * x;
 180.596 +    tY += w * y;
 180.597 +    tXY += w * x * y;
 180.598 +
 180.599 +    N[i] = tN;
 180.600 +    X[i] = tX;
 180.601 +    XX[i] = tXX;
 180.602 +    Y[i] = tY;
 180.603 +    XY[i] = tXY;
 180.604 +  }
 180.605 +
 180.606 +  for (i = 0, x = 0.f;; i++, x += 1.f) {
 180.607 +
 180.608 +    lo = b[i] >> 16;
 180.609 +    if( lo>=0 ) break;
 180.610 +    hi = b[i] & 0xffff;
 180.611 +
 180.612 +    tN = N[hi] + N[-lo];
 180.613 +    tX = X[hi] - X[-lo];
 180.614 +    tXX = XX[hi] + XX[-lo];
 180.615 +    tY = Y[hi] + Y[-lo];
 180.616 +    tXY = XY[hi] - XY[-lo];
 180.617 +
 180.618 +    A = tY * tXX - tX * tXY;
 180.619 +    B = tN * tXY - tX * tY;
 180.620 +    D = tN * tXX - tX * tX;
 180.621 +    R = (A + x * B) / D;
 180.622 +    if (R < 0.f)
 180.623 +      R = 0.f;
 180.624 +
 180.625 +    noise[i] = R - offset;
 180.626 +  }
 180.627 +
 180.628 +  for ( ;; i++, x += 1.f) {
 180.629 +
 180.630 +    lo = b[i] >> 16;
 180.631 +    hi = b[i] & 0xffff;
 180.632 +    if(hi>=n)break;
 180.633 +
 180.634 +    tN = N[hi] - N[lo];
 180.635 +    tX = X[hi] - X[lo];
 180.636 +    tXX = XX[hi] - XX[lo];
 180.637 +    tY = Y[hi] - Y[lo];
 180.638 +    tXY = XY[hi] - XY[lo];
 180.639 +
 180.640 +    A = tY * tXX - tX * tXY;
 180.641 +    B = tN * tXY - tX * tY;
 180.642 +    D = tN * tXX - tX * tX;
 180.643 +    R = (A + x * B) / D;
 180.644 +    if (R < 0.f) R = 0.f;
 180.645 +
 180.646 +    noise[i] = R - offset;
 180.647 +  }
 180.648 +  for ( ; i < n; i++, x += 1.f) {
 180.649 +
 180.650 +    R = (A + x * B) / D;
 180.651 +    if (R < 0.f) R = 0.f;
 180.652 +
 180.653 +    noise[i] = R - offset;
 180.654 +  }
 180.655 +
 180.656 +  if (fixed <= 0) return;
 180.657 +
 180.658 +  for (i = 0, x = 0.f;; i++, x += 1.f) {
 180.659 +    hi = i + fixed / 2;
 180.660 +    lo = hi - fixed;
 180.661 +    if(lo>=0)break;
 180.662 +
 180.663 +    tN = N[hi] + N[-lo];
 180.664 +    tX = X[hi] - X[-lo];
 180.665 +    tXX = XX[hi] + XX[-lo];
 180.666 +    tY = Y[hi] + Y[-lo];
 180.667 +    tXY = XY[hi] - XY[-lo];
 180.668 +
 180.669 +
 180.670 +    A = tY * tXX - tX * tXY;
 180.671 +    B = tN * tXY - tX * tY;
 180.672 +    D = tN * tXX - tX * tX;
 180.673 +    R = (A + x * B) / D;
 180.674 +
 180.675 +    if (R - offset < noise[i]) noise[i] = R - offset;
 180.676 +  }
 180.677 +  for ( ;; i++, x += 1.f) {
 180.678 +
 180.679 +    hi = i + fixed / 2;
 180.680 +    lo = hi - fixed;
 180.681 +    if(hi>=n)break;
 180.682 +
 180.683 +    tN = N[hi] - N[lo];
 180.684 +    tX = X[hi] - X[lo];
 180.685 +    tXX = XX[hi] - XX[lo];
 180.686 +    tY = Y[hi] - Y[lo];
 180.687 +    tXY = XY[hi] - XY[lo];
 180.688 +
 180.689 +    A = tY * tXX - tX * tXY;
 180.690 +    B = tN * tXY - tX * tY;
 180.691 +    D = tN * tXX - tX * tX;
 180.692 +    R = (A + x * B) / D;
 180.693 +
 180.694 +    if (R - offset < noise[i]) noise[i] = R - offset;
 180.695 +  }
 180.696 +  for ( ; i < n; i++, x += 1.f) {
 180.697 +    R = (A + x * B) / D;
 180.698 +    if (R - offset < noise[i]) noise[i] = R - offset;
 180.699 +  }
 180.700 +}
 180.701 +
 180.702 +void _vp_noisemask(vorbis_look_psy *p,
 180.703 +                   float *logmdct,
 180.704 +                   float *logmask){
 180.705 +
 180.706 +  int i,n=p->n;
 180.707 +  float *work=alloca(n*sizeof(*work));
 180.708 +
 180.709 +  bark_noise_hybridmp(n,p->bark,logmdct,logmask,
 180.710 +                      140.,-1);
 180.711 +
 180.712 +  for(i=0;i<n;i++)work[i]=logmdct[i]-logmask[i];
 180.713 +
 180.714 +  bark_noise_hybridmp(n,p->bark,work,logmask,0.,
 180.715 +                      p->vi->noisewindowfixed);
 180.716 +
 180.717 +  for(i=0;i<n;i++)work[i]=logmdct[i]-work[i];
 180.718 +
 180.719 +#if 0
 180.720 +  {
 180.721 +    static int seq=0;
 180.722 +
 180.723 +    float work2[n];
 180.724 +    for(i=0;i<n;i++){
 180.725 +      work2[i]=logmask[i]+work[i];
 180.726 +    }
 180.727 +
 180.728 +    if(seq&1)
 180.729 +      _analysis_output("median2R",seq/2,work,n,1,0,0);
 180.730 +    else
 180.731 +      _analysis_output("median2L",seq/2,work,n,1,0,0);
 180.732 +
 180.733 +    if(seq&1)
 180.734 +      _analysis_output("envelope2R",seq/2,work2,n,1,0,0);
 180.735 +    else
 180.736 +      _analysis_output("envelope2L",seq/2,work2,n,1,0,0);
 180.737 +    seq++;
 180.738 +  }
 180.739 +#endif
 180.740 +
 180.741 +  for(i=0;i<n;i++){
 180.742 +    int dB=logmask[i]+.5;
 180.743 +    if(dB>=NOISE_COMPAND_LEVELS)dB=NOISE_COMPAND_LEVELS-1;
 180.744 +    if(dB<0)dB=0;
 180.745 +    logmask[i]= work[i]+p->vi->noisecompand[dB];
 180.746 +  }
 180.747 +
 180.748 +}
 180.749 +
 180.750 +void _vp_tonemask(vorbis_look_psy *p,
 180.751 +                  float *logfft,
 180.752 +                  float *logmask,
 180.753 +                  float global_specmax,
 180.754 +                  float local_specmax){
 180.755 +
 180.756 +  int i,n=p->n;
 180.757 +
 180.758 +  float *seed=alloca(sizeof(*seed)*p->total_octave_lines);
 180.759 +  float att=local_specmax+p->vi->ath_adjatt;
 180.760 +  for(i=0;i<p->total_octave_lines;i++)seed[i]=NEGINF;
 180.761 +
 180.762 +  /* set the ATH (floating below localmax, not global max by a
 180.763 +     specified att) */
 180.764 +  if(att<p->vi->ath_maxatt)att=p->vi->ath_maxatt;
 180.765 +
 180.766 +  for(i=0;i<n;i++)
 180.767 +    logmask[i]=p->ath[i]+att;
 180.768 +
 180.769 +  /* tone masking */
 180.770 +  seed_loop(p,(const float ***)p->tonecurves,logfft,logmask,seed,global_specmax);
 180.771 +  max_seeds(p,seed,logmask);
 180.772 +
 180.773 +}
 180.774 +
 180.775 +void _vp_offset_and_mix(vorbis_look_psy *p,
 180.776 +                        float *noise,
 180.777 +                        float *tone,
 180.778 +                        int offset_select,
 180.779 +                        float *logmask,
 180.780 +                        float *mdct,
 180.781 +                        float *logmdct){
 180.782 +  int i,n=p->n;
 180.783 +  float de, coeffi, cx;/* AoTuV */
 180.784 +  float toneatt=p->vi->tone_masteratt[offset_select];
 180.785 +
 180.786 +  cx = p->m_val;
 180.787 +
 180.788 +  for(i=0;i<n;i++){
 180.789 +    float val= noise[i]+p->noiseoffset[offset_select][i];
 180.790 +    if(val>p->vi->noisemaxsupp)val=p->vi->noisemaxsupp;
 180.791 +    logmask[i]=max(val,tone[i]+toneatt);
 180.792 +
 180.793 +
 180.794 +    /* AoTuV */
 180.795 +    /** @ M1 **
 180.796 +        The following codes improve a noise problem.
 180.797 +        A fundamental idea uses the value of masking and carries out
 180.798 +        the relative compensation of the MDCT.
 180.799 +        However, this code is not perfect and all noise problems cannot be solved.
 180.800 +        by Aoyumi @ 2004/04/18
 180.801 +    */
 180.802 +
 180.803 +    if(offset_select == 1) {
 180.804 +      coeffi = -17.2;       /* coeffi is a -17.2dB threshold */
 180.805 +      val = val - logmdct[i];  /* val == mdct line value relative to floor in dB */
 180.806 +
 180.807 +      if(val > coeffi){
 180.808 +        /* mdct value is > -17.2 dB below floor */
 180.809 +
 180.810 +        de = 1.0-((val-coeffi)*0.005*cx);
 180.811 +        /* pro-rated attenuation:
 180.812 +           -0.00 dB boost if mdct value is -17.2dB (relative to floor)
 180.813 +           -0.77 dB boost if mdct value is 0dB (relative to floor)
 180.814 +           -1.64 dB boost if mdct value is +17.2dB (relative to floor)
 180.815 +           etc... */
 180.816 +
 180.817 +        if(de < 0) de = 0.0001;
 180.818 +      }else
 180.819 +        /* mdct value is <= -17.2 dB below floor */
 180.820 +
 180.821 +        de = 1.0-((val-coeffi)*0.0003*cx);
 180.822 +      /* pro-rated attenuation:
 180.823 +         +0.00 dB atten if mdct value is -17.2dB (relative to floor)
 180.824 +         +0.45 dB atten if mdct value is -34.4dB (relative to floor)
 180.825 +         etc... */
 180.826 +
 180.827 +      mdct[i] *= de;
 180.828 +
 180.829 +    }
 180.830 +  }
 180.831 +}
 180.832 +
 180.833 +float _vp_ampmax_decay(float amp,vorbis_dsp_state *vd){
 180.834 +  vorbis_info *vi=vd->vi;
 180.835 +  codec_setup_info *ci=vi->codec_setup;
 180.836 +  vorbis_info_psy_global *gi=&ci->psy_g_param;
 180.837 +
 180.838 +  int n=ci->blocksizes[vd->W]/2;
 180.839 +  float secs=(float)n/vi->rate;
 180.840 +
 180.841 +  amp+=secs*gi->ampmax_att_per_sec;
 180.842 +  if(amp<-9999)amp=-9999;
 180.843 +  return(amp);
 180.844 +}
 180.845 +
 180.846 +static float FLOOR1_fromdB_LOOKUP[256]={
 180.847 +  1.0649863e-07F, 1.1341951e-07F, 1.2079015e-07F, 1.2863978e-07F,
 180.848 +  1.3699951e-07F, 1.4590251e-07F, 1.5538408e-07F, 1.6548181e-07F,
 180.849 +  1.7623575e-07F, 1.8768855e-07F, 1.9988561e-07F, 2.128753e-07F,
 180.850 +  2.2670913e-07F, 2.4144197e-07F, 2.5713223e-07F, 2.7384213e-07F,
 180.851 +  2.9163793e-07F, 3.1059021e-07F, 3.3077411e-07F, 3.5226968e-07F,
 180.852 +  3.7516214e-07F, 3.9954229e-07F, 4.2550680e-07F, 4.5315863e-07F,
 180.853 +  4.8260743e-07F, 5.1396998e-07F, 5.4737065e-07F, 5.8294187e-07F,
 180.854 +  6.2082472e-07F, 6.6116941e-07F, 7.0413592e-07F, 7.4989464e-07F,
 180.855 +  7.9862701e-07F, 8.5052630e-07F, 9.0579828e-07F, 9.6466216e-07F,
 180.856 +  1.0273513e-06F, 1.0941144e-06F, 1.1652161e-06F, 1.2409384e-06F,
 180.857 +  1.3215816e-06F, 1.4074654e-06F, 1.4989305e-06F, 1.5963394e-06F,
 180.858 +  1.7000785e-06F, 1.8105592e-06F, 1.9282195e-06F, 2.0535261e-06F,
 180.859 +  2.1869758e-06F, 2.3290978e-06F, 2.4804557e-06F, 2.6416497e-06F,
 180.860 +  2.8133190e-06F, 2.9961443e-06F, 3.1908506e-06F, 3.3982101e-06F,
 180.861 +  3.6190449e-06F, 3.8542308e-06F, 4.1047004e-06F, 4.3714470e-06F,
 180.862 +  4.6555282e-06F, 4.9580707e-06F, 5.2802740e-06F, 5.6234160e-06F,
 180.863 +  5.9888572e-06F, 6.3780469e-06F, 6.7925283e-06F, 7.2339451e-06F,
 180.864 +  7.7040476e-06F, 8.2047000e-06F, 8.7378876e-06F, 9.3057248e-06F,
 180.865 +  9.9104632e-06F, 1.0554501e-05F, 1.1240392e-05F, 1.1970856e-05F,
 180.866 +  1.2748789e-05F, 1.3577278e-05F, 1.4459606e-05F, 1.5399272e-05F,
 180.867 +  1.6400004e-05F, 1.7465768e-05F, 1.8600792e-05F, 1.9809576e-05F,
 180.868 +  2.1096914e-05F, 2.2467911e-05F, 2.3928002e-05F, 2.5482978e-05F,
 180.869 +  2.7139006e-05F, 2.8902651e-05F, 3.0780908e-05F, 3.2781225e-05F,
 180.870 +  3.4911534e-05F, 3.7180282e-05F, 3.9596466e-05F, 4.2169667e-05F,
 180.871 +  4.4910090e-05F, 4.7828601e-05F, 5.0936773e-05F, 5.4246931e-05F,
 180.872 +  5.7772202e-05F, 6.1526565e-05F, 6.5524908e-05F, 6.9783085e-05F,
 180.873 +  7.4317983e-05F, 7.9147585e-05F, 8.4291040e-05F, 8.9768747e-05F,
 180.874 +  9.5602426e-05F, 0.00010181521F, 0.00010843174F, 0.00011547824F,
 180.875 +  0.00012298267F, 0.00013097477F, 0.00013948625F, 0.00014855085F,
 180.876 +  0.00015820453F, 0.00016848555F, 0.00017943469F, 0.00019109536F,
 180.877 +  0.00020351382F, 0.00021673929F, 0.00023082423F, 0.00024582449F,
 180.878 +  0.00026179955F, 0.00027881276F, 0.00029693158F, 0.00031622787F,
 180.879 +  0.00033677814F, 0.00035866388F, 0.00038197188F, 0.00040679456F,
 180.880 +  0.00043323036F, 0.00046138411F, 0.00049136745F, 0.00052329927F,
 180.881 +  0.00055730621F, 0.00059352311F, 0.00063209358F, 0.00067317058F,
 180.882 +  0.00071691700F, 0.00076350630F, 0.00081312324F, 0.00086596457F,
 180.883 +  0.00092223983F, 0.00098217216F, 0.0010459992F, 0.0011139742F,
 180.884 +  0.0011863665F, 0.0012634633F, 0.0013455702F, 0.0014330129F,
 180.885 +  0.0015261382F, 0.0016253153F, 0.0017309374F, 0.0018434235F,
 180.886 +  0.0019632195F, 0.0020908006F, 0.0022266726F, 0.0023713743F,
 180.887 +  0.0025254795F, 0.0026895994F, 0.0028643847F, 0.0030505286F,
 180.888 +  0.0032487691F, 0.0034598925F, 0.0036847358F, 0.0039241906F,
 180.889 +  0.0041792066F, 0.0044507950F, 0.0047400328F, 0.0050480668F,
 180.890 +  0.0053761186F, 0.0057254891F, 0.0060975636F, 0.0064938176F,
 180.891 +  0.0069158225F, 0.0073652516F, 0.0078438871F, 0.0083536271F,
 180.892 +  0.0088964928F, 0.009474637F, 0.010090352F, 0.010746080F,
 180.893 +  0.011444421F, 0.012188144F, 0.012980198F, 0.013823725F,
 180.894 +  0.014722068F, 0.015678791F, 0.016697687F, 0.017782797F,
 180.895 +  0.018938423F, 0.020169149F, 0.021479854F, 0.022875735F,
 180.896 +  0.024362330F, 0.025945531F, 0.027631618F, 0.029427276F,
 180.897 +  0.031339626F, 0.033376252F, 0.035545228F, 0.037855157F,
 180.898 +  0.040315199F, 0.042935108F, 0.045725273F, 0.048696758F,
 180.899 +  0.051861348F, 0.055231591F, 0.058820850F, 0.062643361F,
 180.900 +  0.066714279F, 0.071049749F, 0.075666962F, 0.080584227F,
 180.901 +  0.085821044F, 0.091398179F, 0.097337747F, 0.10366330F,
 180.902 +  0.11039993F, 0.11757434F, 0.12521498F, 0.13335215F,
 180.903 +  0.14201813F, 0.15124727F, 0.16107617F, 0.17154380F,
 180.904 +  0.18269168F, 0.19456402F, 0.20720788F, 0.22067342F,
 180.905 +  0.23501402F, 0.25028656F, 0.26655159F, 0.28387361F,
 180.906 +  0.30232132F, 0.32196786F, 0.34289114F, 0.36517414F,
 180.907 +  0.38890521F, 0.41417847F, 0.44109412F, 0.46975890F,
 180.908 +  0.50028648F, 0.53279791F, 0.56742212F, 0.60429640F,
 180.909 +  0.64356699F, 0.68538959F, 0.72993007F, 0.77736504F,
 180.910 +  0.82788260F, 0.88168307F, 0.9389798F, 1.F,
 180.911 +};
 180.912 +
 180.913 +/* this is for per-channel noise normalization */
 180.914 +static int apsort(const void *a, const void *b){
 180.915 +  float f1=**(float**)a;
 180.916 +  float f2=**(float**)b;
 180.917 +  return (f1<f2)-(f1>f2);
 180.918 +}
 180.919 +
 180.920 +static void flag_lossless(int limit, float prepoint, float postpoint, float *mdct,
 180.921 +                         float *floor, int *flag, int i, int jn){
 180.922 +  int j;
 180.923 +  for(j=0;j<jn;j++){
 180.924 +    float point = j>=limit-i ? postpoint : prepoint;
 180.925 +    float r = fabs(mdct[j])/floor[j];
 180.926 +    if(r<point)
 180.927 +      flag[j]=0;
 180.928 +    else
 180.929 +      flag[j]=1;
 180.930 +  }
 180.931 +}
 180.932 +
 180.933 +/* Overload/Side effect: On input, the *q vector holds either the
 180.934 +   quantized energy (for elements with the flag set) or the absolute
 180.935 +   values of the *r vector (for elements with flag unset).  On output,
 180.936 +   *q holds the quantized energy for all elements */
 180.937 +static float noise_normalize(vorbis_look_psy *p, int limit, float *r, float *q, float *f, int *flags, float acc, int i, int n, int *out){
 180.938 +
 180.939 +  vorbis_info_psy *vi=p->vi;
 180.940 +  float **sort = alloca(n*sizeof(*sort));
 180.941 +  int j,count=0;
 180.942 +  int start = (vi->normal_p ? vi->normal_start-i : n);
 180.943 +  if(start>n)start=n;
 180.944 +
 180.945 +  /* force classic behavior where only energy in the current band is considered */
 180.946 +  acc=0.f;
 180.947 +
 180.948 +  /* still responsible for populating *out where noise norm not in
 180.949 +     effect.  There's no need to [re]populate *q in these areas */
 180.950 +  for(j=0;j<start;j++){
 180.951 +    if(!flags || !flags[j]){ /* lossless coupling already quantized.
 180.952 +                                Don't touch; requantizing based on
 180.953 +                                energy would be incorrect. */
 180.954 +      float ve = q[j]/f[j];
 180.955 +      if(r[j]<0)
 180.956 +        out[j] = -rint(sqrt(ve));
 180.957 +      else
 180.958 +        out[j] = rint(sqrt(ve));
 180.959 +    }
 180.960 +  }
 180.961 +
 180.962 +  /* sort magnitudes for noise norm portion of partition */
 180.963 +  for(;j<n;j++){
 180.964 +    if(!flags || !flags[j]){ /* can't noise norm elements that have
 180.965 +                                already been loslessly coupled; we can
 180.966 +                                only account for their energy error */
 180.967 +      float ve = q[j]/f[j];
 180.968 +      /* Despite all the new, more capable coupling code, for now we
 180.969 +         implement noise norm as it has been up to this point. Only
 180.970 +         consider promotions to unit magnitude from 0.  In addition
 180.971 +         the only energy error counted is quantizations to zero. */
 180.972 +      /* also-- the original point code only applied noise norm at > pointlimit */
 180.973 +      if(ve<.25f && (!flags || j>=limit-i)){
 180.974 +        acc += ve;
 180.975 +        sort[count++]=q+j; /* q is fabs(r) for unflagged element */
 180.976 +      }else{
 180.977 +        /* For now: no acc adjustment for nonzero quantization.  populate *out and q as this value is final. */
 180.978 +        if(r[j]<0)
 180.979 +          out[j] = -rint(sqrt(ve));
 180.980 +        else
 180.981 +          out[j] = rint(sqrt(ve));
 180.982 +        q[j] = out[j]*out[j]*f[j];
 180.983 +      }
 180.984 +    }/* else{
 180.985 +        again, no energy adjustment for error in nonzero quant-- for now
 180.986 +        }*/
 180.987 +  }
 180.988 +
 180.989 +  if(count){
 180.990 +    /* noise norm to do */
 180.991 +    qsort(sort,count,sizeof(*sort),apsort);
 180.992 +    for(j=0;j<count;j++){
 180.993 +      int k=sort[j]-q;
 180.994 +      if(acc>=vi->normal_thresh){
 180.995 +        out[k]=unitnorm(r[k]);
 180.996 +        acc-=1.f;
 180.997 +        q[k]=f[k];
 180.998 +      }else{
 180.999 +        out[k]=0;
180.1000 +        q[k]=0.f;
180.1001 +      }
180.1002 +    }
180.1003 +  }
180.1004 +
180.1005 +  return acc;
180.1006 +}
180.1007 +
180.1008 +/* Noise normalization, quantization and coupling are not wholly
180.1009 +   seperable processes in depth>1 coupling. */
180.1010 +void _vp_couple_quantize_normalize(int blobno,
180.1011 +                                   vorbis_info_psy_global *g,
180.1012 +                                   vorbis_look_psy *p,
180.1013 +                                   vorbis_info_mapping0 *vi,
180.1014 +                                   float **mdct,
180.1015 +                                   int   **iwork,
180.1016 +                                   int    *nonzero,
180.1017 +                                   int     sliding_lowpass,
180.1018 +                                   int     ch){
180.1019 +
180.1020 +  int i;
180.1021 +  int n = p->n;
180.1022 +  int partition=(p->vi->normal_p ? p->vi->normal_partition : 16);
180.1023 +  int limit = g->coupling_pointlimit[p->vi->blockflag][blobno];
180.1024 +  float prepoint=stereo_threshholds[g->coupling_prepointamp[blobno]];
180.1025 +  float postpoint=stereo_threshholds[g->coupling_postpointamp[blobno]];
180.1026 +#if 0
180.1027 +  float de=0.1*p->m_val; /* a blend of the AoTuV M2 and M3 code here and below */
180.1028 +#endif
180.1029 +
180.1030 +  /* mdct is our raw mdct output, floor not removed. */
180.1031 +  /* inout passes in the ifloor, passes back quantized result */
180.1032 +
180.1033 +  /* unquantized energy (negative indicates amplitude has negative sign) */
180.1034 +  float **raw = alloca(ch*sizeof(*raw));
180.1035 +
180.1036 +  /* dual pupose; quantized energy (if flag set), othersize fabs(raw) */
180.1037 +  float **quant = alloca(ch*sizeof(*quant));
180.1038 +
180.1039 +  /* floor energy */
180.1040 +  float **floor = alloca(ch*sizeof(*floor));
180.1041 +
180.1042 +  /* flags indicating raw/quantized status of elements in raw vector */
180.1043 +  int   **flag  = alloca(ch*sizeof(*flag));
180.1044 +
180.1045 +  /* non-zero flag working vector */
180.1046 +  int    *nz    = alloca(ch*sizeof(*nz));
180.1047 +
180.1048 +  /* energy surplus/defecit tracking */
180.1049 +  float  *acc   = alloca((ch+vi->coupling_steps)*sizeof(*acc));
180.1050 +
180.1051 +  /* The threshold of a stereo is changed with the size of n */
180.1052 +  if(n > 1000)
180.1053 +    postpoint=stereo_threshholds_limited[g->coupling_postpointamp[blobno]];
180.1054 +
180.1055 +  raw[0]   = alloca(ch*partition*sizeof(**raw));
180.1056 +  quant[0] = alloca(ch*partition*sizeof(**quant));
180.1057 +  floor[0] = alloca(ch*partition*sizeof(**floor));
180.1058 +  flag[0]  = alloca(ch*partition*sizeof(**flag));
180.1059 +
180.1060 +  for(i=1;i<ch;i++){
180.1061 +    raw[i]   = &raw[0][partition*i];
180.1062 +    quant[i] = &quant[0][partition*i];
180.1063 +    floor[i] = &floor[0][partition*i];
180.1064 +    flag[i]  = &flag[0][partition*i];
180.1065 +  }
180.1066 +  for(i=0;i<ch+vi->coupling_steps;i++)
180.1067 +    acc[i]=0.f;
180.1068 +
180.1069 +  for(i=0;i<n;i+=partition){
180.1070 +    int k,j,jn = partition > n-i ? n-i : partition;
180.1071 +    int step,track = 0;
180.1072 +
180.1073 +    memcpy(nz,nonzero,sizeof(*nz)*ch);
180.1074 +
180.1075 +    /* prefill */
180.1076 +    memset(flag[0],0,ch*partition*sizeof(**flag));
180.1077 +    for(k=0;k<ch;k++){
180.1078 +      int *iout = &iwork[k][i];
180.1079 +      if(nz[k]){
180.1080 +
180.1081 +        for(j=0;j<jn;j++)
180.1082 +          floor[k][j] = FLOOR1_fromdB_LOOKUP[iout[j]];
180.1083 +
180.1084 +        flag_lossless(limit,prepoint,postpoint,&mdct[k][i],floor[k],flag[k],i,jn);
180.1085 +
180.1086 +        for(j=0;j<jn;j++){
180.1087 +          quant[k][j] = raw[k][j] = mdct[k][i+j]*mdct[k][i+j];
180.1088 +          if(mdct[k][i+j]<0.f) raw[k][j]*=-1.f;
180.1089 +          floor[k][j]*=floor[k][j];
180.1090 +        }
180.1091 +
180.1092 +        acc[track]=noise_normalize(p,limit,raw[k],quant[k],floor[k],NULL,acc[track],i,jn,iout);
180.1093 +
180.1094 +      }else{
180.1095 +        for(j=0;j<jn;j++){
180.1096 +          floor[k][j] = 1e-10f;
180.1097 +          raw[k][j] = 0.f;
180.1098 +          quant[k][j] = 0.f;
180.1099 +          flag[k][j] = 0;
180.1100 +          iout[j]=0;
180.1101 +        }
180.1102 +        acc[track]=0.f;
180.1103 +      }
180.1104 +      track++;
180.1105 +    }
180.1106 +
180.1107 +    /* coupling */
180.1108 +    for(step=0;step<vi->coupling_steps;step++){
180.1109 +      int Mi = vi->coupling_mag[step];
180.1110 +      int Ai = vi->coupling_ang[step];
180.1111 +      int *iM = &iwork[Mi][i];
180.1112 +      int *iA = &iwork[Ai][i];
180.1113 +      float *reM = raw[Mi];
180.1114 +      float *reA = raw[Ai];
180.1115 +      float *qeM = quant[Mi];
180.1116 +      float *qeA = quant[Ai];
180.1117 +      float *floorM = floor[Mi];
180.1118 +      float *floorA = floor[Ai];
180.1119 +      int *fM = flag[Mi];
180.1120 +      int *fA = flag[Ai];
180.1121 +
180.1122 +      if(nz[Mi] || nz[Ai]){
180.1123 +        nz[Mi] = nz[Ai] = 1;
180.1124 +
180.1125 +        for(j=0;j<jn;j++){
180.1126 +
180.1127 +          if(j<sliding_lowpass-i){
180.1128 +            if(fM[j] || fA[j]){
180.1129 +              /* lossless coupling */
180.1130 +
180.1131 +              reM[j] = fabs(reM[j])+fabs(reA[j]);
180.1132 +              qeM[j] = qeM[j]+qeA[j];
180.1133 +              fM[j]=fA[j]=1;
180.1134 +
180.1135 +              /* couple iM/iA */
180.1136 +              {
180.1137 +                int A = iM[j];
180.1138 +                int B = iA[j];
180.1139 +
180.1140 +                if(abs(A)>abs(B)){
180.1141 +                  iA[j]=(A>0?A-B:B-A);
180.1142 +                }else{
180.1143 +                  iA[j]=(B>0?A-B:B-A);
180.1144 +                  iM[j]=B;
180.1145 +                }
180.1146 +
180.1147 +                /* collapse two equivalent tuples to one */
180.1148 +                if(iA[j]>=abs(iM[j])*2){
180.1149 +                  iA[j]= -iA[j];
180.1150 +                  iM[j]= -iM[j];
180.1151 +                }
180.1152 +
180.1153 +              }
180.1154 +
180.1155 +            }else{
180.1156 +              /* lossy (point) coupling */
180.1157 +              if(j<limit-i){
180.1158 +                /* dipole */
180.1159 +                reM[j] += reA[j];
180.1160 +                qeM[j] = fabs(reM[j]);
180.1161 +              }else{
180.1162 +#if 0
180.1163 +                /* AoTuV */
180.1164 +                /** @ M2 **
180.1165 +                    The boost problem by the combination of noise normalization and point stereo is eased.
180.1166 +                    However, this is a temporary patch.
180.1167 +                    by Aoyumi @ 2004/04/18
180.1168 +                */
180.1169 +                float derate = (1.0 - de*((float)(j-limit+i) / (float)(n-limit)));
180.1170 +                /* elliptical */
180.1171 +                if(reM[j]+reA[j]<0){
180.1172 +                  reM[j] = - (qeM[j] = (fabs(reM[j])+fabs(reA[j]))*derate*derate);
180.1173 +                }else{
180.1174 +                  reM[j] =   (qeM[j] = (fabs(reM[j])+fabs(reA[j]))*derate*derate);
180.1175 +                }
180.1176 +#else
180.1177 +                /* elliptical */
180.1178 +                if(reM[j]+reA[j]<0){
180.1179 +                  reM[j] = - (qeM[j] = fabs(reM[j])+fabs(reA[j]));
180.1180 +                }else{
180.1181 +                  reM[j] =   (qeM[j] = fabs(reM[j])+fabs(reA[j]));
180.1182 +                }
180.1183 +#endif
180.1184 +
180.1185 +              }
180.1186 +              reA[j]=qeA[j]=0.f;
180.1187 +              fA[j]=1;
180.1188 +              iA[j]=0;
180.1189 +            }
180.1190 +          }
180.1191 +          floorM[j]=floorA[j]=floorM[j]+floorA[j];
180.1192 +        }
180.1193 +        /* normalize the resulting mag vector */
180.1194 +        acc[track]=noise_normalize(p,limit,raw[Mi],quant[Mi],floor[Mi],flag[Mi],acc[track],i,jn,iM);
180.1195 +        track++;
180.1196 +      }
180.1197 +    }
180.1198 +  }
180.1199 +
180.1200 +  for(i=0;i<vi->coupling_steps;i++){
180.1201 +    /* make sure coupling a zero and a nonzero channel results in two
180.1202 +       nonzero channels. */
180.1203 +    if(nonzero[vi->coupling_mag[i]] ||
180.1204 +       nonzero[vi->coupling_ang[i]]){
180.1205 +      nonzero[vi->coupling_mag[i]]=1;
180.1206 +      nonzero[vi->coupling_ang[i]]=1;
180.1207 +    }
180.1208 +  }
180.1209 +}
   181.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   181.2 +++ b/libs/vorbis/psy.h	Sun Nov 01 00:36:56 2015 +0200
   181.3 @@ -0,0 +1,154 @@
   181.4 +/********************************************************************
   181.5 + *                                                                  *
   181.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   181.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   181.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   181.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  181.10 + *                                                                  *
  181.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
  181.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  181.13 + *                                                                  *
  181.14 + ********************************************************************
  181.15 +
  181.16 + function: random psychoacoustics (not including preecho)
  181.17 + last mod: $Id: psy.h 16946 2010-03-03 16:12:40Z xiphmont $
  181.18 +
  181.19 + ********************************************************************/
  181.20 +
  181.21 +#ifndef _V_PSY_H_
  181.22 +#define _V_PSY_H_
  181.23 +#include "smallft.h"
  181.24 +
  181.25 +#include "backends.h"
  181.26 +#include "envelope.h"
  181.27 +
  181.28 +#ifndef EHMER_MAX
  181.29 +#define EHMER_MAX 56
  181.30 +#endif
  181.31 +
  181.32 +/* psychoacoustic setup ********************************************/
  181.33 +#define P_BANDS 17      /* 62Hz to 16kHz */
  181.34 +#define P_LEVELS 8      /* 30dB to 100dB */
  181.35 +#define P_LEVEL_0 30.    /* 30 dB */
  181.36 +#define P_NOISECURVES 3
  181.37 +
  181.38 +#define NOISE_COMPAND_LEVELS 40
  181.39 +typedef struct vorbis_info_psy{
  181.40 +  int   blockflag;
  181.41 +
  181.42 +  float ath_adjatt;
  181.43 +  float ath_maxatt;
  181.44 +
  181.45 +  float tone_masteratt[P_NOISECURVES];
  181.46 +  float tone_centerboost;
  181.47 +  float tone_decay;
  181.48 +  float tone_abs_limit;
  181.49 +  float toneatt[P_BANDS];
  181.50 +
  181.51 +  int noisemaskp;
  181.52 +  float noisemaxsupp;
  181.53 +  float noisewindowlo;
  181.54 +  float noisewindowhi;
  181.55 +  int   noisewindowlomin;
  181.56 +  int   noisewindowhimin;
  181.57 +  int   noisewindowfixed;
  181.58 +  float noiseoff[P_NOISECURVES][P_BANDS];
  181.59 +  float noisecompand[NOISE_COMPAND_LEVELS];
  181.60 +
  181.61 +  float max_curve_dB;
  181.62 +
  181.63 +  int normal_p;
  181.64 +  int normal_start;
  181.65 +  int normal_partition;
  181.66 +  double normal_thresh;
  181.67 +} vorbis_info_psy;
  181.68 +
  181.69 +typedef struct{
  181.70 +  int   eighth_octave_lines;
  181.71 +
  181.72 +  /* for block long/short tuning; encode only */
  181.73 +  float preecho_thresh[VE_BANDS];
  181.74 +  float postecho_thresh[VE_BANDS];
  181.75 +  float stretch_penalty;
  181.76 +  float preecho_minenergy;
  181.77 +
  181.78 +  float ampmax_att_per_sec;
  181.79 +
  181.80 +  /* channel coupling config */
  181.81 +  int   coupling_pkHz[PACKETBLOBS];
  181.82 +  int   coupling_pointlimit[2][PACKETBLOBS];
  181.83 +  int   coupling_prepointamp[PACKETBLOBS];
  181.84 +  int   coupling_postpointamp[PACKETBLOBS];
  181.85 +  int   sliding_lowpass[2][PACKETBLOBS];
  181.86 +
  181.87 +} vorbis_info_psy_global;
  181.88 +
  181.89 +typedef struct {
  181.90 +  float ampmax;
  181.91 +  int   channels;
  181.92 +
  181.93 +  vorbis_info_psy_global *gi;
  181.94 +  int   coupling_pointlimit[2][P_NOISECURVES];
  181.95 +} vorbis_look_psy_global;
  181.96 +
  181.97 +
  181.98 +typedef struct {
  181.99 +  int n;
 181.100 +  struct vorbis_info_psy *vi;
 181.101 +
 181.102 +  float ***tonecurves;
 181.103 +  float **noiseoffset;
 181.104 +
 181.105 +  float *ath;
 181.106 +  long  *octave;             /* in n.ocshift format */
 181.107 +  long  *bark;
 181.108 +
 181.109 +  long  firstoc;
 181.110 +  long  shiftoc;
 181.111 +  int   eighth_octave_lines; /* power of two, please */
 181.112 +  int   total_octave_lines;
 181.113 +  long  rate; /* cache it */
 181.114 +
 181.115 +  float m_val; /* Masking compensation value */
 181.116 +
 181.117 +} vorbis_look_psy;
 181.118 +
 181.119 +extern void   _vp_psy_init(vorbis_look_psy *p,vorbis_info_psy *vi,
 181.120 +                           vorbis_info_psy_global *gi,int n,long rate);
 181.121 +extern void   _vp_psy_clear(vorbis_look_psy *p);
 181.122 +extern void  *_vi_psy_dup(void *source);
 181.123 +
 181.124 +extern void   _vi_psy_free(vorbis_info_psy *i);
 181.125 +extern vorbis_info_psy *_vi_psy_copy(vorbis_info_psy *i);
 181.126 +
 181.127 +extern void _vp_noisemask(vorbis_look_psy *p,
 181.128 +                          float *logmdct,
 181.129 +                          float *logmask);
 181.130 +
 181.131 +extern void _vp_tonemask(vorbis_look_psy *p,
 181.132 +                         float *logfft,
 181.133 +                         float *logmask,
 181.134 +                         float global_specmax,
 181.135 +                         float local_specmax);
 181.136 +
 181.137 +extern void _vp_offset_and_mix(vorbis_look_psy *p,
 181.138 +                               float *noise,
 181.139 +                               float *tone,
 181.140 +                               int offset_select,
 181.141 +                               float *logmask,
 181.142 +                               float *mdct,
 181.143 +                               float *logmdct);
 181.144 +
 181.145 +extern float _vp_ampmax_decay(float amp,vorbis_dsp_state *vd);
 181.146 +
 181.147 +extern void _vp_couple_quantize_normalize(int blobno,
 181.148 +                                          vorbis_info_psy_global *g,
 181.149 +                                          vorbis_look_psy *p,
 181.150 +                                          vorbis_info_mapping0 *vi,
 181.151 +                                          float **mdct,
 181.152 +                                          int   **iwork,
 181.153 +                                          int    *nonzero,
 181.154 +                                          int     sliding_lowpass,
 181.155 +                                          int     ch);
 181.156 +
 181.157 +#endif
   182.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   182.2 +++ b/libs/vorbis/registry.c	Sun Nov 01 00:36:56 2015 +0200
   182.3 @@ -0,0 +1,45 @@
   182.4 +/********************************************************************
   182.5 + *                                                                  *
   182.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   182.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   182.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   182.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  182.10 + *                                                                  *
  182.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
  182.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  182.13 + *                                                                  *
  182.14 + ********************************************************************
  182.15 +
  182.16 + function: registry for time, floor, res backends and channel mappings
  182.17 + last mod: $Id: registry.c 16227 2009-07-08 06:58:46Z xiphmont $
  182.18 +
  182.19 + ********************************************************************/
  182.20 +
  182.21 +#include "vorbis/codec.h"
  182.22 +#include "codec_internal.h"
  182.23 +#include "registry.h"
  182.24 +#include "misc.h"
  182.25 +/* seems like major overkill now; the backend numbers will grow into
  182.26 +   the infrastructure soon enough */
  182.27 +
  182.28 +extern const vorbis_func_floor     floor0_exportbundle;
  182.29 +extern const vorbis_func_floor     floor1_exportbundle;
  182.30 +extern const vorbis_func_residue   residue0_exportbundle;
  182.31 +extern const vorbis_func_residue   residue1_exportbundle;
  182.32 +extern const vorbis_func_residue   residue2_exportbundle;
  182.33 +extern const vorbis_func_mapping   mapping0_exportbundle;
  182.34 +
  182.35 +const vorbis_func_floor     *const _floor_P[]={
  182.36 +  &floor0_exportbundle,
  182.37 +  &floor1_exportbundle,
  182.38 +};
  182.39 +
  182.40 +const vorbis_func_residue   *const _residue_P[]={
  182.41 +  &residue0_exportbundle,
  182.42 +  &residue1_exportbundle,
  182.43 +  &residue2_exportbundle,
  182.44 +};
  182.45 +
  182.46 +const vorbis_func_mapping   *const _mapping_P[]={
  182.47 +  &mapping0_exportbundle,
  182.48 +};
   183.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   183.2 +++ b/libs/vorbis/registry.h	Sun Nov 01 00:36:56 2015 +0200
   183.3 @@ -0,0 +1,32 @@
   183.4 +/********************************************************************
   183.5 + *                                                                  *
   183.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   183.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   183.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   183.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  183.10 + *                                                                  *
  183.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007             *
  183.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  183.13 + *                                                                  *
  183.14 + ********************************************************************
  183.15 +
  183.16 + function: registry for time, floor, res backends and channel mappings
  183.17 + last mod: $Id: registry.h 15531 2008-11-24 23:50:06Z xiphmont $
  183.18 +
  183.19 + ********************************************************************/
  183.20 +
  183.21 +#ifndef _V_REG_H_
  183.22 +#define _V_REG_H_
  183.23 +
  183.24 +#define VI_TRANSFORMB 1
  183.25 +#define VI_WINDOWB 1
  183.26 +#define VI_TIMEB 1
  183.27 +#define VI_FLOORB 2
  183.28 +#define VI_RESB 3
  183.29 +#define VI_MAPB 1
  183.30 +
  183.31 +extern const vorbis_func_floor     *const _floor_P[];
  183.32 +extern const vorbis_func_residue   *const _residue_P[];
  183.33 +extern const vorbis_func_mapping   *const _mapping_P[];
  183.34 +
  183.35 +#endif
   184.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   184.2 +++ b/libs/vorbis/res0.c	Sun Nov 01 00:36:56 2015 +0200
   184.3 @@ -0,0 +1,889 @@
   184.4 +/********************************************************************
   184.5 + *                                                                  *
   184.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   184.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   184.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   184.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  184.10 + *                                                                  *
  184.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2010             *
  184.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  184.13 + *                                                                  *
  184.14 + ********************************************************************
  184.15 +
  184.16 + function: residue backend 0, 1 and 2 implementation
  184.17 + last mod: $Id: res0.c 17556 2010-10-21 18:25:19Z tterribe $
  184.18 +
  184.19 + ********************************************************************/
  184.20 +
  184.21 +/* Slow, slow, slow, simpleminded and did I mention it was slow?  The
  184.22 +   encode/decode loops are coded for clarity and performance is not
  184.23 +   yet even a nagging little idea lurking in the shadows.  Oh and BTW,
  184.24 +   it's slow. */
  184.25 +
  184.26 +#include <stdlib.h>
  184.27 +#include <string.h>
  184.28 +#include <math.h>
  184.29 +#include <ogg/ogg.h>
  184.30 +#include "vorbis/codec.h"
  184.31 +#include "codec_internal.h"
  184.32 +#include "registry.h"
  184.33 +#include "codebook.h"
  184.34 +#include "misc.h"
  184.35 +#include "os.h"
  184.36 +
  184.37 +/*#define TRAIN_RES 1*/
  184.38 +/*#define TRAIN_RESAUX 1*/
  184.39 +
  184.40 +#if defined(TRAIN_RES) || defined (TRAIN_RESAUX)
  184.41 +#include <stdio.h>
  184.42 +#endif
  184.43 +
  184.44 +typedef struct {
  184.45 +  vorbis_info_residue0 *info;
  184.46 +
  184.47 +  int         parts;
  184.48 +  int         stages;
  184.49 +  codebook   *fullbooks;
  184.50 +  codebook   *phrasebook;
  184.51 +  codebook ***partbooks;
  184.52 +
  184.53 +  int         partvals;
  184.54 +  int       **decodemap;
  184.55 +
  184.56 +  long      postbits;
  184.57 +  long      phrasebits;
  184.58 +  long      frames;
  184.59 +
  184.60 +#if defined(TRAIN_RES) || defined(TRAIN_RESAUX)
  184.61 +  int        train_seq;
  184.62 +  long      *training_data[8][64];
  184.63 +  float      training_max[8][64];
  184.64 +  float      training_min[8][64];
  184.65 +  float     tmin;
  184.66 +  float     tmax;
  184.67 +  int       submap;
  184.68 +#endif
  184.69 +
  184.70 +} vorbis_look_residue0;
  184.71 +
  184.72 +void res0_free_info(vorbis_info_residue *i){
  184.73 +  vorbis_info_residue0 *info=(vorbis_info_residue0 *)i;
  184.74 +  if(info){
  184.75 +    memset(info,0,sizeof(*info));
  184.76 +    _ogg_free(info);
  184.77 +  }
  184.78 +}
  184.79 +
  184.80 +void res0_free_look(vorbis_look_residue *i){
  184.81 +  int j;
  184.82 +  if(i){
  184.83 +
  184.84 +    vorbis_look_residue0 *look=(vorbis_look_residue0 *)i;
  184.85 +
  184.86 +#ifdef TRAIN_RES
  184.87 +    {
  184.88 +      int j,k,l;
  184.89 +      for(j=0;j<look->parts;j++){
  184.90 +        /*fprintf(stderr,"partition %d: ",j);*/
  184.91 +        for(k=0;k<8;k++)
  184.92 +          if(look->training_data[k][j]){
  184.93 +            char buffer[80];
  184.94 +            FILE *of;
  184.95 +            codebook *statebook=look->partbooks[j][k];
  184.96 +
  184.97 +            /* long and short into the same bucket by current convention */
  184.98 +            sprintf(buffer,"res_sub%d_part%d_pass%d.vqd",look->submap,j,k);
  184.99 +            of=fopen(buffer,"a");
 184.100 +
 184.101 +            for(l=0;l<statebook->entries;l++)
 184.102 +              fprintf(of,"%d:%ld\n",l,look->training_data[k][j][l]);
 184.103 +
 184.104 +            fclose(of);
 184.105 +
 184.106 +            /*fprintf(stderr,"%d(%.2f|%.2f) ",k,
 184.107 +              look->training_min[k][j],look->training_max[k][j]);*/
 184.108 +
 184.109 +            _ogg_free(look->training_data[k][j]);
 184.110 +            look->training_data[k][j]=NULL;
 184.111 +          }
 184.112 +        /*fprintf(stderr,"\n");*/
 184.113 +      }
 184.114 +    }
 184.115 +    fprintf(stderr,"min/max residue: %g::%g\n",look->tmin,look->tmax);
 184.116 +
 184.117 +    /*fprintf(stderr,"residue bit usage %f:%f (%f total)\n",
 184.118 +            (float)look->phrasebits/look->frames,
 184.119 +            (float)look->postbits/look->frames,
 184.120 +            (float)(look->postbits+look->phrasebits)/look->frames);*/
 184.121 +#endif
 184.122 +
 184.123 +
 184.124 +    /*vorbis_info_residue0 *info=look->info;
 184.125 +
 184.126 +    fprintf(stderr,
 184.127 +            "%ld frames encoded in %ld phrasebits and %ld residue bits "
 184.128 +            "(%g/frame) \n",look->frames,look->phrasebits,
 184.129 +            look->resbitsflat,
 184.130 +            (look->phrasebits+look->resbitsflat)/(float)look->frames);
 184.131 +
 184.132 +    for(j=0;j<look->parts;j++){
 184.133 +      long acc=0;
 184.134 +      fprintf(stderr,"\t[%d] == ",j);
 184.135 +      for(k=0;k<look->stages;k++)
 184.136 +        if((info->secondstages[j]>>k)&1){
 184.137 +          fprintf(stderr,"%ld,",look->resbits[j][k]);
 184.138 +          acc+=look->resbits[j][k];
 184.139 +        }
 184.140 +
 184.141 +      fprintf(stderr,":: (%ld vals) %1.2fbits/sample\n",look->resvals[j],
 184.142 +              acc?(float)acc/(look->resvals[j]*info->grouping):0);
 184.143 +    }
 184.144 +    fprintf(stderr,"\n");*/
 184.145 +
 184.146 +    for(j=0;j<look->parts;j++)
 184.147 +      if(look->partbooks[j])_ogg_free(look->partbooks[j]);
 184.148 +    _ogg_free(look->partbooks);
 184.149 +    for(j=0;j<look->partvals;j++)
 184.150 +      _ogg_free(look->decodemap[j]);
 184.151 +    _ogg_free(look->decodemap);
 184.152 +
 184.153 +    memset(look,0,sizeof(*look));
 184.154 +    _ogg_free(look);
 184.155 +  }
 184.156 +}
 184.157 +
 184.158 +static int ilog(unsigned int v){
 184.159 +  int ret=0;
 184.160 +  while(v){
 184.161 +    ret++;
 184.162 +    v>>=1;
 184.163 +  }
 184.164 +  return(ret);
 184.165 +}
 184.166 +
 184.167 +static int icount(unsigned int v){
 184.168 +  int ret=0;
 184.169 +  while(v){
 184.170 +    ret+=v&1;
 184.171 +    v>>=1;
 184.172 +  }
 184.173 +  return(ret);
 184.174 +}
 184.175 +
 184.176 +
 184.177 +void res0_pack(vorbis_info_residue *vr,oggpack_buffer *opb){
 184.178 +  vorbis_info_residue0 *info=(vorbis_info_residue0 *)vr;
 184.179 +  int j,acc=0;
 184.180 +  oggpack_write(opb,info->begin,24);
 184.181 +  oggpack_write(opb,info->end,24);
 184.182 +
 184.183 +  oggpack_write(opb,info->grouping-1,24);  /* residue vectors to group and
 184.184 +                                             code with a partitioned book */
 184.185 +  oggpack_write(opb,info->partitions-1,6); /* possible partition choices */
 184.186 +  oggpack_write(opb,info->groupbook,8);  /* group huffman book */
 184.187 +
 184.188 +  /* secondstages is a bitmask; as encoding progresses pass by pass, a
 184.189 +     bitmask of one indicates this partition class has bits to write
 184.190 +     this pass */
 184.191 +  for(j=0;j<info->partitions;j++){
 184.192 +    if(ilog(info->secondstages[j])>3){
 184.193 +      /* yes, this is a minor hack due to not thinking ahead */
 184.194 +      oggpack_write(opb,info->secondstages[j],3);
 184.195 +      oggpack_write(opb,1,1);
 184.196 +      oggpack_write(opb,info->secondstages[j]>>3,5);
 184.197 +    }else
 184.198 +      oggpack_write(opb,info->secondstages[j],4); /* trailing zero */
 184.199 +    acc+=icount(info->secondstages[j]);
 184.200 +  }
 184.201 +  for(j=0;j<acc;j++)
 184.202 +    oggpack_write(opb,info->booklist[j],8);
 184.203 +
 184.204 +}
 184.205 +
 184.206 +/* vorbis_info is for range checking */
 184.207 +vorbis_info_residue *res0_unpack(vorbis_info *vi,oggpack_buffer *opb){
 184.208 +  int j,acc=0;
 184.209 +  vorbis_info_residue0 *info=_ogg_calloc(1,sizeof(*info));
 184.210 +  codec_setup_info     *ci=vi->codec_setup;
 184.211 +
 184.212 +  info->begin=oggpack_read(opb,24);
 184.213 +  info->end=oggpack_read(opb,24);
 184.214 +  info->grouping=oggpack_read(opb,24)+1;
 184.215 +  info->partitions=oggpack_read(opb,6)+1;
 184.216 +  info->groupbook=oggpack_read(opb,8);
 184.217 +
 184.218 +  /* check for premature EOP */
 184.219 +  if(info->groupbook<0)goto errout;
 184.220 +
 184.221 +  for(j=0;j<info->partitions;j++){
 184.222 +    int cascade=oggpack_read(opb,3);
 184.223 +    int cflag=oggpack_read(opb,1);
 184.224 +    if(cflag<0) goto errout;
 184.225 +    if(cflag){
 184.226 +      int c=oggpack_read(opb,5);
 184.227 +      if(c<0) goto errout;
 184.228 +      cascade|=(c<<3);
 184.229 +    }
 184.230 +    info->secondstages[j]=cascade;
 184.231 +
 184.232 +    acc+=icount(cascade);
 184.233 +  }
 184.234 +  for(j=0;j<acc;j++){
 184.235 +    int book=oggpack_read(opb,8);
 184.236 +    if(book<0) goto errout;
 184.237 +    info->booklist[j]=book;
 184.238 +  }
 184.239 +
 184.240 +  if(info->groupbook>=ci->books)goto errout;
 184.241 +  for(j=0;j<acc;j++){
 184.242 +    if(info->booklist[j]>=ci->books)goto errout;
 184.243 +    if(ci->book_param[info->booklist[j]]->maptype==0)goto errout;
 184.244 +  }
 184.245 +
 184.246 +  /* verify the phrasebook is not specifying an impossible or
 184.247 +     inconsistent partitioning scheme. */
 184.248 +  /* modify the phrasebook ranging check from r16327; an early beta
 184.249 +     encoder had a bug where it used an oversized phrasebook by
 184.250 +     accident.  These files should continue to be playable, but don't
 184.251 +     allow an exploit */
 184.252 +  {
 184.253 +    int entries = ci->book_param[info->groupbook]->entries;
 184.254 +    int dim = ci->book_param[info->groupbook]->dim;
 184.255 +    int partvals = 1;
 184.256 +    if (dim<1) goto errout;
 184.257 +    while(dim>0){
 184.258 +      partvals *= info->partitions;
 184.259 +      if(partvals > entries) goto errout;
 184.260 +      dim--;
 184.261 +    }
 184.262 +    info->partvals = partvals;
 184.263 +  }
 184.264 +
 184.265 +  return(info);
 184.266 + errout:
 184.267 +  res0_free_info(info);
 184.268 +  return(NULL);
 184.269 +}
 184.270 +
 184.271 +vorbis_look_residue *res0_look(vorbis_dsp_state *vd,
 184.272 +                               vorbis_info_residue *vr){
 184.273 +  vorbis_info_residue0 *info=(vorbis_info_residue0 *)vr;
 184.274 +  vorbis_look_residue0 *look=_ogg_calloc(1,sizeof(*look));
 184.275 +  codec_setup_info     *ci=vd->vi->codec_setup;
 184.276 +
 184.277 +  int j,k,acc=0;
 184.278 +  int dim;
 184.279 +  int maxstage=0;
 184.280 +  look->info=info;
 184.281 +
 184.282 +  look->parts=info->partitions;
 184.283 +  look->fullbooks=ci->fullbooks;
 184.284 +  look->phrasebook=ci->fullbooks+info->groupbook;
 184.285 +  dim=look->phrasebook->dim;
 184.286 +
 184.287 +  look->partbooks=_ogg_calloc(look->parts,sizeof(*look->partbooks));
 184.288 +
 184.289 +  for(j=0;j<look->parts;j++){
 184.290 +    int stages=ilog(info->secondstages[j]);
 184.291 +    if(stages){
 184.292 +      if(stages>maxstage)maxstage=stages;
 184.293 +      look->partbooks[j]=_ogg_calloc(stages,sizeof(*look->partbooks[j]));
 184.294 +      for(k=0;k<stages;k++)
 184.295 +        if(info->secondstages[j]&(1<<k)){
 184.296 +          look->partbooks[j][k]=ci->fullbooks+info->booklist[acc++];
 184.297 +#ifdef TRAIN_RES
 184.298 +          look->training_data[k][j]=_ogg_calloc(look->partbooks[j][k]->entries,
 184.299 +                                           sizeof(***look->training_data));
 184.300 +#endif
 184.301 +        }
 184.302 +    }
 184.303 +  }
 184.304 +
 184.305 +  look->partvals=1;
 184.306 +  for(j=0;j<dim;j++)
 184.307 +      look->partvals*=look->parts;
 184.308 +
 184.309 +  look->stages=maxstage;
 184.310 +  look->decodemap=_ogg_malloc(look->partvals*sizeof(*look->decodemap));
 184.311 +  for(j=0;j<look->partvals;j++){
 184.312 +    long val=j;
 184.313 +    long mult=look->partvals/look->parts;
 184.314 +    look->decodemap[j]=_ogg_malloc(dim*sizeof(*look->decodemap[j]));
 184.315 +    for(k=0;k<dim;k++){
 184.316 +      long deco=val/mult;
 184.317 +      val-=deco*mult;
 184.318 +      mult/=look->parts;
 184.319 +      look->decodemap[j][k]=deco;
 184.320 +    }
 184.321 +  }
 184.322 +#if defined(TRAIN_RES) || defined (TRAIN_RESAUX)
 184.323 +  {
 184.324 +    static int train_seq=0;
 184.325 +    look->train_seq=train_seq++;
 184.326 +  }
 184.327 +#endif
 184.328 +  return(look);
 184.329 +}
 184.330 +
 184.331 +/* break an abstraction and copy some code for performance purposes */
 184.332 +static int local_book_besterror(codebook *book,int *a){
 184.333 +  int dim=book->dim;
 184.334 +  int i,j,o;
 184.335 +  int minval=book->minval;
 184.336 +  int del=book->delta;
 184.337 +  int qv=book->quantvals;
 184.338 +  int ze=(qv>>1);
 184.339 +  int index=0;
 184.340 +  /* assumes integer/centered encoder codebook maptype 1 no more than dim 8 */
 184.341 +  int p[8]={0,0,0,0,0,0,0,0};
 184.342 +
 184.343 +  if(del!=1){
 184.344 +    for(i=0,o=dim;i<dim;i++){
 184.345 +      int v = (a[--o]-minval+(del>>1))/del;
 184.346 +      int m = (v<ze ? ((ze-v)<<1)-1 : ((v-ze)<<1));
 184.347 +      index = index*qv+ (m<0?0:(m>=qv?qv-1:m));
 184.348 +      p[o]=v*del+minval;
 184.349 +    }
 184.350 +  }else{
 184.351 +    for(i=0,o=dim;i<dim;i++){
 184.352 +      int v = a[--o]-minval;
 184.353 +      int m = (v<ze ? ((ze-v)<<1)-1 : ((v-ze)<<1));
 184.354 +      index = index*qv+ (m<0?0:(m>=qv?qv-1:m));
 184.355 +      p[o]=v*del+minval;
 184.356 +    }
 184.357 +  }
 184.358 +
 184.359 +  if(book->c->lengthlist[index]<=0){
 184.360 +    const static_codebook *c=book->c;
 184.361 +    int best=-1;
 184.362 +    /* assumes integer/centered encoder codebook maptype 1 no more than dim 8 */
 184.363 +    int e[8]={0,0,0,0,0,0,0,0};
 184.364 +    int maxval = book->minval + book->delta*(book->quantvals-1);
 184.365 +    for(i=0;i<book->entries;i++){
 184.366 +      if(c->lengthlist[i]>0){
 184.367 +        int this=0;
 184.368 +        for(j=0;j<dim;j++){
 184.369 +          int val=(e[j]-a[j]);
 184.370 +          this+=val*val;
 184.371 +        }
 184.372 +        if(best==-1 || this<best){
 184.373 +          memcpy(p,e,sizeof(p));
 184.374 +          best=this;
 184.375 +          index=i;
 184.376 +        }
 184.377 +      }
 184.378 +      /* assumes the value patterning created by the tools in vq/ */
 184.379 +      j=0;
 184.380 +      while(e[j]>=maxval)
 184.381 +        e[j++]=0;
 184.382 +      if(e[j]>=0)
 184.383 +        e[j]+=book->delta;
 184.384 +      e[j]= -e[j];
 184.385 +    }
 184.386 +  }
 184.387 +
 184.388 +  if(index>-1){
 184.389 +    for(i=0;i<dim;i++)
 184.390 +      *a++ -= p[i];
 184.391 +  }
 184.392 +
 184.393 +  return(index);
 184.394 +}
 184.395 +
 184.396 +static int _encodepart(oggpack_buffer *opb,int *vec, int n,
 184.397 +                       codebook *book,long *acc){
 184.398 +  int i,bits=0;
 184.399 +  int dim=book->dim;
 184.400 +  int step=n/dim;
 184.401 +
 184.402 +  for(i=0;i<step;i++){
 184.403 +    int entry=local_book_besterror(book,vec+i*dim);
 184.404 +
 184.405 +#ifdef TRAIN_RES
 184.406 +    if(entry>=0)
 184.407 +      acc[entry]++;
 184.408 +#endif
 184.409 +
 184.410 +    bits+=vorbis_book_encode(book,entry,opb);
 184.411 +
 184.412 +  }
 184.413 +
 184.414 +  return(bits);
 184.415 +}
 184.416 +
 184.417 +static long **_01class(vorbis_block *vb,vorbis_look_residue *vl,
 184.418 +                       int **in,int ch){
 184.419 +  long i,j,k;
 184.420 +  vorbis_look_residue0 *look=(vorbis_look_residue0 *)vl;
 184.421 +  vorbis_info_residue0 *info=look->info;
 184.422 +
 184.423 +  /* move all this setup out later */
 184.424 +  int samples_per_partition=info->grouping;
 184.425 +  int possible_partitions=info->partitions;
 184.426 +  int n=info->end-info->begin;
 184.427 +
 184.428 +  int partvals=n/samples_per_partition;
 184.429 +  long **partword=_vorbis_block_alloc(vb,ch*sizeof(*partword));
 184.430 +  float scale=100./samples_per_partition;
 184.431 +
 184.432 +  /* we find the partition type for each partition of each
 184.433 +     channel.  We'll go back and do the interleaved encoding in a
 184.434 +     bit.  For now, clarity */
 184.435 +
 184.436 +  for(i=0;i<ch;i++){
 184.437 +    partword[i]=_vorbis_block_alloc(vb,n/samples_per_partition*sizeof(*partword[i]));
 184.438 +    memset(partword[i],0,n/samples_per_partition*sizeof(*partword[i]));
 184.439 +  }
 184.440 +
 184.441 +  for(i=0;i<partvals;i++){
 184.442 +    int offset=i*samples_per_partition+info->begin;
 184.443 +    for(j=0;j<ch;j++){
 184.444 +      int max=0;
 184.445 +      int ent=0;
 184.446 +      for(k=0;k<samples_per_partition;k++){
 184.447 +        if(abs(in[j][offset+k])>max)max=abs(in[j][offset+k]);
 184.448 +        ent+=abs(in[j][offset+k]);
 184.449 +      }
 184.450 +      ent*=scale;
 184.451 +
 184.452 +      for(k=0;k<possible_partitions-1;k++)
 184.453 +        if(max<=info->classmetric1[k] &&
 184.454 +           (info->classmetric2[k]<0 || ent<info->classmetric2[k]))
 184.455 +          break;
 184.456 +
 184.457 +      partword[j][i]=k;
 184.458 +    }
 184.459 +  }
 184.460 +
 184.461 +#ifdef TRAIN_RESAUX
 184.462 +  {
 184.463 +    FILE *of;
 184.464 +    char buffer[80];
 184.465 +
 184.466 +    for(i=0;i<ch;i++){
 184.467 +      sprintf(buffer,"resaux_%d.vqd",look->train_seq);
 184.468 +      of=fopen(buffer,"a");
 184.469 +      for(j=0;j<partvals;j++)
 184.470 +        fprintf(of,"%ld, ",partword[i][j]);
 184.471 +      fprintf(of,"\n");
 184.472 +      fclose(of);
 184.473 +    }
 184.474 +  }
 184.475 +#endif
 184.476 +  look->frames++;
 184.477 +
 184.478 +  return(partword);
 184.479 +}
 184.480 +
 184.481 +/* designed for stereo or other modes where the partition size is an
 184.482 +   integer multiple of the number of channels encoded in the current
 184.483 +   submap */
 184.484 +static long **_2class(vorbis_block *vb,vorbis_look_residue *vl,int **in,
 184.485 +                      int ch){
 184.486 +  long i,j,k,l;
 184.487 +  vorbis_look_residue0 *look=(vorbis_look_residue0 *)vl;
 184.488 +  vorbis_info_residue0 *info=look->info;
 184.489 +
 184.490 +  /* move all this setup out later */
 184.491 +  int samples_per_partition=info->grouping;
 184.492 +  int possible_partitions=info->partitions;
 184.493 +  int n=info->end-info->begin;
 184.494 +
 184.495 +  int partvals=n/samples_per_partition;
 184.496 +  long **partword=_vorbis_block_alloc(vb,sizeof(*partword));
 184.497 +
 184.498 +#if defined(TRAIN_RES) || defined (TRAIN_RESAUX)
 184.499 +  FILE *of;
 184.500 +  char buffer[80];
 184.501 +#endif
 184.502 +
 184.503 +  partword[0]=_vorbis_block_alloc(vb,partvals*sizeof(*partword[0]));
 184.504 +  memset(partword[0],0,partvals*sizeof(*partword[0]));
 184.505 +
 184.506 +  for(i=0,l=info->begin/ch;i<partvals;i++){
 184.507 +    int magmax=0;
 184.508 +    int angmax=0;
 184.509 +    for(j=0;j<samples_per_partition;j+=ch){
 184.510 +      if(abs(in[0][l])>magmax)magmax=abs(in[0][l]);
 184.511 +      for(k=1;k<ch;k++)
 184.512 +        if(abs(in[k][l])>angmax)angmax=abs(in[k][l]);
 184.513 +      l++;
 184.514 +    }
 184.515 +
 184.516 +    for(j=0;j<possible_partitions-1;j++)
 184.517 +      if(magmax<=info->classmetric1[j] &&
 184.518 +         angmax<=info->classmetric2[j])
 184.519 +        break;
 184.520 +
 184.521 +    partword[0][i]=j;
 184.522 +
 184.523 +  }
 184.524 +
 184.525 +#ifdef TRAIN_RESAUX
 184.526 +  sprintf(buffer,"resaux_%d.vqd",look->train_seq);
 184.527 +  of=fopen(buffer,"a");
 184.528 +  for(i=0;i<partvals;i++)
 184.529 +    fprintf(of,"%ld, ",partword[0][i]);
 184.530 +  fprintf(of,"\n");
 184.531 +  fclose(of);
 184.532 +#endif
 184.533 +
 184.534 +  look->frames++;
 184.535 +
 184.536 +  return(partword);
 184.537 +}
 184.538 +
 184.539 +static int _01forward(oggpack_buffer *opb,
 184.540 +                      vorbis_block *vb,vorbis_look_residue *vl,
 184.541 +                      int **in,int ch,
 184.542 +                      long **partword,
 184.543 +                      int (*encode)(oggpack_buffer *,int *,int,
 184.544 +                                    codebook *,long *),
 184.545 +                      int submap){
 184.546 +  long i,j,k,s;
 184.547 +  vorbis_look_residue0 *look=(vorbis_look_residue0 *)vl;
 184.548 +  vorbis_info_residue0 *info=look->info;
 184.549 +
 184.550 +#ifdef TRAIN_RES
 184.551 +  look->submap=submap;
 184.552 +#endif
 184.553 +
 184.554 +  /* move all this setup out later */
 184.555 +  int samples_per_partition=info->grouping;
 184.556 +  int possible_partitions=info->partitions;
 184.557 +  int partitions_per_word=look->phrasebook->dim;
 184.558 +  int n=info->end-info->begin;
 184.559 +
 184.560 +  int partvals=n/samples_per_partition;
 184.561 +  long resbits[128];
 184.562 +  long resvals[128];
 184.563 +
 184.564 +#ifdef TRAIN_RES
 184.565 +  for(i=0;i<ch;i++)
 184.566 +    for(j=info->begin;j<info->end;j++){
 184.567 +      if(in[i][j]>look->tmax)look->tmax=in[i][j];
 184.568 +      if(in[i][j]<look->tmin)look->tmin=in[i][j];
 184.569 +    }
 184.570 +#endif
 184.571 +
 184.572 +  memset(resbits,0,sizeof(resbits));
 184.573 +  memset(resvals,0,sizeof(resvals));
 184.574 +
 184.575 +  /* we code the partition words for each channel, then the residual
 184.576 +     words for a partition per channel until we've written all the
 184.577 +     residual words for that partition word.  Then write the next
 184.578 +     partition channel words... */
 184.579 +
 184.580 +  for(s=0;s<look->stages;s++){
 184.581 +
 184.582 +    for(i=0;i<partvals;){
 184.583 +
 184.584 +      /* first we encode a partition codeword for each channel */
 184.585 +      if(s==0){
 184.586 +        for(j=0;j<ch;j++){
 184.587 +          long val=partword[j][i];
 184.588 +          for(k=1;k<partitions_per_word;k++){
 184.589 +            val*=possible_partitions;
 184.590 +            if(i+k<partvals)
 184.591 +              val+=partword[j][i+k];
 184.592 +          }
 184.593 +
 184.594 +          /* training hack */
 184.595 +          if(val<look->phrasebook->entries)
 184.596 +            look->phrasebits+=vorbis_book_encode(look->phrasebook,val,opb);
 184.597 +#if 0 /*def TRAIN_RES*/
 184.598 +          else
 184.599 +            fprintf(stderr,"!");
 184.600 +#endif
 184.601 +
 184.602 +        }
 184.603 +      }
 184.604 +
 184.605 +      /* now we encode interleaved residual values for the partitions */
 184.606 +      for(k=0;k<partitions_per_word && i<partvals;k++,i++){
 184.607 +        long offset=i*samples_per_partition+info->begin;
 184.608 +
 184.609 +        for(j=0;j<ch;j++){
 184.610 +          if(s==0)resvals[partword[j][i]]+=samples_per_partition;
 184.611 +          if(info->secondstages[partword[j][i]]&(1<<s)){
 184.612 +            codebook *statebook=look->partbooks[partword[j][i]][s];
 184.613 +            if(statebook){
 184.614 +              int ret;
 184.615 +              long *accumulator=NULL;
 184.616 +
 184.617 +#ifdef TRAIN_RES
 184.618 +              accumulator=look->training_data[s][partword[j][i]];
 184.619 +              {
 184.620 +                int l;
 184.621 +                int *samples=in[j]+offset;
 184.622 +                for(l=0;l<samples_per_partition;l++){
 184.623 +                  if(samples[l]<look->training_min[s][partword[j][i]])
 184.624 +                    look->training_min[s][partword[j][i]]=samples[l];
 184.625 +                  if(samples[l]>look->training_max[s][partword[j][i]])
 184.626 +                    look->training_max[s][partword[j][i]]=samples[l];
 184.627 +                }
 184.628 +              }
 184.629 +#endif
 184.630 +
 184.631 +              ret=encode(opb,in[j]+offset,samples_per_partition,
 184.632 +                         statebook,accumulator);
 184.633 +
 184.634 +              look->postbits+=ret;
 184.635 +              resbits[partword[j][i]]+=ret;
 184.636 +            }
 184.637 +          }
 184.638 +        }
 184.639 +      }
 184.640 +    }
 184.641 +  }
 184.642 +
 184.643 +  /*{
 184.644 +    long total=0;
 184.645 +    long totalbits=0;
 184.646 +    fprintf(stderr,"%d :: ",vb->mode);
 184.647 +    for(k=0;k<possible_partitions;k++){
 184.648 +    fprintf(stderr,"%ld/%1.2g, ",resvals[k],(float)resbits[k]/resvals[k]);
 184.649 +    total+=resvals[k];
 184.650 +    totalbits+=resbits[k];
 184.651 +    }
 184.652 +
 184.653 +    fprintf(stderr,":: %ld:%1.2g\n",total,(double)totalbits/total);
 184.654 +    }*/
 184.655 +
 184.656 +  return(0);
 184.657 +}
 184.658 +
 184.659 +/* a truncated packet here just means 'stop working'; it's not an error */
 184.660 +static int _01inverse(vorbis_block *vb,vorbis_look_residue *vl,
 184.661 +                      float **in,int ch,
 184.662 +                      long (*decodepart)(codebook *, float *,
 184.663 +                                         oggpack_buffer *,int)){
 184.664 +
 184.665 +  long i,j,k,l,s;
 184.666 +  vorbis_look_residue0 *look=(vorbis_look_residue0 *)vl;
 184.667 +  vorbis_info_residue0 *info=look->info;
 184.668 +
 184.669 +  /* move all this setup out later */
 184.670 +  int samples_per_partition=info->grouping;
 184.671 +  int partitions_per_word=look->phrasebook->dim;
 184.672 +  int max=vb->pcmend>>1;
 184.673 +  int end=(info->end<max?info->end:max);
 184.674 +  int n=end-info->begin;
 184.675 +
 184.676 +  if(n>0){
 184.677 +    int partvals=n/samples_per_partition;
 184.678 +    int partwords=(partvals+partitions_per_word-1)/partitions_per_word;
 184.679 +    int ***partword=alloca(ch*sizeof(*partword));
 184.680 +
 184.681 +    for(j=0;j<ch;j++)
 184.682 +      partword[j]=_vorbis_block_alloc(vb,partwords*sizeof(*partword[j]));
 184.683 +
 184.684 +    for(s=0;s<look->stages;s++){
 184.685 +
 184.686 +      /* each loop decodes on partition codeword containing
 184.687 +         partitions_per_word partitions */
 184.688 +      for(i=0,l=0;i<partvals;l++){
 184.689 +        if(s==0){
 184.690 +          /* fetch the partition word for each channel */
 184.691 +          for(j=0;j<ch;j++){
 184.692 +            int temp=vorbis_book_decode(look->phrasebook,&vb->opb);
 184.693 +
 184.694 +            if(temp==-1 || temp>=info->partvals)goto eopbreak;
 184.695 +            partword[j][l]=look->decodemap[temp];
 184.696 +            if(partword[j][l]==NULL)goto errout;
 184.697 +          }
 184.698 +        }
 184.699 +
 184.700 +        /* now we decode residual values for the partitions */
 184.701 +        for(k=0;k<partitions_per_word && i<partvals;k++,i++)
 184.702 +          for(j=0;j<ch;j++){
 184.703 +            long offset=info->begin+i*samples_per_partition;
 184.704 +            if(info->secondstages[partword[j][l][k]]&(1<<s)){
 184.705 +              codebook *stagebook=look->partbooks[partword[j][l][k]][s];
 184.706 +              if(stagebook){
 184.707 +                if(decodepart(stagebook,in[j]+offset,&vb->opb,
 184.708 +                              samples_per_partition)==-1)goto eopbreak;
 184.709 +              }
 184.710 +            }
 184.711 +          }
 184.712 +      }
 184.713 +    }
 184.714 +  }
 184.715 + errout:
 184.716 + eopbreak:
 184.717 +  return(0);
 184.718 +}
 184.719 +
 184.720 +int res0_inverse(vorbis_block *vb,vorbis_look_residue *vl,
 184.721 +                 float **in,int *nonzero,int ch){
 184.722 +  int i,used=0;
 184.723 +  for(i=0;i<ch;i++)
 184.724 +    if(nonzero[i])
 184.725 +      in[used++]=in[i];
 184.726 +  if(used)
 184.727 +    return(_01inverse(vb,vl,in,used,vorbis_book_decodevs_add));
 184.728 +  else
 184.729 +    return(0);
 184.730 +}
 184.731 +
 184.732 +int res1_forward(oggpack_buffer *opb,vorbis_block *vb,vorbis_look_residue *vl,
 184.733 +                 int **in,int *nonzero,int ch, long **partword, int submap){
 184.734 +  int i,used=0;
 184.735 +  for(i=0;i<ch;i++)
 184.736 +    if(nonzero[i])
 184.737 +      in[used++]=in[i];
 184.738 +
 184.739 +  if(used){
 184.740 +    return _01forward(opb,vb,vl,in,used,partword,_encodepart,submap);
 184.741 +  }else{
 184.742 +    return(0);
 184.743 +  }
 184.744 +}
 184.745 +
 184.746 +long **res1_class(vorbis_block *vb,vorbis_look_residue *vl,
 184.747 +                  int **in,int *nonzero,int ch){
 184.748 +  int i,used=0;
 184.749 +  for(i=0;i<ch;i++)
 184.750 +    if(nonzero[i])
 184.751 +      in[used++]=in[i];
 184.752 +  if(used)
 184.753 +    return(_01class(vb,vl,in,used));
 184.754 +  else
 184.755 +    return(0);
 184.756 +}
 184.757 +
 184.758 +int res1_inverse(vorbis_block *vb,vorbis_look_residue *vl,
 184.759 +                 float **in,int *nonzero,int ch){
 184.760 +  int i,used=0;
 184.761 +  for(i=0;i<ch;i++)
 184.762 +    if(nonzero[i])
 184.763 +      in[used++]=in[i];
 184.764 +  if(used)
 184.765 +    return(_01inverse(vb,vl,in,used,vorbis_book_decodev_add));
 184.766 +  else
 184.767 +    return(0);
 184.768 +}
 184.769 +
 184.770 +long **res2_class(vorbis_block *vb,vorbis_look_residue *vl,
 184.771 +                  int **in,int *nonzero,int ch){
 184.772 +  int i,used=0;
 184.773 +  for(i=0;i<ch;i++)
 184.774 +    if(nonzero[i])used++;
 184.775 +  if(used)
 184.776 +    return(_2class(vb,vl,in,ch));
 184.777 +  else
 184.778 +    return(0);
 184.779 +}
 184.780 +
 184.781 +/* res2 is slightly more different; all the channels are interleaved
 184.782 +   into a single vector and encoded. */
 184.783 +
 184.784 +int res2_forward(oggpack_buffer *opb,
 184.785 +                 vorbis_block *vb,vorbis_look_residue *vl,
 184.786 +                 int **in,int *nonzero,int ch, long **partword,int submap){
 184.787 +  long i,j,k,n=vb->pcmend/2,used=0;
 184.788 +
 184.789 +  /* don't duplicate the code; use a working vector hack for now and
 184.790 +     reshape ourselves into a single channel res1 */
 184.791 +  /* ugly; reallocs for each coupling pass :-( */
 184.792 +  int *work=_vorbis_block_alloc(vb,ch*n*sizeof(*work));
 184.793 +  for(i=0;i<ch;i++){
 184.794 +    int *pcm=in[i];
 184.795 +    if(nonzero[i])used++;
 184.796 +    for(j=0,k=i;j<n;j++,k+=ch)
 184.797 +      work[k]=pcm[j];
 184.798 +  }
 184.799 +
 184.800 +  if(used){
 184.801 +    return _01forward(opb,vb,vl,&work,1,partword,_encodepart,submap);
 184.802 +  }else{
 184.803 +    return(0);
 184.804 +  }
 184.805 +}
 184.806 +
 184.807 +/* duplicate code here as speed is somewhat more important */
 184.808 +int res2_inverse(vorbis_block *vb,vorbis_look_residue *vl,
 184.809 +                 float **in,int *nonzero,int ch){
 184.810 +  long i,k,l,s;
 184.811 +  vorbis_look_residue0 *look=(vorbis_look_residue0 *)vl;
 184.812 +  vorbis_info_residue0 *info=look->info;
 184.813 +
 184.814 +  /* move all this setup out later */
 184.815 +  int samples_per_partition=info->grouping;
 184.816 +  int partitions_per_word=look->phrasebook->dim;
 184.817 +  int max=(vb->pcmend*ch)>>1;
 184.818 +  int end=(info->end<max?info->end:max);
 184.819 +  int n=end-info->begin;
 184.820 +
 184.821 +  if(n>0){
 184.822 +    int partvals=n/samples_per_partition;
 184.823 +    int partwords=(partvals+partitions_per_word-1)/partitions_per_word;
 184.824 +    int **partword=_vorbis_block_alloc(vb,partwords*sizeof(*partword));
 184.825 +
 184.826 +    for(i=0;i<ch;i++)if(nonzero[i])break;
 184.827 +    if(i==ch)return(0); /* no nonzero vectors */
 184.828 +
 184.829 +    for(s=0;s<look->stages;s++){
 184.830 +      for(i=0,l=0;i<partvals;l++){
 184.831 +
 184.832 +        if(s==0){
 184.833 +          /* fetch the partition word */
 184.834 +          int temp=vorbis_book_decode(look->phrasebook,&vb->opb);
 184.835 +          if(temp==-1 || temp>=info->partvals)goto eopbreak;
 184.836 +          partword[l]=look->decodemap[temp];
 184.837 +          if(partword[l]==NULL)goto errout;
 184.838 +        }
 184.839 +
 184.840 +        /* now we decode residual values for the partitions */
 184.841 +        for(k=0;k<partitions_per_word && i<partvals;k++,i++)
 184.842 +          if(info->secondstages[partword[l][k]]&(1<<s)){
 184.843 +            codebook *stagebook=look->partbooks[partword[l][k]][s];
 184.844 +
 184.845 +            if(stagebook){
 184.846 +              if(vorbis_book_decodevv_add(stagebook,in,
 184.847 +                                          i*samples_per_partition+info->begin,ch,
 184.848 +                                          &vb->opb,samples_per_partition)==-1)
 184.849 +                goto eopbreak;
 184.850 +            }
 184.851 +          }
 184.852 +      }
 184.853 +    }
 184.854 +  }
 184.855 + errout:
 184.856 + eopbreak:
 184.857 +  return(0);
 184.858 +}
 184.859 +
 184.860 +
 184.861 +const vorbis_func_residue residue0_exportbundle={
 184.862 +  NULL,
 184.863 +  &res0_unpack,
 184.864 +  &res0_look,
 184.865 +  &res0_free_info,
 184.866 +  &res0_free_look,
 184.867 +  NULL,
 184.868 +  NULL,
 184.869 +  &res0_inverse
 184.870 +};
 184.871 +
 184.872 +const vorbis_func_residue residue1_exportbundle={
 184.873 +  &res0_pack,
 184.874 +  &res0_unpack,
 184.875 +  &res0_look,
 184.876 +  &res0_free_info,
 184.877 +  &res0_free_look,
 184.878 +  &res1_class,
 184.879 +  &res1_forward,
 184.880 +  &res1_inverse
 184.881 +};
 184.882 +
 184.883 +const vorbis_func_residue residue2_exportbundle={
 184.884 +  &res0_pack,
 184.885 +  &res0_unpack,
 184.886 +  &res0_look,
 184.887 +  &res0_free_info,
 184.888 +  &res0_free_look,
 184.889 +  &res2_class,
 184.890 +  &res2_forward,
 184.891 +  &res2_inverse
 184.892 +};
   185.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   185.2 +++ b/libs/vorbis/scales.h	Sun Nov 01 00:36:56 2015 +0200
   185.3 @@ -0,0 +1,90 @@
   185.4 +/********************************************************************
   185.5 + *                                                                  *
   185.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   185.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   185.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   185.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  185.10 + *                                                                  *
  185.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
  185.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  185.13 + *                                                                  *
  185.14 + ********************************************************************
  185.15 +
  185.16 + function: linear scale -> dB, Bark and Mel scales
  185.17 + last mod: $Id: scales.h 16227 2009-07-08 06:58:46Z xiphmont $
  185.18 +
  185.19 + ********************************************************************/
  185.20 +
  185.21 +#ifndef _V_SCALES_H_
  185.22 +#define _V_SCALES_H_
  185.23 +
  185.24 +#include <math.h>
  185.25 +#include "os.h"
  185.26 +
  185.27 +#ifdef _MSC_VER
  185.28 +/* MS Visual Studio doesn't have C99 inline keyword. */
  185.29 +#define inline __inline
  185.30 +#endif
  185.31 +
  185.32 +/* 20log10(x) */
  185.33 +#define VORBIS_IEEE_FLOAT32 1
  185.34 +#ifdef VORBIS_IEEE_FLOAT32
  185.35 +
  185.36 +static inline float unitnorm(float x){
  185.37 +  union {
  185.38 +    ogg_uint32_t i;
  185.39 +    float f;
  185.40 +  } ix;
  185.41 +  ix.f = x;
  185.42 +  ix.i = (ix.i & 0x80000000U) | (0x3f800000U);
  185.43 +  return ix.f;
  185.44 +}
  185.45 +
  185.46 +/* Segher was off (too high) by ~ .3 decibel.  Center the conversion correctly. */
  185.47 +static inline float todB(const float *x){
  185.48 +  union {
  185.49 +    ogg_uint32_t i;
  185.50 +    float f;
  185.51 +  } ix;
  185.52 +  ix.f = *x;
  185.53 +  ix.i = ix.i&0x7fffffff;
  185.54 +  return (float)(ix.i * 7.17711438e-7f -764.6161886f);
  185.55 +}
  185.56 +
  185.57 +#define todB_nn(x) todB(x)
  185.58 +
  185.59 +#else
  185.60 +
  185.61 +static float unitnorm(float x){
  185.62 +  if(x<0)return(-1.f);
  185.63 +  return(1.f);
  185.64 +}
  185.65 +
  185.66 +#define todB(x)   (*(x)==0?-400.f:log(*(x)**(x))*4.34294480f)
  185.67 +#define todB_nn(x)   (*(x)==0.f?-400.f:log(*(x))*8.6858896f)
  185.68 +
  185.69 +#endif
  185.70 +
  185.71 +#define fromdB(x) (exp((x)*.11512925f))
  185.72 +
  185.73 +/* The bark scale equations are approximations, since the original
  185.74 +   table was somewhat hand rolled.  The below are chosen to have the
  185.75 +   best possible fit to the rolled tables, thus their somewhat odd
  185.76 +   appearance (these are more accurate and over a longer range than
  185.77 +   the oft-quoted bark equations found in the texts I have).  The
  185.78 +   approximations are valid from 0 - 30kHz (nyquist) or so.
  185.79 +
  185.80 +   all f in Hz, z in Bark */
  185.81 +
  185.82 +#define toBARK(n)   (13.1f*atan(.00074f*(n))+2.24f*atan((n)*(n)*1.85e-8f)+1e-4f*(n))
  185.83 +#define fromBARK(z) (102.f*(z)-2.f*pow(z,2.f)+.4f*pow(z,3.f)+pow(1.46f,z)-1.f)
  185.84 +#define toMEL(n)    (log(1.f+(n)*.001f)*1442.695f)
  185.85 +#define fromMEL(m)  (1000.f*exp((m)/1442.695f)-1000.f)
  185.86 +
  185.87 +/* Frequency to octave.  We arbitrarily declare 63.5 Hz to be octave
  185.88 +   0.0 */
  185.89 +
  185.90 +#define toOC(n)     (log(n)*1.442695f-5.965784f)
  185.91 +#define fromOC(o)   (exp(((o)+5.965784f)*.693147f))
  185.92 +
  185.93 +#endif
   186.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   186.2 +++ b/libs/vorbis/sharedbook.c	Sun Nov 01 00:36:56 2015 +0200
   186.3 @@ -0,0 +1,579 @@
   186.4 +/********************************************************************
   186.5 + *                                                                  *
   186.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   186.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   186.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   186.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  186.10 + *                                                                  *
  186.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
  186.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  186.13 + *                                                                  *
  186.14 + ********************************************************************
  186.15 +
  186.16 + function: basic shared codebook operations
  186.17 + last mod: $Id: sharedbook.c 17030 2010-03-25 06:52:55Z xiphmont $
  186.18 +
  186.19 + ********************************************************************/
  186.20 +
  186.21 +#include <stdlib.h>
  186.22 +#include <math.h>
  186.23 +#include <string.h>
  186.24 +#include <ogg/ogg.h>
  186.25 +#include "os.h"
  186.26 +#include "misc.h"
  186.27 +#include "vorbis/codec.h"
  186.28 +#include "codebook.h"
  186.29 +#include "scales.h"
  186.30 +
  186.31 +/**** pack/unpack helpers ******************************************/
  186.32 +int _ilog(unsigned int v){
  186.33 +  int ret=0;
  186.34 +  while(v){
  186.35 +    ret++;
  186.36 +    v>>=1;
  186.37 +  }
  186.38 +  return(ret);
  186.39 +}
  186.40 +
  186.41 +/* 32 bit float (not IEEE; nonnormalized mantissa +
  186.42 +   biased exponent) : neeeeeee eeemmmmm mmmmmmmm mmmmmmmm
  186.43 +   Why not IEEE?  It's just not that important here. */
  186.44 +
  186.45 +#define VQ_FEXP 10
  186.46 +#define VQ_FMAN 21
  186.47 +#define VQ_FEXP_BIAS 768 /* bias toward values smaller than 1. */
  186.48 +
  186.49 +/* doesn't currently guard under/overflow */
  186.50 +long _float32_pack(float val){
  186.51 +  int sign=0;
  186.52 +  long exp;
  186.53 +  long mant;
  186.54 +  if(val<0){
  186.55 +    sign=0x80000000;
  186.56 +    val= -val;
  186.57 +  }
  186.58 +  exp= floor(log(val)/log(2.f)+.001); /*+epsilon*/
  186.59 +  mant=rint(ldexp(val,(VQ_FMAN-1)-exp));
  186.60 +  exp=(exp+VQ_FEXP_BIAS)<<VQ_FMAN;
  186.61 +
  186.62 +  return(sign|exp|mant);
  186.63 +}
  186.64 +
  186.65 +float _float32_unpack(long val){
  186.66 +  double mant=val&0x1fffff;
  186.67 +  int    sign=val&0x80000000;
  186.68 +  long   exp =(val&0x7fe00000L)>>VQ_FMAN;
  186.69 +  if(sign)mant= -mant;
  186.70 +  return(ldexp(mant,exp-(VQ_FMAN-1)-VQ_FEXP_BIAS));
  186.71 +}
  186.72 +
  186.73 +/* given a list of word lengths, generate a list of codewords.  Works
  186.74 +   for length ordered or unordered, always assigns the lowest valued
  186.75 +   codewords first.  Extended to handle unused entries (length 0) */
  186.76 +ogg_uint32_t *_make_words(long *l,long n,long sparsecount){
  186.77 +  long i,j,count=0;
  186.78 +  ogg_uint32_t marker[33];
  186.79 +  ogg_uint32_t *r=_ogg_malloc((sparsecount?sparsecount:n)*sizeof(*r));
  186.80 +  memset(marker,0,sizeof(marker));
  186.81 +
  186.82 +  for(i=0;i<n;i++){
  186.83 +    long length=l[i];
  186.84 +    if(length>0){
  186.85 +      ogg_uint32_t entry=marker[length];
  186.86 +
  186.87 +      /* when we claim a node for an entry, we also claim the nodes
  186.88 +         below it (pruning off the imagined tree that may have dangled
  186.89 +         from it) as well as blocking the use of any nodes directly
  186.90 +         above for leaves */
  186.91 +
  186.92 +      /* update ourself */
  186.93 +      if(length<32 && (entry>>length)){
  186.94 +        /* error condition; the lengths must specify an overpopulated tree */
  186.95 +        _ogg_free(r);
  186.96 +        return(NULL);
  186.97 +      }
  186.98 +      r[count++]=entry;
  186.99 +
 186.100 +      /* Look to see if the next shorter marker points to the node
 186.101 +         above. if so, update it and repeat.  */
 186.102 +      {
 186.103 +        for(j=length;j>0;j--){
 186.104 +
 186.105 +          if(marker[j]&1){
 186.106 +            /* have to jump branches */
 186.107 +            if(j==1)
 186.108 +              marker[1]++;
 186.109 +            else
 186.110 +              marker[j]=marker[j-1]<<1;
 186.111 +            break; /* invariant says next upper marker would already
 186.112 +                      have been moved if it was on the same path */
 186.113 +          }
 186.114 +          marker[j]++;
 186.115 +        }
 186.116 +      }
 186.117 +
 186.118 +      /* prune the tree; the implicit invariant says all the longer
 186.119 +         markers were dangling from our just-taken node.  Dangle them
 186.120 +         from our *new* node. */
 186.121 +      for(j=length+1;j<33;j++)
 186.122 +        if((marker[j]>>1) == entry){
 186.123 +          entry=marker[j];
 186.124 +          marker[j]=marker[j-1]<<1;
 186.125 +        }else
 186.126 +          break;
 186.127 +    }else
 186.128 +      if(sparsecount==0)count++;
 186.129 +  }
 186.130 +
 186.131 +  /* sanity check the huffman tree; an underpopulated tree must be
 186.132 +     rejected. The only exception is the one-node pseudo-nil tree,
 186.133 +     which appears to be underpopulated because the tree doesn't
 186.134 +     really exist; there's only one possible 'codeword' or zero bits,
 186.135 +     but the above tree-gen code doesn't mark that. */
 186.136 +  if(sparsecount != 1){
 186.137 +    for(i=1;i<33;i++)
 186.138 +      if(marker[i] & (0xffffffffUL>>(32-i))){
 186.139 +	_ogg_free(r);
 186.140 +	return(NULL);
 186.141 +      }
 186.142 +  }
 186.143 +
 186.144 +  /* bitreverse the words because our bitwise packer/unpacker is LSb
 186.145 +     endian */
 186.146 +  for(i=0,count=0;i<n;i++){
 186.147 +    ogg_uint32_t temp=0;
 186.148 +    for(j=0;j<l[i];j++){
 186.149 +      temp<<=1;
 186.150 +      temp|=(r[count]>>j)&1;
 186.151 +    }
 186.152 +
 186.153 +    if(sparsecount){
 186.154 +      if(l[i])
 186.155 +        r[count++]=temp;
 186.156 +    }else
 186.157 +      r[count++]=temp;
 186.158 +  }
 186.159 +
 186.160 +  return(r);
 186.161 +}
 186.162 +
 186.163 +/* there might be a straightforward one-line way to do the below
 186.164 +   that's portable and totally safe against roundoff, but I haven't
 186.165 +   thought of it.  Therefore, we opt on the side of caution */
 186.166 +long _book_maptype1_quantvals(const static_codebook *b){
 186.167 +  long vals=floor(pow((float)b->entries,1.f/b->dim));
 186.168 +
 186.169 +  /* the above *should* be reliable, but we'll not assume that FP is
 186.170 +     ever reliable when bitstream sync is at stake; verify via integer
 186.171 +     means that vals really is the greatest value of dim for which
 186.172 +     vals^b->bim <= b->entries */
 186.173 +  /* treat the above as an initial guess */
 186.174 +  while(1){
 186.175 +    long acc=1;
 186.176 +    long acc1=1;
 186.177 +    int i;
 186.178 +    for(i=0;i<b->dim;i++){
 186.179 +      acc*=vals;
 186.180 +      acc1*=vals+1;
 186.181 +    }
 186.182 +    if(acc<=b->entries && acc1>b->entries){
 186.183 +      return(vals);
 186.184 +    }else{
 186.185 +      if(acc>b->entries){
 186.186 +        vals--;
 186.187 +      }else{
 186.188 +        vals++;
 186.189 +      }
 186.190 +    }
 186.191 +  }
 186.192 +}
 186.193 +
 186.194 +/* unpack the quantized list of values for encode/decode ***********/
 186.195 +/* we need to deal with two map types: in map type 1, the values are
 186.196 +   generated algorithmically (each column of the vector counts through
 186.197 +   the values in the quant vector). in map type 2, all the values came
 186.198 +   in in an explicit list.  Both value lists must be unpacked */
 186.199 +float *_book_unquantize(const static_codebook *b,int n,int *sparsemap){
 186.200 +  long j,k,count=0;
 186.201 +  if(b->maptype==1 || b->maptype==2){
 186.202 +    int quantvals;
 186.203 +    float mindel=_float32_unpack(b->q_min);
 186.204 +    float delta=_float32_unpack(b->q_delta);
 186.205 +    float *r=_ogg_calloc(n*b->dim,sizeof(*r));
 186.206 +
 186.207 +    /* maptype 1 and 2 both use a quantized value vector, but
 186.208 +       different sizes */
 186.209 +    switch(b->maptype){
 186.210 +    case 1:
 186.211 +      /* most of the time, entries%dimensions == 0, but we need to be
 186.212 +         well defined.  We define that the possible vales at each
 186.213 +         scalar is values == entries/dim.  If entries%dim != 0, we'll
 186.214 +         have 'too few' values (values*dim<entries), which means that
 186.215 +         we'll have 'left over' entries; left over entries use zeroed
 186.216 +         values (and are wasted).  So don't generate codebooks like
 186.217 +         that */
 186.218 +      quantvals=_book_maptype1_quantvals(b);
 186.219 +      for(j=0;j<b->entries;j++){
 186.220 +        if((sparsemap && b->lengthlist[j]) || !sparsemap){
 186.221 +          float last=0.f;
 186.222 +          int indexdiv=1;
 186.223 +          for(k=0;k<b->dim;k++){
 186.224 +            int index= (j/indexdiv)%quantvals;
 186.225 +            float val=b->quantlist[index];
 186.226 +            val=fabs(val)*delta+mindel+last;
 186.227 +            if(b->q_sequencep)last=val;
 186.228 +            if(sparsemap)
 186.229 +              r[sparsemap[count]*b->dim+k]=val;
 186.230 +            else
 186.231 +              r[count*b->dim+k]=val;
 186.232 +            indexdiv*=quantvals;
 186.233 +          }
 186.234 +          count++;
 186.235 +        }
 186.236 +
 186.237 +      }
 186.238 +      break;
 186.239 +    case 2:
 186.240 +      for(j=0;j<b->entries;j++){
 186.241 +        if((sparsemap && b->lengthlist[j]) || !sparsemap){
 186.242 +          float last=0.f;
 186.243 +
 186.244 +          for(k=0;k<b->dim;k++){
 186.245 +            float val=b->quantlist[j*b->dim+k];
 186.246 +            val=fabs(val)*delta+mindel+last;
 186.247 +            if(b->q_sequencep)last=val;
 186.248 +            if(sparsemap)
 186.249 +              r[sparsemap[count]*b->dim+k]=val;
 186.250 +            else
 186.251 +              r[count*b->dim+k]=val;
 186.252 +          }
 186.253 +          count++;
 186.254 +        }
 186.255 +      }
 186.256 +      break;
 186.257 +    }
 186.258 +
 186.259 +    return(r);
 186.260 +  }
 186.261 +  return(NULL);
 186.262 +}
 186.263 +
 186.264 +void vorbis_staticbook_destroy(static_codebook *b){
 186.265 +  if(b->allocedp){
 186.266 +    if(b->quantlist)_ogg_free(b->quantlist);
 186.267 +    if(b->lengthlist)_ogg_free(b->lengthlist);
 186.268 +    memset(b,0,sizeof(*b));
 186.269 +    _ogg_free(b);
 186.270 +  } /* otherwise, it is in static memory */
 186.271 +}
 186.272 +
 186.273 +void vorbis_book_clear(codebook *b){
 186.274 +  /* static book is not cleared; we're likely called on the lookup and
 186.275 +     the static codebook belongs to the info struct */
 186.276 +  if(b->valuelist)_ogg_free(b->valuelist);
 186.277 +  if(b->codelist)_ogg_free(b->codelist);
 186.278 +
 186.279 +  if(b->dec_index)_ogg_free(b->dec_index);
 186.280 +  if(b->dec_codelengths)_ogg_free(b->dec_codelengths);
 186.281 +  if(b->dec_firsttable)_ogg_free(b->dec_firsttable);
 186.282 +
 186.283 +  memset(b,0,sizeof(*b));
 186.284 +}
 186.285 +
 186.286 +int vorbis_book_init_encode(codebook *c,const static_codebook *s){
 186.287 +
 186.288 +  memset(c,0,sizeof(*c));
 186.289 +  c->c=s;
 186.290 +  c->entries=s->entries;
 186.291 +  c->used_entries=s->entries;
 186.292 +  c->dim=s->dim;
 186.293 +  c->codelist=_make_words(s->lengthlist,s->entries,0);
 186.294 +  /*c->valuelist=_book_unquantize(s,s->entries,NULL);*/
 186.295 +  c->quantvals=_book_maptype1_quantvals(s);
 186.296 +  c->minval=(int)rint(_float32_unpack(s->q_min));
 186.297 +  c->delta=(int)rint(_float32_unpack(s->q_delta));
 186.298 +
 186.299 +  return(0);
 186.300 +}
 186.301 +
 186.302 +static ogg_uint32_t bitreverse(ogg_uint32_t x){
 186.303 +  x=    ((x>>16)&0x0000ffffUL) | ((x<<16)&0xffff0000UL);
 186.304 +  x=    ((x>> 8)&0x00ff00ffUL) | ((x<< 8)&0xff00ff00UL);
 186.305 +  x=    ((x>> 4)&0x0f0f0f0fUL) | ((x<< 4)&0xf0f0f0f0UL);
 186.306 +  x=    ((x>> 2)&0x33333333UL) | ((x<< 2)&0xccccccccUL);
 186.307 +  return((x>> 1)&0x55555555UL) | ((x<< 1)&0xaaaaaaaaUL);
 186.308 +}
 186.309 +
 186.310 +static int sort32a(const void *a,const void *b){
 186.311 +  return ( **(ogg_uint32_t **)a>**(ogg_uint32_t **)b)-
 186.312 +    ( **(ogg_uint32_t **)a<**(ogg_uint32_t **)b);
 186.313 +}
 186.314 +
 186.315 +/* decode codebook arrangement is more heavily optimized than encode */
 186.316 +int vorbis_book_init_decode(codebook *c,const static_codebook *s){
 186.317 +  int i,j,n=0,tabn;
 186.318 +  int *sortindex;
 186.319 +  memset(c,0,sizeof(*c));
 186.320 +
 186.321 +  /* count actually used entries */
 186.322 +  for(i=0;i<s->entries;i++)
 186.323 +    if(s->lengthlist[i]>0)
 186.324 +      n++;
 186.325 +
 186.326 +  c->entries=s->entries;
 186.327 +  c->used_entries=n;
 186.328 +  c->dim=s->dim;
 186.329 +
 186.330 +  if(n>0){
 186.331 +
 186.332 +    /* two different remappings go on here.
 186.333 +
 186.334 +    First, we collapse the likely sparse codebook down only to
 186.335 +    actually represented values/words.  This collapsing needs to be
 186.336 +    indexed as map-valueless books are used to encode original entry
 186.337 +    positions as integers.
 186.338 +
 186.339 +    Second, we reorder all vectors, including the entry index above,
 186.340 +    by sorted bitreversed codeword to allow treeless decode. */
 186.341 +
 186.342 +    /* perform sort */
 186.343 +    ogg_uint32_t *codes=_make_words(s->lengthlist,s->entries,c->used_entries);
 186.344 +    ogg_uint32_t **codep=alloca(sizeof(*codep)*n);
 186.345 +
 186.346 +    if(codes==NULL)goto err_out;
 186.347 +
 186.348 +    for(i=0;i<n;i++){
 186.349 +      codes[i]=bitreverse(codes[i]);
 186.350 +      codep[i]=codes+i;
 186.351 +    }
 186.352 +
 186.353 +    qsort(codep,n,sizeof(*codep),sort32a);
 186.354 +
 186.355 +    sortindex=alloca(n*sizeof(*sortindex));
 186.356 +    c->codelist=_ogg_malloc(n*sizeof(*c->codelist));
 186.357 +    /* the index is a reverse index */
 186.358 +    for(i=0;i<n;i++){
 186.359 +      int position=codep[i]-codes;
 186.360 +      sortindex[position]=i;
 186.361 +    }
 186.362 +
 186.363 +    for(i=0;i<n;i++)
 186.364 +      c->codelist[sortindex[i]]=codes[i];
 186.365 +    _ogg_free(codes);
 186.366 +
 186.367 +
 186.368 +    c->valuelist=_book_unquantize(s,n,sortindex);
 186.369 +    c->dec_index=_ogg_malloc(n*sizeof(*c->dec_index));
 186.370 +
 186.371 +    for(n=0,i=0;i<s->entries;i++)
 186.372 +      if(s->lengthlist[i]>0)
 186.373 +        c->dec_index[sortindex[n++]]=i;
 186.374 +
 186.375 +    c->dec_codelengths=_ogg_malloc(n*sizeof(*c->dec_codelengths));
 186.376 +    for(n=0,i=0;i<s->entries;i++)
 186.377 +      if(s->lengthlist[i]>0)
 186.378 +        c->dec_codelengths[sortindex[n++]]=s->lengthlist[i];
 186.379 +
 186.380 +    c->dec_firsttablen=_ilog(c->used_entries)-4; /* this is magic */
 186.381 +    if(c->dec_firsttablen<5)c->dec_firsttablen=5;
 186.382 +    if(c->dec_firsttablen>8)c->dec_firsttablen=8;
 186.383 +
 186.384 +    tabn=1<<c->dec_firsttablen;
 186.385 +    c->dec_firsttable=_ogg_calloc(tabn,sizeof(*c->dec_firsttable));
 186.386 +    c->dec_maxlength=0;
 186.387 +
 186.388 +    for(i=0;i<n;i++){
 186.389 +      if(c->dec_maxlength<c->dec_codelengths[i])
 186.390 +        c->dec_maxlength=c->dec_codelengths[i];
 186.391 +      if(c->dec_codelengths[i]<=c->dec_firsttablen){
 186.392 +        ogg_uint32_t orig=bitreverse(c->codelist[i]);
 186.393 +        for(j=0;j<(1<<(c->dec_firsttablen-c->dec_codelengths[i]));j++)
 186.394 +          c->dec_firsttable[orig|(j<<c->dec_codelengths[i])]=i+1;
 186.395 +      }
 186.396 +    }
 186.397 +
 186.398 +    /* now fill in 'unused' entries in the firsttable with hi/lo search
 186.399 +       hints for the non-direct-hits */
 186.400 +    {
 186.401 +      ogg_uint32_t mask=0xfffffffeUL<<(31-c->dec_firsttablen);
 186.402 +      long lo=0,hi=0;
 186.403 +
 186.404 +      for(i=0;i<tabn;i++){
 186.405 +        ogg_uint32_t word=i<<(32-c->dec_firsttablen);
 186.406 +        if(c->dec_firsttable[bitreverse(word)]==0){
 186.407 +          while((lo+1)<n && c->codelist[lo+1]<=word)lo++;
 186.408 +          while(    hi<n && word>=(c->codelist[hi]&mask))hi++;
 186.409 +
 186.410 +          /* we only actually have 15 bits per hint to play with here.
 186.411 +             In order to overflow gracefully (nothing breaks, efficiency
 186.412 +             just drops), encode as the difference from the extremes. */
 186.413 +          {
 186.414 +            unsigned long loval=lo;
 186.415 +            unsigned long hival=n-hi;
 186.416 +
 186.417 +            if(loval>0x7fff)loval=0x7fff;
 186.418 +            if(hival>0x7fff)hival=0x7fff;
 186.419 +            c->dec_firsttable[bitreverse(word)]=
 186.420 +              0x80000000UL | (loval<<15) | hival;
 186.421 +          }
 186.422 +        }
 186.423 +      }
 186.424 +    }
 186.425 +  }
 186.426 +
 186.427 +  return(0);
 186.428 + err_out:
 186.429 +  vorbis_book_clear(c);
 186.430 +  return(-1);
 186.431 +}
 186.432 +
 186.433 +long vorbis_book_codeword(codebook *book,int entry){
 186.434 +  if(book->c) /* only use with encode; decode optimizations are
 186.435 +                 allowed to break this */
 186.436 +    return book->codelist[entry];
 186.437 +  return -1;
 186.438 +}
 186.439 +
 186.440 +long vorbis_book_codelen(codebook *book,int entry){
 186.441 +  if(book->c) /* only use with encode; decode optimizations are
 186.442 +                 allowed to break this */
 186.443 +    return book->c->lengthlist[entry];
 186.444 +  return -1;
 186.445 +}
 186.446 +
 186.447 +#ifdef _V_SELFTEST
 186.448 +
 186.449 +/* Unit tests of the dequantizer; this stuff will be OK
 186.450 +   cross-platform, I simply want to be sure that special mapping cases
 186.451 +   actually work properly; a bug could go unnoticed for a while */
 186.452 +
 186.453 +#include <stdio.h>
 186.454 +
 186.455 +/* cases:
 186.456 +
 186.457 +   no mapping
 186.458 +   full, explicit mapping
 186.459 +   algorithmic mapping
 186.460 +
 186.461 +   nonsequential
 186.462 +   sequential
 186.463 +*/
 186.464 +
 186.465 +static long full_quantlist1[]={0,1,2,3,    4,5,6,7, 8,3,6,1};
 186.466 +static long partial_quantlist1[]={0,7,2};
 186.467 +
 186.468 +/* no mapping */
 186.469 +static_codebook test1={
 186.470 +  4,16,
 186.471 +  NULL,
 186.472 +  0,
 186.473 +  0,0,0,0,
 186.474 +  NULL,
 186.475 +  0
 186.476 +};
 186.477 +static float *test1_result=NULL;
 186.478 +
 186.479 +/* linear, full mapping, nonsequential */
 186.480 +static_codebook test2={
 186.481 +  4,3,
 186.482 +  NULL,
 186.483 +  2,
 186.484 +  -533200896,1611661312,4,0,
 186.485 +  full_quantlist1,
 186.486 +  0
 186.487 +};
 186.488 +static float test2_result[]={-3,-2,-1,0, 1,2,3,4, 5,0,3,-2};
 186.489 +
 186.490 +/* linear, full mapping, sequential */
 186.491 +static_codebook test3={
 186.492 +  4,3,
 186.493 +  NULL,
 186.494 +  2,
 186.495 +  -533200896,1611661312,4,1,
 186.496 +  full_quantlist1,
 186.497 +  0
 186.498 +};
 186.499 +static float test3_result[]={-3,-5,-6,-6, 1,3,6,10, 5,5,8,6};
 186.500 +
 186.501 +/* linear, algorithmic mapping, nonsequential */
 186.502 +static_codebook test4={
 186.503 +  3,27,
 186.504 +  NULL,
 186.505 +  1,
 186.506 +  -533200896,1611661312,4,0,
 186.507 +  partial_quantlist1,
 186.508 +  0
 186.509 +};
 186.510 +static float test4_result[]={-3,-3,-3, 4,-3,-3, -1,-3,-3,
 186.511 +                              -3, 4,-3, 4, 4,-3, -1, 4,-3,
 186.512 +                              -3,-1,-3, 4,-1,-3, -1,-1,-3,
 186.513 +                              -3,-3, 4, 4,-3, 4, -1,-3, 4,
 186.514 +                              -3, 4, 4, 4, 4, 4, -1, 4, 4,
 186.515 +                              -3,-1, 4, 4,-1, 4, -1,-1, 4,
 186.516 +                              -3,-3,-1, 4,-3,-1, -1,-3,-1,
 186.517 +                              -3, 4,-1, 4, 4,-1, -1, 4,-1,
 186.518 +                              -3,-1,-1, 4,-1,-1, -1,-1,-1};
 186.519 +
 186.520 +/* linear, algorithmic mapping, sequential */
 186.521 +static_codebook test5={
 186.522 +  3,27,
 186.523 +  NULL,
 186.524 +  1,
 186.525 +  -533200896,1611661312,4,1,
 186.526 +  partial_quantlist1,
 186.527 +  0
 186.528 +};
 186.529 +static float test5_result[]={-3,-6,-9, 4, 1,-2, -1,-4,-7,
 186.530 +                              -3, 1,-2, 4, 8, 5, -1, 3, 0,
 186.531 +                              -3,-4,-7, 4, 3, 0, -1,-2,-5,
 186.532 +                              -3,-6,-2, 4, 1, 5, -1,-4, 0,
 186.533 +                              -3, 1, 5, 4, 8,12, -1, 3, 7,
 186.534 +                              -3,-4, 0, 4, 3, 7, -1,-2, 2,
 186.535 +                              -3,-6,-7, 4, 1, 0, -1,-4,-5,
 186.536 +                              -3, 1, 0, 4, 8, 7, -1, 3, 2,
 186.537 +                              -3,-4,-5, 4, 3, 2, -1,-2,-3};
 186.538 +
 186.539 +void run_test(static_codebook *b,float *comp){
 186.540 +  float *out=_book_unquantize(b,b->entries,NULL);
 186.541 +  int i;
 186.542 +
 186.543 +  if(comp){
 186.544 +    if(!out){
 186.545 +      fprintf(stderr,"_book_unquantize incorrectly returned NULL\n");
 186.546 +      exit(1);
 186.547 +    }
 186.548 +
 186.549 +    for(i=0;i<b->entries*b->dim;i++)
 186.550 +      if(fabs(out[i]-comp[i])>.0001){
 186.551 +        fprintf(stderr,"disagreement in unquantized and reference data:\n"
 186.552 +                "position %d, %g != %g\n",i,out[i],comp[i]);
 186.553 +        exit(1);
 186.554 +      }
 186.555 +
 186.556 +  }else{
 186.557 +    if(out){
 186.558 +      fprintf(stderr,"_book_unquantize returned a value array: \n"
 186.559 +              " correct result should have been NULL\n");
 186.560 +      exit(1);
 186.561 +    }
 186.562 +  }
 186.563 +}
 186.564 +
 186.565 +int main(){
 186.566 +  /* run the nine dequant tests, and compare to the hand-rolled results */
 186.567 +  fprintf(stderr,"Dequant test 1... ");
 186.568 +  run_test(&test1,test1_result);
 186.569 +  fprintf(stderr,"OK\nDequant test 2... ");
 186.570 +  run_test(&test2,test2_result);
 186.571 +  fprintf(stderr,"OK\nDequant test 3... ");
 186.572 +  run_test(&test3,test3_result);
 186.573 +  fprintf(stderr,"OK\nDequant test 4... ");
 186.574 +  run_test(&test4,test4_result);
 186.575 +  fprintf(stderr,"OK\nDequant test 5... ");
 186.576 +  run_test(&test5,test5_result);
 186.577 +  fprintf(stderr,"OK\n\n");
 186.578 +
 186.579 +  return(0);
 186.580 +}
 186.581 +
 186.582 +#endif
   187.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   187.2 +++ b/libs/vorbis/smallft.c	Sun Nov 01 00:36:56 2015 +0200
   187.3 @@ -0,0 +1,1255 @@
   187.4 +/********************************************************************
   187.5 + *                                                                  *
   187.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   187.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   187.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   187.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  187.10 + *                                                                  *
  187.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
  187.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  187.13 + *                                                                  *
  187.14 + ********************************************************************
  187.15 +
  187.16 + function: *unnormalized* fft transform
  187.17 + last mod: $Id: smallft.c 16227 2009-07-08 06:58:46Z xiphmont $
  187.18 +
  187.19 + ********************************************************************/
  187.20 +
  187.21 +/* FFT implementation from OggSquish, minus cosine transforms,
  187.22 + * minus all but radix 2/4 case.  In Vorbis we only need this
  187.23 + * cut-down version.
  187.24 + *
  187.25 + * To do more than just power-of-two sized vectors, see the full
  187.26 + * version I wrote for NetLib.
  187.27 + *
  187.28 + * Note that the packing is a little strange; rather than the FFT r/i
  187.29 + * packing following R_0, I_n, R_1, I_1, R_2, I_2 ... R_n-1, I_n-1,
  187.30 + * it follows R_0, R_1, I_1, R_2, I_2 ... R_n-1, I_n-1, I_n like the
  187.31 + * FORTRAN version
  187.32 + */
  187.33 +
  187.34 +#include <stdlib.h>
  187.35 +#include <string.h>
  187.36 +#include <math.h>
  187.37 +#include "smallft.h"
  187.38 +#include "os.h"
  187.39 +#include "misc.h"
  187.40 +
  187.41 +static void drfti1(int n, float *wa, int *ifac){
  187.42 +  static int ntryh[4] = { 4,2,3,5 };
  187.43 +  static float tpi = 6.28318530717958648f;
  187.44 +  float arg,argh,argld,fi;
  187.45 +  int ntry=0,i,j=-1;
  187.46 +  int k1, l1, l2, ib;
  187.47 +  int ld, ii, ip, is, nq, nr;
  187.48 +  int ido, ipm, nfm1;
  187.49 +  int nl=n;
  187.50 +  int nf=0;
  187.51 +
  187.52 + L101:
  187.53 +  j++;
  187.54 +  if (j < 4)
  187.55 +    ntry=ntryh[j];
  187.56 +  else
  187.57 +    ntry+=2;
  187.58 +
  187.59 + L104:
  187.60 +  nq=nl/ntry;
  187.61 +  nr=nl-ntry*nq;
  187.62 +  if (nr!=0) goto L101;
  187.63 +
  187.64 +  nf++;
  187.65 +  ifac[nf+1]=ntry;
  187.66 +  nl=nq;
  187.67 +  if(ntry!=2)goto L107;
  187.68 +  if(nf==1)goto L107;
  187.69 +
  187.70 +  for (i=1;i<nf;i++){
  187.71 +    ib=nf-i+1;
  187.72 +    ifac[ib+1]=ifac[ib];
  187.73 +  }
  187.74 +  ifac[2] = 2;
  187.75 +
  187.76 + L107:
  187.77 +  if(nl!=1)goto L104;
  187.78 +  ifac[0]=n;
  187.79 +  ifac[1]=nf;
  187.80 +  argh=tpi/n;
  187.81 +  is=0;
  187.82 +  nfm1=nf-1;
  187.83 +  l1=1;
  187.84 +
  187.85 +  if(nfm1==0)return;
  187.86 +
  187.87 +  for (k1=0;k1<nfm1;k1++){
  187.88 +    ip=ifac[k1+2];
  187.89 +    ld=0;
  187.90 +    l2=l1*ip;
  187.91 +    ido=n/l2;
  187.92 +    ipm=ip-1;
  187.93 +
  187.94 +    for (j=0;j<ipm;j++){
  187.95 +      ld+=l1;
  187.96 +      i=is;
  187.97 +      argld=(float)ld*argh;
  187.98 +      fi=0.f;
  187.99 +      for (ii=2;ii<ido;ii+=2){
 187.100 +        fi+=1.f;
 187.101 +        arg=fi*argld;
 187.102 +        wa[i++]=cos(arg);
 187.103 +        wa[i++]=sin(arg);
 187.104 +      }
 187.105 +      is+=ido;
 187.106 +    }
 187.107 +    l1=l2;
 187.108 +  }
 187.109 +}
 187.110 +
 187.111 +static void fdrffti(int n, float *wsave, int *ifac){
 187.112 +
 187.113 +  if (n == 1) return;
 187.114 +  drfti1(n, wsave+n, ifac);
 187.115 +}
 187.116 +
 187.117 +static void dradf2(int ido,int l1,float *cc,float *ch,float *wa1){
 187.118 +  int i,k;
 187.119 +  float ti2,tr2;
 187.120 +  int t0,t1,t2,t3,t4,t5,t6;
 187.121 +
 187.122 +  t1=0;
 187.123 +  t0=(t2=l1*ido);
 187.124 +  t3=ido<<1;
 187.125 +  for(k=0;k<l1;k++){
 187.126 +    ch[t1<<1]=cc[t1]+cc[t2];
 187.127 +    ch[(t1<<1)+t3-1]=cc[t1]-cc[t2];
 187.128 +    t1+=ido;
 187.129 +    t2+=ido;
 187.130 +  }
 187.131 +
 187.132 +  if(ido<2)return;
 187.133 +  if(ido==2)goto L105;
 187.134 +
 187.135 +  t1=0;
 187.136 +  t2=t0;
 187.137 +  for(k=0;k<l1;k++){
 187.138 +    t3=t2;
 187.139 +    t4=(t1<<1)+(ido<<1);
 187.140 +    t5=t1;
 187.141 +    t6=t1+t1;
 187.142 +    for(i=2;i<ido;i+=2){
 187.143 +      t3+=2;
 187.144 +      t4-=2;
 187.145 +      t5+=2;
 187.146 +      t6+=2;
 187.147 +      tr2=wa1[i-2]*cc[t3-1]+wa1[i-1]*cc[t3];
 187.148 +      ti2=wa1[i-2]*cc[t3]-wa1[i-1]*cc[t3-1];
 187.149 +      ch[t6]=cc[t5]+ti2;
 187.150 +      ch[t4]=ti2-cc[t5];
 187.151 +      ch[t6-1]=cc[t5-1]+tr2;
 187.152 +      ch[t4-1]=cc[t5-1]-tr2;
 187.153 +    }
 187.154 +    t1+=ido;
 187.155 +    t2+=ido;
 187.156 +  }
 187.157 +
 187.158 +  if(ido%2==1)return;
 187.159 +
 187.160 + L105:
 187.161 +  t3=(t2=(t1=ido)-1);
 187.162 +  t2+=t0;
 187.163 +  for(k=0;k<l1;k++){
 187.164 +    ch[t1]=-cc[t2];
 187.165 +    ch[t1-1]=cc[t3];
 187.166 +    t1+=ido<<1;
 187.167 +    t2+=ido;
 187.168 +    t3+=ido;
 187.169 +  }
 187.170 +}
 187.171 +
 187.172 +static void dradf4(int ido,int l1,float *cc,float *ch,float *wa1,
 187.173 +            float *wa2,float *wa3){
 187.174 +  static float hsqt2 = .70710678118654752f;
 187.175 +  int i,k,t0,t1,t2,t3,t4,t5,t6;
 187.176 +  float ci2,ci3,ci4,cr2,cr3,cr4,ti1,ti2,ti3,ti4,tr1,tr2,tr3,tr4;
 187.177 +  t0=l1*ido;
 187.178 +
 187.179 +  t1=t0;
 187.180 +  t4=t1<<1;
 187.181 +  t2=t1+(t1<<1);
 187.182 +  t3=0;
 187.183 +
 187.184 +  for(k=0;k<l1;k++){
 187.185 +    tr1=cc[t1]+cc[t2];
 187.186 +    tr2=cc[t3]+cc[t4];
 187.187 +
 187.188 +    ch[t5=t3<<2]=tr1+tr2;
 187.189 +    ch[(ido<<2)+t5-1]=tr2-tr1;
 187.190 +    ch[(t5+=(ido<<1))-1]=cc[t3]-cc[t4];
 187.191 +    ch[t5]=cc[t2]-cc[t1];
 187.192 +
 187.193 +    t1+=ido;
 187.194 +    t2+=ido;
 187.195 +    t3+=ido;
 187.196 +    t4+=ido;
 187.197 +  }
 187.198 +
 187.199 +  if(ido<2)return;
 187.200 +  if(ido==2)goto L105;
 187.201 +
 187.202 +
 187.203 +  t1=0;
 187.204 +  for(k=0;k<l1;k++){
 187.205 +    t2=t1;
 187.206 +    t4=t1<<2;
 187.207 +    t5=(t6=ido<<1)+t4;
 187.208 +    for(i=2;i<ido;i+=2){
 187.209 +      t3=(t2+=2);
 187.210 +      t4+=2;
 187.211 +      t5-=2;
 187.212 +
 187.213 +      t3+=t0;
 187.214 +      cr2=wa1[i-2]*cc[t3-1]+wa1[i-1]*cc[t3];
 187.215 +      ci2=wa1[i-2]*cc[t3]-wa1[i-1]*cc[t3-1];
 187.216 +      t3+=t0;
 187.217 +      cr3=wa2[i-2]*cc[t3-1]+wa2[i-1]*cc[t3];
 187.218 +      ci3=wa2[i-2]*cc[t3]-wa2[i-1]*cc[t3-1];
 187.219 +      t3+=t0;
 187.220 +      cr4=wa3[i-2]*cc[t3-1]+wa3[i-1]*cc[t3];
 187.221 +      ci4=wa3[i-2]*cc[t3]-wa3[i-1]*cc[t3-1];
 187.222 +
 187.223 +      tr1=cr2+cr4;
 187.224 +      tr4=cr4-cr2;
 187.225 +      ti1=ci2+ci4;
 187.226 +      ti4=ci2-ci4;
 187.227 +
 187.228 +      ti2=cc[t2]+ci3;
 187.229 +      ti3=cc[t2]-ci3;
 187.230 +      tr2=cc[t2-1]+cr3;
 187.231 +      tr3=cc[t2-1]-cr3;
 187.232 +
 187.233 +      ch[t4-1]=tr1+tr2;
 187.234 +      ch[t4]=ti1+ti2;
 187.235 +
 187.236 +      ch[t5-1]=tr3-ti4;
 187.237 +      ch[t5]=tr4-ti3;
 187.238 +
 187.239 +      ch[t4+t6-1]=ti4+tr3;
 187.240 +      ch[t4+t6]=tr4+ti3;
 187.241 +
 187.242 +      ch[t5+t6-1]=tr2-tr1;
 187.243 +      ch[t5+t6]=ti1-ti2;
 187.244 +    }
 187.245 +    t1+=ido;
 187.246 +  }
 187.247 +  if(ido&1)return;
 187.248 +
 187.249 + L105:
 187.250 +
 187.251 +  t2=(t1=t0+ido-1)+(t0<<1);
 187.252 +  t3=ido<<2;
 187.253 +  t4=ido;
 187.254 +  t5=ido<<1;
 187.255 +  t6=ido;
 187.256 +
 187.257 +  for(k=0;k<l1;k++){
 187.258 +    ti1=-hsqt2*(cc[t1]+cc[t2]);
 187.259 +    tr1=hsqt2*(cc[t1]-cc[t2]);
 187.260 +
 187.261 +    ch[t4-1]=tr1+cc[t6-1];
 187.262 +    ch[t4+t5-1]=cc[t6-1]-tr1;
 187.263 +
 187.264 +    ch[t4]=ti1-cc[t1+t0];
 187.265 +    ch[t4+t5]=ti1+cc[t1+t0];
 187.266 +
 187.267 +    t1+=ido;
 187.268 +    t2+=ido;
 187.269 +    t4+=t3;
 187.270 +    t6+=ido;
 187.271 +  }
 187.272 +}
 187.273 +
 187.274 +static void dradfg(int ido,int ip,int l1,int idl1,float *cc,float *c1,
 187.275 +                          float *c2,float *ch,float *ch2,float *wa){
 187.276 +
 187.277 +  static float tpi=6.283185307179586f;
 187.278 +  int idij,ipph,i,j,k,l,ic,ik,is;
 187.279 +  int t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
 187.280 +  float dc2,ai1,ai2,ar1,ar2,ds2;
 187.281 +  int nbd;
 187.282 +  float dcp,arg,dsp,ar1h,ar2h;
 187.283 +  int idp2,ipp2;
 187.284 +
 187.285 +  arg=tpi/(float)ip;
 187.286 +  dcp=cos(arg);
 187.287 +  dsp=sin(arg);
 187.288 +  ipph=(ip+1)>>1;
 187.289 +  ipp2=ip;
 187.290 +  idp2=ido;
 187.291 +  nbd=(ido-1)>>1;
 187.292 +  t0=l1*ido;
 187.293 +  t10=ip*ido;
 187.294 +
 187.295 +  if(ido==1)goto L119;
 187.296 +  for(ik=0;ik<idl1;ik++)ch2[ik]=c2[ik];
 187.297 +
 187.298 +  t1=0;
 187.299 +  for(j=1;j<ip;j++){
 187.300 +    t1+=t0;
 187.301 +    t2=t1;
 187.302 +    for(k=0;k<l1;k++){
 187.303 +      ch[t2]=c1[t2];
 187.304 +      t2+=ido;
 187.305 +    }
 187.306 +  }
 187.307 +
 187.308 +  is=-ido;
 187.309 +  t1=0;
 187.310 +  if(nbd>l1){
 187.311 +    for(j=1;j<ip;j++){
 187.312 +      t1+=t0;
 187.313 +      is+=ido;
 187.314 +      t2= -ido+t1;
 187.315 +      for(k=0;k<l1;k++){
 187.316 +        idij=is-1;
 187.317 +        t2+=ido;
 187.318 +        t3=t2;
 187.319 +        for(i=2;i<ido;i+=2){
 187.320 +          idij+=2;
 187.321 +          t3+=2;
 187.322 +          ch[t3-1]=wa[idij-1]*c1[t3-1]+wa[idij]*c1[t3];
 187.323 +          ch[t3]=wa[idij-1]*c1[t3]-wa[idij]*c1[t3-1];
 187.324 +        }
 187.325 +      }
 187.326 +    }
 187.327 +  }else{
 187.328 +
 187.329 +    for(j=1;j<ip;j++){
 187.330 +      is+=ido;
 187.331 +      idij=is-1;
 187.332 +      t1+=t0;
 187.333 +      t2=t1;
 187.334 +      for(i=2;i<ido;i+=2){
 187.335 +        idij+=2;
 187.336 +        t2+=2;
 187.337 +        t3=t2;
 187.338 +        for(k=0;k<l1;k++){
 187.339 +          ch[t3-1]=wa[idij-1]*c1[t3-1]+wa[idij]*c1[t3];
 187.340 +          ch[t3]=wa[idij-1]*c1[t3]-wa[idij]*c1[t3-1];
 187.341 +          t3+=ido;
 187.342 +        }
 187.343 +      }
 187.344 +    }
 187.345 +  }
 187.346 +
 187.347 +  t1=0;
 187.348 +  t2=ipp2*t0;
 187.349 +  if(nbd<l1){
 187.350 +    for(j=1;j<ipph;j++){
 187.351 +      t1+=t0;
 187.352 +      t2-=t0;
 187.353 +      t3=t1;
 187.354 +      t4=t2;
 187.355 +      for(i=2;i<ido;i+=2){
 187.356 +        t3+=2;
 187.357 +        t4+=2;
 187.358 +        t5=t3-ido;
 187.359 +        t6=t4-ido;
 187.360 +        for(k=0;k<l1;k++){
 187.361 +          t5+=ido;
 187.362 +          t6+=ido;
 187.363 +          c1[t5-1]=ch[t5-1]+ch[t6-1];
 187.364 +          c1[t6-1]=ch[t5]-ch[t6];
 187.365 +          c1[t5]=ch[t5]+ch[t6];
 187.366 +          c1[t6]=ch[t6-1]-ch[t5-1];
 187.367 +        }
 187.368 +      }
 187.369 +    }
 187.370 +  }else{
 187.371 +    for(j=1;j<ipph;j++){
 187.372 +      t1+=t0;
 187.373 +      t2-=t0;
 187.374 +      t3=t1;
 187.375 +      t4=t2;
 187.376 +      for(k=0;k<l1;k++){
 187.377 +        t5=t3;
 187.378 +        t6=t4;
 187.379 +        for(i=2;i<ido;i+=2){
 187.380 +          t5+=2;
 187.381 +          t6+=2;
 187.382 +          c1[t5-1]=ch[t5-1]+ch[t6-1];
 187.383 +          c1[t6-1]=ch[t5]-ch[t6];
 187.384 +          c1[t5]=ch[t5]+ch[t6];
 187.385 +          c1[t6]=ch[t6-1]-ch[t5-1];
 187.386 +        }
 187.387 +        t3+=ido;
 187.388 +        t4+=ido;
 187.389 +      }
 187.390 +    }
 187.391 +  }
 187.392 +
 187.393 +L119:
 187.394 +  for(ik=0;ik<idl1;ik++)c2[ik]=ch2[ik];
 187.395 +
 187.396 +  t1=0;
 187.397 +  t2=ipp2*idl1;
 187.398 +  for(j=1;j<ipph;j++){
 187.399 +    t1+=t0;
 187.400 +    t2-=t0;
 187.401 +    t3=t1-ido;
 187.402 +    t4=t2-ido;
 187.403 +    for(k=0;k<l1;k++){
 187.404 +      t3+=ido;
 187.405 +      t4+=ido;
 187.406 +      c1[t3]=ch[t3]+ch[t4];
 187.407 +      c1[t4]=ch[t4]-ch[t3];
 187.408 +    }
 187.409 +  }
 187.410 +
 187.411 +  ar1=1.f;
 187.412 +  ai1=0.f;
 187.413 +  t1=0;
 187.414 +  t2=ipp2*idl1;
 187.415 +  t3=(ip-1)*idl1;
 187.416 +  for(l=1;l<ipph;l++){
 187.417 +    t1+=idl1;
 187.418 +    t2-=idl1;
 187.419 +    ar1h=dcp*ar1-dsp*ai1;
 187.420 +    ai1=dcp*ai1+dsp*ar1;
 187.421 +    ar1=ar1h;
 187.422 +    t4=t1;
 187.423 +    t5=t2;
 187.424 +    t6=t3;
 187.425 +    t7=idl1;
 187.426 +
 187.427 +    for(ik=0;ik<idl1;ik++){
 187.428 +      ch2[t4++]=c2[ik]+ar1*c2[t7++];
 187.429 +      ch2[t5++]=ai1*c2[t6++];
 187.430 +    }
 187.431 +
 187.432 +    dc2=ar1;
 187.433 +    ds2=ai1;
 187.434 +    ar2=ar1;
 187.435 +    ai2=ai1;
 187.436 +
 187.437 +    t4=idl1;
 187.438 +    t5=(ipp2-1)*idl1;
 187.439 +    for(j=2;j<ipph;j++){
 187.440 +      t4+=idl1;
 187.441 +      t5-=idl1;
 187.442 +
 187.443 +      ar2h=dc2*ar2-ds2*ai2;
 187.444 +      ai2=dc2*ai2+ds2*ar2;
 187.445 +      ar2=ar2h;
 187.446 +
 187.447 +      t6=t1;
 187.448 +      t7=t2;
 187.449 +      t8=t4;
 187.450 +      t9=t5;
 187.451 +      for(ik=0;ik<idl1;ik++){
 187.452 +        ch2[t6++]+=ar2*c2[t8++];
 187.453 +        ch2[t7++]+=ai2*c2[t9++];
 187.454 +      }
 187.455 +    }
 187.456 +  }
 187.457 +
 187.458 +  t1=0;
 187.459 +  for(j=1;j<ipph;j++){
 187.460 +    t1+=idl1;
 187.461 +    t2=t1;
 187.462 +    for(ik=0;ik<idl1;ik++)ch2[ik]+=c2[t2++];
 187.463 +  }
 187.464 +
 187.465 +  if(ido<l1)goto L132;
 187.466 +
 187.467 +  t1=0;
 187.468 +  t2=0;
 187.469 +  for(k=0;k<l1;k++){
 187.470 +    t3=t1;
 187.471 +    t4=t2;
 187.472 +    for(i=0;i<ido;i++)cc[t4++]=ch[t3++];
 187.473 +    t1+=ido;
 187.474 +    t2+=t10;
 187.475 +  }
 187.476 +
 187.477 +  goto L135;
 187.478 +
 187.479 + L132:
 187.480 +  for(i=0;i<ido;i++){
 187.481 +    t1=i;
 187.482 +    t2=i;
 187.483 +    for(k=0;k<l1;k++){
 187.484 +      cc[t2]=ch[t1];
 187.485 +      t1+=ido;
 187.486 +      t2+=t10;
 187.487 +    }
 187.488 +  }
 187.489 +
 187.490 + L135:
 187.491 +  t1=0;
 187.492 +  t2=ido<<1;
 187.493 +  t3=0;
 187.494 +  t4=ipp2*t0;
 187.495 +  for(j=1;j<ipph;j++){
 187.496 +
 187.497 +    t1+=t2;
 187.498 +    t3+=t0;
 187.499 +    t4-=t0;
 187.500 +
 187.501 +    t5=t1;
 187.502 +    t6=t3;
 187.503 +    t7=t4;
 187.504 +
 187.505 +    for(k=0;k<l1;k++){
 187.506 +      cc[t5-1]=ch[t6];
 187.507 +      cc[t5]=ch[t7];
 187.508 +      t5+=t10;
 187.509 +      t6+=ido;
 187.510 +      t7+=ido;
 187.511 +    }
 187.512 +  }
 187.513 +
 187.514 +  if(ido==1)return;
 187.515 +  if(nbd<l1)goto L141;
 187.516 +
 187.517 +  t1=-ido;
 187.518 +  t3=0;
 187.519 +  t4=0;
 187.520 +  t5=ipp2*t0;
 187.521 +  for(j=1;j<ipph;j++){
 187.522 +    t1+=t2;
 187.523 +    t3+=t2;
 187.524 +    t4+=t0;
 187.525 +    t5-=t0;
 187.526 +    t6=t1;
 187.527 +    t7=t3;
 187.528 +    t8=t4;
 187.529 +    t9=t5;
 187.530 +    for(k=0;k<l1;k++){
 187.531 +      for(i=2;i<ido;i+=2){
 187.532 +        ic=idp2-i;
 187.533 +        cc[i+t7-1]=ch[i+t8-1]+ch[i+t9-1];
 187.534 +        cc[ic+t6-1]=ch[i+t8-1]-ch[i+t9-1];
 187.535 +        cc[i+t7]=ch[i+t8]+ch[i+t9];
 187.536 +        cc[ic+t6]=ch[i+t9]-ch[i+t8];
 187.537 +      }
 187.538 +      t6+=t10;
 187.539 +      t7+=t10;
 187.540 +      t8+=ido;
 187.541 +      t9+=ido;
 187.542 +    }
 187.543 +  }
 187.544 +  return;
 187.545 +
 187.546 + L141:
 187.547 +
 187.548 +  t1=-ido;
 187.549 +  t3=0;
 187.550 +  t4=0;
 187.551 +  t5=ipp2*t0;
 187.552 +  for(j=1;j<ipph;j++){
 187.553 +    t1+=t2;
 187.554 +    t3+=t2;
 187.555 +    t4+=t0;
 187.556 +    t5-=t0;
 187.557 +    for(i=2;i<ido;i+=2){
 187.558 +      t6=idp2+t1-i;
 187.559 +      t7=i+t3;
 187.560 +      t8=i+t4;
 187.561 +      t9=i+t5;
 187.562 +      for(k=0;k<l1;k++){
 187.563 +        cc[t7-1]=ch[t8-1]+ch[t9-1];
 187.564 +        cc[t6-1]=ch[t8-1]-ch[t9-1];
 187.565 +        cc[t7]=ch[t8]+ch[t9];
 187.566 +        cc[t6]=ch[t9]-ch[t8];
 187.567 +        t6+=t10;
 187.568 +        t7+=t10;
 187.569 +        t8+=ido;
 187.570 +        t9+=ido;
 187.571 +      }
 187.572 +    }
 187.573 +  }
 187.574 +}
 187.575 +
 187.576 +static void drftf1(int n,float *c,float *ch,float *wa,int *ifac){
 187.577 +  int i,k1,l1,l2;
 187.578 +  int na,kh,nf;
 187.579 +  int ip,iw,ido,idl1,ix2,ix3;
 187.580 +
 187.581 +  nf=ifac[1];
 187.582 +  na=1;
 187.583 +  l2=n;
 187.584 +  iw=n;
 187.585 +
 187.586 +  for(k1=0;k1<nf;k1++){
 187.587 +    kh=nf-k1;
 187.588 +    ip=ifac[kh+1];
 187.589 +    l1=l2/ip;
 187.590 +    ido=n/l2;
 187.591 +    idl1=ido*l1;
 187.592 +    iw-=(ip-1)*ido;
 187.593 +    na=1-na;
 187.594 +
 187.595 +    if(ip!=4)goto L102;
 187.596 +
 187.597 +    ix2=iw+ido;
 187.598 +    ix3=ix2+ido;
 187.599 +    if(na!=0)
 187.600 +      dradf4(ido,l1,ch,c,wa+iw-1,wa+ix2-1,wa+ix3-1);
 187.601 +    else
 187.602 +      dradf4(ido,l1,c,ch,wa+iw-1,wa+ix2-1,wa+ix3-1);
 187.603 +    goto L110;
 187.604 +
 187.605 + L102:
 187.606 +    if(ip!=2)goto L104;
 187.607 +    if(na!=0)goto L103;
 187.608 +
 187.609 +    dradf2(ido,l1,c,ch,wa+iw-1);
 187.610 +    goto L110;
 187.611 +
 187.612 +  L103:
 187.613 +    dradf2(ido,l1,ch,c,wa+iw-1);
 187.614 +    goto L110;
 187.615 +
 187.616 +  L104:
 187.617 +    if(ido==1)na=1-na;
 187.618 +    if(na!=0)goto L109;
 187.619 +
 187.620 +    dradfg(ido,ip,l1,idl1,c,c,c,ch,ch,wa+iw-1);
 187.621 +    na=1;
 187.622 +    goto L110;
 187.623 +
 187.624 +  L109:
 187.625 +    dradfg(ido,ip,l1,idl1,ch,ch,ch,c,c,wa+iw-1);
 187.626 +    na=0;
 187.627 +
 187.628 +  L110:
 187.629 +    l2=l1;
 187.630 +  }
 187.631 +
 187.632 +  if(na==1)return;
 187.633 +
 187.634 +  for(i=0;i<n;i++)c[i]=ch[i];
 187.635 +}
 187.636 +
 187.637 +static void dradb2(int ido,int l1,float *cc,float *ch,float *wa1){
 187.638 +  int i,k,t0,t1,t2,t3,t4,t5,t6;
 187.639 +  float ti2,tr2;
 187.640 +
 187.641 +  t0=l1*ido;
 187.642 +
 187.643 +  t1=0;
 187.644 +  t2=0;
 187.645 +  t3=(ido<<1)-1;
 187.646 +  for(k=0;k<l1;k++){
 187.647 +    ch[t1]=cc[t2]+cc[t3+t2];
 187.648 +    ch[t1+t0]=cc[t2]-cc[t3+t2];
 187.649 +    t2=(t1+=ido)<<1;
 187.650 +  }
 187.651 +
 187.652 +  if(ido<2)return;
 187.653 +  if(ido==2)goto L105;
 187.654 +
 187.655 +  t1=0;
 187.656 +  t2=0;
 187.657 +  for(k=0;k<l1;k++){
 187.658 +    t3=t1;
 187.659 +    t5=(t4=t2)+(ido<<1);
 187.660 +    t6=t0+t1;
 187.661 +    for(i=2;i<ido;i+=2){
 187.662 +      t3+=2;
 187.663 +      t4+=2;
 187.664 +      t5-=2;
 187.665 +      t6+=2;
 187.666 +      ch[t3-1]=cc[t4-1]+cc[t5-1];
 187.667 +      tr2=cc[t4-1]-cc[t5-1];
 187.668 +      ch[t3]=cc[t4]-cc[t5];
 187.669 +      ti2=cc[t4]+cc[t5];
 187.670 +      ch[t6-1]=wa1[i-2]*tr2-wa1[i-1]*ti2;
 187.671 +      ch[t6]=wa1[i-2]*ti2+wa1[i-1]*tr2;
 187.672 +    }
 187.673 +    t2=(t1+=ido)<<1;
 187.674 +  }
 187.675 +
 187.676 +  if(ido%2==1)return;
 187.677 +
 187.678 +L105:
 187.679 +  t1=ido-1;
 187.680 +  t2=ido-1;
 187.681 +  for(k=0;k<l1;k++){
 187.682 +    ch[t1]=cc[t2]+cc[t2];
 187.683 +    ch[t1+t0]=-(cc[t2+1]+cc[t2+1]);
 187.684 +    t1+=ido;
 187.685 +    t2+=ido<<1;
 187.686 +  }
 187.687 +}
 187.688 +
 187.689 +static void dradb3(int ido,int l1,float *cc,float *ch,float *wa1,
 187.690 +                          float *wa2){
 187.691 +  static float taur = -.5f;
 187.692 +  static float taui = .8660254037844386f;
 187.693 +  int i,k,t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
 187.694 +  float ci2,ci3,di2,di3,cr2,cr3,dr2,dr3,ti2,tr2;
 187.695 +  t0=l1*ido;
 187.696 +
 187.697 +  t1=0;
 187.698 +  t2=t0<<1;
 187.699 +  t3=ido<<1;
 187.700 +  t4=ido+(ido<<1);
 187.701 +  t5=0;
 187.702 +  for(k=0;k<l1;k++){
 187.703 +    tr2=cc[t3-1]+cc[t3-1];
 187.704 +    cr2=cc[t5]+(taur*tr2);
 187.705 +    ch[t1]=cc[t5]+tr2;
 187.706 +    ci3=taui*(cc[t3]+cc[t3]);
 187.707 +    ch[t1+t0]=cr2-ci3;
 187.708 +    ch[t1+t2]=cr2+ci3;
 187.709 +    t1+=ido;
 187.710 +    t3+=t4;
 187.711 +    t5+=t4;
 187.712 +  }
 187.713 +
 187.714 +  if(ido==1)return;
 187.715 +
 187.716 +  t1=0;
 187.717 +  t3=ido<<1;
 187.718 +  for(k=0;k<l1;k++){
 187.719 +    t7=t1+(t1<<1);
 187.720 +    t6=(t5=t7+t3);
 187.721 +    t8=t1;
 187.722 +    t10=(t9=t1+t0)+t0;
 187.723 +
 187.724 +    for(i=2;i<ido;i+=2){
 187.725 +      t5+=2;
 187.726 +      t6-=2;
 187.727 +      t7+=2;
 187.728 +      t8+=2;
 187.729 +      t9+=2;
 187.730 +      t10+=2;
 187.731 +      tr2=cc[t5-1]+cc[t6-1];
 187.732 +      cr2=cc[t7-1]+(taur*tr2);
 187.733 +      ch[t8-1]=cc[t7-1]+tr2;
 187.734 +      ti2=cc[t5]-cc[t6];
 187.735 +      ci2=cc[t7]+(taur*ti2);
 187.736 +      ch[t8]=cc[t7]+ti2;
 187.737 +      cr3=taui*(cc[t5-1]-cc[t6-1]);
 187.738 +      ci3=taui*(cc[t5]+cc[t6]);
 187.739 +      dr2=cr2-ci3;
 187.740 +      dr3=cr2+ci3;
 187.741 +      di2=ci2+cr3;
 187.742 +      di3=ci2-cr3;
 187.743 +      ch[t9-1]=wa1[i-2]*dr2-wa1[i-1]*di2;
 187.744 +      ch[t9]=wa1[i-2]*di2+wa1[i-1]*dr2;
 187.745 +      ch[t10-1]=wa2[i-2]*dr3-wa2[i-1]*di3;
 187.746 +      ch[t10]=wa2[i-2]*di3+wa2[i-1]*dr3;
 187.747 +    }
 187.748 +    t1+=ido;
 187.749 +  }
 187.750 +}
 187.751 +
 187.752 +static void dradb4(int ido,int l1,float *cc,float *ch,float *wa1,
 187.753 +                          float *wa2,float *wa3){
 187.754 +  static float sqrt2=1.414213562373095f;
 187.755 +  int i,k,t0,t1,t2,t3,t4,t5,t6,t7,t8;
 187.756 +  float ci2,ci3,ci4,cr2,cr3,cr4,ti1,ti2,ti3,ti4,tr1,tr2,tr3,tr4;
 187.757 +  t0=l1*ido;
 187.758 +
 187.759 +  t1=0;
 187.760 +  t2=ido<<2;
 187.761 +  t3=0;
 187.762 +  t6=ido<<1;
 187.763 +  for(k=0;k<l1;k++){
 187.764 +    t4=t3+t6;
 187.765 +    t5=t1;
 187.766 +    tr3=cc[t4-1]+cc[t4-1];
 187.767 +    tr4=cc[t4]+cc[t4];
 187.768 +    tr1=cc[t3]-cc[(t4+=t6)-1];
 187.769 +    tr2=cc[t3]+cc[t4-1];
 187.770 +    ch[t5]=tr2+tr3;
 187.771 +    ch[t5+=t0]=tr1-tr4;
 187.772 +    ch[t5+=t0]=tr2-tr3;
 187.773 +    ch[t5+=t0]=tr1+tr4;
 187.774 +    t1+=ido;
 187.775 +    t3+=t2;
 187.776 +  }
 187.777 +
 187.778 +  if(ido<2)return;
 187.779 +  if(ido==2)goto L105;
 187.780 +
 187.781 +  t1=0;
 187.782 +  for(k=0;k<l1;k++){
 187.783 +    t5=(t4=(t3=(t2=t1<<2)+t6))+t6;
 187.784 +    t7=t1;
 187.785 +    for(i=2;i<ido;i+=2){
 187.786 +      t2+=2;
 187.787 +      t3+=2;
 187.788 +      t4-=2;
 187.789 +      t5-=2;
 187.790 +      t7+=2;
 187.791 +      ti1=cc[t2]+cc[t5];
 187.792 +      ti2=cc[t2]-cc[t5];
 187.793 +      ti3=cc[t3]-cc[t4];
 187.794 +      tr4=cc[t3]+cc[t4];
 187.795 +      tr1=cc[t2-1]-cc[t5-1];
 187.796 +      tr2=cc[t2-1]+cc[t5-1];
 187.797 +      ti4=cc[t3-1]-cc[t4-1];
 187.798 +      tr3=cc[t3-1]+cc[t4-1];
 187.799 +      ch[t7-1]=tr2+tr3;
 187.800 +      cr3=tr2-tr3;
 187.801 +      ch[t7]=ti2+ti3;
 187.802 +      ci3=ti2-ti3;
 187.803 +      cr2=tr1-tr4;
 187.804 +      cr4=tr1+tr4;
 187.805 +      ci2=ti1+ti4;
 187.806 +      ci4=ti1-ti4;
 187.807 +
 187.808 +      ch[(t8=t7+t0)-1]=wa1[i-2]*cr2-wa1[i-1]*ci2;
 187.809 +      ch[t8]=wa1[i-2]*ci2+wa1[i-1]*cr2;
 187.810 +      ch[(t8+=t0)-1]=wa2[i-2]*cr3-wa2[i-1]*ci3;
 187.811 +      ch[t8]=wa2[i-2]*ci3+wa2[i-1]*cr3;
 187.812 +      ch[(t8+=t0)-1]=wa3[i-2]*cr4-wa3[i-1]*ci4;
 187.813 +      ch[t8]=wa3[i-2]*ci4+wa3[i-1]*cr4;
 187.814 +    }
 187.815 +    t1+=ido;
 187.816 +  }
 187.817 +
 187.818 +  if(ido%2 == 1)return;
 187.819 +
 187.820 + L105:
 187.821 +
 187.822 +  t1=ido;
 187.823 +  t2=ido<<2;
 187.824 +  t3=ido-1;
 187.825 +  t4=ido+(ido<<1);
 187.826 +  for(k=0;k<l1;k++){
 187.827 +    t5=t3;
 187.828 +    ti1=cc[t1]+cc[t4];
 187.829 +    ti2=cc[t4]-cc[t1];
 187.830 +    tr1=cc[t1-1]-cc[t4-1];
 187.831 +    tr2=cc[t1-1]+cc[t4-1];
 187.832 +    ch[t5]=tr2+tr2;
 187.833 +    ch[t5+=t0]=sqrt2*(tr1-ti1);
 187.834 +    ch[t5+=t0]=ti2+ti2;
 187.835 +    ch[t5+=t0]=-sqrt2*(tr1+ti1);
 187.836 +
 187.837 +    t3+=ido;
 187.838 +    t1+=t2;
 187.839 +    t4+=t2;
 187.840 +  }
 187.841 +}
 187.842 +
 187.843 +static void dradbg(int ido,int ip,int l1,int idl1,float *cc,float *c1,
 187.844 +            float *c2,float *ch,float *ch2,float *wa){
 187.845 +  static float tpi=6.283185307179586f;
 187.846 +  int idij,ipph,i,j,k,l,ik,is,t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,
 187.847 +      t11,t12;
 187.848 +  float dc2,ai1,ai2,ar1,ar2,ds2;
 187.849 +  int nbd;
 187.850 +  float dcp,arg,dsp,ar1h,ar2h;
 187.851 +  int ipp2;
 187.852 +
 187.853 +  t10=ip*ido;
 187.854 +  t0=l1*ido;
 187.855 +  arg=tpi/(float)ip;
 187.856 +  dcp=cos(arg);
 187.857 +  dsp=sin(arg);
 187.858 +  nbd=(ido-1)>>1;
 187.859 +  ipp2=ip;
 187.860 +  ipph=(ip+1)>>1;
 187.861 +  if(ido<l1)goto L103;
 187.862 +
 187.863 +  t1=0;
 187.864 +  t2=0;
 187.865 +  for(k=0;k<l1;k++){
 187.866 +    t3=t1;
 187.867 +    t4=t2;
 187.868 +    for(i=0;i<ido;i++){
 187.869 +      ch[t3]=cc[t4];
 187.870 +      t3++;
 187.871 +      t4++;
 187.872 +    }
 187.873 +    t1+=ido;
 187.874 +    t2+=t10;
 187.875 +  }
 187.876 +  goto L106;
 187.877 +
 187.878 + L103:
 187.879 +  t1=0;
 187.880 +  for(i=0;i<ido;i++){
 187.881 +    t2=t1;
 187.882 +    t3=t1;
 187.883 +    for(k=0;k<l1;k++){
 187.884 +      ch[t2]=cc[t3];
 187.885 +      t2+=ido;
 187.886 +      t3+=t10;
 187.887 +    }
 187.888 +    t1++;
 187.889 +  }
 187.890 +
 187.891 + L106:
 187.892 +  t1=0;
 187.893 +  t2=ipp2*t0;
 187.894 +  t7=(t5=ido<<1);
 187.895 +  for(j=1;j<ipph;j++){
 187.896 +    t1+=t0;
 187.897 +    t2-=t0;
 187.898 +    t3=t1;
 187.899 +    t4=t2;
 187.900 +    t6=t5;
 187.901 +    for(k=0;k<l1;k++){
 187.902 +      ch[t3]=cc[t6-1]+cc[t6-1];
 187.903 +      ch[t4]=cc[t6]+cc[t6];
 187.904 +      t3+=ido;
 187.905 +      t4+=ido;
 187.906 +      t6+=t10;
 187.907 +    }
 187.908 +    t5+=t7;
 187.909 +  }
 187.910 +
 187.911 +  if (ido == 1)goto L116;
 187.912 +  if(nbd<l1)goto L112;
 187.913 +
 187.914 +  t1=0;
 187.915 +  t2=ipp2*t0;
 187.916 +  t7=0;
 187.917 +  for(j=1;j<ipph;j++){
 187.918 +    t1+=t0;
 187.919 +    t2-=t0;
 187.920 +    t3=t1;
 187.921 +    t4=t2;
 187.922 +
 187.923 +    t7+=(ido<<1);
 187.924 +    t8=t7;
 187.925 +    for(k=0;k<l1;k++){
 187.926 +      t5=t3;
 187.927 +      t6=t4;
 187.928 +      t9=t8;
 187.929 +      t11=t8;
 187.930 +      for(i=2;i<ido;i+=2){
 187.931 +        t5+=2;
 187.932 +        t6+=2;
 187.933 +        t9+=2;
 187.934 +        t11-=2;
 187.935 +        ch[t5-1]=cc[t9-1]+cc[t11-1];
 187.936 +        ch[t6-1]=cc[t9-1]-cc[t11-1];
 187.937 +        ch[t5]=cc[t9]-cc[t11];
 187.938 +        ch[t6]=cc[t9]+cc[t11];
 187.939 +      }
 187.940 +      t3+=ido;
 187.941 +      t4+=ido;
 187.942 +      t8+=t10;
 187.943 +    }
 187.944 +  }
 187.945 +  goto L116;
 187.946 +
 187.947 + L112:
 187.948 +  t1=0;
 187.949 +  t2=ipp2*t0;
 187.950 +  t7=0;
 187.951 +  for(j=1;j<ipph;j++){
 187.952 +    t1+=t0;
 187.953 +    t2-=t0;
 187.954 +    t3=t1;
 187.955 +    t4=t2;
 187.956 +    t7+=(ido<<1);
 187.957 +    t8=t7;
 187.958 +    t9=t7;
 187.959 +    for(i=2;i<ido;i+=2){
 187.960 +      t3+=2;
 187.961 +      t4+=2;
 187.962 +      t8+=2;
 187.963 +      t9-=2;
 187.964 +      t5=t3;
 187.965 +      t6=t4;
 187.966 +      t11=t8;
 187.967 +      t12=t9;
 187.968 +      for(k=0;k<l1;k++){
 187.969 +        ch[t5-1]=cc[t11-1]+cc[t12-1];
 187.970 +        ch[t6-1]=cc[t11-1]-cc[t12-1];
 187.971 +        ch[t5]=cc[t11]-cc[t12];
 187.972 +        ch[t6]=cc[t11]+cc[t12];
 187.973 +        t5+=ido;
 187.974 +        t6+=ido;
 187.975 +        t11+=t10;
 187.976 +        t12+=t10;
 187.977 +      }
 187.978 +    }
 187.979 +  }
 187.980 +
 187.981 +L116:
 187.982 +  ar1=1.f;
 187.983 +  ai1=0.f;
 187.984 +  t1=0;
 187.985 +  t9=(t2=ipp2*idl1);
 187.986 +  t3=(ip-1)*idl1;
 187.987 +  for(l=1;l<ipph;l++){
 187.988 +    t1+=idl1;
 187.989 +    t2-=idl1;
 187.990 +
 187.991 +    ar1h=dcp*ar1-dsp*ai1;
 187.992 +    ai1=dcp*ai1+dsp*ar1;
 187.993 +    ar1=ar1h;
 187.994 +    t4=t1;
 187.995 +    t5=t2;
 187.996 +    t6=0;
 187.997 +    t7=idl1;
 187.998 +    t8=t3;
 187.999 +    for(ik=0;ik<idl1;ik++){
187.1000 +      c2[t4++]=ch2[t6++]+ar1*ch2[t7++];
187.1001 +      c2[t5++]=ai1*ch2[t8++];
187.1002 +    }
187.1003 +    dc2=ar1;
187.1004 +    ds2=ai1;
187.1005 +    ar2=ar1;
187.1006 +    ai2=ai1;
187.1007 +
187.1008 +    t6=idl1;
187.1009 +    t7=t9-idl1;
187.1010 +    for(j=2;j<ipph;j++){
187.1011 +      t6+=idl1;
187.1012 +      t7-=idl1;
187.1013 +      ar2h=dc2*ar2-ds2*ai2;
187.1014 +      ai2=dc2*ai2+ds2*ar2;
187.1015 +      ar2=ar2h;
187.1016 +      t4=t1;
187.1017 +      t5=t2;
187.1018 +      t11=t6;
187.1019 +      t12=t7;
187.1020 +      for(ik=0;ik<idl1;ik++){
187.1021 +        c2[t4++]+=ar2*ch2[t11++];
187.1022 +        c2[t5++]+=ai2*ch2[t12++];
187.1023 +      }
187.1024 +    }
187.1025 +  }
187.1026 +
187.1027 +  t1=0;
187.1028 +  for(j=1;j<ipph;j++){
187.1029 +    t1+=idl1;
187.1030 +    t2=t1;
187.1031 +    for(ik=0;ik<idl1;ik++)ch2[ik]+=ch2[t2++];
187.1032 +  }
187.1033 +
187.1034 +  t1=0;
187.1035 +  t2=ipp2*t0;
187.1036 +  for(j=1;j<ipph;j++){
187.1037 +    t1+=t0;
187.1038 +    t2-=t0;
187.1039 +    t3=t1;
187.1040 +    t4=t2;
187.1041 +    for(k=0;k<l1;k++){
187.1042 +      ch[t3]=c1[t3]-c1[t4];
187.1043 +      ch[t4]=c1[t3]+c1[t4];
187.1044 +      t3+=ido;
187.1045 +      t4+=ido;
187.1046 +    }
187.1047 +  }
187.1048 +
187.1049 +  if(ido==1)goto L132;
187.1050 +  if(nbd<l1)goto L128;
187.1051 +
187.1052 +  t1=0;
187.1053 +  t2=ipp2*t0;
187.1054 +  for(j=1;j<ipph;j++){
187.1055 +    t1+=t0;
187.1056 +    t2-=t0;
187.1057 +    t3=t1;
187.1058 +    t4=t2;
187.1059 +    for(k=0;k<l1;k++){
187.1060 +      t5=t3;
187.1061 +      t6=t4;
187.1062 +      for(i=2;i<ido;i+=2){
187.1063 +        t5+=2;
187.1064 +        t6+=2;
187.1065 +        ch[t5-1]=c1[t5-1]-c1[t6];
187.1066 +        ch[t6-1]=c1[t5-1]+c1[t6];
187.1067 +        ch[t5]=c1[t5]+c1[t6-1];
187.1068 +        ch[t6]=c1[t5]-c1[t6-1];
187.1069 +      }
187.1070 +      t3+=ido;
187.1071 +      t4+=ido;
187.1072 +    }
187.1073 +  }
187.1074 +  goto L132;
187.1075 +
187.1076 + L128:
187.1077 +  t1=0;
187.1078 +  t2=ipp2*t0;
187.1079 +  for(j=1;j<ipph;j++){
187.1080 +    t1+=t0;
187.1081 +    t2-=t0;
187.1082 +    t3=t1;
187.1083 +    t4=t2;
187.1084 +    for(i=2;i<ido;i+=2){
187.1085 +      t3+=2;
187.1086 +      t4+=2;
187.1087 +      t5=t3;
187.1088 +      t6=t4;
187.1089 +      for(k=0;k<l1;k++){
187.1090 +        ch[t5-1]=c1[t5-1]-c1[t6];
187.1091 +        ch[t6-1]=c1[t5-1]+c1[t6];
187.1092 +        ch[t5]=c1[t5]+c1[t6-1];
187.1093 +        ch[t6]=c1[t5]-c1[t6-1];
187.1094 +        t5+=ido;
187.1095 +        t6+=ido;
187.1096 +      }
187.1097 +    }
187.1098 +  }
187.1099 +
187.1100 +L132:
187.1101 +  if(ido==1)return;
187.1102 +
187.1103 +  for(ik=0;ik<idl1;ik++)c2[ik]=ch2[ik];
187.1104 +
187.1105 +  t1=0;
187.1106 +  for(j=1;j<ip;j++){
187.1107 +    t2=(t1+=t0);
187.1108 +    for(k=0;k<l1;k++){
187.1109 +      c1[t2]=ch[t2];
187.1110 +      t2+=ido;
187.1111 +    }
187.1112 +  }
187.1113 +
187.1114 +  if(nbd>l1)goto L139;
187.1115 +
187.1116 +  is= -ido-1;
187.1117 +  t1=0;
187.1118 +  for(j=1;j<ip;j++){
187.1119 +    is+=ido;
187.1120 +    t1+=t0;
187.1121 +    idij=is;
187.1122 +    t2=t1;
187.1123 +    for(i=2;i<ido;i+=2){
187.1124 +      t2+=2;
187.1125 +      idij+=2;
187.1126 +      t3=t2;
187.1127 +      for(k=0;k<l1;k++){
187.1128 +        c1[t3-1]=wa[idij-1]*ch[t3-1]-wa[idij]*ch[t3];
187.1129 +        c1[t3]=wa[idij-1]*ch[t3]+wa[idij]*ch[t3-1];
187.1130 +        t3+=ido;
187.1131 +      }
187.1132 +    }
187.1133 +  }
187.1134 +  return;
187.1135 +
187.1136 + L139:
187.1137 +  is= -ido-1;
187.1138 +  t1=0;
187.1139 +  for(j=1;j<ip;j++){
187.1140 +    is+=ido;
187.1141 +    t1+=t0;
187.1142 +    t2=t1;
187.1143 +    for(k=0;k<l1;k++){
187.1144 +      idij=is;
187.1145 +      t3=t2;
187.1146 +      for(i=2;i<ido;i+=2){
187.1147 +        idij+=2;
187.1148 +        t3+=2;
187.1149 +        c1[t3-1]=wa[idij-1]*ch[t3-1]-wa[idij]*ch[t3];
187.1150 +        c1[t3]=wa[idij-1]*ch[t3]+wa[idij]*ch[t3-1];
187.1151 +      }
187.1152 +      t2+=ido;
187.1153 +    }
187.1154 +  }
187.1155 +}
187.1156 +
187.1157 +static void drftb1(int n, float *c, float *ch, float *wa, int *ifac){
187.1158 +  int i,k1,l1,l2;
187.1159 +  int na;
187.1160 +  int nf,ip,iw,ix2,ix3,ido,idl1;
187.1161 +
187.1162 +  nf=ifac[1];
187.1163 +  na=0;
187.1164 +  l1=1;
187.1165 +  iw=1;
187.1166 +
187.1167 +  for(k1=0;k1<nf;k1++){
187.1168 +    ip=ifac[k1 + 2];
187.1169 +    l2=ip*l1;
187.1170 +    ido=n/l2;
187.1171 +    idl1=ido*l1;
187.1172 +    if(ip!=4)goto L103;
187.1173 +    ix2=iw+ido;
187.1174 +    ix3=ix2+ido;
187.1175 +
187.1176 +    if(na!=0)
187.1177 +      dradb4(ido,l1,ch,c,wa+iw-1,wa+ix2-1,wa+ix3-1);
187.1178 +    else
187.1179 +      dradb4(ido,l1,c,ch,wa+iw-1,wa+ix2-1,wa+ix3-1);
187.1180 +    na=1-na;
187.1181 +    goto L115;
187.1182 +
187.1183 +  L103:
187.1184 +    if(ip!=2)goto L106;
187.1185 +
187.1186 +    if(na!=0)
187.1187 +      dradb2(ido,l1,ch,c,wa+iw-1);
187.1188 +    else
187.1189 +      dradb2(ido,l1,c,ch,wa+iw-1);
187.1190 +    na=1-na;
187.1191 +    goto L115;
187.1192 +
187.1193 +  L106:
187.1194 +    if(ip!=3)goto L109;
187.1195 +
187.1196 +    ix2=iw+ido;
187.1197 +    if(na!=0)
187.1198 +      dradb3(ido,l1,ch,c,wa+iw-1,wa+ix2-1);
187.1199 +    else
187.1200 +      dradb3(ido,l1,c,ch,wa+iw-1,wa+ix2-1);
187.1201 +    na=1-na;
187.1202 +    goto L115;
187.1203 +
187.1204 +  L109:
187.1205 +/*    The radix five case can be translated later..... */
187.1206 +/*    if(ip!=5)goto L112;
187.1207 +
187.1208 +    ix2=iw+ido;
187.1209 +    ix3=ix2+ido;
187.1210 +    ix4=ix3+ido;
187.1211 +    if(na!=0)
187.1212 +      dradb5(ido,l1,ch,c,wa+iw-1,wa+ix2-1,wa+ix3-1,wa+ix4-1);
187.1213 +    else
187.1214 +      dradb5(ido,l1,c,ch,wa+iw-1,wa+ix2-1,wa+ix3-1,wa+ix4-1);
187.1215 +    na=1-na;
187.1216 +    goto L115;
187.1217 +
187.1218 +  L112:*/
187.1219 +    if(na!=0)
187.1220 +      dradbg(ido,ip,l1,idl1,ch,ch,ch,c,c,wa+iw-1);
187.1221 +    else
187.1222 +      dradbg(ido,ip,l1,idl1,c,c,c,ch,ch,wa+iw-1);
187.1223 +    if(ido==1)na=1-na;
187.1224 +
187.1225 +  L115:
187.1226 +    l1=l2;
187.1227 +    iw+=(ip-1)*ido;
187.1228 +  }
187.1229 +
187.1230 +  if(na==0)return;
187.1231 +
187.1232 +  for(i=0;i<n;i++)c[i]=ch[i];
187.1233 +}
187.1234 +
187.1235 +void drft_forward(drft_lookup *l,float *data){
187.1236 +  if(l->n==1)return;
187.1237 +  drftf1(l->n,data,l->trigcache,l->trigcache+l->n,l->splitcache);
187.1238 +}
187.1239 +
187.1240 +void drft_backward(drft_lookup *l,float *data){
187.1241 +  if (l->n==1)return;
187.1242 +  drftb1(l->n,data,l->trigcache,l->trigcache+l->n,l->splitcache);
187.1243 +}
187.1244 +
187.1245 +void drft_init(drft_lookup *l,int n){
187.1246 +  l->n=n;
187.1247 +  l->trigcache=_ogg_calloc(3*n,sizeof(*l->trigcache));
187.1248 +  l->splitcache=_ogg_calloc(32,sizeof(*l->splitcache));
187.1249 +  fdrffti(n, l->trigcache, l->splitcache);
187.1250 +}
187.1251 +
187.1252 +void drft_clear(drft_lookup *l){
187.1253 +  if(l){
187.1254 +    if(l->trigcache)_ogg_free(l->trigcache);
187.1255 +    if(l->splitcache)_ogg_free(l->splitcache);
187.1256 +    memset(l,0,sizeof(*l));
187.1257 +  }
187.1258 +}
   188.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   188.2 +++ b/libs/vorbis/smallft.h	Sun Nov 01 00:36:56 2015 +0200
   188.3 @@ -0,0 +1,34 @@
   188.4 +/********************************************************************
   188.5 + *                                                                  *
   188.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   188.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   188.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   188.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  188.10 + *                                                                  *
  188.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007             *
  188.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  188.13 + *                                                                  *
  188.14 + ********************************************************************
  188.15 +
  188.16 + function: fft transform
  188.17 + last mod: $Id: smallft.h 13293 2007-07-24 00:09:47Z xiphmont $
  188.18 +
  188.19 + ********************************************************************/
  188.20 +
  188.21 +#ifndef _V_SMFT_H_
  188.22 +#define _V_SMFT_H_
  188.23 +
  188.24 +#include "vorbis/codec.h"
  188.25 +
  188.26 +typedef struct {
  188.27 +  int n;
  188.28 +  float *trigcache;
  188.29 +  int *splitcache;
  188.30 +} drft_lookup;
  188.31 +
  188.32 +extern void drft_forward(drft_lookup *l,float *data);
  188.33 +extern void drft_backward(drft_lookup *l,float *data);
  188.34 +extern void drft_init(drft_lookup *l,int n);
  188.35 +extern void drft_clear(drft_lookup *l);
  188.36 +
  188.37 +#endif
   189.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   189.2 +++ b/libs/vorbis/synthesis.c	Sun Nov 01 00:36:56 2015 +0200
   189.3 @@ -0,0 +1,184 @@
   189.4 +/********************************************************************
   189.5 + *                                                                  *
   189.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   189.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   189.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   189.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  189.10 + *                                                                  *
  189.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
  189.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  189.13 + *                                                                  *
  189.14 + ********************************************************************
  189.15 +
  189.16 + function: single-block PCM synthesis
  189.17 + last mod: $Id: synthesis.c 17474 2010-09-30 03:41:41Z gmaxwell $
  189.18 +
  189.19 + ********************************************************************/
  189.20 +
  189.21 +#include <stdio.h>
  189.22 +#include <ogg/ogg.h>
  189.23 +#include "vorbis/codec.h"
  189.24 +#include "codec_internal.h"
  189.25 +#include "registry.h"
  189.26 +#include "misc.h"
  189.27 +#include "os.h"
  189.28 +
  189.29 +int vorbis_synthesis(vorbis_block *vb,ogg_packet *op){
  189.30 +  vorbis_dsp_state     *vd= vb ? vb->vd : 0;
  189.31 +  private_state        *b= vd ? vd->backend_state : 0;
  189.32 +  vorbis_info          *vi= vd ? vd->vi : 0;
  189.33 +  codec_setup_info     *ci= vi ? vi->codec_setup : 0;
  189.34 +  oggpack_buffer       *opb=vb ? &vb->opb : 0;
  189.35 +  int                   type,mode,i;
  189.36 +
  189.37 +  if (!vd || !b || !vi || !ci || !opb) {
  189.38 +    return OV_EBADPACKET;
  189.39 +  }
  189.40 +
  189.41 +  /* first things first.  Make sure decode is ready */
  189.42 +  _vorbis_block_ripcord(vb);
  189.43 +  oggpack_readinit(opb,op->packet,op->bytes);
  189.44 +
  189.45 +  /* Check the packet type */
  189.46 +  if(oggpack_read(opb,1)!=0){
  189.47 +    /* Oops.  This is not an audio data packet */
  189.48 +    return(OV_ENOTAUDIO);
  189.49 +  }
  189.50 +
  189.51 +  /* read our mode and pre/post windowsize */
  189.52 +  mode=oggpack_read(opb,b->modebits);
  189.53 +  if(mode==-1){
  189.54 +    return(OV_EBADPACKET);
  189.55 +  }
  189.56 +
  189.57 +  vb->mode=mode;
  189.58 +  if(!ci->mode_param[mode]){
  189.59 +    return(OV_EBADPACKET);
  189.60 +  }
  189.61 +
  189.62 +  vb->W=ci->mode_param[mode]->blockflag;
  189.63 +  if(vb->W){
  189.64 +
  189.65 +    /* this doesn;t get mapped through mode selection as it's used
  189.66 +       only for window selection */
  189.67 +    vb->lW=oggpack_read(opb,1);
  189.68 +    vb->nW=oggpack_read(opb,1);
  189.69 +    if(vb->nW==-1){
  189.70 +      return(OV_EBADPACKET);
  189.71 +    }
  189.72 +  }else{
  189.73 +    vb->lW=0;
  189.74 +    vb->nW=0;
  189.75 +  }
  189.76 +
  189.77 +  /* more setup */
  189.78 +  vb->granulepos=op->granulepos;
  189.79 +  vb->sequence=op->packetno;
  189.80 +  vb->eofflag=op->e_o_s;
  189.81 +
  189.82 +  /* alloc pcm passback storage */
  189.83 +  vb->pcmend=ci->blocksizes[vb->W];
  189.84 +  vb->pcm=_vorbis_block_alloc(vb,sizeof(*vb->pcm)*vi->channels);
  189.85 +  for(i=0;i<vi->channels;i++)
  189.86 +    vb->pcm[i]=_vorbis_block_alloc(vb,vb->pcmend*sizeof(*vb->pcm[i]));
  189.87 +
  189.88 +  /* unpack_header enforces range checking */
  189.89 +  type=ci->map_type[ci->mode_param[mode]->mapping];
  189.90 +
  189.91 +  return(_mapping_P[type]->inverse(vb,ci->map_param[ci->mode_param[mode]->
  189.92 +                                                   mapping]));
  189.93 +}
  189.94 +
  189.95 +/* used to track pcm position without actually performing decode.
  189.96 +   Useful for sequential 'fast forward' */
  189.97 +int vorbis_synthesis_trackonly(vorbis_block *vb,ogg_packet *op){
  189.98 +  vorbis_dsp_state     *vd=vb->vd;
  189.99 +  private_state        *b=vd->backend_state;
 189.100 +  vorbis_info          *vi=vd->vi;
 189.101 +  codec_setup_info     *ci=vi->codec_setup;
 189.102 +  oggpack_buffer       *opb=&vb->opb;
 189.103 +  int                   mode;
 189.104 +
 189.105 +  /* first things first.  Make sure decode is ready */
 189.106 +  _vorbis_block_ripcord(vb);
 189.107 +  oggpack_readinit(opb,op->packet,op->bytes);
 189.108 +
 189.109 +  /* Check the packet type */
 189.110 +  if(oggpack_read(opb,1)!=0){
 189.111 +    /* Oops.  This is not an audio data packet */
 189.112 +    return(OV_ENOTAUDIO);
 189.113 +  }
 189.114 +
 189.115 +  /* read our mode and pre/post windowsize */
 189.116 +  mode=oggpack_read(opb,b->modebits);
 189.117 +  if(mode==-1)return(OV_EBADPACKET);
 189.118 +
 189.119 +  vb->mode=mode;
 189.120 +  if(!ci->mode_param[mode]){
 189.121 +    return(OV_EBADPACKET);
 189.122 +  }
 189.123 +  
 189.124 +  vb->W=ci->mode_param[mode]->blockflag;
 189.125 +  if(vb->W){
 189.126 +    vb->lW=oggpack_read(opb,1);
 189.127 +    vb->nW=oggpack_read(opb,1);
 189.128 +    if(vb->nW==-1)   return(OV_EBADPACKET);
 189.129 +  }else{
 189.130 +    vb->lW=0;
 189.131 +    vb->nW=0;
 189.132 +  }
 189.133 +
 189.134 +  /* more setup */
 189.135 +  vb->granulepos=op->granulepos;
 189.136 +  vb->sequence=op->packetno;
 189.137 +  vb->eofflag=op->e_o_s;
 189.138 +
 189.139 +  /* no pcm */
 189.140 +  vb->pcmend=0;
 189.141 +  vb->pcm=NULL;
 189.142 +
 189.143 +  return(0);
 189.144 +}
 189.145 +
 189.146 +long vorbis_packet_blocksize(vorbis_info *vi,ogg_packet *op){
 189.147 +  codec_setup_info     *ci=vi->codec_setup;
 189.148 +  oggpack_buffer       opb;
 189.149 +  int                  mode;
 189.150 +
 189.151 +  oggpack_readinit(&opb,op->packet,op->bytes);
 189.152 +
 189.153 +  /* Check the packet type */
 189.154 +  if(oggpack_read(&opb,1)!=0){
 189.155 +    /* Oops.  This is not an audio data packet */
 189.156 +    return(OV_ENOTAUDIO);
 189.157 +  }
 189.158 +
 189.159 +  {
 189.160 +    int modebits=0;
 189.161 +    int v=ci->modes;
 189.162 +    while(v>1){
 189.163 +      modebits++;
 189.164 +      v>>=1;
 189.165 +    }
 189.166 +
 189.167 +    /* read our mode and pre/post windowsize */
 189.168 +    mode=oggpack_read(&opb,modebits);
 189.169 +  }
 189.170 +  if(mode==-1)return(OV_EBADPACKET);
 189.171 +  return(ci->blocksizes[ci->mode_param[mode]->blockflag]);
 189.172 +}
 189.173 +
 189.174 +int vorbis_synthesis_halfrate(vorbis_info *vi,int flag){
 189.175 +  /* set / clear half-sample-rate mode */
 189.176 +  codec_setup_info     *ci=vi->codec_setup;
 189.177 +
 189.178 +  /* right now, our MDCT can't handle < 64 sample windows. */
 189.179 +  if(ci->blocksizes[0]<=64 && flag)return -1;
 189.180 +  ci->halfrate_flag=(flag?1:0);
 189.181 +  return 0;
 189.182 +}
 189.183 +
 189.184 +int vorbis_synthesis_halfrate_p(vorbis_info *vi){
 189.185 +  codec_setup_info     *ci=vi->codec_setup;
 189.186 +  return ci->halfrate_flag;
 189.187 +}
   190.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   190.2 +++ b/libs/vorbis/vorbisenc.c	Sun Nov 01 00:36:56 2015 +0200
   190.3 @@ -0,0 +1,1215 @@
   190.4 +/********************************************************************
   190.5 + *                                                                  *
   190.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   190.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   190.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   190.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  190.10 + *                                                                  *
  190.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
  190.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  190.13 + *                                                                  *
  190.14 + ********************************************************************
  190.15 +
  190.16 + function: simple programmatic interface for encoder mode setup
  190.17 + last mod: $Id: vorbisenc.c 17028 2010-03-25 05:22:15Z xiphmont $
  190.18 +
  190.19 + ********************************************************************/
  190.20 +
  190.21 +#include <stdlib.h>
  190.22 +#include <string.h>
  190.23 +#include <math.h>
  190.24 +
  190.25 +#include "vorbis/codec.h"
  190.26 +#include "vorbis/vorbisenc.h"
  190.27 +
  190.28 +#include "codec_internal.h"
  190.29 +
  190.30 +#include "os.h"
  190.31 +#include "misc.h"
  190.32 +
  190.33 +/* careful with this; it's using static array sizing to make managing
  190.34 +   all the modes a little less annoying.  If we use a residue backend
  190.35 +   with > 12 partition types, or a different division of iteration,
  190.36 +   this needs to be updated. */
  190.37 +typedef struct {
  190.38 +  const static_codebook *books[12][4];
  190.39 +} static_bookblock;
  190.40 +
  190.41 +typedef struct {
  190.42 +  int res_type;
  190.43 +  int limit_type; /* 0 lowpass limited, 1 point stereo limited */
  190.44 +  int grouping;
  190.45 +  const vorbis_info_residue0 *res;
  190.46 +  const static_codebook  *book_aux;
  190.47 +  const static_codebook  *book_aux_managed;
  190.48 +  const static_bookblock *books_base;
  190.49 +  const static_bookblock *books_base_managed;
  190.50 +} vorbis_residue_template;
  190.51 +
  190.52 +typedef struct {
  190.53 +  const vorbis_info_mapping0    *map;
  190.54 +  const vorbis_residue_template *res;
  190.55 +} vorbis_mapping_template;
  190.56 +
  190.57 +typedef struct vp_adjblock{
  190.58 +  int block[P_BANDS];
  190.59 +} vp_adjblock;
  190.60 +
  190.61 +typedef struct {
  190.62 +  int data[NOISE_COMPAND_LEVELS];
  190.63 +} compandblock;
  190.64 +
  190.65 +/* high level configuration information for setting things up
  190.66 +   step-by-step with the detailed vorbis_encode_ctl interface.
  190.67 +   There's a fair amount of redundancy such that interactive setup
  190.68 +   does not directly deal with any vorbis_info or codec_setup_info
  190.69 +   initialization; it's all stored (until full init) in this highlevel
  190.70 +   setup, then flushed out to the real codec setup structs later. */
  190.71 +
  190.72 +typedef struct {
  190.73 +  int att[P_NOISECURVES];
  190.74 +  float boost;
  190.75 +  float decay;
  190.76 +} att3;
  190.77 +typedef struct { int data[P_NOISECURVES]; } adj3;
  190.78 +
  190.79 +typedef struct {
  190.80 +  int   pre[PACKETBLOBS];
  190.81 +  int   post[PACKETBLOBS];
  190.82 +  float kHz[PACKETBLOBS];
  190.83 +  float lowpasskHz[PACKETBLOBS];
  190.84 +} adj_stereo;
  190.85 +
  190.86 +typedef struct {
  190.87 +  int lo;
  190.88 +  int hi;
  190.89 +  int fixed;
  190.90 +} noiseguard;
  190.91 +typedef struct {
  190.92 +  int data[P_NOISECURVES][17];
  190.93 +} noise3;
  190.94 +
  190.95 +typedef struct {
  190.96 +  int      mappings;
  190.97 +  const double  *rate_mapping;
  190.98 +  const double  *quality_mapping;
  190.99 +  int      coupling_restriction;
 190.100 +  long     samplerate_min_restriction;
 190.101 +  long     samplerate_max_restriction;
 190.102 +
 190.103 +
 190.104 +  const int     *blocksize_short;
 190.105 +  const int     *blocksize_long;
 190.106 +
 190.107 +  const att3    *psy_tone_masteratt;
 190.108 +  const int     *psy_tone_0dB;
 190.109 +  const int     *psy_tone_dBsuppress;
 190.110 +
 190.111 +  const vp_adjblock *psy_tone_adj_impulse;
 190.112 +  const vp_adjblock *psy_tone_adj_long;
 190.113 +  const vp_adjblock *psy_tone_adj_other;
 190.114 +
 190.115 +  const noiseguard  *psy_noiseguards;
 190.116 +  const noise3      *psy_noise_bias_impulse;
 190.117 +  const noise3      *psy_noise_bias_padding;
 190.118 +  const noise3      *psy_noise_bias_trans;
 190.119 +  const noise3      *psy_noise_bias_long;
 190.120 +  const int         *psy_noise_dBsuppress;
 190.121 +
 190.122 +  const compandblock  *psy_noise_compand;
 190.123 +  const double        *psy_noise_compand_short_mapping;
 190.124 +  const double        *psy_noise_compand_long_mapping;
 190.125 +
 190.126 +  const int      *psy_noise_normal_start[2];
 190.127 +  const int      *psy_noise_normal_partition[2];
 190.128 +  const double   *psy_noise_normal_thresh;
 190.129 +
 190.130 +  const int      *psy_ath_float;
 190.131 +  const int      *psy_ath_abs;
 190.132 +
 190.133 +  const double   *psy_lowpass;
 190.134 +
 190.135 +  const vorbis_info_psy_global *global_params;
 190.136 +  const double     *global_mapping;
 190.137 +  const adj_stereo *stereo_modes;
 190.138 +
 190.139 +  const static_codebook *const *const *const floor_books;
 190.140 +  const vorbis_info_floor1 *floor_params;
 190.141 +  const int floor_mappings;
 190.142 +  const int **floor_mapping_list;
 190.143 +
 190.144 +  const vorbis_mapping_template *maps;
 190.145 +} ve_setup_data_template;
 190.146 +
 190.147 +/* a few static coder conventions */
 190.148 +static const vorbis_info_mode _mode_template[2]={
 190.149 +  {0,0,0,0},
 190.150 +  {1,0,0,1}
 190.151 +};
 190.152 +
 190.153 +static const vorbis_info_mapping0 _map_nominal[2]={
 190.154 +  {1, {0,0}, {0}, {0}, 1,{0},{1}},
 190.155 +  {1, {0,0}, {1}, {1}, 1,{0},{1}}
 190.156 +};
 190.157 +
 190.158 +#include "modes/setup_44.h"
 190.159 +#include "modes/setup_44u.h"
 190.160 +#include "modes/setup_44p51.h"
 190.161 +#include "modes/setup_32.h"
 190.162 +#include "modes/setup_8.h"
 190.163 +#include "modes/setup_11.h"
 190.164 +#include "modes/setup_16.h"
 190.165 +#include "modes/setup_22.h"
 190.166 +#include "modes/setup_X.h"
 190.167 +
 190.168 +static const ve_setup_data_template *const setup_list[]={
 190.169 +  &ve_setup_44_stereo,
 190.170 +  &ve_setup_44_51,
 190.171 +  &ve_setup_44_uncoupled,
 190.172 +
 190.173 +  &ve_setup_32_stereo,
 190.174 +  &ve_setup_32_uncoupled,
 190.175 +
 190.176 +  &ve_setup_22_stereo,
 190.177 +  &ve_setup_22_uncoupled,
 190.178 +  &ve_setup_16_stereo,
 190.179 +  &ve_setup_16_uncoupled,
 190.180 +
 190.181 +  &ve_setup_11_stereo,
 190.182 +  &ve_setup_11_uncoupled,
 190.183 +  &ve_setup_8_stereo,
 190.184 +  &ve_setup_8_uncoupled,
 190.185 +
 190.186 +  &ve_setup_X_stereo,
 190.187 +  &ve_setup_X_uncoupled,
 190.188 +  &ve_setup_XX_stereo,
 190.189 +  &ve_setup_XX_uncoupled,
 190.190 +  0
 190.191 +};
 190.192 +
 190.193 +static void vorbis_encode_floor_setup(vorbis_info *vi,int s,
 190.194 +                                     const static_codebook *const *const *const books,
 190.195 +                                     const vorbis_info_floor1 *in,
 190.196 +                                     const int *x){
 190.197 +  int i,k,is=s;
 190.198 +  vorbis_info_floor1 *f=_ogg_calloc(1,sizeof(*f));
 190.199 +  codec_setup_info *ci=vi->codec_setup;
 190.200 +
 190.201 +  memcpy(f,in+x[is],sizeof(*f));
 190.202 +
 190.203 +  /* books */
 190.204 +  {
 190.205 +    int partitions=f->partitions;
 190.206 +    int maxclass=-1;
 190.207 +    int maxbook=-1;
 190.208 +    for(i=0;i<partitions;i++)
 190.209 +      if(f->partitionclass[i]>maxclass)maxclass=f->partitionclass[i];
 190.210 +    for(i=0;i<=maxclass;i++){
 190.211 +      if(f->class_book[i]>maxbook)maxbook=f->class_book[i];
 190.212 +      f->class_book[i]+=ci->books;
 190.213 +      for(k=0;k<(1<<f->class_subs[i]);k++){
 190.214 +        if(f->class_subbook[i][k]>maxbook)maxbook=f->class_subbook[i][k];
 190.215 +        if(f->class_subbook[i][k]>=0)f->class_subbook[i][k]+=ci->books;
 190.216 +      }
 190.217 +    }
 190.218 +
 190.219 +    for(i=0;i<=maxbook;i++)
 190.220 +      ci->book_param[ci->books++]=(static_codebook *)books[x[is]][i];
 190.221 +  }
 190.222 +
 190.223 +  /* for now, we're only using floor 1 */
 190.224 +  ci->floor_type[ci->floors]=1;
 190.225 +  ci->floor_param[ci->floors]=f;
 190.226 +  ci->floors++;
 190.227 +
 190.228 +  return;
 190.229 +}
 190.230 +
 190.231 +static void vorbis_encode_global_psych_setup(vorbis_info *vi,double s,
 190.232 +                                            const vorbis_info_psy_global *in,
 190.233 +                                            const double *x){
 190.234 +  int i,is=s;
 190.235 +  double ds=s-is;
 190.236 +  codec_setup_info *ci=vi->codec_setup;
 190.237 +  vorbis_info_psy_global *g=&ci->psy_g_param;
 190.238 +
 190.239 +  memcpy(g,in+(int)x[is],sizeof(*g));
 190.240 +
 190.241 +  ds=x[is]*(1.-ds)+x[is+1]*ds;
 190.242 +  is=(int)ds;
 190.243 +  ds-=is;
 190.244 +  if(ds==0 && is>0){
 190.245 +    is--;
 190.246 +    ds=1.;
 190.247 +  }
 190.248 +
 190.249 +  /* interpolate the trigger threshholds */
 190.250 +  for(i=0;i<4;i++){
 190.251 +    g->preecho_thresh[i]=in[is].preecho_thresh[i]*(1.-ds)+in[is+1].preecho_thresh[i]*ds;
 190.252 +    g->postecho_thresh[i]=in[is].postecho_thresh[i]*(1.-ds)+in[is+1].postecho_thresh[i]*ds;
 190.253 +  }
 190.254 +  g->ampmax_att_per_sec=ci->hi.amplitude_track_dBpersec;
 190.255 +  return;
 190.256 +}
 190.257 +
 190.258 +static void vorbis_encode_global_stereo(vorbis_info *vi,
 190.259 +                                        const highlevel_encode_setup *const hi,
 190.260 +                                        const adj_stereo *p){
 190.261 +  float s=hi->stereo_point_setting;
 190.262 +  int i,is=s;
 190.263 +  double ds=s-is;
 190.264 +  codec_setup_info *ci=vi->codec_setup;
 190.265 +  vorbis_info_psy_global *g=&ci->psy_g_param;
 190.266 +
 190.267 +  if(p){
 190.268 +    memcpy(g->coupling_prepointamp,p[is].pre,sizeof(*p[is].pre)*PACKETBLOBS);
 190.269 +    memcpy(g->coupling_postpointamp,p[is].post,sizeof(*p[is].post)*PACKETBLOBS);
 190.270 +
 190.271 +    if(hi->managed){
 190.272 +      /* interpolate the kHz threshholds */
 190.273 +      for(i=0;i<PACKETBLOBS;i++){
 190.274 +        float kHz=p[is].kHz[i]*(1.-ds)+p[is+1].kHz[i]*ds;
 190.275 +        g->coupling_pointlimit[0][i]=kHz*1000./vi->rate*ci->blocksizes[0];
 190.276 +        g->coupling_pointlimit[1][i]=kHz*1000./vi->rate*ci->blocksizes[1];
 190.277 +        g->coupling_pkHz[i]=kHz;
 190.278 +
 190.279 +        kHz=p[is].lowpasskHz[i]*(1.-ds)+p[is+1].lowpasskHz[i]*ds;
 190.280 +        g->sliding_lowpass[0][i]=kHz*1000./vi->rate*ci->blocksizes[0];
 190.281 +        g->sliding_lowpass[1][i]=kHz*1000./vi->rate*ci->blocksizes[1];
 190.282 +
 190.283 +      }
 190.284 +    }else{
 190.285 +      float kHz=p[is].kHz[PACKETBLOBS/2]*(1.-ds)+p[is+1].kHz[PACKETBLOBS/2]*ds;
 190.286 +      for(i=0;i<PACKETBLOBS;i++){
 190.287 +        g->coupling_pointlimit[0][i]=kHz*1000./vi->rate*ci->blocksizes[0];
 190.288 +        g->coupling_pointlimit[1][i]=kHz*1000./vi->rate*ci->blocksizes[1];
 190.289 +        g->coupling_pkHz[i]=kHz;
 190.290 +      }
 190.291 +
 190.292 +      kHz=p[is].lowpasskHz[PACKETBLOBS/2]*(1.-ds)+p[is+1].lowpasskHz[PACKETBLOBS/2]*ds;
 190.293 +      for(i=0;i<PACKETBLOBS;i++){
 190.294 +        g->sliding_lowpass[0][i]=kHz*1000./vi->rate*ci->blocksizes[0];
 190.295 +        g->sliding_lowpass[1][i]=kHz*1000./vi->rate*ci->blocksizes[1];
 190.296 +      }
 190.297 +    }
 190.298 +  }else{
 190.299 +    for(i=0;i<PACKETBLOBS;i++){
 190.300 +      g->sliding_lowpass[0][i]=ci->blocksizes[0];
 190.301 +      g->sliding_lowpass[1][i]=ci->blocksizes[1];
 190.302 +    }
 190.303 +  }
 190.304 +  return;
 190.305 +}
 190.306 +
 190.307 +static void vorbis_encode_psyset_setup(vorbis_info *vi,double s,
 190.308 +                                       const int *nn_start,
 190.309 +                                       const int *nn_partition,
 190.310 +                                       const double *nn_thresh,
 190.311 +                                       int block){
 190.312 +  codec_setup_info *ci=vi->codec_setup;
 190.313 +  vorbis_info_psy *p=ci->psy_param[block];
 190.314 +  highlevel_encode_setup *hi=&ci->hi;
 190.315 +  int is=s;
 190.316 +
 190.317 +  if(block>=ci->psys)
 190.318 +    ci->psys=block+1;
 190.319 +  if(!p){
 190.320 +    p=_ogg_calloc(1,sizeof(*p));
 190.321 +    ci->psy_param[block]=p;
 190.322 +  }
 190.323 +
 190.324 +  memcpy(p,&_psy_info_template,sizeof(*p));
 190.325 +  p->blockflag=block>>1;
 190.326 +
 190.327 +  if(hi->noise_normalize_p){
 190.328 +    p->normal_p=1;
 190.329 +    p->normal_start=nn_start[is];
 190.330 +    p->normal_partition=nn_partition[is];
 190.331 +    p->normal_thresh=nn_thresh[is];
 190.332 +  }
 190.333 +
 190.334 +  return;
 190.335 +}
 190.336 +
 190.337 +static void vorbis_encode_tonemask_setup(vorbis_info *vi,double s,int block,
 190.338 +                                         const att3 *att,
 190.339 +                                         const int  *max,
 190.340 +                                         const vp_adjblock *in){
 190.341 +  int i,is=s;
 190.342 +  double ds=s-is;
 190.343 +  codec_setup_info *ci=vi->codec_setup;
 190.344 +  vorbis_info_psy *p=ci->psy_param[block];
 190.345 +
 190.346 +  /* 0 and 2 are only used by bitmanagement, but there's no harm to always
 190.347 +     filling the values in here */
 190.348 +  p->tone_masteratt[0]=att[is].att[0]*(1.-ds)+att[is+1].att[0]*ds;
 190.349 +  p->tone_masteratt[1]=att[is].att[1]*(1.-ds)+att[is+1].att[1]*ds;
 190.350 +  p->tone_masteratt[2]=att[is].att[2]*(1.-ds)+att[is+1].att[2]*ds;
 190.351 +  p->tone_centerboost=att[is].boost*(1.-ds)+att[is+1].boost*ds;
 190.352 +  p->tone_decay=att[is].decay*(1.-ds)+att[is+1].decay*ds;
 190.353 +
 190.354 +  p->max_curve_dB=max[is]*(1.-ds)+max[is+1]*ds;
 190.355 +
 190.356 +  for(i=0;i<P_BANDS;i++)
 190.357 +    p->toneatt[i]=in[is].block[i]*(1.-ds)+in[is+1].block[i]*ds;
 190.358 +  return;
 190.359 +}
 190.360 +
 190.361 +
 190.362 +static void vorbis_encode_compand_setup(vorbis_info *vi,double s,int block,
 190.363 +                                        const compandblock *in,
 190.364 +                                        const double *x){
 190.365 +  int i,is=s;
 190.366 +  double ds=s-is;
 190.367 +  codec_setup_info *ci=vi->codec_setup;
 190.368 +  vorbis_info_psy *p=ci->psy_param[block];
 190.369 +
 190.370 +  ds=x[is]*(1.-ds)+x[is+1]*ds;
 190.371 +  is=(int)ds;
 190.372 +  ds-=is;
 190.373 +  if(ds==0 && is>0){
 190.374 +    is--;
 190.375 +    ds=1.;
 190.376 +  }
 190.377 +
 190.378 +  /* interpolate the compander settings */
 190.379 +  for(i=0;i<NOISE_COMPAND_LEVELS;i++)
 190.380 +    p->noisecompand[i]=in[is].data[i]*(1.-ds)+in[is+1].data[i]*ds;
 190.381 +  return;
 190.382 +}
 190.383 +
 190.384 +static void vorbis_encode_peak_setup(vorbis_info *vi,double s,int block,
 190.385 +                                    const int *suppress){
 190.386 +  int is=s;
 190.387 +  double ds=s-is;
 190.388 +  codec_setup_info *ci=vi->codec_setup;
 190.389 +  vorbis_info_psy *p=ci->psy_param[block];
 190.390 +
 190.391 +  p->tone_abs_limit=suppress[is]*(1.-ds)+suppress[is+1]*ds;
 190.392 +
 190.393 +  return;
 190.394 +}
 190.395 +
 190.396 +static void vorbis_encode_noisebias_setup(vorbis_info *vi,double s,int block,
 190.397 +                                         const int *suppress,
 190.398 +                                         const noise3 *in,
 190.399 +                                         const noiseguard *guard,
 190.400 +                                         double userbias){
 190.401 +  int i,is=s,j;
 190.402 +  double ds=s-is;
 190.403 +  codec_setup_info *ci=vi->codec_setup;
 190.404 +  vorbis_info_psy *p=ci->psy_param[block];
 190.405 +
 190.406 +  p->noisemaxsupp=suppress[is]*(1.-ds)+suppress[is+1]*ds;
 190.407 +  p->noisewindowlomin=guard[block].lo;
 190.408 +  p->noisewindowhimin=guard[block].hi;
 190.409 +  p->noisewindowfixed=guard[block].fixed;
 190.410 +
 190.411 +  for(j=0;j<P_NOISECURVES;j++)
 190.412 +    for(i=0;i<P_BANDS;i++)
 190.413 +      p->noiseoff[j][i]=in[is].data[j][i]*(1.-ds)+in[is+1].data[j][i]*ds;
 190.414 +
 190.415 +  /* impulse blocks may take a user specified bias to boost the
 190.416 +     nominal/high noise encoding depth */
 190.417 +  for(j=0;j<P_NOISECURVES;j++){
 190.418 +    float min=p->noiseoff[j][0]+6; /* the lowest it can go */
 190.419 +    for(i=0;i<P_BANDS;i++){
 190.420 +      p->noiseoff[j][i]+=userbias;
 190.421 +      if(p->noiseoff[j][i]<min)p->noiseoff[j][i]=min;
 190.422 +    }
 190.423 +  }
 190.424 +
 190.425 +  return;
 190.426 +}
 190.427 +
 190.428 +static void vorbis_encode_ath_setup(vorbis_info *vi,int block){
 190.429 +  codec_setup_info *ci=vi->codec_setup;
 190.430 +  vorbis_info_psy *p=ci->psy_param[block];
 190.431 +
 190.432 +  p->ath_adjatt=ci->hi.ath_floating_dB;
 190.433 +  p->ath_maxatt=ci->hi.ath_absolute_dB;
 190.434 +  return;
 190.435 +}
 190.436 +
 190.437 +
 190.438 +static int book_dup_or_new(codec_setup_info *ci,const static_codebook *book){
 190.439 +  int i;
 190.440 +  for(i=0;i<ci->books;i++)
 190.441 +    if(ci->book_param[i]==book)return(i);
 190.442 +
 190.443 +  return(ci->books++);
 190.444 +}
 190.445 +
 190.446 +static void vorbis_encode_blocksize_setup(vorbis_info *vi,double s,
 190.447 +                                         const int *shortb,const int *longb){
 190.448 +
 190.449 +  codec_setup_info *ci=vi->codec_setup;
 190.450 +  int is=s;
 190.451 +
 190.452 +  int blockshort=shortb[is];
 190.453 +  int blocklong=longb[is];
 190.454 +  ci->blocksizes[0]=blockshort;
 190.455 +  ci->blocksizes[1]=blocklong;
 190.456 +
 190.457 +}
 190.458 +
 190.459 +static void vorbis_encode_residue_setup(vorbis_info *vi,
 190.460 +                                        int number, int block,
 190.461 +                                        const vorbis_residue_template *res){
 190.462 +
 190.463 +  codec_setup_info *ci=vi->codec_setup;
 190.464 +  int i;
 190.465 +
 190.466 +  vorbis_info_residue0 *r=ci->residue_param[number]=
 190.467 +    _ogg_malloc(sizeof(*r));
 190.468 +
 190.469 +  memcpy(r,res->res,sizeof(*r));
 190.470 +  if(ci->residues<=number)ci->residues=number+1;
 190.471 +
 190.472 +  r->grouping=res->grouping;
 190.473 +  ci->residue_type[number]=res->res_type;
 190.474 +
 190.475 +  /* fill in all the books */
 190.476 +  {
 190.477 +    int booklist=0,k;
 190.478 +
 190.479 +    if(ci->hi.managed){
 190.480 +      for(i=0;i<r->partitions;i++)
 190.481 +        for(k=0;k<4;k++)
 190.482 +          if(res->books_base_managed->books[i][k])
 190.483 +            r->secondstages[i]|=(1<<k);
 190.484 +
 190.485 +      r->groupbook=book_dup_or_new(ci,res->book_aux_managed);
 190.486 +      ci->book_param[r->groupbook]=(static_codebook *)res->book_aux_managed;
 190.487 +
 190.488 +      for(i=0;i<r->partitions;i++){
 190.489 +        for(k=0;k<4;k++){
 190.490 +          if(res->books_base_managed->books[i][k]){
 190.491 +            int bookid=book_dup_or_new(ci,res->books_base_managed->books[i][k]);
 190.492 +            r->booklist[booklist++]=bookid;
 190.493 +            ci->book_param[bookid]=(static_codebook *)res->books_base_managed->books[i][k];
 190.494 +          }
 190.495 +        }
 190.496 +      }
 190.497 +
 190.498 +    }else{
 190.499 +
 190.500 +      for(i=0;i<r->partitions;i++)
 190.501 +        for(k=0;k<4;k++)
 190.502 +          if(res->books_base->books[i][k])
 190.503 +            r->secondstages[i]|=(1<<k);
 190.504 +
 190.505 +      r->groupbook=book_dup_or_new(ci,res->book_aux);
 190.506 +      ci->book_param[r->groupbook]=(static_codebook *)res->book_aux;
 190.507 +
 190.508 +      for(i=0;i<r->partitions;i++){
 190.509 +        for(k=0;k<4;k++){
 190.510 +          if(res->books_base->books[i][k]){
 190.511 +            int bookid=book_dup_or_new(ci,res->books_base->books[i][k]);
 190.512 +            r->booklist[booklist++]=bookid;
 190.513 +            ci->book_param[bookid]=(static_codebook *)res->books_base->books[i][k];
 190.514 +          }
 190.515 +        }
 190.516 +      }
 190.517 +    }
 190.518 +  }
 190.519 +
 190.520 +  /* lowpass setup/pointlimit */
 190.521 +  {
 190.522 +    double freq=ci->hi.lowpass_kHz*1000.;
 190.523 +    vorbis_info_floor1 *f=ci->floor_param[block]; /* by convention */
 190.524 +    double nyq=vi->rate/2.;
 190.525 +    long blocksize=ci->blocksizes[block]>>1;
 190.526 +
 190.527 +    /* lowpass needs to be set in the floor and the residue. */
 190.528 +    if(freq>nyq)freq=nyq;
 190.529 +    /* in the floor, the granularity can be very fine; it doesn't alter
 190.530 +       the encoding structure, only the samples used to fit the floor
 190.531 +       approximation */
 190.532 +    f->n=freq/nyq*blocksize;
 190.533 +
 190.534 +    /* this res may by limited by the maximum pointlimit of the mode,
 190.535 +       not the lowpass. the floor is always lowpass limited. */
 190.536 +    switch(res->limit_type){
 190.537 +    case 1: /* point stereo limited */
 190.538 +      if(ci->hi.managed)
 190.539 +        freq=ci->psy_g_param.coupling_pkHz[PACKETBLOBS-1]*1000.;
 190.540 +      else
 190.541 +        freq=ci->psy_g_param.coupling_pkHz[PACKETBLOBS/2]*1000.;
 190.542 +      if(freq>nyq)freq=nyq;
 190.543 +      break;
 190.544 +    case 2: /* LFE channel; lowpass at ~ 250Hz */
 190.545 +      freq=250;
 190.546 +      break;
 190.547 +    default:
 190.548 +      /* already set */
 190.549 +      break;
 190.550 +    }
 190.551 +
 190.552 +    /* in the residue, we're constrained, physically, by partition
 190.553 +       boundaries.  We still lowpass 'wherever', but we have to round up
 190.554 +       here to next boundary, or the vorbis spec will round it *down* to
 190.555 +       previous boundary in encode/decode */
 190.556 +    if(ci->residue_type[number]==2){
 190.557 +      /* residue 2 bundles together multiple channels; used by stereo
 190.558 +         and surround.  Count the channels in use */
 190.559 +      /* Multiple maps/submaps can point to the same residue.  In the case
 190.560 +         of residue 2, they all better have the same number of
 190.561 +         channels/samples. */
 190.562 +      int j,k,ch=0;
 190.563 +      for(i=0;i<ci->maps&&ch==0;i++){
 190.564 +        vorbis_info_mapping0 *mi=(vorbis_info_mapping0 *)ci->map_param[i];
 190.565 +        for(j=0;j<mi->submaps && ch==0;j++)
 190.566 +          if(mi->residuesubmap[j]==number) /* we found a submap referencing theis residue backend */
 190.567 +            for(k=0;k<vi->channels;k++)
 190.568 +              if(mi->chmuxlist[k]==j) /* this channel belongs to the submap */
 190.569 +                ch++;
 190.570 +      }
 190.571 +
 190.572 +      r->end=(int)((freq/nyq*blocksize*ch)/r->grouping+.9)* /* round up only if we're well past */
 190.573 +        r->grouping;
 190.574 +      /* the blocksize and grouping may disagree at the end */
 190.575 +      if(r->end>blocksize*ch)r->end=blocksize*ch/r->grouping*r->grouping;
 190.576 +
 190.577 +    }else{
 190.578 +
 190.579 +      r->end=(int)((freq/nyq*blocksize)/r->grouping+.9)* /* round up only if we're well past */
 190.580 +        r->grouping;
 190.581 +      /* the blocksize and grouping may disagree at the end */
 190.582 +      if(r->end>blocksize)r->end=blocksize/r->grouping*r->grouping;
 190.583 +
 190.584 +    }
 190.585 +
 190.586 +    if(r->end==0)r->end=r->grouping; /* LFE channel */
 190.587 +
 190.588 +  }
 190.589 +}
 190.590 +
 190.591 +/* we assume two maps in this encoder */
 190.592 +static void vorbis_encode_map_n_res_setup(vorbis_info *vi,double s,
 190.593 +                                          const vorbis_mapping_template *maps){
 190.594 +
 190.595 +  codec_setup_info *ci=vi->codec_setup;
 190.596 +  int i,j,is=s,modes=2;
 190.597 +  const vorbis_info_mapping0 *map=maps[is].map;
 190.598 +  const vorbis_info_mode *mode=_mode_template;
 190.599 +  const vorbis_residue_template *res=maps[is].res;
 190.600 +
 190.601 +  if(ci->blocksizes[0]==ci->blocksizes[1])modes=1;
 190.602 +
 190.603 +  for(i=0;i<modes;i++){
 190.604 +
 190.605 +    ci->map_param[i]=_ogg_calloc(1,sizeof(*map));
 190.606 +    ci->mode_param[i]=_ogg_calloc(1,sizeof(*mode));
 190.607 +
 190.608 +    memcpy(ci->mode_param[i],mode+i,sizeof(*_mode_template));
 190.609 +    if(i>=ci->modes)ci->modes=i+1;
 190.610 +
 190.611 +    ci->map_type[i]=0;
 190.612 +    memcpy(ci->map_param[i],map+i,sizeof(*map));
 190.613 +    if(i>=ci->maps)ci->maps=i+1;
 190.614 +
 190.615 +    for(j=0;j<map[i].submaps;j++)
 190.616 +      vorbis_encode_residue_setup(vi,map[i].residuesubmap[j],i
 190.617 +                                  ,res+map[i].residuesubmap[j]);
 190.618 +  }
 190.619 +}
 190.620 +
 190.621 +static double setting_to_approx_bitrate(vorbis_info *vi){
 190.622 +  codec_setup_info *ci=vi->codec_setup;
 190.623 +  highlevel_encode_setup *hi=&ci->hi;
 190.624 +  ve_setup_data_template *setup=(ve_setup_data_template *)hi->setup;
 190.625 +  int is=hi->base_setting;
 190.626 +  double ds=hi->base_setting-is;
 190.627 +  int ch=vi->channels;
 190.628 +  const double *r=setup->rate_mapping;
 190.629 +
 190.630 +  if(r==NULL)
 190.631 +    return(-1);
 190.632 +
 190.633 +  return((r[is]*(1.-ds)+r[is+1]*ds)*ch);
 190.634 +}
 190.635 +
 190.636 +static const void *get_setup_template(long ch,long srate,
 190.637 +                                      double req,int q_or_bitrate,
 190.638 +                                      double *base_setting){
 190.639 +  int i=0,j;
 190.640 +  if(q_or_bitrate)req/=ch;
 190.641 +
 190.642 +  while(setup_list[i]){
 190.643 +    if(setup_list[i]->coupling_restriction==-1 ||
 190.644 +       setup_list[i]->coupling_restriction==ch){
 190.645 +      if(srate>=setup_list[i]->samplerate_min_restriction &&
 190.646 +         srate<=setup_list[i]->samplerate_max_restriction){
 190.647 +        int mappings=setup_list[i]->mappings;
 190.648 +        const double *map=(q_or_bitrate?
 190.649 +                     setup_list[i]->rate_mapping:
 190.650 +                     setup_list[i]->quality_mapping);
 190.651 +
 190.652 +        /* the template matches.  Does the requested quality mode
 190.653 +           fall within this template's modes? */
 190.654 +        if(req<map[0]){++i;continue;}
 190.655 +        if(req>map[setup_list[i]->mappings]){++i;continue;}
 190.656 +        for(j=0;j<mappings;j++)
 190.657 +          if(req>=map[j] && req<map[j+1])break;
 190.658 +        /* an all-points match */
 190.659 +        if(j==mappings)
 190.660 +          *base_setting=j-.001;
 190.661 +        else{
 190.662 +          float low=map[j];
 190.663 +          float high=map[j+1];
 190.664 +          float del=(req-low)/(high-low);
 190.665 +          *base_setting=j+del;
 190.666 +        }
 190.667 +
 190.668 +        return(setup_list[i]);
 190.669 +      }
 190.670 +    }
 190.671 +    i++;
 190.672 +  }
 190.673 +
 190.674 +  return NULL;
 190.675 +}
 190.676 +
 190.677 +/* encoders will need to use vorbis_info_init beforehand and call
 190.678 +   vorbis_info clear when all done */
 190.679 +
 190.680 +/* two interfaces; this, more detailed one, and later a convenience
 190.681 +   layer on top */
 190.682 +
 190.683 +/* the final setup call */
 190.684 +int vorbis_encode_setup_init(vorbis_info *vi){
 190.685 +  int i,i0=0,singleblock=0;
 190.686 +  codec_setup_info *ci=vi->codec_setup;
 190.687 +  ve_setup_data_template *setup=NULL;
 190.688 +  highlevel_encode_setup *hi=&ci->hi;
 190.689 +
 190.690 +  if(ci==NULL)return(OV_EINVAL);
 190.691 +  if(!hi->impulse_block_p)i0=1;
 190.692 +
 190.693 +  /* too low/high an ATH floater is nonsensical, but doesn't break anything */
 190.694 +  if(hi->ath_floating_dB>-80)hi->ath_floating_dB=-80;
 190.695 +  if(hi->ath_floating_dB<-200)hi->ath_floating_dB=-200;
 190.696 +
 190.697 +  /* again, bound this to avoid the app shooting itself int he foot
 190.698 +     too badly */
 190.699 +  if(hi->amplitude_track_dBpersec>0.)hi->amplitude_track_dBpersec=0.;
 190.700 +  if(hi->amplitude_track_dBpersec<-99999.)hi->amplitude_track_dBpersec=-99999.;
 190.701 +
 190.702 +  /* get the appropriate setup template; matches the fetch in previous
 190.703 +     stages */
 190.704 +  setup=(ve_setup_data_template *)hi->setup;
 190.705 +  if(setup==NULL)return(OV_EINVAL);
 190.706 +
 190.707 +  hi->set_in_stone=1;
 190.708 +  /* choose block sizes from configured sizes as well as paying
 190.709 +     attention to long_block_p and short_block_p.  If the configured
 190.710 +     short and long blocks are the same length, we set long_block_p
 190.711 +     and unset short_block_p */
 190.712 +  vorbis_encode_blocksize_setup(vi,hi->base_setting,
 190.713 +                                setup->blocksize_short,
 190.714 +                                setup->blocksize_long);
 190.715 +  if(ci->blocksizes[0]==ci->blocksizes[1])singleblock=1;
 190.716 +
 190.717 +  /* floor setup; choose proper floor params.  Allocated on the floor
 190.718 +     stack in order; if we alloc only a single long floor, it's 0 */
 190.719 +  for(i=0;i<setup->floor_mappings;i++)
 190.720 +    vorbis_encode_floor_setup(vi,hi->base_setting,
 190.721 +                              setup->floor_books,
 190.722 +                              setup->floor_params,
 190.723 +                              setup->floor_mapping_list[i]);
 190.724 +
 190.725 +  /* setup of [mostly] short block detection and stereo*/
 190.726 +  vorbis_encode_global_psych_setup(vi,hi->trigger_setting,
 190.727 +                                   setup->global_params,
 190.728 +                                   setup->global_mapping);
 190.729 +  vorbis_encode_global_stereo(vi,hi,setup->stereo_modes);
 190.730 +
 190.731 +  /* basic psych setup and noise normalization */
 190.732 +  vorbis_encode_psyset_setup(vi,hi->base_setting,
 190.733 +                             setup->psy_noise_normal_start[0],
 190.734 +                             setup->psy_noise_normal_partition[0],
 190.735 +                             setup->psy_noise_normal_thresh,
 190.736 +                             0);
 190.737 +  vorbis_encode_psyset_setup(vi,hi->base_setting,
 190.738 +                             setup->psy_noise_normal_start[0],
 190.739 +                             setup->psy_noise_normal_partition[0],
 190.740 +                             setup->psy_noise_normal_thresh,
 190.741 +                             1);
 190.742 +  if(!singleblock){
 190.743 +    vorbis_encode_psyset_setup(vi,hi->base_setting,
 190.744 +                               setup->psy_noise_normal_start[1],
 190.745 +                               setup->psy_noise_normal_partition[1],
 190.746 +                                    setup->psy_noise_normal_thresh,
 190.747 +                               2);
 190.748 +    vorbis_encode_psyset_setup(vi,hi->base_setting,
 190.749 +                               setup->psy_noise_normal_start[1],
 190.750 +                               setup->psy_noise_normal_partition[1],
 190.751 +                               setup->psy_noise_normal_thresh,
 190.752 +                               3);
 190.753 +  }
 190.754 +
 190.755 +  /* tone masking setup */
 190.756 +  vorbis_encode_tonemask_setup(vi,hi->block[i0].tone_mask_setting,0,
 190.757 +                               setup->psy_tone_masteratt,
 190.758 +                               setup->psy_tone_0dB,
 190.759 +                               setup->psy_tone_adj_impulse);
 190.760 +  vorbis_encode_tonemask_setup(vi,hi->block[1].tone_mask_setting,1,
 190.761 +                               setup->psy_tone_masteratt,
 190.762 +                               setup->psy_tone_0dB,
 190.763 +                               setup->psy_tone_adj_other);
 190.764 +  if(!singleblock){
 190.765 +    vorbis_encode_tonemask_setup(vi,hi->block[2].tone_mask_setting,2,
 190.766 +                                 setup->psy_tone_masteratt,
 190.767 +                                 setup->psy_tone_0dB,
 190.768 +                                 setup->psy_tone_adj_other);
 190.769 +    vorbis_encode_tonemask_setup(vi,hi->block[3].tone_mask_setting,3,
 190.770 +                                 setup->psy_tone_masteratt,
 190.771 +                                 setup->psy_tone_0dB,
 190.772 +                                 setup->psy_tone_adj_long);
 190.773 +  }
 190.774 +
 190.775 +  /* noise companding setup */
 190.776 +  vorbis_encode_compand_setup(vi,hi->block[i0].noise_compand_setting,0,
 190.777 +                              setup->psy_noise_compand,
 190.778 +                              setup->psy_noise_compand_short_mapping);
 190.779 +  vorbis_encode_compand_setup(vi,hi->block[1].noise_compand_setting,1,
 190.780 +                              setup->psy_noise_compand,
 190.781 +                              setup->psy_noise_compand_short_mapping);
 190.782 +  if(!singleblock){
 190.783 +    vorbis_encode_compand_setup(vi,hi->block[2].noise_compand_setting,2,
 190.784 +                                setup->psy_noise_compand,
 190.785 +                                setup->psy_noise_compand_long_mapping);
 190.786 +    vorbis_encode_compand_setup(vi,hi->block[3].noise_compand_setting,3,
 190.787 +                                setup->psy_noise_compand,
 190.788 +                                setup->psy_noise_compand_long_mapping);
 190.789 +  }
 190.790 +
 190.791 +  /* peak guarding setup  */
 190.792 +  vorbis_encode_peak_setup(vi,hi->block[i0].tone_peaklimit_setting,0,
 190.793 +                           setup->psy_tone_dBsuppress);
 190.794 +  vorbis_encode_peak_setup(vi,hi->block[1].tone_peaklimit_setting,1,
 190.795 +                           setup->psy_tone_dBsuppress);
 190.796 +  if(!singleblock){
 190.797 +    vorbis_encode_peak_setup(vi,hi->block[2].tone_peaklimit_setting,2,
 190.798 +                             setup->psy_tone_dBsuppress);
 190.799 +    vorbis_encode_peak_setup(vi,hi->block[3].tone_peaklimit_setting,3,
 190.800 +                             setup->psy_tone_dBsuppress);
 190.801 +  }
 190.802 +
 190.803 +  /* noise bias setup */
 190.804 +  vorbis_encode_noisebias_setup(vi,hi->block[i0].noise_bias_setting,0,
 190.805 +                                setup->psy_noise_dBsuppress,
 190.806 +                                setup->psy_noise_bias_impulse,
 190.807 +                                setup->psy_noiseguards,
 190.808 +                                (i0==0?hi->impulse_noisetune:0.));
 190.809 +  vorbis_encode_noisebias_setup(vi,hi->block[1].noise_bias_setting,1,
 190.810 +                                setup->psy_noise_dBsuppress,
 190.811 +                                setup->psy_noise_bias_padding,
 190.812 +                                setup->psy_noiseguards,0.);
 190.813 +  if(!singleblock){
 190.814 +    vorbis_encode_noisebias_setup(vi,hi->block[2].noise_bias_setting,2,
 190.815 +                                  setup->psy_noise_dBsuppress,
 190.816 +                                  setup->psy_noise_bias_trans,
 190.817 +                                  setup->psy_noiseguards,0.);
 190.818 +    vorbis_encode_noisebias_setup(vi,hi->block[3].noise_bias_setting,3,
 190.819 +                                  setup->psy_noise_dBsuppress,
 190.820 +                                  setup->psy_noise_bias_long,
 190.821 +                                  setup->psy_noiseguards,0.);
 190.822 +  }
 190.823 +
 190.824 +  vorbis_encode_ath_setup(vi,0);
 190.825 +  vorbis_encode_ath_setup(vi,1);
 190.826 +  if(!singleblock){
 190.827 +    vorbis_encode_ath_setup(vi,2);
 190.828 +    vorbis_encode_ath_setup(vi,3);
 190.829 +  }
 190.830 +
 190.831 +  vorbis_encode_map_n_res_setup(vi,hi->base_setting,setup->maps);
 190.832 +
 190.833 +  /* set bitrate readonlies and management */
 190.834 +  if(hi->bitrate_av>0)
 190.835 +    vi->bitrate_nominal=hi->bitrate_av;
 190.836 +  else{
 190.837 +    vi->bitrate_nominal=setting_to_approx_bitrate(vi);
 190.838 +  }
 190.839 +
 190.840 +  vi->bitrate_lower=hi->bitrate_min;
 190.841 +  vi->bitrate_upper=hi->bitrate_max;
 190.842 +  if(hi->bitrate_av)
 190.843 +    vi->bitrate_window=(double)hi->bitrate_reservoir/hi->bitrate_av;
 190.844 +  else
 190.845 +    vi->bitrate_window=0.;
 190.846 +
 190.847 +  if(hi->managed){
 190.848 +    ci->bi.avg_rate=hi->bitrate_av;
 190.849 +    ci->bi.min_rate=hi->bitrate_min;
 190.850 +    ci->bi.max_rate=hi->bitrate_max;
 190.851 +
 190.852 +    ci->bi.reservoir_bits=hi->bitrate_reservoir;
 190.853 +    ci->bi.reservoir_bias=
 190.854 +      hi->bitrate_reservoir_bias;
 190.855 +
 190.856 +    ci->bi.slew_damp=hi->bitrate_av_damp;
 190.857 +
 190.858 +  }
 190.859 +
 190.860 +  return(0);
 190.861 +
 190.862 +}
 190.863 +
 190.864 +static void vorbis_encode_setup_setting(vorbis_info *vi,
 190.865 +                                       long  channels,
 190.866 +                                       long  rate){
 190.867 +  int i,is;
 190.868 +  codec_setup_info *ci=vi->codec_setup;
 190.869 +  highlevel_encode_setup *hi=&ci->hi;
 190.870 +  const ve_setup_data_template *setup=hi->setup;
 190.871 +  double ds;
 190.872 +
 190.873 +  vi->version=0;
 190.874 +  vi->channels=channels;
 190.875 +  vi->rate=rate;
 190.876 +
 190.877 +  hi->impulse_block_p=1;
 190.878 +  hi->noise_normalize_p=1;
 190.879 +
 190.880 +  is=hi->base_setting;
 190.881 +  ds=hi->base_setting-is;
 190.882 +
 190.883 +  hi->stereo_point_setting=hi->base_setting;
 190.884 +
 190.885 +  if(!hi->lowpass_altered)
 190.886 +    hi->lowpass_kHz=
 190.887 +      setup->psy_lowpass[is]*(1.-ds)+setup->psy_lowpass[is+1]*ds;
 190.888 +
 190.889 +  hi->ath_floating_dB=setup->psy_ath_float[is]*(1.-ds)+
 190.890 +    setup->psy_ath_float[is+1]*ds;
 190.891 +  hi->ath_absolute_dB=setup->psy_ath_abs[is]*(1.-ds)+
 190.892 +    setup->psy_ath_abs[is+1]*ds;
 190.893 +
 190.894 +  hi->amplitude_track_dBpersec=-6.;
 190.895 +  hi->trigger_setting=hi->base_setting;
 190.896 +
 190.897 +  for(i=0;i<4;i++){
 190.898 +    hi->block[i].tone_mask_setting=hi->base_setting;
 190.899 +    hi->block[i].tone_peaklimit_setting=hi->base_setting;
 190.900 +    hi->block[i].noise_bias_setting=hi->base_setting;
 190.901 +    hi->block[i].noise_compand_setting=hi->base_setting;
 190.902 +  }
 190.903 +}
 190.904 +
 190.905 +int vorbis_encode_setup_vbr(vorbis_info *vi,
 190.906 +                            long  channels,
 190.907 +                            long  rate,
 190.908 +                            float quality){
 190.909 +  codec_setup_info *ci=vi->codec_setup;
 190.910 +  highlevel_encode_setup *hi=&ci->hi;
 190.911 +
 190.912 +  quality+=.0000001;
 190.913 +  if(quality>=1.)quality=.9999;
 190.914 +
 190.915 +  hi->req=quality;
 190.916 +  hi->setup=get_setup_template(channels,rate,quality,0,&hi->base_setting);
 190.917 +  if(!hi->setup)return OV_EIMPL;
 190.918 +
 190.919 +  vorbis_encode_setup_setting(vi,channels,rate);
 190.920 +  hi->managed=0;
 190.921 +  hi->coupling_p=1;
 190.922 +
 190.923 +  return 0;
 190.924 +}
 190.925 +
 190.926 +int vorbis_encode_init_vbr(vorbis_info *vi,
 190.927 +                           long channels,
 190.928 +                           long rate,
 190.929 +
 190.930 +                           float base_quality /* 0. to 1. */
 190.931 +                           ){
 190.932 +  int ret=0;
 190.933 +
 190.934 +  ret=vorbis_encode_setup_vbr(vi,channels,rate,base_quality);
 190.935 +
 190.936 +  if(ret){
 190.937 +    vorbis_info_clear(vi);
 190.938 +    return ret;
 190.939 +  }
 190.940 +  ret=vorbis_encode_setup_init(vi);
 190.941 +  if(ret)
 190.942 +    vorbis_info_clear(vi);
 190.943 +  return(ret);
 190.944 +}
 190.945 +
 190.946 +int vorbis_encode_setup_managed(vorbis_info *vi,
 190.947 +                                long channels,
 190.948 +                                long rate,
 190.949 +
 190.950 +                                long max_bitrate,
 190.951 +                                long nominal_bitrate,
 190.952 +                                long min_bitrate){
 190.953 +
 190.954 +  codec_setup_info *ci=vi->codec_setup;
 190.955 +  highlevel_encode_setup *hi=&ci->hi;
 190.956 +  double tnominal=nominal_bitrate;
 190.957 +
 190.958 +  if(nominal_bitrate<=0.){
 190.959 +    if(max_bitrate>0.){
 190.960 +      if(min_bitrate>0.)
 190.961 +        nominal_bitrate=(max_bitrate+min_bitrate)*.5;
 190.962 +      else
 190.963 +        nominal_bitrate=max_bitrate*.875;
 190.964 +    }else{
 190.965 +      if(min_bitrate>0.){
 190.966 +        nominal_bitrate=min_bitrate;
 190.967 +      }else{
 190.968 +        return(OV_EINVAL);
 190.969 +      }
 190.970 +    }
 190.971 +  }
 190.972 +
 190.973 +  hi->req=nominal_bitrate;
 190.974 +  hi->setup=get_setup_template(channels,rate,nominal_bitrate,1,&hi->base_setting);
 190.975 +  if(!hi->setup)return OV_EIMPL;
 190.976 +
 190.977 +  vorbis_encode_setup_setting(vi,channels,rate);
 190.978 +
 190.979 +  /* initialize management with sane defaults */
 190.980 +  hi->coupling_p=1;
 190.981 +  hi->managed=1;
 190.982 +  hi->bitrate_min=min_bitrate;
 190.983 +  hi->bitrate_max=max_bitrate;
 190.984 +  hi->bitrate_av=tnominal;
 190.985 +  hi->bitrate_av_damp=1.5f; /* full range in no less than 1.5 second */
 190.986 +  hi->bitrate_reservoir=nominal_bitrate*2;
 190.987 +  hi->bitrate_reservoir_bias=.1; /* bias toward hoarding bits */
 190.988 +
 190.989 +  return(0);
 190.990 +
 190.991 +}
 190.992 +
 190.993 +int vorbis_encode_init(vorbis_info *vi,
 190.994 +                       long channels,
 190.995 +                       long rate,
 190.996 +
 190.997 +                       long max_bitrate,
 190.998 +                       long nominal_bitrate,
 190.999 +                       long min_bitrate){
190.1000 +
190.1001 +  int ret=vorbis_encode_setup_managed(vi,channels,rate,
190.1002 +                                      max_bitrate,
190.1003 +                                      nominal_bitrate,
190.1004 +                                      min_bitrate);
190.1005 +  if(ret){
190.1006 +    vorbis_info_clear(vi);
190.1007 +    return(ret);
190.1008 +  }
190.1009 +
190.1010 +  ret=vorbis_encode_setup_init(vi);
190.1011 +  if(ret)
190.1012 +    vorbis_info_clear(vi);
190.1013 +  return(ret);
190.1014 +}
190.1015 +
190.1016 +int vorbis_encode_ctl(vorbis_info *vi,int number,void *arg){
190.1017 +  if(vi){
190.1018 +    codec_setup_info *ci=vi->codec_setup;
190.1019 +    highlevel_encode_setup *hi=&ci->hi;
190.1020 +    int setp=(number&0xf); /* a read request has a low nibble of 0 */
190.1021 +
190.1022 +    if(setp && hi->set_in_stone)return(OV_EINVAL);
190.1023 +
190.1024 +    switch(number){
190.1025 +
190.1026 +    /* now deprecated *****************/
190.1027 +    case OV_ECTL_RATEMANAGE_GET:
190.1028 +      {
190.1029 +
190.1030 +        struct ovectl_ratemanage_arg *ai=
190.1031 +          (struct ovectl_ratemanage_arg *)arg;
190.1032 +
190.1033 +        ai->management_active=hi->managed;
190.1034 +        ai->bitrate_hard_window=ai->bitrate_av_window=
190.1035 +          (double)hi->bitrate_reservoir/vi->rate;
190.1036 +        ai->bitrate_av_window_center=1.;
190.1037 +        ai->bitrate_hard_min=hi->bitrate_min;
190.1038 +        ai->bitrate_hard_max=hi->bitrate_max;
190.1039 +        ai->bitrate_av_lo=hi->bitrate_av;
190.1040 +        ai->bitrate_av_hi=hi->bitrate_av;
190.1041 +
190.1042 +      }
190.1043 +      return(0);
190.1044 +
190.1045 +    /* now deprecated *****************/
190.1046 +    case OV_ECTL_RATEMANAGE_SET:
190.1047 +      {
190.1048 +        struct ovectl_ratemanage_arg *ai=
190.1049 +          (struct ovectl_ratemanage_arg *)arg;
190.1050 +        if(ai==NULL){
190.1051 +          hi->managed=0;
190.1052 +        }else{
190.1053 +          hi->managed=ai->management_active;
190.1054 +          vorbis_encode_ctl(vi,OV_ECTL_RATEMANAGE_AVG,arg);
190.1055 +          vorbis_encode_ctl(vi,OV_ECTL_RATEMANAGE_HARD,arg);
190.1056 +        }
190.1057 +      }
190.1058 +      return 0;
190.1059 +
190.1060 +    /* now deprecated *****************/
190.1061 +    case OV_ECTL_RATEMANAGE_AVG:
190.1062 +      {
190.1063 +        struct ovectl_ratemanage_arg *ai=
190.1064 +          (struct ovectl_ratemanage_arg *)arg;
190.1065 +        if(ai==NULL){
190.1066 +          hi->bitrate_av=0;
190.1067 +        }else{
190.1068 +          hi->bitrate_av=(ai->bitrate_av_lo+ai->bitrate_av_hi)*.5;
190.1069 +        }
190.1070 +      }
190.1071 +      return(0);
190.1072 +    /* now deprecated *****************/
190.1073 +    case OV_ECTL_RATEMANAGE_HARD:
190.1074 +      {
190.1075 +        struct ovectl_ratemanage_arg *ai=
190.1076 +          (struct ovectl_ratemanage_arg *)arg;
190.1077 +        if(ai==NULL){
190.1078 +          hi->bitrate_min=0;
190.1079 +          hi->bitrate_max=0;
190.1080 +        }else{
190.1081 +          hi->bitrate_min=ai->bitrate_hard_min;
190.1082 +          hi->bitrate_max=ai->bitrate_hard_max;
190.1083 +          hi->bitrate_reservoir=ai->bitrate_hard_window*
190.1084 +            (hi->bitrate_max+hi->bitrate_min)*.5;
190.1085 +        }
190.1086 +        if(hi->bitrate_reservoir<128.)
190.1087 +          hi->bitrate_reservoir=128.;
190.1088 +      }
190.1089 +      return(0);
190.1090 +
190.1091 +      /* replacement ratemanage interface */
190.1092 +    case OV_ECTL_RATEMANAGE2_GET:
190.1093 +      {
190.1094 +        struct ovectl_ratemanage2_arg *ai=
190.1095 +          (struct ovectl_ratemanage2_arg *)arg;
190.1096 +        if(ai==NULL)return OV_EINVAL;
190.1097 +
190.1098 +        ai->management_active=hi->managed;
190.1099 +        ai->bitrate_limit_min_kbps=hi->bitrate_min/1000;
190.1100 +        ai->bitrate_limit_max_kbps=hi->bitrate_max/1000;
190.1101 +        ai->bitrate_average_kbps=hi->bitrate_av/1000;
190.1102 +        ai->bitrate_average_damping=hi->bitrate_av_damp;
190.1103 +        ai->bitrate_limit_reservoir_bits=hi->bitrate_reservoir;
190.1104 +        ai->bitrate_limit_reservoir_bias=hi->bitrate_reservoir_bias;
190.1105 +      }
190.1106 +      return (0);
190.1107 +    case OV_ECTL_RATEMANAGE2_SET:
190.1108 +      {
190.1109 +        struct ovectl_ratemanage2_arg *ai=
190.1110 +          (struct ovectl_ratemanage2_arg *)arg;
190.1111 +        if(ai==NULL){
190.1112 +          hi->managed=0;
190.1113 +        }else{
190.1114 +          /* sanity check; only catch invariant violations */
190.1115 +          if(ai->bitrate_limit_min_kbps>0 &&
190.1116 +             ai->bitrate_average_kbps>0 &&
190.1117 +             ai->bitrate_limit_min_kbps>ai->bitrate_average_kbps)
190.1118 +            return OV_EINVAL;
190.1119 +
190.1120 +          if(ai->bitrate_limit_max_kbps>0 &&
190.1121 +             ai->bitrate_average_kbps>0 &&
190.1122 +             ai->bitrate_limit_max_kbps<ai->bitrate_average_kbps)
190.1123 +            return OV_EINVAL;
190.1124 +
190.1125 +          if(ai->bitrate_limit_min_kbps>0 &&
190.1126 +             ai->bitrate_limit_max_kbps>0 &&
190.1127 +             ai->bitrate_limit_min_kbps>ai->bitrate_limit_max_kbps)
190.1128 +            return OV_EINVAL;
190.1129 +
190.1130 +          if(ai->bitrate_average_damping <= 0.)
190.1131 +            return OV_EINVAL;
190.1132 +
190.1133 +          if(ai->bitrate_limit_reservoir_bits < 0)
190.1134 +            return OV_EINVAL;
190.1135 +
190.1136 +          if(ai->bitrate_limit_reservoir_bias < 0.)
190.1137 +            return OV_EINVAL;
190.1138 +
190.1139 +          if(ai->bitrate_limit_reservoir_bias > 1.)
190.1140 +            return OV_EINVAL;
190.1141 +
190.1142 +          hi->managed=ai->management_active;
190.1143 +          hi->bitrate_min=ai->bitrate_limit_min_kbps * 1000;
190.1144 +          hi->bitrate_max=ai->bitrate_limit_max_kbps * 1000;
190.1145 +          hi->bitrate_av=ai->bitrate_average_kbps * 1000;
190.1146 +          hi->bitrate_av_damp=ai->bitrate_average_damping;
190.1147 +          hi->bitrate_reservoir=ai->bitrate_limit_reservoir_bits;
190.1148 +          hi->bitrate_reservoir_bias=ai->bitrate_limit_reservoir_bias;
190.1149 +        }
190.1150 +      }
190.1151 +      return 0;
190.1152 +
190.1153 +    case OV_ECTL_LOWPASS_GET:
190.1154 +      {
190.1155 +        double *farg=(double *)arg;
190.1156 +        *farg=hi->lowpass_kHz;
190.1157 +      }
190.1158 +      return(0);
190.1159 +    case OV_ECTL_LOWPASS_SET:
190.1160 +      {
190.1161 +        double *farg=(double *)arg;
190.1162 +        hi->lowpass_kHz=*farg;
190.1163 +
190.1164 +        if(hi->lowpass_kHz<2.)hi->lowpass_kHz=2.;
190.1165 +        if(hi->lowpass_kHz>99.)hi->lowpass_kHz=99.;
190.1166 +        hi->lowpass_altered=1;
190.1167 +      }
190.1168 +      return(0);
190.1169 +    case OV_ECTL_IBLOCK_GET:
190.1170 +      {
190.1171 +        double *farg=(double *)arg;
190.1172 +        *farg=hi->impulse_noisetune;
190.1173 +      }
190.1174 +      return(0);
190.1175 +    case OV_ECTL_IBLOCK_SET:
190.1176 +      {
190.1177 +        double *farg=(double *)arg;
190.1178 +        hi->impulse_noisetune=*farg;
190.1179 +
190.1180 +        if(hi->impulse_noisetune>0.)hi->impulse_noisetune=0.;
190.1181 +        if(hi->impulse_noisetune<-15.)hi->impulse_noisetune=-15.;
190.1182 +      }
190.1183 +      return(0);
190.1184 +    case OV_ECTL_COUPLING_GET:
190.1185 +      {
190.1186 +        int *iarg=(int *)arg;
190.1187 +        *iarg=hi->coupling_p;
190.1188 +      }
190.1189 +      return(0);
190.1190 +    case OV_ECTL_COUPLING_SET:
190.1191 +      {
190.1192 +        const void *new_template;
190.1193 +        double new_base=0.;
190.1194 +        int *iarg=(int *)arg;
190.1195 +        hi->coupling_p=((*iarg)!=0);
190.1196 +
190.1197 +        /* Fetching a new template can alter the base_setting, which
190.1198 +           many other parameters are based on.  Right now, the only
190.1199 +           parameter drawn from the base_setting that can be altered
190.1200 +           by an encctl is the lowpass, so that is explictly flagged
190.1201 +           to not be overwritten when we fetch a new template and
190.1202 +           recompute the dependant settings */
190.1203 +        new_template = get_setup_template(hi->coupling_p?vi->channels:-1,
190.1204 +                                          vi->rate,
190.1205 +                                          hi->req,
190.1206 +                                          hi->managed,
190.1207 +                                          &new_base);
190.1208 +        if(!hi->setup)return OV_EIMPL;
190.1209 +        hi->setup=new_template;
190.1210 +        hi->base_setting=new_base;
190.1211 +        vorbis_encode_setup_setting(vi,vi->channels,vi->rate);
190.1212 +      }
190.1213 +      return(0);
190.1214 +    }
190.1215 +    return(OV_EIMPL);
190.1216 +  }
190.1217 +  return(OV_EINVAL);
190.1218 +}
   191.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   191.2 +++ b/libs/vorbis/vorbisenc.h	Sun Nov 01 00:36:56 2015 +0200
   191.3 @@ -0,0 +1,436 @@
   191.4 +/********************************************************************
   191.5 + *                                                                  *
   191.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   191.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   191.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   191.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  191.10 + *                                                                  *
  191.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001             *
  191.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  191.13 + *                                                                  *
  191.14 + ********************************************************************
  191.15 +
  191.16 + function: vorbis encode-engine setup
  191.17 + last mod: $Id: vorbisenc.h 17021 2010-03-24 09:29:41Z xiphmont $
  191.18 +
  191.19 + ********************************************************************/
  191.20 +
  191.21 +/** \file
  191.22 + * Libvorbisenc is a convenient API for setting up an encoding
  191.23 + * environment using libvorbis. Libvorbisenc encapsulates the
  191.24 + * actions needed to set up the encoder properly.
  191.25 + */
  191.26 +
  191.27 +#ifndef _OV_ENC_H_
  191.28 +#define _OV_ENC_H_
  191.29 +
  191.30 +#ifdef __cplusplus
  191.31 +extern "C"
  191.32 +{
  191.33 +#endif /* __cplusplus */
  191.34 +
  191.35 +#include "codec.h"
  191.36 +
  191.37 +/**
  191.38 + * This is the primary function within libvorbisenc for setting up managed
  191.39 + * bitrate modes.
  191.40 + *
  191.41 + * Before this function is called, the \ref vorbis_info
  191.42 + * struct should be initialized by using vorbis_info_init() from the libvorbis
  191.43 + * API.  After encoding, vorbis_info_clear() should be called.
  191.44 + *
  191.45 + * The max_bitrate, nominal_bitrate, and min_bitrate settings are used to set
  191.46 + * constraints for the encoded file.  This function uses these settings to
  191.47 + * select the appropriate encoding mode and set it up.
  191.48 + *
  191.49 + * \param vi               Pointer to an initialized \ref vorbis_info struct.
  191.50 + * \param channels         The number of channels to be encoded.
  191.51 + * \param rate             The sampling rate of the source audio.
  191.52 + * \param max_bitrate      Desired maximum bitrate (limit). -1 indicates unset.
  191.53 + * \param nominal_bitrate  Desired average, or central, bitrate. -1 indicates unset.
  191.54 + * \param min_bitrate      Desired minimum bitrate. -1 indicates unset.
  191.55 + *
  191.56 + * \return Zero for success, and negative values for failure.
  191.57 + *
  191.58 + * \retval 0          Success.
  191.59 + * \retval OV_EFAULT  Internal logic fault; indicates a bug or heap/stack corruption.
  191.60 + * \retval OV_EINVAL  Invalid setup request, eg, out of range argument.
  191.61 + * \retval OV_EIMPL   Unimplemented mode; unable to comply with bitrate request.
  191.62 + */
  191.63 +extern int vorbis_encode_init(vorbis_info *vi,
  191.64 +                              long channels,
  191.65 +                              long rate,
  191.66 +
  191.67 +                              long max_bitrate,
  191.68 +                              long nominal_bitrate,
  191.69 +                              long min_bitrate);
  191.70 +
  191.71 +/**
  191.72 + * This function performs step-one of a three-step bitrate-managed encode
  191.73 + * setup.  It functions similarly to the one-step setup performed by \ref
  191.74 + * vorbis_encode_init but allows an application to make further encode setup
  191.75 + * tweaks using \ref vorbis_encode_ctl before finally calling \ref
  191.76 + * vorbis_encode_setup_init to complete the setup process.
  191.77 + *
  191.78 + * Before this function is called, the \ref vorbis_info struct should be
  191.79 + * initialized by using vorbis_info_init() from the libvorbis API.  After
  191.80 + * encoding, vorbis_info_clear() should be called.
  191.81 + *
  191.82 + * The max_bitrate, nominal_bitrate, and min_bitrate settings are used to set
  191.83 + * constraints for the encoded file.  This function uses these settings to
  191.84 + * select the appropriate encoding mode and set it up.
  191.85 + *
  191.86 + * \param vi                Pointer to an initialized vorbis_info struct.
  191.87 + * \param channels          The number of channels to be encoded.
  191.88 + * \param rate              The sampling rate of the source audio.
  191.89 + * \param max_bitrate       Desired maximum bitrate (limit). -1 indicates unset.
  191.90 + * \param nominal_bitrate   Desired average, or central, bitrate. -1 indicates unset.
  191.91 + * \param min_bitrate       Desired minimum bitrate. -1 indicates unset.
  191.92 + *
  191.93 + * \return Zero for success, and negative for failure.
  191.94 + *
  191.95 + * \retval 0           Success
  191.96 + * \retval OV_EFAULT   Internal logic fault; indicates a bug or heap/stack corruption.
  191.97 + * \retval OV_EINVAL   Invalid setup request, eg, out of range argument.
  191.98 + * \retval OV_EIMPL    Unimplemented mode; unable to comply with bitrate request.
  191.99 + */
 191.100 +extern int vorbis_encode_setup_managed(vorbis_info *vi,
 191.101 +                                       long channels,
 191.102 +                                       long rate,
 191.103 +
 191.104 +                                       long max_bitrate,
 191.105 +                                       long nominal_bitrate,
 191.106 +                                       long min_bitrate);
 191.107 +
 191.108 +/**
 191.109 + * This function performs step-one of a three-step variable bitrate
 191.110 + * (quality-based) encode setup.  It functions similarly to the one-step setup
 191.111 + * performed by \ref vorbis_encode_init_vbr() but allows an application to
 191.112 + * make further encode setup tweaks using \ref vorbis_encode_ctl() before
 191.113 + * finally calling \ref vorbis_encode_setup_init to complete the setup
 191.114 + * process.
 191.115 + *
 191.116 + * Before this function is called, the \ref vorbis_info struct should be
 191.117 + * initialized by using \ref vorbis_info_init() from the libvorbis API.  After
 191.118 + * encoding, vorbis_info_clear() should be called.
 191.119 + *
 191.120 + * \param vi        Pointer to an initialized vorbis_info struct.
 191.121 + * \param channels  The number of channels to be encoded.
 191.122 + * \param rate      The sampling rate of the source audio.
 191.123 + * \param quality   Desired quality level, currently from -0.1 to 1.0 (lo to hi).
 191.124 + *
 191.125 + * \return Zero for success, and negative values for failure.
 191.126 + *
 191.127 + * \retval  0          Success
 191.128 + * \retval  OV_EFAULT  Internal logic fault; indicates a bug or heap/stack corruption.
 191.129 + * \retval  OV_EINVAL  Invalid setup request, eg, out of range argument.
 191.130 + * \retval  OV_EIMPL   Unimplemented mode; unable to comply with quality level request.
 191.131 + */
 191.132 +extern int vorbis_encode_setup_vbr(vorbis_info *vi,
 191.133 +                                  long channels,
 191.134 +                                  long rate,
 191.135 +
 191.136 +                                  float quality
 191.137 +                                  );
 191.138 +
 191.139 +/**
 191.140 + * This is the primary function within libvorbisenc for setting up variable
 191.141 + * bitrate ("quality" based) modes.
 191.142 + *
 191.143 + *
 191.144 + * Before this function is called, the vorbis_info struct should be
 191.145 + * initialized by using vorbis_info_init() from the libvorbis API. After
 191.146 + * encoding, vorbis_info_clear() should be called.
 191.147 + *
 191.148 + * \param vi           Pointer to an initialized vorbis_info struct.
 191.149 + * \param channels     The number of channels to be encoded.
 191.150 + * \param rate         The sampling rate of the source audio.
 191.151 + * \param base_quality Desired quality level, currently from -0.1 to 1.0 (lo to hi).
 191.152 + *
 191.153 + *
 191.154 + * \return Zero for success, or a negative number for failure.
 191.155 + *
 191.156 + * \retval 0           Success
 191.157 + * \retval OV_EFAULT   Internal logic fault; indicates a bug or heap/stack corruption.
 191.158 + * \retval OV_EINVAL   Invalid setup request, eg, out of range argument.
 191.159 + * \retval OV_EIMPL    Unimplemented mode; unable to comply with quality level request.
 191.160 + */
 191.161 +extern int vorbis_encode_init_vbr(vorbis_info *vi,
 191.162 +                                  long channels,
 191.163 +                                  long rate,
 191.164 +
 191.165 +                                  float base_quality
 191.166 +                                  );
 191.167 +
 191.168 +/**
 191.169 + * This function performs the last stage of three-step encoding setup, as
 191.170 + * described in the API overview under managed bitrate modes.
 191.171 + *
 191.172 + * Before this function is called, the \ref vorbis_info struct should be
 191.173 + * initialized by using vorbis_info_init() from the libvorbis API, one of
 191.174 + * \ref vorbis_encode_setup_managed() or \ref vorbis_encode_setup_vbr() called to
 191.175 + * initialize the high-level encoding setup, and \ref vorbis_encode_ctl()
 191.176 + * called if necessary to make encoding setup changes.
 191.177 + * vorbis_encode_setup_init() finalizes the highlevel encoding structure into
 191.178 + * a complete encoding setup after which the application may make no further
 191.179 + * setup changes.
 191.180 + *
 191.181 + * After encoding, vorbis_info_clear() should be called.
 191.182 + *
 191.183 + * \param vi Pointer to an initialized \ref vorbis_info struct.
 191.184 + *
 191.185 + * \return Zero for success, and negative values for failure.
 191.186 + *
 191.187 + * \retval  0           Success.
 191.188 + * \retval  OV_EFAULT  Internal logic fault; indicates a bug or heap/stack corruption.
 191.189 + *
 191.190 + * \retval OV_EINVAL   Attempt to use vorbis_encode_setup_init() without first
 191.191 + * calling one of vorbis_encode_setup_managed() or vorbis_encode_setup_vbr() to
 191.192 + * initialize the high-level encoding setup
 191.193 + *
 191.194 + */
 191.195 +extern int vorbis_encode_setup_init(vorbis_info *vi);
 191.196 +
 191.197 +/**
 191.198 + * This function implements a generic interface to miscellaneous encoder
 191.199 + * settings similar to the classic UNIX 'ioctl()' system call.  Applications
 191.200 + * may use vorbis_encode_ctl() to query or set bitrate management or quality
 191.201 + * mode details by using one of several \e request arguments detailed below.
 191.202 + * vorbis_encode_ctl() must be called after one of
 191.203 + * vorbis_encode_setup_managed() or vorbis_encode_setup_vbr().  When used
 191.204 + * to modify settings, \ref vorbis_encode_ctl() must be called before \ref
 191.205 + * vorbis_encode_setup_init().
 191.206 + *
 191.207 + * \param vi      Pointer to an initialized vorbis_info struct.
 191.208 + *
 191.209 + * \param number Specifies the desired action; See \ref encctlcodes "the list
 191.210 + * of available requests".
 191.211 + *
 191.212 + * \param arg void * pointing to a data structure matching the request
 191.213 + * argument.
 191.214 + *
 191.215 + * \retval 0          Success. Any further return information (such as the result of a
 191.216 + * query) is placed into the storage pointed to by *arg.
 191.217 + *
 191.218 + * \retval OV_EINVAL  Invalid argument, or an attempt to modify a setting after
 191.219 + * calling vorbis_encode_setup_init().
 191.220 + *
 191.221 + * \retval OV_EIMPL   Unimplemented or unknown request
 191.222 + */
 191.223 +extern int vorbis_encode_ctl(vorbis_info *vi,int number,void *arg);
 191.224 +
 191.225 +/**
 191.226 + * \deprecated This is a deprecated interface. Please use vorbis_encode_ctl()
 191.227 + * with the \ref ovectl_ratemanage2_arg struct and \ref
 191.228 + * OV_ECTL_RATEMANAGE2_GET and \ref OV_ECTL_RATEMANAGE2_SET calls in new code.
 191.229 + *
 191.230 + * The \ref ovectl_ratemanage_arg structure is used with vorbis_encode_ctl()
 191.231 + * and the \ref OV_ECTL_RATEMANAGE_GET, \ref OV_ECTL_RATEMANAGE_SET, \ref
 191.232 + * OV_ECTL_RATEMANAGE_AVG, \ref OV_ECTL_RATEMANAGE_HARD calls in order to
 191.233 + * query and modify specifics of the encoder's bitrate management
 191.234 + * configuration.
 191.235 +*/
 191.236 +struct ovectl_ratemanage_arg {
 191.237 +  int    management_active; /**< nonzero if bitrate management is active*/
 191.238 +/** hard lower limit (in kilobits per second) below which the stream bitrate
 191.239 +    will never be allowed for any given bitrate_hard_window seconds of time.*/
 191.240 +  long   bitrate_hard_min;
 191.241 +/** hard upper limit (in kilobits per second) above which the stream bitrate
 191.242 +    will never be allowed for any given bitrate_hard_window seconds of time.*/
 191.243 +  long   bitrate_hard_max;
 191.244 +/** the window period (in seconds) used to regulate the hard bitrate minimum
 191.245 +    and maximum*/
 191.246 +  double bitrate_hard_window;
 191.247 +/** soft lower limit (in kilobits per second) below which the average bitrate
 191.248 +    tracker will start nudging the bitrate higher.*/
 191.249 +  long   bitrate_av_lo;
 191.250 +/** soft upper limit (in kilobits per second) above which the average bitrate
 191.251 +    tracker will start nudging the bitrate lower.*/
 191.252 +  long   bitrate_av_hi;
 191.253 +/** the window period (in seconds) used to regulate the average bitrate
 191.254 +    minimum and maximum.*/
 191.255 +  double bitrate_av_window;
 191.256 +/** Regulates the relative centering of the average and hard windows; in
 191.257 +    libvorbis 1.0 and 1.0.1, the hard window regulation overlapped but
 191.258 +    followed the average window regulation. In libvorbis 1.1 a bit-reservoir
 191.259 +    interface replaces the old windowing interface; the older windowing
 191.260 +    interface is simulated and this field has no effect.*/
 191.261 +  double bitrate_av_window_center;
 191.262 +};
 191.263 +
 191.264 +/**
 191.265 + * \name struct ovectl_ratemanage2_arg
 191.266 + *
 191.267 + * The ovectl_ratemanage2_arg structure is used with vorbis_encode_ctl() and
 191.268 + * the OV_ECTL_RATEMANAGE2_GET and OV_ECTL_RATEMANAGE2_SET calls in order to
 191.269 + * query and modify specifics of the encoder's bitrate management
 191.270 + * configuration.
 191.271 + *
 191.272 +*/
 191.273 +struct ovectl_ratemanage2_arg {
 191.274 +  int    management_active; /**< nonzero if bitrate management is active */
 191.275 +/** Lower allowed bitrate limit in kilobits per second */
 191.276 +  long   bitrate_limit_min_kbps;
 191.277 +/** Upper allowed bitrate limit in kilobits per second */
 191.278 +  long   bitrate_limit_max_kbps;
 191.279 +  long   bitrate_limit_reservoir_bits; /**<Size of the bitrate reservoir in bits */
 191.280 +/** Regulates the bitrate reservoir's preferred fill level in a range from 0.0
 191.281 + * to 1.0; 0.0 tries to bank bits to buffer against future bitrate spikes, 1.0
 191.282 + * buffers against future sudden drops in instantaneous bitrate. Default is
 191.283 + * 0.1
 191.284 + */
 191.285 +  double bitrate_limit_reservoir_bias;
 191.286 +/** Average bitrate setting in kilobits per second */
 191.287 +  long   bitrate_average_kbps;
 191.288 +/** Slew rate limit setting for average bitrate adjustment; sets the minimum
 191.289 + *  time in seconds the bitrate tracker may swing from one extreme to the
 191.290 + *  other when boosting or damping average bitrate.
 191.291 + */
 191.292 +  double bitrate_average_damping;
 191.293 +};
 191.294 +
 191.295 +
 191.296 +/**
 191.297 + * \name vorbis_encode_ctl() codes
 191.298 + *
 191.299 + * \anchor encctlcodes
 191.300 + *
 191.301 + * These values are passed as the \c number parameter of vorbis_encode_ctl().
 191.302 + * The type of the referent of that function's \c arg pointer depends on these
 191.303 + * codes.
 191.304 + */
 191.305 +/*@{*/
 191.306 +
 191.307 +/**
 191.308 + * Query the current encoder bitrate management setting.
 191.309 + *
 191.310 + *Argument: <tt>struct ovectl_ratemanage2_arg *</tt>
 191.311 + *
 191.312 + * Used to query the current encoder bitrate management setting. Also used to
 191.313 + * initialize fields of an ovectl_ratemanage2_arg structure for use with
 191.314 + * \ref OV_ECTL_RATEMANAGE2_SET.
 191.315 + */
 191.316 +#define OV_ECTL_RATEMANAGE2_GET      0x14
 191.317 +
 191.318 +/**
 191.319 + * Set the current encoder bitrate management settings.
 191.320 + *
 191.321 + * Argument: <tt>struct ovectl_ratemanage2_arg *</tt>
 191.322 + *
 191.323 + * Used to set the current encoder bitrate management settings to the values
 191.324 + * listed in the ovectl_ratemanage2_arg. Passing a NULL pointer will disable
 191.325 + * bitrate management.
 191.326 +*/
 191.327 +#define OV_ECTL_RATEMANAGE2_SET      0x15
 191.328 +
 191.329 +/**
 191.330 + * Returns the current encoder hard-lowpass setting (kHz) in the double
 191.331 + * pointed to by arg.
 191.332 + *
 191.333 + * Argument: <tt>double *</tt>
 191.334 +*/
 191.335 +#define OV_ECTL_LOWPASS_GET          0x20
 191.336 +
 191.337 +/**
 191.338 + *  Sets the encoder hard-lowpass to the value (kHz) pointed to by arg. Valid
 191.339 + *  lowpass settings range from 2 to 99.
 191.340 + *
 191.341 + * Argument: <tt>double *</tt>
 191.342 +*/
 191.343 +#define OV_ECTL_LOWPASS_SET          0x21
 191.344 +
 191.345 +/**
 191.346 + *  Returns the current encoder impulse block setting in the double pointed
 191.347 + *  to by arg.
 191.348 + *
 191.349 + * Argument: <tt>double *</tt>
 191.350 +*/
 191.351 +#define OV_ECTL_IBLOCK_GET           0x30
 191.352 +
 191.353 +/**
 191.354 + *  Sets the impulse block bias to the the value pointed to by arg.
 191.355 + *
 191.356 + * Argument: <tt>double *</tt>
 191.357 + *
 191.358 + *  Valid range is -15.0 to 0.0 [default]. A negative impulse block bias will
 191.359 + *  direct to encoder to use more bits when incoding short blocks that contain
 191.360 + *  strong impulses, thus improving the accuracy of impulse encoding.
 191.361 + */
 191.362 +#define OV_ECTL_IBLOCK_SET           0x31
 191.363 +
 191.364 +/**
 191.365 + *  Returns the current encoder coupling setting in the int pointed
 191.366 + *  to by arg.
 191.367 + *
 191.368 + * Argument: <tt>int *</tt>
 191.369 +*/
 191.370 +#define OV_ECTL_COUPLING_GET         0x40
 191.371 +
 191.372 +/**
 191.373 + *  Enables/disables channel coupling in multichannel encoding according to arg.
 191.374 + *
 191.375 + * Argument: <tt>int *</tt>
 191.376 + *
 191.377 + *  Zero disables channel coupling for multichannel inputs, nonzer enables
 191.378 + *  channel coupling.  Setting has no effect on monophonic encoding or
 191.379 + *  multichannel counts that do not offer coupling.  At present, coupling is
 191.380 + *  available for stereo and 5.1 encoding.
 191.381 + */
 191.382 +#define OV_ECTL_COUPLING_SET         0x41
 191.383 +
 191.384 +  /* deprecated rate management supported only for compatibility */
 191.385 +
 191.386 +/**
 191.387 + * Old interface to querying bitrate management settings.
 191.388 + *
 191.389 + * Deprecated after move to bit-reservoir style management in 1.1 rendered
 191.390 + * this interface partially obsolete.
 191.391 +
 191.392 + * \deprecated Please use \ref OV_ECTL_RATEMANAGE2_GET instead.
 191.393 + *
 191.394 + * Argument: <tt>struct ovectl_ratemanage_arg *</tt>
 191.395 + */
 191.396 +#define OV_ECTL_RATEMANAGE_GET       0x10
 191.397 +/**
 191.398 + * Old interface to modifying bitrate management settings.
 191.399 + *
 191.400 + *  deprecated after move to bit-reservoir style management in 1.1 rendered
 191.401 + *  this interface partially obsolete.
 191.402 + *
 191.403 + * \deprecated Please use \ref OV_ECTL_RATEMANAGE2_SET instead.
 191.404 + *
 191.405 + * Argument: <tt>struct ovectl_ratemanage_arg *</tt>
 191.406 + */
 191.407 +#define OV_ECTL_RATEMANAGE_SET       0x11
 191.408 +/**
 191.409 + * Old interface to setting average-bitrate encoding mode.
 191.410 + *
 191.411 + * Deprecated after move to bit-reservoir style management in 1.1 rendered
 191.412 + * this interface partially obsolete.
 191.413 + *
 191.414 + *  \deprecated Please use \ref OV_ECTL_RATEMANAGE2_SET instead.
 191.415 + *
 191.416 + * Argument: <tt>struct ovectl_ratemanage_arg *</tt>
 191.417 + */
 191.418 +#define OV_ECTL_RATEMANAGE_AVG       0x12
 191.419 +/**
 191.420 + * Old interface to setting bounded-bitrate encoding modes.
 191.421 + *
 191.422 + * deprecated after move to bit-reservoir style management in 1.1 rendered
 191.423 + * this interface partially obsolete.
 191.424 + *
 191.425 + *  \deprecated Please use \ref OV_ECTL_RATEMANAGE2_SET instead.
 191.426 + *
 191.427 + * Argument: <tt>struct ovectl_ratemanage_arg *</tt>
 191.428 + */
 191.429 +#define OV_ECTL_RATEMANAGE_HARD      0x13
 191.430 +
 191.431 +/*@}*/
 191.432 +
 191.433 +
 191.434 +
 191.435 +#ifdef __cplusplus
 191.436 +}
 191.437 +#endif /* __cplusplus */
 191.438 +
 191.439 +#endif
   192.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   192.2 +++ b/libs/vorbis/vorbisfile.c	Sun Nov 01 00:36:56 2015 +0200
   192.3 @@ -0,0 +1,2337 @@
   192.4 +/********************************************************************
   192.5 + *                                                                  *
   192.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   192.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   192.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   192.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  192.10 + *                                                                  *
  192.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
  192.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  192.13 + *                                                                  *
  192.14 + ********************************************************************
  192.15 +
  192.16 + function: stdio-based convenience library for opening/seeking/decoding
  192.17 + last mod: $Id: vorbisfile.c 17573 2010-10-27 14:53:59Z xiphmont $
  192.18 +
  192.19 + ********************************************************************/
  192.20 +
  192.21 +#include <stdlib.h>
  192.22 +#include <stdio.h>
  192.23 +#include <errno.h>
  192.24 +#include <string.h>
  192.25 +#include <math.h>
  192.26 +
  192.27 +#include "vorbis/codec.h"
  192.28 +
  192.29 +/* we don't need or want the static callback symbols here */
  192.30 +#define OV_EXCLUDE_STATIC_CALLBACKS
  192.31 +#include "vorbis/vorbisfile.h"
  192.32 +
  192.33 +#include "os.h"
  192.34 +#include "misc.h"
  192.35 +
  192.36 +/* A 'chained bitstream' is a Vorbis bitstream that contains more than
  192.37 +   one logical bitstream arranged end to end (the only form of Ogg
  192.38 +   multiplexing allowed in a Vorbis bitstream; grouping [parallel
  192.39 +   multiplexing] is not allowed in Vorbis) */
  192.40 +
  192.41 +/* A Vorbis file can be played beginning to end (streamed) without
  192.42 +   worrying ahead of time about chaining (see decoder_example.c).  If
  192.43 +   we have the whole file, however, and want random access
  192.44 +   (seeking/scrubbing) or desire to know the total length/time of a
  192.45 +   file, we need to account for the possibility of chaining. */
  192.46 +
  192.47 +/* We can handle things a number of ways; we can determine the entire
  192.48 +   bitstream structure right off the bat, or find pieces on demand.
  192.49 +   This example determines and caches structure for the entire
  192.50 +   bitstream, but builds a virtual decoder on the fly when moving
  192.51 +   between links in the chain. */
  192.52 +
  192.53 +/* There are also different ways to implement seeking.  Enough
  192.54 +   information exists in an Ogg bitstream to seek to
  192.55 +   sample-granularity positions in the output.  Or, one can seek by
  192.56 +   picking some portion of the stream roughly in the desired area if
  192.57 +   we only want coarse navigation through the stream. */
  192.58 +
  192.59 +/*************************************************************************
  192.60 + * Many, many internal helpers.  The intention is not to be confusing;
  192.61 + * rampant duplication and monolithic function implementation would be
  192.62 + * harder to understand anyway.  The high level functions are last.  Begin
  192.63 + * grokking near the end of the file */
  192.64 +
  192.65 +/* read a little more data from the file/pipe into the ogg_sync framer
  192.66 +*/
  192.67 +#define CHUNKSIZE 65536 /* greater-than-page-size granularity seeking */
  192.68 +#define READSIZE 2048 /* a smaller read size is needed for low-rate streaming. */
  192.69 +
  192.70 +static long _get_data(OggVorbis_File *vf){
  192.71 +  errno=0;
  192.72 +  if(!(vf->callbacks.read_func))return(-1);
  192.73 +  if(vf->datasource){
  192.74 +    char *buffer=ogg_sync_buffer(&vf->oy,READSIZE);
  192.75 +    long bytes=(vf->callbacks.read_func)(buffer,1,READSIZE,vf->datasource);
  192.76 +    if(bytes>0)ogg_sync_wrote(&vf->oy,bytes);
  192.77 +    if(bytes==0 && errno)return(-1);
  192.78 +    return(bytes);
  192.79 +  }else
  192.80 +    return(0);
  192.81 +}
  192.82 +
  192.83 +/* save a tiny smidge of verbosity to make the code more readable */
  192.84 +static int _seek_helper(OggVorbis_File *vf,ogg_int64_t offset){
  192.85 +  if(vf->datasource){
  192.86 +    if(!(vf->callbacks.seek_func)||
  192.87 +       (vf->callbacks.seek_func)(vf->datasource, offset, SEEK_SET) == -1)
  192.88 +      return OV_EREAD;
  192.89 +    vf->offset=offset;
  192.90 +    ogg_sync_reset(&vf->oy);
  192.91 +  }else{
  192.92 +    /* shouldn't happen unless someone writes a broken callback */
  192.93 +    return OV_EFAULT;
  192.94 +  }
  192.95 +  return 0;
  192.96 +}
  192.97 +
  192.98 +/* The read/seek functions track absolute position within the stream */
  192.99 +
 192.100 +/* from the head of the stream, get the next page.  boundary specifies
 192.101 +   if the function is allowed to fetch more data from the stream (and
 192.102 +   how much) or only use internally buffered data.
 192.103 +
 192.104 +   boundary: -1) unbounded search
 192.105 +              0) read no additional data; use cached only
 192.106 +              n) search for a new page beginning for n bytes
 192.107 +
 192.108 +   return:   <0) did not find a page (OV_FALSE, OV_EOF, OV_EREAD)
 192.109 +              n) found a page at absolute offset n */
 192.110 +
 192.111 +static ogg_int64_t _get_next_page(OggVorbis_File *vf,ogg_page *og,
 192.112 +                                  ogg_int64_t boundary){
 192.113 +  if(boundary>0)boundary+=vf->offset;
 192.114 +  while(1){
 192.115 +    long more;
 192.116 +
 192.117 +    if(boundary>0 && vf->offset>=boundary)return(OV_FALSE);
 192.118 +    more=ogg_sync_pageseek(&vf->oy,og);
 192.119 +
 192.120 +    if(more<0){
 192.121 +      /* skipped n bytes */
 192.122 +      vf->offset-=more;
 192.123 +    }else{
 192.124 +      if(more==0){
 192.125 +        /* send more paramedics */
 192.126 +        if(!boundary)return(OV_FALSE);
 192.127 +        {
 192.128 +          long ret=_get_data(vf);
 192.129 +          if(ret==0)return(OV_EOF);
 192.130 +          if(ret<0)return(OV_EREAD);
 192.131 +        }
 192.132 +      }else{
 192.133 +        /* got a page.  Return the offset at the page beginning,
 192.134 +           advance the internal offset past the page end */
 192.135 +        ogg_int64_t ret=vf->offset;
 192.136 +        vf->offset+=more;
 192.137 +        return(ret);
 192.138 +
 192.139 +      }
 192.140 +    }
 192.141 +  }
 192.142 +}
 192.143 +
 192.144 +/* find the latest page beginning before the current stream cursor
 192.145 +   position. Much dirtier than the above as Ogg doesn't have any
 192.146 +   backward search linkage.  no 'readp' as it will certainly have to
 192.147 +   read. */
 192.148 +/* returns offset or OV_EREAD, OV_FAULT */
 192.149 +static ogg_int64_t _get_prev_page(OggVorbis_File *vf,ogg_page *og){
 192.150 +  ogg_int64_t begin=vf->offset;
 192.151 +  ogg_int64_t end=begin;
 192.152 +  ogg_int64_t ret;
 192.153 +  ogg_int64_t offset=-1;
 192.154 +
 192.155 +  while(offset==-1){
 192.156 +    begin-=CHUNKSIZE;
 192.157 +    if(begin<0)
 192.158 +      begin=0;
 192.159 +
 192.160 +    ret=_seek_helper(vf,begin);
 192.161 +    if(ret)return(ret);
 192.162 +
 192.163 +    while(vf->offset<end){
 192.164 +      memset(og,0,sizeof(*og));
 192.165 +      ret=_get_next_page(vf,og,end-vf->offset);
 192.166 +      if(ret==OV_EREAD)return(OV_EREAD);
 192.167 +      if(ret<0){
 192.168 +        break;
 192.169 +      }else{
 192.170 +        offset=ret;
 192.171 +      }
 192.172 +    }
 192.173 +  }
 192.174 +
 192.175 +  /* In a fully compliant, non-multiplexed stream, we'll still be
 192.176 +     holding the last page.  In multiplexed (or noncompliant streams),
 192.177 +     we will probably have to re-read the last page we saw */
 192.178 +  if(og->header_len==0){
 192.179 +    ret=_seek_helper(vf,offset);
 192.180 +    if(ret)return(ret);
 192.181 +
 192.182 +    ret=_get_next_page(vf,og,CHUNKSIZE);
 192.183 +    if(ret<0)
 192.184 +      /* this shouldn't be possible */
 192.185 +      return(OV_EFAULT);
 192.186 +  }
 192.187 +
 192.188 +  return(offset);
 192.189 +}
 192.190 +
 192.191 +static void _add_serialno(ogg_page *og,long **serialno_list, int *n){
 192.192 +  long s = ogg_page_serialno(og);
 192.193 +  (*n)++;
 192.194 +
 192.195 +  if(*serialno_list){
 192.196 +    *serialno_list = _ogg_realloc(*serialno_list, sizeof(**serialno_list)*(*n));
 192.197 +  }else{
 192.198 +    *serialno_list = _ogg_malloc(sizeof(**serialno_list));
 192.199 +  }
 192.200 +
 192.201 +  (*serialno_list)[(*n)-1] = s;
 192.202 +}
 192.203 +
 192.204 +/* returns nonzero if found */
 192.205 +static int _lookup_serialno(long s, long *serialno_list, int n){
 192.206 +  if(serialno_list){
 192.207 +    while(n--){
 192.208 +      if(*serialno_list == s) return 1;
 192.209 +      serialno_list++;
 192.210 +    }
 192.211 +  }
 192.212 +  return 0;
 192.213 +}
 192.214 +
 192.215 +static int _lookup_page_serialno(ogg_page *og, long *serialno_list, int n){
 192.216 +  long s = ogg_page_serialno(og);
 192.217 +  return _lookup_serialno(s,serialno_list,n);
 192.218 +}
 192.219 +
 192.220 +/* performs the same search as _get_prev_page, but prefers pages of
 192.221 +   the specified serial number. If a page of the specified serialno is
 192.222 +   spotted during the seek-back-and-read-forward, it will return the
 192.223 +   info of last page of the matching serial number instead of the very
 192.224 +   last page.  If no page of the specified serialno is seen, it will
 192.225 +   return the info of last page and alter *serialno.  */
 192.226 +static ogg_int64_t _get_prev_page_serial(OggVorbis_File *vf,
 192.227 +                                         long *serial_list, int serial_n,
 192.228 +                                         int *serialno, ogg_int64_t *granpos){
 192.229 +  ogg_page og;
 192.230 +  ogg_int64_t begin=vf->offset;
 192.231 +  ogg_int64_t end=begin;
 192.232 +  ogg_int64_t ret;
 192.233 +
 192.234 +  ogg_int64_t prefoffset=-1;
 192.235 +  ogg_int64_t offset=-1;
 192.236 +  ogg_int64_t ret_serialno=-1;
 192.237 +  ogg_int64_t ret_gran=-1;
 192.238 +
 192.239 +  while(offset==-1){
 192.240 +    begin-=CHUNKSIZE;
 192.241 +    if(begin<0)
 192.242 +      begin=0;
 192.243 +
 192.244 +    ret=_seek_helper(vf,begin);
 192.245 +    if(ret)return(ret);
 192.246 +
 192.247 +    while(vf->offset<end){
 192.248 +      ret=_get_next_page(vf,&og,end-vf->offset);
 192.249 +      if(ret==OV_EREAD)return(OV_EREAD);
 192.250 +      if(ret<0){
 192.251 +        break;
 192.252 +      }else{
 192.253 +        ret_serialno=ogg_page_serialno(&og);
 192.254 +        ret_gran=ogg_page_granulepos(&og);
 192.255 +        offset=ret;
 192.256 +
 192.257 +        if(ret_serialno == *serialno){
 192.258 +          prefoffset=ret;
 192.259 +          *granpos=ret_gran;
 192.260 +        }
 192.261 +
 192.262 +        if(!_lookup_serialno(ret_serialno,serial_list,serial_n)){
 192.263 +          /* we fell off the end of the link, which means we seeked
 192.264 +             back too far and shouldn't have been looking in that link
 192.265 +             to begin with.  If we found the preferred serial number,
 192.266 +             forget that we saw it. */
 192.267 +          prefoffset=-1;
 192.268 +        }
 192.269 +      }
 192.270 +    }
 192.271 +  }
 192.272 +
 192.273 +  /* we're not interested in the page... just the serialno and granpos. */
 192.274 +  if(prefoffset>=0)return(prefoffset);
 192.275 +
 192.276 +  *serialno = ret_serialno;
 192.277 +  *granpos = ret_gran;
 192.278 +  return(offset);
 192.279 +
 192.280 +}
 192.281 +
 192.282 +/* uses the local ogg_stream storage in vf; this is important for
 192.283 +   non-streaming input sources */
 192.284 +static int _fetch_headers(OggVorbis_File *vf,vorbis_info *vi,vorbis_comment *vc,
 192.285 +                          long **serialno_list, int *serialno_n,
 192.286 +                          ogg_page *og_ptr){
 192.287 +  ogg_page og;
 192.288 +  ogg_packet op;
 192.289 +  int i,ret;
 192.290 +  int allbos=0;
 192.291 +
 192.292 +  if(!og_ptr){
 192.293 +    ogg_int64_t llret=_get_next_page(vf,&og,CHUNKSIZE);
 192.294 +    if(llret==OV_EREAD)return(OV_EREAD);
 192.295 +    if(llret<0)return(OV_ENOTVORBIS);
 192.296 +    og_ptr=&og;
 192.297 +  }
 192.298 +
 192.299 +  vorbis_info_init(vi);
 192.300 +  vorbis_comment_init(vc);
 192.301 +  vf->ready_state=OPENED;
 192.302 +
 192.303 +  /* extract the serialnos of all BOS pages + the first set of vorbis
 192.304 +     headers we see in the link */
 192.305 +
 192.306 +  while(ogg_page_bos(og_ptr)){
 192.307 +    if(serialno_list){
 192.308 +      if(_lookup_page_serialno(og_ptr,*serialno_list,*serialno_n)){
 192.309 +        /* a dupe serialnumber in an initial header packet set == invalid stream */
 192.310 +        if(*serialno_list)_ogg_free(*serialno_list);
 192.311 +        *serialno_list=0;
 192.312 +        *serialno_n=0;
 192.313 +        ret=OV_EBADHEADER;
 192.314 +        goto bail_header;
 192.315 +      }
 192.316 +
 192.317 +      _add_serialno(og_ptr,serialno_list,serialno_n);
 192.318 +    }
 192.319 +
 192.320 +    if(vf->ready_state<STREAMSET){
 192.321 +      /* we don't have a vorbis stream in this link yet, so begin
 192.322 +         prospective stream setup. We need a stream to get packets */
 192.323 +      ogg_stream_reset_serialno(&vf->os,ogg_page_serialno(og_ptr));
 192.324 +      ogg_stream_pagein(&vf->os,og_ptr);
 192.325 +
 192.326 +      if(ogg_stream_packetout(&vf->os,&op) > 0 &&
 192.327 +         vorbis_synthesis_idheader(&op)){
 192.328 +        /* vorbis header; continue setup */
 192.329 +        vf->ready_state=STREAMSET;
 192.330 +        if((ret=vorbis_synthesis_headerin(vi,vc,&op))){
 192.331 +          ret=OV_EBADHEADER;
 192.332 +          goto bail_header;
 192.333 +        }
 192.334 +      }
 192.335 +    }
 192.336 +
 192.337 +    /* get next page */
 192.338 +    {
 192.339 +      ogg_int64_t llret=_get_next_page(vf,og_ptr,CHUNKSIZE);
 192.340 +      if(llret==OV_EREAD){
 192.341 +        ret=OV_EREAD;
 192.342 +        goto bail_header;
 192.343 +      }
 192.344 +      if(llret<0){
 192.345 +        ret=OV_ENOTVORBIS;
 192.346 +        goto bail_header;
 192.347 +      }
 192.348 +
 192.349 +      /* if this page also belongs to our vorbis stream, submit it and break */
 192.350 +      if(vf->ready_state==STREAMSET &&
 192.351 +         vf->os.serialno == ogg_page_serialno(og_ptr)){
 192.352 +        ogg_stream_pagein(&vf->os,og_ptr);
 192.353 +        break;
 192.354 +      }
 192.355 +    }
 192.356 +  }
 192.357 +
 192.358 +  if(vf->ready_state!=STREAMSET){
 192.359 +    ret = OV_ENOTVORBIS;
 192.360 +    goto bail_header;
 192.361 +  }
 192.362 +
 192.363 +  while(1){
 192.364 +
 192.365 +    i=0;
 192.366 +    while(i<2){ /* get a page loop */
 192.367 +
 192.368 +      while(i<2){ /* get a packet loop */
 192.369 +
 192.370 +        int result=ogg_stream_packetout(&vf->os,&op);
 192.371 +        if(result==0)break;
 192.372 +        if(result==-1){
 192.373 +          ret=OV_EBADHEADER;
 192.374 +          goto bail_header;
 192.375 +        }
 192.376 +
 192.377 +        if((ret=vorbis_synthesis_headerin(vi,vc,&op)))
 192.378 +          goto bail_header;
 192.379 +
 192.380 +        i++;
 192.381 +      }
 192.382 +
 192.383 +      while(i<2){
 192.384 +        if(_get_next_page(vf,og_ptr,CHUNKSIZE)<0){
 192.385 +          ret=OV_EBADHEADER;
 192.386 +          goto bail_header;
 192.387 +        }
 192.388 +
 192.389 +        /* if this page belongs to the correct stream, go parse it */
 192.390 +        if(vf->os.serialno == ogg_page_serialno(og_ptr)){
 192.391 +          ogg_stream_pagein(&vf->os,og_ptr);
 192.392 +          break;
 192.393 +        }
 192.394 +
 192.395 +        /* if we never see the final vorbis headers before the link
 192.396 +           ends, abort */
 192.397 +        if(ogg_page_bos(og_ptr)){
 192.398 +          if(allbos){
 192.399 +            ret = OV_EBADHEADER;
 192.400 +            goto bail_header;
 192.401 +          }else
 192.402 +            allbos=1;
 192.403 +        }
 192.404 +
 192.405 +        /* otherwise, keep looking */
 192.406 +      }
 192.407 +    }
 192.408 +
 192.409 +    return 0;
 192.410 +  }
 192.411 +
 192.412 + bail_header:
 192.413 +  vorbis_info_clear(vi);
 192.414 +  vorbis_comment_clear(vc);
 192.415 +  vf->ready_state=OPENED;
 192.416 +
 192.417 +  return ret;
 192.418 +}
 192.419 +
 192.420 +/* Starting from current cursor position, get initial PCM offset of
 192.421 +   next page.  Consumes the page in the process without decoding
 192.422 +   audio, however this is only called during stream parsing upon
 192.423 +   seekable open. */
 192.424 +static ogg_int64_t _initial_pcmoffset(OggVorbis_File *vf, vorbis_info *vi){
 192.425 +  ogg_page    og;
 192.426 +  ogg_int64_t accumulated=0;
 192.427 +  long        lastblock=-1;
 192.428 +  int         result;
 192.429 +  int         serialno = vf->os.serialno;
 192.430 +
 192.431 +  while(1){
 192.432 +    ogg_packet op;
 192.433 +    if(_get_next_page(vf,&og,-1)<0)
 192.434 +      break; /* should not be possible unless the file is truncated/mangled */
 192.435 +
 192.436 +    if(ogg_page_bos(&og)) break;
 192.437 +    if(ogg_page_serialno(&og)!=serialno) continue;
 192.438 +
 192.439 +    /* count blocksizes of all frames in the page */
 192.440 +    ogg_stream_pagein(&vf->os,&og);
 192.441 +    while((result=ogg_stream_packetout(&vf->os,&op))){
 192.442 +      if(result>0){ /* ignore holes */
 192.443 +        long thisblock=vorbis_packet_blocksize(vi,&op);
 192.444 +        if(lastblock!=-1)
 192.445 +          accumulated+=(lastblock+thisblock)>>2;
 192.446 +        lastblock=thisblock;
 192.447 +      }
 192.448 +    }
 192.449 +
 192.450 +    if(ogg_page_granulepos(&og)!=-1){
 192.451 +      /* pcm offset of last packet on the first audio page */
 192.452 +      accumulated= ogg_page_granulepos(&og)-accumulated;
 192.453 +      break;
 192.454 +    }
 192.455 +  }
 192.456 +
 192.457 +  /* less than zero?  Either a corrupt file or a stream with samples
 192.458 +     trimmed off the beginning, a normal occurrence; in both cases set
 192.459 +     the offset to zero */
 192.460 +  if(accumulated<0)accumulated=0;
 192.461 +
 192.462 +  return accumulated;
 192.463 +}
 192.464 +
 192.465 +/* finds each bitstream link one at a time using a bisection search
 192.466 +   (has to begin by knowing the offset of the lb's initial page).
 192.467 +   Recurses for each link so it can alloc the link storage after
 192.468 +   finding them all, then unroll and fill the cache at the same time */
 192.469 +static int _bisect_forward_serialno(OggVorbis_File *vf,
 192.470 +                                    ogg_int64_t begin,
 192.471 +                                    ogg_int64_t searched,
 192.472 +                                    ogg_int64_t end,
 192.473 +                                    ogg_int64_t endgran,
 192.474 +                                    int endserial,
 192.475 +                                    long *currentno_list,
 192.476 +                                    int  currentnos,
 192.477 +                                    long m){
 192.478 +  ogg_int64_t pcmoffset;
 192.479 +  ogg_int64_t dataoffset=searched;
 192.480 +  ogg_int64_t endsearched=end;
 192.481 +  ogg_int64_t next=end;
 192.482 +  ogg_int64_t searchgran=-1;
 192.483 +  ogg_page og;
 192.484 +  ogg_int64_t ret,last;
 192.485 +  int serialno = vf->os.serialno;
 192.486 +
 192.487 +  /* invariants:
 192.488 +     we have the headers and serialnos for the link beginning at 'begin'
 192.489 +     we have the offset and granpos of the last page in the file (potentially
 192.490 +       not a page we care about)
 192.491 +  */
 192.492 +
 192.493 +  /* Is the last page in our list of current serialnumbers? */
 192.494 +  if(_lookup_serialno(endserial,currentno_list,currentnos)){
 192.495 +
 192.496 +    /* last page is in the starting serialno list, so we've bisected
 192.497 +       down to (or just started with) a single link.  Now we need to
 192.498 +       find the last vorbis page belonging to the first vorbis stream
 192.499 +       for this link. */
 192.500 +
 192.501 +    while(endserial != serialno){
 192.502 +      endserial = serialno;
 192.503 +      vf->offset=_get_prev_page_serial(vf,currentno_list,currentnos,&endserial,&endgran);
 192.504 +    }
 192.505 +
 192.506 +    vf->links=m+1;
 192.507 +    if(vf->offsets)_ogg_free(vf->offsets);
 192.508 +    if(vf->serialnos)_ogg_free(vf->serialnos);
 192.509 +    if(vf->dataoffsets)_ogg_free(vf->dataoffsets);
 192.510 +
 192.511 +    vf->offsets=_ogg_malloc((vf->links+1)*sizeof(*vf->offsets));
 192.512 +    vf->vi=_ogg_realloc(vf->vi,vf->links*sizeof(*vf->vi));
 192.513 +    vf->vc=_ogg_realloc(vf->vc,vf->links*sizeof(*vf->vc));
 192.514 +    vf->serialnos=_ogg_malloc(vf->links*sizeof(*vf->serialnos));
 192.515 +    vf->dataoffsets=_ogg_malloc(vf->links*sizeof(*vf->dataoffsets));
 192.516 +    vf->pcmlengths=_ogg_malloc(vf->links*2*sizeof(*vf->pcmlengths));
 192.517 +
 192.518 +    vf->offsets[m+1]=end;
 192.519 +    vf->offsets[m]=begin;
 192.520 +    vf->pcmlengths[m*2+1]=(endgran<0?0:endgran);
 192.521 +
 192.522 +  }else{
 192.523 +
 192.524 +    long *next_serialno_list=NULL;
 192.525 +    int next_serialnos=0;
 192.526 +    vorbis_info vi;
 192.527 +    vorbis_comment vc;
 192.528 +
 192.529 +    /* the below guards against garbage seperating the last and
 192.530 +       first pages of two links. */
 192.531 +    while(searched<endsearched){
 192.532 +      ogg_int64_t bisect;
 192.533 +
 192.534 +      if(endsearched-searched<CHUNKSIZE){
 192.535 +        bisect=searched;
 192.536 +      }else{
 192.537 +        bisect=(searched+endsearched)/2;
 192.538 +      }
 192.539 +
 192.540 +      if(bisect != vf->offset){
 192.541 +        ret=_seek_helper(vf,bisect);
 192.542 +        if(ret)return(ret);
 192.543 +      }
 192.544 +
 192.545 +      last=_get_next_page(vf,&og,-1);
 192.546 +      if(last==OV_EREAD)return(OV_EREAD);
 192.547 +      if(last<0 || !_lookup_page_serialno(&og,currentno_list,currentnos)){
 192.548 +        endsearched=bisect;
 192.549 +        if(last>=0)next=last;
 192.550 +      }else{
 192.551 +        searched=vf->offset;
 192.552 +      }
 192.553 +    }
 192.554 +
 192.555 +    /* Bisection point found */
 192.556 +
 192.557 +    /* for the time being, fetch end PCM offset the simple way */
 192.558 +    {
 192.559 +      int testserial = serialno+1;
 192.560 +      vf->offset = next;
 192.561 +      while(testserial != serialno){
 192.562 +        testserial = serialno;
 192.563 +        vf->offset=_get_prev_page_serial(vf,currentno_list,currentnos,&testserial,&searchgran);
 192.564 +      }
 192.565 +    }
 192.566 +
 192.567 +    if(vf->offset!=next){
 192.568 +      ret=_seek_helper(vf,next);
 192.569 +      if(ret)return(ret);
 192.570 +    }
 192.571 +
 192.572 +    ret=_fetch_headers(vf,&vi,&vc,&next_serialno_list,&next_serialnos,NULL);
 192.573 +    if(ret)return(ret);
 192.574 +    serialno = vf->os.serialno;
 192.575 +    dataoffset = vf->offset;
 192.576 +
 192.577 +    /* this will consume a page, however the next bistection always
 192.578 +       starts with a raw seek */
 192.579 +    pcmoffset = _initial_pcmoffset(vf,&vi);
 192.580 +
 192.581 +    ret=_bisect_forward_serialno(vf,next,vf->offset,end,endgran,endserial,
 192.582 +                                 next_serialno_list,next_serialnos,m+1);
 192.583 +    if(ret)return(ret);
 192.584 +
 192.585 +    if(next_serialno_list)_ogg_free(next_serialno_list);
 192.586 +
 192.587 +    vf->offsets[m+1]=next;
 192.588 +    vf->serialnos[m+1]=serialno;
 192.589 +    vf->dataoffsets[m+1]=dataoffset;
 192.590 +
 192.591 +    vf->vi[m+1]=vi;
 192.592 +    vf->vc[m+1]=vc;
 192.593 +
 192.594 +    vf->pcmlengths[m*2+1]=searchgran;
 192.595 +    vf->pcmlengths[m*2+2]=pcmoffset;
 192.596 +    vf->pcmlengths[m*2+3]-=pcmoffset;
 192.597 +    if(vf->pcmlengths[m*2+3]<0)vf->pcmlengths[m*2+3]=0;
 192.598 +  }
 192.599 +  return(0);
 192.600 +}
 192.601 +
 192.602 +static int _make_decode_ready(OggVorbis_File *vf){
 192.603 +  if(vf->ready_state>STREAMSET)return 0;
 192.604 +  if(vf->ready_state<STREAMSET)return OV_EFAULT;
 192.605 +  if(vf->seekable){
 192.606 +    if(vorbis_synthesis_init(&vf->vd,vf->vi+vf->current_link))
 192.607 +      return OV_EBADLINK;
 192.608 +  }else{
 192.609 +    if(vorbis_synthesis_init(&vf->vd,vf->vi))
 192.610 +      return OV_EBADLINK;
 192.611 +  }
 192.612 +  vorbis_block_init(&vf->vd,&vf->vb);
 192.613 +  vf->ready_state=INITSET;
 192.614 +  vf->bittrack=0.f;
 192.615 +  vf->samptrack=0.f;
 192.616 +  return 0;
 192.617 +}
 192.618 +
 192.619 +static int _open_seekable2(OggVorbis_File *vf){
 192.620 +  ogg_int64_t dataoffset=vf->dataoffsets[0],end,endgran=-1;
 192.621 +  int endserial=vf->os.serialno;
 192.622 +  int serialno=vf->os.serialno;
 192.623 +
 192.624 +  /* we're partially open and have a first link header state in
 192.625 +     storage in vf */
 192.626 +
 192.627 +  /* fetch initial PCM offset */
 192.628 +  ogg_int64_t pcmoffset = _initial_pcmoffset(vf,vf->vi);
 192.629 +
 192.630 +  /* we can seek, so set out learning all about this file */
 192.631 +  if(vf->callbacks.seek_func && vf->callbacks.tell_func){
 192.632 +    (vf->callbacks.seek_func)(vf->datasource,0,SEEK_END);
 192.633 +    vf->offset=vf->end=(vf->callbacks.tell_func)(vf->datasource);
 192.634 +  }else{
 192.635 +    vf->offset=vf->end=-1;
 192.636 +  }
 192.637 +
 192.638 +  /* If seek_func is implemented, tell_func must also be implemented */
 192.639 +  if(vf->end==-1) return(OV_EINVAL);
 192.640 +
 192.641 +  /* Get the offset of the last page of the physical bitstream, or, if
 192.642 +     we're lucky the last vorbis page of this link as most OggVorbis
 192.643 +     files will contain a single logical bitstream */
 192.644 +  end=_get_prev_page_serial(vf,vf->serialnos+2,vf->serialnos[1],&endserial,&endgran);
 192.645 +  if(end<0)return(end);
 192.646 +
 192.647 +  /* now determine bitstream structure recursively */
 192.648 +  if(_bisect_forward_serialno(vf,0,dataoffset,vf->offset,endgran,endserial,
 192.649 +                              vf->serialnos+2,vf->serialnos[1],0)<0)return(OV_EREAD);
 192.650 +
 192.651 +  vf->offsets[0]=0;
 192.652 +  vf->serialnos[0]=serialno;
 192.653 +  vf->dataoffsets[0]=dataoffset;
 192.654 +  vf->pcmlengths[0]=pcmoffset;
 192.655 +  vf->pcmlengths[1]-=pcmoffset;
 192.656 +  if(vf->pcmlengths[1]<0)vf->pcmlengths[1]=0;
 192.657 +
 192.658 +  return(ov_raw_seek(vf,dataoffset));
 192.659 +}
 192.660 +
 192.661 +/* clear out the current logical bitstream decoder */
 192.662 +static void _decode_clear(OggVorbis_File *vf){
 192.663 +  vorbis_dsp_clear(&vf->vd);
 192.664 +  vorbis_block_clear(&vf->vb);
 192.665 +  vf->ready_state=OPENED;
 192.666 +}
 192.667 +
 192.668 +/* fetch and process a packet.  Handles the case where we're at a
 192.669 +   bitstream boundary and dumps the decoding machine.  If the decoding
 192.670 +   machine is unloaded, it loads it.  It also keeps pcm_offset up to
 192.671 +   date (seek and read both use this.  seek uses a special hack with
 192.672 +   readp).
 192.673 +
 192.674 +   return: <0) error, OV_HOLE (lost packet) or OV_EOF
 192.675 +            0) need more data (only if readp==0)
 192.676 +            1) got a packet
 192.677 +*/
 192.678 +
 192.679 +static int _fetch_and_process_packet(OggVorbis_File *vf,
 192.680 +                                     ogg_packet *op_in,
 192.681 +                                     int readp,
 192.682 +                                     int spanp){
 192.683 +  ogg_page og;
 192.684 +
 192.685 +  /* handle one packet.  Try to fetch it from current stream state */
 192.686 +  /* extract packets from page */
 192.687 +  while(1){
 192.688 +
 192.689 +    if(vf->ready_state==STREAMSET){
 192.690 +      int ret=_make_decode_ready(vf);
 192.691 +      if(ret<0)return ret;
 192.692 +    }
 192.693 +
 192.694 +    /* process a packet if we can. */
 192.695 +
 192.696 +    if(vf->ready_state==INITSET){
 192.697 +      int hs=vorbis_synthesis_halfrate_p(vf->vi);
 192.698 +
 192.699 +      while(1) {
 192.700 +              ogg_packet op;
 192.701 +              ogg_packet *op_ptr=(op_in?op_in:&op);
 192.702 +        int result=ogg_stream_packetout(&vf->os,op_ptr);
 192.703 +        ogg_int64_t granulepos;
 192.704 +
 192.705 +        op_in=NULL;
 192.706 +        if(result==-1)return(OV_HOLE); /* hole in the data. */
 192.707 +        if(result>0){
 192.708 +          /* got a packet.  process it */
 192.709 +          granulepos=op_ptr->granulepos;
 192.710 +          if(!vorbis_synthesis(&vf->vb,op_ptr)){ /* lazy check for lazy
 192.711 +                                                    header handling.  The
 192.712 +                                                    header packets aren't
 192.713 +                                                    audio, so if/when we
 192.714 +                                                    submit them,
 192.715 +                                                    vorbis_synthesis will
 192.716 +                                                    reject them */
 192.717 +
 192.718 +            /* suck in the synthesis data and track bitrate */
 192.719 +            {
 192.720 +              int oldsamples=vorbis_synthesis_pcmout(&vf->vd,NULL);
 192.721 +              /* for proper use of libvorbis within libvorbisfile,
 192.722 +                 oldsamples will always be zero. */
 192.723 +              if(oldsamples)return(OV_EFAULT);
 192.724 +
 192.725 +              vorbis_synthesis_blockin(&vf->vd,&vf->vb);
 192.726 +              vf->samptrack+=(vorbis_synthesis_pcmout(&vf->vd,NULL)<<hs);
 192.727 +              vf->bittrack+=op_ptr->bytes*8;
 192.728 +            }
 192.729 +
 192.730 +            /* update the pcm offset. */
 192.731 +            if(granulepos!=-1 && !op_ptr->e_o_s){
 192.732 +              int link=(vf->seekable?vf->current_link:0);
 192.733 +              int i,samples;
 192.734 +
 192.735 +              /* this packet has a pcm_offset on it (the last packet
 192.736 +                 completed on a page carries the offset) After processing
 192.737 +                 (above), we know the pcm position of the *last* sample
 192.738 +                 ready to be returned. Find the offset of the *first*
 192.739 +
 192.740 +                 As an aside, this trick is inaccurate if we begin
 192.741 +                 reading anew right at the last page; the end-of-stream
 192.742 +                 granulepos declares the last frame in the stream, and the
 192.743 +                 last packet of the last page may be a partial frame.
 192.744 +                 So, we need a previous granulepos from an in-sequence page
 192.745 +                 to have a reference point.  Thus the !op_ptr->e_o_s clause
 192.746 +                 above */
 192.747 +
 192.748 +              if(vf->seekable && link>0)
 192.749 +                granulepos-=vf->pcmlengths[link*2];
 192.750 +              if(granulepos<0)granulepos=0; /* actually, this
 192.751 +                                               shouldn't be possible
 192.752 +                                               here unless the stream
 192.753 +                                               is very broken */
 192.754 +
 192.755 +              samples=(vorbis_synthesis_pcmout(&vf->vd,NULL)<<hs);
 192.756 +
 192.757 +              granulepos-=samples;
 192.758 +              for(i=0;i<link;i++)
 192.759 +                granulepos+=vf->pcmlengths[i*2+1];
 192.760 +              vf->pcm_offset=granulepos;
 192.761 +            }
 192.762 +            return(1);
 192.763 +          }
 192.764 +        }
 192.765 +        else
 192.766 +          break;
 192.767 +      }
 192.768 +    }
 192.769 +
 192.770 +    if(vf->ready_state>=OPENED){
 192.771 +      ogg_int64_t ret;
 192.772 +
 192.773 +      while(1){
 192.774 +        /* the loop is not strictly necessary, but there's no sense in
 192.775 +           doing the extra checks of the larger loop for the common
 192.776 +           case in a multiplexed bistream where the page is simply
 192.777 +           part of a different logical bitstream; keep reading until
 192.778 +           we get one with the correct serialno */
 192.779 +
 192.780 +        if(!readp)return(0);
 192.781 +        if((ret=_get_next_page(vf,&og,-1))<0){
 192.782 +          return(OV_EOF); /* eof. leave unitialized */
 192.783 +        }
 192.784 +
 192.785 +        /* bitrate tracking; add the header's bytes here, the body bytes
 192.786 +           are done by packet above */
 192.787 +        vf->bittrack+=og.header_len*8;
 192.788 +
 192.789 +        if(vf->ready_state==INITSET){
 192.790 +          if(vf->current_serialno!=ogg_page_serialno(&og)){
 192.791 +
 192.792 +            /* two possibilities:
 192.793 +               1) our decoding just traversed a bitstream boundary
 192.794 +               2) another stream is multiplexed into this logical section */
 192.795 +
 192.796 +            if(ogg_page_bos(&og)){
 192.797 +              /* boundary case */
 192.798 +              if(!spanp)
 192.799 +                return(OV_EOF);
 192.800 +
 192.801 +              _decode_clear(vf);
 192.802 +
 192.803 +              if(!vf->seekable){
 192.804 +                vorbis_info_clear(vf->vi);
 192.805 +                vorbis_comment_clear(vf->vc);
 192.806 +              }
 192.807 +              break;
 192.808 +
 192.809 +            }else
 192.810 +              continue; /* possibility #2 */
 192.811 +          }
 192.812 +        }
 192.813 +
 192.814 +        break;
 192.815 +      }
 192.816 +    }
 192.817 +
 192.818 +    /* Do we need to load a new machine before submitting the page? */
 192.819 +    /* This is different in the seekable and non-seekable cases.
 192.820 +
 192.821 +       In the seekable case, we already have all the header
 192.822 +       information loaded and cached; we just initialize the machine
 192.823 +       with it and continue on our merry way.
 192.824 +
 192.825 +       In the non-seekable (streaming) case, we'll only be at a
 192.826 +       boundary if we just left the previous logical bitstream and
 192.827 +       we're now nominally at the header of the next bitstream
 192.828 +    */
 192.829 +
 192.830 +    if(vf->ready_state!=INITSET){
 192.831 +      int link;
 192.832 +
 192.833 +      if(vf->ready_state<STREAMSET){
 192.834 +        if(vf->seekable){
 192.835 +          long serialno = ogg_page_serialno(&og);
 192.836 +
 192.837 +          /* match the serialno to bitstream section.  We use this rather than
 192.838 +             offset positions to avoid problems near logical bitstream
 192.839 +             boundaries */
 192.840 +
 192.841 +          for(link=0;link<vf->links;link++)
 192.842 +            if(vf->serialnos[link]==serialno)break;
 192.843 +
 192.844 +          if(link==vf->links) continue; /* not the desired Vorbis
 192.845 +                                           bitstream section; keep
 192.846 +                                           trying */
 192.847 +
 192.848 +          vf->current_serialno=serialno;
 192.849 +          vf->current_link=link;
 192.850 +
 192.851 +          ogg_stream_reset_serialno(&vf->os,vf->current_serialno);
 192.852 +          vf->ready_state=STREAMSET;
 192.853 +
 192.854 +        }else{
 192.855 +          /* we're streaming */
 192.856 +          /* fetch the three header packets, build the info struct */
 192.857 +
 192.858 +          int ret=_fetch_headers(vf,vf->vi,vf->vc,NULL,NULL,&og);
 192.859 +          if(ret)return(ret);
 192.860 +          vf->current_serialno=vf->os.serialno;
 192.861 +          vf->current_link++;
 192.862 +          link=0;
 192.863 +        }
 192.864 +      }
 192.865 +    }
 192.866 +
 192.867 +    /* the buffered page is the data we want, and we're ready for it;
 192.868 +       add it to the stream state */
 192.869 +    ogg_stream_pagein(&vf->os,&og);
 192.870 +
 192.871 +  }
 192.872 +}
 192.873 +
 192.874 +/* if, eg, 64 bit stdio is configured by default, this will build with
 192.875 +   fseek64 */
 192.876 +static int _fseek64_wrap(FILE *f,ogg_int64_t off,int whence){
 192.877 +  if(f==NULL)return(-1);
 192.878 +  return fseek(f,off,whence);
 192.879 +}
 192.880 +
 192.881 +static int _ov_open1(void *f,OggVorbis_File *vf,const char *initial,
 192.882 +                     long ibytes, ov_callbacks callbacks){
 192.883 +  int offsettest=((f && callbacks.seek_func)?callbacks.seek_func(f,0,SEEK_CUR):-1);
 192.884 +  long *serialno_list=NULL;
 192.885 +  int serialno_list_size=0;
 192.886 +  int ret;
 192.887 +
 192.888 +  memset(vf,0,sizeof(*vf));
 192.889 +  vf->datasource=f;
 192.890 +  vf->callbacks = callbacks;
 192.891 +
 192.892 +  /* init the framing state */
 192.893 +  ogg_sync_init(&vf->oy);
 192.894 +
 192.895 +  /* perhaps some data was previously read into a buffer for testing
 192.896 +     against other stream types.  Allow initialization from this
 192.897 +     previously read data (especially as we may be reading from a
 192.898 +     non-seekable stream) */
 192.899 +  if(initial){
 192.900 +    char *buffer=ogg_sync_buffer(&vf->oy,ibytes);
 192.901 +    memcpy(buffer,initial,ibytes);
 192.902 +    ogg_sync_wrote(&vf->oy,ibytes);
 192.903 +  }
 192.904 +
 192.905 +  /* can we seek? Stevens suggests the seek test was portable */
 192.906 +  if(offsettest!=-1)vf->seekable=1;
 192.907 +
 192.908 +  /* No seeking yet; Set up a 'single' (current) logical bitstream
 192.909 +     entry for partial open */
 192.910 +  vf->links=1;
 192.911 +  vf->vi=_ogg_calloc(vf->links,sizeof(*vf->vi));
 192.912 +  vf->vc=_ogg_calloc(vf->links,sizeof(*vf->vc));
 192.913 +  ogg_stream_init(&vf->os,-1); /* fill in the serialno later */
 192.914 +
 192.915 +  /* Fetch all BOS pages, store the vorbis header and all seen serial
 192.916 +     numbers, load subsequent vorbis setup headers */
 192.917 +  if((ret=_fetch_headers(vf,vf->vi,vf->vc,&serialno_list,&serialno_list_size,NULL))<0){
 192.918 +    vf->datasource=NULL;
 192.919 +    ov_clear(vf);
 192.920 +  }else{
 192.921 +    /* serial number list for first link needs to be held somewhere
 192.922 +       for second stage of seekable stream open; this saves having to
 192.923 +       seek/reread first link's serialnumber data then. */
 192.924 +    vf->serialnos=_ogg_calloc(serialno_list_size+2,sizeof(*vf->serialnos));
 192.925 +    vf->serialnos[0]=vf->current_serialno=vf->os.serialno;
 192.926 +    vf->serialnos[1]=serialno_list_size;
 192.927 +    memcpy(vf->serialnos+2,serialno_list,serialno_list_size*sizeof(*vf->serialnos));
 192.928 +
 192.929 +    vf->offsets=_ogg_calloc(1,sizeof(*vf->offsets));
 192.930 +    vf->dataoffsets=_ogg_calloc(1,sizeof(*vf->dataoffsets));
 192.931 +    vf->offsets[0]=0;
 192.932 +    vf->dataoffsets[0]=vf->offset;
 192.933 +
 192.934 +    vf->ready_state=PARTOPEN;
 192.935 +  }
 192.936 +  if(serialno_list)_ogg_free(serialno_list);
 192.937 +  return(ret);
 192.938 +}
 192.939 +
 192.940 +static int _ov_open2(OggVorbis_File *vf){
 192.941 +  if(vf->ready_state != PARTOPEN) return OV_EINVAL;
 192.942 +  vf->ready_state=OPENED;
 192.943 +  if(vf->seekable){
 192.944 +    int ret=_open_seekable2(vf);
 192.945 +    if(ret){
 192.946 +      vf->datasource=NULL;
 192.947 +      ov_clear(vf);
 192.948 +    }
 192.949 +    return(ret);
 192.950 +  }else
 192.951 +    vf->ready_state=STREAMSET;
 192.952 +
 192.953 +  return 0;
 192.954 +}
 192.955 +
 192.956 +
 192.957 +/* clear out the OggVorbis_File struct */
 192.958 +int ov_clear(OggVorbis_File *vf){
 192.959 +  if(vf){
 192.960 +    vorbis_block_clear(&vf->vb);
 192.961 +    vorbis_dsp_clear(&vf->vd);
 192.962 +    ogg_stream_clear(&vf->os);
 192.963 +
 192.964 +    if(vf->vi && vf->links){
 192.965 +      int i;
 192.966 +      for(i=0;i<vf->links;i++){
 192.967 +        vorbis_info_clear(vf->vi+i);
 192.968 +        vorbis_comment_clear(vf->vc+i);
 192.969 +      }
 192.970 +      _ogg_free(vf->vi);
 192.971 +      _ogg_free(vf->vc);
 192.972 +    }
 192.973 +    if(vf->dataoffsets)_ogg_free(vf->dataoffsets);
 192.974 +    if(vf->pcmlengths)_ogg_free(vf->pcmlengths);
 192.975 +    if(vf->serialnos)_ogg_free(vf->serialnos);
 192.976 +    if(vf->offsets)_ogg_free(vf->offsets);
 192.977 +    ogg_sync_clear(&vf->oy);
 192.978 +    if(vf->datasource && vf->callbacks.close_func)
 192.979 +      (vf->callbacks.close_func)(vf->datasource);
 192.980 +    memset(vf,0,sizeof(*vf));
 192.981 +  }
 192.982 +#ifdef DEBUG_LEAKS
 192.983 +  _VDBG_dump();
 192.984 +#endif
 192.985 +  return(0);
 192.986 +}
 192.987 +
 192.988 +/* inspects the OggVorbis file and finds/documents all the logical
 192.989 +   bitstreams contained in it.  Tries to be tolerant of logical
 192.990 +   bitstream sections that are truncated/woogie.
 192.991 +
 192.992 +   return: -1) error
 192.993 +            0) OK
 192.994 +*/
 192.995 +
 192.996 +int ov_open_callbacks(void *f,OggVorbis_File *vf,
 192.997 +    const char *initial,long ibytes,ov_callbacks callbacks){
 192.998 +  int ret=_ov_open1(f,vf,initial,ibytes,callbacks);
 192.999 +  if(ret)return ret;
192.1000 +  return _ov_open2(vf);
192.1001 +}
192.1002 +
192.1003 +int ov_open(FILE *f,OggVorbis_File *vf,const char *initial,long ibytes){
192.1004 +  ov_callbacks callbacks = {
192.1005 +    (size_t (*)(void *, size_t, size_t, void *))  fread,
192.1006 +    (int (*)(void *, ogg_int64_t, int))              _fseek64_wrap,
192.1007 +    (int (*)(void *))                             fclose,
192.1008 +    (long (*)(void *))                            ftell
192.1009 +  };
192.1010 +
192.1011 +  return ov_open_callbacks((void *)f, vf, initial, ibytes, callbacks);
192.1012 +}
192.1013 +
192.1014 +int ov_fopen(const char *path,OggVorbis_File *vf){
192.1015 +  int ret;
192.1016 +  FILE *f = fopen(path,"rb");
192.1017 +  if(!f) return -1;
192.1018 +
192.1019 +  ret = ov_open(f,vf,NULL,0);
192.1020 +  if(ret) fclose(f);
192.1021 +  return ret;
192.1022 +}
192.1023 +
192.1024 +
192.1025 +/* cheap hack for game usage where downsampling is desirable; there's
192.1026 +   no need for SRC as we can just do it cheaply in libvorbis. */
192.1027 +
192.1028 +int ov_halfrate(OggVorbis_File *vf,int flag){
192.1029 +  int i;
192.1030 +  if(vf->vi==NULL)return OV_EINVAL;
192.1031 +  if(vf->ready_state>STREAMSET){
192.1032 +    /* clear out stream state; dumping the decode machine is needed to
192.1033 +       reinit the MDCT lookups. */
192.1034 +    vorbis_dsp_clear(&vf->vd);
192.1035 +    vorbis_block_clear(&vf->vb);
192.1036 +    vf->ready_state=STREAMSET;
192.1037 +    if(vf->pcm_offset>=0){
192.1038 +      ogg_int64_t pos=vf->pcm_offset;
192.1039 +      vf->pcm_offset=-1; /* make sure the pos is dumped if unseekable */
192.1040 +      ov_pcm_seek(vf,pos);
192.1041 +    }
192.1042 +  }
192.1043 +
192.1044 +  for(i=0;i<vf->links;i++){
192.1045 +    if(vorbis_synthesis_halfrate(vf->vi+i,flag)){
192.1046 +      if(flag) ov_halfrate(vf,0);
192.1047 +      return OV_EINVAL;
192.1048 +    }
192.1049 +  }
192.1050 +  return 0;
192.1051 +}
192.1052 +
192.1053 +int ov_halfrate_p(OggVorbis_File *vf){
192.1054 +  if(vf->vi==NULL)return OV_EINVAL;
192.1055 +  return vorbis_synthesis_halfrate_p(vf->vi);
192.1056 +}
192.1057 +
192.1058 +/* Only partially open the vorbis file; test for Vorbisness, and load
192.1059 +   the headers for the first chain.  Do not seek (although test for
192.1060 +   seekability).  Use ov_test_open to finish opening the file, else
192.1061 +   ov_clear to close/free it. Same return codes as open. */
192.1062 +
192.1063 +int ov_test_callbacks(void *f,OggVorbis_File *vf,
192.1064 +    const char *initial,long ibytes,ov_callbacks callbacks)
192.1065 +{
192.1066 +  return _ov_open1(f,vf,initial,ibytes,callbacks);
192.1067 +}
192.1068 +
192.1069 +int ov_test(FILE *f,OggVorbis_File *vf,const char *initial,long ibytes){
192.1070 +  ov_callbacks callbacks = {
192.1071 +    (size_t (*)(void *, size_t, size_t, void *))  fread,
192.1072 +    (int (*)(void *, ogg_int64_t, int))              _fseek64_wrap,
192.1073 +    (int (*)(void *))                             fclose,
192.1074 +    (long (*)(void *))                            ftell
192.1075 +  };
192.1076 +
192.1077 +  return ov_test_callbacks((void *)f, vf, initial, ibytes, callbacks);
192.1078 +}
192.1079 +
192.1080 +int ov_test_open(OggVorbis_File *vf){
192.1081 +  if(vf->ready_state!=PARTOPEN)return(OV_EINVAL);
192.1082 +  return _ov_open2(vf);
192.1083 +}
192.1084 +
192.1085 +/* How many logical bitstreams in this physical bitstream? */
192.1086 +long ov_streams(OggVorbis_File *vf){
192.1087 +  return vf->links;
192.1088 +}
192.1089 +
192.1090 +/* Is the FILE * associated with vf seekable? */
192.1091 +long ov_seekable(OggVorbis_File *vf){
192.1092 +  return vf->seekable;
192.1093 +}
192.1094 +
192.1095 +/* returns the bitrate for a given logical bitstream or the entire
192.1096 +   physical bitstream.  If the file is open for random access, it will
192.1097 +   find the *actual* average bitrate.  If the file is streaming, it
192.1098 +   returns the nominal bitrate (if set) else the average of the
192.1099 +   upper/lower bounds (if set) else -1 (unset).
192.1100 +
192.1101 +   If you want the actual bitrate field settings, get them from the
192.1102 +   vorbis_info structs */
192.1103 +
192.1104 +long ov_bitrate(OggVorbis_File *vf,int i){
192.1105 +  if(vf->ready_state<OPENED)return(OV_EINVAL);
192.1106 +  if(i>=vf->links)return(OV_EINVAL);
192.1107 +  if(!vf->seekable && i!=0)return(ov_bitrate(vf,0));
192.1108 +  if(i<0){
192.1109 +    ogg_int64_t bits=0;
192.1110 +    int i;
192.1111 +    float br;
192.1112 +    for(i=0;i<vf->links;i++)
192.1113 +      bits+=(vf->offsets[i+1]-vf->dataoffsets[i])*8;
192.1114 +    /* This once read: return(rint(bits/ov_time_total(vf,-1)));
192.1115 +     * gcc 3.x on x86 miscompiled this at optimisation level 2 and above,
192.1116 +     * so this is slightly transformed to make it work.
192.1117 +     */
192.1118 +    br = bits/ov_time_total(vf,-1);
192.1119 +    return(rint(br));
192.1120 +  }else{
192.1121 +    if(vf->seekable){
192.1122 +      /* return the actual bitrate */
192.1123 +      return(rint((vf->offsets[i+1]-vf->dataoffsets[i])*8/ov_time_total(vf,i)));
192.1124 +    }else{
192.1125 +      /* return nominal if set */
192.1126 +      if(vf->vi[i].bitrate_nominal>0){
192.1127 +        return vf->vi[i].bitrate_nominal;
192.1128 +      }else{
192.1129 +        if(vf->vi[i].bitrate_upper>0){
192.1130 +          if(vf->vi[i].bitrate_lower>0){
192.1131 +            return (vf->vi[i].bitrate_upper+vf->vi[i].bitrate_lower)/2;
192.1132 +          }else{
192.1133 +            return vf->vi[i].bitrate_upper;
192.1134 +          }
192.1135 +        }
192.1136 +        return(OV_FALSE);
192.1137 +      }
192.1138 +    }
192.1139 +  }
192.1140 +}
192.1141 +
192.1142 +/* returns the actual bitrate since last call.  returns -1 if no
192.1143 +   additional data to offer since last call (or at beginning of stream),
192.1144 +   EINVAL if stream is only partially open
192.1145 +*/
192.1146 +long ov_bitrate_instant(OggVorbis_File *vf){
192.1147 +  int link=(vf->seekable?vf->current_link:0);
192.1148 +  long ret;
192.1149 +  if(vf->ready_state<OPENED)return(OV_EINVAL);
192.1150 +  if(vf->samptrack==0)return(OV_FALSE);
192.1151 +  ret=vf->bittrack/vf->samptrack*vf->vi[link].rate+.5;
192.1152 +  vf->bittrack=0.f;
192.1153 +  vf->samptrack=0.f;
192.1154 +  return(ret);
192.1155 +}
192.1156 +
192.1157 +/* Guess */
192.1158 +long ov_serialnumber(OggVorbis_File *vf,int i){
192.1159 +  if(i>=vf->links)return(ov_serialnumber(vf,vf->links-1));
192.1160 +  if(!vf->seekable && i>=0)return(ov_serialnumber(vf,-1));
192.1161 +  if(i<0){
192.1162 +    return(vf->current_serialno);
192.1163 +  }else{
192.1164 +    return(vf->serialnos[i]);
192.1165 +  }
192.1166 +}
192.1167 +
192.1168 +/* returns: total raw (compressed) length of content if i==-1
192.1169 +            raw (compressed) length of that logical bitstream for i==0 to n
192.1170 +            OV_EINVAL if the stream is not seekable (we can't know the length)
192.1171 +            or if stream is only partially open
192.1172 +*/
192.1173 +ogg_int64_t ov_raw_total(OggVorbis_File *vf,int i){
192.1174 +  if(vf->ready_state<OPENED)return(OV_EINVAL);
192.1175 +  if(!vf->seekable || i>=vf->links)return(OV_EINVAL);
192.1176 +  if(i<0){
192.1177 +    ogg_int64_t acc=0;
192.1178 +    int i;
192.1179 +    for(i=0;i<vf->links;i++)
192.1180 +      acc+=ov_raw_total(vf,i);
192.1181 +    return(acc);
192.1182 +  }else{
192.1183 +    return(vf->offsets[i+1]-vf->offsets[i]);
192.1184 +  }
192.1185 +}
192.1186 +
192.1187 +/* returns: total PCM length (samples) of content if i==-1 PCM length
192.1188 +            (samples) of that logical bitstream for i==0 to n
192.1189 +            OV_EINVAL if the stream is not seekable (we can't know the
192.1190 +            length) or only partially open
192.1191 +*/
192.1192 +ogg_int64_t ov_pcm_total(OggVorbis_File *vf,int i){
192.1193 +  if(vf->ready_state<OPENED)return(OV_EINVAL);
192.1194 +  if(!vf->seekable || i>=vf->links)return(OV_EINVAL);
192.1195 +  if(i<0){
192.1196 +    ogg_int64_t acc=0;
192.1197 +    int i;
192.1198 +    for(i=0;i<vf->links;i++)
192.1199 +      acc+=ov_pcm_total(vf,i);
192.1200 +    return(acc);
192.1201 +  }else{
192.1202 +    return(vf->pcmlengths[i*2+1]);
192.1203 +  }
192.1204 +}
192.1205 +
192.1206 +/* returns: total seconds of content if i==-1
192.1207 +            seconds in that logical bitstream for i==0 to n
192.1208 +            OV_EINVAL if the stream is not seekable (we can't know the
192.1209 +            length) or only partially open
192.1210 +*/
192.1211 +double ov_time_total(OggVorbis_File *vf,int i){
192.1212 +  if(vf->ready_state<OPENED)return(OV_EINVAL);
192.1213 +  if(!vf->seekable || i>=vf->links)return(OV_EINVAL);
192.1214 +  if(i<0){
192.1215 +    double acc=0;
192.1216 +    int i;
192.1217 +    for(i=0;i<vf->links;i++)
192.1218 +      acc+=ov_time_total(vf,i);
192.1219 +    return(acc);
192.1220 +  }else{
192.1221 +    return((double)(vf->pcmlengths[i*2+1])/vf->vi[i].rate);
192.1222 +  }
192.1223 +}
192.1224 +
192.1225 +/* seek to an offset relative to the *compressed* data. This also
192.1226 +   scans packets to update the PCM cursor. It will cross a logical
192.1227 +   bitstream boundary, but only if it can't get any packets out of the
192.1228 +   tail of the bitstream we seek to (so no surprises).
192.1229 +
192.1230 +   returns zero on success, nonzero on failure */
192.1231 +
192.1232 +int ov_raw_seek(OggVorbis_File *vf,ogg_int64_t pos){
192.1233 +  ogg_stream_state work_os;
192.1234 +  int ret;
192.1235 +
192.1236 +  if(vf->ready_state<OPENED)return(OV_EINVAL);
192.1237 +  if(!vf->seekable)
192.1238 +    return(OV_ENOSEEK); /* don't dump machine if we can't seek */
192.1239 +
192.1240 +  if(pos<0 || pos>vf->end)return(OV_EINVAL);
192.1241 +
192.1242 +  /* is the seek position outside our current link [if any]? */
192.1243 +  if(vf->ready_state>=STREAMSET){
192.1244 +    if(pos<vf->offsets[vf->current_link] || pos>=vf->offsets[vf->current_link+1])
192.1245 +      _decode_clear(vf); /* clear out stream state */
192.1246 +  }
192.1247 +
192.1248 +  /* don't yet clear out decoding machine (if it's initialized), in
192.1249 +     the case we're in the same link.  Restart the decode lapping, and
192.1250 +     let _fetch_and_process_packet deal with a potential bitstream
192.1251 +     boundary */
192.1252 +  vf->pcm_offset=-1;
192.1253 +  ogg_stream_reset_serialno(&vf->os,
192.1254 +                            vf->current_serialno); /* must set serialno */
192.1255 +  vorbis_synthesis_restart(&vf->vd);
192.1256 +
192.1257 +  ret=_seek_helper(vf,pos);
192.1258 +  if(ret)goto seek_error;
192.1259 +
192.1260 +  /* we need to make sure the pcm_offset is set, but we don't want to
192.1261 +     advance the raw cursor past good packets just to get to the first
192.1262 +     with a granulepos.  That's not equivalent behavior to beginning
192.1263 +     decoding as immediately after the seek position as possible.
192.1264 +
192.1265 +     So, a hack.  We use two stream states; a local scratch state and
192.1266 +     the shared vf->os stream state.  We use the local state to
192.1267 +     scan, and the shared state as a buffer for later decode.
192.1268 +
192.1269 +     Unfortuantely, on the last page we still advance to last packet
192.1270 +     because the granulepos on the last page is not necessarily on a
192.1271 +     packet boundary, and we need to make sure the granpos is
192.1272 +     correct.
192.1273 +  */
192.1274 +
192.1275 +  {
192.1276 +    ogg_page og;
192.1277 +    ogg_packet op;
192.1278 +    int lastblock=0;
192.1279 +    int accblock=0;
192.1280 +    int thisblock=0;
192.1281 +    int lastflag=0;
192.1282 +    int firstflag=0;
192.1283 +    ogg_int64_t pagepos=-1;
192.1284 +
192.1285 +    ogg_stream_init(&work_os,vf->current_serialno); /* get the memory ready */
192.1286 +    ogg_stream_reset(&work_os); /* eliminate the spurious OV_HOLE
192.1287 +                                   return from not necessarily
192.1288 +                                   starting from the beginning */
192.1289 +
192.1290 +    while(1){
192.1291 +      if(vf->ready_state>=STREAMSET){
192.1292 +        /* snarf/scan a packet if we can */
192.1293 +        int result=ogg_stream_packetout(&work_os,&op);
192.1294 +
192.1295 +        if(result>0){
192.1296 +
192.1297 +          if(vf->vi[vf->current_link].codec_setup){
192.1298 +            thisblock=vorbis_packet_blocksize(vf->vi+vf->current_link,&op);
192.1299 +            if(thisblock<0){
192.1300 +              ogg_stream_packetout(&vf->os,NULL);
192.1301 +              thisblock=0;
192.1302 +            }else{
192.1303 +
192.1304 +              /* We can't get a guaranteed correct pcm position out of the
192.1305 +                 last page in a stream because it might have a 'short'
192.1306 +                 granpos, which can only be detected in the presence of a
192.1307 +                 preceding page.  However, if the last page is also the first
192.1308 +                 page, the granpos rules of a first page take precedence.  Not
192.1309 +                 only that, but for first==last, the EOS page must be treated
192.1310 +                 as if its a normal first page for the stream to open/play. */
192.1311 +              if(lastflag && !firstflag)
192.1312 +                ogg_stream_packetout(&vf->os,NULL);
192.1313 +              else
192.1314 +                if(lastblock)accblock+=(lastblock+thisblock)>>2;
192.1315 +            }
192.1316 +
192.1317 +            if(op.granulepos!=-1){
192.1318 +              int i,link=vf->current_link;
192.1319 +              ogg_int64_t granulepos=op.granulepos-vf->pcmlengths[link*2];
192.1320 +              if(granulepos<0)granulepos=0;
192.1321 +
192.1322 +              for(i=0;i<link;i++)
192.1323 +                granulepos+=vf->pcmlengths[i*2+1];
192.1324 +              vf->pcm_offset=granulepos-accblock;
192.1325 +              if(vf->pcm_offset<0)vf->pcm_offset=0;
192.1326 +              break;
192.1327 +            }
192.1328 +            lastblock=thisblock;
192.1329 +            continue;
192.1330 +          }else
192.1331 +            ogg_stream_packetout(&vf->os,NULL);
192.1332 +        }
192.1333 +      }
192.1334 +
192.1335 +      if(!lastblock){
192.1336 +        pagepos=_get_next_page(vf,&og,-1);
192.1337 +        if(pagepos<0){
192.1338 +          vf->pcm_offset=ov_pcm_total(vf,-1);
192.1339 +          break;
192.1340 +        }
192.1341 +      }else{
192.1342 +        /* huh?  Bogus stream with packets but no granulepos */
192.1343 +        vf->pcm_offset=-1;
192.1344 +        break;
192.1345 +      }
192.1346 +
192.1347 +      /* has our decoding just traversed a bitstream boundary? */
192.1348 +      if(vf->ready_state>=STREAMSET){
192.1349 +        if(vf->current_serialno!=ogg_page_serialno(&og)){
192.1350 +
192.1351 +          /* two possibilities:
192.1352 +             1) our decoding just traversed a bitstream boundary
192.1353 +             2) another stream is multiplexed into this logical section? */
192.1354 +
192.1355 +          if(ogg_page_bos(&og)){
192.1356 +            /* we traversed */
192.1357 +            _decode_clear(vf); /* clear out stream state */
192.1358 +            ogg_stream_clear(&work_os);
192.1359 +          } /* else, do nothing; next loop will scoop another page */
192.1360 +        }
192.1361 +      }
192.1362 +
192.1363 +      if(vf->ready_state<STREAMSET){
192.1364 +        int link;
192.1365 +        long serialno = ogg_page_serialno(&og);
192.1366 +
192.1367 +        for(link=0;link<vf->links;link++)
192.1368 +          if(vf->serialnos[link]==serialno)break;
192.1369 +
192.1370 +        if(link==vf->links) continue; /* not the desired Vorbis
192.1371 +                                         bitstream section; keep
192.1372 +                                         trying */
192.1373 +        vf->current_link=link;
192.1374 +        vf->current_serialno=serialno;
192.1375 +        ogg_stream_reset_serialno(&vf->os,serialno);
192.1376 +        ogg_stream_reset_serialno(&work_os,serialno);
192.1377 +        vf->ready_state=STREAMSET;
192.1378 +        firstflag=(pagepos<=vf->dataoffsets[link]);
192.1379 +      }
192.1380 +
192.1381 +      ogg_stream_pagein(&vf->os,&og);
192.1382 +      ogg_stream_pagein(&work_os,&og);
192.1383 +      lastflag=ogg_page_eos(&og);
192.1384 +
192.1385 +    }
192.1386 +  }
192.1387 +
192.1388 +  ogg_stream_clear(&work_os);
192.1389 +  vf->bittrack=0.f;
192.1390 +  vf->samptrack=0.f;
192.1391 +  return(0);
192.1392 +
192.1393 + seek_error:
192.1394 +  /* dump the machine so we're in a known state */
192.1395 +  vf->pcm_offset=-1;
192.1396 +  ogg_stream_clear(&work_os);
192.1397 +  _decode_clear(vf);
192.1398 +  return OV_EBADLINK;
192.1399 +}
192.1400 +
192.1401 +/* Page granularity seek (faster than sample granularity because we
192.1402 +   don't do the last bit of decode to find a specific sample).
192.1403 +
192.1404 +   Seek to the last [granule marked] page preceding the specified pos
192.1405 +   location, such that decoding past the returned point will quickly
192.1406 +   arrive at the requested position. */
192.1407 +int ov_pcm_seek_page(OggVorbis_File *vf,ogg_int64_t pos){
192.1408 +  int link=-1;
192.1409 +  ogg_int64_t result=0;
192.1410 +  ogg_int64_t total=ov_pcm_total(vf,-1);
192.1411 +
192.1412 +  if(vf->ready_state<OPENED)return(OV_EINVAL);
192.1413 +  if(!vf->seekable)return(OV_ENOSEEK);
192.1414 +
192.1415 +  if(pos<0 || pos>total)return(OV_EINVAL);
192.1416 +
192.1417 +  /* which bitstream section does this pcm offset occur in? */
192.1418 +  for(link=vf->links-1;link>=0;link--){
192.1419 +    total-=vf->pcmlengths[link*2+1];
192.1420 +    if(pos>=total)break;
192.1421 +  }
192.1422 +
192.1423 +  /* search within the logical bitstream for the page with the highest
192.1424 +     pcm_pos preceding (or equal to) pos.  There is a danger here;
192.1425 +     missing pages or incorrect frame number information in the
192.1426 +     bitstream could make our task impossible.  Account for that (it
192.1427 +     would be an error condition) */
192.1428 +
192.1429 +  /* new search algorithm by HB (Nicholas Vinen) */
192.1430 +  {
192.1431 +    ogg_int64_t end=vf->offsets[link+1];
192.1432 +    ogg_int64_t begin=vf->offsets[link];
192.1433 +    ogg_int64_t begintime = vf->pcmlengths[link*2];
192.1434 +    ogg_int64_t endtime = vf->pcmlengths[link*2+1]+begintime;
192.1435 +    ogg_int64_t target=pos-total+begintime;
192.1436 +    ogg_int64_t best=begin;
192.1437 +
192.1438 +    ogg_page og;
192.1439 +    while(begin<end){
192.1440 +      ogg_int64_t bisect;
192.1441 +
192.1442 +      if(end-begin<CHUNKSIZE){
192.1443 +        bisect=begin;
192.1444 +      }else{
192.1445 +        /* take a (pretty decent) guess. */
192.1446 +        bisect=begin +
192.1447 +          (ogg_int64_t)((double)(target-begintime)*(end-begin)/(endtime-begintime))
192.1448 +          - CHUNKSIZE;
192.1449 +        if(bisect<begin+CHUNKSIZE)
192.1450 +          bisect=begin;
192.1451 +      }
192.1452 +
192.1453 +      if(bisect!=vf->offset){
192.1454 +        result=_seek_helper(vf,bisect);
192.1455 +        if(result) goto seek_error;
192.1456 +      }
192.1457 +
192.1458 +      while(begin<end){
192.1459 +        result=_get_next_page(vf,&og,end-vf->offset);
192.1460 +        if(result==OV_EREAD) goto seek_error;
192.1461 +        if(result<0){
192.1462 +          if(bisect<=begin+1)
192.1463 +            end=begin; /* found it */
192.1464 +          else{
192.1465 +            if(bisect==0) goto seek_error;
192.1466 +            bisect-=CHUNKSIZE;
192.1467 +            if(bisect<=begin)bisect=begin+1;
192.1468 +            result=_seek_helper(vf,bisect);
192.1469 +            if(result) goto seek_error;
192.1470 +          }
192.1471 +        }else{
192.1472 +          ogg_int64_t granulepos;
192.1473 +
192.1474 +          if(ogg_page_serialno(&og)!=vf->serialnos[link])
192.1475 +            continue;
192.1476 +
192.1477 +          granulepos=ogg_page_granulepos(&og);
192.1478 +          if(granulepos==-1)continue;
192.1479 +
192.1480 +          if(granulepos<target){
192.1481 +            best=result;  /* raw offset of packet with granulepos */
192.1482 +            begin=vf->offset; /* raw offset of next page */
192.1483 +            begintime=granulepos;
192.1484 +
192.1485 +            if(target-begintime>44100)break;
192.1486 +            bisect=begin; /* *not* begin + 1 */
192.1487 +          }else{
192.1488 +            if(bisect<=begin+1)
192.1489 +              end=begin;  /* found it */
192.1490 +            else{
192.1491 +              if(end==vf->offset){ /* we're pretty close - we'd be stuck in */
192.1492 +                end=result;
192.1493 +                bisect-=CHUNKSIZE; /* an endless loop otherwise. */
192.1494 +                if(bisect<=begin)bisect=begin+1;
192.1495 +                result=_seek_helper(vf,bisect);
192.1496 +                if(result) goto seek_error;
192.1497 +              }else{
192.1498 +                end=bisect;
192.1499 +                endtime=granulepos;
192.1500 +                break;
192.1501 +              }
192.1502 +            }
192.1503 +          }
192.1504 +        }
192.1505 +      }
192.1506 +    }
192.1507 +
192.1508 +    /* found our page. seek to it, update pcm offset. Easier case than
192.1509 +       raw_seek, don't keep packets preceding granulepos. */
192.1510 +    {
192.1511 +      ogg_page og;
192.1512 +      ogg_packet op;
192.1513 +
192.1514 +      /* seek */
192.1515 +      result=_seek_helper(vf,best);
192.1516 +      vf->pcm_offset=-1;
192.1517 +      if(result) goto seek_error;
192.1518 +      result=_get_next_page(vf,&og,-1);
192.1519 +      if(result<0) goto seek_error;
192.1520 +
192.1521 +      if(link!=vf->current_link){
192.1522 +        /* Different link; dump entire decode machine */
192.1523 +        _decode_clear(vf);
192.1524 +
192.1525 +        vf->current_link=link;
192.1526 +        vf->current_serialno=vf->serialnos[link];
192.1527 +        vf->ready_state=STREAMSET;
192.1528 +
192.1529 +      }else{
192.1530 +        vorbis_synthesis_restart(&vf->vd);
192.1531 +      }
192.1532 +
192.1533 +      ogg_stream_reset_serialno(&vf->os,vf->current_serialno);
192.1534 +      ogg_stream_pagein(&vf->os,&og);
192.1535 +
192.1536 +      /* pull out all but last packet; the one with granulepos */
192.1537 +      while(1){
192.1538 +        result=ogg_stream_packetpeek(&vf->os,&op);
192.1539 +        if(result==0){
192.1540 +          /* !!! the packet finishing this page originated on a
192.1541 +             preceding page. Keep fetching previous pages until we
192.1542 +             get one with a granulepos or without the 'continued' flag
192.1543 +             set.  Then just use raw_seek for simplicity. */
192.1544 +
192.1545 +          result=_seek_helper(vf,best);
192.1546 +          if(result<0) goto seek_error;
192.1547 +
192.1548 +          while(1){
192.1549 +            result=_get_prev_page(vf,&og);
192.1550 +            if(result<0) goto seek_error;
192.1551 +            if(ogg_page_serialno(&og)==vf->current_serialno &&
192.1552 +               (ogg_page_granulepos(&og)>-1 ||
192.1553 +                !ogg_page_continued(&og))){
192.1554 +              return ov_raw_seek(vf,result);
192.1555 +            }
192.1556 +            vf->offset=result;
192.1557 +          }
192.1558 +        }
192.1559 +        if(result<0){
192.1560 +          result = OV_EBADPACKET;
192.1561 +          goto seek_error;
192.1562 +        }
192.1563 +        if(op.granulepos!=-1){
192.1564 +          vf->pcm_offset=op.granulepos-vf->pcmlengths[vf->current_link*2];
192.1565 +          if(vf->pcm_offset<0)vf->pcm_offset=0;
192.1566 +          vf->pcm_offset+=total;
192.1567 +          break;
192.1568 +        }else
192.1569 +          result=ogg_stream_packetout(&vf->os,NULL);
192.1570 +      }
192.1571 +    }
192.1572 +  }
192.1573 +
192.1574 +  /* verify result */
192.1575 +  if(vf->pcm_offset>pos || pos>ov_pcm_total(vf,-1)){
192.1576 +    result=OV_EFAULT;
192.1577 +    goto seek_error;
192.1578 +  }
192.1579 +  vf->bittrack=0.f;
192.1580 +  vf->samptrack=0.f;
192.1581 +  return(0);
192.1582 +
192.1583 + seek_error:
192.1584 +  /* dump machine so we're in a known state */
192.1585 +  vf->pcm_offset=-1;
192.1586 +  _decode_clear(vf);
192.1587 +  return (int)result;
192.1588 +}
192.1589 +
192.1590 +/* seek to a sample offset relative to the decompressed pcm stream
192.1591 +   returns zero on success, nonzero on failure */
192.1592 +
192.1593 +int ov_pcm_seek(OggVorbis_File *vf,ogg_int64_t pos){
192.1594 +  int thisblock,lastblock=0;
192.1595 +  int ret=ov_pcm_seek_page(vf,pos);
192.1596 +  if(ret<0)return(ret);
192.1597 +  if((ret=_make_decode_ready(vf)))return ret;
192.1598 +
192.1599 +  /* discard leading packets we don't need for the lapping of the
192.1600 +     position we want; don't decode them */
192.1601 +
192.1602 +  while(1){
192.1603 +    ogg_packet op;
192.1604 +    ogg_page og;
192.1605 +
192.1606 +    int ret=ogg_stream_packetpeek(&vf->os,&op);
192.1607 +    if(ret>0){
192.1608 +      thisblock=vorbis_packet_blocksize(vf->vi+vf->current_link,&op);
192.1609 +      if(thisblock<0){
192.1610 +        ogg_stream_packetout(&vf->os,NULL);
192.1611 +        continue; /* non audio packet */
192.1612 +      }
192.1613 +      if(lastblock)vf->pcm_offset+=(lastblock+thisblock)>>2;
192.1614 +
192.1615 +      if(vf->pcm_offset+((thisblock+
192.1616 +                          vorbis_info_blocksize(vf->vi,1))>>2)>=pos)break;
192.1617 +
192.1618 +      /* remove the packet from packet queue and track its granulepos */
192.1619 +      ogg_stream_packetout(&vf->os,NULL);
192.1620 +      vorbis_synthesis_trackonly(&vf->vb,&op);  /* set up a vb with
192.1621 +                                                   only tracking, no
192.1622 +                                                   pcm_decode */
192.1623 +      vorbis_synthesis_blockin(&vf->vd,&vf->vb);
192.1624 +
192.1625 +      /* end of logical stream case is hard, especially with exact
192.1626 +         length positioning. */
192.1627 +
192.1628 +      if(op.granulepos>-1){
192.1629 +        int i;
192.1630 +        /* always believe the stream markers */
192.1631 +        vf->pcm_offset=op.granulepos-vf->pcmlengths[vf->current_link*2];
192.1632 +        if(vf->pcm_offset<0)vf->pcm_offset=0;
192.1633 +        for(i=0;i<vf->current_link;i++)
192.1634 +          vf->pcm_offset+=vf->pcmlengths[i*2+1];
192.1635 +      }
192.1636 +
192.1637 +      lastblock=thisblock;
192.1638 +
192.1639 +    }else{
192.1640 +      if(ret<0 && ret!=OV_HOLE)break;
192.1641 +
192.1642 +      /* suck in a new page */
192.1643 +      if(_get_next_page(vf,&og,-1)<0)break;
192.1644 +      if(ogg_page_bos(&og))_decode_clear(vf);
192.1645 +
192.1646 +      if(vf->ready_state<STREAMSET){
192.1647 +        long serialno=ogg_page_serialno(&og);
192.1648 +        int link;
192.1649 +
192.1650 +        for(link=0;link<vf->links;link++)
192.1651 +          if(vf->serialnos[link]==serialno)break;
192.1652 +        if(link==vf->links) continue;
192.1653 +        vf->current_link=link;
192.1654 +
192.1655 +        vf->ready_state=STREAMSET;
192.1656 +        vf->current_serialno=ogg_page_serialno(&og);
192.1657 +        ogg_stream_reset_serialno(&vf->os,serialno);
192.1658 +        ret=_make_decode_ready(vf);
192.1659 +        if(ret)return ret;
192.1660 +        lastblock=0;
192.1661 +      }
192.1662 +
192.1663 +      ogg_stream_pagein(&vf->os,&og);
192.1664 +    }
192.1665 +  }
192.1666 +
192.1667 +  vf->bittrack=0.f;
192.1668 +  vf->samptrack=0.f;
192.1669 +  /* discard samples until we reach the desired position. Crossing a
192.1670 +     logical bitstream boundary with abandon is OK. */
192.1671 +  {
192.1672 +    /* note that halfrate could be set differently in each link, but
192.1673 +       vorbisfile encoforces all links are set or unset */
192.1674 +    int hs=vorbis_synthesis_halfrate_p(vf->vi);
192.1675 +    while(vf->pcm_offset<((pos>>hs)<<hs)){
192.1676 +      ogg_int64_t target=(pos-vf->pcm_offset)>>hs;
192.1677 +      long samples=vorbis_synthesis_pcmout(&vf->vd,NULL);
192.1678 +
192.1679 +      if(samples>target)samples=target;
192.1680 +      vorbis_synthesis_read(&vf->vd,samples);
192.1681 +      vf->pcm_offset+=samples<<hs;
192.1682 +
192.1683 +      if(samples<target)
192.1684 +        if(_fetch_and_process_packet(vf,NULL,1,1)<=0)
192.1685 +          vf->pcm_offset=ov_pcm_total(vf,-1); /* eof */
192.1686 +    }
192.1687 +  }
192.1688 +  return 0;
192.1689 +}
192.1690 +
192.1691 +/* seek to a playback time relative to the decompressed pcm stream
192.1692 +   returns zero on success, nonzero on failure */
192.1693 +int ov_time_seek(OggVorbis_File *vf,double seconds){
192.1694 +  /* translate time to PCM position and call ov_pcm_seek */
192.1695 +
192.1696 +  int link=-1;
192.1697 +  ogg_int64_t pcm_total=0;
192.1698 +  double time_total=0.;
192.1699 +
192.1700 +  if(vf->ready_state<OPENED)return(OV_EINVAL);
192.1701 +  if(!vf->seekable)return(OV_ENOSEEK);
192.1702 +  if(seconds<0)return(OV_EINVAL);
192.1703 +
192.1704 +  /* which bitstream section does this time offset occur in? */
192.1705 +  for(link=0;link<vf->links;link++){
192.1706 +    double addsec = ov_time_total(vf,link);
192.1707 +    if(seconds<time_total+addsec)break;
192.1708 +    time_total+=addsec;
192.1709 +    pcm_total+=vf->pcmlengths[link*2+1];
192.1710 +  }
192.1711 +
192.1712 +  if(link==vf->links)return(OV_EINVAL);
192.1713 +
192.1714 +  /* enough information to convert time offset to pcm offset */
192.1715 +  {
192.1716 +    ogg_int64_t target=pcm_total+(seconds-time_total)*vf->vi[link].rate;
192.1717 +    return(ov_pcm_seek(vf,target));
192.1718 +  }
192.1719 +}
192.1720 +
192.1721 +/* page-granularity version of ov_time_seek
192.1722 +   returns zero on success, nonzero on failure */
192.1723 +int ov_time_seek_page(OggVorbis_File *vf,double seconds){
192.1724 +  /* translate time to PCM position and call ov_pcm_seek */
192.1725 +
192.1726 +  int link=-1;
192.1727 +  ogg_int64_t pcm_total=0;
192.1728 +  double time_total=0.;
192.1729 +
192.1730 +  if(vf->ready_state<OPENED)return(OV_EINVAL);
192.1731 +  if(!vf->seekable)return(OV_ENOSEEK);
192.1732 +  if(seconds<0)return(OV_EINVAL);
192.1733 +
192.1734 +  /* which bitstream section does this time offset occur in? */
192.1735 +  for(link=0;link<vf->links;link++){
192.1736 +    double addsec = ov_time_total(vf,link);
192.1737 +    if(seconds<time_total+addsec)break;
192.1738 +    time_total+=addsec;
192.1739 +    pcm_total+=vf->pcmlengths[link*2+1];
192.1740 +  }
192.1741 +
192.1742 +  if(link==vf->links)return(OV_EINVAL);
192.1743 +
192.1744 +  /* enough information to convert time offset to pcm offset */
192.1745 +  {
192.1746 +    ogg_int64_t target=pcm_total+(seconds-time_total)*vf->vi[link].rate;
192.1747 +    return(ov_pcm_seek_page(vf,target));
192.1748 +  }
192.1749 +}
192.1750 +
192.1751 +/* tell the current stream offset cursor.  Note that seek followed by
192.1752 +   tell will likely not give the set offset due to caching */
192.1753 +ogg_int64_t ov_raw_tell(OggVorbis_File *vf){
192.1754 +  if(vf->ready_state<OPENED)return(OV_EINVAL);
192.1755 +  return(vf->offset);
192.1756 +}
192.1757 +
192.1758 +/* return PCM offset (sample) of next PCM sample to be read */
192.1759 +ogg_int64_t ov_pcm_tell(OggVorbis_File *vf){
192.1760 +  if(vf->ready_state<OPENED)return(OV_EINVAL);
192.1761 +  return(vf->pcm_offset);
192.1762 +}
192.1763 +
192.1764 +/* return time offset (seconds) of next PCM sample to be read */
192.1765 +double ov_time_tell(OggVorbis_File *vf){
192.1766 +  int link=0;
192.1767 +  ogg_int64_t pcm_total=0;
192.1768 +  double time_total=0.f;
192.1769 +
192.1770 +  if(vf->ready_state<OPENED)return(OV_EINVAL);
192.1771 +  if(vf->seekable){
192.1772 +    pcm_total=ov_pcm_total(vf,-1);
192.1773 +    time_total=ov_time_total(vf,-1);
192.1774 +
192.1775 +    /* which bitstream section does this time offset occur in? */
192.1776 +    for(link=vf->links-1;link>=0;link--){
192.1777 +      pcm_total-=vf->pcmlengths[link*2+1];
192.1778 +      time_total-=ov_time_total(vf,link);
192.1779 +      if(vf->pcm_offset>=pcm_total)break;
192.1780 +    }
192.1781 +  }
192.1782 +
192.1783 +  return((double)time_total+(double)(vf->pcm_offset-pcm_total)/vf->vi[link].rate);
192.1784 +}
192.1785 +
192.1786 +/*  link:   -1) return the vorbis_info struct for the bitstream section
192.1787 +                currently being decoded
192.1788 +           0-n) to request information for a specific bitstream section
192.1789 +
192.1790 +    In the case of a non-seekable bitstream, any call returns the
192.1791 +    current bitstream.  NULL in the case that the machine is not
192.1792 +    initialized */
192.1793 +
192.1794 +vorbis_info *ov_info(OggVorbis_File *vf,int link){
192.1795 +  if(vf->seekable){
192.1796 +    if(link<0)
192.1797 +      if(vf->ready_state>=STREAMSET)
192.1798 +        return vf->vi+vf->current_link;
192.1799 +      else
192.1800 +      return vf->vi;
192.1801 +    else
192.1802 +      if(link>=vf->links)
192.1803 +        return NULL;
192.1804 +      else
192.1805 +        return vf->vi+link;
192.1806 +  }else{
192.1807 +    return vf->vi;
192.1808 +  }
192.1809 +}
192.1810 +
192.1811 +/* grr, strong typing, grr, no templates/inheritence, grr */
192.1812 +vorbis_comment *ov_comment(OggVorbis_File *vf,int link){
192.1813 +  if(vf->seekable){
192.1814 +    if(link<0)
192.1815 +      if(vf->ready_state>=STREAMSET)
192.1816 +        return vf->vc+vf->current_link;
192.1817 +      else
192.1818 +        return vf->vc;
192.1819 +    else
192.1820 +      if(link>=vf->links)
192.1821 +        return NULL;
192.1822 +      else
192.1823 +        return vf->vc+link;
192.1824 +  }else{
192.1825 +    return vf->vc;
192.1826 +  }
192.1827 +}
192.1828 +
192.1829 +static int host_is_big_endian() {
192.1830 +  ogg_int32_t pattern = 0xfeedface; /* deadbeef */
192.1831 +  unsigned char *bytewise = (unsigned char *)&pattern;
192.1832 +  if (bytewise[0] == 0xfe) return 1;
192.1833 +  return 0;
192.1834 +}
192.1835 +
192.1836 +/* up to this point, everything could more or less hide the multiple
192.1837 +   logical bitstream nature of chaining from the toplevel application
192.1838 +   if the toplevel application didn't particularly care.  However, at
192.1839 +   the point that we actually read audio back, the multiple-section
192.1840 +   nature must surface: Multiple bitstream sections do not necessarily
192.1841 +   have to have the same number of channels or sampling rate.
192.1842 +
192.1843 +   ov_read returns the sequential logical bitstream number currently
192.1844 +   being decoded along with the PCM data in order that the toplevel
192.1845 +   application can take action on channel/sample rate changes.  This
192.1846 +   number will be incremented even for streamed (non-seekable) streams
192.1847 +   (for seekable streams, it represents the actual logical bitstream
192.1848 +   index within the physical bitstream.  Note that the accessor
192.1849 +   functions above are aware of this dichotomy).
192.1850 +
192.1851 +   ov_read_filter is exactly the same as ov_read except that it processes
192.1852 +   the decoded audio data through a filter before packing it into the
192.1853 +   requested format. This gives greater accuracy than applying a filter
192.1854 +   after the audio has been converted into integral PCM.
192.1855 +
192.1856 +   input values: buffer) a buffer to hold packed PCM data for return
192.1857 +                 length) the byte length requested to be placed into buffer
192.1858 +                 bigendianp) should the data be packed LSB first (0) or
192.1859 +                             MSB first (1)
192.1860 +                 word) word size for output.  currently 1 (byte) or
192.1861 +                       2 (16 bit short)
192.1862 +
192.1863 +   return values: <0) error/hole in data (OV_HOLE), partial open (OV_EINVAL)
192.1864 +                   0) EOF
192.1865 +                   n) number of bytes of PCM actually returned.  The
192.1866 +                   below works on a packet-by-packet basis, so the
192.1867 +                   return length is not related to the 'length' passed
192.1868 +                   in, just guaranteed to fit.
192.1869 +
192.1870 +            *section) set to the logical bitstream number */
192.1871 +
192.1872 +long ov_read_filter(OggVorbis_File *vf,char *buffer,int length,
192.1873 +                    int bigendianp,int word,int sgned,int *bitstream,
192.1874 +                    void (*filter)(float **pcm,long channels,long samples,void *filter_param),void *filter_param){
192.1875 +  int i,j;
192.1876 +  int host_endian = host_is_big_endian();
192.1877 +  int hs;
192.1878 +
192.1879 +  float **pcm;
192.1880 +  long samples;
192.1881 +
192.1882 +  if(vf->ready_state<OPENED)return(OV_EINVAL);
192.1883 +
192.1884 +  while(1){
192.1885 +    if(vf->ready_state==INITSET){
192.1886 +      samples=vorbis_synthesis_pcmout(&vf->vd,&pcm);
192.1887 +      if(samples)break;
192.1888 +    }
192.1889 +
192.1890 +    /* suck in another packet */
192.1891 +    {
192.1892 +      int ret=_fetch_and_process_packet(vf,NULL,1,1);
192.1893 +      if(ret==OV_EOF)
192.1894 +        return(0);
192.1895 +      if(ret<=0)
192.1896 +        return(ret);
192.1897 +    }
192.1898 +
192.1899 +  }
192.1900 +
192.1901 +  if(samples>0){
192.1902 +
192.1903 +    /* yay! proceed to pack data into the byte buffer */
192.1904 +
192.1905 +    long channels=ov_info(vf,-1)->channels;
192.1906 +    long bytespersample=word * channels;
192.1907 +    vorbis_fpu_control fpu;
192.1908 +    if(samples>length/bytespersample)samples=length/bytespersample;
192.1909 +
192.1910 +    if(samples <= 0)
192.1911 +      return OV_EINVAL;
192.1912 +
192.1913 +    /* Here. */
192.1914 +    if(filter)
192.1915 +      filter(pcm,channels,samples,filter_param);
192.1916 +
192.1917 +    /* a tight loop to pack each size */
192.1918 +    {
192.1919 +      int val;
192.1920 +      if(word==1){
192.1921 +        int off=(sgned?0:128);
192.1922 +        vorbis_fpu_setround(&fpu);
192.1923 +        for(j=0;j<samples;j++)
192.1924 +          for(i=0;i<channels;i++){
192.1925 +            val=vorbis_ftoi(pcm[i][j]*128.f);
192.1926 +            if(val>127)val=127;
192.1927 +            else if(val<-128)val=-128;
192.1928 +            *buffer++=val+off;
192.1929 +          }
192.1930 +        vorbis_fpu_restore(fpu);
192.1931 +      }else{
192.1932 +        int off=(sgned?0:32768);
192.1933 +
192.1934 +        if(host_endian==bigendianp){
192.1935 +          if(sgned){
192.1936 +
192.1937 +            vorbis_fpu_setround(&fpu);
192.1938 +            for(i=0;i<channels;i++) { /* It's faster in this order */
192.1939 +              float *src=pcm[i];
192.1940 +              short *dest=((short *)buffer)+i;
192.1941 +              for(j=0;j<samples;j++) {
192.1942 +                val=vorbis_ftoi(src[j]*32768.f);
192.1943 +                if(val>32767)val=32767;
192.1944 +                else if(val<-32768)val=-32768;
192.1945 +                *dest=val;
192.1946 +                dest+=channels;
192.1947 +              }
192.1948 +            }
192.1949 +            vorbis_fpu_restore(fpu);
192.1950 +
192.1951 +          }else{
192.1952 +
192.1953 +            vorbis_fpu_setround(&fpu);
192.1954 +            for(i=0;i<channels;i++) {
192.1955 +              float *src=pcm[i];
192.1956 +              short *dest=((short *)buffer)+i;
192.1957 +              for(j=0;j<samples;j++) {
192.1958 +                val=vorbis_ftoi(src[j]*32768.f);
192.1959 +                if(val>32767)val=32767;
192.1960 +                else if(val<-32768)val=-32768;
192.1961 +                *dest=val+off;
192.1962 +                dest+=channels;
192.1963 +              }
192.1964 +            }
192.1965 +            vorbis_fpu_restore(fpu);
192.1966 +
192.1967 +          }
192.1968 +        }else if(bigendianp){
192.1969 +
192.1970 +          vorbis_fpu_setround(&fpu);
192.1971 +          for(j=0;j<samples;j++)
192.1972 +            for(i=0;i<channels;i++){
192.1973 +              val=vorbis_ftoi(pcm[i][j]*32768.f);
192.1974 +              if(val>32767)val=32767;
192.1975 +              else if(val<-32768)val=-32768;
192.1976 +              val+=off;
192.1977 +              *buffer++=(val>>8);
192.1978 +              *buffer++=(val&0xff);
192.1979 +            }
192.1980 +          vorbis_fpu_restore(fpu);
192.1981 +
192.1982 +        }else{
192.1983 +          int val;
192.1984 +          vorbis_fpu_setround(&fpu);
192.1985 +          for(j=0;j<samples;j++)
192.1986 +            for(i=0;i<channels;i++){
192.1987 +              val=vorbis_ftoi(pcm[i][j]*32768.f);
192.1988 +              if(val>32767)val=32767;
192.1989 +              else if(val<-32768)val=-32768;
192.1990 +              val+=off;
192.1991 +              *buffer++=(val&0xff);
192.1992 +              *buffer++=(val>>8);
192.1993 +                  }
192.1994 +          vorbis_fpu_restore(fpu);
192.1995 +
192.1996 +        }
192.1997 +      }
192.1998 +    }
192.1999 +
192.2000 +    vorbis_synthesis_read(&vf->vd,samples);
192.2001 +    hs=vorbis_synthesis_halfrate_p(vf->vi);
192.2002 +    vf->pcm_offset+=(samples<<hs);
192.2003 +    if(bitstream)*bitstream=vf->current_link;
192.2004 +    return(samples*bytespersample);
192.2005 +  }else{
192.2006 +    return(samples);
192.2007 +  }
192.2008 +}
192.2009 +
192.2010 +long ov_read(OggVorbis_File *vf,char *buffer,int length,
192.2011 +             int bigendianp,int word,int sgned,int *bitstream){
192.2012 +  return ov_read_filter(vf, buffer, length, bigendianp, word, sgned, bitstream, NULL, NULL);
192.2013 +}
192.2014 +
192.2015 +/* input values: pcm_channels) a float vector per channel of output
192.2016 +                 length) the sample length being read by the app
192.2017 +
192.2018 +   return values: <0) error/hole in data (OV_HOLE), partial open (OV_EINVAL)
192.2019 +                   0) EOF
192.2020 +                   n) number of samples of PCM actually returned.  The
192.2021 +                   below works on a packet-by-packet basis, so the
192.2022 +                   return length is not related to the 'length' passed
192.2023 +                   in, just guaranteed to fit.
192.2024 +
192.2025 +            *section) set to the logical bitstream number */
192.2026 +
192.2027 +
192.2028 +
192.2029 +long ov_read_float(OggVorbis_File *vf,float ***pcm_channels,int length,
192.2030 +                   int *bitstream){
192.2031 +
192.2032 +  if(vf->ready_state<OPENED)return(OV_EINVAL);
192.2033 +
192.2034 +  while(1){
192.2035 +    if(vf->ready_state==INITSET){
192.2036 +      float **pcm;
192.2037 +      long samples=vorbis_synthesis_pcmout(&vf->vd,&pcm);
192.2038 +      if(samples){
192.2039 +        int hs=vorbis_synthesis_halfrate_p(vf->vi);
192.2040 +        if(pcm_channels)*pcm_channels=pcm;
192.2041 +        if(samples>length)samples=length;
192.2042 +        vorbis_synthesis_read(&vf->vd,samples);
192.2043 +        vf->pcm_offset+=samples<<hs;
192.2044 +        if(bitstream)*bitstream=vf->current_link;
192.2045 +        return samples;
192.2046 +
192.2047 +      }
192.2048 +    }
192.2049 +
192.2050 +    /* suck in another packet */
192.2051 +    {
192.2052 +      int ret=_fetch_and_process_packet(vf,NULL,1,1);
192.2053 +      if(ret==OV_EOF)return(0);
192.2054 +      if(ret<=0)return(ret);
192.2055 +    }
192.2056 +
192.2057 +  }
192.2058 +}
192.2059 +
192.2060 +extern float *vorbis_window(vorbis_dsp_state *v,int W);
192.2061 +
192.2062 +static void _ov_splice(float **pcm,float **lappcm,
192.2063 +                       int n1, int n2,
192.2064 +                       int ch1, int ch2,
192.2065 +                       float *w1, float *w2){
192.2066 +  int i,j;
192.2067 +  float *w=w1;
192.2068 +  int n=n1;
192.2069 +
192.2070 +  if(n1>n2){
192.2071 +    n=n2;
192.2072 +    w=w2;
192.2073 +  }
192.2074 +
192.2075 +  /* splice */
192.2076 +  for(j=0;j<ch1 && j<ch2;j++){
192.2077 +    float *s=lappcm[j];
192.2078 +    float *d=pcm[j];
192.2079 +
192.2080 +    for(i=0;i<n;i++){
192.2081 +      float wd=w[i]*w[i];
192.2082 +      float ws=1.-wd;
192.2083 +      d[i]=d[i]*wd + s[i]*ws;
192.2084 +    }
192.2085 +  }
192.2086 +  /* window from zero */
192.2087 +  for(;j<ch2;j++){
192.2088 +    float *d=pcm[j];
192.2089 +    for(i=0;i<n;i++){
192.2090 +      float wd=w[i]*w[i];
192.2091 +      d[i]=d[i]*wd;
192.2092 +    }
192.2093 +  }
192.2094 +
192.2095 +}
192.2096 +
192.2097 +/* make sure vf is INITSET */
192.2098 +static int _ov_initset(OggVorbis_File *vf){
192.2099 +  while(1){
192.2100 +    if(vf->ready_state==INITSET)break;
192.2101 +    /* suck in another packet */
192.2102 +    {
192.2103 +      int ret=_fetch_and_process_packet(vf,NULL,1,0);
192.2104 +      if(ret<0 && ret!=OV_HOLE)return(ret);
192.2105 +    }
192.2106 +  }
192.2107 +  return 0;
192.2108 +}
192.2109 +
192.2110 +/* make sure vf is INITSET and that we have a primed buffer; if
192.2111 +   we're crosslapping at a stream section boundary, this also makes
192.2112 +   sure we're sanity checking against the right stream information */
192.2113 +static int _ov_initprime(OggVorbis_File *vf){
192.2114 +  vorbis_dsp_state *vd=&vf->vd;
192.2115 +  while(1){
192.2116 +    if(vf->ready_state==INITSET)
192.2117 +      if(vorbis_synthesis_pcmout(vd,NULL))break;
192.2118 +
192.2119 +    /* suck in another packet */
192.2120 +    {
192.2121 +      int ret=_fetch_and_process_packet(vf,NULL,1,0);
192.2122 +      if(ret<0 && ret!=OV_HOLE)return(ret);
192.2123 +    }
192.2124 +  }
192.2125 +  return 0;
192.2126 +}
192.2127 +
192.2128 +/* grab enough data for lapping from vf; this may be in the form of
192.2129 +   unreturned, already-decoded pcm, remaining PCM we will need to
192.2130 +   decode, or synthetic postextrapolation from last packets. */
192.2131 +static void _ov_getlap(OggVorbis_File *vf,vorbis_info *vi,vorbis_dsp_state *vd,
192.2132 +                       float **lappcm,int lapsize){
192.2133 +  int lapcount=0,i;
192.2134 +  float **pcm;
192.2135 +
192.2136 +  /* try first to decode the lapping data */
192.2137 +  while(lapcount<lapsize){
192.2138 +    int samples=vorbis_synthesis_pcmout(vd,&pcm);
192.2139 +    if(samples){
192.2140 +      if(samples>lapsize-lapcount)samples=lapsize-lapcount;
192.2141 +      for(i=0;i<vi->channels;i++)
192.2142 +        memcpy(lappcm[i]+lapcount,pcm[i],sizeof(**pcm)*samples);
192.2143 +      lapcount+=samples;
192.2144 +      vorbis_synthesis_read(vd,samples);
192.2145 +    }else{
192.2146 +    /* suck in another packet */
192.2147 +      int ret=_fetch_and_process_packet(vf,NULL,1,0); /* do *not* span */
192.2148 +      if(ret==OV_EOF)break;
192.2149 +    }
192.2150 +  }
192.2151 +  if(lapcount<lapsize){
192.2152 +    /* failed to get lapping data from normal decode; pry it from the
192.2153 +       postextrapolation buffering, or the second half of the MDCT
192.2154 +       from the last packet */
192.2155 +    int samples=vorbis_synthesis_lapout(&vf->vd,&pcm);
192.2156 +    if(samples==0){
192.2157 +      for(i=0;i<vi->channels;i++)
192.2158 +        memset(lappcm[i]+lapcount,0,sizeof(**pcm)*lapsize-lapcount);
192.2159 +      lapcount=lapsize;
192.2160 +    }else{
192.2161 +      if(samples>lapsize-lapcount)samples=lapsize-lapcount;
192.2162 +      for(i=0;i<vi->channels;i++)
192.2163 +        memcpy(lappcm[i]+lapcount,pcm[i],sizeof(**pcm)*samples);
192.2164 +      lapcount+=samples;
192.2165 +    }
192.2166 +  }
192.2167 +}
192.2168 +
192.2169 +/* this sets up crosslapping of a sample by using trailing data from
192.2170 +   sample 1 and lapping it into the windowing buffer of sample 2 */
192.2171 +int ov_crosslap(OggVorbis_File *vf1, OggVorbis_File *vf2){
192.2172 +  vorbis_info *vi1,*vi2;
192.2173 +  float **lappcm;
192.2174 +  float **pcm;
192.2175 +  float *w1,*w2;
192.2176 +  int n1,n2,i,ret,hs1,hs2;
192.2177 +
192.2178 +  if(vf1==vf2)return(0); /* degenerate case */
192.2179 +  if(vf1->ready_state<OPENED)return(OV_EINVAL);
192.2180 +  if(vf2->ready_state<OPENED)return(OV_EINVAL);
192.2181 +
192.2182 +  /* the relevant overlap buffers must be pre-checked and pre-primed
192.2183 +     before looking at settings in the event that priming would cross
192.2184 +     a bitstream boundary.  So, do it now */
192.2185 +
192.2186 +  ret=_ov_initset(vf1);
192.2187 +  if(ret)return(ret);
192.2188 +  ret=_ov_initprime(vf2);
192.2189 +  if(ret)return(ret);
192.2190 +
192.2191 +  vi1=ov_info(vf1,-1);
192.2192 +  vi2=ov_info(vf2,-1);
192.2193 +  hs1=ov_halfrate_p(vf1);
192.2194 +  hs2=ov_halfrate_p(vf2);
192.2195 +
192.2196 +  lappcm=alloca(sizeof(*lappcm)*vi1->channels);
192.2197 +  n1=vorbis_info_blocksize(vi1,0)>>(1+hs1);
192.2198 +  n2=vorbis_info_blocksize(vi2,0)>>(1+hs2);
192.2199 +  w1=vorbis_window(&vf1->vd,0);
192.2200 +  w2=vorbis_window(&vf2->vd,0);
192.2201 +
192.2202 +  for(i=0;i<vi1->channels;i++)
192.2203 +    lappcm[i]=alloca(sizeof(**lappcm)*n1);
192.2204 +
192.2205 +  _ov_getlap(vf1,vi1,&vf1->vd,lappcm,n1);
192.2206 +
192.2207 +  /* have a lapping buffer from vf1; now to splice it into the lapping
192.2208 +     buffer of vf2 */
192.2209 +  /* consolidate and expose the buffer. */
192.2210 +  vorbis_synthesis_lapout(&vf2->vd,&pcm);
192.2211 +
192.2212 +#if 0
192.2213 +  _analysis_output_always("pcmL",0,pcm[0],n1*2,0,0,0);
192.2214 +  _analysis_output_always("pcmR",0,pcm[1],n1*2,0,0,0);
192.2215 +#endif
192.2216 +
192.2217 +  /* splice */
192.2218 +  _ov_splice(pcm,lappcm,n1,n2,vi1->channels,vi2->channels,w1,w2);
192.2219 +
192.2220 +  /* done */
192.2221 +  return(0);
192.2222 +}
192.2223 +
192.2224 +static int _ov_64_seek_lap(OggVorbis_File *vf,ogg_int64_t pos,
192.2225 +                           int (*localseek)(OggVorbis_File *,ogg_int64_t)){
192.2226 +  vorbis_info *vi;
192.2227 +  float **lappcm;
192.2228 +  float **pcm;
192.2229 +  float *w1,*w2;
192.2230 +  int n1,n2,ch1,ch2,hs;
192.2231 +  int i,ret;
192.2232 +
192.2233 +  if(vf->ready_state<OPENED)return(OV_EINVAL);
192.2234 +  ret=_ov_initset(vf);
192.2235 +  if(ret)return(ret);
192.2236 +  vi=ov_info(vf,-1);
192.2237 +  hs=ov_halfrate_p(vf);
192.2238 +
192.2239 +  ch1=vi->channels;
192.2240 +  n1=vorbis_info_blocksize(vi,0)>>(1+hs);
192.2241 +  w1=vorbis_window(&vf->vd,0);  /* window arrays from libvorbis are
192.2242 +                                   persistent; even if the decode state
192.2243 +                                   from this link gets dumped, this
192.2244 +                                   window array continues to exist */
192.2245 +
192.2246 +  lappcm=alloca(sizeof(*lappcm)*ch1);
192.2247 +  for(i=0;i<ch1;i++)
192.2248 +    lappcm[i]=alloca(sizeof(**lappcm)*n1);
192.2249 +  _ov_getlap(vf,vi,&vf->vd,lappcm,n1);
192.2250 +
192.2251 +  /* have lapping data; seek and prime the buffer */
192.2252 +  ret=localseek(vf,pos);
192.2253 +  if(ret)return ret;
192.2254 +  ret=_ov_initprime(vf);
192.2255 +  if(ret)return(ret);
192.2256 +
192.2257 + /* Guard against cross-link changes; they're perfectly legal */
192.2258 +  vi=ov_info(vf,-1);
192.2259 +  ch2=vi->channels;
192.2260 +  n2=vorbis_info_blocksize(vi,0)>>(1+hs);
192.2261 +  w2=vorbis_window(&vf->vd,0);
192.2262 +
192.2263 +  /* consolidate and expose the buffer. */
192.2264 +  vorbis_synthesis_lapout(&vf->vd,&pcm);
192.2265 +
192.2266 +  /* splice */
192.2267 +  _ov_splice(pcm,lappcm,n1,n2,ch1,ch2,w1,w2);
192.2268 +
192.2269 +  /* done */
192.2270 +  return(0);
192.2271 +}
192.2272 +
192.2273 +int ov_raw_seek_lap(OggVorbis_File *vf,ogg_int64_t pos){
192.2274 +  return _ov_64_seek_lap(vf,pos,ov_raw_seek);
192.2275 +}
192.2276 +
192.2277 +int ov_pcm_seek_lap(OggVorbis_File *vf,ogg_int64_t pos){
192.2278 +  return _ov_64_seek_lap(vf,pos,ov_pcm_seek);
192.2279 +}
192.2280 +
192.2281 +int ov_pcm_seek_page_lap(OggVorbis_File *vf,ogg_int64_t pos){
192.2282 +  return _ov_64_seek_lap(vf,pos,ov_pcm_seek_page);
192.2283 +}
192.2284 +
192.2285 +static int _ov_d_seek_lap(OggVorbis_File *vf,double pos,
192.2286 +                           int (*localseek)(OggVorbis_File *,double)){
192.2287 +  vorbis_info *vi;
192.2288 +  float **lappcm;
192.2289 +  float **pcm;
192.2290 +  float *w1,*w2;
192.2291 +  int n1,n2,ch1,ch2,hs;
192.2292 +  int i,ret;
192.2293 +
192.2294 +  if(vf->ready_state<OPENED)return(OV_EINVAL);
192.2295 +  ret=_ov_initset(vf);
192.2296 +  if(ret)return(ret);
192.2297 +  vi=ov_info(vf,-1);
192.2298 +  hs=ov_halfrate_p(vf);
192.2299 +
192.2300 +  ch1=vi->channels;
192.2301 +  n1=vorbis_info_blocksize(vi,0)>>(1+hs);
192.2302 +  w1=vorbis_window(&vf->vd,0);  /* window arrays from libvorbis are
192.2303 +                                   persistent; even if the decode state
192.2304 +                                   from this link gets dumped, this
192.2305 +                                   window array continues to exist */
192.2306 +
192.2307 +  lappcm=alloca(sizeof(*lappcm)*ch1);
192.2308 +  for(i=0;i<ch1;i++)
192.2309 +    lappcm[i]=alloca(sizeof(**lappcm)*n1);
192.2310 +  _ov_getlap(vf,vi,&vf->vd,lappcm,n1);
192.2311 +
192.2312 +  /* have lapping data; seek and prime the buffer */
192.2313 +  ret=localseek(vf,pos);
192.2314 +  if(ret)return ret;
192.2315 +  ret=_ov_initprime(vf);
192.2316 +  if(ret)return(ret);
192.2317 +
192.2318 + /* Guard against cross-link changes; they're perfectly legal */
192.2319 +  vi=ov_info(vf,-1);
192.2320 +  ch2=vi->channels;
192.2321 +  n2=vorbis_info_blocksize(vi,0)>>(1+hs);
192.2322 +  w2=vorbis_window(&vf->vd,0);
192.2323 +
192.2324 +  /* consolidate and expose the buffer. */
192.2325 +  vorbis_synthesis_lapout(&vf->vd,&pcm);
192.2326 +
192.2327 +  /* splice */
192.2328 +  _ov_splice(pcm,lappcm,n1,n2,ch1,ch2,w1,w2);
192.2329 +
192.2330 +  /* done */
192.2331 +  return(0);
192.2332 +}
192.2333 +
192.2334 +int ov_time_seek_lap(OggVorbis_File *vf,double pos){
192.2335 +  return _ov_d_seek_lap(vf,pos,ov_time_seek);
192.2336 +}
192.2337 +
192.2338 +int ov_time_seek_page_lap(OggVorbis_File *vf,double pos){
192.2339 +  return _ov_d_seek_lap(vf,pos,ov_time_seek_page);
192.2340 +}
   193.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   193.2 +++ b/libs/vorbis/vorbisfile.h	Sun Nov 01 00:36:56 2015 +0200
   193.3 @@ -0,0 +1,206 @@
   193.4 +/********************************************************************
   193.5 + *                                                                  *
   193.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   193.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   193.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   193.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  193.10 + *                                                                  *
  193.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007             *
  193.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  193.13 + *                                                                  *
  193.14 + ********************************************************************
  193.15 +
  193.16 + function: stdio-based convenience library for opening/seeking/decoding
  193.17 + last mod: $Id: vorbisfile.h 17182 2010-04-29 03:48:32Z xiphmont $
  193.18 +
  193.19 + ********************************************************************/
  193.20 +
  193.21 +#ifndef _OV_FILE_H_
  193.22 +#define _OV_FILE_H_
  193.23 +
  193.24 +#ifdef __cplusplus
  193.25 +extern "C"
  193.26 +{
  193.27 +#endif /* __cplusplus */
  193.28 +
  193.29 +#include <stdio.h>
  193.30 +#include "codec.h"
  193.31 +
  193.32 +/* The function prototypes for the callbacks are basically the same as for
  193.33 + * the stdio functions fread, fseek, fclose, ftell.
  193.34 + * The one difference is that the FILE * arguments have been replaced with
  193.35 + * a void * - this is to be used as a pointer to whatever internal data these
  193.36 + * functions might need. In the stdio case, it's just a FILE * cast to a void *
  193.37 + *
  193.38 + * If you use other functions, check the docs for these functions and return
  193.39 + * the right values. For seek_func(), you *MUST* return -1 if the stream is
  193.40 + * unseekable
  193.41 + */
  193.42 +typedef struct {
  193.43 +  size_t (*read_func)  (void *ptr, size_t size, size_t nmemb, void *datasource);
  193.44 +  int    (*seek_func)  (void *datasource, ogg_int64_t offset, int whence);
  193.45 +  int    (*close_func) (void *datasource);
  193.46 +  long   (*tell_func)  (void *datasource);
  193.47 +} ov_callbacks;
  193.48 +
  193.49 +#ifndef OV_EXCLUDE_STATIC_CALLBACKS
  193.50 +
  193.51 +/* a few sets of convenient callbacks, especially for use under
  193.52 + * Windows where ov_open_callbacks() should always be used instead of
  193.53 + * ov_open() to avoid problems with incompatible crt.o version linking
  193.54 + * issues. */
  193.55 +
  193.56 +static int _ov_header_fseek_wrap(FILE *f,ogg_int64_t off,int whence){
  193.57 +  if(f==NULL)return(-1);
  193.58 +
  193.59 +#ifdef __MINGW32__
  193.60 +  return fseeko64(f,off,whence);
  193.61 +#elif defined (_WIN32)
  193.62 +  return _fseeki64(f,off,whence);
  193.63 +#else
  193.64 +  return fseek(f,off,whence);
  193.65 +#endif
  193.66 +}
  193.67 +
  193.68 +/* These structs below (OV_CALLBACKS_DEFAULT etc) are defined here as
  193.69 + * static data. That means that every file which includes this header
  193.70 + * will get its own copy of these structs whether it uses them or
  193.71 + * not unless it #defines OV_EXCLUDE_STATIC_CALLBACKS.
  193.72 + * These static symbols are essential on platforms such as Windows on
  193.73 + * which several different versions of stdio support may be linked to
  193.74 + * by different DLLs, and we need to be certain we know which one
  193.75 + * we're using (the same one as the main application).
  193.76 + */
  193.77 +
  193.78 +static ov_callbacks OV_CALLBACKS_DEFAULT = {
  193.79 +  (size_t (*)(void *, size_t, size_t, void *))  fread,
  193.80 +  (int (*)(void *, ogg_int64_t, int))           _ov_header_fseek_wrap,
  193.81 +  (int (*)(void *))                             fclose,
  193.82 +  (long (*)(void *))                            ftell
  193.83 +};
  193.84 +
  193.85 +static ov_callbacks OV_CALLBACKS_NOCLOSE = {
  193.86 +  (size_t (*)(void *, size_t, size_t, void *))  fread,
  193.87 +  (int (*)(void *, ogg_int64_t, int))           _ov_header_fseek_wrap,
  193.88 +  (int (*)(void *))                             NULL,
  193.89 +  (long (*)(void *))                            ftell
  193.90 +};
  193.91 +
  193.92 +static ov_callbacks OV_CALLBACKS_STREAMONLY = {
  193.93 +  (size_t (*)(void *, size_t, size_t, void *))  fread,
  193.94 +  (int (*)(void *, ogg_int64_t, int))           NULL,
  193.95 +  (int (*)(void *))                             fclose,
  193.96 +  (long (*)(void *))                            NULL
  193.97 +};
  193.98 +
  193.99 +static ov_callbacks OV_CALLBACKS_STREAMONLY_NOCLOSE = {
 193.100 +  (size_t (*)(void *, size_t, size_t, void *))  fread,
 193.101 +  (int (*)(void *, ogg_int64_t, int))           NULL,
 193.102 +  (int (*)(void *))                             NULL,
 193.103 +  (long (*)(void *))                            NULL
 193.104 +};
 193.105 +
 193.106 +#endif
 193.107 +
 193.108 +#define  NOTOPEN   0
 193.109 +#define  PARTOPEN  1
 193.110 +#define  OPENED    2
 193.111 +#define  STREAMSET 3
 193.112 +#define  INITSET   4
 193.113 +
 193.114 +typedef struct OggVorbis_File {
 193.115 +  void            *datasource; /* Pointer to a FILE *, etc. */
 193.116 +  int              seekable;
 193.117 +  ogg_int64_t      offset;
 193.118 +  ogg_int64_t      end;
 193.119 +  ogg_sync_state   oy;
 193.120 +
 193.121 +  /* If the FILE handle isn't seekable (eg, a pipe), only the current
 193.122 +     stream appears */
 193.123 +  int              links;
 193.124 +  ogg_int64_t     *offsets;
 193.125 +  ogg_int64_t     *dataoffsets;
 193.126 +  long            *serialnos;
 193.127 +  ogg_int64_t     *pcmlengths; /* overloaded to maintain binary
 193.128 +                                  compatibility; x2 size, stores both
 193.129 +                                  beginning and end values */
 193.130 +  vorbis_info     *vi;
 193.131 +  vorbis_comment  *vc;
 193.132 +
 193.133 +  /* Decoding working state local storage */
 193.134 +  ogg_int64_t      pcm_offset;
 193.135 +  int              ready_state;
 193.136 +  long             current_serialno;
 193.137 +  int              current_link;
 193.138 +
 193.139 +  double           bittrack;
 193.140 +  double           samptrack;
 193.141 +
 193.142 +  ogg_stream_state os; /* take physical pages, weld into a logical
 193.143 +                          stream of packets */
 193.144 +  vorbis_dsp_state vd; /* central working state for the packet->PCM decoder */
 193.145 +  vorbis_block     vb; /* local working space for packet->PCM decode */
 193.146 +
 193.147 +  ov_callbacks callbacks;
 193.148 +
 193.149 +} OggVorbis_File;
 193.150 +
 193.151 +
 193.152 +extern int ov_clear(OggVorbis_File *vf);
 193.153 +extern int ov_fopen(const char *path,OggVorbis_File *vf);
 193.154 +extern int ov_open(FILE *f,OggVorbis_File *vf,const char *initial,long ibytes);
 193.155 +extern int ov_open_callbacks(void *datasource, OggVorbis_File *vf,
 193.156 +                const char *initial, long ibytes, ov_callbacks callbacks);
 193.157 +
 193.158 +extern int ov_test(FILE *f,OggVorbis_File *vf,const char *initial,long ibytes);
 193.159 +extern int ov_test_callbacks(void *datasource, OggVorbis_File *vf,
 193.160 +                const char *initial, long ibytes, ov_callbacks callbacks);
 193.161 +extern int ov_test_open(OggVorbis_File *vf);
 193.162 +
 193.163 +extern long ov_bitrate(OggVorbis_File *vf,int i);
 193.164 +extern long ov_bitrate_instant(OggVorbis_File *vf);
 193.165 +extern long ov_streams(OggVorbis_File *vf);
 193.166 +extern long ov_seekable(OggVorbis_File *vf);
 193.167 +extern long ov_serialnumber(OggVorbis_File *vf,int i);
 193.168 +
 193.169 +extern ogg_int64_t ov_raw_total(OggVorbis_File *vf,int i);
 193.170 +extern ogg_int64_t ov_pcm_total(OggVorbis_File *vf,int i);
 193.171 +extern double ov_time_total(OggVorbis_File *vf,int i);
 193.172 +
 193.173 +extern int ov_raw_seek(OggVorbis_File *vf,ogg_int64_t pos);
 193.174 +extern int ov_pcm_seek(OggVorbis_File *vf,ogg_int64_t pos);
 193.175 +extern int ov_pcm_seek_page(OggVorbis_File *vf,ogg_int64_t pos);
 193.176 +extern int ov_time_seek(OggVorbis_File *vf,double pos);
 193.177 +extern int ov_time_seek_page(OggVorbis_File *vf,double pos);
 193.178 +
 193.179 +extern int ov_raw_seek_lap(OggVorbis_File *vf,ogg_int64_t pos);
 193.180 +extern int ov_pcm_seek_lap(OggVorbis_File *vf,ogg_int64_t pos);
 193.181 +extern int ov_pcm_seek_page_lap(OggVorbis_File *vf,ogg_int64_t pos);
 193.182 +extern int ov_time_seek_lap(OggVorbis_File *vf,double pos);
 193.183 +extern int ov_time_seek_page_lap(OggVorbis_File *vf,double pos);
 193.184 +
 193.185 +extern ogg_int64_t ov_raw_tell(OggVorbis_File *vf);
 193.186 +extern ogg_int64_t ov_pcm_tell(OggVorbis_File *vf);
 193.187 +extern double ov_time_tell(OggVorbis_File *vf);
 193.188 +
 193.189 +extern vorbis_info *ov_info(OggVorbis_File *vf,int link);
 193.190 +extern vorbis_comment *ov_comment(OggVorbis_File *vf,int link);
 193.191 +
 193.192 +extern long ov_read_float(OggVorbis_File *vf,float ***pcm_channels,int samples,
 193.193 +                          int *bitstream);
 193.194 +extern long ov_read_filter(OggVorbis_File *vf,char *buffer,int length,
 193.195 +                          int bigendianp,int word,int sgned,int *bitstream,
 193.196 +                          void (*filter)(float **pcm,long channels,long samples,void *filter_param),void *filter_param);
 193.197 +extern long ov_read(OggVorbis_File *vf,char *buffer,int length,
 193.198 +                    int bigendianp,int word,int sgned,int *bitstream);
 193.199 +extern int ov_crosslap(OggVorbis_File *vf1,OggVorbis_File *vf2);
 193.200 +
 193.201 +extern int ov_halfrate(OggVorbis_File *vf,int flag);
 193.202 +extern int ov_halfrate_p(OggVorbis_File *vf);
 193.203 +
 193.204 +#ifdef __cplusplus
 193.205 +}
 193.206 +#endif /* __cplusplus */
 193.207 +
 193.208 +#endif
 193.209 +
   194.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   194.2 +++ b/libs/vorbis/window.c	Sun Nov 01 00:36:56 2015 +0200
   194.3 @@ -0,0 +1,2135 @@
   194.4 +/********************************************************************
   194.5 + *                                                                  *
   194.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   194.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   194.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   194.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  194.10 + *                                                                  *
  194.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
  194.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  194.13 + *                                                                  *
  194.14 + ********************************************************************
  194.15 +
  194.16 + function: window functions
  194.17 + last mod: $Id: window.c 16227 2009-07-08 06:58:46Z xiphmont $
  194.18 +
  194.19 + ********************************************************************/
  194.20 +
  194.21 +#include <stdlib.h>
  194.22 +#include <math.h>
  194.23 +#include "os.h"
  194.24 +#include "misc.h"
  194.25 +
  194.26 +static const float vwin64[32] = {
  194.27 +  0.0009460463F, 0.0085006468F, 0.0235352254F, 0.0458950567F,
  194.28 +  0.0753351908F, 0.1115073077F, 0.1539457973F, 0.2020557475F,
  194.29 +  0.2551056759F, 0.3122276645F, 0.3724270287F, 0.4346027792F,
  194.30 +  0.4975789974F, 0.5601459521F, 0.6211085051F, 0.6793382689F,
  194.31 +  0.7338252629F, 0.7837245849F, 0.8283939355F, 0.8674186656F,
  194.32 +  0.9006222429F, 0.9280614787F, 0.9500073081F, 0.9669131782F,
  194.33 +  0.9793740220F, 0.9880792941F, 0.9937636139F, 0.9971582668F,
  194.34 +  0.9989462667F, 0.9997230082F, 0.9999638688F, 0.9999995525F,
  194.35 +};
  194.36 +
  194.37 +static const float vwin128[64] = {
  194.38 +  0.0002365472F, 0.0021280687F, 0.0059065254F, 0.0115626550F,
  194.39 +  0.0190823442F, 0.0284463735F, 0.0396300935F, 0.0526030430F,
  194.40 +  0.0673285281F, 0.0837631763F, 0.1018564887F, 0.1215504095F,
  194.41 +  0.1427789367F, 0.1654677960F, 0.1895342001F, 0.2148867160F,
  194.42 +  0.2414252576F, 0.2690412240F, 0.2976177952F, 0.3270303960F,
  194.43 +  0.3571473350F, 0.3878306189F, 0.4189369387F, 0.4503188188F,
  194.44 +  0.4818259135F, 0.5133064334F, 0.5446086751F, 0.5755826278F,
  194.45 +  0.6060816248F, 0.6359640047F, 0.6650947483F, 0.6933470543F,
  194.46 +  0.7206038179F, 0.7467589810F, 0.7717187213F, 0.7954024542F,
  194.47 +  0.8177436264F, 0.8386902831F, 0.8582053981F, 0.8762669622F,
  194.48 +  0.8928678298F, 0.9080153310F, 0.9217306608F, 0.9340480615F,
  194.49 +  0.9450138200F, 0.9546851041F, 0.9631286621F, 0.9704194171F,
  194.50 +  0.9766389810F, 0.9818741197F, 0.9862151938F, 0.9897546035F,
  194.51 +  0.9925852598F, 0.9947991032F, 0.9964856900F, 0.9977308602F,
  194.52 +  0.9986155015F, 0.9992144193F, 0.9995953200F, 0.9998179155F,
  194.53 +  0.9999331503F, 0.9999825563F, 0.9999977357F, 0.9999999720F,
  194.54 +};
  194.55 +
  194.56 +static const float vwin256[128] = {
  194.57 +  0.0000591390F, 0.0005321979F, 0.0014780301F, 0.0028960636F,
  194.58 +  0.0047854363F, 0.0071449926F, 0.0099732775F, 0.0132685298F,
  194.59 +  0.0170286741F, 0.0212513119F, 0.0259337111F, 0.0310727950F,
  194.60 +  0.0366651302F, 0.0427069140F, 0.0491939614F, 0.0561216907F,
  194.61 +  0.0634851102F, 0.0712788035F, 0.0794969160F, 0.0881331402F,
  194.62 +  0.0971807028F, 0.1066323515F, 0.1164803426F, 0.1267164297F,
  194.63 +  0.1373318534F, 0.1483173323F, 0.1596630553F, 0.1713586755F,
  194.64 +  0.1833933062F, 0.1957555184F, 0.2084333404F, 0.2214142599F,
  194.65 +  0.2346852280F, 0.2482326664F, 0.2620424757F, 0.2761000481F,
  194.66 +  0.2903902813F, 0.3048975959F, 0.3196059553F, 0.3344988887F,
  194.67 +  0.3495595160F, 0.3647705766F, 0.3801144597F, 0.3955732382F,
  194.68 +  0.4111287047F, 0.4267624093F, 0.4424557009F, 0.4581897696F,
  194.69 +  0.4739456913F, 0.4897044744F, 0.5054471075F, 0.5211546088F,
  194.70 +  0.5368080763F, 0.5523887395F, 0.5678780103F, 0.5832575361F,
  194.71 +  0.5985092508F, 0.6136154277F, 0.6285587300F, 0.6433222619F,
  194.72 +  0.6578896175F, 0.6722449294F, 0.6863729144F, 0.7002589187F,
  194.73 +  0.7138889597F, 0.7272497662F, 0.7403288154F, 0.7531143679F,
  194.74 +  0.7655954985F, 0.7777621249F, 0.7896050322F, 0.8011158947F,
  194.75 +  0.8122872932F, 0.8231127294F, 0.8335866365F, 0.8437043850F,
  194.76 +  0.8534622861F, 0.8628575905F, 0.8718884835F, 0.8805540765F,
  194.77 +  0.8888543947F, 0.8967903616F, 0.9043637797F, 0.9115773078F,
  194.78 +  0.9184344360F, 0.9249394562F, 0.9310974312F, 0.9369141608F,
  194.79 +  0.9423961446F, 0.9475505439F, 0.9523851406F, 0.9569082947F,
  194.80 +  0.9611289005F, 0.9650563408F, 0.9687004405F, 0.9720714191F,
  194.81 +  0.9751798427F, 0.9780365753F, 0.9806527301F, 0.9830396204F,
  194.82 +  0.9852087111F, 0.9871715701F, 0.9889398207F, 0.9905250941F,
  194.83 +  0.9919389832F, 0.9931929973F, 0.9942985174F, 0.9952667537F,
  194.84 +  0.9961087037F, 0.9968351119F, 0.9974564312F, 0.9979827858F,
  194.85 +  0.9984239359F, 0.9987892441F, 0.9990876435F, 0.9993276081F,
  194.86 +  0.9995171241F, 0.9996636648F, 0.9997741654F, 0.9998550016F,
  194.87 +  0.9999119692F, 0.9999502656F, 0.9999744742F, 0.9999885497F,
  194.88 +  0.9999958064F, 0.9999989077F, 0.9999998584F, 0.9999999983F,
  194.89 +};
  194.90 +
  194.91 +static const float vwin512[256] = {
  194.92 +  0.0000147849F, 0.0001330607F, 0.0003695946F, 0.0007243509F,
  194.93 +  0.0011972759F, 0.0017882983F, 0.0024973285F, 0.0033242588F,
  194.94 +  0.0042689632F, 0.0053312973F, 0.0065110982F, 0.0078081841F,
  194.95 +  0.0092223540F, 0.0107533880F, 0.0124010466F, 0.0141650703F,
  194.96 +  0.0160451800F, 0.0180410758F, 0.0201524373F, 0.0223789233F,
  194.97 +  0.0247201710F, 0.0271757958F, 0.0297453914F, 0.0324285286F,
  194.98 +  0.0352247556F, 0.0381335972F, 0.0411545545F, 0.0442871045F,
  194.99 +  0.0475306997F, 0.0508847676F, 0.0543487103F, 0.0579219038F,
 194.100 +  0.0616036982F, 0.0653934164F, 0.0692903546F, 0.0732937809F,
 194.101 +  0.0774029356F, 0.0816170305F, 0.0859352485F, 0.0903567428F,
 194.102 +  0.0948806375F, 0.0995060259F, 0.1042319712F, 0.1090575056F,
 194.103 +  0.1139816300F, 0.1190033137F, 0.1241214941F, 0.1293350764F,
 194.104 +  0.1346429333F, 0.1400439046F, 0.1455367974F, 0.1511203852F,
 194.105 +  0.1567934083F, 0.1625545735F, 0.1684025537F, 0.1743359881F,
 194.106 +  0.1803534820F, 0.1864536069F, 0.1926349000F, 0.1988958650F,
 194.107 +  0.2052349715F, 0.2116506555F, 0.2181413191F, 0.2247053313F,
 194.108 +  0.2313410275F, 0.2380467105F, 0.2448206500F, 0.2516610835F,
 194.109 +  0.2585662164F, 0.2655342226F, 0.2725632448F, 0.2796513950F,
 194.110 +  0.2867967551F, 0.2939973773F, 0.3012512852F, 0.3085564739F,
 194.111 +  0.3159109111F, 0.3233125375F, 0.3307592680F, 0.3382489922F,
 194.112 +  0.3457795756F, 0.3533488602F, 0.3609546657F, 0.3685947904F,
 194.113 +  0.3762670121F, 0.3839690896F, 0.3916987634F, 0.3994537572F,
 194.114 +  0.4072317788F, 0.4150305215F, 0.4228476653F, 0.4306808783F,
 194.115 +  0.4385278181F, 0.4463861329F, 0.4542534630F, 0.4621274424F,
 194.116 +  0.4700057001F, 0.4778858615F, 0.4857655502F, 0.4936423891F,
 194.117 +  0.5015140023F, 0.5093780165F, 0.5172320626F, 0.5250737772F,
 194.118 +  0.5329008043F, 0.5407107971F, 0.5485014192F, 0.5562703465F,
 194.119 +  0.5640152688F, 0.5717338914F, 0.5794239366F, 0.5870831457F,
 194.120 +  0.5947092801F, 0.6023001235F, 0.6098534829F, 0.6173671907F,
 194.121 +  0.6248391059F, 0.6322671161F, 0.6396491384F, 0.6469831217F,
 194.122 +  0.6542670475F, 0.6614989319F, 0.6686768267F, 0.6757988210F,
 194.123 +  0.6828630426F, 0.6898676592F, 0.6968108799F, 0.7036909564F,
 194.124 +  0.7105061843F, 0.7172549043F, 0.7239355032F, 0.7305464154F,
 194.125 +  0.7370861235F, 0.7435531598F, 0.7499461068F, 0.7562635986F,
 194.126 +  0.7625043214F, 0.7686670148F, 0.7747504721F, 0.7807535410F,
 194.127 +  0.7866751247F, 0.7925141825F, 0.7982697296F, 0.8039408387F,
 194.128 +  0.8095266395F, 0.8150263196F, 0.8204391248F, 0.8257643590F,
 194.129 +  0.8310013848F, 0.8361496236F, 0.8412085555F, 0.8461777194F,
 194.130 +  0.8510567129F, 0.8558451924F, 0.8605428730F, 0.8651495278F,
 194.131 +  0.8696649882F, 0.8740891432F, 0.8784219392F, 0.8826633797F,
 194.132 +  0.8868135244F, 0.8908724888F, 0.8948404441F, 0.8987176157F,
 194.133 +  0.9025042831F, 0.9062007791F, 0.9098074886F, 0.9133248482F,
 194.134 +  0.9167533451F, 0.9200935163F, 0.9233459472F, 0.9265112712F,
 194.135 +  0.9295901680F, 0.9325833632F, 0.9354916263F, 0.9383157705F,
 194.136 +  0.9410566504F, 0.9437151618F, 0.9462922398F, 0.9487888576F,
 194.137 +  0.9512060252F, 0.9535447882F, 0.9558062262F, 0.9579914516F,
 194.138 +  0.9601016078F, 0.9621378683F, 0.9641014348F, 0.9659935361F,
 194.139 +  0.9678154261F, 0.9695683830F, 0.9712537071F, 0.9728727198F,
 194.140 +  0.9744267618F, 0.9759171916F, 0.9773453842F, 0.9787127293F,
 194.141 +  0.9800206298F, 0.9812705006F, 0.9824637665F, 0.9836018613F,
 194.142 +  0.9846862258F, 0.9857183066F, 0.9866995544F, 0.9876314227F,
 194.143 +  0.9885153662F, 0.9893528393F, 0.9901452948F, 0.9908941823F,
 194.144 +  0.9916009470F, 0.9922670279F, 0.9928938570F, 0.9934828574F,
 194.145 +  0.9940354423F, 0.9945530133F, 0.9950369595F, 0.9954886562F,
 194.146 +  0.9959094633F, 0.9963007242F, 0.9966637649F, 0.9969998925F,
 194.147 +  0.9973103939F, 0.9975965351F, 0.9978595598F, 0.9981006885F,
 194.148 +  0.9983211172F, 0.9985220166F, 0.9987045311F, 0.9988697776F,
 194.149 +  0.9990188449F, 0.9991527924F, 0.9992726499F, 0.9993794157F,
 194.150 +  0.9994740570F, 0.9995575079F, 0.9996306699F, 0.9996944099F,
 194.151 +  0.9997495605F, 0.9997969190F, 0.9998372465F, 0.9998712678F,
 194.152 +  0.9998996704F, 0.9999231041F, 0.9999421807F, 0.9999574732F,
 194.153 +  0.9999695157F, 0.9999788026F, 0.9999857885F, 0.9999908879F,
 194.154 +  0.9999944746F, 0.9999968817F, 0.9999984010F, 0.9999992833F,
 194.155 +  0.9999997377F, 0.9999999317F, 0.9999999911F, 0.9999999999F,
 194.156 +};
 194.157 +
 194.158 +static const float vwin1024[512] = {
 194.159 +  0.0000036962F, 0.0000332659F, 0.0000924041F, 0.0001811086F,
 194.160 +  0.0002993761F, 0.0004472021F, 0.0006245811F, 0.0008315063F,
 194.161 +  0.0010679699F, 0.0013339631F, 0.0016294757F, 0.0019544965F,
 194.162 +  0.0023090133F, 0.0026930125F, 0.0031064797F, 0.0035493989F,
 194.163 +  0.0040217533F, 0.0045235250F, 0.0050546946F, 0.0056152418F,
 194.164 +  0.0062051451F, 0.0068243817F, 0.0074729278F, 0.0081507582F,
 194.165 +  0.0088578466F, 0.0095941655F, 0.0103596863F, 0.0111543789F,
 194.166 +  0.0119782122F, 0.0128311538F, 0.0137131701F, 0.0146242260F,
 194.167 +  0.0155642855F, 0.0165333111F, 0.0175312640F, 0.0185581042F,
 194.168 +  0.0196137903F, 0.0206982797F, 0.0218115284F, 0.0229534910F,
 194.169 +  0.0241241208F, 0.0253233698F, 0.0265511886F, 0.0278075263F,
 194.170 +  0.0290923308F, 0.0304055484F, 0.0317471241F, 0.0331170013F,
 194.171 +  0.0345151222F, 0.0359414274F, 0.0373958560F, 0.0388783456F,
 194.172 +  0.0403888325F, 0.0419272511F, 0.0434935347F, 0.0450876148F,
 194.173 +  0.0467094213F, 0.0483588828F, 0.0500359261F, 0.0517404765F,
 194.174 +  0.0534724575F, 0.0552317913F, 0.0570183983F, 0.0588321971F,
 194.175 +  0.0606731048F, 0.0625410369F, 0.0644359070F, 0.0663576272F,
 194.176 +  0.0683061077F, 0.0702812571F, 0.0722829821F, 0.0743111878F,
 194.177 +  0.0763657775F, 0.0784466526F, 0.0805537129F, 0.0826868561F,
 194.178 +  0.0848459782F, 0.0870309736F, 0.0892417345F, 0.0914781514F,
 194.179 +  0.0937401128F, 0.0960275056F, 0.0983402145F, 0.1006781223F,
 194.180 +  0.1030411101F, 0.1054290568F, 0.1078418397F, 0.1102793336F,
 194.181 +  0.1127414119F, 0.1152279457F, 0.1177388042F, 0.1202738544F,
 194.182 +  0.1228329618F, 0.1254159892F, 0.1280227980F, 0.1306532471F,
 194.183 +  0.1333071937F, 0.1359844927F, 0.1386849970F, 0.1414085575F,
 194.184 +  0.1441550230F, 0.1469242403F, 0.1497160539F, 0.1525303063F,
 194.185 +  0.1553668381F, 0.1582254875F, 0.1611060909F, 0.1640084822F,
 194.186 +  0.1669324936F, 0.1698779549F, 0.1728446939F, 0.1758325362F,
 194.187 +  0.1788413055F, 0.1818708232F, 0.1849209084F, 0.1879913785F,
 194.188 +  0.1910820485F, 0.1941927312F, 0.1973232376F, 0.2004733764F,
 194.189 +  0.2036429541F, 0.2068317752F, 0.2100396421F, 0.2132663552F,
 194.190 +  0.2165117125F, 0.2197755102F, 0.2230575422F, 0.2263576007F,
 194.191 +  0.2296754753F, 0.2330109540F, 0.2363638225F, 0.2397338646F,
 194.192 +  0.2431208619F, 0.2465245941F, 0.2499448389F, 0.2533813719F,
 194.193 +  0.2568339669F, 0.2603023956F, 0.2637864277F, 0.2672858312F,
 194.194 +  0.2708003718F, 0.2743298135F, 0.2778739186F, 0.2814324472F,
 194.195 +  0.2850051576F, 0.2885918065F, 0.2921921485F, 0.2958059366F,
 194.196 +  0.2994329219F, 0.3030728538F, 0.3067254799F, 0.3103905462F,
 194.197 +  0.3140677969F, 0.3177569747F, 0.3214578205F, 0.3251700736F,
 194.198 +  0.3288934718F, 0.3326277513F, 0.3363726468F, 0.3401278914F,
 194.199 +  0.3438932168F, 0.3476683533F, 0.3514530297F, 0.3552469734F,
 194.200 +  0.3590499106F, 0.3628615659F, 0.3666816630F, 0.3705099239F,
 194.201 +  0.3743460698F, 0.3781898204F, 0.3820408945F, 0.3858990095F,
 194.202 +  0.3897638820F, 0.3936352274F, 0.3975127601F, 0.4013961936F,
 194.203 +  0.4052852405F, 0.4091796123F, 0.4130790198F, 0.4169831732F,
 194.204 +  0.4208917815F, 0.4248045534F, 0.4287211965F, 0.4326414181F,
 194.205 +  0.4365649248F, 0.4404914225F, 0.4444206167F, 0.4483522125F,
 194.206 +  0.4522859146F, 0.4562214270F, 0.4601584538F, 0.4640966984F,
 194.207 +  0.4680358644F, 0.4719756548F, 0.4759157726F, 0.4798559209F,
 194.208 +  0.4837958024F, 0.4877351199F, 0.4916735765F, 0.4956108751F,
 194.209 +  0.4995467188F, 0.5034808109F, 0.5074128550F, 0.5113425550F,
 194.210 +  0.5152696149F, 0.5191937395F, 0.5231146336F, 0.5270320028F,
 194.211 +  0.5309455530F, 0.5348549910F, 0.5387600239F, 0.5426603597F,
 194.212 +  0.5465557070F, 0.5504457754F, 0.5543302752F, 0.5582089175F,
 194.213 +  0.5620814145F, 0.5659474793F, 0.5698068262F, 0.5736591704F,
 194.214 +  0.5775042283F, 0.5813417176F, 0.5851713571F, 0.5889928670F,
 194.215 +  0.5928059689F, 0.5966103856F, 0.6004058415F, 0.6041920626F,
 194.216 +  0.6079687761F, 0.6117357113F, 0.6154925986F, 0.6192391705F,
 194.217 +  0.6229751612F, 0.6267003064F, 0.6304143441F, 0.6341170137F,
 194.218 +  0.6378080569F, 0.6414872173F, 0.6451542405F, 0.6488088741F,
 194.219 +  0.6524508681F, 0.6560799742F, 0.6596959469F, 0.6632985424F,
 194.220 +  0.6668875197F, 0.6704626398F, 0.6740236662F, 0.6775703649F,
 194.221 +  0.6811025043F, 0.6846198554F, 0.6881221916F, 0.6916092892F,
 194.222 +  0.6950809269F, 0.6985368861F, 0.7019769510F, 0.7054009085F,
 194.223 +  0.7088085484F, 0.7121996632F, 0.7155740484F, 0.7189315023F,
 194.224 +  0.7222718263F, 0.7255948245F, 0.7289003043F, 0.7321880760F,
 194.225 +  0.7354579530F, 0.7387097518F, 0.7419432921F, 0.7451583966F,
 194.226 +  0.7483548915F, 0.7515326059F, 0.7546913723F, 0.7578310265F,
 194.227 +  0.7609514077F, 0.7640523581F, 0.7671337237F, 0.7701953535F,
 194.228 +  0.7732371001F, 0.7762588195F, 0.7792603711F, 0.7822416178F,
 194.229 +  0.7852024259F, 0.7881426654F, 0.7910622097F, 0.7939609356F,
 194.230 +  0.7968387237F, 0.7996954579F, 0.8025310261F, 0.8053453193F,
 194.231 +  0.8081382324F, 0.8109096638F, 0.8136595156F, 0.8163876936F,
 194.232 +  0.8190941071F, 0.8217786690F, 0.8244412960F, 0.8270819086F,
 194.233 +  0.8297004305F, 0.8322967896F, 0.8348709171F, 0.8374227481F,
 194.234 +  0.8399522213F, 0.8424592789F, 0.8449438672F, 0.8474059356F,
 194.235 +  0.8498454378F, 0.8522623306F, 0.8546565748F, 0.8570281348F,
 194.236 +  0.8593769787F, 0.8617030779F, 0.8640064080F, 0.8662869477F,
 194.237 +  0.8685446796F, 0.8707795899F, 0.8729916682F, 0.8751809079F,
 194.238 +  0.8773473059F, 0.8794908626F, 0.8816115819F, 0.8837094713F,
 194.239 +  0.8857845418F, 0.8878368079F, 0.8898662874F, 0.8918730019F,
 194.240 +  0.8938569760F, 0.8958182380F, 0.8977568194F, 0.8996727552F,
 194.241 +  0.9015660837F, 0.9034368465F, 0.9052850885F, 0.9071108577F,
 194.242 +  0.9089142057F, 0.9106951869F, 0.9124538591F, 0.9141902832F,
 194.243 +  0.9159045233F, 0.9175966464F, 0.9192667228F, 0.9209148257F,
 194.244 +  0.9225410313F, 0.9241454187F, 0.9257280701F, 0.9272890704F,
 194.245 +  0.9288285075F, 0.9303464720F, 0.9318430576F, 0.9333183603F,
 194.246 +  0.9347724792F, 0.9362055158F, 0.9376175745F, 0.9390087622F,
 194.247 +  0.9403791881F, 0.9417289644F, 0.9430582055F, 0.9443670283F,
 194.248 +  0.9456555521F, 0.9469238986F, 0.9481721917F, 0.9494005577F,
 194.249 +  0.9506091252F, 0.9517980248F, 0.9529673894F, 0.9541173540F,
 194.250 +  0.9552480557F, 0.9563596334F, 0.9574522282F, 0.9585259830F,
 194.251 +  0.9595810428F, 0.9606175542F, 0.9616356656F, 0.9626355274F,
 194.252 +  0.9636172915F, 0.9645811114F, 0.9655271425F, 0.9664555414F,
 194.253 +  0.9673664664F, 0.9682600774F, 0.9691365355F, 0.9699960034F,
 194.254 +  0.9708386448F, 0.9716646250F, 0.9724741103F, 0.9732672685F,
 194.255 +  0.9740442683F, 0.9748052795F, 0.9755504729F, 0.9762800205F,
 194.256 +  0.9769940950F, 0.9776928703F, 0.9783765210F, 0.9790452223F,
 194.257 +  0.9796991504F, 0.9803384823F, 0.9809633954F, 0.9815740679F,
 194.258 +  0.9821706784F, 0.9827534063F, 0.9833224312F, 0.9838779332F,
 194.259 +  0.9844200928F, 0.9849490910F, 0.9854651087F, 0.9859683274F,
 194.260 +  0.9864589286F, 0.9869370940F, 0.9874030054F, 0.9878568447F,
 194.261 +  0.9882987937F, 0.9887290343F, 0.9891477481F, 0.9895551169F,
 194.262 +  0.9899513220F, 0.9903365446F, 0.9907109658F, 0.9910747662F,
 194.263 +  0.9914281260F, 0.9917712252F, 0.9921042433F, 0.9924273593F,
 194.264 +  0.9927407516F, 0.9930445982F, 0.9933390763F, 0.9936243626F,
 194.265 +  0.9939006331F, 0.9941680631F, 0.9944268269F, 0.9946770982F,
 194.266 +  0.9949190498F, 0.9951528537F, 0.9953786808F, 0.9955967011F,
 194.267 +  0.9958070836F, 0.9960099963F, 0.9962056061F, 0.9963940787F,
 194.268 +  0.9965755786F, 0.9967502693F, 0.9969183129F, 0.9970798704F,
 194.269 +  0.9972351013F, 0.9973841640F, 0.9975272151F, 0.9976644103F,
 194.270 +  0.9977959036F, 0.9979218476F, 0.9980423932F, 0.9981576901F,
 194.271 +  0.9982678862F, 0.9983731278F, 0.9984735596F, 0.9985693247F,
 194.272 +  0.9986605645F, 0.9987474186F, 0.9988300248F, 0.9989085193F,
 194.273 +  0.9989830364F, 0.9990537085F, 0.9991206662F, 0.9991840382F,
 194.274 +  0.9992439513F, 0.9993005303F, 0.9993538982F, 0.9994041757F,
 194.275 +  0.9994514817F, 0.9994959330F, 0.9995376444F, 0.9995767286F,
 194.276 +  0.9996132960F, 0.9996474550F, 0.9996793121F, 0.9997089710F,
 194.277 +  0.9997365339F, 0.9997621003F, 0.9997857677F, 0.9998076311F,
 194.278 +  0.9998277836F, 0.9998463156F, 0.9998633155F, 0.9998788692F,
 194.279 +  0.9998930603F, 0.9999059701F, 0.9999176774F, 0.9999282586F,
 194.280 +  0.9999377880F, 0.9999463370F, 0.9999539749F, 0.9999607685F,
 194.281 +  0.9999667820F, 0.9999720773F, 0.9999767136F, 0.9999807479F,
 194.282 +  0.9999842344F, 0.9999872249F, 0.9999897688F, 0.9999919127F,
 194.283 +  0.9999937009F, 0.9999951749F, 0.9999963738F, 0.9999973342F,
 194.284 +  0.9999980900F, 0.9999986724F, 0.9999991103F, 0.9999994297F,
 194.285 +  0.9999996543F, 0.9999998049F, 0.9999999000F, 0.9999999552F,
 194.286 +  0.9999999836F, 0.9999999957F, 0.9999999994F, 1.0000000000F,
 194.287 +};
 194.288 +
 194.289 +static const float vwin2048[1024] = {
 194.290 +  0.0000009241F, 0.0000083165F, 0.0000231014F, 0.0000452785F,
 194.291 +  0.0000748476F, 0.0001118085F, 0.0001561608F, 0.0002079041F,
 194.292 +  0.0002670379F, 0.0003335617F, 0.0004074748F, 0.0004887765F,
 194.293 +  0.0005774661F, 0.0006735427F, 0.0007770054F, 0.0008878533F,
 194.294 +  0.0010060853F, 0.0011317002F, 0.0012646969F, 0.0014050742F,
 194.295 +  0.0015528307F, 0.0017079650F, 0.0018704756F, 0.0020403610F,
 194.296 +  0.0022176196F, 0.0024022497F, 0.0025942495F, 0.0027936173F,
 194.297 +  0.0030003511F, 0.0032144490F, 0.0034359088F, 0.0036647286F,
 194.298 +  0.0039009061F, 0.0041444391F, 0.0043953253F, 0.0046535621F,
 194.299 +  0.0049191472F, 0.0051920781F, 0.0054723520F, 0.0057599664F,
 194.300 +  0.0060549184F, 0.0063572052F, 0.0066668239F, 0.0069837715F,
 194.301 +  0.0073080449F, 0.0076396410F, 0.0079785566F, 0.0083247884F,
 194.302 +  0.0086783330F, 0.0090391871F, 0.0094073470F, 0.0097828092F,
 194.303 +  0.0101655700F, 0.0105556258F, 0.0109529726F, 0.0113576065F,
 194.304 +  0.0117695237F, 0.0121887200F, 0.0126151913F, 0.0130489335F,
 194.305 +  0.0134899422F, 0.0139382130F, 0.0143937415F, 0.0148565233F,
 194.306 +  0.0153265536F, 0.0158038279F, 0.0162883413F, 0.0167800889F,
 194.307 +  0.0172790660F, 0.0177852675F, 0.0182986882F, 0.0188193231F,
 194.308 +  0.0193471668F, 0.0198822141F, 0.0204244594F, 0.0209738974F,
 194.309 +  0.0215305225F, 0.0220943289F, 0.0226653109F, 0.0232434627F,
 194.310 +  0.0238287784F, 0.0244212519F, 0.0250208772F, 0.0256276481F,
 194.311 +  0.0262415582F, 0.0268626014F, 0.0274907711F, 0.0281260608F,
 194.312 +  0.0287684638F, 0.0294179736F, 0.0300745833F, 0.0307382859F,
 194.313 +  0.0314090747F, 0.0320869424F, 0.0327718819F, 0.0334638860F,
 194.314 +  0.0341629474F, 0.0348690586F, 0.0355822122F, 0.0363024004F,
 194.315 +  0.0370296157F, 0.0377638502F, 0.0385050960F, 0.0392533451F,
 194.316 +  0.0400085896F, 0.0407708211F, 0.0415400315F, 0.0423162123F,
 194.317 +  0.0430993552F, 0.0438894515F, 0.0446864926F, 0.0454904698F,
 194.318 +  0.0463013742F, 0.0471191969F, 0.0479439288F, 0.0487755607F,
 194.319 +  0.0496140836F, 0.0504594879F, 0.0513117642F, 0.0521709031F,
 194.320 +  0.0530368949F, 0.0539097297F, 0.0547893979F, 0.0556758894F,
 194.321 +  0.0565691941F, 0.0574693019F, 0.0583762026F, 0.0592898858F,
 194.322 +  0.0602103410F, 0.0611375576F, 0.0620715250F, 0.0630122324F,
 194.323 +  0.0639596688F, 0.0649138234F, 0.0658746848F, 0.0668422421F,
 194.324 +  0.0678164838F, 0.0687973985F, 0.0697849746F, 0.0707792005F,
 194.325 +  0.0717800645F, 0.0727875547F, 0.0738016591F, 0.0748223656F,
 194.326 +  0.0758496620F, 0.0768835359F, 0.0779239751F, 0.0789709668F,
 194.327 +  0.0800244985F, 0.0810845574F, 0.0821511306F, 0.0832242052F,
 194.328 +  0.0843037679F, 0.0853898056F, 0.0864823050F, 0.0875812525F,
 194.329 +  0.0886866347F, 0.0897984378F, 0.0909166480F, 0.0920412513F,
 194.330 +  0.0931722338F, 0.0943095813F, 0.0954532795F, 0.0966033140F,
 194.331 +  0.0977596702F, 0.0989223336F, 0.1000912894F, 0.1012665227F,
 194.332 +  0.1024480185F, 0.1036357616F, 0.1048297369F, 0.1060299290F,
 194.333 +  0.1072363224F, 0.1084489014F, 0.1096676504F, 0.1108925534F,
 194.334 +  0.1121235946F, 0.1133607577F, 0.1146040267F, 0.1158533850F,
 194.335 +  0.1171088163F, 0.1183703040F, 0.1196378312F, 0.1209113812F,
 194.336 +  0.1221909370F, 0.1234764815F, 0.1247679974F, 0.1260654674F,
 194.337 +  0.1273688740F, 0.1286781995F, 0.1299934263F, 0.1313145365F,
 194.338 +  0.1326415121F, 0.1339743349F, 0.1353129866F, 0.1366574490F,
 194.339 +  0.1380077035F, 0.1393637315F, 0.1407255141F, 0.1420930325F,
 194.340 +  0.1434662677F, 0.1448452004F, 0.1462298115F, 0.1476200814F,
 194.341 +  0.1490159906F, 0.1504175195F, 0.1518246482F, 0.1532373569F,
 194.342 +  0.1546556253F, 0.1560794333F, 0.1575087606F, 0.1589435866F,
 194.343 +  0.1603838909F, 0.1618296526F, 0.1632808509F, 0.1647374648F,
 194.344 +  0.1661994731F, 0.1676668546F, 0.1691395880F, 0.1706176516F,
 194.345 +  0.1721010238F, 0.1735896829F, 0.1750836068F, 0.1765827736F,
 194.346 +  0.1780871610F, 0.1795967468F, 0.1811115084F, 0.1826314234F,
 194.347 +  0.1841564689F, 0.1856866221F, 0.1872218600F, 0.1887621595F,
 194.348 +  0.1903074974F, 0.1918578503F, 0.1934131947F, 0.1949735068F,
 194.349 +  0.1965387630F, 0.1981089393F, 0.1996840117F, 0.2012639560F,
 194.350 +  0.2028487479F, 0.2044383630F, 0.2060327766F, 0.2076319642F,
 194.351 +  0.2092359007F, 0.2108445614F, 0.2124579211F, 0.2140759545F,
 194.352 +  0.2156986364F, 0.2173259411F, 0.2189578432F, 0.2205943168F,
 194.353 +  0.2222353361F, 0.2238808751F, 0.2255309076F, 0.2271854073F,
 194.354 +  0.2288443480F, 0.2305077030F, 0.2321754457F, 0.2338475493F,
 194.355 +  0.2355239869F, 0.2372047315F, 0.2388897560F, 0.2405790329F,
 194.356 +  0.2422725350F, 0.2439702347F, 0.2456721043F, 0.2473781159F,
 194.357 +  0.2490882418F, 0.2508024539F, 0.2525207240F, 0.2542430237F,
 194.358 +  0.2559693248F, 0.2576995986F, 0.2594338166F, 0.2611719498F,
 194.359 +  0.2629139695F, 0.2646598466F, 0.2664095520F, 0.2681630564F,
 194.360 +  0.2699203304F, 0.2716813445F, 0.2734460691F, 0.2752144744F,
 194.361 +  0.2769865307F, 0.2787622079F, 0.2805414760F, 0.2823243047F,
 194.362 +  0.2841106637F, 0.2859005227F, 0.2876938509F, 0.2894906179F,
 194.363 +  0.2912907928F, 0.2930943447F, 0.2949012426F, 0.2967114554F,
 194.364 +  0.2985249520F, 0.3003417009F, 0.3021616708F, 0.3039848301F,
 194.365 +  0.3058111471F, 0.3076405901F, 0.3094731273F, 0.3113087266F,
 194.366 +  0.3131473560F, 0.3149889833F, 0.3168335762F, 0.3186811024F,
 194.367 +  0.3205315294F, 0.3223848245F, 0.3242409552F, 0.3260998886F,
 194.368 +  0.3279615918F, 0.3298260319F, 0.3316931758F, 0.3335629903F,
 194.369 +  0.3354354423F, 0.3373104982F, 0.3391881247F, 0.3410682882F,
 194.370 +  0.3429509551F, 0.3448360917F, 0.3467236642F, 0.3486136387F,
 194.371 +  0.3505059811F, 0.3524006575F, 0.3542976336F, 0.3561968753F,
 194.372 +  0.3580983482F, 0.3600020179F, 0.3619078499F, 0.3638158096F,
 194.373 +  0.3657258625F, 0.3676379737F, 0.3695521086F, 0.3714682321F,
 194.374 +  0.3733863094F, 0.3753063055F, 0.3772281852F, 0.3791519134F,
 194.375 +  0.3810774548F, 0.3830047742F, 0.3849338362F, 0.3868646053F,
 194.376 +  0.3887970459F, 0.3907311227F, 0.3926667998F, 0.3946040417F,
 194.377 +  0.3965428125F, 0.3984830765F, 0.4004247978F, 0.4023679403F,
 194.378 +  0.4043124683F, 0.4062583455F, 0.4082055359F, 0.4101540034F,
 194.379 +  0.4121037117F, 0.4140546246F, 0.4160067058F, 0.4179599190F,
 194.380 +  0.4199142277F, 0.4218695956F, 0.4238259861F, 0.4257833627F,
 194.381 +  0.4277416888F, 0.4297009279F, 0.4316610433F, 0.4336219983F,
 194.382 +  0.4355837562F, 0.4375462803F, 0.4395095337F, 0.4414734797F,
 194.383 +  0.4434380815F, 0.4454033021F, 0.4473691046F, 0.4493354521F,
 194.384 +  0.4513023078F, 0.4532696345F, 0.4552373954F, 0.4572055533F,
 194.385 +  0.4591740713F, 0.4611429123F, 0.4631120393F, 0.4650814151F,
 194.386 +  0.4670510028F, 0.4690207650F, 0.4709906649F, 0.4729606651F,
 194.387 +  0.4749307287F, 0.4769008185F, 0.4788708972F, 0.4808409279F,
 194.388 +  0.4828108732F, 0.4847806962F, 0.4867503597F, 0.4887198264F,
 194.389 +  0.4906890593F, 0.4926580213F, 0.4946266753F, 0.4965949840F,
 194.390 +  0.4985629105F, 0.5005304176F, 0.5024974683F, 0.5044640255F,
 194.391 +  0.5064300522F, 0.5083955114F, 0.5103603659F, 0.5123245790F,
 194.392 +  0.5142881136F, 0.5162509328F, 0.5182129997F, 0.5201742774F,
 194.393 +  0.5221347290F, 0.5240943178F, 0.5260530070F, 0.5280107598F,
 194.394 +  0.5299675395F, 0.5319233095F, 0.5338780330F, 0.5358316736F,
 194.395 +  0.5377841946F, 0.5397355596F, 0.5416857320F, 0.5436346755F,
 194.396 +  0.5455823538F, 0.5475287304F, 0.5494737691F, 0.5514174337F,
 194.397 +  0.5533596881F, 0.5553004962F, 0.5572398218F, 0.5591776291F,
 194.398 +  0.5611138821F, 0.5630485449F, 0.5649815818F, 0.5669129570F,
 194.399 +  0.5688426349F, 0.5707705799F, 0.5726967564F, 0.5746211290F,
 194.400 +  0.5765436624F, 0.5784643212F, 0.5803830702F, 0.5822998743F,
 194.401 +  0.5842146984F, 0.5861275076F, 0.5880382669F, 0.5899469416F,
 194.402 +  0.5918534968F, 0.5937578981F, 0.5956601107F, 0.5975601004F,
 194.403 +  0.5994578326F, 0.6013532732F, 0.6032463880F, 0.6051371429F,
 194.404 +  0.6070255039F, 0.6089114372F, 0.6107949090F, 0.6126758856F,
 194.405 +  0.6145543334F, 0.6164302191F, 0.6183035092F, 0.6201741706F,
 194.406 +  0.6220421700F, 0.6239074745F, 0.6257700513F, 0.6276298674F,
 194.407 +  0.6294868903F, 0.6313410873F, 0.6331924262F, 0.6350408745F,
 194.408 +  0.6368864001F, 0.6387289710F, 0.6405685552F, 0.6424051209F,
 194.409 +  0.6442386364F, 0.6460690702F, 0.6478963910F, 0.6497205673F,
 194.410 +  0.6515415682F, 0.6533593625F, 0.6551739194F, 0.6569852082F,
 194.411 +  0.6587931984F, 0.6605978593F, 0.6623991609F, 0.6641970728F,
 194.412 +  0.6659915652F, 0.6677826081F, 0.6695701718F, 0.6713542268F,
 194.413 +  0.6731347437F, 0.6749116932F, 0.6766850461F, 0.6784547736F,
 194.414 +  0.6802208469F, 0.6819832374F, 0.6837419164F, 0.6854968559F,
 194.415 +  0.6872480275F, 0.6889954034F, 0.6907389556F, 0.6924786566F,
 194.416 +  0.6942144788F, 0.6959463950F, 0.6976743780F, 0.6993984008F,
 194.417 +  0.7011184365F, 0.7028344587F, 0.7045464407F, 0.7062543564F,
 194.418 +  0.7079581796F, 0.7096578844F, 0.7113534450F, 0.7130448359F,
 194.419 +  0.7147320316F, 0.7164150070F, 0.7180937371F, 0.7197681970F,
 194.420 +  0.7214383620F, 0.7231042077F, 0.7247657098F, 0.7264228443F,
 194.421 +  0.7280755871F, 0.7297239147F, 0.7313678035F, 0.7330072301F,
 194.422 +  0.7346421715F, 0.7362726046F, 0.7378985069F, 0.7395198556F,
 194.423 +  0.7411366285F, 0.7427488034F, 0.7443563584F, 0.7459592717F,
 194.424 +  0.7475575218F, 0.7491510873F, 0.7507399471F, 0.7523240803F,
 194.425 +  0.7539034661F, 0.7554780839F, 0.7570479136F, 0.7586129349F,
 194.426 +  0.7601731279F, 0.7617284730F, 0.7632789506F, 0.7648245416F,
 194.427 +  0.7663652267F, 0.7679009872F, 0.7694318044F, 0.7709576599F,
 194.428 +  0.7724785354F, 0.7739944130F, 0.7755052749F, 0.7770111035F,
 194.429 +  0.7785118815F, 0.7800075916F, 0.7814982170F, 0.7829837410F,
 194.430 +  0.7844641472F, 0.7859394191F, 0.7874095408F, 0.7888744965F,
 194.431 +  0.7903342706F, 0.7917888476F, 0.7932382124F, 0.7946823501F,
 194.432 +  0.7961212460F, 0.7975548855F, 0.7989832544F, 0.8004063386F,
 194.433 +  0.8018241244F, 0.8032365981F, 0.8046437463F, 0.8060455560F,
 194.434 +  0.8074420141F, 0.8088331080F, 0.8102188253F, 0.8115991536F,
 194.435 +  0.8129740810F, 0.8143435957F, 0.8157076861F, 0.8170663409F,
 194.436 +  0.8184195489F, 0.8197672994F, 0.8211095817F, 0.8224463853F,
 194.437 +  0.8237777001F, 0.8251035161F, 0.8264238235F, 0.8277386129F,
 194.438 +  0.8290478750F, 0.8303516008F, 0.8316497814F, 0.8329424083F,
 194.439 +  0.8342294731F, 0.8355109677F, 0.8367868841F, 0.8380572148F,
 194.440 +  0.8393219523F, 0.8405810893F, 0.8418346190F, 0.8430825345F,
 194.441 +  0.8443248294F, 0.8455614974F, 0.8467925323F, 0.8480179285F,
 194.442 +  0.8492376802F, 0.8504517822F, 0.8516602292F, 0.8528630164F,
 194.443 +  0.8540601391F, 0.8552515928F, 0.8564373733F, 0.8576174766F,
 194.444 +  0.8587918990F, 0.8599606368F, 0.8611236868F, 0.8622810460F,
 194.445 +  0.8634327113F, 0.8645786802F, 0.8657189504F, 0.8668535195F,
 194.446 +  0.8679823857F, 0.8691055472F, 0.8702230025F, 0.8713347503F,
 194.447 +  0.8724407896F, 0.8735411194F, 0.8746357394F, 0.8757246489F,
 194.448 +  0.8768078479F, 0.8778853364F, 0.8789571146F, 0.8800231832F,
 194.449 +  0.8810835427F, 0.8821381942F, 0.8831871387F, 0.8842303777F,
 194.450 +  0.8852679127F, 0.8862997456F, 0.8873258784F, 0.8883463132F,
 194.451 +  0.8893610527F, 0.8903700994F, 0.8913734562F, 0.8923711263F,
 194.452 +  0.8933631129F, 0.8943494196F, 0.8953300500F, 0.8963050083F,
 194.453 +  0.8972742985F, 0.8982379249F, 0.8991958922F, 0.9001482052F,
 194.454 +  0.9010948688F, 0.9020358883F, 0.9029712690F, 0.9039010165F,
 194.455 +  0.9048251367F, 0.9057436357F, 0.9066565195F, 0.9075637946F,
 194.456 +  0.9084654678F, 0.9093615456F, 0.9102520353F, 0.9111369440F,
 194.457 +  0.9120162792F, 0.9128900484F, 0.9137582595F, 0.9146209204F,
 194.458 +  0.9154780394F, 0.9163296248F, 0.9171756853F, 0.9180162296F,
 194.459 +  0.9188512667F, 0.9196808057F, 0.9205048559F, 0.9213234270F,
 194.460 +  0.9221365285F, 0.9229441704F, 0.9237463629F, 0.9245431160F,
 194.461 +  0.9253344404F, 0.9261203465F, 0.9269008453F, 0.9276759477F,
 194.462 +  0.9284456648F, 0.9292100080F, 0.9299689889F, 0.9307226190F,
 194.463 +  0.9314709103F, 0.9322138747F, 0.9329515245F, 0.9336838721F,
 194.464 +  0.9344109300F, 0.9351327108F, 0.9358492275F, 0.9365604931F,
 194.465 +  0.9372665208F, 0.9379673239F, 0.9386629160F, 0.9393533107F,
 194.466 +  0.9400385220F, 0.9407185637F, 0.9413934501F, 0.9420631954F,
 194.467 +  0.9427278141F, 0.9433873208F, 0.9440417304F, 0.9446910576F,
 194.468 +  0.9453353176F, 0.9459745255F, 0.9466086968F, 0.9472378469F,
 194.469 +  0.9478619915F, 0.9484811463F, 0.9490953274F, 0.9497045506F,
 194.470 +  0.9503088323F, 0.9509081888F, 0.9515026365F, 0.9520921921F,
 194.471 +  0.9526768723F, 0.9532566940F, 0.9538316742F, 0.9544018300F,
 194.472 +  0.9549671786F, 0.9555277375F, 0.9560835241F, 0.9566345562F,
 194.473 +  0.9571808513F, 0.9577224275F, 0.9582593027F, 0.9587914949F,
 194.474 +  0.9593190225F, 0.9598419038F, 0.9603601571F, 0.9608738012F,
 194.475 +  0.9613828546F, 0.9618873361F, 0.9623872646F, 0.9628826591F,
 194.476 +  0.9633735388F, 0.9638599227F, 0.9643418303F, 0.9648192808F,
 194.477 +  0.9652922939F, 0.9657608890F, 0.9662250860F, 0.9666849046F,
 194.478 +  0.9671403646F, 0.9675914861F, 0.9680382891F, 0.9684807937F,
 194.479 +  0.9689190202F, 0.9693529890F, 0.9697827203F, 0.9702082347F,
 194.480 +  0.9706295529F, 0.9710466953F, 0.9714596828F, 0.9718685362F,
 194.481 +  0.9722732762F, 0.9726739240F, 0.9730705005F, 0.9734630267F,
 194.482 +  0.9738515239F, 0.9742360134F, 0.9746165163F, 0.9749930540F,
 194.483 +  0.9753656481F, 0.9757343198F, 0.9760990909F, 0.9764599829F,
 194.484 +  0.9768170175F, 0.9771702164F, 0.9775196013F, 0.9778651941F,
 194.485 +  0.9782070167F, 0.9785450909F, 0.9788794388F, 0.9792100824F,
 194.486 +  0.9795370437F, 0.9798603449F, 0.9801800080F, 0.9804960554F,
 194.487 +  0.9808085092F, 0.9811173916F, 0.9814227251F, 0.9817245318F,
 194.488 +  0.9820228343F, 0.9823176549F, 0.9826090160F, 0.9828969402F,
 194.489 +  0.9831814498F, 0.9834625674F, 0.9837403156F, 0.9840147169F,
 194.490 +  0.9842857939F, 0.9845535692F, 0.9848180654F, 0.9850793052F,
 194.491 +  0.9853373113F, 0.9855921062F, 0.9858437127F, 0.9860921535F,
 194.492 +  0.9863374512F, 0.9865796287F, 0.9868187085F, 0.9870547136F,
 194.493 +  0.9872876664F, 0.9875175899F, 0.9877445067F, 0.9879684396F,
 194.494 +  0.9881894112F, 0.9884074444F, 0.9886225619F, 0.9888347863F,
 194.495 +  0.9890441404F, 0.9892506468F, 0.9894543284F, 0.9896552077F,
 194.496 +  0.9898533074F, 0.9900486502F, 0.9902412587F, 0.9904311555F,
 194.497 +  0.9906183633F, 0.9908029045F, 0.9909848019F, 0.9911640779F,
 194.498 +  0.9913407550F, 0.9915148557F, 0.9916864025F, 0.9918554179F,
 194.499 +  0.9920219241F, 0.9921859437F, 0.9923474989F, 0.9925066120F,
 194.500 +  0.9926633054F, 0.9928176012F, 0.9929695218F, 0.9931190891F,
 194.501 +  0.9932663254F, 0.9934112527F, 0.9935538932F, 0.9936942686F,
 194.502 +  0.9938324012F, 0.9939683126F, 0.9941020248F, 0.9942335597F,
 194.503 +  0.9943629388F, 0.9944901841F, 0.9946153170F, 0.9947383593F,
 194.504 +  0.9948593325F, 0.9949782579F, 0.9950951572F, 0.9952100516F,
 194.505 +  0.9953229625F, 0.9954339111F, 0.9955429186F, 0.9956500062F,
 194.506 +  0.9957551948F, 0.9958585056F, 0.9959599593F, 0.9960595769F,
 194.507 +  0.9961573792F, 0.9962533869F, 0.9963476206F, 0.9964401009F,
 194.508 +  0.9965308483F, 0.9966198833F, 0.9967072261F, 0.9967928971F,
 194.509 +  0.9968769164F, 0.9969593041F, 0.9970400804F, 0.9971192651F,
 194.510 +  0.9971968781F, 0.9972729391F, 0.9973474680F, 0.9974204842F,
 194.511 +  0.9974920074F, 0.9975620569F, 0.9976306521F, 0.9976978122F,
 194.512 +  0.9977635565F, 0.9978279039F, 0.9978908736F, 0.9979524842F,
 194.513 +  0.9980127547F, 0.9980717037F, 0.9981293499F, 0.9981857116F,
 194.514 +  0.9982408073F, 0.9982946554F, 0.9983472739F, 0.9983986810F,
 194.515 +  0.9984488947F, 0.9984979328F, 0.9985458132F, 0.9985925534F,
 194.516 +  0.9986381711F, 0.9986826838F, 0.9987261086F, 0.9987684630F,
 194.517 +  0.9988097640F, 0.9988500286F, 0.9988892738F, 0.9989275163F,
 194.518 +  0.9989647727F, 0.9990010597F, 0.9990363938F, 0.9990707911F,
 194.519 +  0.9991042679F, 0.9991368404F, 0.9991685244F, 0.9991993358F,
 194.520 +  0.9992292905F, 0.9992584038F, 0.9992866914F, 0.9993141686F,
 194.521 +  0.9993408506F, 0.9993667526F, 0.9993918895F, 0.9994162761F,
 194.522 +  0.9994399273F, 0.9994628576F, 0.9994850815F, 0.9995066133F,
 194.523 +  0.9995274672F, 0.9995476574F, 0.9995671978F, 0.9995861021F,
 194.524 +  0.9996043841F, 0.9996220573F, 0.9996391352F, 0.9996556310F,
 194.525 +  0.9996715579F, 0.9996869288F, 0.9997017568F, 0.9997160543F,
 194.526 +  0.9997298342F, 0.9997431088F, 0.9997558905F, 0.9997681914F,
 194.527 +  0.9997800236F, 0.9997913990F, 0.9998023292F, 0.9998128261F,
 194.528 +  0.9998229009F, 0.9998325650F, 0.9998418296F, 0.9998507058F,
 194.529 +  0.9998592044F, 0.9998673362F, 0.9998751117F, 0.9998825415F,
 194.530 +  0.9998896358F, 0.9998964047F, 0.9999028584F, 0.9999090066F,
 194.531 +  0.9999148590F, 0.9999204253F, 0.9999257148F, 0.9999307368F,
 194.532 +  0.9999355003F, 0.9999400144F, 0.9999442878F, 0.9999483293F,
 194.533 +  0.9999521472F, 0.9999557499F, 0.9999591457F, 0.9999623426F,
 194.534 +  0.9999653483F, 0.9999681708F, 0.9999708175F, 0.9999732959F,
 194.535 +  0.9999756132F, 0.9999777765F, 0.9999797928F, 0.9999816688F,
 194.536 +  0.9999834113F, 0.9999850266F, 0.9999865211F, 0.9999879009F,
 194.537 +  0.9999891721F, 0.9999903405F, 0.9999914118F, 0.9999923914F,
 194.538 +  0.9999932849F, 0.9999940972F, 0.9999948336F, 0.9999954989F,
 194.539 +  0.9999960978F, 0.9999966349F, 0.9999971146F, 0.9999975411F,
 194.540 +  0.9999979185F, 0.9999982507F, 0.9999985414F, 0.9999987944F,
 194.541 +  0.9999990129F, 0.9999992003F, 0.9999993596F, 0.9999994939F,
 194.542 +  0.9999996059F, 0.9999996981F, 0.9999997732F, 0.9999998333F,
 194.543 +  0.9999998805F, 0.9999999170F, 0.9999999444F, 0.9999999643F,
 194.544 +  0.9999999784F, 0.9999999878F, 0.9999999937F, 0.9999999972F,
 194.545 +  0.9999999990F, 0.9999999997F, 1.0000000000F, 1.0000000000F,
 194.546 +};
 194.547 +
 194.548 +static const float vwin4096[2048] = {
 194.549 +  0.0000002310F, 0.0000020791F, 0.0000057754F, 0.0000113197F,
 194.550 +  0.0000187121F, 0.0000279526F, 0.0000390412F, 0.0000519777F,
 194.551 +  0.0000667623F, 0.0000833949F, 0.0001018753F, 0.0001222036F,
 194.552 +  0.0001443798F, 0.0001684037F, 0.0001942754F, 0.0002219947F,
 194.553 +  0.0002515616F, 0.0002829761F, 0.0003162380F, 0.0003513472F,
 194.554 +  0.0003883038F, 0.0004271076F, 0.0004677584F, 0.0005102563F,
 194.555 +  0.0005546011F, 0.0006007928F, 0.0006488311F, 0.0006987160F,
 194.556 +  0.0007504474F, 0.0008040251F, 0.0008594490F, 0.0009167191F,
 194.557 +  0.0009758351F, 0.0010367969F, 0.0010996044F, 0.0011642574F,
 194.558 +  0.0012307558F, 0.0012990994F, 0.0013692880F, 0.0014413216F,
 194.559 +  0.0015151998F, 0.0015909226F, 0.0016684898F, 0.0017479011F,
 194.560 +  0.0018291565F, 0.0019122556F, 0.0019971983F, 0.0020839845F,
 194.561 +  0.0021726138F, 0.0022630861F, 0.0023554012F, 0.0024495588F,
 194.562 +  0.0025455588F, 0.0026434008F, 0.0027430847F, 0.0028446103F,
 194.563 +  0.0029479772F, 0.0030531853F, 0.0031602342F, 0.0032691238F,
 194.564 +  0.0033798538F, 0.0034924239F, 0.0036068338F, 0.0037230833F,
 194.565 +  0.0038411721F, 0.0039610999F, 0.0040828664F, 0.0042064714F,
 194.566 +  0.0043319145F, 0.0044591954F, 0.0045883139F, 0.0047192696F,
 194.567 +  0.0048520622F, 0.0049866914F, 0.0051231569F, 0.0052614583F,
 194.568 +  0.0054015953F, 0.0055435676F, 0.0056873748F, 0.0058330166F,
 194.569 +  0.0059804926F, 0.0061298026F, 0.0062809460F, 0.0064339226F,
 194.570 +  0.0065887320F, 0.0067453738F, 0.0069038476F, 0.0070641531F,
 194.571 +  0.0072262899F, 0.0073902575F, 0.0075560556F, 0.0077236838F,
 194.572 +  0.0078931417F, 0.0080644288F, 0.0082375447F, 0.0084124891F,
 194.573 +  0.0085892615F, 0.0087678614F, 0.0089482885F, 0.0091305422F,
 194.574 +  0.0093146223F, 0.0095005281F, 0.0096882592F, 0.0098778153F,
 194.575 +  0.0100691958F, 0.0102624002F, 0.0104574281F, 0.0106542791F,
 194.576 +  0.0108529525F, 0.0110534480F, 0.0112557651F, 0.0114599032F,
 194.577 +  0.0116658618F, 0.0118736405F, 0.0120832387F, 0.0122946560F,
 194.578 +  0.0125078917F, 0.0127229454F, 0.0129398166F, 0.0131585046F,
 194.579 +  0.0133790090F, 0.0136013292F, 0.0138254647F, 0.0140514149F,
 194.580 +  0.0142791792F, 0.0145087572F, 0.0147401481F, 0.0149733515F,
 194.581 +  0.0152083667F, 0.0154451932F, 0.0156838304F, 0.0159242777F,
 194.582 +  0.0161665345F, 0.0164106001F, 0.0166564741F, 0.0169041557F,
 194.583 +  0.0171536443F, 0.0174049393F, 0.0176580401F, 0.0179129461F,
 194.584 +  0.0181696565F, 0.0184281708F, 0.0186884883F, 0.0189506084F,
 194.585 +  0.0192145303F, 0.0194802535F, 0.0197477772F, 0.0200171008F,
 194.586 +  0.0202882236F, 0.0205611449F, 0.0208358639F, 0.0211123801F,
 194.587 +  0.0213906927F, 0.0216708011F, 0.0219527043F, 0.0222364019F,
 194.588 +  0.0225218930F, 0.0228091769F, 0.0230982529F, 0.0233891203F,
 194.589 +  0.0236817782F, 0.0239762259F, 0.0242724628F, 0.0245704880F,
 194.590 +  0.0248703007F, 0.0251719002F, 0.0254752858F, 0.0257804565F,
 194.591 +  0.0260874117F, 0.0263961506F, 0.0267066722F, 0.0270189760F,
 194.592 +  0.0273330609F, 0.0276489263F, 0.0279665712F, 0.0282859949F,
 194.593 +  0.0286071966F, 0.0289301753F, 0.0292549303F, 0.0295814607F,
 194.594 +  0.0299097656F, 0.0302398442F, 0.0305716957F, 0.0309053191F,
 194.595 +  0.0312407135F, 0.0315778782F, 0.0319168122F, 0.0322575145F,
 194.596 +  0.0325999844F, 0.0329442209F, 0.0332902231F, 0.0336379900F,
 194.597 +  0.0339875208F, 0.0343388146F, 0.0346918703F, 0.0350466871F,
 194.598 +  0.0354032640F, 0.0357616000F, 0.0361216943F, 0.0364835458F,
 194.599 +  0.0368471535F, 0.0372125166F, 0.0375796339F, 0.0379485046F,
 194.600 +  0.0383191276F, 0.0386915020F, 0.0390656267F, 0.0394415008F,
 194.601 +  0.0398191231F, 0.0401984927F, 0.0405796086F, 0.0409624698F,
 194.602 +  0.0413470751F, 0.0417334235F, 0.0421215141F, 0.0425113457F,
 194.603 +  0.0429029172F, 0.0432962277F, 0.0436912760F, 0.0440880610F,
 194.604 +  0.0444865817F, 0.0448868370F, 0.0452888257F, 0.0456925468F,
 194.605 +  0.0460979992F, 0.0465051816F, 0.0469140931F, 0.0473247325F,
 194.606 +  0.0477370986F, 0.0481511902F, 0.0485670064F, 0.0489845458F,
 194.607 +  0.0494038074F, 0.0498247899F, 0.0502474922F, 0.0506719131F,
 194.608 +  0.0510980514F, 0.0515259060F, 0.0519554756F, 0.0523867590F,
 194.609 +  0.0528197550F, 0.0532544624F, 0.0536908800F, 0.0541290066F,
 194.610 +  0.0545688408F, 0.0550103815F, 0.0554536274F, 0.0558985772F,
 194.611 +  0.0563452297F, 0.0567935837F, 0.0572436377F, 0.0576953907F,
 194.612 +  0.0581488412F, 0.0586039880F, 0.0590608297F, 0.0595193651F,
 194.613 +  0.0599795929F, 0.0604415117F, 0.0609051202F, 0.0613704170F,
 194.614 +  0.0618374009F, 0.0623060704F, 0.0627764243F, 0.0632484611F,
 194.615 +  0.0637221795F, 0.0641975781F, 0.0646746555F, 0.0651534104F,
 194.616 +  0.0656338413F, 0.0661159469F, 0.0665997257F, 0.0670851763F,
 194.617 +  0.0675722973F, 0.0680610873F, 0.0685515448F, 0.0690436684F,
 194.618 +  0.0695374567F, 0.0700329081F, 0.0705300213F, 0.0710287947F,
 194.619 +  0.0715292269F, 0.0720313163F, 0.0725350616F, 0.0730404612F,
 194.620 +  0.0735475136F, 0.0740562172F, 0.0745665707F, 0.0750785723F,
 194.621 +  0.0755922207F, 0.0761075143F, 0.0766244515F, 0.0771430307F,
 194.622 +  0.0776632505F, 0.0781851092F, 0.0787086052F, 0.0792337371F,
 194.623 +  0.0797605032F, 0.0802889018F, 0.0808189315F, 0.0813505905F,
 194.624 +  0.0818838773F, 0.0824187903F, 0.0829553277F, 0.0834934881F,
 194.625 +  0.0840332697F, 0.0845746708F, 0.0851176899F, 0.0856623252F,
 194.626 +  0.0862085751F, 0.0867564379F, 0.0873059119F, 0.0878569954F,
 194.627 +  0.0884096867F, 0.0889639840F, 0.0895198858F, 0.0900773902F,
 194.628 +  0.0906364955F, 0.0911972000F, 0.0917595019F, 0.0923233995F,
 194.629 +  0.0928888909F, 0.0934559745F, 0.0940246485F, 0.0945949110F,
 194.630 +  0.0951667604F, 0.0957401946F, 0.0963152121F, 0.0968918109F,
 194.631 +  0.0974699893F, 0.0980497454F, 0.0986310773F, 0.0992139832F,
 194.632 +  0.0997984614F, 0.1003845098F, 0.1009721267F, 0.1015613101F,
 194.633 +  0.1021520582F, 0.1027443692F, 0.1033382410F, 0.1039336718F,
 194.634 +  0.1045306597F, 0.1051292027F, 0.1057292990F, 0.1063309466F,
 194.635 +  0.1069341435F, 0.1075388878F, 0.1081451776F, 0.1087530108F,
 194.636 +  0.1093623856F, 0.1099732998F, 0.1105857516F, 0.1111997389F,
 194.637 +  0.1118152597F, 0.1124323121F, 0.1130508939F, 0.1136710032F,
 194.638 +  0.1142926379F, 0.1149157960F, 0.1155404755F, 0.1161666742F,
 194.639 +  0.1167943901F, 0.1174236211F, 0.1180543652F, 0.1186866202F,
 194.640 +  0.1193203841F, 0.1199556548F, 0.1205924300F, 0.1212307078F,
 194.641 +  0.1218704860F, 0.1225117624F, 0.1231545349F, 0.1237988013F,
 194.642 +  0.1244445596F, 0.1250918074F, 0.1257405427F, 0.1263907632F,
 194.643 +  0.1270424667F, 0.1276956512F, 0.1283503142F, 0.1290064537F,
 194.644 +  0.1296640674F, 0.1303231530F, 0.1309837084F, 0.1316457312F,
 194.645 +  0.1323092193F, 0.1329741703F, 0.1336405820F, 0.1343084520F,
 194.646 +  0.1349777782F, 0.1356485582F, 0.1363207897F, 0.1369944704F,
 194.647 +  0.1376695979F, 0.1383461700F, 0.1390241842F, 0.1397036384F,
 194.648 +  0.1403845300F, 0.1410668567F, 0.1417506162F, 0.1424358061F,
 194.649 +  0.1431224240F, 0.1438104674F, 0.1444999341F, 0.1451908216F,
 194.650 +  0.1458831274F, 0.1465768492F, 0.1472719844F, 0.1479685308F,
 194.651 +  0.1486664857F, 0.1493658468F, 0.1500666115F, 0.1507687775F,
 194.652 +  0.1514723422F, 0.1521773031F, 0.1528836577F, 0.1535914035F,
 194.653 +  0.1543005380F, 0.1550110587F, 0.1557229631F, 0.1564362485F,
 194.654 +  0.1571509124F, 0.1578669524F, 0.1585843657F, 0.1593031499F,
 194.655 +  0.1600233024F, 0.1607448205F, 0.1614677017F, 0.1621919433F,
 194.656 +  0.1629175428F, 0.1636444975F, 0.1643728047F, 0.1651024619F,
 194.657 +  0.1658334665F, 0.1665658156F, 0.1672995067F, 0.1680345371F,
 194.658 +  0.1687709041F, 0.1695086050F, 0.1702476372F, 0.1709879978F,
 194.659 +  0.1717296843F, 0.1724726938F, 0.1732170237F, 0.1739626711F,
 194.660 +  0.1747096335F, 0.1754579079F, 0.1762074916F, 0.1769583819F,
 194.661 +  0.1777105760F, 0.1784640710F, 0.1792188642F, 0.1799749529F,
 194.662 +  0.1807323340F, 0.1814910049F, 0.1822509628F, 0.1830122046F,
 194.663 +  0.1837747277F, 0.1845385292F, 0.1853036062F, 0.1860699558F,
 194.664 +  0.1868375751F, 0.1876064613F, 0.1883766114F, 0.1891480226F,
 194.665 +  0.1899206919F, 0.1906946164F, 0.1914697932F, 0.1922462194F,
 194.666 +  0.1930238919F, 0.1938028079F, 0.1945829643F, 0.1953643583F,
 194.667 +  0.1961469868F, 0.1969308468F, 0.1977159353F, 0.1985022494F,
 194.668 +  0.1992897859F, 0.2000785420F, 0.2008685145F, 0.2016597005F,
 194.669 +  0.2024520968F, 0.2032457005F, 0.2040405084F, 0.2048365175F,
 194.670 +  0.2056337247F, 0.2064321269F, 0.2072317211F, 0.2080325041F,
 194.671 +  0.2088344727F, 0.2096376240F, 0.2104419547F, 0.2112474618F,
 194.672 +  0.2120541420F, 0.2128619923F, 0.2136710094F, 0.2144811902F,
 194.673 +  0.2152925315F, 0.2161050301F, 0.2169186829F, 0.2177334866F,
 194.674 +  0.2185494381F, 0.2193665340F, 0.2201847712F, 0.2210041465F,
 194.675 +  0.2218246565F, 0.2226462981F, 0.2234690680F, 0.2242929629F,
 194.676 +  0.2251179796F, 0.2259441147F, 0.2267713650F, 0.2275997272F,
 194.677 +  0.2284291979F, 0.2292597739F, 0.2300914518F, 0.2309242283F,
 194.678 +  0.2317581001F, 0.2325930638F, 0.2334291160F, 0.2342662534F,
 194.679 +  0.2351044727F, 0.2359437703F, 0.2367841431F, 0.2376255875F,
 194.680 +  0.2384681001F, 0.2393116776F, 0.2401563165F, 0.2410020134F,
 194.681 +  0.2418487649F, 0.2426965675F, 0.2435454178F, 0.2443953122F,
 194.682 +  0.2452462474F, 0.2460982199F, 0.2469512262F, 0.2478052628F,
 194.683 +  0.2486603262F, 0.2495164129F, 0.2503735194F, 0.2512316421F,
 194.684 +  0.2520907776F, 0.2529509222F, 0.2538120726F, 0.2546742250F,
 194.685 +  0.2555373760F, 0.2564015219F, 0.2572666593F, 0.2581327845F,
 194.686 +  0.2589998939F, 0.2598679840F, 0.2607370510F, 0.2616070916F,
 194.687 +  0.2624781019F, 0.2633500783F, 0.2642230173F, 0.2650969152F,
 194.688 +  0.2659717684F, 0.2668475731F, 0.2677243257F, 0.2686020226F,
 194.689 +  0.2694806601F, 0.2703602344F, 0.2712407419F, 0.2721221789F,
 194.690 +  0.2730045417F, 0.2738878265F, 0.2747720297F, 0.2756571474F,
 194.691 +  0.2765431760F, 0.2774301117F, 0.2783179508F, 0.2792066895F,
 194.692 +  0.2800963240F, 0.2809868505F, 0.2818782654F, 0.2827705647F,
 194.693 +  0.2836637447F, 0.2845578016F, 0.2854527315F, 0.2863485307F,
 194.694 +  0.2872451953F, 0.2881427215F, 0.2890411055F, 0.2899403433F,
 194.695 +  0.2908404312F, 0.2917413654F, 0.2926431418F, 0.2935457567F,
 194.696 +  0.2944492061F, 0.2953534863F, 0.2962585932F, 0.2971645230F,
 194.697 +  0.2980712717F, 0.2989788356F, 0.2998872105F, 0.3007963927F,
 194.698 +  0.3017063781F, 0.3026171629F, 0.3035287430F, 0.3044411145F,
 194.699 +  0.3053542736F, 0.3062682161F, 0.3071829381F, 0.3080984356F,
 194.700 +  0.3090147047F, 0.3099317413F, 0.3108495414F, 0.3117681011F,
 194.701 +  0.3126874163F, 0.3136074830F, 0.3145282972F, 0.3154498548F,
 194.702 +  0.3163721517F, 0.3172951841F, 0.3182189477F, 0.3191434385F,
 194.703 +  0.3200686525F, 0.3209945856F, 0.3219212336F, 0.3228485927F,
 194.704 +  0.3237766585F, 0.3247054271F, 0.3256348943F, 0.3265650560F,
 194.705 +  0.3274959081F, 0.3284274465F, 0.3293596671F, 0.3302925657F,
 194.706 +  0.3312261382F, 0.3321603804F, 0.3330952882F, 0.3340308574F,
 194.707 +  0.3349670838F, 0.3359039634F, 0.3368414919F, 0.3377796651F,
 194.708 +  0.3387184789F, 0.3396579290F, 0.3405980113F, 0.3415387216F,
 194.709 +  0.3424800556F, 0.3434220091F, 0.3443645779F, 0.3453077578F,
 194.710 +  0.3462515446F, 0.3471959340F, 0.3481409217F, 0.3490865036F,
 194.711 +  0.3500326754F, 0.3509794328F, 0.3519267715F, 0.3528746873F,
 194.712 +  0.3538231759F, 0.3547722330F, 0.3557218544F, 0.3566720357F,
 194.713 +  0.3576227727F, 0.3585740610F, 0.3595258964F, 0.3604782745F,
 194.714 +  0.3614311910F, 0.3623846417F, 0.3633386221F, 0.3642931280F,
 194.715 +  0.3652481549F, 0.3662036987F, 0.3671597548F, 0.3681163191F,
 194.716 +  0.3690733870F, 0.3700309544F, 0.3709890167F, 0.3719475696F,
 194.717 +  0.3729066089F, 0.3738661299F, 0.3748261285F, 0.3757866002F,
 194.718 +  0.3767475406F, 0.3777089453F, 0.3786708100F, 0.3796331302F,
 194.719 +  0.3805959014F, 0.3815591194F, 0.3825227796F, 0.3834868777F,
 194.720 +  0.3844514093F, 0.3854163698F, 0.3863817549F, 0.3873475601F,
 194.721 +  0.3883137810F, 0.3892804131F, 0.3902474521F, 0.3912148933F,
 194.722 +  0.3921827325F, 0.3931509650F, 0.3941195865F, 0.3950885925F,
 194.723 +  0.3960579785F, 0.3970277400F, 0.3979978725F, 0.3989683716F,
 194.724 +  0.3999392328F, 0.4009104516F, 0.4018820234F, 0.4028539438F,
 194.725 +  0.4038262084F, 0.4047988125F, 0.4057717516F, 0.4067450214F,
 194.726 +  0.4077186172F, 0.4086925345F, 0.4096667688F, 0.4106413155F,
 194.727 +  0.4116161703F, 0.4125913284F, 0.4135667854F, 0.4145425368F,
 194.728 +  0.4155185780F, 0.4164949044F, 0.4174715116F, 0.4184483949F,
 194.729 +  0.4194255498F, 0.4204029718F, 0.4213806563F, 0.4223585987F,
 194.730 +  0.4233367946F, 0.4243152392F, 0.4252939281F, 0.4262728566F,
 194.731 +  0.4272520202F, 0.4282314144F, 0.4292110345F, 0.4301908760F,
 194.732 +  0.4311709343F, 0.4321512047F, 0.4331316828F, 0.4341123639F,
 194.733 +  0.4350932435F, 0.4360743168F, 0.4370555794F, 0.4380370267F,
 194.734 +  0.4390186540F, 0.4400004567F, 0.4409824303F, 0.4419645701F,
 194.735 +  0.4429468716F, 0.4439293300F, 0.4449119409F, 0.4458946996F,
 194.736 +  0.4468776014F, 0.4478606418F, 0.4488438162F, 0.4498271199F,
 194.737 +  0.4508105483F, 0.4517940967F, 0.4527777607F, 0.4537615355F,
 194.738 +  0.4547454165F, 0.4557293991F, 0.4567134786F, 0.4576976505F,
 194.739 +  0.4586819101F, 0.4596662527F, 0.4606506738F, 0.4616351687F,
 194.740 +  0.4626197328F, 0.4636043614F, 0.4645890499F, 0.4655737936F,
 194.741 +  0.4665585880F, 0.4675434284F, 0.4685283101F, 0.4695132286F,
 194.742 +  0.4704981791F, 0.4714831570F, 0.4724681577F, 0.4734531766F,
 194.743 +  0.4744382089F, 0.4754232501F, 0.4764082956F, 0.4773933406F,
 194.744 +  0.4783783806F, 0.4793634108F, 0.4803484267F, 0.4813334237F,
 194.745 +  0.4823183969F, 0.4833033419F, 0.4842882540F, 0.4852731285F,
 194.746 +  0.4862579608F, 0.4872427462F, 0.4882274802F, 0.4892121580F,
 194.747 +  0.4901967751F, 0.4911813267F, 0.4921658083F, 0.4931502151F,
 194.748 +  0.4941345427F, 0.4951187863F, 0.4961029412F, 0.4970870029F,
 194.749 +  0.4980709667F, 0.4990548280F, 0.5000385822F, 0.5010222245F,
 194.750 +  0.5020057505F, 0.5029891553F, 0.5039724345F, 0.5049555834F,
 194.751 +  0.5059385973F, 0.5069214716F, 0.5079042018F, 0.5088867831F,
 194.752 +  0.5098692110F, 0.5108514808F, 0.5118335879F, 0.5128155277F,
 194.753 +  0.5137972956F, 0.5147788869F, 0.5157602971F, 0.5167415215F,
 194.754 +  0.5177225555F, 0.5187033945F, 0.5196840339F, 0.5206644692F,
 194.755 +  0.5216446956F, 0.5226247086F, 0.5236045035F, 0.5245840759F,
 194.756 +  0.5255634211F, 0.5265425344F, 0.5275214114F, 0.5285000474F,
 194.757 +  0.5294784378F, 0.5304565781F, 0.5314344637F, 0.5324120899F,
 194.758 +  0.5333894522F, 0.5343665461F, 0.5353433670F, 0.5363199102F,
 194.759 +  0.5372961713F, 0.5382721457F, 0.5392478287F, 0.5402232159F,
 194.760 +  0.5411983027F, 0.5421730845F, 0.5431475569F, 0.5441217151F,
 194.761 +  0.5450955548F, 0.5460690714F, 0.5470422602F, 0.5480151169F,
 194.762 +  0.5489876368F, 0.5499598155F, 0.5509316484F, 0.5519031310F,
 194.763 +  0.5528742587F, 0.5538450271F, 0.5548154317F, 0.5557854680F,
 194.764 +  0.5567551314F, 0.5577244174F, 0.5586933216F, 0.5596618395F,
 194.765 +  0.5606299665F, 0.5615976983F, 0.5625650302F, 0.5635319580F,
 194.766 +  0.5644984770F, 0.5654645828F, 0.5664302709F, 0.5673955370F,
 194.767 +  0.5683603765F, 0.5693247850F, 0.5702887580F, 0.5712522912F,
 194.768 +  0.5722153800F, 0.5731780200F, 0.5741402069F, 0.5751019362F,
 194.769 +  0.5760632034F, 0.5770240042F, 0.5779843341F, 0.5789441889F,
 194.770 +  0.5799035639F, 0.5808624549F, 0.5818208575F, 0.5827787673F,
 194.771 +  0.5837361800F, 0.5846930910F, 0.5856494961F, 0.5866053910F,
 194.772 +  0.5875607712F, 0.5885156324F, 0.5894699703F, 0.5904237804F,
 194.773 +  0.5913770586F, 0.5923298004F, 0.5932820016F, 0.5942336578F,
 194.774 +  0.5951847646F, 0.5961353179F, 0.5970853132F, 0.5980347464F,
 194.775 +  0.5989836131F, 0.5999319090F, 0.6008796298F, 0.6018267713F,
 194.776 +  0.6027733292F, 0.6037192993F, 0.6046646773F, 0.6056094589F,
 194.777 +  0.6065536400F, 0.6074972162F, 0.6084401833F, 0.6093825372F,
 194.778 +  0.6103242736F, 0.6112653884F, 0.6122058772F, 0.6131457359F,
 194.779 +  0.6140849604F, 0.6150235464F, 0.6159614897F, 0.6168987862F,
 194.780 +  0.6178354318F, 0.6187714223F, 0.6197067535F, 0.6206414213F,
 194.781 +  0.6215754215F, 0.6225087501F, 0.6234414028F, 0.6243733757F,
 194.782 +  0.6253046646F, 0.6262352654F, 0.6271651739F, 0.6280943862F,
 194.783 +  0.6290228982F, 0.6299507057F, 0.6308778048F, 0.6318041913F,
 194.784 +  0.6327298612F, 0.6336548105F, 0.6345790352F, 0.6355025312F,
 194.785 +  0.6364252945F, 0.6373473211F, 0.6382686070F, 0.6391891483F,
 194.786 +  0.6401089409F, 0.6410279808F, 0.6419462642F, 0.6428637869F,
 194.787 +  0.6437805452F, 0.6446965350F, 0.6456117524F, 0.6465261935F,
 194.788 +  0.6474398544F, 0.6483527311F, 0.6492648197F, 0.6501761165F,
 194.789 +  0.6510866174F, 0.6519963186F, 0.6529052162F, 0.6538133064F,
 194.790 +  0.6547205854F, 0.6556270492F, 0.6565326941F, 0.6574375162F,
 194.791 +  0.6583415117F, 0.6592446769F, 0.6601470079F, 0.6610485009F,
 194.792 +  0.6619491521F, 0.6628489578F, 0.6637479143F, 0.6646460177F,
 194.793 +  0.6655432643F, 0.6664396505F, 0.6673351724F, 0.6682298264F,
 194.794 +  0.6691236087F, 0.6700165157F, 0.6709085436F, 0.6717996889F,
 194.795 +  0.6726899478F, 0.6735793167F, 0.6744677918F, 0.6753553697F,
 194.796 +  0.6762420466F, 0.6771278190F, 0.6780126832F, 0.6788966357F,
 194.797 +  0.6797796728F, 0.6806617909F, 0.6815429866F, 0.6824232562F,
 194.798 +  0.6833025961F, 0.6841810030F, 0.6850584731F, 0.6859350031F,
 194.799 +  0.6868105894F, 0.6876852284F, 0.6885589168F, 0.6894316510F,
 194.800 +  0.6903034275F, 0.6911742430F, 0.6920440939F, 0.6929129769F,
 194.801 +  0.6937808884F, 0.6946478251F, 0.6955137837F, 0.6963787606F,
 194.802 +  0.6972427525F, 0.6981057560F, 0.6989677678F, 0.6998287845F,
 194.803 +  0.7006888028F, 0.7015478194F, 0.7024058309F, 0.7032628340F,
 194.804 +  0.7041188254F, 0.7049738019F, 0.7058277601F, 0.7066806969F,
 194.805 +  0.7075326089F, 0.7083834929F, 0.7092333457F, 0.7100821640F,
 194.806 +  0.7109299447F, 0.7117766846F, 0.7126223804F, 0.7134670291F,
 194.807 +  0.7143106273F, 0.7151531721F, 0.7159946602F, 0.7168350885F,
 194.808 +  0.7176744539F, 0.7185127534F, 0.7193499837F, 0.7201861418F,
 194.809 +  0.7210212247F, 0.7218552293F, 0.7226881526F, 0.7235199914F,
 194.810 +  0.7243507428F, 0.7251804039F, 0.7260089715F, 0.7268364426F,
 194.811 +  0.7276628144F, 0.7284880839F, 0.7293122481F, 0.7301353040F,
 194.812 +  0.7309572487F, 0.7317780794F, 0.7325977930F, 0.7334163868F,
 194.813 +  0.7342338579F, 0.7350502033F, 0.7358654202F, 0.7366795059F,
 194.814 +  0.7374924573F, 0.7383042718F, 0.7391149465F, 0.7399244787F,
 194.815 +  0.7407328655F, 0.7415401041F, 0.7423461920F, 0.7431511261F,
 194.816 +  0.7439549040F, 0.7447575227F, 0.7455589797F, 0.7463592723F,
 194.817 +  0.7471583976F, 0.7479563532F, 0.7487531363F, 0.7495487443F,
 194.818 +  0.7503431745F, 0.7511364244F, 0.7519284913F, 0.7527193726F,
 194.819 +  0.7535090658F, 0.7542975683F, 0.7550848776F, 0.7558709910F,
 194.820 +  0.7566559062F, 0.7574396205F, 0.7582221314F, 0.7590034366F,
 194.821 +  0.7597835334F, 0.7605624194F, 0.7613400923F, 0.7621165495F,
 194.822 +  0.7628917886F, 0.7636658072F, 0.7644386030F, 0.7652101735F,
 194.823 +  0.7659805164F, 0.7667496292F, 0.7675175098F, 0.7682841556F,
 194.824 +  0.7690495645F, 0.7698137341F, 0.7705766622F, 0.7713383463F,
 194.825 +  0.7720987844F, 0.7728579741F, 0.7736159132F, 0.7743725994F,
 194.826 +  0.7751280306F, 0.7758822046F, 0.7766351192F, 0.7773867722F,
 194.827 +  0.7781371614F, 0.7788862848F, 0.7796341401F, 0.7803807253F,
 194.828 +  0.7811260383F, 0.7818700769F, 0.7826128392F, 0.7833543230F,
 194.829 +  0.7840945263F, 0.7848334471F, 0.7855710833F, 0.7863074330F,
 194.830 +  0.7870424941F, 0.7877762647F, 0.7885087428F, 0.7892399264F,
 194.831 +  0.7899698137F, 0.7906984026F, 0.7914256914F, 0.7921516780F,
 194.832 +  0.7928763607F, 0.7935997375F, 0.7943218065F, 0.7950425661F,
 194.833 +  0.7957620142F, 0.7964801492F, 0.7971969692F, 0.7979124724F,
 194.834 +  0.7986266570F, 0.7993395214F, 0.8000510638F, 0.8007612823F,
 194.835 +  0.8014701754F, 0.8021777413F, 0.8028839784F, 0.8035888849F,
 194.836 +  0.8042924592F, 0.8049946997F, 0.8056956048F, 0.8063951727F,
 194.837 +  0.8070934020F, 0.8077902910F, 0.8084858381F, 0.8091800419F,
 194.838 +  0.8098729007F, 0.8105644130F, 0.8112545774F, 0.8119433922F,
 194.839 +  0.8126308561F, 0.8133169676F, 0.8140017251F, 0.8146851272F,
 194.840 +  0.8153671726F, 0.8160478598F, 0.8167271874F, 0.8174051539F,
 194.841 +  0.8180817582F, 0.8187569986F, 0.8194308741F, 0.8201033831F,
 194.842 +  0.8207745244F, 0.8214442966F, 0.8221126986F, 0.8227797290F,
 194.843 +  0.8234453865F, 0.8241096700F, 0.8247725781F, 0.8254341097F,
 194.844 +  0.8260942636F, 0.8267530385F, 0.8274104334F, 0.8280664470F,
 194.845 +  0.8287210782F, 0.8293743259F, 0.8300261889F, 0.8306766662F,
 194.846 +  0.8313257566F, 0.8319734591F, 0.8326197727F, 0.8332646963F,
 194.847 +  0.8339082288F, 0.8345503692F, 0.8351911167F, 0.8358304700F,
 194.848 +  0.8364684284F, 0.8371049907F, 0.8377401562F, 0.8383739238F,
 194.849 +  0.8390062927F, 0.8396372618F, 0.8402668305F, 0.8408949977F,
 194.850 +  0.8415217626F, 0.8421471245F, 0.8427710823F, 0.8433936354F,
 194.851 +  0.8440147830F, 0.8446345242F, 0.8452528582F, 0.8458697844F,
 194.852 +  0.8464853020F, 0.8470994102F, 0.8477121084F, 0.8483233958F,
 194.853 +  0.8489332718F, 0.8495417356F, 0.8501487866F, 0.8507544243F,
 194.854 +  0.8513586479F, 0.8519614568F, 0.8525628505F, 0.8531628283F,
 194.855 +  0.8537613897F, 0.8543585341F, 0.8549542611F, 0.8555485699F,
 194.856 +  0.8561414603F, 0.8567329315F, 0.8573229832F, 0.8579116149F,
 194.857 +  0.8584988262F, 0.8590846165F, 0.8596689855F, 0.8602519327F,
 194.858 +  0.8608334577F, 0.8614135603F, 0.8619922399F, 0.8625694962F,
 194.859 +  0.8631453289F, 0.8637197377F, 0.8642927222F, 0.8648642821F,
 194.860 +  0.8654344172F, 0.8660031272F, 0.8665704118F, 0.8671362708F,
 194.861 +  0.8677007039F, 0.8682637109F, 0.8688252917F, 0.8693854460F,
 194.862 +  0.8699441737F, 0.8705014745F, 0.8710573485F, 0.8716117953F,
 194.863 +  0.8721648150F, 0.8727164073F, 0.8732665723F, 0.8738153098F,
 194.864 +  0.8743626197F, 0.8749085021F, 0.8754529569F, 0.8759959840F,
 194.865 +  0.8765375835F, 0.8770777553F, 0.8776164996F, 0.8781538162F,
 194.866 +  0.8786897054F, 0.8792241670F, 0.8797572013F, 0.8802888082F,
 194.867 +  0.8808189880F, 0.8813477407F, 0.8818750664F, 0.8824009653F,
 194.868 +  0.8829254375F, 0.8834484833F, 0.8839701028F, 0.8844902961F,
 194.869 +  0.8850090636F, 0.8855264054F, 0.8860423218F, 0.8865568131F,
 194.870 +  0.8870698794F, 0.8875815212F, 0.8880917386F, 0.8886005319F,
 194.871 +  0.8891079016F, 0.8896138479F, 0.8901183712F, 0.8906214719F,
 194.872 +  0.8911231503F, 0.8916234067F, 0.8921222417F, 0.8926196556F,
 194.873 +  0.8931156489F, 0.8936102219F, 0.8941033752F, 0.8945951092F,
 194.874 +  0.8950854244F, 0.8955743212F, 0.8960618003F, 0.8965478621F,
 194.875 +  0.8970325071F, 0.8975157359F, 0.8979975490F, 0.8984779471F,
 194.876 +  0.8989569307F, 0.8994345004F, 0.8999106568F, 0.9003854005F,
 194.877 +  0.9008587323F, 0.9013306526F, 0.9018011623F, 0.9022702619F,
 194.878 +  0.9027379521F, 0.9032042337F, 0.9036691074F, 0.9041325739F,
 194.879 +  0.9045946339F, 0.9050552882F, 0.9055145376F, 0.9059723828F,
 194.880 +  0.9064288246F, 0.9068838638F, 0.9073375013F, 0.9077897379F,
 194.881 +  0.9082405743F, 0.9086900115F, 0.9091380503F, 0.9095846917F,
 194.882 +  0.9100299364F, 0.9104737854F, 0.9109162397F, 0.9113573001F,
 194.883 +  0.9117969675F, 0.9122352430F, 0.9126721275F, 0.9131076219F,
 194.884 +  0.9135417273F, 0.9139744447F, 0.9144057750F, 0.9148357194F,
 194.885 +  0.9152642787F, 0.9156914542F, 0.9161172468F, 0.9165416576F,
 194.886 +  0.9169646877F, 0.9173863382F, 0.9178066102F, 0.9182255048F,
 194.887 +  0.9186430232F, 0.9190591665F, 0.9194739359F, 0.9198873324F,
 194.888 +  0.9202993574F, 0.9207100120F, 0.9211192973F, 0.9215272147F,
 194.889 +  0.9219337653F, 0.9223389504F, 0.9227427713F, 0.9231452290F,
 194.890 +  0.9235463251F, 0.9239460607F, 0.9243444371F, 0.9247414557F,
 194.891 +  0.9251371177F, 0.9255314245F, 0.9259243774F, 0.9263159778F,
 194.892 +  0.9267062270F, 0.9270951264F, 0.9274826774F, 0.9278688814F,
 194.893 +  0.9282537398F, 0.9286372540F, 0.9290194254F, 0.9294002555F,
 194.894 +  0.9297797458F, 0.9301578976F, 0.9305347125F, 0.9309101919F,
 194.895 +  0.9312843373F, 0.9316571503F, 0.9320286323F, 0.9323987849F,
 194.896 +  0.9327676097F, 0.9331351080F, 0.9335012816F, 0.9338661320F,
 194.897 +  0.9342296607F, 0.9345918694F, 0.9349527596F, 0.9353123330F,
 194.898 +  0.9356705911F, 0.9360275357F, 0.9363831683F, 0.9367374905F,
 194.899 +  0.9370905042F, 0.9374422108F, 0.9377926122F, 0.9381417099F,
 194.900 +  0.9384895057F, 0.9388360014F, 0.9391811985F, 0.9395250989F,
 194.901 +  0.9398677043F, 0.9402090165F, 0.9405490371F, 0.9408877680F,
 194.902 +  0.9412252110F, 0.9415613678F, 0.9418962402F, 0.9422298301F,
 194.903 +  0.9425621392F, 0.9428931695F, 0.9432229226F, 0.9435514005F,
 194.904 +  0.9438786050F, 0.9442045381F, 0.9445292014F, 0.9448525971F,
 194.905 +  0.9451747268F, 0.9454955926F, 0.9458151963F, 0.9461335399F,
 194.906 +  0.9464506253F, 0.9467664545F, 0.9470810293F, 0.9473943517F,
 194.907 +  0.9477064238F, 0.9480172474F, 0.9483268246F, 0.9486351573F,
 194.908 +  0.9489422475F, 0.9492480973F, 0.9495527087F, 0.9498560837F,
 194.909 +  0.9501582243F, 0.9504591325F, 0.9507588105F, 0.9510572603F,
 194.910 +  0.9513544839F, 0.9516504834F, 0.9519452609F, 0.9522388186F,
 194.911 +  0.9525311584F, 0.9528222826F, 0.9531121932F, 0.9534008923F,
 194.912 +  0.9536883821F, 0.9539746647F, 0.9542597424F, 0.9545436171F,
 194.913 +  0.9548262912F, 0.9551077667F, 0.9553880459F, 0.9556671309F,
 194.914 +  0.9559450239F, 0.9562217272F, 0.9564972429F, 0.9567715733F,
 194.915 +  0.9570447206F, 0.9573166871F, 0.9575874749F, 0.9578570863F,
 194.916 +  0.9581255236F, 0.9583927890F, 0.9586588849F, 0.9589238134F,
 194.917 +  0.9591875769F, 0.9594501777F, 0.9597116180F, 0.9599719003F,
 194.918 +  0.9602310267F, 0.9604889995F, 0.9607458213F, 0.9610014942F,
 194.919 +  0.9612560206F, 0.9615094028F, 0.9617616433F, 0.9620127443F,
 194.920 +  0.9622627083F, 0.9625115376F, 0.9627592345F, 0.9630058016F,
 194.921 +  0.9632512411F, 0.9634955555F, 0.9637387471F, 0.9639808185F,
 194.922 +  0.9642217720F, 0.9644616100F, 0.9647003349F, 0.9649379493F,
 194.923 +  0.9651744556F, 0.9654098561F, 0.9656441534F, 0.9658773499F,
 194.924 +  0.9661094480F, 0.9663404504F, 0.9665703593F, 0.9667991774F,
 194.925 +  0.9670269071F, 0.9672535509F, 0.9674791114F, 0.9677035909F,
 194.926 +  0.9679269921F, 0.9681493174F, 0.9683705694F, 0.9685907506F,
 194.927 +  0.9688098636F, 0.9690279108F, 0.9692448948F, 0.9694608182F,
 194.928 +  0.9696756836F, 0.9698894934F, 0.9701022503F, 0.9703139569F,
 194.929 +  0.9705246156F, 0.9707342291F, 0.9709428000F, 0.9711503309F,
 194.930 +  0.9713568243F, 0.9715622829F, 0.9717667093F, 0.9719701060F,
 194.931 +  0.9721724757F, 0.9723738210F, 0.9725741446F, 0.9727734490F,
 194.932 +  0.9729717369F, 0.9731690109F, 0.9733652737F, 0.9735605279F,
 194.933 +  0.9737547762F, 0.9739480212F, 0.9741402656F, 0.9743315120F,
 194.934 +  0.9745217631F, 0.9747110216F, 0.9748992901F, 0.9750865714F,
 194.935 +  0.9752728681F, 0.9754581829F, 0.9756425184F, 0.9758258775F,
 194.936 +  0.9760082627F, 0.9761896768F, 0.9763701224F, 0.9765496024F,
 194.937 +  0.9767281193F, 0.9769056760F, 0.9770822751F, 0.9772579193F,
 194.938 +  0.9774326114F, 0.9776063542F, 0.9777791502F, 0.9779510023F,
 194.939 +  0.9781219133F, 0.9782918858F, 0.9784609226F, 0.9786290264F,
 194.940 +  0.9787962000F, 0.9789624461F, 0.9791277676F, 0.9792921671F,
 194.941 +  0.9794556474F, 0.9796182113F, 0.9797798615F, 0.9799406009F,
 194.942 +  0.9801004321F, 0.9802593580F, 0.9804173813F, 0.9805745049F,
 194.943 +  0.9807307314F, 0.9808860637F, 0.9810405046F, 0.9811940568F,
 194.944 +  0.9813467232F, 0.9814985065F, 0.9816494095F, 0.9817994351F,
 194.945 +  0.9819485860F, 0.9820968650F, 0.9822442750F, 0.9823908186F,
 194.946 +  0.9825364988F, 0.9826813184F, 0.9828252801F, 0.9829683868F,
 194.947 +  0.9831106413F, 0.9832520463F, 0.9833926048F, 0.9835323195F,
 194.948 +  0.9836711932F, 0.9838092288F, 0.9839464291F, 0.9840827969F,
 194.949 +  0.9842183351F, 0.9843530464F, 0.9844869337F, 0.9846199998F,
 194.950 +  0.9847522475F, 0.9848836798F, 0.9850142993F, 0.9851441090F,
 194.951 +  0.9852731117F, 0.9854013101F, 0.9855287073F, 0.9856553058F,
 194.952 +  0.9857811087F, 0.9859061188F, 0.9860303388F, 0.9861537717F,
 194.953 +  0.9862764202F, 0.9863982872F, 0.9865193756F, 0.9866396882F,
 194.954 +  0.9867592277F, 0.9868779972F, 0.9869959993F, 0.9871132370F,
 194.955 +  0.9872297131F, 0.9873454304F, 0.9874603918F, 0.9875746001F,
 194.956 +  0.9876880581F, 0.9878007688F, 0.9879127348F, 0.9880239592F,
 194.957 +  0.9881344447F, 0.9882441941F, 0.9883532104F, 0.9884614962F,
 194.958 +  0.9885690546F, 0.9886758883F, 0.9887820001F, 0.9888873930F,
 194.959 +  0.9889920697F, 0.9890960331F, 0.9891992859F, 0.9893018312F,
 194.960 +  0.9894036716F, 0.9895048100F, 0.9896052493F, 0.9897049923F,
 194.961 +  0.9898040418F, 0.9899024006F, 0.9900000717F, 0.9900970577F,
 194.962 +  0.9901933616F, 0.9902889862F, 0.9903839343F, 0.9904782087F,
 194.963 +  0.9905718122F, 0.9906647477F, 0.9907570180F, 0.9908486259F,
 194.964 +  0.9909395742F, 0.9910298658F, 0.9911195034F, 0.9912084899F,
 194.965 +  0.9912968281F, 0.9913845208F, 0.9914715708F, 0.9915579810F,
 194.966 +  0.9916437540F, 0.9917288928F, 0.9918134001F, 0.9918972788F,
 194.967 +  0.9919805316F, 0.9920631613F, 0.9921451707F, 0.9922265626F,
 194.968 +  0.9923073399F, 0.9923875052F, 0.9924670615F, 0.9925460114F,
 194.969 +  0.9926243577F, 0.9927021033F, 0.9927792508F, 0.9928558032F,
 194.970 +  0.9929317631F, 0.9930071333F, 0.9930819167F, 0.9931561158F,
 194.971 +  0.9932297337F, 0.9933027728F, 0.9933752362F, 0.9934471264F,
 194.972 +  0.9935184462F, 0.9935891985F, 0.9936593859F, 0.9937290112F,
 194.973 +  0.9937980771F, 0.9938665864F, 0.9939345418F, 0.9940019460F,
 194.974 +  0.9940688018F, 0.9941351118F, 0.9942008789F, 0.9942661057F,
 194.975 +  0.9943307950F, 0.9943949494F, 0.9944585717F, 0.9945216645F,
 194.976 +  0.9945842307F, 0.9946462728F, 0.9947077936F, 0.9947687957F,
 194.977 +  0.9948292820F, 0.9948892550F, 0.9949487174F, 0.9950076719F,
 194.978 +  0.9950661212F, 0.9951240679F, 0.9951815148F, 0.9952384645F,
 194.979 +  0.9952949196F, 0.9953508828F, 0.9954063568F, 0.9954613442F,
 194.980 +  0.9955158476F, 0.9955698697F, 0.9956234132F, 0.9956764806F,
 194.981 +  0.9957290746F, 0.9957811978F, 0.9958328528F, 0.9958840423F,
 194.982 +  0.9959347688F, 0.9959850351F, 0.9960348435F, 0.9960841969F,
 194.983 +  0.9961330977F, 0.9961815486F, 0.9962295521F, 0.9962771108F,
 194.984 +  0.9963242274F, 0.9963709043F, 0.9964171441F, 0.9964629494F,
 194.985 +  0.9965083228F, 0.9965532668F, 0.9965977840F, 0.9966418768F,
 194.986 +  0.9966855479F, 0.9967287998F, 0.9967716350F, 0.9968140559F,
 194.987 +  0.9968560653F, 0.9968976655F, 0.9969388591F, 0.9969796485F,
 194.988 +  0.9970200363F, 0.9970600250F, 0.9970996170F, 0.9971388149F,
 194.989 +  0.9971776211F, 0.9972160380F, 0.9972540683F, 0.9972917142F,
 194.990 +  0.9973289783F, 0.9973658631F, 0.9974023709F, 0.9974385042F,
 194.991 +  0.9974742655F, 0.9975096571F, 0.9975446816F, 0.9975793413F,
 194.992 +  0.9976136386F, 0.9976475759F, 0.9976811557F, 0.9977143803F,
 194.993 +  0.9977472521F, 0.9977797736F, 0.9978119470F, 0.9978437748F,
 194.994 +  0.9978752593F, 0.9979064029F, 0.9979372079F, 0.9979676768F,
 194.995 +  0.9979978117F, 0.9980276151F, 0.9980570893F, 0.9980862367F,
 194.996 +  0.9981150595F, 0.9981435600F, 0.9981717406F, 0.9981996035F,
 194.997 +  0.9982271511F, 0.9982543856F, 0.9982813093F, 0.9983079246F,
 194.998 +  0.9983342336F, 0.9983602386F, 0.9983859418F, 0.9984113456F,
 194.999 +  0.9984364522F, 0.9984612638F, 0.9984857825F, 0.9985100108F,
194.1000 +  0.9985339507F, 0.9985576044F, 0.9985809743F, 0.9986040624F,
194.1001 +  0.9986268710F, 0.9986494022F, 0.9986716583F, 0.9986936413F,
194.1002 +  0.9987153535F, 0.9987367969F, 0.9987579738F, 0.9987788864F,
194.1003 +  0.9987995366F, 0.9988199267F, 0.9988400587F, 0.9988599348F,
194.1004 +  0.9988795572F, 0.9988989278F, 0.9989180487F, 0.9989369222F,
194.1005 +  0.9989555501F, 0.9989739347F, 0.9989920780F, 0.9990099820F,
194.1006 +  0.9990276487F, 0.9990450803F, 0.9990622787F, 0.9990792460F,
194.1007 +  0.9990959841F, 0.9991124952F, 0.9991287812F, 0.9991448440F,
194.1008 +  0.9991606858F, 0.9991763084F, 0.9991917139F, 0.9992069042F,
194.1009 +  0.9992218813F, 0.9992366471F, 0.9992512035F, 0.9992655525F,
194.1010 +  0.9992796961F, 0.9992936361F, 0.9993073744F, 0.9993209131F,
194.1011 +  0.9993342538F, 0.9993473987F, 0.9993603494F, 0.9993731080F,
194.1012 +  0.9993856762F, 0.9993980559F, 0.9994102490F, 0.9994222573F,
194.1013 +  0.9994340827F, 0.9994457269F, 0.9994571918F, 0.9994684793F,
194.1014 +  0.9994795910F, 0.9994905288F, 0.9995012945F, 0.9995118898F,
194.1015 +  0.9995223165F, 0.9995325765F, 0.9995426713F, 0.9995526029F,
194.1016 +  0.9995623728F, 0.9995719829F, 0.9995814349F, 0.9995907304F,
194.1017 +  0.9995998712F, 0.9996088590F, 0.9996176954F, 0.9996263821F,
194.1018 +  0.9996349208F, 0.9996433132F, 0.9996515609F, 0.9996596656F,
194.1019 +  0.9996676288F, 0.9996754522F, 0.9996831375F, 0.9996906862F,
194.1020 +  0.9996981000F, 0.9997053804F, 0.9997125290F, 0.9997195474F,
194.1021 +  0.9997264371F, 0.9997331998F, 0.9997398369F, 0.9997463500F,
194.1022 +  0.9997527406F, 0.9997590103F, 0.9997651606F, 0.9997711930F,
194.1023 +  0.9997771089F, 0.9997829098F, 0.9997885973F, 0.9997941728F,
194.1024 +  0.9997996378F, 0.9998049936F, 0.9998102419F, 0.9998153839F,
194.1025 +  0.9998204211F, 0.9998253550F, 0.9998301868F, 0.9998349182F,
194.1026 +  0.9998395503F, 0.9998440847F, 0.9998485226F, 0.9998528654F,
194.1027 +  0.9998571146F, 0.9998612713F, 0.9998653370F, 0.9998693130F,
194.1028 +  0.9998732007F, 0.9998770012F, 0.9998807159F, 0.9998843461F,
194.1029 +  0.9998878931F, 0.9998913581F, 0.9998947424F, 0.9998980473F,
194.1030 +  0.9999012740F, 0.9999044237F, 0.9999074976F, 0.9999104971F,
194.1031 +  0.9999134231F, 0.9999162771F, 0.9999190601F, 0.9999217733F,
194.1032 +  0.9999244179F, 0.9999269950F, 0.9999295058F, 0.9999319515F,
194.1033 +  0.9999343332F, 0.9999366519F, 0.9999389088F, 0.9999411050F,
194.1034 +  0.9999432416F, 0.9999453196F, 0.9999473402F, 0.9999493044F,
194.1035 +  0.9999512132F, 0.9999530677F, 0.9999548690F, 0.9999566180F,
194.1036 +  0.9999583157F, 0.9999599633F, 0.9999615616F, 0.9999631116F,
194.1037 +  0.9999646144F, 0.9999660709F, 0.9999674820F, 0.9999688487F,
194.1038 +  0.9999701719F, 0.9999714526F, 0.9999726917F, 0.9999738900F,
194.1039 +  0.9999750486F, 0.9999761682F, 0.9999772497F, 0.9999782941F,
194.1040 +  0.9999793021F, 0.9999802747F, 0.9999812126F, 0.9999821167F,
194.1041 +  0.9999829878F, 0.9999838268F, 0.9999846343F, 0.9999854113F,
194.1042 +  0.9999861584F, 0.9999868765F, 0.9999875664F, 0.9999882287F,
194.1043 +  0.9999888642F, 0.9999894736F, 0.9999900577F, 0.9999906172F,
194.1044 +  0.9999911528F, 0.9999916651F, 0.9999921548F, 0.9999926227F,
194.1045 +  0.9999930693F, 0.9999934954F, 0.9999939015F, 0.9999942883F,
194.1046 +  0.9999946564F, 0.9999950064F, 0.9999953390F, 0.9999956547F,
194.1047 +  0.9999959541F, 0.9999962377F, 0.9999965062F, 0.9999967601F,
194.1048 +  0.9999969998F, 0.9999972260F, 0.9999974392F, 0.9999976399F,
194.1049 +  0.9999978285F, 0.9999980056F, 0.9999981716F, 0.9999983271F,
194.1050 +  0.9999984724F, 0.9999986081F, 0.9999987345F, 0.9999988521F,
194.1051 +  0.9999989613F, 0.9999990625F, 0.9999991562F, 0.9999992426F,
194.1052 +  0.9999993223F, 0.9999993954F, 0.9999994625F, 0.9999995239F,
194.1053 +  0.9999995798F, 0.9999996307F, 0.9999996768F, 0.9999997184F,
194.1054 +  0.9999997559F, 0.9999997895F, 0.9999998195F, 0.9999998462F,
194.1055 +  0.9999998698F, 0.9999998906F, 0.9999999088F, 0.9999999246F,
194.1056 +  0.9999999383F, 0.9999999500F, 0.9999999600F, 0.9999999684F,
194.1057 +  0.9999999754F, 0.9999999811F, 0.9999999858F, 0.9999999896F,
194.1058 +  0.9999999925F, 0.9999999948F, 0.9999999965F, 0.9999999978F,
194.1059 +  0.9999999986F, 0.9999999992F, 0.9999999996F, 0.9999999998F,
194.1060 +  0.9999999999F, 1.0000000000F, 1.0000000000F, 1.0000000000F,
194.1061 +};
194.1062 +
194.1063 +static const float vwin8192[4096] = {
194.1064 +  0.0000000578F, 0.0000005198F, 0.0000014438F, 0.0000028299F,
194.1065 +  0.0000046780F, 0.0000069882F, 0.0000097604F, 0.0000129945F,
194.1066 +  0.0000166908F, 0.0000208490F, 0.0000254692F, 0.0000305515F,
194.1067 +  0.0000360958F, 0.0000421021F, 0.0000485704F, 0.0000555006F,
194.1068 +  0.0000628929F, 0.0000707472F, 0.0000790635F, 0.0000878417F,
194.1069 +  0.0000970820F, 0.0001067842F, 0.0001169483F, 0.0001275744F,
194.1070 +  0.0001386625F, 0.0001502126F, 0.0001622245F, 0.0001746984F,
194.1071 +  0.0001876343F, 0.0002010320F, 0.0002148917F, 0.0002292132F,
194.1072 +  0.0002439967F, 0.0002592421F, 0.0002749493F, 0.0002911184F,
194.1073 +  0.0003077493F, 0.0003248421F, 0.0003423967F, 0.0003604132F,
194.1074 +  0.0003788915F, 0.0003978316F, 0.0004172335F, 0.0004370971F,
194.1075 +  0.0004574226F, 0.0004782098F, 0.0004994587F, 0.0005211694F,
194.1076 +  0.0005433418F, 0.0005659759F, 0.0005890717F, 0.0006126292F,
194.1077 +  0.0006366484F, 0.0006611292F, 0.0006860716F, 0.0007114757F,
194.1078 +  0.0007373414F, 0.0007636687F, 0.0007904576F, 0.0008177080F,
194.1079 +  0.0008454200F, 0.0008735935F, 0.0009022285F, 0.0009313250F,
194.1080 +  0.0009608830F, 0.0009909025F, 0.0010213834F, 0.0010523257F,
194.1081 +  0.0010837295F, 0.0011155946F, 0.0011479211F, 0.0011807090F,
194.1082 +  0.0012139582F, 0.0012476687F, 0.0012818405F, 0.0013164736F,
194.1083 +  0.0013515679F, 0.0013871235F, 0.0014231402F, 0.0014596182F,
194.1084 +  0.0014965573F, 0.0015339576F, 0.0015718190F, 0.0016101415F,
194.1085 +  0.0016489251F, 0.0016881698F, 0.0017278754F, 0.0017680421F,
194.1086 +  0.0018086698F, 0.0018497584F, 0.0018913080F, 0.0019333185F,
194.1087 +  0.0019757898F, 0.0020187221F, 0.0020621151F, 0.0021059690F,
194.1088 +  0.0021502837F, 0.0021950591F, 0.0022402953F, 0.0022859921F,
194.1089 +  0.0023321497F, 0.0023787679F, 0.0024258467F, 0.0024733861F,
194.1090 +  0.0025213861F, 0.0025698466F, 0.0026187676F, 0.0026681491F,
194.1091 +  0.0027179911F, 0.0027682935F, 0.0028190562F, 0.0028702794F,
194.1092 +  0.0029219628F, 0.0029741066F, 0.0030267107F, 0.0030797749F,
194.1093 +  0.0031332994F, 0.0031872841F, 0.0032417289F, 0.0032966338F,
194.1094 +  0.0033519988F, 0.0034078238F, 0.0034641089F, 0.0035208539F,
194.1095 +  0.0035780589F, 0.0036357237F, 0.0036938485F, 0.0037524331F,
194.1096 +  0.0038114775F, 0.0038709817F, 0.0039309456F, 0.0039913692F,
194.1097 +  0.0040522524F, 0.0041135953F, 0.0041753978F, 0.0042376599F,
194.1098 +  0.0043003814F, 0.0043635624F, 0.0044272029F, 0.0044913028F,
194.1099 +  0.0045558620F, 0.0046208806F, 0.0046863585F, 0.0047522955F,
194.1100 +  0.0048186919F, 0.0048855473F, 0.0049528619F, 0.0050206356F,
194.1101 +  0.0050888684F, 0.0051575601F, 0.0052267108F, 0.0052963204F,
194.1102 +  0.0053663890F, 0.0054369163F, 0.0055079025F, 0.0055793474F,
194.1103 +  0.0056512510F, 0.0057236133F, 0.0057964342F, 0.0058697137F,
194.1104 +  0.0059434517F, 0.0060176482F, 0.0060923032F, 0.0061674166F,
194.1105 +  0.0062429883F, 0.0063190183F, 0.0063955066F, 0.0064724532F,
194.1106 +  0.0065498579F, 0.0066277207F, 0.0067060416F, 0.0067848205F,
194.1107 +  0.0068640575F, 0.0069437523F, 0.0070239051F, 0.0071045157F,
194.1108 +  0.0071855840F, 0.0072671102F, 0.0073490940F, 0.0074315355F,
194.1109 +  0.0075144345F, 0.0075977911F, 0.0076816052F, 0.0077658768F,
194.1110 +  0.0078506057F, 0.0079357920F, 0.0080214355F, 0.0081075363F,
194.1111 +  0.0081940943F, 0.0082811094F, 0.0083685816F, 0.0084565108F,
194.1112 +  0.0085448970F, 0.0086337401F, 0.0087230401F, 0.0088127969F,
194.1113 +  0.0089030104F, 0.0089936807F, 0.0090848076F, 0.0091763911F,
194.1114 +  0.0092684311F, 0.0093609276F, 0.0094538805F, 0.0095472898F,
194.1115 +  0.0096411554F, 0.0097354772F, 0.0098302552F, 0.0099254894F,
194.1116 +  0.0100211796F, 0.0101173259F, 0.0102139281F, 0.0103109863F,
194.1117 +  0.0104085002F, 0.0105064700F, 0.0106048955F, 0.0107037766F,
194.1118 +  0.0108031133F, 0.0109029056F, 0.0110031534F, 0.0111038565F,
194.1119 +  0.0112050151F, 0.0113066289F, 0.0114086980F, 0.0115112222F,
194.1120 +  0.0116142015F, 0.0117176359F, 0.0118215252F, 0.0119258695F,
194.1121 +  0.0120306686F, 0.0121359225F, 0.0122416312F, 0.0123477944F,
194.1122 +  0.0124544123F, 0.0125614847F, 0.0126690116F, 0.0127769928F,
194.1123 +  0.0128854284F, 0.0129943182F, 0.0131036623F, 0.0132134604F,
194.1124 +  0.0133237126F, 0.0134344188F, 0.0135455790F, 0.0136571929F,
194.1125 +  0.0137692607F, 0.0138817821F, 0.0139947572F, 0.0141081859F,
194.1126 +  0.0142220681F, 0.0143364037F, 0.0144511927F, 0.0145664350F,
194.1127 +  0.0146821304F, 0.0147982791F, 0.0149148808F, 0.0150319355F,
194.1128 +  0.0151494431F, 0.0152674036F, 0.0153858168F, 0.0155046828F,
194.1129 +  0.0156240014F, 0.0157437726F, 0.0158639962F, 0.0159846723F,
194.1130 +  0.0161058007F, 0.0162273814F, 0.0163494142F, 0.0164718991F,
194.1131 +  0.0165948361F, 0.0167182250F, 0.0168420658F, 0.0169663584F,
194.1132 +  0.0170911027F, 0.0172162987F, 0.0173419462F, 0.0174680452F,
194.1133 +  0.0175945956F, 0.0177215974F, 0.0178490504F, 0.0179769545F,
194.1134 +  0.0181053098F, 0.0182341160F, 0.0183633732F, 0.0184930812F,
194.1135 +  0.0186232399F, 0.0187538494F, 0.0188849094F, 0.0190164200F,
194.1136 +  0.0191483809F, 0.0192807923F, 0.0194136539F, 0.0195469656F,
194.1137 +  0.0196807275F, 0.0198149394F, 0.0199496012F, 0.0200847128F,
194.1138 +  0.0202202742F, 0.0203562853F, 0.0204927460F, 0.0206296561F,
194.1139 +  0.0207670157F, 0.0209048245F, 0.0210430826F, 0.0211817899F,
194.1140 +  0.0213209462F, 0.0214605515F, 0.0216006057F, 0.0217411086F,
194.1141 +  0.0218820603F, 0.0220234605F, 0.0221653093F, 0.0223076066F,
194.1142 +  0.0224503521F, 0.0225935459F, 0.0227371879F, 0.0228812779F,
194.1143 +  0.0230258160F, 0.0231708018F, 0.0233162355F, 0.0234621169F,
194.1144 +  0.0236084459F, 0.0237552224F, 0.0239024462F, 0.0240501175F,
194.1145 +  0.0241982359F, 0.0243468015F, 0.0244958141F, 0.0246452736F,
194.1146 +  0.0247951800F, 0.0249455331F, 0.0250963329F, 0.0252475792F,
194.1147 +  0.0253992720F, 0.0255514111F, 0.0257039965F, 0.0258570281F,
194.1148 +  0.0260105057F, 0.0261644293F, 0.0263187987F, 0.0264736139F,
194.1149 +  0.0266288747F, 0.0267845811F, 0.0269407330F, 0.0270973302F,
194.1150 +  0.0272543727F, 0.0274118604F, 0.0275697930F, 0.0277281707F,
194.1151 +  0.0278869932F, 0.0280462604F, 0.0282059723F, 0.0283661287F,
194.1152 +  0.0285267295F, 0.0286877747F, 0.0288492641F, 0.0290111976F,
194.1153 +  0.0291735751F, 0.0293363965F, 0.0294996617F, 0.0296633706F,
194.1154 +  0.0298275231F, 0.0299921190F, 0.0301571583F, 0.0303226409F,
194.1155 +  0.0304885667F, 0.0306549354F, 0.0308217472F, 0.0309890017F,
194.1156 +  0.0311566989F, 0.0313248388F, 0.0314934211F, 0.0316624459F,
194.1157 +  0.0318319128F, 0.0320018220F, 0.0321721732F, 0.0323429663F,
194.1158 +  0.0325142013F, 0.0326858779F, 0.0328579962F, 0.0330305559F,
194.1159 +  0.0332035570F, 0.0333769994F, 0.0335508829F, 0.0337252074F,
194.1160 +  0.0338999728F, 0.0340751790F, 0.0342508259F, 0.0344269134F,
194.1161 +  0.0346034412F, 0.0347804094F, 0.0349578178F, 0.0351356663F,
194.1162 +  0.0353139548F, 0.0354926831F, 0.0356718511F, 0.0358514588F,
194.1163 +  0.0360315059F, 0.0362119924F, 0.0363929182F, 0.0365742831F,
194.1164 +  0.0367560870F, 0.0369383297F, 0.0371210113F, 0.0373041315F,
194.1165 +  0.0374876902F, 0.0376716873F, 0.0378561226F, 0.0380409961F,
194.1166 +  0.0382263077F, 0.0384120571F, 0.0385982443F, 0.0387848691F,
194.1167 +  0.0389719315F, 0.0391594313F, 0.0393473683F, 0.0395357425F,
194.1168 +  0.0397245537F, 0.0399138017F, 0.0401034866F, 0.0402936080F,
194.1169 +  0.0404841660F, 0.0406751603F, 0.0408665909F, 0.0410584576F,
194.1170 +  0.0412507603F, 0.0414434988F, 0.0416366731F, 0.0418302829F,
194.1171 +  0.0420243282F, 0.0422188088F, 0.0424137246F, 0.0426090755F,
194.1172 +  0.0428048613F, 0.0430010819F, 0.0431977371F, 0.0433948269F,
194.1173 +  0.0435923511F, 0.0437903095F, 0.0439887020F, 0.0441875285F,
194.1174 +  0.0443867889F, 0.0445864830F, 0.0447866106F, 0.0449871717F,
194.1175 +  0.0451881661F, 0.0453895936F, 0.0455914542F, 0.0457937477F,
194.1176 +  0.0459964738F, 0.0461996326F, 0.0464032239F, 0.0466072475F,
194.1177 +  0.0468117032F, 0.0470165910F, 0.0472219107F, 0.0474276622F,
194.1178 +  0.0476338452F, 0.0478404597F, 0.0480475056F, 0.0482549827F,
194.1179 +  0.0484628907F, 0.0486712297F, 0.0488799994F, 0.0490891998F,
194.1180 +  0.0492988306F, 0.0495088917F, 0.0497193830F, 0.0499303043F,
194.1181 +  0.0501416554F, 0.0503534363F, 0.0505656468F, 0.0507782867F,
194.1182 +  0.0509913559F, 0.0512048542F, 0.0514187815F, 0.0516331376F,
194.1183 +  0.0518479225F, 0.0520631358F, 0.0522787775F, 0.0524948475F,
194.1184 +  0.0527113455F, 0.0529282715F, 0.0531456252F, 0.0533634066F,
194.1185 +  0.0535816154F, 0.0538002515F, 0.0540193148F, 0.0542388051F,
194.1186 +  0.0544587222F, 0.0546790660F, 0.0548998364F, 0.0551210331F,
194.1187 +  0.0553426561F, 0.0555647051F, 0.0557871801F, 0.0560100807F,
194.1188 +  0.0562334070F, 0.0564571587F, 0.0566813357F, 0.0569059378F,
194.1189 +  0.0571309649F, 0.0573564168F, 0.0575822933F, 0.0578085942F,
194.1190 +  0.0580353195F, 0.0582624689F, 0.0584900423F, 0.0587180396F,
194.1191 +  0.0589464605F, 0.0591753049F, 0.0594045726F, 0.0596342635F,
194.1192 +  0.0598643774F, 0.0600949141F, 0.0603258735F, 0.0605572555F,
194.1193 +  0.0607890597F, 0.0610212862F, 0.0612539346F, 0.0614870049F,
194.1194 +  0.0617204968F, 0.0619544103F, 0.0621887451F, 0.0624235010F,
194.1195 +  0.0626586780F, 0.0628942758F, 0.0631302942F, 0.0633667331F,
194.1196 +  0.0636035923F, 0.0638408717F, 0.0640785710F, 0.0643166901F,
194.1197 +  0.0645552288F, 0.0647941870F, 0.0650335645F, 0.0652733610F,
194.1198 +  0.0655135765F, 0.0657542108F, 0.0659952636F, 0.0662367348F,
194.1199 +  0.0664786242F, 0.0667209316F, 0.0669636570F, 0.0672068000F,
194.1200 +  0.0674503605F, 0.0676943384F, 0.0679387334F, 0.0681835454F,
194.1201 +  0.0684287742F, 0.0686744196F, 0.0689204814F, 0.0691669595F,
194.1202 +  0.0694138536F, 0.0696611637F, 0.0699088894F, 0.0701570307F,
194.1203 +  0.0704055873F, 0.0706545590F, 0.0709039458F, 0.0711537473F,
194.1204 +  0.0714039634F, 0.0716545939F, 0.0719056387F, 0.0721570975F,
194.1205 +  0.0724089702F, 0.0726612565F, 0.0729139563F, 0.0731670694F,
194.1206 +  0.0734205956F, 0.0736745347F, 0.0739288866F, 0.0741836510F,
194.1207 +  0.0744388277F, 0.0746944166F, 0.0749504175F, 0.0752068301F,
194.1208 +  0.0754636543F, 0.0757208899F, 0.0759785367F, 0.0762365946F,
194.1209 +  0.0764950632F, 0.0767539424F, 0.0770132320F, 0.0772729319F,
194.1210 +  0.0775330418F, 0.0777935616F, 0.0780544909F, 0.0783158298F,
194.1211 +  0.0785775778F, 0.0788397349F, 0.0791023009F, 0.0793652755F,
194.1212 +  0.0796286585F, 0.0798924498F, 0.0801566492F, 0.0804212564F,
194.1213 +  0.0806862712F, 0.0809516935F, 0.0812175231F, 0.0814837597F,
194.1214 +  0.0817504031F, 0.0820174532F, 0.0822849097F, 0.0825527724F,
194.1215 +  0.0828210412F, 0.0830897158F, 0.0833587960F, 0.0836282816F,
194.1216 +  0.0838981724F, 0.0841684682F, 0.0844391688F, 0.0847102740F,
194.1217 +  0.0849817835F, 0.0852536973F, 0.0855260150F, 0.0857987364F,
194.1218 +  0.0860718614F, 0.0863453897F, 0.0866193211F, 0.0868936554F,
194.1219 +  0.0871683924F, 0.0874435319F, 0.0877190737F, 0.0879950175F,
194.1220 +  0.0882713632F, 0.0885481105F, 0.0888252592F, 0.0891028091F,
194.1221 +  0.0893807600F, 0.0896591117F, 0.0899378639F, 0.0902170165F,
194.1222 +  0.0904965692F, 0.0907765218F, 0.0910568740F, 0.0913376258F,
194.1223 +  0.0916187767F, 0.0919003268F, 0.0921822756F, 0.0924646230F,
194.1224 +  0.0927473687F, 0.0930305126F, 0.0933140545F, 0.0935979940F,
194.1225 +  0.0938823310F, 0.0941670653F, 0.0944521966F, 0.0947377247F,
194.1226 +  0.0950236494F, 0.0953099704F, 0.0955966876F, 0.0958838007F,
194.1227 +  0.0961713094F, 0.0964592136F, 0.0967475131F, 0.0970362075F,
194.1228 +  0.0973252967F, 0.0976147805F, 0.0979046585F, 0.0981949307F,
194.1229 +  0.0984855967F, 0.0987766563F, 0.0990681093F, 0.0993599555F,
194.1230 +  0.0996521945F, 0.0999448263F, 0.1002378506F, 0.1005312671F,
194.1231 +  0.1008250755F, 0.1011192757F, 0.1014138675F, 0.1017088505F,
194.1232 +  0.1020042246F, 0.1022999895F, 0.1025961450F, 0.1028926909F,
194.1233 +  0.1031896268F, 0.1034869526F, 0.1037846680F, 0.1040827729F,
194.1234 +  0.1043812668F, 0.1046801497F, 0.1049794213F, 0.1052790813F,
194.1235 +  0.1055791294F, 0.1058795656F, 0.1061803894F, 0.1064816006F,
194.1236 +  0.1067831991F, 0.1070851846F, 0.1073875568F, 0.1076903155F,
194.1237 +  0.1079934604F, 0.1082969913F, 0.1086009079F, 0.1089052101F,
194.1238 +  0.1092098975F, 0.1095149699F, 0.1098204270F, 0.1101262687F,
194.1239 +  0.1104324946F, 0.1107391045F, 0.1110460982F, 0.1113534754F,
194.1240 +  0.1116612359F, 0.1119693793F, 0.1122779055F, 0.1125868142F,
194.1241 +  0.1128961052F, 0.1132057781F, 0.1135158328F, 0.1138262690F,
194.1242 +  0.1141370863F, 0.1144482847F, 0.1147598638F, 0.1150718233F,
194.1243 +  0.1153841631F, 0.1156968828F, 0.1160099822F, 0.1163234610F,
194.1244 +  0.1166373190F, 0.1169515559F, 0.1172661714F, 0.1175811654F,
194.1245 +  0.1178965374F, 0.1182122874F, 0.1185284149F, 0.1188449198F,
194.1246 +  0.1191618018F, 0.1194790606F, 0.1197966960F, 0.1201147076F,
194.1247 +  0.1204330953F, 0.1207518587F, 0.1210709976F, 0.1213905118F,
194.1248 +  0.1217104009F, 0.1220306647F, 0.1223513029F, 0.1226723153F,
194.1249 +  0.1229937016F, 0.1233154615F, 0.1236375948F, 0.1239601011F,
194.1250 +  0.1242829803F, 0.1246062319F, 0.1249298559F, 0.1252538518F,
194.1251 +  0.1255782195F, 0.1259029586F, 0.1262280689F, 0.1265535501F,
194.1252 +  0.1268794019F, 0.1272056241F, 0.1275322163F, 0.1278591784F,
194.1253 +  0.1281865099F, 0.1285142108F, 0.1288422805F, 0.1291707190F,
194.1254 +  0.1294995259F, 0.1298287009F, 0.1301582437F, 0.1304881542F,
194.1255 +  0.1308184319F, 0.1311490766F, 0.1314800881F, 0.1318114660F,
194.1256 +  0.1321432100F, 0.1324753200F, 0.1328077955F, 0.1331406364F,
194.1257 +  0.1334738422F, 0.1338074129F, 0.1341413479F, 0.1344756472F,
194.1258 +  0.1348103103F, 0.1351453370F, 0.1354807270F, 0.1358164801F,
194.1259 +  0.1361525959F, 0.1364890741F, 0.1368259145F, 0.1371631167F,
194.1260 +  0.1375006805F, 0.1378386056F, 0.1381768917F, 0.1385155384F,
194.1261 +  0.1388545456F, 0.1391939129F, 0.1395336400F, 0.1398737266F,
194.1262 +  0.1402141724F, 0.1405549772F, 0.1408961406F, 0.1412376623F,
194.1263 +  0.1415795421F, 0.1419217797F, 0.1422643746F, 0.1426073268F,
194.1264 +  0.1429506358F, 0.1432943013F, 0.1436383231F, 0.1439827008F,
194.1265 +  0.1443274342F, 0.1446725229F, 0.1450179667F, 0.1453637652F,
194.1266 +  0.1457099181F, 0.1460564252F, 0.1464032861F, 0.1467505006F,
194.1267 +  0.1470980682F, 0.1474459888F, 0.1477942620F, 0.1481428875F,
194.1268 +  0.1484918651F, 0.1488411942F, 0.1491908748F, 0.1495409065F,
194.1269 +  0.1498912889F, 0.1502420218F, 0.1505931048F, 0.1509445376F,
194.1270 +  0.1512963200F, 0.1516484516F, 0.1520009321F, 0.1523537612F,
194.1271 +  0.1527069385F, 0.1530604638F, 0.1534143368F, 0.1537685571F,
194.1272 +  0.1541231244F, 0.1544780384F, 0.1548332987F, 0.1551889052F,
194.1273 +  0.1555448574F, 0.1559011550F, 0.1562577978F, 0.1566147853F,
194.1274 +  0.1569721173F, 0.1573297935F, 0.1576878135F, 0.1580461771F,
194.1275 +  0.1584048838F, 0.1587639334F, 0.1591233255F, 0.1594830599F,
194.1276 +  0.1598431361F, 0.1602035540F, 0.1605643131F, 0.1609254131F,
194.1277 +  0.1612868537F, 0.1616486346F, 0.1620107555F, 0.1623732160F,
194.1278 +  0.1627360158F, 0.1630991545F, 0.1634626319F, 0.1638264476F,
194.1279 +  0.1641906013F, 0.1645550926F, 0.1649199212F, 0.1652850869F,
194.1280 +  0.1656505892F, 0.1660164278F, 0.1663826024F, 0.1667491127F,
194.1281 +  0.1671159583F, 0.1674831388F, 0.1678506541F, 0.1682185036F,
194.1282 +  0.1685866872F, 0.1689552044F, 0.1693240549F, 0.1696932384F,
194.1283 +  0.1700627545F, 0.1704326029F, 0.1708027833F, 0.1711732952F,
194.1284 +  0.1715441385F, 0.1719153127F, 0.1722868175F, 0.1726586526F,
194.1285 +  0.1730308176F, 0.1734033121F, 0.1737761359F, 0.1741492886F,
194.1286 +  0.1745227698F, 0.1748965792F, 0.1752707164F, 0.1756451812F,
194.1287 +  0.1760199731F, 0.1763950918F, 0.1767705370F, 0.1771463083F,
194.1288 +  0.1775224054F, 0.1778988279F, 0.1782755754F, 0.1786526477F,
194.1289 +  0.1790300444F, 0.1794077651F, 0.1797858094F, 0.1801641771F,
194.1290 +  0.1805428677F, 0.1809218810F, 0.1813012165F, 0.1816808739F,
194.1291 +  0.1820608528F, 0.1824411530F, 0.1828217739F, 0.1832027154F,
194.1292 +  0.1835839770F, 0.1839655584F, 0.1843474592F, 0.1847296790F,
194.1293 +  0.1851122175F, 0.1854950744F, 0.1858782492F, 0.1862617417F,
194.1294 +  0.1866455514F, 0.1870296780F, 0.1874141211F, 0.1877988804F,
194.1295 +  0.1881839555F, 0.1885693461F, 0.1889550517F, 0.1893410721F,
194.1296 +  0.1897274068F, 0.1901140555F, 0.1905010178F, 0.1908882933F,
194.1297 +  0.1912758818F, 0.1916637828F, 0.1920519959F, 0.1924405208F,
194.1298 +  0.1928293571F, 0.1932185044F, 0.1936079625F, 0.1939977308F,
194.1299 +  0.1943878091F, 0.1947781969F, 0.1951688939F, 0.1955598998F,
194.1300 +  0.1959512141F, 0.1963428364F, 0.1967347665F, 0.1971270038F,
194.1301 +  0.1975195482F, 0.1979123990F, 0.1983055561F, 0.1986990190F,
194.1302 +  0.1990927873F, 0.1994868607F, 0.1998812388F, 0.2002759212F,
194.1303 +  0.2006709075F, 0.2010661974F, 0.2014617904F, 0.2018576862F,
194.1304 +  0.2022538844F, 0.2026503847F, 0.2030471865F, 0.2034442897F,
194.1305 +  0.2038416937F, 0.2042393982F, 0.2046374028F, 0.2050357071F,
194.1306 +  0.2054343107F, 0.2058332133F, 0.2062324145F, 0.2066319138F,
194.1307 +  0.2070317110F, 0.2074318055F, 0.2078321970F, 0.2082328852F,
194.1308 +  0.2086338696F, 0.2090351498F, 0.2094367255F, 0.2098385962F,
194.1309 +  0.2102407617F, 0.2106432213F, 0.2110459749F, 0.2114490220F,
194.1310 +  0.2118523621F, 0.2122559950F, 0.2126599202F, 0.2130641373F,
194.1311 +  0.2134686459F, 0.2138734456F, 0.2142785361F, 0.2146839168F,
194.1312 +  0.2150895875F, 0.2154955478F, 0.2159017972F, 0.2163083353F,
194.1313 +  0.2167151617F, 0.2171222761F, 0.2175296780F, 0.2179373670F,
194.1314 +  0.2183453428F, 0.2187536049F, 0.2191621529F, 0.2195709864F,
194.1315 +  0.2199801051F, 0.2203895085F, 0.2207991961F, 0.2212091677F,
194.1316 +  0.2216194228F, 0.2220299610F, 0.2224407818F, 0.2228518850F,
194.1317 +  0.2232632699F, 0.2236749364F, 0.2240868839F, 0.2244991121F,
194.1318 +  0.2249116204F, 0.2253244086F, 0.2257374763F, 0.2261508229F,
194.1319 +  0.2265644481F, 0.2269783514F, 0.2273925326F, 0.2278069911F,
194.1320 +  0.2282217265F, 0.2286367384F, 0.2290520265F, 0.2294675902F,
194.1321 +  0.2298834292F, 0.2302995431F, 0.2307159314F, 0.2311325937F,
194.1322 +  0.2315495297F, 0.2319667388F, 0.2323842207F, 0.2328019749F,
194.1323 +  0.2332200011F, 0.2336382988F, 0.2340568675F, 0.2344757070F,
194.1324 +  0.2348948166F, 0.2353141961F, 0.2357338450F, 0.2361537629F,
194.1325 +  0.2365739493F, 0.2369944038F, 0.2374151261F, 0.2378361156F,
194.1326 +  0.2382573720F, 0.2386788948F, 0.2391006836F, 0.2395227380F,
194.1327 +  0.2399450575F, 0.2403676417F, 0.2407904902F, 0.2412136026F,
194.1328 +  0.2416369783F, 0.2420606171F, 0.2424845185F, 0.2429086820F,
194.1329 +  0.2433331072F, 0.2437577936F, 0.2441827409F, 0.2446079486F,
194.1330 +  0.2450334163F, 0.2454591435F, 0.2458851298F, 0.2463113747F,
194.1331 +  0.2467378779F, 0.2471646389F, 0.2475916573F, 0.2480189325F,
194.1332 +  0.2484464643F, 0.2488742521F, 0.2493022955F, 0.2497305940F,
194.1333 +  0.2501591473F, 0.2505879549F, 0.2510170163F, 0.2514463311F,
194.1334 +  0.2518758989F, 0.2523057193F, 0.2527357916F, 0.2531661157F,
194.1335 +  0.2535966909F, 0.2540275169F, 0.2544585931F, 0.2548899193F,
194.1336 +  0.2553214948F, 0.2557533193F, 0.2561853924F, 0.2566177135F,
194.1337 +  0.2570502822F, 0.2574830981F, 0.2579161608F, 0.2583494697F,
194.1338 +  0.2587830245F, 0.2592168246F, 0.2596508697F, 0.2600851593F,
194.1339 +  0.2605196929F, 0.2609544701F, 0.2613894904F, 0.2618247534F,
194.1340 +  0.2622602586F, 0.2626960055F, 0.2631319938F, 0.2635682230F,
194.1341 +  0.2640046925F, 0.2644414021F, 0.2648783511F, 0.2653155391F,
194.1342 +  0.2657529657F, 0.2661906305F, 0.2666285329F, 0.2670666725F,
194.1343 +  0.2675050489F, 0.2679436616F, 0.2683825101F, 0.2688215940F,
194.1344 +  0.2692609127F, 0.2697004660F, 0.2701402532F, 0.2705802739F,
194.1345 +  0.2710205278F, 0.2714610142F, 0.2719017327F, 0.2723426830F,
194.1346 +  0.2727838644F, 0.2732252766F, 0.2736669191F, 0.2741087914F,
194.1347 +  0.2745508930F, 0.2749932235F, 0.2754357824F, 0.2758785693F,
194.1348 +  0.2763215837F, 0.2767648251F, 0.2772082930F, 0.2776519870F,
194.1349 +  0.2780959066F, 0.2785400513F, 0.2789844207F, 0.2794290143F,
194.1350 +  0.2798738316F, 0.2803188722F, 0.2807641355F, 0.2812096211F,
194.1351 +  0.2816553286F, 0.2821012574F, 0.2825474071F, 0.2829937773F,
194.1352 +  0.2834403673F, 0.2838871768F, 0.2843342053F, 0.2847814523F,
194.1353 +  0.2852289174F, 0.2856765999F, 0.2861244996F, 0.2865726159F,
194.1354 +  0.2870209482F, 0.2874694962F, 0.2879182594F, 0.2883672372F,
194.1355 +  0.2888164293F, 0.2892658350F, 0.2897154540F, 0.2901652858F,
194.1356 +  0.2906153298F, 0.2910655856F, 0.2915160527F, 0.2919667306F,
194.1357 +  0.2924176189F, 0.2928687171F, 0.2933200246F, 0.2937715409F,
194.1358 +  0.2942232657F, 0.2946751984F, 0.2951273386F, 0.2955796856F,
194.1359 +  0.2960322391F, 0.2964849986F, 0.2969379636F, 0.2973911335F,
194.1360 +  0.2978445080F, 0.2982980864F, 0.2987518684F, 0.2992058534F,
194.1361 +  0.2996600409F, 0.3001144305F, 0.3005690217F, 0.3010238139F,
194.1362 +  0.3014788067F, 0.3019339995F, 0.3023893920F, 0.3028449835F,
194.1363 +  0.3033007736F, 0.3037567618F, 0.3042129477F, 0.3046693306F,
194.1364 +  0.3051259102F, 0.3055826859F, 0.3060396572F, 0.3064968236F,
194.1365 +  0.3069541847F, 0.3074117399F, 0.3078694887F, 0.3083274307F,
194.1366 +  0.3087855653F, 0.3092438920F, 0.3097024104F, 0.3101611199F,
194.1367 +  0.3106200200F, 0.3110791103F, 0.3115383902F, 0.3119978592F,
194.1368 +  0.3124575169F, 0.3129173627F, 0.3133773961F, 0.3138376166F,
194.1369 +  0.3142980238F, 0.3147586170F, 0.3152193959F, 0.3156803598F,
194.1370 +  0.3161415084F, 0.3166028410F, 0.3170643573F, 0.3175260566F,
194.1371 +  0.3179879384F, 0.3184500023F, 0.3189122478F, 0.3193746743F,
194.1372 +  0.3198372814F, 0.3203000685F, 0.3207630351F, 0.3212261807F,
194.1373 +  0.3216895048F, 0.3221530069F, 0.3226166865F, 0.3230805430F,
194.1374 +  0.3235445760F, 0.3240087849F, 0.3244731693F, 0.3249377285F,
194.1375 +  0.3254024622F, 0.3258673698F, 0.3263324507F, 0.3267977045F,
194.1376 +  0.3272631306F, 0.3277287286F, 0.3281944978F, 0.3286604379F,
194.1377 +  0.3291265482F, 0.3295928284F, 0.3300592777F, 0.3305258958F,
194.1378 +  0.3309926821F, 0.3314596361F, 0.3319267573F, 0.3323940451F,
194.1379 +  0.3328614990F, 0.3333291186F, 0.3337969033F, 0.3342648525F,
194.1380 +  0.3347329658F, 0.3352012427F, 0.3356696825F, 0.3361382849F,
194.1381 +  0.3366070492F, 0.3370759749F, 0.3375450616F, 0.3380143087F,
194.1382 +  0.3384837156F, 0.3389532819F, 0.3394230071F, 0.3398928905F,
194.1383 +  0.3403629317F, 0.3408331302F, 0.3413034854F, 0.3417739967F,
194.1384 +  0.3422446638F, 0.3427154860F, 0.3431864628F, 0.3436575938F,
194.1385 +  0.3441288782F, 0.3446003158F, 0.3450719058F, 0.3455436478F,
194.1386 +  0.3460155412F, 0.3464875856F, 0.3469597804F, 0.3474321250F,
194.1387 +  0.3479046189F, 0.3483772617F, 0.3488500527F, 0.3493229914F,
194.1388 +  0.3497960774F, 0.3502693100F, 0.3507426887F, 0.3512162131F,
194.1389 +  0.3516898825F, 0.3521636965F, 0.3526376545F, 0.3531117559F,
194.1390 +  0.3535860003F, 0.3540603870F, 0.3545349157F, 0.3550095856F,
194.1391 +  0.3554843964F, 0.3559593474F, 0.3564344381F, 0.3569096680F,
194.1392 +  0.3573850366F, 0.3578605432F, 0.3583361875F, 0.3588119687F,
194.1393 +  0.3592878865F, 0.3597639402F, 0.3602401293F, 0.3607164533F,
194.1394 +  0.3611929117F, 0.3616695038F, 0.3621462292F, 0.3626230873F,
194.1395 +  0.3631000776F, 0.3635771995F, 0.3640544525F, 0.3645318360F,
194.1396 +  0.3650093496F, 0.3654869926F, 0.3659647645F, 0.3664426648F,
194.1397 +  0.3669206930F, 0.3673988484F, 0.3678771306F, 0.3683555390F,
194.1398 +  0.3688340731F, 0.3693127322F, 0.3697915160F, 0.3702704237F,
194.1399 +  0.3707494549F, 0.3712286091F, 0.3717078857F, 0.3721872840F,
194.1400 +  0.3726668037F, 0.3731464441F, 0.3736262047F, 0.3741060850F,
194.1401 +  0.3745860843F, 0.3750662023F, 0.3755464382F, 0.3760267915F,
194.1402 +  0.3765072618F, 0.3769878484F, 0.3774685509F, 0.3779493686F,
194.1403 +  0.3784303010F, 0.3789113475F, 0.3793925076F, 0.3798737809F,
194.1404 +  0.3803551666F, 0.3808366642F, 0.3813182733F, 0.3817999932F,
194.1405 +  0.3822818234F, 0.3827637633F, 0.3832458124F, 0.3837279702F,
194.1406 +  0.3842102360F, 0.3846926093F, 0.3851750897F, 0.3856576764F,
194.1407 +  0.3861403690F, 0.3866231670F, 0.3871060696F, 0.3875890765F,
194.1408 +  0.3880721870F, 0.3885554007F, 0.3890387168F, 0.3895221349F,
194.1409 +  0.3900056544F, 0.3904892748F, 0.3909729955F, 0.3914568160F,
194.1410 +  0.3919407356F, 0.3924247539F, 0.3929088702F, 0.3933930841F,
194.1411 +  0.3938773949F, 0.3943618021F, 0.3948463052F, 0.3953309035F,
194.1412 +  0.3958155966F, 0.3963003838F, 0.3967852646F, 0.3972702385F,
194.1413 +  0.3977553048F, 0.3982404631F, 0.3987257127F, 0.3992110531F,
194.1414 +  0.3996964838F, 0.4001820041F, 0.4006676136F, 0.4011533116F,
194.1415 +  0.4016390976F, 0.4021249710F, 0.4026109313F, 0.4030969779F,
194.1416 +  0.4035831102F, 0.4040693277F, 0.4045556299F, 0.4050420160F,
194.1417 +  0.4055284857F, 0.4060150383F, 0.4065016732F, 0.4069883899F,
194.1418 +  0.4074751879F, 0.4079620665F, 0.4084490252F, 0.4089360635F,
194.1419 +  0.4094231807F, 0.4099103763F, 0.4103976498F, 0.4108850005F,
194.1420 +  0.4113724280F, 0.4118599315F, 0.4123475107F, 0.4128351648F,
194.1421 +  0.4133228934F, 0.4138106959F, 0.4142985716F, 0.4147865201F,
194.1422 +  0.4152745408F, 0.4157626330F, 0.4162507963F, 0.4167390301F,
194.1423 +  0.4172273337F, 0.4177157067F, 0.4182041484F, 0.4186926583F,
194.1424 +  0.4191812359F, 0.4196698805F, 0.4201585915F, 0.4206473685F,
194.1425 +  0.4211362108F, 0.4216251179F, 0.4221140892F, 0.4226031241F,
194.1426 +  0.4230922221F, 0.4235813826F, 0.4240706050F, 0.4245598887F,
194.1427 +  0.4250492332F, 0.4255386379F, 0.4260281022F, 0.4265176256F,
194.1428 +  0.4270072075F, 0.4274968473F, 0.4279865445F, 0.4284762984F,
194.1429 +  0.4289661086F, 0.4294559743F, 0.4299458951F, 0.4304358704F,
194.1430 +  0.4309258996F, 0.4314159822F, 0.4319061175F, 0.4323963050F,
194.1431 +  0.4328865441F, 0.4333768342F, 0.4338671749F, 0.4343575654F,
194.1432 +  0.4348480052F, 0.4353384938F, 0.4358290306F, 0.4363196149F,
194.1433 +  0.4368102463F, 0.4373009241F, 0.4377916478F, 0.4382824168F,
194.1434 +  0.4387732305F, 0.4392640884F, 0.4397549899F, 0.4402459343F,
194.1435 +  0.4407369212F, 0.4412279499F, 0.4417190198F, 0.4422101305F,
194.1436 +  0.4427012813F, 0.4431924717F, 0.4436837010F, 0.4441749686F,
194.1437 +  0.4446662742F, 0.4451576169F, 0.4456489963F, 0.4461404118F,
194.1438 +  0.4466318628F, 0.4471233487F, 0.4476148690F, 0.4481064230F,
194.1439 +  0.4485980103F, 0.4490896302F, 0.4495812821F, 0.4500729654F,
194.1440 +  0.4505646797F, 0.4510564243F, 0.4515481986F, 0.4520400021F,
194.1441 +  0.4525318341F, 0.4530236942F, 0.4535155816F, 0.4540074959F,
194.1442 +  0.4544994365F, 0.4549914028F, 0.4554833941F, 0.4559754100F,
194.1443 +  0.4564674499F, 0.4569595131F, 0.4574515991F, 0.4579437074F,
194.1444 +  0.4584358372F, 0.4589279881F, 0.4594201595F, 0.4599123508F,
194.1445 +  0.4604045615F, 0.4608967908F, 0.4613890383F, 0.4618813034F,
194.1446 +  0.4623735855F, 0.4628658841F, 0.4633581984F, 0.4638505281F,
194.1447 +  0.4643428724F, 0.4648352308F, 0.4653276028F, 0.4658199877F,
194.1448 +  0.4663123849F, 0.4668047940F, 0.4672972143F, 0.4677896451F,
194.1449 +  0.4682820861F, 0.4687745365F, 0.4692669958F, 0.4697594634F,
194.1450 +  0.4702519387F, 0.4707444211F, 0.4712369102F, 0.4717294052F,
194.1451 +  0.4722219056F, 0.4727144109F, 0.4732069204F, 0.4736994336F,
194.1452 +  0.4741919498F, 0.4746844686F, 0.4751769893F, 0.4756695113F,
194.1453 +  0.4761620341F, 0.4766545571F, 0.4771470797F, 0.4776396013F,
194.1454 +  0.4781321213F, 0.4786246392F, 0.4791171544F, 0.4796096663F,
194.1455 +  0.4801021744F, 0.4805946779F, 0.4810871765F, 0.4815796694F,
194.1456 +  0.4820721561F, 0.4825646360F, 0.4830571086F, 0.4835495732F,
194.1457 +  0.4840420293F, 0.4845344763F, 0.4850269136F, 0.4855193407F,
194.1458 +  0.4860117569F, 0.4865041617F, 0.4869965545F, 0.4874889347F,
194.1459 +  0.4879813018F, 0.4884736551F, 0.4889659941F, 0.4894583182F,
194.1460 +  0.4899506268F, 0.4904429193F, 0.4909351952F, 0.4914274538F,
194.1461 +  0.4919196947F, 0.4924119172F, 0.4929041207F, 0.4933963046F,
194.1462 +  0.4938884685F, 0.4943806116F, 0.4948727335F, 0.4953648335F,
194.1463 +  0.4958569110F, 0.4963489656F, 0.4968409965F, 0.4973330032F,
194.1464 +  0.4978249852F, 0.4983169419F, 0.4988088726F, 0.4993007768F,
194.1465 +  0.4997926539F, 0.5002845034F, 0.5007763247F, 0.5012681171F,
194.1466 +  0.5017598801F, 0.5022516132F, 0.5027433157F, 0.5032349871F,
194.1467 +  0.5037266268F, 0.5042182341F, 0.5047098086F, 0.5052013497F,
194.1468 +  0.5056928567F, 0.5061843292F, 0.5066757664F, 0.5071671679F,
194.1469 +  0.5076585330F, 0.5081498613F, 0.5086411520F, 0.5091324047F,
194.1470 +  0.5096236187F, 0.5101147934F, 0.5106059284F, 0.5110970230F,
194.1471 +  0.5115880766F, 0.5120790887F, 0.5125700587F, 0.5130609860F,
194.1472 +  0.5135518700F, 0.5140427102F, 0.5145335059F, 0.5150242566F,
194.1473 +  0.5155149618F, 0.5160056208F, 0.5164962331F, 0.5169867980F,
194.1474 +  0.5174773151F, 0.5179677837F, 0.5184582033F, 0.5189485733F,
194.1475 +  0.5194388931F, 0.5199291621F, 0.5204193798F, 0.5209095455F,
194.1476 +  0.5213996588F, 0.5218897190F, 0.5223797256F, 0.5228696779F,
194.1477 +  0.5233595755F, 0.5238494177F, 0.5243392039F, 0.5248289337F,
194.1478 +  0.5253186063F, 0.5258082213F, 0.5262977781F, 0.5267872760F,
194.1479 +  0.5272767146F, 0.5277660932F, 0.5282554112F, 0.5287446682F,
194.1480 +  0.5292338635F, 0.5297229965F, 0.5302120667F, 0.5307010736F,
194.1481 +  0.5311900164F, 0.5316788947F, 0.5321677079F, 0.5326564554F,
194.1482 +  0.5331451366F, 0.5336337511F, 0.5341222981F, 0.5346107771F,
194.1483 +  0.5350991876F, 0.5355875290F, 0.5360758007F, 0.5365640021F,
194.1484 +  0.5370521327F, 0.5375401920F, 0.5380281792F, 0.5385160939F,
194.1485 +  0.5390039355F, 0.5394917034F, 0.5399793971F, 0.5404670159F,
194.1486 +  0.5409545594F, 0.5414420269F, 0.5419294179F, 0.5424167318F,
194.1487 +  0.5429039680F, 0.5433911261F, 0.5438782053F, 0.5443652051F,
194.1488 +  0.5448521250F, 0.5453389644F, 0.5458257228F, 0.5463123995F,
194.1489 +  0.5467989940F, 0.5472855057F, 0.5477719341F, 0.5482582786F,
194.1490 +  0.5487445387F, 0.5492307137F, 0.5497168031F, 0.5502028063F,
194.1491 +  0.5506887228F, 0.5511745520F, 0.5516602934F, 0.5521459463F,
194.1492 +  0.5526315103F, 0.5531169847F, 0.5536023690F, 0.5540876626F,
194.1493 +  0.5545728649F, 0.5550579755F, 0.5555429937F, 0.5560279189F,
194.1494 +  0.5565127507F, 0.5569974884F, 0.5574821315F, 0.5579666794F,
194.1495 +  0.5584511316F, 0.5589354875F, 0.5594197465F, 0.5599039080F,
194.1496 +  0.5603879716F, 0.5608719367F, 0.5613558026F, 0.5618395689F,
194.1497 +  0.5623232350F, 0.5628068002F, 0.5632902642F, 0.5637736262F,
194.1498 +  0.5642568858F, 0.5647400423F, 0.5652230953F, 0.5657060442F,
194.1499 +  0.5661888883F, 0.5666716272F, 0.5671542603F, 0.5676367870F,
194.1500 +  0.5681192069F, 0.5686015192F, 0.5690837235F, 0.5695658192F,
194.1501 +  0.5700478058F, 0.5705296827F, 0.5710114494F, 0.5714931052F,
194.1502 +  0.5719746497F, 0.5724560822F, 0.5729374023F, 0.5734186094F,
194.1503 +  0.5738997029F, 0.5743806823F, 0.5748615470F, 0.5753422965F,
194.1504 +  0.5758229301F, 0.5763034475F, 0.5767838480F, 0.5772641310F,
194.1505 +  0.5777442960F, 0.5782243426F, 0.5787042700F, 0.5791840778F,
194.1506 +  0.5796637654F, 0.5801433322F, 0.5806227778F, 0.5811021016F,
194.1507 +  0.5815813029F, 0.5820603814F, 0.5825393363F, 0.5830181673F,
194.1508 +  0.5834968737F, 0.5839754549F, 0.5844539105F, 0.5849322399F,
194.1509 +  0.5854104425F, 0.5858885179F, 0.5863664653F, 0.5868442844F,
194.1510 +  0.5873219746F, 0.5877995353F, 0.5882769660F, 0.5887542661F,
194.1511 +  0.5892314351F, 0.5897084724F, 0.5901853776F, 0.5906621500F,
194.1512 +  0.5911387892F, 0.5916152945F, 0.5920916655F, 0.5925679016F,
194.1513 +  0.5930440022F, 0.5935199669F, 0.5939957950F, 0.5944714861F,
194.1514 +  0.5949470396F, 0.5954224550F, 0.5958977317F, 0.5963728692F,
194.1515 +  0.5968478669F, 0.5973227244F, 0.5977974411F, 0.5982720163F,
194.1516 +  0.5987464497F, 0.5992207407F, 0.5996948887F, 0.6001688932F,
194.1517 +  0.6006427537F, 0.6011164696F, 0.6015900405F, 0.6020634657F,
194.1518 +  0.6025367447F, 0.6030098770F, 0.6034828621F, 0.6039556995F,
194.1519 +  0.6044283885F, 0.6049009288F, 0.6053733196F, 0.6058455606F,
194.1520 +  0.6063176512F, 0.6067895909F, 0.6072613790F, 0.6077330152F,
194.1521 +  0.6082044989F, 0.6086758295F, 0.6091470065F, 0.6096180294F,
194.1522 +  0.6100888977F, 0.6105596108F, 0.6110301682F, 0.6115005694F,
194.1523 +  0.6119708139F, 0.6124409011F, 0.6129108305F, 0.6133806017F,
194.1524 +  0.6138502139F, 0.6143196669F, 0.6147889599F, 0.6152580926F,
194.1525 +  0.6157270643F, 0.6161958746F, 0.6166645230F, 0.6171330088F,
194.1526 +  0.6176013317F, 0.6180694910F, 0.6185374863F, 0.6190053171F,
194.1527 +  0.6194729827F, 0.6199404828F, 0.6204078167F, 0.6208749841F,
194.1528 +  0.6213419842F, 0.6218088168F, 0.6222754811F, 0.6227419768F,
194.1529 +  0.6232083032F, 0.6236744600F, 0.6241404465F, 0.6246062622F,
194.1530 +  0.6250719067F, 0.6255373795F, 0.6260026799F, 0.6264678076F,
194.1531 +  0.6269327619F, 0.6273975425F, 0.6278621487F, 0.6283265800F,
194.1532 +  0.6287908361F, 0.6292549163F, 0.6297188201F, 0.6301825471F,
194.1533 +  0.6306460966F, 0.6311094683F, 0.6315726617F, 0.6320356761F,
194.1534 +  0.6324985111F, 0.6329611662F, 0.6334236410F, 0.6338859348F,
194.1535 +  0.6343480472F, 0.6348099777F, 0.6352717257F, 0.6357332909F,
194.1536 +  0.6361946726F, 0.6366558704F, 0.6371168837F, 0.6375777122F,
194.1537 +  0.6380383552F, 0.6384988123F, 0.6389590830F, 0.6394191668F,
194.1538 +  0.6398790631F, 0.6403387716F, 0.6407982916F, 0.6412576228F,
194.1539 +  0.6417167645F, 0.6421757163F, 0.6426344778F, 0.6430930483F,
194.1540 +  0.6435514275F, 0.6440096149F, 0.6444676098F, 0.6449254119F,
194.1541 +  0.6453830207F, 0.6458404356F, 0.6462976562F, 0.6467546820F,
194.1542 +  0.6472115125F, 0.6476681472F, 0.6481245856F, 0.6485808273F,
194.1543 +  0.6490368717F, 0.6494927183F, 0.6499483667F, 0.6504038164F,
194.1544 +  0.6508590670F, 0.6513141178F, 0.6517689684F, 0.6522236185F,
194.1545 +  0.6526780673F, 0.6531323146F, 0.6535863598F, 0.6540402024F,
194.1546 +  0.6544938419F, 0.6549472779F, 0.6554005099F, 0.6558535373F,
194.1547 +  0.6563063598F, 0.6567589769F, 0.6572113880F, 0.6576635927F,
194.1548 +  0.6581155906F, 0.6585673810F, 0.6590189637F, 0.6594703380F,
194.1549 +  0.6599215035F, 0.6603724598F, 0.6608232064F, 0.6612737427F,
194.1550 +  0.6617240684F, 0.6621741829F, 0.6626240859F, 0.6630737767F,
194.1551 +  0.6635232550F, 0.6639725202F, 0.6644215720F, 0.6648704098F,
194.1552 +  0.6653190332F, 0.6657674417F, 0.6662156348F, 0.6666636121F,
194.1553 +  0.6671113731F, 0.6675589174F, 0.6680062445F, 0.6684533538F,
194.1554 +  0.6689002450F, 0.6693469177F, 0.6697933712F, 0.6702396052F,
194.1555 +  0.6706856193F, 0.6711314129F, 0.6715769855F, 0.6720223369F,
194.1556 +  0.6724674664F, 0.6729123736F, 0.6733570581F, 0.6738015194F,
194.1557 +  0.6742457570F, 0.6746897706F, 0.6751335596F, 0.6755771236F,
194.1558 +  0.6760204621F, 0.6764635747F, 0.6769064609F, 0.6773491204F,
194.1559 +  0.6777915525F, 0.6782337570F, 0.6786757332F, 0.6791174809F,
194.1560 +  0.6795589995F, 0.6800002886F, 0.6804413477F, 0.6808821765F,
194.1561 +  0.6813227743F, 0.6817631409F, 0.6822032758F, 0.6826431785F,
194.1562 +  0.6830828485F, 0.6835222855F, 0.6839614890F, 0.6844004585F,
194.1563 +  0.6848391936F, 0.6852776939F, 0.6857159589F, 0.6861539883F,
194.1564 +  0.6865917815F, 0.6870293381F, 0.6874666576F, 0.6879037398F,
194.1565 +  0.6883405840F, 0.6887771899F, 0.6892135571F, 0.6896496850F,
194.1566 +  0.6900855733F, 0.6905212216F, 0.6909566294F, 0.6913917963F,
194.1567 +  0.6918267218F, 0.6922614055F, 0.6926958471F, 0.6931300459F,
194.1568 +  0.6935640018F, 0.6939977141F, 0.6944311825F, 0.6948644066F,
194.1569 +  0.6952973859F, 0.6957301200F, 0.6961626085F, 0.6965948510F,
194.1570 +  0.6970268470F, 0.6974585961F, 0.6978900980F, 0.6983213521F,
194.1571 +  0.6987523580F, 0.6991831154F, 0.6996136238F, 0.7000438828F,
194.1572 +  0.7004738921F, 0.7009036510F, 0.7013331594F, 0.7017624166F,
194.1573 +  0.7021914224F, 0.7026201763F, 0.7030486779F, 0.7034769268F,
194.1574 +  0.7039049226F, 0.7043326648F, 0.7047601531F, 0.7051873870F,
194.1575 +  0.7056143662F, 0.7060410902F, 0.7064675586F, 0.7068937711F,
194.1576 +  0.7073197271F, 0.7077454264F, 0.7081708684F, 0.7085960529F,
194.1577 +  0.7090209793F, 0.7094456474F, 0.7098700566F, 0.7102942066F,
194.1578 +  0.7107180970F, 0.7111417274F, 0.7115650974F, 0.7119882066F,
194.1579 +  0.7124110545F, 0.7128336409F, 0.7132559653F, 0.7136780272F,
194.1580 +  0.7140998264F, 0.7145213624F, 0.7149426348F, 0.7153636433F,
194.1581 +  0.7157843874F, 0.7162048668F, 0.7166250810F, 0.7170450296F,
194.1582 +  0.7174647124F, 0.7178841289F, 0.7183032786F, 0.7187221613F,
194.1583 +  0.7191407765F, 0.7195591239F, 0.7199772030F, 0.7203950135F,
194.1584 +  0.7208125550F, 0.7212298271F, 0.7216468294F, 0.7220635616F,
194.1585 +  0.7224800233F, 0.7228962140F, 0.7233121335F, 0.7237277813F,
194.1586 +  0.7241431571F, 0.7245582604F, 0.7249730910F, 0.7253876484F,
194.1587 +  0.7258019322F, 0.7262159422F, 0.7266296778F, 0.7270431388F,
194.1588 +  0.7274563247F, 0.7278692353F, 0.7282818700F, 0.7286942287F,
194.1589 +  0.7291063108F, 0.7295181160F, 0.7299296440F, 0.7303408944F,
194.1590 +  0.7307518669F, 0.7311625609F, 0.7315729763F, 0.7319831126F,
194.1591 +  0.7323929695F, 0.7328025466F, 0.7332118435F, 0.7336208600F,
194.1592 +  0.7340295955F, 0.7344380499F, 0.7348462226F, 0.7352541134F,
194.1593 +  0.7356617220F, 0.7360690478F, 0.7364760907F, 0.7368828502F,
194.1594 +  0.7372893259F, 0.7376955176F, 0.7381014249F, 0.7385070475F,
194.1595 +  0.7389123849F, 0.7393174368F, 0.7397222029F, 0.7401266829F,
194.1596 +  0.7405308763F, 0.7409347829F, 0.7413384023F, 0.7417417341F,
194.1597 +  0.7421447780F, 0.7425475338F, 0.7429500009F, 0.7433521791F,
194.1598 +  0.7437540681F, 0.7441556674F, 0.7445569769F, 0.7449579960F,
194.1599 +  0.7453587245F, 0.7457591621F, 0.7461593084F, 0.7465591631F,
194.1600 +  0.7469587259F, 0.7473579963F, 0.7477569741F, 0.7481556590F,
194.1601 +  0.7485540506F, 0.7489521486F, 0.7493499526F, 0.7497474623F,
194.1602 +  0.7501446775F, 0.7505415977F, 0.7509382227F, 0.7513345521F,
194.1603 +  0.7517305856F, 0.7521263229F, 0.7525217636F, 0.7529169074F,
194.1604 +  0.7533117541F, 0.7537063032F, 0.7541005545F, 0.7544945076F,
194.1605 +  0.7548881623F, 0.7552815182F, 0.7556745749F, 0.7560673323F,
194.1606 +  0.7564597899F, 0.7568519474F, 0.7572438046F, 0.7576353611F,
194.1607 +  0.7580266166F, 0.7584175708F, 0.7588082235F, 0.7591985741F,
194.1608 +  0.7595886226F, 0.7599783685F, 0.7603678116F, 0.7607569515F,
194.1609 +  0.7611457879F, 0.7615343206F, 0.7619225493F, 0.7623104735F,
194.1610 +  0.7626980931F, 0.7630854078F, 0.7634724171F, 0.7638591209F,
194.1611 +  0.7642455188F, 0.7646316106F, 0.7650173959F, 0.7654028744F,
194.1612 +  0.7657880459F, 0.7661729100F, 0.7665574664F, 0.7669417150F,
194.1613 +  0.7673256553F, 0.7677092871F, 0.7680926100F, 0.7684756239F,
194.1614 +  0.7688583284F, 0.7692407232F, 0.7696228080F, 0.7700045826F,
194.1615 +  0.7703860467F, 0.7707671999F, 0.7711480420F, 0.7715285728F,
194.1616 +  0.7719087918F, 0.7722886989F, 0.7726682938F, 0.7730475762F,
194.1617 +  0.7734265458F, 0.7738052023F, 0.7741835454F, 0.7745615750F,
194.1618 +  0.7749392906F, 0.7753166921F, 0.7756937791F, 0.7760705514F,
194.1619 +  0.7764470087F, 0.7768231508F, 0.7771989773F, 0.7775744880F,
194.1620 +  0.7779496827F, 0.7783245610F, 0.7786991227F, 0.7790733676F,
194.1621 +  0.7794472953F, 0.7798209056F, 0.7801941982F, 0.7805671729F,
194.1622 +  0.7809398294F, 0.7813121675F, 0.7816841869F, 0.7820558873F,
194.1623 +  0.7824272684F, 0.7827983301F, 0.7831690720F, 0.7835394940F,
194.1624 +  0.7839095957F, 0.7842793768F, 0.7846488373F, 0.7850179767F,
194.1625 +  0.7853867948F, 0.7857552914F, 0.7861234663F, 0.7864913191F,
194.1626 +  0.7868588497F, 0.7872260578F, 0.7875929431F, 0.7879595055F,
194.1627 +  0.7883257445F, 0.7886916601F, 0.7890572520F, 0.7894225198F,
194.1628 +  0.7897874635F, 0.7901520827F, 0.7905163772F, 0.7908803468F,
194.1629 +  0.7912439912F, 0.7916073102F, 0.7919703035F, 0.7923329710F,
194.1630 +  0.7926953124F, 0.7930573274F, 0.7934190158F, 0.7937803774F,
194.1631 +  0.7941414120F, 0.7945021193F, 0.7948624991F, 0.7952225511F,
194.1632 +  0.7955822752F, 0.7959416711F, 0.7963007387F, 0.7966594775F,
194.1633 +  0.7970178875F, 0.7973759685F, 0.7977337201F, 0.7980911422F,
194.1634 +  0.7984482346F, 0.7988049970F, 0.7991614292F, 0.7995175310F,
194.1635 +  0.7998733022F, 0.8002287426F, 0.8005838519F, 0.8009386299F,
194.1636 +  0.8012930765F, 0.8016471914F, 0.8020009744F, 0.8023544253F,
194.1637 +  0.8027075438F, 0.8030603298F, 0.8034127831F, 0.8037649035F,
194.1638 +  0.8041166906F, 0.8044681445F, 0.8048192647F, 0.8051700512F,
194.1639 +  0.8055205038F, 0.8058706222F, 0.8062204062F, 0.8065698556F,
194.1640 +  0.8069189702F, 0.8072677499F, 0.8076161944F, 0.8079643036F,
194.1641 +  0.8083120772F, 0.8086595151F, 0.8090066170F, 0.8093533827F,
194.1642 +  0.8096998122F, 0.8100459051F, 0.8103916613F, 0.8107370806F,
194.1643 +  0.8110821628F, 0.8114269077F, 0.8117713151F, 0.8121153849F,
194.1644 +  0.8124591169F, 0.8128025108F, 0.8131455666F, 0.8134882839F,
194.1645 +  0.8138306627F, 0.8141727027F, 0.8145144038F, 0.8148557658F,
194.1646 +  0.8151967886F, 0.8155374718F, 0.8158778154F, 0.8162178192F,
194.1647 +  0.8165574830F, 0.8168968067F, 0.8172357900F, 0.8175744328F,
194.1648 +  0.8179127349F, 0.8182506962F, 0.8185883164F, 0.8189255955F,
194.1649 +  0.8192625332F, 0.8195991295F, 0.8199353840F, 0.8202712967F,
194.1650 +  0.8206068673F, 0.8209420958F, 0.8212769820F, 0.8216115256F,
194.1651 +  0.8219457266F, 0.8222795848F, 0.8226131000F, 0.8229462721F,
194.1652 +  0.8232791009F, 0.8236115863F, 0.8239437280F, 0.8242755260F,
194.1653 +  0.8246069801F, 0.8249380901F, 0.8252688559F, 0.8255992774F,
194.1654 +  0.8259293544F, 0.8262590867F, 0.8265884741F, 0.8269175167F,
194.1655 +  0.8272462141F, 0.8275745663F, 0.8279025732F, 0.8282302344F,
194.1656 +  0.8285575501F, 0.8288845199F, 0.8292111437F, 0.8295374215F,
194.1657 +  0.8298633530F, 0.8301889382F, 0.8305141768F, 0.8308390688F,
194.1658 +  0.8311636141F, 0.8314878124F, 0.8318116637F, 0.8321351678F,
194.1659 +  0.8324583246F, 0.8327811340F, 0.8331035957F, 0.8334257098F,
194.1660 +  0.8337474761F, 0.8340688944F, 0.8343899647F, 0.8347106867F,
194.1661 +  0.8350310605F, 0.8353510857F, 0.8356707624F, 0.8359900904F,
194.1662 +  0.8363090696F, 0.8366276999F, 0.8369459811F, 0.8372639131F,
194.1663 +  0.8375814958F, 0.8378987292F, 0.8382156130F, 0.8385321472F,
194.1664 +  0.8388483316F, 0.8391641662F, 0.8394796508F, 0.8397947853F,
194.1665 +  0.8401095697F, 0.8404240037F, 0.8407380873F, 0.8410518204F,
194.1666 +  0.8413652029F, 0.8416782347F, 0.8419909156F, 0.8423032456F,
194.1667 +  0.8426152245F, 0.8429268523F, 0.8432381289F, 0.8435490541F,
194.1668 +  0.8438596279F, 0.8441698502F, 0.8444797208F, 0.8447892396F,
194.1669 +  0.8450984067F, 0.8454072218F, 0.8457156849F, 0.8460237959F,
194.1670 +  0.8463315547F, 0.8466389612F, 0.8469460154F, 0.8472527170F,
194.1671 +  0.8475590661F, 0.8478650625F, 0.8481707063F, 0.8484759971F,
194.1672 +  0.8487809351F, 0.8490855201F, 0.8493897521F, 0.8496936308F,
194.1673 +  0.8499971564F, 0.8503003286F, 0.8506031474F, 0.8509056128F,
194.1674 +  0.8512077246F, 0.8515094828F, 0.8518108872F, 0.8521119379F,
194.1675 +  0.8524126348F, 0.8527129777F, 0.8530129666F, 0.8533126015F,
194.1676 +  0.8536118822F, 0.8539108087F, 0.8542093809F, 0.8545075988F,
194.1677 +  0.8548054623F, 0.8551029712F, 0.8554001257F, 0.8556969255F,
194.1678 +  0.8559933707F, 0.8562894611F, 0.8565851968F, 0.8568805775F,
194.1679 +  0.8571756034F, 0.8574702743F, 0.8577645902F, 0.8580585509F,
194.1680 +  0.8583521566F, 0.8586454070F, 0.8589383021F, 0.8592308420F,
194.1681 +  0.8595230265F, 0.8598148556F, 0.8601063292F, 0.8603974473F,
194.1682 +  0.8606882098F, 0.8609786167F, 0.8612686680F, 0.8615583636F,
194.1683 +  0.8618477034F, 0.8621366874F, 0.8624253156F, 0.8627135878F,
194.1684 +  0.8630015042F, 0.8632890646F, 0.8635762690F, 0.8638631173F,
194.1685 +  0.8641496096F, 0.8644357457F, 0.8647215257F, 0.8650069495F,
194.1686 +  0.8652920171F, 0.8655767283F, 0.8658610833F, 0.8661450820F,
194.1687 +  0.8664287243F, 0.8667120102F, 0.8669949397F, 0.8672775127F,
194.1688 +  0.8675597293F, 0.8678415894F, 0.8681230929F, 0.8684042398F,
194.1689 +  0.8686850302F, 0.8689654640F, 0.8692455412F, 0.8695252617F,
194.1690 +  0.8698046255F, 0.8700836327F, 0.8703622831F, 0.8706405768F,
194.1691 +  0.8709185138F, 0.8711960940F, 0.8714733174F, 0.8717501840F,
194.1692 +  0.8720266939F, 0.8723028469F, 0.8725786430F, 0.8728540824F,
194.1693 +  0.8731291648F, 0.8734038905F, 0.8736782592F, 0.8739522711F,
194.1694 +  0.8742259261F, 0.8744992242F, 0.8747721653F, 0.8750447496F,
194.1695 +  0.8753169770F, 0.8755888475F, 0.8758603611F, 0.8761315177F,
194.1696 +  0.8764023175F, 0.8766727603F, 0.8769428462F, 0.8772125752F,
194.1697 +  0.8774819474F, 0.8777509626F, 0.8780196209F, 0.8782879224F,
194.1698 +  0.8785558669F, 0.8788234546F, 0.8790906854F, 0.8793575594F,
194.1699 +  0.8796240765F, 0.8798902368F, 0.8801560403F, 0.8804214870F,
194.1700 +  0.8806865768F, 0.8809513099F, 0.8812156863F, 0.8814797059F,
194.1701 +  0.8817433687F, 0.8820066749F, 0.8822696243F, 0.8825322171F,
194.1702 +  0.8827944532F, 0.8830563327F, 0.8833178556F, 0.8835790219F,
194.1703 +  0.8838398316F, 0.8841002848F, 0.8843603815F, 0.8846201217F,
194.1704 +  0.8848795054F, 0.8851385327F, 0.8853972036F, 0.8856555182F,
194.1705 +  0.8859134764F, 0.8861710783F, 0.8864283239F, 0.8866852133F,
194.1706 +  0.8869417464F, 0.8871979234F, 0.8874537443F, 0.8877092090F,
194.1707 +  0.8879643177F, 0.8882190704F, 0.8884734671F, 0.8887275078F,
194.1708 +  0.8889811927F, 0.8892345216F, 0.8894874948F, 0.8897401122F,
194.1709 +  0.8899923738F, 0.8902442798F, 0.8904958301F, 0.8907470248F,
194.1710 +  0.8909978640F, 0.8912483477F, 0.8914984759F, 0.8917482487F,
194.1711 +  0.8919976662F, 0.8922467284F, 0.8924954353F, 0.8927437871F,
194.1712 +  0.8929917837F, 0.8932394252F, 0.8934867118F, 0.8937336433F,
194.1713 +  0.8939802199F, 0.8942264417F, 0.8944723087F, 0.8947178210F,
194.1714 +  0.8949629785F, 0.8952077815F, 0.8954522299F, 0.8956963239F,
194.1715 +  0.8959400634F, 0.8961834486F, 0.8964264795F, 0.8966691561F,
194.1716 +  0.8969114786F, 0.8971534470F, 0.8973950614F, 0.8976363219F,
194.1717 +  0.8978772284F, 0.8981177812F, 0.8983579802F, 0.8985978256F,
194.1718 +  0.8988373174F, 0.8990764556F, 0.8993152405F, 0.8995536720F,
194.1719 +  0.8997917502F, 0.9000294751F, 0.9002668470F, 0.9005038658F,
194.1720 +  0.9007405317F, 0.9009768446F, 0.9012128048F, 0.9014484123F,
194.1721 +  0.9016836671F, 0.9019185693F, 0.9021531191F, 0.9023873165F,
194.1722 +  0.9026211616F, 0.9028546546F, 0.9030877954F, 0.9033205841F,
194.1723 +  0.9035530210F, 0.9037851059F, 0.9040168392F, 0.9042482207F,
194.1724 +  0.9044792507F, 0.9047099293F, 0.9049402564F, 0.9051702323F,
194.1725 +  0.9053998569F, 0.9056291305F, 0.9058580531F, 0.9060866248F,
194.1726 +  0.9063148457F, 0.9065427159F, 0.9067702355F, 0.9069974046F,
194.1727 +  0.9072242233F, 0.9074506917F, 0.9076768100F, 0.9079025782F,
194.1728 +  0.9081279964F, 0.9083530647F, 0.9085777833F, 0.9088021523F,
194.1729 +  0.9090261717F, 0.9092498417F, 0.9094731623F, 0.9096961338F,
194.1730 +  0.9099187561F, 0.9101410295F, 0.9103629540F, 0.9105845297F,
194.1731 +  0.9108057568F, 0.9110266354F, 0.9112471656F, 0.9114673475F,
194.1732 +  0.9116871812F, 0.9119066668F, 0.9121258046F, 0.9123445945F,
194.1733 +  0.9125630367F, 0.9127811314F, 0.9129988786F, 0.9132162785F,
194.1734 +  0.9134333312F, 0.9136500368F, 0.9138663954F, 0.9140824073F,
194.1735 +  0.9142980724F, 0.9145133910F, 0.9147283632F, 0.9149429890F,
194.1736 +  0.9151572687F, 0.9153712023F, 0.9155847900F, 0.9157980319F,
194.1737 +  0.9160109282F, 0.9162234790F, 0.9164356844F, 0.9166475445F,
194.1738 +  0.9168590595F, 0.9170702296F, 0.9172810548F, 0.9174915354F,
194.1739 +  0.9177016714F, 0.9179114629F, 0.9181209102F, 0.9183300134F,
194.1740 +  0.9185387726F, 0.9187471879F, 0.9189552595F, 0.9191629876F,
194.1741 +  0.9193703723F, 0.9195774136F, 0.9197841119F, 0.9199904672F,
194.1742 +  0.9201964797F, 0.9204021495F, 0.9206074767F, 0.9208124616F,
194.1743 +  0.9210171043F, 0.9212214049F, 0.9214253636F, 0.9216289805F,
194.1744 +  0.9218322558F, 0.9220351896F, 0.9222377821F, 0.9224400335F,
194.1745 +  0.9226419439F, 0.9228435134F, 0.9230447423F, 0.9232456307F,
194.1746 +  0.9234461787F, 0.9236463865F, 0.9238462543F, 0.9240457822F,
194.1747 +  0.9242449704F, 0.9244438190F, 0.9246423282F, 0.9248404983F,
194.1748 +  0.9250383293F, 0.9252358214F, 0.9254329747F, 0.9256297896F,
194.1749 +  0.9258262660F, 0.9260224042F, 0.9262182044F, 0.9264136667F,
194.1750 +  0.9266087913F, 0.9268035783F, 0.9269980280F, 0.9271921405F,
194.1751 +  0.9273859160F, 0.9275793546F, 0.9277724566F, 0.9279652221F,
194.1752 +  0.9281576513F, 0.9283497443F, 0.9285415014F, 0.9287329227F,
194.1753 +  0.9289240084F, 0.9291147586F, 0.9293051737F, 0.9294952536F,
194.1754 +  0.9296849987F, 0.9298744091F, 0.9300634850F, 0.9302522266F,
194.1755 +  0.9304406340F, 0.9306287074F, 0.9308164471F, 0.9310038532F,
194.1756 +  0.9311909259F, 0.9313776654F, 0.9315640719F, 0.9317501455F,
194.1757 +  0.9319358865F, 0.9321212951F, 0.9323063713F, 0.9324911155F,
194.1758 +  0.9326755279F, 0.9328596085F, 0.9330433577F, 0.9332267756F,
194.1759 +  0.9334098623F, 0.9335926182F, 0.9337750434F, 0.9339571380F,
194.1760 +  0.9341389023F, 0.9343203366F, 0.9345014409F, 0.9346822155F,
194.1761 +  0.9348626606F, 0.9350427763F, 0.9352225630F, 0.9354020207F,
194.1762 +  0.9355811498F, 0.9357599503F, 0.9359384226F, 0.9361165667F,
194.1763 +  0.9362943830F, 0.9364718716F, 0.9366490327F, 0.9368258666F,
194.1764 +  0.9370023733F, 0.9371785533F, 0.9373544066F, 0.9375299335F,
194.1765 +  0.9377051341F, 0.9378800087F, 0.9380545576F, 0.9382287809F,
194.1766 +  0.9384026787F, 0.9385762515F, 0.9387494993F, 0.9389224223F,
194.1767 +  0.9390950209F, 0.9392672951F, 0.9394392453F, 0.9396108716F,
194.1768 +  0.9397821743F, 0.9399531536F, 0.9401238096F, 0.9402941427F,
194.1769 +  0.9404641530F, 0.9406338407F, 0.9408032061F, 0.9409722495F,
194.1770 +  0.9411409709F, 0.9413093707F, 0.9414774491F, 0.9416452062F,
194.1771 +  0.9418126424F, 0.9419797579F, 0.9421465528F, 0.9423130274F,
194.1772 +  0.9424791819F, 0.9426450166F, 0.9428105317F, 0.9429757274F,
194.1773 +  0.9431406039F, 0.9433051616F, 0.9434694005F, 0.9436333209F,
194.1774 +  0.9437969232F, 0.9439602074F, 0.9441231739F, 0.9442858229F,
194.1775 +  0.9444481545F, 0.9446101691F, 0.9447718669F, 0.9449332481F,
194.1776 +  0.9450943129F, 0.9452550617F, 0.9454154945F, 0.9455756118F,
194.1777 +  0.9457354136F, 0.9458949003F, 0.9460540721F, 0.9462129292F,
194.1778 +  0.9463714719F, 0.9465297003F, 0.9466876149F, 0.9468452157F,
194.1779 +  0.9470025031F, 0.9471594772F, 0.9473161384F, 0.9474724869F,
194.1780 +  0.9476285229F, 0.9477842466F, 0.9479396584F, 0.9480947585F,
194.1781 +  0.9482495470F, 0.9484040243F, 0.9485581906F, 0.9487120462F,
194.1782 +  0.9488655913F, 0.9490188262F, 0.9491717511F, 0.9493243662F,
194.1783 +  0.9494766718F, 0.9496286683F, 0.9497803557F, 0.9499317345F,
194.1784 +  0.9500828047F, 0.9502335668F, 0.9503840209F, 0.9505341673F,
194.1785 +  0.9506840062F, 0.9508335380F, 0.9509827629F, 0.9511316810F,
194.1786 +  0.9512802928F, 0.9514285984F, 0.9515765982F, 0.9517242923F,
194.1787 +  0.9518716810F, 0.9520187646F, 0.9521655434F, 0.9523120176F,
194.1788 +  0.9524581875F, 0.9526040534F, 0.9527496154F, 0.9528948739F,
194.1789 +  0.9530398292F, 0.9531844814F, 0.9533288310F, 0.9534728780F,
194.1790 +  0.9536166229F, 0.9537600659F, 0.9539032071F, 0.9540460470F,
194.1791 +  0.9541885858F, 0.9543308237F, 0.9544727611F, 0.9546143981F,
194.1792 +  0.9547557351F, 0.9548967723F, 0.9550375100F, 0.9551779485F,
194.1793 +  0.9553180881F, 0.9554579290F, 0.9555974714F, 0.9557367158F,
194.1794 +  0.9558756623F, 0.9560143112F, 0.9561526628F, 0.9562907174F,
194.1795 +  0.9564284752F, 0.9565659366F, 0.9567031017F, 0.9568399710F,
194.1796 +  0.9569765446F, 0.9571128229F, 0.9572488061F, 0.9573844944F,
194.1797 +  0.9575198883F, 0.9576549879F, 0.9577897936F, 0.9579243056F,
194.1798 +  0.9580585242F, 0.9581924497F, 0.9583260824F, 0.9584594226F,
194.1799 +  0.9585924705F, 0.9587252264F, 0.9588576906F, 0.9589898634F,
194.1800 +  0.9591217452F, 0.9592533360F, 0.9593846364F, 0.9595156465F,
194.1801 +  0.9596463666F, 0.9597767971F, 0.9599069382F, 0.9600367901F,
194.1802 +  0.9601663533F, 0.9602956279F, 0.9604246143F, 0.9605533128F,
194.1803 +  0.9606817236F, 0.9608098471F, 0.9609376835F, 0.9610652332F,
194.1804 +  0.9611924963F, 0.9613194733F, 0.9614461644F, 0.9615725699F,
194.1805 +  0.9616986901F, 0.9618245253F, 0.9619500757F, 0.9620753418F,
194.1806 +  0.9622003238F, 0.9623250219F, 0.9624494365F, 0.9625735679F,
194.1807 +  0.9626974163F, 0.9628209821F, 0.9629442656F, 0.9630672671F,
194.1808 +  0.9631899868F, 0.9633124251F, 0.9634345822F, 0.9635564585F,
194.1809 +  0.9636780543F, 0.9637993699F, 0.9639204056F, 0.9640411616F,
194.1810 +  0.9641616383F, 0.9642818359F, 0.9644017549F, 0.9645213955F,
194.1811 +  0.9646407579F, 0.9647598426F, 0.9648786497F, 0.9649971797F,
194.1812 +  0.9651154328F, 0.9652334092F, 0.9653511095F, 0.9654685337F,
194.1813 +  0.9655856823F, 0.9657025556F, 0.9658191538F, 0.9659354773F,
194.1814 +  0.9660515263F, 0.9661673013F, 0.9662828024F, 0.9663980300F,
194.1815 +  0.9665129845F, 0.9666276660F, 0.9667420750F, 0.9668562118F,
194.1816 +  0.9669700766F, 0.9670836698F, 0.9671969917F, 0.9673100425F,
194.1817 +  0.9674228227F, 0.9675353325F, 0.9676475722F, 0.9677595422F,
194.1818 +  0.9678712428F, 0.9679826742F, 0.9680938368F, 0.9682047309F,
194.1819 +  0.9683153569F, 0.9684257150F, 0.9685358056F, 0.9686456289F,
194.1820 +  0.9687551853F, 0.9688644752F, 0.9689734987F, 0.9690822564F,
194.1821 +  0.9691907483F, 0.9692989750F, 0.9694069367F, 0.9695146337F,
194.1822 +  0.9696220663F, 0.9697292349F, 0.9698361398F, 0.9699427813F,
194.1823 +  0.9700491597F, 0.9701552754F, 0.9702611286F, 0.9703667197F,
194.1824 +  0.9704720490F, 0.9705771169F, 0.9706819236F, 0.9707864695F,
194.1825 +  0.9708907549F, 0.9709947802F, 0.9710985456F, 0.9712020514F,
194.1826 +  0.9713052981F, 0.9714082859F, 0.9715110151F, 0.9716134862F,
194.1827 +  0.9717156993F, 0.9718176549F, 0.9719193532F, 0.9720207946F,
194.1828 +  0.9721219794F, 0.9722229080F, 0.9723235806F, 0.9724239976F,
194.1829 +  0.9725241593F, 0.9726240661F, 0.9727237183F, 0.9728231161F,
194.1830 +  0.9729222601F, 0.9730211503F, 0.9731197873F, 0.9732181713F,
194.1831 +  0.9733163027F, 0.9734141817F, 0.9735118088F, 0.9736091842F,
194.1832 +  0.9737063083F, 0.9738031814F, 0.9738998039F, 0.9739961760F,
194.1833 +  0.9740922981F, 0.9741881706F, 0.9742837938F, 0.9743791680F,
194.1834 +  0.9744742935F, 0.9745691707F, 0.9746637999F, 0.9747581814F,
194.1835 +  0.9748523157F, 0.9749462029F, 0.9750398435F, 0.9751332378F,
194.1836 +  0.9752263861F, 0.9753192887F, 0.9754119461F, 0.9755043585F,
194.1837 +  0.9755965262F, 0.9756884496F, 0.9757801291F, 0.9758715650F,
194.1838 +  0.9759627575F, 0.9760537071F, 0.9761444141F, 0.9762348789F,
194.1839 +  0.9763251016F, 0.9764150828F, 0.9765048228F, 0.9765943218F,
194.1840 +  0.9766835802F, 0.9767725984F, 0.9768613767F, 0.9769499154F,
194.1841 +  0.9770382149F, 0.9771262755F, 0.9772140976F, 0.9773016815F,
194.1842 +  0.9773890275F, 0.9774761360F, 0.9775630073F, 0.9776496418F,
194.1843 +  0.9777360398F, 0.9778222016F, 0.9779081277F, 0.9779938182F,
194.1844 +  0.9780792736F, 0.9781644943F, 0.9782494805F, 0.9783342326F,
194.1845 +  0.9784187509F, 0.9785030359F, 0.9785870877F, 0.9786709069F,
194.1846 +  0.9787544936F, 0.9788378484F, 0.9789209714F, 0.9790038631F,
194.1847 +  0.9790865238F, 0.9791689538F, 0.9792511535F, 0.9793331232F,
194.1848 +  0.9794148633F, 0.9794963742F, 0.9795776561F, 0.9796587094F,
194.1849 +  0.9797395345F, 0.9798201316F, 0.9799005013F, 0.9799806437F,
194.1850 +  0.9800605593F, 0.9801402483F, 0.9802197112F, 0.9802989483F,
194.1851 +  0.9803779600F, 0.9804567465F, 0.9805353082F, 0.9806136455F,
194.1852 +  0.9806917587F, 0.9807696482F, 0.9808473143F, 0.9809247574F,
194.1853 +  0.9810019778F, 0.9810789759F, 0.9811557519F, 0.9812323064F,
194.1854 +  0.9813086395F, 0.9813847517F, 0.9814606433F, 0.9815363147F,
194.1855 +  0.9816117662F, 0.9816869981F, 0.9817620108F, 0.9818368047F,
194.1856 +  0.9819113801F, 0.9819857374F, 0.9820598769F, 0.9821337989F,
194.1857 +  0.9822075038F, 0.9822809920F, 0.9823542638F, 0.9824273195F,
194.1858 +  0.9825001596F, 0.9825727843F, 0.9826451940F, 0.9827173891F,
194.1859 +  0.9827893700F, 0.9828611368F, 0.9829326901F, 0.9830040302F,
194.1860 +  0.9830751574F, 0.9831460720F, 0.9832167745F, 0.9832872652F,
194.1861 +  0.9833575444F, 0.9834276124F, 0.9834974697F, 0.9835671166F,
194.1862 +  0.9836365535F, 0.9837057806F, 0.9837747983F, 0.9838436071F,
194.1863 +  0.9839122072F, 0.9839805990F, 0.9840487829F, 0.9841167591F,
194.1864 +  0.9841845282F, 0.9842520903F, 0.9843194459F, 0.9843865953F,
194.1865 +  0.9844535389F, 0.9845202771F, 0.9845868101F, 0.9846531383F,
194.1866 +  0.9847192622F, 0.9847851820F, 0.9848508980F, 0.9849164108F,
194.1867 +  0.9849817205F, 0.9850468276F, 0.9851117324F, 0.9851764352F,
194.1868 +  0.9852409365F, 0.9853052366F, 0.9853693358F, 0.9854332344F,
194.1869 +  0.9854969330F, 0.9855604317F, 0.9856237309F, 0.9856868310F,
194.1870 +  0.9857497325F, 0.9858124355F, 0.9858749404F, 0.9859372477F,
194.1871 +  0.9859993577F, 0.9860612707F, 0.9861229871F, 0.9861845072F,
194.1872 +  0.9862458315F, 0.9863069601F, 0.9863678936F, 0.9864286322F,
194.1873 +  0.9864891764F, 0.9865495264F, 0.9866096826F, 0.9866696454F,
194.1874 +  0.9867294152F, 0.9867889922F, 0.9868483769F, 0.9869075695F,
194.1875 +  0.9869665706F, 0.9870253803F, 0.9870839991F, 0.9871424273F,
194.1876 +  0.9872006653F, 0.9872587135F, 0.9873165721F, 0.9873742415F,
194.1877 +  0.9874317222F, 0.9874890144F, 0.9875461185F, 0.9876030348F,
194.1878 +  0.9876597638F, 0.9877163057F, 0.9877726610F, 0.9878288300F,
194.1879 +  0.9878848130F, 0.9879406104F, 0.9879962225F, 0.9880516497F,
194.1880 +  0.9881068924F, 0.9881619509F, 0.9882168256F, 0.9882715168F,
194.1881 +  0.9883260249F, 0.9883803502F, 0.9884344931F, 0.9884884539F,
194.1882 +  0.9885422331F, 0.9885958309F, 0.9886492477F, 0.9887024838F,
194.1883 +  0.9887555397F, 0.9888084157F, 0.9888611120F, 0.9889136292F,
194.1884 +  0.9889659675F, 0.9890181273F, 0.9890701089F, 0.9891219128F,
194.1885 +  0.9891735392F, 0.9892249885F, 0.9892762610F, 0.9893273572F,
194.1886 +  0.9893782774F, 0.9894290219F, 0.9894795911F, 0.9895299853F,
194.1887 +  0.9895802049F, 0.9896302502F, 0.9896801217F, 0.9897298196F,
194.1888 +  0.9897793443F, 0.9898286961F, 0.9898778755F, 0.9899268828F,
194.1889 +  0.9899757183F, 0.9900243823F, 0.9900728753F, 0.9901211976F,
194.1890 +  0.9901693495F, 0.9902173314F, 0.9902651436F, 0.9903127865F,
194.1891 +  0.9903602605F, 0.9904075659F, 0.9904547031F, 0.9905016723F,
194.1892 +  0.9905484740F, 0.9905951086F, 0.9906415763F, 0.9906878775F,
194.1893 +  0.9907340126F, 0.9907799819F, 0.9908257858F, 0.9908714247F,
194.1894 +  0.9909168988F, 0.9909622086F, 0.9910073543F, 0.9910523364F,
194.1895 +  0.9910971552F, 0.9911418110F, 0.9911863042F, 0.9912306351F,
194.1896 +  0.9912748042F, 0.9913188117F, 0.9913626580F, 0.9914063435F,
194.1897 +  0.9914498684F, 0.9914932333F, 0.9915364383F, 0.9915794839F,
194.1898 +  0.9916223703F, 0.9916650981F, 0.9917076674F, 0.9917500787F,
194.1899 +  0.9917923323F, 0.9918344286F, 0.9918763679F, 0.9919181505F,
194.1900 +  0.9919597769F, 0.9920012473F, 0.9920425621F, 0.9920837217F,
194.1901 +  0.9921247263F, 0.9921655765F, 0.9922062724F, 0.9922468145F,
194.1902 +  0.9922872030F, 0.9923274385F, 0.9923675211F, 0.9924074513F,
194.1903 +  0.9924472294F, 0.9924868557F, 0.9925263306F, 0.9925656544F,
194.1904 +  0.9926048275F, 0.9926438503F, 0.9926827230F, 0.9927214461F,
194.1905 +  0.9927600199F, 0.9927984446F, 0.9928367208F, 0.9928748486F,
194.1906 +  0.9929128285F, 0.9929506608F, 0.9929883459F, 0.9930258841F,
194.1907 +  0.9930632757F, 0.9931005211F, 0.9931376207F, 0.9931745747F,
194.1908 +  0.9932113836F, 0.9932480476F, 0.9932845671F, 0.9933209425F,
194.1909 +  0.9933571742F, 0.9933932623F, 0.9934292074F, 0.9934650097F,
194.1910 +  0.9935006696F, 0.9935361874F, 0.9935715635F, 0.9936067982F,
194.1911 +  0.9936418919F, 0.9936768448F, 0.9937116574F, 0.9937463300F,
194.1912 +  0.9937808629F, 0.9938152565F, 0.9938495111F, 0.9938836271F,
194.1913 +  0.9939176047F, 0.9939514444F, 0.9939851465F, 0.9940187112F,
194.1914 +  0.9940521391F, 0.9940854303F, 0.9941185853F, 0.9941516044F,
194.1915 +  0.9941844879F, 0.9942172361F, 0.9942498495F, 0.9942823283F,
194.1916 +  0.9943146729F, 0.9943468836F, 0.9943789608F, 0.9944109047F,
194.1917 +  0.9944427158F, 0.9944743944F, 0.9945059408F, 0.9945373553F,
194.1918 +  0.9945686384F, 0.9945997902F, 0.9946308112F, 0.9946617017F,
194.1919 +  0.9946924621F, 0.9947230926F, 0.9947535937F, 0.9947839656F,
194.1920 +  0.9948142086F, 0.9948443232F, 0.9948743097F, 0.9949041683F,
194.1921 +  0.9949338995F, 0.9949635035F, 0.9949929807F, 0.9950223315F,
194.1922 +  0.9950515561F, 0.9950806549F, 0.9951096282F, 0.9951384764F,
194.1923 +  0.9951671998F, 0.9951957987F, 0.9952242735F, 0.9952526245F,
194.1924 +  0.9952808520F, 0.9953089564F, 0.9953369380F, 0.9953647971F,
194.1925 +  0.9953925340F, 0.9954201491F, 0.9954476428F, 0.9954750153F,
194.1926 +  0.9955022670F, 0.9955293981F, 0.9955564092F, 0.9955833003F,
194.1927 +  0.9956100720F, 0.9956367245F, 0.9956632582F, 0.9956896733F,
194.1928 +  0.9957159703F, 0.9957421494F, 0.9957682110F, 0.9957941553F,
194.1929 +  0.9958199828F, 0.9958456937F, 0.9958712884F, 0.9958967672F,
194.1930 +  0.9959221305F, 0.9959473784F, 0.9959725115F, 0.9959975300F,
194.1931 +  0.9960224342F, 0.9960472244F, 0.9960719011F, 0.9960964644F,
194.1932 +  0.9961209148F, 0.9961452525F, 0.9961694779F, 0.9961935913F,
194.1933 +  0.9962175930F, 0.9962414834F, 0.9962652627F, 0.9962889313F,
194.1934 +  0.9963124895F, 0.9963359377F, 0.9963592761F, 0.9963825051F,
194.1935 +  0.9964056250F, 0.9964286361F, 0.9964515387F, 0.9964743332F,
194.1936 +  0.9964970198F, 0.9965195990F, 0.9965420709F, 0.9965644360F,
194.1937 +  0.9965866946F, 0.9966088469F, 0.9966308932F, 0.9966528340F,
194.1938 +  0.9966746695F, 0.9966964001F, 0.9967180260F, 0.9967395475F,
194.1939 +  0.9967609651F, 0.9967822789F, 0.9968034894F, 0.9968245968F,
194.1940 +  0.9968456014F, 0.9968665036F, 0.9968873037F, 0.9969080019F,
194.1941 +  0.9969285987F, 0.9969490942F, 0.9969694889F, 0.9969897830F,
194.1942 +  0.9970099769F, 0.9970300708F, 0.9970500651F, 0.9970699601F,
194.1943 +  0.9970897561F, 0.9971094533F, 0.9971290522F, 0.9971485531F,
194.1944 +  0.9971679561F, 0.9971872617F, 0.9972064702F, 0.9972255818F,
194.1945 +  0.9972445968F, 0.9972635157F, 0.9972823386F, 0.9973010659F,
194.1946 +  0.9973196980F, 0.9973382350F, 0.9973566773F, 0.9973750253F,
194.1947 +  0.9973932791F, 0.9974114392F, 0.9974295059F, 0.9974474793F,
194.1948 +  0.9974653599F, 0.9974831480F, 0.9975008438F, 0.9975184476F,
194.1949 +  0.9975359598F, 0.9975533806F, 0.9975707104F, 0.9975879495F,
194.1950 +  0.9976050981F, 0.9976221566F, 0.9976391252F, 0.9976560043F,
194.1951 +  0.9976727941F, 0.9976894950F, 0.9977061073F, 0.9977226312F,
194.1952 +  0.9977390671F, 0.9977554152F, 0.9977716759F, 0.9977878495F,
194.1953 +  0.9978039361F, 0.9978199363F, 0.9978358501F, 0.9978516780F,
194.1954 +  0.9978674202F, 0.9978830771F, 0.9978986488F, 0.9979141358F,
194.1955 +  0.9979295383F, 0.9979448566F, 0.9979600909F, 0.9979752417F,
194.1956 +  0.9979903091F, 0.9980052936F, 0.9980201952F, 0.9980350145F,
194.1957 +  0.9980497515F, 0.9980644067F, 0.9980789804F, 0.9980934727F,
194.1958 +  0.9981078841F, 0.9981222147F, 0.9981364649F, 0.9981506350F,
194.1959 +  0.9981647253F, 0.9981787360F, 0.9981926674F, 0.9982065199F,
194.1960 +  0.9982202936F, 0.9982339890F, 0.9982476062F, 0.9982611456F,
194.1961 +  0.9982746074F, 0.9982879920F, 0.9983012996F, 0.9983145304F,
194.1962 +  0.9983276849F, 0.9983407632F, 0.9983537657F, 0.9983666926F,
194.1963 +  0.9983795442F, 0.9983923208F, 0.9984050226F, 0.9984176501F,
194.1964 +  0.9984302033F, 0.9984426827F, 0.9984550884F, 0.9984674208F,
194.1965 +  0.9984796802F, 0.9984918667F, 0.9985039808F, 0.9985160227F,
194.1966 +  0.9985279926F, 0.9985398909F, 0.9985517177F, 0.9985634734F,
194.1967 +  0.9985751583F, 0.9985867727F, 0.9985983167F, 0.9986097907F,
194.1968 +  0.9986211949F, 0.9986325297F, 0.9986437953F, 0.9986549919F,
194.1969 +  0.9986661199F, 0.9986771795F, 0.9986881710F, 0.9986990946F,
194.1970 +  0.9987099507F, 0.9987207394F, 0.9987314611F, 0.9987421161F,
194.1971 +  0.9987527045F, 0.9987632267F, 0.9987736829F, 0.9987840734F,
194.1972 +  0.9987943985F, 0.9988046584F, 0.9988148534F, 0.9988249838F,
194.1973 +  0.9988350498F, 0.9988450516F, 0.9988549897F, 0.9988648641F,
194.1974 +  0.9988746753F, 0.9988844233F, 0.9988941086F, 0.9989037313F,
194.1975 +  0.9989132918F, 0.9989227902F, 0.9989322269F, 0.9989416021F,
194.1976 +  0.9989509160F, 0.9989601690F, 0.9989693613F, 0.9989784931F,
194.1977 +  0.9989875647F, 0.9989965763F, 0.9990055283F, 0.9990144208F,
194.1978 +  0.9990232541F, 0.9990320286F, 0.9990407443F, 0.9990494016F,
194.1979 +  0.9990580008F, 0.9990665421F, 0.9990750257F, 0.9990834519F,
194.1980 +  0.9990918209F, 0.9991001331F, 0.9991083886F, 0.9991165877F,
194.1981 +  0.9991247307F, 0.9991328177F, 0.9991408491F, 0.9991488251F,
194.1982 +  0.9991567460F, 0.9991646119F, 0.9991724232F, 0.9991801801F,
194.1983 +  0.9991878828F, 0.9991955316F, 0.9992031267F, 0.9992106684F,
194.1984 +  0.9992181569F, 0.9992255925F, 0.9992329753F, 0.9992403057F,
194.1985 +  0.9992475839F, 0.9992548101F, 0.9992619846F, 0.9992691076F,
194.1986 +  0.9992761793F, 0.9992832001F, 0.9992901701F, 0.9992970895F,
194.1987 +  0.9993039587F, 0.9993107777F, 0.9993175470F, 0.9993242667F,
194.1988 +  0.9993309371F, 0.9993375583F, 0.9993441307F, 0.9993506545F,
194.1989 +  0.9993571298F, 0.9993635570F, 0.9993699362F, 0.9993762678F,
194.1990 +  0.9993825519F, 0.9993887887F, 0.9993949785F, 0.9994011216F,
194.1991 +  0.9994072181F, 0.9994132683F, 0.9994192725F, 0.9994252307F,
194.1992 +  0.9994311434F, 0.9994370107F, 0.9994428327F, 0.9994486099F,
194.1993 +  0.9994543423F, 0.9994600303F, 0.9994656739F, 0.9994712736F,
194.1994 +  0.9994768294F, 0.9994823417F, 0.9994878105F, 0.9994932363F,
194.1995 +  0.9994986191F, 0.9995039592F, 0.9995092568F, 0.9995145122F,
194.1996 +  0.9995197256F, 0.9995248971F, 0.9995300270F, 0.9995351156F,
194.1997 +  0.9995401630F, 0.9995451695F, 0.9995501352F, 0.9995550604F,
194.1998 +  0.9995599454F, 0.9995647903F, 0.9995695953F, 0.9995743607F,
194.1999 +  0.9995790866F, 0.9995837734F, 0.9995884211F, 0.9995930300F,
194.2000 +  0.9995976004F, 0.9996021324F, 0.9996066263F, 0.9996110822F,
194.2001 +  0.9996155004F, 0.9996198810F, 0.9996242244F, 0.9996285306F,
194.2002 +  0.9996327999F, 0.9996370326F, 0.9996412287F, 0.9996453886F,
194.2003 +  0.9996495125F, 0.9996536004F, 0.9996576527F, 0.9996616696F,
194.2004 +  0.9996656512F, 0.9996695977F, 0.9996735094F, 0.9996773865F,
194.2005 +  0.9996812291F, 0.9996850374F, 0.9996888118F, 0.9996925523F,
194.2006 +  0.9996962591F, 0.9996999325F, 0.9997035727F, 0.9997071798F,
194.2007 +  0.9997107541F, 0.9997142957F, 0.9997178049F, 0.9997212818F,
194.2008 +  0.9997247266F, 0.9997281396F, 0.9997315209F, 0.9997348708F,
194.2009 +  0.9997381893F, 0.9997414767F, 0.9997447333F, 0.9997479591F,
194.2010 +  0.9997511544F, 0.9997543194F, 0.9997574542F, 0.9997605591F,
194.2011 +  0.9997636342F, 0.9997666797F, 0.9997696958F, 0.9997726828F,
194.2012 +  0.9997756407F, 0.9997785698F, 0.9997814703F, 0.9997843423F,
194.2013 +  0.9997871860F, 0.9997900016F, 0.9997927894F, 0.9997955494F,
194.2014 +  0.9997982818F, 0.9998009869F, 0.9998036648F, 0.9998063157F,
194.2015 +  0.9998089398F, 0.9998115373F, 0.9998141082F, 0.9998166529F,
194.2016 +  0.9998191715F, 0.9998216642F, 0.9998241311F, 0.9998265724F,
194.2017 +  0.9998289884F, 0.9998313790F, 0.9998337447F, 0.9998360854F,
194.2018 +  0.9998384015F, 0.9998406930F, 0.9998429602F, 0.9998452031F,
194.2019 +  0.9998474221F, 0.9998496171F, 0.9998517885F, 0.9998539364F,
194.2020 +  0.9998560610F, 0.9998581624F, 0.9998602407F, 0.9998622962F,
194.2021 +  0.9998643291F, 0.9998663394F, 0.9998683274F, 0.9998702932F,
194.2022 +  0.9998722370F, 0.9998741589F, 0.9998760591F, 0.9998779378F,
194.2023 +  0.9998797952F, 0.9998816313F, 0.9998834464F, 0.9998852406F,
194.2024 +  0.9998870141F, 0.9998887670F, 0.9998904995F, 0.9998922117F,
194.2025 +  0.9998939039F, 0.9998955761F, 0.9998972285F, 0.9998988613F,
194.2026 +  0.9999004746F, 0.9999020686F, 0.9999036434F, 0.9999051992F,
194.2027 +  0.9999067362F, 0.9999082544F, 0.9999097541F, 0.9999112354F,
194.2028 +  0.9999126984F, 0.9999141433F, 0.9999155703F, 0.9999169794F,
194.2029 +  0.9999183709F, 0.9999197449F, 0.9999211014F, 0.9999224408F,
194.2030 +  0.9999237631F, 0.9999250684F, 0.9999263570F, 0.9999276289F,
194.2031 +  0.9999288843F, 0.9999301233F, 0.9999313461F, 0.9999325529F,
194.2032 +  0.9999337437F, 0.9999349187F, 0.9999360780F, 0.9999372218F,
194.2033 +  0.9999383503F, 0.9999394635F, 0.9999405616F, 0.9999416447F,
194.2034 +  0.9999427129F, 0.9999437665F, 0.9999448055F, 0.9999458301F,
194.2035 +  0.9999468404F, 0.9999478365F, 0.9999488185F, 0.9999497867F,
194.2036 +  0.9999507411F, 0.9999516819F, 0.9999526091F, 0.9999535230F,
194.2037 +  0.9999544236F, 0.9999553111F, 0.9999561856F, 0.9999570472F,
194.2038 +  0.9999578960F, 0.9999587323F, 0.9999595560F, 0.9999603674F,
194.2039 +  0.9999611666F, 0.9999619536F, 0.9999627286F, 0.9999634917F,
194.2040 +  0.9999642431F, 0.9999649828F, 0.9999657110F, 0.9999664278F,
194.2041 +  0.9999671334F, 0.9999678278F, 0.9999685111F, 0.9999691835F,
194.2042 +  0.9999698451F, 0.9999704960F, 0.9999711364F, 0.9999717662F,
194.2043 +  0.9999723858F, 0.9999729950F, 0.9999735942F, 0.9999741834F,
194.2044 +  0.9999747626F, 0.9999753321F, 0.9999758919F, 0.9999764421F,
194.2045 +  0.9999769828F, 0.9999775143F, 0.9999780364F, 0.9999785495F,
194.2046 +  0.9999790535F, 0.9999795485F, 0.9999800348F, 0.9999805124F,
194.2047 +  0.9999809813F, 0.9999814417F, 0.9999818938F, 0.9999823375F,
194.2048 +  0.9999827731F, 0.9999832005F, 0.9999836200F, 0.9999840316F,
194.2049 +  0.9999844353F, 0.9999848314F, 0.9999852199F, 0.9999856008F,
194.2050 +  0.9999859744F, 0.9999863407F, 0.9999866997F, 0.9999870516F,
194.2051 +  0.9999873965F, 0.9999877345F, 0.9999880656F, 0.9999883900F,
194.2052 +  0.9999887078F, 0.9999890190F, 0.9999893237F, 0.9999896220F,
194.2053 +  0.9999899140F, 0.9999901999F, 0.9999904796F, 0.9999907533F,
194.2054 +  0.9999910211F, 0.9999912830F, 0.9999915391F, 0.9999917896F,
194.2055 +  0.9999920345F, 0.9999922738F, 0.9999925077F, 0.9999927363F,
194.2056 +  0.9999929596F, 0.9999931777F, 0.9999933907F, 0.9999935987F,
194.2057 +  0.9999938018F, 0.9999940000F, 0.9999941934F, 0.9999943820F,
194.2058 +  0.9999945661F, 0.9999947456F, 0.9999949206F, 0.9999950912F,
194.2059 +  0.9999952575F, 0.9999954195F, 0.9999955773F, 0.9999957311F,
194.2060 +  0.9999958807F, 0.9999960265F, 0.9999961683F, 0.9999963063F,
194.2061 +  0.9999964405F, 0.9999965710F, 0.9999966979F, 0.9999968213F,
194.2062 +  0.9999969412F, 0.9999970576F, 0.9999971707F, 0.9999972805F,
194.2063 +  0.9999973871F, 0.9999974905F, 0.9999975909F, 0.9999976881F,
194.2064 +  0.9999977824F, 0.9999978738F, 0.9999979624F, 0.9999980481F,
194.2065 +  0.9999981311F, 0.9999982115F, 0.9999982892F, 0.9999983644F,
194.2066 +  0.9999984370F, 0.9999985072F, 0.9999985750F, 0.9999986405F,
194.2067 +  0.9999987037F, 0.9999987647F, 0.9999988235F, 0.9999988802F,
194.2068 +  0.9999989348F, 0.9999989873F, 0.9999990379F, 0.9999990866F,
194.2069 +  0.9999991334F, 0.9999991784F, 0.9999992217F, 0.9999992632F,
194.2070 +  0.9999993030F, 0.9999993411F, 0.9999993777F, 0.9999994128F,
194.2071 +  0.9999994463F, 0.9999994784F, 0.9999995091F, 0.9999995384F,
194.2072 +  0.9999995663F, 0.9999995930F, 0.9999996184F, 0.9999996426F,
194.2073 +  0.9999996657F, 0.9999996876F, 0.9999997084F, 0.9999997282F,
194.2074 +  0.9999997469F, 0.9999997647F, 0.9999997815F, 0.9999997973F,
194.2075 +  0.9999998123F, 0.9999998265F, 0.9999998398F, 0.9999998524F,
194.2076 +  0.9999998642F, 0.9999998753F, 0.9999998857F, 0.9999998954F,
194.2077 +  0.9999999045F, 0.9999999130F, 0.9999999209F, 0.9999999282F,
194.2078 +  0.9999999351F, 0.9999999414F, 0.9999999472F, 0.9999999526F,
194.2079 +  0.9999999576F, 0.9999999622F, 0.9999999664F, 0.9999999702F,
194.2080 +  0.9999999737F, 0.9999999769F, 0.9999999798F, 0.9999999824F,
194.2081 +  0.9999999847F, 0.9999999868F, 0.9999999887F, 0.9999999904F,
194.2082 +  0.9999999919F, 0.9999999932F, 0.9999999943F, 0.9999999953F,
194.2083 +  0.9999999961F, 0.9999999969F, 0.9999999975F, 0.9999999980F,
194.2084 +  0.9999999985F, 0.9999999988F, 0.9999999991F, 0.9999999993F,
194.2085 +  0.9999999995F, 0.9999999997F, 0.9999999998F, 0.9999999999F,
194.2086 +  0.9999999999F, 1.0000000000F, 1.0000000000F, 1.0000000000F,
194.2087 +  1.0000000000F, 1.0000000000F, 1.0000000000F, 1.0000000000F,
194.2088 +};
194.2089 +
194.2090 +static const float *const vwin[8] = {
194.2091 +  vwin64,
194.2092 +  vwin128,
194.2093 +  vwin256,
194.2094 +  vwin512,
194.2095 +  vwin1024,
194.2096 +  vwin2048,
194.2097 +  vwin4096,
194.2098 +  vwin8192,
194.2099 +};
194.2100 +
194.2101 +const float *_vorbis_window_get(int n){
194.2102 +  return vwin[n];
194.2103 +}
194.2104 +
194.2105 +void _vorbis_apply_window(float *d,int *winno,long *blocksizes,
194.2106 +                          int lW,int W,int nW){
194.2107 +  lW=(W?lW:0);
194.2108 +  nW=(W?nW:0);
194.2109 +
194.2110 +  {
194.2111 +    const float *windowLW=vwin[winno[lW]];
194.2112 +    const float *windowNW=vwin[winno[nW]];
194.2113 +
194.2114 +    long n=blocksizes[W];
194.2115 +    long ln=blocksizes[lW];
194.2116 +    long rn=blocksizes[nW];
194.2117 +
194.2118 +    long leftbegin=n/4-ln/4;
194.2119 +    long leftend=leftbegin+ln/2;
194.2120 +
194.2121 +    long rightbegin=n/2+n/4-rn/4;
194.2122 +    long rightend=rightbegin+rn/2;
194.2123 +
194.2124 +    int i,p;
194.2125 +
194.2126 +    for(i=0;i<leftbegin;i++)
194.2127 +      d[i]=0.f;
194.2128 +
194.2129 +    for(p=0;i<leftend;i++,p++)
194.2130 +      d[i]*=windowLW[p];
194.2131 +
194.2132 +    for(i=rightbegin,p=rn/2-1;i<rightend;i++,p--)
194.2133 +      d[i]*=windowNW[p];
194.2134 +
194.2135 +    for(;i<n;i++)
194.2136 +      d[i]=0.f;
194.2137 +  }
194.2138 +}
   195.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   195.2 +++ b/libs/vorbis/window.h	Sun Nov 01 00:36:56 2015 +0200
   195.3 @@ -0,0 +1,26 @@
   195.4 +/********************************************************************
   195.5 + *                                                                  *
   195.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
   195.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
   195.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
   195.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  195.10 + *                                                                  *
  195.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007             *
  195.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
  195.13 + *                                                                  *
  195.14 + ********************************************************************
  195.15 +
  195.16 + function: window functions
  195.17 + last mod: $Id: window.h 13293 2007-07-24 00:09:47Z xiphmont $
  195.18 +
  195.19 + ********************************************************************/
  195.20 +
  195.21 +#ifndef _V_WINDOW_
  195.22 +#define _V_WINDOW_
  195.23 +
  195.24 +extern float *_vorbis_window_get(int n);
  195.25 +extern void _vorbis_apply_window(float *d,int *winno,long *blocksizes,
  195.26 +                          int lW,int W,int nW);
  195.27 +
  195.28 +
  195.29 +#endif
   196.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   196.2 +++ b/libs/zlib/LICENSE	Sun Nov 01 00:36:56 2015 +0200
   196.3 @@ -0,0 +1,20 @@
   196.4 + (C) 1995-2010 Jean-loup Gailly and Mark Adler
   196.5 +
   196.6 +  This software is provided 'as-is', without any express or implied
   196.7 +  warranty.  In no event will the authors be held liable for any damages
   196.8 +  arising from the use of this software.
   196.9 +
  196.10 +  Permission is granted to anyone to use this software for any purpose,
  196.11 +  including commercial applications, and to alter it and redistribute it
  196.12 +  freely, subject to the following restrictions:
  196.13 +
  196.14 +  1. The origin of this software must not be misrepresented; you must not
  196.15 +     claim that you wrote the original software. If you use this software
  196.16 +     in a product, an acknowledgment in the product documentation would be
  196.17 +     appreciated but is not required.
  196.18 +  2. Altered source versions must be plainly marked as such, and must not be
  196.19 +     misrepresented as being the original software.
  196.20 +  3. This notice may not be removed or altered from any source distribution.
  196.21 +
  196.22 +  Jean-loup Gailly        Mark Adler
  196.23 +  jloup@gzip.org          madler@alumni.caltech.edu
   197.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   197.2 +++ b/libs/zlib/adler32.c	Sun Nov 01 00:36:56 2015 +0200
   197.3 @@ -0,0 +1,149 @@
   197.4 +/* adler32.c -- compute the Adler-32 checksum of a data stream
   197.5 + * Copyright (C) 1995-2004 Mark Adler
   197.6 + * For conditions of distribution and use, see copyright notice in zlib.h
   197.7 + */
   197.8 +
   197.9 +/* @(#) $Id$ */
  197.10 +
  197.11 +#define ZLIB_INTERNAL
  197.12 +#include "zlib.h"
  197.13 +
  197.14 +#define BASE 65521UL    /* largest prime smaller than 65536 */
  197.15 +#define NMAX 5552
  197.16 +/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
  197.17 +
  197.18 +#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  197.19 +#define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  197.20 +#define DO4(buf,i)  DO2(buf,i); DO2(buf,i+2);
  197.21 +#define DO8(buf,i)  DO4(buf,i); DO4(buf,i+4);
  197.22 +#define DO16(buf)   DO8(buf,0); DO8(buf,8);
  197.23 +
  197.24 +/* use NO_DIVIDE if your processor does not do division in hardware */
  197.25 +#ifdef NO_DIVIDE
  197.26 +#  define MOD(a) \
  197.27 +    do { \
  197.28 +        if (a >= (BASE << 16)) a -= (BASE << 16); \
  197.29 +        if (a >= (BASE << 15)) a -= (BASE << 15); \
  197.30 +        if (a >= (BASE << 14)) a -= (BASE << 14); \
  197.31 +        if (a >= (BASE << 13)) a -= (BASE << 13); \
  197.32 +        if (a >= (BASE << 12)) a -= (BASE << 12); \
  197.33 +        if (a >= (BASE << 11)) a -= (BASE << 11); \
  197.34 +        if (a >= (BASE << 10)) a -= (BASE << 10); \
  197.35 +        if (a >= (BASE << 9)) a -= (BASE << 9); \
  197.36 +        if (a >= (BASE << 8)) a -= (BASE << 8); \
  197.37 +        if (a >= (BASE << 7)) a -= (BASE << 7); \
  197.38 +        if (a >= (BASE << 6)) a -= (BASE << 6); \
  197.39 +        if (a >= (BASE << 5)) a -= (BASE << 5); \
  197.40 +        if (a >= (BASE << 4)) a -= (BASE << 4); \
  197.41 +        if (a >= (BASE << 3)) a -= (BASE << 3); \
  197.42 +        if (a >= (BASE << 2)) a -= (BASE << 2); \
  197.43 +        if (a >= (BASE << 1)) a -= (BASE << 1); \
  197.44 +        if (a >= BASE) a -= BASE; \
  197.45 +    } while (0)
  197.46 +#  define MOD4(a) \
  197.47 +    do { \
  197.48 +        if (a >= (BASE << 4)) a -= (BASE << 4); \
  197.49 +        if (a >= (BASE << 3)) a -= (BASE << 3); \
  197.50 +        if (a >= (BASE << 2)) a -= (BASE << 2); \
  197.51 +        if (a >= (BASE << 1)) a -= (BASE << 1); \
  197.52 +        if (a >= BASE) a -= BASE; \
  197.53 +    } while (0)
  197.54 +#else
  197.55 +#  define MOD(a) a %= BASE
  197.56 +#  define MOD4(a) a %= BASE
  197.57 +#endif
  197.58 +
  197.59 +/* ========================================================================= */
  197.60 +uLong ZEXPORT adler32(adler, buf, len)
  197.61 +    uLong adler;
  197.62 +    const Bytef *buf;
  197.63 +    uInt len;
  197.64 +{
  197.65 +    unsigned long sum2;
  197.66 +    unsigned n;
  197.67 +
  197.68 +    /* split Adler-32 into component sums */
  197.69 +    sum2 = (adler >> 16) & 0xffff;
  197.70 +    adler &= 0xffff;
  197.71 +
  197.72 +    /* in case user likes doing a byte at a time, keep it fast */
  197.73 +    if (len == 1) {
  197.74 +        adler += buf[0];
  197.75 +        if (adler >= BASE)
  197.76 +            adler -= BASE;
  197.77 +        sum2 += adler;
  197.78 +        if (sum2 >= BASE)
  197.79 +            sum2 -= BASE;
  197.80 +        return adler | (sum2 << 16);
  197.81 +    }
  197.82 +
  197.83 +    /* initial Adler-32 value (deferred check for len == 1 speed) */
  197.84 +    if (buf == Z_NULL)
  197.85 +        return 1L;
  197.86 +
  197.87 +    /* in case short lengths are provided, keep it somewhat fast */
  197.88 +    if (len < 16) {
  197.89 +        while (len--) {
  197.90 +            adler += *buf++;
  197.91 +            sum2 += adler;
  197.92 +        }
  197.93 +        if (adler >= BASE)
  197.94 +            adler -= BASE;
  197.95 +        MOD4(sum2);             /* only added so many BASE's */
  197.96 +        return adler | (sum2 << 16);
  197.97 +    }
  197.98 +
  197.99 +    /* do length NMAX blocks -- requires just one modulo operation */
 197.100 +    while (len >= NMAX) {
 197.101 +        len -= NMAX;
 197.102 +        n = NMAX / 16;          /* NMAX is divisible by 16 */
 197.103 +        do {
 197.104 +            DO16(buf);          /* 16 sums unrolled */
 197.105 +            buf += 16;
 197.106 +        } while (--n);
 197.107 +        MOD(adler);
 197.108 +        MOD(sum2);
 197.109 +    }
 197.110 +
 197.111 +    /* do remaining bytes (less than NMAX, still just one modulo) */
 197.112 +    if (len) {                  /* avoid modulos if none remaining */
 197.113 +        while (len >= 16) {
 197.114 +            len -= 16;
 197.115 +            DO16(buf);
 197.116 +            buf += 16;
 197.117 +        }
 197.118 +        while (len--) {
 197.119 +            adler += *buf++;
 197.120 +            sum2 += adler;
 197.121 +        }
 197.122 +        MOD(adler);
 197.123 +        MOD(sum2);
 197.124 +    }
 197.125 +
 197.126 +    /* return recombined sums */
 197.127 +    return adler | (sum2 << 16);
 197.128 +}
 197.129 +
 197.130 +/* ========================================================================= */
 197.131 +uLong ZEXPORT adler32_combine(adler1, adler2, len2)
 197.132 +    uLong adler1;
 197.133 +    uLong adler2;
 197.134 +    z_off_t len2;
 197.135 +{
 197.136 +    unsigned long sum1;
 197.137 +    unsigned long sum2;
 197.138 +    unsigned rem;
 197.139 +
 197.140 +    /* the derivation of this formula is left as an exercise for the reader */
 197.141 +    rem = (unsigned)(len2 % BASE);
 197.142 +    sum1 = adler1 & 0xffff;
 197.143 +    sum2 = rem * sum1;
 197.144 +    MOD(sum2);
 197.145 +    sum1 += (adler2 & 0xffff) + BASE - 1;
 197.146 +    sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) + BASE - rem;
 197.147 +    if (sum1 > BASE) sum1 -= BASE;
 197.148 +    if (sum1 > BASE) sum1 -= BASE;
 197.149 +    if (sum2 > (BASE << 1)) sum2 -= (BASE << 1);
 197.150 +    if (sum2 > BASE) sum2 -= BASE;
 197.151 +    return sum1 | (sum2 << 16);
 197.152 +}
   198.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   198.2 +++ b/libs/zlib/compress.c	Sun Nov 01 00:36:56 2015 +0200
   198.3 @@ -0,0 +1,79 @@
   198.4 +/* compress.c -- compress a memory buffer
   198.5 + * Copyright (C) 1995-2003 Jean-loup Gailly.
   198.6 + * For conditions of distribution and use, see copyright notice in zlib.h
   198.7 + */
   198.8 +
   198.9 +/* @(#) $Id$ */
  198.10 +
  198.11 +#define ZLIB_INTERNAL
  198.12 +#include "zlib.h"
  198.13 +
  198.14 +/* ===========================================================================
  198.15 +     Compresses the source buffer into the destination buffer. The level
  198.16 +   parameter has the same meaning as in deflateInit.  sourceLen is the byte
  198.17 +   length of the source buffer. Upon entry, destLen is the total size of the
  198.18 +   destination buffer, which must be at least 0.1% larger than sourceLen plus
  198.19 +   12 bytes. Upon exit, destLen is the actual size of the compressed buffer.
  198.20 +
  198.21 +     compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
  198.22 +   memory, Z_BUF_ERROR if there was not enough room in the output buffer,
  198.23 +   Z_STREAM_ERROR if the level parameter is invalid.
  198.24 +*/
  198.25 +int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
  198.26 +    Bytef *dest;
  198.27 +    uLongf *destLen;
  198.28 +    const Bytef *source;
  198.29 +    uLong sourceLen;
  198.30 +    int level;
  198.31 +{
  198.32 +    z_stream stream;
  198.33 +    int err;
  198.34 +
  198.35 +    stream.next_in = (Bytef*)source;
  198.36 +    stream.avail_in = (uInt)sourceLen;
  198.37 +#ifdef MAXSEG_64K
  198.38 +    /* Check for source > 64K on 16-bit machine: */
  198.39 +    if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;
  198.40 +#endif
  198.41 +    stream.next_out = dest;
  198.42 +    stream.avail_out = (uInt)*destLen;
  198.43 +    if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR;
  198.44 +
  198.45 +    stream.zalloc = (alloc_func)0;
  198.46 +    stream.zfree = (free_func)0;
  198.47 +    stream.opaque = (voidpf)0;
  198.48 +
  198.49 +    err = deflateInit(&stream, level);
  198.50 +    if (err != Z_OK) return err;
  198.51 +
  198.52 +    err = deflate(&stream, Z_FINISH);
  198.53 +    if (err != Z_STREAM_END) {
  198.54 +        deflateEnd(&stream);
  198.55 +        return err == Z_OK ? Z_BUF_ERROR : err;
  198.56 +    }
  198.57 +    *destLen = stream.total_out;
  198.58 +
  198.59 +    err = deflateEnd(&stream);
  198.60 +    return err;
  198.61 +}
  198.62 +
  198.63 +/* ===========================================================================
  198.64 + */
  198.65 +int ZEXPORT compress (dest, destLen, source, sourceLen)
  198.66 +    Bytef *dest;
  198.67 +    uLongf *destLen;
  198.68 +    const Bytef *source;
  198.69 +    uLong sourceLen;
  198.70 +{
  198.71 +    return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION);
  198.72 +}
  198.73 +
  198.74 +/* ===========================================================================
  198.75 +     If the default memLevel or windowBits for deflateInit() is changed, then
  198.76 +   this function needs to be updated.
  198.77 + */
  198.78 +uLong ZEXPORT compressBound (sourceLen)
  198.79 +    uLong sourceLen;
  198.80 +{
  198.81 +    return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + 11;
  198.82 +}
   199.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   199.2 +++ b/libs/zlib/crc32.c	Sun Nov 01 00:36:56 2015 +0200
   199.3 @@ -0,0 +1,423 @@
   199.4 +/* crc32.c -- compute the CRC-32 of a data stream
   199.5 + * Copyright (C) 1995-2005 Mark Adler
   199.6 + * For conditions of distribution and use, see copyright notice in zlib.h
   199.7 + *
   199.8 + * Thanks to Rodney Brown <rbrown64@csc.com.au> for his contribution of faster
   199.9 + * CRC methods: exclusive-oring 32 bits of data at a time, and pre-computing
  199.10 + * tables for updating the shift register in one step with three exclusive-ors
  199.11 + * instead of four steps with four exclusive-ors.  This results in about a
  199.12 + * factor of two increase in speed on a Power PC G4 (PPC7455) using gcc -O3.
  199.13 + */
  199.14 +
  199.15 +/* @(#) $Id$ */
  199.16 +
  199.17 +/*
  199.18 +  Note on the use of DYNAMIC_CRC_TABLE: there is no mutex or semaphore
  199.19 +  protection on the static variables used to control the first-use generation
  199.20 +  of the crc tables.  Therefore, if you #define DYNAMIC_CRC_TABLE, you should
  199.21 +  first call get_crc_table() to initialize the tables before allowing more than
  199.22 +  one thread to use crc32().
  199.23 + */
  199.24 +
  199.25 +#ifdef MAKECRCH
  199.26 +#  include <stdio.h>
  199.27 +#  ifndef DYNAMIC_CRC_TABLE
  199.28 +#    define DYNAMIC_CRC_TABLE
  199.29 +#  endif /* !DYNAMIC_CRC_TABLE */
  199.30 +#endif /* MAKECRCH */
  199.31 +
  199.32 +#include "zutil.h"      /* for STDC and FAR definitions */
  199.33 +
  199.34 +#define local static
  199.35 +
  199.36 +/* Find a four-byte integer type for crc32_little() and crc32_big(). */
  199.37 +#ifndef NOBYFOUR
  199.38 +#  ifdef STDC           /* need ANSI C limits.h to determine sizes */
  199.39 +#    include <limits.h>
  199.40 +#    define BYFOUR
  199.41 +#    if (UINT_MAX == 0xffffffffUL)
  199.42 +       typedef unsigned int u4;
  199.43 +#    else
  199.44 +#      if (ULONG_MAX == 0xffffffffUL)
  199.45 +         typedef unsigned long u4;
  199.46 +#      else
  199.47 +#        if (USHRT_MAX == 0xffffffffUL)
  199.48 +           typedef unsigned short u4;
  199.49 +#        else
  199.50 +#          undef BYFOUR     /* can't find a four-byte integer type! */
  199.51 +#        endif
  199.52 +#      endif
  199.53 +#    endif
  199.54 +#  endif /* STDC */
  199.55 +#endif /* !NOBYFOUR */
  199.56 +
  199.57 +/* Definitions for doing the crc four data bytes at a time. */
  199.58 +#ifdef BYFOUR
  199.59 +#  define REV(w) (((w)>>24)+(((w)>>8)&0xff00)+ \
  199.60 +                (((w)&0xff00)<<8)+(((w)&0xff)<<24))
  199.61 +   local unsigned long crc32_little OF((unsigned long,
  199.62 +                        const unsigned char FAR *, unsigned));
  199.63 +   local unsigned long crc32_big OF((unsigned long,
  199.64 +                        const unsigned char FAR *, unsigned));
  199.65 +#  define TBLS 8
  199.66 +#else
  199.67 +#  define TBLS 1
  199.68 +#endif /* BYFOUR */
  199.69 +
  199.70 +/* Local functions for crc concatenation */
  199.71 +local unsigned long gf2_matrix_times OF((unsigned long *mat,
  199.72 +                                         unsigned long vec));
  199.73 +local void gf2_matrix_square OF((unsigned long *square, unsigned long *mat));
  199.74 +
  199.75 +#ifdef DYNAMIC_CRC_TABLE
  199.76 +
  199.77 +local volatile int crc_table_empty = 1;
  199.78 +local unsigned long FAR crc_table[TBLS][256];
  199.79 +local void make_crc_table OF((void));
  199.80 +#ifdef MAKECRCH
  199.81 +   local void write_table OF((FILE *, const unsigned long FAR *));
  199.82 +#endif /* MAKECRCH */
  199.83 +/*
  199.84 +  Generate tables for a byte-wise 32-bit CRC calculation on the polynomial:
  199.85 +  x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1.
  199.86 +
  199.87 +  Polynomials over GF(2) are represented in binary, one bit per coefficient,
  199.88 +  with the lowest powers in the most significant bit.  Then adding polynomials
  199.89 +  is just exclusive-or, and multiplying a polynomial by x is a right shift by
  199.90 +  one.  If we call the above polynomial p, and represent a byte as the
  199.91 +  polynomial q, also with the lowest power in the most significant bit (so the
  199.92 +  byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p,
  199.93 +  where a mod b means the remainder after dividing a by b.
  199.94 +
  199.95 +  This calculation is done using the shift-register method of multiplying and
  199.96 +  taking the remainder.  The register is initialized to zero, and for each
  199.97 +  incoming bit, x^32 is added mod p to the register if the bit is a one (where
  199.98 +  x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by
  199.99 +  x (which is shifting right by one and adding x^32 mod p if the bit shifted
 199.100 +  out is a one).  We start with the highest power (least significant bit) of
 199.101 +  q and repeat for all eight bits of q.
 199.102 +
 199.103 +  The first table is simply the CRC of all possible eight bit values.  This is
 199.104 +  all the information needed to generate CRCs on data a byte at a time for all
 199.105 +  combinations of CRC register values and incoming bytes.  The remaining tables
 199.106 +  allow for word-at-a-time CRC calculation for both big-endian and little-
 199.107 +  endian machines, where a word is four bytes.
 199.108 +*/
 199.109 +local void make_crc_table()
 199.110 +{
 199.111 +    unsigned long c;
 199.112 +    int n, k;
 199.113 +    unsigned long poly;                 /* polynomial exclusive-or pattern */
 199.114 +    /* terms of polynomial defining this crc (except x^32): */
 199.115 +    static volatile int first = 1;      /* flag to limit concurrent making */
 199.116 +    static const unsigned char p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26};
 199.117 +
 199.118 +    /* See if another task is already doing this (not thread-safe, but better
 199.119 +       than nothing -- significantly reduces duration of vulnerability in
 199.120 +       case the advice about DYNAMIC_CRC_TABLE is ignored) */
 199.121 +    if (first) {
 199.122 +        first = 0;
 199.123 +
 199.124 +        /* make exclusive-or pattern from polynomial (0xedb88320UL) */
 199.125 +        poly = 0UL;
 199.126 +        for (n = 0; n < sizeof(p)/sizeof(unsigned char); n++)
 199.127 +            poly |= 1UL << (31 - p[n]);
 199.128 +
 199.129 +        /* generate a crc for every 8-bit value */
 199.130 +        for (n = 0; n < 256; n++) {
 199.131 +            c = (unsigned long)n;
 199.132 +            for (k = 0; k < 8; k++)
 199.133 +                c = c & 1 ? poly ^ (c >> 1) : c >> 1;
 199.134 +            crc_table[0][n] = c;
 199.135 +        }
 199.136 +
 199.137 +#ifdef BYFOUR
 199.138 +        /* generate crc for each value followed by one, two, and three zeros,
 199.139 +           and then the byte reversal of those as well as the first table */
 199.140 +        for (n = 0; n < 256; n++) {
 199.141 +            c = crc_table[0][n];
 199.142 +            crc_table[4][n] = REV(c);
 199.143 +            for (k = 1; k < 4; k++) {
 199.144 +                c = crc_table[0][c & 0xff] ^ (c >> 8);
 199.145 +                crc_table[k][n] = c;
 199.146 +                crc_table[k + 4][n] = REV(c);
 199.147 +            }
 199.148 +        }
 199.149 +#endif /* BYFOUR */
 199.150 +
 199.151 +        crc_table_empty = 0;
 199.152 +    }
 199.153 +    else {      /* not first */
 199.154 +        /* wait for the other guy to finish (not efficient, but rare) */
 199.155 +        while (crc_table_empty)
 199.156 +            ;
 199.157 +    }
 199.158 +
 199.159 +#ifdef MAKECRCH
 199.160 +    /* write out CRC tables to crc32.h */
 199.161 +    {
 199.162 +        FILE *out;
 199.163 +
 199.164 +        out = fopen("crc32.h", "w");
 199.165 +        if (out == NULL) return;
 199.166 +        fprintf(out, "/* crc32.h -- tables for rapid CRC calculation\n");
 199.167 +        fprintf(out, " * Generated automatically by crc32.c\n */\n\n");
 199.168 +        fprintf(out, "local const unsigned long FAR ");
 199.169 +        fprintf(out, "crc_table[TBLS][256] =\n{\n  {\n");
 199.170 +        write_table(out, crc_table[0]);
 199.171 +#  ifdef BYFOUR
 199.172 +        fprintf(out, "#ifdef BYFOUR\n");
 199.173 +        for (k = 1; k < 8; k++) {
 199.174 +            fprintf(out, "  },\n  {\n");
 199.175 +            write_table(out, crc_table[k]);
 199.176 +        }
 199.177 +        fprintf(out, "#endif\n");
 199.178 +#  endif /* BYFOUR */
 199.179 +        fprintf(out, "  }\n};\n");
 199.180 +        fclose(out);
 199.181 +    }
 199.182 +#endif /* MAKECRCH */
 199.183 +}
 199.184 +
 199.185 +#ifdef MAKECRCH
 199.186 +local void write_table(out, table)
 199.187 +    FILE *out;
 199.188 +    const unsigned long FAR *table;
 199.189 +{
 199.190 +    int n;
 199.191 +
 199.192 +    for (n = 0; n < 256; n++)
 199.193 +        fprintf(out, "%s0x%08lxUL%s", n % 5 ? "" : "    ", table[n],
 199.194 +                n == 255 ? "\n" : (n % 5 == 4 ? ",\n" : ", "));
 199.195 +}
 199.196 +#endif /* MAKECRCH */
 199.197 +
 199.198 +#else /* !DYNAMIC_CRC_TABLE */
 199.199 +/* ========================================================================
 199.200 + * Tables of CRC-32s of all single-byte values, made by make_crc_table().
 199.201 + */
 199.202 +#include "crc32.h"
 199.203 +#endif /* DYNAMIC_CRC_TABLE */
 199.204 +
 199.205 +/* =========================================================================
 199.206 + * This function can be used by asm versions of crc32()
 199.207 + */
 199.208 +const unsigned long FAR * ZEXPORT get_crc_table()
 199.209 +{
 199.210 +#ifdef DYNAMIC_CRC_TABLE
 199.211 +    if (crc_table_empty)
 199.212 +        make_crc_table();
 199.213 +#endif /* DYNAMIC_CRC_TABLE */
 199.214 +    return (const unsigned long FAR *)crc_table;
 199.215 +}
 199.216 +
 199.217 +/* ========================================================================= */
 199.218 +#define DO1 crc = crc_table[0][((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8)
 199.219 +#define DO8 DO1; DO1; DO1; DO1; DO1; DO1; DO1; DO1
 199.220 +
 199.221 +/* ========================================================================= */
 199.222 +unsigned long ZEXPORT crc32(crc, buf, len)
 199.223 +    unsigned long crc;
 199.224 +    const unsigned char FAR *buf;
 199.225 +    unsigned len;
 199.226 +{
 199.227 +    if (buf == Z_NULL) return 0UL;
 199.228 +
 199.229 +#ifdef DYNAMIC_CRC_TABLE
 199.230 +    if (crc_table_empty)
 199.231 +        make_crc_table();
 199.232 +#endif /* DYNAMIC_CRC_TABLE */
 199.233 +
 199.234 +#ifdef BYFOUR
 199.235 +    if (sizeof(void *) == sizeof(ptrdiff_t)) {
 199.236 +        u4 endian;
 199.237 +
 199.238 +        endian = 1;
 199.239 +        if (*((unsigned char *)(&endian)))
 199.240 +            return crc32_little(crc, buf, len);
 199.241 +        else
 199.242 +            return crc32_big(crc, buf, len);
 199.243 +    }
 199.244 +#endif /* BYFOUR */
 199.245 +    crc = crc ^ 0xffffffffUL;
 199.246 +    while (len >= 8) {
 199.247 +        DO8;
 199.248 +        len -= 8;
 199.249 +    }
 199.250 +    if (len) do {
 199.251 +        DO1;
 199.252 +    } while (--len);
 199.253 +    return crc ^ 0xffffffffUL;
 199.254 +}
 199.255 +
 199.256 +#ifdef BYFOUR
 199.257 +
 199.258 +/* ========================================================================= */
 199.259 +#define DOLIT4 c ^= *buf4++; \
 199.260 +        c = crc_table[3][c & 0xff] ^ crc_table[2][(c >> 8) & 0xff] ^ \
 199.261 +            crc_table[1][(c >> 16) & 0xff] ^ crc_table[0][c >> 24]
 199.262 +#define DOLIT32 DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4
 199.263 +
 199.264 +/* ========================================================================= */
 199.265 +local unsigned long crc32_little(crc, buf, len)
 199.266 +    unsigned long crc;
 199.267 +    const unsigned char FAR *buf;
 199.268 +    unsigned len;
 199.269 +{
 199.270 +    register u4 c;
 199.271 +    register const u4 FAR *buf4;
 199.272 +
 199.273 +    c = (u4)crc;
 199.274 +    c = ~c;
 199.275 +    while (len && ((ptrdiff_t)buf & 3)) {
 199.276 +        c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);
 199.277 +        len--;
 199.278 +    }
 199.279 +
 199.280 +    buf4 = (const u4 FAR *)(const void FAR *)buf;
 199.281 +    while (len >= 32) {
 199.282 +        DOLIT32;
 199.283 +        len -= 32;
 199.284 +    }
 199.285 +    while (len >= 4) {
 199.286 +        DOLIT4;
 199.287 +        len -= 4;
 199.288 +    }
 199.289 +    buf = (const unsigned char FAR *)buf4;
 199.290 +
 199.291 +    if (len) do {
 199.292 +        c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);
 199.293 +    } while (--len);
 199.294 +    c = ~c;
 199.295 +    return (unsigned long)c;
 199.296 +}
 199.297 +
 199.298 +/* ========================================================================= */
 199.299 +#define DOBIG4 c ^= *++buf4; \
 199.300 +        c = crc_table[4][c & 0xff] ^ crc_table[5][(c >> 8) & 0xff] ^ \
 199.301 +            crc_table[6][(c >> 16) & 0xff] ^ crc_table[7][c >> 24]
 199.302 +#define DOBIG32 DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4
 199.303 +
 199.304 +/* ========================================================================= */
 199.305 +local unsigned long crc32_big(crc, buf, len)
 199.306 +    unsigned long crc;
 199.307 +    const unsigned char FAR *buf;
 199.308 +    unsigned len;
 199.309 +{
 199.310 +    register u4 c;
 199.311 +    register const u4 FAR *buf4;
 199.312 +
 199.313 +    c = REV((u4)crc);
 199.314 +    c = ~c;
 199.315 +    while (len && ((ptrdiff_t)buf & 3)) {
 199.316 +        c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);
 199.317 +        len--;
 199.318 +    }
 199.319 +
 199.320 +    buf4 = (const u4 FAR *)(const void FAR *)buf;
 199.321 +    buf4--;
 199.322 +    while (len >= 32) {
 199.323 +        DOBIG32;
 199.324 +        len -= 32;
 199.325 +    }
 199.326 +    while (len >= 4) {
 199.327 +        DOBIG4;
 199.328 +        len -= 4;
 199.329 +    }
 199.330 +    buf4++;
 199.331 +    buf = (const unsigned char FAR *)buf4;
 199.332 +
 199.333 +    if (len) do {
 199.334 +        c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);
 199.335 +    } while (--len);
 199.336 +    c = ~c;
 199.337 +    return (unsigned long)(REV(c));
 199.338 +}
 199.339 +
 199.340 +#endif /* BYFOUR */
 199.341 +
 199.342 +#define GF2_DIM 32      /* dimension of GF(2) vectors (length of CRC) */
 199.343 +
 199.344 +/* ========================================================================= */
 199.345 +local unsigned long gf2_matrix_times(mat, vec)
 199.346 +    unsigned long *mat;
 199.347 +    unsigned long vec;
 199.348 +{
 199.349 +    unsigned long sum;
 199.350 +
 199.351 +    sum = 0;
 199.352 +    while (vec) {
 199.353 +        if (vec & 1)
 199.354 +            sum ^= *mat;
 199.355 +        vec >>= 1;
 199.356 +        mat++;
 199.357 +    }
 199.358 +    return sum;
 199.359 +}
 199.360 +
 199.361 +/* ========================================================================= */
 199.362 +local void gf2_matrix_square(square, mat)
 199.363 +    unsigned long *square;
 199.364 +    unsigned long *mat;
 199.365 +{
 199.366 +    int n;
 199.367 +
 199.368 +    for (n = 0; n < GF2_DIM; n++)
 199.369 +        square[n] = gf2_matrix_times(mat, mat[n]);
 199.370 +}
 199.371 +
 199.372 +/* ========================================================================= */
 199.373 +uLong ZEXPORT crc32_combine(crc1, crc2, len2)
 199.374 +    uLong crc1;
 199.375 +    uLong crc2;
 199.376 +    z_off_t len2;
 199.377 +{
 199.378 +    int n;
 199.379 +    unsigned long row;
 199.380 +    unsigned long even[GF2_DIM];    /* even-power-of-two zeros operator */
 199.381 +    unsigned long odd[GF2_DIM];     /* odd-power-of-two zeros operator */
 199.382 +
 199.383 +    /* degenerate case */
 199.384 +    if (len2 == 0)
 199.385 +        return crc1;
 199.386 +
 199.387 +    /* put operator for one zero bit in odd */
 199.388 +    odd[0] = 0xedb88320L;           /* CRC-32 polynomial */
 199.389 +    row = 1;
 199.390 +    for (n = 1; n < GF2_DIM; n++) {
 199.391 +        odd[n] = row;
 199.392 +        row <<= 1;
 199.393 +    }
 199.394 +
 199.395 +    /* put operator for two zero bits in even */
 199.396 +    gf2_matrix_square(even, odd);
 199.397 +
 199.398 +    /* put operator for four zero bits in odd */
 199.399 +    gf2_matrix_square(odd, even);
 199.400 +
 199.401 +    /* apply len2 zeros to crc1 (first square will put the operator for one
 199.402 +       zero byte, eight zero bits, in even) */
 199.403 +    do {
 199.404 +        /* apply zeros operator for this bit of len2 */
 199.405 +        gf2_matrix_square(even, odd);
 199.406 +        if (len2 & 1)
 199.407 +            crc1 = gf2_matrix_times(even, crc1);
 199.408 +        len2 >>= 1;
 199.409 +
 199.410 +        /* if no more bits set, then done */
 199.411 +        if (len2 == 0)
 199.412 +            break;
 199.413 +
 199.414 +        /* another iteration of the loop with odd and even swapped */
 199.415 +        gf2_matrix_square(odd, even);
 199.416 +        if (len2 & 1)
 199.417 +            crc1 = gf2_matrix_times(odd, crc1);
 199.418 +        len2 >>= 1;
 199.419 +
 199.420 +        /* if no more bits set, then done */
 199.421 +    } while (len2 != 0);
 199.422 +
 199.423 +    /* return combined crc */
 199.424 +    crc1 ^= crc2;
 199.425 +    return crc1;
 199.426 +}
   200.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   200.2 +++ b/libs/zlib/crc32.h	Sun Nov 01 00:36:56 2015 +0200
   200.3 @@ -0,0 +1,441 @@
   200.4 +/* crc32.h -- tables for rapid CRC calculation
   200.5 + * Generated automatically by crc32.c
   200.6 + */
   200.7 +
   200.8 +local const unsigned long FAR crc_table[TBLS][256] =
   200.9 +{
  200.10 +  {
  200.11 +    0x00000000UL, 0x77073096UL, 0xee0e612cUL, 0x990951baUL, 0x076dc419UL,
  200.12 +    0x706af48fUL, 0xe963a535UL, 0x9e6495a3UL, 0x0edb8832UL, 0x79dcb8a4UL,
  200.13 +    0xe0d5e91eUL, 0x97d2d988UL, 0x09b64c2bUL, 0x7eb17cbdUL, 0xe7b82d07UL,
  200.14 +    0x90bf1d91UL, 0x1db71064UL, 0x6ab020f2UL, 0xf3b97148UL, 0x84be41deUL,
  200.15 +    0x1adad47dUL, 0x6ddde4ebUL, 0xf4d4b551UL, 0x83d385c7UL, 0x136c9856UL,
  200.16 +    0x646ba8c0UL, 0xfd62f97aUL, 0x8a65c9ecUL, 0x14015c4fUL, 0x63066cd9UL,
  200.17 +    0xfa0f3d63UL, 0x8d080df5UL, 0x3b6e20c8UL, 0x4c69105eUL, 0xd56041e4UL,
  200.18 +    0xa2677172UL, 0x3c03e4d1UL, 0x4b04d447UL, 0xd20d85fdUL, 0xa50ab56bUL,
  200.19 +    0x35b5a8faUL, 0x42b2986cUL, 0xdbbbc9d6UL, 0xacbcf940UL, 0x32d86ce3UL,
  200.20 +    0x45df5c75UL, 0xdcd60dcfUL, 0xabd13d59UL, 0x26d930acUL, 0x51de003aUL,
  200.21 +    0xc8d75180UL, 0xbfd06116UL, 0x21b4f4b5UL, 0x56b3c423UL, 0xcfba9599UL,
  200.22 +    0xb8bda50fUL, 0x2802b89eUL, 0x5f058808UL, 0xc60cd9b2UL, 0xb10be924UL,
  200.23 +    0x2f6f7c87UL, 0x58684c11UL, 0xc1611dabUL, 0xb6662d3dUL, 0x76dc4190UL,
  200.24 +    0x01db7106UL, 0x98d220bcUL, 0xefd5102aUL, 0x71b18589UL, 0x06b6b51fUL,
  200.25 +    0x9fbfe4a5UL, 0xe8b8d433UL, 0x7807c9a2UL, 0x0f00f934UL, 0x9609a88eUL,
  200.26 +    0xe10e9818UL, 0x7f6a0dbbUL, 0x086d3d2dUL, 0x91646c97UL, 0xe6635c01UL,
  200.27 +    0x6b6b51f4UL, 0x1c6c6162UL, 0x856530d8UL, 0xf262004eUL, 0x6c0695edUL,
  200.28 +    0x1b01a57bUL, 0x8208f4c1UL, 0xf50fc457UL, 0x65b0d9c6UL, 0x12b7e950UL,
  200.29 +    0x8bbeb8eaUL, 0xfcb9887cUL, 0x62dd1ddfUL, 0x15da2d49UL, 0x8cd37cf3UL,
  200.30 +    0xfbd44c65UL, 0x4db26158UL, 0x3ab551ceUL, 0xa3bc0074UL, 0xd4bb30e2UL,
  200.31 +    0x4adfa541UL, 0x3dd895d7UL, 0xa4d1c46dUL, 0xd3d6f4fbUL, 0x4369e96aUL,
  200.32 +    0x346ed9fcUL, 0xad678846UL, 0xda60b8d0UL, 0x44042d73UL, 0x33031de5UL,
  200.33 +    0xaa0a4c5fUL, 0xdd0d7cc9UL, 0x5005713cUL, 0x270241aaUL, 0xbe0b1010UL,
  200.34 +    0xc90c2086UL, 0x5768b525UL, 0x206f85b3UL, 0xb966d409UL, 0xce61e49fUL,
  200.35 +    0x5edef90eUL, 0x29d9c998UL, 0xb0d09822UL, 0xc7d7a8b4UL, 0x59b33d17UL,
  200.36 +    0x2eb40d81UL, 0xb7bd5c3bUL, 0xc0ba6cadUL, 0xedb88320UL, 0x9abfb3b6UL,
  200.37 +    0x03b6e20cUL, 0x74b1d29aUL, 0xead54739UL, 0x9dd277afUL, 0x04db2615UL,
  200.38 +    0x73dc1683UL, 0xe3630b12UL, 0x94643b84UL, 0x0d6d6a3eUL, 0x7a6a5aa8UL,
  200.39 +    0xe40ecf0bUL, 0x9309ff9dUL, 0x0a00ae27UL, 0x7d079eb1UL, 0xf00f9344UL,
  200.40 +    0x8708a3d2UL, 0x1e01f268UL, 0x6906c2feUL, 0xf762575dUL, 0x806567cbUL,
  200.41 +    0x196c3671UL, 0x6e6b06e7UL, 0xfed41b76UL, 0x89d32be0UL, 0x10da7a5aUL,
  200.42 +    0x67dd4accUL, 0xf9b9df6fUL, 0x8ebeeff9UL, 0x17b7be43UL, 0x60b08ed5UL,
  200.43 +    0xd6d6a3e8UL, 0xa1d1937eUL, 0x38d8c2c4UL, 0x4fdff252UL, 0xd1bb67f1UL,
  200.44 +    0xa6bc5767UL, 0x3fb506ddUL, 0x48b2364bUL, 0xd80d2bdaUL, 0xaf0a1b4cUL,
  200.45 +    0x36034af6UL, 0x41047a60UL, 0xdf60efc3UL, 0xa867df55UL, 0x316e8eefUL,
  200.46 +    0x4669be79UL, 0xcb61b38cUL, 0xbc66831aUL, 0x256fd2a0UL, 0x5268e236UL,
  200.47 +    0xcc0c7795UL, 0xbb0b4703UL, 0x220216b9UL, 0x5505262fUL, 0xc5ba3bbeUL,
  200.48 +    0xb2bd0b28UL, 0x2bb45a92UL, 0x5cb36a04UL, 0xc2d7ffa7UL, 0xb5d0cf31UL,
  200.49 +    0x2cd99e8bUL, 0x5bdeae1dUL, 0x9b64c2b0UL, 0xec63f226UL, 0x756aa39cUL,
  200.50 +    0x026d930aUL, 0x9c0906a9UL, 0xeb0e363fUL, 0x72076785UL, 0x05005713UL,
  200.51 +    0x95bf4a82UL, 0xe2b87a14UL, 0x7bb12baeUL, 0x0cb61b38UL, 0x92d28e9bUL,
  200.52 +    0xe5d5be0dUL, 0x7cdcefb7UL, 0x0bdbdf21UL, 0x86d3d2d4UL, 0xf1d4e242UL,
  200.53 +    0x68ddb3f8UL, 0x1fda836eUL, 0x81be16cdUL, 0xf6b9265bUL, 0x6fb077e1UL,
  200.54 +    0x18b74777UL, 0x88085ae6UL, 0xff0f6a70UL, 0x66063bcaUL, 0x11010b5cUL,
  200.55 +    0x8f659effUL, 0xf862ae69UL, 0x616bffd3UL, 0x166ccf45UL, 0xa00ae278UL,
  200.56 +    0xd70dd2eeUL, 0x4e048354UL, 0x3903b3c2UL, 0xa7672661UL, 0xd06016f7UL,
  200.57 +    0x4969474dUL, 0x3e6e77dbUL, 0xaed16a4aUL, 0xd9d65adcUL, 0x40df0b66UL,
  200.58 +    0x37d83bf0UL, 0xa9bcae53UL, 0xdebb9ec5UL, 0x47b2cf7fUL, 0x30b5ffe9UL,
  200.59 +    0xbdbdf21cUL, 0xcabac28aUL, 0x53b39330UL, 0x24b4a3a6UL, 0xbad03605UL,
  200.60 +    0xcdd70693UL, 0x54de5729UL, 0x23d967bfUL, 0xb3667a2eUL, 0xc4614ab8UL,
  200.61 +    0x5d681b02UL, 0x2a6f2b94UL, 0xb40bbe37UL, 0xc30c8ea1UL, 0x5a05df1bUL,
  200.62 +    0x2d02ef8dUL
  200.63 +#ifdef BYFOUR
  200.64 +  },
  200.65 +  {
  200.66 +    0x00000000UL, 0x191b3141UL, 0x32366282UL, 0x2b2d53c3UL, 0x646cc504UL,
  200.67 +    0x7d77f445UL, 0x565aa786UL, 0x4f4196c7UL, 0xc8d98a08UL, 0xd1c2bb49UL,
  200.68 +    0xfaefe88aUL, 0xe3f4d9cbUL, 0xacb54f0cUL, 0xb5ae7e4dUL, 0x9e832d8eUL,
  200.69 +    0x87981ccfUL, 0x4ac21251UL, 0x53d92310UL, 0x78f470d3UL, 0x61ef4192UL,
  200.70 +    0x2eaed755UL, 0x37b5e614UL, 0x1c98b5d7UL, 0x05838496UL, 0x821b9859UL,
  200.71 +    0x9b00a918UL, 0xb02dfadbUL, 0xa936cb9aUL, 0xe6775d5dUL, 0xff6c6c1cUL,
  200.72 +    0xd4413fdfUL, 0xcd5a0e9eUL, 0x958424a2UL, 0x8c9f15e3UL, 0xa7b24620UL,
  200.73 +    0xbea97761UL, 0xf1e8e1a6UL, 0xe8f3d0e7UL, 0xc3de8324UL, 0xdac5b265UL,
  200.74 +    0x5d5daeaaUL, 0x44469febUL, 0x6f6bcc28UL, 0x7670fd69UL, 0x39316baeUL,
  200.75 +    0x202a5aefUL, 0x0b07092cUL, 0x121c386dUL, 0xdf4636f3UL, 0xc65d07b2UL,
  200.76 +    0xed705471UL, 0xf46b6530UL, 0xbb2af3f7UL, 0xa231c2b6UL, 0x891c9175UL,
  200.77 +    0x9007a034UL, 0x179fbcfbUL, 0x0e848dbaUL, 0x25a9de79UL, 0x3cb2ef38UL,
  200.78 +    0x73f379ffUL, 0x6ae848beUL, 0x41c51b7dUL, 0x58de2a3cUL, 0xf0794f05UL,
  200.79 +    0xe9627e44UL, 0xc24f2d87UL, 0xdb541cc6UL, 0x94158a01UL, 0x8d0ebb40UL,
  200.80 +    0xa623e883UL, 0xbf38d9c2UL, 0x38a0c50dUL, 0x21bbf44cUL, 0x0a96a78fUL,
  200.81 +    0x138d96ceUL, 0x5ccc0009UL, 0x45d73148UL, 0x6efa628bUL, 0x77e153caUL,
  200.82 +    0xbabb5d54UL, 0xa3a06c15UL, 0x888d3fd6UL, 0x91960e97UL, 0xded79850UL,
  200.83 +    0xc7cca911UL, 0xece1fad2UL, 0xf5facb93UL, 0x7262d75cUL, 0x6b79e61dUL,
  200.84 +    0x4054b5deUL, 0x594f849fUL, 0x160e1258UL, 0x0f152319UL, 0x243870daUL,
  200.85 +    0x3d23419bUL, 0x65fd6ba7UL, 0x7ce65ae6UL, 0x57cb0925UL, 0x4ed03864UL,
  200.86 +    0x0191aea3UL, 0x188a9fe2UL, 0x33a7cc21UL, 0x2abcfd60UL, 0xad24e1afUL,
  200.87 +    0xb43fd0eeUL, 0x9f12832dUL, 0x8609b26cUL, 0xc94824abUL, 0xd05315eaUL,
  200.88 +    0xfb7e4629UL, 0xe2657768UL, 0x2f3f79f6UL, 0x362448b7UL, 0x1d091b74UL,
  200.89 +    0x04122a35UL, 0x4b53bcf2UL, 0x52488db3UL, 0x7965de70UL, 0x607eef31UL,
  200.90 +    0xe7e6f3feUL, 0xfefdc2bfUL, 0xd5d0917cUL, 0xcccba03dUL, 0x838a36faUL,
  200.91 +    0x9a9107bbUL, 0xb1bc5478UL, 0xa8a76539UL, 0x3b83984bUL, 0x2298a90aUL,
  200.92 +    0x09b5fac9UL, 0x10aecb88UL, 0x5fef5d4fUL, 0x46f46c0eUL, 0x6dd93fcdUL,
  200.93 +    0x74c20e8cUL, 0xf35a1243UL, 0xea412302UL, 0xc16c70c1UL, 0xd8774180UL,
  200.94 +    0x9736d747UL, 0x8e2de606UL, 0xa500b5c5UL, 0xbc1b8484UL, 0x71418a1aUL,
  200.95 +    0x685abb5bUL, 0x4377e898UL, 0x5a6cd9d9UL, 0x152d4f1eUL, 0x0c367e5fUL,
  200.96 +    0x271b2d9cUL, 0x3e001cddUL, 0xb9980012UL, 0xa0833153UL, 0x8bae6290UL,
  200.97 +    0x92b553d1UL, 0xddf4c516UL, 0xc4eff457UL, 0xefc2a794UL, 0xf6d996d5UL,
  200.98 +    0xae07bce9UL, 0xb71c8da8UL, 0x9c31de6bUL, 0x852aef2aUL, 0xca6b79edUL,
  200.99 +    0xd37048acUL, 0xf85d1b6fUL, 0xe1462a2eUL, 0x66de36e1UL, 0x7fc507a0UL,
 200.100 +    0x54e85463UL, 0x4df36522UL, 0x02b2f3e5UL, 0x1ba9c2a4UL, 0x30849167UL,
 200.101 +    0x299fa026UL, 0xe4c5aeb8UL, 0xfdde9ff9UL, 0xd6f3cc3aUL, 0xcfe8fd7bUL,
 200.102 +    0x80a96bbcUL, 0x99b25afdUL, 0xb29f093eUL, 0xab84387fUL, 0x2c1c24b0UL,
 200.103 +    0x350715f1UL, 0x1e2a4632UL, 0x07317773UL, 0x4870e1b4UL, 0x516bd0f5UL,
 200.104 +    0x7a468336UL, 0x635db277UL, 0xcbfad74eUL, 0xd2e1e60fUL, 0xf9ccb5ccUL,
 200.105 +    0xe0d7848dUL, 0xaf96124aUL, 0xb68d230bUL, 0x9da070c8UL, 0x84bb4189UL,
 200.106 +    0x03235d46UL, 0x1a386c07UL, 0x31153fc4UL, 0x280e0e85UL, 0x674f9842UL,
 200.107 +    0x7e54a903UL, 0x5579fac0UL, 0x4c62cb81UL, 0x8138c51fUL, 0x9823f45eUL,
 200.108 +    0xb30ea79dUL, 0xaa1596dcUL, 0xe554001bUL, 0xfc4f315aUL, 0xd7626299UL,
 200.109 +    0xce7953d8UL, 0x49e14f17UL, 0x50fa7e56UL, 0x7bd72d95UL, 0x62cc1cd4UL,
 200.110 +    0x2d8d8a13UL, 0x3496bb52UL, 0x1fbbe891UL, 0x06a0d9d0UL, 0x5e7ef3ecUL,
 200.111 +    0x4765c2adUL, 0x6c48916eUL, 0x7553a02fUL, 0x3a1236e8UL, 0x230907a9UL,
 200.112 +    0x0824546aUL, 0x113f652bUL, 0x96a779e4UL, 0x8fbc48a5UL, 0xa4911b66UL,
 200.113 +    0xbd8a2a27UL, 0xf2cbbce0UL, 0xebd08da1UL, 0xc0fdde62UL, 0xd9e6ef23UL,
 200.114 +    0x14bce1bdUL, 0x0da7d0fcUL, 0x268a833fUL, 0x3f91b27eUL, 0x70d024b9UL,
 200.115 +    0x69cb15f8UL, 0x42e6463bUL, 0x5bfd777aUL, 0xdc656bb5UL, 0xc57e5af4UL,
 200.116 +    0xee530937UL, 0xf7483876UL, 0xb809aeb1UL, 0xa1129ff0UL, 0x8a3fcc33UL,
 200.117 +    0x9324fd72UL
 200.118 +  },
 200.119 +  {
 200.120 +    0x00000000UL, 0x01c26a37UL, 0x0384d46eUL, 0x0246be59UL, 0x0709a8dcUL,
 200.121 +    0x06cbc2ebUL, 0x048d7cb2UL, 0x054f1685UL, 0x0e1351b8UL, 0x0fd13b8fUL,
 200.122 +    0x0d9785d6UL, 0x0c55efe1UL, 0x091af964UL, 0x08d89353UL, 0x0a9e2d0aUL,
 200.123 +    0x0b5c473dUL, 0x1c26a370UL, 0x1de4c947UL, 0x1fa2771eUL, 0x1e601d29UL,
 200.124 +    0x1b2f0bacUL, 0x1aed619bUL, 0x18abdfc2UL, 0x1969b5f5UL, 0x1235f2c8UL,
 200.125 +    0x13f798ffUL, 0x11b126a6UL, 0x10734c91UL, 0x153c5a14UL, 0x14fe3023UL,
 200.126 +    0x16b88e7aUL, 0x177ae44dUL, 0x384d46e0UL, 0x398f2cd7UL, 0x3bc9928eUL,
 200.127 +    0x3a0bf8b9UL, 0x3f44ee3cUL, 0x3e86840bUL, 0x3cc03a52UL, 0x3d025065UL,
 200.128 +    0x365e1758UL, 0x379c7d6fUL, 0x35dac336UL, 0x3418a901UL, 0x3157bf84UL,
 200.129 +    0x3095d5b3UL, 0x32d36beaUL, 0x331101ddUL, 0x246be590UL, 0x25a98fa7UL,
 200.130 +    0x27ef31feUL, 0x262d5bc9UL, 0x23624d4cUL, 0x22a0277bUL, 0x20e69922UL,
 200.131 +    0x2124f315UL, 0x2a78b428UL, 0x2bbade1fUL, 0x29fc6046UL, 0x283e0a71UL,
 200.132 +    0x2d711cf4UL, 0x2cb376c3UL, 0x2ef5c89aUL, 0x2f37a2adUL, 0x709a8dc0UL,
 200.133 +    0x7158e7f7UL, 0x731e59aeUL, 0x72dc3399UL, 0x7793251cUL, 0x76514f2bUL,
 200.134 +    0x7417f172UL, 0x75d59b45UL, 0x7e89dc78UL, 0x7f4bb64fUL, 0x7d0d0816UL,
 200.135 +    0x7ccf6221UL, 0x798074a4UL, 0x78421e93UL, 0x7a04a0caUL, 0x7bc6cafdUL,
 200.136 +    0x6cbc2eb0UL, 0x6d7e4487UL, 0x6f38fadeUL, 0x6efa90e9UL, 0x6bb5866cUL,
 200.137 +    0x6a77ec5bUL, 0x68315202UL, 0x69f33835UL, 0x62af7f08UL, 0x636d153fUL,
 200.138 +    0x612bab66UL, 0x60e9c151UL, 0x65a6d7d4UL, 0x6464bde3UL, 0x662203baUL,
 200.139 +    0x67e0698dUL, 0x48d7cb20UL, 0x4915a117UL, 0x4b531f4eUL, 0x4a917579UL,
 200.140 +    0x4fde63fcUL, 0x4e1c09cbUL, 0x4c5ab792UL, 0x4d98dda5UL, 0x46c49a98UL,
 200.141 +    0x4706f0afUL, 0x45404ef6UL, 0x448224c1UL, 0x41cd3244UL, 0x400f5873UL,
 200.142 +    0x4249e62aUL, 0x438b8c1dUL, 0x54f16850UL, 0x55330267UL, 0x5775bc3eUL,
 200.143 +    0x56b7d609UL, 0x53f8c08cUL, 0x523aaabbUL, 0x507c14e2UL, 0x51be7ed5UL,
 200.144 +    0x5ae239e8UL, 0x5b2053dfUL, 0x5966ed86UL, 0x58a487b1UL, 0x5deb9134UL,
 200.145 +    0x5c29fb03UL, 0x5e6f455aUL, 0x5fad2f6dUL, 0xe1351b80UL, 0xe0f771b7UL,
 200.146 +    0xe2b1cfeeUL, 0xe373a5d9UL, 0xe63cb35cUL, 0xe7fed96bUL, 0xe5b86732UL,
 200.147 +    0xe47a0d05UL, 0xef264a38UL, 0xeee4200fUL, 0xeca29e56UL, 0xed60f461UL,
 200.148 +    0xe82fe2e4UL, 0xe9ed88d3UL, 0xebab368aUL, 0xea695cbdUL, 0xfd13b8f0UL,
 200.149 +    0xfcd1d2c7UL, 0xfe976c9eUL, 0xff5506a9UL, 0xfa1a102cUL, 0xfbd87a1bUL,
 200.150 +    0xf99ec442UL, 0xf85cae75UL, 0xf300e948UL, 0xf2c2837fUL, 0xf0843d26UL,
 200.151 +    0xf1465711UL, 0xf4094194UL, 0xf5cb2ba3UL, 0xf78d95faUL, 0xf64fffcdUL,
 200.152 +    0xd9785d60UL, 0xd8ba3757UL, 0xdafc890eUL, 0xdb3ee339UL, 0xde71f5bcUL,
 200.153 +    0xdfb39f8bUL, 0xddf521d2UL, 0xdc374be5UL, 0xd76b0cd8UL, 0xd6a966efUL,
 200.154 +    0xd4efd8b6UL, 0xd52db281UL, 0xd062a404UL, 0xd1a0ce33UL, 0xd3e6706aUL,
 200.155 +    0xd2241a5dUL, 0xc55efe10UL, 0xc49c9427UL, 0xc6da2a7eUL, 0xc7184049UL,
 200.156 +    0xc25756ccUL, 0xc3953cfbUL, 0xc1d382a2UL, 0xc011e895UL, 0xcb4dafa8UL,
 200.157 +    0xca8fc59fUL, 0xc8c97bc6UL, 0xc90b11f1UL, 0xcc440774UL, 0xcd866d43UL,
 200.158 +    0xcfc0d31aUL, 0xce02b92dUL, 0x91af9640UL, 0x906dfc77UL, 0x922b422eUL,
 200.159 +    0x93e92819UL, 0x96a63e9cUL, 0x976454abUL, 0x9522eaf2UL, 0x94e080c5UL,
 200.160 +    0x9fbcc7f8UL, 0x9e7eadcfUL, 0x9c381396UL, 0x9dfa79a1UL, 0x98b56f24UL,
 200.161 +    0x99770513UL, 0x9b31bb4aUL, 0x9af3d17dUL, 0x8d893530UL, 0x8c4b5f07UL,
 200.162 +    0x8e0de15eUL, 0x8fcf8b69UL, 0x8a809decUL, 0x8b42f7dbUL, 0x89044982UL,
 200.163 +    0x88c623b5UL, 0x839a6488UL, 0x82580ebfUL, 0x801eb0e6UL, 0x81dcdad1UL,
 200.164 +    0x8493cc54UL, 0x8551a663UL, 0x8717183aUL, 0x86d5720dUL, 0xa9e2d0a0UL,
 200.165 +    0xa820ba97UL, 0xaa6604ceUL, 0xaba46ef9UL, 0xaeeb787cUL, 0xaf29124bUL,
 200.166 +    0xad6fac12UL, 0xacadc625UL, 0xa7f18118UL, 0xa633eb2fUL, 0xa4755576UL,
 200.167 +    0xa5b73f41UL, 0xa0f829c4UL, 0xa13a43f3UL, 0xa37cfdaaUL, 0xa2be979dUL,
 200.168 +    0xb5c473d0UL, 0xb40619e7UL, 0xb640a7beUL, 0xb782cd89UL, 0xb2cddb0cUL,
 200.169 +    0xb30fb13bUL, 0xb1490f62UL, 0xb08b6555UL, 0xbbd72268UL, 0xba15485fUL,
 200.170 +    0xb853f606UL, 0xb9919c31UL, 0xbcde8ab4UL, 0xbd1ce083UL, 0xbf5a5edaUL,
 200.171 +    0xbe9834edUL
 200.172 +  },
 200.173 +  {
 200.174 +    0x00000000UL, 0xb8bc6765UL, 0xaa09c88bUL, 0x12b5afeeUL, 0x8f629757UL,
 200.175 +    0x37def032UL, 0x256b5fdcUL, 0x9dd738b9UL, 0xc5b428efUL, 0x7d084f8aUL,
 200.176 +    0x6fbde064UL, 0xd7018701UL, 0x4ad6bfb8UL, 0xf26ad8ddUL, 0xe0df7733UL,
 200.177 +    0x58631056UL, 0x5019579fUL, 0xe8a530faUL, 0xfa109f14UL, 0x42acf871UL,
 200.178 +    0xdf7bc0c8UL, 0x67c7a7adUL, 0x75720843UL, 0xcdce6f26UL, 0x95ad7f70UL,
 200.179 +    0x2d111815UL, 0x3fa4b7fbUL, 0x8718d09eUL, 0x1acfe827UL, 0xa2738f42UL,
 200.180 +    0xb0c620acUL, 0x087a47c9UL, 0xa032af3eUL, 0x188ec85bUL, 0x0a3b67b5UL,
 200.181 +    0xb28700d0UL, 0x2f503869UL, 0x97ec5f0cUL, 0x8559f0e2UL, 0x3de59787UL,
 200.182 +    0x658687d1UL, 0xdd3ae0b4UL, 0xcf8f4f5aUL, 0x7733283fUL, 0xeae41086UL,
 200.183 +    0x525877e3UL, 0x40edd80dUL, 0xf851bf68UL, 0xf02bf8a1UL, 0x48979fc4UL,
 200.184 +    0x5a22302aUL, 0xe29e574fUL, 0x7f496ff6UL, 0xc7f50893UL, 0xd540a77dUL,
 200.185 +    0x6dfcc018UL, 0x359fd04eUL, 0x8d23b72bUL, 0x9f9618c5UL, 0x272a7fa0UL,
 200.186 +    0xbafd4719UL, 0x0241207cUL, 0x10f48f92UL, 0xa848e8f7UL, 0x9b14583dUL,
 200.187 +    0x23a83f58UL, 0x311d90b6UL, 0x89a1f7d3UL, 0x1476cf6aUL, 0xaccaa80fUL,
 200.188 +    0xbe7f07e1UL, 0x06c36084UL, 0x5ea070d2UL, 0xe61c17b7UL, 0xf4a9b859UL,
 200.189 +    0x4c15df3cUL, 0xd1c2e785UL, 0x697e80e0UL, 0x7bcb2f0eUL, 0xc377486bUL,
 200.190 +    0xcb0d0fa2UL, 0x73b168c7UL, 0x6104c729UL, 0xd9b8a04cUL, 0x446f98f5UL,
 200.191 +    0xfcd3ff90UL, 0xee66507eUL, 0x56da371bUL, 0x0eb9274dUL, 0xb6054028UL,
 200.192 +    0xa4b0efc6UL, 0x1c0c88a3UL, 0x81dbb01aUL, 0x3967d77fUL, 0x2bd27891UL,
 200.193 +    0x936e1ff4UL, 0x3b26f703UL, 0x839a9066UL, 0x912f3f88UL, 0x299358edUL,
 200.194 +    0xb4446054UL, 0x0cf80731UL, 0x1e4da8dfUL, 0xa6f1cfbaUL, 0xfe92dfecUL,
 200.195 +    0x462eb889UL, 0x549b1767UL, 0xec277002UL, 0x71f048bbUL, 0xc94c2fdeUL,
 200.196 +    0xdbf98030UL, 0x6345e755UL, 0x6b3fa09cUL, 0xd383c7f9UL, 0xc1366817UL,
 200.197 +    0x798a0f72UL, 0xe45d37cbUL, 0x5ce150aeUL, 0x4e54ff40UL, 0xf6e89825UL,
 200.198 +    0xae8b8873UL, 0x1637ef16UL, 0x048240f8UL, 0xbc3e279dUL, 0x21e91f24UL,
 200.199 +    0x99557841UL, 0x8be0d7afUL, 0x335cb0caUL, 0xed59b63bUL, 0x55e5d15eUL,
 200.200 +    0x47507eb0UL, 0xffec19d5UL, 0x623b216cUL, 0xda874609UL, 0xc832e9e7UL,
 200.201 +    0x708e8e82UL, 0x28ed9ed4UL, 0x9051f9b1UL, 0x82e4565fUL, 0x3a58313aUL,
 200.202 +    0xa78f0983UL, 0x1f336ee6UL, 0x0d86c108UL, 0xb53aa66dUL, 0xbd40e1a4UL,
 200.203 +    0x05fc86c1UL, 0x1749292fUL, 0xaff54e4aUL, 0x322276f3UL, 0x8a9e1196UL,
 200.204 +    0x982bbe78UL, 0x2097d91dUL, 0x78f4c94bUL, 0xc048ae2eUL, 0xd2fd01c0UL,
 200.205 +    0x6a4166a5UL, 0xf7965e1cUL, 0x4f2a3979UL, 0x5d9f9697UL, 0xe523f1f2UL,
 200.206 +    0x4d6b1905UL, 0xf5d77e60UL, 0xe762d18eUL, 0x5fdeb6ebUL, 0xc2098e52UL,
 200.207 +    0x7ab5e937UL, 0x680046d9UL, 0xd0bc21bcUL, 0x88df31eaUL, 0x3063568fUL,
 200.208 +    0x22d6f961UL, 0x9a6a9e04UL, 0x07bda6bdUL, 0xbf01c1d8UL, 0xadb46e36UL,
 200.209 +    0x15080953UL, 0x1d724e9aUL, 0xa5ce29ffUL, 0xb77b8611UL, 0x0fc7e174UL,
 200.210 +    0x9210d9cdUL, 0x2aacbea8UL, 0x38191146UL, 0x80a57623UL, 0xd8c66675UL,
 200.211 +    0x607a0110UL, 0x72cfaefeUL, 0xca73c99bUL, 0x57a4f122UL, 0xef189647UL,
 200.212 +    0xfdad39a9UL, 0x45115eccUL, 0x764dee06UL, 0xcef18963UL, 0xdc44268dUL,
 200.213 +    0x64f841e8UL, 0xf92f7951UL, 0x41931e34UL, 0x5326b1daUL, 0xeb9ad6bfUL,
 200.214 +    0xb3f9c6e9UL, 0x0b45a18cUL, 0x19f00e62UL, 0xa14c6907UL, 0x3c9b51beUL,
 200.215 +    0x842736dbUL, 0x96929935UL, 0x2e2efe50UL, 0x2654b999UL, 0x9ee8defcUL,
 200.216 +    0x8c5d7112UL, 0x34e11677UL, 0xa9362eceUL, 0x118a49abUL, 0x033fe645UL,
 200.217 +    0xbb838120UL, 0xe3e09176UL, 0x5b5cf613UL, 0x49e959fdUL, 0xf1553e98UL,
 200.218 +    0x6c820621UL, 0xd43e6144UL, 0xc68bceaaUL, 0x7e37a9cfUL, 0xd67f4138UL,
 200.219 +    0x6ec3265dUL, 0x7c7689b3UL, 0xc4caeed6UL, 0x591dd66fUL, 0xe1a1b10aUL,
 200.220 +    0xf3141ee4UL, 0x4ba87981UL, 0x13cb69d7UL, 0xab770eb2UL, 0xb9c2a15cUL,
 200.221 +    0x017ec639UL, 0x9ca9fe80UL, 0x241599e5UL, 0x36a0360bUL, 0x8e1c516eUL,
 200.222 +    0x866616a7UL, 0x3eda71c2UL, 0x2c6fde2cUL, 0x94d3b949UL, 0x090481f0UL,
 200.223 +    0xb1b8e695UL, 0xa30d497bUL, 0x1bb12e1eUL, 0x43d23e48UL, 0xfb6e592dUL,
 200.224 +    0xe9dbf6c3UL, 0x516791a6UL, 0xccb0a91fUL, 0x740cce7aUL, 0x66b96194UL,
 200.225 +    0xde0506f1UL
 200.226 +  },
 200.227 +  {
 200.228 +    0x00000000UL, 0x96300777UL, 0x2c610eeeUL, 0xba510999UL, 0x19c46d07UL,
 200.229 +    0x8ff46a70UL, 0x35a563e9UL, 0xa395649eUL, 0x3288db0eUL, 0xa4b8dc79UL,
 200.230 +    0x1ee9d5e0UL, 0x88d9d297UL, 0x2b4cb609UL, 0xbd7cb17eUL, 0x072db8e7UL,
 200.231 +    0x911dbf90UL, 0x6410b71dUL, 0xf220b06aUL, 0x4871b9f3UL, 0xde41be84UL,
 200.232 +    0x7dd4da1aUL, 0xebe4dd6dUL, 0x51b5d4f4UL, 0xc785d383UL, 0x56986c13UL,
 200.233 +    0xc0a86b64UL, 0x7af962fdUL, 0xecc9658aUL, 0x4f5c0114UL, 0xd96c0663UL,
 200.234 +    0x633d0ffaUL, 0xf50d088dUL, 0xc8206e3bUL, 0x5e10694cUL, 0xe44160d5UL,
 200.235 +    0x727167a2UL, 0xd1e4033cUL, 0x47d4044bUL, 0xfd850dd2UL, 0x6bb50aa5UL,
 200.236 +    0xfaa8b535UL, 0x6c98b242UL, 0xd6c9bbdbUL, 0x40f9bcacUL, 0xe36cd832UL,
 200.237 +    0x755cdf45UL, 0xcf0dd6dcUL, 0x593dd1abUL, 0xac30d926UL, 0x3a00de51UL,
 200.238 +    0x8051d7c8UL, 0x1661d0bfUL, 0xb5f4b421UL, 0x23c4b356UL, 0x9995bacfUL,
 200.239 +    0x0fa5bdb8UL, 0x9eb80228UL, 0x0888055fUL, 0xb2d90cc6UL, 0x24e90bb1UL,
 200.240 +    0x877c6f2fUL, 0x114c6858UL, 0xab1d61c1UL, 0x3d2d66b6UL, 0x9041dc76UL,
 200.241 +    0x0671db01UL, 0xbc20d298UL, 0x2a10d5efUL, 0x8985b171UL, 0x1fb5b606UL,
 200.242 +    0xa5e4bf9fUL, 0x33d4b8e8UL, 0xa2c90778UL, 0x34f9000fUL, 0x8ea80996UL,
 200.243 +    0x18980ee1UL, 0xbb0d6a7fUL, 0x2d3d6d08UL, 0x976c6491UL, 0x015c63e6UL,
 200.244 +    0xf4516b6bUL, 0x62616c1cUL, 0xd8306585UL, 0x4e0062f2UL, 0xed95066cUL,
 200.245 +    0x7ba5011bUL, 0xc1f40882UL, 0x57c40ff5UL, 0xc6d9b065UL, 0x50e9b712UL,
 200.246 +    0xeab8be8bUL, 0x7c88b9fcUL, 0xdf1ddd62UL, 0x492dda15UL, 0xf37cd38cUL,
 200.247 +    0x654cd4fbUL, 0x5861b24dUL, 0xce51b53aUL, 0x7400bca3UL, 0xe230bbd4UL,
 200.248 +    0x41a5df4aUL, 0xd795d83dUL, 0x6dc4d1a4UL, 0xfbf4d6d3UL, 0x6ae96943UL,
 200.249 +    0xfcd96e34UL, 0x468867adUL, 0xd0b860daUL, 0x732d0444UL, 0xe51d0333UL,
 200.250 +    0x5f4c0aaaUL, 0xc97c0dddUL, 0x3c710550UL, 0xaa410227UL, 0x10100bbeUL,
 200.251 +    0x86200cc9UL, 0x25b56857UL, 0xb3856f20UL, 0x09d466b9UL, 0x9fe461ceUL,
 200.252 +    0x0ef9de5eUL, 0x98c9d929UL, 0x2298d0b0UL, 0xb4a8d7c7UL, 0x173db359UL,
 200.253 +    0x810db42eUL, 0x3b5cbdb7UL, 0xad6cbac0UL, 0x2083b8edUL, 0xb6b3bf9aUL,
 200.254 +    0x0ce2b603UL, 0x9ad2b174UL, 0x3947d5eaUL, 0xaf77d29dUL, 0x1526db04UL,
 200.255 +    0x8316dc73UL, 0x120b63e3UL, 0x843b6494UL, 0x3e6a6d0dUL, 0xa85a6a7aUL,
 200.256 +    0x0bcf0ee4UL, 0x9dff0993UL, 0x27ae000aUL, 0xb19e077dUL, 0x44930ff0UL,
 200.257 +    0xd2a30887UL, 0x68f2011eUL, 0xfec20669UL, 0x5d5762f7UL, 0xcb676580UL,
 200.258 +    0x71366c19UL, 0xe7066b6eUL, 0x761bd4feUL, 0xe02bd389UL, 0x5a7ada10UL,
 200.259 +    0xcc4add67UL, 0x6fdfb9f9UL, 0xf9efbe8eUL, 0x43beb717UL, 0xd58eb060UL,
 200.260 +    0xe8a3d6d6UL, 0x7e93d1a1UL, 0xc4c2d838UL, 0x52f2df4fUL, 0xf167bbd1UL,
 200.261 +    0x6757bca6UL, 0xdd06b53fUL, 0x4b36b248UL, 0xda2b0dd8UL, 0x4c1b0aafUL,
 200.262 +    0xf64a0336UL, 0x607a0441UL, 0xc3ef60dfUL, 0x55df67a8UL, 0xef8e6e31UL,
 200.263 +    0x79be6946UL, 0x8cb361cbUL, 0x1a8366bcUL, 0xa0d26f25UL, 0x36e26852UL,
 200.264 +    0x95770cccUL, 0x03470bbbUL, 0xb9160222UL, 0x2f260555UL, 0xbe3bbac5UL,
 200.265 +    0x280bbdb2UL, 0x925ab42bUL, 0x046ab35cUL, 0xa7ffd7c2UL, 0x31cfd0b5UL,
 200.266 +    0x8b9ed92cUL, 0x1daede5bUL, 0xb0c2649bUL, 0x26f263ecUL, 0x9ca36a75UL,
 200.267 +    0x0a936d02UL, 0xa906099cUL, 0x3f360eebUL, 0x85670772UL, 0x13570005UL,
 200.268 +    0x824abf95UL, 0x147ab8e2UL, 0xae2bb17bUL, 0x381bb60cUL, 0x9b8ed292UL,
 200.269 +    0x0dbed5e5UL, 0xb7efdc7cUL, 0x21dfdb0bUL, 0xd4d2d386UL, 0x42e2d4f1UL,
 200.270 +    0xf8b3dd68UL, 0x6e83da1fUL, 0xcd16be81UL, 0x5b26b9f6UL, 0xe177b06fUL,
 200.271 +    0x7747b718UL, 0xe65a0888UL, 0x706a0fffUL, 0xca3b0666UL, 0x5c0b0111UL,
 200.272 +    0xff9e658fUL, 0x69ae62f8UL, 0xd3ff6b61UL, 0x45cf6c16UL, 0x78e20aa0UL,
 200.273 +    0xeed20dd7UL, 0x5483044eUL, 0xc2b30339UL, 0x612667a7UL, 0xf71660d0UL,
 200.274 +    0x4d476949UL, 0xdb776e3eUL, 0x4a6ad1aeUL, 0xdc5ad6d9UL, 0x660bdf40UL,
 200.275 +    0xf03bd837UL, 0x53aebca9UL, 0xc59ebbdeUL, 0x7fcfb247UL, 0xe9ffb530UL,
 200.276 +    0x1cf2bdbdUL, 0x8ac2bacaUL, 0x3093b353UL, 0xa6a3b424UL, 0x0536d0baUL,
 200.277 +    0x9306d7cdUL, 0x2957de54UL, 0xbf67d923UL, 0x2e7a66b3UL, 0xb84a61c4UL,
 200.278 +    0x021b685dUL, 0x942b6f2aUL, 0x37be0bb4UL, 0xa18e0cc3UL, 0x1bdf055aUL,
 200.279 +    0x8def022dUL
 200.280 +  },
 200.281 +  {
 200.282 +    0x00000000UL, 0x41311b19UL, 0x82623632UL, 0xc3532d2bUL, 0x04c56c64UL,
 200.283 +    0x45f4777dUL, 0x86a75a56UL, 0xc796414fUL, 0x088ad9c8UL, 0x49bbc2d1UL,
 200.284 +    0x8ae8effaUL, 0xcbd9f4e3UL, 0x0c4fb5acUL, 0x4d7eaeb5UL, 0x8e2d839eUL,
 200.285 +    0xcf1c9887UL, 0x5112c24aUL, 0x1023d953UL, 0xd370f478UL, 0x9241ef61UL,
 200.286 +    0x55d7ae2eUL, 0x14e6b537UL, 0xd7b5981cUL, 0x96848305UL, 0x59981b82UL,
 200.287 +    0x18a9009bUL, 0xdbfa2db0UL, 0x9acb36a9UL, 0x5d5d77e6UL, 0x1c6c6cffUL,
 200.288 +    0xdf3f41d4UL, 0x9e0e5acdUL, 0xa2248495UL, 0xe3159f8cUL, 0x2046b2a7UL,
 200.289 +    0x6177a9beUL, 0xa6e1e8f1UL, 0xe7d0f3e8UL, 0x2483dec3UL, 0x65b2c5daUL,
 200.290 +    0xaaae5d5dUL, 0xeb9f4644UL, 0x28cc6b6fUL, 0x69fd7076UL, 0xae6b3139UL,
 200.291 +    0xef5a2a20UL, 0x2c09070bUL, 0x6d381c12UL, 0xf33646dfUL, 0xb2075dc6UL,
 200.292 +    0x715470edUL, 0x30656bf4UL, 0xf7f32abbUL, 0xb6c231a2UL, 0x75911c89UL,
 200.293 +    0x34a00790UL, 0xfbbc9f17UL, 0xba8d840eUL, 0x79dea925UL, 0x38efb23cUL,
 200.294 +    0xff79f373UL, 0xbe48e86aUL, 0x7d1bc541UL, 0x3c2ade58UL, 0x054f79f0UL,
 200.295 +    0x447e62e9UL, 0x872d4fc2UL, 0xc61c54dbUL, 0x018a1594UL, 0x40bb0e8dUL,
 200.296 +    0x83e823a6UL, 0xc2d938bfUL, 0x0dc5a038UL, 0x4cf4bb21UL, 0x8fa7960aUL,
 200.297 +    0xce968d13UL, 0x0900cc5cUL, 0x4831d745UL, 0x8b62fa6eUL, 0xca53e177UL,
 200.298 +    0x545dbbbaUL, 0x156ca0a3UL, 0xd63f8d88UL, 0x970e9691UL, 0x5098d7deUL,
 200.299 +    0x11a9ccc7UL, 0xd2fae1ecUL, 0x93cbfaf5UL, 0x5cd76272UL, 0x1de6796bUL,
 200.300 +    0xdeb55440UL, 0x9f844f59UL, 0x58120e16UL, 0x1923150fUL, 0xda703824UL,
 200.301 +    0x9b41233dUL, 0xa76bfd65UL, 0xe65ae67cUL, 0x2509cb57UL, 0x6438d04eUL,
 200.302 +    0xa3ae9101UL, 0xe29f8a18UL, 0x21cca733UL, 0x60fdbc2aUL, 0xafe124adUL,
 200.303 +    0xeed03fb4UL, 0x2d83129fUL, 0x6cb20986UL, 0xab2448c9UL, 0xea1553d0UL,
 200.304 +    0x29467efbUL, 0x687765e2UL, 0xf6793f2fUL, 0xb7482436UL, 0x741b091dUL,
 200.305 +    0x352a1204UL, 0xf2bc534bUL, 0xb38d4852UL, 0x70de6579UL, 0x31ef7e60UL,
 200.306 +    0xfef3e6e7UL, 0xbfc2fdfeUL, 0x7c91d0d5UL, 0x3da0cbccUL, 0xfa368a83UL,
 200.307 +    0xbb07919aUL, 0x7854bcb1UL, 0x3965a7a8UL, 0x4b98833bUL, 0x0aa99822UL,
 200.308 +    0xc9fab509UL, 0x88cbae10UL, 0x4f5def5fUL, 0x0e6cf446UL, 0xcd3fd96dUL,
 200.309 +    0x8c0ec274UL, 0x43125af3UL, 0x022341eaUL, 0xc1706cc1UL, 0x804177d8UL,
 200.310 +    0x47d73697UL, 0x06e62d8eUL, 0xc5b500a5UL, 0x84841bbcUL, 0x1a8a4171UL,
 200.311 +    0x5bbb5a68UL, 0x98e87743UL, 0xd9d96c5aUL, 0x1e4f2d15UL, 0x5f7e360cUL,
 200.312 +    0x9c2d1b27UL, 0xdd1c003eUL, 0x120098b9UL, 0x533183a0UL, 0x9062ae8bUL,
 200.313 +    0xd153b592UL, 0x16c5f4ddUL, 0x57f4efc4UL, 0x94a7c2efUL, 0xd596d9f6UL,
 200.314 +    0xe9bc07aeUL, 0xa88d1cb7UL, 0x6bde319cUL, 0x2aef2a85UL, 0xed796bcaUL,
 200.315 +    0xac4870d3UL, 0x6f1b5df8UL, 0x2e2a46e1UL, 0xe136de66UL, 0xa007c57fUL,
 200.316 +    0x6354e854UL, 0x2265f34dUL, 0xe5f3b202UL, 0xa4c2a91bUL, 0x67918430UL,
 200.317 +    0x26a09f29UL, 0xb8aec5e4UL, 0xf99fdefdUL, 0x3accf3d6UL, 0x7bfde8cfUL,
 200.318 +    0xbc6ba980UL, 0xfd5ab299UL, 0x3e099fb2UL, 0x7f3884abUL, 0xb0241c2cUL,
 200.319 +    0xf1150735UL, 0x32462a1eUL, 0x73773107UL, 0xb4e17048UL, 0xf5d06b51UL,
 200.320 +    0x3683467aUL, 0x77b25d63UL, 0x4ed7facbUL, 0x0fe6e1d2UL, 0xccb5ccf9UL,
 200.321 +    0x8d84d7e0UL, 0x4a1296afUL, 0x0b238db6UL, 0xc870a09dUL, 0x8941bb84UL,
 200.322 +    0x465d2303UL, 0x076c381aUL, 0xc43f1531UL, 0x850e0e28UL, 0x42984f67UL,
 200.323 +    0x03a9547eUL, 0xc0fa7955UL, 0x81cb624cUL, 0x1fc53881UL, 0x5ef42398UL,
 200.324 +    0x9da70eb3UL, 0xdc9615aaUL, 0x1b0054e5UL, 0x5a314ffcUL, 0x996262d7UL,
 200.325 +    0xd85379ceUL, 0x174fe149UL, 0x567efa50UL, 0x952dd77bUL, 0xd41ccc62UL,
 200.326 +    0x138a8d2dUL, 0x52bb9634UL, 0x91e8bb1fUL, 0xd0d9a006UL, 0xecf37e5eUL,
 200.327 +    0xadc26547UL, 0x6e91486cUL, 0x2fa05375UL, 0xe836123aUL, 0xa9070923UL,
 200.328 +    0x6a542408UL, 0x2b653f11UL, 0xe479a796UL, 0xa548bc8fUL, 0x661b91a4UL,
 200.329 +    0x272a8abdUL, 0xe0bccbf2UL, 0xa18dd0ebUL, 0x62defdc0UL, 0x23efe6d9UL,
 200.330 +    0xbde1bc14UL, 0xfcd0a70dUL, 0x3f838a26UL, 0x7eb2913fUL, 0xb924d070UL,
 200.331 +    0xf815cb69UL, 0x3b46e642UL, 0x7a77fd5bUL, 0xb56b65dcUL, 0xf45a7ec5UL,
 200.332 +    0x370953eeUL, 0x763848f7UL, 0xb1ae09b8UL, 0xf09f12a1UL, 0x33cc3f8aUL,
 200.333 +    0x72fd2493UL
 200.334 +  },
 200.335 +  {
 200.336 +    0x00000000UL, 0x376ac201UL, 0x6ed48403UL, 0x59be4602UL, 0xdca80907UL,
 200.337 +    0xebc2cb06UL, 0xb27c8d04UL, 0x85164f05UL, 0xb851130eUL, 0x8f3bd10fUL,
 200.338 +    0xd685970dUL, 0xe1ef550cUL, 0x64f91a09UL, 0x5393d808UL, 0x0a2d9e0aUL,
 200.339 +    0x3d475c0bUL, 0x70a3261cUL, 0x47c9e41dUL, 0x1e77a21fUL, 0x291d601eUL,
 200.340 +    0xac0b2f1bUL, 0x9b61ed1aUL, 0xc2dfab18UL, 0xf5b56919UL, 0xc8f23512UL,
 200.341 +    0xff98f713UL, 0xa626b111UL, 0x914c7310UL, 0x145a3c15UL, 0x2330fe14UL,
 200.342 +    0x7a8eb816UL, 0x4de47a17UL, 0xe0464d38UL, 0xd72c8f39UL, 0x8e92c93bUL,
 200.343 +    0xb9f80b3aUL, 0x3cee443fUL, 0x0b84863eUL, 0x523ac03cUL, 0x6550023dUL,
 200.344 +    0x58175e36UL, 0x6f7d9c37UL, 0x36c3da35UL, 0x01a91834UL, 0x84bf5731UL,
 200.345 +    0xb3d59530UL, 0xea6bd332UL, 0xdd011133UL, 0x90e56b24UL, 0xa78fa925UL,
 200.346 +    0xfe31ef27UL, 0xc95b2d26UL, 0x4c4d6223UL, 0x7b27a022UL, 0x2299e620UL,
 200.347 +    0x15f32421UL, 0x28b4782aUL, 0x1fdeba2bUL, 0x4660fc29UL, 0x710a3e28UL,
 200.348 +    0xf41c712dUL, 0xc376b32cUL, 0x9ac8f52eUL, 0xada2372fUL, 0xc08d9a70UL,
 200.349 +    0xf7e75871UL, 0xae591e73UL, 0x9933dc72UL, 0x1c259377UL, 0x2b4f5176UL,
 200.350 +    0x72f11774UL, 0x459bd575UL, 0x78dc897eUL, 0x4fb64b7fUL, 0x16080d7dUL,
 200.351 +    0x2162cf7cUL, 0xa4748079UL, 0x931e4278UL, 0xcaa0047aUL, 0xfdcac67bUL,
 200.352 +    0xb02ebc6cUL, 0x87447e6dUL, 0xdefa386fUL, 0xe990fa6eUL, 0x6c86b56bUL,
 200.353 +    0x5bec776aUL, 0x02523168UL, 0x3538f369UL, 0x087faf62UL, 0x3f156d63UL,
 200.354 +    0x66ab2b61UL, 0x51c1e960UL, 0xd4d7a665UL, 0xe3bd6464UL, 0xba032266UL,
 200.355 +    0x8d69e067UL, 0x20cbd748UL, 0x17a11549UL, 0x4e1f534bUL, 0x7975914aUL,
 200.356 +    0xfc63de4fUL, 0xcb091c4eUL, 0x92b75a4cUL, 0xa5dd984dUL, 0x989ac446UL,
 200.357 +    0xaff00647UL, 0xf64e4045UL, 0xc1248244UL, 0x4432cd41UL, 0x73580f40UL,
 200.358 +    0x2ae64942UL, 0x1d8c8b43UL, 0x5068f154UL, 0x67023355UL, 0x3ebc7557UL,
 200.359 +    0x09d6b756UL, 0x8cc0f853UL, 0xbbaa3a52UL, 0xe2147c50UL, 0xd57ebe51UL,
 200.360 +    0xe839e25aUL, 0xdf53205bUL, 0x86ed6659UL, 0xb187a458UL, 0x3491eb5dUL,
 200.361 +    0x03fb295cUL, 0x5a456f5eUL, 0x6d2fad5fUL, 0x801b35e1UL, 0xb771f7e0UL,
 200.362 +    0xeecfb1e2UL, 0xd9a573e3UL, 0x5cb33ce6UL, 0x6bd9fee7UL, 0x3267b8e5UL,
 200.363 +    0x050d7ae4UL, 0x384a26efUL, 0x0f20e4eeUL, 0x569ea2ecUL, 0x61f460edUL,
 200.364 +    0xe4e22fe8UL, 0xd388ede9UL, 0x8a36abebUL, 0xbd5c69eaUL, 0xf0b813fdUL,
 200.365 +    0xc7d2d1fcUL, 0x9e6c97feUL, 0xa90655ffUL, 0x2c101afaUL, 0x1b7ad8fbUL,
 200.366 +    0x42c49ef9UL, 0x75ae5cf8UL, 0x48e900f3UL, 0x7f83c2f2UL, 0x263d84f0UL,
 200.367 +    0x115746f1UL, 0x944109f4UL, 0xa32bcbf5UL, 0xfa958df7UL, 0xcdff4ff6UL,
 200.368 +    0x605d78d9UL, 0x5737bad8UL, 0x0e89fcdaUL, 0x39e33edbUL, 0xbcf571deUL,
 200.369 +    0x8b9fb3dfUL, 0xd221f5ddUL, 0xe54b37dcUL, 0xd80c6bd7UL, 0xef66a9d6UL,
 200.370 +    0xb6d8efd4UL, 0x81b22dd5UL, 0x04a462d0UL, 0x33cea0d1UL, 0x6a70e6d3UL,
 200.371 +    0x5d1a24d2UL, 0x10fe5ec5UL, 0x27949cc4UL, 0x7e2adac6UL, 0x494018c7UL,
 200.372 +    0xcc5657c2UL, 0xfb3c95c3UL, 0xa282d3c1UL, 0x95e811c0UL, 0xa8af4dcbUL,
 200.373 +    0x9fc58fcaUL, 0xc67bc9c8UL, 0xf1110bc9UL, 0x740744ccUL, 0x436d86cdUL,
 200.374 +    0x1ad3c0cfUL, 0x2db902ceUL, 0x4096af91UL, 0x77fc6d90UL, 0x2e422b92UL,
 200.375 +    0x1928e993UL, 0x9c3ea696UL, 0xab546497UL, 0xf2ea2295UL, 0xc580e094UL,
 200.376 +    0xf8c7bc9fUL, 0xcfad7e9eUL, 0x9613389cUL, 0xa179fa9dUL, 0x246fb598UL,
 200.377 +    0x13057799UL, 0x4abb319bUL, 0x7dd1f39aUL, 0x3035898dUL, 0x075f4b8cUL,
 200.378 +    0x5ee10d8eUL, 0x698bcf8fUL, 0xec9d808aUL, 0xdbf7428bUL, 0x82490489UL,
 200.379 +    0xb523c688UL, 0x88649a83UL, 0xbf0e5882UL, 0xe6b01e80UL, 0xd1dadc81UL,
 200.380 +    0x54cc9384UL, 0x63a65185UL, 0x3a181787UL, 0x0d72d586UL, 0xa0d0e2a9UL,
 200.381 +    0x97ba20a8UL, 0xce0466aaUL, 0xf96ea4abUL, 0x7c78ebaeUL, 0x4b1229afUL,
 200.382 +    0x12ac6fadUL, 0x25c6adacUL, 0x1881f1a7UL, 0x2feb33a6UL, 0x765575a4UL,
 200.383 +    0x413fb7a5UL, 0xc429f8a0UL, 0xf3433aa1UL, 0xaafd7ca3UL, 0x9d97bea2UL,
 200.384 +    0xd073c4b5UL, 0xe71906b4UL, 0xbea740b6UL, 0x89cd82b7UL, 0x0cdbcdb2UL,
 200.385 +    0x3bb10fb3UL, 0x620f49b1UL, 0x55658bb0UL, 0x6822d7bbUL, 0x5f4815baUL,
 200.386 +    0x06f653b8UL, 0x319c91b9UL, 0xb48adebcUL, 0x83e01cbdUL, 0xda5e5abfUL,
 200.387 +    0xed3498beUL
 200.388 +  },
 200.389 +  {
 200.390 +    0x00000000UL, 0x6567bcb8UL, 0x8bc809aaUL, 0xeeafb512UL, 0x5797628fUL,
 200.391 +    0x32f0de37UL, 0xdc5f6b25UL, 0xb938d79dUL, 0xef28b4c5UL, 0x8a4f087dUL,
 200.392 +    0x64e0bd6fUL, 0x018701d7UL, 0xb8bfd64aUL, 0xddd86af2UL, 0x3377dfe0UL,
 200.393 +    0x56106358UL, 0x9f571950UL, 0xfa30a5e8UL, 0x149f10faUL, 0x71f8ac42UL,
 200.394 +    0xc8c07bdfUL, 0xada7c767UL, 0x43087275UL, 0x266fcecdUL, 0x707fad95UL,
 200.395 +    0x1518112dUL, 0xfbb7a43fUL, 0x9ed01887UL, 0x27e8cf1aUL, 0x428f73a2UL,
 200.396 +    0xac20c6b0UL, 0xc9477a08UL, 0x3eaf32a0UL, 0x5bc88e18UL, 0xb5673b0aUL,
 200.397 +    0xd00087b2UL, 0x6938502fUL, 0x0c5fec97UL, 0xe2f05985UL, 0x8797e53dUL,
 200.398 +    0xd1878665UL, 0xb4e03addUL, 0x5a4f8fcfUL, 0x3f283377UL, 0x8610e4eaUL,
 200.399 +    0xe3775852UL, 0x0dd8ed40UL, 0x68bf51f8UL, 0xa1f82bf0UL, 0xc49f9748UL,
 200.400 +    0x2a30225aUL, 0x4f579ee2UL, 0xf66f497fUL, 0x9308f5c7UL, 0x7da740d5UL,
 200.401 +    0x18c0fc6dUL, 0x4ed09f35UL, 0x2bb7238dUL, 0xc518969fUL, 0xa07f2a27UL,
 200.402 +    0x1947fdbaUL, 0x7c204102UL, 0x928ff410UL, 0xf7e848a8UL, 0x3d58149bUL,
 200.403 +    0x583fa823UL, 0xb6901d31UL, 0xd3f7a189UL, 0x6acf7614UL, 0x0fa8caacUL,
 200.404 +    0xe1077fbeUL, 0x8460c306UL, 0xd270a05eUL, 0xb7171ce6UL, 0x59b8a9f4UL,
 200.405 +    0x3cdf154cUL, 0x85e7c2d1UL, 0xe0807e69UL, 0x0e2fcb7bUL, 0x6b4877c3UL,
 200.406 +    0xa20f0dcbUL, 0xc768b173UL, 0x29c70461UL, 0x4ca0b8d9UL, 0xf5986f44UL,
 200.407 +    0x90ffd3fcUL, 0x7e5066eeUL, 0x1b37da56UL, 0x4d27b90eUL, 0x284005b6UL,
 200.408 +    0xc6efb0a4UL, 0xa3880c1cUL, 0x1ab0db81UL, 0x7fd76739UL, 0x9178d22bUL,
 200.409 +    0xf41f6e93UL, 0x03f7263bUL, 0x66909a83UL, 0x883f2f91UL, 0xed589329UL,
 200.410 +    0x546044b4UL, 0x3107f80cUL, 0xdfa84d1eUL, 0xbacff1a6UL, 0xecdf92feUL,
 200.411 +    0x89b82e46UL, 0x67179b54UL, 0x027027ecUL, 0xbb48f071UL, 0xde2f4cc9UL,
 200.412 +    0x3080f9dbUL, 0x55e74563UL, 0x9ca03f6bUL, 0xf9c783d3UL, 0x176836c1UL,
 200.413 +    0x720f8a79UL, 0xcb375de4UL, 0xae50e15cUL, 0x40ff544eUL, 0x2598e8f6UL,
 200.414 +    0x73888baeUL, 0x16ef3716UL, 0xf8408204UL, 0x9d273ebcUL, 0x241fe921UL,
 200.415 +    0x41785599UL, 0xafd7e08bUL, 0xcab05c33UL, 0x3bb659edUL, 0x5ed1e555UL,
 200.416 +    0xb07e5047UL, 0xd519ecffUL, 0x6c213b62UL, 0x094687daUL, 0xe7e932c8UL,
 200.417 +    0x828e8e70UL, 0xd49eed28UL, 0xb1f95190UL, 0x5f56e482UL, 0x3a31583aUL,
 200.418 +    0x83098fa7UL, 0xe66e331fUL, 0x08c1860dUL, 0x6da63ab5UL, 0xa4e140bdUL,
 200.419 +    0xc186fc05UL, 0x2f294917UL, 0x4a4ef5afUL, 0xf3762232UL, 0x96119e8aUL,
 200.420 +    0x78be2b98UL, 0x1dd99720UL, 0x4bc9f478UL, 0x2eae48c0UL, 0xc001fdd2UL,
 200.421 +    0xa566416aUL, 0x1c5e96f7UL, 0x79392a4fUL, 0x97969f5dUL, 0xf2f123e5UL,
 200.422 +    0x05196b4dUL, 0x607ed7f5UL, 0x8ed162e7UL, 0xebb6de5fUL, 0x528e09c2UL,
 200.423 +    0x37e9b57aUL, 0xd9460068UL, 0xbc21bcd0UL, 0xea31df88UL, 0x8f566330UL,
 200.424 +    0x61f9d622UL, 0x049e6a9aUL, 0xbda6bd07UL, 0xd8c101bfUL, 0x366eb4adUL,
 200.425 +    0x53090815UL, 0x9a4e721dUL, 0xff29cea5UL, 0x11867bb7UL, 0x74e1c70fUL,
 200.426 +    0xcdd91092UL, 0xa8beac2aUL, 0x46111938UL, 0x2376a580UL, 0x7566c6d8UL,
 200.427 +    0x10017a60UL, 0xfeaecf72UL, 0x9bc973caUL, 0x22f1a457UL, 0x479618efUL,
 200.428 +    0xa939adfdUL, 0xcc5e1145UL, 0x06ee4d76UL, 0x6389f1ceUL, 0x8d2644dcUL,
 200.429 +    0xe841f864UL, 0x51792ff9UL, 0x341e9341UL, 0xdab12653UL, 0xbfd69aebUL,
 200.430 +    0xe9c6f9b3UL, 0x8ca1450bUL, 0x620ef019UL, 0x07694ca1UL, 0xbe519b3cUL,
 200.431 +    0xdb362784UL, 0x35999296UL, 0x50fe2e2eUL, 0x99b95426UL, 0xfcdee89eUL,
 200.432 +    0x12715d8cUL, 0x7716e134UL, 0xce2e36a9UL, 0xab498a11UL, 0x45e63f03UL,
 200.433 +    0x208183bbUL, 0x7691e0e3UL, 0x13f65c5bUL, 0xfd59e949UL, 0x983e55f1UL,
 200.434 +    0x2106826cUL, 0x44613ed4UL, 0xaace8bc6UL, 0xcfa9377eUL, 0x38417fd6UL,
 200.435 +    0x5d26c36eUL, 0xb389767cUL, 0xd6eecac4UL, 0x6fd61d59UL, 0x0ab1a1e1UL,
 200.436 +    0xe41e14f3UL, 0x8179a84bUL, 0xd769cb13UL, 0xb20e77abUL, 0x5ca1c2b9UL,
 200.437 +    0x39c67e01UL, 0x80fea99cUL, 0xe5991524UL, 0x0b36a036UL, 0x6e511c8eUL,
 200.438 +    0xa7166686UL, 0xc271da3eUL, 0x2cde6f2cUL, 0x49b9d394UL, 0xf0810409UL,
 200.439 +    0x95e6b8b1UL, 0x7b490da3UL, 0x1e2eb11bUL, 0x483ed243UL, 0x2d596efbUL,
 200.440 +    0xc3f6dbe9UL, 0xa6916751UL, 0x1fa9b0ccUL, 0x7ace0c74UL, 0x9461b966UL,
 200.441 +    0xf10605deUL
 200.442 +#endif
 200.443 +  }
 200.444 +};
   201.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   201.2 +++ b/libs/zlib/deflate.c	Sun Nov 01 00:36:56 2015 +0200
   201.3 @@ -0,0 +1,1736 @@
   201.4 +/* deflate.c -- compress data using the deflation algorithm
   201.5 + * Copyright (C) 1995-2005 Jean-loup Gailly.
   201.6 + * For conditions of distribution and use, see copyright notice in zlib.h
   201.7 + */
   201.8 +
   201.9 +/*
  201.10 + *  ALGORITHM
  201.11 + *
  201.12 + *      The "deflation" process depends on being able to identify portions
  201.13 + *      of the input text which are identical to earlier input (within a
  201.14 + *      sliding window trailing behind the input currently being processed).
  201.15 + *
  201.16 + *      The most straightforward technique turns out to be the fastest for
  201.17 + *      most input files: try all possible matches and select the longest.
  201.18 + *      The key feature of this algorithm is that insertions into the string
  201.19 + *      dictionary are very simple and thus fast, and deletions are avoided
  201.20 + *      completely. Insertions are performed at each input character, whereas
  201.21 + *      string matches are performed only when the previous match ends. So it
  201.22 + *      is preferable to spend more time in matches to allow very fast string
  201.23 + *      insertions and avoid deletions. The matching algorithm for small
  201.24 + *      strings is inspired from that of Rabin & Karp. A brute force approach
  201.25 + *      is used to find longer strings when a small match has been found.
  201.26 + *      A similar algorithm is used in comic (by Jan-Mark Wams) and freeze
  201.27 + *      (by Leonid Broukhis).
  201.28 + *         A previous version of this file used a more sophisticated algorithm
  201.29 + *      (by Fiala and Greene) which is guaranteed to run in linear amortized
  201.30 + *      time, but has a larger average cost, uses more memory and is patented.
  201.31 + *      However the F&G algorithm may be faster for some highly redundant
  201.32 + *      files if the parameter max_chain_length (described below) is too large.
  201.33 + *
  201.34 + *  ACKNOWLEDGEMENTS
  201.35 + *
  201.36 + *      The idea of lazy evaluation of matches is due to Jan-Mark Wams, and
  201.37 + *      I found it in 'freeze' written by Leonid Broukhis.
  201.38 + *      Thanks to many people for bug reports and testing.
  201.39 + *
  201.40 + *  REFERENCES
  201.41 + *
  201.42 + *      Deutsch, L.P.,"DEFLATE Compressed Data Format Specification".
  201.43 + *      Available in http://www.ietf.org/rfc/rfc1951.txt
  201.44 + *
  201.45 + *      A description of the Rabin and Karp algorithm is given in the book
  201.46 + *         "Algorithms" by R. Sedgewick, Addison-Wesley, p252.
  201.47 + *
  201.48 + *      Fiala,E.R., and Greene,D.H.
  201.49 + *         Data Compression with Finite Windows, Comm.ACM, 32,4 (1989) 490-595
  201.50 + *
  201.51 + */
  201.52 +
  201.53 +/* @(#) $Id$ */
  201.54 +
  201.55 +#include "deflate.h"
  201.56 +
  201.57 +const char deflate_copyright[] =
  201.58 +   " deflate 1.2.3 Copyright 1995-2005 Jean-loup Gailly ";
  201.59 +/*
  201.60 +  If you use the zlib library in a product, an acknowledgment is welcome
  201.61 +  in the documentation of your product. If for some reason you cannot
  201.62 +  include such an acknowledgment, I would appreciate that you keep this
  201.63 +  copyright string in the executable of your product.
  201.64 + */
  201.65 +
  201.66 +/* ===========================================================================
  201.67 + *  Function prototypes.
  201.68 + */
  201.69 +typedef enum {
  201.70 +    need_more,      /* block not completed, need more input or more output */
  201.71 +    block_done,     /* block flush performed */
  201.72 +    finish_started, /* finish started, need only more output at next deflate */
  201.73 +    finish_done     /* finish done, accept no more input or output */
  201.74 +} block_state;
  201.75 +
  201.76 +typedef block_state (*compress_func) OF((deflate_state *s, int flush));
  201.77 +/* Compression function. Returns the block state after the call. */
  201.78 +
  201.79 +local void fill_window    OF((deflate_state *s));
  201.80 +local block_state deflate_stored OF((deflate_state *s, int flush));
  201.81 +local block_state deflate_fast   OF((deflate_state *s, int flush));
  201.82 +#ifndef FASTEST
  201.83 +local block_state deflate_slow   OF((deflate_state *s, int flush));
  201.84 +#endif
  201.85 +local void lm_init        OF((deflate_state *s));
  201.86 +local void putShortMSB    OF((deflate_state *s, uInt b));
  201.87 +local void flush_pending  OF((z_streamp strm));
  201.88 +local int read_buf        OF((z_streamp strm, Bytef *buf, unsigned size));
  201.89 +#ifndef FASTEST
  201.90 +#ifdef ASMV
  201.91 +      void match_init OF((void)); /* asm code initialization */
  201.92 +      uInt longest_match  OF((deflate_state *s, IPos cur_match));
  201.93 +#else
  201.94 +local uInt longest_match  OF((deflate_state *s, IPos cur_match));
  201.95 +#endif
  201.96 +#endif
  201.97 +local uInt longest_match_fast OF((deflate_state *s, IPos cur_match));
  201.98 +
  201.99 +#ifdef DEBUG
 201.100 +local  void check_match OF((deflate_state *s, IPos start, IPos match,
 201.101 +                            int length));
 201.102 +#endif
 201.103 +
 201.104 +/* ===========================================================================
 201.105 + * Local data
 201.106 + */
 201.107 +
 201.108 +#define NIL 0
 201.109 +/* Tail of hash chains */
 201.110 +
 201.111 +#ifndef TOO_FAR
 201.112 +#  define TOO_FAR 4096
 201.113 +#endif
 201.114 +/* Matches of length 3 are discarded if their distance exceeds TOO_FAR */
 201.115 +
 201.116 +#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
 201.117 +/* Minimum amount of lookahead, except at the end of the input file.
 201.118 + * See deflate.c for comments about the MIN_MATCH+1.
 201.119 + */
 201.120 +
 201.121 +/* Values for max_lazy_match, good_match and max_chain_length, depending on
 201.122 + * the desired pack level (0..9). The values given below have been tuned to
 201.123 + * exclude worst case performance for pathological files. Better values may be
 201.124 + * found for specific files.
 201.125 + */
 201.126 +typedef struct config_s {
 201.127 +   ush good_length; /* reduce lazy search above this match length */
 201.128 +   ush max_lazy;    /* do not perform lazy search above this match length */
 201.129 +   ush nice_length; /* quit search above this match length */
 201.130 +   ush max_chain;
 201.131 +   compress_func func;
 201.132 +} config;
 201.133 +
 201.134 +#ifdef FASTEST
 201.135 +local const config configuration_table[2] = {
 201.136 +/*      good lazy nice chain */
 201.137 +/* 0 */ {0,    0,  0,    0, deflate_stored},  /* store only */
 201.138 +/* 1 */ {4,    4,  8,    4, deflate_fast}}; /* max speed, no lazy matches */
 201.139 +#else
 201.140 +local const config configuration_table[10] = {
 201.141 +/*      good lazy nice chain */
 201.142 +/* 0 */ {0,    0,  0,    0, deflate_stored},  /* store only */
 201.143 +/* 1 */ {4,    4,  8,    4, deflate_fast}, /* max speed, no lazy matches */
 201.144 +/* 2 */ {4,    5, 16,    8, deflate_fast},
 201.145 +/* 3 */ {4,    6, 32,   32, deflate_fast},
 201.146 +
 201.147 +/* 4 */ {4,    4, 16,   16, deflate_slow},  /* lazy matches */
 201.148 +/* 5 */ {8,   16, 32,   32, deflate_slow},
 201.149 +/* 6 */ {8,   16, 128, 128, deflate_slow},
 201.150 +/* 7 */ {8,   32, 128, 256, deflate_slow},
 201.151 +/* 8 */ {32, 128, 258, 1024, deflate_slow},
 201.152 +/* 9 */ {32, 258, 258, 4096, deflate_slow}}; /* max compression */
 201.153 +#endif
 201.154 +
 201.155 +/* Note: the deflate() code requires max_lazy >= MIN_MATCH and max_chain >= 4
 201.156 + * For deflate_fast() (levels <= 3) good is ignored and lazy has a different
 201.157 + * meaning.
 201.158 + */
 201.159 +
 201.160 +#define EQUAL 0
 201.161 +/* result of memcmp for equal strings */
 201.162 +
 201.163 +#ifndef NO_DUMMY_DECL
 201.164 +struct static_tree_desc_s {int dummy;}; /* for buggy compilers */
 201.165 +#endif
 201.166 +
 201.167 +/* ===========================================================================
 201.168 + * Update a hash value with the given input byte
 201.169 + * IN  assertion: all calls to to UPDATE_HASH are made with consecutive
 201.170 + *    input characters, so that a running hash key can be computed from the
 201.171 + *    previous key instead of complete recalculation each time.
 201.172 + */
 201.173 +#define UPDATE_HASH(s,h,c) (h = (((h)<<s->hash_shift) ^ (c)) & s->hash_mask)
 201.174 +
 201.175 +
 201.176 +/* ===========================================================================
 201.177 + * Insert string str in the dictionary and set match_head to the previous head
 201.178 + * of the hash chain (the most recent string with same hash key). Return
 201.179 + * the previous length of the hash chain.
 201.180 + * If this file is compiled with -DFASTEST, the compression level is forced
 201.181 + * to 1, and no hash chains are maintained.
 201.182 + * IN  assertion: all calls to to INSERT_STRING are made with consecutive
 201.183 + *    input characters and the first MIN_MATCH bytes of str are valid
 201.184 + *    (except for the last MIN_MATCH-1 bytes of the input file).
 201.185 + */
 201.186 +#ifdef FASTEST
 201.187 +#define INSERT_STRING(s, str, match_head) \
 201.188 +   (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
 201.189 +    match_head = s->head[s->ins_h], \
 201.190 +    s->head[s->ins_h] = (Pos)(str))
 201.191 +#else
 201.192 +#define INSERT_STRING(s, str, match_head) \
 201.193 +   (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
 201.194 +    match_head = s->prev[(str) & s->w_mask] = s->head[s->ins_h], \
 201.195 +    s->head[s->ins_h] = (Pos)(str))
 201.196 +#endif
 201.197 +
 201.198 +/* ===========================================================================
 201.199 + * Initialize the hash table (avoiding 64K overflow for 16 bit systems).
 201.200 + * prev[] will be initialized on the fly.
 201.201 + */
 201.202 +#define CLEAR_HASH(s) \
 201.203 +    s->head[s->hash_size-1] = NIL; \
 201.204 +    zmemzero((Bytef *)s->head, (unsigned)(s->hash_size-1)*sizeof(*s->head));
 201.205 +
 201.206 +/* ========================================================================= */
 201.207 +int ZEXPORT deflateInit_(strm, level, version, stream_size)
 201.208 +    z_streamp strm;
 201.209 +    int level;
 201.210 +    const char *version;
 201.211 +    int stream_size;
 201.212 +{
 201.213 +    return deflateInit2_(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL,
 201.214 +                         Z_DEFAULT_STRATEGY, version, stream_size);
 201.215 +    /* To do: ignore strm->next_in if we use it as window */
 201.216 +}
 201.217 +
 201.218 +/* ========================================================================= */
 201.219 +int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
 201.220 +                  version, stream_size)
 201.221 +    z_streamp strm;
 201.222 +    int  level;
 201.223 +    int  method;
 201.224 +    int  windowBits;
 201.225 +    int  memLevel;
 201.226 +    int  strategy;
 201.227 +    const char *version;
 201.228 +    int stream_size;
 201.229 +{
 201.230 +    deflate_state *s;
 201.231 +    int wrap = 1;
 201.232 +    static const char my_version[] = ZLIB_VERSION;
 201.233 +
 201.234 +    ushf *overlay;
 201.235 +    /* We overlay pending_buf and d_buf+l_buf. This works since the average
 201.236 +     * output size for (length,distance) codes is <= 24 bits.
 201.237 +     */
 201.238 +
 201.239 +    if (version == Z_NULL || version[0] != my_version[0] ||
 201.240 +        stream_size != sizeof(z_stream)) {
 201.241 +        return Z_VERSION_ERROR;
 201.242 +    }
 201.243 +    if (strm == Z_NULL) return Z_STREAM_ERROR;
 201.244 +
 201.245 +    strm->msg = Z_NULL;
 201.246 +    if (strm->zalloc == (alloc_func)0) {
 201.247 +        strm->zalloc = zcalloc;
 201.248 +        strm->opaque = (voidpf)0;
 201.249 +    }
 201.250 +    if (strm->zfree == (free_func)0) strm->zfree = zcfree;
 201.251 +
 201.252 +#ifdef FASTEST
 201.253 +    if (level != 0) level = 1;
 201.254 +#else
 201.255 +    if (level == Z_DEFAULT_COMPRESSION) level = 6;
 201.256 +#endif
 201.257 +
 201.258 +    if (windowBits < 0) { /* suppress zlib wrapper */
 201.259 +        wrap = 0;
 201.260 +        windowBits = -windowBits;
 201.261 +    }
 201.262 +#ifdef GZIP
 201.263 +    else if (windowBits > 15) {
 201.264 +        wrap = 2;       /* write gzip wrapper instead */
 201.265 +        windowBits -= 16;
 201.266 +    }
 201.267 +#endif
 201.268 +    if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED ||
 201.269 +        windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||
 201.270 +        strategy < 0 || strategy > Z_FIXED) {
 201.271 +        return Z_STREAM_ERROR;
 201.272 +    }
 201.273 +    if (windowBits == 8) windowBits = 9;  /* until 256-byte window bug fixed */
 201.274 +    s = (deflate_state *) ZALLOC(strm, 1, sizeof(deflate_state));
 201.275 +    if (s == Z_NULL) return Z_MEM_ERROR;
 201.276 +    strm->state = (struct internal_state FAR *)s;
 201.277 +    s->strm = strm;
 201.278 +
 201.279 +    s->wrap = wrap;
 201.280 +    s->gzhead = Z_NULL;
 201.281 +    s->w_bits = windowBits;
 201.282 +    s->w_size = 1 << s->w_bits;
 201.283 +    s->w_mask = s->w_size - 1;
 201.284 +
 201.285 +    s->hash_bits = memLevel + 7;
 201.286 +    s->hash_size = 1 << s->hash_bits;
 201.287 +    s->hash_mask = s->hash_size - 1;
 201.288 +    s->hash_shift =  ((s->hash_bits+MIN_MATCH-1)/MIN_MATCH);
 201.289 +
 201.290 +    s->window = (Bytef *) ZALLOC(strm, s->w_size, 2*sizeof(Byte));
 201.291 +    s->prev   = (Posf *)  ZALLOC(strm, s->w_size, sizeof(Pos));
 201.292 +    s->head   = (Posf *)  ZALLOC(strm, s->hash_size, sizeof(Pos));
 201.293 +
 201.294 +    s->lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */
 201.295 +
 201.296 +    overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);
 201.297 +    s->pending_buf = (uchf *) overlay;
 201.298 +    s->pending_buf_size = (ulg)s->lit_bufsize * (sizeof(ush)+2L);
 201.299 +
 201.300 +    if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||
 201.301 +        s->pending_buf == Z_NULL) {
 201.302 +        s->status = FINISH_STATE;
 201.303 +        strm->msg = (char*)ERR_MSG(Z_MEM_ERROR);
 201.304 +        deflateEnd (strm);
 201.305 +        return Z_MEM_ERROR;
 201.306 +    }
 201.307 +    s->d_buf = overlay + s->lit_bufsize/sizeof(ush);
 201.308 +    s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;
 201.309 +
 201.310 +    s->level = level;
 201.311 +    s->strategy = strategy;
 201.312 +    s->method = (Byte)method;
 201.313 +
 201.314 +    return deflateReset(strm);
 201.315 +}
 201.316 +
 201.317 +/* ========================================================================= */
 201.318 +int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength)
 201.319 +    z_streamp strm;
 201.320 +    const Bytef *dictionary;
 201.321 +    uInt  dictLength;
 201.322 +{
 201.323 +    deflate_state *s;
 201.324 +    uInt length = dictLength;
 201.325 +    uInt n;
 201.326 +    IPos hash_head = 0;
 201.327 +
 201.328 +    if (strm == Z_NULL || strm->state == Z_NULL || dictionary == Z_NULL ||
 201.329 +        strm->state->wrap == 2 ||
 201.330 +        (strm->state->wrap == 1 && strm->state->status != INIT_STATE))
 201.331 +        return Z_STREAM_ERROR;
 201.332 +
 201.333 +    s = strm->state;
 201.334 +    if (s->wrap)
 201.335 +        strm->adler = adler32(strm->adler, dictionary, dictLength);
 201.336 +
 201.337 +    if (length < MIN_MATCH) return Z_OK;
 201.338 +    if (length > MAX_DIST(s)) {
 201.339 +        length = MAX_DIST(s);
 201.340 +        dictionary += dictLength - length; /* use the tail of the dictionary */
 201.341 +    }
 201.342 +    zmemcpy(s->window, dictionary, length);
 201.343 +    s->strstart = length;
 201.344 +    s->block_start = (long)length;
 201.345 +
 201.346 +    /* Insert all strings in the hash table (except for the last two bytes).
 201.347 +     * s->lookahead stays null, so s->ins_h will be recomputed at the next
 201.348 +     * call of fill_window.
 201.349 +     */
 201.350 +    s->ins_h = s->window[0];
 201.351 +    UPDATE_HASH(s, s->ins_h, s->window[1]);
 201.352 +    for (n = 0; n <= length - MIN_MATCH; n++) {
 201.353 +        INSERT_STRING(s, n, hash_head);
 201.354 +    }
 201.355 +    if (hash_head) hash_head = 0;  /* to make compiler happy */
 201.356 +    return Z_OK;
 201.357 +}
 201.358 +
 201.359 +/* ========================================================================= */
 201.360 +int ZEXPORT deflateReset (strm)
 201.361 +    z_streamp strm;
 201.362 +{
 201.363 +    deflate_state *s;
 201.364 +
 201.365 +    if (strm == Z_NULL || strm->state == Z_NULL ||
 201.366 +        strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0) {
 201.367 +        return Z_STREAM_ERROR;
 201.368 +    }
 201.369 +
 201.370 +    strm->total_in = strm->total_out = 0;
 201.371 +    strm->msg = Z_NULL; /* use zfree if we ever allocate msg dynamically */
 201.372 +    strm->data_type = Z_UNKNOWN;
 201.373 +
 201.374 +    s = (deflate_state *)strm->state;
 201.375 +    s->pending = 0;
 201.376 +    s->pending_out = s->pending_buf;
 201.377 +
 201.378 +    if (s->wrap < 0) {
 201.379 +        s->wrap = -s->wrap; /* was made negative by deflate(..., Z_FINISH); */
 201.380 +    }
 201.381 +    s->status = s->wrap ? INIT_STATE : BUSY_STATE;
 201.382 +    strm->adler =
 201.383 +#ifdef GZIP
 201.384 +        s->wrap == 2 ? crc32(0L, Z_NULL, 0) :
 201.385 +#endif
 201.386 +        adler32(0L, Z_NULL, 0);
 201.387 +    s->last_flush = Z_NO_FLUSH;
 201.388 +
 201.389 +    _tr_init(s);
 201.390 +    lm_init(s);
 201.391 +
 201.392 +    return Z_OK;
 201.393 +}
 201.394 +
 201.395 +/* ========================================================================= */
 201.396 +int ZEXPORT deflateSetHeader (strm, head)
 201.397 +    z_streamp strm;
 201.398 +    gz_headerp head;
 201.399 +{
 201.400 +    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
 201.401 +    if (strm->state->wrap != 2) return Z_STREAM_ERROR;
 201.402 +    strm->state->gzhead = head;
 201.403 +    return Z_OK;
 201.404 +}
 201.405 +
 201.406 +/* ========================================================================= */
 201.407 +int ZEXPORT deflatePrime (strm, bits, value)
 201.408 +    z_streamp strm;
 201.409 +    int bits;
 201.410 +    int value;
 201.411 +{
 201.412 +    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
 201.413 +    strm->state->bi_valid = bits;
 201.414 +    strm->state->bi_buf = (ush)(value & ((1 << bits) - 1));
 201.415 +    return Z_OK;
 201.416 +}
 201.417 +
 201.418 +/* ========================================================================= */
 201.419 +int ZEXPORT deflateParams(strm, level, strategy)
 201.420 +    z_streamp strm;
 201.421 +    int level;
 201.422 +    int strategy;
 201.423 +{
 201.424 +    deflate_state *s;
 201.425 +    compress_func func;
 201.426 +    int err = Z_OK;
 201.427 +
 201.428 +    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
 201.429 +    s = strm->state;
 201.430 +
 201.431 +#ifdef FASTEST
 201.432 +    if (level != 0) level = 1;
 201.433 +#else
 201.434 +    if (level == Z_DEFAULT_COMPRESSION) level = 6;
 201.435 +#endif
 201.436 +    if (level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED) {
 201.437 +        return Z_STREAM_ERROR;
 201.438 +    }
 201.439 +    func = configuration_table[s->level].func;
 201.440 +
 201.441 +    if (func != configuration_table[level].func && strm->total_in != 0) {
 201.442 +        /* Flush the last buffer: */
 201.443 +        err = deflate(strm, Z_PARTIAL_FLUSH);
 201.444 +    }
 201.445 +    if (s->level != level) {
 201.446 +        s->level = level;
 201.447 +        s->max_lazy_match   = configuration_table[level].max_lazy;
 201.448 +        s->good_match       = configuration_table[level].good_length;
 201.449 +        s->nice_match       = configuration_table[level].nice_length;
 201.450 +        s->max_chain_length = configuration_table[level].max_chain;
 201.451 +    }
 201.452 +    s->strategy = strategy;
 201.453 +    return err;
 201.454 +}
 201.455 +
 201.456 +/* ========================================================================= */
 201.457 +int ZEXPORT deflateTune(strm, good_length, max_lazy, nice_length, max_chain)
 201.458 +    z_streamp strm;
 201.459 +    int good_length;
 201.460 +    int max_lazy;
 201.461 +    int nice_length;
 201.462 +    int max_chain;
 201.463 +{
 201.464 +    deflate_state *s;
 201.465 +
 201.466 +    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
 201.467 +    s = strm->state;
 201.468 +    s->good_match = good_length;
 201.469 +    s->max_lazy_match = max_lazy;
 201.470 +    s->nice_match = nice_length;
 201.471 +    s->max_chain_length = max_chain;
 201.472 +    return Z_OK;
 201.473 +}
 201.474 +
 201.475 +/* =========================================================================
 201.476 + * For the default windowBits of 15 and memLevel of 8, this function returns
 201.477 + * a close to exact, as well as small, upper bound on the compressed size.
 201.478 + * They are coded as constants here for a reason--if the #define's are
 201.479 + * changed, then this function needs to be changed as well.  The return
 201.480 + * value for 15 and 8 only works for those exact settings.
 201.481 + *
 201.482 + * For any setting other than those defaults for windowBits and memLevel,
 201.483 + * the value returned is a conservative worst case for the maximum expansion
 201.484 + * resulting from using fixed blocks instead of stored blocks, which deflate
 201.485 + * can emit on compressed data for some combinations of the parameters.
 201.486 + *
 201.487 + * This function could be more sophisticated to provide closer upper bounds
 201.488 + * for every combination of windowBits and memLevel, as well as wrap.
 201.489 + * But even the conservative upper bound of about 14% expansion does not
 201.490 + * seem onerous for output buffer allocation.
 201.491 + */
 201.492 +uLong ZEXPORT deflateBound(strm, sourceLen)
 201.493 +    z_streamp strm;
 201.494 +    uLong sourceLen;
 201.495 +{
 201.496 +    deflate_state *s;
 201.497 +    uLong destLen;
 201.498 +
 201.499 +    /* conservative upper bound */
 201.500 +    destLen = sourceLen +
 201.501 +              ((sourceLen + 7) >> 3) + ((sourceLen + 63) >> 6) + 11;
 201.502 +
 201.503 +    /* if can't get parameters, return conservative bound */
 201.504 +    if (strm == Z_NULL || strm->state == Z_NULL)
 201.505 +        return destLen;
 201.506 +
 201.507 +    /* if not default parameters, return conservative bound */
 201.508 +    s = strm->state;
 201.509 +    if (s->w_bits != 15 || s->hash_bits != 8 + 7)
 201.510 +        return destLen;
 201.511 +
 201.512 +    /* default settings: return tight bound for that case */
 201.513 +    return compressBound(sourceLen);
 201.514 +}
 201.515 +
 201.516 +/* =========================================================================
 201.517 + * Put a short in the pending buffer. The 16-bit value is put in MSB order.
 201.518 + * IN assertion: the stream state is correct and there is enough room in
 201.519 + * pending_buf.
 201.520 + */
 201.521 +local void putShortMSB (s, b)
 201.522 +    deflate_state *s;
 201.523 +    uInt b;
 201.524 +{
 201.525 +    put_byte(s, (Byte)(b >> 8));
 201.526 +    put_byte(s, (Byte)(b & 0xff));
 201.527 +}
 201.528 +
 201.529 +/* =========================================================================
 201.530 + * Flush as much pending output as possible. All deflate() output goes
 201.531 + * through this function so some applications may wish to modify it
 201.532 + * to avoid allocating a large strm->next_out buffer and copying into it.
 201.533 + * (See also read_buf()).
 201.534 + */
 201.535 +local void flush_pending(strm)
 201.536 +    z_streamp strm;
 201.537 +{
 201.538 +    unsigned len = strm->state->pending;
 201.539 +
 201.540 +    if (len > strm->avail_out) len = strm->avail_out;
 201.541 +    if (len == 0) return;
 201.542 +
 201.543 +    zmemcpy(strm->next_out, strm->state->pending_out, len);
 201.544 +    strm->next_out  += len;
 201.545 +    strm->state->pending_out  += len;
 201.546 +    strm->total_out += len;
 201.547 +    strm->avail_out  -= len;
 201.548 +    strm->state->pending -= len;
 201.549 +    if (strm->state->pending == 0) {
 201.550 +        strm->state->pending_out = strm->state->pending_buf;
 201.551 +    }
 201.552 +}
 201.553 +
 201.554 +/* ========================================================================= */
 201.555 +int ZEXPORT deflate (strm, flush)
 201.556 +    z_streamp strm;
 201.557 +    int flush;
 201.558 +{
 201.559 +    int old_flush; /* value of flush param for previous deflate call */
 201.560 +    deflate_state *s;
 201.561 +
 201.562 +    if (strm == Z_NULL || strm->state == Z_NULL ||
 201.563 +        flush > Z_FINISH || flush < 0) {
 201.564 +        return Z_STREAM_ERROR;
 201.565 +    }
 201.566 +    s = strm->state;
 201.567 +
 201.568 +    if (strm->next_out == Z_NULL ||
 201.569 +        (strm->next_in == Z_NULL && strm->avail_in != 0) ||
 201.570 +        (s->status == FINISH_STATE && flush != Z_FINISH)) {
 201.571 +        ERR_RETURN(strm, Z_STREAM_ERROR);
 201.572 +    }
 201.573 +    if (strm->avail_out == 0) ERR_RETURN(strm, Z_BUF_ERROR);
 201.574 +
 201.575 +    s->strm = strm; /* just in case */
 201.576 +    old_flush = s->last_flush;
 201.577 +    s->last_flush = flush;
 201.578 +
 201.579 +    /* Write the header */
 201.580 +    if (s->status == INIT_STATE) {
 201.581 +#ifdef GZIP
 201.582 +        if (s->wrap == 2) {
 201.583 +            strm->adler = crc32(0L, Z_NULL, 0);
 201.584 +            put_byte(s, 31);
 201.585 +            put_byte(s, 139);
 201.586 +            put_byte(s, 8);
 201.587 +            if (s->gzhead == NULL) {
 201.588 +                put_byte(s, 0);
 201.589 +                put_byte(s, 0);
 201.590 +                put_byte(s, 0);
 201.591 +                put_byte(s, 0);
 201.592 +                put_byte(s, 0);
 201.593 +                put_byte(s, s->level == 9 ? 2 :
 201.594 +                            (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ?
 201.595 +                             4 : 0));
 201.596 +                put_byte(s, OS_CODE);
 201.597 +                s->status = BUSY_STATE;
 201.598 +            }
 201.599 +            else {
 201.600 +                put_byte(s, (s->gzhead->text ? 1 : 0) +
 201.601 +                            (s->gzhead->hcrc ? 2 : 0) +
 201.602 +                            (s->gzhead->extra == Z_NULL ? 0 : 4) +
 201.603 +                            (s->gzhead->name == Z_NULL ? 0 : 8) +
 201.604 +                            (s->gzhead->comment == Z_NULL ? 0 : 16)
 201.605 +                        );
 201.606 +                put_byte(s, (Byte)(s->gzhead->time & 0xff));
 201.607 +                put_byte(s, (Byte)((s->gzhead->time >> 8) & 0xff));
 201.608 +                put_byte(s, (Byte)((s->gzhead->time >> 16) & 0xff));
 201.609 +                put_byte(s, (Byte)((s->gzhead->time >> 24) & 0xff));
 201.610 +                put_byte(s, s->level == 9 ? 2 :
 201.611 +                            (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ?
 201.612 +                             4 : 0));
 201.613 +                put_byte(s, s->gzhead->os & 0xff);
 201.614 +                if (s->gzhead->extra != NULL) {
 201.615 +                    put_byte(s, s->gzhead->extra_len & 0xff);
 201.616 +                    put_byte(s, (s->gzhead->extra_len >> 8) & 0xff);
 201.617 +                }
 201.618 +                if (s->gzhead->hcrc)
 201.619 +                    strm->adler = crc32(strm->adler, s->pending_buf,
 201.620 +                                        s->pending);
 201.621 +                s->gzindex = 0;
 201.622 +                s->status = EXTRA_STATE;
 201.623 +            }
 201.624 +        }
 201.625 +        else
 201.626 +#endif
 201.627 +        {
 201.628 +            uInt header = (Z_DEFLATED + ((s->w_bits-8)<<4)) << 8;
 201.629 +            uInt level_flags;
 201.630 +
 201.631 +            if (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2)
 201.632 +                level_flags = 0;
 201.633 +            else if (s->level < 6)
 201.634 +                level_flags = 1;
 201.635 +            else if (s->level == 6)
 201.636 +                level_flags = 2;
 201.637 +            else
 201.638 +                level_flags = 3;
 201.639 +            header |= (level_flags << 6);
 201.640 +            if (s->strstart != 0) header |= PRESET_DICT;
 201.641 +            header += 31 - (header % 31);
 201.642 +
 201.643 +            s->status = BUSY_STATE;
 201.644 +            putShortMSB(s, header);
 201.645 +
 201.646 +            /* Save the adler32 of the preset dictionary: */
 201.647 +            if (s->strstart != 0) {
 201.648 +                putShortMSB(s, (uInt)(strm->adler >> 16));
 201.649 +                putShortMSB(s, (uInt)(strm->adler & 0xffff));
 201.650 +            }
 201.651 +            strm->adler = adler32(0L, Z_NULL, 0);
 201.652 +        }
 201.653 +    }
 201.654 +#ifdef GZIP
 201.655 +    if (s->status == EXTRA_STATE) {
 201.656 +        if (s->gzhead->extra != NULL) {
 201.657 +            uInt beg = s->pending;  /* start of bytes to update crc */
 201.658 +
 201.659 +            while (s->gzindex < (s->gzhead->extra_len & 0xffff)) {
 201.660 +                if (s->pending == s->pending_buf_size) {
 201.661 +                    if (s->gzhead->hcrc && s->pending > beg)
 201.662 +                        strm->adler = crc32(strm->adler, s->pending_buf + beg,
 201.663 +                                            s->pending - beg);
 201.664 +                    flush_pending(strm);
 201.665 +                    beg = s->pending;
 201.666 +                    if (s->pending == s->pending_buf_size)
 201.667 +                        break;
 201.668 +                }
 201.669 +                put_byte(s, s->gzhead->extra[s->gzindex]);
 201.670 +                s->gzindex++;
 201.671 +            }
 201.672 +            if (s->gzhead->hcrc && s->pending > beg)
 201.673 +                strm->adler = crc32(strm->adler, s->pending_buf + beg,
 201.674 +                                    s->pending - beg);
 201.675 +            if (s->gzindex == s->gzhead->extra_len) {
 201.676 +                s->gzindex = 0;
 201.677 +                s->status = NAME_STATE;
 201.678 +            }
 201.679 +        }
 201.680 +        else
 201.681 +            s->status = NAME_STATE;
 201.682 +    }
 201.683 +    if (s->status == NAME_STATE) {
 201.684 +        if (s->gzhead->name != NULL) {
 201.685 +            uInt beg = s->pending;  /* start of bytes to update crc */
 201.686 +            int val;
 201.687 +
 201.688 +            do {
 201.689 +                if (s->pending == s->pending_buf_size) {
 201.690 +                    if (s->gzhead->hcrc && s->pending > beg)
 201.691 +                        strm->adler = crc32(strm->adler, s->pending_buf + beg,
 201.692 +                                            s->pending - beg);
 201.693 +                    flush_pending(strm);
 201.694 +                    beg = s->pending;
 201.695 +                    if (s->pending == s->pending_buf_size) {
 201.696 +                        val = 1;
 201.697 +                        break;
 201.698 +                    }
 201.699 +                }
 201.700 +                val = s->gzhead->name[s->gzindex++];
 201.701 +                put_byte(s, val);
 201.702 +            } while (val != 0);
 201.703 +            if (s->gzhead->hcrc && s->pending > beg)
 201.704 +                strm->adler = crc32(strm->adler, s->pending_buf + beg,
 201.705 +                                    s->pending - beg);
 201.706 +            if (val == 0) {
 201.707 +                s->gzindex = 0;
 201.708 +                s->status = COMMENT_STATE;
 201.709 +            }
 201.710 +        }
 201.711 +        else
 201.712 +            s->status = COMMENT_STATE;
 201.713 +    }
 201.714 +    if (s->status == COMMENT_STATE) {
 201.715 +        if (s->gzhead->comment != NULL) {
 201.716 +            uInt beg = s->pending;  /* start of bytes to update crc */
 201.717 +            int val;
 201.718 +
 201.719 +            do {
 201.720 +                if (s->pending == s->pending_buf_size) {
 201.721 +                    if (s->gzhead->hcrc && s->pending > beg)
 201.722 +                        strm->adler = crc32(strm->adler, s->pending_buf + beg,
 201.723 +                                            s->pending - beg);
 201.724 +                    flush_pending(strm);
 201.725 +                    beg = s->pending;
 201.726 +                    if (s->pending == s->pending_buf_size) {
 201.727 +                        val = 1;
 201.728 +                        break;
 201.729 +                    }
 201.730 +                }
 201.731 +                val = s->gzhead->comment[s->gzindex++];
 201.732 +                put_byte(s, val);
 201.733 +            } while (val != 0);
 201.734 +            if (s->gzhead->hcrc && s->pending > beg)
 201.735 +                strm->adler = crc32(strm->adler, s->pending_buf + beg,
 201.736 +                                    s->pending - beg);
 201.737 +            if (val == 0)
 201.738 +                s->status = HCRC_STATE;
 201.739 +        }
 201.740 +        else
 201.741 +            s->status = HCRC_STATE;
 201.742 +    }
 201.743 +    if (s->status == HCRC_STATE) {
 201.744 +        if (s->gzhead->hcrc) {
 201.745 +            if (s->pending + 2 > s->pending_buf_size)
 201.746 +                flush_pending(strm);
 201.747 +            if (s->pending + 2 <= s->pending_buf_size) {
 201.748 +                put_byte(s, (Byte)(strm->adler & 0xff));
 201.749 +                put_byte(s, (Byte)((strm->adler >> 8) & 0xff));
 201.750 +                strm->adler = crc32(0L, Z_NULL, 0);
 201.751 +                s->status = BUSY_STATE;
 201.752 +            }
 201.753 +        }
 201.754 +        else
 201.755 +            s->status = BUSY_STATE;
 201.756 +    }
 201.757 +#endif
 201.758 +
 201.759 +    /* Flush as much pending output as possible */
 201.760 +    if (s->pending != 0) {
 201.761 +        flush_pending(strm);
 201.762 +        if (strm->avail_out == 0) {
 201.763 +            /* Since avail_out is 0, deflate will be called again with
 201.764 +             * more output space, but possibly with both pending and
 201.765 +             * avail_in equal to zero. There won't be anything to do,
 201.766 +             * but this is not an error situation so make sure we
 201.767 +             * return OK instead of BUF_ERROR at next call of deflate:
 201.768 +             */
 201.769 +            s->last_flush = -1;
 201.770 +            return Z_OK;
 201.771 +        }
 201.772 +
 201.773 +    /* Make sure there is something to do and avoid duplicate consecutive
 201.774 +     * flushes. For repeated and useless calls with Z_FINISH, we keep
 201.775 +     * returning Z_STREAM_END instead of Z_BUF_ERROR.
 201.776 +     */
 201.777 +    } else if (strm->avail_in == 0 && flush <= old_flush &&
 201.778 +               flush != Z_FINISH) {
 201.779 +        ERR_RETURN(strm, Z_BUF_ERROR);
 201.780 +    }
 201.781 +
 201.782 +    /* User must not provide more input after the first FINISH: */
 201.783 +    if (s->status == FINISH_STATE && strm->avail_in != 0) {
 201.784 +        ERR_RETURN(strm, Z_BUF_ERROR);
 201.785 +    }
 201.786 +
 201.787 +    /* Start a new block or continue the current one.
 201.788 +     */
 201.789 +    if (strm->avail_in != 0 || s->lookahead != 0 ||
 201.790 +        (flush != Z_NO_FLUSH && s->status != FINISH_STATE)) {
 201.791 +        block_state bstate;
 201.792 +
 201.793 +        bstate = (*(configuration_table[s->level].func))(s, flush);
 201.794 +
 201.795 +        if (bstate == finish_started || bstate == finish_done) {
 201.796 +            s->status = FINISH_STATE;
 201.797 +        }
 201.798 +        if (bstate == need_more || bstate == finish_started) {
 201.799 +            if (strm->avail_out == 0) {
 201.800 +                s->last_flush = -1; /* avoid BUF_ERROR next call, see above */
 201.801 +            }
 201.802 +            return Z_OK;
 201.803 +            /* If flush != Z_NO_FLUSH && avail_out == 0, the next call
 201.804 +             * of deflate should use the same flush parameter to make sure
 201.805 +             * that the flush is complete. So we don't have to output an
 201.806 +             * empty block here, this will be done at next call. This also
 201.807 +             * ensures that for a very small output buffer, we emit at most
 201.808 +             * one empty block.
 201.809 +             */
 201.810 +        }
 201.811 +        if (bstate == block_done) {
 201.812 +            if (flush == Z_PARTIAL_FLUSH) {
 201.813 +                _tr_align(s);
 201.814 +            } else { /* FULL_FLUSH or SYNC_FLUSH */
 201.815 +                _tr_stored_block(s, (char*)0, 0L, 0);
 201.816 +                /* For a full flush, this empty block will be recognized
 201.817 +                 * as a special marker by inflate_sync().
 201.818 +                 */
 201.819 +                if (flush == Z_FULL_FLUSH) {
 201.820 +                    CLEAR_HASH(s);             /* forget history */
 201.821 +                }
 201.822 +            }
 201.823 +            flush_pending(strm);
 201.824 +            if (strm->avail_out == 0) {
 201.825 +              s->last_flush = -1; /* avoid BUF_ERROR at next call, see above */
 201.826 +              return Z_OK;
 201.827 +            }
 201.828 +        }
 201.829 +    }
 201.830 +    Assert(strm->avail_out > 0, "bug2");
 201.831 +
 201.832 +    if (flush != Z_FINISH) return Z_OK;
 201.833 +    if (s->wrap <= 0) return Z_STREAM_END;
 201.834 +
 201.835 +    /* Write the trailer */
 201.836 +#ifdef GZIP
 201.837 +    if (s->wrap == 2) {
 201.838 +        put_byte(s, (Byte)(strm->adler & 0xff));
 201.839 +        put_byte(s, (Byte)((strm->adler >> 8) & 0xff));
 201.840 +        put_byte(s, (Byte)((strm->adler >> 16) & 0xff));
 201.841 +        put_byte(s, (Byte)((strm->adler >> 24) & 0xff));
 201.842 +        put_byte(s, (Byte)(strm->total_in & 0xff));
 201.843 +        put_byte(s, (Byte)((strm->total_in >> 8) & 0xff));
 201.844 +        put_byte(s, (Byte)((strm->total_in >> 16) & 0xff));
 201.845 +        put_byte(s, (Byte)((strm->total_in >> 24) & 0xff));
 201.846 +    }
 201.847 +    else
 201.848 +#endif
 201.849 +    {
 201.850 +        putShortMSB(s, (uInt)(strm->adler >> 16));
 201.851 +        putShortMSB(s, (uInt)(strm->adler & 0xffff));
 201.852 +    }
 201.853 +    flush_pending(strm);
 201.854 +    /* If avail_out is zero, the application will call deflate again
 201.855 +     * to flush the rest.
 201.856 +     */
 201.857 +    if (s->wrap > 0) s->wrap = -s->wrap; /* write the trailer only once! */
 201.858 +    return s->pending != 0 ? Z_OK : Z_STREAM_END;
 201.859 +}
 201.860 +
 201.861 +/* ========================================================================= */
 201.862 +int ZEXPORT deflateEnd (strm)
 201.863 +    z_streamp strm;
 201.864 +{
 201.865 +    int status;
 201.866 +
 201.867 +    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
 201.868 +
 201.869 +    status = strm->state->status;
 201.870 +    if (status != INIT_STATE &&
 201.871 +        status != EXTRA_STATE &&
 201.872 +        status != NAME_STATE &&
 201.873 +        status != COMMENT_STATE &&
 201.874 +        status != HCRC_STATE &&
 201.875 +        status != BUSY_STATE &&
 201.876 +        status != FINISH_STATE) {
 201.877 +      return Z_STREAM_ERROR;
 201.878 +    }
 201.879 +
 201.880 +    /* Deallocate in reverse order of allocations: */
 201.881 +    TRY_FREE(strm, strm->state->pending_buf);
 201.882 +    TRY_FREE(strm, strm->state->head);
 201.883 +    TRY_FREE(strm, strm->state->prev);
 201.884 +    TRY_FREE(strm, strm->state->window);
 201.885 +
 201.886 +    ZFREE(strm, strm->state);
 201.887 +    strm->state = Z_NULL;
 201.888 +
 201.889 +    return status == BUSY_STATE ? Z_DATA_ERROR : Z_OK;
 201.890 +}
 201.891 +
 201.892 +/* =========================================================================
 201.893 + * Copy the source state to the destination state.
 201.894 + * To simplify the source, this is not supported for 16-bit MSDOS (which
 201.895 + * doesn't have enough memory anyway to duplicate compression states).
 201.896 + */
 201.897 +int ZEXPORT deflateCopy (dest, source)
 201.898 +    z_streamp dest;
 201.899 +    z_streamp source;
 201.900 +{
 201.901 +#ifdef MAXSEG_64K
 201.902 +    return Z_STREAM_ERROR;
 201.903 +#else
 201.904 +    deflate_state *ds;
 201.905 +    deflate_state *ss;
 201.906 +    ushf *overlay;
 201.907 +
 201.908 +
 201.909 +    if (source == Z_NULL || dest == Z_NULL || source->state == Z_NULL) {
 201.910 +        return Z_STREAM_ERROR;
 201.911 +    }
 201.912 +
 201.913 +    ss = source->state;
 201.914 +
 201.915 +    zmemcpy(dest, source, sizeof(z_stream));
 201.916 +
 201.917 +    ds = (deflate_state *) ZALLOC(dest, 1, sizeof(deflate_state));
 201.918 +    if (ds == Z_NULL) return Z_MEM_ERROR;
 201.919 +    dest->state = (struct internal_state FAR *) ds;
 201.920 +    zmemcpy(ds, ss, sizeof(deflate_state));
 201.921 +    ds->strm = dest;
 201.922 +
 201.923 +    ds->window = (Bytef *) ZALLOC(dest, ds->w_size, 2*sizeof(Byte));
 201.924 +    ds->prev   = (Posf *)  ZALLOC(dest, ds->w_size, sizeof(Pos));
 201.925 +    ds->head   = (Posf *)  ZALLOC(dest, ds->hash_size, sizeof(Pos));
 201.926 +    overlay = (ushf *) ZALLOC(dest, ds->lit_bufsize, sizeof(ush)+2);
 201.927 +    ds->pending_buf = (uchf *) overlay;
 201.928 +
 201.929 +    if (ds->window == Z_NULL || ds->prev == Z_NULL || ds->head == Z_NULL ||
 201.930 +        ds->pending_buf == Z_NULL) {
 201.931 +        deflateEnd (dest);
 201.932 +        return Z_MEM_ERROR;
 201.933 +    }
 201.934 +    /* following zmemcpy do not work for 16-bit MSDOS */
 201.935 +    zmemcpy(ds->window, ss->window, ds->w_size * 2 * sizeof(Byte));
 201.936 +    zmemcpy(ds->prev, ss->prev, ds->w_size * sizeof(Pos));
 201.937 +    zmemcpy(ds->head, ss->head, ds->hash_size * sizeof(Pos));
 201.938 +    zmemcpy(ds->pending_buf, ss->pending_buf, (uInt)ds->pending_buf_size);
 201.939 +
 201.940 +    ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf);
 201.941 +    ds->d_buf = overlay + ds->lit_bufsize/sizeof(ush);
 201.942 +    ds->l_buf = ds->pending_buf + (1+sizeof(ush))*ds->lit_bufsize;
 201.943 +
 201.944 +    ds->l_desc.dyn_tree = ds->dyn_ltree;
 201.945 +    ds->d_desc.dyn_tree = ds->dyn_dtree;
 201.946 +    ds->bl_desc.dyn_tree = ds->bl_tree;
 201.947 +
 201.948 +    return Z_OK;
 201.949 +#endif /* MAXSEG_64K */
 201.950 +}
 201.951 +
 201.952 +/* ===========================================================================
 201.953 + * Read a new buffer from the current input stream, update the adler32
 201.954 + * and total number of bytes read.  All deflate() input goes through
 201.955 + * this function so some applications may wish to modify it to avoid
 201.956 + * allocating a large strm->next_in buffer and copying from it.
 201.957 + * (See also flush_pending()).
 201.958 + */
 201.959 +local int read_buf(strm, buf, size)
 201.960 +    z_streamp strm;
 201.961 +    Bytef *buf;
 201.962 +    unsigned size;
 201.963 +{
 201.964 +    unsigned len = strm->avail_in;
 201.965 +
 201.966 +    if (len > size) len = size;
 201.967 +    if (len == 0) return 0;
 201.968 +
 201.969 +    strm->avail_in  -= len;
 201.970 +
 201.971 +    if (strm->state->wrap == 1) {
 201.972 +        strm->adler = adler32(strm->adler, strm->next_in, len);
 201.973 +    }
 201.974 +#ifdef GZIP
 201.975 +    else if (strm->state->wrap == 2) {
 201.976 +        strm->adler = crc32(strm->adler, strm->next_in, len);
 201.977 +    }
 201.978 +#endif
 201.979 +    zmemcpy(buf, strm->next_in, len);
 201.980 +    strm->next_in  += len;
 201.981 +    strm->total_in += len;
 201.982 +
 201.983 +    return (int)len;
 201.984 +}
 201.985 +
 201.986 +/* ===========================================================================
 201.987 + * Initialize the "longest match" routines for a new zlib stream
 201.988 + */
 201.989 +local void lm_init (s)
 201.990 +    deflate_state *s;
 201.991 +{
 201.992 +    s->window_size = (ulg)2L*s->w_size;
 201.993 +
 201.994 +    CLEAR_HASH(s);
 201.995 +
 201.996 +    /* Set the default configuration parameters:
 201.997 +     */
 201.998 +    s->max_lazy_match   = configuration_table[s->level].max_lazy;
 201.999 +    s->good_match       = configuration_table[s->level].good_length;
201.1000 +    s->nice_match       = configuration_table[s->level].nice_length;
201.1001 +    s->max_chain_length = configuration_table[s->level].max_chain;
201.1002 +
201.1003 +    s->strstart = 0;
201.1004 +    s->block_start = 0L;
201.1005 +    s->lookahead = 0;
201.1006 +    s->match_length = s->prev_length = MIN_MATCH-1;
201.1007 +    s->match_available = 0;
201.1008 +    s->ins_h = 0;
201.1009 +#ifndef FASTEST
201.1010 +#ifdef ASMV
201.1011 +    match_init(); /* initialize the asm code */
201.1012 +#endif
201.1013 +#endif
201.1014 +}
201.1015 +
201.1016 +#ifndef FASTEST
201.1017 +/* ===========================================================================
201.1018 + * Set match_start to the longest match starting at the given string and
201.1019 + * return its length. Matches shorter or equal to prev_length are discarded,
201.1020 + * in which case the result is equal to prev_length and match_start is
201.1021 + * garbage.
201.1022 + * IN assertions: cur_match is the head of the hash chain for the current
201.1023 + *   string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1
201.1024 + * OUT assertion: the match length is not greater than s->lookahead.
201.1025 + */
201.1026 +#ifndef ASMV
201.1027 +/* For 80x86 and 680x0, an optimized version will be provided in match.asm or
201.1028 + * match.S. The code will be functionally equivalent.
201.1029 + */
201.1030 +local uInt longest_match(s, cur_match)
201.1031 +    deflate_state *s;
201.1032 +    IPos cur_match;                             /* current match */
201.1033 +{
201.1034 +    unsigned chain_length = s->max_chain_length;/* max hash chain length */
201.1035 +    register Bytef *scan = s->window + s->strstart; /* current string */
201.1036 +    register Bytef *match;                       /* matched string */
201.1037 +    register int len;                           /* length of current match */
201.1038 +    int best_len = s->prev_length;              /* best match length so far */
201.1039 +    int nice_match = s->nice_match;             /* stop if match long enough */
201.1040 +    IPos limit = s->strstart > (IPos)MAX_DIST(s) ?
201.1041 +        s->strstart - (IPos)MAX_DIST(s) : NIL;
201.1042 +    /* Stop when cur_match becomes <= limit. To simplify the code,
201.1043 +     * we prevent matches with the string of window index 0.
201.1044 +     */
201.1045 +    Posf *prev = s->prev;
201.1046 +    uInt wmask = s->w_mask;
201.1047 +
201.1048 +#ifdef UNALIGNED_OK
201.1049 +    /* Compare two bytes at a time. Note: this is not always beneficial.
201.1050 +     * Try with and without -DUNALIGNED_OK to check.
201.1051 +     */
201.1052 +    register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1;
201.1053 +    register ush scan_start = *(ushf*)scan;
201.1054 +    register ush scan_end   = *(ushf*)(scan+best_len-1);
201.1055 +#else
201.1056 +    register Bytef *strend = s->window + s->strstart + MAX_MATCH;
201.1057 +    register Byte scan_end1  = scan[best_len-1];
201.1058 +    register Byte scan_end   = scan[best_len];
201.1059 +#endif
201.1060 +
201.1061 +    /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
201.1062 +     * It is easy to get rid of this optimization if necessary.
201.1063 +     */
201.1064 +    Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
201.1065 +
201.1066 +    /* Do not waste too much time if we already have a good match: */
201.1067 +    if (s->prev_length >= s->good_match) {
201.1068 +        chain_length >>= 2;
201.1069 +    }
201.1070 +    /* Do not look for matches beyond the end of the input. This is necessary
201.1071 +     * to make deflate deterministic.
201.1072 +     */
201.1073 +    if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead;
201.1074 +
201.1075 +    Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
201.1076 +
201.1077 +    do {
201.1078 +        Assert(cur_match < s->strstart, "no future");
201.1079 +        match = s->window + cur_match;
201.1080 +
201.1081 +        /* Skip to next match if the match length cannot increase
201.1082 +         * or if the match length is less than 2.  Note that the checks below
201.1083 +         * for insufficient lookahead only occur occasionally for performance
201.1084 +         * reasons.  Therefore uninitialized memory will be accessed, and
201.1085 +         * conditional jumps will be made that depend on those values.
201.1086 +         * However the length of the match is limited to the lookahead, so
201.1087 +         * the output of deflate is not affected by the uninitialized values.
201.1088 +         */
201.1089 +#if (defined(UNALIGNED_OK) && MAX_MATCH == 258)
201.1090 +        /* This code assumes sizeof(unsigned short) == 2. Do not use
201.1091 +         * UNALIGNED_OK if your compiler uses a different size.
201.1092 +         */
201.1093 +        if (*(ushf*)(match+best_len-1) != scan_end ||
201.1094 +            *(ushf*)match != scan_start) continue;
201.1095 +
201.1096 +        /* It is not necessary to compare scan[2] and match[2] since they are
201.1097 +         * always equal when the other bytes match, given that the hash keys
201.1098 +         * are equal and that HASH_BITS >= 8. Compare 2 bytes at a time at
201.1099 +         * strstart+3, +5, ... up to strstart+257. We check for insufficient
201.1100 +         * lookahead only every 4th comparison; the 128th check will be made
201.1101 +         * at strstart+257. If MAX_MATCH-2 is not a multiple of 8, it is
201.1102 +         * necessary to put more guard bytes at the end of the window, or
201.1103 +         * to check more often for insufficient lookahead.
201.1104 +         */
201.1105 +        Assert(scan[2] == match[2], "scan[2]?");
201.1106 +        scan++, match++;
201.1107 +        do {
201.1108 +        } while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
201.1109 +                 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
201.1110 +                 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
201.1111 +                 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
201.1112 +                 scan < strend);
201.1113 +        /* The funny "do {}" generates better code on most compilers */
201.1114 +
201.1115 +        /* Here, scan <= window+strstart+257 */
201.1116 +        Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
201.1117 +        if (*scan == *match) scan++;
201.1118 +
201.1119 +        len = (MAX_MATCH - 1) - (int)(strend-scan);
201.1120 +        scan = strend - (MAX_MATCH-1);
201.1121 +
201.1122 +#else /* UNALIGNED_OK */
201.1123 +
201.1124 +        if (match[best_len]   != scan_end  ||
201.1125 +            match[best_len-1] != scan_end1 ||
201.1126 +            *match            != *scan     ||
201.1127 +            *++match          != scan[1])      continue;
201.1128 +
201.1129 +        /* The check at best_len-1 can be removed because it will be made
201.1130 +         * again later. (This heuristic is not always a win.)
201.1131 +         * It is not necessary to compare scan[2] and match[2] since they
201.1132 +         * are always equal when the other bytes match, given that
201.1133 +         * the hash keys are equal and that HASH_BITS >= 8.
201.1134 +         */
201.1135 +        scan += 2, match++;
201.1136 +        Assert(*scan == *match, "match[2]?");
201.1137 +
201.1138 +        /* We check for insufficient lookahead only every 8th comparison;
201.1139 +         * the 256th check will be made at strstart+258.
201.1140 +         */
201.1141 +        do {
201.1142 +        } while (*++scan == *++match && *++scan == *++match &&
201.1143 +                 *++scan == *++match && *++scan == *++match &&
201.1144 +                 *++scan == *++match && *++scan == *++match &&
201.1145 +                 *++scan == *++match && *++scan == *++match &&
201.1146 +                 scan < strend);
201.1147 +
201.1148 +        Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
201.1149 +
201.1150 +        len = MAX_MATCH - (int)(strend - scan);
201.1151 +        scan = strend - MAX_MATCH;
201.1152 +
201.1153 +#endif /* UNALIGNED_OK */
201.1154 +
201.1155 +        if (len > best_len) {
201.1156 +            s->match_start = cur_match;
201.1157 +            best_len = len;
201.1158 +            if (len >= nice_match) break;
201.1159 +#ifdef UNALIGNED_OK
201.1160 +            scan_end = *(ushf*)(scan+best_len-1);
201.1161 +#else
201.1162 +            scan_end1  = scan[best_len-1];
201.1163 +            scan_end   = scan[best_len];
201.1164 +#endif
201.1165 +        }
201.1166 +    } while ((cur_match = prev[cur_match & wmask]) > limit
201.1167 +             && --chain_length != 0);
201.1168 +
201.1169 +    if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
201.1170 +    return s->lookahead;
201.1171 +}
201.1172 +#endif /* ASMV */
201.1173 +#endif /* FASTEST */
201.1174 +
201.1175 +/* ---------------------------------------------------------------------------
201.1176 + * Optimized version for level == 1 or strategy == Z_RLE only
201.1177 + */
201.1178 +local uInt longest_match_fast(s, cur_match)
201.1179 +    deflate_state *s;
201.1180 +    IPos cur_match;                             /* current match */
201.1181 +{
201.1182 +    register Bytef *scan = s->window + s->strstart; /* current string */
201.1183 +    register Bytef *match;                       /* matched string */
201.1184 +    register int len;                           /* length of current match */
201.1185 +    register Bytef *strend = s->window + s->strstart + MAX_MATCH;
201.1186 +
201.1187 +    /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
201.1188 +     * It is easy to get rid of this optimization if necessary.
201.1189 +     */
201.1190 +    Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
201.1191 +
201.1192 +    Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
201.1193 +
201.1194 +    Assert(cur_match < s->strstart, "no future");
201.1195 +
201.1196 +    match = s->window + cur_match;
201.1197 +
201.1198 +    /* Return failure if the match length is less than 2:
201.1199 +     */
201.1200 +    if (match[0] != scan[0] || match[1] != scan[1]) return MIN_MATCH-1;
201.1201 +
201.1202 +    /* The check at best_len-1 can be removed because it will be made
201.1203 +     * again later. (This heuristic is not always a win.)
201.1204 +     * It is not necessary to compare scan[2] and match[2] since they
201.1205 +     * are always equal when the other bytes match, given that
201.1206 +     * the hash keys are equal and that HASH_BITS >= 8.
201.1207 +     */
201.1208 +    scan += 2, match += 2;
201.1209 +    Assert(*scan == *match, "match[2]?");
201.1210 +
201.1211 +    /* We check for insufficient lookahead only every 8th comparison;
201.1212 +     * the 256th check will be made at strstart+258.
201.1213 +     */
201.1214 +    do {
201.1215 +    } while (*++scan == *++match && *++scan == *++match &&
201.1216 +             *++scan == *++match && *++scan == *++match &&
201.1217 +             *++scan == *++match && *++scan == *++match &&
201.1218 +             *++scan == *++match && *++scan == *++match &&
201.1219 +             scan < strend);
201.1220 +
201.1221 +    Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
201.1222 +
201.1223 +    len = MAX_MATCH - (int)(strend - scan);
201.1224 +
201.1225 +    if (len < MIN_MATCH) return MIN_MATCH - 1;
201.1226 +
201.1227 +    s->match_start = cur_match;
201.1228 +    return (uInt)len <= s->lookahead ? (uInt)len : s->lookahead;
201.1229 +}
201.1230 +
201.1231 +#ifdef DEBUG
201.1232 +/* ===========================================================================
201.1233 + * Check that the match at match_start is indeed a match.
201.1234 + */
201.1235 +local void check_match(s, start, match, length)
201.1236 +    deflate_state *s;
201.1237 +    IPos start, match;
201.1238 +    int length;
201.1239 +{
201.1240 +    /* check that the match is indeed a match */
201.1241 +    if (zmemcmp(s->window + match,
201.1242 +                s->window + start, length) != EQUAL) {
201.1243 +        fprintf(stderr, " start %u, match %u, length %d\n",
201.1244 +                start, match, length);
201.1245 +        do {
201.1246 +            fprintf(stderr, "%c%c", s->window[match++], s->window[start++]);
201.1247 +        } while (--length != 0);
201.1248 +        z_error("invalid match");
201.1249 +    }
201.1250 +    if (z_verbose > 1) {
201.1251 +        fprintf(stderr,"\\[%d,%d]", start-match, length);
201.1252 +        do { putc(s->window[start++], stderr); } while (--length != 0);
201.1253 +    }
201.1254 +}
201.1255 +#else
201.1256 +#  define check_match(s, start, match, length)
201.1257 +#endif /* DEBUG */
201.1258 +
201.1259 +/* ===========================================================================
201.1260 + * Fill the window when the lookahead becomes insufficient.
201.1261 + * Updates strstart and lookahead.
201.1262 + *
201.1263 + * IN assertion: lookahead < MIN_LOOKAHEAD
201.1264 + * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD
201.1265 + *    At least one byte has been read, or avail_in == 0; reads are
201.1266 + *    performed for at least two bytes (required for the zip translate_eol
201.1267 + *    option -- not supported here).
201.1268 + */
201.1269 +local void fill_window(s)
201.1270 +    deflate_state *s;
201.1271 +{
201.1272 +    register unsigned n, m;
201.1273 +    register Posf *p;
201.1274 +    unsigned more;    /* Amount of free space at the end of the window. */
201.1275 +    uInt wsize = s->w_size;
201.1276 +
201.1277 +    do {
201.1278 +        more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart);
201.1279 +
201.1280 +        /* Deal with !@#$% 64K limit: */
201.1281 +        if (sizeof(int) <= 2) {
201.1282 +            if (more == 0 && s->strstart == 0 && s->lookahead == 0) {
201.1283 +                more = wsize;
201.1284 +
201.1285 +            } else if (more == (unsigned)(-1)) {
201.1286 +                /* Very unlikely, but possible on 16 bit machine if
201.1287 +                 * strstart == 0 && lookahead == 1 (input done a byte at time)
201.1288 +                 */
201.1289 +                more--;
201.1290 +            }
201.1291 +        }
201.1292 +
201.1293 +        /* If the window is almost full and there is insufficient lookahead,
201.1294 +         * move the upper half to the lower one to make room in the upper half.
201.1295 +         */
201.1296 +        if (s->strstart >= wsize+MAX_DIST(s)) {
201.1297 +
201.1298 +            zmemcpy(s->window, s->window+wsize, (unsigned)wsize);
201.1299 +            s->match_start -= wsize;
201.1300 +            s->strstart    -= wsize; /* we now have strstart >= MAX_DIST */
201.1301 +            s->block_start -= (long) wsize;
201.1302 +
201.1303 +            /* Slide the hash table (could be avoided with 32 bit values
201.1304 +               at the expense of memory usage). We slide even when level == 0
201.1305 +               to keep the hash table consistent if we switch back to level > 0
201.1306 +               later. (Using level 0 permanently is not an optimal usage of
201.1307 +               zlib, so we don't care about this pathological case.)
201.1308 +             */
201.1309 +            /* %%% avoid this when Z_RLE */
201.1310 +            n = s->hash_size;
201.1311 +            p = &s->head[n];
201.1312 +            do {
201.1313 +                m = *--p;
201.1314 +                *p = (Pos)(m >= wsize ? m-wsize : NIL);
201.1315 +            } while (--n);
201.1316 +
201.1317 +            n = wsize;
201.1318 +#ifndef FASTEST
201.1319 +            p = &s->prev[n];
201.1320 +            do {
201.1321 +                m = *--p;
201.1322 +                *p = (Pos)(m >= wsize ? m-wsize : NIL);
201.1323 +                /* If n is not on any hash chain, prev[n] is garbage but
201.1324 +                 * its value will never be used.
201.1325 +                 */
201.1326 +            } while (--n);
201.1327 +#endif
201.1328 +            more += wsize;
201.1329 +        }
201.1330 +        if (s->strm->avail_in == 0) return;
201.1331 +
201.1332 +        /* If there was no sliding:
201.1333 +         *    strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&
201.1334 +         *    more == window_size - lookahead - strstart
201.1335 +         * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)
201.1336 +         * => more >= window_size - 2*WSIZE + 2
201.1337 +         * In the BIG_MEM or MMAP case (not yet supported),
201.1338 +         *   window_size == input_size + MIN_LOOKAHEAD  &&
201.1339 +         *   strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.
201.1340 +         * Otherwise, window_size == 2*WSIZE so more >= 2.
201.1341 +         * If there was sliding, more >= WSIZE. So in all cases, more >= 2.
201.1342 +         */
201.1343 +        Assert(more >= 2, "more < 2");
201.1344 +
201.1345 +        n = read_buf(s->strm, s->window + s->strstart + s->lookahead, more);
201.1346 +        s->lookahead += n;
201.1347 +
201.1348 +        /* Initialize the hash value now that we have some input: */
201.1349 +        if (s->lookahead >= MIN_MATCH) {
201.1350 +            s->ins_h = s->window[s->strstart];
201.1351 +            UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]);
201.1352 +#if MIN_MATCH != 3
201.1353 +            Call UPDATE_HASH() MIN_MATCH-3 more times
201.1354 +#endif
201.1355 +        }
201.1356 +        /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,
201.1357 +         * but this is not important since only literal bytes will be emitted.
201.1358 +         */
201.1359 +
201.1360 +    } while (s->lookahead < MIN_LOOKAHEAD && s->strm->avail_in != 0);
201.1361 +}
201.1362 +
201.1363 +/* ===========================================================================
201.1364 + * Flush the current block, with given end-of-file flag.
201.1365 + * IN assertion: strstart is set to the end of the current match.
201.1366 + */
201.1367 +#define FLUSH_BLOCK_ONLY(s, eof) { \
201.1368 +   _tr_flush_block(s, (s->block_start >= 0L ? \
201.1369 +                   (charf *)&s->window[(unsigned)s->block_start] : \
201.1370 +                   (charf *)Z_NULL), \
201.1371 +                (ulg)((long)s->strstart - s->block_start), \
201.1372 +                (eof)); \
201.1373 +   s->block_start = s->strstart; \
201.1374 +   flush_pending(s->strm); \
201.1375 +   Tracev((stderr,"[FLUSH]")); \
201.1376 +}
201.1377 +
201.1378 +/* Same but force premature exit if necessary. */
201.1379 +#define FLUSH_BLOCK(s, eof) { \
201.1380 +   FLUSH_BLOCK_ONLY(s, eof); \
201.1381 +   if (s->strm->avail_out == 0) return (eof) ? finish_started : need_more; \
201.1382 +}
201.1383 +
201.1384 +/* ===========================================================================
201.1385 + * Copy without compression as much as possible from the input stream, return
201.1386 + * the current block state.
201.1387 + * This function does not insert new strings in the dictionary since
201.1388 + * uncompressible data is probably not useful. This function is used
201.1389 + * only for the level=0 compression option.
201.1390 + * NOTE: this function should be optimized to avoid extra copying from
201.1391 + * window to pending_buf.
201.1392 + */
201.1393 +local block_state deflate_stored(s, flush)
201.1394 +    deflate_state *s;
201.1395 +    int flush;
201.1396 +{
201.1397 +    /* Stored blocks are limited to 0xffff bytes, pending_buf is limited
201.1398 +     * to pending_buf_size, and each stored block has a 5 byte header:
201.1399 +     */
201.1400 +    ulg max_block_size = 0xffff;
201.1401 +    ulg max_start;
201.1402 +
201.1403 +    if (max_block_size > s->pending_buf_size - 5) {
201.1404 +        max_block_size = s->pending_buf_size - 5;
201.1405 +    }
201.1406 +
201.1407 +    /* Copy as much as possible from input to output: */
201.1408 +    for (;;) {
201.1409 +        /* Fill the window as much as possible: */
201.1410 +        if (s->lookahead <= 1) {
201.1411 +
201.1412 +            Assert(s->strstart < s->w_size+MAX_DIST(s) ||
201.1413 +                   s->block_start >= (long)s->w_size, "slide too late");
201.1414 +
201.1415 +            fill_window(s);
201.1416 +            if (s->lookahead == 0 && flush == Z_NO_FLUSH) return need_more;
201.1417 +
201.1418 +            if (s->lookahead == 0) break; /* flush the current block */
201.1419 +        }
201.1420 +        Assert(s->block_start >= 0L, "block gone");
201.1421 +
201.1422 +        s->strstart += s->lookahead;
201.1423 +        s->lookahead = 0;
201.1424 +
201.1425 +        /* Emit a stored block if pending_buf will be full: */
201.1426 +        max_start = s->block_start + max_block_size;
201.1427 +        if (s->strstart == 0 || (ulg)s->strstart >= max_start) {
201.1428 +            /* strstart == 0 is possible when wraparound on 16-bit machine */
201.1429 +            s->lookahead = (uInt)(s->strstart - max_start);
201.1430 +            s->strstart = (uInt)max_start;
201.1431 +            FLUSH_BLOCK(s, 0);
201.1432 +        }
201.1433 +        /* Flush if we may have to slide, otherwise block_start may become
201.1434 +         * negative and the data will be gone:
201.1435 +         */
201.1436 +        if (s->strstart - (uInt)s->block_start >= MAX_DIST(s)) {
201.1437 +            FLUSH_BLOCK(s, 0);
201.1438 +        }
201.1439 +    }
201.1440 +    FLUSH_BLOCK(s, flush == Z_FINISH);
201.1441 +    return flush == Z_FINISH ? finish_done : block_done;
201.1442 +}
201.1443 +
201.1444 +/* ===========================================================================
201.1445 + * Compress as much as possible from the input stream, return the current
201.1446 + * block state.
201.1447 + * This function does not perform lazy evaluation of matches and inserts
201.1448 + * new strings in the dictionary only for unmatched strings or for short
201.1449 + * matches. It is used only for the fast compression options.
201.1450 + */
201.1451 +local block_state deflate_fast(s, flush)
201.1452 +    deflate_state *s;
201.1453 +    int flush;
201.1454 +{
201.1455 +    IPos hash_head = NIL; /* head of the hash chain */
201.1456 +    int bflush;           /* set if current block must be flushed */
201.1457 +
201.1458 +    for (;;) {
201.1459 +        /* Make sure that we always have enough lookahead, except
201.1460 +         * at the end of the input file. We need MAX_MATCH bytes
201.1461 +         * for the next match, plus MIN_MATCH bytes to insert the
201.1462 +         * string following the next match.
201.1463 +         */
201.1464 +        if (s->lookahead < MIN_LOOKAHEAD) {
201.1465 +            fill_window(s);
201.1466 +            if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
201.1467 +                return need_more;
201.1468 +            }
201.1469 +            if (s->lookahead == 0) break; /* flush the current block */
201.1470 +        }
201.1471 +
201.1472 +        /* Insert the string window[strstart .. strstart+2] in the
201.1473 +         * dictionary, and set hash_head to the head of the hash chain:
201.1474 +         */
201.1475 +        if (s->lookahead >= MIN_MATCH) {
201.1476 +            INSERT_STRING(s, s->strstart, hash_head);
201.1477 +        }
201.1478 +
201.1479 +        /* Find the longest match, discarding those <= prev_length.
201.1480 +         * At this point we have always match_length < MIN_MATCH
201.1481 +         */
201.1482 +        if (hash_head != NIL && s->strstart - hash_head <= MAX_DIST(s)) {
201.1483 +            /* To simplify the code, we prevent matches with the string
201.1484 +             * of window index 0 (in particular we have to avoid a match
201.1485 +             * of the string with itself at the start of the input file).
201.1486 +             */
201.1487 +#ifdef FASTEST
201.1488 +            if ((s->strategy != Z_HUFFMAN_ONLY && s->strategy != Z_RLE) ||
201.1489 +                (s->strategy == Z_RLE && s->strstart - hash_head == 1)) {
201.1490 +                s->match_length = longest_match_fast (s, hash_head);
201.1491 +            }
201.1492 +#else
201.1493 +            if (s->strategy != Z_HUFFMAN_ONLY && s->strategy != Z_RLE) {
201.1494 +                s->match_length = longest_match (s, hash_head);
201.1495 +            } else if (s->strategy == Z_RLE && s->strstart - hash_head == 1) {
201.1496 +                s->match_length = longest_match_fast (s, hash_head);
201.1497 +            }
201.1498 +#endif
201.1499 +            /* longest_match() or longest_match_fast() sets match_start */
201.1500 +        }
201.1501 +        if (s->match_length >= MIN_MATCH) {
201.1502 +            check_match(s, s->strstart, s->match_start, s->match_length);
201.1503 +
201.1504 +            _tr_tally_dist(s, s->strstart - s->match_start,
201.1505 +                           s->match_length - MIN_MATCH, bflush);
201.1506 +
201.1507 +            s->lookahead -= s->match_length;
201.1508 +
201.1509 +            /* Insert new strings in the hash table only if the match length
201.1510 +             * is not too large. This saves time but degrades compression.
201.1511 +             */
201.1512 +#ifndef FASTEST
201.1513 +            if (s->match_length <= s->max_insert_length &&
201.1514 +                s->lookahead >= MIN_MATCH) {
201.1515 +                s->match_length--; /* string at strstart already in table */
201.1516 +                do {
201.1517 +                    s->strstart++;
201.1518 +                    INSERT_STRING(s, s->strstart, hash_head);
201.1519 +                    /* strstart never exceeds WSIZE-MAX_MATCH, so there are
201.1520 +                     * always MIN_MATCH bytes ahead.
201.1521 +                     */
201.1522 +                } while (--s->match_length != 0);
201.1523 +                s->strstart++;
201.1524 +            } else
201.1525 +#endif
201.1526 +            {
201.1527 +                s->strstart += s->match_length;
201.1528 +                s->match_length = 0;
201.1529 +                s->ins_h = s->window[s->strstart];
201.1530 +                UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]);
201.1531 +#if MIN_MATCH != 3
201.1532 +                Call UPDATE_HASH() MIN_MATCH-3 more times
201.1533 +#endif
201.1534 +                /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not
201.1535 +                 * matter since it will be recomputed at next deflate call.
201.1536 +                 */
201.1537 +            }
201.1538 +        } else {
201.1539 +            /* No match, output a literal byte */
201.1540 +            Tracevv((stderr,"%c", s->window[s->strstart]));
201.1541 +            _tr_tally_lit (s, s->window[s->strstart], bflush);
201.1542 +            s->lookahead--;
201.1543 +            s->strstart++;
201.1544 +        }
201.1545 +        if (bflush) FLUSH_BLOCK(s, 0);
201.1546 +    }
201.1547 +    FLUSH_BLOCK(s, flush == Z_FINISH);
201.1548 +    return flush == Z_FINISH ? finish_done : block_done;
201.1549 +}
201.1550 +
201.1551 +#ifndef FASTEST
201.1552 +/* ===========================================================================
201.1553 + * Same as above, but achieves better compression. We use a lazy
201.1554 + * evaluation for matches: a match is finally adopted only if there is
201.1555 + * no better match at the next window position.
201.1556 + */
201.1557 +local block_state deflate_slow(s, flush)
201.1558 +    deflate_state *s;
201.1559 +    int flush;
201.1560 +{
201.1561 +    IPos hash_head = NIL;    /* head of hash chain */
201.1562 +    int bflush;              /* set if current block must be flushed */
201.1563 +
201.1564 +    /* Process the input block. */
201.1565 +    for (;;) {
201.1566 +        /* Make sure that we always have enough lookahead, except
201.1567 +         * at the end of the input file. We need MAX_MATCH bytes
201.1568 +         * for the next match, plus MIN_MATCH bytes to insert the
201.1569 +         * string following the next match.
201.1570 +         */
201.1571 +        if (s->lookahead < MIN_LOOKAHEAD) {
201.1572 +            fill_window(s);
201.1573 +            if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
201.1574 +                return need_more;
201.1575 +            }
201.1576 +            if (s->lookahead == 0) break; /* flush the current block */
201.1577 +        }
201.1578 +
201.1579 +        /* Insert the string window[strstart .. strstart+2] in the
201.1580 +         * dictionary, and set hash_head to the head of the hash chain:
201.1581 +         */
201.1582 +        if (s->lookahead >= MIN_MATCH) {
201.1583 +            INSERT_STRING(s, s->strstart, hash_head);
201.1584 +        }
201.1585 +
201.1586 +        /* Find the longest match, discarding those <= prev_length.
201.1587 +         */
201.1588 +        s->prev_length = s->match_length, s->prev_match = s->match_start;
201.1589 +        s->match_length = MIN_MATCH-1;
201.1590 +
201.1591 +        if (hash_head != NIL && s->prev_length < s->max_lazy_match &&
201.1592 +            s->strstart - hash_head <= MAX_DIST(s)) {
201.1593 +            /* To simplify the code, we prevent matches with the string
201.1594 +             * of window index 0 (in particular we have to avoid a match
201.1595 +             * of the string with itself at the start of the input file).
201.1596 +             */
201.1597 +            if (s->strategy != Z_HUFFMAN_ONLY && s->strategy != Z_RLE) {
201.1598 +                s->match_length = longest_match (s, hash_head);
201.1599 +            } else if (s->strategy == Z_RLE && s->strstart - hash_head == 1) {
201.1600 +                s->match_length = longest_match_fast (s, hash_head);
201.1601 +            }
201.1602 +            /* longest_match() or longest_match_fast() sets match_start */
201.1603 +
201.1604 +            if (s->match_length <= 5 && (s->strategy == Z_FILTERED
201.1605 +#if TOO_FAR <= 32767
201.1606 +                || (s->match_length == MIN_MATCH &&
201.1607 +                    s->strstart - s->match_start > TOO_FAR)
201.1608 +#endif
201.1609 +                )) {
201.1610 +
201.1611 +                /* If prev_match is also MIN_MATCH, match_start is garbage
201.1612 +                 * but we will ignore the current match anyway.
201.1613 +                 */
201.1614 +                s->match_length = MIN_MATCH-1;
201.1615 +            }
201.1616 +        }
201.1617 +        /* If there was a match at the previous step and the current
201.1618 +         * match is not better, output the previous match:
201.1619 +         */
201.1620 +        if (s->prev_length >= MIN_MATCH && s->match_length <= s->prev_length) {
201.1621 +            uInt max_insert = s->strstart + s->lookahead - MIN_MATCH;
201.1622 +            /* Do not insert strings in hash table beyond this. */
201.1623 +
201.1624 +            check_match(s, s->strstart-1, s->prev_match, s->prev_length);
201.1625 +
201.1626 +            _tr_tally_dist(s, s->strstart -1 - s->prev_match,
201.1627 +                           s->prev_length - MIN_MATCH, bflush);
201.1628 +
201.1629 +            /* Insert in hash table all strings up to the end of the match.
201.1630 +             * strstart-1 and strstart are already inserted. If there is not
201.1631 +             * enough lookahead, the last two strings are not inserted in
201.1632 +             * the hash table.
201.1633 +             */
201.1634 +            s->lookahead -= s->prev_length-1;
201.1635 +            s->prev_length -= 2;
201.1636 +            do {
201.1637 +                if (++s->strstart <= max_insert) {
201.1638 +                    INSERT_STRING(s, s->strstart, hash_head);
201.1639 +                }
201.1640 +            } while (--s->prev_length != 0);
201.1641 +            s->match_available = 0;
201.1642 +            s->match_length = MIN_MATCH-1;
201.1643 +            s->strstart++;
201.1644 +
201.1645 +            if (bflush) FLUSH_BLOCK(s, 0);
201.1646 +
201.1647 +        } else if (s->match_available) {
201.1648 +            /* If there was no match at the previous position, output a
201.1649 +             * single literal. If there was a match but the current match
201.1650 +             * is longer, truncate the previous match to a single literal.
201.1651 +             */
201.1652 +            Tracevv((stderr,"%c", s->window[s->strstart-1]));
201.1653 +            _tr_tally_lit(s, s->window[s->strstart-1], bflush);
201.1654 +            if (bflush) {
201.1655 +                FLUSH_BLOCK_ONLY(s, 0);
201.1656 +            }
201.1657 +            s->strstart++;
201.1658 +            s->lookahead--;
201.1659 +            if (s->strm->avail_out == 0) return need_more;
201.1660 +        } else {
201.1661 +            /* There is no previous match to compare with, wait for
201.1662 +             * the next step to decide.
201.1663 +             */
201.1664 +            s->match_available = 1;
201.1665 +            s->strstart++;
201.1666 +            s->lookahead--;
201.1667 +        }
201.1668 +    }
201.1669 +    Assert (flush != Z_NO_FLUSH, "no flush?");
201.1670 +    if (s->match_available) {
201.1671 +        Tracevv((stderr,"%c", s->window[s->strstart-1]));
201.1672 +        _tr_tally_lit(s, s->window[s->strstart-1], bflush);
201.1673 +        s->match_available = 0;
201.1674 +    }
201.1675 +    FLUSH_BLOCK(s, flush == Z_FINISH);
201.1676 +    return flush == Z_FINISH ? finish_done : block_done;
201.1677 +}
201.1678 +#endif /* FASTEST */
201.1679 +
201.1680 +#if 0
201.1681 +/* ===========================================================================
201.1682 + * For Z_RLE, simply look for runs of bytes, generate matches only of distance
201.1683 + * one.  Do not maintain a hash table.  (It will be regenerated if this run of
201.1684 + * deflate switches away from Z_RLE.)
201.1685 + */
201.1686 +local block_state deflate_rle(s, flush)
201.1687 +    deflate_state *s;
201.1688 +    int flush;
201.1689 +{
201.1690 +    int bflush;         /* set if current block must be flushed */
201.1691 +    uInt run;           /* length of run */
201.1692 +    uInt max;           /* maximum length of run */
201.1693 +    uInt prev;          /* byte at distance one to match */
201.1694 +    Bytef *scan;        /* scan for end of run */
201.1695 +
201.1696 +    for (;;) {
201.1697 +        /* Make sure that we always have enough lookahead, except
201.1698 +         * at the end of the input file. We need MAX_MATCH bytes
201.1699 +         * for the longest encodable run.
201.1700 +         */
201.1701 +        if (s->lookahead < MAX_MATCH) {
201.1702 +            fill_window(s);
201.1703 +            if (s->lookahead < MAX_MATCH && flush == Z_NO_FLUSH) {
201.1704 +                return need_more;
201.1705 +            }
201.1706 +            if (s->lookahead == 0) break; /* flush the current block */
201.1707 +        }
201.1708 +
201.1709 +        /* See how many times the previous byte repeats */
201.1710 +        run = 0;
201.1711 +        if (s->strstart > 0) {      /* if there is a previous byte, that is */
201.1712 +            max = s->lookahead < MAX_MATCH ? s->lookahead : MAX_MATCH;
201.1713 +            scan = s->window + s->strstart - 1;
201.1714 +            prev = *scan++;
201.1715 +            do {
201.1716 +                if (*scan++ != prev)
201.1717 +                    break;
201.1718 +            } while (++run < max);
201.1719 +        }
201.1720 +
201.1721 +        /* Emit match if have run of MIN_MATCH or longer, else emit literal */
201.1722 +        if (run >= MIN_MATCH) {
201.1723 +            check_match(s, s->strstart, s->strstart - 1, run);
201.1724 +            _tr_tally_dist(s, 1, run - MIN_MATCH, bflush);
201.1725 +            s->lookahead -= run;
201.1726 +            s->strstart += run;
201.1727 +        } else {
201.1728 +            /* No match, output a literal byte */
201.1729 +            Tracevv((stderr,"%c", s->window[s->strstart]));
201.1730 +            _tr_tally_lit (s, s->window[s->strstart], bflush);
201.1731 +            s->lookahead--;
201.1732 +            s->strstart++;
201.1733 +        }
201.1734 +        if (bflush) FLUSH_BLOCK(s, 0);
201.1735 +    }
201.1736 +    FLUSH_BLOCK(s, flush == Z_FINISH);
201.1737 +    return flush == Z_FINISH ? finish_done : block_done;
201.1738 +}
201.1739 +#endif
   202.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   202.2 +++ b/libs/zlib/deflate.h	Sun Nov 01 00:36:56 2015 +0200
   202.3 @@ -0,0 +1,331 @@
   202.4 +/* deflate.h -- internal compression state
   202.5 + * Copyright (C) 1995-2004 Jean-loup Gailly
   202.6 + * For conditions of distribution and use, see copyright notice in zlib.h
   202.7 + */
   202.8 +
   202.9 +/* WARNING: this file should *not* be used by applications. It is
  202.10 +   part of the implementation of the compression library and is
  202.11 +   subject to change. Applications should only use zlib.h.
  202.12 + */
  202.13 +
  202.14 +/* @(#) $Id$ */
  202.15 +
  202.16 +#ifndef DEFLATE_H
  202.17 +#define DEFLATE_H
  202.18 +
  202.19 +#include "zutil.h"
  202.20 +
  202.21 +/* define NO_GZIP when compiling if you want to disable gzip header and
  202.22 +   trailer creation by deflate().  NO_GZIP would be used to avoid linking in
  202.23 +   the crc code when it is not needed.  For shared libraries, gzip encoding
  202.24 +   should be left enabled. */
  202.25 +#ifndef NO_GZIP
  202.26 +#  define GZIP
  202.27 +#endif
  202.28 +
  202.29 +/* ===========================================================================
  202.30 + * Internal compression state.
  202.31 + */
  202.32 +
  202.33 +#define LENGTH_CODES 29
  202.34 +/* number of length codes, not counting the special END_BLOCK code */
  202.35 +
  202.36 +#define LITERALS  256
  202.37 +/* number of literal bytes 0..255 */
  202.38 +
  202.39 +#define L_CODES (LITERALS+1+LENGTH_CODES)
  202.40 +/* number of Literal or Length codes, including the END_BLOCK code */
  202.41 +
  202.42 +#define D_CODES   30
  202.43 +/* number of distance codes */
  202.44 +
  202.45 +#define BL_CODES  19
  202.46 +/* number of codes used to transfer the bit lengths */
  202.47 +
  202.48 +#define HEAP_SIZE (2*L_CODES+1)
  202.49 +/* maximum heap size */
  202.50 +
  202.51 +#define MAX_BITS 15
  202.52 +/* All codes must not exceed MAX_BITS bits */
  202.53 +
  202.54 +#define INIT_STATE    42
  202.55 +#define EXTRA_STATE   69
  202.56 +#define NAME_STATE    73
  202.57 +#define COMMENT_STATE 91
  202.58 +#define HCRC_STATE   103
  202.59 +#define BUSY_STATE   113
  202.60 +#define FINISH_STATE 666
  202.61 +/* Stream status */
  202.62 +
  202.63 +
  202.64 +/* Data structure describing a single value and its code string. */
  202.65 +typedef struct ct_data_s {
  202.66 +    union {
  202.67 +        ush  freq;       /* frequency count */
  202.68 +        ush  code;       /* bit string */
  202.69 +    } fc;
  202.70 +    union {
  202.71 +        ush  dad;        /* father node in Huffman tree */
  202.72 +        ush  len;        /* length of bit string */
  202.73 +    } dl;
  202.74 +} FAR ct_data;
  202.75 +
  202.76 +#define Freq fc.freq
  202.77 +#define Code fc.code
  202.78 +#define Dad  dl.dad
  202.79 +#define Len  dl.len
  202.80 +
  202.81 +typedef struct static_tree_desc_s  static_tree_desc;
  202.82 +
  202.83 +typedef struct tree_desc_s {
  202.84 +    ct_data *dyn_tree;           /* the dynamic tree */
  202.85 +    int     max_code;            /* largest code with non zero frequency */
  202.86 +    static_tree_desc *stat_desc; /* the corresponding static tree */
  202.87 +} FAR tree_desc;
  202.88 +
  202.89 +typedef ush Pos;
  202.90 +typedef Pos FAR Posf;
  202.91 +typedef unsigned IPos;
  202.92 +
  202.93 +/* A Pos is an index in the character window. We use short instead of int to
  202.94 + * save space in the various tables. IPos is used only for parameter passing.
  202.95 + */
  202.96 +
  202.97 +typedef struct internal_state {
  202.98 +    z_streamp strm;      /* pointer back to this zlib stream */
  202.99 +    int   status;        /* as the name implies */
 202.100 +    Bytef *pending_buf;  /* output still pending */
 202.101 +    ulg   pending_buf_size; /* size of pending_buf */
 202.102 +    Bytef *pending_out;  /* next pending byte to output to the stream */
 202.103 +    uInt   pending;      /* nb of bytes in the pending buffer */
 202.104 +    int   wrap;          /* bit 0 true for zlib, bit 1 true for gzip */
 202.105 +    gz_headerp  gzhead;  /* gzip header information to write */
 202.106 +    uInt   gzindex;      /* where in extra, name, or comment */
 202.107 +    Byte  method;        /* STORED (for zip only) or DEFLATED */
 202.108 +    int   last_flush;    /* value of flush param for previous deflate call */
 202.109 +
 202.110 +                /* used by deflate.c: */
 202.111 +
 202.112 +    uInt  w_size;        /* LZ77 window size (32K by default) */
 202.113 +    uInt  w_bits;        /* log2(w_size)  (8..16) */
 202.114 +    uInt  w_mask;        /* w_size - 1 */
 202.115 +
 202.116 +    Bytef *window;
 202.117 +    /* Sliding window. Input bytes are read into the second half of the window,
 202.118 +     * and move to the first half later to keep a dictionary of at least wSize
 202.119 +     * bytes. With this organization, matches are limited to a distance of
 202.120 +     * wSize-MAX_MATCH bytes, but this ensures that IO is always
 202.121 +     * performed with a length multiple of the block size. Also, it limits
 202.122 +     * the window size to 64K, which is quite useful on MSDOS.
 202.123 +     * To do: use the user input buffer as sliding window.
 202.124 +     */
 202.125 +
 202.126 +    ulg window_size;
 202.127 +    /* Actual size of window: 2*wSize, except when the user input buffer
 202.128 +     * is directly used as sliding window.
 202.129 +     */
 202.130 +
 202.131 +    Posf *prev;
 202.132 +    /* Link to older string with same hash index. To limit the size of this
 202.133 +     * array to 64K, this link is maintained only for the last 32K strings.
 202.134 +     * An index in this array is thus a window index modulo 32K.
 202.135 +     */
 202.136 +
 202.137 +    Posf *head; /* Heads of the hash chains or NIL. */
 202.138 +
 202.139 +    uInt  ins_h;          /* hash index of string to be inserted */
 202.140 +    uInt  hash_size;      /* number of elements in hash table */
 202.141 +    uInt  hash_bits;      /* log2(hash_size) */
 202.142 +    uInt  hash_mask;      /* hash_size-1 */
 202.143 +
 202.144 +    uInt  hash_shift;
 202.145 +    /* Number of bits by which ins_h must be shifted at each input
 202.146 +     * step. It must be such that after MIN_MATCH steps, the oldest
 202.147 +     * byte no longer takes part in the hash key, that is:
 202.148 +     *   hash_shift * MIN_MATCH >= hash_bits
 202.149 +     */
 202.150 +
 202.151 +    long block_start;
 202.152 +    /* Window position at the beginning of the current output block. Gets
 202.153 +     * negative when the window is moved backwards.
 202.154 +     */
 202.155 +
 202.156 +    uInt match_length;           /* length of best match */
 202.157 +    IPos prev_match;             /* previous match */
 202.158 +    int match_available;         /* set if previous match exists */
 202.159 +    uInt strstart;               /* start of string to insert */
 202.160 +    uInt match_start;            /* start of matching string */
 202.161 +    uInt lookahead;              /* number of valid bytes ahead in window */
 202.162 +
 202.163 +    uInt prev_length;
 202.164 +    /* Length of the best match at previous step. Matches not greater than this
 202.165 +     * are discarded. This is used in the lazy match evaluation.
 202.166 +     */
 202.167 +
 202.168 +    uInt max_chain_length;
 202.169 +    /* To speed up deflation, hash chains are never searched beyond this
 202.170 +     * length.  A higher limit improves compression ratio but degrades the
 202.171 +     * speed.
 202.172 +     */
 202.173 +
 202.174 +    uInt max_lazy_match;
 202.175 +    /* Attempt to find a better match only when the current match is strictly
 202.176 +     * smaller than this value. This mechanism is used only for compression
 202.177 +     * levels >= 4.
 202.178 +     */
 202.179 +#   define max_insert_length  max_lazy_match
 202.180 +    /* Insert new strings in the hash table only if the match length is not
 202.181 +     * greater than this length. This saves time but degrades compression.
 202.182 +     * max_insert_length is used only for compression levels <= 3.
 202.183 +     */
 202.184 +
 202.185 +    int level;    /* compression level (1..9) */
 202.186 +    int strategy; /* favor or force Huffman coding*/
 202.187 +
 202.188 +    uInt good_match;
 202.189 +    /* Use a faster search when the previous match is longer than this */
 202.190 +
 202.191 +    int nice_match; /* Stop searching when current match exceeds this */
 202.192 +
 202.193 +                /* used by trees.c: */
 202.194 +    /* Didn't use ct_data typedef below to supress compiler warning */
 202.195 +    struct ct_data_s dyn_ltree[HEAP_SIZE];   /* literal and length tree */
 202.196 +    struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */
 202.197 +    struct ct_data_s bl_tree[2*BL_CODES+1];  /* Huffman tree for bit lengths */
 202.198 +
 202.199 +    struct tree_desc_s l_desc;               /* desc. for literal tree */
 202.200 +    struct tree_desc_s d_desc;               /* desc. for distance tree */
 202.201 +    struct tree_desc_s bl_desc;              /* desc. for bit length tree */
 202.202 +
 202.203 +    ush bl_count[MAX_BITS+1];
 202.204 +    /* number of codes at each bit length for an optimal tree */
 202.205 +
 202.206 +    int heap[2*L_CODES+1];      /* heap used to build the Huffman trees */
 202.207 +    int heap_len;               /* number of elements in the heap */
 202.208 +    int heap_max;               /* element of largest frequency */
 202.209 +    /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.
 202.210 +     * The same heap array is used to build all trees.
 202.211 +     */
 202.212 +
 202.213 +    uch depth[2*L_CODES+1];
 202.214 +    /* Depth of each subtree used as tie breaker for trees of equal frequency
 202.215 +     */
 202.216 +
 202.217 +    uchf *l_buf;          /* buffer for literals or lengths */
 202.218 +
 202.219 +    uInt  lit_bufsize;
 202.220 +    /* Size of match buffer for literals/lengths.  There are 4 reasons for
 202.221 +     * limiting lit_bufsize to 64K:
 202.222 +     *   - frequencies can be kept in 16 bit counters
 202.223 +     *   - if compression is not successful for the first block, all input
 202.224 +     *     data is still in the window so we can still emit a stored block even
 202.225 +     *     when input comes from standard input.  (This can also be done for
 202.226 +     *     all blocks if lit_bufsize is not greater than 32K.)
 202.227 +     *   - if compression is not successful for a file smaller than 64K, we can
 202.228 +     *     even emit a stored file instead of a stored block (saving 5 bytes).
 202.229 +     *     This is applicable only for zip (not gzip or zlib).
 202.230 +     *   - creating new Huffman trees less frequently may not provide fast
 202.231 +     *     adaptation to changes in the input data statistics. (Take for
 202.232 +     *     example a binary file with poorly compressible code followed by
 202.233 +     *     a highly compressible string table.) Smaller buffer sizes give
 202.234 +     *     fast adaptation but have of course the overhead of transmitting
 202.235 +     *     trees more frequently.
 202.236 +     *   - I can't count above 4
 202.237 +     */
 202.238 +
 202.239 +    uInt last_lit;      /* running index in l_buf */
 202.240 +
 202.241 +    ushf *d_buf;
 202.242 +    /* Buffer for distances. To simplify the code, d_buf and l_buf have
 202.243 +     * the same number of elements. To use different lengths, an extra flag
 202.244 +     * array would be necessary.
 202.245 +     */
 202.246 +
 202.247 +    ulg opt_len;        /* bit length of current block with optimal trees */
 202.248 +    ulg static_len;     /* bit length of current block with static trees */
 202.249 +    uInt matches;       /* number of string matches in current block */
 202.250 +    int last_eob_len;   /* bit length of EOB code for last block */
 202.251 +
 202.252 +#ifdef DEBUG
 202.253 +    ulg compressed_len; /* total bit length of compressed file mod 2^32 */
 202.254 +    ulg bits_sent;      /* bit length of compressed data sent mod 2^32 */
 202.255 +#endif
 202.256 +
 202.257 +    ush bi_buf;
 202.258 +    /* Output buffer. bits are inserted starting at the bottom (least
 202.259 +     * significant bits).
 202.260 +     */
 202.261 +    int bi_valid;
 202.262 +    /* Number of valid bits in bi_buf.  All bits above the last valid bit
 202.263 +     * are always zero.
 202.264 +     */
 202.265 +
 202.266 +} FAR deflate_state;
 202.267 +
 202.268 +/* Output a byte on the stream.
 202.269 + * IN assertion: there is enough room in pending_buf.
 202.270 + */
 202.271 +#define put_byte(s, c) {s->pending_buf[s->pending++] = (c);}
 202.272 +
 202.273 +
 202.274 +#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
 202.275 +/* Minimum amount of lookahead, except at the end of the input file.
 202.276 + * See deflate.c for comments about the MIN_MATCH+1.
 202.277 + */
 202.278 +
 202.279 +#define MAX_DIST(s)  ((s)->w_size-MIN_LOOKAHEAD)
 202.280 +/* In order to simplify the code, particularly on 16 bit machines, match
 202.281 + * distances are limited to MAX_DIST instead of WSIZE.
 202.282 + */
 202.283 +
 202.284 +        /* in trees.c */
 202.285 +void _tr_init         OF((deflate_state *s));
 202.286 +int  _tr_tally        OF((deflate_state *s, unsigned dist, unsigned lc));
 202.287 +void _tr_flush_block  OF((deflate_state *s, charf *buf, ulg stored_len,
 202.288 +                          int eof));
 202.289 +void _tr_align        OF((deflate_state *s));
 202.290 +void _tr_stored_block OF((deflate_state *s, charf *buf, ulg stored_len,
 202.291 +                          int eof));
 202.292 +
 202.293 +#define d_code(dist) \
 202.294 +   ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])
 202.295 +/* Mapping from a distance to a distance code. dist is the distance - 1 and
 202.296 + * must not have side effects. _dist_code[256] and _dist_code[257] are never
 202.297 + * used.
 202.298 + */
 202.299 +
 202.300 +#ifndef DEBUG
 202.301 +/* Inline versions of _tr_tally for speed: */
 202.302 +
 202.303 +#if defined(GEN_TREES_H) || !defined(STDC)
 202.304 +  extern uch _length_code[];
 202.305 +  extern uch _dist_code[];
 202.306 +#else
 202.307 +  extern const uch _length_code[];
 202.308 +  extern const uch _dist_code[];
 202.309 +#endif
 202.310 +
 202.311 +# define _tr_tally_lit(s, c, flush) \
 202.312 +  { uch cc = (c); \
 202.313 +    s->d_buf[s->last_lit] = 0; \
 202.314 +    s->l_buf[s->last_lit++] = cc; \
 202.315 +    s->dyn_ltree[cc].Freq++; \
 202.316 +    flush = (s->last_lit == s->lit_bufsize-1); \
 202.317 +   }
 202.318 +# define _tr_tally_dist(s, distance, length, flush) \
 202.319 +  { uch len = (length); \
 202.320 +    ush dist = (distance); \
 202.321 +    s->d_buf[s->last_lit] = dist; \
 202.322 +    s->l_buf[s->last_lit++] = len; \
 202.323 +    dist--; \
 202.324 +    s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
 202.325 +    s->dyn_dtree[d_code(dist)].Freq++; \
 202.326 +    flush = (s->last_lit == s->lit_bufsize-1); \
 202.327 +  }
 202.328 +#else
 202.329 +# define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c)
 202.330 +# define _tr_tally_dist(s, distance, length, flush) \
 202.331 +              flush = _tr_tally(s, distance, length)
 202.332 +#endif
 202.333 +
 202.334 +#endif /* DEFLATE_H */
   203.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   203.2 +++ b/libs/zlib/gzio.c	Sun Nov 01 00:36:56 2015 +0200
   203.3 @@ -0,0 +1,1026 @@
   203.4 +/* gzio.c -- IO on .gz files
   203.5 + * Copyright (C) 1995-2005 Jean-loup Gailly.
   203.6 + * For conditions of distribution and use, see copyright notice in zlib.h
   203.7 + *
   203.8 + * Compile this file with -DNO_GZCOMPRESS to avoid the compression code.
   203.9 + */
  203.10 +
  203.11 +/* @(#) $Id$ */
  203.12 +
  203.13 +#include <stdio.h>
  203.14 +
  203.15 +#include "zutil.h"
  203.16 +
  203.17 +#ifdef NO_DEFLATE       /* for compatibility with old definition */
  203.18 +#  define NO_GZCOMPRESS
  203.19 +#endif
  203.20 +
  203.21 +#ifndef NO_DUMMY_DECL
  203.22 +struct internal_state {int dummy;}; /* for buggy compilers */
  203.23 +#endif
  203.24 +
  203.25 +#ifndef Z_BUFSIZE
  203.26 +#  ifdef MAXSEG_64K
  203.27 +#    define Z_BUFSIZE 4096 /* minimize memory usage for 16-bit DOS */
  203.28 +#  else
  203.29 +#    define Z_BUFSIZE 16384
  203.30 +#  endif
  203.31 +#endif
  203.32 +#ifndef Z_PRINTF_BUFSIZE
  203.33 +#  define Z_PRINTF_BUFSIZE 4096
  203.34 +#endif
  203.35 +
  203.36 +#ifdef __MVS__
  203.37 +#  pragma map (fdopen , "\174\174FDOPEN")
  203.38 +   FILE *fdopen(int, const char *);
  203.39 +#endif
  203.40 +
  203.41 +#ifndef STDC
  203.42 +extern voidp  malloc OF((uInt size));
  203.43 +extern void   free   OF((voidpf ptr));
  203.44 +#endif
  203.45 +
  203.46 +#define ALLOC(size) malloc(size)
  203.47 +#define TRYFREE(p) {if (p) free(p);}
  203.48 +
  203.49 +static int const gz_magic[2] = {0x1f, 0x8b}; /* gzip magic header */
  203.50 +
  203.51 +/* gzip flag byte */
  203.52 +#define ASCII_FLAG   0x01 /* bit 0 set: file probably ascii text */
  203.53 +#define HEAD_CRC     0x02 /* bit 1 set: header CRC present */
  203.54 +#define EXTRA_FIELD  0x04 /* bit 2 set: extra field present */
  203.55 +#define ORIG_NAME    0x08 /* bit 3 set: original file name present */
  203.56 +#define COMMENT      0x10 /* bit 4 set: file comment present */
  203.57 +#define RESERVED     0xE0 /* bits 5..7: reserved */
  203.58 +
  203.59 +typedef struct gz_stream {
  203.60 +    z_stream stream;
  203.61 +    int      z_err;   /* error code for last stream operation */
  203.62 +    int      z_eof;   /* set if end of input file */
  203.63 +    FILE     *file;   /* .gz file */
  203.64 +    Byte     *inbuf;  /* input buffer */
  203.65 +    Byte     *outbuf; /* output buffer */
  203.66 +    uLong    crc;     /* crc32 of uncompressed data */
  203.67 +    char     *msg;    /* error message */
  203.68 +    char     *path;   /* path name for debugging only */
  203.69 +    int      transparent; /* 1 if input file is not a .gz file */
  203.70 +    char     mode;    /* 'w' or 'r' */
  203.71 +    z_off_t  start;   /* start of compressed data in file (header skipped) */
  203.72 +    z_off_t  in;      /* bytes into deflate or inflate */
  203.73 +    z_off_t  out;     /* bytes out of deflate or inflate */
  203.74 +    int      back;    /* one character push-back */
  203.75 +    int      last;    /* true if push-back is last character */
  203.76 +} gz_stream;
  203.77 +
  203.78 +
  203.79 +local gzFile gz_open      OF((const char *path, const char *mode, int  fd));
  203.80 +local int do_flush        OF((gzFile file, int flush));
  203.81 +local int    get_byte     OF((gz_stream *s));
  203.82 +local void   check_header OF((gz_stream *s));
  203.83 +local int    destroy      OF((gz_stream *s));
  203.84 +local void   putLong      OF((FILE *file, uLong x));
  203.85 +local uLong  getLong      OF((gz_stream *s));
  203.86 +
  203.87 +/* ===========================================================================
  203.88 +     Opens a gzip (.gz) file for reading or writing. The mode parameter
  203.89 +   is as in fopen ("rb" or "wb"). The file is given either by file descriptor
  203.90 +   or path name (if fd == -1).
  203.91 +     gz_open returns NULL if the file could not be opened or if there was
  203.92 +   insufficient memory to allocate the (de)compression state; errno
  203.93 +   can be checked to distinguish the two cases (if errno is zero, the
  203.94 +   zlib error is Z_MEM_ERROR).
  203.95 +*/
  203.96 +local gzFile gz_open (path, mode, fd)
  203.97 +    const char *path;
  203.98 +    const char *mode;
  203.99 +    int  fd;
 203.100 +{
 203.101 +    int err;
 203.102 +    int level = Z_DEFAULT_COMPRESSION; /* compression level */
 203.103 +    int strategy = Z_DEFAULT_STRATEGY; /* compression strategy */
 203.104 +    char *p = (char*)mode;
 203.105 +    gz_stream *s;
 203.106 +    char fmode[80]; /* copy of mode, without the compression level */
 203.107 +    char *m = fmode;
 203.108 +
 203.109 +    if (!path || !mode) return Z_NULL;
 203.110 +
 203.111 +    s = (gz_stream *)ALLOC(sizeof(gz_stream));
 203.112 +    if (!s) return Z_NULL;
 203.113 +
 203.114 +    s->stream.zalloc = (alloc_func)0;
 203.115 +    s->stream.zfree = (free_func)0;
 203.116 +    s->stream.opaque = (voidpf)0;
 203.117 +    s->stream.next_in = s->inbuf = Z_NULL;
 203.118 +    s->stream.next_out = s->outbuf = Z_NULL;
 203.119 +    s->stream.avail_in = s->stream.avail_out = 0;
 203.120 +    s->file = NULL;
 203.121 +    s->z_err = Z_OK;
 203.122 +    s->z_eof = 0;
 203.123 +    s->in = 0;
 203.124 +    s->out = 0;
 203.125 +    s->back = EOF;
 203.126 +    s->crc = crc32(0L, Z_NULL, 0);
 203.127 +    s->msg = NULL;
 203.128 +    s->transparent = 0;
 203.129 +
 203.130 +    s->path = (char*)ALLOC(strlen(path)+1);
 203.131 +    if (s->path == NULL) {
 203.132 +        return destroy(s), (gzFile)Z_NULL;
 203.133 +    }
 203.134 +    strcpy(s->path, path); /* do this early for debugging */
 203.135 +
 203.136 +    s->mode = '\0';
 203.137 +    do {
 203.138 +        if (*p == 'r') s->mode = 'r';
 203.139 +        if (*p == 'w' || *p == 'a') s->mode = 'w';
 203.140 +        if (*p >= '0' && *p <= '9') {
 203.141 +            level = *p - '0';
 203.142 +        } else if (*p == 'f') {
 203.143 +          strategy = Z_FILTERED;
 203.144 +        } else if (*p == 'h') {
 203.145 +          strategy = Z_HUFFMAN_ONLY;
 203.146 +        } else if (*p == 'R') {
 203.147 +          strategy = Z_RLE;
 203.148 +        } else {
 203.149 +            *m++ = *p; /* copy the mode */
 203.150 +        }
 203.151 +    } while (*p++ && m != fmode + sizeof(fmode));
 203.152 +    if (s->mode == '\0') return destroy(s), (gzFile)Z_NULL;
 203.153 +
 203.154 +    if (s->mode == 'w') {
 203.155 +#ifdef NO_GZCOMPRESS
 203.156 +        err = Z_STREAM_ERROR;
 203.157 +#else
 203.158 +        err = deflateInit2(&(s->stream), level,
 203.159 +                           Z_DEFLATED, -MAX_WBITS, DEF_MEM_LEVEL, strategy);
 203.160 +        /* windowBits is passed < 0 to suppress zlib header */
 203.161 +
 203.162 +        s->stream.next_out = s->outbuf = (Byte*)ALLOC(Z_BUFSIZE);
 203.163 +#endif
 203.164 +        if (err != Z_OK || s->outbuf == Z_NULL) {
 203.165 +            return destroy(s), (gzFile)Z_NULL;
 203.166 +        }
 203.167 +    } else {
 203.168 +        s->stream.next_in  = s->inbuf = (Byte*)ALLOC(Z_BUFSIZE);
 203.169 +
 203.170 +        err = inflateInit2(&(s->stream), -MAX_WBITS);
 203.171 +        /* windowBits is passed < 0 to tell that there is no zlib header.
 203.172 +         * Note that in this case inflate *requires* an extra "dummy" byte
 203.173 +         * after the compressed stream in order to complete decompression and
 203.174 +         * return Z_STREAM_END. Here the gzip CRC32 ensures that 4 bytes are
 203.175 +         * present after the compressed stream.
 203.176 +         */
 203.177 +        if (err != Z_OK || s->inbuf == Z_NULL) {
 203.178 +            return destroy(s), (gzFile)Z_NULL;
 203.179 +        }
 203.180 +    }
 203.181 +    s->stream.avail_out = Z_BUFSIZE;
 203.182 +
 203.183 +    errno = 0;
 203.184 +    s->file = fd < 0 ? F_OPEN(path, fmode) : (FILE*)fdopen(fd, fmode);
 203.185 +
 203.186 +    if (s->file == NULL) {
 203.187 +        return destroy(s), (gzFile)Z_NULL;
 203.188 +    }
 203.189 +    if (s->mode == 'w') {
 203.190 +        /* Write a very simple .gz header:
 203.191 +         */
 203.192 +        fprintf(s->file, "%c%c%c%c%c%c%c%c%c%c", gz_magic[0], gz_magic[1],
 203.193 +             Z_DEFLATED, 0 /*flags*/, 0,0,0,0 /*time*/, 0 /*xflags*/, OS_CODE);
 203.194 +        s->start = 10L;
 203.195 +        /* We use 10L instead of ftell(s->file) to because ftell causes an
 203.196 +         * fflush on some systems. This version of the library doesn't use
 203.197 +         * start anyway in write mode, so this initialization is not
 203.198 +         * necessary.
 203.199 +         */
 203.200 +    } else {
 203.201 +        check_header(s); /* skip the .gz header */
 203.202 +        s->start = ftell(s->file) - s->stream.avail_in;
 203.203 +    }
 203.204 +
 203.205 +    return (gzFile)s;
 203.206 +}
 203.207 +
 203.208 +/* ===========================================================================
 203.209 +     Opens a gzip (.gz) file for reading or writing.
 203.210 +*/
 203.211 +gzFile ZEXPORT gzopen (path, mode)
 203.212 +    const char *path;
 203.213 +    const char *mode;
 203.214 +{
 203.215 +    return gz_open (path, mode, -1);
 203.216 +}
 203.217 +
 203.218 +/* ===========================================================================
 203.219 +     Associate a gzFile with the file descriptor fd. fd is not dup'ed here
 203.220 +   to mimic the behavio(u)r of fdopen.
 203.221 +*/
 203.222 +gzFile ZEXPORT gzdopen (fd, mode)
 203.223 +    int fd;
 203.224 +    const char *mode;
 203.225 +{
 203.226 +    char name[46];      /* allow for up to 128-bit integers */
 203.227 +
 203.228 +    if (fd < 0) return (gzFile)Z_NULL;
 203.229 +    sprintf(name, "<fd:%d>", fd); /* for debugging */
 203.230 +
 203.231 +    return gz_open (name, mode, fd);
 203.232 +}
 203.233 +
 203.234 +/* ===========================================================================
 203.235 + * Update the compression level and strategy
 203.236 + */
 203.237 +int ZEXPORT gzsetparams (file, level, strategy)
 203.238 +    gzFile file;
 203.239 +    int level;
 203.240 +    int strategy;
 203.241 +{
 203.242 +    gz_stream *s = (gz_stream*)file;
 203.243 +
 203.244 +    if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR;
 203.245 +
 203.246 +    /* Make room to allow flushing */
 203.247 +    if (s->stream.avail_out == 0) {
 203.248 +
 203.249 +        s->stream.next_out = s->outbuf;
 203.250 +        if (fwrite(s->outbuf, 1, Z_BUFSIZE, s->file) != Z_BUFSIZE) {
 203.251 +            s->z_err = Z_ERRNO;
 203.252 +        }
 203.253 +        s->stream.avail_out = Z_BUFSIZE;
 203.254 +    }
 203.255 +
 203.256 +    return deflateParams (&(s->stream), level, strategy);
 203.257 +}
 203.258 +
 203.259 +/* ===========================================================================
 203.260 +     Read a byte from a gz_stream; update next_in and avail_in. Return EOF
 203.261 +   for end of file.
 203.262 +   IN assertion: the stream s has been sucessfully opened for reading.
 203.263 +*/
 203.264 +local int get_byte(s)
 203.265 +    gz_stream *s;
 203.266 +{
 203.267 +    if (s->z_eof) return EOF;
 203.268 +    if (s->stream.avail_in == 0) {
 203.269 +        errno = 0;
 203.270 +        s->stream.avail_in = (uInt)fread(s->inbuf, 1, Z_BUFSIZE, s->file);
 203.271 +        if (s->stream.avail_in == 0) {
 203.272 +            s->z_eof = 1;
 203.273 +            if (ferror(s->file)) s->z_err = Z_ERRNO;
 203.274 +            return EOF;
 203.275 +        }
 203.276 +        s->stream.next_in = s->inbuf;
 203.277 +    }
 203.278 +    s->stream.avail_in--;
 203.279 +    return *(s->stream.next_in)++;
 203.280 +}
 203.281 +
 203.282 +/* ===========================================================================
 203.283 +      Check the gzip header of a gz_stream opened for reading. Set the stream
 203.284 +    mode to transparent if the gzip magic header is not present; set s->err
 203.285 +    to Z_DATA_ERROR if the magic header is present but the rest of the header
 203.286 +    is incorrect.
 203.287 +    IN assertion: the stream s has already been created sucessfully;
 203.288 +       s->stream.avail_in is zero for the first time, but may be non-zero
 203.289 +       for concatenated .gz files.
 203.290 +*/
 203.291 +local void check_header(s)
 203.292 +    gz_stream *s;
 203.293 +{
 203.294 +    int method; /* method byte */
 203.295 +    int flags;  /* flags byte */
 203.296 +    uInt len;
 203.297 +    int c;
 203.298 +
 203.299 +    /* Assure two bytes in the buffer so we can peek ahead -- handle case
 203.300 +       where first byte of header is at the end of the buffer after the last
 203.301 +       gzip segment */
 203.302 +    len = s->stream.avail_in;
 203.303 +    if (len < 2) {
 203.304 +        if (len) s->inbuf[0] = s->stream.next_in[0];
 203.305 +        errno = 0;
 203.306 +        len = (uInt)fread(s->inbuf + len, 1, Z_BUFSIZE >> len, s->file);
 203.307 +        if (len == 0 && ferror(s->file)) s->z_err = Z_ERRNO;
 203.308 +        s->stream.avail_in += len;
 203.309 +        s->stream.next_in = s->inbuf;
 203.310 +        if (s->stream.avail_in < 2) {
 203.311 +            s->transparent = s->stream.avail_in;
 203.312 +            return;
 203.313 +        }
 203.314 +    }
 203.315 +
 203.316 +    /* Peek ahead to check the gzip magic header */
 203.317 +    if (s->stream.next_in[0] != gz_magic[0] ||
 203.318 +        s->stream.next_in[1] != gz_magic[1]) {
 203.319 +        s->transparent = 1;
 203.320 +        return;
 203.321 +    }
 203.322 +    s->stream.avail_in -= 2;
 203.323 +    s->stream.next_in += 2;
 203.324 +
 203.325 +    /* Check the rest of the gzip header */
 203.326 +    method = get_byte(s);
 203.327 +    flags = get_byte(s);
 203.328 +    if (method != Z_DEFLATED || (flags & RESERVED) != 0) {
 203.329 +        s->z_err = Z_DATA_ERROR;
 203.330 +        return;
 203.331 +    }
 203.332 +
 203.333 +    /* Discard time, xflags and OS code: */
 203.334 +    for (len = 0; len < 6; len++) (void)get_byte(s);
 203.335 +
 203.336 +    if ((flags & EXTRA_FIELD) != 0) { /* skip the extra field */
 203.337 +        len  =  (uInt)get_byte(s);
 203.338 +        len += ((uInt)get_byte(s))<<8;
 203.339 +        /* len is garbage if EOF but the loop below will quit anyway */
 203.340 +        while (len-- != 0 && get_byte(s) != EOF) ;
 203.341 +    }
 203.342 +    if ((flags & ORIG_NAME) != 0) { /* skip the original file name */
 203.343 +        while ((c = get_byte(s)) != 0 && c != EOF) ;
 203.344 +    }
 203.345 +    if ((flags & COMMENT) != 0) {   /* skip the .gz file comment */
 203.346 +        while ((c = get_byte(s)) != 0 && c != EOF) ;
 203.347 +    }
 203.348 +    if ((flags & HEAD_CRC) != 0) {  /* skip the header crc */
 203.349 +        for (len = 0; len < 2; len++) (void)get_byte(s);
 203.350 +    }
 203.351 +    s->z_err = s->z_eof ? Z_DATA_ERROR : Z_OK;
 203.352 +}
 203.353 +
 203.354 + /* ===========================================================================
 203.355 + * Cleanup then free the given gz_stream. Return a zlib error code.
 203.356 +   Try freeing in the reverse order of allocations.
 203.357 + */
 203.358 +local int destroy (s)
 203.359 +    gz_stream *s;
 203.360 +{
 203.361 +    int err = Z_OK;
 203.362 +
 203.363 +    if (!s) return Z_STREAM_ERROR;
 203.364 +
 203.365 +    TRYFREE(s->msg);
 203.366 +
 203.367 +    if (s->stream.state != NULL) {
 203.368 +        if (s->mode == 'w') {
 203.369 +#ifdef NO_GZCOMPRESS
 203.370 +            err = Z_STREAM_ERROR;
 203.371 +#else
 203.372 +            err = deflateEnd(&(s->stream));
 203.373 +#endif
 203.374 +        } else if (s->mode == 'r') {
 203.375 +            err = inflateEnd(&(s->stream));
 203.376 +        }
 203.377 +    }
 203.378 +    if (s->file != NULL && fclose(s->file)) {
 203.379 +#ifdef ESPIPE
 203.380 +        if (errno != ESPIPE) /* fclose is broken for pipes in HP/UX */
 203.381 +#endif
 203.382 +            err = Z_ERRNO;
 203.383 +    }
 203.384 +    if (s->z_err < 0) err = s->z_err;
 203.385 +
 203.386 +    TRYFREE(s->inbuf);
 203.387 +    TRYFREE(s->outbuf);
 203.388 +    TRYFREE(s->path);
 203.389 +    TRYFREE(s);
 203.390 +    return err;
 203.391 +}
 203.392 +
 203.393 +/* ===========================================================================
 203.394 +     Reads the given number of uncompressed bytes from the compressed file.
 203.395 +   gzread returns the number of bytes actually read (0 for end of file).
 203.396 +*/
 203.397 +int ZEXPORT gzread (file, buf, len)
 203.398 +    gzFile file;
 203.399 +    voidp buf;
 203.400 +    unsigned len;
 203.401 +{
 203.402 +    gz_stream *s = (gz_stream*)file;
 203.403 +    Bytef *start = (Bytef*)buf; /* starting point for crc computation */
 203.404 +    Byte  *next_out; /* == stream.next_out but not forced far (for MSDOS) */
 203.405 +
 203.406 +    if (s == NULL || s->mode != 'r') return Z_STREAM_ERROR;
 203.407 +
 203.408 +    if (s->z_err == Z_DATA_ERROR || s->z_err == Z_ERRNO) return -1;
 203.409 +    if (s->z_err == Z_STREAM_END) return 0;  /* EOF */
 203.410 +
 203.411 +    next_out = (Byte*)buf;
 203.412 +    s->stream.next_out = (Bytef*)buf;
 203.413 +    s->stream.avail_out = len;
 203.414 +
 203.415 +    if (s->stream.avail_out && s->back != EOF) {
 203.416 +        *next_out++ = s->back;
 203.417 +        s->stream.next_out++;
 203.418 +        s->stream.avail_out--;
 203.419 +        s->back = EOF;
 203.420 +        s->out++;
 203.421 +        start++;
 203.422 +        if (s->last) {
 203.423 +            s->z_err = Z_STREAM_END;
 203.424 +            return 1;
 203.425 +        }
 203.426 +    }
 203.427 +
 203.428 +    while (s->stream.avail_out != 0) {
 203.429 +
 203.430 +        if (s->transparent) {
 203.431 +            /* Copy first the lookahead bytes: */
 203.432 +            uInt n = s->stream.avail_in;
 203.433 +            if (n > s->stream.avail_out) n = s->stream.avail_out;
 203.434 +            if (n > 0) {
 203.435 +                zmemcpy(s->stream.next_out, s->stream.next_in, n);
 203.436 +                next_out += n;
 203.437 +                s->stream.next_out = next_out;
 203.438 +                s->stream.next_in   += n;
 203.439 +                s->stream.avail_out -= n;
 203.440 +                s->stream.avail_in  -= n;
 203.441 +            }
 203.442 +            if (s->stream.avail_out > 0) {
 203.443 +                s->stream.avail_out -=
 203.444 +                    (uInt)fread(next_out, 1, s->stream.avail_out, s->file);
 203.445 +            }
 203.446 +            len -= s->stream.avail_out;
 203.447 +            s->in  += len;
 203.448 +            s->out += len;
 203.449 +            if (len == 0) s->z_eof = 1;
 203.450 +            return (int)len;
 203.451 +        }
 203.452 +        if (s->stream.avail_in == 0 && !s->z_eof) {
 203.453 +
 203.454 +            errno = 0;
 203.455 +            s->stream.avail_in = (uInt)fread(s->inbuf, 1, Z_BUFSIZE, s->file);
 203.456 +            if (s->stream.avail_in == 0) {
 203.457 +                s->z_eof = 1;
 203.458 +                if (ferror(s->file)) {
 203.459 +                    s->z_err = Z_ERRNO;
 203.460 +                    break;
 203.461 +                }
 203.462 +            }
 203.463 +            s->stream.next_in = s->inbuf;
 203.464 +        }
 203.465 +        s->in += s->stream.avail_in;
 203.466 +        s->out += s->stream.avail_out;
 203.467 +        s->z_err = inflate(&(s->stream), Z_NO_FLUSH);
 203.468 +        s->in -= s->stream.avail_in;
 203.469 +        s->out -= s->stream.avail_out;
 203.470 +
 203.471 +        if (s->z_err == Z_STREAM_END) {
 203.472 +            /* Check CRC and original size */
 203.473 +            s->crc = crc32(s->crc, start, (uInt)(s->stream.next_out - start));
 203.474 +            start = s->stream.next_out;
 203.475 +
 203.476 +            if (getLong(s) != s->crc) {
 203.477 +                s->z_err = Z_DATA_ERROR;
 203.478 +            } else {
 203.479 +                (void)getLong(s);
 203.480 +                /* The uncompressed length returned by above getlong() may be
 203.481 +                 * different from s->out in case of concatenated .gz files.
 203.482 +                 * Check for such files:
 203.483 +                 */
 203.484 +                check_header(s);
 203.485 +                if (s->z_err == Z_OK) {
 203.486 +                    inflateReset(&(s->stream));
 203.487 +                    s->crc = crc32(0L, Z_NULL, 0);
 203.488 +                }
 203.489 +            }
 203.490 +        }
 203.491 +        if (s->z_err != Z_OK || s->z_eof) break;
 203.492 +    }
 203.493 +    s->crc = crc32(s->crc, start, (uInt)(s->stream.next_out - start));
 203.494 +
 203.495 +    if (len == s->stream.avail_out &&
 203.496 +        (s->z_err == Z_DATA_ERROR || s->z_err == Z_ERRNO))
 203.497 +        return -1;
 203.498 +    return (int)(len - s->stream.avail_out);
 203.499 +}
 203.500 +
 203.501 +
 203.502 +/* ===========================================================================
 203.503 +      Reads one byte from the compressed file. gzgetc returns this byte
 203.504 +   or -1 in case of end of file or error.
 203.505 +*/
 203.506 +int ZEXPORT gzgetc(file)
 203.507 +    gzFile file;
 203.508 +{
 203.509 +    unsigned char c;
 203.510 +
 203.511 +    return gzread(file, &c, 1) == 1 ? c : -1;
 203.512 +}
 203.513 +
 203.514 +
 203.515 +/* ===========================================================================
 203.516 +      Push one byte back onto the stream.
 203.517 +*/
 203.518 +int ZEXPORT gzungetc(c, file)
 203.519 +    int c;
 203.520 +    gzFile file;
 203.521 +{
 203.522 +    gz_stream *s = (gz_stream*)file;
 203.523 +
 203.524 +    if (s == NULL || s->mode != 'r' || c == EOF || s->back != EOF) return EOF;
 203.525 +    s->back = c;
 203.526 +    s->out--;
 203.527 +    s->last = (s->z_err == Z_STREAM_END);
 203.528 +    if (s->last) s->z_err = Z_OK;
 203.529 +    s->z_eof = 0;
 203.530 +    return c;
 203.531 +}
 203.532 +
 203.533 +
 203.534 +/* ===========================================================================
 203.535 +      Reads bytes from the compressed file until len-1 characters are
 203.536 +   read, or a newline character is read and transferred to buf, or an
 203.537 +   end-of-file condition is encountered.  The string is then terminated
 203.538 +   with a null character.
 203.539 +      gzgets returns buf, or Z_NULL in case of error.
 203.540 +
 203.541 +      The current implementation is not optimized at all.
 203.542 +*/
 203.543 +char * ZEXPORT gzgets(file, buf, len)
 203.544 +    gzFile file;
 203.545 +    char *buf;
 203.546 +    int len;
 203.547 +{
 203.548 +    char *b = buf;
 203.549 +    if (buf == Z_NULL || len <= 0) return Z_NULL;
 203.550 +
 203.551 +    while (--len > 0 && gzread(file, buf, 1) == 1 && *buf++ != '\n') ;
 203.552 +    *buf = '\0';
 203.553 +    return b == buf && len > 0 ? Z_NULL : b;
 203.554 +}
 203.555 +
 203.556 +
 203.557 +#ifndef NO_GZCOMPRESS
 203.558 +/* ===========================================================================
 203.559 +     Writes the given number of uncompressed bytes into the compressed file.
 203.560 +   gzwrite returns the number of bytes actually written (0 in case of error).
 203.561 +*/
 203.562 +int ZEXPORT gzwrite (file, buf, len)
 203.563 +    gzFile file;
 203.564 +    voidpc buf;
 203.565 +    unsigned len;
 203.566 +{
 203.567 +    gz_stream *s = (gz_stream*)file;
 203.568 +
 203.569 +    if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR;
 203.570 +
 203.571 +    s->stream.next_in = (Bytef*)buf;
 203.572 +    s->stream.avail_in = len;
 203.573 +
 203.574 +    while (s->stream.avail_in != 0) {
 203.575 +
 203.576 +        if (s->stream.avail_out == 0) {
 203.577 +
 203.578 +            s->stream.next_out = s->outbuf;
 203.579 +            if (fwrite(s->outbuf, 1, Z_BUFSIZE, s->file) != Z_BUFSIZE) {
 203.580 +                s->z_err = Z_ERRNO;
 203.581 +                break;
 203.582 +            }
 203.583 +            s->stream.avail_out = Z_BUFSIZE;
 203.584 +        }
 203.585 +        s->in += s->stream.avail_in;
 203.586 +        s->out += s->stream.avail_out;
 203.587 +        s->z_err = deflate(&(s->stream), Z_NO_FLUSH);
 203.588 +        s->in -= s->stream.avail_in;
 203.589 +        s->out -= s->stream.avail_out;
 203.590 +        if (s->z_err != Z_OK) break;
 203.591 +    }
 203.592 +    s->crc = crc32(s->crc, (const Bytef *)buf, len);
 203.593 +
 203.594 +    return (int)(len - s->stream.avail_in);
 203.595 +}
 203.596 +
 203.597 +
 203.598 +/* ===========================================================================
 203.599 +     Converts, formats, and writes the args to the compressed file under
 203.600 +   control of the format string, as in fprintf. gzprintf returns the number of
 203.601 +   uncompressed bytes actually written (0 in case of error).
 203.602 +*/
 203.603 +#ifdef STDC
 203.604 +#include <stdarg.h>
 203.605 +
 203.606 +int ZEXPORTVA gzprintf (gzFile file, const char *format, /* args */ ...)
 203.607 +{
 203.608 +    char buf[Z_PRINTF_BUFSIZE];
 203.609 +    va_list va;
 203.610 +    int len;
 203.611 +
 203.612 +    buf[sizeof(buf) - 1] = 0;
 203.613 +    va_start(va, format);
 203.614 +#ifdef NO_vsnprintf
 203.615 +#  ifdef HAS_vsprintf_void
 203.616 +    (void)vsprintf(buf, format, va);
 203.617 +    va_end(va);
 203.618 +    for (len = 0; len < sizeof(buf); len++)
 203.619 +        if (buf[len] == 0) break;
 203.620 +#  else
 203.621 +    len = vsprintf(buf, format, va);
 203.622 +    va_end(va);
 203.623 +#  endif
 203.624 +#else
 203.625 +#  ifdef HAS_vsnprintf_void
 203.626 +    (void)vsnprintf(buf, sizeof(buf), format, va);
 203.627 +    va_end(va);
 203.628 +    len = strlen(buf);
 203.629 +#  else
 203.630 +    len = vsnprintf(buf, sizeof(buf), format, va);
 203.631 +    va_end(va);
 203.632 +#  endif
 203.633 +#endif
 203.634 +    if (len <= 0 || len >= (int)sizeof(buf) || buf[sizeof(buf) - 1] != 0)
 203.635 +        return 0;
 203.636 +    return gzwrite(file, buf, (unsigned)len);
 203.637 +}
 203.638 +#else /* not ANSI C */
 203.639 +
 203.640 +int ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
 203.641 +                       a11, a12, a13, a14, a15, a16, a17, a18, a19, a20)
 203.642 +    gzFile file;
 203.643 +    const char *format;
 203.644 +    int a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
 203.645 +        a11, a12, a13, a14, a15, a16, a17, a18, a19, a20;
 203.646 +{
 203.647 +    char buf[Z_PRINTF_BUFSIZE];
 203.648 +    int len;
 203.649 +
 203.650 +    buf[sizeof(buf) - 1] = 0;
 203.651 +#ifdef NO_snprintf
 203.652 +#  ifdef HAS_sprintf_void
 203.653 +    sprintf(buf, format, a1, a2, a3, a4, a5, a6, a7, a8,
 203.654 +            a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
 203.655 +    for (len = 0; len < sizeof(buf); len++)
 203.656 +        if (buf[len] == 0) break;
 203.657 +#  else
 203.658 +    len = sprintf(buf, format, a1, a2, a3, a4, a5, a6, a7, a8,
 203.659 +                a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
 203.660 +#  endif
 203.661 +#else
 203.662 +#  ifdef HAS_snprintf_void
 203.663 +    snprintf(buf, sizeof(buf), format, a1, a2, a3, a4, a5, a6, a7, a8,
 203.664 +             a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
 203.665 +    len = strlen(buf);
 203.666 +#  else
 203.667 +    len = snprintf(buf, sizeof(buf), format, a1, a2, a3, a4, a5, a6, a7, a8,
 203.668 +                 a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
 203.669 +#  endif
 203.670 +#endif
 203.671 +    if (len <= 0 || len >= sizeof(buf) || buf[sizeof(buf) - 1] != 0)
 203.672 +        return 0;
 203.673 +    return gzwrite(file, buf, len);
 203.674 +}
 203.675 +#endif
 203.676 +
 203.677 +/* ===========================================================================
 203.678 +      Writes c, converted to an unsigned char, into the compressed file.
 203.679 +   gzputc returns the value that was written, or -1 in case of error.
 203.680 +*/
 203.681 +int ZEXPORT gzputc(file, c)
 203.682 +    gzFile file;
 203.683 +    int c;
 203.684 +{
 203.685 +    unsigned char cc = (unsigned char) c; /* required for big endian systems */
 203.686 +
 203.687 +    return gzwrite(file, &cc, 1) == 1 ? (int)cc : -1;
 203.688 +}
 203.689 +
 203.690 +
 203.691 +/* ===========================================================================
 203.692 +      Writes the given null-terminated string to the compressed file, excluding
 203.693 +   the terminating null character.
 203.694 +      gzputs returns the number of characters written, or -1 in case of error.
 203.695 +*/
 203.696 +int ZEXPORT gzputs(file, s)
 203.697 +    gzFile file;
 203.698 +    const char *s;
 203.699 +{
 203.700 +    return gzwrite(file, (char*)s, (unsigned)strlen(s));
 203.701 +}
 203.702 +
 203.703 +
 203.704 +/* ===========================================================================
 203.705 +     Flushes all pending output into the compressed file. The parameter
 203.706 +   flush is as in the deflate() function.
 203.707 +*/
 203.708 +local int do_flush (file, flush)
 203.709 +    gzFile file;
 203.710 +    int flush;
 203.711 +{
 203.712 +    uInt len;
 203.713 +    int done = 0;
 203.714 +    gz_stream *s = (gz_stream*)file;
 203.715 +
 203.716 +    if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR;
 203.717 +
 203.718 +    s->stream.avail_in = 0; /* should be zero already anyway */
 203.719 +
 203.720 +    for (;;) {
 203.721 +        len = Z_BUFSIZE - s->stream.avail_out;
 203.722 +
 203.723 +        if (len != 0) {
 203.724 +            if ((uInt)fwrite(s->outbuf, 1, len, s->file) != len) {
 203.725 +                s->z_err = Z_ERRNO;
 203.726 +                return Z_ERRNO;
 203.727 +            }
 203.728 +            s->stream.next_out = s->outbuf;
 203.729 +            s->stream.avail_out = Z_BUFSIZE;
 203.730 +        }
 203.731 +        if (done) break;
 203.732 +        s->out += s->stream.avail_out;
 203.733 +        s->z_err = deflate(&(s->stream), flush);
 203.734 +        s->out -= s->stream.avail_out;
 203.735 +
 203.736 +        /* Ignore the second of two consecutive flushes: */
 203.737 +        if (len == 0 && s->z_err == Z_BUF_ERROR) s->z_err = Z_OK;
 203.738 +
 203.739 +        /* deflate has finished flushing only when it hasn't used up
 203.740 +         * all the available space in the output buffer:
 203.741 +         */
 203.742 +        done = (s->stream.avail_out != 0 || s->z_err == Z_STREAM_END);
 203.743 +
 203.744 +        if (s->z_err != Z_OK && s->z_err != Z_STREAM_END) break;
 203.745 +    }
 203.746 +    return  s->z_err == Z_STREAM_END ? Z_OK : s->z_err;
 203.747 +}
 203.748 +
 203.749 +int ZEXPORT gzflush (file, flush)
 203.750 +     gzFile file;
 203.751 +     int flush;
 203.752 +{
 203.753 +    gz_stream *s = (gz_stream*)file;
 203.754 +    int err = do_flush (file, flush);
 203.755 +
 203.756 +    if (err) return err;
 203.757 +    fflush(s->file);
 203.758 +    return  s->z_err == Z_STREAM_END ? Z_OK : s->z_err;
 203.759 +}
 203.760 +#endif /* NO_GZCOMPRESS */
 203.761 +
 203.762 +/* ===========================================================================
 203.763 +      Sets the starting position for the next gzread or gzwrite on the given
 203.764 +   compressed file. The offset represents a number of bytes in the
 203.765 +      gzseek returns the resulting offset location as measured in bytes from
 203.766 +   the beginning of the uncompressed stream, or -1 in case of error.
 203.767 +      SEEK_END is not implemented, returns error.
 203.768 +      In this version of the library, gzseek can be extremely slow.
 203.769 +*/
 203.770 +z_off_t ZEXPORT gzseek (file, offset, whence)
 203.771 +    gzFile file;
 203.772 +    z_off_t offset;
 203.773 +    int whence;
 203.774 +{
 203.775 +    gz_stream *s = (gz_stream*)file;
 203.776 +
 203.777 +    if (s == NULL || whence == SEEK_END ||
 203.778 +        s->z_err == Z_ERRNO || s->z_err == Z_DATA_ERROR) {
 203.779 +        return -1L;
 203.780 +    }
 203.781 +
 203.782 +    if (s->mode == 'w') {
 203.783 +#ifdef NO_GZCOMPRESS
 203.784 +        return -1L;
 203.785 +#else
 203.786 +        if (whence == SEEK_SET) {
 203.787 +            offset -= s->in;
 203.788 +        }
 203.789 +        if (offset < 0) return -1L;
 203.790 +
 203.791 +        /* At this point, offset is the number of zero bytes to write. */
 203.792 +        if (s->inbuf == Z_NULL) {
 203.793 +            s->inbuf = (Byte*)ALLOC(Z_BUFSIZE); /* for seeking */
 203.794 +            if (s->inbuf == Z_NULL) return -1L;
 203.795 +            zmemzero(s->inbuf, Z_BUFSIZE);
 203.796 +        }
 203.797 +        while (offset > 0)  {
 203.798 +            uInt size = Z_BUFSIZE;
 203.799 +            if (offset < Z_BUFSIZE) size = (uInt)offset;
 203.800 +
 203.801 +            size = gzwrite(file, s->inbuf, size);
 203.802 +            if (size == 0) return -1L;
 203.803 +
 203.804 +            offset -= size;
 203.805 +        }
 203.806 +        return s->in;
 203.807 +#endif
 203.808 +    }
 203.809 +    /* Rest of function is for reading only */
 203.810 +
 203.811 +    /* compute absolute position */
 203.812 +    if (whence == SEEK_CUR) {
 203.813 +        offset += s->out;
 203.814 +    }
 203.815 +    if (offset < 0) return -1L;
 203.816 +
 203.817 +    if (s->transparent) {
 203.818 +        /* map to fseek */
 203.819 +        s->back = EOF;
 203.820 +        s->stream.avail_in = 0;
 203.821 +        s->stream.next_in = s->inbuf;
 203.822 +        if (fseek(s->file, offset, SEEK_SET) < 0) return -1L;
 203.823 +
 203.824 +        s->in = s->out = offset;
 203.825 +        return offset;
 203.826 +    }
 203.827 +
 203.828 +    /* For a negative seek, rewind and use positive seek */
 203.829 +    if (offset >= s->out) {
 203.830 +        offset -= s->out;
 203.831 +    } else if (gzrewind(file) < 0) {
 203.832 +        return -1L;
 203.833 +    }
 203.834 +    /* offset is now the number of bytes to skip. */
 203.835 +
 203.836 +    if (offset != 0 && s->outbuf == Z_NULL) {
 203.837 +        s->outbuf = (Byte*)ALLOC(Z_BUFSIZE);
 203.838 +        if (s->outbuf == Z_NULL) return -1L;
 203.839 +    }
 203.840 +    if (offset && s->back != EOF) {
 203.841 +        s->back = EOF;
 203.842 +        s->out++;
 203.843 +        offset--;
 203.844 +        if (s->last) s->z_err = Z_STREAM_END;
 203.845 +    }
 203.846 +    while (offset > 0)  {
 203.847 +        int size = Z_BUFSIZE;
 203.848 +        if (offset < Z_BUFSIZE) size = (int)offset;
 203.849 +
 203.850 +        size = gzread(file, s->outbuf, (uInt)size);
 203.851 +        if (size <= 0) return -1L;
 203.852 +        offset -= size;
 203.853 +    }
 203.854 +    return s->out;
 203.855 +}
 203.856 +
 203.857 +/* ===========================================================================
 203.858 +     Rewinds input file.
 203.859 +*/
 203.860 +int ZEXPORT gzrewind (file)
 203.861 +    gzFile file;
 203.862 +{
 203.863 +    gz_stream *s = (gz_stream*)file;
 203.864 +
 203.865 +    if (s == NULL || s->mode != 'r') return -1;
 203.866 +
 203.867 +    s->z_err = Z_OK;
 203.868 +    s->z_eof = 0;
 203.869 +    s->back = EOF;
 203.870 +    s->stream.avail_in = 0;
 203.871 +    s->stream.next_in = s->inbuf;
 203.872 +    s->crc = crc32(0L, Z_NULL, 0);
 203.873 +    if (!s->transparent) (void)inflateReset(&s->stream);
 203.874 +    s->in = 0;
 203.875 +    s->out = 0;
 203.876 +    return fseek(s->file, s->start, SEEK_SET);
 203.877 +}
 203.878 +
 203.879 +/* ===========================================================================
 203.880 +     Returns the starting position for the next gzread or gzwrite on the
 203.881 +   given compressed file. This position represents a number of bytes in the
 203.882 +   uncompressed data stream.
 203.883 +*/
 203.884 +z_off_t ZEXPORT gztell (file)
 203.885 +    gzFile file;
 203.886 +{
 203.887 +    return gzseek(file, 0L, SEEK_CUR);
 203.888 +}
 203.889 +
 203.890 +/* ===========================================================================
 203.891 +     Returns 1 when EOF has previously been detected reading the given
 203.892 +   input stream, otherwise zero.
 203.893 +*/
 203.894 +int ZEXPORT gzeof (file)
 203.895 +    gzFile file;
 203.896 +{
 203.897 +    gz_stream *s = (gz_stream*)file;
 203.898 +
 203.899 +    /* With concatenated compressed files that can have embedded
 203.900 +     * crc trailers, z_eof is no longer the only/best indicator of EOF
 203.901 +     * on a gz_stream. Handle end-of-stream error explicitly here.
 203.902 +     */
 203.903 +    if (s == NULL || s->mode != 'r') return 0;
 203.904 +    if (s->z_eof) return 1;
 203.905 +    return s->z_err == Z_STREAM_END;
 203.906 +}
 203.907 +
 203.908 +/* ===========================================================================
 203.909 +     Returns 1 if reading and doing so transparently, otherwise zero.
 203.910 +*/
 203.911 +int ZEXPORT gzdirect (file)
 203.912 +    gzFile file;
 203.913 +{
 203.914 +    gz_stream *s = (gz_stream*)file;
 203.915 +
 203.916 +    if (s == NULL || s->mode != 'r') return 0;
 203.917 +    return s->transparent;
 203.918 +}
 203.919 +
 203.920 +/* ===========================================================================
 203.921 +   Outputs a long in LSB order to the given file
 203.922 +*/
 203.923 +local void putLong (file, x)
 203.924 +    FILE *file;
 203.925 +    uLong x;
 203.926 +{
 203.927 +    int n;
 203.928 +    for (n = 0; n < 4; n++) {
 203.929 +        fputc((int)(x & 0xff), file);
 203.930 +        x >>= 8;
 203.931 +    }
 203.932 +}
 203.933 +
 203.934 +/* ===========================================================================
 203.935 +   Reads a long in LSB order from the given gz_stream. Sets z_err in case
 203.936 +   of error.
 203.937 +*/
 203.938 +local uLong getLong (s)
 203.939 +    gz_stream *s;
 203.940 +{
 203.941 +    uLong x = (uLong)get_byte(s);
 203.942 +    int c;
 203.943 +
 203.944 +    x += ((uLong)get_byte(s))<<8;
 203.945 +    x += ((uLong)get_byte(s))<<16;
 203.946 +    c = get_byte(s);
 203.947 +    if (c == EOF) s->z_err = Z_DATA_ERROR;
 203.948 +    x += ((uLong)c)<<24;
 203.949 +    return x;
 203.950 +}
 203.951 +
 203.952 +/* ===========================================================================
 203.953 +     Flushes all pending output if necessary, closes the compressed file
 203.954 +   and deallocates all the (de)compression state.
 203.955 +*/
 203.956 +int ZEXPORT gzclose (file)
 203.957 +    gzFile file;
 203.958 +{
 203.959 +    gz_stream *s = (gz_stream*)file;
 203.960 +
 203.961 +    if (s == NULL) return Z_STREAM_ERROR;
 203.962 +
 203.963 +    if (s->mode == 'w') {
 203.964 +#ifdef NO_GZCOMPRESS
 203.965 +        return Z_STREAM_ERROR;
 203.966 +#else
 203.967 +        if (do_flush (file, Z_FINISH) != Z_OK)
 203.968 +            return destroy((gz_stream*)file);
 203.969 +
 203.970 +        putLong (s->file, s->crc);
 203.971 +        putLong (s->file, (uLong)(s->in & 0xffffffff));
 203.972 +#endif
 203.973 +    }
 203.974 +    return destroy((gz_stream*)file);
 203.975 +}
 203.976 +
 203.977 +#ifdef STDC
 203.978 +#  define zstrerror(errnum) strerror(errnum)
 203.979 +#else
 203.980 +#  define zstrerror(errnum) ""
 203.981 +#endif
 203.982 +
 203.983 +/* ===========================================================================
 203.984 +     Returns the error message for the last error which occurred on the
 203.985 +   given compressed file. errnum is set to zlib error number. If an
 203.986 +   error occurred in the file system and not in the compression library,
 203.987 +   errnum is set to Z_ERRNO and the application may consult errno
 203.988 +   to get the exact error code.
 203.989 +*/
 203.990 +const char * ZEXPORT gzerror (file, errnum)
 203.991 +    gzFile file;
 203.992 +    int *errnum;
 203.993 +{
 203.994 +    char *m;
 203.995 +    gz_stream *s = (gz_stream*)file;
 203.996 +
 203.997 +    if (s == NULL) {
 203.998 +        *errnum = Z_STREAM_ERROR;
 203.999 +        return (const char*)ERR_MSG(Z_STREAM_ERROR);
203.1000 +    }
203.1001 +    *errnum = s->z_err;
203.1002 +    if (*errnum == Z_OK) return (const char*)"";
203.1003 +
203.1004 +    m = (char*)(*errnum == Z_ERRNO ? zstrerror(errno) : s->stream.msg);
203.1005 +
203.1006 +    if (m == NULL || *m == '\0') m = (char*)ERR_MSG(s->z_err);
203.1007 +
203.1008 +    TRYFREE(s->msg);
203.1009 +    s->msg = (char*)ALLOC(strlen(s->path) + strlen(m) + 3);
203.1010 +    if (s->msg == Z_NULL) return (const char*)ERR_MSG(Z_MEM_ERROR);
203.1011 +    strcpy(s->msg, s->path);
203.1012 +    strcat(s->msg, ": ");
203.1013 +    strcat(s->msg, m);
203.1014 +    return (const char*)s->msg;
203.1015 +}
203.1016 +
203.1017 +/* ===========================================================================
203.1018 +     Clear the error and end-of-file flags, and do the same for the real file.
203.1019 +*/
203.1020 +void ZEXPORT gzclearerr (file)
203.1021 +    gzFile file;
203.1022 +{
203.1023 +    gz_stream *s = (gz_stream*)file;
203.1024 +
203.1025 +    if (s == NULL) return;
203.1026 +    if (s->z_err != Z_STREAM_END) s->z_err = Z_OK;
203.1027 +    s->z_eof = 0;
203.1028 +    clearerr(s->file);
203.1029 +}
   204.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   204.2 +++ b/libs/zlib/infback.c	Sun Nov 01 00:36:56 2015 +0200
   204.3 @@ -0,0 +1,623 @@
   204.4 +/* infback.c -- inflate using a call-back interface
   204.5 + * Copyright (C) 1995-2005 Mark Adler
   204.6 + * For conditions of distribution and use, see copyright notice in zlib.h
   204.7 + */
   204.8 +
   204.9 +/*
  204.10 +   This code is largely copied from inflate.c.  Normally either infback.o or
  204.11 +   inflate.o would be linked into an application--not both.  The interface
  204.12 +   with inffast.c is retained so that optimized assembler-coded versions of
  204.13 +   inflate_fast() can be used with either inflate.c or infback.c.
  204.14 + */
  204.15 +
  204.16 +#include "zutil.h"
  204.17 +#include "inftrees.h"
  204.18 +#include "inflate.h"
  204.19 +#include "inffast.h"
  204.20 +
  204.21 +/* function prototypes */
  204.22 +local void fixedtables OF((struct inflate_state FAR *state));
  204.23 +
  204.24 +/*
  204.25 +   strm provides memory allocation functions in zalloc and zfree, or
  204.26 +   Z_NULL to use the library memory allocation functions.
  204.27 +
  204.28 +   windowBits is in the range 8..15, and window is a user-supplied
  204.29 +   window and output buffer that is 2**windowBits bytes.
  204.30 + */
  204.31 +int ZEXPORT inflateBackInit_(strm, windowBits, window, version, stream_size)
  204.32 +z_streamp strm;
  204.33 +int windowBits;
  204.34 +unsigned char FAR *window;
  204.35 +const char *version;
  204.36 +int stream_size;
  204.37 +{
  204.38 +    struct inflate_state FAR *state;
  204.39 +
  204.40 +    if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
  204.41 +        stream_size != (int)(sizeof(z_stream)))
  204.42 +        return Z_VERSION_ERROR;
  204.43 +    if (strm == Z_NULL || window == Z_NULL ||
  204.44 +        windowBits < 8 || windowBits > 15)
  204.45 +        return Z_STREAM_ERROR;
  204.46 +    strm->msg = Z_NULL;                 /* in case we return an error */
  204.47 +    if (strm->zalloc == (alloc_func)0) {
  204.48 +        strm->zalloc = zcalloc;
  204.49 +        strm->opaque = (voidpf)0;
  204.50 +    }
  204.51 +    if (strm->zfree == (free_func)0) strm->zfree = zcfree;
  204.52 +    state = (struct inflate_state FAR *)ZALLOC(strm, 1,
  204.53 +                                               sizeof(struct inflate_state));
  204.54 +    if (state == Z_NULL) return Z_MEM_ERROR;
  204.55 +    Tracev((stderr, "inflate: allocated\n"));
  204.56 +    strm->state = (struct internal_state FAR *)state;
  204.57 +    state->dmax = 32768U;
  204.58 +    state->wbits = windowBits;
  204.59 +    state->wsize = 1U << windowBits;
  204.60 +    state->window = window;
  204.61 +    state->write = 0;
  204.62 +    state->whave = 0;
  204.63 +    return Z_OK;
  204.64 +}
  204.65 +
  204.66 +/*
  204.67 +   Return state with length and distance decoding tables and index sizes set to
  204.68 +   fixed code decoding.  Normally this returns fixed tables from inffixed.h.
  204.69 +   If BUILDFIXED is defined, then instead this routine builds the tables the
  204.70 +   first time it's called, and returns those tables the first time and
  204.71 +   thereafter.  This reduces the size of the code by about 2K bytes, in
  204.72 +   exchange for a little execution time.  However, BUILDFIXED should not be
  204.73 +   used for threaded applications, since the rewriting of the tables and virgin
  204.74 +   may not be thread-safe.
  204.75 + */
  204.76 +local void fixedtables(state)
  204.77 +struct inflate_state FAR *state;
  204.78 +{
  204.79 +#ifdef BUILDFIXED
  204.80 +    static int virgin = 1;
  204.81 +    static code *lenfix, *distfix;
  204.82 +    static code fixed[544];
  204.83 +
  204.84 +    /* build fixed huffman tables if first call (may not be thread safe) */
  204.85 +    if (virgin) {
  204.86 +        unsigned sym, bits;
  204.87 +        static code *next;
  204.88 +
  204.89 +        /* literal/length table */
  204.90 +        sym = 0;
  204.91 +        while (sym < 144) state->lens[sym++] = 8;
  204.92 +        while (sym < 256) state->lens[sym++] = 9;
  204.93 +        while (sym < 280) state->lens[sym++] = 7;
  204.94 +        while (sym < 288) state->lens[sym++] = 8;
  204.95 +        next = fixed;
  204.96 +        lenfix = next;
  204.97 +        bits = 9;
  204.98 +        inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work);
  204.99 +
 204.100 +        /* distance table */
 204.101 +        sym = 0;
 204.102 +        while (sym < 32) state->lens[sym++] = 5;
 204.103 +        distfix = next;
 204.104 +        bits = 5;
 204.105 +        inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work);
 204.106 +
 204.107 +        /* do this just once */
 204.108 +        virgin = 0;
 204.109 +    }
 204.110 +#else /* !BUILDFIXED */
 204.111 +#   include "inffixed.h"
 204.112 +#endif /* BUILDFIXED */
 204.113 +    state->lencode = lenfix;
 204.114 +    state->lenbits = 9;
 204.115 +    state->distcode = distfix;
 204.116 +    state->distbits = 5;
 204.117 +}
 204.118 +
 204.119 +/* Macros for inflateBack(): */
 204.120 +
 204.121 +/* Load returned state from inflate_fast() */
 204.122 +#define LOAD() \
 204.123 +    do { \
 204.124 +        put = strm->next_out; \
 204.125 +        left = strm->avail_out; \
 204.126 +        next = strm->next_in; \
 204.127 +        have = strm->avail_in; \
 204.128 +        hold = state->hold; \
 204.129 +        bits = state->bits; \
 204.130 +    } while (0)
 204.131 +
 204.132 +/* Set state from registers for inflate_fast() */
 204.133 +#define RESTORE() \
 204.134 +    do { \
 204.135 +        strm->next_out = put; \
 204.136 +        strm->avail_out = left; \
 204.137 +        strm->next_in = next; \
 204.138 +        strm->avail_in = have; \
 204.139 +        state->hold = hold; \
 204.140 +        state->bits = bits; \
 204.141 +    } while (0)
 204.142 +
 204.143 +/* Clear the input bit accumulator */
 204.144 +#define INITBITS() \
 204.145 +    do { \
 204.146 +        hold = 0; \
 204.147 +        bits = 0; \
 204.148 +    } while (0)
 204.149 +
 204.150 +/* Assure that some input is available.  If input is requested, but denied,
 204.151 +   then return a Z_BUF_ERROR from inflateBack(). */
 204.152 +#define PULL() \
 204.153 +    do { \
 204.154 +        if (have == 0) { \
 204.155 +            have = in(in_desc, &next); \
 204.156 +            if (have == 0) { \
 204.157 +                next = Z_NULL; \
 204.158 +                ret = Z_BUF_ERROR; \
 204.159 +                goto inf_leave; \
 204.160 +            } \
 204.161 +        } \
 204.162 +    } while (0)
 204.163 +
 204.164 +/* Get a byte of input into the bit accumulator, or return from inflateBack()
 204.165 +   with an error if there is no input available. */
 204.166 +#define PULLBYTE() \
 204.167 +    do { \
 204.168 +        PULL(); \
 204.169 +        have--; \
 204.170 +        hold += (unsigned long)(*next++) << bits; \
 204.171 +        bits += 8; \
 204.172 +    } while (0)
 204.173 +
 204.174 +/* Assure that there are at least n bits in the bit accumulator.  If there is
 204.175 +   not enough available input to do that, then return from inflateBack() with
 204.176 +   an error. */
 204.177 +#define NEEDBITS(n) \
 204.178 +    do { \
 204.179 +        while (bits < (unsigned)(n)) \
 204.180 +            PULLBYTE(); \
 204.181 +    } while (0)
 204.182 +
 204.183 +/* Return the low n bits of the bit accumulator (n < 16) */
 204.184 +#define BITS(n) \
 204.185 +    ((unsigned)hold & ((1U << (n)) - 1))
 204.186 +
 204.187 +/* Remove n bits from the bit accumulator */
 204.188 +#define DROPBITS(n) \
 204.189 +    do { \
 204.190 +        hold >>= (n); \
 204.191 +        bits -= (unsigned)(n); \
 204.192 +    } while (0)
 204.193 +
 204.194 +/* Remove zero to seven bits as needed to go to a byte boundary */
 204.195 +#define BYTEBITS() \
 204.196 +    do { \
 204.197 +        hold >>= bits & 7; \
 204.198 +        bits -= bits & 7; \
 204.199 +    } while (0)
 204.200 +
 204.201 +/* Assure that some output space is available, by writing out the window
 204.202 +   if it's full.  If the write fails, return from inflateBack() with a
 204.203 +   Z_BUF_ERROR. */
 204.204 +#define ROOM() \
 204.205 +    do { \
 204.206 +        if (left == 0) { \
 204.207 +            put = state->window; \
 204.208 +            left = state->wsize; \
 204.209 +            state->whave = left; \
 204.210 +            if (out(out_desc, put, left)) { \
 204.211 +                ret = Z_BUF_ERROR; \
 204.212 +                goto inf_leave; \
 204.213 +            } \
 204.214 +        } \
 204.215 +    } while (0)
 204.216 +
 204.217 +/*
 204.218 +   strm provides the memory allocation functions and window buffer on input,
 204.219 +   and provides information on the unused input on return.  For Z_DATA_ERROR
 204.220 +   returns, strm will also provide an error message.
 204.221 +
 204.222 +   in() and out() are the call-back input and output functions.  When
 204.223 +   inflateBack() needs more input, it calls in().  When inflateBack() has
 204.224 +   filled the window with output, or when it completes with data in the
 204.225 +   window, it calls out() to write out the data.  The application must not
 204.226 +   change the provided input until in() is called again or inflateBack()
 204.227 +   returns.  The application must not change the window/output buffer until
 204.228 +   inflateBack() returns.
 204.229 +
 204.230 +   in() and out() are called with a descriptor parameter provided in the
 204.231 +   inflateBack() call.  This parameter can be a structure that provides the
 204.232 +   information required to do the read or write, as well as accumulated
 204.233 +   information on the input and output such as totals and check values.
 204.234 +
 204.235 +   in() should return zero on failure.  out() should return non-zero on
 204.236 +   failure.  If either in() or out() fails, than inflateBack() returns a
 204.237 +   Z_BUF_ERROR.  strm->next_in can be checked for Z_NULL to see whether it
 204.238 +   was in() or out() that caused in the error.  Otherwise,  inflateBack()
 204.239 +   returns Z_STREAM_END on success, Z_DATA_ERROR for an deflate format
 204.240 +   error, or Z_MEM_ERROR if it could not allocate memory for the state.
 204.241 +   inflateBack() can also return Z_STREAM_ERROR if the input parameters
 204.242 +   are not correct, i.e. strm is Z_NULL or the state was not initialized.
 204.243 + */
 204.244 +int ZEXPORT inflateBack(strm, in, in_desc, out, out_desc)
 204.245 +z_streamp strm;
 204.246 +in_func in;
 204.247 +void FAR *in_desc;
 204.248 +out_func out;
 204.249 +void FAR *out_desc;
 204.250 +{
 204.251 +    struct inflate_state FAR *state;
 204.252 +    unsigned char FAR *next;    /* next input */
 204.253 +    unsigned char FAR *put;     /* next output */
 204.254 +    unsigned have, left;        /* available input and output */
 204.255 +    unsigned long hold;         /* bit buffer */
 204.256 +    unsigned bits;              /* bits in bit buffer */
 204.257 +    unsigned copy;              /* number of stored or match bytes to copy */
 204.258 +    unsigned char FAR *from;    /* where to copy match bytes from */
 204.259 +    code this;                  /* current decoding table entry */
 204.260 +    code last;                  /* parent table entry */
 204.261 +    unsigned len;               /* length to copy for repeats, bits to drop */
 204.262 +    int ret;                    /* return code */
 204.263 +    static const unsigned short order[19] = /* permutation of code lengths */
 204.264 +        {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
 204.265 +
 204.266 +    /* Check that the strm exists and that the state was initialized */
 204.267 +    if (strm == Z_NULL || strm->state == Z_NULL)
 204.268 +        return Z_STREAM_ERROR;
 204.269 +    state = (struct inflate_state FAR *)strm->state;
 204.270 +
 204.271 +    /* Reset the state */
 204.272 +    strm->msg = Z_NULL;
 204.273 +    state->mode = TYPE;
 204.274 +    state->last = 0;
 204.275 +    state->whave = 0;
 204.276 +    next = strm->next_in;
 204.277 +    have = next != Z_NULL ? strm->avail_in : 0;
 204.278 +    hold = 0;
 204.279 +    bits = 0;
 204.280 +    put = state->window;
 204.281 +    left = state->wsize;
 204.282 +
 204.283 +    /* Inflate until end of block marked as last */
 204.284 +    for (;;)
 204.285 +        switch (state->mode) {
 204.286 +        case TYPE:
 204.287 +            /* determine and dispatch block type */
 204.288 +            if (state->last) {
 204.289 +                BYTEBITS();
 204.290 +                state->mode = DONE;
 204.291 +                break;
 204.292 +            }
 204.293 +            NEEDBITS(3);
 204.294 +            state->last = BITS(1);
 204.295 +            DROPBITS(1);
 204.296 +            switch (BITS(2)) {
 204.297 +            case 0:                             /* stored block */
 204.298 +                Tracev((stderr, "inflate:     stored block%s\n",
 204.299 +                        state->last ? " (last)" : ""));
 204.300 +                state->mode = STORED;
 204.301 +                break;
 204.302 +            case 1:                             /* fixed block */
 204.303 +                fixedtables(state);
 204.304 +                Tracev((stderr, "inflate:     fixed codes block%s\n",
 204.305 +                        state->last ? " (last)" : ""));
 204.306 +                state->mode = LEN;              /* decode codes */
 204.307 +                break;
 204.308 +            case 2:                             /* dynamic block */
 204.309 +                Tracev((stderr, "inflate:     dynamic codes block%s\n",
 204.310 +                        state->last ? " (last)" : ""));
 204.311 +                state->mode = TABLE;
 204.312 +                break;
 204.313 +            case 3:
 204.314 +                strm->msg = (char *)"invalid block type";
 204.315 +                state->mode = BAD;
 204.316 +            }
 204.317 +            DROPBITS(2);
 204.318 +            break;
 204.319 +
 204.320 +        case STORED:
 204.321 +            /* get and verify stored block length */
 204.322 +            BYTEBITS();                         /* go to byte boundary */
 204.323 +            NEEDBITS(32);
 204.324 +            if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
 204.325 +                strm->msg = (char *)"invalid stored block lengths";
 204.326 +                state->mode = BAD;
 204.327 +                break;
 204.328 +            }
 204.329 +            state->length = (unsigned)hold & 0xffff;
 204.330 +            Tracev((stderr, "inflate:       stored length %u\n",
 204.331 +                    state->length));
 204.332 +            INITBITS();
 204.333 +
 204.334 +            /* copy stored block from input to output */
 204.335 +            while (state->length != 0) {
 204.336 +                copy = state->length;
 204.337 +                PULL();
 204.338 +                ROOM();
 204.339 +                if (copy > have) copy = have;
 204.340 +                if (copy > left) copy = left;
 204.341 +                zmemcpy(put, next, copy);
 204.342 +                have -= copy;
 204.343 +                next += copy;
 204.344 +                left -= copy;
 204.345 +                put += copy;
 204.346 +                state->length -= copy;
 204.347 +            }
 204.348 +            Tracev((stderr, "inflate:       stored end\n"));
 204.349 +            state->mode = TYPE;
 204.350 +            break;
 204.351 +
 204.352 +        case TABLE:
 204.353 +            /* get dynamic table entries descriptor */
 204.354 +            NEEDBITS(14);
 204.355 +            state->nlen = BITS(5) + 257;
 204.356 +            DROPBITS(5);
 204.357 +            state->ndist = BITS(5) + 1;
 204.358 +            DROPBITS(5);
 204.359 +            state->ncode = BITS(4) + 4;
 204.360 +            DROPBITS(4);
 204.361 +#ifndef PKZIP_BUG_WORKAROUND
 204.362 +            if (state->nlen > 286 || state->ndist > 30) {
 204.363 +                strm->msg = (char *)"too many length or distance symbols";
 204.364 +                state->mode = BAD;
 204.365 +                break;
 204.366 +            }
 204.367 +#endif
 204.368 +            Tracev((stderr, "inflate:       table sizes ok\n"));
 204.369 +
 204.370 +            /* get code length code lengths (not a typo) */
 204.371 +            state->have = 0;
 204.372 +            while (state->have < state->ncode) {
 204.373 +                NEEDBITS(3);
 204.374 +                state->lens[order[state->have++]] = (unsigned short)BITS(3);
 204.375 +                DROPBITS(3);
 204.376 +            }
 204.377 +            while (state->have < 19)
 204.378 +                state->lens[order[state->have++]] = 0;
 204.379 +            state->next = state->codes;
 204.380 +            state->lencode = (code const FAR *)(state->next);
 204.381 +            state->lenbits = 7;
 204.382 +            ret = inflate_table(CODES, state->lens, 19, &(state->next),
 204.383 +                                &(state->lenbits), state->work);
 204.384 +            if (ret) {
 204.385 +                strm->msg = (char *)"invalid code lengths set";
 204.386 +                state->mode = BAD;
 204.387 +                break;
 204.388 +            }
 204.389 +            Tracev((stderr, "inflate:       code lengths ok\n"));
 204.390 +
 204.391 +            /* get length and distance code code lengths */
 204.392 +            state->have = 0;
 204.393 +            while (state->have < state->nlen + state->ndist) {
 204.394 +                for (;;) {
 204.395 +                    this = state->lencode[BITS(state->lenbits)];
 204.396 +                    if ((unsigned)(this.bits) <= bits) break;
 204.397 +                    PULLBYTE();
 204.398 +                }
 204.399 +                if (this.val < 16) {
 204.400 +                    NEEDBITS(this.bits);
 204.401 +                    DROPBITS(this.bits);
 204.402 +                    state->lens[state->have++] = this.val;
 204.403 +                }
 204.404 +                else {
 204.405 +                    if (this.val == 16) {
 204.406 +                        NEEDBITS(this.bits + 2);
 204.407 +                        DROPBITS(this.bits);
 204.408 +                        if (state->have == 0) {
 204.409 +                            strm->msg = (char *)"invalid bit length repeat";
 204.410 +                            state->mode = BAD;
 204.411 +                            break;
 204.412 +                        }
 204.413 +                        len = (unsigned)(state->lens[state->have - 1]);
 204.414 +                        copy = 3 + BITS(2);
 204.415 +                        DROPBITS(2);
 204.416 +                    }
 204.417 +                    else if (this.val == 17) {
 204.418 +                        NEEDBITS(this.bits + 3);
 204.419 +                        DROPBITS(this.bits);
 204.420 +                        len = 0;
 204.421 +                        copy = 3 + BITS(3);
 204.422 +                        DROPBITS(3);
 204.423 +                    }
 204.424 +                    else {
 204.425 +                        NEEDBITS(this.bits + 7);
 204.426 +                        DROPBITS(this.bits);
 204.427 +                        len = 0;
 204.428 +                        copy = 11 + BITS(7);
 204.429 +                        DROPBITS(7);
 204.430 +                    }
 204.431 +                    if (state->have + copy > state->nlen + state->ndist) {
 204.432 +                        strm->msg = (char *)"invalid bit length repeat";
 204.433 +                        state->mode = BAD;
 204.434 +                        break;
 204.435 +                    }
 204.436 +                    while (copy--)
 204.437 +                        state->lens[state->have++] = (unsigned short)len;
 204.438 +                }
 204.439 +            }
 204.440 +
 204.441 +            /* handle error breaks in while */
 204.442 +            if (state->mode == BAD) break;
 204.443 +
 204.444 +            /* build code tables */
 204.445 +            state->next = state->codes;
 204.446 +            state->lencode = (code const FAR *)(state->next);
 204.447 +            state->lenbits = 9;
 204.448 +            ret = inflate_table(LENS, state->lens, state->nlen, &(state->next),
 204.449 +                                &(state->lenbits), state->work);
 204.450 +            if (ret) {
 204.451 +                strm->msg = (char *)"invalid literal/lengths set";
 204.452 +                state->mode = BAD;
 204.453 +                break;
 204.454 +            }
 204.455 +            state->distcode = (code const FAR *)(state->next);
 204.456 +            state->distbits = 6;
 204.457 +            ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist,
 204.458 +                            &(state->next), &(state->distbits), state->work);
 204.459 +            if (ret) {
 204.460 +                strm->msg = (char *)"invalid distances set";
 204.461 +                state->mode = BAD;
 204.462 +                break;
 204.463 +            }
 204.464 +            Tracev((stderr, "inflate:       codes ok\n"));
 204.465 +            state->mode = LEN;
 204.466 +
 204.467 +        case LEN:
 204.468 +            /* use inflate_fast() if we have enough input and output */
 204.469 +            if (have >= 6 && left >= 258) {
 204.470 +                RESTORE();
 204.471 +                if (state->whave < state->wsize)
 204.472 +                    state->whave = state->wsize - left;
 204.473 +                inflate_fast(strm, state->wsize);
 204.474 +                LOAD();
 204.475 +                break;
 204.476 +            }
 204.477 +
 204.478 +            /* get a literal, length, or end-of-block code */
 204.479 +            for (;;) {
 204.480 +                this = state->lencode[BITS(state->lenbits)];
 204.481 +                if ((unsigned)(this.bits) <= bits) break;
 204.482 +                PULLBYTE();
 204.483 +            }
 204.484 +            if (this.op && (this.op & 0xf0) == 0) {
 204.485 +                last = this;
 204.486 +                for (;;) {
 204.487 +                    this = state->lencode[last.val +
 204.488 +                            (BITS(last.bits + last.op) >> last.bits)];
 204.489 +                    if ((unsigned)(last.bits + this.bits) <= bits) break;
 204.490 +                    PULLBYTE();
 204.491 +                }
 204.492 +                DROPBITS(last.bits);
 204.493 +            }
 204.494 +            DROPBITS(this.bits);
 204.495 +            state->length = (unsigned)this.val;
 204.496 +
 204.497 +            /* process literal */
 204.498 +            if (this.op == 0) {
 204.499 +                Tracevv((stderr, this.val >= 0x20 && this.val < 0x7f ?
 204.500 +                        "inflate:         literal '%c'\n" :
 204.501 +                        "inflate:         literal 0x%02x\n", this.val));
 204.502 +                ROOM();
 204.503 +                *put++ = (unsigned char)(state->length);
 204.504 +                left--;
 204.505 +                state->mode = LEN;
 204.506 +                break;
 204.507 +            }
 204.508 +
 204.509 +            /* process end of block */
 204.510 +            if (this.op & 32) {
 204.511 +                Tracevv((stderr, "inflate:         end of block\n"));
 204.512 +                state->mode = TYPE;
 204.513 +                break;
 204.514 +            }
 204.515 +
 204.516 +            /* invalid code */
 204.517 +            if (this.op & 64) {
 204.518 +                strm->msg = (char *)"invalid literal/length code";
 204.519 +                state->mode = BAD;
 204.520 +                break;
 204.521 +            }
 204.522 +
 204.523 +            /* length code -- get extra bits, if any */
 204.524 +            state->extra = (unsigned)(this.op) & 15;
 204.525 +            if (state->extra != 0) {
 204.526 +                NEEDBITS(state->extra);
 204.527 +                state->length += BITS(state->extra);
 204.528 +                DROPBITS(state->extra);
 204.529 +            }
 204.530 +            Tracevv((stderr, "inflate:         length %u\n", state->length));
 204.531 +
 204.532 +            /* get distance code */
 204.533 +            for (;;) {
 204.534 +                this = state->distcode[BITS(state->distbits)];
 204.535 +                if ((unsigned)(this.bits) <= bits) break;
 204.536 +                PULLBYTE();
 204.537 +            }
 204.538 +            if ((this.op & 0xf0) == 0) {
 204.539 +                last = this;
 204.540 +                for (;;) {
 204.541 +                    this = state->distcode[last.val +
 204.542 +                            (BITS(last.bits + last.op) >> last.bits)];
 204.543 +                    if ((unsigned)(last.bits + this.bits) <= bits) break;
 204.544 +                    PULLBYTE();
 204.545 +                }
 204.546 +                DROPBITS(last.bits);
 204.547 +            }
 204.548 +            DROPBITS(this.bits);
 204.549 +            if (this.op & 64) {
 204.550 +                strm->msg = (char *)"invalid distance code";
 204.551 +                state->mode = BAD;
 204.552 +                break;
 204.553 +            }
 204.554 +            state->offset = (unsigned)this.val;
 204.555 +
 204.556 +            /* get distance extra bits, if any */
 204.557 +            state->extra = (unsigned)(this.op) & 15;
 204.558 +            if (state->extra != 0) {
 204.559 +                NEEDBITS(state->extra);
 204.560 +                state->offset += BITS(state->extra);
 204.561 +                DROPBITS(state->extra);
 204.562 +            }
 204.563 +            if (state->offset > state->wsize - (state->whave < state->wsize ?
 204.564 +                                                left : 0)) {
 204.565 +                strm->msg = (char *)"invalid distance too far back";
 204.566 +                state->mode = BAD;
 204.567 +                break;
 204.568 +            }
 204.569 +            Tracevv((stderr, "inflate:         distance %u\n", state->offset));
 204.570 +
 204.571 +            /* copy match from window to output */
 204.572 +            do {
 204.573 +                ROOM();
 204.574 +                copy = state->wsize - state->offset;
 204.575 +                if (copy < left) {
 204.576 +                    from = put + copy;
 204.577 +                    copy = left - copy;
 204.578 +                }
 204.579 +                else {
 204.580 +                    from = put - state->offset;
 204.581 +                    copy = left;
 204.582 +                }
 204.583 +                if (copy > state->length) copy = state->length;
 204.584 +                state->length -= copy;
 204.585 +                left -= copy;
 204.586 +                do {
 204.587 +                    *put++ = *from++;
 204.588 +                } while (--copy);
 204.589 +            } while (state->length != 0);
 204.590 +            break;
 204.591 +
 204.592 +        case DONE:
 204.593 +            /* inflate stream terminated properly -- write leftover output */
 204.594 +            ret = Z_STREAM_END;
 204.595 +            if (left < state->wsize) {
 204.596 +                if (out(out_desc, state->window, state->wsize - left))
 204.597 +                    ret = Z_BUF_ERROR;
 204.598 +            }
 204.599 +            goto inf_leave;
 204.600 +
 204.601 +        case BAD:
 204.602 +            ret = Z_DATA_ERROR;
 204.603 +            goto inf_leave;
 204.604 +
 204.605 +        default:                /* can't happen, but makes compilers happy */
 204.606 +            ret = Z_STREAM_ERROR;
 204.607 +            goto inf_leave;
 204.608 +        }
 204.609 +
 204.610 +    /* Return unused input */
 204.611 +  inf_leave:
 204.612 +    strm->next_in = next;
 204.613 +    strm->avail_in = have;
 204.614 +    return ret;
 204.615 +}
 204.616 +
 204.617 +int ZEXPORT inflateBackEnd(strm)
 204.618 +z_streamp strm;
 204.619 +{
 204.620 +    if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0)
 204.621 +        return Z_STREAM_ERROR;
 204.622 +    ZFREE(strm, strm->state);
 204.623 +    strm->state = Z_NULL;
 204.624 +    Tracev((stderr, "inflate: end\n"));
 204.625 +    return Z_OK;
 204.626 +}
   205.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   205.2 +++ b/libs/zlib/inffast.c	Sun Nov 01 00:36:56 2015 +0200
   205.3 @@ -0,0 +1,318 @@
   205.4 +/* inffast.c -- fast decoding
   205.5 + * Copyright (C) 1995-2004 Mark Adler
   205.6 + * For conditions of distribution and use, see copyright notice in zlib.h
   205.7 + */
   205.8 +
   205.9 +#include "zutil.h"
  205.10 +#include "inftrees.h"
  205.11 +#include "inflate.h"
  205.12 +#include "inffast.h"
  205.13 +
  205.14 +#ifndef ASMINF
  205.15 +
  205.16 +/* Allow machine dependent optimization for post-increment or pre-increment.
  205.17 +   Based on testing to date,
  205.18 +   Pre-increment preferred for:
  205.19 +   - PowerPC G3 (Adler)
  205.20 +   - MIPS R5000 (Randers-Pehrson)
  205.21 +   Post-increment preferred for:
  205.22 +   - none
  205.23 +   No measurable difference:
  205.24 +   - Pentium III (Anderson)
  205.25 +   - M68060 (Nikl)
  205.26 + */
  205.27 +#ifdef POSTINC
  205.28 +#  define OFF 0
  205.29 +#  define PUP(a) *(a)++
  205.30 +#else
  205.31 +#  define OFF 1
  205.32 +#  define PUP(a) *++(a)
  205.33 +#endif
  205.34 +
  205.35 +/*
  205.36 +   Decode literal, length, and distance codes and write out the resulting
  205.37 +   literal and match bytes until either not enough input or output is
  205.38 +   available, an end-of-block is encountered, or a data error is encountered.
  205.39 +   When large enough input and output buffers are supplied to inflate(), for
  205.40 +   example, a 16K input buffer and a 64K output buffer, more than 95% of the
  205.41 +   inflate execution time is spent in this routine.
  205.42 +
  205.43 +   Entry assumptions:
  205.44 +
  205.45 +        state->mode == LEN
  205.46 +        strm->avail_in >= 6
  205.47 +        strm->avail_out >= 258
  205.48 +        start >= strm->avail_out
  205.49 +        state->bits < 8
  205.50 +
  205.51 +   On return, state->mode is one of:
  205.52 +
  205.53 +        LEN -- ran out of enough output space or enough available input
  205.54 +        TYPE -- reached end of block code, inflate() to interpret next block
  205.55 +        BAD -- error in block data
  205.56 +
  205.57 +   Notes:
  205.58 +
  205.59 +    - The maximum input bits used by a length/distance pair is 15 bits for the
  205.60 +      length code, 5 bits for the length extra, 15 bits for the distance code,
  205.61 +      and 13 bits for the distance extra.  This totals 48 bits, or six bytes.
  205.62 +      Therefore if strm->avail_in >= 6, then there is enough input to avoid
  205.63 +      checking for available input while decoding.
  205.64 +
  205.65 +    - The maximum bytes that a single length/distance pair can output is 258
  205.66 +      bytes, which is the maximum length that can be coded.  inflate_fast()
  205.67 +      requires strm->avail_out >= 258 for each loop to avoid checking for
  205.68 +      output space.
  205.69 + */
  205.70 +void inflate_fast(strm, start)
  205.71 +z_streamp strm;
  205.72 +unsigned start;         /* inflate()'s starting value for strm->avail_out */
  205.73 +{
  205.74 +    struct inflate_state FAR *state;
  205.75 +    unsigned char FAR *in;      /* local strm->next_in */
  205.76 +    unsigned char FAR *last;    /* while in < last, enough input available */
  205.77 +    unsigned char FAR *out;     /* local strm->next_out */
  205.78 +    unsigned char FAR *beg;     /* inflate()'s initial strm->next_out */
  205.79 +    unsigned char FAR *end;     /* while out < end, enough space available */
  205.80 +#ifdef INFLATE_STRICT
  205.81 +    unsigned dmax;              /* maximum distance from zlib header */
  205.82 +#endif
  205.83 +    unsigned wsize;             /* window size or zero if not using window */
  205.84 +    unsigned whave;             /* valid bytes in the window */
  205.85 +    unsigned write;             /* window write index */
  205.86 +    unsigned char FAR *window;  /* allocated sliding window, if wsize != 0 */
  205.87 +    unsigned long hold;         /* local strm->hold */
  205.88 +    unsigned bits;              /* local strm->bits */
  205.89 +    code const FAR *lcode;      /* local strm->lencode */
  205.90 +    code const FAR *dcode;      /* local strm->distcode */
  205.91 +    unsigned lmask;             /* mask for first level of length codes */
  205.92 +    unsigned dmask;             /* mask for first level of distance codes */
  205.93 +    code this;                  /* retrieved table entry */
  205.94 +    unsigned op;                /* code bits, operation, extra bits, or */
  205.95 +                                /*  window position, window bytes to copy */
  205.96 +    unsigned len;               /* match length, unused bytes */
  205.97 +    unsigned dist;              /* match distance */
  205.98 +    unsigned char FAR *from;    /* where to copy match from */
  205.99 +
 205.100 +    /* copy state to local variables */
 205.101 +    state = (struct inflate_state FAR *)strm->state;
 205.102 +    in = strm->next_in - OFF;
 205.103 +    last = in + (strm->avail_in - 5);
 205.104 +    out = strm->next_out - OFF;
 205.105 +    beg = out - (start - strm->avail_out);
 205.106 +    end = out + (strm->avail_out - 257);
 205.107 +#ifdef INFLATE_STRICT
 205.108 +    dmax = state->dmax;
 205.109 +#endif
 205.110 +    wsize = state->wsize;
 205.111 +    whave = state->whave;
 205.112 +    write = state->write;
 205.113 +    window = state->window;
 205.114 +    hold = state->hold;
 205.115 +    bits = state->bits;
 205.116 +    lcode = state->lencode;
 205.117 +    dcode = state->distcode;
 205.118 +    lmask = (1U << state->lenbits) - 1;
 205.119 +    dmask = (1U << state->distbits) - 1;
 205.120 +
 205.121 +    /* decode literals and length/distances until end-of-block or not enough
 205.122 +       input data or output space */
 205.123 +    do {
 205.124 +        if (bits < 15) {
 205.125 +            hold += (unsigned long)(PUP(in)) << bits;
 205.126 +            bits += 8;
 205.127 +            hold += (unsigned long)(PUP(in)) << bits;
 205.128 +            bits += 8;
 205.129 +        }
 205.130 +        this = lcode[hold & lmask];
 205.131 +      dolen:
 205.132 +        op = (unsigned)(this.bits);
 205.133 +        hold >>= op;
 205.134 +        bits -= op;
 205.135 +        op = (unsigned)(this.op);
 205.136 +        if (op == 0) {                          /* literal */
 205.137 +            Tracevv((stderr, this.val >= 0x20 && this.val < 0x7f ?
 205.138 +                    "inflate:         literal '%c'\n" :
 205.139 +                    "inflate:         literal 0x%02x\n", this.val));
 205.140 +            PUP(out) = (unsigned char)(this.val);
 205.141 +        }
 205.142 +        else if (op & 16) {                     /* length base */
 205.143 +            len = (unsigned)(this.val);
 205.144 +            op &= 15;                           /* number of extra bits */
 205.145 +            if (op) {
 205.146 +                if (bits < op) {
 205.147 +                    hold += (unsigned long)(PUP(in)) << bits;
 205.148 +                    bits += 8;
 205.149 +                }
 205.150 +                len += (unsigned)hold & ((1U << op) - 1);
 205.151 +                hold >>= op;
 205.152 +                bits -= op;
 205.153 +            }
 205.154 +            Tracevv((stderr, "inflate:         length %u\n", len));
 205.155 +            if (bits < 15) {
 205.156 +                hold += (unsigned long)(PUP(in)) << bits;
 205.157 +                bits += 8;
 205.158 +                hold += (unsigned long)(PUP(in)) << bits;
 205.159 +                bits += 8;
 205.160 +            }
 205.161 +            this = dcode[hold & dmask];
 205.162 +          dodist:
 205.163 +            op = (unsigned)(this.bits);
 205.164 +            hold >>= op;
 205.165 +            bits -= op;
 205.166 +            op = (unsigned)(this.op);
 205.167 +            if (op & 16) {                      /* distance base */
 205.168 +                dist = (unsigned)(this.val);
 205.169 +                op &= 15;                       /* number of extra bits */
 205.170 +                if (bits < op) {
 205.171 +                    hold += (unsigned long)(PUP(in)) << bits;
 205.172 +                    bits += 8;
 205.173 +                    if (bits < op) {
 205.174 +                        hold += (unsigned long)(PUP(in)) << bits;
 205.175 +                        bits += 8;
 205.176 +                    }
 205.177 +                }
 205.178 +                dist += (unsigned)hold & ((1U << op) - 1);
 205.179 +#ifdef INFLATE_STRICT
 205.180 +                if (dist > dmax) {
 205.181 +                    strm->msg = (char *)"invalid distance too far back";
 205.182 +                    state->mode = BAD;
 205.183 +                    break;
 205.184 +                }
 205.185 +#endif
 205.186 +                hold >>= op;
 205.187 +                bits -= op;
 205.188 +                Tracevv((stderr, "inflate:         distance %u\n", dist));
 205.189 +                op = (unsigned)(out - beg);     /* max distance in output */
 205.190 +                if (dist > op) {                /* see if copy from window */
 205.191 +                    op = dist - op;             /* distance back in window */
 205.192 +                    if (op > whave) {
 205.193 +                        strm->msg = (char *)"invalid distance too far back";
 205.194 +                        state->mode = BAD;
 205.195 +                        break;
 205.196 +                    }
 205.197 +                    from = window - OFF;
 205.198 +                    if (write == 0) {           /* very common case */
 205.199 +                        from += wsize - op;
 205.200 +                        if (op < len) {         /* some from window */
 205.201 +                            len -= op;
 205.202 +                            do {
 205.203 +                                PUP(out) = PUP(from);
 205.204 +                            } while (--op);
 205.205 +                            from = out - dist;  /* rest from output */
 205.206 +                        }
 205.207 +                    }
 205.208 +                    else if (write < op) {      /* wrap around window */
 205.209 +                        from += wsize + write - op;
 205.210 +                        op -= write;
 205.211 +                        if (op < len) {         /* some from end of window */
 205.212 +                            len -= op;
 205.213 +                            do {
 205.214 +                                PUP(out) = PUP(from);
 205.215 +                            } while (--op);
 205.216 +                            from = window - OFF;
 205.217 +                            if (write < len) {  /* some from start of window */
 205.218 +                                op = write;
 205.219 +                                len -= op;
 205.220 +                                do {
 205.221 +                                    PUP(out) = PUP(from);
 205.222 +                                } while (--op);
 205.223 +                                from = out - dist;      /* rest from output */
 205.224 +                            }
 205.225 +                        }
 205.226 +                    }
 205.227 +                    else {                      /* contiguous in window */
 205.228 +                        from += write - op;
 205.229 +                        if (op < len) {         /* some from window */
 205.230 +                            len -= op;
 205.231 +                            do {
 205.232 +                                PUP(out) = PUP(from);
 205.233 +                            } while (--op);
 205.234 +                            from = out - dist;  /* rest from output */
 205.235 +                        }
 205.236 +                    }
 205.237 +                    while (len > 2) {
 205.238 +                        PUP(out) = PUP(from);
 205.239 +                        PUP(out) = PUP(from);
 205.240 +                        PUP(out) = PUP(from);
 205.241 +                        len -= 3;
 205.242 +                    }
 205.243 +                    if (len) {
 205.244 +                        PUP(out) = PUP(from);
 205.245 +                        if (len > 1)
 205.246 +                            PUP(out) = PUP(from);
 205.247 +                    }
 205.248 +                }
 205.249 +                else {
 205.250 +                    from = out - dist;          /* copy direct from output */
 205.251 +                    do {                        /* minimum length is three */
 205.252 +                        PUP(out) = PUP(from);
 205.253 +                        PUP(out) = PUP(from);
 205.254 +                        PUP(out) = PUP(from);
 205.255 +                        len -= 3;
 205.256 +                    } while (len > 2);
 205.257 +                    if (len) {
 205.258 +                        PUP(out) = PUP(from);
 205.259 +                        if (len > 1)
 205.260 +                            PUP(out) = PUP(from);
 205.261 +                    }
 205.262 +                }
 205.263 +            }
 205.264 +            else if ((op & 64) == 0) {          /* 2nd level distance code */
 205.265 +                this = dcode[this.val + (hold & ((1U << op) - 1))];
 205.266 +                goto dodist;
 205.267 +            }
 205.268 +            else {
 205.269 +                strm->msg = (char *)"invalid distance code";
 205.270 +                state->mode = BAD;
 205.271 +                break;
 205.272 +            }
 205.273 +        }
 205.274 +        else if ((op & 64) == 0) {              /* 2nd level length code */
 205.275 +            this = lcode[this.val + (hold & ((1U << op) - 1))];
 205.276 +            goto dolen;
 205.277 +        }
 205.278 +        else if (op & 32) {                     /* end-of-block */
 205.279 +            Tracevv((stderr, "inflate:         end of block\n"));
 205.280 +            state->mode = TYPE;
 205.281 +            break;
 205.282 +        }
 205.283 +        else {
 205.284 +            strm->msg = (char *)"invalid literal/length code";
 205.285 +            state->mode = BAD;
 205.286 +            break;
 205.287 +        }
 205.288 +    } while (in < last && out < end);
 205.289 +
 205.290 +    /* return unused bytes (on entry, bits < 8, so in won't go too far back) */
 205.291 +    len = bits >> 3;
 205.292 +    in -= len;
 205.293 +    bits -= len << 3;
 205.294 +    hold &= (1U << bits) - 1;
 205.295 +
 205.296 +    /* update state and return */
 205.297 +    strm->next_in = in + OFF;
 205.298 +    strm->next_out = out + OFF;
 205.299 +    strm->avail_in = (unsigned)(in < last ? 5 + (last - in) : 5 - (in - last));
 205.300 +    strm->avail_out = (unsigned)(out < end ?
 205.301 +                                 257 + (end - out) : 257 - (out - end));
 205.302 +    state->hold = hold;
 205.303 +    state->bits = bits;
 205.304 +    return;
 205.305 +}
 205.306 +
 205.307 +/*
 205.308 +   inflate_fast() speedups that turned out slower (on a PowerPC G3 750CXe):
 205.309 +   - Using bit fields for code structure
 205.310 +   - Different op definition to avoid & for extra bits (do & for table bits)
 205.311 +   - Three separate decoding do-loops for direct, window, and write == 0
 205.312 +   - Special case for distance > 1 copies to do overlapped load and store copy
 205.313 +   - Explicit branch predictions (based on measured branch probabilities)
 205.314 +   - Deferring match copy and interspersed it with decoding subsequent codes
 205.315 +   - Swapping literal/length else
 205.316 +   - Swapping window/direct else
 205.317 +   - Larger unrolled copy loops (three is about right)
 205.318 +   - Moving len -= 3 statement into middle of loop
 205.319 + */
 205.320 +
 205.321 +#endif /* !ASMINF */
   206.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   206.2 +++ b/libs/zlib/inffast.h	Sun Nov 01 00:36:56 2015 +0200
   206.3 @@ -0,0 +1,11 @@
   206.4 +/* inffast.h -- header to use inffast.c
   206.5 + * Copyright (C) 1995-2003 Mark Adler
   206.6 + * For conditions of distribution and use, see copyright notice in zlib.h
   206.7 + */
   206.8 +
   206.9 +/* WARNING: this file should *not* be used by applications. It is
  206.10 +   part of the implementation of the compression library and is
  206.11 +   subject to change. Applications should only use zlib.h.
  206.12 + */
  206.13 +
  206.14 +void inflate_fast OF((z_streamp strm, unsigned start));
   207.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   207.2 +++ b/libs/zlib/inffixed.h	Sun Nov 01 00:36:56 2015 +0200
   207.3 @@ -0,0 +1,94 @@
   207.4 +    /* inffixed.h -- table for decoding fixed codes
   207.5 +     * Generated automatically by makefixed().
   207.6 +     */
   207.7 +
   207.8 +    /* WARNING: this file should *not* be used by applications. It
   207.9 +       is part of the implementation of the compression library and
  207.10 +       is subject to change. Applications should only use zlib.h.
  207.11 +     */
  207.12 +
  207.13 +    static const code lenfix[512] = {
  207.14 +        {96,7,0},{0,8,80},{0,8,16},{20,8,115},{18,7,31},{0,8,112},{0,8,48},
  207.15 +        {0,9,192},{16,7,10},{0,8,96},{0,8,32},{0,9,160},{0,8,0},{0,8,128},
  207.16 +        {0,8,64},{0,9,224},{16,7,6},{0,8,88},{0,8,24},{0,9,144},{19,7,59},
  207.17 +        {0,8,120},{0,8,56},{0,9,208},{17,7,17},{0,8,104},{0,8,40},{0,9,176},
  207.18 +        {0,8,8},{0,8,136},{0,8,72},{0,9,240},{16,7,4},{0,8,84},{0,8,20},
  207.19 +        {21,8,227},{19,7,43},{0,8,116},{0,8,52},{0,9,200},{17,7,13},{0,8,100},
  207.20 +        {0,8,36},{0,9,168},{0,8,4},{0,8,132},{0,8,68},{0,9,232},{16,7,8},
  207.21 +        {0,8,92},{0,8,28},{0,9,152},{20,7,83},{0,8,124},{0,8,60},{0,9,216},
  207.22 +        {18,7,23},{0,8,108},{0,8,44},{0,9,184},{0,8,12},{0,8,140},{0,8,76},
  207.23 +        {0,9,248},{16,7,3},{0,8,82},{0,8,18},{21,8,163},{19,7,35},{0,8,114},
  207.24 +        {0,8,50},{0,9,196},{17,7,11},{0,8,98},{0,8,34},{0,9,164},{0,8,2},
  207.25 +        {0,8,130},{0,8,66},{0,9,228},{16,7,7},{0,8,90},{0,8,26},{0,9,148},
  207.26 +        {20,7,67},{0,8,122},{0,8,58},{0,9,212},{18,7,19},{0,8,106},{0,8,42},
  207.27 +        {0,9,180},{0,8,10},{0,8,138},{0,8,74},{0,9,244},{16,7,5},{0,8,86},
  207.28 +        {0,8,22},{64,8,0},{19,7,51},{0,8,118},{0,8,54},{0,9,204},{17,7,15},
  207.29 +        {0,8,102},{0,8,38},{0,9,172},{0,8,6},{0,8,134},{0,8,70},{0,9,236},
  207.30 +        {16,7,9},{0,8,94},{0,8,30},{0,9,156},{20,7,99},{0,8,126},{0,8,62},
  207.31 +        {0,9,220},{18,7,27},{0,8,110},{0,8,46},{0,9,188},{0,8,14},{0,8,142},
  207.32 +        {0,8,78},{0,9,252},{96,7,0},{0,8,81},{0,8,17},{21,8,131},{18,7,31},
  207.33 +        {0,8,113},{0,8,49},{0,9,194},{16,7,10},{0,8,97},{0,8,33},{0,9,162},
  207.34 +        {0,8,1},{0,8,129},{0,8,65},{0,9,226},{16,7,6},{0,8,89},{0,8,25},
  207.35 +        {0,9,146},{19,7,59},{0,8,121},{0,8,57},{0,9,210},{17,7,17},{0,8,105},
  207.36 +        {0,8,41},{0,9,178},{0,8,9},{0,8,137},{0,8,73},{0,9,242},{16,7,4},
  207.37 +        {0,8,85},{0,8,21},{16,8,258},{19,7,43},{0,8,117},{0,8,53},{0,9,202},
  207.38 +        {17,7,13},{0,8,101},{0,8,37},{0,9,170},{0,8,5},{0,8,133},{0,8,69},
  207.39 +        {0,9,234},{16,7,8},{0,8,93},{0,8,29},{0,9,154},{20,7,83},{0,8,125},
  207.40 +        {0,8,61},{0,9,218},{18,7,23},{0,8,109},{0,8,45},{0,9,186},{0,8,13},
  207.41 +        {0,8,141},{0,8,77},{0,9,250},{16,7,3},{0,8,83},{0,8,19},{21,8,195},
  207.42 +        {19,7,35},{0,8,115},{0,8,51},{0,9,198},{17,7,11},{0,8,99},{0,8,35},
  207.43 +        {0,9,166},{0,8,3},{0,8,131},{0,8,67},{0,9,230},{16,7,7},{0,8,91},
  207.44 +        {0,8,27},{0,9,150},{20,7,67},{0,8,123},{0,8,59},{0,9,214},{18,7,19},
  207.45 +        {0,8,107},{0,8,43},{0,9,182},{0,8,11},{0,8,139},{0,8,75},{0,9,246},
  207.46 +        {16,7,5},{0,8,87},{0,8,23},{64,8,0},{19,7,51},{0,8,119},{0,8,55},
  207.47 +        {0,9,206},{17,7,15},{0,8,103},{0,8,39},{0,9,174},{0,8,7},{0,8,135},
  207.48 +        {0,8,71},{0,9,238},{16,7,9},{0,8,95},{0,8,31},{0,9,158},{20,7,99},
  207.49 +        {0,8,127},{0,8,63},{0,9,222},{18,7,27},{0,8,111},{0,8,47},{0,9,190},
  207.50 +        {0,8,15},{0,8,143},{0,8,79},{0,9,254},{96,7,0},{0,8,80},{0,8,16},
  207.51 +        {20,8,115},{18,7,31},{0,8,112},{0,8,48},{0,9,193},{16,7,10},{0,8,96},
  207.52 +        {0,8,32},{0,9,161},{0,8,0},{0,8,128},{0,8,64},{0,9,225},{16,7,6},
  207.53 +        {0,8,88},{0,8,24},{0,9,145},{19,7,59},{0,8,120},{0,8,56},{0,9,209},
  207.54 +        {17,7,17},{0,8,104},{0,8,40},{0,9,177},{0,8,8},{0,8,136},{0,8,72},
  207.55 +        {0,9,241},{16,7,4},{0,8,84},{0,8,20},{21,8,227},{19,7,43},{0,8,116},
  207.56 +        {0,8,52},{0,9,201},{17,7,13},{0,8,100},{0,8,36},{0,9,169},{0,8,4},
  207.57 +        {0,8,132},{0,8,68},{0,9,233},{16,7,8},{0,8,92},{0,8,28},{0,9,153},
  207.58 +        {20,7,83},{0,8,124},{0,8,60},{0,9,217},{18,7,23},{0,8,108},{0,8,44},
  207.59 +        {0,9,185},{0,8,12},{0,8,140},{0,8,76},{0,9,249},{16,7,3},{0,8,82},
  207.60 +        {0,8,18},{21,8,163},{19,7,35},{0,8,114},{0,8,50},{0,9,197},{17,7,11},
  207.61 +        {0,8,98},{0,8,34},{0,9,165},{0,8,2},{0,8,130},{0,8,66},{0,9,229},
  207.62 +        {16,7,7},{0,8,90},{0,8,26},{0,9,149},{20,7,67},{0,8,122},{0,8,58},
  207.63 +        {0,9,213},{18,7,19},{0,8,106},{0,8,42},{0,9,181},{0,8,10},{0,8,138},
  207.64 +        {0,8,74},{0,9,245},{16,7,5},{0,8,86},{0,8,22},{64,8,0},{19,7,51},
  207.65 +        {0,8,118},{0,8,54},{0,9,205},{17,7,15},{0,8,102},{0,8,38},{0,9,173},
  207.66 +        {0,8,6},{0,8,134},{0,8,70},{0,9,237},{16,7,9},{0,8,94},{0,8,30},
  207.67 +        {0,9,157},{20,7,99},{0,8,126},{0,8,62},{0,9,221},{18,7,27},{0,8,110},
  207.68 +        {0,8,46},{0,9,189},{0,8,14},{0,8,142},{0,8,78},{0,9,253},{96,7,0},
  207.69 +        {0,8,81},{0,8,17},{21,8,131},{18,7,31},{0,8,113},{0,8,49},{0,9,195},
  207.70 +        {16,7,10},{0,8,97},{0,8,33},{0,9,163},{0,8,1},{0,8,129},{0,8,65},
  207.71 +        {0,9,227},{16,7,6},{0,8,89},{0,8,25},{0,9,147},{19,7,59},{0,8,121},
  207.72 +        {0,8,57},{0,9,211},{17,7,17},{0,8,105},{0,8,41},{0,9,179},{0,8,9},
  207.73 +        {0,8,137},{0,8,73},{0,9,243},{16,7,4},{0,8,85},{0,8,21},{16,8,258},
  207.74 +        {19,7,43},{0,8,117},{0,8,53},{0,9,203},{17,7,13},{0,8,101},{0,8,37},
  207.75 +        {0,9,171},{0,8,5},{0,8,133},{0,8,69},{0,9,235},{16,7,8},{0,8,93},
  207.76 +        {0,8,29},{0,9,155},{20,7,83},{0,8,125},{0,8,61},{0,9,219},{18,7,23},
  207.77 +        {0,8,109},{0,8,45},{0,9,187},{0,8,13},{0,8,141},{0,8,77},{0,9,251},
  207.78 +        {16,7,3},{0,8,83},{0,8,19},{21,8,195},{19,7,35},{0,8,115},{0,8,51},
  207.79 +        {0,9,199},{17,7,11},{0,8,99},{0,8,35},{0,9,167},{0,8,3},{0,8,131},
  207.80 +        {0,8,67},{0,9,231},{16,7,7},{0,8,91},{0,8,27},{0,9,151},{20,7,67},
  207.81 +        {0,8,123},{0,8,59},{0,9,215},{18,7,19},{0,8,107},{0,8,43},{0,9,183},
  207.82 +        {0,8,11},{0,8,139},{0,8,75},{0,9,247},{16,7,5},{0,8,87},{0,8,23},
  207.83 +        {64,8,0},{19,7,51},{0,8,119},{0,8,55},{0,9,207},{17,7,15},{0,8,103},
  207.84 +        {0,8,39},{0,9,175},{0,8,7},{0,8,135},{0,8,71},{0,9,239},{16,7,9},
  207.85 +        {0,8,95},{0,8,31},{0,9,159},{20,7,99},{0,8,127},{0,8,63},{0,9,223},
  207.86 +        {18,7,27},{0,8,111},{0,8,47},{0,9,191},{0,8,15},{0,8,143},{0,8,79},
  207.87 +        {0,9,255}
  207.88 +    };
  207.89 +
  207.90 +    static const code distfix[32] = {
  207.91 +        {16,5,1},{23,5,257},{19,5,17},{27,5,4097},{17,5,5},{25,5,1025},
  207.92 +        {21,5,65},{29,5,16385},{16,5,3},{24,5,513},{20,5,33},{28,5,8193},
  207.93 +        {18,5,9},{26,5,2049},{22,5,129},{64,5,0},{16,5,2},{23,5,385},
  207.94 +        {19,5,25},{27,5,6145},{17,5,7},{25,5,1537},{21,5,97},{29,5,24577},
  207.95 +        {16,5,4},{24,5,769},{20,5,49},{28,5,12289},{18,5,13},{26,5,3073},
  207.96 +        {22,5,193},{64,5,0}
  207.97 +    };
   208.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   208.2 +++ b/libs/zlib/inflate.c	Sun Nov 01 00:36:56 2015 +0200
   208.3 @@ -0,0 +1,1368 @@
   208.4 +/* inflate.c -- zlib decompression
   208.5 + * Copyright (C) 1995-2005 Mark Adler
   208.6 + * For conditions of distribution and use, see copyright notice in zlib.h
   208.7 + */
   208.8 +
   208.9 +/*
  208.10 + * Change history:
  208.11 + *
  208.12 + * 1.2.beta0    24 Nov 2002
  208.13 + * - First version -- complete rewrite of inflate to simplify code, avoid
  208.14 + *   creation of window when not needed, minimize use of window when it is
  208.15 + *   needed, make inffast.c even faster, implement gzip decoding, and to
  208.16 + *   improve code readability and style over the previous zlib inflate code
  208.17 + *
  208.18 + * 1.2.beta1    25 Nov 2002
  208.19 + * - Use pointers for available input and output checking in inffast.c
  208.20 + * - Remove input and output counters in inffast.c
  208.21 + * - Change inffast.c entry and loop from avail_in >= 7 to >= 6
  208.22 + * - Remove unnecessary second byte pull from length extra in inffast.c
  208.23 + * - Unroll direct copy to three copies per loop in inffast.c
  208.24 + *
  208.25 + * 1.2.beta2    4 Dec 2002
  208.26 + * - Change external routine names to reduce potential conflicts
  208.27 + * - Correct filename to inffixed.h for fixed tables in inflate.c
  208.28 + * - Make hbuf[] unsigned char to match parameter type in inflate.c
  208.29 + * - Change strm->next_out[-state->offset] to *(strm->next_out - state->offset)
  208.30 + *   to avoid negation problem on Alphas (64 bit) in inflate.c
  208.31 + *
  208.32 + * 1.2.beta3    22 Dec 2002
  208.33 + * - Add comments on state->bits assertion in inffast.c
  208.34 + * - Add comments on op field in inftrees.h
  208.35 + * - Fix bug in reuse of allocated window after inflateReset()
  208.36 + * - Remove bit fields--back to byte structure for speed
  208.37 + * - Remove distance extra == 0 check in inflate_fast()--only helps for lengths
  208.38 + * - Change post-increments to pre-increments in inflate_fast(), PPC biased?
  208.39 + * - Add compile time option, POSTINC, to use post-increments instead (Intel?)
  208.40 + * - Make MATCH copy in inflate() much faster for when inflate_fast() not used
  208.41 + * - Use local copies of stream next and avail values, as well as local bit
  208.42 + *   buffer and bit count in inflate()--for speed when inflate_fast() not used
  208.43 + *
  208.44 + * 1.2.beta4    1 Jan 2003
  208.45 + * - Split ptr - 257 statements in inflate_table() to avoid compiler warnings
  208.46 + * - Move a comment on output buffer sizes from inffast.c to inflate.c
  208.47 + * - Add comments in inffast.c to introduce the inflate_fast() routine
  208.48 + * - Rearrange window copies in inflate_fast() for speed and simplification
  208.49 + * - Unroll last copy for window match in inflate_fast()
  208.50 + * - Use local copies of window variables in inflate_fast() for speed
  208.51 + * - Pull out common write == 0 case for speed in inflate_fast()
  208.52 + * - Make op and len in inflate_fast() unsigned for consistency
  208.53 + * - Add FAR to lcode and dcode declarations in inflate_fast()
  208.54 + * - Simplified bad distance check in inflate_fast()
  208.55 + * - Added inflateBackInit(), inflateBack(), and inflateBackEnd() in new
  208.56 + *   source file infback.c to provide a call-back interface to inflate for
  208.57 + *   programs like gzip and unzip -- uses window as output buffer to avoid
  208.58 + *   window copying
  208.59 + *
  208.60 + * 1.2.beta5    1 Jan 2003
  208.61 + * - Improved inflateBack() interface to allow the caller to provide initial
  208.62 + *   input in strm.
  208.63 + * - Fixed stored blocks bug in inflateBack()
  208.64 + *
  208.65 + * 1.2.beta6    4 Jan 2003
  208.66 + * - Added comments in inffast.c on effectiveness of POSTINC
  208.67 + * - Typecasting all around to reduce compiler warnings
  208.68 + * - Changed loops from while (1) or do {} while (1) to for (;;), again to
  208.69 + *   make compilers happy
  208.70 + * - Changed type of window in inflateBackInit() to unsigned char *
  208.71 + *
  208.72 + * 1.2.beta7    27 Jan 2003
  208.73 + * - Changed many types to unsigned or unsigned short to avoid warnings
  208.74 + * - Added inflateCopy() function
  208.75 + *
  208.76 + * 1.2.0        9 Mar 2003
  208.77 + * - Changed inflateBack() interface to provide separate opaque descriptors
  208.78 + *   for the in() and out() functions
  208.79 + * - Changed inflateBack() argument and in_func typedef to swap the length
  208.80 + *   and buffer address return values for the input function
  208.81 + * - Check next_in and next_out for Z_NULL on entry to inflate()
  208.82 + *
  208.83 + * The history for versions after 1.2.0 are in ChangeLog in zlib distribution.
  208.84 + */
  208.85 +
  208.86 +#include "zutil.h"
  208.87 +#include "inftrees.h"
  208.88 +#include "inflate.h"
  208.89 +#include "inffast.h"
  208.90 +
  208.91 +#ifdef MAKEFIXED
  208.92 +#  ifndef BUILDFIXED
  208.93 +#    define BUILDFIXED
  208.94 +#  endif
  208.95 +#endif
  208.96 +
  208.97 +/* function prototypes */
  208.98 +local void fixedtables OF((struct inflate_state FAR *state));
  208.99 +local int updatewindow OF((z_streamp strm, unsigned out));
 208.100 +#ifdef BUILDFIXED
 208.101 +   void makefixed OF((void));
 208.102 +#endif
 208.103 +local unsigned syncsearch OF((unsigned FAR *have, unsigned char FAR *buf,
 208.104 +                              unsigned len));
 208.105 +
 208.106 +int ZEXPORT inflateReset(strm)
 208.107 +z_streamp strm;
 208.108 +{
 208.109 +    struct inflate_state FAR *state;
 208.110 +
 208.111 +    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
 208.112 +    state = (struct inflate_state FAR *)strm->state;
 208.113 +    strm->total_in = strm->total_out = state->total = 0;
 208.114 +    strm->msg = Z_NULL;
 208.115 +    strm->adler = 1;        /* to support ill-conceived Java test suite */
 208.116 +    state->mode = HEAD;
 208.117 +    state->last = 0;
 208.118 +    state->havedict = 0;
 208.119 +    state->dmax = 32768U;
 208.120 +    state->head = Z_NULL;
 208.121 +    state->wsize = 0;
 208.122 +    state->whave = 0;
 208.123 +    state->write = 0;
 208.124 +    state->hold = 0;
 208.125 +    state->bits = 0;
 208.126 +    state->lencode = state->distcode = state->next = state->codes;
 208.127 +    Tracev((stderr, "inflate: reset\n"));
 208.128 +    return Z_OK;
 208.129 +}
 208.130 +
 208.131 +int ZEXPORT inflatePrime(strm, bits, value)
 208.132 +z_streamp strm;
 208.133 +int bits;
 208.134 +int value;
 208.135 +{
 208.136 +    struct inflate_state FAR *state;
 208.137 +
 208.138 +    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
 208.139 +    state = (struct inflate_state FAR *)strm->state;
 208.140 +    if (bits > 16 || state->bits + bits > 32) return Z_STREAM_ERROR;
 208.141 +    value &= (1L << bits) - 1;
 208.142 +    state->hold += value << state->bits;
 208.143 +    state->bits += bits;
 208.144 +    return Z_OK;
 208.145 +}
 208.146 +
 208.147 +int ZEXPORT inflateInit2_(strm, windowBits, version, stream_size)
 208.148 +z_streamp strm;
 208.149 +int windowBits;
 208.150 +const char *version;
 208.151 +int stream_size;
 208.152 +{
 208.153 +    struct inflate_state FAR *state;
 208.154 +
 208.155 +    if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
 208.156 +        stream_size != (int)(sizeof(z_stream)))
 208.157 +        return Z_VERSION_ERROR;
 208.158 +    if (strm == Z_NULL) return Z_STREAM_ERROR;
 208.159 +    strm->msg = Z_NULL;                 /* in case we return an error */
 208.160 +    if (strm->zalloc == (alloc_func)0) {
 208.161 +        strm->zalloc = zcalloc;
 208.162 +        strm->opaque = (voidpf)0;
 208.163 +    }
 208.164 +    if (strm->zfree == (free_func)0) strm->zfree = zcfree;
 208.165 +    state = (struct inflate_state FAR *)
 208.166 +            ZALLOC(strm, 1, sizeof(struct inflate_state));
 208.167 +    if (state == Z_NULL) return Z_MEM_ERROR;
 208.168 +    Tracev((stderr, "inflate: allocated\n"));
 208.169 +    strm->state = (struct internal_state FAR *)state;
 208.170 +    if (windowBits < 0) {
 208.171 +        state->wrap = 0;
 208.172 +        windowBits = -windowBits;
 208.173 +    }
 208.174 +    else {
 208.175 +        state->wrap = (windowBits >> 4) + 1;
 208.176 +#ifdef GUNZIP
 208.177 +        if (windowBits < 48) windowBits &= 15;
 208.178 +#endif
 208.179 +    }
 208.180 +    if (windowBits < 8 || windowBits > 15) {
 208.181 +        ZFREE(strm, state);
 208.182 +        strm->state = Z_NULL;
 208.183 +        return Z_STREAM_ERROR;
 208.184 +    }
 208.185 +    state->wbits = (unsigned)windowBits;
 208.186 +    state->window = Z_NULL;
 208.187 +    return inflateReset(strm);
 208.188 +}
 208.189 +
 208.190 +int ZEXPORT inflateInit_(strm, version, stream_size)
 208.191 +z_streamp strm;
 208.192 +const char *version;
 208.193 +int stream_size;
 208.194 +{
 208.195 +    return inflateInit2_(strm, DEF_WBITS, version, stream_size);
 208.196 +}
 208.197 +
 208.198 +/*
 208.199 +   Return state with length and distance decoding tables and index sizes set to
 208.200 +   fixed code decoding.  Normally this returns fixed tables from inffixed.h.
 208.201 +   If BUILDFIXED is defined, then instead this routine builds the tables the
 208.202 +   first time it's called, and returns those tables the first time and
 208.203 +   thereafter.  This reduces the size of the code by about 2K bytes, in
 208.204 +   exchange for a little execution time.  However, BUILDFIXED should not be
 208.205 +   used for threaded applications, since the rewriting of the tables and virgin
 208.206 +   may not be thread-safe.
 208.207 + */
 208.208 +local void fixedtables(state)
 208.209 +struct inflate_state FAR *state;
 208.210 +{
 208.211 +#ifdef BUILDFIXED
 208.212 +    static int virgin = 1;
 208.213 +    static code *lenfix, *distfix;
 208.214 +    static code fixed[544];
 208.215 +
 208.216 +    /* build fixed huffman tables if first call (may not be thread safe) */
 208.217 +    if (virgin) {
 208.218 +        unsigned sym, bits;
 208.219 +        static code *next;
 208.220 +
 208.221 +        /* literal/length table */
 208.222 +        sym = 0;
 208.223 +        while (sym < 144) state->lens[sym++] = 8;
 208.224 +        while (sym < 256) state->lens[sym++] = 9;
 208.225 +        while (sym < 280) state->lens[sym++] = 7;
 208.226 +        while (sym < 288) state->lens[sym++] = 8;
 208.227 +        next = fixed;
 208.228 +        lenfix = next;
 208.229 +        bits = 9;
 208.230 +        inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work);
 208.231 +
 208.232 +        /* distance table */
 208.233 +        sym = 0;
 208.234 +        while (sym < 32) state->lens[sym++] = 5;
 208.235 +        distfix = next;
 208.236 +        bits = 5;
 208.237 +        inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work);
 208.238 +
 208.239 +        /* do this just once */
 208.240 +        virgin = 0;
 208.241 +    }
 208.242 +#else /* !BUILDFIXED */
 208.243 +#   include "inffixed.h"
 208.244 +#endif /* BUILDFIXED */
 208.245 +    state->lencode = lenfix;
 208.246 +    state->lenbits = 9;
 208.247 +    state->distcode = distfix;
 208.248 +    state->distbits = 5;
 208.249 +}
 208.250 +
 208.251 +#ifdef MAKEFIXED
 208.252 +#include <stdio.h>
 208.253 +
 208.254 +/*
 208.255 +   Write out the inffixed.h that is #include'd above.  Defining MAKEFIXED also
 208.256 +   defines BUILDFIXED, so the tables are built on the fly.  makefixed() writes
 208.257 +   those tables to stdout, which would be piped to inffixed.h.  A small program
 208.258 +   can simply call makefixed to do this:
 208.259 +
 208.260 +    void makefixed(void);
 208.261 +
 208.262 +    int main(void)
 208.263 +    {
 208.264 +        makefixed();
 208.265 +        return 0;
 208.266 +    }
 208.267 +
 208.268 +   Then that can be linked with zlib built with MAKEFIXED defined and run:
 208.269 +
 208.270 +    a.out > inffixed.h
 208.271 + */
 208.272 +void makefixed()
 208.273 +{
 208.274 +    unsigned low, size;
 208.275 +    struct inflate_state state;
 208.276 +
 208.277 +    fixedtables(&state);
 208.278 +    puts("    /* inffixed.h -- table for decoding fixed codes");
 208.279 +    puts("     * Generated automatically by makefixed().");
 208.280 +    puts("     */");
 208.281 +    puts("");
 208.282 +    puts("    /* WARNING: this file should *not* be used by applications.");
 208.283 +    puts("       It is part of the implementation of this library and is");
 208.284 +    puts("       subject to change. Applications should only use zlib.h.");
 208.285 +    puts("     */");
 208.286 +    puts("");
 208.287 +    size = 1U << 9;
 208.288 +    printf("    static const code lenfix[%u] = {", size);
 208.289 +    low = 0;
 208.290 +    for (;;) {
 208.291 +        if ((low % 7) == 0) printf("\n        ");
 208.292 +        printf("{%u,%u,%d}", state.lencode[low].op, state.lencode[low].bits,
 208.293 +               state.lencode[low].val);
 208.294 +        if (++low == size) break;
 208.295 +        putchar(',');
 208.296 +    }
 208.297 +    puts("\n    };");
 208.298 +    size = 1U << 5;
 208.299 +    printf("\n    static const code distfix[%u] = {", size);
 208.300 +    low = 0;
 208.301 +    for (;;) {
 208.302 +        if ((low % 6) == 0) printf("\n        ");
 208.303 +        printf("{%u,%u,%d}", state.distcode[low].op, state.distcode[low].bits,
 208.304 +               state.distcode[low].val);
 208.305 +        if (++low == size) break;
 208.306 +        putchar(',');
 208.307 +    }
 208.308 +    puts("\n    };");
 208.309 +}
 208.310 +#endif /* MAKEFIXED */
 208.311 +
 208.312 +/*
 208.313 +   Update the window with the last wsize (normally 32K) bytes written before
 208.314 +   returning.  If window does not exist yet, create it.  This is only called
 208.315 +   when a window is already in use, or when output has been written during this
 208.316 +   inflate call, but the end of the deflate stream has not been reached yet.
 208.317 +   It is also called to create a window for dictionary data when a dictionary
 208.318 +   is loaded.
 208.319 +
 208.320 +   Providing output buffers larger than 32K to inflate() should provide a speed
 208.321 +   advantage, since only the last 32K of output is copied to the sliding window
 208.322 +   upon return from inflate(), and since all distances after the first 32K of
 208.323 +   output will fall in the output data, making match copies simpler and faster.
 208.324 +   The advantage may be dependent on the size of the processor's data caches.
 208.325 + */
 208.326 +local int updatewindow(strm, out)
 208.327 +z_streamp strm;
 208.328 +unsigned out;
 208.329 +{
 208.330 +    struct inflate_state FAR *state;
 208.331 +    unsigned copy, dist;
 208.332 +
 208.333 +    state = (struct inflate_state FAR *)strm->state;
 208.334 +
 208.335 +    /* if it hasn't been done already, allocate space for the window */
 208.336 +    if (state->window == Z_NULL) {
 208.337 +        state->window = (unsigned char FAR *)
 208.338 +                        ZALLOC(strm, 1U << state->wbits,
 208.339 +                               sizeof(unsigned char));
 208.340 +        if (state->window == Z_NULL) return 1;
 208.341 +    }
 208.342 +
 208.343 +    /* if window not in use yet, initialize */
 208.344 +    if (state->wsize == 0) {
 208.345 +        state->wsize = 1U << state->wbits;
 208.346 +        state->write = 0;
 208.347 +        state->whave = 0;
 208.348 +    }
 208.349 +
 208.350 +    /* copy state->wsize or less output bytes into the circular window */
 208.351 +    copy = out - strm->avail_out;
 208.352 +    if (copy >= state->wsize) {
 208.353 +        zmemcpy(state->window, strm->next_out - state->wsize, state->wsize);
 208.354 +        state->write = 0;
 208.355 +        state->whave = state->wsize;
 208.356 +    }
 208.357 +    else {
 208.358 +        dist = state->wsize - state->write;
 208.359 +        if (dist > copy) dist = copy;
 208.360 +        zmemcpy(state->window + state->write, strm->next_out - copy, dist);
 208.361 +        copy -= dist;
 208.362 +        if (copy) {
 208.363 +            zmemcpy(state->window, strm->next_out - copy, copy);
 208.364 +            state->write = copy;
 208.365 +            state->whave = state->wsize;
 208.366 +        }
 208.367 +        else {
 208.368 +            state->write += dist;
 208.369 +            if (state->write == state->wsize) state->write = 0;
 208.370 +            if (state->whave < state->wsize) state->whave += dist;
 208.371 +        }
 208.372 +    }
 208.373 +    return 0;
 208.374 +}
 208.375 +
 208.376 +/* Macros for inflate(): */
 208.377 +
 208.378 +/* check function to use adler32() for zlib or crc32() for gzip */
 208.379 +#ifdef GUNZIP
 208.380 +#  define UPDATE(check, buf, len) \
 208.381 +    (state->flags ? crc32(check, buf, len) : adler32(check, buf, len))
 208.382 +#else
 208.383 +#  define UPDATE(check, buf, len) adler32(check, buf, len)
 208.384 +#endif
 208.385 +
 208.386 +/* check macros for header crc */
 208.387 +#ifdef GUNZIP
 208.388 +#  define CRC2(check, word) \
 208.389 +    do { \
 208.390 +        hbuf[0] = (unsigned char)(word); \
 208.391 +        hbuf[1] = (unsigned char)((word) >> 8); \
 208.392 +        check = crc32(check, hbuf, 2); \
 208.393 +    } while (0)
 208.394 +
 208.395 +#  define CRC4(check, word) \
 208.396 +    do { \
 208.397 +        hbuf[0] = (unsigned char)(word); \
 208.398 +        hbuf[1] = (unsigned char)((word) >> 8); \
 208.399 +        hbuf[2] = (unsigned char)((word) >> 16); \
 208.400 +        hbuf[3] = (unsigned char)((word) >> 24); \
 208.401 +        check = crc32(check, hbuf, 4); \
 208.402 +    } while (0)
 208.403 +#endif
 208.404 +
 208.405 +/* Load registers with state in inflate() for speed */
 208.406 +#define LOAD() \
 208.407 +    do { \
 208.408 +        put = strm->next_out; \
 208.409 +        left = strm->avail_out; \
 208.410 +        next = strm->next_in; \
 208.411 +        have = strm->avail_in; \
 208.412 +        hold = state->hold; \
 208.413 +        bits = state->bits; \
 208.414 +    } while (0)
 208.415 +
 208.416 +/* Restore state from registers in inflate() */
 208.417 +#define RESTORE() \
 208.418 +    do { \
 208.419 +        strm->next_out = put; \
 208.420 +        strm->avail_out = left; \
 208.421 +        strm->next_in = next; \
 208.422 +        strm->avail_in = have; \
 208.423 +        state->hold = hold; \
 208.424 +        state->bits = bits; \
 208.425 +    } while (0)
 208.426 +
 208.427 +/* Clear the input bit accumulator */
 208.428 +#define INITBITS() \
 208.429 +    do { \
 208.430 +        hold = 0; \
 208.431 +        bits = 0; \
 208.432 +    } while (0)
 208.433 +
 208.434 +/* Get a byte of input into the bit accumulator, or return from inflate()
 208.435 +   if there is no input available. */
 208.436 +#define PULLBYTE() \
 208.437 +    do { \
 208.438 +        if (have == 0) goto inf_leave; \
 208.439 +        have--; \
 208.440 +        hold += (unsigned long)(*next++) << bits; \
 208.441 +        bits += 8; \
 208.442 +    } while (0)
 208.443 +
 208.444 +/* Assure that there are at least n bits in the bit accumulator.  If there is
 208.445 +   not enough available input to do that, then return from inflate(). */
 208.446 +#define NEEDBITS(n) \
 208.447 +    do { \
 208.448 +        while (bits < (unsigned)(n)) \
 208.449 +            PULLBYTE(); \
 208.450 +    } while (0)
 208.451 +
 208.452 +/* Return the low n bits of the bit accumulator (n < 16) */
 208.453 +#define BITS(n) \
 208.454 +    ((unsigned)hold & ((1U << (n)) - 1))
 208.455 +
 208.456 +/* Remove n bits from the bit accumulator */
 208.457 +#define DROPBITS(n) \
 208.458 +    do { \
 208.459 +        hold >>= (n); \
 208.460 +        bits -= (unsigned)(n); \
 208.461 +    } while (0)
 208.462 +
 208.463 +/* Remove zero to seven bits as needed to go to a byte boundary */
 208.464 +#define BYTEBITS() \
 208.465 +    do { \
 208.466 +        hold >>= bits & 7; \
 208.467 +        bits -= bits & 7; \
 208.468 +    } while (0)
 208.469 +
 208.470 +/* Reverse the bytes in a 32-bit value */
 208.471 +#define REVERSE(q) \
 208.472 +    ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \
 208.473 +     (((q) & 0xff00) << 8) + (((q) & 0xff) << 24))
 208.474 +
 208.475 +/*
 208.476 +   inflate() uses a state machine to process as much input data and generate as
 208.477 +   much output data as possible before returning.  The state machine is
 208.478 +   structured roughly as follows:
 208.479 +
 208.480 +    for (;;) switch (state) {
 208.481 +    ...
 208.482 +    case STATEn:
 208.483 +        if (not enough input data or output space to make progress)
 208.484 +            return;
 208.485 +        ... make progress ...
 208.486 +        state = STATEm;
 208.487 +        break;
 208.488 +    ...
 208.489 +    }
 208.490 +
 208.491 +   so when inflate() is called again, the same case is attempted again, and
 208.492 +   if the appropriate resources are provided, the machine proceeds to the
 208.493 +   next state.  The NEEDBITS() macro is usually the way the state evaluates
 208.494 +   whether it can proceed or should return.  NEEDBITS() does the return if
 208.495 +   the requested bits are not available.  The typical use of the BITS macros
 208.496 +   is:
 208.497 +
 208.498 +        NEEDBITS(n);
 208.499 +        ... do something with BITS(n) ...
 208.500 +        DROPBITS(n);
 208.501 +
 208.502 +   where NEEDBITS(n) either returns from inflate() if there isn't enough
 208.503 +   input left to load n bits into the accumulator, or it continues.  BITS(n)
 208.504 +   gives the low n bits in the accumulator.  When done, DROPBITS(n) drops
 208.505 +   the low n bits off the accumulator.  INITBITS() clears the accumulator
 208.506 +   and sets the number of available bits to zero.  BYTEBITS() discards just
 208.507 +   enough bits to put the accumulator on a byte boundary.  After BYTEBITS()
 208.508 +   and a NEEDBITS(8), then BITS(8) would return the next byte in the stream.
 208.509 +
 208.510 +   NEEDBITS(n) uses PULLBYTE() to get an available byte of input, or to return
 208.511 +   if there is no input available.  The decoding of variable length codes uses
 208.512 +   PULLBYTE() directly in order to pull just enough bytes to decode the next
 208.513 +   code, and no more.
 208.514 +
 208.515 +   Some states loop until they get enough input, making sure that enough
 208.516 +   state information is maintained to continue the loop where it left off
 208.517 +   if NEEDBITS() returns in the loop.  For example, want, need, and keep
 208.518 +   would all have to actually be part of the saved state in case NEEDBITS()
 208.519 +   returns:
 208.520 +
 208.521 +    case STATEw:
 208.522 +        while (want < need) {
 208.523 +            NEEDBITS(n);
 208.524 +            keep[want++] = BITS(n);
 208.525 +            DROPBITS(n);
 208.526 +        }
 208.527 +        state = STATEx;
 208.528 +    case STATEx:
 208.529 +
 208.530 +   As shown above, if the next state is also the next case, then the break
 208.531 +   is omitted.
 208.532 +
 208.533 +   A state may also return if there is not enough output space available to
 208.534 +   complete that state.  Those states are copying stored data, writing a
 208.535 +   literal byte, and copying a matching string.
 208.536 +
 208.537 +   When returning, a "goto inf_leave" is used to update the total counters,
 208.538 +   update the check value, and determine whether any progress has been made
 208.539 +   during that inflate() call in order to return the proper return code.
 208.540 +   Progress is defined as a change in either strm->avail_in or strm->avail_out.
 208.541 +   When there is a window, goto inf_leave will update the window with the last
 208.542 +   output written.  If a goto inf_leave occurs in the middle of decompression
 208.543 +   and there is no window currently, goto inf_leave will create one and copy
 208.544 +   output to the window for the next call of inflate().
 208.545 +
 208.546 +   In this implementation, the flush parameter of inflate() only affects the
 208.547 +   return code (per zlib.h).  inflate() always writes as much as possible to
 208.548 +   strm->next_out, given the space available and the provided input--the effect
 208.549 +   documented in zlib.h of Z_SYNC_FLUSH.  Furthermore, inflate() always defers
 208.550 +   the allocation of and copying into a sliding window until necessary, which
 208.551 +   provides the effect documented in zlib.h for Z_FINISH when the entire input
 208.552 +   stream available.  So the only thing the flush parameter actually does is:
 208.553 +   when flush is set to Z_FINISH, inflate() cannot return Z_OK.  Instead it
 208.554 +   will return Z_BUF_ERROR if it has not reached the end of the stream.
 208.555 + */
 208.556 +
 208.557 +int ZEXPORT inflate(strm, flush)
 208.558 +z_streamp strm;
 208.559 +int flush;
 208.560 +{
 208.561 +    struct inflate_state FAR *state;
 208.562 +    unsigned char FAR *next;    /* next input */
 208.563 +    unsigned char FAR *put;     /* next output */
 208.564 +    unsigned have, left;        /* available input and output */
 208.565 +    unsigned long hold;         /* bit buffer */
 208.566 +    unsigned bits;              /* bits in bit buffer */
 208.567 +    unsigned in, out;           /* save starting available input and output */
 208.568 +    unsigned copy;              /* number of stored or match bytes to copy */
 208.569 +    unsigned char FAR *from;    /* where to copy match bytes from */
 208.570 +    code this;                  /* current decoding table entry */
 208.571 +    code last;                  /* parent table entry */
 208.572 +    unsigned len;               /* length to copy for repeats, bits to drop */
 208.573 +    int ret;                    /* return code */
 208.574 +#ifdef GUNZIP
 208.575 +    unsigned char hbuf[4];      /* buffer for gzip header crc calculation */
 208.576 +#endif
 208.577 +    static const unsigned short order[19] = /* permutation of code lengths */
 208.578 +        {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
 208.579 +
 208.580 +    if (strm == Z_NULL || strm->state == Z_NULL || strm->next_out == Z_NULL ||
 208.581 +        (strm->next_in == Z_NULL && strm->avail_in != 0))
 208.582 +        return Z_STREAM_ERROR;
 208.583 +
 208.584 +    state = (struct inflate_state FAR *)strm->state;
 208.585 +    if (state->mode == TYPE) state->mode = TYPEDO;      /* skip check */
 208.586 +    LOAD();
 208.587 +    in = have;
 208.588 +    out = left;
 208.589 +    ret = Z_OK;
 208.590 +    for (;;)
 208.591 +        switch (state->mode) {
 208.592 +        case HEAD:
 208.593 +            if (state->wrap == 0) {
 208.594 +                state->mode = TYPEDO;
 208.595 +                break;
 208.596 +            }
 208.597 +            NEEDBITS(16);
 208.598 +#ifdef GUNZIP
 208.599 +            if ((state->wrap & 2) && hold == 0x8b1f) {  /* gzip header */
 208.600 +                state->check = crc32(0L, Z_NULL, 0);
 208.601 +                CRC2(state->check, hold);
 208.602 +                INITBITS();
 208.603 +                state->mode = FLAGS;
 208.604 +                break;
 208.605 +            }
 208.606 +            state->flags = 0;           /* expect zlib header */
 208.607 +            if (state->head != Z_NULL)
 208.608 +                state->head->done = -1;
 208.609 +            if (!(state->wrap & 1) ||   /* check if zlib header allowed */
 208.610 +#else
 208.611 +            if (
 208.612 +#endif
 208.613 +                ((BITS(8) << 8) + (hold >> 8)) % 31) {
 208.614 +                strm->msg = (char *)"incorrect header check";
 208.615 +                state->mode = BAD;
 208.616 +                break;
 208.617 +            }
 208.618 +            if (BITS(4) != Z_DEFLATED) {
 208.619 +                strm->msg = (char *)"unknown compression method";
 208.620 +                state->mode = BAD;
 208.621 +                break;
 208.622 +            }
 208.623 +            DROPBITS(4);
 208.624 +            len = BITS(4) + 8;
 208.625 +            if (len > state->wbits) {
 208.626 +                strm->msg = (char *)"invalid window size";
 208.627 +                state->mode = BAD;
 208.628 +                break;
 208.629 +            }
 208.630 +            state->dmax = 1U << len;
 208.631 +            Tracev((stderr, "inflate:   zlib header ok\n"));
 208.632 +            strm->adler = state->check = adler32(0L, Z_NULL, 0);
 208.633 +            state->mode = hold & 0x200 ? DICTID : TYPE;
 208.634 +            INITBITS();
 208.635 +            break;
 208.636 +#ifdef GUNZIP
 208.637 +        case FLAGS:
 208.638 +            NEEDBITS(16);
 208.639 +            state->flags = (int)(hold);
 208.640 +            if ((state->flags & 0xff) != Z_DEFLATED) {
 208.641 +                strm->msg = (char *)"unknown compression method";
 208.642 +                state->mode = BAD;
 208.643 +                break;
 208.644 +            }
 208.645 +            if (state->flags & 0xe000) {
 208.646 +                strm->msg = (char *)"unknown header flags set";
 208.647 +                state->mode = BAD;
 208.648 +                break;
 208.649 +            }
 208.650 +            if (state->head != Z_NULL)
 208.651 +                state->head->text = (int)((hold >> 8) & 1);
 208.652 +            if (state->flags & 0x0200) CRC2(state->check, hold);
 208.653 +            INITBITS();
 208.654 +            state->mode = TIME;
 208.655 +        case TIME:
 208.656 +            NEEDBITS(32);
 208.657 +            if (state->head != Z_NULL)
 208.658 +                state->head->time = hold;
 208.659 +            if (state->flags & 0x0200) CRC4(state->check, hold);
 208.660 +            INITBITS();
 208.661 +            state->mode = OS;
 208.662 +        case OS:
 208.663 +            NEEDBITS(16);
 208.664 +            if (state->head != Z_NULL) {
 208.665 +                state->head->xflags = (int)(hold & 0xff);
 208.666 +                state->head->os = (int)(hold >> 8);
 208.667 +            }
 208.668 +            if (state->flags & 0x0200) CRC2(state->check, hold);
 208.669 +            INITBITS();
 208.670 +            state->mode = EXLEN;
 208.671 +        case EXLEN:
 208.672 +            if (state->flags & 0x0400) {
 208.673 +                NEEDBITS(16);
 208.674 +                state->length = (unsigned)(hold);
 208.675 +                if (state->head != Z_NULL)
 208.676 +                    state->head->extra_len = (unsigned)hold;
 208.677 +                if (state->flags & 0x0200) CRC2(state->check, hold);
 208.678 +                INITBITS();
 208.679 +            }
 208.680 +            else if (state->head != Z_NULL)
 208.681 +                state->head->extra = Z_NULL;
 208.682 +            state->mode = EXTRA;
 208.683 +        case EXTRA:
 208.684 +            if (state->flags & 0x0400) {
 208.685 +                copy = state->length;
 208.686 +                if (copy > have) copy = have;
 208.687 +                if (copy) {
 208.688 +                    if (state->head != Z_NULL &&
 208.689 +                        state->head->extra != Z_NULL) {
 208.690 +                        len = state->head->extra_len - state->length;
 208.691 +                        zmemcpy(state->head->extra + len, next,
 208.692 +                                len + copy > state->head->extra_max ?
 208.693 +                                state->head->extra_max - len : copy);
 208.694 +                    }
 208.695 +                    if (state->flags & 0x0200)
 208.696 +                        state->check = crc32(state->check, next, copy);
 208.697 +                    have -= copy;
 208.698 +                    next += copy;
 208.699 +                    state->length -= copy;
 208.700 +                }
 208.701 +                if (state->length) goto inf_leave;
 208.702 +            }
 208.703 +            state->length = 0;
 208.704 +            state->mode = NAME;
 208.705 +        case NAME:
 208.706 +            if (state->flags & 0x0800) {
 208.707 +                if (have == 0) goto inf_leave;
 208.708 +                copy = 0;
 208.709 +                do {
 208.710 +                    len = (unsigned)(next[copy++]);
 208.711 +                    if (state->head != Z_NULL &&
 208.712 +                            state->head->name != Z_NULL &&
 208.713 +                            state->length < state->head->name_max)
 208.714 +                        state->head->name[state->length++] = len;
 208.715 +                } while (len && copy < have);
 208.716 +                if (state->flags & 0x0200)
 208.717 +                    state->check = crc32(state->check, next, copy);
 208.718 +                have -= copy;
 208.719 +                next += copy;
 208.720 +                if (len) goto inf_leave;
 208.721 +            }
 208.722 +            else if (state->head != Z_NULL)
 208.723 +                state->head->name = Z_NULL;
 208.724 +            state->length = 0;
 208.725 +            state->mode = COMMENT;
 208.726 +        case COMMENT:
 208.727 +            if (state->flags & 0x1000) {
 208.728 +                if (have == 0) goto inf_leave;
 208.729 +                copy = 0;
 208.730 +                do {
 208.731 +                    len = (unsigned)(next[copy++]);
 208.732 +                    if (state->head != Z_NULL &&
 208.733 +                            state->head->comment != Z_NULL &&
 208.734 +                            state->length < state->head->comm_max)
 208.735 +                        state->head->comment[state->length++] = len;
 208.736 +                } while (len && copy < have);
 208.737 +                if (state->flags & 0x0200)
 208.738 +                    state->check = crc32(state->check, next, copy);
 208.739 +                have -= copy;
 208.740 +                next += copy;
 208.741 +                if (len) goto inf_leave;
 208.742 +            }
 208.743 +            else if (state->head != Z_NULL)
 208.744 +                state->head->comment = Z_NULL;
 208.745 +            state->mode = HCRC;
 208.746 +        case HCRC:
 208.747 +            if (state->flags & 0x0200) {
 208.748 +                NEEDBITS(16);
 208.749 +                if (hold != (state->check & 0xffff)) {
 208.750 +                    strm->msg = (char *)"header crc mismatch";
 208.751 +                    state->mode = BAD;
 208.752 +                    break;
 208.753 +                }
 208.754 +                INITBITS();
 208.755 +            }
 208.756 +            if (state->head != Z_NULL) {
 208.757 +                state->head->hcrc = (int)((state->flags >> 9) & 1);
 208.758 +                state->head->done = 1;
 208.759 +            }
 208.760 +            strm->adler = state->check = crc32(0L, Z_NULL, 0);
 208.761 +            state->mode = TYPE;
 208.762 +            break;
 208.763 +#endif
 208.764 +        case DICTID:
 208.765 +            NEEDBITS(32);
 208.766 +            strm->adler = state->check = REVERSE(hold);
 208.767 +            INITBITS();
 208.768 +            state->mode = DICT;
 208.769 +        case DICT:
 208.770 +            if (state->havedict == 0) {
 208.771 +                RESTORE();
 208.772 +                return Z_NEED_DICT;
 208.773 +            }
 208.774 +            strm->adler = state->check = adler32(0L, Z_NULL, 0);
 208.775 +            state->mode = TYPE;
 208.776 +        case TYPE:
 208.777 +            if (flush == Z_BLOCK) goto inf_leave;
 208.778 +        case TYPEDO:
 208.779 +            if (state->last) {
 208.780 +                BYTEBITS();
 208.781 +                state->mode = CHECK;
 208.782 +                break;
 208.783 +            }
 208.784 +            NEEDBITS(3);
 208.785 +            state->last = BITS(1);
 208.786 +            DROPBITS(1);
 208.787 +            switch (BITS(2)) {
 208.788 +            case 0:                             /* stored block */
 208.789 +                Tracev((stderr, "inflate:     stored block%s\n",
 208.790 +                        state->last ? " (last)" : ""));
 208.791 +                state->mode = STORED;
 208.792 +                break;
 208.793 +            case 1:                             /* fixed block */
 208.794 +                fixedtables(state);
 208.795 +                Tracev((stderr, "inflate:     fixed codes block%s\n",
 208.796 +                        state->last ? " (last)" : ""));
 208.797 +                state->mode = LEN;              /* decode codes */
 208.798 +                break;
 208.799 +            case 2:                             /* dynamic block */
 208.800 +                Tracev((stderr, "inflate:     dynamic codes block%s\n",
 208.801 +                        state->last ? " (last)" : ""));
 208.802 +                state->mode = TABLE;
 208.803 +                break;
 208.804 +            case 3:
 208.805 +                strm->msg = (char *)"invalid block type";
 208.806 +                state->mode = BAD;
 208.807 +            }
 208.808 +            DROPBITS(2);
 208.809 +            break;
 208.810 +        case STORED:
 208.811 +            BYTEBITS();                         /* go to byte boundary */
 208.812 +            NEEDBITS(32);
 208.813 +            if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
 208.814 +                strm->msg = (char *)"invalid stored block lengths";
 208.815 +                state->mode = BAD;
 208.816 +                break;
 208.817 +            }
 208.818 +            state->length = (unsigned)hold & 0xffff;
 208.819 +            Tracev((stderr, "inflate:       stored length %u\n",
 208.820 +                    state->length));
 208.821 +            INITBITS();
 208.822 +            state->mode = COPY;
 208.823 +        case COPY:
 208.824 +            copy = state->length;
 208.825 +            if (copy) {
 208.826 +                if (copy > have) copy = have;
 208.827 +                if (copy > left) copy = left;
 208.828 +                if (copy == 0) goto inf_leave;
 208.829 +                zmemcpy(put, next, copy);
 208.830 +                have -= copy;
 208.831 +                next += copy;
 208.832 +                left -= copy;
 208.833 +                put += copy;
 208.834 +                state->length -= copy;
 208.835 +                break;
 208.836 +            }
 208.837 +            Tracev((stderr, "inflate:       stored end\n"));
 208.838 +            state->mode = TYPE;
 208.839 +            break;
 208.840 +        case TABLE:
 208.841 +            NEEDBITS(14);
 208.842 +            state->nlen = BITS(5) + 257;
 208.843 +            DROPBITS(5);
 208.844 +            state->ndist = BITS(5) + 1;
 208.845 +            DROPBITS(5);
 208.846 +            state->ncode = BITS(4) + 4;
 208.847 +            DROPBITS(4);
 208.848 +#ifndef PKZIP_BUG_WORKAROUND
 208.849 +            if (state->nlen > 286 || state->ndist > 30) {
 208.850 +                strm->msg = (char *)"too many length or distance symbols";
 208.851 +                state->mode = BAD;
 208.852 +                break;
 208.853 +            }
 208.854 +#endif
 208.855 +            Tracev((stderr, "inflate:       table sizes ok\n"));
 208.856 +            state->have = 0;
 208.857 +            state->mode = LENLENS;
 208.858 +        case LENLENS:
 208.859 +            while (state->have < state->ncode) {
 208.860 +                NEEDBITS(3);
 208.861 +                state->lens[order[state->have++]] = (unsigned short)BITS(3);
 208.862 +                DROPBITS(3);
 208.863 +            }
 208.864 +            while (state->have < 19)
 208.865 +                state->lens[order[state->have++]] = 0;
 208.866 +            state->next = state->codes;
 208.867 +            state->lencode = (code const FAR *)(state->next);
 208.868 +            state->lenbits = 7;
 208.869 +            ret = inflate_table(CODES, state->lens, 19, &(state->next),
 208.870 +                                &(state->lenbits), state->work);
 208.871 +            if (ret) {
 208.872 +                strm->msg = (char *)"invalid code lengths set";
 208.873 +                state->mode = BAD;
 208.874 +                break;
 208.875 +            }
 208.876 +            Tracev((stderr, "inflate:       code lengths ok\n"));
 208.877 +            state->have = 0;
 208.878 +            state->mode = CODELENS;
 208.879 +        case CODELENS:
 208.880 +            while (state->have < state->nlen + state->ndist) {
 208.881 +                for (;;) {
 208.882 +                    this = state->lencode[BITS(state->lenbits)];
 208.883 +                    if ((unsigned)(this.bits) <= bits) break;
 208.884 +                    PULLBYTE();
 208.885 +                }
 208.886 +                if (this.val < 16) {
 208.887 +                    NEEDBITS(this.bits);
 208.888 +                    DROPBITS(this.bits);
 208.889 +                    state->lens[state->have++] = this.val;
 208.890 +                }
 208.891 +                else {
 208.892 +                    if (this.val == 16) {
 208.893 +                        NEEDBITS(this.bits + 2);
 208.894 +                        DROPBITS(this.bits);
 208.895 +                        if (state->have == 0) {
 208.896 +                            strm->msg = (char *)"invalid bit length repeat";
 208.897 +                            state->mode = BAD;
 208.898 +                            break;
 208.899 +                        }
 208.900 +                        len = state->lens[state->have - 1];
 208.901 +                        copy = 3 + BITS(2);
 208.902 +                        DROPBITS(2);
 208.903 +                    }
 208.904 +                    else if (this.val == 17) {
 208.905 +                        NEEDBITS(this.bits + 3);
 208.906 +                        DROPBITS(this.bits);
 208.907 +                        len = 0;
 208.908 +                        copy = 3 + BITS(3);
 208.909 +                        DROPBITS(3);
 208.910 +                    }
 208.911 +                    else {
 208.912 +                        NEEDBITS(this.bits + 7);
 208.913 +                        DROPBITS(this.bits);
 208.914 +                        len = 0;
 208.915 +                        copy = 11 + BITS(7);
 208.916 +                        DROPBITS(7);
 208.917 +                    }
 208.918 +                    if (state->have + copy > state->nlen + state->ndist) {
 208.919 +                        strm->msg = (char *)"invalid bit length repeat";
 208.920 +                        state->mode = BAD;
 208.921 +                        break;
 208.922 +                    }
 208.923 +                    while (copy--)
 208.924 +                        state->lens[state->have++] = (unsigned short)len;
 208.925 +                }
 208.926 +            }
 208.927 +
 208.928 +            /* handle error breaks in while */
 208.929 +            if (state->mode == BAD) break;
 208.930 +
 208.931 +            /* build code tables */
 208.932 +            state->next = state->codes;
 208.933 +            state->lencode = (code const FAR *)(state->next);
 208.934 +            state->lenbits = 9;
 208.935 +            ret = inflate_table(LENS, state->lens, state->nlen, &(state->next),
 208.936 +                                &(state->lenbits), state->work);
 208.937 +            if (ret) {
 208.938 +                strm->msg = (char *)"invalid literal/lengths set";
 208.939 +                state->mode = BAD;
 208.940 +                break;
 208.941 +            }
 208.942 +            state->distcode = (code const FAR *)(state->next);
 208.943 +            state->distbits = 6;
 208.944 +            ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist,
 208.945 +                            &(state->next), &(state->distbits), state->work);
 208.946 +            if (ret) {
 208.947 +                strm->msg = (char *)"invalid distances set";
 208.948 +                state->mode = BAD;
 208.949 +                break;
 208.950 +            }
 208.951 +            Tracev((stderr, "inflate:       codes ok\n"));
 208.952 +            state->mode = LEN;
 208.953 +        case LEN:
 208.954 +            if (have >= 6 && left >= 258) {
 208.955 +                RESTORE();
 208.956 +                inflate_fast(strm, out);
 208.957 +                LOAD();
 208.958 +                break;
 208.959 +            }
 208.960 +            for (;;) {
 208.961 +                this = state->lencode[BITS(state->lenbits)];
 208.962 +                if ((unsigned)(this.bits) <= bits) break;
 208.963 +                PULLBYTE();
 208.964 +            }
 208.965 +            if (this.op && (this.op & 0xf0) == 0) {
 208.966 +                last = this;
 208.967 +                for (;;) {
 208.968 +                    this = state->lencode[last.val +
 208.969 +                            (BITS(last.bits + last.op) >> last.bits)];
 208.970 +                    if ((unsigned)(last.bits + this.bits) <= bits) break;
 208.971 +                    PULLBYTE();
 208.972 +                }
 208.973 +                DROPBITS(last.bits);
 208.974 +            }
 208.975 +            DROPBITS(this.bits);
 208.976 +            state->length = (unsigned)this.val;
 208.977 +            if ((int)(this.op) == 0) {
 208.978 +                Tracevv((stderr, this.val >= 0x20 && this.val < 0x7f ?
 208.979 +                        "inflate:         literal '%c'\n" :
 208.980 +                        "inflate:         literal 0x%02x\n", this.val));
 208.981 +                state->mode = LIT;
 208.982 +                break;
 208.983 +            }
 208.984 +            if (this.op & 32) {
 208.985 +                Tracevv((stderr, "inflate:         end of block\n"));
 208.986 +                state->mode = TYPE;
 208.987 +                break;
 208.988 +            }
 208.989 +            if (this.op & 64) {
 208.990 +                strm->msg = (char *)"invalid literal/length code";
 208.991 +                state->mode = BAD;
 208.992 +                break;
 208.993 +            }
 208.994 +            state->extra = (unsigned)(this.op) & 15;
 208.995 +            state->mode = LENEXT;
 208.996 +        case LENEXT:
 208.997 +            if (state->extra) {
 208.998 +                NEEDBITS(state->extra);
 208.999 +                state->length += BITS(state->extra);
208.1000 +                DROPBITS(state->extra);
208.1001 +            }
208.1002 +            Tracevv((stderr, "inflate:         length %u\n", state->length));
208.1003 +            state->mode = DIST;
208.1004 +        case DIST:
208.1005 +            for (;;) {
208.1006 +                this = state->distcode[BITS(state->distbits)];
208.1007 +                if ((unsigned)(this.bits) <= bits) break;
208.1008 +                PULLBYTE();
208.1009 +            }
208.1010 +            if ((this.op & 0xf0) == 0) {
208.1011 +                last = this;
208.1012 +                for (;;) {
208.1013 +                    this = state->distcode[last.val +
208.1014 +                            (BITS(last.bits + last.op) >> last.bits)];
208.1015 +                    if ((unsigned)(last.bits + this.bits) <= bits) break;
208.1016 +                    PULLBYTE();
208.1017 +                }
208.1018 +                DROPBITS(last.bits);
208.1019 +            }
208.1020 +            DROPBITS(this.bits);
208.1021 +            if (this.op & 64) {
208.1022 +                strm->msg = (char *)"invalid distance code";
208.1023 +                state->mode = BAD;
208.1024 +                break;
208.1025 +            }
208.1026 +            state->offset = (unsigned)this.val;
208.1027 +            state->extra = (unsigned)(this.op) & 15;
208.1028 +            state->mode = DISTEXT;
208.1029 +        case DISTEXT:
208.1030 +            if (state->extra) {
208.1031 +                NEEDBITS(state->extra);
208.1032 +                state->offset += BITS(state->extra);
208.1033 +                DROPBITS(state->extra);
208.1034 +            }
208.1035 +#ifdef INFLATE_STRICT
208.1036 +            if (state->offset > state->dmax) {
208.1037 +                strm->msg = (char *)"invalid distance too far back";
208.1038 +                state->mode = BAD;
208.1039 +                break;
208.1040 +            }
208.1041 +#endif
208.1042 +            if (state->offset > state->whave + out - left) {
208.1043 +                strm->msg = (char *)"invalid distance too far back";
208.1044 +                state->mode = BAD;
208.1045 +                break;
208.1046 +            }
208.1047 +            Tracevv((stderr, "inflate:         distance %u\n", state->offset));
208.1048 +            state->mode = MATCH;
208.1049 +        case MATCH:
208.1050 +            if (left == 0) goto inf_leave;
208.1051 +            copy = out - left;
208.1052 +            if (state->offset > copy) {         /* copy from window */
208.1053 +                copy = state->offset - copy;
208.1054 +                if (copy > state->write) {
208.1055 +                    copy -= state->write;
208.1056 +                    from = state->window + (state->wsize - copy);
208.1057 +                }
208.1058 +                else
208.1059 +                    from = state->window + (state->write - copy);
208.1060 +                if (copy > state->length) copy = state->length;
208.1061 +            }
208.1062 +            else {                              /* copy from output */
208.1063 +                from = put - state->offset;
208.1064 +                copy = state->length;
208.1065 +            }
208.1066 +            if (copy > left) copy = left;
208.1067 +            left -= copy;
208.1068 +            state->length -= copy;
208.1069 +            do {
208.1070 +                *put++ = *from++;
208.1071 +            } while (--copy);
208.1072 +            if (state->length == 0) state->mode = LEN;
208.1073 +            break;
208.1074 +        case LIT:
208.1075 +            if (left == 0) goto inf_leave;
208.1076 +            *put++ = (unsigned char)(state->length);
208.1077 +            left--;
208.1078 +            state->mode = LEN;
208.1079 +            break;
208.1080 +        case CHECK:
208.1081 +            if (state->wrap) {
208.1082 +                NEEDBITS(32);
208.1083 +                out -= left;
208.1084 +                strm->total_out += out;
208.1085 +                state->total += out;
208.1086 +                if (out)
208.1087 +                    strm->adler = state->check =
208.1088 +                        UPDATE(state->check, put - out, out);
208.1089 +                out = left;
208.1090 +                if ((
208.1091 +#ifdef GUNZIP
208.1092 +                     state->flags ? hold :
208.1093 +#endif
208.1094 +                     REVERSE(hold)) != state->check) {
208.1095 +                    strm->msg = (char *)"incorrect data check";
208.1096 +                    state->mode = BAD;
208.1097 +                    break;
208.1098 +                }
208.1099 +                INITBITS();
208.1100 +                Tracev((stderr, "inflate:   check matches trailer\n"));
208.1101 +            }
208.1102 +#ifdef GUNZIP
208.1103 +            state->mode = LENGTH;
208.1104 +        case LENGTH:
208.1105 +            if (state->wrap && state->flags) {
208.1106 +                NEEDBITS(32);
208.1107 +                if (hold != (state->total & 0xffffffffUL)) {
208.1108 +                    strm->msg = (char *)"incorrect length check";
208.1109 +                    state->mode = BAD;
208.1110 +                    break;
208.1111 +                }
208.1112 +                INITBITS();
208.1113 +                Tracev((stderr, "inflate:   length matches trailer\n"));
208.1114 +            }
208.1115 +#endif
208.1116 +            state->mode = DONE;
208.1117 +        case DONE:
208.1118 +            ret = Z_STREAM_END;
208.1119 +            goto inf_leave;
208.1120 +        case BAD:
208.1121 +            ret = Z_DATA_ERROR;
208.1122 +            goto inf_leave;
208.1123 +        case MEM:
208.1124 +            return Z_MEM_ERROR;
208.1125 +        case SYNC:
208.1126 +        default:
208.1127 +            return Z_STREAM_ERROR;
208.1128 +        }
208.1129 +
208.1130 +    /*
208.1131 +       Return from inflate(), updating the total counts and the check value.
208.1132 +       If there was no progress during the inflate() call, return a buffer
208.1133 +       error.  Call updatewindow() to create and/or update the window state.
208.1134 +       Note: a memory error from inflate() is non-recoverable.
208.1135 +     */
208.1136 +  inf_leave:
208.1137 +    RESTORE();
208.1138 +    if (state->wsize || (state->mode < CHECK && out != strm->avail_out))
208.1139 +        if (updatewindow(strm, out)) {
208.1140 +            state->mode = MEM;
208.1141 +            return Z_MEM_ERROR;
208.1142 +        }
208.1143 +    in -= strm->avail_in;
208.1144 +    out -= strm->avail_out;
208.1145 +    strm->total_in += in;
208.1146 +    strm->total_out += out;
208.1147 +    state->total += out;
208.1148 +    if (state->wrap && out)
208.1149 +        strm->adler = state->check =
208.1150 +            UPDATE(state->check, strm->next_out - out, out);
208.1151 +    strm->data_type = state->bits + (state->last ? 64 : 0) +
208.1152 +                      (state->mode == TYPE ? 128 : 0);
208.1153 +    if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK)
208.1154 +        ret = Z_BUF_ERROR;
208.1155 +    return ret;
208.1156 +}
208.1157 +
208.1158 +int ZEXPORT inflateEnd(strm)
208.1159 +z_streamp strm;
208.1160 +{
208.1161 +    struct inflate_state FAR *state;
208.1162 +    if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0)
208.1163 +        return Z_STREAM_ERROR;
208.1164 +    state = (struct inflate_state FAR *)strm->state;
208.1165 +    if (state->window != Z_NULL) ZFREE(strm, state->window);
208.1166 +    ZFREE(strm, strm->state);
208.1167 +    strm->state = Z_NULL;
208.1168 +    Tracev((stderr, "inflate: end\n"));
208.1169 +    return Z_OK;
208.1170 +}
208.1171 +
208.1172 +int ZEXPORT inflateSetDictionary(strm, dictionary, dictLength)
208.1173 +z_streamp strm;
208.1174 +const Bytef *dictionary;
208.1175 +uInt dictLength;
208.1176 +{
208.1177 +    struct inflate_state FAR *state;
208.1178 +    unsigned long id;
208.1179 +
208.1180 +    /* check state */
208.1181 +    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
208.1182 +    state = (struct inflate_state FAR *)strm->state;
208.1183 +    if (state->wrap != 0 && state->mode != DICT)
208.1184 +        return Z_STREAM_ERROR;
208.1185 +
208.1186 +    /* check for correct dictionary id */
208.1187 +    if (state->mode == DICT) {
208.1188 +        id = adler32(0L, Z_NULL, 0);
208.1189 +        id = adler32(id, dictionary, dictLength);
208.1190 +        if (id != state->check)
208.1191 +            return Z_DATA_ERROR;
208.1192 +    }
208.1193 +
208.1194 +    /* copy dictionary to window */
208.1195 +    if (updatewindow(strm, strm->avail_out)) {
208.1196 +        state->mode = MEM;
208.1197 +        return Z_MEM_ERROR;
208.1198 +    }
208.1199 +    if (dictLength > state->wsize) {
208.1200 +        zmemcpy(state->window, dictionary + dictLength - state->wsize,
208.1201 +                state->wsize);
208.1202 +        state->whave = state->wsize;
208.1203 +    }
208.1204 +    else {
208.1205 +        zmemcpy(state->window + state->wsize - dictLength, dictionary,
208.1206 +                dictLength);
208.1207 +        state->whave = dictLength;
208.1208 +    }
208.1209 +    state->havedict = 1;
208.1210 +    Tracev((stderr, "inflate:   dictionary set\n"));
208.1211 +    return Z_OK;
208.1212 +}
208.1213 +
208.1214 +int ZEXPORT inflateGetHeader(strm, head)
208.1215 +z_streamp strm;
208.1216 +gz_headerp head;
208.1217 +{
208.1218 +    struct inflate_state FAR *state;
208.1219 +
208.1220 +    /* check state */
208.1221 +    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
208.1222 +    state = (struct inflate_state FAR *)strm->state;
208.1223 +    if ((state->wrap & 2) == 0) return Z_STREAM_ERROR;
208.1224 +
208.1225 +    /* save header structure */
208.1226 +    state->head = head;
208.1227 +    head->done = 0;
208.1228 +    return Z_OK;
208.1229 +}
208.1230 +
208.1231 +/*
208.1232 +   Search buf[0..len-1] for the pattern: 0, 0, 0xff, 0xff.  Return when found
208.1233 +   or when out of input.  When called, *have is the number of pattern bytes
208.1234 +   found in order so far, in 0..3.  On return *have is updated to the new
208.1235 +   state.  If on return *have equals four, then the pattern was found and the
208.1236 +   return value is how many bytes were read including the last byte of the
208.1237 +   pattern.  If *have is less than four, then the pattern has not been found
208.1238 +   yet and the return value is len.  In the latter case, syncsearch() can be
208.1239 +   called again with more data and the *have state.  *have is initialized to
208.1240 +   zero for the first call.
208.1241 + */
208.1242 +local unsigned syncsearch(have, buf, len)
208.1243 +unsigned FAR *have;
208.1244 +unsigned char FAR *buf;
208.1245 +unsigned len;
208.1246 +{
208.1247 +    unsigned got;
208.1248 +    unsigned next;
208.1249 +
208.1250 +    got = *have;
208.1251 +    next = 0;
208.1252 +    while (next < len && got < 4) {
208.1253 +        if ((int)(buf[next]) == (got < 2 ? 0 : 0xff))
208.1254 +            got++;
208.1255 +        else if (buf[next])
208.1256 +            got = 0;
208.1257 +        else
208.1258 +            got = 4 - got;
208.1259 +        next++;
208.1260 +    }
208.1261 +    *have = got;
208.1262 +    return next;
208.1263 +}
208.1264 +
208.1265 +int ZEXPORT inflateSync(strm)
208.1266 +z_streamp strm;
208.1267 +{
208.1268 +    unsigned len;               /* number of bytes to look at or looked at */
208.1269 +    unsigned long in, out;      /* temporary to save total_in and total_out */
208.1270 +    unsigned char buf[4];       /* to restore bit buffer to byte string */
208.1271 +    struct inflate_state FAR *state;
208.1272 +
208.1273 +    /* check parameters */
208.1274 +    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
208.1275 +    state = (struct inflate_state FAR *)strm->state;
208.1276 +    if (strm->avail_in == 0 && state->bits < 8) return Z_BUF_ERROR;
208.1277 +
208.1278 +    /* if first time, start search in bit buffer */
208.1279 +    if (state->mode != SYNC) {
208.1280 +        state->mode = SYNC;
208.1281 +        state->hold <<= state->bits & 7;
208.1282 +        state->bits -= state->bits & 7;
208.1283 +        len = 0;
208.1284 +        while (state->bits >= 8) {
208.1285 +            buf[len++] = (unsigned char)(state->hold);
208.1286 +            state->hold >>= 8;
208.1287 +            state->bits -= 8;
208.1288 +        }
208.1289 +        state->have = 0;
208.1290 +        syncsearch(&(state->have), buf, len);
208.1291 +    }
208.1292 +
208.1293 +    /* search available input */
208.1294 +    len = syncsearch(&(state->have), strm->next_in, strm->avail_in);
208.1295 +    strm->avail_in -= len;
208.1296 +    strm->next_in += len;
208.1297 +    strm->total_in += len;
208.1298 +
208.1299 +    /* return no joy or set up to restart inflate() on a new block */
208.1300 +    if (state->have != 4) return Z_DATA_ERROR;
208.1301 +    in = strm->total_in;  out = strm->total_out;
208.1302 +    inflateReset(strm);
208.1303 +    strm->total_in = in;  strm->total_out = out;
208.1304 +    state->mode = TYPE;
208.1305 +    return Z_OK;
208.1306 +}
208.1307 +
208.1308 +/*
208.1309 +   Returns true if inflate is currently at the end of a block generated by
208.1310 +   Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP
208.1311 +   implementation to provide an additional safety check. PPP uses
208.1312 +   Z_SYNC_FLUSH but removes the length bytes of the resulting empty stored
208.1313 +   block. When decompressing, PPP checks that at the end of input packet,
208.1314 +   inflate is waiting for these length bytes.
208.1315 + */
208.1316 +int ZEXPORT inflateSyncPoint(strm)
208.1317 +z_streamp strm;
208.1318 +{
208.1319 +    struct inflate_state FAR *state;
208.1320 +
208.1321 +    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
208.1322 +    state = (struct inflate_state FAR *)strm->state;
208.1323 +    return state->mode == STORED && state->bits == 0;
208.1324 +}
208.1325 +
208.1326 +int ZEXPORT inflateCopy(dest, source)
208.1327 +z_streamp dest;
208.1328 +z_streamp source;
208.1329 +{
208.1330 +    struct inflate_state FAR *state;
208.1331 +    struct inflate_state FAR *copy;
208.1332 +    unsigned char FAR *window;
208.1333 +    unsigned wsize;
208.1334 +
208.1335 +    /* check input */
208.1336 +    if (dest == Z_NULL || source == Z_NULL || source->state == Z_NULL ||
208.1337 +        source->zalloc == (alloc_func)0 || source->zfree == (free_func)0)
208.1338 +        return Z_STREAM_ERROR;
208.1339 +    state = (struct inflate_state FAR *)source->state;
208.1340 +
208.1341 +    /* allocate space */
208.1342 +    copy = (struct inflate_state FAR *)
208.1343 +           ZALLOC(source, 1, sizeof(struct inflate_state));
208.1344 +    if (copy == Z_NULL) return Z_MEM_ERROR;
208.1345 +    window = Z_NULL;
208.1346 +    if (state->window != Z_NULL) {
208.1347 +        window = (unsigned char FAR *)
208.1348 +                 ZALLOC(source, 1U << state->wbits, sizeof(unsigned char));
208.1349 +        if (window == Z_NULL) {
208.1350 +            ZFREE(source, copy);
208.1351 +            return Z_MEM_ERROR;
208.1352 +        }
208.1353 +    }
208.1354 +
208.1355 +    /* copy state */
208.1356 +    zmemcpy(dest, source, sizeof(z_stream));
208.1357 +    zmemcpy(copy, state, sizeof(struct inflate_state));
208.1358 +    if (state->lencode >= state->codes &&
208.1359 +        state->lencode <= state->codes + ENOUGH - 1) {
208.1360 +        copy->lencode = copy->codes + (state->lencode - state->codes);
208.1361 +        copy->distcode = copy->codes + (state->distcode - state->codes);
208.1362 +    }
208.1363 +    copy->next = copy->codes + (state->next - state->codes);
208.1364 +    if (window != Z_NULL) {
208.1365 +        wsize = 1U << state->wbits;
208.1366 +        zmemcpy(window, state->window, wsize);
208.1367 +    }
208.1368 +    copy->window = window;
208.1369 +    dest->state = (struct internal_state FAR *)copy;
208.1370 +    return Z_OK;
208.1371 +}
   209.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   209.2 +++ b/libs/zlib/inflate.h	Sun Nov 01 00:36:56 2015 +0200
   209.3 @@ -0,0 +1,115 @@
   209.4 +/* inflate.h -- internal inflate state definition
   209.5 + * Copyright (C) 1995-2004 Mark Adler
   209.6 + * For conditions of distribution and use, see copyright notice in zlib.h
   209.7 + */
   209.8 +
   209.9 +/* WARNING: this file should *not* be used by applications. It is
  209.10 +   part of the implementation of the compression library and is
  209.11 +   subject to change. Applications should only use zlib.h.
  209.12 + */
  209.13 +
  209.14 +/* define NO_GZIP when compiling if you want to disable gzip header and
  209.15 +   trailer decoding by inflate().  NO_GZIP would be used to avoid linking in
  209.16 +   the crc code when it is not needed.  For shared libraries, gzip decoding
  209.17 +   should be left enabled. */
  209.18 +#ifndef NO_GZIP
  209.19 +#  define GUNZIP
  209.20 +#endif
  209.21 +
  209.22 +/* Possible inflate modes between inflate() calls */
  209.23 +typedef enum {
  209.24 +    HEAD,       /* i: waiting for magic header */
  209.25 +    FLAGS,      /* i: waiting for method and flags (gzip) */
  209.26 +    TIME,       /* i: waiting for modification time (gzip) */
  209.27 +    OS,         /* i: waiting for extra flags and operating system (gzip) */
  209.28 +    EXLEN,      /* i: waiting for extra length (gzip) */
  209.29 +    EXTRA,      /* i: waiting for extra bytes (gzip) */
  209.30 +    NAME,       /* i: waiting for end of file name (gzip) */
  209.31 +    COMMENT,    /* i: waiting for end of comment (gzip) */
  209.32 +    HCRC,       /* i: waiting for header crc (gzip) */
  209.33 +    DICTID,     /* i: waiting for dictionary check value */
  209.34 +    DICT,       /* waiting for inflateSetDictionary() call */
  209.35 +        TYPE,       /* i: waiting for type bits, including last-flag bit */
  209.36 +        TYPEDO,     /* i: same, but skip check to exit inflate on new block */
  209.37 +        STORED,     /* i: waiting for stored size (length and complement) */
  209.38 +        COPY,       /* i/o: waiting for input or output to copy stored block */
  209.39 +        TABLE,      /* i: waiting for dynamic block table lengths */
  209.40 +        LENLENS,    /* i: waiting for code length code lengths */
  209.41 +        CODELENS,   /* i: waiting for length/lit and distance code lengths */
  209.42 +            LEN,        /* i: waiting for length/lit code */
  209.43 +            LENEXT,     /* i: waiting for length extra bits */
  209.44 +            DIST,       /* i: waiting for distance code */
  209.45 +            DISTEXT,    /* i: waiting for distance extra bits */
  209.46 +            MATCH,      /* o: waiting for output space to copy string */
  209.47 +            LIT,        /* o: waiting for output space to write literal */
  209.48 +    CHECK,      /* i: waiting for 32-bit check value */
  209.49 +    LENGTH,     /* i: waiting for 32-bit length (gzip) */
  209.50 +    DONE,       /* finished check, done -- remain here until reset */
  209.51 +    BAD,        /* got a data error -- remain here until reset */
  209.52 +    MEM,        /* got an inflate() memory error -- remain here until reset */
  209.53 +    SYNC        /* looking for synchronization bytes to restart inflate() */
  209.54 +} inflate_mode;
  209.55 +
  209.56 +/*
  209.57 +    State transitions between above modes -
  209.58 +
  209.59 +    (most modes can go to the BAD or MEM mode -- not shown for clarity)
  209.60 +
  209.61 +    Process header:
  209.62 +        HEAD -> (gzip) or (zlib)
  209.63 +        (gzip) -> FLAGS -> TIME -> OS -> EXLEN -> EXTRA -> NAME
  209.64 +        NAME -> COMMENT -> HCRC -> TYPE
  209.65 +        (zlib) -> DICTID or TYPE
  209.66 +        DICTID -> DICT -> TYPE
  209.67 +    Read deflate blocks:
  209.68 +            TYPE -> STORED or TABLE or LEN or CHECK
  209.69 +            STORED -> COPY -> TYPE
  209.70 +            TABLE -> LENLENS -> CODELENS -> LEN
  209.71 +    Read deflate codes:
  209.72 +                LEN -> LENEXT or LIT or TYPE
  209.73 +                LENEXT -> DIST -> DISTEXT -> MATCH -> LEN
  209.74 +                LIT -> LEN
  209.75 +    Process trailer:
  209.76 +        CHECK -> LENGTH -> DONE
  209.77 + */
  209.78 +
  209.79 +/* state maintained between inflate() calls.  Approximately 7K bytes. */
  209.80 +struct inflate_state {
  209.81 +    inflate_mode mode;          /* current inflate mode */
  209.82 +    int last;                   /* true if processing last block */
  209.83 +    int wrap;                   /* bit 0 true for zlib, bit 1 true for gzip */
  209.84 +    int havedict;               /* true if dictionary provided */
  209.85 +    int flags;                  /* gzip header method and flags (0 if zlib) */
  209.86 +    unsigned dmax;              /* zlib header max distance (INFLATE_STRICT) */
  209.87 +    unsigned long check;        /* protected copy of check value */
  209.88 +    unsigned long total;        /* protected copy of output count */
  209.89 +    gz_headerp head;            /* where to save gzip header information */
  209.90 +        /* sliding window */
  209.91 +    unsigned wbits;             /* log base 2 of requested window size */
  209.92 +    unsigned wsize;             /* window size or zero if not using window */
  209.93 +    unsigned whave;             /* valid bytes in the window */
  209.94 +    unsigned write;             /* window write index */
  209.95 +    unsigned char FAR *window;  /* allocated sliding window, if needed */
  209.96 +        /* bit accumulator */
  209.97 +    unsigned long hold;         /* input bit accumulator */
  209.98 +    unsigned bits;              /* number of bits in "in" */
  209.99 +        /* for string and stored block copying */
 209.100 +    unsigned length;            /* literal or length of data to copy */
 209.101 +    unsigned offset;            /* distance back to copy string from */
 209.102 +        /* for table and code decoding */
 209.103 +    unsigned extra;             /* extra bits needed */
 209.104 +        /* fixed and dynamic code tables */
 209.105 +    code const FAR *lencode;    /* starting table for length/literal codes */
 209.106 +    code const FAR *distcode;   /* starting table for distance codes */
 209.107 +    unsigned lenbits;           /* index bits for lencode */
 209.108 +    unsigned distbits;          /* index bits for distcode */
 209.109 +        /* dynamic table building */
 209.110 +    unsigned ncode;             /* number of code length code lengths */
 209.111 +    unsigned nlen;              /* number of length code lengths */
 209.112 +    unsigned ndist;             /* number of distance code lengths */
 209.113 +    unsigned have;              /* number of code lengths in lens[] */
 209.114 +    code FAR *next;             /* next available space in codes[] */
 209.115 +    unsigned short lens[320];   /* temporary storage for code lengths */
 209.116 +    unsigned short work[288];   /* work area for code table building */
 209.117 +    code codes[ENOUGH];         /* space for code tables */
 209.118 +};
   210.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   210.2 +++ b/libs/zlib/inftrees.c	Sun Nov 01 00:36:56 2015 +0200
   210.3 @@ -0,0 +1,329 @@
   210.4 +/* inftrees.c -- generate Huffman trees for efficient decoding
   210.5 + * Copyright (C) 1995-2005 Mark Adler
   210.6 + * For conditions of distribution and use, see copyright notice in zlib.h
   210.7 + */
   210.8 +
   210.9 +#include "zutil.h"
  210.10 +#include "inftrees.h"
  210.11 +
  210.12 +#define MAXBITS 15
  210.13 +
  210.14 +const char inflate_copyright[] =
  210.15 +   " inflate 1.2.3 Copyright 1995-2005 Mark Adler ";
  210.16 +/*
  210.17 +  If you use the zlib library in a product, an acknowledgment is welcome
  210.18 +  in the documentation of your product. If for some reason you cannot
  210.19 +  include such an acknowledgment, I would appreciate that you keep this
  210.20 +  copyright string in the executable of your product.
  210.21 + */
  210.22 +
  210.23 +/*
  210.24 +   Build a set of tables to decode the provided canonical Huffman code.
  210.25 +   The code lengths are lens[0..codes-1].  The result starts at *table,
  210.26 +   whose indices are 0..2^bits-1.  work is a writable array of at least
  210.27 +   lens shorts, which is used as a work area.  type is the type of code
  210.28 +   to be generated, CODES, LENS, or DISTS.  On return, zero is success,
  210.29 +   -1 is an invalid code, and +1 means that ENOUGH isn't enough.  table
  210.30 +   on return points to the next available entry's address.  bits is the
  210.31 +   requested root table index bits, and on return it is the actual root
  210.32 +   table index bits.  It will differ if the request is greater than the
  210.33 +   longest code or if it is less than the shortest code.
  210.34 + */
  210.35 +int inflate_table(type, lens, codes, table, bits, work)
  210.36 +codetype type;
  210.37 +unsigned short FAR *lens;
  210.38 +unsigned codes;
  210.39 +code FAR * FAR *table;
  210.40 +unsigned FAR *bits;
  210.41 +unsigned short FAR *work;
  210.42 +{
  210.43 +    unsigned len;               /* a code's length in bits */
  210.44 +    unsigned sym;               /* index of code symbols */
  210.45 +    unsigned min, max;          /* minimum and maximum code lengths */
  210.46 +    unsigned root;              /* number of index bits for root table */
  210.47 +    unsigned curr;              /* number of index bits for current table */
  210.48 +    unsigned drop;              /* code bits to drop for sub-table */
  210.49 +    int left;                   /* number of prefix codes available */
  210.50 +    unsigned used;              /* code entries in table used */
  210.51 +    unsigned huff;              /* Huffman code */
  210.52 +    unsigned incr;              /* for incrementing code, index */
  210.53 +    unsigned fill;              /* index for replicating entries */
  210.54 +    unsigned low;               /* low bits for current root entry */
  210.55 +    unsigned mask;              /* mask for low root bits */
  210.56 +    code this;                  /* table entry for duplication */
  210.57 +    code FAR *next;             /* next available space in table */
  210.58 +    const unsigned short FAR *base;     /* base value table to use */
  210.59 +    const unsigned short FAR *extra;    /* extra bits table to use */
  210.60 +    int end;                    /* use base and extra for symbol > end */
  210.61 +    unsigned short count[MAXBITS+1];    /* number of codes of each length */
  210.62 +    unsigned short offs[MAXBITS+1];     /* offsets in table for each length */
  210.63 +    static const unsigned short lbase[31] = { /* Length codes 257..285 base */
  210.64 +        3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
  210.65 +        35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
  210.66 +    static const unsigned short lext[31] = { /* Length codes 257..285 extra */
  210.67 +        16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
  210.68 +        19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 201, 196};
  210.69 +    static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
  210.70 +        1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
  210.71 +        257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
  210.72 +        8193, 12289, 16385, 24577, 0, 0};
  210.73 +    static const unsigned short dext[32] = { /* Distance codes 0..29 extra */
  210.74 +        16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,
  210.75 +        23, 23, 24, 24, 25, 25, 26, 26, 27, 27,
  210.76 +        28, 28, 29, 29, 64, 64};
  210.77 +
  210.78 +    /*
  210.79 +       Process a set of code lengths to create a canonical Huffman code.  The
  210.80 +       code lengths are lens[0..codes-1].  Each length corresponds to the
  210.81 +       symbols 0..codes-1.  The Huffman code is generated by first sorting the
  210.82 +       symbols by length from short to long, and retaining the symbol order
  210.83 +       for codes with equal lengths.  Then the code starts with all zero bits
  210.84 +       for the first code of the shortest length, and the codes are integer
  210.85 +       increments for the same length, and zeros are appended as the length
  210.86 +       increases.  For the deflate format, these bits are stored backwards
  210.87 +       from their more natural integer increment ordering, and so when the
  210.88 +       decoding tables are built in the large loop below, the integer codes
  210.89 +       are incremented backwards.
  210.90 +
  210.91 +       This routine assumes, but does not check, that all of the entries in
  210.92 +       lens[] are in the range 0..MAXBITS.  The caller must assure this.
  210.93 +       1..MAXBITS is interpreted as that code length.  zero means that that
  210.94 +       symbol does not occur in this code.
  210.95 +
  210.96 +       The codes are sorted by computing a count of codes for each length,
  210.97 +       creating from that a table of starting indices for each length in the
  210.98 +       sorted table, and then entering the symbols in order in the sorted
  210.99 +       table.  The sorted table is work[], with that space being provided by
 210.100 +       the caller.
 210.101 +
 210.102 +       The length counts are used for other purposes as well, i.e. finding
 210.103 +       the minimum and maximum length codes, determining if there are any
 210.104 +       codes at all, checking for a valid set of lengths, and looking ahead
 210.105 +       at length counts to determine sub-table sizes when building the
 210.106 +       decoding tables.
 210.107 +     */
 210.108 +
 210.109 +    /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */
 210.110 +    for (len = 0; len <= MAXBITS; len++)
 210.111 +        count[len] = 0;
 210.112 +    for (sym = 0; sym < codes; sym++)
 210.113 +        count[lens[sym]]++;
 210.114 +
 210.115 +    /* bound code lengths, force root to be within code lengths */
 210.116 +    root = *bits;
 210.117 +    for (max = MAXBITS; max >= 1; max--)
 210.118 +        if (count[max] != 0) break;
 210.119 +    if (root > max) root = max;
 210.120 +    if (max == 0) {                     /* no symbols to code at all */
 210.121 +        this.op = (unsigned char)64;    /* invalid code marker */
 210.122 +        this.bits = (unsigned char)1;
 210.123 +        this.val = (unsigned short)0;
 210.124 +        *(*table)++ = this;             /* make a table to force an error */
 210.125 +        *(*table)++ = this;
 210.126 +        *bits = 1;
 210.127 +        return 0;     /* no symbols, but wait for decoding to report error */
 210.128 +    }
 210.129 +    for (min = 1; min <= MAXBITS; min++)
 210.130 +        if (count[min] != 0) break;
 210.131 +    if (root < min) root = min;
 210.132 +
 210.133 +    /* check for an over-subscribed or incomplete set of lengths */
 210.134 +    left = 1;
 210.135 +    for (len = 1; len <= MAXBITS; len++) {
 210.136 +        left <<= 1;
 210.137 +        left -= count[len];
 210.138 +        if (left < 0) return -1;        /* over-subscribed */
 210.139 +    }
 210.140 +    if (left > 0 && (type == CODES || max != 1))
 210.141 +        return -1;                      /* incomplete set */
 210.142 +
 210.143 +    /* generate offsets into symbol table for each length for sorting */
 210.144 +    offs[1] = 0;
 210.145 +    for (len = 1; len < MAXBITS; len++)
 210.146 +        offs[len + 1] = offs[len] + count[len];
 210.147 +
 210.148 +    /* sort symbols by length, by symbol order within each length */
 210.149 +    for (sym = 0; sym < codes; sym++)
 210.150 +        if (lens[sym] != 0) work[offs[lens[sym]]++] = (unsigned short)sym;
 210.151 +
 210.152 +    /*
 210.153 +       Create and fill in decoding tables.  In this loop, the table being
 210.154 +       filled is at next and has curr index bits.  The code being used is huff
 210.155 +       with length len.  That code is converted to an index by dropping drop
 210.156 +       bits off of the bottom.  For codes where len is less than drop + curr,
 210.157 +       those top drop + curr - len bits are incremented through all values to
 210.158 +       fill the table with replicated entries.
 210.159 +
 210.160 +       root is the number of index bits for the root table.  When len exceeds
 210.161 +       root, sub-tables are created pointed to by the root entry with an index
 210.162 +       of the low root bits of huff.  This is saved in low to check for when a
 210.163 +       new sub-table should be started.  drop is zero when the root table is
 210.164 +       being filled, and drop is root when sub-tables are being filled.
 210.165 +
 210.166 +       When a new sub-table is needed, it is necessary to look ahead in the
 210.167 +       code lengths to determine what size sub-table is needed.  The length
 210.168 +       counts are used for this, and so count[] is decremented as codes are
 210.169 +       entered in the tables.
 210.170 +
 210.171 +       used keeps track of how many table entries have been allocated from the
 210.172 +       provided *table space.  It is checked when a LENS table is being made
 210.173 +       against the space in *table, ENOUGH, minus the maximum space needed by
 210.174 +       the worst case distance code, MAXD.  This should never happen, but the
 210.175 +       sufficiency of ENOUGH has not been proven exhaustively, hence the check.
 210.176 +       This assumes that when type == LENS, bits == 9.
 210.177 +
 210.178 +       sym increments through all symbols, and the loop terminates when
 210.179 +       all codes of length max, i.e. all codes, have been processed.  This
 210.180 +       routine permits incomplete codes, so another loop after this one fills
 210.181 +       in the rest of the decoding tables with invalid code markers.
 210.182 +     */
 210.183 +
 210.184 +    /* set up for code type */
 210.185 +    switch (type) {
 210.186 +    case CODES:
 210.187 +        base = extra = work;    /* dummy value--not used */
 210.188 +        end = 19;
 210.189 +        break;
 210.190 +    case LENS:
 210.191 +        base = lbase;
 210.192 +        base -= 257;
 210.193 +        extra = lext;
 210.194 +        extra -= 257;
 210.195 +        end = 256;
 210.196 +        break;
 210.197 +    default:            /* DISTS */
 210.198 +        base = dbase;
 210.199 +        extra = dext;
 210.200 +        end = -1;
 210.201 +    }
 210.202 +
 210.203 +    /* initialize state for loop */
 210.204 +    huff = 0;                   /* starting code */
 210.205 +    sym = 0;                    /* starting code symbol */
 210.206 +    len = min;                  /* starting code length */
 210.207 +    next = *table;              /* current table to fill in */
 210.208 +    curr = root;                /* current table index bits */
 210.209 +    drop = 0;                   /* current bits to drop from code for index */
 210.210 +    low = (unsigned)(-1);       /* trigger new sub-table when len > root */
 210.211 +    used = 1U << root;          /* use root table entries */
 210.212 +    mask = used - 1;            /* mask for comparing low */
 210.213 +
 210.214 +    /* check available table space */
 210.215 +    if (type == LENS && used >= ENOUGH - MAXD)
 210.216 +        return 1;
 210.217 +
 210.218 +    /* process all codes and make table entries */
 210.219 +    for (;;) {
 210.220 +        /* create table entry */
 210.221 +        this.bits = (unsigned char)(len - drop);
 210.222 +        if ((int)(work[sym]) < end) {
 210.223 +            this.op = (unsigned char)0;
 210.224 +            this.val = work[sym];
 210.225 +        }
 210.226 +        else if ((int)(work[sym]) > end) {
 210.227 +            this.op = (unsigned char)(extra[work[sym]]);
 210.228 +            this.val = base[work[sym]];
 210.229 +        }
 210.230 +        else {
 210.231 +            this.op = (unsigned char)(32 + 64);         /* end of block */
 210.232 +            this.val = 0;
 210.233 +        }
 210.234 +
 210.235 +        /* replicate for those indices with low len bits equal to huff */
 210.236 +        incr = 1U << (len - drop);
 210.237 +        fill = 1U << curr;
 210.238 +        min = fill;                 /* save offset to next table */
 210.239 +        do {
 210.240 +            fill -= incr;
 210.241 +            next[(huff >> drop) + fill] = this;
 210.242 +        } while (fill != 0);
 210.243 +
 210.244 +        /* backwards increment the len-bit code huff */
 210.245 +        incr = 1U << (len - 1);
 210.246 +        while (huff & incr)
 210.247 +            incr >>= 1;
 210.248 +        if (incr != 0) {
 210.249 +            huff &= incr - 1;
 210.250 +            huff += incr;
 210.251 +        }
 210.252 +        else
 210.253 +            huff = 0;
 210.254 +
 210.255 +        /* go to next symbol, update count, len */
 210.256 +        sym++;
 210.257 +        if (--(count[len]) == 0) {
 210.258 +            if (len == max) break;
 210.259 +            len = lens[work[sym]];
 210.260 +        }
 210.261 +
 210.262 +        /* create new sub-table if needed */
 210.263 +        if (len > root && (huff & mask) != low) {
 210.264 +            /* if first time, transition to sub-tables */
 210.265 +            if (drop == 0)
 210.266 +                drop = root;
 210.267 +
 210.268 +            /* increment past last table */
 210.269 +            next += min;            /* here min is 1 << curr */
 210.270 +
 210.271 +            /* determine length of next table */
 210.272 +            curr = len - drop;
 210.273 +            left = (int)(1 << curr);
 210.274 +            while (curr + drop < max) {
 210.275 +                left -= count[curr + drop];
 210.276 +                if (left <= 0) break;
 210.277 +                curr++;
 210.278 +                left <<= 1;
 210.279 +            }
 210.280 +
 210.281 +            /* check for enough space */
 210.282 +            used += 1U << curr;
 210.283 +            if (type == LENS && used >= ENOUGH - MAXD)
 210.284 +                return 1;
 210.285 +
 210.286 +            /* point entry in root table to sub-table */
 210.287 +            low = huff & mask;
 210.288 +            (*table)[low].op = (unsigned char)curr;
 210.289 +            (*table)[low].bits = (unsigned char)root;
 210.290 +            (*table)[low].val = (unsigned short)(next - *table);
 210.291 +        }
 210.292 +    }
 210.293 +
 210.294 +    /*
 210.295 +       Fill in rest of table for incomplete codes.  This loop is similar to the
 210.296 +       loop above in incrementing huff for table indices.  It is assumed that
 210.297 +       len is equal to curr + drop, so there is no loop needed to increment
 210.298 +       through high index bits.  When the current sub-table is filled, the loop
 210.299 +       drops back to the root table to fill in any remaining entries there.
 210.300 +     */
 210.301 +    this.op = (unsigned char)64;                /* invalid code marker */
 210.302 +    this.bits = (unsigned char)(len - drop);
 210.303 +    this.val = (unsigned short)0;
 210.304 +    while (huff != 0) {
 210.305 +        /* when done with sub-table, drop back to root table */
 210.306 +        if (drop != 0 && (huff & mask) != low) {
 210.307 +            drop = 0;
 210.308 +            len = root;
 210.309 +            next = *table;
 210.310 +            this.bits = (unsigned char)len;
 210.311 +        }
 210.312 +
 210.313 +        /* put invalid code marker in table */
 210.314 +        next[huff >> drop] = this;
 210.315 +
 210.316 +        /* backwards increment the len-bit code huff */
 210.317 +        incr = 1U << (len - 1);
 210.318 +        while (huff & incr)
 210.319 +            incr >>= 1;
 210.320 +        if (incr != 0) {
 210.321 +            huff &= incr - 1;
 210.322 +            huff += incr;
 210.323 +        }
 210.324 +        else
 210.325 +            huff = 0;
 210.326 +    }
 210.327 +
 210.328 +    /* set return parameters */
 210.329 +    *table += used;
 210.330 +    *bits = root;
 210.331 +    return 0;
 210.332 +}
   211.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   211.2 +++ b/libs/zlib/inftrees.h	Sun Nov 01 00:36:56 2015 +0200
   211.3 @@ -0,0 +1,55 @@
   211.4 +/* inftrees.h -- header to use inftrees.c
   211.5 + * Copyright (C) 1995-2005 Mark Adler
   211.6 + * For conditions of distribution and use, see copyright notice in zlib.h
   211.7 + */
   211.8 +
   211.9 +/* WARNING: this file should *not* be used by applications. It is
  211.10 +   part of the implementation of the compression library and is
  211.11 +   subject to change. Applications should only use zlib.h.
  211.12 + */
  211.13 +
  211.14 +/* Structure for decoding tables.  Each entry provides either the
  211.15 +   information needed to do the operation requested by the code that
  211.16 +   indexed that table entry, or it provides a pointer to another
  211.17 +   table that indexes more bits of the code.  op indicates whether
  211.18 +   the entry is a pointer to another table, a literal, a length or
  211.19 +   distance, an end-of-block, or an invalid code.  For a table
  211.20 +   pointer, the low four bits of op is the number of index bits of
  211.21 +   that table.  For a length or distance, the low four bits of op
  211.22 +   is the number of extra bits to get after the code.  bits is
  211.23 +   the number of bits in this code or part of the code to drop off
  211.24 +   of the bit buffer.  val is the actual byte to output in the case
  211.25 +   of a literal, the base length or distance, or the offset from
  211.26 +   the current table to the next table.  Each entry is four bytes. */
  211.27 +typedef struct {
  211.28 +    unsigned char op;           /* operation, extra bits, table bits */
  211.29 +    unsigned char bits;         /* bits in this part of the code */
  211.30 +    unsigned short val;         /* offset in table or code value */
  211.31 +} code;
  211.32 +
  211.33 +/* op values as set by inflate_table():
  211.34 +    00000000 - literal
  211.35 +    0000tttt - table link, tttt != 0 is the number of table index bits
  211.36 +    0001eeee - length or distance, eeee is the number of extra bits
  211.37 +    01100000 - end of block
  211.38 +    01000000 - invalid code
  211.39 + */
  211.40 +
  211.41 +/* Maximum size of dynamic tree.  The maximum found in a long but non-
  211.42 +   exhaustive search was 1444 code structures (852 for length/literals
  211.43 +   and 592 for distances, the latter actually the result of an
  211.44 +   exhaustive search).  The true maximum is not known, but the value
  211.45 +   below is more than safe. */
  211.46 +#define ENOUGH 2048
  211.47 +#define MAXD 592
  211.48 +
  211.49 +/* Type of code to build for inftable() */
  211.50 +typedef enum {
  211.51 +    CODES,
  211.52 +    LENS,
  211.53 +    DISTS
  211.54 +} codetype;
  211.55 +
  211.56 +extern int inflate_table OF((codetype type, unsigned short FAR *lens,
  211.57 +                             unsigned codes, code FAR * FAR *table,
  211.58 +                             unsigned FAR *bits, unsigned short FAR *work));
   212.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   212.2 +++ b/libs/zlib/trees.c	Sun Nov 01 00:36:56 2015 +0200
   212.3 @@ -0,0 +1,1219 @@
   212.4 +/* trees.c -- output deflated data using Huffman coding
   212.5 + * Copyright (C) 1995-2005 Jean-loup Gailly
   212.6 + * For conditions of distribution and use, see copyright notice in zlib.h
   212.7 + */
   212.8 +
   212.9 +/*
  212.10 + *  ALGORITHM
  212.11 + *
  212.12 + *      The "deflation" process uses several Huffman trees. The more
  212.13 + *      common source values are represented by shorter bit sequences.
  212.14 + *
  212.15 + *      Each code tree is stored in a compressed form which is itself
  212.16 + * a Huffman encoding of the lengths of all the code strings (in
  212.17 + * ascending order by source values).  The actual code strings are
  212.18 + * reconstructed from the lengths in the inflate process, as described
  212.19 + * in the deflate specification.
  212.20 + *
  212.21 + *  REFERENCES
  212.22 + *
  212.23 + *      Deutsch, L.P.,"'Deflate' Compressed Data Format Specification".
  212.24 + *      Available in ftp.uu.net:/pub/archiving/zip/doc/deflate-1.1.doc
  212.25 + *
  212.26 + *      Storer, James A.
  212.27 + *          Data Compression:  Methods and Theory, pp. 49-50.
  212.28 + *          Computer Science Press, 1988.  ISBN 0-7167-8156-5.
  212.29 + *
  212.30 + *      Sedgewick, R.
  212.31 + *          Algorithms, p290.
  212.32 + *          Addison-Wesley, 1983. ISBN 0-201-06672-6.
  212.33 + */
  212.34 +
  212.35 +/* @(#) $Id$ */
  212.36 +
  212.37 +/* #define GEN_TREES_H */
  212.38 +
  212.39 +#include "deflate.h"
  212.40 +
  212.41 +#ifdef DEBUG
  212.42 +#  include <ctype.h>
  212.43 +#endif
  212.44 +
  212.45 +/* ===========================================================================
  212.46 + * Constants
  212.47 + */
  212.48 +
  212.49 +#define MAX_BL_BITS 7
  212.50 +/* Bit length codes must not exceed MAX_BL_BITS bits */
  212.51 +
  212.52 +#define END_BLOCK 256
  212.53 +/* end of block literal code */
  212.54 +
  212.55 +#define REP_3_6      16
  212.56 +/* repeat previous bit length 3-6 times (2 bits of repeat count) */
  212.57 +
  212.58 +#define REPZ_3_10    17
  212.59 +/* repeat a zero length 3-10 times  (3 bits of repeat count) */
  212.60 +
  212.61 +#define REPZ_11_138  18
  212.62 +/* repeat a zero length 11-138 times  (7 bits of repeat count) */
  212.63 +
  212.64 +local const int extra_lbits[LENGTH_CODES] /* extra bits for each length code */
  212.65 +   = {0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0};
  212.66 +
  212.67 +local const int extra_dbits[D_CODES] /* extra bits for each distance code */
  212.68 +   = {0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13};
  212.69 +
  212.70 +local const int extra_blbits[BL_CODES]/* extra bits for each bit length code */
  212.71 +   = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7};
  212.72 +
  212.73 +local const uch bl_order[BL_CODES]
  212.74 +   = {16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15};
  212.75 +/* The lengths of the bit length codes are sent in order of decreasing
  212.76 + * probability, to avoid transmitting the lengths for unused bit length codes.
  212.77 + */
  212.78 +
  212.79 +#define Buf_size (8 * 2*sizeof(char))
  212.80 +/* Number of bits used within bi_buf. (bi_buf might be implemented on
  212.81 + * more than 16 bits on some systems.)
  212.82 + */
  212.83 +
  212.84 +/* ===========================================================================
  212.85 + * Local data. These are initialized only once.
  212.86 + */
  212.87 +
  212.88 +#define DIST_CODE_LEN  512 /* see definition of array dist_code below */
  212.89 +
  212.90 +#if defined(GEN_TREES_H) || !defined(STDC)
  212.91 +/* non ANSI compilers may not accept trees.h */
  212.92 +
  212.93 +local ct_data static_ltree[L_CODES+2];
  212.94 +/* The static literal tree. Since the bit lengths are imposed, there is no
  212.95 + * need for the L_CODES extra codes used during heap construction. However
  212.96 + * The codes 286 and 287 are needed to build a canonical tree (see _tr_init
  212.97 + * below).
  212.98 + */
  212.99 +
 212.100 +local ct_data static_dtree[D_CODES];
 212.101 +/* The static distance tree. (Actually a trivial tree since all codes use
 212.102 + * 5 bits.)
 212.103 + */
 212.104 +
 212.105 +uch _dist_code[DIST_CODE_LEN];
 212.106 +/* Distance codes. The first 256 values correspond to the distances
 212.107 + * 3 .. 258, the last 256 values correspond to the top 8 bits of
 212.108 + * the 15 bit distances.
 212.109 + */
 212.110 +
 212.111 +uch _length_code[MAX_MATCH-MIN_MATCH+1];
 212.112 +/* length code for each normalized match length (0 == MIN_MATCH) */
 212.113 +
 212.114 +local int base_length[LENGTH_CODES];
 212.115 +/* First normalized length for each code (0 = MIN_MATCH) */
 212.116 +
 212.117 +local int base_dist[D_CODES];
 212.118 +/* First normalized distance for each code (0 = distance of 1) */
 212.119 +
 212.120 +#else
 212.121 +#  include "trees.h"
 212.122 +#endif /* GEN_TREES_H */
 212.123 +
 212.124 +struct static_tree_desc_s {
 212.125 +    const ct_data *static_tree;  /* static tree or NULL */
 212.126 +    const intf *extra_bits;      /* extra bits for each code or NULL */
 212.127 +    int     extra_base;          /* base index for extra_bits */
 212.128 +    int     elems;               /* max number of elements in the tree */
 212.129 +    int     max_length;          /* max bit length for the codes */
 212.130 +};
 212.131 +
 212.132 +local static_tree_desc  static_l_desc =
 212.133 +{static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS};
 212.134 +
 212.135 +local static_tree_desc  static_d_desc =
 212.136 +{static_dtree, extra_dbits, 0,          D_CODES, MAX_BITS};
 212.137 +
 212.138 +local static_tree_desc  static_bl_desc =
 212.139 +{(const ct_data *)0, extra_blbits, 0,   BL_CODES, MAX_BL_BITS};
 212.140 +
 212.141 +/* ===========================================================================
 212.142 + * Local (static) routines in this file.
 212.143 + */
 212.144 +
 212.145 +local void tr_static_init OF((void));
 212.146 +local void init_block     OF((deflate_state *s));
 212.147 +local void pqdownheap     OF((deflate_state *s, ct_data *tree, int k));
 212.148 +local void gen_bitlen     OF((deflate_state *s, tree_desc *desc));
 212.149 +local void gen_codes      OF((ct_data *tree, int max_code, ushf *bl_count));
 212.150 +local void build_tree     OF((deflate_state *s, tree_desc *desc));
 212.151 +local void scan_tree      OF((deflate_state *s, ct_data *tree, int max_code));
 212.152 +local void send_tree      OF((deflate_state *s, ct_data *tree, int max_code));
 212.153 +local int  build_bl_tree  OF((deflate_state *s));
 212.154 +local void send_all_trees OF((deflate_state *s, int lcodes, int dcodes,
 212.155 +                              int blcodes));
 212.156 +local void compress_block OF((deflate_state *s, ct_data *ltree,
 212.157 +                              ct_data *dtree));
 212.158 +local void set_data_type  OF((deflate_state *s));
 212.159 +local unsigned bi_reverse OF((unsigned value, int length));
 212.160 +local void bi_windup      OF((deflate_state *s));
 212.161 +local void bi_flush       OF((deflate_state *s));
 212.162 +local void copy_block     OF((deflate_state *s, charf *buf, unsigned len,
 212.163 +                              int header));
 212.164 +
 212.165 +#ifdef GEN_TREES_H
 212.166 +local void gen_trees_header OF((void));
 212.167 +#endif
 212.168 +
 212.169 +#ifndef DEBUG
 212.170 +#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
 212.171 +   /* Send a code of the given tree. c and tree must not have side effects */
 212.172 +
 212.173 +#else /* DEBUG */
 212.174 +#  define send_code(s, c, tree) \
 212.175 +     { if (z_verbose>2) fprintf(stderr,"\ncd %3d ",(c)); \
 212.176 +       send_bits(s, tree[c].Code, tree[c].Len); }
 212.177 +#endif
 212.178 +
 212.179 +/* ===========================================================================
 212.180 + * Output a short LSB first on the stream.
 212.181 + * IN assertion: there is enough room in pendingBuf.
 212.182 + */
 212.183 +#define put_short(s, w) { \
 212.184 +    put_byte(s, (uch)((w) & 0xff)); \
 212.185 +    put_byte(s, (uch)((ush)(w) >> 8)); \
 212.186 +}
 212.187 +
 212.188 +/* ===========================================================================
 212.189 + * Send a value on a given number of bits.
 212.190 + * IN assertion: length <= 16 and value fits in length bits.
 212.191 + */
 212.192 +#ifdef DEBUG
 212.193 +local void send_bits      OF((deflate_state *s, int value, int length));
 212.194 +
 212.195 +local void send_bits(s, value, length)
 212.196 +    deflate_state *s;
 212.197 +    int value;  /* value to send */
 212.198 +    int length; /* number of bits */
 212.199 +{
 212.200 +    Tracevv((stderr," l %2d v %4x ", length, value));
 212.201 +    Assert(length > 0 && length <= 15, "invalid length");
 212.202 +    s->bits_sent += (ulg)length;
 212.203 +
 212.204 +    /* If not enough room in bi_buf, use (valid) bits from bi_buf and
 212.205 +     * (16 - bi_valid) bits from value, leaving (width - (16-bi_valid))
 212.206 +     * unused bits in value.
 212.207 +     */
 212.208 +    if (s->bi_valid > (int)Buf_size - length) {
 212.209 +        s->bi_buf |= (value << s->bi_valid);
 212.210 +        put_short(s, s->bi_buf);
 212.211 +        s->bi_buf = (ush)value >> (Buf_size - s->bi_valid);
 212.212 +        s->bi_valid += length - Buf_size;
 212.213 +    } else {
 212.214 +        s->bi_buf |= value << s->bi_valid;
 212.215 +        s->bi_valid += length;
 212.216 +    }
 212.217 +}
 212.218 +#else /* !DEBUG */
 212.219 +
 212.220 +#define send_bits(s, value, length) \
 212.221 +{ int len = length;\
 212.222 +  if (s->bi_valid > (int)Buf_size - len) {\
 212.223 +    int val = value;\
 212.224 +    s->bi_buf |= (val << s->bi_valid);\
 212.225 +    put_short(s, s->bi_buf);\
 212.226 +    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
 212.227 +    s->bi_valid += len - Buf_size;\
 212.228 +  } else {\
 212.229 +    s->bi_buf |= (value) << s->bi_valid;\
 212.230 +    s->bi_valid += len;\
 212.231 +  }\
 212.232 +}
 212.233 +#endif /* DEBUG */
 212.234 +
 212.235 +
 212.236 +/* the arguments must not have side effects */
 212.237 +
 212.238 +/* ===========================================================================
 212.239 + * Initialize the various 'constant' tables.
 212.240 + */
 212.241 +local void tr_static_init()
 212.242 +{
 212.243 +#if defined(GEN_TREES_H) || !defined(STDC)
 212.244 +    static int static_init_done = 0;
 212.245 +    int n;        /* iterates over tree elements */
 212.246 +    int bits;     /* bit counter */
 212.247 +    int length;   /* length value */
 212.248 +    int code;     /* code value */
 212.249 +    int dist;     /* distance index */
 212.250 +    ush bl_count[MAX_BITS+1];
 212.251 +    /* number of codes at each bit length for an optimal tree */
 212.252 +
 212.253 +    if (static_init_done) return;
 212.254 +
 212.255 +    /* For some embedded targets, global variables are not initialized: */
 212.256 +    static_l_desc.static_tree = static_ltree;
 212.257 +    static_l_desc.extra_bits = extra_lbits;
 212.258 +    static_d_desc.static_tree = static_dtree;
 212.259 +    static_d_desc.extra_bits = extra_dbits;
 212.260 +    static_bl_desc.extra_bits = extra_blbits;
 212.261 +
 212.262 +    /* Initialize the mapping length (0..255) -> length code (0..28) */
 212.263 +    length = 0;
 212.264 +    for (code = 0; code < LENGTH_CODES-1; code++) {
 212.265 +        base_length[code] = length;
 212.266 +        for (n = 0; n < (1<<extra_lbits[code]); n++) {
 212.267 +            _length_code[length++] = (uch)code;
 212.268 +        }
 212.269 +    }
 212.270 +    Assert (length == 256, "tr_static_init: length != 256");
 212.271 +    /* Note that the length 255 (match length 258) can be represented
 212.272 +     * in two different ways: code 284 + 5 bits or code 285, so we
 212.273 +     * overwrite length_code[255] to use the best encoding:
 212.274 +     */
 212.275 +    _length_code[length-1] = (uch)code;
 212.276 +
 212.277 +    /* Initialize the mapping dist (0..32K) -> dist code (0..29) */
 212.278 +    dist = 0;
 212.279 +    for (code = 0 ; code < 16; code++) {
 212.280 +        base_dist[code] = dist;
 212.281 +        for (n = 0; n < (1<<extra_dbits[code]); n++) {
 212.282 +            _dist_code[dist++] = (uch)code;
 212.283 +        }
 212.284 +    }
 212.285 +    Assert (dist == 256, "tr_static_init: dist != 256");
 212.286 +    dist >>= 7; /* from now on, all distances are divided by 128 */
 212.287 +    for ( ; code < D_CODES; code++) {
 212.288 +        base_dist[code] = dist << 7;
 212.289 +        for (n = 0; n < (1<<(extra_dbits[code]-7)); n++) {
 212.290 +            _dist_code[256 + dist++] = (uch)code;
 212.291 +        }
 212.292 +    }
 212.293 +    Assert (dist == 256, "tr_static_init: 256+dist != 512");
 212.294 +
 212.295 +    /* Construct the codes of the static literal tree */
 212.296 +    for (bits = 0; bits <= MAX_BITS; bits++) bl_count[bits] = 0;
 212.297 +    n = 0;
 212.298 +    while (n <= 143) static_ltree[n++].Len = 8, bl_count[8]++;
 212.299 +    while (n <= 255) static_ltree[n++].Len = 9, bl_count[9]++;
 212.300 +    while (n <= 279) static_ltree[n++].Len = 7, bl_count[7]++;
 212.301 +    while (n <= 287) static_ltree[n++].Len = 8, bl_count[8]++;
 212.302 +    /* Codes 286 and 287 do not exist, but we must include them in the
 212.303 +     * tree construction to get a canonical Huffman tree (longest code
 212.304 +     * all ones)
 212.305 +     */
 212.306 +    gen_codes((ct_data *)static_ltree, L_CODES+1, bl_count);
 212.307 +
 212.308 +    /* The static distance tree is trivial: */
 212.309 +    for (n = 0; n < D_CODES; n++) {
 212.310 +        static_dtree[n].Len = 5;
 212.311 +        static_dtree[n].Code = bi_reverse((unsigned)n, 5);
 212.312 +    }
 212.313 +    static_init_done = 1;
 212.314 +
 212.315 +#  ifdef GEN_TREES_H
 212.316 +    gen_trees_header();
 212.317 +#  endif
 212.318 +#endif /* defined(GEN_TREES_H) || !defined(STDC) */
 212.319 +}
 212.320 +
 212.321 +/* ===========================================================================
 212.322 + * Genererate the file trees.h describing the static trees.
 212.323 + */
 212.324 +#ifdef GEN_TREES_H
 212.325 +#  ifndef DEBUG
 212.326 +#    include <stdio.h>
 212.327 +#  endif
 212.328 +
 212.329 +#  define SEPARATOR(i, last, width) \
 212.330 +      ((i) == (last)? "\n};\n\n" :    \
 212.331 +       ((i) % (width) == (width)-1 ? ",\n" : ", "))
 212.332 +
 212.333 +void gen_trees_header()
 212.334 +{
 212.335 +    FILE *header = fopen("trees.h", "w");
 212.336 +    int i;
 212.337 +
 212.338 +    Assert (header != NULL, "Can't open trees.h");
 212.339 +    fprintf(header,
 212.340 +            "/* header created automatically with -DGEN_TREES_H */\n\n");
 212.341 +
 212.342 +    fprintf(header, "local const ct_data static_ltree[L_CODES+2] = {\n");
 212.343 +    for (i = 0; i < L_CODES+2; i++) {
 212.344 +        fprintf(header, "{{%3u},{%3u}}%s", static_ltree[i].Code,
 212.345 +                static_ltree[i].Len, SEPARATOR(i, L_CODES+1, 5));
 212.346 +    }
 212.347 +
 212.348 +    fprintf(header, "local const ct_data static_dtree[D_CODES] = {\n");
 212.349 +    for (i = 0; i < D_CODES; i++) {
 212.350 +        fprintf(header, "{{%2u},{%2u}}%s", static_dtree[i].Code,
 212.351 +                static_dtree[i].Len, SEPARATOR(i, D_CODES-1, 5));
 212.352 +    }
 212.353 +
 212.354 +    fprintf(header, "const uch _dist_code[DIST_CODE_LEN] = {\n");
 212.355 +    for (i = 0; i < DIST_CODE_LEN; i++) {
 212.356 +        fprintf(header, "%2u%s", _dist_code[i],
 212.357 +                SEPARATOR(i, DIST_CODE_LEN-1, 20));
 212.358 +    }
 212.359 +
 212.360 +    fprintf(header, "const uch _length_code[MAX_MATCH-MIN_MATCH+1]= {\n");
 212.361 +    for (i = 0; i < MAX_MATCH-MIN_MATCH+1; i++) {
 212.362 +        fprintf(header, "%2u%s", _length_code[i],
 212.363 +                SEPARATOR(i, MAX_MATCH-MIN_MATCH, 20));
 212.364 +    }
 212.365 +
 212.366 +    fprintf(header, "local const int base_length[LENGTH_CODES] = {\n");
 212.367 +    for (i = 0; i < LENGTH_CODES; i++) {
 212.368 +        fprintf(header, "%1u%s", base_length[i],
 212.369 +                SEPARATOR(i, LENGTH_CODES-1, 20));
 212.370 +    }
 212.371 +
 212.372 +    fprintf(header, "local const int base_dist[D_CODES] = {\n");
 212.373 +    for (i = 0; i < D_CODES; i++) {
 212.374 +        fprintf(header, "%5u%s", base_dist[i],
 212.375 +                SEPARATOR(i, D_CODES-1, 10));
 212.376 +    }
 212.377 +
 212.378 +    fclose(header);
 212.379 +}
 212.380 +#endif /* GEN_TREES_H */
 212.381 +
 212.382 +/* ===========================================================================
 212.383 + * Initialize the tree data structures for a new zlib stream.
 212.384 + */
 212.385 +void _tr_init(s)
 212.386 +    deflate_state *s;
 212.387 +{
 212.388 +    tr_static_init();
 212.389 +
 212.390 +    s->l_desc.dyn_tree = s->dyn_ltree;
 212.391 +    s->l_desc.stat_desc = &static_l_desc;
 212.392 +
 212.393 +    s->d_desc.dyn_tree = s->dyn_dtree;
 212.394 +    s->d_desc.stat_desc = &static_d_desc;
 212.395 +
 212.396 +    s->bl_desc.dyn_tree = s->bl_tree;
 212.397 +    s->bl_desc.stat_desc = &static_bl_desc;
 212.398 +
 212.399 +    s->bi_buf = 0;
 212.400 +    s->bi_valid = 0;
 212.401 +    s->last_eob_len = 8; /* enough lookahead for inflate */
 212.402 +#ifdef DEBUG
 212.403 +    s->compressed_len = 0L;
 212.404 +    s->bits_sent = 0L;
 212.405 +#endif
 212.406 +
 212.407 +    /* Initialize the first block of the first file: */
 212.408 +    init_block(s);
 212.409 +}
 212.410 +
 212.411 +/* ===========================================================================
 212.412 + * Initialize a new block.
 212.413 + */
 212.414 +local void init_block(s)
 212.415 +    deflate_state *s;
 212.416 +{
 212.417 +    int n; /* iterates over tree elements */
 212.418 +
 212.419 +    /* Initialize the trees. */
 212.420 +    for (n = 0; n < L_CODES;  n++) s->dyn_ltree[n].Freq = 0;
 212.421 +    for (n = 0; n < D_CODES;  n++) s->dyn_dtree[n].Freq = 0;
 212.422 +    for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0;
 212.423 +
 212.424 +    s->dyn_ltree[END_BLOCK].Freq = 1;
 212.425 +    s->opt_len = s->static_len = 0L;
 212.426 +    s->last_lit = s->matches = 0;
 212.427 +}
 212.428 +
 212.429 +#define SMALLEST 1
 212.430 +/* Index within the heap array of least frequent node in the Huffman tree */
 212.431 +
 212.432 +
 212.433 +/* ===========================================================================
 212.434 + * Remove the smallest element from the heap and recreate the heap with
 212.435 + * one less element. Updates heap and heap_len.
 212.436 + */
 212.437 +#define pqremove(s, tree, top) \
 212.438 +{\
 212.439 +    top = s->heap[SMALLEST]; \
 212.440 +    s->heap[SMALLEST] = s->heap[s->heap_len--]; \
 212.441 +    pqdownheap(s, tree, SMALLEST); \
 212.442 +}
 212.443 +
 212.444 +/* ===========================================================================
 212.445 + * Compares to subtrees, using the tree depth as tie breaker when
 212.446 + * the subtrees have equal frequency. This minimizes the worst case length.
 212.447 + */
 212.448 +#define smaller(tree, n, m, depth) \
 212.449 +   (tree[n].Freq < tree[m].Freq || \
 212.450 +   (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m]))
 212.451 +
 212.452 +/* ===========================================================================
 212.453 + * Restore the heap property by moving down the tree starting at node k,
 212.454 + * exchanging a node with the smallest of its two sons if necessary, stopping
 212.455 + * when the heap property is re-established (each father smaller than its
 212.456 + * two sons).
 212.457 + */
 212.458 +local void pqdownheap(s, tree, k)
 212.459 +    deflate_state *s;
 212.460 +    ct_data *tree;  /* the tree to restore */
 212.461 +    int k;               /* node to move down */
 212.462 +{
 212.463 +    int v = s->heap[k];
 212.464 +    int j = k << 1;  /* left son of k */
 212.465 +    while (j <= s->heap_len) {
 212.466 +        /* Set j to the smallest of the two sons: */
 212.467 +        if (j < s->heap_len &&
 212.468 +            smaller(tree, s->heap[j+1], s->heap[j], s->depth)) {
 212.469 +            j++;
 212.470 +        }
 212.471 +        /* Exit if v is smaller than both sons */
 212.472 +        if (smaller(tree, v, s->heap[j], s->depth)) break;
 212.473 +
 212.474 +        /* Exchange v with the smallest son */
 212.475 +        s->heap[k] = s->heap[j];  k = j;
 212.476 +
 212.477 +        /* And continue down the tree, setting j to the left son of k */
 212.478 +        j <<= 1;
 212.479 +    }
 212.480 +    s->heap[k] = v;
 212.481 +}
 212.482 +
 212.483 +/* ===========================================================================
 212.484 + * Compute the optimal bit lengths for a tree and update the total bit length
 212.485 + * for the current block.
 212.486 + * IN assertion: the fields freq and dad are set, heap[heap_max] and
 212.487 + *    above are the tree nodes sorted by increasing frequency.
 212.488 + * OUT assertions: the field len is set to the optimal bit length, the
 212.489 + *     array bl_count contains the frequencies for each bit length.
 212.490 + *     The length opt_len is updated; static_len is also updated if stree is
 212.491 + *     not null.
 212.492 + */
 212.493 +local void gen_bitlen(s, desc)
 212.494 +    deflate_state *s;
 212.495 +    tree_desc *desc;    /* the tree descriptor */
 212.496 +{
 212.497 +    ct_data *tree        = desc->dyn_tree;
 212.498 +    int max_code         = desc->max_code;
 212.499 +    const ct_data *stree = desc->stat_desc->static_tree;
 212.500 +    const intf *extra    = desc->stat_desc->extra_bits;
 212.501 +    int base             = desc->stat_desc->extra_base;
 212.502 +    int max_length       = desc->stat_desc->max_length;
 212.503 +    int h;              /* heap index */
 212.504 +    int n, m;           /* iterate over the tree elements */
 212.505 +    int bits;           /* bit length */
 212.506 +    int xbits;          /* extra bits */
 212.507 +    ush f;              /* frequency */
 212.508 +    int overflow = 0;   /* number of elements with bit length too large */
 212.509 +
 212.510 +    for (bits = 0; bits <= MAX_BITS; bits++) s->bl_count[bits] = 0;
 212.511 +
 212.512 +    /* In a first pass, compute the optimal bit lengths (which may
 212.513 +     * overflow in the case of the bit length tree).
 212.514 +     */
 212.515 +    tree[s->heap[s->heap_max]].Len = 0; /* root of the heap */
 212.516 +
 212.517 +    for (h = s->heap_max+1; h < HEAP_SIZE; h++) {
 212.518 +        n = s->heap[h];
 212.519 +        bits = tree[tree[n].Dad].Len + 1;
 212.520 +        if (bits > max_length) bits = max_length, overflow++;
 212.521 +        tree[n].Len = (ush)bits;
 212.522 +        /* We overwrite tree[n].Dad which is no longer needed */
 212.523 +
 212.524 +        if (n > max_code) continue; /* not a leaf node */
 212.525 +
 212.526 +        s->bl_count[bits]++;
 212.527 +        xbits = 0;
 212.528 +        if (n >= base) xbits = extra[n-base];
 212.529 +        f = tree[n].Freq;
 212.530 +        s->opt_len += (ulg)f * (bits + xbits);
 212.531 +        if (stree) s->static_len += (ulg)f * (stree[n].Len + xbits);
 212.532 +    }
 212.533 +    if (overflow == 0) return;
 212.534 +
 212.535 +    Trace((stderr,"\nbit length overflow\n"));
 212.536 +    /* This happens for example on obj2 and pic of the Calgary corpus */
 212.537 +
 212.538 +    /* Find the first bit length which could increase: */
 212.539 +    do {
 212.540 +        bits = max_length-1;
 212.541 +        while (s->bl_count[bits] == 0) bits--;
 212.542 +        s->bl_count[bits]--;      /* move one leaf down the tree */
 212.543 +        s->bl_count[bits+1] += 2; /* move one overflow item as its brother */
 212.544 +        s->bl_count[max_length]--;
 212.545 +        /* The brother of the overflow item also moves one step up,
 212.546 +         * but this does not affect bl_count[max_length]
 212.547 +         */
 212.548 +        overflow -= 2;
 212.549 +    } while (overflow > 0);
 212.550 +
 212.551 +    /* Now recompute all bit lengths, scanning in increasing frequency.
 212.552 +     * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all
 212.553 +     * lengths instead of fixing only the wrong ones. This idea is taken
 212.554 +     * from 'ar' written by Haruhiko Okumura.)
 212.555 +     */
 212.556 +    for (bits = max_length; bits != 0; bits--) {
 212.557 +        n = s->bl_count[bits];
 212.558 +        while (n != 0) {
 212.559 +            m = s->heap[--h];
 212.560 +            if (m > max_code) continue;
 212.561 +            if ((unsigned) tree[m].Len != (unsigned) bits) {
 212.562 +                Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits));
 212.563 +                s->opt_len += ((long)bits - (long)tree[m].Len)
 212.564 +                              *(long)tree[m].Freq;
 212.565 +                tree[m].Len = (ush)bits;
 212.566 +            }
 212.567 +            n--;
 212.568 +        }
 212.569 +    }
 212.570 +}
 212.571 +
 212.572 +/* ===========================================================================
 212.573 + * Generate the codes for a given tree and bit counts (which need not be
 212.574 + * optimal).
 212.575 + * IN assertion: the array bl_count contains the bit length statistics for
 212.576 + * the given tree and the field len is set for all tree elements.
 212.577 + * OUT assertion: the field code is set for all tree elements of non
 212.578 + *     zero code length.
 212.579 + */
 212.580 +local void gen_codes (tree, max_code, bl_count)
 212.581 +    ct_data *tree;             /* the tree to decorate */
 212.582 +    int max_code;              /* largest code with non zero frequency */
 212.583 +    ushf *bl_count;            /* number of codes at each bit length */
 212.584 +{
 212.585 +    ush next_code[MAX_BITS+1]; /* next code value for each bit length */
 212.586 +    ush code = 0;              /* running code value */
 212.587 +    int bits;                  /* bit index */
 212.588 +    int n;                     /* code index */
 212.589 +
 212.590 +    /* The distribution counts are first used to generate the code values
 212.591 +     * without bit reversal.
 212.592 +     */
 212.593 +    for (bits = 1; bits <= MAX_BITS; bits++) {
 212.594 +        next_code[bits] = code = (code + bl_count[bits-1]) << 1;
 212.595 +    }
 212.596 +    /* Check that the bit counts in bl_count are consistent. The last code
 212.597 +     * must be all ones.
 212.598 +     */
 212.599 +    Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,
 212.600 +            "inconsistent bit counts");
 212.601 +    Tracev((stderr,"\ngen_codes: max_code %d ", max_code));
 212.602 +
 212.603 +    for (n = 0;  n <= max_code; n++) {
 212.604 +        int len = tree[n].Len;
 212.605 +        if (len == 0) continue;
 212.606 +        /* Now reverse the bits */
 212.607 +        tree[n].Code = bi_reverse(next_code[len]++, len);
 212.608 +
 212.609 +        Tracecv(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ",
 212.610 +             n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));
 212.611 +    }
 212.612 +}
 212.613 +
 212.614 +/* ===========================================================================
 212.615 + * Construct one Huffman tree and assigns the code bit strings and lengths.
 212.616 + * Update the total bit length for the current block.
 212.617 + * IN assertion: the field freq is set for all tree elements.
 212.618 + * OUT assertions: the fields len and code are set to the optimal bit length
 212.619 + *     and corresponding code. The length opt_len is updated; static_len is
 212.620 + *     also updated if stree is not null. The field max_code is set.
 212.621 + */
 212.622 +local void build_tree(s, desc)
 212.623 +    deflate_state *s;
 212.624 +    tree_desc *desc; /* the tree descriptor */
 212.625 +{
 212.626 +    ct_data *tree         = desc->dyn_tree;
 212.627 +    const ct_data *stree  = desc->stat_desc->static_tree;
 212.628 +    int elems             = desc->stat_desc->elems;
 212.629 +    int n, m;          /* iterate over heap elements */
 212.630 +    int max_code = -1; /* largest code with non zero frequency */
 212.631 +    int node;          /* new node being created */
 212.632 +
 212.633 +    /* Construct the initial heap, with least frequent element in
 212.634 +     * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].
 212.635 +     * heap[0] is not used.
 212.636 +     */
 212.637 +    s->heap_len = 0, s->heap_max = HEAP_SIZE;
 212.638 +
 212.639 +    for (n = 0; n < elems; n++) {
 212.640 +        if (tree[n].Freq != 0) {
 212.641 +            s->heap[++(s->heap_len)] = max_code = n;
 212.642 +            s->depth[n] = 0;
 212.643 +        } else {
 212.644 +            tree[n].Len = 0;
 212.645 +        }
 212.646 +    }
 212.647 +
 212.648 +    /* The pkzip format requires that at least one distance code exists,
 212.649 +     * and that at least one bit should be sent even if there is only one
 212.650 +     * possible code. So to avoid special checks later on we force at least
 212.651 +     * two codes of non zero frequency.
 212.652 +     */
 212.653 +    while (s->heap_len < 2) {
 212.654 +        node = s->heap[++(s->heap_len)] = (max_code < 2 ? ++max_code : 0);
 212.655 +        tree[node].Freq = 1;
 212.656 +        s->depth[node] = 0;
 212.657 +        s->opt_len--; if (stree) s->static_len -= stree[node].Len;
 212.658 +        /* node is 0 or 1 so it does not have extra bits */
 212.659 +    }
 212.660 +    desc->max_code = max_code;
 212.661 +
 212.662 +    /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,
 212.663 +     * establish sub-heaps of increasing lengths:
 212.664 +     */
 212.665 +    for (n = s->heap_len/2; n >= 1; n--) pqdownheap(s, tree, n);
 212.666 +
 212.667 +    /* Construct the Huffman tree by repeatedly combining the least two
 212.668 +     * frequent nodes.
 212.669 +     */
 212.670 +    node = elems;              /* next internal node of the tree */
 212.671 +    do {
 212.672 +        pqremove(s, tree, n);  /* n = node of least frequency */
 212.673 +        m = s->heap[SMALLEST]; /* m = node of next least frequency */
 212.674 +
 212.675 +        s->heap[--(s->heap_max)] = n; /* keep the nodes sorted by frequency */
 212.676 +        s->heap[--(s->heap_max)] = m;
 212.677 +
 212.678 +        /* Create a new node father of n and m */
 212.679 +        tree[node].Freq = tree[n].Freq + tree[m].Freq;
 212.680 +        s->depth[node] = (uch)((s->depth[n] >= s->depth[m] ?
 212.681 +                                s->depth[n] : s->depth[m]) + 1);
 212.682 +        tree[n].Dad = tree[m].Dad = (ush)node;
 212.683 +#ifdef DUMP_BL_TREE
 212.684 +        if (tree == s->bl_tree) {
 212.685 +            fprintf(stderr,"\nnode %d(%d), sons %d(%d) %d(%d)",
 212.686 +                    node, tree[node].Freq, n, tree[n].Freq, m, tree[m].Freq);
 212.687 +        }
 212.688 +#endif
 212.689 +        /* and insert the new node in the heap */
 212.690 +        s->heap[SMALLEST] = node++;
 212.691 +        pqdownheap(s, tree, SMALLEST);
 212.692 +
 212.693 +    } while (s->heap_len >= 2);
 212.694 +
 212.695 +    s->heap[--(s->heap_max)] = s->heap[SMALLEST];
 212.696 +
 212.697 +    /* At this point, the fields freq and dad are set. We can now
 212.698 +     * generate the bit lengths.
 212.699 +     */
 212.700 +    gen_bitlen(s, (tree_desc *)desc);
 212.701 +
 212.702 +    /* The field len is now set, we can generate the bit codes */
 212.703 +    gen_codes ((ct_data *)tree, max_code, s->bl_count);
 212.704 +}
 212.705 +
 212.706 +/* ===========================================================================
 212.707 + * Scan a literal or distance tree to determine the frequencies of the codes
 212.708 + * in the bit length tree.
 212.709 + */
 212.710 +local void scan_tree (s, tree, max_code)
 212.711 +    deflate_state *s;
 212.712 +    ct_data *tree;   /* the tree to be scanned */
 212.713 +    int max_code;    /* and its largest code of non zero frequency */
 212.714 +{
 212.715 +    int n;                     /* iterates over all tree elements */
 212.716 +    int prevlen = -1;          /* last emitted length */
 212.717 +    int curlen;                /* length of current code */
 212.718 +    int nextlen = tree[0].Len; /* length of next code */
 212.719 +    int count = 0;             /* repeat count of the current code */
 212.720 +    int max_count = 7;         /* max repeat count */
 212.721 +    int min_count = 4;         /* min repeat count */
 212.722 +
 212.723 +    if (nextlen == 0) max_count = 138, min_count = 3;
 212.724 +    tree[max_code+1].Len = (ush)0xffff; /* guard */
 212.725 +
 212.726 +    for (n = 0; n <= max_code; n++) {
 212.727 +        curlen = nextlen; nextlen = tree[n+1].Len;
 212.728 +        if (++count < max_count && curlen == nextlen) {
 212.729 +            continue;
 212.730 +        } else if (count < min_count) {
 212.731 +            s->bl_tree[curlen].Freq += count;
 212.732 +        } else if (curlen != 0) {
 212.733 +            if (curlen != prevlen) s->bl_tree[curlen].Freq++;
 212.734 +            s->bl_tree[REP_3_6].Freq++;
 212.735 +        } else if (count <= 10) {
 212.736 +            s->bl_tree[REPZ_3_10].Freq++;
 212.737 +        } else {
 212.738 +            s->bl_tree[REPZ_11_138].Freq++;
 212.739 +        }
 212.740 +        count = 0; prevlen = curlen;
 212.741 +        if (nextlen == 0) {
 212.742 +            max_count = 138, min_count = 3;
 212.743 +        } else if (curlen == nextlen) {
 212.744 +            max_count = 6, min_count = 3;
 212.745 +        } else {
 212.746 +            max_count = 7, min_count = 4;
 212.747 +        }
 212.748 +    }
 212.749 +}
 212.750 +
 212.751 +/* ===========================================================================
 212.752 + * Send a literal or distance tree in compressed form, using the codes in
 212.753 + * bl_tree.
 212.754 + */
 212.755 +local void send_tree (s, tree, max_code)
 212.756 +    deflate_state *s;
 212.757 +    ct_data *tree; /* the tree to be scanned */
 212.758 +    int max_code;       /* and its largest code of non zero frequency */
 212.759 +{
 212.760 +    int n;                     /* iterates over all tree elements */
 212.761 +    int prevlen = -1;          /* last emitted length */
 212.762 +    int curlen;                /* length of current code */
 212.763 +    int nextlen = tree[0].Len; /* length of next code */
 212.764 +    int count = 0;             /* repeat count of the current code */
 212.765 +    int max_count = 7;         /* max repeat count */
 212.766 +    int min_count = 4;         /* min repeat count */
 212.767 +
 212.768 +    /* tree[max_code+1].Len = -1; */  /* guard already set */
 212.769 +    if (nextlen == 0) max_count = 138, min_count = 3;
 212.770 +
 212.771 +    for (n = 0; n <= max_code; n++) {
 212.772 +        curlen = nextlen; nextlen = tree[n+1].Len;
 212.773 +        if (++count < max_count && curlen == nextlen) {
 212.774 +            continue;
 212.775 +        } else if (count < min_count) {
 212.776 +            do { send_code(s, curlen, s->bl_tree); } while (--count != 0);
 212.777 +
 212.778 +        } else if (curlen != 0) {
 212.779 +            if (curlen != prevlen) {
 212.780 +                send_code(s, curlen, s->bl_tree); count--;
 212.781 +            }
 212.782 +            Assert(count >= 3 && count <= 6, " 3_6?");
 212.783 +            send_code(s, REP_3_6, s->bl_tree); send_bits(s, count-3, 2);
 212.784 +
 212.785 +        } else if (count <= 10) {
 212.786 +            send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count-3, 3);
 212.787 +
 212.788 +        } else {
 212.789 +            send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count-11, 7);
 212.790 +        }
 212.791 +        count = 0; prevlen = curlen;
 212.792 +        if (nextlen == 0) {
 212.793 +            max_count = 138, min_count = 3;
 212.794 +        } else if (curlen == nextlen) {
 212.795 +            max_count = 6, min_count = 3;
 212.796 +        } else {
 212.797 +            max_count = 7, min_count = 4;
 212.798 +        }
 212.799 +    }
 212.800 +}
 212.801 +
 212.802 +/* ===========================================================================
 212.803 + * Construct the Huffman tree for the bit lengths and return the index in
 212.804 + * bl_order of the last bit length code to send.
 212.805 + */
 212.806 +local int build_bl_tree(s)
 212.807 +    deflate_state *s;
 212.808 +{
 212.809 +    int max_blindex;  /* index of last bit length code of non zero freq */
 212.810 +
 212.811 +    /* Determine the bit length frequencies for literal and distance trees */
 212.812 +    scan_tree(s, (ct_data *)s->dyn_ltree, s->l_desc.max_code);
 212.813 +    scan_tree(s, (ct_data *)s->dyn_dtree, s->d_desc.max_code);
 212.814 +
 212.815 +    /* Build the bit length tree: */
 212.816 +    build_tree(s, (tree_desc *)(&(s->bl_desc)));
 212.817 +    /* opt_len now includes the length of the tree representations, except
 212.818 +     * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.
 212.819 +     */
 212.820 +
 212.821 +    /* Determine the number of bit length codes to send. The pkzip format
 212.822 +     * requires that at least 4 bit length codes be sent. (appnote.txt says
 212.823 +     * 3 but the actual value used is 4.)
 212.824 +     */
 212.825 +    for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) {
 212.826 +        if (s->bl_tree[bl_order[max_blindex]].Len != 0) break;
 212.827 +    }
 212.828 +    /* Update opt_len to include the bit length tree and counts */
 212.829 +    s->opt_len += 3*(max_blindex+1) + 5+5+4;
 212.830 +    Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld",
 212.831 +            s->opt_len, s->static_len));
 212.832 +
 212.833 +    return max_blindex;
 212.834 +}
 212.835 +
 212.836 +/* ===========================================================================
 212.837 + * Send the header for a block using dynamic Huffman trees: the counts, the
 212.838 + * lengths of the bit length codes, the literal tree and the distance tree.
 212.839 + * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.
 212.840 + */
 212.841 +local void send_all_trees(s, lcodes, dcodes, blcodes)
 212.842 +    deflate_state *s;
 212.843 +    int lcodes, dcodes, blcodes; /* number of codes for each tree */
 212.844 +{
 212.845 +    int rank;                    /* index in bl_order */
 212.846 +
 212.847 +    Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes");
 212.848 +    Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,
 212.849 +            "too many codes");
 212.850 +    Tracev((stderr, "\nbl counts: "));
 212.851 +    send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */
 212.852 +    send_bits(s, dcodes-1,   5);
 212.853 +    send_bits(s, blcodes-4,  4); /* not -3 as stated in appnote.txt */
 212.854 +    for (rank = 0; rank < blcodes; rank++) {
 212.855 +        Tracev((stderr, "\nbl code %2d ", bl_order[rank]));
 212.856 +        send_bits(s, s->bl_tree[bl_order[rank]].Len, 3);
 212.857 +    }
 212.858 +    Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent));
 212.859 +
 212.860 +    send_tree(s, (ct_data *)s->dyn_ltree, lcodes-1); /* literal tree */
 212.861 +    Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent));
 212.862 +
 212.863 +    send_tree(s, (ct_data *)s->dyn_dtree, dcodes-1); /* distance tree */
 212.864 +    Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent));
 212.865 +}
 212.866 +
 212.867 +/* ===========================================================================
 212.868 + * Send a stored block
 212.869 + */
 212.870 +void _tr_stored_block(s, buf, stored_len, eof)
 212.871 +    deflate_state *s;
 212.872 +    charf *buf;       /* input block */
 212.873 +    ulg stored_len;   /* length of input block */
 212.874 +    int eof;          /* true if this is the last block for a file */
 212.875 +{
 212.876 +    send_bits(s, (STORED_BLOCK<<1)+eof, 3);  /* send block type */
 212.877 +#ifdef DEBUG
 212.878 +    s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L;
 212.879 +    s->compressed_len += (stored_len + 4) << 3;
 212.880 +#endif
 212.881 +    copy_block(s, buf, (unsigned)stored_len, 1); /* with header */
 212.882 +}
 212.883 +
 212.884 +/* ===========================================================================
 212.885 + * Send one empty static block to give enough lookahead for inflate.
 212.886 + * This takes 10 bits, of which 7 may remain in the bit buffer.
 212.887 + * The current inflate code requires 9 bits of lookahead. If the
 212.888 + * last two codes for the previous block (real code plus EOB) were coded
 212.889 + * on 5 bits or less, inflate may have only 5+3 bits of lookahead to decode
 212.890 + * the last real code. In this case we send two empty static blocks instead
 212.891 + * of one. (There are no problems if the previous block is stored or fixed.)
 212.892 + * To simplify the code, we assume the worst case of last real code encoded
 212.893 + * on one bit only.
 212.894 + */
 212.895 +void _tr_align(s)
 212.896 +    deflate_state *s;
 212.897 +{
 212.898 +    send_bits(s, STATIC_TREES<<1, 3);
 212.899 +    send_code(s, END_BLOCK, static_ltree);
 212.900 +#ifdef DEBUG
 212.901 +    s->compressed_len += 10L; /* 3 for block type, 7 for EOB */
 212.902 +#endif
 212.903 +    bi_flush(s);
 212.904 +    /* Of the 10 bits for the empty block, we have already sent
 212.905 +     * (10 - bi_valid) bits. The lookahead for the last real code (before
 212.906 +     * the EOB of the previous block) was thus at least one plus the length
 212.907 +     * of the EOB plus what we have just sent of the empty static block.
 212.908 +     */
 212.909 +    if (1 + s->last_eob_len + 10 - s->bi_valid < 9) {
 212.910 +        send_bits(s, STATIC_TREES<<1, 3);
 212.911 +        send_code(s, END_BLOCK, static_ltree);
 212.912 +#ifdef DEBUG
 212.913 +        s->compressed_len += 10L;
 212.914 +#endif
 212.915 +        bi_flush(s);
 212.916 +    }
 212.917 +    s->last_eob_len = 7;
 212.918 +}
 212.919 +
 212.920 +/* ===========================================================================
 212.921 + * Determine the best encoding for the current block: dynamic trees, static
 212.922 + * trees or store, and output the encoded block to the zip file.
 212.923 + */
 212.924 +void _tr_flush_block(s, buf, stored_len, eof)
 212.925 +    deflate_state *s;
 212.926 +    charf *buf;       /* input block, or NULL if too old */
 212.927 +    ulg stored_len;   /* length of input block */
 212.928 +    int eof;          /* true if this is the last block for a file */
 212.929 +{
 212.930 +    ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */
 212.931 +    int max_blindex = 0;  /* index of last bit length code of non zero freq */
 212.932 +
 212.933 +    /* Build the Huffman trees unless a stored block is forced */
 212.934 +    if (s->level > 0) {
 212.935 +
 212.936 +        /* Check if the file is binary or text */
 212.937 +        if (stored_len > 0 && s->strm->data_type == Z_UNKNOWN)
 212.938 +            set_data_type(s);
 212.939 +
 212.940 +        /* Construct the literal and distance trees */
 212.941 +        build_tree(s, (tree_desc *)(&(s->l_desc)));
 212.942 +        Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len,
 212.943 +                s->static_len));
 212.944 +
 212.945 +        build_tree(s, (tree_desc *)(&(s->d_desc)));
 212.946 +        Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len,
 212.947 +                s->static_len));
 212.948 +        /* At this point, opt_len and static_len are the total bit lengths of
 212.949 +         * the compressed block data, excluding the tree representations.
 212.950 +         */
 212.951 +
 212.952 +        /* Build the bit length tree for the above two trees, and get the index
 212.953 +         * in bl_order of the last bit length code to send.
 212.954 +         */
 212.955 +        max_blindex = build_bl_tree(s);
 212.956 +
 212.957 +        /* Determine the best encoding. Compute the block lengths in bytes. */
 212.958 +        opt_lenb = (s->opt_len+3+7)>>3;
 212.959 +        static_lenb = (s->static_len+3+7)>>3;
 212.960 +
 212.961 +        Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ",
 212.962 +                opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,
 212.963 +                s->last_lit));
 212.964 +
 212.965 +        if (static_lenb <= opt_lenb) opt_lenb = static_lenb;
 212.966 +
 212.967 +    } else {
 212.968 +        Assert(buf != (char*)0, "lost buf");
 212.969 +        opt_lenb = static_lenb = stored_len + 5; /* force a stored block */
 212.970 +    }
 212.971 +
 212.972 +#ifdef FORCE_STORED
 212.973 +    if (buf != (char*)0) { /* force stored block */
 212.974 +#else
 212.975 +    if (stored_len+4 <= opt_lenb && buf != (char*)0) {
 212.976 +                       /* 4: two words for the lengths */
 212.977 +#endif
 212.978 +        /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.
 212.979 +         * Otherwise we can't have processed more than WSIZE input bytes since
 212.980 +         * the last block flush, because compression would have been
 212.981 +         * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to
 212.982 +         * transform a block into a stored block.
 212.983 +         */
 212.984 +        _tr_stored_block(s, buf, stored_len, eof);
 212.985 +
 212.986 +#ifdef FORCE_STATIC
 212.987 +    } else if (static_lenb >= 0) { /* force static trees */
 212.988 +#else
 212.989 +    } else if (s->strategy == Z_FIXED || static_lenb == opt_lenb) {
 212.990 +#endif
 212.991 +        send_bits(s, (STATIC_TREES<<1)+eof, 3);
 212.992 +        compress_block(s, (ct_data *)static_ltree, (ct_data *)static_dtree);
 212.993 +#ifdef DEBUG
 212.994 +        s->compressed_len += 3 + s->static_len;
 212.995 +#endif
 212.996 +    } else {
 212.997 +        send_bits(s, (DYN_TREES<<1)+eof, 3);
 212.998 +        send_all_trees(s, s->l_desc.max_code+1, s->d_desc.max_code+1,
 212.999 +                       max_blindex+1);
212.1000 +        compress_block(s, (ct_data *)s->dyn_ltree, (ct_data *)s->dyn_dtree);
212.1001 +#ifdef DEBUG
212.1002 +        s->compressed_len += 3 + s->opt_len;
212.1003 +#endif
212.1004 +    }
212.1005 +    Assert (s->compressed_len == s->bits_sent, "bad compressed size");
212.1006 +    /* The above check is made mod 2^32, for files larger than 512 MB
212.1007 +     * and uLong implemented on 32 bits.
212.1008 +     */
212.1009 +    init_block(s);
212.1010 +
212.1011 +    if (eof) {
212.1012 +        bi_windup(s);
212.1013 +#ifdef DEBUG
212.1014 +        s->compressed_len += 7;  /* align on byte boundary */
212.1015 +#endif
212.1016 +    }
212.1017 +    Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3,
212.1018 +           s->compressed_len-7*eof));
212.1019 +}
212.1020 +
212.1021 +/* ===========================================================================
212.1022 + * Save the match info and tally the frequency counts. Return true if
212.1023 + * the current block must be flushed.
212.1024 + */
212.1025 +int _tr_tally (s, dist, lc)
212.1026 +    deflate_state *s;
212.1027 +    unsigned dist;  /* distance of matched string */
212.1028 +    unsigned lc;    /* match length-MIN_MATCH or unmatched char (if dist==0) */
212.1029 +{
212.1030 +    s->d_buf[s->last_lit] = (ush)dist;
212.1031 +    s->l_buf[s->last_lit++] = (uch)lc;
212.1032 +    if (dist == 0) {
212.1033 +        /* lc is the unmatched char */
212.1034 +        s->dyn_ltree[lc].Freq++;
212.1035 +    } else {
212.1036 +        s->matches++;
212.1037 +        /* Here, lc is the match length - MIN_MATCH */
212.1038 +        dist--;             /* dist = match distance - 1 */
212.1039 +        Assert((ush)dist < (ush)MAX_DIST(s) &&
212.1040 +               (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&
212.1041 +               (ush)d_code(dist) < (ush)D_CODES,  "_tr_tally: bad match");
212.1042 +
212.1043 +        s->dyn_ltree[_length_code[lc]+LITERALS+1].Freq++;
212.1044 +        s->dyn_dtree[d_code(dist)].Freq++;
212.1045 +    }
212.1046 +
212.1047 +#ifdef TRUNCATE_BLOCK
212.1048 +    /* Try to guess if it is profitable to stop the current block here */
212.1049 +    if ((s->last_lit & 0x1fff) == 0 && s->level > 2) {
212.1050 +        /* Compute an upper bound for the compressed length */
212.1051 +        ulg out_length = (ulg)s->last_lit*8L;
212.1052 +        ulg in_length = (ulg)((long)s->strstart - s->block_start);
212.1053 +        int dcode;
212.1054 +        for (dcode = 0; dcode < D_CODES; dcode++) {
212.1055 +            out_length += (ulg)s->dyn_dtree[dcode].Freq *
212.1056 +                (5L+extra_dbits[dcode]);
212.1057 +        }
212.1058 +        out_length >>= 3;
212.1059 +        Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ",
212.1060 +               s->last_lit, in_length, out_length,
212.1061 +               100L - out_length*100L/in_length));
212.1062 +        if (s->matches < s->last_lit/2 && out_length < in_length/2) return 1;
212.1063 +    }
212.1064 +#endif
212.1065 +    return (s->last_lit == s->lit_bufsize-1);
212.1066 +    /* We avoid equality with lit_bufsize because of wraparound at 64K
212.1067 +     * on 16 bit machines and because stored blocks are restricted to
212.1068 +     * 64K-1 bytes.
212.1069 +     */
212.1070 +}
212.1071 +
212.1072 +/* ===========================================================================
212.1073 + * Send the block data compressed using the given Huffman trees
212.1074 + */
212.1075 +local void compress_block(s, ltree, dtree)
212.1076 +    deflate_state *s;
212.1077 +    ct_data *ltree; /* literal tree */
212.1078 +    ct_data *dtree; /* distance tree */
212.1079 +{
212.1080 +    unsigned dist;      /* distance of matched string */
212.1081 +    int lc;             /* match length or unmatched char (if dist == 0) */
212.1082 +    unsigned lx = 0;    /* running index in l_buf */
212.1083 +    unsigned code;      /* the code to send */
212.1084 +    int extra;          /* number of extra bits to send */
212.1085 +
212.1086 +    if (s->last_lit != 0) do {
212.1087 +        dist = s->d_buf[lx];
212.1088 +        lc = s->l_buf[lx++];
212.1089 +        if (dist == 0) {
212.1090 +            send_code(s, lc, ltree); /* send a literal byte */
212.1091 +            Tracecv(isgraph(lc), (stderr," '%c' ", lc));
212.1092 +        } else {
212.1093 +            /* Here, lc is the match length - MIN_MATCH */
212.1094 +            code = _length_code[lc];
212.1095 +            send_code(s, code+LITERALS+1, ltree); /* send the length code */
212.1096 +            extra = extra_lbits[code];
212.1097 +            if (extra != 0) {
212.1098 +                lc -= base_length[code];
212.1099 +                send_bits(s, lc, extra);       /* send the extra length bits */
212.1100 +            }
212.1101 +            dist--; /* dist is now the match distance - 1 */
212.1102 +            code = d_code(dist);
212.1103 +            Assert (code < D_CODES, "bad d_code");
212.1104 +
212.1105 +            send_code(s, code, dtree);       /* send the distance code */
212.1106 +            extra = extra_dbits[code];
212.1107 +            if (extra != 0) {
212.1108 +                dist -= base_dist[code];
212.1109 +                send_bits(s, dist, extra);   /* send the extra distance bits */
212.1110 +            }
212.1111 +        } /* literal or match pair ? */
212.1112 +
212.1113 +        /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */
212.1114 +        Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx,
212.1115 +               "pendingBuf overflow");
212.1116 +
212.1117 +    } while (lx < s->last_lit);
212.1118 +
212.1119 +    send_code(s, END_BLOCK, ltree);
212.1120 +    s->last_eob_len = ltree[END_BLOCK].Len;
212.1121 +}
212.1122 +
212.1123 +/* ===========================================================================
212.1124 + * Set the data type to BINARY or TEXT, using a crude approximation:
212.1125 + * set it to Z_TEXT if all symbols are either printable characters (33 to 255)
212.1126 + * or white spaces (9 to 13, or 32); or set it to Z_BINARY otherwise.
212.1127 + * IN assertion: the fields Freq of dyn_ltree are set.
212.1128 + */
212.1129 +local void set_data_type(s)
212.1130 +    deflate_state *s;
212.1131 +{
212.1132 +    int n;
212.1133 +
212.1134 +    for (n = 0; n < 9; n++)
212.1135 +        if (s->dyn_ltree[n].Freq != 0)
212.1136 +            break;
212.1137 +    if (n == 9)
212.1138 +        for (n = 14; n < 32; n++)
212.1139 +            if (s->dyn_ltree[n].Freq != 0)
212.1140 +                break;
212.1141 +    s->strm->data_type = (n == 32) ? Z_TEXT : Z_BINARY;
212.1142 +}
212.1143 +
212.1144 +/* ===========================================================================
212.1145 + * Reverse the first len bits of a code, using straightforward code (a faster
212.1146 + * method would use a table)
212.1147 + * IN assertion: 1 <= len <= 15
212.1148 + */
212.1149 +local unsigned bi_reverse(code, len)
212.1150 +    unsigned code; /* the value to invert */
212.1151 +    int len;       /* its bit length */
212.1152 +{
212.1153 +    register unsigned res = 0;
212.1154 +    do {
212.1155 +        res |= code & 1;
212.1156 +        code >>= 1, res <<= 1;
212.1157 +    } while (--len > 0);
212.1158 +    return res >> 1;
212.1159 +}
212.1160 +
212.1161 +/* ===========================================================================
212.1162 + * Flush the bit buffer, keeping at most 7 bits in it.
212.1163 + */
212.1164 +local void bi_flush(s)
212.1165 +    deflate_state *s;
212.1166 +{
212.1167 +    if (s->bi_valid == 16) {
212.1168 +        put_short(s, s->bi_buf);
212.1169 +        s->bi_buf = 0;
212.1170 +        s->bi_valid = 0;
212.1171 +    } else if (s->bi_valid >= 8) {
212.1172 +        put_byte(s, (Byte)s->bi_buf);
212.1173 +        s->bi_buf >>= 8;
212.1174 +        s->bi_valid -= 8;
212.1175 +    }
212.1176 +}
212.1177 +
212.1178 +/* ===========================================================================
212.1179 + * Flush the bit buffer and align the output on a byte boundary
212.1180 + */
212.1181 +local void bi_windup(s)
212.1182 +    deflate_state *s;
212.1183 +{
212.1184 +    if (s->bi_valid > 8) {
212.1185 +        put_short(s, s->bi_buf);
212.1186 +    } else if (s->bi_valid > 0) {
212.1187 +        put_byte(s, (Byte)s->bi_buf);
212.1188 +    }
212.1189 +    s->bi_buf = 0;
212.1190 +    s->bi_valid = 0;
212.1191 +#ifdef DEBUG
212.1192 +    s->bits_sent = (s->bits_sent+7) & ~7;
212.1193 +#endif
212.1194 +}
212.1195 +
212.1196 +/* ===========================================================================
212.1197 + * Copy a stored block, storing first the length and its
212.1198 + * one's complement if requested.
212.1199 + */
212.1200 +local void copy_block(s, buf, len, header)
212.1201 +    deflate_state *s;
212.1202 +    charf    *buf;    /* the input data */
212.1203 +    unsigned len;     /* its length */
212.1204 +    int      header;  /* true if block header must be written */
212.1205 +{
212.1206 +    bi_windup(s);        /* align on byte boundary */
212.1207 +    s->last_eob_len = 8; /* enough lookahead for inflate */
212.1208 +
212.1209 +    if (header) {
212.1210 +        put_short(s, (ush)len);
212.1211 +        put_short(s, (ush)~len);
212.1212 +#ifdef DEBUG
212.1213 +        s->bits_sent += 2*16;
212.1214 +#endif
212.1215 +    }
212.1216 +#ifdef DEBUG
212.1217 +    s->bits_sent += (ulg)len<<3;
212.1218 +#endif
212.1219 +    while (len--) {
212.1220 +        put_byte(s, *buf++);
212.1221 +    }
212.1222 +}
   213.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   213.2 +++ b/libs/zlib/trees.h	Sun Nov 01 00:36:56 2015 +0200
   213.3 @@ -0,0 +1,128 @@
   213.4 +/* header created automatically with -DGEN_TREES_H */
   213.5 +
   213.6 +local const ct_data static_ltree[L_CODES+2] = {
   213.7 +{{ 12},{  8}}, {{140},{  8}}, {{ 76},{  8}}, {{204},{  8}}, {{ 44},{  8}},
   213.8 +{{172},{  8}}, {{108},{  8}}, {{236},{  8}}, {{ 28},{  8}}, {{156},{  8}},
   213.9 +{{ 92},{  8}}, {{220},{  8}}, {{ 60},{  8}}, {{188},{  8}}, {{124},{  8}},
  213.10 +{{252},{  8}}, {{  2},{  8}}, {{130},{  8}}, {{ 66},{  8}}, {{194},{  8}},
  213.11 +{{ 34},{  8}}, {{162},{  8}}, {{ 98},{  8}}, {{226},{  8}}, {{ 18},{  8}},
  213.12 +{{146},{  8}}, {{ 82},{  8}}, {{210},{  8}}, {{ 50},{  8}}, {{178},{  8}},
  213.13 +{{114},{  8}}, {{242},{  8}}, {{ 10},{  8}}, {{138},{  8}}, {{ 74},{  8}},
  213.14 +{{202},{  8}}, {{ 42},{  8}}, {{170},{  8}}, {{106},{  8}}, {{234},{  8}},
  213.15 +{{ 26},{  8}}, {{154},{  8}}, {{ 90},{  8}}, {{218},{  8}}, {{ 58},{  8}},
  213.16 +{{186},{  8}}, {{122},{  8}}, {{250},{  8}}, {{  6},{  8}}, {{134},{  8}},
  213.17 +{{ 70},{  8}}, {{198},{  8}}, {{ 38},{  8}}, {{166},{  8}}, {{102},{  8}},
  213.18 +{{230},{  8}}, {{ 22},{  8}}, {{150},{  8}}, {{ 86},{  8}}, {{214},{  8}},
  213.19 +{{ 54},{  8}}, {{182},{  8}}, {{118},{  8}}, {{246},{  8}}, {{ 14},{  8}},
  213.20 +{{142},{  8}}, {{ 78},{  8}}, {{206},{  8}}, {{ 46},{  8}}, {{174},{  8}},
  213.21 +{{110},{  8}}, {{238},{  8}}, {{ 30},{  8}}, {{158},{  8}}, {{ 94},{  8}},
  213.22 +{{222},{  8}}, {{ 62},{  8}}, {{190},{  8}}, {{126},{  8}}, {{254},{  8}},
  213.23 +{{  1},{  8}}, {{129},{  8}}, {{ 65},{  8}}, {{193},{  8}}, {{ 33},{  8}},
  213.24 +{{161},{  8}}, {{ 97},{  8}}, {{225},{  8}}, {{ 17},{  8}}, {{145},{  8}},
  213.25 +{{ 81},{  8}}, {{209},{  8}}, {{ 49},{  8}}, {{177},{  8}}, {{113},{  8}},
  213.26 +{{241},{  8}}, {{  9},{  8}}, {{137},{  8}}, {{ 73},{  8}}, {{201},{  8}},
  213.27 +{{ 41},{  8}}, {{169},{  8}}, {{105},{  8}}, {{233},{  8}}, {{ 25},{  8}},
  213.28 +{{153},{  8}}, {{ 89},{  8}}, {{217},{  8}}, {{ 57},{  8}}, {{185},{  8}},
  213.29 +{{121},{  8}}, {{249},{  8}}, {{  5},{  8}}, {{133},{  8}}, {{ 69},{  8}},
  213.30 +{{197},{  8}}, {{ 37},{  8}}, {{165},{  8}}, {{101},{  8}}, {{229},{  8}},
  213.31 +{{ 21},{  8}}, {{149},{  8}}, {{ 85},{  8}}, {{213},{  8}}, {{ 53},{  8}},
  213.32 +{{181},{  8}}, {{117},{  8}}, {{245},{  8}}, {{ 13},{  8}}, {{141},{  8}},
  213.33 +{{ 77},{  8}}, {{205},{  8}}, {{ 45},{  8}}, {{173},{  8}}, {{109},{  8}},
  213.34 +{{237},{  8}}, {{ 29},{  8}}, {{157},{  8}}, {{ 93},{  8}}, {{221},{  8}},
  213.35 +{{ 61},{  8}}, {{189},{  8}}, {{125},{  8}}, {{253},{  8}}, {{ 19},{  9}},
  213.36 +{{275},{  9}}, {{147},{  9}}, {{403},{  9}}, {{ 83},{  9}}, {{339},{  9}},
  213.37 +{{211},{  9}}, {{467},{  9}}, {{ 51},{  9}}, {{307},{  9}}, {{179},{  9}},
  213.38 +{{435},{  9}}, {{115},{  9}}, {{371},{  9}}, {{243},{  9}}, {{499},{  9}},
  213.39 +{{ 11},{  9}}, {{267},{  9}}, {{139},{  9}}, {{395},{  9}}, {{ 75},{  9}},
  213.40 +{{331},{  9}}, {{203},{  9}}, {{459},{  9}}, {{ 43},{  9}}, {{299},{  9}},
  213.41 +{{171},{  9}}, {{427},{  9}}, {{107},{  9}}, {{363},{  9}}, {{235},{  9}},
  213.42 +{{491},{  9}}, {{ 27},{  9}}, {{283},{  9}}, {{155},{  9}}, {{411},{  9}},
  213.43 +{{ 91},{  9}}, {{347},{  9}}, {{219},{  9}}, {{475},{  9}}, {{ 59},{  9}},
  213.44 +{{315},{  9}}, {{187},{  9}}, {{443},{  9}}, {{123},{  9}}, {{379},{  9}},
  213.45 +{{251},{  9}}, {{507},{  9}}, {{  7},{  9}}, {{263},{  9}}, {{135},{  9}},
  213.46 +{{391},{  9}}, {{ 71},{  9}}, {{327},{  9}}, {{199},{  9}}, {{455},{  9}},
  213.47 +{{ 39},{  9}}, {{295},{  9}}, {{167},{  9}}, {{423},{  9}}, {{103},{  9}},
  213.48 +{{359},{  9}}, {{231},{  9}}, {{487},{  9}}, {{ 23},{  9}}, {{279},{  9}},
  213.49 +{{151},{  9}}, {{407},{  9}}, {{ 87},{  9}}, {{343},{  9}}, {{215},{  9}},
  213.50 +{{471},{  9}}, {{ 55},{  9}}, {{311},{  9}}, {{183},{  9}}, {{439},{  9}},
  213.51 +{{119},{  9}}, {{375},{  9}}, {{247},{  9}}, {{503},{  9}}, {{ 15},{  9}},
  213.52 +{{271},{  9}}, {{143},{  9}}, {{399},{  9}}, {{ 79},{  9}}, {{335},{  9}},
  213.53 +{{207},{  9}}, {{463},{  9}}, {{ 47},{  9}}, {{303},{  9}}, {{175},{  9}},
  213.54 +{{431},{  9}}, {{111},{  9}}, {{367},{  9}}, {{239},{  9}}, {{495},{  9}},
  213.55 +{{ 31},{  9}}, {{287},{  9}}, {{159},{  9}}, {{415},{  9}}, {{ 95},{  9}},
  213.56 +{{351},{  9}}, {{223},{  9}}, {{479},{  9}}, {{ 63},{  9}}, {{319},{  9}},
  213.57 +{{191},{  9}}, {{447},{  9}}, {{127},{  9}}, {{383},{  9}}, {{255},{  9}},
  213.58 +{{511},{  9}}, {{  0},{  7}}, {{ 64},{  7}}, {{ 32},{  7}}, {{ 96},{  7}},
  213.59 +{{ 16},{  7}}, {{ 80},{  7}}, {{ 48},{  7}}, {{112},{  7}}, {{  8},{  7}},
  213.60 +{{ 72},{  7}}, {{ 40},{  7}}, {{104},{  7}}, {{ 24},{  7}}, {{ 88},{  7}},
  213.61 +{{ 56},{  7}}, {{120},{  7}}, {{  4},{  7}}, {{ 68},{  7}}, {{ 36},{  7}},
  213.62 +{{100},{  7}}, {{ 20},{  7}}, {{ 84},{  7}}, {{ 52},{  7}}, {{116},{  7}},
  213.63 +{{  3},{  8}}, {{131},{  8}}, {{ 67},{  8}}, {{195},{  8}}, {{ 35},{  8}},
  213.64 +{{163},{  8}}, {{ 99},{  8}}, {{227},{  8}}
  213.65 +};
  213.66 +
  213.67 +local const ct_data static_dtree[D_CODES] = {
  213.68 +{{ 0},{ 5}}, {{16},{ 5}}, {{ 8},{ 5}}, {{24},{ 5}}, {{ 4},{ 5}},
  213.69 +{{20},{ 5}}, {{12},{ 5}}, {{28},{ 5}}, {{ 2},{ 5}}, {{18},{ 5}},
  213.70 +{{10},{ 5}}, {{26},{ 5}}, {{ 6},{ 5}}, {{22},{ 5}}, {{14},{ 5}},
  213.71 +{{30},{ 5}}, {{ 1},{ 5}}, {{17},{ 5}}, {{ 9},{ 5}}, {{25},{ 5}},
  213.72 +{{ 5},{ 5}}, {{21},{ 5}}, {{13},{ 5}}, {{29},{ 5}}, {{ 3},{ 5}},
  213.73 +{{19},{ 5}}, {{11},{ 5}}, {{27},{ 5}}, {{ 7},{ 5}}, {{23},{ 5}}
  213.74 +};
  213.75 +
  213.76 +const uch _dist_code[DIST_CODE_LEN] = {
  213.77 + 0,  1,  2,  3,  4,  4,  5,  5,  6,  6,  6,  6,  7,  7,  7,  7,  8,  8,  8,  8,
  213.78 + 8,  8,  8,  8,  9,  9,  9,  9,  9,  9,  9,  9, 10, 10, 10, 10, 10, 10, 10, 10,
  213.79 +10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  213.80 +11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
  213.81 +12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13,
  213.82 +13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
  213.83 +13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
  213.84 +14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
  213.85 +14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
  213.86 +14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15,
  213.87 +15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
  213.88 +15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
  213.89 +15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  0,  0, 16, 17,
  213.90 +18, 18, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22,
  213.91 +23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
  213.92 +24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
  213.93 +26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
  213.94 +26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27,
  213.95 +27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
  213.96 +27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
  213.97 +28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
  213.98 +28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
  213.99 +28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
 213.100 +29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
 213.101 +29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
 213.102 +29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29
 213.103 +};
 213.104 +
 213.105 +const uch _length_code[MAX_MATCH-MIN_MATCH+1]= {
 213.106 + 0,  1,  2,  3,  4,  5,  6,  7,  8,  8,  9,  9, 10, 10, 11, 11, 12, 12, 12, 12,
 213.107 +13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16,
 213.108 +17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19,
 213.109 +19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
 213.110 +21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22,
 213.111 +22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23,
 213.112 +23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
 213.113 +24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
 213.114 +25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
 213.115 +25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26,
 213.116 +26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
 213.117 +26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
 213.118 +27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28
 213.119 +};
 213.120 +
 213.121 +local const int base_length[LENGTH_CODES] = {
 213.122 +0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56,
 213.123 +64, 80, 96, 112, 128, 160, 192, 224, 0
 213.124 +};
 213.125 +
 213.126 +local const int base_dist[D_CODES] = {
 213.127 +    0,     1,     2,     3,     4,     6,     8,    12,    16,    24,
 213.128 +   32,    48,    64,    96,   128,   192,   256,   384,   512,   768,
 213.129 + 1024,  1536,  2048,  3072,  4096,  6144,  8192, 12288, 16384, 24576
 213.130 +};
 213.131 +
   214.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   214.2 +++ b/libs/zlib/uncompr.c	Sun Nov 01 00:36:56 2015 +0200
   214.3 @@ -0,0 +1,61 @@
   214.4 +/* uncompr.c -- decompress a memory buffer
   214.5 + * Copyright (C) 1995-2003 Jean-loup Gailly.
   214.6 + * For conditions of distribution and use, see copyright notice in zlib.h
   214.7 + */
   214.8 +
   214.9 +/* @(#) $Id$ */
  214.10 +
  214.11 +#define ZLIB_INTERNAL
  214.12 +#include "zlib.h"
  214.13 +
  214.14 +/* ===========================================================================
  214.15 +     Decompresses the source buffer into the destination buffer.  sourceLen is
  214.16 +   the byte length of the source buffer. Upon entry, destLen is the total
  214.17 +   size of the destination buffer, which must be large enough to hold the
  214.18 +   entire uncompressed data. (The size of the uncompressed data must have
  214.19 +   been saved previously by the compressor and transmitted to the decompressor
  214.20 +   by some mechanism outside the scope of this compression library.)
  214.21 +   Upon exit, destLen is the actual size of the compressed buffer.
  214.22 +     This function can be used to decompress a whole file at once if the
  214.23 +   input file is mmap'ed.
  214.24 +
  214.25 +     uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
  214.26 +   enough memory, Z_BUF_ERROR if there was not enough room in the output
  214.27 +   buffer, or Z_DATA_ERROR if the input data was corrupted.
  214.28 +*/
  214.29 +int ZEXPORT uncompress (dest, destLen, source, sourceLen)
  214.30 +    Bytef *dest;
  214.31 +    uLongf *destLen;
  214.32 +    const Bytef *source;
  214.33 +    uLong sourceLen;
  214.34 +{
  214.35 +    z_stream stream;
  214.36 +    int err;
  214.37 +
  214.38 +    stream.next_in = (Bytef*)source;
  214.39 +    stream.avail_in = (uInt)sourceLen;
  214.40 +    /* Check for source > 64K on 16-bit machine: */
  214.41 +    if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;
  214.42 +
  214.43 +    stream.next_out = dest;
  214.44 +    stream.avail_out = (uInt)*destLen;
  214.45 +    if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR;
  214.46 +
  214.47 +    stream.zalloc = (alloc_func)0;
  214.48 +    stream.zfree = (free_func)0;
  214.49 +
  214.50 +    err = inflateInit(&stream);
  214.51 +    if (err != Z_OK) return err;
  214.52 +
  214.53 +    err = inflate(&stream, Z_FINISH);
  214.54 +    if (err != Z_STREAM_END) {
  214.55 +        inflateEnd(&stream);
  214.56 +        if (err == Z_NEED_DICT || (err == Z_BUF_ERROR && stream.avail_in == 0))
  214.57 +            return Z_DATA_ERROR;
  214.58 +        return err;
  214.59 +    }
  214.60 +    *destLen = stream.total_out;
  214.61 +
  214.62 +    err = inflateEnd(&stream);
  214.63 +    return err;
  214.64 +}
   215.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   215.2 +++ b/libs/zlib/zconf.h	Sun Nov 01 00:36:56 2015 +0200
   215.3 @@ -0,0 +1,332 @@
   215.4 +/* zconf.h -- configuration of the zlib compression library
   215.5 + * Copyright (C) 1995-2005 Jean-loup Gailly.
   215.6 + * For conditions of distribution and use, see copyright notice in zlib.h
   215.7 + */
   215.8 +
   215.9 +/* @(#) $Id$ */
  215.10 +
  215.11 +#ifndef ZCONF_H
  215.12 +#define ZCONF_H
  215.13 +
  215.14 +/*
  215.15 + * If you *really* need a unique prefix for all types and library functions,
  215.16 + * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
  215.17 + */
  215.18 +#ifdef Z_PREFIX
  215.19 +#  define deflateInit_          z_deflateInit_
  215.20 +#  define deflate               z_deflate
  215.21 +#  define deflateEnd            z_deflateEnd
  215.22 +#  define inflateInit_          z_inflateInit_
  215.23 +#  define inflate               z_inflate
  215.24 +#  define inflateEnd            z_inflateEnd
  215.25 +#  define deflateInit2_         z_deflateInit2_
  215.26 +#  define deflateSetDictionary  z_deflateSetDictionary
  215.27 +#  define deflateCopy           z_deflateCopy
  215.28 +#  define deflateReset          z_deflateReset
  215.29 +#  define deflateParams         z_deflateParams
  215.30 +#  define deflateBound          z_deflateBound
  215.31 +#  define deflatePrime          z_deflatePrime
  215.32 +#  define inflateInit2_         z_inflateInit2_
  215.33 +#  define inflateSetDictionary  z_inflateSetDictionary
  215.34 +#  define inflateSync           z_inflateSync
  215.35 +#  define inflateSyncPoint      z_inflateSyncPoint
  215.36 +#  define inflateCopy           z_inflateCopy
  215.37 +#  define inflateReset          z_inflateReset
  215.38 +#  define inflateBack           z_inflateBack
  215.39 +#  define inflateBackEnd        z_inflateBackEnd
  215.40 +#  define compress              z_compress
  215.41 +#  define compress2             z_compress2
  215.42 +#  define compressBound         z_compressBound
  215.43 +#  define uncompress            z_uncompress
  215.44 +#  define adler32               z_adler32
  215.45 +#  define crc32                 z_crc32
  215.46 +#  define get_crc_table         z_get_crc_table
  215.47 +#  define zError                z_zError
  215.48 +
  215.49 +#  define alloc_func            z_alloc_func
  215.50 +#  define free_func             z_free_func
  215.51 +#  define in_func               z_in_func
  215.52 +#  define out_func              z_out_func
  215.53 +#  define Byte                  z_Byte
  215.54 +#  define uInt                  z_uInt
  215.55 +#  define uLong                 z_uLong
  215.56 +#  define Bytef                 z_Bytef
  215.57 +#  define charf                 z_charf
  215.58 +#  define intf                  z_intf
  215.59 +#  define uIntf                 z_uIntf
  215.60 +#  define uLongf                z_uLongf
  215.61 +#  define voidpf                z_voidpf
  215.62 +#  define voidp                 z_voidp
  215.63 +#endif
  215.64 +
  215.65 +#if defined(__MSDOS__) && !defined(MSDOS)
  215.66 +#  define MSDOS
  215.67 +#endif
  215.68 +#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
  215.69 +#  define OS2
  215.70 +#endif
  215.71 +#if defined(_WINDOWS) && !defined(WINDOWS)
  215.72 +#  define WINDOWS
  215.73 +#endif
  215.74 +#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
  215.75 +#  ifndef WIN32
  215.76 +#    define WIN32
  215.77 +#  endif
  215.78 +#endif
  215.79 +#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
  215.80 +#  if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
  215.81 +#    ifndef SYS16BIT
  215.82 +#      define SYS16BIT
  215.83 +#    endif
  215.84 +#  endif
  215.85 +#endif
  215.86 +
  215.87 +/*
  215.88 + * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
  215.89 + * than 64k bytes at a time (needed on systems with 16-bit int).
  215.90 + */
  215.91 +#ifdef SYS16BIT
  215.92 +#  define MAXSEG_64K
  215.93 +#endif
  215.94 +#ifdef MSDOS
  215.95 +#  define UNALIGNED_OK
  215.96 +#endif
  215.97 +
  215.98 +#ifdef __STDC_VERSION__
  215.99 +#  ifndef STDC
 215.100 +#    define STDC
 215.101 +#  endif
 215.102 +#  if __STDC_VERSION__ >= 199901L
 215.103 +#    ifndef STDC99
 215.104 +#      define STDC99
 215.105 +#    endif
 215.106 +#  endif
 215.107 +#endif
 215.108 +#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
 215.109 +#  define STDC
 215.110 +#endif
 215.111 +#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
 215.112 +#  define STDC
 215.113 +#endif
 215.114 +#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
 215.115 +#  define STDC
 215.116 +#endif
 215.117 +#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
 215.118 +#  define STDC
 215.119 +#endif
 215.120 +
 215.121 +#if defined(__OS400__) && !defined(STDC)    /* iSeries (formerly AS/400). */
 215.122 +#  define STDC
 215.123 +#endif
 215.124 +
 215.125 +#ifndef STDC
 215.126 +#  ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
 215.127 +#    define const       /* note: need a more gentle solution here */
 215.128 +#  endif
 215.129 +#endif
 215.130 +
 215.131 +/* Some Mac compilers merge all .h files incorrectly: */
 215.132 +#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
 215.133 +#  define NO_DUMMY_DECL
 215.134 +#endif
 215.135 +
 215.136 +/* Maximum value for memLevel in deflateInit2 */
 215.137 +#ifndef MAX_MEM_LEVEL
 215.138 +#  ifdef MAXSEG_64K
 215.139 +#    define MAX_MEM_LEVEL 8
 215.140 +#  else
 215.141 +#    define MAX_MEM_LEVEL 9
 215.142 +#  endif
 215.143 +#endif
 215.144 +
 215.145 +/* Maximum value for windowBits in deflateInit2 and inflateInit2.
 215.146 + * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
 215.147 + * created by gzip. (Files created by minigzip can still be extracted by
 215.148 + * gzip.)
 215.149 + */
 215.150 +#ifndef MAX_WBITS
 215.151 +#  define MAX_WBITS   15 /* 32K LZ77 window */
 215.152 +#endif
 215.153 +
 215.154 +/* The memory requirements for deflate are (in bytes):
 215.155 +            (1 << (windowBits+2)) +  (1 << (memLevel+9))
 215.156 + that is: 128K for windowBits=15  +  128K for memLevel = 8  (default values)
 215.157 + plus a few kilobytes for small objects. For example, if you want to reduce
 215.158 + the default memory requirements from 256K to 128K, compile with
 215.159 +     make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
 215.160 + Of course this will generally degrade compression (there's no free lunch).
 215.161 +
 215.162 +   The memory requirements for inflate are (in bytes) 1 << windowBits
 215.163 + that is, 32K for windowBits=15 (default value) plus a few kilobytes
 215.164 + for small objects.
 215.165 +*/
 215.166 +
 215.167 +                        /* Type declarations */
 215.168 +
 215.169 +#ifndef OF /* function prototypes */
 215.170 +#  ifdef STDC
 215.171 +#    define OF(args)  args
 215.172 +#  else
 215.173 +#    define OF(args)  ()
 215.174 +#  endif
 215.175 +#endif
 215.176 +
 215.177 +/* The following definitions for FAR are needed only for MSDOS mixed
 215.178 + * model programming (small or medium model with some far allocations).
 215.179 + * This was tested only with MSC; for other MSDOS compilers you may have
 215.180 + * to define NO_MEMCPY in zutil.h.  If you don't need the mixed model,
 215.181 + * just define FAR to be empty.
 215.182 + */
 215.183 +#ifdef SYS16BIT
 215.184 +#  if defined(M_I86SM) || defined(M_I86MM)
 215.185 +     /* MSC small or medium model */
 215.186 +#    define SMALL_MEDIUM
 215.187 +#    ifdef _MSC_VER
 215.188 +#      define FAR _far
 215.189 +#    else
 215.190 +#      define FAR far
 215.191 +#    endif
 215.192 +#  endif
 215.193 +#  if (defined(__SMALL__) || defined(__MEDIUM__))
 215.194 +     /* Turbo C small or medium model */
 215.195 +#    define SMALL_MEDIUM
 215.196 +#    ifdef __BORLANDC__
 215.197 +#      define FAR _far
 215.198 +#    else
 215.199 +#      define FAR far
 215.200 +#    endif
 215.201 +#  endif
 215.202 +#endif
 215.203 +
 215.204 +#if defined(WINDOWS) || defined(WIN32)
 215.205 +   /* If building or using zlib as a DLL, define ZLIB_DLL.
 215.206 +    * This is not mandatory, but it offers a little performance increase.
 215.207 +    */
 215.208 +#  ifdef ZLIB_DLL
 215.209 +#    if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
 215.210 +#      ifdef ZLIB_INTERNAL
 215.211 +#        define ZEXTERN extern __declspec(dllexport)
 215.212 +#      else
 215.213 +#        define ZEXTERN extern __declspec(dllimport)
 215.214 +#      endif
 215.215 +#    endif
 215.216 +#  endif  /* ZLIB_DLL */
 215.217 +   /* If building or using zlib with the WINAPI/WINAPIV calling convention,
 215.218 +    * define ZLIB_WINAPI.
 215.219 +    * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
 215.220 +    */
 215.221 +#  ifdef ZLIB_WINAPI
 215.222 +#    ifdef FAR
 215.223 +#      undef FAR
 215.224 +#    endif
 215.225 +#    include <windows.h>
 215.226 +     /* No need for _export, use ZLIB.DEF instead. */
 215.227 +     /* For complete Windows compatibility, use WINAPI, not __stdcall. */
 215.228 +#    define ZEXPORT WINAPI
 215.229 +#    ifdef WIN32
 215.230 +#      define ZEXPORTVA WINAPIV
 215.231 +#    else
 215.232 +#      define ZEXPORTVA FAR CDECL
 215.233 +#    endif
 215.234 +#  endif
 215.235 +#endif
 215.236 +
 215.237 +#if defined (__BEOS__)
 215.238 +#  ifdef ZLIB_DLL
 215.239 +#    ifdef ZLIB_INTERNAL
 215.240 +#      define ZEXPORT   __declspec(dllexport)
 215.241 +#      define ZEXPORTVA __declspec(dllexport)
 215.242 +#    else
 215.243 +#      define ZEXPORT   __declspec(dllimport)
 215.244 +#      define ZEXPORTVA __declspec(dllimport)
 215.245 +#    endif
 215.246 +#  endif
 215.247 +#endif
 215.248 +
 215.249 +#ifndef ZEXTERN
 215.250 +#  define ZEXTERN extern
 215.251 +#endif
 215.252 +#ifndef ZEXPORT
 215.253 +#  define ZEXPORT
 215.254 +#endif
 215.255 +#ifndef ZEXPORTVA
 215.256 +#  define ZEXPORTVA
 215.257 +#endif
 215.258 +
 215.259 +#ifndef FAR
 215.260 +#  define FAR
 215.261 +#endif
 215.262 +
 215.263 +#if !defined(__MACTYPES__)
 215.264 +typedef unsigned char  Byte;  /* 8 bits */
 215.265 +#endif
 215.266 +typedef unsigned int   uInt;  /* 16 bits or more */
 215.267 +typedef unsigned long  uLong; /* 32 bits or more */
 215.268 +
 215.269 +#ifdef SMALL_MEDIUM
 215.270 +   /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
 215.271 +#  define Bytef Byte FAR
 215.272 +#else
 215.273 +   typedef Byte  FAR Bytef;
 215.274 +#endif
 215.275 +typedef char  FAR charf;
 215.276 +typedef int   FAR intf;
 215.277 +typedef uInt  FAR uIntf;
 215.278 +typedef uLong FAR uLongf;
 215.279 +
 215.280 +#ifdef STDC
 215.281 +   typedef void const *voidpc;
 215.282 +   typedef void FAR   *voidpf;
 215.283 +   typedef void       *voidp;
 215.284 +#else
 215.285 +   typedef Byte const *voidpc;
 215.286 +   typedef Byte FAR   *voidpf;
 215.287 +   typedef Byte       *voidp;
 215.288 +#endif
 215.289 +
 215.290 +#if 0           /* HAVE_UNISTD_H -- this line is updated by ./configure */
 215.291 +#  include <sys/types.h> /* for off_t */
 215.292 +#  include <unistd.h>    /* for SEEK_* and off_t */
 215.293 +#  ifdef VMS
 215.294 +#    include <unixio.h>   /* for off_t */
 215.295 +#  endif
 215.296 +#  define z_off_t off_t
 215.297 +#endif
 215.298 +#ifndef SEEK_SET
 215.299 +#  define SEEK_SET        0       /* Seek from beginning of file.  */
 215.300 +#  define SEEK_CUR        1       /* Seek from current position.  */
 215.301 +#  define SEEK_END        2       /* Set file pointer to EOF plus "offset" */
 215.302 +#endif
 215.303 +#ifndef z_off_t
 215.304 +#  define z_off_t long
 215.305 +#endif
 215.306 +
 215.307 +#if defined(__OS400__)
 215.308 +#  define NO_vsnprintf
 215.309 +#endif
 215.310 +
 215.311 +#if defined(__MVS__)
 215.312 +#  define NO_vsnprintf
 215.313 +#  ifdef FAR
 215.314 +#    undef FAR
 215.315 +#  endif
 215.316 +#endif
 215.317 +
 215.318 +/* MVS linker does not support external names larger than 8 bytes */
 215.319 +#if defined(__MVS__)
 215.320 +#   pragma map(deflateInit_,"DEIN")
 215.321 +#   pragma map(deflateInit2_,"DEIN2")
 215.322 +#   pragma map(deflateEnd,"DEEND")
 215.323 +#   pragma map(deflateBound,"DEBND")
 215.324 +#   pragma map(inflateInit_,"ININ")
 215.325 +#   pragma map(inflateInit2_,"ININ2")
 215.326 +#   pragma map(inflateEnd,"INEND")
 215.327 +#   pragma map(inflateSync,"INSY")
 215.328 +#   pragma map(inflateSetDictionary,"INSEDI")
 215.329 +#   pragma map(compressBound,"CMBND")
 215.330 +#   pragma map(inflate_table,"INTABL")
 215.331 +#   pragma map(inflate_fast,"INFA")
 215.332 +#   pragma map(inflate_copyright,"INCOPY")
 215.333 +#endif
 215.334 +
 215.335 +#endif /* ZCONF_H */
   216.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   216.2 +++ b/libs/zlib/zlib.h	Sun Nov 01 00:36:56 2015 +0200
   216.3 @@ -0,0 +1,1357 @@
   216.4 +/* zlib.h -- interface of the 'zlib' general purpose compression library
   216.5 +  version 1.2.3, July 18th, 2005
   216.6 +
   216.7 +  Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler
   216.8 +
   216.9 +  This software is provided 'as-is', without any express or implied
  216.10 +  warranty.  In no event will the authors be held liable for any damages
  216.11 +  arising from the use of this software.
  216.12 +
  216.13 +  Permission is granted to anyone to use this software for any purpose,
  216.14 +  including commercial applications, and to alter it and redistribute it
  216.15 +  freely, subject to the following restrictions:
  216.16 +
  216.17 +  1. The origin of this software must not be misrepresented; you must not
  216.18 +     claim that you wrote the original software. If you use this software
  216.19 +     in a product, an acknowledgment in the product documentation would be
  216.20 +     appreciated but is not required.
  216.21 +  2. Altered source versions must be plainly marked as such, and must not be
  216.22 +     misrepresented as being the original software.
  216.23 +  3. This notice may not be removed or altered from any source distribution.
  216.24 +
  216.25 +  Jean-loup Gailly        Mark Adler
  216.26 +  jloup@gzip.org          madler@alumni.caltech.edu
  216.27 +
  216.28 +
  216.29 +  The data format used by the zlib library is described by RFCs (Request for
  216.30 +  Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt
  216.31 +  (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
  216.32 +*/
  216.33 +
  216.34 +#ifndef ZLIB_H
  216.35 +#define ZLIB_H
  216.36 +
  216.37 +#include "zconf.h"
  216.38 +
  216.39 +#ifdef __cplusplus
  216.40 +extern "C" {
  216.41 +#endif
  216.42 +
  216.43 +#define ZLIB_VERSION "1.2.3"
  216.44 +#define ZLIB_VERNUM 0x1230
  216.45 +
  216.46 +/*
  216.47 +     The 'zlib' compression library provides in-memory compression and
  216.48 +  decompression functions, including integrity checks of the uncompressed
  216.49 +  data.  This version of the library supports only one compression method
  216.50 +  (deflation) but other algorithms will be added later and will have the same
  216.51 +  stream interface.
  216.52 +
  216.53 +     Compression can be done in a single step if the buffers are large
  216.54 +  enough (for example if an input file is mmap'ed), or can be done by
  216.55 +  repeated calls of the compression function.  In the latter case, the
  216.56 +  application must provide more input and/or consume the output
  216.57 +  (providing more output space) before each call.
  216.58 +
  216.59 +     The compressed data format used by default by the in-memory functions is
  216.60 +  the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped
  216.61 +  around a deflate stream, which is itself documented in RFC 1951.
  216.62 +
  216.63 +     The library also supports reading and writing files in gzip (.gz) format
  216.64 +  with an interface similar to that of stdio using the functions that start
  216.65 +  with "gz".  The gzip format is different from the zlib format.  gzip is a
  216.66 +  gzip wrapper, documented in RFC 1952, wrapped around a deflate stream.
  216.67 +
  216.68 +     This library can optionally read and write gzip streams in memory as well.
  216.69 +
  216.70 +     The zlib format was designed to be compact and fast for use in memory
  216.71 +  and on communications channels.  The gzip format was designed for single-
  216.72 +  file compression on file systems, has a larger header than zlib to maintain
  216.73 +  directory information, and uses a different, slower check method than zlib.
  216.74 +
  216.75 +     The library does not install any signal handler. The decoder checks
  216.76 +  the consistency of the compressed data, so the library should never
  216.77 +  crash even in case of corrupted input.
  216.78 +*/
  216.79 +
  216.80 +typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
  216.81 +typedef void   (*free_func)  OF((voidpf opaque, voidpf address));
  216.82 +
  216.83 +struct internal_state;
  216.84 +
  216.85 +typedef struct z_stream_s {
  216.86 +    Bytef    *next_in;  /* next input byte */
  216.87 +    uInt     avail_in;  /* number of bytes available at next_in */
  216.88 +    uLong    total_in;  /* total nb of input bytes read so far */
  216.89 +
  216.90 +    Bytef    *next_out; /* next output byte should be put there */
  216.91 +    uInt     avail_out; /* remaining free space at next_out */
  216.92 +    uLong    total_out; /* total nb of bytes output so far */
  216.93 +
  216.94 +    char     *msg;      /* last error message, NULL if no error */
  216.95 +    struct internal_state FAR *state; /* not visible by applications */
  216.96 +
  216.97 +    alloc_func zalloc;  /* used to allocate the internal state */
  216.98 +    free_func  zfree;   /* used to free the internal state */
  216.99 +    voidpf     opaque;  /* private data object passed to zalloc and zfree */
 216.100 +
 216.101 +    int     data_type;  /* best guess about the data type: binary or text */
 216.102 +    uLong   adler;      /* adler32 value of the uncompressed data */
 216.103 +    uLong   reserved;   /* reserved for future use */
 216.104 +} z_stream;
 216.105 +
 216.106 +typedef z_stream FAR *z_streamp;
 216.107 +
 216.108 +/*
 216.109 +     gzip header information passed to and from zlib routines.  See RFC 1952
 216.110 +  for more details on the meanings of these fields.
 216.111 +*/
 216.112 +typedef struct gz_header_s {
 216.113 +    int     text;       /* true if compressed data believed to be text */
 216.114 +    uLong   time;       /* modification time */
 216.115 +    int     xflags;     /* extra flags (not used when writing a gzip file) */
 216.116 +    int     os;         /* operating system */
 216.117 +    Bytef   *extra;     /* pointer to extra field or Z_NULL if none */
 216.118 +    uInt    extra_len;  /* extra field length (valid if extra != Z_NULL) */
 216.119 +    uInt    extra_max;  /* space at extra (only when reading header) */
 216.120 +    Bytef   *name;      /* pointer to zero-terminated file name or Z_NULL */
 216.121 +    uInt    name_max;   /* space at name (only when reading header) */
 216.122 +    Bytef   *comment;   /* pointer to zero-terminated comment or Z_NULL */
 216.123 +    uInt    comm_max;   /* space at comment (only when reading header) */
 216.124 +    int     hcrc;       /* true if there was or will be a header crc */
 216.125 +    int     done;       /* true when done reading gzip header (not used
 216.126 +                           when writing a gzip file) */
 216.127 +} gz_header;
 216.128 +
 216.129 +typedef gz_header FAR *gz_headerp;
 216.130 +
 216.131 +/*
 216.132 +   The application must update next_in and avail_in when avail_in has
 216.133 +   dropped to zero. It must update next_out and avail_out when avail_out
 216.134 +   has dropped to zero. The application must initialize zalloc, zfree and
 216.135 +   opaque before calling the init function. All other fields are set by the
 216.136 +   compression library and must not be updated by the application.
 216.137 +
 216.138 +   The opaque value provided by the application will be passed as the first
 216.139 +   parameter for calls of zalloc and zfree. This can be useful for custom
 216.140 +   memory management. The compression library attaches no meaning to the
 216.141 +   opaque value.
 216.142 +
 216.143 +   zalloc must return Z_NULL if there is not enough memory for the object.
 216.144 +   If zlib is used in a multi-threaded application, zalloc and zfree must be
 216.145 +   thread safe.
 216.146 +
 216.147 +   On 16-bit systems, the functions zalloc and zfree must be able to allocate
 216.148 +   exactly 65536 bytes, but will not be required to allocate more than this
 216.149 +   if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS,
 216.150 +   pointers returned by zalloc for objects of exactly 65536 bytes *must*
 216.151 +   have their offset normalized to zero. The default allocation function
 216.152 +   provided by this library ensures this (see zutil.c). To reduce memory
 216.153 +   requirements and avoid any allocation of 64K objects, at the expense of
 216.154 +   compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h).
 216.155 +
 216.156 +   The fields total_in and total_out can be used for statistics or
 216.157 +   progress reports. After compression, total_in holds the total size of
 216.158 +   the uncompressed data and may be saved for use in the decompressor
 216.159 +   (particularly if the decompressor wants to decompress everything in
 216.160 +   a single step).
 216.161 +*/
 216.162 +
 216.163 +                        /* constants */
 216.164 +
 216.165 +#define Z_NO_FLUSH      0
 216.166 +#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */
 216.167 +#define Z_SYNC_FLUSH    2
 216.168 +#define Z_FULL_FLUSH    3
 216.169 +#define Z_FINISH        4
 216.170 +#define Z_BLOCK         5
 216.171 +/* Allowed flush values; see deflate() and inflate() below for details */
 216.172 +
 216.173 +#define Z_OK            0
 216.174 +#define Z_STREAM_END    1
 216.175 +#define Z_NEED_DICT     2
 216.176 +#define Z_ERRNO        (-1)
 216.177 +#define Z_STREAM_ERROR (-2)
 216.178 +#define Z_DATA_ERROR   (-3)
 216.179 +#define Z_MEM_ERROR    (-4)
 216.180 +#define Z_BUF_ERROR    (-5)
 216.181 +#define Z_VERSION_ERROR (-6)
 216.182 +/* Return codes for the compression/decompression functions. Negative
 216.183 + * values are errors, positive values are used for special but normal events.
 216.184 + */
 216.185 +
 216.186 +#define Z_NO_COMPRESSION         0
 216.187 +#define Z_BEST_SPEED             1
 216.188 +#define Z_BEST_COMPRESSION       9
 216.189 +#define Z_DEFAULT_COMPRESSION  (-1)
 216.190 +/* compression levels */
 216.191 +
 216.192 +#define Z_FILTERED            1
 216.193 +#define Z_HUFFMAN_ONLY        2
 216.194 +#define Z_RLE                 3
 216.195 +#define Z_FIXED               4
 216.196 +#define Z_DEFAULT_STRATEGY    0
 216.197 +/* compression strategy; see deflateInit2() below for details */
 216.198 +
 216.199 +#define Z_BINARY   0
 216.200 +#define Z_TEXT     1
 216.201 +#define Z_ASCII    Z_TEXT   /* for compatibility with 1.2.2 and earlier */
 216.202 +#define Z_UNKNOWN  2
 216.203 +/* Possible values of the data_type field (though see inflate()) */
 216.204 +
 216.205 +#define Z_DEFLATED   8
 216.206 +/* The deflate compression method (the only one supported in this version) */
 216.207 +
 216.208 +#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
 216.209 +
 216.210 +#define zlib_version zlibVersion()
 216.211 +/* for compatibility with versions < 1.0.2 */
 216.212 +
 216.213 +                        /* basic functions */
 216.214 +
 216.215 +ZEXTERN const char * ZEXPORT zlibVersion OF((void));
 216.216 +/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
 216.217 +   If the first character differs, the library code actually used is
 216.218 +   not compatible with the zlib.h header file used by the application.
 216.219 +   This check is automatically made by deflateInit and inflateInit.
 216.220 + */
 216.221 +
 216.222 +/*
 216.223 +ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
 216.224 +
 216.225 +     Initializes the internal stream state for compression. The fields
 216.226 +   zalloc, zfree and opaque must be initialized before by the caller.
 216.227 +   If zalloc and zfree are set to Z_NULL, deflateInit updates them to
 216.228 +   use default allocation functions.
 216.229 +
 216.230 +     The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:
 216.231 +   1 gives best speed, 9 gives best compression, 0 gives no compression at
 216.232 +   all (the input data is simply copied a block at a time).
 216.233 +   Z_DEFAULT_COMPRESSION requests a default compromise between speed and
 216.234 +   compression (currently equivalent to level 6).
 216.235 +
 216.236 +     deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not
 216.237 +   enough memory, Z_STREAM_ERROR if level is not a valid compression level,
 216.238 +   Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible
 216.239 +   with the version assumed by the caller (ZLIB_VERSION).
 216.240 +   msg is set to null if there is no error message.  deflateInit does not
 216.241 +   perform any compression: this will be done by deflate().
 216.242 +*/
 216.243 +
 216.244 +
 216.245 +ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
 216.246 +/*
 216.247 +    deflate compresses as much data as possible, and stops when the input
 216.248 +  buffer becomes empty or the output buffer becomes full. It may introduce some
 216.249 +  output latency (reading input without producing any output) except when
 216.250 +  forced to flush.
 216.251 +
 216.252 +    The detailed semantics are as follows. deflate performs one or both of the
 216.253 +  following actions:
 216.254 +
 216.255 +  - Compress more input starting at next_in and update next_in and avail_in
 216.256 +    accordingly. If not all input can be processed (because there is not
 216.257 +    enough room in the output buffer), next_in and avail_in are updated and
 216.258 +    processing will resume at this point for the next call of deflate().
 216.259 +
 216.260 +  - Provide more output starting at next_out and update next_out and avail_out
 216.261 +    accordingly. This action is forced if the parameter flush is non zero.
 216.262 +    Forcing flush frequently degrades the compression ratio, so this parameter
 216.263 +    should be set only when necessary (in interactive applications).
 216.264 +    Some output may be provided even if flush is not set.
 216.265 +
 216.266 +  Before the call of deflate(), the application should ensure that at least
 216.267 +  one of the actions is possible, by providing more input and/or consuming
 216.268 +  more output, and updating avail_in or avail_out accordingly; avail_out
 216.269 +  should never be zero before the call. The application can consume the
 216.270 +  compressed output when it wants, for example when the output buffer is full
 216.271 +  (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK
 216.272 +  and with zero avail_out, it must be called again after making room in the
 216.273 +  output buffer because there might be more output pending.
 216.274 +
 216.275 +    Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to
 216.276 +  decide how much data to accumualte before producing output, in order to
 216.277 +  maximize compression.
 216.278 +
 216.279 +    If the parameter flush is set to Z_SYNC_FLUSH, all pending output is
 216.280 +  flushed to the output buffer and the output is aligned on a byte boundary, so
 216.281 +  that the decompressor can get all input data available so far. (In particular
 216.282 +  avail_in is zero after the call if enough output space has been provided
 216.283 +  before the call.)  Flushing may degrade compression for some compression
 216.284 +  algorithms and so it should be used only when necessary.
 216.285 +
 216.286 +    If flush is set to Z_FULL_FLUSH, all output is flushed as with
 216.287 +  Z_SYNC_FLUSH, and the compression state is reset so that decompression can
 216.288 +  restart from this point if previous compressed data has been damaged or if
 216.289 +  random access is desired. Using Z_FULL_FLUSH too often can seriously degrade
 216.290 +  compression.
 216.291 +
 216.292 +    If deflate returns with avail_out == 0, this function must be called again
 216.293 +  with the same value of the flush parameter and more output space (updated
 216.294 +  avail_out), until the flush is complete (deflate returns with non-zero
 216.295 +  avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that
 216.296 +  avail_out is greater than six to avoid repeated flush markers due to
 216.297 +  avail_out == 0 on return.
 216.298 +
 216.299 +    If the parameter flush is set to Z_FINISH, pending input is processed,
 216.300 +  pending output is flushed and deflate returns with Z_STREAM_END if there
 216.301 +  was enough output space; if deflate returns with Z_OK, this function must be
 216.302 +  called again with Z_FINISH and more output space (updated avail_out) but no
 216.303 +  more input data, until it returns with Z_STREAM_END or an error. After
 216.304 +  deflate has returned Z_STREAM_END, the only possible operations on the
 216.305 +  stream are deflateReset or deflateEnd.
 216.306 +
 216.307 +    Z_FINISH can be used immediately after deflateInit if all the compression
 216.308 +  is to be done in a single step. In this case, avail_out must be at least
 216.309 +  the value returned by deflateBound (see below). If deflate does not return
 216.310 +  Z_STREAM_END, then it must be called again as described above.
 216.311 +
 216.312 +    deflate() sets strm->adler to the adler32 checksum of all input read
 216.313 +  so far (that is, total_in bytes).
 216.314 +
 216.315 +    deflate() may update strm->data_type if it can make a good guess about
 216.316 +  the input data type (Z_BINARY or Z_TEXT). In doubt, the data is considered
 216.317 +  binary. This field is only for information purposes and does not affect
 216.318 +  the compression algorithm in any manner.
 216.319 +
 216.320 +    deflate() returns Z_OK if some progress has been made (more input
 216.321 +  processed or more output produced), Z_STREAM_END if all input has been
 216.322 +  consumed and all output has been produced (only when flush is set to
 216.323 +  Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example
 216.324 +  if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible
 216.325 +  (for example avail_in or avail_out was zero). Note that Z_BUF_ERROR is not
 216.326 +  fatal, and deflate() can be called again with more input and more output
 216.327 +  space to continue compressing.
 216.328 +*/
 216.329 +
 216.330 +
 216.331 +ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
 216.332 +/*
 216.333 +     All dynamically allocated data structures for this stream are freed.
 216.334 +   This function discards any unprocessed input and does not flush any
 216.335 +   pending output.
 216.336 +
 216.337 +     deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the
 216.338 +   stream state was inconsistent, Z_DATA_ERROR if the stream was freed
 216.339 +   prematurely (some input or output was discarded). In the error case,
 216.340 +   msg may be set but then points to a static string (which must not be
 216.341 +   deallocated).
 216.342 +*/
 216.343 +
 216.344 +
 216.345 +/*
 216.346 +ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
 216.347 +
 216.348 +     Initializes the internal stream state for decompression. The fields
 216.349 +   next_in, avail_in, zalloc, zfree and opaque must be initialized before by
 216.350 +   the caller. If next_in is not Z_NULL and avail_in is large enough (the exact
 216.351 +   value depends on the compression method), inflateInit determines the
 216.352 +   compression method from the zlib header and allocates all data structures
 216.353 +   accordingly; otherwise the allocation will be deferred to the first call of
 216.354 +   inflate.  If zalloc and zfree are set to Z_NULL, inflateInit updates them to
 216.355 +   use default allocation functions.
 216.356 +
 216.357 +     inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
 216.358 +   memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
 216.359 +   version assumed by the caller.  msg is set to null if there is no error
 216.360 +   message. inflateInit does not perform any decompression apart from reading
 216.361 +   the zlib header if present: this will be done by inflate().  (So next_in and
 216.362 +   avail_in may be modified, but next_out and avail_out are unchanged.)
 216.363 +*/
 216.364 +
 216.365 +
 216.366 +ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
 216.367 +/*
 216.368 +    inflate decompresses as much data as possible, and stops when the input
 216.369 +  buffer becomes empty or the output buffer becomes full. It may introduce
 216.370 +  some output latency (reading input without producing any output) except when
 216.371 +  forced to flush.
 216.372 +
 216.373 +  The detailed semantics are as follows. inflate performs one or both of the
 216.374 +  following actions:
 216.375 +
 216.376 +  - Decompress more input starting at next_in and update next_in and avail_in
 216.377 +    accordingly. If not all input can be processed (because there is not
 216.378 +    enough room in the output buffer), next_in is updated and processing
 216.379 +    will resume at this point for the next call of inflate().
 216.380 +
 216.381 +  - Provide more output starting at next_out and update next_out and avail_out
 216.382 +    accordingly.  inflate() provides as much output as possible, until there
 216.383 +    is no more input data or no more space in the output buffer (see below
 216.384 +    about the flush parameter).
 216.385 +
 216.386 +  Before the call of inflate(), the application should ensure that at least
 216.387 +  one of the actions is possible, by providing more input and/or consuming
 216.388 +  more output, and updating the next_* and avail_* values accordingly.
 216.389 +  The application can consume the uncompressed output when it wants, for
 216.390 +  example when the output buffer is full (avail_out == 0), or after each
 216.391 +  call of inflate(). If inflate returns Z_OK and with zero avail_out, it
 216.392 +  must be called again after making room in the output buffer because there
 216.393 +  might be more output pending.
 216.394 +
 216.395 +    The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH,
 216.396 +  Z_FINISH, or Z_BLOCK. Z_SYNC_FLUSH requests that inflate() flush as much
 216.397 +  output as possible to the output buffer. Z_BLOCK requests that inflate() stop
 216.398 +  if and when it gets to the next deflate block boundary. When decoding the
 216.399 +  zlib or gzip format, this will cause inflate() to return immediately after
 216.400 +  the header and before the first block. When doing a raw inflate, inflate()
 216.401 +  will go ahead and process the first block, and will return when it gets to
 216.402 +  the end of that block, or when it runs out of data.
 216.403 +
 216.404 +    The Z_BLOCK option assists in appending to or combining deflate streams.
 216.405 +  Also to assist in this, on return inflate() will set strm->data_type to the
 216.406 +  number of unused bits in the last byte taken from strm->next_in, plus 64
 216.407 +  if inflate() is currently decoding the last block in the deflate stream,
 216.408 +  plus 128 if inflate() returned immediately after decoding an end-of-block
 216.409 +  code or decoding the complete header up to just before the first byte of the
 216.410 +  deflate stream. The end-of-block will not be indicated until all of the
 216.411 +  uncompressed data from that block has been written to strm->next_out.  The
 216.412 +  number of unused bits may in general be greater than seven, except when
 216.413 +  bit 7 of data_type is set, in which case the number of unused bits will be
 216.414 +  less than eight.
 216.415 +
 216.416 +    inflate() should normally be called until it returns Z_STREAM_END or an
 216.417 +  error. However if all decompression is to be performed in a single step
 216.418 +  (a single call of inflate), the parameter flush should be set to
 216.419 +  Z_FINISH. In this case all pending input is processed and all pending
 216.420 +  output is flushed; avail_out must be large enough to hold all the
 216.421 +  uncompressed data. (The size of the uncompressed data may have been saved
 216.422 +  by the compressor for this purpose.) The next operation on this stream must
 216.423 +  be inflateEnd to deallocate the decompression state. The use of Z_FINISH
 216.424 +  is never required, but can be used to inform inflate that a faster approach
 216.425 +  may be used for the single inflate() call.
 216.426 +
 216.427 +     In this implementation, inflate() always flushes as much output as
 216.428 +  possible to the output buffer, and always uses the faster approach on the
 216.429 +  first call. So the only effect of the flush parameter in this implementation
 216.430 +  is on the return value of inflate(), as noted below, or when it returns early
 216.431 +  because Z_BLOCK is used.
 216.432 +
 216.433 +     If a preset dictionary is needed after this call (see inflateSetDictionary
 216.434 +  below), inflate sets strm->adler to the adler32 checksum of the dictionary
 216.435 +  chosen by the compressor and returns Z_NEED_DICT; otherwise it sets
 216.436 +  strm->adler to the adler32 checksum of all output produced so far (that is,
 216.437 +  total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described
 216.438 +  below. At the end of the stream, inflate() checks that its computed adler32
 216.439 +  checksum is equal to that saved by the compressor and returns Z_STREAM_END
 216.440 +  only if the checksum is correct.
 216.441 +
 216.442 +    inflate() will decompress and check either zlib-wrapped or gzip-wrapped
 216.443 +  deflate data.  The header type is detected automatically.  Any information
 216.444 +  contained in the gzip header is not retained, so applications that need that
 216.445 +  information should instead use raw inflate, see inflateInit2() below, or
 216.446 +  inflateBack() and perform their own processing of the gzip header and
 216.447 +  trailer.
 216.448 +
 216.449 +    inflate() returns Z_OK if some progress has been made (more input processed
 216.450 +  or more output produced), Z_STREAM_END if the end of the compressed data has
 216.451 +  been reached and all uncompressed output has been produced, Z_NEED_DICT if a
 216.452 +  preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
 216.453 +  corrupted (input stream not conforming to the zlib format or incorrect check
 216.454 +  value), Z_STREAM_ERROR if the stream structure was inconsistent (for example
 216.455 +  if next_in or next_out was NULL), Z_MEM_ERROR if there was not enough memory,
 216.456 +  Z_BUF_ERROR if no progress is possible or if there was not enough room in the
 216.457 +  output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and
 216.458 +  inflate() can be called again with more input and more output space to
 216.459 +  continue decompressing. If Z_DATA_ERROR is returned, the application may then
 216.460 +  call inflateSync() to look for a good compression block if a partial recovery
 216.461 +  of the data is desired.
 216.462 +*/
 216.463 +
 216.464 +
 216.465 +ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
 216.466 +/*
 216.467 +     All dynamically allocated data structures for this stream are freed.
 216.468 +   This function discards any unprocessed input and does not flush any
 216.469 +   pending output.
 216.470 +
 216.471 +     inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state
 216.472 +   was inconsistent. In the error case, msg may be set but then points to a
 216.473 +   static string (which must not be deallocated).
 216.474 +*/
 216.475 +
 216.476 +                        /* Advanced functions */
 216.477 +
 216.478 +/*
 216.479 +    The following functions are needed only in some special applications.
 216.480 +*/
 216.481 +
 216.482 +/*
 216.483 +ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
 216.484 +                                     int  level,
 216.485 +                                     int  method,
 216.486 +                                     int  windowBits,
 216.487 +                                     int  memLevel,
 216.488 +                                     int  strategy));
 216.489 +
 216.490 +     This is another version of deflateInit with more compression options. The
 216.491 +   fields next_in, zalloc, zfree and opaque must be initialized before by
 216.492 +   the caller.
 216.493 +
 216.494 +     The method parameter is the compression method. It must be Z_DEFLATED in
 216.495 +   this version of the library.
 216.496 +
 216.497 +     The windowBits parameter is the base two logarithm of the window size
 216.498 +   (the size of the history buffer). It should be in the range 8..15 for this
 216.499 +   version of the library. Larger values of this parameter result in better
 216.500 +   compression at the expense of memory usage. The default value is 15 if
 216.501 +   deflateInit is used instead.
 216.502 +
 216.503 +     windowBits can also be -8..-15 for raw deflate. In this case, -windowBits
 216.504 +   determines the window size. deflate() will then generate raw deflate data
 216.505 +   with no zlib header or trailer, and will not compute an adler32 check value.
 216.506 +
 216.507 +     windowBits can also be greater than 15 for optional gzip encoding. Add
 216.508 +   16 to windowBits to write a simple gzip header and trailer around the
 216.509 +   compressed data instead of a zlib wrapper. The gzip header will have no
 216.510 +   file name, no extra data, no comment, no modification time (set to zero),
 216.511 +   no header crc, and the operating system will be set to 255 (unknown).  If a
 216.512 +   gzip stream is being written, strm->adler is a crc32 instead of an adler32.
 216.513 +
 216.514 +     The memLevel parameter specifies how much memory should be allocated
 216.515 +   for the internal compression state. memLevel=1 uses minimum memory but
 216.516 +   is slow and reduces compression ratio; memLevel=9 uses maximum memory
 216.517 +   for optimal speed. The default value is 8. See zconf.h for total memory
 216.518 +   usage as a function of windowBits and memLevel.
 216.519 +
 216.520 +     The strategy parameter is used to tune the compression algorithm. Use the
 216.521 +   value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a
 216.522 +   filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no
 216.523 +   string match), or Z_RLE to limit match distances to one (run-length
 216.524 +   encoding). Filtered data consists mostly of small values with a somewhat
 216.525 +   random distribution. In this case, the compression algorithm is tuned to
 216.526 +   compress them better. The effect of Z_FILTERED is to force more Huffman
 216.527 +   coding and less string matching; it is somewhat intermediate between
 216.528 +   Z_DEFAULT and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as fast as
 216.529 +   Z_HUFFMAN_ONLY, but give better compression for PNG image data. The strategy
 216.530 +   parameter only affects the compression ratio but not the correctness of the
 216.531 +   compressed output even if it is not set appropriately.  Z_FIXED prevents the
 216.532 +   use of dynamic Huffman codes, allowing for a simpler decoder for special
 216.533 +   applications.
 216.534 +
 216.535 +      deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
 216.536 +   memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid
 216.537 +   method). msg is set to null if there is no error message.  deflateInit2 does
 216.538 +   not perform any compression: this will be done by deflate().
 216.539 +*/
 216.540 +
 216.541 +ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
 216.542 +                                             const Bytef *dictionary,
 216.543 +                                             uInt  dictLength));
 216.544 +/*
 216.545 +     Initializes the compression dictionary from the given byte sequence
 216.546 +   without producing any compressed output. This function must be called
 216.547 +   immediately after deflateInit, deflateInit2 or deflateReset, before any
 216.548 +   call of deflate. The compressor and decompressor must use exactly the same
 216.549 +   dictionary (see inflateSetDictionary).
 216.550 +
 216.551 +     The dictionary should consist of strings (byte sequences) that are likely
 216.552 +   to be encountered later in the data to be compressed, with the most commonly
 216.553 +   used strings preferably put towards the end of the dictionary. Using a
 216.554 +   dictionary is most useful when the data to be compressed is short and can be
 216.555 +   predicted with good accuracy; the data can then be compressed better than
 216.556 +   with the default empty dictionary.
 216.557 +
 216.558 +     Depending on the size of the compression data structures selected by
 216.559 +   deflateInit or deflateInit2, a part of the dictionary may in effect be
 216.560 +   discarded, for example if the dictionary is larger than the window size in
 216.561 +   deflate or deflate2. Thus the strings most likely to be useful should be
 216.562 +   put at the end of the dictionary, not at the front. In addition, the
 216.563 +   current implementation of deflate will use at most the window size minus
 216.564 +   262 bytes of the provided dictionary.
 216.565 +
 216.566 +     Upon return of this function, strm->adler is set to the adler32 value
 216.567 +   of the dictionary; the decompressor may later use this value to determine
 216.568 +   which dictionary has been used by the compressor. (The adler32 value
 216.569 +   applies to the whole dictionary even if only a subset of the dictionary is
 216.570 +   actually used by the compressor.) If a raw deflate was requested, then the
 216.571 +   adler32 value is not computed and strm->adler is not set.
 216.572 +
 216.573 +     deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a
 216.574 +   parameter is invalid (such as NULL dictionary) or the stream state is
 216.575 +   inconsistent (for example if deflate has already been called for this stream
 216.576 +   or if the compression method is bsort). deflateSetDictionary does not
 216.577 +   perform any compression: this will be done by deflate().
 216.578 +*/
 216.579 +
 216.580 +ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
 216.581 +                                    z_streamp source));
 216.582 +/*
 216.583 +     Sets the destination stream as a complete copy of the source stream.
 216.584 +
 216.585 +     This function can be useful when several compression strategies will be
 216.586 +   tried, for example when there are several ways of pre-processing the input
 216.587 +   data with a filter. The streams that will be discarded should then be freed
 216.588 +   by calling deflateEnd.  Note that deflateCopy duplicates the internal
 216.589 +   compression state which can be quite large, so this strategy is slow and
 216.590 +   can consume lots of memory.
 216.591 +
 216.592 +     deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
 216.593 +   enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
 216.594 +   (such as zalloc being NULL). msg is left unchanged in both source and
 216.595 +   destination.
 216.596 +*/
 216.597 +
 216.598 +ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));
 216.599 +/*
 216.600 +     This function is equivalent to deflateEnd followed by deflateInit,
 216.601 +   but does not free and reallocate all the internal compression state.
 216.602 +   The stream will keep the same compression level and any other attributes
 216.603 +   that may have been set by deflateInit2.
 216.604 +
 216.605 +      deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
 216.606 +   stream state was inconsistent (such as zalloc or state being NULL).
 216.607 +*/
 216.608 +
 216.609 +ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
 216.610 +                                      int level,
 216.611 +                                      int strategy));
 216.612 +/*
 216.613 +     Dynamically update the compression level and compression strategy.  The
 216.614 +   interpretation of level and strategy is as in deflateInit2.  This can be
 216.615 +   used to switch between compression and straight copy of the input data, or
 216.616 +   to switch to a different kind of input data requiring a different
 216.617 +   strategy. If the compression level is changed, the input available so far
 216.618 +   is compressed with the old level (and may be flushed); the new level will
 216.619 +   take effect only at the next call of deflate().
 216.620 +
 216.621 +     Before the call of deflateParams, the stream state must be set as for
 216.622 +   a call of deflate(), since the currently available input may have to
 216.623 +   be compressed and flushed. In particular, strm->avail_out must be non-zero.
 216.624 +
 216.625 +     deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source
 216.626 +   stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR
 216.627 +   if strm->avail_out was zero.
 216.628 +*/
 216.629 +
 216.630 +ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm,
 216.631 +                                    int good_length,
 216.632 +                                    int max_lazy,
 216.633 +                                    int nice_length,
 216.634 +                                    int max_chain));
 216.635 +/*
 216.636 +     Fine tune deflate's internal compression parameters.  This should only be
 216.637 +   used by someone who understands the algorithm used by zlib's deflate for
 216.638 +   searching for the best matching string, and even then only by the most
 216.639 +   fanatic optimizer trying to squeeze out the last compressed bit for their
 216.640 +   specific input data.  Read the deflate.c source code for the meaning of the
 216.641 +   max_lazy, good_length, nice_length, and max_chain parameters.
 216.642 +
 216.643 +     deflateTune() can be called after deflateInit() or deflateInit2(), and
 216.644 +   returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream.
 216.645 + */
 216.646 +
 216.647 +ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm,
 216.648 +                                       uLong sourceLen));
 216.649 +/*
 216.650 +     deflateBound() returns an upper bound on the compressed size after
 216.651 +   deflation of sourceLen bytes.  It must be called after deflateInit()
 216.652 +   or deflateInit2().  This would be used to allocate an output buffer
 216.653 +   for deflation in a single pass, and so would be called before deflate().
 216.654 +*/
 216.655 +
 216.656 +ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm,
 216.657 +                                     int bits,
 216.658 +                                     int value));
 216.659 +/*
 216.660 +     deflatePrime() inserts bits in the deflate output stream.  The intent
 216.661 +  is that this function is used to start off the deflate output with the
 216.662 +  bits leftover from a previous deflate stream when appending to it.  As such,
 216.663 +  this function can only be used for raw deflate, and must be used before the
 216.664 +  first deflate() call after a deflateInit2() or deflateReset().  bits must be
 216.665 +  less than or equal to 16, and that many of the least significant bits of
 216.666 +  value will be inserted in the output.
 216.667 +
 216.668 +      deflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
 216.669 +   stream state was inconsistent.
 216.670 +*/
 216.671 +
 216.672 +ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm,
 216.673 +                                         gz_headerp head));
 216.674 +/*
 216.675 +      deflateSetHeader() provides gzip header information for when a gzip
 216.676 +   stream is requested by deflateInit2().  deflateSetHeader() may be called
 216.677 +   after deflateInit2() or deflateReset() and before the first call of
 216.678 +   deflate().  The text, time, os, extra field, name, and comment information
 216.679 +   in the provided gz_header structure are written to the gzip header (xflag is
 216.680 +   ignored -- the extra flags are set according to the compression level).  The
 216.681 +   caller must assure that, if not Z_NULL, name and comment are terminated with
 216.682 +   a zero byte, and that if extra is not Z_NULL, that extra_len bytes are
 216.683 +   available there.  If hcrc is true, a gzip header crc is included.  Note that
 216.684 +   the current versions of the command-line version of gzip (up through version
 216.685 +   1.3.x) do not support header crc's, and will report that it is a "multi-part
 216.686 +   gzip file" and give up.
 216.687 +
 216.688 +      If deflateSetHeader is not used, the default gzip header has text false,
 216.689 +   the time set to zero, and os set to 255, with no extra, name, or comment
 216.690 +   fields.  The gzip header is returned to the default state by deflateReset().
 216.691 +
 216.692 +      deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
 216.693 +   stream state was inconsistent.
 216.694 +*/
 216.695 +
 216.696 +/*
 216.697 +ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
 216.698 +                                     int  windowBits));
 216.699 +
 216.700 +     This is another version of inflateInit with an extra parameter. The
 216.701 +   fields next_in, avail_in, zalloc, zfree and opaque must be initialized
 216.702 +   before by the caller.
 216.703 +
 216.704 +     The windowBits parameter is the base two logarithm of the maximum window
 216.705 +   size (the size of the history buffer).  It should be in the range 8..15 for
 216.706 +   this version of the library. The default value is 15 if inflateInit is used
 216.707 +   instead. windowBits must be greater than or equal to the windowBits value
 216.708 +   provided to deflateInit2() while compressing, or it must be equal to 15 if
 216.709 +   deflateInit2() was not used. If a compressed stream with a larger window
 216.710 +   size is given as input, inflate() will return with the error code
 216.711 +   Z_DATA_ERROR instead of trying to allocate a larger window.
 216.712 +
 216.713 +     windowBits can also be -8..-15 for raw inflate. In this case, -windowBits
 216.714 +   determines the window size. inflate() will then process raw deflate data,
 216.715 +   not looking for a zlib or gzip header, not generating a check value, and not
 216.716 +   looking for any check values for comparison at the end of the stream. This
 216.717 +   is for use with other formats that use the deflate compressed data format
 216.718 +   such as zip.  Those formats provide their own check values. If a custom
 216.719 +   format is developed using the raw deflate format for compressed data, it is
 216.720 +   recommended that a check value such as an adler32 or a crc32 be applied to
 216.721 +   the uncompressed data as is done in the zlib, gzip, and zip formats.  For
 216.722 +   most applications, the zlib format should be used as is. Note that comments
 216.723 +   above on the use in deflateInit2() applies to the magnitude of windowBits.
 216.724 +
 216.725 +     windowBits can also be greater than 15 for optional gzip decoding. Add
 216.726 +   32 to windowBits to enable zlib and gzip decoding with automatic header
 216.727 +   detection, or add 16 to decode only the gzip format (the zlib format will
 216.728 +   return a Z_DATA_ERROR).  If a gzip stream is being decoded, strm->adler is
 216.729 +   a crc32 instead of an adler32.
 216.730 +
 216.731 +     inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
 216.732 +   memory, Z_STREAM_ERROR if a parameter is invalid (such as a null strm). msg
 216.733 +   is set to null if there is no error message.  inflateInit2 does not perform
 216.734 +   any decompression apart from reading the zlib header if present: this will
 216.735 +   be done by inflate(). (So next_in and avail_in may be modified, but next_out
 216.736 +   and avail_out are unchanged.)
 216.737 +*/
 216.738 +
 216.739 +ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
 216.740 +                                             const Bytef *dictionary,
 216.741 +                                             uInt  dictLength));
 216.742 +/*
 216.743 +     Initializes the decompression dictionary from the given uncompressed byte
 216.744 +   sequence. This function must be called immediately after a call of inflate,
 216.745 +   if that call returned Z_NEED_DICT. The dictionary chosen by the compressor
 216.746 +   can be determined from the adler32 value returned by that call of inflate.
 216.747 +   The compressor and decompressor must use exactly the same dictionary (see
 216.748 +   deflateSetDictionary).  For raw inflate, this function can be called
 216.749 +   immediately after inflateInit2() or inflateReset() and before any call of
 216.750 +   inflate() to set the dictionary.  The application must insure that the
 216.751 +   dictionary that was used for compression is provided.
 216.752 +
 216.753 +     inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
 216.754 +   parameter is invalid (such as NULL dictionary) or the stream state is
 216.755 +   inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
 216.756 +   expected one (incorrect adler32 value). inflateSetDictionary does not
 216.757 +   perform any decompression: this will be done by subsequent calls of
 216.758 +   inflate().
 216.759 +*/
 216.760 +
 216.761 +ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
 216.762 +/*
 216.763 +    Skips invalid compressed data until a full flush point (see above the
 216.764 +  description of deflate with Z_FULL_FLUSH) can be found, or until all
 216.765 +  available input is skipped. No output is provided.
 216.766 +
 216.767 +    inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR
 216.768 +  if no more input was provided, Z_DATA_ERROR if no flush point has been found,
 216.769 +  or Z_STREAM_ERROR if the stream structure was inconsistent. In the success
 216.770 +  case, the application may save the current current value of total_in which
 216.771 +  indicates where valid compressed data was found. In the error case, the
 216.772 +  application may repeatedly call inflateSync, providing more input each time,
 216.773 +  until success or end of the input data.
 216.774 +*/
 216.775 +
 216.776 +ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
 216.777 +                                    z_streamp source));
 216.778 +/*
 216.779 +     Sets the destination stream as a complete copy of the source stream.
 216.780 +
 216.781 +     This function can be useful when randomly accessing a large stream.  The
 216.782 +   first pass through the stream can periodically record the inflate state,
 216.783 +   allowing restarting inflate at those points when randomly accessing the
 216.784 +   stream.
 216.785 +
 216.786 +     inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
 216.787 +   enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
 216.788 +   (such as zalloc being NULL). msg is left unchanged in both source and
 216.789 +   destination.
 216.790 +*/
 216.791 +
 216.792 +ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
 216.793 +/*
 216.794 +     This function is equivalent to inflateEnd followed by inflateInit,
 216.795 +   but does not free and reallocate all the internal decompression state.
 216.796 +   The stream will keep attributes that may have been set by inflateInit2.
 216.797 +
 216.798 +      inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
 216.799 +   stream state was inconsistent (such as zalloc or state being NULL).
 216.800 +*/
 216.801 +
 216.802 +ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm,
 216.803 +                                     int bits,
 216.804 +                                     int value));
 216.805 +/*
 216.806 +     This function inserts bits in the inflate input stream.  The intent is
 216.807 +  that this function is used to start inflating at a bit position in the
 216.808 +  middle of a byte.  The provided bits will be used before any bytes are used
 216.809 +  from next_in.  This function should only be used with raw inflate, and
 216.810 +  should be used before the first inflate() call after inflateInit2() or
 216.811 +  inflateReset().  bits must be less than or equal to 16, and that many of the
 216.812 +  least significant bits of value will be inserted in the input.
 216.813 +
 216.814 +      inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
 216.815 +   stream state was inconsistent.
 216.816 +*/
 216.817 +
 216.818 +ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm,
 216.819 +                                         gz_headerp head));
 216.820 +/*
 216.821 +      inflateGetHeader() requests that gzip header information be stored in the
 216.822 +   provided gz_header structure.  inflateGetHeader() may be called after
 216.823 +   inflateInit2() or inflateReset(), and before the first call of inflate().
 216.824 +   As inflate() processes the gzip stream, head->done is zero until the header
 216.825 +   is completed, at which time head->done is set to one.  If a zlib stream is
 216.826 +   being decoded, then head->done is set to -1 to indicate that there will be
 216.827 +   no gzip header information forthcoming.  Note that Z_BLOCK can be used to
 216.828 +   force inflate() to return immediately after header processing is complete
 216.829 +   and before any actual data is decompressed.
 216.830 +
 216.831 +      The text, time, xflags, and os fields are filled in with the gzip header
 216.832 +   contents.  hcrc is set to true if there is a header CRC.  (The header CRC
 216.833 +   was valid if done is set to one.)  If extra is not Z_NULL, then extra_max
 216.834 +   contains the maximum number of bytes to write to extra.  Once done is true,
 216.835 +   extra_len contains the actual extra field length, and extra contains the
 216.836 +   extra field, or that field truncated if extra_max is less than extra_len.
 216.837 +   If name is not Z_NULL, then up to name_max characters are written there,
 216.838 +   terminated with a zero unless the length is greater than name_max.  If
 216.839 +   comment is not Z_NULL, then up to comm_max characters are written there,
 216.840 +   terminated with a zero unless the length is greater than comm_max.  When
 216.841 +   any of extra, name, or comment are not Z_NULL and the respective field is
 216.842 +   not present in the header, then that field is set to Z_NULL to signal its
 216.843 +   absence.  This allows the use of deflateSetHeader() with the returned
 216.844 +   structure to duplicate the header.  However if those fields are set to
 216.845 +   allocated memory, then the application will need to save those pointers
 216.846 +   elsewhere so that they can be eventually freed.
 216.847 +
 216.848 +      If inflateGetHeader is not used, then the header information is simply
 216.849 +   discarded.  The header is always checked for validity, including the header
 216.850 +   CRC if present.  inflateReset() will reset the process to discard the header
 216.851 +   information.  The application would need to call inflateGetHeader() again to
 216.852 +   retrieve the header from the next gzip stream.
 216.853 +
 216.854 +      inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
 216.855 +   stream state was inconsistent.
 216.856 +*/
 216.857 +
 216.858 +/*
 216.859 +ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,
 216.860 +                                        unsigned char FAR *window));
 216.861 +
 216.862 +     Initialize the internal stream state for decompression using inflateBack()
 216.863 +   calls.  The fields zalloc, zfree and opaque in strm must be initialized
 216.864 +   before the call.  If zalloc and zfree are Z_NULL, then the default library-
 216.865 +   derived memory allocation routines are used.  windowBits is the base two
 216.866 +   logarithm of the window size, in the range 8..15.  window is a caller
 216.867 +   supplied buffer of that size.  Except for special applications where it is
 216.868 +   assured that deflate was used with small window sizes, windowBits must be 15
 216.869 +   and a 32K byte window must be supplied to be able to decompress general
 216.870 +   deflate streams.
 216.871 +
 216.872 +     See inflateBack() for the usage of these routines.
 216.873 +
 216.874 +     inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of
 216.875 +   the paramaters are invalid, Z_MEM_ERROR if the internal state could not
 216.876 +   be allocated, or Z_VERSION_ERROR if the version of the library does not
 216.877 +   match the version of the header file.
 216.878 +*/
 216.879 +
 216.880 +typedef unsigned (*in_func) OF((void FAR *, unsigned char FAR * FAR *));
 216.881 +typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned));
 216.882 +
 216.883 +ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
 216.884 +                                    in_func in, void FAR *in_desc,
 216.885 +                                    out_func out, void FAR *out_desc));
 216.886 +/*
 216.887 +     inflateBack() does a raw inflate with a single call using a call-back
 216.888 +   interface for input and output.  This is more efficient than inflate() for
 216.889 +   file i/o applications in that it avoids copying between the output and the
 216.890 +   sliding window by simply making the window itself the output buffer.  This
 216.891 +   function trusts the application to not change the output buffer passed by
 216.892 +   the output function, at least until inflateBack() returns.
 216.893 +
 216.894 +     inflateBackInit() must be called first to allocate the internal state
 216.895 +   and to initialize the state with the user-provided window buffer.
 216.896 +   inflateBack() may then be used multiple times to inflate a complete, raw
 216.897 +   deflate stream with each call.  inflateBackEnd() is then called to free
 216.898 +   the allocated state.
 216.899 +
 216.900 +     A raw deflate stream is one with no zlib or gzip header or trailer.
 216.901 +   This routine would normally be used in a utility that reads zip or gzip
 216.902 +   files and writes out uncompressed files.  The utility would decode the
 216.903 +   header and process the trailer on its own, hence this routine expects
 216.904 +   only the raw deflate stream to decompress.  This is different from the
 216.905 +   normal behavior of inflate(), which expects either a zlib or gzip header and
 216.906 +   trailer around the deflate stream.
 216.907 +
 216.908 +     inflateBack() uses two subroutines supplied by the caller that are then
 216.909 +   called by inflateBack() for input and output.  inflateBack() calls those
 216.910 +   routines until it reads a complete deflate stream and writes out all of the
 216.911 +   uncompressed data, or until it encounters an error.  The function's
 216.912 +   parameters and return types are defined above in the in_func and out_func
 216.913 +   typedefs.  inflateBack() will call in(in_desc, &buf) which should return the
 216.914 +   number of bytes of provided input, and a pointer to that input in buf.  If
 216.915 +   there is no input available, in() must return zero--buf is ignored in that
 216.916 +   case--and inflateBack() will return a buffer error.  inflateBack() will call
 216.917 +   out(out_desc, buf, len) to write the uncompressed data buf[0..len-1].  out()
 216.918 +   should return zero on success, or non-zero on failure.  If out() returns
 216.919 +   non-zero, inflateBack() will return with an error.  Neither in() nor out()
 216.920 +   are permitted to change the contents of the window provided to
 216.921 +   inflateBackInit(), which is also the buffer that out() uses to write from.
 216.922 +   The length written by out() will be at most the window size.  Any non-zero
 216.923 +   amount of input may be provided by in().
 216.924 +
 216.925 +     For convenience, inflateBack() can be provided input on the first call by
 216.926 +   setting strm->next_in and strm->avail_in.  If that input is exhausted, then
 216.927 +   in() will be called.  Therefore strm->next_in must be initialized before
 216.928 +   calling inflateBack().  If strm->next_in is Z_NULL, then in() will be called
 216.929 +   immediately for input.  If strm->next_in is not Z_NULL, then strm->avail_in
 216.930 +   must also be initialized, and then if strm->avail_in is not zero, input will
 216.931 +   initially be taken from strm->next_in[0 .. strm->avail_in - 1].
 216.932 +
 216.933 +     The in_desc and out_desc parameters of inflateBack() is passed as the
 216.934 +   first parameter of in() and out() respectively when they are called.  These
 216.935 +   descriptors can be optionally used to pass any information that the caller-
 216.936 +   supplied in() and out() functions need to do their job.
 216.937 +
 216.938 +     On return, inflateBack() will set strm->next_in and strm->avail_in to
 216.939 +   pass back any unused input that was provided by the last in() call.  The
 216.940 +   return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR
 216.941 +   if in() or out() returned an error, Z_DATA_ERROR if there was a format
 216.942 +   error in the deflate stream (in which case strm->msg is set to indicate the
 216.943 +   nature of the error), or Z_STREAM_ERROR if the stream was not properly
 216.944 +   initialized.  In the case of Z_BUF_ERROR, an input or output error can be
 216.945 +   distinguished using strm->next_in which will be Z_NULL only if in() returned
 216.946 +   an error.  If strm->next is not Z_NULL, then the Z_BUF_ERROR was due to
 216.947 +   out() returning non-zero.  (in() will always be called before out(), so
 216.948 +   strm->next_in is assured to be defined if out() returns non-zero.)  Note
 216.949 +   that inflateBack() cannot return Z_OK.
 216.950 +*/
 216.951 +
 216.952 +ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm));
 216.953 +/*
 216.954 +     All memory allocated by inflateBackInit() is freed.
 216.955 +
 216.956 +     inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream
 216.957 +   state was inconsistent.
 216.958 +*/
 216.959 +
 216.960 +ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
 216.961 +/* Return flags indicating compile-time options.
 216.962 +
 216.963 +    Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other:
 216.964 +     1.0: size of uInt
 216.965 +     3.2: size of uLong
 216.966 +     5.4: size of voidpf (pointer)
 216.967 +     7.6: size of z_off_t
 216.968 +
 216.969 +    Compiler, assembler, and debug options:
 216.970 +     8: DEBUG
 216.971 +     9: ASMV or ASMINF -- use ASM code
 216.972 +     10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention
 216.973 +     11: 0 (reserved)
 216.974 +
 216.975 +    One-time table building (smaller code, but not thread-safe if true):
 216.976 +     12: BUILDFIXED -- build static block decoding tables when needed
 216.977 +     13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed
 216.978 +     14,15: 0 (reserved)
 216.979 +
 216.980 +    Library content (indicates missing functionality):
 216.981 +     16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking
 216.982 +                          deflate code when not needed)
 216.983 +     17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect
 216.984 +                    and decode gzip streams (to avoid linking crc code)
 216.985 +     18-19: 0 (reserved)
 216.986 +
 216.987 +    Operation variations (changes in library functionality):
 216.988 +     20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate
 216.989 +     21: FASTEST -- deflate algorithm with only one, lowest compression level
 216.990 +     22,23: 0 (reserved)
 216.991 +
 216.992 +    The sprintf variant used by gzprintf (zero is best):
 216.993 +     24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format
 216.994 +     25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure!
 216.995 +     26: 0 = returns value, 1 = void -- 1 means inferred string length returned
 216.996 +
 216.997 +    Remainder:
 216.998 +     27-31: 0 (reserved)
 216.999 + */
216.1000 +
216.1001 +
216.1002 +                        /* utility functions */
216.1003 +
216.1004 +/*
216.1005 +     The following utility functions are implemented on top of the
216.1006 +   basic stream-oriented functions. To simplify the interface, some
216.1007 +   default options are assumed (compression level and memory usage,
216.1008 +   standard memory allocation functions). The source code of these
216.1009 +   utility functions can easily be modified if you need special options.
216.1010 +*/
216.1011 +
216.1012 +ZEXTERN int ZEXPORT compress OF((Bytef *dest,   uLongf *destLen,
216.1013 +                                 const Bytef *source, uLong sourceLen));
216.1014 +/*
216.1015 +     Compresses the source buffer into the destination buffer.  sourceLen is
216.1016 +   the byte length of the source buffer. Upon entry, destLen is the total
216.1017 +   size of the destination buffer, which must be at least the value returned
216.1018 +   by compressBound(sourceLen). Upon exit, destLen is the actual size of the
216.1019 +   compressed buffer.
216.1020 +     This function can be used to compress a whole file at once if the
216.1021 +   input file is mmap'ed.
216.1022 +     compress returns Z_OK if success, Z_MEM_ERROR if there was not
216.1023 +   enough memory, Z_BUF_ERROR if there was not enough room in the output
216.1024 +   buffer.
216.1025 +*/
216.1026 +
216.1027 +ZEXTERN int ZEXPORT compress2 OF((Bytef *dest,   uLongf *destLen,
216.1028 +                                  const Bytef *source, uLong sourceLen,
216.1029 +                                  int level));
216.1030 +/*
216.1031 +     Compresses the source buffer into the destination buffer. The level
216.1032 +   parameter has the same meaning as in deflateInit.  sourceLen is the byte
216.1033 +   length of the source buffer. Upon entry, destLen is the total size of the
216.1034 +   destination buffer, which must be at least the value returned by
216.1035 +   compressBound(sourceLen). Upon exit, destLen is the actual size of the
216.1036 +   compressed buffer.
216.1037 +
216.1038 +     compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
216.1039 +   memory, Z_BUF_ERROR if there was not enough room in the output buffer,
216.1040 +   Z_STREAM_ERROR if the level parameter is invalid.
216.1041 +*/
216.1042 +
216.1043 +ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen));
216.1044 +/*
216.1045 +     compressBound() returns an upper bound on the compressed size after
216.1046 +   compress() or compress2() on sourceLen bytes.  It would be used before
216.1047 +   a compress() or compress2() call to allocate the destination buffer.
216.1048 +*/
216.1049 +
216.1050 +ZEXTERN int ZEXPORT uncompress OF((Bytef *dest,   uLongf *destLen,
216.1051 +                                   const Bytef *source, uLong sourceLen));
216.1052 +/*
216.1053 +     Decompresses the source buffer into the destination buffer.  sourceLen is
216.1054 +   the byte length of the source buffer. Upon entry, destLen is the total
216.1055 +   size of the destination buffer, which must be large enough to hold the
216.1056 +   entire uncompressed data. (The size of the uncompressed data must have
216.1057 +   been saved previously by the compressor and transmitted to the decompressor
216.1058 +   by some mechanism outside the scope of this compression library.)
216.1059 +   Upon exit, destLen is the actual size of the compressed buffer.
216.1060 +     This function can be used to decompress a whole file at once if the
216.1061 +   input file is mmap'ed.
216.1062 +
216.1063 +     uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
216.1064 +   enough memory, Z_BUF_ERROR if there was not enough room in the output
216.1065 +   buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete.
216.1066 +*/
216.1067 +
216.1068 +
216.1069 +typedef voidp gzFile;
216.1070 +
216.1071 +ZEXTERN gzFile ZEXPORT gzopen  OF((const char *path, const char *mode));
216.1072 +/*
216.1073 +     Opens a gzip (.gz) file for reading or writing. The mode parameter
216.1074 +   is as in fopen ("rb" or "wb") but can also include a compression level
216.1075 +   ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for
216.1076 +   Huffman only compression as in "wb1h", or 'R' for run-length encoding
216.1077 +   as in "wb1R". (See the description of deflateInit2 for more information
216.1078 +   about the strategy parameter.)
216.1079 +
216.1080 +     gzopen can be used to read a file which is not in gzip format; in this
216.1081 +   case gzread will directly read from the file without decompression.
216.1082 +
216.1083 +     gzopen returns NULL if the file could not be opened or if there was
216.1084 +   insufficient memory to allocate the (de)compression state; errno
216.1085 +   can be checked to distinguish the two cases (if errno is zero, the
216.1086 +   zlib error is Z_MEM_ERROR).  */
216.1087 +
216.1088 +ZEXTERN gzFile ZEXPORT gzdopen  OF((int fd, const char *mode));
216.1089 +/*
216.1090 +     gzdopen() associates a gzFile with the file descriptor fd.  File
216.1091 +   descriptors are obtained from calls like open, dup, creat, pipe or
216.1092 +   fileno (in the file has been previously opened with fopen).
216.1093 +   The mode parameter is as in gzopen.
216.1094 +     The next call of gzclose on the returned gzFile will also close the
216.1095 +   file descriptor fd, just like fclose(fdopen(fd), mode) closes the file
216.1096 +   descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode).
216.1097 +     gzdopen returns NULL if there was insufficient memory to allocate
216.1098 +   the (de)compression state.
216.1099 +*/
216.1100 +
216.1101 +ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
216.1102 +/*
216.1103 +     Dynamically update the compression level or strategy. See the description
216.1104 +   of deflateInit2 for the meaning of these parameters.
216.1105 +     gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not
216.1106 +   opened for writing.
216.1107 +*/
216.1108 +
216.1109 +ZEXTERN int ZEXPORT    gzread  OF((gzFile file, voidp buf, unsigned len));
216.1110 +/*
216.1111 +     Reads the given number of uncompressed bytes from the compressed file.
216.1112 +   If the input file was not in gzip format, gzread copies the given number
216.1113 +   of bytes into the buffer.
216.1114 +     gzread returns the number of uncompressed bytes actually read (0 for
216.1115 +   end of file, -1 for error). */
216.1116 +
216.1117 +ZEXTERN int ZEXPORT    gzwrite OF((gzFile file,
216.1118 +                                   voidpc buf, unsigned len));
216.1119 +/*
216.1120 +     Writes the given number of uncompressed bytes into the compressed file.
216.1121 +   gzwrite returns the number of uncompressed bytes actually written
216.1122 +   (0 in case of error).
216.1123 +*/
216.1124 +
216.1125 +ZEXTERN int ZEXPORTVA   gzprintf OF((gzFile file, const char *format, ...));
216.1126 +/*
216.1127 +     Converts, formats, and writes the args to the compressed file under
216.1128 +   control of the format string, as in fprintf. gzprintf returns the number of
216.1129 +   uncompressed bytes actually written (0 in case of error).  The number of
216.1130 +   uncompressed bytes written is limited to 4095. The caller should assure that
216.1131 +   this limit is not exceeded. If it is exceeded, then gzprintf() will return
216.1132 +   return an error (0) with nothing written. In this case, there may also be a
216.1133 +   buffer overflow with unpredictable consequences, which is possible only if
216.1134 +   zlib was compiled with the insecure functions sprintf() or vsprintf()
216.1135 +   because the secure snprintf() or vsnprintf() functions were not available.
216.1136 +*/
216.1137 +
216.1138 +ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
216.1139 +/*
216.1140 +      Writes the given null-terminated string to the compressed file, excluding
216.1141 +   the terminating null character.
216.1142 +      gzputs returns the number of characters written, or -1 in case of error.
216.1143 +*/
216.1144 +
216.1145 +ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
216.1146 +/*
216.1147 +      Reads bytes from the compressed file until len-1 characters are read, or
216.1148 +   a newline character is read and transferred to buf, or an end-of-file
216.1149 +   condition is encountered.  The string is then terminated with a null
216.1150 +   character.
216.1151 +      gzgets returns buf, or Z_NULL in case of error.
216.1152 +*/
216.1153 +
216.1154 +ZEXTERN int ZEXPORT    gzputc OF((gzFile file, int c));
216.1155 +/*
216.1156 +      Writes c, converted to an unsigned char, into the compressed file.
216.1157 +   gzputc returns the value that was written, or -1 in case of error.
216.1158 +*/
216.1159 +
216.1160 +ZEXTERN int ZEXPORT    gzgetc OF((gzFile file));
216.1161 +/*
216.1162 +      Reads one byte from the compressed file. gzgetc returns this byte
216.1163 +   or -1 in case of end of file or error.
216.1164 +*/
216.1165 +
216.1166 +ZEXTERN int ZEXPORT    gzungetc OF((int c, gzFile file));
216.1167 +/*
216.1168 +      Push one character back onto the stream to be read again later.
216.1169 +   Only one character of push-back is allowed.  gzungetc() returns the
216.1170 +   character pushed, or -1 on failure.  gzungetc() will fail if a
216.1171 +   character has been pushed but not read yet, or if c is -1. The pushed
216.1172 +   character will be discarded if the stream is repositioned with gzseek()
216.1173 +   or gzrewind().
216.1174 +*/
216.1175 +
216.1176 +ZEXTERN int ZEXPORT    gzflush OF((gzFile file, int flush));
216.1177 +/*
216.1178 +     Flushes all pending output into the compressed file. The parameter
216.1179 +   flush is as in the deflate() function. The return value is the zlib
216.1180 +   error number (see function gzerror below). gzflush returns Z_OK if
216.1181 +   the flush parameter is Z_FINISH and all output could be flushed.
216.1182 +     gzflush should be called only when strictly necessary because it can
216.1183 +   degrade compression.
216.1184 +*/
216.1185 +
216.1186 +ZEXTERN z_off_t ZEXPORT    gzseek OF((gzFile file,
216.1187 +                                      z_off_t offset, int whence));
216.1188 +/*
216.1189 +      Sets the starting position for the next gzread or gzwrite on the
216.1190 +   given compressed file. The offset represents a number of bytes in the
216.1191 +   uncompressed data stream. The whence parameter is defined as in lseek(2);
216.1192 +   the value SEEK_END is not supported.
216.1193 +     If the file is opened for reading, this function is emulated but can be
216.1194 +   extremely slow. If the file is opened for writing, only forward seeks are
216.1195 +   supported; gzseek then compresses a sequence of zeroes up to the new
216.1196 +   starting position.
216.1197 +
216.1198 +      gzseek returns the resulting offset location as measured in bytes from
216.1199 +   the beginning of the uncompressed stream, or -1 in case of error, in
216.1200 +   particular if the file is opened for writing and the new starting position
216.1201 +   would be before the current position.
216.1202 +*/
216.1203 +
216.1204 +ZEXTERN int ZEXPORT    gzrewind OF((gzFile file));
216.1205 +/*
216.1206 +     Rewinds the given file. This function is supported only for reading.
216.1207 +
216.1208 +   gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
216.1209 +*/
216.1210 +
216.1211 +ZEXTERN z_off_t ZEXPORT    gztell OF((gzFile file));
216.1212 +/*
216.1213 +     Returns the starting position for the next gzread or gzwrite on the
216.1214 +   given compressed file. This position represents a number of bytes in the
216.1215 +   uncompressed data stream.
216.1216 +
216.1217 +   gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
216.1218 +*/
216.1219 +
216.1220 +ZEXTERN int ZEXPORT gzeof OF((gzFile file));
216.1221 +/*
216.1222 +     Returns 1 when EOF has previously been detected reading the given
216.1223 +   input stream, otherwise zero.
216.1224 +*/
216.1225 +
216.1226 +ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
216.1227 +/*
216.1228 +     Returns 1 if file is being read directly without decompression, otherwise
216.1229 +   zero.
216.1230 +*/
216.1231 +
216.1232 +ZEXTERN int ZEXPORT    gzclose OF((gzFile file));
216.1233 +/*
216.1234 +     Flushes all pending output if necessary, closes the compressed file
216.1235 +   and deallocates all the (de)compression state. The return value is the zlib
216.1236 +   error number (see function gzerror below).
216.1237 +*/
216.1238 +
216.1239 +ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
216.1240 +/*
216.1241 +     Returns the error message for the last error which occurred on the
216.1242 +   given compressed file. errnum is set to zlib error number. If an
216.1243 +   error occurred in the file system and not in the compression library,
216.1244 +   errnum is set to Z_ERRNO and the application may consult errno
216.1245 +   to get the exact error code.
216.1246 +*/
216.1247 +
216.1248 +ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
216.1249 +/*
216.1250 +     Clears the error and end-of-file flags for file. This is analogous to the
216.1251 +   clearerr() function in stdio. This is useful for continuing to read a gzip
216.1252 +   file that is being written concurrently.
216.1253 +*/
216.1254 +
216.1255 +                        /* checksum functions */
216.1256 +
216.1257 +/*
216.1258 +     These functions are not related to compression but are exported
216.1259 +   anyway because they might be useful in applications using the
216.1260 +   compression library.
216.1261 +*/
216.1262 +
216.1263 +ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
216.1264 +/*
216.1265 +     Update a running Adler-32 checksum with the bytes buf[0..len-1] and
216.1266 +   return the updated checksum. If buf is NULL, this function returns
216.1267 +   the required initial value for the checksum.
216.1268 +   An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
216.1269 +   much faster. Usage example:
216.1270 +
216.1271 +     uLong adler = adler32(0L, Z_NULL, 0);
216.1272 +
216.1273 +     while (read_buffer(buffer, length) != EOF) {
216.1274 +       adler = adler32(adler, buffer, length);
216.1275 +     }
216.1276 +     if (adler != original_adler) error();
216.1277 +*/
216.1278 +
216.1279 +ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
216.1280 +                                          z_off_t len2));
216.1281 +/*
216.1282 +     Combine two Adler-32 checksums into one.  For two sequences of bytes, seq1
216.1283 +   and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for
216.1284 +   each, adler1 and adler2.  adler32_combine() returns the Adler-32 checksum of
216.1285 +   seq1 and seq2 concatenated, requiring only adler1, adler2, and len2.
216.1286 +*/
216.1287 +
216.1288 +ZEXTERN uLong ZEXPORT crc32   OF((uLong crc, const Bytef *buf, uInt len));
216.1289 +/*
216.1290 +     Update a running CRC-32 with the bytes buf[0..len-1] and return the
216.1291 +   updated CRC-32. If buf is NULL, this function returns the required initial
216.1292 +   value for the for the crc. Pre- and post-conditioning (one's complement) is
216.1293 +   performed within this function so it shouldn't be done by the application.
216.1294 +   Usage example:
216.1295 +
216.1296 +     uLong crc = crc32(0L, Z_NULL, 0);
216.1297 +
216.1298 +     while (read_buffer(buffer, length) != EOF) {
216.1299 +       crc = crc32(crc, buffer, length);
216.1300 +     }
216.1301 +     if (crc != original_crc) error();
216.1302 +*/
216.1303 +
216.1304 +ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2));
216.1305 +
216.1306 +/*
216.1307 +     Combine two CRC-32 check values into one.  For two sequences of bytes,
216.1308 +   seq1 and seq2 with lengths len1 and len2, CRC-32 check values were
216.1309 +   calculated for each, crc1 and crc2.  crc32_combine() returns the CRC-32
216.1310 +   check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and
216.1311 +   len2.
216.1312 +*/
216.1313 +
216.1314 +
216.1315 +                        /* various hacks, don't look :) */
216.1316 +
216.1317 +/* deflateInit and inflateInit are macros to allow checking the zlib version
216.1318 + * and the compiler's view of z_stream:
216.1319 + */
216.1320 +ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level,
216.1321 +                                     const char *version, int stream_size));
216.1322 +ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm,
216.1323 +                                     const char *version, int stream_size));
216.1324 +ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int  level, int  method,
216.1325 +                                      int windowBits, int memLevel,
216.1326 +                                      int strategy, const char *version,
216.1327 +                                      int stream_size));
216.1328 +ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int  windowBits,
216.1329 +                                      const char *version, int stream_size));
216.1330 +ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
216.1331 +                                         unsigned char FAR *window,
216.1332 +                                         const char *version,
216.1333 +                                         int stream_size));
216.1334 +#define deflateInit(strm, level) \
216.1335 +        deflateInit_((strm), (level),       ZLIB_VERSION, sizeof(z_stream))
216.1336 +#define inflateInit(strm) \
216.1337 +        inflateInit_((strm),                ZLIB_VERSION, sizeof(z_stream))
216.1338 +#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
216.1339 +        deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
216.1340 +                      (strategy),           ZLIB_VERSION, sizeof(z_stream))
216.1341 +#define inflateInit2(strm, windowBits) \
216.1342 +        inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream))
216.1343 +#define inflateBackInit(strm, windowBits, window) \
216.1344 +        inflateBackInit_((strm), (windowBits), (window), \
216.1345 +        ZLIB_VERSION, sizeof(z_stream))
216.1346 +
216.1347 +
216.1348 +#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL)
216.1349 +    struct internal_state {int dummy;}; /* hack for buggy compilers */
216.1350 +#endif
216.1351 +
216.1352 +ZEXTERN const char   * ZEXPORT zError           OF((int));
216.1353 +ZEXTERN int            ZEXPORT inflateSyncPoint OF((z_streamp z));
216.1354 +ZEXTERN const uLongf * ZEXPORT get_crc_table    OF((void));
216.1355 +
216.1356 +#ifdef __cplusplus
216.1357 +}
216.1358 +#endif
216.1359 +
216.1360 +#endif /* ZLIB_H */
   217.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   217.2 +++ b/libs/zlib/zutil.c	Sun Nov 01 00:36:56 2015 +0200
   217.3 @@ -0,0 +1,318 @@
   217.4 +/* zutil.c -- target dependent utility functions for the compression library
   217.5 + * Copyright (C) 1995-2005 Jean-loup Gailly.
   217.6 + * For conditions of distribution and use, see copyright notice in zlib.h
   217.7 + */
   217.8 +
   217.9 +/* @(#) $Id$ */
  217.10 +
  217.11 +#include "zutil.h"
  217.12 +
  217.13 +#ifndef NO_DUMMY_DECL
  217.14 +struct internal_state      {int dummy;}; /* for buggy compilers */
  217.15 +#endif
  217.16 +
  217.17 +const char * const z_errmsg[10] = {
  217.18 +"need dictionary",     /* Z_NEED_DICT       2  */
  217.19 +"stream end",          /* Z_STREAM_END      1  */
  217.20 +"",                    /* Z_OK              0  */
  217.21 +"file error",          /* Z_ERRNO         (-1) */
  217.22 +"stream error",        /* Z_STREAM_ERROR  (-2) */
  217.23 +"data error",          /* Z_DATA_ERROR    (-3) */
  217.24 +"insufficient memory", /* Z_MEM_ERROR     (-4) */
  217.25 +"buffer error",        /* Z_BUF_ERROR     (-5) */
  217.26 +"incompatible version",/* Z_VERSION_ERROR (-6) */
  217.27 +""};
  217.28 +
  217.29 +
  217.30 +const char * ZEXPORT zlibVersion()
  217.31 +{
  217.32 +    return ZLIB_VERSION;
  217.33 +}
  217.34 +
  217.35 +uLong ZEXPORT zlibCompileFlags()
  217.36 +{
  217.37 +    uLong flags;
  217.38 +
  217.39 +    flags = 0;
  217.40 +    switch (sizeof(uInt)) {
  217.41 +    case 2:     break;
  217.42 +    case 4:     flags += 1;     break;
  217.43 +    case 8:     flags += 2;     break;
  217.44 +    default:    flags += 3;
  217.45 +    }
  217.46 +    switch (sizeof(uLong)) {
  217.47 +    case 2:     break;
  217.48 +    case 4:     flags += 1 << 2;        break;
  217.49 +    case 8:     flags += 2 << 2;        break;
  217.50 +    default:    flags += 3 << 2;
  217.51 +    }
  217.52 +    switch (sizeof(voidpf)) {
  217.53 +    case 2:     break;
  217.54 +    case 4:     flags += 1 << 4;        break;
  217.55 +    case 8:     flags += 2 << 4;        break;
  217.56 +    default:    flags += 3 << 4;
  217.57 +    }
  217.58 +    switch (sizeof(z_off_t)) {
  217.59 +    case 2:     break;
  217.60 +    case 4:     flags += 1 << 6;        break;
  217.61 +    case 8:     flags += 2 << 6;        break;
  217.62 +    default:    flags += 3 << 6;
  217.63 +    }
  217.64 +#ifdef DEBUG
  217.65 +    flags += 1 << 8;
  217.66 +#endif
  217.67 +#if defined(ASMV) || defined(ASMINF)
  217.68 +    flags += 1 << 9;
  217.69 +#endif
  217.70 +#ifdef ZLIB_WINAPI
  217.71 +    flags += 1 << 10;
  217.72 +#endif
  217.73 +#ifdef BUILDFIXED
  217.74 +    flags += 1 << 12;
  217.75 +#endif
  217.76 +#ifdef DYNAMIC_CRC_TABLE
  217.77 +    flags += 1 << 13;
  217.78 +#endif
  217.79 +#ifdef NO_GZCOMPRESS
  217.80 +    flags += 1L << 16;
  217.81 +#endif
  217.82 +#ifdef NO_GZIP
  217.83 +    flags += 1L << 17;
  217.84 +#endif
  217.85 +#ifdef PKZIP_BUG_WORKAROUND
  217.86 +    flags += 1L << 20;
  217.87 +#endif
  217.88 +#ifdef FASTEST
  217.89 +    flags += 1L << 21;
  217.90 +#endif
  217.91 +#ifdef STDC
  217.92 +#  ifdef NO_vsnprintf
  217.93 +        flags += 1L << 25;
  217.94 +#    ifdef HAS_vsprintf_void
  217.95 +        flags += 1L << 26;
  217.96 +#    endif
  217.97 +#  else
  217.98 +#    ifdef HAS_vsnprintf_void
  217.99 +        flags += 1L << 26;
 217.100 +#    endif
 217.101 +#  endif
 217.102 +#else
 217.103 +        flags += 1L << 24;
 217.104 +#  ifdef NO_snprintf
 217.105 +        flags += 1L << 25;
 217.106 +#    ifdef HAS_sprintf_void
 217.107 +        flags += 1L << 26;
 217.108 +#    endif
 217.109 +#  else
 217.110 +#    ifdef HAS_snprintf_void
 217.111 +        flags += 1L << 26;
 217.112 +#    endif
 217.113 +#  endif
 217.114 +#endif
 217.115 +    return flags;
 217.116 +}
 217.117 +
 217.118 +#ifdef DEBUG
 217.119 +
 217.120 +#  ifndef verbose
 217.121 +#    define verbose 0
 217.122 +#  endif
 217.123 +int z_verbose = verbose;
 217.124 +
 217.125 +void z_error (m)
 217.126 +    char *m;
 217.127 +{
 217.128 +    fprintf(stderr, "%s\n", m);
 217.129 +    exit(1);
 217.130 +}
 217.131 +#endif
 217.132 +
 217.133 +/* exported to allow conversion of error code to string for compress() and
 217.134 + * uncompress()
 217.135 + */
 217.136 +const char * ZEXPORT zError(err)
 217.137 +    int err;
 217.138 +{
 217.139 +    return ERR_MSG(err);
 217.140 +}
 217.141 +
 217.142 +#if defined(_WIN32_WCE)
 217.143 +    /* The Microsoft C Run-Time Library for Windows CE doesn't have
 217.144 +     * errno.  We define it as a global variable to simplify porting.
 217.145 +     * Its value is always 0 and should not be used.
 217.146 +     */
 217.147 +    int errno = 0;
 217.148 +#endif
 217.149 +
 217.150 +#ifndef HAVE_MEMCPY
 217.151 +
 217.152 +void zmemcpy(dest, source, len)
 217.153 +    Bytef* dest;
 217.154 +    const Bytef* source;
 217.155 +    uInt  len;
 217.156 +{
 217.157 +    if (len == 0) return;
 217.158 +    do {
 217.159 +        *dest++ = *source++; /* ??? to be unrolled */
 217.160 +    } while (--len != 0);
 217.161 +}
 217.162 +
 217.163 +int zmemcmp(s1, s2, len)
 217.164 +    const Bytef* s1;
 217.165 +    const Bytef* s2;
 217.166 +    uInt  len;
 217.167 +{
 217.168 +    uInt j;
 217.169 +
 217.170 +    for (j = 0; j < len; j++) {
 217.171 +        if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1;
 217.172 +    }
 217.173 +    return 0;
 217.174 +}
 217.175 +
 217.176 +void zmemzero(dest, len)
 217.177 +    Bytef* dest;
 217.178 +    uInt  len;
 217.179 +{
 217.180 +    if (len == 0) return;
 217.181 +    do {
 217.182 +        *dest++ = 0;  /* ??? to be unrolled */
 217.183 +    } while (--len != 0);
 217.184 +}
 217.185 +#endif
 217.186 +
 217.187 +
 217.188 +#ifdef SYS16BIT
 217.189 +
 217.190 +#ifdef __TURBOC__
 217.191 +/* Turbo C in 16-bit mode */
 217.192 +
 217.193 +#  define MY_ZCALLOC
 217.194 +
 217.195 +/* Turbo C malloc() does not allow dynamic allocation of 64K bytes
 217.196 + * and farmalloc(64K) returns a pointer with an offset of 8, so we
 217.197 + * must fix the pointer. Warning: the pointer must be put back to its
 217.198 + * original form in order to free it, use zcfree().
 217.199 + */
 217.200 +
 217.201 +#define MAX_PTR 10
 217.202 +/* 10*64K = 640K */
 217.203 +
 217.204 +local int next_ptr = 0;
 217.205 +
 217.206 +typedef struct ptr_table_s {
 217.207 +    voidpf org_ptr;
 217.208 +    voidpf new_ptr;
 217.209 +} ptr_table;
 217.210 +
 217.211 +local ptr_table table[MAX_PTR];
 217.212 +/* This table is used to remember the original form of pointers
 217.213 + * to large buffers (64K). Such pointers are normalized with a zero offset.
 217.214 + * Since MSDOS is not a preemptive multitasking OS, this table is not
 217.215 + * protected from concurrent access. This hack doesn't work anyway on
 217.216 + * a protected system like OS/2. Use Microsoft C instead.
 217.217 + */
 217.218 +
 217.219 +voidpf zcalloc (voidpf opaque, unsigned items, unsigned size)
 217.220 +{
 217.221 +    voidpf buf = opaque; /* just to make some compilers happy */
 217.222 +    ulg bsize = (ulg)items*size;
 217.223 +
 217.224 +    /* If we allocate less than 65520 bytes, we assume that farmalloc
 217.225 +     * will return a usable pointer which doesn't have to be normalized.
 217.226 +     */
 217.227 +    if (bsize < 65520L) {
 217.228 +        buf = farmalloc(bsize);
 217.229 +        if (*(ush*)&buf != 0) return buf;
 217.230 +    } else {
 217.231 +        buf = farmalloc(bsize + 16L);
 217.232 +    }
 217.233 +    if (buf == NULL || next_ptr >= MAX_PTR) return NULL;
 217.234 +    table[next_ptr].org_ptr = buf;
 217.235 +
 217.236 +    /* Normalize the pointer to seg:0 */
 217.237 +    *((ush*)&buf+1) += ((ush)((uch*)buf-0) + 15) >> 4;
 217.238 +    *(ush*)&buf = 0;
 217.239 +    table[next_ptr++].new_ptr = buf;
 217.240 +    return buf;
 217.241 +}
 217.242 +
 217.243 +void  zcfree (voidpf opaque, voidpf ptr)
 217.244 +{
 217.245 +    int n;
 217.246 +    if (*(ush*)&ptr != 0) { /* object < 64K */
 217.247 +        farfree(ptr);
 217.248 +        return;
 217.249 +    }
 217.250 +    /* Find the original pointer */
 217.251 +    for (n = 0; n < next_ptr; n++) {
 217.252 +        if (ptr != table[n].new_ptr) continue;
 217.253 +
 217.254 +        farfree(table[n].org_ptr);
 217.255 +        while (++n < next_ptr) {
 217.256 +            table[n-1] = table[n];
 217.257 +        }
 217.258 +        next_ptr--;
 217.259 +        return;
 217.260 +    }
 217.261 +    ptr = opaque; /* just to make some compilers happy */
 217.262 +    Assert(0, "zcfree: ptr not found");
 217.263 +}
 217.264 +
 217.265 +#endif /* __TURBOC__ */
 217.266 +
 217.267 +
 217.268 +#ifdef M_I86
 217.269 +/* Microsoft C in 16-bit mode */
 217.270 +
 217.271 +#  define MY_ZCALLOC
 217.272 +
 217.273 +#if (!defined(_MSC_VER) || (_MSC_VER <= 600))
 217.274 +#  define _halloc  halloc
 217.275 +#  define _hfree   hfree
 217.276 +#endif
 217.277 +
 217.278 +voidpf zcalloc (voidpf opaque, unsigned items, unsigned size)
 217.279 +{
 217.280 +    if (opaque) opaque = 0; /* to make compiler happy */
 217.281 +    return _halloc((long)items, size);
 217.282 +}
 217.283 +
 217.284 +void  zcfree (voidpf opaque, voidpf ptr)
 217.285 +{
 217.286 +    if (opaque) opaque = 0; /* to make compiler happy */
 217.287 +    _hfree(ptr);
 217.288 +}
 217.289 +
 217.290 +#endif /* M_I86 */
 217.291 +
 217.292 +#endif /* SYS16BIT */
 217.293 +
 217.294 +
 217.295 +#ifndef MY_ZCALLOC /* Any system without a special alloc function */
 217.296 +
 217.297 +#ifndef STDC
 217.298 +extern voidp  malloc OF((uInt size));
 217.299 +extern voidp  calloc OF((uInt items, uInt size));
 217.300 +extern void   free   OF((voidpf ptr));
 217.301 +#endif
 217.302 +
 217.303 +voidpf zcalloc (opaque, items, size)
 217.304 +    voidpf opaque;
 217.305 +    unsigned items;
 217.306 +    unsigned size;
 217.307 +{
 217.308 +    if (opaque) items += size - size; /* make compiler happy */
 217.309 +    return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) :
 217.310 +                              (voidpf)calloc(items, size);
 217.311 +}
 217.312 +
 217.313 +void  zcfree (opaque, ptr)
 217.314 +    voidpf opaque;
 217.315 +    voidpf ptr;
 217.316 +{
 217.317 +    free(ptr);
 217.318 +    if (opaque) return; /* make compiler happy */
 217.319 +}
 217.320 +
 217.321 +#endif /* MY_ZCALLOC */
   218.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   218.2 +++ b/libs/zlib/zutil.h	Sun Nov 01 00:36:56 2015 +0200
   218.3 @@ -0,0 +1,269 @@
   218.4 +/* zutil.h -- internal interface and configuration of the compression library
   218.5 + * Copyright (C) 1995-2005 Jean-loup Gailly.
   218.6 + * For conditions of distribution and use, see copyright notice in zlib.h
   218.7 + */
   218.8 +
   218.9 +/* WARNING: this file should *not* be used by applications. It is
  218.10 +   part of the implementation of the compression library and is
  218.11 +   subject to change. Applications should only use zlib.h.
  218.12 + */
  218.13 +
  218.14 +/* @(#) $Id$ */
  218.15 +
  218.16 +#ifndef ZUTIL_H
  218.17 +#define ZUTIL_H
  218.18 +
  218.19 +#define ZLIB_INTERNAL
  218.20 +#include "zlib.h"
  218.21 +
  218.22 +#ifdef STDC
  218.23 +#  ifndef _WIN32_WCE
  218.24 +#    include <stddef.h>
  218.25 +#  endif
  218.26 +#  include <string.h>
  218.27 +#  include <stdlib.h>
  218.28 +#endif
  218.29 +#ifdef NO_ERRNO_H
  218.30 +#   ifdef _WIN32_WCE
  218.31 +      /* The Microsoft C Run-Time Library for Windows CE doesn't have
  218.32 +       * errno.  We define it as a global variable to simplify porting.
  218.33 +       * Its value is always 0 and should not be used.  We rename it to
  218.34 +       * avoid conflict with other libraries that use the same workaround.
  218.35 +       */
  218.36 +#     define errno z_errno
  218.37 +#   endif
  218.38 +    extern int errno;
  218.39 +#else
  218.40 +#  ifndef _WIN32_WCE
  218.41 +#    include <errno.h>
  218.42 +#  endif
  218.43 +#endif
  218.44 +
  218.45 +#ifndef local
  218.46 +#  define local static
  218.47 +#endif
  218.48 +/* compile with -Dlocal if your debugger can't find static symbols */
  218.49 +
  218.50 +typedef unsigned char  uch;
  218.51 +typedef uch FAR uchf;
  218.52 +typedef unsigned short ush;
  218.53 +typedef ush FAR ushf;
  218.54 +typedef unsigned long  ulg;
  218.55 +
  218.56 +extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
  218.57 +/* (size given to avoid silly warnings with Visual C++) */
  218.58 +
  218.59 +#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
  218.60 +
  218.61 +#define ERR_RETURN(strm,err) \
  218.62 +  return (strm->msg = (char*)ERR_MSG(err), (err))
  218.63 +/* To be used only when the state is known to be valid */
  218.64 +
  218.65 +        /* common constants */
  218.66 +
  218.67 +#ifndef DEF_WBITS
  218.68 +#  define DEF_WBITS MAX_WBITS
  218.69 +#endif
  218.70 +/* default windowBits for decompression. MAX_WBITS is for compression only */
  218.71 +
  218.72 +#if MAX_MEM_LEVEL >= 8
  218.73 +#  define DEF_MEM_LEVEL 8
  218.74 +#else
  218.75 +#  define DEF_MEM_LEVEL  MAX_MEM_LEVEL
  218.76 +#endif
  218.77 +/* default memLevel */
  218.78 +
  218.79 +#define STORED_BLOCK 0
  218.80 +#define STATIC_TREES 1
  218.81 +#define DYN_TREES    2
  218.82 +/* The three kinds of block type */
  218.83 +
  218.84 +#define MIN_MATCH  3
  218.85 +#define MAX_MATCH  258
  218.86 +/* The minimum and maximum match lengths */
  218.87 +
  218.88 +#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */
  218.89 +
  218.90 +        /* target dependencies */
  218.91 +
  218.92 +#if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32))
  218.93 +#  define OS_CODE  0x00
  218.94 +#  if defined(__TURBOC__) || defined(__BORLANDC__)
  218.95 +#    if(__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__))
  218.96 +       /* Allow compilation with ANSI keywords only enabled */
  218.97 +       void _Cdecl farfree( void *block );
  218.98 +       void *_Cdecl farmalloc( unsigned long nbytes );
  218.99 +#    else
 218.100 +#      include <alloc.h>
 218.101 +#    endif
 218.102 +#  else /* MSC or DJGPP */
 218.103 +#    include <malloc.h>
 218.104 +#  endif
 218.105 +#endif
 218.106 +
 218.107 +#ifdef AMIGA
 218.108 +#  define OS_CODE  0x01
 218.109 +#endif
 218.110 +
 218.111 +#if defined(VAXC) || defined(VMS)
 218.112 +#  define OS_CODE  0x02
 218.113 +#  define F_OPEN(name, mode) \
 218.114 +     fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512")
 218.115 +#endif
 218.116 +
 218.117 +#if defined(ATARI) || defined(atarist)
 218.118 +#  define OS_CODE  0x05
 218.119 +#endif
 218.120 +
 218.121 +#ifdef OS2
 218.122 +#  define OS_CODE  0x06
 218.123 +#  ifdef M_I86
 218.124 +     #include <malloc.h>
 218.125 +#  endif
 218.126 +#endif
 218.127 +
 218.128 +#if defined(MACOS) || defined(TARGET_OS_MAC)
 218.129 +#  define OS_CODE  0x07
 218.130 +#  if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
 218.131 +#    include <unix.h> /* for fdopen */
 218.132 +#  else
 218.133 +#    ifndef fdopen
 218.134 +#      define fdopen(fd,mode) NULL /* No fdopen() */
 218.135 +#    endif
 218.136 +#  endif
 218.137 +#endif
 218.138 +
 218.139 +#ifdef TOPS20
 218.140 +#  define OS_CODE  0x0a
 218.141 +#endif
 218.142 +
 218.143 +#ifdef WIN32
 218.144 +#  ifndef __CYGWIN__  /* Cygwin is Unix, not Win32 */
 218.145 +#    define OS_CODE  0x0b
 218.146 +#  endif
 218.147 +#endif
 218.148 +
 218.149 +#ifdef __50SERIES /* Prime/PRIMOS */
 218.150 +#  define OS_CODE  0x0f
 218.151 +#endif
 218.152 +
 218.153 +#if defined(_BEOS_) || defined(RISCOS)
 218.154 +#  define fdopen(fd,mode) NULL /* No fdopen() */
 218.155 +#endif
 218.156 +
 218.157 +#if (defined(_MSC_VER) && (_MSC_VER > 600))
 218.158 +#  if defined(_WIN32_WCE)
 218.159 +#    define fdopen(fd,mode) NULL /* No fdopen() */
 218.160 +#    ifndef _PTRDIFF_T_DEFINED
 218.161 +       typedef int ptrdiff_t;
 218.162 +#      define _PTRDIFF_T_DEFINED
 218.163 +#    endif
 218.164 +#  else
 218.165 +#    define fdopen(fd,type)  _fdopen(fd,type)
 218.166 +#  endif
 218.167 +#endif
 218.168 +
 218.169 +        /* common defaults */
 218.170 +
 218.171 +#ifndef OS_CODE
 218.172 +#  define OS_CODE  0x03  /* assume Unix */
 218.173 +#endif
 218.174 +
 218.175 +#ifndef F_OPEN
 218.176 +#  define F_OPEN(name, mode) fopen((name), (mode))
 218.177 +#endif
 218.178 +
 218.179 +         /* functions */
 218.180 +
 218.181 +#if defined(STDC99) || (defined(__TURBOC__) && __TURBOC__ >= 0x550)
 218.182 +#  ifndef HAVE_VSNPRINTF
 218.183 +#    define HAVE_VSNPRINTF
 218.184 +#  endif
 218.185 +#endif
 218.186 +#if defined(__CYGWIN__)
 218.187 +#  ifndef HAVE_VSNPRINTF
 218.188 +#    define HAVE_VSNPRINTF
 218.189 +#  endif
 218.190 +#endif
 218.191 +#ifndef HAVE_VSNPRINTF
 218.192 +#  ifdef MSDOS
 218.193 +     /* vsnprintf may exist on some MS-DOS compilers (DJGPP?),
 218.194 +        but for now we just assume it doesn't. */
 218.195 +#    define NO_vsnprintf
 218.196 +#  endif
 218.197 +#  ifdef __TURBOC__
 218.198 +#    define NO_vsnprintf
 218.199 +#  endif
 218.200 +#  ifdef WIN32
 218.201 +     /* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */
 218.202 +#    if !defined(vsnprintf) && !defined(NO_vsnprintf)
 218.203 +#      define vsnprintf _vsnprintf
 218.204 +#    endif
 218.205 +#  endif
 218.206 +#  ifdef __SASC
 218.207 +#    define NO_vsnprintf
 218.208 +#  endif
 218.209 +#endif
 218.210 +#ifdef VMS
 218.211 +#  define NO_vsnprintf
 218.212 +#endif
 218.213 +
 218.214 +#if defined(pyr)
 218.215 +#  define NO_MEMCPY
 218.216 +#endif
 218.217 +#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__)
 218.218 + /* Use our own functions for small and medium model with MSC <= 5.0.
 218.219 +  * You may have to use the same strategy for Borland C (untested).
 218.220 +  * The __SC__ check is for Symantec.
 218.221 +  */
 218.222 +#  define NO_MEMCPY
 218.223 +#endif
 218.224 +#if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY)
 218.225 +#  define HAVE_MEMCPY
 218.226 +#endif
 218.227 +#ifdef HAVE_MEMCPY
 218.228 +#  ifdef SMALL_MEDIUM /* MSDOS small or medium model */
 218.229 +#    define zmemcpy _fmemcpy
 218.230 +#    define zmemcmp _fmemcmp
 218.231 +#    define zmemzero(dest, len) _fmemset(dest, 0, len)
 218.232 +#  else
 218.233 +#    define zmemcpy memcpy
 218.234 +#    define zmemcmp memcmp
 218.235 +#    define zmemzero(dest, len) memset(dest, 0, len)
 218.236 +#  endif
 218.237 +#else
 218.238 +   extern void zmemcpy  OF((Bytef* dest, const Bytef* source, uInt len));
 218.239 +   extern int  zmemcmp  OF((const Bytef* s1, const Bytef* s2, uInt len));
 218.240 +   extern void zmemzero OF((Bytef* dest, uInt len));
 218.241 +#endif
 218.242 +
 218.243 +/* Diagnostic functions */
 218.244 +#ifdef DEBUG
 218.245 +#  include <stdio.h>
 218.246 +   extern int z_verbose;
 218.247 +   extern void z_error    OF((char *m));
 218.248 +#  define Assert(cond,msg) {if(!(cond)) z_error(msg);}
 218.249 +#  define Trace(x) {if (z_verbose>=0) fprintf x ;}
 218.250 +#  define Tracev(x) {if (z_verbose>0) fprintf x ;}
 218.251 +#  define Tracevv(x) {if (z_verbose>1) fprintf x ;}
 218.252 +#  define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;}
 218.253 +#  define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;}
 218.254 +#else
 218.255 +#  define Assert(cond,msg)
 218.256 +#  define Trace(x)
 218.257 +#  define Tracev(x)
 218.258 +#  define Tracevv(x)
 218.259 +#  define Tracec(c,x)
 218.260 +#  define Tracecv(c,x)
 218.261 +#endif
 218.262 +
 218.263 +
 218.264 +voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size));
 218.265 +void   zcfree  OF((voidpf opaque, voidpf ptr));
 218.266 +
 218.267 +#define ZALLOC(strm, items, size) \
 218.268 +           (*((strm)->zalloc))((strm)->opaque, (items), (size))
 218.269 +#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
 218.270 +#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
 218.271 +
 218.272 +#endif /* ZUTIL_H */