summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonty <xiphmont@xiph.org>2001-10-09 04:34:55 +0000
committerMonty <xiphmont@xiph.org>2001-10-09 04:34:55 +0000
commit5f94292430b302d7798e171e51b36e5f3090d499 (patch)
treed3d6490f17241f4519956e68340eff600a563ae9
parent398f15cdcd1c22b00e7ea30d78c59220654ec756 (diff)
downloadlibvorbis-git-5f94292430b302d7798e171e51b36e5f3090d499.tar.gz
bitrate management engine first commit. Still at least one bug/not
well tested. Monty svn path=/branches/branch_monty_20011009/vorbis/; revision=2124
-rw-r--r--examples/encoder_example.c213
-rw-r--r--lib/backends.h192
-rw-r--r--lib/block.c834
-rw-r--r--lib/books/line_1024x31_0sub0.vqh37
-rw-r--r--lib/books/line_1024x31_0sub1.vqh40
-rw-r--r--lib/books/line_1024x31_1sub0.vqh37
-rw-r--r--lib/books/line_1024x31_1sub1.vqh40
-rw-r--r--lib/books/line_1024x31_2sub1.vqh37
-rw-r--r--lib/books/line_1024x31_2sub2.vqh38
-rw-r--r--lib/books/line_1024x31_2sub3.vqh40
-rw-r--r--lib/books/line_1024x31_3sub1.vqh37
-rw-r--r--lib/books/line_1024x31_3sub2.vqh38
-rw-r--r--lib/books/line_1024x31_3sub3.vqh40
-rw-r--r--lib/books/line_1024x31_class0.vqh37
-rw-r--r--lib/books/line_1024x31_class1.vqh37
-rw-r--r--lib/books/line_1024x31_class2.vqh40
-rw-r--r--lib/books/line_1024x31_class3.vqh40
-rw-r--r--lib/books/line_128x7_0sub0.vqh40
-rw-r--r--lib/books/line_128x7_1sub1.vqh37
-rw-r--r--lib/books/line_128x7_1sub2.vqh38
-rw-r--r--lib/books/line_128x7_1sub3.vqh40
-rw-r--r--lib/books/line_128x7_2sub1.vqh37
-rw-r--r--lib/books/line_128x7_2sub2.vqh38
-rw-r--r--lib/books/line_128x7_2sub3.vqh40
-rw-r--r--lib/books/line_128x7_class1.vqh40
-rw-r--r--lib/books/line_128x7_class2.vqh40
-rw-r--r--lib/books/res_44c_A_128aux.vqh43
-rw-r--r--lib/books/res_44c_Z_1024aux.vqh43
-rw-r--r--lib/books/res_44c_Z_128aux.vqh99
-rw-r--r--lib/books/res_Zc_1.vqh94
-rw-r--r--lib/books/res_Zc_2.vqh300
-rw-r--r--lib/books/res_Zc_3.vqh248
-rw-r--r--lib/books/res_Zc_5.vqh89
-rw-r--r--lib/books/res_Zc_6.vqh129
-rw-r--r--lib/books/res_Zc_7.vqh119
-rw-r--r--lib/books/res_Zc_8.vqh1043
-rw-r--r--lib/books/res_Zc_9.vqh99
-rw-r--r--lib/books/res_Zc_9a.vqh115
-rw-r--r--lib/books/res_Zc_9b.vqh63
-rw-r--r--lib/codec_internal.h147
-rw-r--r--lib/mapping0.c890
-rw-r--r--lib/modes/mode_44c_A.h377
-rw-r--r--lib/modes/mode_44c_Z.h338
-rw-r--r--lib/psy.h175
-rw-r--r--lib/res0.c918
-rw-r--r--vq/res_44c_A.vqs47
-rw-r--r--vq/res_44c_Z.vqs63
47 files changed, 7566 insertions, 0 deletions
diff --git a/examples/encoder_example.c b/examples/encoder_example.c
new file mode 100644
index 00000000..607a3ee9
--- /dev/null
+++ b/examples/encoder_example.c
@@ -0,0 +1,213 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+ * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+ * *
+ * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 *
+ * by the XIPHOPHORUS Company http://www.xiph.org/ *
+
+ ********************************************************************
+
+ function: simple example encoder
+ last mod: $Id: encoder_example.c,v 1.27.2.1 2001/10/09 04:34:44 xiphmont Exp $
+
+ ********************************************************************/
+
+/* takes a stereo 16bit 44.1kHz WAV file from stdin and encodes it into
+ a Vorbis bitstream */
+
+/* Note that this is POSIX, not ANSI, code */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <math.h>
+#include <vorbis/vorbisenc.h>
+
+#ifdef _WIN32 /* We need the following two to set stdin/stdout to binary */
+#include <io.h>
+#include <fcntl.h>
+#endif
+
+#if defined(macintosh) && defined(__MWERKS__)
+#include <console.h> /* CodeWarrior's Mac "command-line" support */
+#endif
+
+#define READ 1024
+signed char readbuffer[READ*4+44]; /* out of the data segment, not the stack */
+
+int main(){
+ ogg_stream_state os; /* take physical pages, weld into a logical
+ stream of packets */
+ ogg_page og; /* one Ogg bitstream page. Vorbis packets are inside */
+ ogg_packet op; /* one raw packet of data for decode */
+
+ vorbis_info vi; /* struct that stores all the static vorbis bitstream
+ settings */
+ vorbis_comment vc; /* struct that stores all the user comments */
+
+ vorbis_dsp_state vd; /* central working state for the packet->PCM decoder */
+ vorbis_block vb; /* local working space for packet->PCM decode */
+
+ int eos=0;
+ int i, founddata;
+
+#if defined(macintosh) && defined(__MWERKS__)
+ int argc = 0;
+ char **argv = NULL;
+ argc = ccommand(&argv); /* get a "command line" from the Mac user */
+ /* this also lets the user set stdin and stdout */
+#endif
+
+ /* we cheat on the WAV header; we just bypass 44 bytes and never
+ verify that it matches 16bit/stereo/44.1kHz. This is just an
+ example, after all. */
+
+#ifdef _WIN32 /* We need to set stdin/stdout to binary mode. Damn windows. */
+ /* Beware the evil ifdef. We avoid these where we can, but this one we
+ cannot. Don't add any more, you'll probably go to hell if you do. */
+ _setmode( _fileno( stdin ), _O_BINARY );
+ _setmode( _fileno( stdout ), _O_BINARY );
+#endif
+
+ /* we cheat on the WAV header; we just bypass the header and never
+ verify that it matches 16bit/stereo/44.1kHz. This is just an
+ example, after all. */
+
+ readbuffer[0] = '\0';
+ for (i=0, founddata=0; i<30 && ! feof(stdin) && ! ferror(stdin); i++)
+ {
+ fread(readbuffer,1,2,stdin);
+
+ if ( ! strncmp(readbuffer, "da", 2) )
+ {
+ founddata = 1;
+ fread(readbuffer,1,6,stdin);
+ }
+ }
+
+ /********** Encode setup ************/
+
+ /* choose an encoding mode */
+ /* (mode 0: 44kHz stereo uncoupled, roughly 128kbps VBR) */
+ vorbis_info_init(&vi);
+ vorbis_encode_init(&vi,2,44100, -1, 128000, -1);
+
+ /* add a comment */
+ vorbis_comment_init(&vc);
+ vorbis_comment_add(&vc,"Track encoded by encoder_example.c");
+
+ /* set up the analysis state and auxiliary encoding storage */
+ vorbis_analysis_init(&vd,&vi);
+ vorbis_block_init(&vd,&vb);
+
+ /* set up our packet->stream encoder */
+ /* pick a random serial number; that way we can more likely build
+ chained streams just by concatenation */
+ srand(time(NULL));
+ ogg_stream_init(&os,rand());
+
+ /* Vorbis streams begin with three headers; the initial header (with
+ most of the codec setup parameters) which is mandated by the Ogg
+ bitstream spec. The second header holds any comment fields. The
+ third header holds the bitstream codebook. We merely need to
+ make the headers, then pass them to libvorbis one at a time;
+ libvorbis handles the additional Ogg bitstream constraints */
+
+ {
+ ogg_packet header;
+ ogg_packet header_comm;
+ ogg_packet header_code;
+
+ vorbis_analysis_headerout(&vd,&vc,&header,&header_comm,&header_code);
+ ogg_stream_packetin(&os,&header); /* automatically placed in its own
+ page */
+ ogg_stream_packetin(&os,&header_comm);
+ ogg_stream_packetin(&os,&header_code);
+
+ /* We don't have to write out here, but doing so makes streaming
+ * much easier, so we do, flushing ALL pages. This ensures the actual
+ * audio data will start on a new page
+ */
+ while(!eos){
+ int result=ogg_stream_flush(&os,&og);
+ if(result==0)break;
+ fwrite(og.header,1,og.header_len,stdout);
+ fwrite(og.body,1,og.body_len,stdout);
+ }
+
+ }
+
+ while(!eos){
+ long i;
+ long bytes=fread(readbuffer,1,READ*4,stdin); /* stereo hardwired here */
+
+ if(bytes==0){
+ /* end of file. this can be done implicitly in the mainline,
+ but it's easier to see here in non-clever fashion.
+ Tell the library we're at end of stream so that it can handle
+ the last frame and mark end of stream in the output properly */
+ vorbis_analysis_wrote(&vd,0);
+
+ }else{
+ /* data to encode */
+
+ /* expose the buffer to submit data */
+ float **buffer=vorbis_analysis_buffer(&vd,READ);
+
+ /* uninterleave samples */
+ for(i=0;i<bytes/4;i++){
+ buffer[0][i]=((readbuffer[i*4+1]<<8)|
+ (0x00ff&(int)readbuffer[i*4]))/32768.f;
+ buffer[1][i]=((readbuffer[i*4+3]<<8)|
+ (0x00ff&(int)readbuffer[i*4+2]))/32768.f;
+ }
+
+ /* tell the library how much we actually submitted */
+ vorbis_analysis_wrote(&vd,i);
+ }
+
+ /* vorbis does some data preanalysis, then divvies up blocks for
+ more involved (potentially parallel) processing. Get a single
+ block for encoding now */
+ while(vorbis_analysis_blockout(&vd,&vb)==1){
+
+ /* analysis */
+ vorbis_analysis(&vb,&op);
+
+ /* weld the packet into the bitstream */
+ ogg_stream_packetin(&os,&op);
+
+ /* write out pages (if any) */
+ while(!eos){
+ int result=ogg_stream_pageout(&os,&og);
+ if(result==0)break;
+ fwrite(og.header,1,og.header_len,stdout);
+ fwrite(og.body,1,og.body_len,stdout);
+
+ /* this could be set above, but for illustrative purposes, I do
+ it here (to show that vorbis does know where the stream ends) */
+
+ if(ogg_page_eos(&og))eos=1;
+
+ }
+ }
+ }
+
+ /* clean up and exit. vorbis_info_clear() must be called last */
+
+ ogg_stream_clear(&os);
+ vorbis_block_clear(&vb);
+ vorbis_dsp_clear(&vd);
+ vorbis_comment_clear(&vc);
+ vorbis_info_clear(&vi);
+
+ /* ogg_page and ogg_packet structs always point to storage in
+ libvorbis. They're never freed or manipulated directly */
+
+ fprintf(stderr,"Done.\n");
+ return(0);
+}
diff --git a/lib/backends.h b/lib/backends.h
new file mode 100644
index 00000000..16c2438c
--- /dev/null
+++ b/lib/backends.h
@@ -0,0 +1,192 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+ * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+ * *
+ * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 *
+ * by the XIPHOPHORUS Company http://www.xiph.org/ *
+
+ ********************************************************************
+
+ function: libvorbis backend and mapping structures; needed for
+ static mode headers
+ last mod: $Id: backends.h,v 1.10.4.1 2001/10/09 04:34:45 xiphmont Exp $
+
+ ********************************************************************/
+
+/* this is exposed up here because we need it for static modes.
+ Lookups for each backend aren't exposed because there's no reason
+ to do so */
+
+#ifndef _vorbis_backend_h_
+#define _vorbis_backend_h_
+
+#include "codec_internal.h"
+
+/* this would all be simpler/shorter with templates, but.... */
+/* Transform backend generic *************************************/
+
+/* only mdct right now. Flesh it out more if we ever transcend mdct
+ in the transform domain */
+
+/* Time backend generic ******************************************/
+typedef struct{
+ void (*pack) (vorbis_info_time *,oggpack_buffer *);
+ vorbis_info_time *(*unpack)(vorbis_info *,oggpack_buffer *);
+ vorbis_look_time *(*look) (vorbis_dsp_state *,vorbis_info_mode *,
+ vorbis_info_time *);
+ vorbis_info_time *(*copy_info)(vorbis_info_time *);
+
+ void (*free_info) (vorbis_info_time *);
+ void (*free_look) (vorbis_look_time *);
+ int (*forward) (struct vorbis_block *,vorbis_look_time *,
+ float *,float *);
+ int (*inverse) (struct vorbis_block *,vorbis_look_time *,
+ float *,float *);
+} vorbis_func_time;
+
+typedef struct{
+ int dummy;
+} vorbis_info_time0;
+
+/* Floor backend generic *****************************************/
+typedef struct{
+ void (*pack) (vorbis_info_floor *,oggpack_buffer *);
+ vorbis_info_floor *(*unpack)(vorbis_info *,oggpack_buffer *);
+ vorbis_look_floor *(*look) (vorbis_dsp_state *,vorbis_info_mode *,
+ vorbis_info_floor *);
+ vorbis_info_floor *(*copy_info)(vorbis_info_floor *);
+ void (*free_info) (vorbis_info_floor *);
+ void (*free_look) (vorbis_look_floor *);
+ int (*forward) (struct vorbis_block *,vorbis_look_floor *,
+ float *, const float *, /* in */
+ const float *, const float *, /* in */
+ float *); /* out */
+ void *(*inverse1) (struct vorbis_block *,vorbis_look_floor *);
+ int (*inverse2) (struct vorbis_block *,vorbis_look_floor *,
+ void *buffer,float *);
+} vorbis_func_floor;
+
+typedef struct{
+ int order;
+ long rate;
+ long barkmap;
+
+ int ampbits;
+ int ampdB;
+
+ int numbooks; /* <= 16 */
+ int books[16];
+
+ float lessthan; /* encode-only config setting hacks for libvorbis */
+ float greaterthan; /* encode-only config setting hacks for libvorbis */
+
+} vorbis_info_floor0;
+
+#define VIF_POSIT 63
+#define VIF_CLASS 16
+#define VIF_PARTS 31
+typedef struct{
+ int partitions; /* 0 to 31 */
+ int partitionclass[VIF_PARTS]; /* 0 to 15 */
+
+ int class_dim[VIF_CLASS]; /* 1 to 8 */
+ int class_subs[VIF_CLASS]; /* 0,1,2,3 (bits: 1<<n poss) */
+ int class_book[VIF_CLASS]; /* subs ^ dim entries */
+ int class_subbook[VIF_CLASS][8]; /* [VIF_CLASS][subs] */
+
+
+ int mult; /* 1 2 3 or 4 */
+ int postlist[VIF_POSIT+2]; /* first two implicit */
+
+
+ /* encode side analysis parameters */
+ float maxover;
+ float maxunder;
+ float maxerr;
+
+ int twofitminsize;
+ int twofitminused;
+ int twofitweight;
+ float twofitatten;
+ int unusedminsize;
+ int unusedmin_n;
+
+ int n;
+
+} vorbis_info_floor1;
+
+/* Residue backend generic *****************************************/
+typedef struct{
+ void (*pack) (vorbis_info_residue *,oggpack_buffer *);
+ vorbis_info_residue *(*unpack)(vorbis_info *,oggpack_buffer *);
+ vorbis_look_residue *(*look) (vorbis_dsp_state *,vorbis_info_mode *,
+ vorbis_info_residue *);
+ vorbis_info_residue *(*copy_info)(vorbis_info_residue *);
+ void (*free_info) (vorbis_info_residue *);
+ void (*free_look) (vorbis_look_residue *);
+ long **(*class) (struct vorbis_block *,vorbis_look_residue *,
+ float **,int *,int);
+ int (*forward) (struct vorbis_block *,vorbis_look_residue *,
+ float **,float **,int *,int,int,long **,double,ogg_uint32_t *);
+ int (*inverse) (struct vorbis_block *,vorbis_look_residue *,
+ float **,int *,int);
+} vorbis_func_residue;
+
+typedef struct vorbis_info_residue0{
+/* block-partitioned VQ coded straight residue */
+ long begin;
+ long end;
+
+ /* first stage (lossless partitioning) */
+ int grouping; /* group n vectors per partition */
+ int partitions; /* possible codebooks for a partition */
+ int groupbook; /* huffbook for partitioning */
+ int secondstages[64]; /* expanded out to pointers in lookup */
+ int booklist[256]; /* list of second stage books */
+
+ /* encode-only heuristic settings */
+ float entmax[64]; /* book entropy threshholds*/
+ float ampmax[64]; /* book amp threshholds*/
+ int subgrp[64]; /* book heuristic subgroup size */
+ int blimit[64]; /* subgroup position limits */
+} vorbis_info_residue0;
+
+/* Mapping backend generic *****************************************/
+typedef struct{
+ void (*pack) (vorbis_info *,vorbis_info_mapping *,
+ oggpack_buffer *);
+ vorbis_info_mapping *(*unpack)(vorbis_info *,oggpack_buffer *);
+ vorbis_look_mapping *(*look) (vorbis_dsp_state *,vorbis_info_mode *,
+ vorbis_info_mapping *);
+ vorbis_info_mapping *(*copy_info)(vorbis_info_mapping *);
+ void (*free_info) (vorbis_info_mapping *);
+ void (*free_look) (vorbis_look_mapping *);
+ int (*forward) (struct vorbis_block *vb,vorbis_look_mapping *);
+ int (*inverse) (struct vorbis_block *vb,vorbis_look_mapping *);
+} vorbis_func_mapping;
+
+typedef struct vorbis_info_mapping0{
+ int submaps; /* <= 16 */
+ int chmuxlist[256]; /* up to 256 channels in a Vorbis stream */
+
+ int timesubmap[16]; /* [mux] */
+ int floorsubmap[16]; /* [mux] submap to floors */
+ int residuesubmap[16]; /* [mux] submap to residue */
+
+ int psy[2]; /* by blocktype; impulse/padding for short,
+ transition/normal for long */
+
+ int coupling_steps;
+ int coupling_mag[256];
+ int coupling_ang[256];
+} vorbis_info_mapping0;
+
+#endif
+
+
+
+
+
diff --git a/lib/block.c b/lib/block.c
new file mode 100644
index 00000000..ad6481e5
--- /dev/null
+++ b/lib/block.c
@@ -0,0 +1,834 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+ * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+ * *
+ * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 *
+ * by the XIPHOPHORUS Company http://www.xiph.org/ *
+
+ ********************************************************************
+
+ function: PCM data vector blocking, windowing and dis/reassembly
+ last mod: $Id: block.c,v 1.50.2.1 2001/10/09 04:34:45 xiphmont Exp $
+
+ Handle windowing, overlap-add, etc of the PCM vectors. This is made
+ more amusing by Vorbis' current two allowed block sizes.
+
+ ********************************************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ogg/ogg.h>
+#include "vorbis/codec.h"
+#include "codec_internal.h"
+
+#include "window.h"
+#include "envelope.h"
+#include "mdct.h"
+#include "lpc.h"
+#include "registry.h"
+#include "codebook.h"
+#include "misc.h"
+#include "os.h"
+#include "psy.h"
+
+static int ilog2(unsigned int v){
+ int ret=0;
+ while(v>1){
+ ret++;
+ v>>=1;
+ }
+ return(ret);
+}
+
+/* pcm accumulator examples (not exhaustive):
+
+ <-------------- lW ---------------->
+ <--------------- W ---------------->
+: .....|..... _______________ |
+: .''' | '''_--- | |\ |
+:.....''' |_____--- '''......| | \_______|
+:.................|__________________|_______|__|______|
+ |<------ Sl ------>| > Sr < |endW
+ |beginSl |endSl | |endSr
+ |beginW |endlW |beginSr
+
+
+ |< lW >|
+ <--------------- W ---------------->
+ | | .. ______________ |
+ | | ' `/ | ---_ |
+ |___.'___/`. | ---_____|
+ |_______|__|_______|_________________|
+ | >|Sl|< |<------ Sr ----->|endW
+ | | |endSl |beginSr |endSr
+ |beginW | |endlW
+ mult[0] |beginSl mult[n]
+
+ <-------------- lW ----------------->
+ |<--W-->|
+: .............. ___ | |
+: .''' |`/ \ | |
+:.....''' |/`....\|...|
+:.........................|___|___|___|
+ |Sl |Sr |endW
+ | | |endSr
+ | |beginSr
+ | |endSl
+ |beginSl
+ |beginW
+*/
+
+/* block abstraction setup *********************************************/
+
+#ifndef WORD_ALIGN
+#define WORD_ALIGN 8
+#endif
+
+int vorbis_block_init(vorbis_dsp_state *v, vorbis_block *vb){
+ memset(vb,0,sizeof(*vb));
+ vb->vd=v;
+ vb->localalloc=0;
+ vb->localstore=NULL;
+ if(v->analysisp){
+ oggpack_writeinit(&vb->opb);
+ vb->internal=_ogg_calloc(1,sizeof(vorbis_block_internal));
+ ((vorbis_block_internal *)vb->internal)->ampmax=-9999;
+ }
+
+ return(0);
+}
+
+void *_vorbis_block_alloc(vorbis_block *vb,long bytes){
+ bytes=(bytes+(WORD_ALIGN-1)) & ~(WORD_ALIGN-1);
+ if(bytes+vb->localtop>vb->localalloc){
+ /* can't just _ogg_realloc... there are outstanding pointers */
+ if(vb->localstore){
+ struct alloc_chain *link=_ogg_malloc(sizeof(*link));
+ vb->totaluse+=vb->localtop;
+ link->next=vb->reap;
+ link->ptr=vb->localstore;
+ vb->reap=link;
+ }
+ /* highly conservative */
+ vb->localalloc=bytes;
+ vb->localstore=_ogg_malloc(vb->localalloc);
+ vb->localtop=0;
+ }
+ {
+ void *ret=(void *)(((char *)vb->localstore)+vb->localtop);
+ vb->localtop+=bytes;
+ return ret;
+ }
+}
+
+/* reap the chain, pull the ripcord */
+void _vorbis_block_ripcord(vorbis_block *vb){
+ /* reap the chain */
+ struct alloc_chain *reap=vb->reap;
+ while(reap){
+ struct alloc_chain *next=reap->next;
+ _ogg_free(reap->ptr);
+ memset(reap,0,sizeof(*reap));
+ _ogg_free(reap);
+ reap=next;
+ }
+ /* consolidate storage */
+ if(vb->totaluse){
+ vb->localstore=_ogg_realloc(vb->localstore,vb->totaluse+vb->localalloc);
+ vb->localalloc+=vb->totaluse;
+ vb->totaluse=0;
+ }
+
+ /* pull the ripcord */
+ vb->localtop=0;
+ vb->reap=NULL;
+}
+
+int vorbis_block_clear(vorbis_block *vb){
+ if(vb->vd)
+ if(vb->vd->analysisp)
+ oggpack_writeclear(&vb->opb);
+ _vorbis_block_ripcord(vb);
+ if(vb->localstore)_ogg_free(vb->localstore);
+ if(vb->internal)_ogg_free(vb->internal);
+
+ memset(vb,0,sizeof(*vb));
+ return(0);
+}
+
+/* Analysis side code, but directly related to blocking. Thus it's
+ here and not in analysis.c (which is for analysis transforms only).
+ The init is here because some of it is shared */
+
+static int _vds_shared_init(vorbis_dsp_state *v,vorbis_info *vi,int encp){
+ int i;
+ codec_setup_info *ci=vi->codec_setup;
+ backend_lookup_state *b=NULL;
+
+ memset(v,0,sizeof(*v));
+ b=v->backend_state=_ogg_calloc(1,sizeof(*b));
+
+ v->vi=vi;
+ b->modebits=ilog2(ci->modes);
+
+ b->transform[0]=_ogg_calloc(VI_TRANSFORMB,sizeof(*b->transform[0]));
+ b->transform[1]=_ogg_calloc(VI_TRANSFORMB,sizeof(*b->transform[1]));
+
+ /* MDCT is tranform 0 */
+
+ b->transform[0][0]=_ogg_calloc(1,sizeof(mdct_lookup));
+ b->transform[1][0]=_ogg_calloc(1,sizeof(mdct_lookup));
+ mdct_init(b->transform[0][0],ci->blocksizes[0]);
+ mdct_init(b->transform[1][0],ci->blocksizes[1]);
+
+ b->window[0][0][0]=_ogg_calloc(VI_WINDOWB,sizeof(*b->window[0][0][0]));
+ b->window[0][0][1]=b->window[0][0][0];
+ b->window[0][1][0]=b->window[0][0][0];
+ b->window[0][1][1]=b->window[0][0][0];
+ b->window[1][0][0]=_ogg_calloc(VI_WINDOWB,sizeof(*b->window[1][0][0]));
+ b->window[1][0][1]=_ogg_calloc(VI_WINDOWB,sizeof(*b->window[1][0][1]));
+ b->window[1][1][0]=_ogg_calloc(VI_WINDOWB,sizeof(*b->window[1][1][0]));
+ b->window[1][1][1]=_ogg_calloc(VI_WINDOWB,sizeof(*b->window[1][1][1]));
+
+ for(i=0;i<VI_WINDOWB;i++){
+ b->window[0][0][0][i]=
+ _vorbis_window(i,ci->blocksizes[0],ci->blocksizes[0]/2,ci->blocksizes[0]/2);
+ b->window[1][0][0][i]=
+ _vorbis_window(i,ci->blocksizes[1],ci->blocksizes[0]/2,ci->blocksizes[0]/2);
+ b->window[1][0][1][i]=
+ _vorbis_window(i,ci->blocksizes[1],ci->blocksizes[0]/2,ci->blocksizes[1]/2);
+ b->window[1][1][0][i]=
+ _vorbis_window(i,ci->blocksizes[1],ci->blocksizes[1]/2,ci->blocksizes[0]/2);
+ b->window[1][1][1][i]=
+ _vorbis_window(i,ci->blocksizes[1],ci->blocksizes[1]/2,ci->blocksizes[1]/2);
+ }
+
+ if(encp){ /* encode/decode differ here */
+ /* finish the codebooks */
+ b->fullbooks=_ogg_calloc(ci->books,sizeof(*b->fullbooks));
+ for(i=0;i<ci->books;i++)
+ vorbis_book_init_encode(b->fullbooks+i,ci->book_param[i]);
+ v->analysisp=1;
+ }else{
+ /* finish the codebooks */
+ b->fullbooks=_ogg_calloc(ci->books,sizeof(*b->fullbooks));
+ for(i=0;i<ci->books;i++)
+ vorbis_book_init_decode(b->fullbooks+i,ci->book_param[i]);
+ }
+
+ /* initialize the storage vectors to a decent size greater than the
+ minimum */
+
+ v->pcm_storage=8192; /* we'll assume later that we have
+ a minimum of twice the blocksize of
+ accumulated samples in analysis */
+ v->pcm=_ogg_malloc(vi->channels*sizeof(*v->pcm));
+ v->pcmret=_ogg_malloc(vi->channels*sizeof(*v->pcmret));
+ {
+ int i;
+ for(i=0;i<vi->channels;i++)
+ v->pcm[i]=_ogg_calloc(v->pcm_storage,sizeof(*v->pcm[i]));
+ }
+
+ /* all 1 (large block) or 0 (small block) */
+ /* explicitly set for the sake of clarity */
+ v->lW=0; /* previous window size */
+ v->W=0; /* current window size */
+
+ /* all vector indexes */
+ v->centerW=ci->blocksizes[1]/2;
+
+ v->pcm_current=v->centerW;
+
+ /* initialize all the mapping/backend lookups */
+ b->mode=_ogg_calloc(ci->modes,sizeof(*b->mode));
+ for(i=0;i<ci->modes;i++){
+ int mapnum=ci->mode_param[i]->mapping;
+ int maptype=ci->map_type[mapnum];
+ b->mode[i]=_mapping_P[maptype]->look(v,ci->mode_param[i],
+ ci->map_param[mapnum]);
+ }
+
+ return(0);
+}
+
+/* arbitrary settings and spec-mandated numbers get filled in here */
+int vorbis_analysis_init(vorbis_dsp_state *v,vorbis_info *vi){
+ backend_lookup_state *b=NULL;
+
+ _vds_shared_init(v,vi,1);
+ b=v->backend_state;
+ b->psy_g_look=_vp_global_look(vi);
+
+ /* Initialize the envelope state storage */
+ b->ve=_ogg_calloc(1,sizeof(*b->ve));
+ _ve_envelope_init(b->ve,vi);
+
+ /* compute bitrate tracking setup, allocate circular packet size queue */
+ {
+ codec_setup_info *ci=vi->codec_setup;
+ /* first find the max possible needed queue size */
+ long maxpackets=(max(ci->bitrate_bound_queuetime,
+ ci->bitrate_avg_queuetime)*
+ vi->rate+(ci->blocksizes[0]-1))/ci->blocksizes[0]+1;
+ long eighths=8*ci->passlimit[ci->coupling_passes-1];
+ if(ci->bitrate_queue_loweravg<=0. && ci->bitrate_queue_upperavg<=0.)eighths=0;
+
+ b->bitrate_queue_size=maxpackets;
+ b->bitrate_eighths=eighths;
+ b->bitrate_queue=_ogg_malloc(maxpackets*sizeof(*b->bitrate_queue));
+ if(eighths){
+ b->bitrate_queue_eighths=_ogg_malloc(maxpackets*eighths*sizeof(*b->bitrate_queue));
+ b->bitrate_avgbitacc=_ogg_malloc(eighths*sizeof(*b->bitrate_avgbitacc));
+ }
+ b->bitrate_floatinglimit=ci->bitrate_floatinglimit_initial;
+ }
+
+ return(0);
+}
+
+void vorbis_dsp_clear(vorbis_dsp_state *v){
+ int i,j,k;
+ if(v){
+ vorbis_info *vi=v->vi;
+ codec_setup_info *ci=(vi?vi->codec_setup:NULL);
+ backend_lookup_state *b=v->backend_state;
+
+ if(b){
+ if(b->window[0][0][0]){
+ for(i=0;i<VI_WINDOWB;i++)
+ if(b->window[0][0][0][i])_ogg_free(b->window[0][0][0][i]);
+ _ogg_free(b->window[0][0][0]);
+
+ for(j=0;j<2;j++)
+ for(k=0;k<2;k++){
+ for(i=0;i<VI_WINDOWB;i++)
+ if(b->window[1][j][k][i])_ogg_free(b->window[1][j][k][i]);
+ _ogg_free(b->window[1][j][k]);
+ }
+ }
+
+ if(b->ve){
+ _ve_envelope_clear(b->ve);
+ _ogg_free(b->ve);
+ }
+
+ if(b->transform[0]){
+ mdct_clear(b->transform[0][0]);
+ _ogg_free(b->transform[0][0]);
+ _ogg_free(b->transform[0]);
+ }
+ if(b->transform[1]){
+ mdct_clear(b->transform[1][0]);
+ _ogg_free(b->transform[1][0]);
+ _ogg_free(b->transform[1]);
+ }
+ if(b->psy_g_look)_vp_global_free(b->psy_g_look);
+ if(b->bitrate_queue)_ogg_free(b->bitrate_queue);
+ if(b->bitrate_queue_eighths)_ogg_free(b->bitrate_queue_eighths);
+ if(b->bitrate_avgbitacc)_ogg_free(b->bitrate_avgbitacc);
+
+ }
+
+ if(v->pcm){
+ for(i=0;i<vi->channels;i++)
+ if(v->pcm[i])_ogg_free(v->pcm[i]);
+ _ogg_free(v->pcm);
+ if(v->pcmret)_ogg_free(v->pcmret);
+ }
+
+ /* free mode lookups; these are actually vorbis_look_mapping structs */
+ if(ci){
+ for(i=0;i<ci->modes;i++){
+ int mapnum=ci->mode_param[i]->mapping;
+ int maptype=ci->map_type[mapnum];
+ if(b && b->mode)_mapping_P[maptype]->free_look(b->mode[i]);
+ }
+ /* free codebooks */
+ for(i=0;i<ci->books;i++)
+ if(b && b->fullbooks)vorbis_book_clear(b->fullbooks+i);
+ }
+
+ if(b){
+ if(b->mode)_ogg_free(b->mode);
+ if(b->fullbooks)_ogg_free(b->fullbooks);
+
+ /* free header, header1, header2 */
+ if(b->header)_ogg_free(b->header);
+ if(b->header1)_ogg_free(b->header1);
+ if(b->header2)_ogg_free(b->header2);
+ _ogg_free(b);
+ }
+
+ memset(v,0,sizeof(*v));
+ }
+}
+
+float **vorbis_analysis_buffer(vorbis_dsp_state *v, int vals){
+ int i;
+ vorbis_info *vi=v->vi;
+ backend_lookup_state *b=v->backend_state;
+
+ /* free header, header1, header2 */
+ if(b->header)_ogg_free(b->header);b->header=NULL;
+ if(b->header1)_ogg_free(b->header1);b->header1=NULL;
+ if(b->header2)_ogg_free(b->header2);b->header2=NULL;
+
+ /* Do we have enough storage space for the requested buffer? If not,
+ expand the PCM (and envelope) storage */
+
+ if(v->pcm_current+vals>=v->pcm_storage){
+ v->pcm_storage=v->pcm_current+vals*2;
+
+ for(i=0;i<vi->channels;i++){
+ v->pcm[i]=_ogg_realloc(v->pcm[i],v->pcm_storage*sizeof(*v->pcm[i]));
+ }
+ }
+
+ for(i=0;i<vi->channels;i++)
+ v->pcmret[i]=v->pcm[i]+v->pcm_current;
+
+ return(v->pcmret);
+}
+
+static void _preextrapolate_helper(vorbis_dsp_state *v){
+ int i;
+ int order=32;
+ float *lpc=alloca(order*sizeof(*lpc));
+ float *work=alloca(v->pcm_current*sizeof(*work));
+ long j;
+ v->preextrapolate=1;
+
+ if(v->pcm_current-v->centerW>order*2){ /* safety */
+ for(i=0;i<v->vi->channels;i++){
+
+ /* need to run the extrapolation in reverse! */
+ for(j=0;j<v->pcm_current;j++)
+ work[j]=v->pcm[i][v->pcm_current-j-1];
+
+ /* prime as above */
+ vorbis_lpc_from_data(work,lpc,v->pcm_current-v->centerW,order);
+
+ /* run the predictor filter */
+ vorbis_lpc_predict(lpc,work+v->pcm_current-v->centerW-order,
+ order,
+ work+v->pcm_current-v->centerW,
+ v->centerW);
+ for(j=0;j<v->pcm_current;j++)
+ v->pcm[i][v->pcm_current-j-1]=work[j];
+ }
+ }
+}
+
+
+/* call with val<=0 to set eof */
+
+int vorbis_analysis_wrote(vorbis_dsp_state *v, int vals){
+ vorbis_info *vi=v->vi;
+ codec_setup_info *ci=vi->codec_setup;
+ /*backend_lookup_state *b=v->backend_state;*/
+
+ if(vals<=0){
+ int order=32;
+ int i;
+ float *lpc=alloca(order*sizeof(*lpc));
+
+ /* if it wasn't done earlier (very short sample) */
+ if(!v->preextrapolate)
+ _preextrapolate_helper(v);
+
+ /* We're encoding the end of the stream. Just make sure we have
+ [at least] a full block of zeroes at the end. */
+ /* actually, we don't want zeroes; that could drop a large
+ amplitude off a cliff, creating spread spectrum noise that will
+ suck to encode. Extrapolate for the sake of cleanliness. */
+
+ vorbis_analysis_buffer(v,ci->blocksizes[1]*2);
+ v->eofflag=v->pcm_current;
+ v->pcm_current+=ci->blocksizes[1]*2;
+
+ for(i=0;i<vi->channels;i++){
+ if(v->eofflag>order*2){
+ /* extrapolate with LPC to fill in */
+ long n;
+
+ /* make a predictor filter */
+ n=v->eofflag;
+ if(n>ci->blocksizes[1])n=ci->blocksizes[1];
+ vorbis_lpc_from_data(v->pcm[i]+v->eofflag-n,lpc,n,order);
+
+ /* run the predictor filter */
+ vorbis_lpc_predict(lpc,v->pcm[i]+v->eofflag-order,order,
+ v->pcm[i]+v->eofflag,v->pcm_current-v->eofflag);
+ }else{
+ /* not enough data to extrapolate (unlikely to happen due to
+ guarding the overlap, but bulletproof in case that
+ assumtion goes away). zeroes will do. */
+ memset(v->pcm[i]+v->eofflag,0,
+ (v->pcm_current-v->eofflag)*sizeof(*v->pcm[i]));
+
+ }
+ }
+ }else{
+
+ if(v->pcm_current+vals>v->pcm_storage)
+ return(OV_EINVAL);
+
+ v->pcm_current+=vals;
+
+ /* we may want to reverse extrapolate the beginning of a stream
+ too... in case we're beginning on a cliff! */
+ /* clumsy, but simple. It only runs once, so simple is good. */
+ if(!v->preextrapolate && v->pcm_current-v->centerW>ci->blocksizes[1])
+ _preextrapolate_helper(v);
+
+ }
+ return(0);
+}
+
+/* do the deltas, envelope shaping, pre-echo and determine the size of
+ the next block on which to continue analysis */
+int vorbis_analysis_blockout(vorbis_dsp_state *v,vorbis_block *vb){
+ int i;
+ vorbis_info *vi=v->vi;
+ codec_setup_info *ci=vi->codec_setup;
+ backend_lookup_state *b=v->backend_state;
+ vorbis_look_psy_global *g=b->psy_g_look;
+ vorbis_info_psy_global *gi=ci->psy_g_param;
+ long beginW=v->centerW-ci->blocksizes[v->W]/2,centerNext;
+
+ /* check to see if we're started... */
+ if(!v->preextrapolate)return(0);
+
+ /* check to see if we're done... */
+ if(v->eofflag==-1)return(0);
+
+ /* By our invariant, we have lW, W and centerW set. Search for
+ the next boundary so we can determine nW (the next window size)
+ which lets us compute the shape of the current block's window */
+
+ if(ci->blocksizes[0]<ci->blocksizes[1]){
+ long largebound;
+ long bp;
+
+ if(v->W)
+ /* min boundary; nW large, next small */
+ largebound=v->centerW+ci->blocksizes[1]*3/4+ci->blocksizes[0]/4;
+ else
+ /* min boundary; nW large, next small */
+ largebound=v->centerW+ci->blocksizes[1]/2+ci->blocksizes[0]/2;
+
+ bp=_ve_envelope_search(v,largebound);
+ if(bp==-1)return(0); /* not enough data currently to search for a
+ full long block */
+ v->nW=bp;
+
+ }else
+ v->nW=0;
+
+ centerNext=v->centerW+ci->blocksizes[v->W]/4+ci->blocksizes[v->nW]/4;
+
+ {
+ /* center of next block + next block maximum right side. */
+
+ long blockbound=centerNext+ci->blocksizes[v->nW]/2;
+ if(v->pcm_current<blockbound)return(0); /* not enough data yet;
+ although this check is
+ less strict that the
+ _ve_envelope_search,
+ the search is not run
+ if we only use one
+ block size */
+ }
+
+ /* fill in the block. Note that for a short window, lW and nW are *short*
+ regardless of actual settings in the stream */
+
+ _vorbis_block_ripcord(vb);
+ if(v->W){
+ vb->lW=v->lW;
+ vb->W=v->W;
+ vb->nW=v->nW;
+ }else{
+ vb->lW=0;
+ vb->W=v->W;
+ vb->nW=0;
+ }
+ vb->vd=v;
+ vb->sequence=v->sequence;
+ vb->granulepos=v->granulepos;
+ vb->pcmend=ci->blocksizes[v->W];
+
+
+ /* copy the vectors; this uses the local storage in vb */
+ {
+ vorbis_block_internal *vbi=(vorbis_block_internal *)vb->internal;
+
+ /* this tracks 'strongest peak' for later psychoacoustics */
+ /* moved to the global psy state; clean this mess up */
+ if(vbi->ampmax>g->ampmax)g->ampmax=vbi->ampmax;
+ g->ampmax=_vp_ampmax_decay(g->ampmax,v);
+ vbi->ampmax=g->ampmax;
+
+ vb->pcm=_vorbis_block_alloc(vb,sizeof(*vb->pcm)*vi->channels);
+ vbi->pcmdelay=_vorbis_block_alloc(vb,sizeof(*vbi->pcmdelay)*vi->channels);
+ for(i=0;i<vi->channels;i++){
+ vbi->pcmdelay[i]=
+ _vorbis_block_alloc(vb,(vb->pcmend+beginW)*sizeof(*vbi->pcmdelay[i]));
+ memcpy(vbi->pcmdelay[i],v->pcm[i],(vb->pcmend+beginW)*sizeof(*vbi->pcmdelay[i]));
+ vb->pcm[i]=vbi->pcmdelay[i]+beginW;
+
+ /* before we added the delay
+ vb->pcm[i]=_vorbis_block_alloc(vb,vb->pcmend*sizeof(*vb->pcm[i]));
+ memcpy(vb->pcm[i],v->pcm[i]+beginW,ci->blocksizes[v->W]*sizeof(*vb->pcm[i]));
+ */
+
+ }
+ }
+
+ /* handle eof detection: eof==0 means that we've not yet received EOF
+ eof>0 marks the last 'real' sample in pcm[]
+ eof<0 'no more to do'; doesn't get here */
+
+ if(v->eofflag){
+ if(v->centerW>=v->eofflag){
+ v->eofflag=-1;
+ vb->eofflag=1;
+ return(1);
+ }
+ }
+
+ /* advance storage vectors and clean up */
+ {
+ int new_centerNext=ci->blocksizes[1]/2+gi->delaycache;
+ int movementW=centerNext-new_centerNext;
+
+ if(movementW>0){
+
+ _ve_envelope_shift(b->ve,movementW);
+ v->pcm_current-=movementW;
+
+ for(i=0;i<vi->channels;i++)
+ memmove(v->pcm[i],v->pcm[i]+movementW,
+ v->pcm_current*sizeof(*v->pcm[i]));
+
+
+ v->lW=v->W;
+ v->W=v->nW;
+ v->centerW=new_centerNext;
+
+ v->sequence++;
+
+ if(v->eofflag){
+ v->eofflag-=movementW;
+ /* do not add padding to end of stream! */
+ if(v->centerW>=v->eofflag){
+ v->granulepos+=movementW-(v->centerW-v->eofflag);
+ }else{
+ v->granulepos+=movementW;
+ }
+ }else{
+ v->granulepos+=movementW;
+ }
+ }
+ }
+
+ /* done */
+ return(1);
+}
+
+int vorbis_synthesis_init(vorbis_dsp_state *v,vorbis_info *vi){
+ _vds_shared_init(v,vi,0);
+
+ v->pcm_returned=-1;
+ v->granulepos=-1;
+ v->sequence=-1;
+
+ return(0);
+}
+
+/* Unlike in analysis, the window is only partially applied for each
+ block. The time domain envelope is not yet handled at the point of
+ calling (as it relies on the previous block). */
+
+int vorbis_synthesis_blockin(vorbis_dsp_state *v,vorbis_block *vb){
+ vorbis_info *vi=v->vi;
+ codec_setup_info *ci=vi->codec_setup;
+
+ /* Shift out any PCM that we returned previously */
+ /* centerW is currently the center of the last block added */
+
+ if(v->centerW>ci->blocksizes[1]/2 &&
+ /* Quick additional hack; to avoid *alot* of shifts, use an
+ oversized buffer. This increases memory usage, but doesn't make
+ much difference wrt L1/L2 cache pressure. */
+ v->pcm_returned>8192){
+
+ /* don't shift too much; we need to have a minimum PCM buffer of
+ 1/2 long block */
+
+ int shiftPCM=v->centerW-ci->blocksizes[1]/2;
+ shiftPCM=(v->pcm_returned<shiftPCM?v->pcm_returned:shiftPCM);
+
+ v->pcm_current-=shiftPCM;
+ v->centerW-=shiftPCM;
+ v->pcm_returned-=shiftPCM;
+
+ if(shiftPCM){
+ int i;
+ for(i=0;i<vi->channels;i++)
+ memmove(v->pcm[i],v->pcm[i]+shiftPCM,
+ v->pcm_current*sizeof(*v->pcm[i]));
+ }
+ }
+
+ v->lW=v->W;
+ v->W=vb->W;
+ v->nW=-1;
+
+ v->glue_bits+=vb->glue_bits;
+ v->time_bits+=vb->time_bits;
+ v->floor_bits+=vb->floor_bits;
+ v->res_bits+=vb->res_bits;
+
+ if(v->sequence+1 != vb->sequence)v->granulepos=-1; /* out of sequence;
+ lose count */
+
+ v->sequence=vb->sequence;
+
+ {
+ int sizeW=ci->blocksizes[v->W];
+ int centerW=v->centerW+ci->blocksizes[v->lW]/4+sizeW/4;
+ int beginW=centerW-sizeW/2;
+ int endW=beginW+sizeW;
+ int beginSl;
+ int endSl;
+ int i,j;
+
+ /* Do we have enough PCM/mult storage for the block? */
+ if(endW>v->pcm_storage){
+ /* expand the storage */
+ v->pcm_storage=endW+ci->blocksizes[1];
+
+ for(i=0;i<vi->channels;i++)
+ v->pcm[i]=_ogg_realloc(v->pcm[i],v->pcm_storage*sizeof(*v->pcm[i]));
+ }
+
+ /* overlap/add PCM */
+
+ switch(v->W){
+ case 0:
+ beginSl=0;
+ endSl=ci->blocksizes[0]/2;
+ break;
+ case 1:
+ beginSl=ci->blocksizes[1]/4-ci->blocksizes[v->lW]/4;
+ endSl=beginSl+ci->blocksizes[v->lW]/2;
+ break;
+ default:
+ return(-1);
+ }
+
+ for(j=0;j<vi->channels;j++){
+ static int seq=0;
+ float *pcm=v->pcm[j]+beginW;
+ float *p=vb->pcm[j];
+
+ /* the overlap/add section */
+ for(i=beginSl;i<endSl;i++)
+ pcm[i]+=p[i];
+ /* the remaining section */
+ for(;i<sizeW;i++)
+ pcm[i]=p[i];
+
+ _analysis_output("lapped",seq,pcm,sizeW,0,0);
+ _analysis_output("buffered",seq++,v->pcm[j],sizeW+beginW,0,0);
+
+ }
+
+ /* deal with initial packet state; we do this using the explicit
+ pcm_returned==-1 flag otherwise we're sensitive to first block
+ being short or long */
+
+ if(v->pcm_returned==-1)
+ v->pcm_returned=centerW;
+
+ /* track the frame number... This is for convenience, but also
+ making sure our last packet doesn't end with added padding. If
+ the last packet is partial, the number of samples we'll have to
+ return will be past the vb->granulepos.
+
+ This is not foolproof! It will be confused if we begin
+ decoding at the last page after a seek or hole. In that case,
+ we don't have a starting point to judge where the last frame
+ is. For this reason, vorbisfile will always try to make sure
+ it reads the last two marked pages in proper sequence */
+
+ if(v->granulepos==-1)
+ if(vb->granulepos==-1){
+ v->granulepos=0;
+ }else{
+ v->granulepos=vb->granulepos;
+ }
+ else{
+ v->granulepos+=(centerW-v->centerW);
+ if(vb->granulepos!=-1 && v->granulepos!=vb->granulepos){
+
+ if(v->granulepos>vb->granulepos){
+ long extra=v->granulepos-vb->granulepos;
+
+ if(vb->eofflag){
+ /* partial last frame. Strip the extra samples off */
+ centerW-=extra;
+ }else if(vb->sequence == 1){
+ /* ^^^ argh, this can be 1 from seeking! */
+
+
+ /* partial first frame. Discard extra leading samples */
+ v->pcm_returned+=extra;
+ if(v->pcm_returned>centerW)v->pcm_returned=centerW;
+
+ }
+
+ }/* else{ Shouldn't happen *unless* the bitstream is out of
+ spec. Either way, believe the bitstream } */
+ v->granulepos=vb->granulepos;
+ }
+ }
+
+ /* Update, cleanup */
+
+ v->centerW=centerW;
+ v->pcm_current=endW;
+
+ if(vb->eofflag)v->eofflag=1;
+ }
+
+ return(0);
+}
+
+/* pcm==NULL indicates we just want the pending samples, no more */
+int vorbis_synthesis_pcmout(vorbis_dsp_state *v,float ***pcm){
+ vorbis_info *vi=v->vi;
+ if(v->pcm_returned>-1 && v->pcm_returned<v->centerW){
+ if(pcm){
+ int i;
+ for(i=0;i<vi->channels;i++)
+ v->pcmret[i]=v->pcm[i]+v->pcm_returned;
+ *pcm=v->pcmret;
+ }
+ return(v->centerW-v->pcm_returned);
+ }
+ return(0);
+}
+
+int vorbis_synthesis_read(vorbis_dsp_state *v,int bytes){
+ if(bytes && v->pcm_returned+bytes>v->centerW)return(OV_EINVAL);
+ v->pcm_returned+=bytes;
+ return(0);
+}
+
diff --git a/lib/books/line_1024x31_0sub0.vqh b/lib/books/line_1024x31_0sub0.vqh
new file mode 100644
index 00000000..fd817ecb
--- /dev/null
+++ b/lib/books/line_1024x31_0sub0.vqh
@@ -0,0 +1,37 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE Ogg Vorbis SOFTWARE CODEC SOURCE CODE. *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
+ * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. *
+ * PLEASE READ THESE TERMS DISTRIBUTING. *
+ * *
+ * THE OggSQUISH SOURCE CODE IS (C) COPYRIGHT 1994-1999 *
+ * by 1999 Monty <monty@xiph.org> and The XIPHOPHORUS Company *
+ * http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: static codebook autogenerated by huff/huffbuld
+
+ ********************************************************************/
+
+#ifndef _V_line_1024x31_0sub0_VQH_
+#define _V_line_1024x31_0sub0_VQH_
+#include "codebook.h"
+
+static long _huff_lengthlist_line_1024x31_0sub0[] = {
+ 4, 3, 4, 4, 4, 3, 4, 3, 5, 4, 5, 4, 6, 4, 6, 5,
+};
+
+static static_codebook _huff_book_line_1024x31_0sub0 = {
+ 1, 16,
+ _huff_lengthlist_line_1024x31_0sub0,
+ 0, 0, 0, 0, 0,
+ NULL,
+ NULL,
+ NULL,
+ 0
+};
+
+
+#endif
diff --git a/lib/books/line_1024x31_0sub1.vqh b/lib/books/line_1024x31_0sub1.vqh
new file mode 100644
index 00000000..1d05c0bc
--- /dev/null
+++ b/lib/books/line_1024x31_0sub1.vqh
@@ -0,0 +1,40 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE Ogg Vorbis SOFTWARE CODEC SOURCE CODE. *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
+ * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. *
+ * PLEASE READ THESE TERMS DISTRIBUTING. *
+ * *
+ * THE OggSQUISH SOURCE CODE IS (C) COPYRIGHT 1994-1999 *
+ * by 1999 Monty <monty@xiph.org> and The XIPHOPHORUS Company *
+ * http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: static codebook autogenerated by huff/huffbuld
+
+ ********************************************************************/
+
+#ifndef _V_line_1024x31_0sub1_VQH_
+#define _V_line_1024x31_0sub1_VQH_
+#include "codebook.h"
+
+static long _huff_lengthlist_line_1024x31_0sub1[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 4, 3, 4, 3, 5, 3, 5, 3, 6, 4, 7, 4, 7, 4, 7, 5,
+ 7, 6, 8, 6,10, 9,10,10,11,12,10,12,12,12,12,12,
+ 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
+};
+
+static static_codebook _huff_book_line_1024x31_0sub1 = {
+ 1, 64,
+ _huff_lengthlist_line_1024x31_0sub1,
+ 0, 0, 0, 0, 0,
+ NULL,
+ NULL,
+ NULL,
+ 0
+};
+
+
+#endif
diff --git a/lib/books/line_1024x31_1sub0.vqh b/lib/books/line_1024x31_1sub0.vqh
new file mode 100644
index 00000000..5e25a379
--- /dev/null
+++ b/lib/books/line_1024x31_1sub0.vqh
@@ -0,0 +1,37 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE Ogg Vorbis SOFTWARE CODEC SOURCE CODE. *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
+ * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. *
+ * PLEASE READ THESE TERMS DISTRIBUTING. *
+ * *
+ * THE OggSQUISH SOURCE CODE IS (C) COPYRIGHT 1994-1999 *
+ * by 1999 Monty <monty@xiph.org> and The XIPHOPHORUS Company *
+ * http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: static codebook autogenerated by huff/huffbuld
+
+ ********************************************************************/
+
+#ifndef _V_line_1024x31_1sub0_VQH_
+#define _V_line_1024x31_1sub0_VQH_
+#include "codebook.h"
+
+static long _huff_lengthlist_line_1024x31_1sub0[] = {
+ 2, 3, 4, 4, 3, 4, 4, 4, 4, 5, 5, 6, 6, 6, 7, 7,
+};
+
+static static_codebook _huff_book_line_1024x31_1sub0 = {
+ 1, 16,
+ _huff_lengthlist_line_1024x31_1sub0,
+ 0, 0, 0, 0, 0,
+ NULL,
+ NULL,
+ NULL,
+ 0
+};
+
+
+#endif
diff --git a/lib/books/line_1024x31_1sub1.vqh b/lib/books/line_1024x31_1sub1.vqh
new file mode 100644
index 00000000..68fd0be9
--- /dev/null
+++ b/lib/books/line_1024x31_1sub1.vqh
@@ -0,0 +1,40 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE Ogg Vorbis SOFTWARE CODEC SOURCE CODE. *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
+ * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. *
+ * PLEASE READ THESE TERMS DISTRIBUTING. *
+ * *
+ * THE OggSQUISH SOURCE CODE IS (C) COPYRIGHT 1994-1999 *
+ * by 1999 Monty <monty@xiph.org> and The XIPHOPHORUS Company *
+ * http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: static codebook autogenerated by huff/huffbuld
+
+ ********************************************************************/
+
+#ifndef _V_line_1024x31_1sub1_VQH_
+#define _V_line_1024x31_1sub1_VQH_
+#include "codebook.h"
+
+static long _huff_lengthlist_line_1024x31_1sub1[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 3, 3, 3, 4, 3, 3, 3, 4, 5, 5, 6, 6, 7,10,10,10,
+ 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
+ 11,11,11,11,11,11,10,10,10,10,10,10,10,10,10,10,
+};
+
+static static_codebook _huff_book_line_1024x31_1sub1 = {
+ 1, 64,
+ _huff_lengthlist_line_1024x31_1sub1,
+ 0, 0, 0, 0, 0,
+ NULL,
+ NULL,
+ NULL,
+ 0
+};
+
+
+#endif
diff --git a/lib/books/line_1024x31_2sub1.vqh b/lib/books/line_1024x31_2sub1.vqh
new file mode 100644
index 00000000..c36ad6a7
--- /dev/null
+++ b/lib/books/line_1024x31_2sub1.vqh
@@ -0,0 +1,37 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE Ogg Vorbis SOFTWARE CODEC SOURCE CODE. *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
+ * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. *
+ * PLEASE READ THESE TERMS DISTRIBUTING. *
+ * *
+ * THE OggSQUISH SOURCE CODE IS (C) COPYRIGHT 1994-1999 *
+ * by 1999 Monty <monty@xiph.org> and The XIPHOPHORUS Company *
+ * http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: static codebook autogenerated by huff/huffbuld
+
+ ********************************************************************/
+
+#ifndef _V_line_1024x31_2sub1_VQH_
+#define _V_line_1024x31_2sub1_VQH_
+#include "codebook.h"
+
+static long _huff_lengthlist_line_1024x31_2sub1[] = {
+ 0, 2, 4, 2, 4, 3, 4, 3, 4,
+};
+
+static static_codebook _huff_book_line_1024x31_2sub1 = {
+ 1, 9,
+ _huff_lengthlist_line_1024x31_2sub1,
+ 0, 0, 0, 0, 0,
+ NULL,
+ NULL,
+ NULL,
+ 0
+};
+
+
+#endif
diff --git a/lib/books/line_1024x31_2sub2.vqh b/lib/books/line_1024x31_2sub2.vqh
new file mode 100644
index 00000000..7396483a
--- /dev/null
+++ b/lib/books/line_1024x31_2sub2.vqh
@@ -0,0 +1,38 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE Ogg Vorbis SOFTWARE CODEC SOURCE CODE. *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
+ * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. *
+ * PLEASE READ THESE TERMS DISTRIBUTING. *
+ * *
+ * THE OggSQUISH SOURCE CODE IS (C) COPYRIGHT 1994-1999 *
+ * by 1999 Monty <monty@xiph.org> and The XIPHOPHORUS Company *
+ * http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: static codebook autogenerated by huff/huffbuld
+
+ ********************************************************************/
+
+#ifndef _V_line_1024x31_2sub2_VQH_
+#define _V_line_1024x31_2sub2_VQH_
+#include "codebook.h"
+
+static long _huff_lengthlist_line_1024x31_2sub2[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 4, 4, 6, 5, 7,
+ 4, 8, 3, 9, 3,10, 4,10, 4,
+};
+
+static static_codebook _huff_book_line_1024x31_2sub2 = {
+ 1, 25,
+ _huff_lengthlist_line_1024x31_2sub2,
+ 0, 0, 0, 0, 0,
+ NULL,
+ NULL,
+ NULL,
+ 0
+};
+
+
+#endif
diff --git a/lib/books/line_1024x31_2sub3.vqh b/lib/books/line_1024x31_2sub3.vqh
new file mode 100644
index 00000000..90f0bbcf
--- /dev/null
+++ b/lib/books/line_1024x31_2sub3.vqh
@@ -0,0 +1,40 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE Ogg Vorbis SOFTWARE CODEC SOURCE CODE. *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
+ * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. *
+ * PLEASE READ THESE TERMS DISTRIBUTING. *
+ * *
+ * THE OggSQUISH SOURCE CODE IS (C) COPYRIGHT 1994-1999 *
+ * by 1999 Monty <monty@xiph.org> and The XIPHOPHORUS Company *
+ * http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: static codebook autogenerated by huff/huffbuld
+
+ ********************************************************************/
+
+#ifndef _V_line_1024x31_2sub3_VQH_
+#define _V_line_1024x31_2sub3_VQH_
+#include "codebook.h"
+
+static long _huff_lengthlist_line_1024x31_2sub3[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 2, 7, 3, 7, 2, 7,
+ 4, 7, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6,
+};
+
+static static_codebook _huff_book_line_1024x31_2sub3 = {
+ 1, 64,
+ _huff_lengthlist_line_1024x31_2sub3,
+ 0, 0, 0, 0, 0,
+ NULL,
+ NULL,
+ NULL,
+ 0
+};
+
+
+#endif
diff --git a/lib/books/line_1024x31_3sub1.vqh b/lib/books/line_1024x31_3sub1.vqh
new file mode 100644
index 00000000..304002a4
--- /dev/null
+++ b/lib/books/line_1024x31_3sub1.vqh
@@ -0,0 +1,37 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE Ogg Vorbis SOFTWARE CODEC SOURCE CODE. *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
+ * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. *
+ * PLEASE READ THESE TERMS DISTRIBUTING. *
+ * *
+ * THE OggSQUISH SOURCE CODE IS (C) COPYRIGHT 1994-1999 *
+ * by 1999 Monty <monty@xiph.org> and The XIPHOPHORUS Company *
+ * http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: static codebook autogenerated by huff/huffbuld
+
+ ********************************************************************/
+
+#ifndef _V_line_1024x31_3sub1_VQH_
+#define _V_line_1024x31_3sub1_VQH_
+#include "codebook.h"
+
+static long _huff_lengthlist_line_1024x31_3sub1[] = {
+ 0, 3, 3, 2, 3, 3, 4, 3, 4,
+};
+
+static static_codebook _huff_book_line_1024x31_3sub1 = {
+ 1, 9,
+ _huff_lengthlist_line_1024x31_3sub1,
+ 0, 0, 0, 0, 0,
+ NULL,
+ NULL,
+ NULL,
+ 0
+};
+
+
+#endif
diff --git a/lib/books/line_1024x31_3sub2.vqh b/lib/books/line_1024x31_3sub2.vqh
new file mode 100644
index 00000000..cc17fea7
--- /dev/null
+++ b/lib/books/line_1024x31_3sub2.vqh
@@ -0,0 +1,38 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE Ogg Vorbis SOFTWARE CODEC SOURCE CODE. *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
+ * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. *
+ * PLEASE READ THESE TERMS DISTRIBUTING. *
+ * *
+ * THE OggSQUISH SOURCE CODE IS (C) COPYRIGHT 1994-1999 *
+ * by 1999 Monty <monty@xiph.org> and The XIPHOPHORUS Company *
+ * http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: static codebook autogenerated by huff/huffbuld
+
+ ********************************************************************/
+
+#ifndef _V_line_1024x31_3sub2_VQH_
+#define _V_line_1024x31_3sub2_VQH_
+#include "codebook.h"
+
+static long _huff_lengthlist_line_1024x31_3sub2[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 2, 4, 3, 6, 4,
+ 7, 5, 9, 5, 9, 6, 9, 6, 9,
+};
+
+static static_codebook _huff_book_line_1024x31_3sub2 = {
+ 1, 25,
+ _huff_lengthlist_line_1024x31_3sub2,
+ 0, 0, 0, 0, 0,
+ NULL,
+ NULL,
+ NULL,
+ 0
+};
+
+
+#endif
diff --git a/lib/books/line_1024x31_3sub3.vqh b/lib/books/line_1024x31_3sub3.vqh
new file mode 100644
index 00000000..487bca22
--- /dev/null
+++ b/lib/books/line_1024x31_3sub3.vqh
@@ -0,0 +1,40 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE Ogg Vorbis SOFTWARE CODEC SOURCE CODE. *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
+ * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. *
+ * PLEASE READ THESE TERMS DISTRIBUTING. *
+ * *
+ * THE OggSQUISH SOURCE CODE IS (C) COPYRIGHT 1994-1999 *
+ * by 1999 Monty <monty@xiph.org> and The XIPHOPHORUS Company *
+ * http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: static codebook autogenerated by huff/huffbuld
+
+ ********************************************************************/
+
+#ifndef _V_line_1024x31_3sub3_VQH_
+#define _V_line_1024x31_3sub3_VQH_
+#include "codebook.h"
+
+static long _huff_lengthlist_line_1024x31_3sub3[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 7, 3, 7, 4, 7, 6,
+ 5, 6, 7, 7, 7, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+};
+
+static static_codebook _huff_book_line_1024x31_3sub3 = {
+ 1, 64,
+ _huff_lengthlist_line_1024x31_3sub3,
+ 0, 0, 0, 0, 0,
+ NULL,
+ NULL,
+ NULL,
+ 0
+};
+
+
+#endif
diff --git a/lib/books/line_1024x31_class0.vqh b/lib/books/line_1024x31_class0.vqh
new file mode 100644
index 00000000..ffc5488c
--- /dev/null
+++ b/lib/books/line_1024x31_class0.vqh
@@ -0,0 +1,37 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE Ogg Vorbis SOFTWARE CODEC SOURCE CODE. *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
+ * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. *
+ * PLEASE READ THESE TERMS DISTRIBUTING. *
+ * *
+ * THE OggSQUISH SOURCE CODE IS (C) COPYRIGHT 1994-1999 *
+ * by 1999 Monty <monty@xiph.org> and The XIPHOPHORUS Company *
+ * http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: static codebook autogenerated by huff/huffbuld
+
+ ********************************************************************/
+
+#ifndef _V_line_1024x31_class0_VQH_
+#define _V_line_1024x31_class0_VQH_
+#include "codebook.h"
+
+static long _huff_lengthlist_line_1024x31_class0[] = {
+ 1, 2, 4, 6, 3, 5, 7, 7,
+};
+
+static static_codebook _huff_book_line_1024x31_class0 = {
+ 1, 8,
+ _huff_lengthlist_line_1024x31_class0,
+ 0, 0, 0, 0, 0,
+ NULL,
+ NULL,
+ NULL,
+ 0
+};
+
+
+#endif
diff --git a/lib/books/line_1024x31_class1.vqh b/lib/books/line_1024x31_class1.vqh
new file mode 100644
index 00000000..e4d83449
--- /dev/null
+++ b/lib/books/line_1024x31_class1.vqh
@@ -0,0 +1,37 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE Ogg Vorbis SOFTWARE CODEC SOURCE CODE. *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
+ * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. *
+ * PLEASE READ THESE TERMS DISTRIBUTING. *
+ * *
+ * THE OggSQUISH SOURCE CODE IS (C) COPYRIGHT 1994-1999 *
+ * by 1999 Monty <monty@xiph.org> and The XIPHOPHORUS Company *
+ * http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: static codebook autogenerated by huff/huffbuld
+
+ ********************************************************************/
+
+#ifndef _V_line_1024x31_class1_VQH_
+#define _V_line_1024x31_class1_VQH_
+#include "codebook.h"
+
+static long _huff_lengthlist_line_1024x31_class1[] = {
+ 1, 5, 2, 4, 7,11,10,12, 3, 8, 6,10,11,12,12,12,
+};
+
+static static_codebook _huff_book_line_1024x31_class1 = {
+ 1, 16,
+ _huff_lengthlist_line_1024x31_class1,
+ 0, 0, 0, 0, 0,
+ NULL,
+ NULL,
+ NULL,
+ 0
+};
+
+
+#endif
diff --git a/lib/books/line_1024x31_class2.vqh b/lib/books/line_1024x31_class2.vqh
new file mode 100644
index 00000000..74527b7e
--- /dev/null
+++ b/lib/books/line_1024x31_class2.vqh
@@ -0,0 +1,40 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE Ogg Vorbis SOFTWARE CODEC SOURCE CODE. *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
+ * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. *
+ * PLEASE READ THESE TERMS DISTRIBUTING. *
+ * *
+ * THE OggSQUISH SOURCE CODE IS (C) COPYRIGHT 1994-1999 *
+ * by 1999 Monty <monty@xiph.org> and The XIPHOPHORUS Company *
+ * http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: static codebook autogenerated by huff/huffbuld
+
+ ********************************************************************/
+
+#ifndef _V_line_1024x31_class2_VQH_
+#define _V_line_1024x31_class2_VQH_
+#include "codebook.h"
+
+static long _huff_lengthlist_line_1024x31_class2[] = {
+ 1, 3, 4,10, 7, 5, 6,10, 9, 6,11,15,15,15,15,15,
+ 6, 3, 5,11, 7, 5, 7,11,11, 8,12,15,15,15,15,15,
+ 10, 8, 8,13,11, 9,10,14,15,15,15,15,15,15,15,15,
+ 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
+};
+
+static static_codebook _huff_book_line_1024x31_class2 = {
+ 1, 64,
+ _huff_lengthlist_line_1024x31_class2,
+ 0, 0, 0, 0, 0,
+ NULL,
+ NULL,
+ NULL,
+ 0
+};
+
+
+#endif
diff --git a/lib/books/line_1024x31_class3.vqh b/lib/books/line_1024x31_class3.vqh
new file mode 100644
index 00000000..ab1be065
--- /dev/null
+++ b/lib/books/line_1024x31_class3.vqh
@@ -0,0 +1,40 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE Ogg Vorbis SOFTWARE CODEC SOURCE CODE. *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
+ * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. *
+ * PLEASE READ THESE TERMS DISTRIBUTING. *
+ * *
+ * THE OggSQUISH SOURCE CODE IS (C) COPYRIGHT 1994-1999 *
+ * by 1999 Monty <monty@xiph.org> and The XIPHOPHORUS Company *
+ * http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: static codebook autogenerated by huff/huffbuld
+
+ ********************************************************************/
+
+#ifndef _V_line_1024x31_class3_VQH_
+#define _V_line_1024x31_class3_VQH_
+#include "codebook.h"
+
+static long _huff_lengthlist_line_1024x31_class3[] = {
+ 1, 3, 5,11, 7, 3, 5,11, 9, 7, 9,15,15,15,15,14,
+ 7, 4, 6,11, 7, 5, 6,12,10, 8, 9,14,14,14,14,14,
+ 11, 8, 9,12,11, 8, 8,11,13,10,11,14,14,14,14,14,
+ 14,14,14,13,14,14,14,14,14,14,14,14,14,14,14,14,
+};
+
+static static_codebook _huff_book_line_1024x31_class3 = {
+ 1, 64,
+ _huff_lengthlist_line_1024x31_class3,
+ 0, 0, 0, 0, 0,
+ NULL,
+ NULL,
+ NULL,
+ 0
+};
+
+
+#endif
diff --git a/lib/books/line_128x7_0sub0.vqh b/lib/books/line_128x7_0sub0.vqh
new file mode 100644
index 00000000..9c5f98b5
--- /dev/null
+++ b/lib/books/line_128x7_0sub0.vqh
@@ -0,0 +1,40 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE Ogg Vorbis SOFTWARE CODEC SOURCE CODE. *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
+ * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. *
+ * PLEASE READ THESE TERMS DISTRIBUTING. *
+ * *
+ * THE OggSQUISH SOURCE CODE IS (C) COPYRIGHT 1994-1999 *
+ * by 1999 Monty <monty@xiph.org> and The XIPHOPHORUS Company *
+ * http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: static codebook autogenerated by huff/huffbuld
+
+ ********************************************************************/
+
+#ifndef _V_line_128x7_0sub0_VQH_
+#define _V_line_128x7_0sub0_VQH_
+#include "codebook.h"
+
+static long _huff_lengthlist_line_128x7_0sub0[] = {
+ 5, 5, 5, 6, 4, 6, 4, 7, 4, 7, 4, 8, 4, 9, 4,11,
+ 4,12, 4,13, 5,13, 5,13, 5,13, 5,13, 5,13, 5,13,
+ 5,13, 6,13, 6,13, 6,13, 5,13, 6,13, 6,12, 7,12,
+ 7,12, 9,11, 9,11,11,12,12,13,13,13,13,13,13,13,
+};
+
+static static_codebook _huff_book_line_128x7_0sub0 = {
+ 1, 64,
+ _huff_lengthlist_line_128x7_0sub0,
+ 0, 0, 0, 0, 0,
+ NULL,
+ NULL,
+ NULL,
+ 0
+};
+
+
+#endif
diff --git a/lib/books/line_128x7_1sub1.vqh b/lib/books/line_128x7_1sub1.vqh
new file mode 100644
index 00000000..fc63d2fe
--- /dev/null
+++ b/lib/books/line_128x7_1sub1.vqh
@@ -0,0 +1,37 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE Ogg Vorbis SOFTWARE CODEC SOURCE CODE. *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
+ * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. *
+ * PLEASE READ THESE TERMS DISTRIBUTING. *
+ * *
+ * THE OggSQUISH SOURCE CODE IS (C) COPYRIGHT 1994-1999 *
+ * by 1999 Monty <monty@xiph.org> and The XIPHOPHORUS Company *
+ * http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: static codebook autogenerated by huff/huffbuld
+
+ ********************************************************************/
+
+#ifndef _V_line_128x7_1sub1_VQH_
+#define _V_line_128x7_1sub1_VQH_
+#include "codebook.h"
+
+static long _huff_lengthlist_line_128x7_1sub1[] = {
+ 0, 4, 2, 5, 2, 5, 3, 3, 3,
+};
+
+static static_codebook _huff_book_line_128x7_1sub1 = {
+ 1, 9,
+ _huff_lengthlist_line_128x7_1sub1,
+ 0, 0, 0, 0, 0,
+ NULL,
+ NULL,
+ NULL,
+ 0
+};
+
+
+#endif
diff --git a/lib/books/line_128x7_1sub2.vqh b/lib/books/line_128x7_1sub2.vqh
new file mode 100644
index 00000000..e3d56c4a
--- /dev/null
+++ b/lib/books/line_128x7_1sub2.vqh
@@ -0,0 +1,38 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE Ogg Vorbis SOFTWARE CODEC SOURCE CODE. *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
+ * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. *
+ * PLEASE READ THESE TERMS DISTRIBUTING. *
+ * *
+ * THE OggSQUISH SOURCE CODE IS (C) COPYRIGHT 1994-1999 *
+ * by 1999 Monty <monty@xiph.org> and The XIPHOPHORUS Company *
+ * http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: static codebook autogenerated by huff/huffbuld
+
+ ********************************************************************/
+
+#ifndef _V_line_128x7_1sub2_VQH_
+#define _V_line_128x7_1sub2_VQH_
+#include "codebook.h"
+
+static long _huff_lengthlist_line_128x7_1sub2[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 6, 2, 9, 3,11,
+ 5,12, 7,12, 9,12, 9,12,11,
+};
+
+static static_codebook _huff_book_line_128x7_1sub2 = {
+ 1, 25,
+ _huff_lengthlist_line_128x7_1sub2,
+ 0, 0, 0, 0, 0,
+ NULL,
+ NULL,
+ NULL,
+ 0
+};
+
+
+#endif
diff --git a/lib/books/line_128x7_1sub3.vqh b/lib/books/line_128x7_1sub3.vqh
new file mode 100644
index 00000000..5c8a9379
--- /dev/null
+++ b/lib/books/line_128x7_1sub3.vqh
@@ -0,0 +1,40 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE Ogg Vorbis SOFTWARE CODEC SOURCE CODE. *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
+ * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. *
+ * PLEASE READ THESE TERMS DISTRIBUTING. *
+ * *
+ * THE OggSQUISH SOURCE CODE IS (C) COPYRIGHT 1994-1999 *
+ * by 1999 Monty <monty@xiph.org> and The XIPHOPHORUS Company *
+ * http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: static codebook autogenerated by huff/huffbuld
+
+ ********************************************************************/
+
+#ifndef _V_line_128x7_1sub3_VQH_
+#define _V_line_128x7_1sub3_VQH_
+#include "codebook.h"
+
+static long _huff_lengthlist_line_128x7_1sub3[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 6, 5, 6, 6, 6,
+ 4, 6, 6, 6, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+};
+
+static static_codebook _huff_book_line_128x7_1sub3 = {
+ 1, 64,
+ _huff_lengthlist_line_128x7_1sub3,
+ 0, 0, 0, 0, 0,
+ NULL,
+ NULL,
+ NULL,
+ 0
+};
+
+
+#endif
diff --git a/lib/books/line_128x7_2sub1.vqh b/lib/books/line_128x7_2sub1.vqh
new file mode 100644
index 00000000..c0395a85
--- /dev/null
+++ b/lib/books/line_128x7_2sub1.vqh
@@ -0,0 +1,37 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE Ogg Vorbis SOFTWARE CODEC SOURCE CODE. *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
+ * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. *
+ * PLEASE READ THESE TERMS DISTRIBUTING. *
+ * *
+ * THE OggSQUISH SOURCE CODE IS (C) COPYRIGHT 1994-1999 *
+ * by 1999 Monty <monty@xiph.org> and The XIPHOPHORUS Company *
+ * http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: static codebook autogenerated by huff/huffbuld
+
+ ********************************************************************/
+
+#ifndef _V_line_128x7_2sub1_VQH_
+#define _V_line_128x7_2sub1_VQH_
+#include "codebook.h"
+
+static long _huff_lengthlist_line_128x7_2sub1[] = {
+ 0, 3, 3, 2, 4, 2, 5, 3, 5,
+};
+
+static static_codebook _huff_book_line_128x7_2sub1 = {
+ 1, 9,
+ _huff_lengthlist_line_128x7_2sub1,
+ 0, 0, 0, 0, 0,
+ NULL,
+ NULL,
+ NULL,
+ 0
+};
+
+
+#endif
diff --git a/lib/books/line_128x7_2sub2.vqh b/lib/books/line_128x7_2sub2.vqh
new file mode 100644
index 00000000..345edb0c
--- /dev/null
+++ b/lib/books/line_128x7_2sub2.vqh
@@ -0,0 +1,38 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE Ogg Vorbis SOFTWARE CODEC SOURCE CODE. *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
+ * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. *
+ * PLEASE READ THESE TERMS DISTRIBUTING. *
+ * *
+ * THE OggSQUISH SOURCE CODE IS (C) COPYRIGHT 1994-1999 *
+ * by 1999 Monty <monty@xiph.org> and The XIPHOPHORUS Company *
+ * http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: static codebook autogenerated by huff/huffbuld
+
+ ********************************************************************/
+
+#ifndef _V_line_128x7_2sub2_VQH_
+#define _V_line_128x7_2sub2_VQH_
+#include "codebook.h"
+
+static long _huff_lengthlist_line_128x7_2sub2[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 5, 2, 6, 3, 7, 3,
+ 8, 4, 9, 4,11, 5,10, 5,11,
+};
+
+static static_codebook _huff_book_line_128x7_2sub2 = {
+ 1, 25,
+ _huff_lengthlist_line_128x7_2sub2,
+ 0, 0, 0, 0, 0,
+ NULL,
+ NULL,
+ NULL,
+ 0
+};
+
+
+#endif
diff --git a/lib/books/line_128x7_2sub3.vqh b/lib/books/line_128x7_2sub3.vqh
new file mode 100644
index 00000000..d5feb59a
--- /dev/null
+++ b/lib/books/line_128x7_2sub3.vqh
@@ -0,0 +1,40 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE Ogg Vorbis SOFTWARE CODEC SOURCE CODE. *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
+ * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. *
+ * PLEASE READ THESE TERMS DISTRIBUTING. *
+ * *
+ * THE OggSQUISH SOURCE CODE IS (C) COPYRIGHT 1994-1999 *
+ * by 1999 Monty <monty@xiph.org> and The XIPHOPHORUS Company *
+ * http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: static codebook autogenerated by huff/huffbuld
+
+ ********************************************************************/
+
+#ifndef _V_line_128x7_2sub3_VQH_
+#define _V_line_128x7_2sub3_VQH_
+#include "codebook.h"
+
+static long _huff_lengthlist_line_128x7_2sub3[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 9, 2, 9, 3, 9, 5,
+ 9, 6, 8, 7, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8,
+};
+
+static static_codebook _huff_book_line_128x7_2sub3 = {
+ 1, 64,
+ _huff_lengthlist_line_128x7_2sub3,
+ 0, 0, 0, 0, 0,
+ NULL,
+ NULL,
+ NULL,
+ 0
+};
+
+
+#endif
diff --git a/lib/books/line_128x7_class1.vqh b/lib/books/line_128x7_class1.vqh
new file mode 100644
index 00000000..5feb4284
--- /dev/null
+++ b/lib/books/line_128x7_class1.vqh
@@ -0,0 +1,40 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE Ogg Vorbis SOFTWARE CODEC SOURCE CODE. *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
+ * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. *
+ * PLEASE READ THESE TERMS DISTRIBUTING. *
+ * *
+ * THE OggSQUISH SOURCE CODE IS (C) COPYRIGHT 1994-1999 *
+ * by 1999 Monty <monty@xiph.org> and The XIPHOPHORUS Company *
+ * http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: static codebook autogenerated by huff/huffbuld
+
+ ********************************************************************/
+
+#ifndef _V_line_128x7_class1_VQH_
+#define _V_line_128x7_class1_VQH_
+#include "codebook.h"
+
+static long _huff_lengthlist_line_128x7_class1[] = {
+ 1, 3,10,13,13, 5, 6,13,12, 6, 6,13,13,13,13,13,
+ 6, 4,10,13,12, 7,12,13,13,12,13,13,13,13,13,13,
+ 4, 3,12,13, 9, 7,10,13,12, 8,11,13,13,13,13,13,
+ 13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
+};
+
+static static_codebook _huff_book_line_128x7_class1 = {
+ 1, 64,
+ _huff_lengthlist_line_128x7_class1,
+ 0, 0, 0, 0, 0,
+ NULL,
+ NULL,
+ NULL,
+ 0
+};
+
+
+#endif
diff --git a/lib/books/line_128x7_class2.vqh b/lib/books/line_128x7_class2.vqh
new file mode 100644
index 00000000..85018d24
--- /dev/null
+++ b/lib/books/line_128x7_class2.vqh
@@ -0,0 +1,40 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE Ogg Vorbis SOFTWARE CODEC SOURCE CODE. *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
+ * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. *
+ * PLEASE READ THESE TERMS DISTRIBUTING. *
+ * *
+ * THE OggSQUISH SOURCE CODE IS (C) COPYRIGHT 1994-1999 *
+ * by 1999 Monty <monty@xiph.org> and The XIPHOPHORUS Company *
+ * http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: static codebook autogenerated by huff/huffbuld
+
+ ********************************************************************/
+
+#ifndef _V_line_128x7_class2_VQH_
+#define _V_line_128x7_class2_VQH_
+#include "codebook.h"
+
+static long _huff_lengthlist_line_128x7_class2[] = {
+ 5, 4, 4,10, 7, 4, 5,13,13, 8, 8,13,13,13,13,13,
+ 6, 3, 3, 7, 7, 4, 4, 9,11, 8, 8,13,13,13,13,13,
+ 9, 5, 3, 5, 8, 5, 4, 7,10, 7, 7,11,13,13,13,13,
+ 13,13,12,13,13,12,13,13,13,13,12,12,12,12,12,12,
+};
+
+static static_codebook _huff_book_line_128x7_class2 = {
+ 1, 64,
+ _huff_lengthlist_line_128x7_class2,
+ 0, 0, 0, 0, 0,
+ NULL,
+ NULL,
+ NULL,
+ 0
+};
+
+
+#endif
diff --git a/lib/books/res_44c_A_128aux.vqh b/lib/books/res_44c_A_128aux.vqh
new file mode 100644
index 00000000..e2f0988a
--- /dev/null
+++ b/lib/books/res_44c_A_128aux.vqh
@@ -0,0 +1,43 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE Ogg Vorbis SOFTWARE CODEC SOURCE CODE. *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
+ * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. *
+ * PLEASE READ THESE TERMS DISTRIBUTING. *
+ * *
+ * THE OggSQUISH SOURCE CODE IS (C) COPYRIGHT 1994-1999 *
+ * by 1999 Monty <monty@xiph.org> and The XIPHOPHORUS Company *
+ * http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: static codebook autogenerated by huff/huffbuld
+
+ ********************************************************************/
+
+#ifndef _V_res_44c_A_128aux_VQH_
+#define _V_res_44c_A_128aux_VQH_
+#include "codebook.h"
+
+static long _huff_lengthlist_res_44c_A_128aux[] = {
+ 8,16, 9,16,16,11,12,15,16,16,13, 5,16,16, 5,16,
+ 7,13,16,16, 6,15, 2,15,15, 6, 6,11,15,15,15, 6,
+ 15,15, 4,15, 6,11,15,15,14, 4,15,15, 3,15, 6,10,
+ 15,15,10,15, 6,15,15, 8,11,13,15,15,11, 5, 8,14,
+ 4,10, 5,10,15,15,13, 9,10,10, 7,13, 8,11,15,15,
+ 15,11,15, 5,15,15, 4, 6,15,15,15,14,15, 7,15,15,
+ 5, 7,13,15,
+};
+
+static static_codebook _huff_book_res_44c_A_128aux = {
+ 2, 100,
+ _huff_lengthlist_res_44c_A_128aux,
+ 0, 0, 0, 0, 0,
+ NULL,
+ NULL,
+ NULL,
+ 0
+};
+
+
+#endif
diff --git a/lib/books/res_44c_Z_1024aux.vqh b/lib/books/res_44c_Z_1024aux.vqh
new file mode 100644
index 00000000..1594306a
--- /dev/null
+++ b/lib/books/res_44c_Z_1024aux.vqh
@@ -0,0 +1,43 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE Ogg Vorbis SOFTWARE CODEC SOURCE CODE. *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
+ * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. *
+ * PLEASE READ THESE TERMS DISTRIBUTING. *
+ * *
+ * THE OggSQUISH SOURCE CODE IS (C) COPYRIGHT 1994-1999 *
+ * by 1999 Monty <monty@xiph.org> and The XIPHOPHORUS Company *
+ * http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: static codebook autogenerated by huff/huffbuld
+
+ ********************************************************************/
+
+#ifndef _V_res_44c_Z_1024aux_VQH_
+#define _V_res_44c_Z_1024aux_VQH_
+#include "codebook.h"
+
+static long _huff_lengthlist_res_44c_Z_1024aux[] = {
+ 3,10, 9,10, 4, 7, 8,12,17,17, 9, 4, 4, 6,17,17,
+ 17,17,13,17, 9, 4, 4, 5,17,17,17,17,12,17, 9, 5,
+ 5, 5,16,16,16,16, 8,11, 4,16,16,16, 3, 5, 8,10,
+ 16,16, 6,16,16,16, 5, 4, 8,12,16,16, 9,16,16,16,
+ 7, 8, 9,12,16,16,11,16,16,16,10,12,11,12,16,16,
+ 13,10,10, 6,15,16,16,16, 7,10,16,14,14, 8,16,16,
+ 16,16, 7,10,
+};
+
+static static_codebook _huff_book_res_44c_Z_1024aux = {
+ 2, 100,
+ _huff_lengthlist_res_44c_Z_1024aux,
+ 0, 0, 0, 0, 0,
+ NULL,
+ NULL,
+ NULL,
+ 0
+};
+
+
+#endif
diff --git a/lib/books/res_44c_Z_128aux.vqh b/lib/books/res_44c_Z_128aux.vqh
new file mode 100644
index 00000000..4962d521
--- /dev/null
+++ b/lib/books/res_44c_Z_128aux.vqh
@@ -0,0 +1,99 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE Ogg Vorbis SOFTWARE CODEC SOURCE CODE. *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
+ * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. *
+ * PLEASE READ THESE TERMS DISTRIBUTING. *
+ * *
+ * THE OggSQUISH SOURCE CODE IS (C) COPYRIGHT 1994-1999 *
+ * by 1999 Monty <monty@xiph.org> and The XIPHOPHORUS Company *
+ * http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: static codebook autogenerated by huff/huffbuld
+
+ ********************************************************************/
+
+#ifndef _V_res_44c_Z_128aux_VQH_
+#define _V_res_44c_Z_128aux_VQH_
+#include "codebook.h"
+
+static long _huff_lengthlist_res_44c_Z_128aux[] = {
+ 4,14,14,14, 6, 8, 9,10,14,14,14,14,14,14,14,14,
+ 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
+ 14,14,14,14,14,14,14,14, 8,14,14,14, 6, 7, 8,11,
+ 14,14, 9,14,14,14, 7, 7,10,13,14,14,11,14,14,14,
+ 10,11,12,12,14,14,13,14,14,14,14,12,14,14,14,14,
+ 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
+ 14,14,14,14, 8,14,14,14, 6, 7, 9,11,14,14,14,13,
+ 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
+ 14,14,14,14,14,14,14,14,14,14,14,14, 7,14,14,14,
+ 5, 5, 8,12,14,14, 8,14,14,14, 6, 5, 8,12,14,14,
+ 9,14,14,14, 9, 9,10,12,14,14,13,14,14,14,13,14,
+ 13,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
+ 14,14,14,14,14,14,14,14, 9,14,14,14, 8, 9,13,12,
+ 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
+ 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
+ 8,14,14,14, 7, 8,11,14,14,14,10,14,14,14, 8, 7,
+ 11,14,14,14,11,14,14,14,11,11,12,14,14,14,14,14,
+ 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
+ 14,14,14,14,14,14,14,14,14,14,14,14,10,14,14,14,
+ 10,12,13,14,14,14,14,12,13,14,14,14,14,14,14,14,
+ 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
+ 14,14,14,14,11,14,14,14,10,11,13,14,14,14,14,14,
+ 14,14,11,12,14,14,14,14,13,14,14,14,12,14,14,14,
+ 14,14,13,14,14,14,14,14,14,14,14,14,14,14,14,14,
+ 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
+ 7,14,14,14, 7, 8,10,13,14,14,14,14,14,14,14,14,
+ 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
+ 14,14,14,14,14,14,14,14, 7,14,14,14, 4, 5, 8,12,
+ 14,14, 7,14,14,14, 5, 6, 9,12,14,14,10,14,14,14,
+ 8, 9,11,13,14,14,13,14,14,14,13,14,12,14,14,14,
+ 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
+ 14,14,14,14, 9,14,14,14, 7, 8,11,13,14,14,14,14,
+ 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
+ 14,14,14,14,14,14,14,14,14,14,14,14, 7,14,14,14,
+ 5, 6, 9,13,14,14, 7,14,14,14, 5, 5, 9,14,14,14,
+ 12,14,14,14, 9, 9,11,14,14,14,13,14,14,14,14,14,
+ 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
+ 14,14,14,14,14,14,14,14,11,14,14,14,10,11,13,14,
+ 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
+ 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
+ 9,14,14,14, 7, 8,10,14,14,14, 9,14,14,14, 8, 8,
+ 10,14,14,14,10,14,14,14,12, 9,12,14,14,14,14,14,
+ 14,14,13,13,14,14,14,14,14,14,14,14,14,14,14,14,
+ 14,14,14,14,14,14,14,14,14,14,14,14,11,14,14,14,
+ 13,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
+ 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
+ 14,14,14,14,12,14,14,14,11,12,14,14,14,14,14,14,
+ 14,14,13,14,13,14,14,14,14,14,14,14,13,12,14,14,
+ 14,14,14,14,14,14,13,14,14,14,14,14,14,14,14,14,
+ 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
+ 14,11,10,12,14,14,14,14,14,14, 9, 5, 6,10,14,14,
+ 14,14,14,14,10, 7, 8,11,14,14,14,14,14,14,14,12,
+ 12,14,14,14,14,14,14,14,14,14,14,14,14,14,13,14,
+ 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
+ 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
+ 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
+ 14,14,14,14,14,11, 9, 9,14,14,14,14,13,14, 8, 4,
+ 5, 7,14,14,14,14,11,14, 9, 6, 6, 7,14,14,14,14,
+ 11,14,13, 9, 8, 8,14,14,14,14,14,14,14,14,14,14,
+ 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
+ 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
+ 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
+ 14,14,14,14,14,14,14,14,
+};
+
+static static_codebook _huff_book_res_44c_Z_128aux = {
+ 3, 1000,
+ _huff_lengthlist_res_44c_Z_128aux,
+ 0, 0, 0, 0, 0,
+ NULL,
+ NULL,
+ NULL,
+ 0
+};
+
+
+#endif
diff --git a/lib/books/res_Zc_1.vqh b/lib/books/res_Zc_1.vqh
new file mode 100644
index 00000000..1fe268ec
--- /dev/null
+++ b/lib/books/res_Zc_1.vqh
@@ -0,0 +1,94 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
+ * THE GNU LESSER/LIBRARY PUBLIC LICENSE, WHICH IS INCLUDED WITH *
+ * THIS SOURCE. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+ * *
+ * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 *
+ * by the XIPHOPHORUS Company, http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: static codebook autogenerated by vq/somethingorother
+
+ ********************************************************************/
+
+#ifndef _V_res_Zc_1_VQH_
+#define _V_res_Zc_1_VQH_
+#include "codebook.h"
+
+static long _vq_quantlist_res_Zc_1[] = {
+ 1,
+ 0,
+ 2,
+};
+
+static long _vq_lengthlist_res_Zc_1[] = {
+ 1, 6, 6, 0, 5, 5, 0, 5, 5, 6, 8, 7, 0, 9, 8, 0,
+ 8, 8, 5, 7, 8, 0, 8, 9, 0, 8, 8, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 5, 8, 8, 0, 8, 7, 0, 7, 8, 5, 8, 8,
+ 0, 7, 8, 0, 8, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5,
+ 9, 8, 0, 8, 7, 0, 8, 7, 5, 8, 9, 0, 7, 8, 0, 7,
+ 8,
+};
+
+static float _vq_quantthresh_res_Zc_1[] = {
+ -0.5, 0.5,
+};
+
+static long _vq_quantmap_res_Zc_1[] = {
+ 1, 0, 2,
+};
+
+static encode_aux_threshmatch _vq_auxt_res_Zc_1 = {
+ _vq_quantthresh_res_Zc_1,
+ _vq_quantmap_res_Zc_1,
+ 3,
+ 3
+};
+
+static long _vq_pigeonmap_res_Zc_1[] = {
+ 0, 0,
+};
+
+static long _vq_fitlist_res_Zc_1[] = {
+ 0, 1, 2, 4, 5, 7, 8, 9,
+ 10, 11, 13, 14, 16, 17, 18, 19,
+ 20, 22, 23, 25, 26, 36, 37, 38,
+ 40, 41, 43, 44, 45, 46, 47, 49,
+ 50, 52, 53, 63, 64, 65, 67, 68,
+ 70, 71, 72, 73, 74, 76, 77, 79,
+ 80,
+};
+
+static long _vq_fitmap_res_Zc_1[] = {
+ 0,
+};
+
+static long _vq_fitlength_res_Zc_1[] = {
+ 49,
+};
+
+static encode_aux_pigeonhole _vq_auxp_res_Zc_1 = {
+ -1, 1, 2, 1,
+ _vq_pigeonmap_res_Zc_1,
+ 49,
+ _vq_fitlist_res_Zc_1,
+ _vq_fitmap_res_Zc_1,
+ _vq_fitlength_res_Zc_1
+};
+
+static static_codebook _vq_book_res_Zc_1 = {
+ 4, 81,
+ _vq_lengthlist_res_Zc_1,
+ 1, -535822336, 1611661312, 2, 0,
+ _vq_quantlist_res_Zc_1,
+ NULL,
+ &_vq_auxt_res_Zc_1,
+ &_vq_auxp_res_Zc_1,
+ 0
+};
+
+
+#endif
diff --git a/lib/books/res_Zc_2.vqh b/lib/books/res_Zc_2.vqh
new file mode 100644
index 00000000..1a363903
--- /dev/null
+++ b/lib/books/res_Zc_2.vqh
@@ -0,0 +1,300 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
+ * THE GNU LESSER/LIBRARY PUBLIC LICENSE, WHICH IS INCLUDED WITH *
+ * THIS SOURCE. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+ * *
+ * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 *
+ * by the XIPHOPHORUS Company, http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: static codebook autogenerated by vq/somethingorother
+
+ ********************************************************************/
+
+#ifndef _V_res_Zc_2_VQH_
+#define _V_res_Zc_2_VQH_
+#include "codebook.h"
+
+static long _vq_quantlist_res_Zc_2[] = {
+ 2,
+ 1,
+ 3,
+ 0,
+ 4,
+};
+
+static long _vq_lengthlist_res_Zc_2[] = {
+ 2, 6, 6, 8, 9, 0, 5, 5, 9, 9, 0, 5, 5, 9, 9, 0,
+ 7, 7, 9, 9, 0, 0, 0,10,10, 5, 8, 8,10,10, 0, 8,
+ 8,11,10, 0, 8, 8,11,10, 0,10, 9,12,11, 0, 0, 0,
+ 11,11, 6, 8, 8,10,11, 0, 8, 8,10,11, 0, 8, 8,10,
+ 10, 0, 9,10,11,11, 0, 0, 0,11,12, 9,10,10,12,12,
+ 0,12,11,14,13, 0,11,11,14,13, 0,14,13,17,13, 0,
+ 0, 0,14,14, 9,10,10,12,12, 0,11,12,13,14, 0,11,
+ 11,12,13, 0,13,15,14,15, 0, 0, 0,14,14, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 5, 8, 8,11,11, 0, 7, 7,11,11,
+ 0, 7, 7,10,11, 0, 9, 8,11,11, 0, 0, 0,11,12, 5,
+ 8, 8,12,11, 0, 7, 7,10,11, 0, 7, 7,11,10, 0, 8,
+ 9,11,12, 0, 0, 0,11,11, 8,10,10,13,12, 0,11,10,
+ 13,12, 0,10,11,13,12, 0,13,12,14,13, 0, 0, 0,13,
+ 13, 9,10,11,13,13, 0,10,11,12,13, 0,10,10,13,12,
+ 0,12,12,15,16, 0, 0, 0,13,13, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 5, 8, 8,12,11, 0, 7, 7,11,10, 0, 7, 7,
+ 11,10, 0, 9, 9,11,11, 0, 0, 0,12,11, 5, 8, 8,11,
+ 12, 0, 7, 7,10,11, 0, 7, 7,10,11, 0, 8, 9,11,11,
+ 0, 0, 0,11,12, 9,11,10,13,13, 0,11,10,13,12, 0,
+ 11,10,13,13, 0,13,12,14,13, 0, 0, 0,14,14, 9,10,
+ 11,13,13, 0,10,11,12,13, 0,10,11,13,13, 0,12,12,
+ 13,13, 0, 0, 0,13,14, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 7, 9,10,13,13, 0, 9, 8,12,13, 0, 8, 9,13,13, 0,
+ 11, 9,12,12, 0, 0, 0,12,13, 7,10, 9,13,13, 0, 9,
+ 9,13,12, 0, 9, 8,14,12, 0,10,11,12,12, 0, 0, 0,
+ 13,12, 9,11,11,14,14, 0,12,10,14,14, 0,11,11,13,
+ 13, 0,13,12,14,13, 0, 0, 0,13,14, 9,12,12,16,16,
+ 0,11,12,13,14, 0,12,11,13,13, 0,12,13,15,14, 0,
+ 0, 0,15,13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,10,
+ 12,11,14,13, 0,11,11,14,13, 0,11,11,15,14, 0,13,
+ 13,14,13, 0, 0, 0,14,13, 9,11,12,15,15, 0,11,11,
+ 12,14, 0,10,12,13,14, 0,12,12,13,14, 0, 0, 0,13,
+ 17,
+};
+
+static float _vq_quantthresh_res_Zc_2[] = {
+ -1.5, -0.5, 0.5, 1.5,
+};
+
+static long _vq_quantmap_res_Zc_2[] = {
+ 3, 1, 0, 2, 4,
+};
+
+static encode_aux_threshmatch _vq_auxt_res_Zc_2 = {
+ _vq_quantthresh_res_Zc_2,
+ _vq_quantmap_res_Zc_2,
+ 5,
+ 5
+};
+
+static long _vq_pigeonmap_res_Zc_2[] = {
+ 1, 0, 0, 0,
+};
+
+static long _vq_fitlist_res_Zc_2[] = {
+ 0, 1, 2, 3, 6, 7, 8, 11,
+ 12, 13, 16, 17, 18, 25, 26, 27,
+ 28, 31, 32, 33, 36, 37, 38, 41,
+ 42, 43, 50, 51, 52, 53, 56, 57,
+ 58, 61, 62, 63, 66, 67, 68, 75,
+ 76, 77, 78, 81, 82, 83, 86, 87,
+ 88, 91, 92, 93, 150, 151, 152, 153,
+ 156, 157, 158, 161, 162, 163, 166, 167,
+ 168, 175, 176, 177, 178, 181, 182, 183,
+ 186, 187, 188, 191, 192, 193, 200, 201,
+ 202, 203, 206, 207, 208, 211, 212, 213,
+ 216, 217, 218, 275, 276, 277, 278, 281,
+ 282, 283, 286, 287, 288, 291, 292, 293,
+ 300, 301, 302, 303, 306, 307, 308, 311,
+ 316, 325, 326, 327, 328, 331, 332, 333,
+ 336, 341, 400, 401, 402, 403, 406, 407,
+ 408, 411, 412, 413, 416, 417, 418, 425,
+ 426, 427, 428, 431, 432, 433, 436, 441,
+ 450, 451, 452, 453, 456, 457, 458, 461,
+ 466, 4, 9, 14, 19, 29, 34, 39,
+ 44, 54, 59, 64, 69, 79, 84, 89,
+ 94, 154, 159, 164, 169, 179, 184, 189,
+ 194, 204, 209, 214, 219, 279, 284, 289,
+ 294, 304, 309, 312, 317, 329, 334, 337,
+ 342, 404, 409, 414, 419, 429, 434, 437,
+ 442, 454, 459, 462, 467, 314, 319, 339,
+ 344, 439, 444, 464, 469, 23, 48, 73,
+ 98, 173, 198, 223, 298, 313, 338, 423,
+ 438, 463, 24, 49, 74, 99, 174, 199,
+ 224, 299, 424, 324, 349, 449, 474, 323,
+ 348, 448, 473, 100, 101, 102, 103, 106,
+ 107, 108, 111, 112, 113, 116, 117, 118,
+ 225, 226, 227, 228, 231, 232, 233, 236,
+ 237, 238, 241, 242, 243, 318, 350, 351,
+ 352, 353, 356, 357, 358, 361, 366, 443,
+ 475, 476, 477, 478, 481, 482, 483, 486,
+ 491, 104, 109, 114, 119, 229, 234, 239,
+ 244, 354, 359, 362, 367, 479, 484, 487,
+ 492, 364, 369, 489, 494, 123, 248, 363,
+ 488, 124, 249, 374, 499, 373, 498, 368,
+ 493, 343, 575, 576, 577, 578, 581, 582,
+ 583, 586, 591, 579, 584, 587, 592, 589,
+ 594, 588, 599, 598, 600, 601, 602, 603,
+ 606, 607, 608, 611, 616, 604, 609, 612,
+ 617, 614, 619, 613, 624, 623, 618, 593,
+ 0, 1, 3, 6, 8, 11, 13, 16,
+ 18, 25, 26, 28, 31, 33, 36, 38,
+ 41, 43, 50, 51, 53, 56, 58, 61,
+ 63, 66, 68, 75, 76, 78, 81, 83,
+ 86, 88, 91, 93, 150, 151, 153, 156,
+ 158, 161, 163, 166, 168, 175, 176, 178,
+ 181, 183, 186, 188, 191, 193, 200, 201,
+ 203, 206, 208, 211, 213, 216, 218, 275,
+ 276, 278, 281, 283, 286, 288, 291, 293,
+ 300, 301, 303, 306, 308, 311, 313, 316,
+ 318, 325, 326, 328, 331, 333, 336, 338,
+ 341, 343, 400, 401, 403, 406, 408, 411,
+ 413, 416, 418, 425, 426, 428, 431, 433,
+ 436, 438, 441, 443, 450, 451, 453, 456,
+ 458, 461, 463, 466, 468, 23, 48, 73,
+ 98, 173, 198, 223, 298, 323, 348, 423,
+ 448, 473, 100, 101, 103, 106, 108, 111,
+ 113, 116, 118, 225, 226, 228, 231, 233,
+ 236, 238, 241, 243, 350, 351, 353, 356,
+ 358, 361, 363, 366, 368, 475, 476, 478,
+ 481, 483, 486, 488, 491, 493, 123, 248,
+ 373, 498, 575, 576, 578, 581, 583, 586,
+ 588, 591, 593, 598, 600, 601, 603, 606,
+ 608, 611, 613, 616, 618, 623, 0, 1,
+ 2, 3, 6, 7, 8, 16, 17, 18,
+ 25, 26, 27, 28, 31, 32, 33, 41,
+ 42, 43, 50, 51, 52, 53, 56, 57,
+ 58, 66, 67, 68, 75, 76, 77, 78,
+ 81, 82, 83, 91, 92, 93, 150, 151,
+ 152, 153, 156, 157, 158, 166, 167, 168,
+ 175, 176, 177, 178, 181, 182, 183, 191,
+ 192, 193, 200, 201, 202, 203, 206, 207,
+ 208, 216, 217, 218, 275, 276, 277, 278,
+ 281, 282, 283, 291, 292, 293, 300, 301,
+ 306, 307, 308, 316, 317, 318, 325, 326,
+ 331, 332, 333, 341, 342, 343, 400, 401,
+ 402, 403, 406, 407, 408, 416, 417, 418,
+ 425, 426, 431, 432, 433, 441, 442, 443,
+ 450, 451, 456, 457, 458, 466, 467, 468,
+ 4, 9, 19, 29, 34, 44, 54, 59,
+ 69, 79, 84, 94, 154, 159, 169, 179,
+ 184, 194, 204, 209, 219, 279, 284, 294,
+ 302, 309, 319, 327, 334, 344, 404, 409,
+ 419, 427, 434, 444, 452, 459, 469, 304,
+ 329, 429, 454, 100, 101, 102, 103, 106,
+ 107, 108, 116, 117, 118, 225, 226, 227,
+ 228, 231, 232, 233, 241, 242, 243, 303,
+ 350, 351, 356, 357, 358, 366, 367, 368,
+ 428, 475, 476, 481, 482, 483, 491, 492,
+ 493, 104, 109, 119, 229, 234, 244, 352,
+ 359, 369, 477, 484, 494, 354, 479, 353,
+ 478, 328, 575, 576, 581, 582, 583, 591,
+ 592, 593, 577, 584, 594, 579, 600, 601,
+ 606, 607, 608, 616, 617, 618, 602, 609,
+ 619, 604, 603, 578, 0, 1, 2, 3,
+ 6, 7, 8, 11, 12, 13, 16, 17,
+ 18, 25, 26, 27, 28, 31, 32, 33,
+ 36, 37, 38, 41, 42, 43, 75, 76,
+ 77, 78, 81, 82, 83, 86, 87, 88,
+ 91, 92, 93, 150, 151, 152, 153, 156,
+ 157, 158, 161, 162, 163, 166, 167, 168,
+ 200, 201, 202, 203, 206, 207, 208, 211,
+ 212, 213, 216, 217, 218, 275, 276, 277,
+ 278, 281, 282, 283, 286, 287, 288, 291,
+ 292, 293, 325, 326, 327, 328, 331, 332,
+ 333, 336, 337, 338, 341, 342, 343, 400,
+ 401, 402, 403, 406, 407, 408, 411, 412,
+ 413, 416, 417, 418, 450, 451, 452, 453,
+ 456, 457, 458, 461, 462, 463, 466, 467,
+ 468, 4, 9, 14, 19, 29, 34, 39,
+ 44, 79, 84, 89, 94, 154, 159, 164,
+ 169, 204, 209, 214, 219, 279, 284, 289,
+ 294, 329, 334, 339, 344, 404, 409, 414,
+ 419, 454, 459, 464, 469, 23, 48, 98,
+ 173, 223, 298, 348, 423, 473, 24, 49,
+ 99, 174, 224, 299, 349, 424, 474, 575,
+ 576, 577, 578, 581, 582, 583, 586, 587,
+ 588, 591, 592, 593, 579, 584, 589, 594,
+ 598, 599, 0, 1, 2, 3, 6, 7,
+ 8, 11, 12, 13, 16, 17, 18, 25,
+ 26, 27, 28, 31, 32, 33, 36, 37,
+ 38, 41, 42, 43, 50, 51, 52, 53,
+ 56, 57, 58, 61, 66, 75, 76, 77,
+ 78, 81, 82, 83, 86, 91, 150, 151,
+ 152, 153, 156, 157, 158, 161, 162, 163,
+ 166, 167, 168, 175, 176, 177, 178, 181,
+ 182, 183, 186, 187, 188, 191, 192, 193,
+ 200, 201, 202, 203, 206, 207, 208, 211,
+ 212, 213, 216, 217, 218, 400, 401, 402,
+ 403, 406, 407, 408, 411, 412, 413, 416,
+ 417, 418, 425, 426, 427, 428, 431, 432,
+ 433, 436, 437, 438, 441, 442, 443, 450,
+ 451, 452, 453, 456, 457, 458, 461, 462,
+ 463, 466, 467, 468, 4, 9, 14, 19,
+ 29, 34, 39, 44, 54, 59, 62, 67,
+ 79, 84, 87, 92, 154, 159, 164, 169,
+ 179, 184, 189, 194, 204, 209, 214, 219,
+ 404, 409, 414, 419, 429, 434, 439, 444,
+ 454, 459, 464, 469, 64, 69, 89, 94,
+ 23, 48, 63, 88, 173, 198, 223, 423,
+ 448, 473, 24, 49, 174, 199, 224, 424,
+ 449, 474, 74, 99, 73, 98, 68, 100,
+ 101, 102, 103, 106, 107, 108, 111, 116,
+ 225, 226, 227, 228, 231, 232, 233, 236,
+ 237, 238, 241, 242, 243, 475, 476, 477,
+ 478, 481, 482, 483, 486, 487, 488, 491,
+ 492, 493, 104, 109, 112, 117, 229, 234,
+ 239, 244, 479, 484, 489, 494, 114, 119,
+ 113, 248, 498, 249, 499, 124, 123, 118,
+ 0, 1, 2, 3, 6, 7, 8, 16,
+ 17, 18, 25, 26, 27, 28, 31, 32,
+ 33, 41, 42, 43, 50, 51, 56, 57,
+ 58, 66, 67, 68, 75, 76, 81, 82,
+ 83, 91, 92, 93, 150, 151, 152, 153,
+ 156, 157, 158, 166, 167, 168, 175, 176,
+ 177, 178, 181, 182, 183, 191, 192, 193,
+ 200, 201, 202, 203, 206, 207, 208, 216,
+ 217, 218, 400, 401, 402, 403, 406, 407,
+ 408, 416, 417, 418, 425, 426, 427, 428,
+ 431, 432, 433, 441, 442, 443, 450, 451,
+ 452, 453, 456, 457, 458, 466, 467, 468,
+ 4, 9, 19, 29, 34, 44, 52, 59,
+ 69, 77, 84, 94, 154, 159, 169, 179,
+ 184, 194, 204, 209, 219, 404, 409, 419,
+ 429, 434, 444, 454, 459, 469, 54, 79,
+ 53, 100, 101, 106, 107, 108, 116, 117,
+ 118, 225, 226, 227, 228, 231, 232, 233,
+ 241, 242, 243, 475, 476, 477, 478, 481,
+ 482, 483, 491, 492, 493, 102, 109, 119,
+ 229, 234, 244, 479, 484, 494, 104, 103,
+};
+
+static long _vq_fitmap_res_Zc_2[] = {
+ 0, 360, 550, 360, 796, 360, 796, 360,
+ 986, 360, 1232, 360, 796, 360, 796, 360,
+};
+
+static long _vq_fitlength_res_Zc_2[] = {
+ 360, 190, 246, 190, 190, 190, 190, 190,
+ 246, 190, 168, 190, 190, 190, 190, 190,
+};
+
+static encode_aux_pigeonhole _vq_auxp_res_Zc_2 = {
+ -2, 1, 4, 2,
+ _vq_pigeonmap_res_Zc_2,
+ 1400,
+ _vq_fitlist_res_Zc_2,
+ _vq_fitmap_res_Zc_2,
+ _vq_fitlength_res_Zc_2
+};
+
+static static_codebook _vq_book_res_Zc_2 = {
+ 4, 625,
+ _vq_lengthlist_res_Zc_2,
+ 1, -533725184, 1611661312, 3, 0,
+ _vq_quantlist_res_Zc_2,
+ NULL,
+ &_vq_auxt_res_Zc_2,
+ &_vq_auxp_res_Zc_2,
+ 0
+};
+
+
+#endif
diff --git a/lib/books/res_Zc_3.vqh b/lib/books/res_Zc_3.vqh
new file mode 100644
index 00000000..9082fad8
--- /dev/null
+++ b/lib/books/res_Zc_3.vqh
@@ -0,0 +1,248 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
+ * THE GNU LESSER/LIBRARY PUBLIC LICENSE, WHICH IS INCLUDED WITH *
+ * THIS SOURCE. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+ * *
+ * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 *
+ * by the XIPHOPHORUS Company, http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: static codebook autogenerated by vq/somethingorother
+
+ ********************************************************************/
+
+#ifndef _V_res_Zc_3_VQH_
+#define _V_res_Zc_3_VQH_
+#include "codebook.h"
+
+static long _vq_quantlist_res_Zc_3[] = {
+ 7,
+ 6,
+ 8,
+ 5,
+ 9,
+ 4,
+ 10,
+ 3,
+ 11,
+ 2,
+ 12,
+ 1,
+ 13,
+ 0,
+ 14,
+};
+
+static long _vq_lengthlist_res_Zc_3[] = {
+ 1, 5, 5, 7, 7, 8, 8, 9, 9,10,10,11,11,12,12, 0,
+ 4, 5, 7, 7, 8, 8, 9, 9,10,10,11,11,12,12, 0, 4,
+ 4, 7, 7, 8, 8, 9, 9,10,10,11,11,12,12, 0, 6, 6,
+ 7, 8, 8, 8,10,10,11,11,12,12,12,13, 0, 0, 0, 7,
+ 8, 9, 8,10,10,11,11,12,12,13,13, 0, 0, 0, 8, 8,
+ 9, 9,10,10,11,11,12,12,13,13, 0, 0, 0, 8, 8, 9,
+ 9,11,10,12,12,12,12,13,13, 0, 0, 0, 9, 9,10,10,
+ 11,11,12,12,12,12,13,14, 0, 0, 0, 0, 0,10,10,11,
+ 11,12,12,13,13,14,14, 0, 0, 0, 0, 0,11,11,11,11,
+ 12,12,13,13,14,14, 0, 0, 0, 0, 0,11,11,12,12,13,
+ 13,14,13,14,14, 0, 0, 0, 0, 0,11,12,12,12,12,13,
+ 13,13,15,14, 0, 0, 0, 0, 0, 0, 0,12,12,13,13,14,
+ 14,17,16, 0, 0, 0, 0, 0, 0, 0,12,13,14,13,13,14,
+ 14,15, 0, 0, 0, 0, 0, 0, 0,13,13,13,13,14,14,15,
+ 17,
+};
+
+static float _vq_quantthresh_res_Zc_3[] = {
+ -6.5, -5.5, -4.5, -3.5, -2.5, -1.5, -0.5, 0.5,
+ 1.5, 2.5, 3.5, 4.5, 5.5, 6.5,
+};
+
+static long _vq_quantmap_res_Zc_3[] = {
+ 13, 11, 9, 7, 5, 3, 1, 0,
+ 2, 4, 6, 8, 10, 12, 14,
+};
+
+static encode_aux_threshmatch _vq_auxt_res_Zc_3 = {
+ _vq_quantthresh_res_Zc_3,
+ _vq_quantmap_res_Zc_3,
+ 15,
+ 15
+};
+
+static long _vq_pigeonmap_res_Zc_3[] = {
+ 4, 3, 3, 2, 1, 1, 0, 0,
+ 0, 1, 2, 2, 3, 4,
+};
+
+static long _vq_fitlist_res_Zc_3[] = {
+ 0, 1, 2, 3, 16, 17, 18, 31,
+ 46, 4, 19, 32, 47, 6, 21, 34,
+ 49, 33, 36, 64, 63, 66, 94, 1,
+ 3, 5, 7, 16, 18, 20, 22, 33,
+ 35, 48, 50, 0, 31, 46, 2, 4,
+ 6, 8, 17, 19, 21, 23, 34, 36,
+ 49, 51, 37, 63, 65, 32, 38, 64,
+ 66, 67, 93, 95, 68, 94, 96, 3,
+ 5, 7, 9, 18, 20, 22, 24, 35,
+ 37, 50, 52, 4, 6, 8, 10, 19,
+ 21, 23, 25, 36, 38, 51, 53, 12,
+ 27, 40, 55, 33, 39, 65, 67, 34,
+ 66, 68, 42, 70, 63, 69, 95, 97,
+ 64, 96, 98, 72, 100, 7, 9, 11,
+ 13, 22, 24, 26, 28, 39, 41, 54,
+ 56, 5, 20, 37, 52, 8, 10, 12,
+ 14, 23, 25, 27, 29, 40, 42, 55,
+ 57, 43, 69, 71, 35, 67, 38, 44,
+ 70, 72, 73, 99, 101, 65, 97, 68,
+ 74, 100, 102, 9, 11, 13, 24, 26,
+ 28, 41, 43, 56, 58, 10, 12, 14,
+ 25, 27, 29, 42, 44, 57, 59, 39,
+ 71, 73, 40, 72, 74, 69, 101, 103,
+ 70, 102, 104, 16, 46, 47, 48, 78,
+ 17, 49, 79, 19, 51, 81, 109, 0,
+ 1, 18, 2, 4, 21, 31, 32, 33,
+ 63, 64, 65, 93, 94, 95, 34, 66,
+ 96, 18, 20, 46, 48, 50, 52, 78,
+ 80, 82, 108, 110, 16, 19, 21, 47,
+ 49, 51, 53, 79, 81, 83, 109, 111,
+ 3, 5, 22, 1, 4, 6, 17, 23,
+ 33, 35, 63, 65, 67, 93, 95, 97,
+ 125, 31, 34, 36, 64, 66, 68, 94,
+ 96, 98, 126, 20, 22, 48, 50, 52,
+ 54, 78, 80, 82, 84, 110, 112, 21,
+ 23, 49, 51, 53, 55, 79, 81, 83,
+ 85, 111, 113, 25, 57, 87, 115, 5,
+ 7, 18, 24, 6, 8, 19, 10, 27,
+ 35, 37, 63, 65, 67, 69, 93, 95,
+ 97, 99, 125, 127, 36, 38, 64, 66,
+ 68, 70, 94, 96, 98, 100, 126, 128,
+ 40, 72, 102, 130, 24, 26, 52, 54,
+ 56, 58, 82, 84, 86, 88, 114, 116,
+ 22, 50, 80, 112, 25, 27, 53, 55,
+ 57, 59, 83, 85, 87, 89, 115, 117,
+ 9, 11, 28, 7, 20, 10, 12, 23,
+ 29, 39, 41, 67, 69, 71, 73, 97,
+ 99, 101, 103, 129, 131, 37, 65, 95,
+ 127, 40, 42, 68, 70, 72, 74, 98,
+ 100, 102, 104, 130, 132, 26, 28, 54,
+ 56, 58, 84, 86, 88, 116, 118, 27,
+ 29, 55, 57, 59, 85, 87, 89, 117,
+ 119, 11, 13, 24, 12, 14, 25, 41,
+ 43, 69, 71, 73, 99, 101, 103, 131,
+ 133, 42, 44, 70, 72, 74, 100, 102,
+ 104, 132, 134, 16, 46, 47, 48, 78,
+ 79, 80, 108, 109, 110, 17, 49, 81,
+ 111, 31, 63, 93, 94, 95, 125, 32,
+ 64, 96, 126, 155, 156, 128, 158, 48,
+ 50, 78, 80, 82, 108, 110, 112, 140,
+ 46, 49, 51, 79, 81, 83, 109, 111,
+ 113, 141, 63, 65, 93, 95, 97, 125,
+ 127, 155, 64, 66, 94, 96, 98, 126,
+ 128, 156, 157, 158, 50, 52, 78, 80,
+ 82, 84, 108, 110, 112, 114, 140, 142,
+ 51, 53, 79, 81, 83, 85, 109, 111,
+ 113, 115, 141, 143, 55, 87, 117, 145,
+ 65, 67, 93, 95, 97, 99, 125, 127,
+ 129, 155, 157, 66, 68, 94, 96, 98,
+ 100, 126, 128, 130, 156, 158, 70, 102,
+ 132, 160, 159, 187, 188, 162, 190, 54,
+ 56, 82, 84, 86, 88, 112, 114, 116,
+ 118, 144, 146, 52, 80, 110, 142, 55,
+ 57, 83, 85, 87, 89, 113, 115, 117,
+ 119, 145, 147, 69, 71, 97, 99, 101,
+ 103, 127, 129, 131, 133, 159, 161, 67,
+ 95, 125, 157, 70, 72, 98, 100, 102,
+ 104, 128, 130, 132, 134, 160, 162, 163,
+ 189, 191, 155, 187, 158, 164, 190, 192,
+ 56, 58, 84, 86, 88, 114, 116, 118,
+ 146, 148, 57, 59, 85, 87, 89, 115,
+ 117, 119, 147, 149, 71, 73, 99, 101,
+ 103, 129, 131, 133, 161, 163, 72, 74,
+ 100, 102, 104, 130, 132, 134, 162, 164,
+ 159, 191, 193, 160, 192, 194, 78, 108,
+ 109, 110, 140, 170, 79, 111, 141, 171,
+ 143, 173, 46, 47, 93, 94, 95, 125,
+ 155, 156, 157, 187, 96, 126, 158, 188,
+ 108, 110, 140, 142, 170, 172, 78, 109,
+ 111, 141, 143, 171, 173, 80, 112, 79,
+ 81, 113, 125, 155, 157, 187, 93, 126,
+ 156, 158, 188, 110, 112, 140, 142, 144,
+ 170, 172, 174, 202, 111, 113, 141, 143,
+ 145, 171, 173, 175, 203, 115, 147, 177,
+ 205, 80, 82, 108, 114, 81, 83, 109,
+ 85, 117, 125, 127, 155, 157, 159, 187,
+ 189, 217, 126, 128, 156, 158, 160, 188,
+ 190, 218, 130, 162, 192, 220, 114, 116,
+ 142, 144, 146, 148, 172, 174, 176, 178,
+ 204, 206, 112, 140, 170, 202, 115, 117,
+ 143, 145, 147, 149, 173, 175, 177, 179,
+ 205, 207, 84, 86, 118, 82, 110, 85,
+ 87, 113, 119, 129, 131, 157, 159, 161,
+ 163, 187, 189, 191, 193, 219, 221, 127,
+ 155, 217, 130, 132, 158, 160, 162, 164,
+ 188, 190, 192, 194, 220, 222, 116, 118,
+ 144, 146, 148, 174, 176, 178, 206, 208,
+ 117, 119, 145, 147, 149, 175, 177, 179,
+ 207, 209, 86, 88, 114, 87, 89, 115,
+ 131, 133, 159, 161, 163, 189, 191, 193,
+ 221, 223, 132, 134, 160, 162, 164, 190,
+ 192, 194, 222, 224, 108, 109, 110, 140,
+ 170, 171, 172, 202, 111, 141, 173, 203,
+ 93, 125, 155, 156, 157, 187, 217, 94,
+ 126, 158, 188, 218, 140, 170, 172, 202,
+ 108, 141, 171, 173, 203, 125, 155, 157,
+ 187, 189, 217, 219, 126, 156, 158, 188,
+ 190, 218, 220, 140, 142, 170, 172, 174,
+ 202, 204, 141, 143, 171, 173, 175, 203,
+ 205, 145, 177, 207, 155, 157, 187, 189,
+ 217, 219, 156, 158, 188, 190, 218, 220,
+ 160, 192, 222, 144, 146, 172, 174, 176,
+ 178, 202, 204, 206, 208, 142, 170, 145,
+ 147, 173, 175, 177, 179, 203, 205, 207,
+ 209, 159, 161, 187, 189, 191, 193, 217,
+ 219, 221, 223, 157, 160, 162, 188, 190,
+ 192, 194, 218, 220, 222, 224, 146, 148,
+ 174, 176, 178, 204, 206, 208, 147, 149,
+ 175, 177, 179, 205, 207, 209, 161, 163,
+ 189, 191, 193, 219, 221, 223, 162, 164,
+ 190, 192, 194, 220, 222, 224,
+};
+
+static long _vq_fitmap_res_Zc_3[] = {
+ 0, 23, 63, 109, 155, 187, 217, 267,
+ 332, 397, 443, 471, 508, 567, 632, 678,
+ 704, 731, 782, 846, 892, 916, 939, 971,
+ 1014,
+};
+
+static long _vq_fitlength_res_Zc_3[] = {
+ 23, 40, 46, 46, 32, 30, 50, 65,
+ 65, 46, 28, 37, 59, 65, 46, 26,
+ 27, 51, 64, 46, 24, 23, 32, 43,
+ 32,
+};
+
+static encode_aux_pigeonhole _vq_auxp_res_Zc_3 = {
+ -7, 1, 14, 5,
+ _vq_pigeonmap_res_Zc_3,
+ 1046,
+ _vq_fitlist_res_Zc_3,
+ _vq_fitmap_res_Zc_3,
+ _vq_fitlength_res_Zc_3
+};
+
+static static_codebook _vq_book_res_Zc_3 = {
+ 2, 225,
+ _vq_lengthlist_res_Zc_3,
+ 1, -530841600, 1611661312, 4, 0,
+ _vq_quantlist_res_Zc_3,
+ NULL,
+ &_vq_auxt_res_Zc_3,
+ &_vq_auxp_res_Zc_3,
+ 0
+};
+
+
+#endif
diff --git a/lib/books/res_Zc_5.vqh b/lib/books/res_Zc_5.vqh
new file mode 100644
index 00000000..a3928c1e
--- /dev/null
+++ b/lib/books/res_Zc_5.vqh
@@ -0,0 +1,89 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
+ * THE GNU LESSER/LIBRARY PUBLIC LICENSE, WHICH IS INCLUDED WITH *
+ * THIS SOURCE. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+ * *
+ * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 *
+ * by the XIPHOPHORUS Company, http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: static codebook autogenerated by vq/somethingorother
+
+ ********************************************************************/
+
+#ifndef _V_res_Zc_5_VQH_
+#define _V_res_Zc_5_VQH_
+#include "codebook.h"
+
+static long _vq_quantlist_res_Zc_5[] = {
+ 1,
+ 0,
+ 2,
+};
+
+static long _vq_lengthlist_res_Zc_5[] = {
+ 1, 3, 3, 0, 0, 0, 0, 0, 0, 4, 5, 5, 0, 0, 0, 0,
+ 0, 0, 4, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0,
+};
+
+static float _vq_quantthresh_res_Zc_5[] = {
+ -0.5, 0.5,
+};
+
+static long _vq_quantmap_res_Zc_5[] = {
+ 1, 0, 2,
+};
+
+static encode_aux_threshmatch _vq_auxt_res_Zc_5 = {
+ _vq_quantthresh_res_Zc_5,
+ _vq_quantmap_res_Zc_5,
+ 3,
+ 3
+};
+
+static long _vq_pigeonmap_res_Zc_5[] = {
+ 0, 0,
+};
+
+static long _vq_fitlist_res_Zc_5[] = {
+ 0, 1, 2, 9, 10, 11, 18, 19,
+ 20,
+};
+
+static long _vq_fitmap_res_Zc_5[] = {
+ 0,
+};
+
+static long _vq_fitlength_res_Zc_5[] = {
+ 9,
+};
+
+static encode_aux_pigeonhole _vq_auxp_res_Zc_5 = {
+ -1, 1, 2, 1,
+ _vq_pigeonmap_res_Zc_5,
+ 9,
+ _vq_fitlist_res_Zc_5,
+ _vq_fitmap_res_Zc_5,
+ _vq_fitlength_res_Zc_5
+};
+
+static static_codebook _vq_book_res_Zc_5 = {
+ 4, 81,
+ _vq_lengthlist_res_Zc_5,
+ 1, -535822336, 1611661312, 2, 0,
+ _vq_quantlist_res_Zc_5,
+ NULL,
+ &_vq_auxt_res_Zc_5,
+ &_vq_auxp_res_Zc_5,
+ 0
+};
+
+
+#endif
diff --git a/lib/books/res_Zc_6.vqh b/lib/books/res_Zc_6.vqh
new file mode 100644
index 00000000..ae5e8341
--- /dev/null
+++ b/lib/books/res_Zc_6.vqh
@@ -0,0 +1,129 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
+ * THE GNU LESSER/LIBRARY PUBLIC LICENSE, WHICH IS INCLUDED WITH *
+ * THIS SOURCE. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+ * *
+ * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 *
+ * by the XIPHOPHORUS Company, http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: static codebook autogenerated by vq/somethingorother
+
+ ********************************************************************/
+
+#ifndef _V_res_Zc_6_VQH_
+#define _V_res_Zc_6_VQH_
+#include "codebook.h"
+
+static long _vq_quantlist_res_Zc_6[] = {
+ 2,
+ 1,
+ 3,
+ 0,
+ 4,
+};
+
+static long _vq_lengthlist_res_Zc_6[] = {
+ 1, 4, 4, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 6, 5, 7, 6, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 4, 5, 6, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7, 6, 9, 9,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 6, 6, 7, 9, 9, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0,
+};
+
+static float _vq_quantthresh_res_Zc_6[] = {
+ -1.5, -0.5, 0.5, 1.5,
+};
+
+static long _vq_quantmap_res_Zc_6[] = {
+ 3, 1, 0, 2, 4,
+};
+
+static encode_aux_threshmatch _vq_auxt_res_Zc_6 = {
+ _vq_quantthresh_res_Zc_6,
+ _vq_quantmap_res_Zc_6,
+ 5,
+ 5
+};
+
+static long _vq_pigeonmap_res_Zc_6[] = {
+ 1, 0, 0, 0,
+};
+
+static long _vq_fitlist_res_Zc_6[] = {
+ 0, 1, 2, 3, 25, 26, 27, 28,
+ 50, 51, 52, 53, 75, 76, 77, 78,
+ 4, 29, 54, 79, 100, 101, 102, 103,
+ 104,
+};
+
+static long _vq_fitmap_res_Zc_6[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+
+static long _vq_fitlength_res_Zc_6[] = {
+ 25, 25, 25, 25, 25, 25, 25, 25,
+ 25, 25, 25, 25, 25, 25, 25, 25,
+};
+
+static encode_aux_pigeonhole _vq_auxp_res_Zc_6 = {
+ -2, 1, 4, 2,
+ _vq_pigeonmap_res_Zc_6,
+ 25,
+ _vq_fitlist_res_Zc_6,
+ _vq_fitmap_res_Zc_6,
+ _vq_fitlength_res_Zc_6
+};
+
+static static_codebook _vq_book_res_Zc_6 = {
+ 4, 625,
+ _vq_lengthlist_res_Zc_6,
+ 1, -533725184, 1611661312, 3, 0,
+ _vq_quantlist_res_Zc_6,
+ NULL,
+ &_vq_auxt_res_Zc_6,
+ &_vq_auxp_res_Zc_6,
+ 0
+};
+
+
+#endif
diff --git a/lib/books/res_Zc_7.vqh b/lib/books/res_Zc_7.vqh
new file mode 100644
index 00000000..dd948072
--- /dev/null
+++ b/lib/books/res_Zc_7.vqh
@@ -0,0 +1,119 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
+ * THE GNU LESSER/LIBRARY PUBLIC LICENSE, WHICH IS INCLUDED WITH *
+ * THIS SOURCE. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+ * *
+ * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 *
+ * by the XIPHOPHORUS Company, http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: static codebook autogenerated by vq/somethingorother
+
+ ********************************************************************/
+
+#ifndef _V_res_Zc_7_VQH_
+#define _V_res_Zc_7_VQH_
+#include "codebook.h"
+
+static long _vq_quantlist_res_Zc_7[] = {
+ 7,
+ 6,
+ 8,
+ 5,
+ 9,
+ 4,
+ 10,
+ 3,
+ 11,
+ 2,
+ 12,
+ 1,
+ 13,
+ 0,
+ 14,
+};
+
+static long _vq_lengthlist_res_Zc_7[] = {
+ 1, 3, 3, 4, 5, 4, 4, 7, 6, 9, 8,11,10,11, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0,
+};
+
+static float _vq_quantthresh_res_Zc_7[] = {
+ -6.5, -5.5, -4.5, -3.5, -2.5, -1.5, -0.5, 0.5,
+ 1.5, 2.5, 3.5, 4.5, 5.5, 6.5,
+};
+
+static long _vq_quantmap_res_Zc_7[] = {
+ 13, 11, 9, 7, 5, 3, 1, 0,
+ 2, 4, 6, 8, 10, 12, 14,
+};
+
+static encode_aux_threshmatch _vq_auxt_res_Zc_7 = {
+ _vq_quantthresh_res_Zc_7,
+ _vq_quantmap_res_Zc_7,
+ 15,
+ 15
+};
+
+static long _vq_pigeonmap_res_Zc_7[] = {
+ 4, 3, 3, 2, 1, 1, 0, 0,
+ 0, 1, 2, 2, 3, 4,
+};
+
+static long _vq_fitlist_res_Zc_7[] = {
+ 0, 1, 2, 3, 4, 6, 5, 7,
+ 8, 9, 10, 11, 12, 13,
+};
+
+static long _vq_fitmap_res_Zc_7[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0,
+};
+
+static long _vq_fitlength_res_Zc_7[] = {
+ 14, 14, 14, 14, 14, 14, 14, 14,
+ 14, 14, 14, 14, 14, 14, 14, 14,
+ 14, 14, 14, 14, 14, 14, 14, 14,
+ 14,
+};
+
+static encode_aux_pigeonhole _vq_auxp_res_Zc_7 = {
+ -7, 1, 14, 5,
+ _vq_pigeonmap_res_Zc_7,
+ 14,
+ _vq_fitlist_res_Zc_7,
+ _vq_fitmap_res_Zc_7,
+ _vq_fitlength_res_Zc_7
+};
+
+static static_codebook _vq_book_res_Zc_7 = {
+ 2, 225,
+ _vq_lengthlist_res_Zc_7,
+ 1, -530841600, 1611661312, 4, 0,
+ _vq_quantlist_res_Zc_7,
+ NULL,
+ &_vq_auxt_res_Zc_7,
+ &_vq_auxp_res_Zc_7,
+ 0
+};
+
+
+#endif
diff --git a/lib/books/res_Zc_8.vqh b/lib/books/res_Zc_8.vqh
new file mode 100644
index 00000000..bfcec30c
--- /dev/null
+++ b/lib/books/res_Zc_8.vqh
@@ -0,0 +1,1043 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
+ * THE GNU LESSER/LIBRARY PUBLIC LICENSE, WHICH IS INCLUDED WITH *
+ * THIS SOURCE. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+ * *
+ * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 *
+ * by the XIPHOPHORUS Company, http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: static codebook autogenerated by vq/somethingorother
+
+ ********************************************************************/
+
+#ifndef _V_res_Zc_8_VQH_
+#define _V_res_Zc_8_VQH_
+#include "codebook.h"
+
+static long _vq_quantlist_res_Zc_8[] = {
+ 22,
+ 21,
+ 23,
+ 20,
+ 24,
+ 19,
+ 25,
+ 18,
+ 26,
+ 17,
+ 27,
+ 16,
+ 28,
+ 15,
+ 29,
+ 14,
+ 30,
+ 13,
+ 31,
+ 12,
+ 32,
+ 11,
+ 33,
+ 10,
+ 34,
+ 9,
+ 35,
+ 8,
+ 36,
+ 7,
+ 37,
+ 6,
+ 38,
+ 5,
+ 39,
+ 4,
+ 40,
+ 3,
+ 41,
+ 2,
+ 42,
+ 1,
+ 43,
+ 0,
+ 44,
+};
+
+static long _vq_lengthlist_res_Zc_8[] = {
+ 2, 4, 4, 6, 6, 7, 7, 8, 8, 9, 8, 9, 9,10,10,10,
+ 9,10,10,11,10,12,11,12,12,13,12,13,13,12,13,14,
+ 13,14,13,14,14,15,13,14,14,16,15,14,14, 0, 5, 5,
+ 6, 7, 8, 7, 8, 8, 9, 9,10,10,10,10,10,10,10,11,
+ 11,11,11,12,13,12,12,12,13,13,13,13,14,14,16,13,
+ 14,13,13,15,14,14,14,13,15,15, 0, 5, 5, 7, 6, 7,
+ 7, 8, 8, 9, 9, 9, 9,10,10,10, 9,10,10,11,11,11,
+ 12,12,12,12,12,12,11,13,12,13,13,12,14,13,13,14,
+ 13,14,14,14,14,16,14, 0, 6, 6, 7, 7, 8, 8, 9, 9,
+ 10,10,10,10,11,11,10,10,11,11,12,12,11,12,12,13,
+ 12,12,13,12,13,13,12,13,13,13,14,13,15,12,13,13,
+ 14,16,14,14, 0, 0, 0, 7, 7, 8, 8, 9, 8,10, 9,10,
+ 10,11,11,11,10,11,11,12,12,12,12,12,12,13,13,13,
+ 0,13,14,15,14,13,13,14,16,13,14,15,16,14,15,14,
+ 14, 0, 0, 0, 8, 8, 8, 8, 9, 9,10,10,11,10,11,11,
+ 11,10,11,11,12,11,12,13,13,13,14,13,13,14,16, 0,
+ 13,16,13,15,14,13,13,13,13,16,15,16,14,16, 0, 0,
+ 0, 7, 8, 8, 8, 9, 9,10,10,10,10,11,11,11,11,11,
+ 11,11,13,12,13,13,13,13,13,13,13,14,13,14,14,14,
+ 15,16,16,14,14,15, 0,16,15, 0,14, 0, 0, 0, 8, 9,
+ 9, 9, 9, 9,10,10,10,11,11,11,11,11,11,12,12,13,
+ 13,12,14,14,13,13,15,14,13, 0,14,14,14,14,14,16,
+ 0,14,14,16,14,16, 0,14, 0, 0, 0, 0, 0, 9, 9, 9,
+ 9,10,10,11,11,11,11,11,12,12,11,12,13,12,13,14,
+ 13,13,13,14,14,13,14,13,13, 0,14,14,16,14,14,16,
+ 14,15,16,15, 0, 0, 0, 0, 0, 0, 9,10,10,10,10,10,
+ 11,11,12,11,12,11,12,11,12,12,13,14,14,13,13,13,
+ 15,16,14,14,13,15,16,14,16, 0,16,15,16, 0,15,14,
+ 16, 0, 0, 0, 0, 0, 0, 9, 9,10,10,10,10,11,11,12,
+ 12,11,12,12,11,12,12,14,13,12,15,15,14,14, 0,14,
+ 16,15,14,16,14,16, 0, 0,16,14,14,16, 0, 0, 0, 0,
+ 0, 0, 0, 0, 9,10,10,10,11,10,11,11,12,12,12,11,
+ 12,12,16,12,13,13,13,13,14,13,15,14,15,16, 0,15,
+ 16, 0,16,16, 0,14, 0,16,16, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0,10,10,11,11,11,12,12,11,11,12,12,12,12,
+ 13,13,14,13,13,14,16, 0,14, 0,16,15, 0,15,16,16,
+ 15,16,14,15,16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 10,11,11,11,11,11,12,12,11,12,12,12,13,14,13,13,
+ 14,15,15,13,13,13,14,14,16, 0, 0, 0,16,16,16,14,
+ 15, 0, 0, 0,16,16, 0, 0, 0, 0, 0, 0, 0,11,10,12,
+ 11,12,11,12,12,12,12,12,14,14,13,13,14,14,15,15,
+ 13,14,16,16,15,16, 0,16, 0,16, 0, 0, 0,16, 0,16,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,10,11,11,10,11,11,
+ 11,11,12,12,13,13,13,12,13,13,14,14,14,15,14,16,
+ 16, 0,14,16, 0, 0, 0,16,16, 0, 0,15, 0, 0,16,16,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0,11,10,11,11,12,11,13,
+ 12,12,13,14,13,14,14,15,14,14,15,15,15,16,14, 0,
+ 16,16, 0,16,16,16,16, 0, 0, 0,15, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,11,11,12,11,12,12,12,13,13,13,
+ 12,13,13,13,15,15,14,16,15,16,15,15,16, 0,16,16,
+ 0, 0, 0,16, 0,16,16, 0, 0,16, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0,11,11,12,11,12,12,12,12,12,13,14,13, 0,
+ 14,14,14,15,16, 0,16,15,16, 0,15, 0,16, 0,16, 0,
+ 0,16,16, 0, 0,16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 11,12,11,11,13,12,12,13,13,13,13,15,14,15,14,16,
+ 15,14, 0,16, 0,15,16, 0,15, 0, 0,15,16, 0,16, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,12,
+ 12,12,12,12,12,13,14,16,13,14, 0,15,15, 0,16,14,
+ 14, 0, 0, 0,16, 0, 0, 0, 0, 0, 0, 0, 0, 0,16, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,12,12,13,13,
+ 14,12,14,14,14,14,14, 0,16,14,15,15,16,14,16,15,
+ 16,14,15,15,16,16, 0, 0,16, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0,12,13,12,12,13,13,13,
+ 14,15,13,16,13,15, 0,16,16,16,15,16, 0,16, 0,16,
+ 16, 0, 0, 0, 0, 0, 0,16, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,13,13,14,13,14,14,13,14,15,16,
+ 14,15,16,15,15, 0, 0,16, 0, 0,15, 0, 0, 0, 0,16,
+ 0, 0, 0,16, 0, 0,16, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0,13,14,14,13, 0,14, 0,14,14,14,16,
+ 16,16, 0, 0,15, 0, 0,16,16,15, 0, 0, 0, 0, 0, 0,
+ 0,15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,14,13,15,13,15, 0,13,14,16,14,15, 0, 0,16,
+ 0, 0, 0,15,15,16,16,16,16, 0, 0, 0, 0, 0, 0, 0,
+ 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,13,
+ 14,14,13, 0,13,16,14,15, 0,15, 0, 0, 0,16, 0, 0,
+ 16,16, 0, 0, 0, 0, 0, 0, 0, 0, 0,16, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,14,16,14,13,
+ 13, 0,16, 0,15,16,16, 0,16,16,16,15,16,16, 0, 0,
+ 15,16, 0, 0,16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,13,13,14,14,16,
+ 0,16,16,16,16,16, 0, 0, 0,16,15,16, 0, 0,16, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,14,14,15,16, 0, 0,15, 0,
+ 14,16,14,16, 0,15, 0, 0, 0,15, 0, 0, 0, 0,16, 0,
+ 16,16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0,15,14,14, 0,15,14,16,16, 0, 0,16,
+ 14, 0, 0,15, 0, 0, 0, 0,16, 0,16, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,15,16,16,15,16,14, 0,16,15,16,15,15, 0, 0,
+ 16, 0, 0, 0, 0,16, 0, 0,16,16, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,14,14,15,15, 0,15,16, 0, 0, 0, 0, 0, 0,16,
+ 0, 0, 0, 0, 0, 0, 0, 0,16, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,15, 0,
+ 0, 0,15, 0, 0,16,16, 0,16, 0,16, 0, 0, 0, 0, 0,
+ 0,16, 0, 0, 0,16, 0, 0, 0,16, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,16,16, 0,16, 0,
+ 14, 0,15,14,16, 0, 0, 0, 0, 0,16, 0, 0,16,16, 0,
+ 0,16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,14,13, 0,16,14,15, 0,13,
+ 16, 0,16,16, 0, 0, 0, 0,16, 0, 0,16, 0, 0, 0, 0,
+ 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0,15, 0,15, 0,16,16,16, 0, 0,
+ 16, 0,16, 0, 0, 0, 0, 0, 0, 0, 0,16, 0, 0,16, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,13,15, 0, 0,16, 0,16, 0, 0,16, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,16, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,14,16, 0, 0,16, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,16, 0, 0, 0, 0,16, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,12, 0,
+ 12,16,16, 0, 0,16, 0, 0, 0,15, 0, 0, 0, 0, 0,16,
+ 16,16, 0, 0, 0, 0, 0,16, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,15,14,16,
+ 0,16, 0,16, 0, 0, 0, 0, 0, 0, 0, 0,16, 0, 0, 0,
+ 0, 0, 0,16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,12,16,14,16, 0, 0,
+ 0, 0, 0, 0,16, 0, 0, 0, 0, 0, 0, 0, 0,16,16, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,12, 0, 0, 0, 0,16, 0,16,
+ 0, 0, 0, 0, 0, 0,16, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,12, 0,12,16,14, 0, 0, 0, 0,16,15, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0,15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0,
+};
+
+static float _vq_quantthresh_res_Zc_8[] = {
+ -21.5, -20.5, -19.5, -18.5, -17.5, -16.5, -15.5, -14.5,
+ -13.5, -12.5, -11.5, -10.5, -9.5, -8.5, -7.5, -6.5,
+ -5.5, -4.5, -3.5, -2.5, -1.5, -0.5, 0.5, 1.5,
+ 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5,
+ 10.5, 11.5, 12.5, 13.5, 14.5, 15.5, 16.5, 17.5,
+ 18.5, 19.5, 20.5, 21.5,
+};
+
+static long _vq_quantmap_res_Zc_8[] = {
+ 43, 41, 39, 37, 35, 33, 31, 29,
+ 27, 25, 23, 21, 19, 17, 15, 13,
+ 11, 9, 7, 5, 3, 1, 0, 2,
+ 4, 6, 8, 10, 12, 14, 16, 18,
+ 20, 22, 24, 26, 28, 30, 32, 34,
+ 36, 38, 40, 42, 44,
+};
+
+static encode_aux_threshmatch _vq_auxt_res_Zc_8 = {
+ _vq_quantthresh_res_Zc_8,
+ _vq_quantmap_res_Zc_8,
+ 45,
+ 45
+};
+
+static long _vq_pigeonmap_res_Zc_8[] = {
+ 14, 13, 13, 12, 11, 11, 10, 9,
+ 9, 8, 7, 7, 6, 5, 5, 4,
+ 3, 3, 2, 1, 1, 0, 0, 0,
+ 1, 2, 2, 3, 4, 4, 5, 6,
+ 6, 7, 8, 8, 9, 10, 10, 11,
+ 12, 12, 13, 14,
+};
+
+static long _vq_fitlist_res_Zc_8[] = {
+ 0, 1, 2, 3, 46, 47, 48, 91,
+ 136, 4, 49, 92, 137, 6, 51, 94,
+ 139, 93, 96, 184, 183, 186, 274, 5,
+ 7, 50, 52, 95, 138, 140, 8, 53,
+ 141, 97, 185, 98, 187, 273, 275, 188,
+ 276, 9, 54, 142, 10, 55, 143, 12,
+ 57, 100, 145, 99, 102, 190, 189, 277,
+ 278, 192, 280, 7, 9, 11, 13, 52,
+ 54, 56, 58, 99, 101, 144, 146, 5,
+ 50, 97, 142, 8, 10, 12, 14, 53,
+ 55, 57, 59, 100, 102, 145, 147, 103,
+ 189, 191, 95, 187, 98, 104, 190, 192,
+ 193, 279, 281, 185, 277, 188, 194, 280,
+ 282, 15, 60, 148, 16, 61, 149, 18,
+ 63, 106, 151, 105, 108, 196, 195, 283,
+ 284, 198, 286, 13, 15, 17, 19, 58,
+ 60, 62, 64, 105, 107, 150, 152, 11,
+ 56, 103, 148, 14, 16, 18, 20, 59,
+ 61, 63, 65, 106, 108, 151, 153, 109,
+ 195, 197, 101, 193, 104, 110, 196, 198,
+ 199, 285, 287, 191, 283, 194, 200, 286,
+ 288, 21, 66, 154, 22, 67, 155, 24,
+ 69, 112, 157, 111, 114, 202, 201, 289,
+ 290, 204, 292, 19, 21, 23, 25, 64,
+ 66, 68, 70, 111, 113, 156, 158, 17,
+ 62, 109, 154, 20, 22, 24, 26, 65,
+ 67, 69, 71, 112, 114, 157, 159, 115,
+ 201, 203, 107, 199, 110, 116, 202, 204,
+ 205, 291, 293, 197, 289, 200, 206, 292,
+ 294, 27, 72, 160, 28, 73, 161, 30,
+ 75, 118, 163, 117, 120, 207, 295, 296,
+ 210, 298, 25, 27, 29, 31, 70, 72,
+ 74, 76, 117, 119, 162, 164, 23, 68,
+ 115, 160, 26, 28, 30, 32, 71, 73,
+ 75, 77, 118, 120, 163, 165, 121, 207,
+ 209, 113, 205, 116, 122, 210, 211, 297,
+ 299, 203, 295, 206, 212, 298, 300, 33,
+ 78, 166, 34, 79, 167, 36, 81, 124,
+ 169, 123, 126, 214, 213, 301, 302, 216,
+ 304, 31, 33, 35, 37, 76, 78, 80,
+ 82, 123, 125, 168, 170, 29, 74, 121,
+ 166, 32, 34, 36, 38, 77, 79, 81,
+ 83, 124, 126, 169, 171, 127, 213, 215,
+ 119, 211, 122, 128, 214, 216, 217, 303,
+ 305, 209, 301, 212, 218, 304, 306, 39,
+ 84, 172, 40, 85, 173, 42, 87, 130,
+ 175, 129, 132, 220, 219, 307, 308, 222,
+ 37, 39, 41, 43, 82, 84, 86, 88,
+ 129, 131, 174, 176, 35, 80, 127, 172,
+ 38, 40, 42, 44, 83, 85, 87, 89,
+ 130, 132, 175, 177, 133, 219, 221, 125,
+ 217, 128, 134, 220, 222, 223, 309, 311,
+ 215, 307, 218, 224, 312, 178, 179, 314,
+ 264, 266, 268, 356, 265, 267, 269, 357,
+ 359, 401, 403, 402, 46, 136, 137, 138,
+ 228, 47, 139, 229, 49, 141, 231, 319,
+ 0, 1, 48, 2, 4, 51, 91, 92,
+ 93, 183, 184, 185, 273, 274, 275, 94,
+ 186, 276, 50, 140, 142, 230, 232, 318,
+ 320, 143, 233, 321, 3, 5, 52, 6,
+ 53, 95, 187, 277, 365, 96, 188, 278,
+ 366, 322, 410, 323, 411, 367, 455, 368,
+ 456, 457, 458, 50, 52, 138, 140, 142,
+ 144, 228, 230, 232, 234, 320, 322, 51,
+ 53, 139, 141, 143, 145, 229, 231, 233,
+ 235, 321, 323, 55, 147, 237, 325, 5,
+ 7, 48, 54, 6, 8, 49, 10, 57,
+ 95, 97, 183, 185, 187, 189, 273, 275,
+ 277, 279, 365, 367, 96, 98, 184, 186,
+ 188, 190, 274, 276, 278, 280, 366, 368,
+ 100, 192, 282, 370, 54, 56, 142, 144,
+ 146, 148, 232, 234, 236, 238, 324, 326,
+ 52, 140, 230, 322, 55, 57, 143, 145,
+ 147, 149, 233, 235, 237, 239, 325, 327,
+ 9, 11, 58, 7, 50, 10, 12, 53,
+ 59, 99, 101, 187, 189, 191, 193, 277,
+ 279, 281, 283, 369, 371, 97, 185, 275,
+ 367, 100, 102, 188, 190, 192, 194, 278,
+ 280, 282, 284, 370, 372, 56, 58, 144,
+ 146, 148, 150, 234, 236, 238, 240, 326,
+ 328, 57, 59, 145, 147, 149, 151, 235,
+ 237, 239, 241, 327, 329, 61, 153, 243,
+ 331, 11, 13, 54, 60, 12, 14, 55,
+ 16, 63, 101, 103, 189, 191, 193, 195,
+ 279, 281, 283, 285, 371, 373, 102, 104,
+ 190, 192, 194, 196, 280, 282, 284, 286,
+ 372, 374, 106, 198, 288, 376, 60, 62,
+ 148, 150, 152, 154, 238, 240, 242, 244,
+ 330, 332, 58, 146, 236, 328, 61, 63,
+ 149, 151, 153, 155, 239, 241, 243, 245,
+ 331, 333, 15, 17, 64, 13, 56, 16,
+ 18, 59, 65, 105, 107, 193, 195, 197,
+ 199, 283, 285, 287, 289, 375, 377, 103,
+ 191, 281, 373, 106, 108, 194, 196, 198,
+ 200, 284, 286, 288, 290, 376, 378, 62,
+ 64, 150, 152, 154, 156, 240, 242, 244,
+ 246, 332, 334, 63, 65, 151, 153, 155,
+ 157, 241, 243, 245, 247, 333, 335, 67,
+ 159, 249, 337, 17, 19, 60, 66, 18,
+ 20, 61, 22, 69, 107, 109, 195, 197,
+ 199, 201, 285, 287, 289, 291, 377, 379,
+ 108, 110, 196, 198, 200, 202, 286, 288,
+ 290, 292, 378, 380, 112, 204, 294, 382,
+ 66, 68, 154, 156, 158, 160, 244, 246,
+ 248, 250, 336, 338, 64, 152, 242, 334,
+ 67, 69, 155, 157, 159, 161, 245, 247,
+ 249, 251, 337, 339, 21, 23, 70, 19,
+ 62, 22, 24, 65, 71, 111, 113, 199,
+ 201, 203, 205, 289, 291, 293, 295, 381,
+ 383, 109, 197, 287, 379, 112, 114, 200,
+ 202, 204, 206, 290, 292, 294, 296, 382,
+ 384, 68, 70, 156, 158, 160, 162, 246,
+ 248, 250, 252, 338, 340, 69, 71, 157,
+ 159, 161, 163, 247, 249, 251, 253, 339,
+ 341, 73, 165, 343, 23, 25, 66, 72,
+ 24, 26, 67, 28, 75, 113, 115, 201,
+ 203, 205, 207, 291, 293, 295, 297, 383,
+ 385, 114, 116, 202, 204, 206, 292, 294,
+ 296, 298, 384, 386, 118, 210, 300, 388,
+ 72, 74, 160, 162, 164, 166, 250, 252,
+ 254, 256, 342, 344, 70, 158, 248, 340,
+ 73, 75, 161, 163, 165, 167, 251, 253,
+ 257, 343, 27, 29, 76, 25, 68, 28,
+ 30, 71, 77, 117, 119, 205, 207, 209,
+ 211, 295, 297, 299, 301, 387, 389, 115,
+ 203, 293, 385, 118, 120, 206, 210, 212,
+ 296, 298, 300, 302, 388, 390, 74, 76,
+ 162, 164, 166, 168, 252, 254, 256, 258,
+ 344, 346, 75, 77, 163, 165, 167, 169,
+ 253, 257, 259, 347, 79, 171, 261, 349,
+ 29, 31, 72, 78, 30, 32, 73, 34,
+ 81, 119, 121, 207, 209, 211, 213, 297,
+ 299, 301, 303, 389, 391, 120, 122, 210,
+ 212, 214, 298, 300, 302, 304, 390, 392,
+ 124, 216, 306, 394, 78, 80, 166, 168,
+ 170, 172, 256, 258, 260, 262, 348, 350,
+ 76, 164, 254, 346, 79, 81, 167, 169,
+ 171, 173, 257, 259, 261, 263, 349, 351,
+ 33, 35, 82, 31, 74, 34, 36, 77,
+ 83, 123, 125, 211, 213, 215, 217, 301,
+ 303, 305, 307, 395, 121, 209, 299, 391,
+ 124, 126, 212, 214, 216, 218, 302, 304,
+ 306, 308, 394, 396, 80, 82, 168, 170,
+ 172, 174, 258, 260, 262, 264, 350, 81,
+ 83, 169, 171, 173, 175, 259, 261, 263,
+ 265, 351, 353, 85, 177, 267, 355, 35,
+ 37, 78, 84, 36, 38, 79, 40, 87,
+ 125, 127, 213, 215, 217, 219, 303, 305,
+ 307, 309, 395, 397, 126, 128, 214, 216,
+ 218, 220, 304, 306, 308, 396, 398, 130,
+ 222, 312, 400, 84, 86, 172, 174, 176,
+ 178, 262, 264, 266, 268, 354, 356, 82,
+ 170, 260, 85, 87, 173, 175, 177, 179,
+ 263, 265, 267, 269, 355, 357, 39, 41,
+ 88, 37, 80, 40, 42, 83, 89, 129,
+ 131, 217, 219, 221, 223, 307, 309, 311,
+ 399, 401, 127, 215, 305, 397, 130, 132,
+ 218, 220, 222, 224, 308, 312, 314, 400,
+ 402, 46, 136, 137, 138, 228, 229, 230,
+ 318, 319, 320, 47, 139, 231, 321, 91,
+ 183, 273, 274, 275, 365, 92, 184, 276,
+ 366, 455, 456, 368, 458, 410, 500, 411,
+ 501, 413, 503, 457, 547, 548, 412, 502,
+ 322, 323, 140, 142, 228, 230, 232, 234,
+ 318, 320, 322, 324, 410, 412, 141, 143,
+ 229, 231, 233, 235, 319, 321, 323, 325,
+ 411, 413, 145, 237, 327, 415, 185, 187,
+ 273, 275, 277, 279, 365, 367, 369, 455,
+ 457, 186, 188, 274, 276, 278, 280, 366,
+ 368, 370, 456, 458, 190, 282, 372, 460,
+ 459, 547, 548, 462, 550, 144, 146, 232,
+ 234, 236, 238, 322, 324, 326, 328, 414,
+ 416, 142, 230, 320, 412, 145, 147, 233,
+ 235, 237, 239, 323, 325, 327, 329, 415,
+ 417, 189, 191, 277, 279, 281, 283, 367,
+ 369, 371, 373, 459, 461, 187, 275, 365,
+ 457, 190, 192, 278, 280, 282, 284, 368,
+ 370, 372, 374, 460, 462, 463, 549, 551,
+ 455, 547, 458, 464, 550, 552, 146, 148,
+ 234, 236, 238, 240, 324, 326, 328, 330,
+ 416, 418, 147, 149, 235, 237, 239, 241,
+ 325, 327, 329, 331, 417, 419, 151, 243,
+ 333, 421, 191, 193, 279, 281, 283, 285,
+ 369, 371, 373, 375, 461, 463, 192, 194,
+ 280, 282, 284, 286, 370, 372, 374, 376,
+ 462, 464, 196, 288, 378, 466, 459, 465,
+ 551, 553, 460, 552, 554, 468, 556, 150,
+ 152, 238, 240, 242, 244, 328, 330, 332,
+ 334, 420, 422, 148, 236, 326, 418, 151,
+ 153, 239, 241, 243, 245, 329, 331, 333,
+ 335, 421, 423, 195, 197, 283, 285, 287,
+ 289, 373, 375, 377, 379, 465, 467, 193,
+ 281, 371, 463, 196, 198, 284, 286, 288,
+ 290, 374, 376, 378, 380, 466, 468, 469,
+ 555, 557, 461, 553, 464, 470, 556, 558,
+ 152, 154, 240, 242, 244, 246, 330, 332,
+ 334, 336, 422, 424, 153, 155, 241, 243,
+ 245, 247, 331, 333, 335, 337, 423, 425,
+ 157, 249, 339, 427, 197, 199, 285, 287,
+ 289, 291, 375, 377, 379, 381, 467, 469,
+ 198, 200, 286, 288, 290, 292, 376, 378,
+ 380, 382, 468, 470, 202, 294, 384, 472,
+ 465, 471, 557, 559, 466, 558, 560, 474,
+ 562, 156, 158, 244, 246, 248, 250, 334,
+ 336, 338, 340, 426, 428, 154, 242, 332,
+ 424, 157, 159, 245, 247, 249, 251, 335,
+ 337, 339, 341, 427, 429, 201, 203, 289,
+ 291, 293, 295, 379, 381, 383, 385, 471,
+ 473, 199, 287, 377, 469, 202, 204, 290,
+ 292, 294, 296, 380, 382, 384, 386, 472,
+ 474, 475, 561, 563, 467, 559, 470, 476,
+ 562, 564, 158, 160, 246, 248, 250, 252,
+ 336, 338, 340, 342, 428, 430, 159, 161,
+ 247, 249, 251, 253, 337, 339, 341, 343,
+ 429, 431, 163, 433, 203, 205, 291, 293,
+ 295, 297, 381, 383, 385, 387, 473, 475,
+ 204, 206, 292, 294, 296, 298, 382, 384,
+ 386, 388, 474, 476, 300, 390, 471, 477,
+ 563, 565, 472, 564, 566, 480, 568, 162,
+ 164, 250, 252, 254, 256, 340, 342, 344,
+ 346, 432, 434, 160, 248, 338, 430, 163,
+ 165, 251, 253, 257, 341, 343, 347, 433,
+ 435, 207, 209, 295, 297, 299, 301, 385,
+ 387, 389, 391, 477, 479, 205, 293, 383,
+ 475, 210, 296, 298, 300, 302, 386, 388,
+ 390, 392, 480, 481, 473, 565, 476, 482,
+ 568, 570, 164, 166, 252, 254, 256, 258,
+ 342, 344, 346, 348, 434, 436, 165, 167,
+ 253, 257, 259, 343, 347, 349, 435, 437,
+ 169, 261, 351, 439, 209, 211, 297, 299,
+ 301, 303, 387, 389, 391, 479, 481, 210,
+ 212, 298, 300, 302, 304, 388, 390, 392,
+ 394, 480, 482, 214, 306, 396, 484, 477,
+ 483, 571, 570, 574, 168, 170, 256, 258,
+ 260, 262, 346, 348, 350, 438, 440, 166,
+ 254, 344, 436, 169, 171, 257, 259, 261,
+ 263, 347, 349, 351, 353, 439, 213, 215,
+ 301, 303, 305, 307, 391, 395, 397, 483,
+ 485, 211, 299, 389, 481, 214, 216, 302,
+ 304, 306, 308, 392, 394, 396, 398, 484,
+ 573, 575, 479, 571, 482, 488, 574, 576,
+ 170, 172, 258, 260, 262, 264, 348, 350,
+ 354, 440, 442, 171, 173, 259, 261, 263,
+ 265, 349, 351, 353, 355, 443, 175, 267,
+ 357, 215, 217, 303, 305, 307, 309, 395,
+ 397, 399, 485, 216, 218, 304, 306, 308,
+ 394, 396, 398, 400, 488, 220, 312, 402,
+ 490, 483, 489, 575, 577, 484, 576, 578,
+ 580, 174, 176, 262, 264, 266, 268, 354,
+ 356, 444, 446, 172, 260, 350, 442, 175,
+ 177, 263, 265, 267, 269, 353, 355, 357,
+ 359, 447, 219, 221, 307, 309, 311, 397,
+ 399, 401, 403, 489, 491, 217, 305, 395,
+ 220, 222, 308, 312, 314, 398, 400, 402,
+ 490, 579, 485, 577, 488, 580, 178, 448,
+ 179, 223, 224, 320, 322, 410, 412, 414,
+ 500, 502, 504, 592, 321, 323, 411, 413,
+ 415, 501, 503, 505, 593, 325, 417, 507,
+ 595, 230, 232, 318, 324, 231, 233, 319,
+ 235, 327, 365, 367, 455, 457, 459, 547,
+ 549, 637, 366, 368, 456, 458, 460, 548,
+ 550, 638, 370, 462, 552, 640, 594, 682,
+ 683, 597, 685, 639, 642, 730, 729, 732,
+ 820, 324, 326, 412, 414, 416, 418, 502,
+ 504, 506, 508, 594, 596, 322, 410, 500,
+ 592, 325, 327, 413, 415, 417, 419, 503,
+ 505, 507, 509, 595, 597, 234, 236, 328,
+ 232, 320, 235, 237, 323, 329, 369, 371,
+ 457, 459, 461, 463, 547, 549, 551, 553,
+ 639, 641, 367, 455, 637, 370, 372, 458,
+ 460, 462, 464, 548, 550, 552, 554, 640,
+ 642, 326, 328, 414, 416, 418, 420, 504,
+ 506, 508, 510, 596, 598, 327, 329, 415,
+ 417, 419, 421, 505, 507, 509, 511, 597,
+ 599, 331, 423, 513, 601, 236, 238, 324,
+ 330, 237, 239, 325, 241, 333, 371, 373,
+ 459, 461, 463, 465, 549, 551, 553, 555,
+ 641, 643, 372, 374, 460, 462, 464, 466,
+ 550, 552, 554, 556, 642, 644, 376, 468,
+ 558, 646, 330, 332, 418, 420, 422, 424,
+ 508, 510, 512, 514, 600, 602, 328, 416,
+ 506, 598, 331, 333, 419, 421, 423, 425,
+ 509, 511, 513, 515, 601, 603, 240, 242,
+ 334, 238, 326, 241, 243, 329, 335, 375,
+ 377, 463, 465, 467, 469, 553, 555, 557,
+ 559, 645, 647, 373, 461, 551, 643, 376,
+ 378, 464, 466, 468, 470, 554, 556, 558,
+ 560, 646, 648, 332, 334, 420, 422, 424,
+ 426, 510, 512, 514, 516, 602, 604, 333,
+ 335, 421, 423, 425, 427, 511, 513, 515,
+ 517, 603, 605, 337, 429, 519, 607, 242,
+ 244, 330, 336, 243, 245, 331, 247, 339,
+ 377, 379, 465, 467, 469, 471, 555, 557,
+ 559, 561, 647, 649, 378, 380, 466, 468,
+ 470, 472, 556, 558, 560, 562, 648, 650,
+ 382, 474, 564, 652, 336, 338, 424, 426,
+ 428, 430, 514, 516, 518, 520, 606, 608,
+ 334, 422, 512, 604, 337, 339, 425, 427,
+ 429, 431, 515, 517, 519, 521, 607, 609,
+ 246, 248, 340, 244, 332, 247, 249, 335,
+ 341, 381, 383, 469, 471, 473, 475, 559,
+ 561, 563, 565, 651, 653, 379, 467, 557,
+ 649, 382, 384, 470, 472, 474, 476, 560,
+ 562, 564, 566, 652, 654, 338, 340, 426,
+ 428, 430, 432, 516, 518, 520, 522, 608,
+ 610, 339, 341, 427, 429, 431, 433, 517,
+ 519, 521, 523, 609, 611, 343, 435, 525,
+ 613, 248, 250, 336, 342, 249, 251, 337,
+ 253, 383, 385, 471, 473, 475, 477, 561,
+ 563, 565, 653, 655, 384, 386, 472, 474,
+ 476, 562, 564, 566, 568, 654, 656, 388,
+ 480, 570, 658, 342, 344, 430, 432, 434,
+ 436, 520, 522, 524, 612, 614, 340, 428,
+ 518, 610, 343, 431, 433, 435, 437, 521,
+ 523, 525, 527, 613, 615, 252, 254, 346,
+ 250, 338, 253, 341, 347, 387, 389, 475,
+ 477, 479, 481, 565, 571, 657, 659, 385,
+ 473, 563, 655, 388, 390, 476, 480, 482,
+ 566, 568, 570, 658, 660, 344, 346, 432,
+ 434, 436, 438, 522, 524, 528, 614, 616,
+ 347, 433, 435, 437, 439, 523, 525, 527,
+ 615, 349, 531, 254, 256, 342, 348, 257,
+ 343, 259, 351, 389, 391, 477, 479, 481,
+ 483, 571, 573, 659, 661, 390, 392, 480,
+ 482, 484, 568, 570, 574, 660, 394, 576,
+ 348, 350, 436, 438, 440, 442, 528, 530,
+ 620, 346, 434, 524, 616, 349, 351, 437,
+ 439, 443, 527, 531, 533, 621, 258, 260,
+ 256, 344, 259, 261, 347, 353, 395, 481,
+ 483, 485, 571, 573, 575, 577, 663, 665,
+ 391, 479, 661, 394, 396, 482, 484, 488,
+ 574, 576, 578, 622, 614, 706, 623, 711,
+ 753, 755, 659, 756, 757, 749, 752, 758,
+ 844, 846, 350, 438, 440, 442, 444, 528,
+ 530, 620, 622, 351, 353, 439, 443, 531,
+ 533, 535, 621, 623, 355, 447, 260, 262,
+ 348, 354, 261, 263, 349, 265, 357, 395,
+ 397, 483, 485, 489, 573, 575, 577, 579,
+ 665, 396, 398, 484, 488, 490, 574, 576,
+ 578, 580, 400, 356, 446, 448, 536, 624,
+ 264, 266, 267, 359, 399, 401, 491, 669,
+ 671, 402, 356, 444, 446, 448, 536, 628,
+ 357, 359, 447, 535, 629, 266, 268, 354,
+ 267, 269, 355, 401, 403, 489, 491, 579,
+ 671, 312, 314, 400, 402, 488, 490, 578,
+ 580, 762, 318, 319, 320, 410, 500, 501,
+ 502, 592, 321, 411, 503, 593, 273, 365,
+ 455, 456, 457, 547, 637, 274, 366, 458,
+ 548, 638, 639, 729, 640, 730, 549, 550,
+ 682, 683, 684, 774, 685, 775, 819, 820,
+ 594, 595, 687, 777, 865, 505, 597, 731,
+ 821, 732, 822, 864, 912, 911, 1001, 1002,
+ 414, 416, 502, 504, 506, 508, 592, 594,
+ 596, 598, 684, 686, 412, 500, 682, 415,
+ 417, 503, 505, 507, 509, 593, 595, 597,
+ 599, 685, 687, 459, 461, 547, 549, 551,
+ 553, 637, 639, 641, 643, 729, 731, 457,
+ 460, 462, 548, 550, 552, 554, 638, 640,
+ 642, 644, 730, 732, 733, 819, 821, 734,
+ 820, 822, 416, 418, 504, 506, 508, 510,
+ 594, 596, 598, 600, 686, 688, 417, 419,
+ 505, 507, 509, 511, 595, 597, 599, 601,
+ 687, 689, 421, 513, 603, 691, 461, 463,
+ 549, 551, 553, 555, 639, 641, 643, 645,
+ 731, 733, 462, 464, 550, 552, 554, 556,
+ 640, 642, 644, 646, 732, 734, 466, 558,
+ 648, 736, 729, 735, 821, 823, 730, 822,
+ 824, 738, 826, 420, 422, 508, 510, 512,
+ 514, 598, 600, 602, 604, 690, 692, 418,
+ 506, 596, 688, 421, 423, 509, 511, 513,
+ 515, 599, 601, 603, 605, 691, 693, 465,
+ 467, 553, 555, 557, 559, 643, 645, 647,
+ 649, 735, 737, 463, 551, 641, 733, 466,
+ 468, 554, 556, 558, 560, 644, 646, 648,
+ 650, 736, 738, 739, 825, 827, 731, 823,
+ 734, 740, 826, 828, 422, 424, 510, 512,
+ 514, 516, 600, 602, 604, 606, 692, 694,
+ 423, 425, 511, 513, 515, 517, 601, 603,
+ 605, 607, 693, 695, 427, 519, 609, 697,
+ 467, 469, 555, 557, 559, 561, 645, 647,
+ 649, 651, 737, 739, 468, 470, 556, 558,
+ 560, 562, 646, 648, 650, 652, 738, 740,
+ 472, 564, 654, 742, 735, 741, 827, 829,
+ 736, 828, 830, 744, 832, 426, 428, 514,
+ 516, 518, 520, 604, 606, 608, 610, 696,
+ 698, 424, 512, 602, 694, 427, 429, 515,
+ 517, 519, 521, 605, 607, 609, 611, 697,
+ 699, 471, 473, 559, 561, 563, 565, 649,
+ 651, 653, 655, 741, 743, 469, 557, 647,
+ 739, 472, 474, 560, 562, 564, 566, 650,
+ 652, 654, 656, 742, 744, 745, 833, 737,
+ 829, 740, 746, 832, 834, 428, 430, 516,
+ 518, 520, 522, 606, 608, 610, 612, 698,
+ 700, 429, 431, 517, 519, 521, 523, 607,
+ 609, 611, 613, 699, 701, 433, 525, 615,
+ 703, 473, 475, 561, 563, 565, 651, 653,
+ 655, 657, 743, 745, 474, 476, 562, 564,
+ 566, 568, 652, 654, 656, 658, 744, 746,
+ 570, 660, 748, 741, 747, 833, 835, 742,
+ 834, 836, 750, 838, 432, 434, 520, 522,
+ 524, 610, 612, 614, 616, 702, 704, 430,
+ 518, 608, 700, 433, 435, 521, 523, 525,
+ 527, 611, 613, 615, 703, 477, 479, 565,
+ 571, 655, 657, 659, 661, 747, 749, 475,
+ 563, 653, 745, 480, 566, 568, 570, 656,
+ 658, 660, 748, 750, 839, 743, 835, 746,
+ 752, 838, 840, 434, 436, 522, 524, 528,
+ 612, 614, 616, 704, 706, 435, 437, 523,
+ 525, 527, 613, 615, 707, 439, 531, 621,
+ 479, 481, 571, 573, 657, 659, 661, 663,
+ 749, 480, 482, 568, 570, 574, 658, 660,
+ 750, 752, 484, 576, 747, 753, 839, 748,
+ 840, 842, 756, 844, 702, 792, 794, 796,
+ 798, 886, 703, 793, 795, 799, 885, 711,
+ 838, 932, 846, 440, 442, 528, 530, 620,
+ 622, 624, 712, 443, 531, 533, 535, 621,
+ 623, 711, 715, 485, 573, 575, 577, 579,
+ 663, 665, 669, 755, 757, 488, 574, 576,
+ 578, 580, 756, 758, 490, 753, 846, 762,
+ 850, 444, 446, 536, 628, 447, 629, 489,
+ 491, 671, 849, 446, 448, 536, 624, 628,
+ 718, 447, 535, 629, 719, 491, 579, 669,
+ 671, 402, 490, 578, 580, 762, 853, 594,
+ 596, 682, 684, 686, 688, 774, 776, 778,
+ 864, 866, 592, 595, 597, 683, 685, 687,
+ 689, 775, 777, 779, 865, 867, 504, 506,
+ 598, 502, 505, 507, 593, 599, 639, 641,
+ 729, 731, 733, 819, 821, 823, 911, 637,
+ 640, 642, 730, 732, 734, 820, 822, 824,
+ 912, 868, 956, 869, 957, 913, 1001, 914,
+ 1002, 1003, 1004, 596, 598, 684, 686, 688,
+ 690, 774, 776, 778, 780, 866, 868, 597,
+ 599, 685, 687, 689, 691, 775, 777, 779,
+ 781, 867, 869, 601, 693, 783, 871, 506,
+ 508, 594, 600, 507, 509, 595, 511, 603,
+ 641, 643, 729, 731, 733, 735, 819, 821,
+ 823, 825, 911, 913, 642, 644, 730, 732,
+ 734, 736, 820, 822, 824, 826, 912, 914,
+ 646, 738, 828, 916, 600, 602, 688, 690,
+ 692, 694, 778, 780, 782, 784, 870, 872,
+ 598, 686, 776, 868, 601, 603, 689, 691,
+ 693, 695, 779, 781, 783, 785, 871, 873,
+ 510, 512, 604, 508, 596, 511, 513, 599,
+ 605, 645, 647, 733, 735, 737, 739, 823,
+ 825, 827, 829, 915, 917, 643, 731, 821,
+ 913, 646, 648, 734, 736, 738, 740, 824,
+ 826, 828, 830, 916, 918, 602, 604, 690,
+ 692, 694, 696, 780, 782, 784, 786, 872,
+ 874, 603, 605, 691, 693, 695, 697, 781,
+ 783, 785, 787, 873, 875, 607, 699, 789,
+ 877, 512, 514, 600, 606, 513, 515, 601,
+ 517, 609, 647, 649, 735, 737, 739, 741,
+ 825, 827, 829, 917, 919, 648, 650, 736,
+ 738, 740, 742, 826, 828, 830, 832, 918,
+ 920, 652, 744, 834, 606, 608, 694, 696,
+ 698, 700, 784, 786, 788, 790, 876, 878,
+ 604, 692, 782, 874, 607, 609, 695, 697,
+ 699, 701, 785, 787, 789, 791, 877, 879,
+ 516, 518, 610, 514, 602, 517, 519, 605,
+ 611, 651, 653, 739, 741, 743, 745, 829,
+ 833, 835, 921, 923, 649, 737, 827, 919,
+ 652, 654, 740, 742, 744, 746, 830, 832,
+ 834, 836, 924, 608, 610, 696, 698, 700,
+ 702, 786, 788, 790, 792, 878, 880, 609,
+ 611, 697, 699, 701, 703, 787, 789, 791,
+ 793, 879, 881, 613, 795, 883, 518, 520,
+ 606, 612, 519, 521, 607, 523, 615, 653,
+ 655, 741, 743, 745, 747, 833, 835, 923,
+ 654, 656, 742, 744, 746, 748, 832, 834,
+ 836, 838, 924, 926, 658, 750, 840, 928,
+ 612, 614, 700, 702, 704, 706, 790, 792,
+ 794, 796, 610, 698, 788, 880, 613, 615,
+ 701, 703, 707, 791, 793, 795, 883, 885,
+ 522, 524, 616, 520, 608, 523, 525, 611,
+ 657, 659, 745, 747, 749, 835, 839, 927,
+ 655, 743, 833, 658, 660, 746, 748, 750,
+ 752, 836, 838, 840, 842, 928, 620, 706,
+ 712, 796, 798, 888, 616, 704, 794, 886,
+ 621, 707, 711, 799, 803, 891, 528, 530,
+ 622, 614, 531, 623, 663, 665, 753, 755,
+ 757, 661, 749, 839, 752, 756, 758, 842,
+ 844, 846, 892, 715, 805, 624, 533, 535,
+ 849, 850, 762, 978, 980, 976, 979, 981,
+ 1021, 1023, 1113, 927, 1019, 1111, 932, 1024,
+ 624, 712, 718, 806, 894, 622, 892, 715,
+ 719, 803, 805, 809, 536, 628, 620, 535,
+ 623, 629, 669, 671, 757, 849, 853, 755,
+ 758, 762, 850, 942, 984, 1031, 1121, 1023,
+ 1078, 980, 1075, 891, 981, 1211, 1113, 1168,
+ 798, 888, 711, 799, 665, 753, 756, 844,
+ 846, 1021, 932, 1024, 978, 1160, 979, 1071,
+ 1111, 1112, 592, 682, 684, 774, 776, 864,
+ 866, 593, 683, 685, 775, 777, 865, 867,
+ 637, 729, 819, 821, 911, 638, 730, 820,
+ 822, 912, 1001, 1002, 914, 1004, 956, 1046,
+ 957, 1047, 500, 501, 639, 640, 1003, 1093,
+ 1094, 959, 1049, 958, 1048, 868, 869, 1183,
+ 1184, 1138, 1139, 1228, 1229, 1185, 1275, 1365,
+ 1186, 1276, 1366, 1230, 1320, 1410, 1231, 1321,
+ 1411, 1547, 1458, 1548, 686, 688, 774, 776,
+ 778, 780, 864, 866, 868, 870, 956, 958,
+ 687, 689, 775, 777, 779, 781, 865, 867,
+ 869, 871, 957, 959, 691, 783, 873, 961,
+ 731, 733, 819, 821, 823, 825, 911, 913,
+ 915, 1001, 1003, 732, 734, 820, 822, 824,
+ 826, 912, 914, 916, 1002, 1004, 736, 828,
+ 918, 1006, 1005, 1093, 1094, 1008, 1096, 690,
+ 692, 778, 780, 782, 784, 868, 870, 872,
+ 874, 960, 962, 688, 776, 866, 958, 691,
+ 693, 779, 781, 783, 785, 869, 871, 873,
+ 875, 961, 963, 735, 737, 823, 825, 827,
+ 829, 913, 915, 917, 919, 1005, 1007, 733,
+ 821, 911, 1003, 736, 738, 824, 826, 828,
+ 830, 914, 916, 918, 920, 1006, 1008, 1009,
+ 1095, 1001, 1093, 1004, 1010, 1096, 1098, 692,
+ 694, 780, 782, 784, 786, 870, 872, 874,
+ 876, 962, 964, 693, 695, 781, 783, 785,
+ 787, 871, 873, 875, 877, 963, 965, 697,
+ 789, 879, 737, 739, 825, 827, 829, 915,
+ 917, 919, 921, 1007, 1009, 738, 740, 826,
+ 828, 830, 832, 916, 918, 920, 1008, 1010,
+ 742, 834, 924, 1012, 1005, 1011, 1006, 1098,
+ 1100, 1102, 696, 698, 784, 786, 788, 790,
+ 874, 876, 878, 880, 966, 968, 694, 782,
+ 872, 964, 697, 699, 785, 787, 789, 791,
+ 875, 877, 879, 881, 969, 741, 743, 829,
+ 833, 835, 919, 921, 923, 1011, 1013, 739,
+ 827, 917, 1009, 742, 744, 830, 832, 834,
+ 836, 920, 924, 926, 1012, 1015, 1101, 1103,
+ 1007, 1010, 1016, 1102, 1104, 698, 700, 786,
+ 788, 790, 792, 876, 878, 880, 968, 970,
+ 699, 701, 787, 789, 791, 793, 877, 879,
+ 881, 883, 969, 971, 703, 795, 885, 973,
+ 743, 745, 833, 835, 921, 923, 927, 1013,
+ 1015, 744, 746, 832, 834, 836, 838, 924,
+ 926, 928, 1016, 748, 840, 1018, 1011, 1017,
+ 1103, 1105, 1012, 1104, 1108, 702, 704, 790,
+ 792, 794, 796, 880, 886, 972, 974, 700,
+ 788, 878, 970, 703, 791, 793, 795, 881,
+ 883, 885, 973, 975, 747, 749, 835, 839,
+ 927, 1017, 1019, 745, 833, 923, 1015, 748,
+ 750, 836, 838, 840, 842, 926, 928, 932,
+ 1018, 1021, 1013, 1105, 1016, 1108, 976, 1060,
+ 1066, 968, 1058, 971, 977, 1063, 1155, 1111,
+ 1197, 1103, 1112, 1200, 704, 706, 792, 794,
+ 796, 798, 886, 888, 974, 976, 707, 793,
+ 795, 799, 883, 885, 975, 977, 891, 979,
+ 749, 839, 927, 1019, 1021, 750, 752, 838,
+ 840, 842, 844, 928, 932, 846, 1024, 1017,
+ 1023, 1111, 1018, 1112, 972, 978, 1066, 1156,
+ 973, 1063, 1155, 1157, 981, 1071, 1159, 1113,
+ 1201, 1108, 1200, 866, 868, 956, 958, 960,
+ 1046, 1048, 1050, 1138, 867, 869, 957, 959,
+ 961, 1047, 1049, 1051, 1139, 871, 963, 1053,
+ 1141, 776, 778, 864, 870, 777, 779, 865,
+ 781, 873, 911, 913, 1001, 1003, 1005, 1093,
+ 1095, 1183, 912, 914, 1002, 1004, 1006, 1094,
+ 1096, 1184, 916, 1008, 1098, 1186, 1140, 1228,
+ 1229, 1231, 1185, 1188, 1276, 1275, 1278, 1366,
+ 870, 872, 958, 960, 962, 964, 1048, 1050,
+ 1052, 1054, 1140, 1142, 868, 956, 1046, 1138,
+ 871, 873, 959, 961, 963, 965, 1049, 1051,
+ 1053, 1055, 1141, 780, 782, 874, 778, 866,
+ 781, 783, 869, 875, 915, 917, 1003, 1005,
+ 1007, 1009, 1093, 1095, 1185, 913, 1001, 1183,
+ 916, 918, 1004, 1006, 1008, 1010, 1094, 1096,
+ 1098, 1100, 1186, 1188, 872, 874, 960, 962,
+ 964, 966, 1050, 1052, 1054, 1056, 1142, 1144,
+ 873, 875, 961, 963, 965, 1051, 1053, 1055,
+ 1057, 1145, 877, 969, 1059, 1147, 782, 784,
+ 870, 876, 783, 785, 871, 787, 879, 917,
+ 919, 1005, 1007, 1009, 1011, 1095, 1101, 1189,
+ 918, 920, 1006, 1008, 1010, 1012, 1096, 1098,
+ 1100, 1102, 1188, 1190, 1104, 876, 878, 964,
+ 966, 968, 970, 1054, 1056, 1058, 1060, 1146,
+ 1148, 874, 962, 1052, 1144, 877, 879, 965,
+ 969, 971, 1055, 1057, 1059, 1147, 786, 788,
+ 880, 784, 872, 787, 789, 875, 881, 921,
+ 923, 1009, 1011, 1013, 1015, 1101, 1103, 1105,
+ 1191, 1193, 919, 1007, 1189, 924, 1010, 1012,
+ 1016, 1100, 1102, 1104, 878, 880, 966, 968,
+ 970, 972, 1056, 1058, 1060, 1148, 879, 881,
+ 969, 971, 973, 1057, 1059, 1063, 1151, 883,
+ 975, 788, 790, 876, 789, 791, 877, 793,
+ 885, 923, 1011, 1013, 1015, 1017, 1101, 1103,
+ 1105, 1193, 924, 926, 1012, 1016, 1018, 1102,
+ 1104, 1108, 928, 1146, 1238, 1240, 1147, 1241,
+ 1155, 1243, 1191, 1197, 1283, 1285, 1284, 1200,
+ 1281, 1375, 1282, 1376, 1290, 888, 976, 978,
+ 980, 1066, 1158, 1160, 886, 974, 1156, 891,
+ 977, 979, 981, 1071, 1159, 798, 892, 796,
+ 799, 1021, 1023, 1111, 1113, 1019, 1201, 1024,
+ 1112, 1248, 1157, 1249, 1291, 1200, 1294, 1384,
+ 1386, 1289, 864, 866, 956, 1046, 1048, 1138,
+ 865, 867, 957, 1047, 1049, 1139, 819, 911,
+ 1001, 1003, 1093, 1183, 820, 912, 1002, 1004,
+ 1094, 1184, 1185, 1275, 1186, 1276, 1095, 1096,
+ 1228, 1230, 1320, 1229, 1231, 1321, 1365, 1366,
+ 1140, 1141, 1323, 1411, 1051, 1277, 1367, 1278,
+ 1142, 1232, 1234, 1322, 1410, 1412, 1413, 1050,
+ 1052, 1144, 1053, 1145, 1279, 1369, 1188, 1370,
+ 1458, 1547, 1548, 960, 962, 1048, 1050, 1052,
+ 1054, 1138, 1140, 1142, 1144, 1230, 1232, 958,
+ 1046, 1228, 961, 963, 1049, 1051, 1053, 1055,
+ 1139, 1141, 1145, 1231, 1005, 1007, 1093, 1095,
+ 1183, 1185, 1189, 1275, 1277, 1003, 1006, 1008,
+ 1094, 1096, 1098, 1100, 1184, 1186, 1188, 1190,
+ 1276, 1278, 1279, 1365, 1367, 1366, 962, 964,
+ 1050, 1052, 1054, 1056, 1140, 1142, 1144, 1146,
+ 1232, 1234, 963, 965, 1051, 1053, 1055, 1057,
+ 1141, 1145, 1147, 1059, 1237, 1007, 1009, 1095,
+ 1101, 1185, 1189, 1191, 1277, 1279, 1008, 1010,
+ 1096, 1098, 1100, 1102, 1186, 1188, 1190, 1278,
+ 1012, 1104, 1282, 1275, 1281, 1367, 1369, 1276,
+ 1370, 1284, 1372, 966, 968, 1054, 1056, 1058,
+ 1060, 1144, 1146, 1148, 1236, 1238, 964, 1052,
+ 1142, 1234, 969, 1055, 1057, 1059, 1145, 1147,
+ 1151, 1237, 1011, 1013, 1101, 1103, 1105, 1189,
+ 1191, 1193, 1281, 1283, 1009, 1279, 1012, 1100,
+ 1102, 1104, 1190, 1282, 1284, 1285, 1371, 1277,
+ 1369, 1372, 970, 972, 974, 976, 1058, 1060,
+ 1066, 1148, 1156, 1158, 1240, 1242, 1244, 973,
+ 975, 1063, 1151, 1155, 1157, 1243, 1245, 1017,
+ 1019, 1105, 1111, 1197, 1201, 1289, 1015, 1103,
+ 1193, 1285, 1018, 1108, 1112, 1200, 1290, 1291,
+ 1379, 1283, 1375, 977, 1159, 979, 1071, 1249,
+ 1021, 1113, 1024, 1294, 1384, 980, 1158, 1160,
+ 1252, 981, 1071, 1075, 1159, 1023, 1111, 1113,
+ 1121, 1201, 1211, 1024, 1112, 1294, 1384, 1386,
+ 846, 850, 942, 1480, 1291, 894, 984, 1078,
+ 1168, 1344, 892, 1342, 1031, 1248, 1432, 1249,
+ 1337, 1345, 1429, 1433, 1521, 1157, 1289, 1379,
+ 1471, 1565, 1569, 1156, 1242, 1244, 1424, 1155,
+ 1243, 1245, 1333, 1066, 1200, 1290, 1608, 1514,
+ 1566, 1562, 1142, 1144, 1230, 1232, 1234, 1236,
+ 1320, 1322, 1326, 1412, 1414, 1145, 1231, 1237,
+ 1321, 1323, 1413, 1415, 1147, 1329, 1417, 1052,
+ 1054, 1140, 1146, 1053, 1055, 1141, 1057, 1189,
+ 1275, 1277, 1279, 1281, 1365, 1367, 1369, 1371,
+ 1459, 1188, 1190, 1276, 1278, 1282, 1366, 1370,
+ 1372, 1458, 1460, 1284, 1410, 1502, 1411, 1419,
+ 1461, 1547, 1548, 1550, 1464, 1552, 1639, 1554,
+ 1146, 1148, 1234, 1236, 1238, 1240, 1326, 1328,
+ 1330, 1418, 1144, 1232, 1322, 1414, 1147, 1237,
+ 1241, 1329, 1331, 1417, 1419, 1056, 1058, 1054,
+ 1142, 1057, 1059, 1145, 1151, 1191, 1193, 1279,
+ 1281, 1283, 1285, 1369, 1371, 1375, 1461, 1463,
+ 1189, 1277, 1367, 1459, 1282, 1284, 1370, 1372,
+ 1376, 1464, 1242, 1420, 1243, 1333, 1421, 1245,
+ 1060, 1063, 1155, 1290, 1240, 1242, 1244, 1330,
+ 1424, 1238, 1328, 1420, 1155, 1241, 1243, 1245,
+ 1331, 1333, 1337, 1156, 1060, 1148, 1063, 1151,
+ 1157, 1197, 1285, 1289, 1291, 1375, 1379, 1283,
+ 1200, 1290, 1376, 1512, 1514, 1418, 1510, 1421,
+ 1471, 1463, 1555, 1384, 1464, 1556, 1562, 1648,
+ 1650, 1645, 1554, 1078, 1168, 1252, 1342, 1344,
+ 1345, 1529, 1075, 1121, 1211, 1480, 1138, 1228,
+ 1230, 1320, 1322, 1410, 1412, 1139, 1229, 1231,
+ 1321, 1323, 1411, 1413, 1183, 1275, 1365, 1367,
+ 1184, 1276, 1366, 1458, 1547, 1548, 1460, 1550,
+ 1232, 1414, 1502, 1415, 1277, 1369, 1459, 1278,
+ 1370, 956, 1046, 1047, 1048, 1592, 957, 1049,
+ 1593, 864, 865, 1001, 1002, 1003, 1093, 1185,
+ 1004, 1094, 1186, 1730, 1639, 1684, 1774, 1595,
+ 1685, 1821, 1822, 1912, 1236, 1238, 1326, 1328,
+ 1330, 1414, 1418, 1420, 1506, 1234, 1322, 1412,
+ 1237, 1329, 1331, 1415, 1417, 1419, 1421, 1509,
+ 1281, 1283, 1369, 1371, 1375, 1459, 1461, 1463,
+ 1279, 1367, 1282, 1284, 1370, 1372, 1376, 1460,
+ 1464, 1552, 1554, 1555, 1641, 1643, 1547, 1639,
+ 1550, 1556, 1644, 1240, 1510, 1241, 1333, 1243,
+ 1285, 1645, 1648, 1596, 1600, 1688, 1502, 1592,
+ 1684, 1595, 1597, 1599, 1731, 1734, 1244, 1424,
+ 1514, 1245, 1333, 1337, 1429, 1249, 1289, 1291,
+ 1379, 1471, 1200, 1290, 1294, 1376, 1384, 1386,
+ 1562, 1650, 1566, 1252, 1342, 1344, 1432, 1345,
+ 1429, 1433, 1521, 1525, 1471, 1565, 1569, 1384,
+ 1386, 1480, 1566, 1211, 1659, 1662, 1168, 1616,
+ 1529, 1751, 1608, 1704, 1792, 1611, 1746, 1791,
+ 1793, 1885, 1836, 1926, 1827, 1919, 1917, 1876,
+ 1966, 1843, 1886, 1228, 1320, 1410, 1412, 1502,
+ 1592, 1230, 1229, 1321, 1411, 1413, 1593, 1138,
+ 1231, 1275, 1365, 1367, 1547, 1639, 1183, 1276,
+ 1366, 1458, 1548, 1550, 1595, 1322, 1414, 1323,
+ 1415, 1506, 1596, 1684, 1597, 1685, 1417, 1509,
+ 1599, 1419, 1459, 1641, 1460, 1552, 1730, 1554,
+ 1644, 1774, 1731, 1821, 1184, 1822, 1912, 1866,
+ 1956, 1867, 1777, 1734, 1823, 1600, 1688, 1690,
+ 1776, 1778, 1643, 1645, 1825, 1418, 1420, 1506,
+ 1510, 1512, 1596, 1600, 1602, 1688, 1690, 1419,
+ 1421, 1509, 1597, 1599, 1603, 1693, 1328, 1330,
+ 1329, 1331, 1417, 1333, 1463, 1555, 1641, 1643,
+ 1645, 1464, 1552, 1554, 1556, 1644, 1648, 1734,
+ 1650, 1424, 1514, 1243, 1245, 1337, 1429, 1379,
+ 1471, 1827, 1562, 1424, 1512, 1514, 1602, 1608,
+ 1337, 1429, 1521, 1603, 1611, 1693, 1785, 1245,
+ 1333, 1421, 1379, 1471, 1555, 1565, 1645, 1562,
+ 1648, 1650, 1566, 1600, 1690, 1876, 1791, 1825,
+ 1827, 1917, 1919, 1746, 1836, 1926, 1966, 1965,
+ 1793, 1608, 1514, 1429, 1521, 1611, 1248, 1342,
+ 1424, 1432, 1512, 1433, 1565, 1471, 1562, 1566,
+ 1746, 1616, 1525, 1529, 1344, 1432, 1569, 1659,
+ 1751, 1843, 1662, 1704, 1799, 1792, 1611, 1793,
+ 1885, 1746, 1836, 1886, 1791, 1926, 1510, 1596,
+ 1600, 1602, 1688, 1690, 1778, 1509, 1597, 1599,
+ 1603, 1693, 1781, 1555, 1641, 1643, 1645, 1731,
+ 1823, 1825, 1554, 1556, 1644, 1648, 1734, 1650,
+ 1821, 1827, 1822, 1512, 1514, 1785, 1917, 1919,
+ 1776, 1866, 1868, 1958, 1960, 1777, 1867, 1869,
+ 1959, 2005, 1912, 1876, 1966, 1965, 1836, 1926,
+ 1502, 1592, 1684, 1774, 1776, 1866, 1411, 1593,
+ 1595, 1685, 1777, 1867, 1410, 1547, 1639, 1641,
+ 1731, 1821, 1548, 1550, 1730, 1822, 1912, 1823,
+ 1869, 1597, 1688, 1778, 1868, 1956, 1958, 1781,
+ 1959, 1596, 1690, 1599, 1825, 1734, 1776, 1778,
+ 1866, 1868, 1956, 1958, 1960, 1774, 1777, 1867,
+ 1869, 1959, 1731, 1821, 1823, 1825, 1917, 2005,
+ 1822, 1912, 1781, 1693, 1785, 1965, 1734, 1648,
+ 1868, 1876, 1958, 1960, 1966, 1785, 1965, 1827,
+ 1917, 1919, 2005, 1825, 1644, 1648, 1650, 1734,
+ 1746, 1822, 1836, 1912, 1926, 1792, 1876, 1966,
+ 1791, 1793, 1885, 1965, 1917, 1919, 1836, 1926,
+};
+
+static long _vq_fitmap_res_Zc_8[] = {
+ 0, 0, 0, 59, 59, 123, 123, 187,
+ 187, 250, 250, 313, 313, 376, 376, 436,
+ 436, 499, 564, 629, 694, 759, 824, 889,
+ 952, 1014, 1076, 1140, 1203, 376, 1265, 436,
+ 1306, 1365, 1430, 1495, 1560, 1625, 1690, 1751,
+ 1810, 1868, 1928, 1985, 1985, 1265, 1265, 2043,
+ 2105, 2169, 2234, 2299, 2364, 2429, 2491, 2549,
+ 2600, 2666, 2666, 2730, 2762, 2762, 2043, 2816,
+ 2874, 2939, 3004, 3069, 3133, 3196, 3251, 2600,
+ 3315, 3315, 3363, 2762, 2762, 2762, 3383, 3443,
+ 3508, 3573, 3636, 3699, 3760, 3251, 3814, 3814,
+ 3872, 3872, 2762, 2762, 3930, 3383, 3996, 4055,
+ 4119, 4178, 4237, 4293, 4356, 3814, 3872, 3872,
+ 3872, 3930, 3930, 3930, 3930, 4411, 4472, 4532,
+ 4589, 4644, 4293, 4356, 4709, 3872, 3872, 3872,
+ 3930, 3930, 4746, 4746, 4411, 4811, 4862, 4915,
+ 4644, 4962, 4962, 4709, 5013, 5013, 5013, 3930,
+ 3930, 4746, 4746, 4746, 4746, 5074, 5136, 5136,
+ 5196, 5013, 5013, 5013, 5013, 5243, 3930, 4746,
+ 4746, 4746, 5254, 5254, 5074, 5316, 5316, 5196,
+ 5382, 5013, 5403, 5403, 5403, 5254, 5254, 5254,
+ 5443, 5443, 5443, 5443, 5316, 5509, 5509, 5555,
+ 5593, 5403, 5403, 5609, 5254, 5254, 5254, 5443,
+ 5443, 5443, 5443, 5443, 5630, 5630, 5555, 5403,
+ 5403, 5609, 5609, 5254, 5254, 5443, 5443, 5680,
+ 5680, 5680, 5680, 5630, 5630, 5555, 5403, 5403,
+ 5609, 5609, 5443, 5443, 5443, 5443, 5680, 5680,
+ 5680, 5718, 5718, 5744, 5555, 5765, 5403, 5609,
+ 5609,
+};
+
+static long _vq_fitlength_res_Zc_8[] = {
+ 59, 59, 59, 64, 64, 64, 64, 63,
+ 63, 63, 63, 63, 63, 60, 60, 63,
+ 63, 65, 65, 65, 65, 65, 65, 63,
+ 62, 62, 64, 63, 62, 60, 41, 63,
+ 59, 65, 65, 65, 65, 65, 61, 59,
+ 58, 60, 57, 58, 58, 41, 41, 62,
+ 64, 65, 65, 65, 65, 62, 58, 51,
+ 66, 64, 64, 32, 54, 54, 62, 58,
+ 65, 65, 65, 64, 63, 55, 64, 66,
+ 48, 48, 20, 54, 54, 54, 60, 65,
+ 65, 63, 63, 61, 54, 64, 58, 58,
+ 58, 58, 54, 54, 66, 60, 59, 64,
+ 59, 59, 56, 63, 55, 58, 58, 58,
+ 58, 66, 66, 66, 66, 61, 60, 57,
+ 55, 65, 63, 55, 37, 58, 58, 58,
+ 66, 66, 65, 65, 61, 51, 53, 47,
+ 65, 51, 51, 37, 61, 61, 61, 66,
+ 66, 65, 65, 65, 65, 62, 60, 60,
+ 47, 61, 61, 61, 61, 11, 66, 65,
+ 65, 65, 62, 62, 62, 66, 66, 47,
+ 21, 61, 40, 40, 40, 62, 62, 62,
+ 66, 66, 66, 66, 66, 46, 46, 38,
+ 16, 40, 40, 21, 62, 62, 62, 66,
+ 66, 66, 66, 66, 50, 50, 38, 40,
+ 40, 21, 21, 62, 62, 66, 66, 38,
+ 38, 38, 38, 50, 50, 38, 40, 40,
+ 21, 21, 66, 66, 66, 66, 38, 38,
+ 38, 26, 26, 21, 38, 11, 40, 21,
+ 21,
+};
+
+static encode_aux_pigeonhole _vq_auxp_res_Zc_8 = {
+ -22, 1, 44, 15,
+ _vq_pigeonmap_res_Zc_8,
+ 5776,
+ _vq_fitlist_res_Zc_8,
+ _vq_fitmap_res_Zc_8,
+ _vq_fitlength_res_Zc_8
+};
+
+static static_codebook _vq_book_res_Zc_8 = {
+ 2, 2025,
+ _vq_lengthlist_res_Zc_8,
+ 1, -527040512, 1611661312, 6, 0,
+ _vq_quantlist_res_Zc_8,
+ NULL,
+ &_vq_auxt_res_Zc_8,
+ &_vq_auxp_res_Zc_8,
+ 0
+};
+
+
+#endif
diff --git a/lib/books/res_Zc_9.vqh b/lib/books/res_Zc_9.vqh
new file mode 100644
index 00000000..83ba2c00
--- /dev/null
+++ b/lib/books/res_Zc_9.vqh
@@ -0,0 +1,99 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
+ * THE GNU LESSER/LIBRARY PUBLIC LICENSE, WHICH IS INCLUDED WITH *
+ * THIS SOURCE. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+ * *
+ * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 *
+ * by the XIPHOPHORUS Company, http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: static codebook autogenerated by vq/somethingorother
+
+ ********************************************************************/
+
+#ifndef _V_res_Zc_9_VQH_
+#define _V_res_Zc_9_VQH_
+#include "codebook.h"
+
+static long _vq_quantlist_res_Zc_9[] = {
+ 2,
+ 1,
+ 3,
+ 0,
+ 4,
+};
+
+static long _vq_lengthlist_res_Zc_9[] = {
+ 1, 6, 5,12,12, 7, 4, 9,11,11, 7,10, 5,11,11,11,
+ 9,11,11,11,11,11,11,11,11, 6,11,10,11,11,11,11,
+ 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
+ 11,11, 6,10,11,11,11,11,11,11,11,11,11,11,11,11,
+ 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
+ 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
+ 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
+ 11,11,11,11,11,11,11,11,11,11,11,11,11, 8,11,11,
+ 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
+ 11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,
+ 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
+ 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
+ 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
+ 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
+ 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
+ 11,11,11,11,11,11,11,11,11,11, 8,11,11,11,11,11,
+ 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
+ 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
+ 11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,
+ 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
+ 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
+ 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
+ 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
+ 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
+ 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
+ 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
+ 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
+ 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
+ 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
+ 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
+ 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
+ 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
+ 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
+ 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
+ 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
+ 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
+ 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
+ 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
+ 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
+ 11,
+};
+
+static float _vq_quantthresh_res_Zc_9[] = {
+ -100.5, -33.5, 33.5, 100.5,
+};
+
+static long _vq_quantmap_res_Zc_9[] = {
+ 3, 1, 0, 2, 4,
+};
+
+static encode_aux_threshmatch _vq_auxt_res_Zc_9 = {
+ _vq_quantthresh_res_Zc_9,
+ _vq_quantmap_res_Zc_9,
+ 5,
+ 5
+};
+
+static static_codebook _vq_book_res_Zc_9 = {
+ 4, 625,
+ _vq_lengthlist_res_Zc_9,
+ 1, -521093120, 1624293376, 3, 0,
+ _vq_quantlist_res_Zc_9,
+ NULL,
+ &_vq_auxt_res_Zc_9,
+ NULL,
+ 0
+};
+
+
+#endif
diff --git a/lib/books/res_Zc_9a.vqh b/lib/books/res_Zc_9a.vqh
new file mode 100644
index 00000000..03ea832c
--- /dev/null
+++ b/lib/books/res_Zc_9a.vqh
@@ -0,0 +1,115 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
+ * THE GNU LESSER/LIBRARY PUBLIC LICENSE, WHICH IS INCLUDED WITH *
+ * THIS SOURCE. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+ * *
+ * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 *
+ * by the XIPHOPHORUS Company, http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: static codebook autogenerated by vq/somethingorother
+
+ ********************************************************************/
+
+#ifndef _V_res_Zc_9a_VQH_
+#define _V_res_Zc_9a_VQH_
+#include "codebook.h"
+
+static long _vq_quantlist_res_Zc_9a[] = {
+ 11,
+ 10,
+ 12,
+ 9,
+ 13,
+ 8,
+ 14,
+ 7,
+ 15,
+ 6,
+ 16,
+ 5,
+ 17,
+ 4,
+ 18,
+ 3,
+ 19,
+ 2,
+ 20,
+ 1,
+ 21,
+ 0,
+ 22,
+};
+
+static long _vq_lengthlist_res_Zc_9a[] = {
+ 2, 4, 4, 6, 5, 7, 6, 7, 7, 8, 8, 9, 9, 9,10, 9,
+ 9, 9,10,10,10,10,11, 7, 5, 6, 7, 7, 8, 8, 8, 8,
+ 9, 9,10, 9,10,10, 9, 9,10,10,10,10,11,11,15, 6,
+ 4, 7, 7, 7, 8, 8, 9, 9, 9,10, 9, 9,10, 9, 9,10,
+ 9,10,10,11,12,15, 7, 7, 8, 8, 8, 9, 9, 9,10,10,
+ 10,10,11,11,10,11,10,11,11,11,12,11,14, 7, 6, 7,
+ 7, 9, 9, 9, 9,10,10,10,10,11,11,11,10,10,10,11,
+ 10,11,12,15, 9, 9, 7, 8, 9, 9,10,10,10,10,11,11,
+ 11,12,12,12,10,12,11,12,13,12,15,14,14, 7, 6, 9,
+ 9, 9,10,10,10,11,11,11,11,10,11,10,12,11,13,12,
+ 12,14,14,14, 8, 9,10,10,11,10,10,10,11,10,12,12,
+ 12,12,12,12,12,13,13,12,14,14,14, 8, 8, 9, 9,11,
+ 10,11,11,12,11,12,12,11,12,12,12,13,14,13,12,14,
+ 14,14,14,13,11,10,12,10,11,13,13,11,11,11,12,11,
+ 12,11,14,12,14,13,14,14,14,14,14, 9, 9,11,10,10,
+ 11,12,11,13,12,12,12,12,13,14,12,14,14,14,14,14,
+ 14,14,12, 9,11,10,13,11,12,12,13,11,13,11,13,13,
+ 14,12,14,13,14,14,14,14,14, 9,11,10,10,11,11,11,
+ 11,11,13,12,12,13,13,12,13,13,13,14,14,14,14,14,
+ 12,12,10,10,11,12,13,12,12,11,12,12,12,13,14,12,
+ 13,13,14,14,14,14,14,14,14,12, 9,10,12,12,13,11,
+ 13,12,12,13,13,13,13,13,14,14,14,14,14,14,14,14,
+ 9,12, 8,11,13,11,13,12,11,12,13,12,13,13,13,12,
+ 14,14,14,14,14,14,14,13,10,10,13,11,12,12,14,13,
+ 13,13,13,12,14,13,13,14,14,14,14,14,14,13,13,11,
+ 9,11, 9,11,12,13,12,13,13,13,13,13,13,13,13,14,
+ 14,14,14,14,14,14,13,12,13,11,11,13,13,12,13,12,
+ 13,13,13,13,14,14,14,14,14,13,14,13,14,13,13,13,
+ 10,14,11,12,13,12,13,13,13,14,13,13,14,14,14,14,
+ 13,14,14,14,14,12,13,13,11,12,14,13,13,13,13,13,
+ 14,14,13,14,14,14,14,14,14,13,14,13,13,13,11,12,
+ 12,14,13,14,13,13,12,14,13,13,14,14,13,14,14,14,
+ 14,14,14,14,14,12,13,14,12,13,13,13,13,13,14,13,
+ 14,
+};
+
+static float _vq_quantthresh_res_Zc_9a[] = {
+ -31.5, -28.5, -25.5, -22.5, -19.5, -16.5, -13.5, -10.5,
+ -7.5, -4.5, -1.5, 1.5, 4.5, 7.5, 10.5, 13.5,
+ 16.5, 19.5, 22.5, 25.5, 28.5, 31.5,
+};
+
+static long _vq_quantmap_res_Zc_9a[] = {
+ 21, 19, 17, 15, 13, 11, 9, 7,
+ 5, 3, 1, 0, 2, 4, 6, 8,
+ 10, 12, 14, 16, 18, 20, 22,
+};
+
+static encode_aux_threshmatch _vq_auxt_res_Zc_9a = {
+ _vq_quantthresh_res_Zc_9a,
+ _vq_quantmap_res_Zc_9a,
+ 23,
+ 23
+};
+
+static static_codebook _vq_book_res_Zc_9a = {
+ 2, 529,
+ _vq_lengthlist_res_Zc_9a,
+ 1, -525303808, 1614282752, 5, 0,
+ _vq_quantlist_res_Zc_9a,
+ NULL,
+ &_vq_auxt_res_Zc_9a,
+ NULL,
+ 0
+};
+
+
+#endif
diff --git a/lib/books/res_Zc_9b.vqh b/lib/books/res_Zc_9b.vqh
new file mode 100644
index 00000000..a1006da8
--- /dev/null
+++ b/lib/books/res_Zc_9b.vqh
@@ -0,0 +1,63 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
+ * THE GNU LESSER/LIBRARY PUBLIC LICENSE, WHICH IS INCLUDED WITH *
+ * THIS SOURCE. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+ * *
+ * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 *
+ * by the XIPHOPHORUS Company, http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: static codebook autogenerated by vq/somethingorother
+
+ ********************************************************************/
+
+#ifndef _V_res_Zc_9b_VQH_
+#define _V_res_Zc_9b_VQH_
+#include "codebook.h"
+
+static long _vq_quantlist_res_Zc_9b[] = {
+ 1,
+ 0,
+ 2,
+};
+
+static long _vq_lengthlist_res_Zc_9b[] = {
+ 3, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 7,
+ 6, 7, 6, 6, 6, 7, 6, 7, 7, 6, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 6, 6, 6, 7, 6, 7, 7, 7, 7, 6, 6, 7,
+ 7, 7, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 7, 7, 6,
+ 7, 7, 7, 7, 7, 7, 7, 6, 6, 7, 6, 6, 7, 7, 7, 6,
+ 7,
+};
+
+static float _vq_quantthresh_res_Zc_9b[] = {
+ -0.5, 0.5,
+};
+
+static long _vq_quantmap_res_Zc_9b[] = {
+ 1, 0, 2,
+};
+
+static encode_aux_threshmatch _vq_auxt_res_Zc_9b = {
+ _vq_quantthresh_res_Zc_9b,
+ _vq_quantmap_res_Zc_9b,
+ 3,
+ 3
+};
+
+static static_codebook _vq_book_res_Zc_9b = {
+ 4, 81,
+ _vq_lengthlist_res_Zc_9b,
+ 1, -535822336, 1611661312, 2, 0,
+ _vq_quantlist_res_Zc_9b,
+ NULL,
+ &_vq_auxt_res_Zc_9b,
+ NULL,
+ 0
+};
+
+
+#endif
diff --git a/lib/codec_internal.h b/lib/codec_internal.h
new file mode 100644
index 00000000..7894d8bb
--- /dev/null
+++ b/lib/codec_internal.h
@@ -0,0 +1,147 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+ * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+ * *
+ * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 *
+ * by the XIPHOPHORUS Company http://www.xiph.org/ *
+ ********************************************************************
+
+ function: libvorbis codec headers
+ last mod: $Id: codec_internal.h,v 1.9.4.1 2001/10/09 04:34:45 xiphmont Exp $
+
+ ********************************************************************/
+
+#ifndef _V_CODECI_H_
+#define _V_CODECI_H_
+
+#include "envelope.h"
+#include "codebook.h"
+
+typedef struct vorbis_block_internal{
+ float **pcmdelay; /* this is a pointer into local storage */
+ float ampmax;
+} vorbis_block_internal;
+
+typedef void vorbis_look_time;
+typedef void vorbis_look_mapping;
+typedef void vorbis_look_floor;
+typedef void vorbis_look_residue;
+typedef void vorbis_look_transform;
+
+/* mode ************************************************************/
+typedef struct {
+ int blockflag;
+ int windowtype;
+ int transformtype;
+ int mapping;
+} vorbis_info_mode;
+
+typedef void vorbis_info_time;
+typedef void vorbis_info_floor;
+typedef void vorbis_info_residue;
+typedef void vorbis_info_mapping;
+
+#include "psy.h"
+
+typedef struct backend_lookup_state {
+ /* local lookup storage */
+ envelope_lookup *ve; /* envelope lookup */
+ float **window[2][2][2]; /* block, leadin, leadout, type */
+ vorbis_look_transform **transform[2]; /* block, type */
+ codebook *fullbooks;
+ vorbis_look_psy_global *psy_g_look;
+
+ /* backend lookups are tied to the mode, not the backend or naked mapping */
+ int modebits;
+ vorbis_look_mapping **mode;
+
+ /* local storage, only used on the encoding side. This way the
+ application does not need to worry about freeing some packets'
+ memory and not others'; packet storage is always tracked.
+ Cleared next call to a _dsp_ function */
+ unsigned char *header;
+ unsigned char *header1;
+ unsigned char *header2;
+
+ /* encode side bitrate tracking */
+ ogg_uint32_t *bitrate_queue;
+ ogg_uint32_t *bitrate_queue_eighths;
+ int bitrate_queue_size;
+ int bitrate_queue_head;
+ int bitrate_eighths;
+
+ long bitrate_boundbitacc;
+ long bitrate_boundsampleacc;
+ long bitrate_boundtail;
+
+ long *bitrate_avgbitacc;
+ long bitrate_avgsampleacc;
+ long bitrate_avgtail;
+
+ double bitrate_floatinglimit;
+
+} backend_lookup_state;
+
+/* vorbis_info contains all the setup information specific to the
+ specific compression/decompression mode in progress (eg,
+ psychoacoustic settings, channel setup, options, codebook
+ etc).
+*********************************************************************/
+
+typedef struct codec_setup_info {
+
+ /* Vorbis supports only short and long blocks, but allows the
+ encoder to choose the sizes */
+
+ long blocksizes[2];
+
+ /* modes are the primary means of supporting on-the-fly different
+ blocksizes, different channel mappings (LR or M/A),
+ different residue backends, etc. Each mode consists of a
+ blocksize flag and a mapping (along with the mapping setup */
+
+ int modes;
+ int maps;
+ int times;
+ int floors;
+ int residues;
+ int books;
+ int psys; /* encode only */
+
+ vorbis_info_mode *mode_param[64];
+ int map_type[64];
+ vorbis_info_mapping *map_param[64];
+ int time_type[64];
+ vorbis_info_time *time_param[64];
+ int floor_type[64];
+ vorbis_info_floor *floor_param[64];
+ int residue_type[64];
+ vorbis_info_residue *residue_param[64];
+ static_codebook *book_param[256];
+
+ vorbis_info_psy *psy_param[64]; /* encode only */
+ vorbis_info_psy_global *psy_g_param;
+
+ /* detailed bitrate management setup */
+ double bitrate_floatinglimit_initial; /* set by mode */
+ double bitrate_bound_queuetime;
+ double bitrate_avg_queuetime;
+
+ double bitrate_absolute_max;
+ double bitrate_absolute_min;
+ double bitrate_queue_max;
+ double bitrate_queue_min;
+ double bitrate_queue_upperavg;
+ double bitrate_queue_loweravg;
+
+ int passlimit[32]; /* iteration limit per couple/quant pass */
+ int coupling_passes;
+} codec_setup_info;
+
+extern vorbis_look_psy_global *_vp_global_look(vorbis_info *vi);
+extern void _vp_global_free(vorbis_look_psy_global *look);
+
+#endif
diff --git a/lib/mapping0.c b/lib/mapping0.c
new file mode 100644
index 00000000..cafe943a
--- /dev/null
+++ b/lib/mapping0.c
@@ -0,0 +1,890 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+ * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+ * *
+ * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 *
+ * by the XIPHOPHORUS Company http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: channel mapping 0 implementation
+ last mod: $Id: mapping0.c,v 1.37.2.1 2001/10/09 04:34:45 xiphmont Exp $
+
+ ********************************************************************/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <math.h>
+#include <ogg/ogg.h>
+#include "vorbis/codec.h"
+#include "codec_internal.h"
+#include "codebook.h"
+#include "bitbuffer.h"
+#include "registry.h"
+#include "psy.h"
+#include "misc.h"
+
+/* simplistic, wasteful way of doing this (unique lookup for each
+ mode/submapping); there should be a central repository for
+ identical lookups. That will require minor work, so I'm putting it
+ off as low priority.
+
+ Why a lookup for each backend in a given mode? Because the
+ blocksize is set by the mode, and low backend lookups may require
+ parameters from other areas of the mode/mapping */
+
+extern int analysis_noisy;
+
+typedef struct {
+ drft_lookup fft_look;
+ vorbis_info_mode *mode;
+ vorbis_info_mapping0 *map;
+
+ vorbis_look_time **time_look;
+ vorbis_look_floor **floor_look;
+
+ vorbis_look_residue **residue_look;
+ vorbis_look_psy *psy_look[2];
+
+ vorbis_func_time **time_func;
+ vorbis_func_floor **floor_func;
+ vorbis_func_residue **residue_func;
+
+ int ch;
+ long lastframe; /* if a different mode is called, we need to
+ invalidate decay */
+} vorbis_look_mapping0;
+
+static vorbis_info_mapping *mapping0_copy_info(vorbis_info_mapping *vm){
+ vorbis_info_mapping0 *info=(vorbis_info_mapping0 *)vm;
+ vorbis_info_mapping0 *ret=_ogg_malloc(sizeof(*ret));
+ memcpy(ret,info,sizeof(*ret));
+ return(ret);
+}
+
+static void mapping0_free_info(vorbis_info_mapping *i){
+ vorbis_info_mapping0 *info=(vorbis_info_mapping0 *)i;
+ if(info){
+ memset(info,0,sizeof(*info));
+ _ogg_free(info);
+ }
+}
+
+static void mapping0_free_look(vorbis_look_mapping *look){
+ int i;
+ vorbis_look_mapping0 *l=(vorbis_look_mapping0 *)look;
+ if(l){
+ drft_clear(&l->fft_look);
+
+ for(i=0;i<l->map->submaps;i++){
+ l->time_func[i]->free_look(l->time_look[i]);
+ l->floor_func[i]->free_look(l->floor_look[i]);
+ l->residue_func[i]->free_look(l->residue_look[i]);
+ }
+ if(l->psy_look[1] && l->psy_look[1]!=l->psy_look[0]){
+ _vp_psy_clear(l->psy_look[1]);
+ _ogg_free(l->psy_look[1]);
+ }
+ if(l->psy_look[0]){
+ _vp_psy_clear(l->psy_look[0]);
+ _ogg_free(l->psy_look[0]);
+ }
+ _ogg_free(l->time_func);
+ _ogg_free(l->floor_func);
+ _ogg_free(l->residue_func);
+ _ogg_free(l->time_look);
+ _ogg_free(l->floor_look);
+ _ogg_free(l->residue_look);
+ memset(l,0,sizeof(*l));
+ _ogg_free(l);
+ }
+}
+
+static vorbis_look_mapping *mapping0_look(vorbis_dsp_state *vd,vorbis_info_mode *vm,
+ vorbis_info_mapping *m){
+ int i;
+ vorbis_info *vi=vd->vi;
+ codec_setup_info *ci=vi->codec_setup;
+ vorbis_look_mapping0 *look=_ogg_calloc(1,sizeof(*look));
+ vorbis_info_mapping0 *info=look->map=(vorbis_info_mapping0 *)m;
+ look->mode=vm;
+
+ look->time_look=_ogg_calloc(info->submaps,sizeof(*look->time_look));
+ look->floor_look=_ogg_calloc(info->submaps,sizeof(*look->floor_look));
+
+ look->residue_look=_ogg_calloc(info->submaps,sizeof(*look->residue_look));
+
+ look->time_func=_ogg_calloc(info->submaps,sizeof(*look->time_func));
+ look->floor_func=_ogg_calloc(info->submaps,sizeof(*look->floor_func));
+ look->residue_func=_ogg_calloc(info->submaps,sizeof(*look->residue_func));
+
+ for(i=0;i<info->submaps;i++){
+ int timenum=info->timesubmap[i];
+ int floornum=info->floorsubmap[i];
+ int resnum=info->residuesubmap[i];
+
+ look->time_func[i]=_time_P[ci->time_type[timenum]];
+ look->time_look[i]=look->time_func[i]->
+ look(vd,vm,ci->time_param[timenum]);
+ look->floor_func[i]=_floor_P[ci->floor_type[floornum]];
+ look->floor_look[i]=look->floor_func[i]->
+ look(vd,vm,ci->floor_param[floornum]);
+ look->residue_func[i]=_residue_P[ci->residue_type[resnum]];
+ look->residue_look[i]=look->residue_func[i]->
+ look(vd,vm,ci->residue_param[resnum]);
+
+ }
+ if(ci->psys && vd->analysisp){
+ if(info->psy[0] != info->psy[1]){
+
+ int psynum=info->psy[0];
+ look->psy_look[0]=_ogg_calloc(1,sizeof(*look->psy_look[0]));
+ _vp_psy_init(look->psy_look[0],ci->psy_param[psynum],
+ ci->psy_g_param,
+ ci->blocksizes[vm->blockflag]/2,vi->rate);
+
+ psynum=info->psy[1];
+ look->psy_look[1]=_ogg_calloc(1,sizeof(*look->psy_look[1]));
+ _vp_psy_init(look->psy_look[1],ci->psy_param[psynum],
+ ci->psy_g_param,
+ ci->blocksizes[vm->blockflag]/2,vi->rate);
+ }else{
+
+ int psynum=info->psy[0];
+ look->psy_look[0]=_ogg_calloc(1,sizeof(*look->psy_look[0]));
+ look->psy_look[1]=look->psy_look[0];
+ _vp_psy_init(look->psy_look[0],ci->psy_param[psynum],
+ ci->psy_g_param,
+ ci->blocksizes[vm->blockflag]/2,vi->rate);
+
+ }
+ }
+
+ look->ch=vi->channels;
+
+ if(vd->analysisp)drft_init(&look->fft_look,ci->blocksizes[vm->blockflag]);
+ return(look);
+}
+
+static int ilog2(unsigned int v){
+ int ret=0;
+ while(v>1){
+ ret++;
+ v>>=1;
+ }
+ return(ret);
+}
+
+static void mapping0_pack(vorbis_info *vi,vorbis_info_mapping *vm,oggpack_buffer *opb){
+ int i;
+ vorbis_info_mapping0 *info=(vorbis_info_mapping0 *)vm;
+
+ /* another 'we meant to do it this way' hack... up to beta 4, we
+ packed 4 binary zeros here to signify one submapping in use. We
+ now redefine that to mean four bitflags that indicate use of
+ deeper features; bit0:submappings, bit1:coupling,
+ bit2,3:reserved. This is backward compatable with all actual uses
+ of the beta code. */
+
+ if(info->submaps>1){
+ oggpack_write(opb,1,1);
+ oggpack_write(opb,info->submaps-1,4);
+ }else
+ oggpack_write(opb,0,1);
+
+ if(info->coupling_steps>0){
+ oggpack_write(opb,1,1);
+ oggpack_write(opb,info->coupling_steps-1,8);
+
+ for(i=0;i<info->coupling_steps;i++){
+ oggpack_write(opb,info->coupling_mag[i],ilog2(vi->channels));
+ oggpack_write(opb,info->coupling_ang[i],ilog2(vi->channels));
+ }
+ }else
+ oggpack_write(opb,0,1);
+
+ oggpack_write(opb,0,2); /* 2,3:reserved */
+
+ /* we don't write the channel submappings if we only have one... */
+ if(info->submaps>1){
+ for(i=0;i<vi->channels;i++)
+ oggpack_write(opb,info->chmuxlist[i],4);
+ }
+ for(i=0;i<info->submaps;i++){
+ oggpack_write(opb,info->timesubmap[i],8);
+ oggpack_write(opb,info->floorsubmap[i],8);
+ oggpack_write(opb,info->residuesubmap[i],8);
+ }
+}
+
+/* also responsible for range checking */
+static vorbis_info_mapping *mapping0_unpack(vorbis_info *vi,oggpack_buffer *opb){
+ int i;
+ vorbis_info_mapping0 *info=_ogg_calloc(1,sizeof(*info));
+ codec_setup_info *ci=vi->codec_setup;
+ memset(info,0,sizeof(*info));
+
+ if(oggpack_read(opb,1))
+ info->submaps=oggpack_read(opb,4)+1;
+ else
+ info->submaps=1;
+
+ if(oggpack_read(opb,1)){
+ info->coupling_steps=oggpack_read(opb,8)+1;
+
+ for(i=0;i<info->coupling_steps;i++){
+ int testM=info->coupling_mag[i]=oggpack_read(opb,ilog2(vi->channels));
+ int testA=info->coupling_ang[i]=oggpack_read(opb,ilog2(vi->channels));
+
+ if(testM<0 ||
+ testA<0 ||
+ testM==testA ||
+ testM>=vi->channels ||
+ testA>=vi->channels) goto err_out;
+ }
+
+ }
+
+ if(oggpack_read(opb,2)>0)goto err_out; /* 2,3:reserved */
+
+ if(info->submaps>1){
+ for(i=0;i<vi->channels;i++){
+ info->chmuxlist[i]=oggpack_read(opb,4);
+ if(info->chmuxlist[i]>=info->submaps)goto err_out;
+ }
+ }
+ for(i=0;i<info->submaps;i++){
+ info->timesubmap[i]=oggpack_read(opb,8);
+ if(info->timesubmap[i]>=ci->times)goto err_out;
+ info->floorsubmap[i]=oggpack_read(opb,8);
+ if(info->floorsubmap[i]>=ci->floors)goto err_out;
+ info->residuesubmap[i]=oggpack_read(opb,8);
+ if(info->residuesubmap[i]>=ci->residues)goto err_out;
+ }
+
+ return info;
+
+ err_out:
+ mapping0_free_info(info);
+ return(NULL);
+}
+
+#include "os.h"
+#include "lpc.h"
+#include "lsp.h"
+#include "envelope.h"
+#include "mdct.h"
+#include "psy.h"
+#include "scales.h"
+
+static double floater_interpolate(backend_lookup_state *b,vorbis_info *vi,
+ double desired_rate){
+ int eighth=b->bitrate_floatinglimit*8-1.;
+ double lobitrate;
+ double hibitrate;
+
+ lobitrate=(double)(eighth==0?0.:
+ b->bitrate_avgbitacc[eighth-1])/b->bitrate_avgsampleacc*vi->rate;
+ while(lobitrate>desired_rate && eighth>0){
+ eighth--;
+ lobitrate=(double)(eighth==0?0.:
+ b->bitrate_avgbitacc[eighth-1])/b->bitrate_avgsampleacc*vi->rate;
+ }
+
+ hibitrate=(eighth>=b->bitrate_eighths?b->bitrate_avgbitacc[b->bitrate_eighths-1]:
+ (double)b->bitrate_avgbitacc[eighth])/b->bitrate_avgsampleacc*vi->rate;
+ while(hibitrate<desired_rate && eighth<b->bitrate_eighths){
+ eighth++;
+ if(eighth<b->bitrate_eighths)
+ hibitrate=(double)b->bitrate_avgbitacc[eighth]/b->bitrate_avgsampleacc*vi->rate;
+ }
+
+ /* interpolate */
+ if(eighth==b->bitrate_eighths){
+ return eighth/8.;
+ }else{
+ double delta=(desired_rate-lobitrate)/(hibitrate-lobitrate);
+ return (eighth+delta)/8.;
+ }
+}
+
+/* no time mapping implementation for now */
+static long seq=0;
+static int mapping0_forward(vorbis_block *vb,vorbis_look_mapping *l){
+ vorbis_dsp_state *vd=vb->vd;
+ vorbis_info *vi=vd->vi;
+ codec_setup_info *ci=vi->codec_setup;
+ backend_lookup_state *b=vb->vd->backend_state;
+ vorbis_look_mapping0 *look=(vorbis_look_mapping0 *)l;
+ vorbis_info_mapping0 *info=look->map;
+ vorbis_info_mode *mode=look->mode;
+ vorbis_block_internal *vbi=(vorbis_block_internal *)vb->internal;
+ int n=vb->pcmend;
+ int i,j;
+ float *window=b->window[vb->W][vb->lW][vb->nW][mode->windowtype];
+ int *nonzero=alloca(sizeof(*nonzero)*vi->channels);
+
+ float *work=_vorbis_block_alloc(vb,n*sizeof(*work));
+
+ float global_ampmax=vbi->ampmax;
+ float *local_ampmax=alloca(sizeof(*local_ampmax)*vi->channels);
+ int blocktype;
+
+ /* we differentiate between short and long block types to help the
+ masking engine; the window shapes also matter.
+ impulse block (a short block in which an impulse occurs)
+ padding block (a short block that pads between a transitional
+ long block and an impulse block, or vice versa)
+ transition block (the wqeird one; a long block with the transition
+ window; affects bass/midrange response and that must be
+ accounted for in masking)
+ long block (run of the mill long block)
+ */
+
+ if(vb->W){
+ if(!vb->lW || !vb->nW)
+ blocktype=BLOCKTYPE_TRANSITION;
+ else
+ blocktype=BLOCKTYPE_LONG;
+ }else{
+ /* right now we're missing the infrastructure to distingush the
+ two short types */
+ blocktype=BLOCKTYPE_IMPULSE;
+ }
+
+ for(i=0;i<vi->channels;i++){
+ float scale=4.f/n;
+
+ /* the following makes things clearer to *me* anyway */
+ float *pcm =vb->pcm[i];
+ float *fft =work;
+ float *logfft =pcm+n/2;
+
+ /*float *res =pcm;
+ float *mdct =pcm;
+ float *codedflr=pcm+n/2;
+ float *logmax =work;
+ float *logmask =work+n/2;*/
+
+ /* window the PCM data */
+ for(j=0;j<n;j++)
+ fft[j]=pcm[j]*=window[j];
+
+ /* transform the PCM data */
+ /* only MDCT right now.... */
+ mdct_forward(b->transform[vb->W][0],pcm,pcm);
+
+ /* FFT yields more accurate tonal estimation (not phase sensitive) */
+ drft_forward(&look->fft_look,fft);
+ fft[0]*=scale;
+ logfft[0]=todB(fft);
+ local_ampmax[i]=logfft[0];
+ for(j=1;j<n-1;j+=2){
+ float temp=scale*FAST_HYPOT(fft[j],fft[j+1]);
+ temp=logfft[(j+1)>>1]=todB(&temp);
+ if(temp>local_ampmax[i])local_ampmax[i]=temp;
+ }
+ if(local_ampmax[i]>global_ampmax)global_ampmax=local_ampmax[i];
+
+ _analysis_output("fft",seq+i,logfft,n/2,1,0);
+ }
+
+ for(i=0;i<vi->channels;i++){
+ int submap=info->chmuxlist[i];
+
+ /* the following makes things clearer to *me* anyway */
+ float *mdct =vb->pcm[i];
+ float *res =mdct;
+ float *codedflr=mdct+n/2;
+ float *logfft =mdct+n/2;
+
+ float *logmdct =work;
+ float *logmax =mdct+n/2;
+ float *logmask =work+n/2;
+
+ for(j=0;j<n/2;j++)
+ logmdct[j]=todB(mdct+j);
+ _analysis_output("mdct",seq+i,logmdct,n/2,1,0);
+ _analysis_output("lmdct",seq+i,mdct,n/2,0,0);
+
+
+ /* perform psychoacoustics; do masking */
+ _vp_compute_mask(look->psy_look[blocktype],
+ b->psy_g_look,
+ i,
+ logfft, /* -> logmax */
+ logmdct,
+ logmask,
+ global_ampmax,
+ local_ampmax[i],
+ ci->blocksizes[vb->lW]/2);
+
+ _analysis_output("mask",seq+i,logmask,n/2,1,0);
+ /* perform floor encoding */
+ nonzero[i]=look->floor_func[submap]->
+ forward(vb,look->floor_look[submap],
+ mdct,
+ logmdct,
+ logmask,
+ logmax,
+
+ codedflr);
+
+
+ _analysis_output("mdct2",seq+i,mdct,n/2,1,1);
+ _vp_remove_floor(look->psy_look[blocktype],
+ b->psy_g_look,
+ logmdct,
+ mdct,
+ codedflr,
+ res,
+ local_ampmax[i]);
+
+ /*for(j=0;j<n/2;j++)
+ if(fabs(res[j])>1200){
+ analysis_noisy=1;
+ fprintf(stderr,"%ld ",seq+i);
+ }*/
+
+ _analysis_output("res",seq+i,res,n/2,1,0);
+ _analysis_output("codedflr",seq+i,codedflr,n/2,1,1);
+
+ }
+
+ vbi->ampmax=global_ampmax;
+
+ /* partition based prequantization and channel coupling */
+ /* Steps in prequant and coupling:
+
+ down-couple/down-quantize from perfect residue -> quantized vector
+ classify by this first quantized vector
+
+ do{
+ encode quantized vector; add encoded values to 'so-far' vector
+ more? [not yet at bitrate/not yet at target]
+ yes{
+ down-couple/down-quantize from perfect-'so-far' ->
+ quantized vector; when subtracting coupling,
+ account for +/- out-of-phase component
+ }no{
+ break
+ }
+ }
+ done.
+
+ quantization in each iteration is done (after circular normalization
+ in coupling) using a by-iteration quantization granule value.
+ */
+
+ {
+ float **pcm=vb->pcm;
+ float **quantized=alloca(sizeof(*quantized)*vi->channels);
+ float **sofar=alloca(sizeof(*sofar)*vi->channels);
+
+ long ***classifications=alloca(sizeof(*classifications)*info->submaps);
+ float ***pcmbundle=alloca(sizeof(*pcmbundle)*info->submaps);
+ float ***sobundle=alloca(sizeof(*sobundle)*info->submaps);
+ int **zerobundle=alloca(sizeof(*zerobundle)*info->submaps);
+ int *chbundle=alloca(sizeof(*chbundle)*info->submaps);
+ int chcounter=0;
+
+ long maxbits,minbits;
+
+ /* play a little loose with this abstraction */
+ int quant_passes=ci->coupling_passes;
+ int stopflag=0,stoppos=0;
+
+ for(i=0;i<vi->channels;i++){
+ quantized[i]=pcm[i]+n/2;
+ sofar[i]=_vorbis_block_alloc(vb,n/2*sizeof(*sofar[i]));
+ memset(sofar[i],0,sizeof(*sofar[i])*n/2);
+ }
+
+ pcmbundle[0]=alloca(sizeof(*pcmbundle[0])*vi->channels);
+ sobundle[0]=alloca(sizeof(*sobundle[0])*vi->channels);
+ zerobundle[0]=alloca(sizeof(*zerobundle[0])*vi->channels);
+
+ /* initial down-quantized coupling */
+
+ if(info->coupling_steps==0){
+ /* this assumes all or nothing coupling right now. it should pass
+ through any channels left uncoupled, but it doesn't do that now */
+ for(i=0;i<vi->channels;i++){
+ float *lpcm=pcm[i];
+ float *lqua=quantized[i];
+ for(j=0;j<n/2;j++)
+ lqua[j]=lpcm[j];
+ }
+ }else{
+ _vp_quantize_couple(look->psy_look[blocktype],
+ info,
+ pcm,
+ sofar,
+ quantized,
+ nonzero,
+ 0);
+ }
+
+ for(i=0;i<vi->channels;i++)
+ _analysis_output("quant",seq+i,quantized[i],n/2,1,0);
+
+
+ /* classify, by submap */
+
+ for(i=0;i<info->submaps;i++){
+ int ch_in_bundle=0;
+ pcmbundle[i]=pcmbundle[0]+chcounter;
+ sobundle[i]=sobundle[0]+chcounter;
+ zerobundle[i]=zerobundle[0]+chcounter;
+
+ for(j=0;j<vi->channels;j++){
+ if(info->chmuxlist[j]==i){
+ if(nonzero[j])
+ zerobundle[i][ch_in_bundle]=1;
+ else
+ zerobundle[i][ch_in_bundle]=0;
+ pcmbundle[i][ch_in_bundle]=quantized[j];
+ sobundle[i][ch_in_bundle++]=sofar[j];
+ }
+ }
+ chbundle[i]=ch_in_bundle;
+ chcounter+=ch_in_bundle;
+
+ classifications[i]=look->residue_func[i]->
+ class(vb,look->residue_look[i],pcmbundle[i],zerobundle[i],chbundle[i]);
+ }
+
+ /* basic bitrate fitting algorithm:
+ determine a current-packet maximum size from the bound queue and
+ point maximums
+ determine a current-packet minimum size from the bound queue and
+ point minimums
+ determine a desired packet size:
+ if there's a requested average, get that from the floater
+ else, use the bits sunk by a single iteration (bounded by min/max)
+ */
+ {
+ long period_samples=b->bitrate_boundsampleacc+ci->blocksizes[vb->W]/2;
+ long maxbits_period=ci->bitrate_queue_max/vi->rate*period_samples;
+ long minbits_period=ci->bitrate_queue_min/vi->rate*period_samples;
+ long maxbits_absolute=ci->bitrate_absolute_max/vi->rate*
+ ci->blocksizes[vb->W]/2;
+ long minbits_absolute=ci->bitrate_absolute_min/vi->rate*
+ ci->blocksizes[vb->W]/2;
+
+ maxbits=min(maxbits_period-b->bitrate_boundbitacc,maxbits_absolute);
+ minbits=max(minbits_period-b->bitrate_boundbitacc,minbits_absolute);
+ if(maxbits<0)maxbits=0;
+ if(maxbits)minbits=min(minbits,maxbits);
+ }
+
+ /* actual encoding loop; if we have a desired stopping point, pack
+ slightly past it so that the end of the packet is not
+ uninitialized data that could pollute the decoded audio on the
+ decode side. We want to truncate at a clean byte boundary */
+ for(i=0;!stopflag;){
+
+ /* perform residue encoding of this pass's quantized residue
+ vector, according residue mapping */
+
+ for(j=0;j<info->submaps;j++){
+ ogg_uint32_t *queueptr=b->bitrate_queue_eighths;
+ if(queueptr)queueptr+=b->bitrate_queue_head*b->bitrate_eighths;
+
+ if(stoppos){
+ look->residue_func[j]->
+ forward(vb,look->residue_look[j],
+ pcmbundle[j],sobundle[j],zerobundle[j],chbundle[j],
+ i,classifications[j],b->bitrate_floatinglimit,queueptr);
+
+ }else{
+ stoppos=look->residue_func[j]->
+ forward(vb,look->residue_look[j],
+ pcmbundle[j],sobundle[j],zerobundle[j],chbundle[j],
+ i,classifications[j],b->bitrate_floatinglimit,queueptr);
+ }
+ i++;
+ }
+
+ /* bitrate management.... deciding when it's time to stop. */
+ if(i<quant_passes){
+ if(b->bitrate_eighths==0){ /* average bitrate always runs
+ encode to the bitter end in
+ order to collect statistics */
+
+ long current_bytes=oggpack_bits(&vb->opb)/8;
+
+ if(maxbits && current_bytes>maxbits/8){
+ /* maxbits trumps all... */
+ stoppos=maxbits/8;
+ stopflag=1;
+ }else{
+ if(current_bytes>(minbits+7)/8){
+ if(ci->passlimit[i-1]>=b->bitrate_floatinglimit){
+ if(!stoppos)stoppos=current_bytes;
+ if(stoppos<current_bytes)
+ stopflag=1;
+ }
+ }
+ }
+ }
+ }else
+ stopflag=1;
+
+ /* down-couple/down-quantize from perfect-'so-far' ->
+ new quantized vector */
+ if(!stoppos){ /* only do this if we're doing a real iteration
+ and not padding */
+ if(info->coupling_steps==0){
+ /* this assumes all or nothing coupling right now. it should pass
+ through any channels left uncoupled, but it doesn't do that now */
+ for(i=0;i<vi->channels;i++){
+ float *lpcm=pcm[i];
+ float *lsof=sofar[i];
+ float *lqua=quantized[i];
+ for(j=0;j<n/2;j++)
+ lqua[j]=lpcm[j]-lsof[j];
+ }
+ }else{
+ _vp_quantize_couple(look->psy_look[blocktype],
+ info,
+ pcm,
+ sofar,
+ quantized,
+ nonzero,
+ i);
+ }
+ }
+
+ /* truncate the packet according to stoppos */
+ if(!stoppos)stoppos=oggpack_bytes(&vb->opb);
+ if(minbits && stoppos*8<minbits)stoppos=(minbits+7)/8;
+ if(maxbits && stoppos*8>maxbits)stoppos=maxbits/8;
+ if(stoppos>oggpack_bytes(&vb->opb))stoppos=oggpack_bytes(&vb->opb);
+ vb->opb.endbyte=stoppos;
+ vb->opb.endbit=0;
+
+ /* steady as she goes */
+ }
+ seq+=vi->channels;
+
+ fprintf(stderr,"Bitrate: cav %d, cmin %ld, cmax %ld, float %.1f,"
+ " this %ld\n",
+ (int)((double)b->bitrate_boundbitacc*vi->rate/b->bitrate_boundsampleacc),
+ minbits,maxbits,b->bitrate_floatinglimit,
+ oggpack_bytes(&vb->opb)*8);
+ fprintf(stderr,"\thead:%d, boundtail:%ld(%ld), avtail:%ld(%ld)\n",
+ b->bitrate_queue_head,b->bitrate_boundtail,b->bitrate_boundsampleacc,
+ b->bitrate_avgtail,b->bitrate_avgsampleacc);
+
+ /* track bitrate*/
+ /* update boundary accumulators */
+ while(b->bitrate_boundsampleacc>ci->bitrate_bound_queuetime*vi->rate){
+ int samples=ci->blocksizes[0]>>1;
+ if(b->bitrate_queue[b->bitrate_boundtail]&0x80000000UL)
+ samples=ci->blocksizes[1]>>1;
+ b->bitrate_boundsampleacc-=samples;
+ b->bitrate_boundbitacc-=
+ b->bitrate_queue[b->bitrate_boundtail]&0x7fffffffUL;
+ b->bitrate_boundtail++;
+ if(b->bitrate_boundtail>=b->bitrate_queue_size)b->bitrate_boundtail=0;
+ }
+
+ /* update moving average accumulators */
+ while(b->bitrate_avgsampleacc>ci->bitrate_avg_queuetime*vi->rate){
+ int samples=ci->blocksizes[0]>>1;
+ if(b->bitrate_queue[b->bitrate_avgtail]&0x80000000UL)
+ samples=ci->blocksizes[1]>>1;
+ b->bitrate_avgsampleacc-=samples;
+ for(i=0;i<b->bitrate_eighths;i++)
+ b->bitrate_avgbitacc[i]-=
+ b->bitrate_queue_eighths[b->bitrate_avgtail*b->bitrate_eighths+i];
+ b->bitrate_avgtail++;
+ if(b->bitrate_avgtail>=b->bitrate_queue_size)b->bitrate_avgtail=0;
+ }
+
+ /* update queue head */
+ {
+ int bits=oggpack_bytes(&vb->opb)*8;
+
+ if(bits>32){ /* (avoid pushing the floater too far in digital silence) */
+
+ /* boundaries */
+ b->bitrate_queue[b->bitrate_queue_head]=bits;
+ if(vb->W)b->bitrate_queue[b->bitrate_queue_head]|=0x80000000UL;
+ b->bitrate_boundbitacc+=bits;
+ b->bitrate_boundsampleacc+=ci->blocksizes[vb->W]>>1;
+
+ /* eighths */
+ if(b->bitrate_eighths){
+ for(i=0;i<b->bitrate_eighths;i++)
+ b->bitrate_avgbitacc[i]+=
+ b->bitrate_queue_eighths[b->bitrate_queue_head*b->bitrate_eighths+i];
+ b->bitrate_avgsampleacc+=ci->blocksizes[vb->W]>>1;
+ }
+
+ b->bitrate_queue_head++;
+ if(b->bitrate_queue_head>=b->bitrate_queue_size)b->bitrate_queue_head=0;
+
+ /* adjust the floater to offset bitrate above/below desired average */
+ /* look for the eighth settings in recent history that bracket
+ the desired bitrate, and interpolate twixt them for the
+ flaoter setting we want */
+
+ if(b->bitrate_eighths>0){
+ double upper=floater_interpolate(b,vi,ci->bitrate_queue_upperavg);
+ double lower=floater_interpolate(b,vi,ci->bitrate_queue_loweravg);
+ b->bitrate_floatinglimit=ci->bitrate_floatinglimit_initial;
+ if(upper>0 && upper<b->bitrate_floatinglimit)
+ b->bitrate_floatinglimit=upper;
+ if(lower>b->bitrate_floatinglimit)
+ b->bitrate_floatinglimit=lower;
+ }
+ }
+ }
+ }
+
+ look->lastframe=vb->sequence;
+ return(0);
+}
+
+static int mapping0_inverse(vorbis_block *vb,vorbis_look_mapping *l){
+ vorbis_dsp_state *vd=vb->vd;
+ vorbis_info *vi=vd->vi;
+ codec_setup_info *ci=vi->codec_setup;
+ backend_lookup_state *b=vd->backend_state;
+ vorbis_look_mapping0 *look=(vorbis_look_mapping0 *)l;
+ vorbis_info_mapping0 *info=look->map;
+ vorbis_info_mode *mode=look->mode;
+ int i,j;
+ long n=vb->pcmend=ci->blocksizes[vb->W];
+
+ float *window=b->window[vb->W][vb->lW][vb->nW][mode->windowtype];
+ float **pcmbundle=alloca(sizeof(*pcmbundle)*vi->channels);
+ int *zerobundle=alloca(sizeof(*zerobundle)*vi->channels);
+
+ int *nonzero =alloca(sizeof(*nonzero)*vi->channels);
+ void **floormemo=alloca(sizeof(*floormemo)*vi->channels);
+
+ /* time domain information decode (note that applying the
+ information would have to happen later; we'll probably add a
+ function entry to the harness for that later */
+ /* NOT IMPLEMENTED */
+
+ /* recover the spectral envelope; store it in the PCM vector for now */
+ for(i=0;i<vi->channels;i++){
+ int submap=info->chmuxlist[i];
+ floormemo[i]=look->floor_func[submap]->
+ inverse1(vb,look->floor_look[submap]);
+ if(floormemo[i])
+ nonzero[i]=1;
+ else
+ nonzero[i]=0;
+ memset(vb->pcm[i],0,sizeof(*vb->pcm[i])*n/2);
+ }
+
+ /* channel coupling can 'dirty' the nonzero listing */
+ for(i=0;i<info->coupling_steps;i++){
+ if(nonzero[info->coupling_mag[i]] ||
+ nonzero[info->coupling_ang[i]]){
+ nonzero[info->coupling_mag[i]]=1;
+ nonzero[info->coupling_ang[i]]=1;
+ }
+ }
+
+ /* recover the residue into our working vectors */
+ for(i=0;i<info->submaps;i++){
+ int ch_in_bundle=0;
+ for(j=0;j<vi->channels;j++){
+ if(info->chmuxlist[j]==i){
+ if(nonzero[j])
+ zerobundle[ch_in_bundle]=1;
+ else
+ zerobundle[ch_in_bundle]=0;
+ pcmbundle[ch_in_bundle++]=vb->pcm[j];
+ }
+ }
+
+ look->residue_func[i]->inverse(vb,look->residue_look[i],
+ pcmbundle,zerobundle,ch_in_bundle);
+ }
+
+ /* channel coupling */
+ for(i=info->coupling_steps-1;i>=0;i--){
+ float *pcmM=vb->pcm[info->coupling_mag[i]];
+ float *pcmA=vb->pcm[info->coupling_ang[i]];
+
+ for(j=0;j<n/2;j++){
+ float mag=pcmM[j];
+ float ang=pcmA[j];
+
+ if(mag>0)
+ if(ang>0){
+ pcmM[j]=mag;
+ pcmA[j]=mag-ang;
+ }else{
+ pcmA[j]=mag;
+ pcmM[j]=mag+ang;
+ }
+ else
+ if(ang>0){
+ pcmM[j]=mag;
+ pcmA[j]=mag+ang;
+ }else{
+ pcmA[j]=mag;
+ pcmM[j]=mag-ang;
+ }
+ }
+ }
+
+ /* compute and apply spectral envelope */
+ for(i=0;i<vi->channels;i++){
+ float *pcm=vb->pcm[i];
+ int submap=info->chmuxlist[i];
+ look->floor_func[submap]->
+ inverse2(vb,look->floor_look[submap],floormemo[i],pcm);
+ }
+
+ /* transform the PCM data; takes PCM vector, vb; modifies PCM vector */
+ /* only MDCT right now.... */
+ for(i=0;i<vi->channels;i++){
+ float *pcm=vb->pcm[i];
+ _analysis_output("out",seq+i,pcm,n/2,1,1);
+ _analysis_output("lout",seq+i,pcm,n/2,0,0);
+ mdct_backward(b->transform[vb->W][0],pcm,pcm);
+ }
+
+ /* window the data */
+ for(i=0;i<vi->channels;i++){
+ float *pcm=vb->pcm[i];
+ if(nonzero[i])
+ for(j=0;j<n;j++)
+ pcm[j]*=window[j];
+ else
+ for(j=0;j<n;j++)
+ pcm[j]=0.f;
+ _analysis_output("final",seq++,pcm,n,0,0);
+ }
+
+ /* now apply the decoded post-window time information */
+ /* NOT IMPLEMENTED */
+
+ /* all done! */
+ return(0);
+}
+
+/* export hooks */
+vorbis_func_mapping mapping0_exportbundle={
+ &mapping0_pack,
+ &mapping0_unpack,
+ &mapping0_look,
+ &mapping0_copy_info,
+ &mapping0_free_info,
+ &mapping0_free_look,
+ &mapping0_forward,
+ &mapping0_inverse
+};
diff --git a/lib/modes/mode_44c_A.h b/lib/modes/mode_44c_A.h
new file mode 100644
index 00000000..96a85706
--- /dev/null
+++ b/lib/modes/mode_44c_A.h
@@ -0,0 +1,377 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+ * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+ * *
+ * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 *
+ * by the XIPHOPHORUS Company http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: predefined encoding modes; 44kHz stereo ~64kbps true VBR
+ last mod: $Id: mode_44c_A.h,v 1.4.2.1 2001/10/09 04:34:55 xiphmont Exp $
+
+ ********************************************************************/
+
+#ifndef _V_MODES_44c_A_H_
+#define _V_MODES_44c_A_H_
+
+#include <stdio.h>
+#include "vorbis/codec.h"
+#include "backends.h"
+
+#include "books/line_128x19_class1.vqh"
+#include "books/line_128x19_class2.vqh"
+
+#include "books/line_128x19_0sub0.vqh"
+#include "books/line_128x19_1sub1.vqh"
+#include "books/line_128x19_1sub2.vqh"
+#include "books/line_128x19_1sub3.vqh"
+#include "books/line_128x19_2sub1.vqh"
+#include "books/line_128x19_2sub2.vqh"
+#include "books/line_128x19_2sub3.vqh"
+
+#include "books/line_1024x31_class0.vqh"
+#include "books/line_1024x31_class1.vqh"
+#include "books/line_1024x31_class2.vqh"
+#include "books/line_1024x31_class3.vqh"
+
+#include "books/line_1024x31_0sub0.vqh"
+#include "books/line_1024x31_0sub1.vqh"
+#include "books/line_1024x31_1sub0.vqh"
+#include "books/line_1024x31_1sub1.vqh"
+#include "books/line_1024x31_2sub1.vqh"
+#include "books/line_1024x31_2sub2.vqh"
+#include "books/line_1024x31_2sub3.vqh"
+#include "books/line_1024x31_3sub1.vqh"
+#include "books/line_1024x31_3sub2.vqh"
+#include "books/line_1024x31_3sub3.vqh"
+
+#include "books/res_44c_A_128aux.vqh"
+#include "books/res_44c_A_1024aux.vqh"
+
+#include "books/res_Ac_1.vqh"
+#include "books/res_Ac_2.vqh"
+#include "books/res_Ac_3.vqh"
+#include "books/res_Ac_4.vqh"
+#include "books/res_Ac_5.vqh"
+#include "books/res_Ac_6.vqh"
+#include "books/res_Ac_7.vqh"
+#include "books/res_Ac_7a.vqh"
+#include "books/res_Ac_8.vqh"
+#include "books/res_Ac_8a.vqh"
+#include "books/res_Ac_9.vqh"
+#include "books/res_Ac_9a.vqh"
+#include "books/res_Ac_9b.vqh"
+
+#include "maskadj_A.h"
+
+static vorbis_info_psy_global _psy_set_44c_AG={
+ 0, /* decaydBpms */
+ 8, /* lines per eighth octave */
+
+ /* thresh sample period, preecho clamp trigger threshhold, range, minenergy */
+ 256, {26.f,26.f,26.f,30.f}, {-26.f,-26.f,-26.f,-30.f}, -90.f,
+ -6.f,
+
+ 0,
+};
+
+static struct vp_couple_pass _psy_pass_44c_A0[]={
+ {1.f,1.f,
+ {{24, 0, 0, 0},
+ {64, 0, 0, 0},
+ {9999, 0, 0, 2.5f}}
+ },
+ {1.f,1.f,
+ {{9999, 0, 0, 0}}
+ },
+};
+
+static vp_couple_pass _psy_pass_44c_A[]={
+ {1.f,1.f,
+ {{288, 0, 0, 0},
+ {512, 0, 0, 0},
+ {9999, 0, 0, 2.5f}}
+ },
+ {1.f,1.f,
+ {{9999, 0, 0, 0}}
+ },
+};
+
+static float _psy_compand_44c_A[NOISE_COMPAND_LEVELS]={
+ 0.f, 1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f, /* 7dB */
+ 8.f, 8.f, 7.f, 6.f, 5.f, 4.f, 3.f, 2.f, /* 15dB */
+ 1.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, /* 23dB */
+ 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, /* 31dB */
+ 1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f, 8.f, /* 39dB */
+};
+
+
+static vorbis_info_psy _psy_set_44c_A0={
+ ATH_Bark_dB_lineaggressive,
+ -100.,-140.,
+
+ /* tonemaskp, guard, abs_limit */
+ 0.f, -26.f, -30.f,
+ &_vp_tonemask_consbass_A,
+ /* peakattp, curvelimitp */
+ 1, 4, &_vp_peakatt_A,
+
+ /*noisemaskp */
+ 1, -10.f, /* suppress any noise curve over maxspec+n */
+ .6f, .6f, /* low/high window */
+ 2, 2, 15,
+
+ /*63 125 250 500 1k 2k 4k 8k 16k*/
+ {-30,-30,-30,-30,-26,-22,-20,-14,-10,-2, -3, -3, 0, 0, 0, 0, 2},
+ _psy_compand_44c_A,
+
+ 95.f, /* even decade + 5 is important; saves an rint() later in a
+ tight loop) */
+
+ _psy_pass_44c_A0
+};
+
+static vorbis_info_psy _psy_set_44c_AT={
+ ATH_Bark_dB_lineaggressive,
+ -100.f,-140.f,
+
+ /* tonemaskp, guard, abs_limit */
+ 0.f,-26.f,-30.f,
+ &_vp_tonemask_consbass_A,
+ /* peakattp,curvelimitp */
+ 1, 4, &_vp_peakatt_A,
+
+ /*noisemaskp */
+ 1, -10.f, /* suppress any noise curve over maxspec+n */
+ .6f,.6f, /* low/high window */
+ 4,4,100,
+
+ /*63 125 250 500 1k 2k 4k 8k 16k*/
+ {-30,-30,-30,-30,-26,-20,-20,-10, -6, -2, -5, -5, 0, 0, 0, 0, 2},
+ _psy_compand_44c_A,
+
+ 95.f, /* even decade + 5 is important; saves an rint() later in a
+ tight loop) */
+
+ _psy_pass_44c_A
+};
+
+static vorbis_info_psy _psy_set_44c_A={
+ ATH_Bark_dB_lineaggressive,
+ -100.f, -140.f,
+
+ /* tonemaskp, guard, abs_limit */
+ 0.f,-26.f,-30.f,
+ &_vp_tonemask_consbass_A,
+ /* peakattp, curvelimitp */
+ 1, 4, &_vp_peakatt_A,
+
+ /*noisemaskp */
+ 1, -10.f, /* suppress any noise curve over maxspec+n */
+ .6f,.6f, /* low/high window */
+ 4,4,100,
+
+ /*63 125 250 500 1k 2k 4k 8k 16k*/
+ {-20,-20,-20,-20,-20,-20,-20,-10, -6, -2, -5, -5, 0, 0, 0, 0, 2},
+ _psy_compand_44c_A,
+
+ 95.f, /* even decade + 5 is important; saves an rint() later in a
+ tight loop) */
+
+ _psy_pass_44c_A
+};
+
+static vorbis_info_time0 _time_set_44c_A={0};
+
+static vorbis_info_floor1 _floor_set_44c_A0={
+ 6,
+ {0,1,1,1,2,2},
+
+ {4,3,3},
+ {0,2,2},
+ {-1,0,1},
+ {{2},{-1,3,4,5},{-1,6,7,8}},
+
+ 4,
+
+ {0,128,
+
+ 6,17,30,58,
+
+ 2,1,4, 11,8,14, 23,20,26,
+ 41,35,48, 84,69,103},
+
+ 60,30,500,
+ 999,999,1,18.,
+ 8,70,
+ 96};
+
+
+static vorbis_info_floor1 _floor_set_44c_A={
+ 10,
+ {0,1,2,2,2,2,2, 3,3,3},
+
+ {3,4,3,3},
+ {1,1,2,2},
+ {9,10,11,12},
+ {{13,14},
+ {15,16},
+ {-1,17,18,19},
+ {-1,20,21,22},
+ },
+
+ 4,
+ {0,1024,
+
+ 88,31,243,
+
+ 14,54,143,460,
+
+ 6,3,10, 22,18,26, 41,36,47,
+ 69,61,78, 112,99,126, 185,162,211,
+ 329,282,387, 672,553,825
+ },
+
+ 60,30,400,
+ 20,8,1,18.,
+ 20,600,
+ 896};
+
+static vorbis_info_residue0 _residue_set_44c_A0={
+ 0,192, 16, 10,23,
+ {0,4,40,
+ 1,2,20,
+ 4,6,6,7},
+ {25, 26,26,
+ 27, 28, 29,29,
+ 30, 31,32, 33,34, 35,36,37},
+ {9999,9999,9999,9999,9999,9999,
+ 9999,9999,9999,9999},
+ {.5f,
+ 1.5f,1.5f,
+ 2.5f,2.5f,2.5f,
+ 4.5f,17.5f,84.5f},
+ {0},
+ {99,8,99,3,8,99,99,99,99,99}};
+
+static vorbis_info_residue0 _residue_set_44c_A={
+ 0,1792, 32,10,24,
+ {0,4,40,
+ 1,2,20,
+ 4,6,6,7},
+ {25, 26,26,
+ 27, 28, 29,29,
+ 30, 31,32, 33,34, 35,36,37},
+ {9999,9999,9999,9999,9999,9999,
+ 9999,9999,9999,9999},
+ {.5f,
+ 1.5f,1.5f,
+ 2.5f,2.5f,2.5f,
+ 4.5f,17.5f,84.5f},
+ {0},
+ {99,32,99,18,32,99,99,99,99,99}};
+
+static vorbis_info_mapping0 _mapping_set_44c_A0={
+ 1, {0,0}, {0}, {0}, {0}, {0,0}, 1,{0},{1}};
+static vorbis_info_mapping0 _mapping_set_44c_A={
+ 1, {0,0}, {0}, {1}, {1}, {1,2}, 1,{0},{1}};
+
+static vorbis_info_mode _mode_set_44c_A0={0,0,0,0};
+static vorbis_info_mode _mode_set_44c_A={1,0,0,1};
+
+codec_setup_info info_44c_A={
+
+ /* smallblock, largeblock */
+ {256, 2048},
+ /* modes,maps,times,floors,residues,books,psys */
+ 2, 2, 1, 2, 2, 38, 3,
+ /* modes */
+ {&_mode_set_44c_A0,&_mode_set_44c_A},
+ /* maps */
+ {0,0},{&_mapping_set_44c_A0,&_mapping_set_44c_A},
+ /* times */
+ {0,0},{&_time_set_44c_A},
+ /* floors */
+ {1,1},{&_floor_set_44c_A0,&_floor_set_44c_A},
+ /* residue */
+ {2,2},{&_residue_set_44c_A0,&_residue_set_44c_A},
+ /* books */
+
+ {
+ &_huff_book_line_128x19_class1,
+ &_huff_book_line_128x19_class2, /* 1 */
+
+ &_huff_book_line_128x19_0sub0, /* 2 */
+ &_huff_book_line_128x19_1sub1, /* 3 */
+ &_huff_book_line_128x19_1sub2,
+ &_huff_book_line_128x19_1sub3, /* 5 */
+ &_huff_book_line_128x19_2sub1,
+ &_huff_book_line_128x19_2sub2, /* 7 */
+ &_huff_book_line_128x19_2sub3,
+
+ &_huff_book_line_1024x31_class0,
+ &_huff_book_line_1024x31_class1, /* 10 */
+ &_huff_book_line_1024x31_class2,
+ &_huff_book_line_1024x31_class3, /* 12 */
+
+ &_huff_book_line_1024x31_0sub0,
+ &_huff_book_line_1024x31_0sub1, /* 14 */
+ &_huff_book_line_1024x31_1sub0,
+ &_huff_book_line_1024x31_1sub1,
+ &_huff_book_line_1024x31_2sub1,
+ &_huff_book_line_1024x31_2sub2, /* 18 */
+ &_huff_book_line_1024x31_2sub3,
+ &_huff_book_line_1024x31_3sub1,
+ &_huff_book_line_1024x31_3sub2,
+ &_huff_book_line_1024x31_3sub3, /* 22 */
+
+ &_huff_book_res_44c_A_128aux,
+ &_huff_book_res_44c_A_1024aux,
+
+ &_vq_book_res_Ac_1,
+ &_vq_book_res_Ac_2,
+ &_vq_book_res_Ac_3,
+ &_vq_book_res_Ac_4,
+ &_vq_book_res_Ac_5,
+ &_vq_book_res_Ac_6,
+ &_vq_book_res_Ac_7,
+ &_vq_book_res_Ac_7a,
+ &_vq_book_res_Ac_8,
+ &_vq_book_res_Ac_8a,
+ &_vq_book_res_Ac_9,
+ &_vq_book_res_Ac_9a,
+ &_vq_book_res_Ac_9b,
+
+
+ },
+ /* psy */
+ {&_psy_set_44c_A0,&_psy_set_44c_AT,&_psy_set_44c_A},
+ &_psy_set_44c_AG,
+
+ /* progressive coding and bitrate controls */
+ 3.0,
+ 1.,4.,
+
+ 0,
+ 0,
+
+ 0,
+ 0,
+
+ 0,0,
+
+ {4,6},
+ 2,
+};
+
+#endif
+
+
+
+
+
+
diff --git a/lib/modes/mode_44c_Z.h b/lib/modes/mode_44c_Z.h
new file mode 100644
index 00000000..75198add
--- /dev/null
+++ b/lib/modes/mode_44c_Z.h
@@ -0,0 +1,338 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+ * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+ * *
+ * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 *
+ * by the XIPHOPHORUS Company http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: predefined encoding modes; 44kHz stereo ~64kbps true VBR
+ last mod: $Id: mode_44c_Z.h,v 1.6.4.1 2001/10/09 04:34:55 xiphmont Exp $
+
+ ********************************************************************/
+
+#ifndef _V_MODES_44c_Z_H_
+#define _V_MODES_44c_Z_H_
+
+#include <stdio.h>
+#include "vorbis/codec.h"
+#include "backends.h"
+
+#include "books/line_128x7_class1.vqh"
+#include "books/line_128x7_class2.vqh"
+
+#include "books/line_128x7_0sub0.vqh"
+#include "books/line_128x7_1sub1.vqh"
+#include "books/line_128x7_1sub2.vqh"
+#include "books/line_128x7_1sub3.vqh"
+#include "books/line_128x7_2sub1.vqh"
+#include "books/line_128x7_2sub2.vqh"
+#include "books/line_128x7_2sub3.vqh"
+
+#include "books/line_1024x31_class0.vqh"
+#include "books/line_1024x31_class1.vqh"
+#include "books/line_1024x31_class2.vqh"
+#include "books/line_1024x31_class3.vqh"
+
+#include "books/line_1024x31_0sub0.vqh"
+#include "books/line_1024x31_0sub1.vqh"
+#include "books/line_1024x31_1sub0.vqh"
+#include "books/line_1024x31_1sub1.vqh"
+#include "books/line_1024x31_2sub1.vqh"
+#include "books/line_1024x31_2sub2.vqh"
+#include "books/line_1024x31_2sub3.vqh"
+#include "books/line_1024x31_3sub1.vqh"
+#include "books/line_1024x31_3sub2.vqh"
+#include "books/line_1024x31_3sub3.vqh"
+
+#include "books/res_44c_Z_128aux.vqh"
+#include "books/res_44c_Z_1024aux.vqh"
+
+#include "books/res_Zc_1.vqh"
+#include "books/res_Zc_2.vqh"
+#include "books/res_Zc_3.vqh"
+#include "books/res_Zc_4.vqh"
+#include "books/res_Zc_5.vqh"
+#include "books/res_Zc_6.vqh"
+#include "books/res_Zc_7.vqh"
+#include "books/res_Zc_8.vqh"
+#include "books/res_Zc_9.vqh"
+#include "books/res_Zc_9a.vqh"
+#include "books/res_Zc_9b.vqh"
+
+#include "maskadj_Z.h"
+
+static vorbis_info_psy_global _psy_set_44c_ZG={
+ 0, /* decaydBpms */
+ 8, /* lines per eighth octave */
+
+ /* thresh sample period, preecho clamp trigger threshhold, range, minenergy */
+ 256, {26.f,26.f,26.f,30.f}, {-90.f,-90.f,-90.f,-90.f}, -90.f,
+ -6.f,
+
+ 0,
+};
+
+static struct vp_couple_pass _psy_pass_44c_Z0[]={
+ {1.f,1.f,
+ {{24, 0, 0, 0},
+ {9999, 0, 0, 7.5f}}
+ },
+};
+
+static vp_couple_pass _psy_pass_44c_Z[]={
+ {1.f,1.f,
+ {{288, 0, 0, 0},
+ {9999, 0, 0, 7.5f}}
+ }
+};
+
+static float _psy_compand_44c_Z[NOISE_COMPAND_LEVELS]={
+ 0.f, 1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f, /* 7dB */
+ 8.f, 9.f, 9.f,10.f,10.f,10.f,11.f, 11.f, /* 15dB */
+ 12.f,12.f,11.f,11.f,10.f,10.f, 9.f, 9.f, /* 23dB */
+ 8.f, 8.f, 8.f, 9.f, 9.f,10.f,11.f, 12.f, /* 31dB */
+ 13.f,14.f,15.f,16.f,17.f,18.f,19.f, 20.f, /* 39dB */
+};
+
+static float _psy_compand_44c_Z0[NOISE_COMPAND_LEVELS]={
+ 0.f, 1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f, /* 7dB */
+ 8.f, 9.f,10.f,11.f,12.f,13.f,14.f, 15.f, /* 15dB */
+ 16.f,17.f,18.f,19.f,20.f,21.f,22.f, 23.f, /* 23dB */
+ 24.f,25.f,26.f,27.f,28.f,29.f,30.f, 31.f, /* 31dB */
+ 32.f,33.f,34.f,35.f,36.f,37.f,38.f, 39.f, /* 39dB */
+};
+
+static vorbis_info_psy _psy_set_44c_Z0={
+ ATH_Bark_dB_lineaggressive,
+ -100.,-110.,
+
+ /* tonemaskp */
+ 3.f, -24.f,-10.f,
+ &_vp_tonemask_consbass_Z,
+ /* peakattp, curvelimitp */
+ 1, 0, &_vp_peakatt_Z,
+
+ /*noisemaskp */
+ 1,-0.f, /* suppress any noise curve over maxspec+n */
+ 5.f, 5.f, /* low/high window */
+ 2, 2, 15,
+
+ /*63 125 250 500 1k 2k 4k 8k 16k*/
+ {-26,-26,-26,-26,-26,-22,-20,-14, -10, -2, 2, 2, 2, 2, 3, 4, 10},
+ //{-20,-20,-20,-20,-20,-20,-20,-26, -22, -22,-20,-20,-22, -22, -22,-23,-20},
+ _psy_compand_44c_Z,
+
+ 95.f, /* even decade + 5 is important; saves an rint() later in a
+ tight loop) */
+ 1,
+ _psy_pass_44c_Z0
+};
+
+static vorbis_info_psy _psy_set_44c_ZT={
+ ATH_Bark_dB_lineaggressive,
+ -100.f,-110.f,
+
+ /* tonemask */
+ 3.f,-24.f,-10.f,
+ &_vp_tonemask_consbass_Z,
+ /* peakattp,curvelimitp */
+ 1, 0, &_vp_peakatt_Z,
+
+ /*noisemaskp */
+ 1, -0.f, /* suppress any noise curve over maxspec+n */
+ .5f,.5f, /* low/high window */
+ 10,10,100,
+
+ /*63 125 250 500 1k 2k 4k 8k 16k*/
+ {-26,-26,-26,-26,-26,-20,-20,-10, -6, 0, 1, 2, 3, 3, 3, 3, 10},
+ //{-20,-20,-20,-20,-20,-20,-20,-26, -22, -22,-20,-20,-22, -22, -22,-23,-20},
+ _psy_compand_44c_Z,
+
+
+ 95.f, /* even decade + 5 is important; saves an rint() later in a
+ tight loop) */
+ 1,_psy_pass_44c_Z
+};
+
+static vorbis_info_psy _psy_set_44c_Z={
+ ATH_Bark_dB_lineaggressive,
+ -100.f, -110.f,
+
+ /* tonemask */
+ 3.f,-24.f,-10.f,
+ &_vp_tonemask_Z,
+ /* peakattp, curvelimitp */
+ 1, 0, &_vp_peakatt_Z,
+
+ /*noisemaskp */
+ 1, -0.f, /* suppress any noise curve over maxspec+n */
+ .5f,.5f, /* low/high window */
+ 10,10,100,
+
+ /*63 125 250 500 1k 2k 4k 8k 16k*/
+ {-20,-20,-20,-20,-20,-20,-20,-10, -6, 0, 1, 2, 3, 3, 3, 3, 10},
+ //{-20,-20,-20,-20,-20,-20,-20,-26, -22, -22,-20,-20,-22, -22, -22,-23,-20},
+ _psy_compand_44c_Z,
+
+
+ 95.f, /* even decade + 5 is important; saves an rint() later in a
+ tight loop) */
+ 1,_psy_pass_44c_Z
+};
+
+static vorbis_info_time0 _time_set_44c_Z={0};
+
+static vorbis_info_floor1 _floor_set_44c_Z0={
+ 3,
+ {0,1,2},
+
+ {1,3,3},
+ {0,2,2},
+ {-1,0,1},
+ {{2},{-1,3,4,5},{-1,6,7,8}},
+
+ 4,
+
+ {0,128,
+
+ 7,
+
+ 2,1,4,
+ 23,13,45},
+
+ 60,30,500,
+ 999,999,0,18.,
+ 8,70,
+ 72};
+
+static vorbis_info_floor1 _floor_set_44c_Z={
+ 10,
+ {0,1,2,2,2,2,2, 3,3,3},
+
+ {3,4,3,3},
+ {1,1,2,2},
+ {9,10,11,12},
+ {{13,14},
+ {15,16},
+ {-1,17,18,19},
+ {-1,20,21,22},
+ },
+
+ 4,
+ {0,1024,
+
+ 88,31,243,
+
+ 14,54,143,460,
+
+ 6,3,10, 22,18,26, 41,36,47,
+ 69,61,78, 112,99,126, 185,162,211,
+ 329,282,387, 672,553,825
+ },
+
+ 60,30,400,
+ 20,8,1,18.,
+ 20,600,
+ 704};
+
+static vorbis_info_residue0 _residue_set_44c_Z0={
+ 0,144, 12, 10,23,
+ {0,1,1,1,1,1,1,1,1,7},
+ {25, 26, 27, 28, 29, 30, 31, 32, 33,34,35},
+ {9999, 9999, 9999, 9999, 2,9999, 9999, 9999, 9999, 9999},
+ {.5, 1.5, 2.5f, 7.5, 1.5f,1.5, 2.5, 7.5, 22.5f},
+ {0},
+ {99, 4, 4, 4, 99,99, 99, 99, 99},
+ {3}};
+
+static vorbis_info_residue0 _residue_set_44c_Z={
+ 0,1408, 32, 10,24,
+ {0,1,1,1,1,1,1,1,1,7},
+ {25, 26, 27, 28, 29, 30, 31, 32, 33,34,35},
+ {9999, 9999, 9999, 9999, 3,9999, 9999, 9999, 9999, 9999},
+ {.5, 1.5, 2.5f, 7.5, 1.5f,1.5, 2.5, 7.5, 22.5f},
+ {0},
+ {99, 18, 18, 18, 99,99, 99, 99, 99},
+ {3}};
+
+static vorbis_info_mapping0 _mapping_set_44c_Z0={
+ 1, {0,0}, {0}, {0}, {0}, {0,0}, 1,{0},{1}};
+static vorbis_info_mapping0 _mapping_set_44c_Z={
+ 1, {0,0}, {0}, {1}, {1}, {1,2}, 1,{0},{1}};
+
+static vorbis_info_mode _mode_set_44c_Z0={0,0,0,0};
+static vorbis_info_mode _mode_set_44c_Z={1,0,0,1};
+
+codec_setup_info info_44c_Z={
+
+ /* smallblock, largeblock */
+ {256, 2048},
+ /* modes,maps,times,floors,residues,books,psys */
+ 2, 2, 1, 2, 2, 36, 3,
+ /* modes */
+ {&_mode_set_44c_Z0,&_mode_set_44c_Z},
+ /* maps */
+ {0,0},{&_mapping_set_44c_Z0,&_mapping_set_44c_Z},
+ /* times */
+ {0,0},{&_time_set_44c_Z},
+ /* floors */
+ {1,1},{&_floor_set_44c_Z0,&_floor_set_44c_Z},
+ /* residue */
+ {2,2},{&_residue_set_44c_Z0,&_residue_set_44c_Z},
+ /* books */
+
+ {
+ &_huff_book_line_128x7_class1,
+ &_huff_book_line_128x7_class2, /* 1 */
+
+ &_huff_book_line_128x7_0sub0, /* 2 */
+ &_huff_book_line_128x7_1sub1, /* 3 */
+ &_huff_book_line_128x7_1sub2,
+ &_huff_book_line_128x7_1sub3, /* 5 */
+ &_huff_book_line_128x7_2sub1,
+ &_huff_book_line_128x7_2sub2, /* 7 */
+ &_huff_book_line_128x7_2sub3,
+
+ &_huff_book_line_1024x31_class0,
+ &_huff_book_line_1024x31_class1, /* 10 */
+ &_huff_book_line_1024x31_class2,
+ &_huff_book_line_1024x31_class3, /* 12 */
+
+ &_huff_book_line_1024x31_0sub0,
+ &_huff_book_line_1024x31_0sub1, /* 14 */
+ &_huff_book_line_1024x31_1sub0,
+ &_huff_book_line_1024x31_1sub1,
+ &_huff_book_line_1024x31_2sub1,
+ &_huff_book_line_1024x31_2sub2, /* 18 */
+ &_huff_book_line_1024x31_2sub3,
+ &_huff_book_line_1024x31_3sub1,
+ &_huff_book_line_1024x31_3sub2,
+ &_huff_book_line_1024x31_3sub3, /* 22 */
+
+ &_huff_book_res_44c_Z_128aux,
+ &_huff_book_res_44c_Z_1024aux,
+
+ &_vq_book_res_Zc_1,
+ &_vq_book_res_Zc_2,
+ &_vq_book_res_Zc_3,
+ &_vq_book_res_Zc_4,
+ &_vq_book_res_Zc_5,
+ &_vq_book_res_Zc_6,
+ &_vq_book_res_Zc_7,
+ &_vq_book_res_Zc_8,
+ &_vq_book_res_Zc_9,
+ &_vq_book_res_Zc_9a,
+ &_vq_book_res_Zc_9b,
+
+ },
+ /* psy */
+ {&_psy_set_44c_Z0,&_psy_set_44c_ZT,&_psy_set_44c_Z},
+ &_psy_set_44c_ZG
+};
+
+#endif
diff --git a/lib/psy.h b/lib/psy.h
new file mode 100644
index 00000000..2b5726c6
--- /dev/null
+++ b/lib/psy.h
@@ -0,0 +1,175 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+ * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+ * *
+ * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 *
+ * by the XIPHOPHORUS Company http://www.xiph.org/ *
+
+ ********************************************************************
+
+ function: random psychoacoustics (not including preecho)
+ last mod: $Id: psy.h,v 1.24.2.1 2001/10/09 04:34:45 xiphmont Exp $
+
+ ********************************************************************/
+
+#ifndef _V_PSY_H_
+#define _V_PSY_H_
+#include "smallft.h"
+
+#include "backends.h"
+
+#define BLOCKTYPE_IMPULSE 0
+#define BLOCKTYPE_PADDING 1
+#define BLOCKTYPE_TRANSITION 0
+#define BLOCKTYPE_LONG 1
+
+
+#ifndef EHMER_MAX
+#define EHMER_MAX 56
+#endif
+
+/* psychoacoustic setup ********************************************/
+#define MAX_BARK 27
+#define P_BANDS 17
+#define P_LEVELS 11
+
+typedef struct vp_couple{
+ int limit; /* sample post */
+
+ float amppost_8phase;
+ float amppost_6phase;
+ float amppost_point;
+
+} vp_couple;
+
+typedef struct vp_couple_pass{
+ float granulem;
+ float igranulem;
+
+ vp_couple couple_pass[8];
+} vp_couple_pass;
+
+typedef struct vp_attenblock{
+ float block[P_BANDS][P_LEVELS];
+} vp_attenblock;
+
+#define NOISE_COMPAND_LEVELS 40
+typedef struct vorbis_info_psy{
+ float *ath;
+
+ float ath_adjatt;
+ float ath_maxatt;
+
+ float tone_masteratt;
+ float tone_guard;
+ float tone_abs_limit;
+ vp_attenblock *toneatt;
+
+ int peakattp;
+ int curvelimitp;
+ vp_attenblock *peakatt;
+
+ int noisemaskp;
+ float noisemaxsupp;
+ float noisewindowlo;
+ float noisewindowhi;
+ int noisewindowlomin;
+ int noisewindowhimin;
+ int noisewindowfixed;
+ float noiseoff[P_BANDS];
+ float *noisecompand;
+
+ float max_curve_dB;
+
+ vp_couple_pass *couple_pass;
+
+} vorbis_info_psy;
+
+typedef struct{
+ float decaydBpms;
+ int eighth_octave_lines;
+
+ /* for block long/short tuning; encode only */
+ int envelopesa;
+ float preecho_thresh[4];
+ float postecho_thresh[4];
+ float preecho_minenergy;
+
+ float ampmax_att_per_sec;
+
+ /* delay caching... how many samples to keep around prior to our
+ current block to aid in analysis? */
+ int delaycache;
+} vorbis_info_psy_global;
+
+typedef struct {
+ float ampmax;
+ float **decay;
+ int decaylines;
+ int channels;
+
+ vorbis_info_psy_global *gi;
+} vorbis_look_psy_global;
+
+
+typedef struct {
+ int n;
+ struct vorbis_info_psy *vi;
+
+ float ***tonecurves;
+ float *noisethresh;
+ float *noiseoffset;
+
+ float *ath;
+ long *octave; /* in n.ocshift format */
+ unsigned long *bark;
+
+ long firstoc;
+ long shiftoc;
+ int eighth_octave_lines; /* power of two, please */
+ int total_octave_lines;
+ long rate; /* cache it */
+} vorbis_look_psy;
+
+extern void _vp_psy_init(vorbis_look_psy *p,vorbis_info_psy *vi,
+ vorbis_info_psy_global *gi,int n,long rate);
+extern void _vp_psy_clear(vorbis_look_psy *p);
+extern void *_vi_psy_dup(void *source);
+
+extern void _vi_psy_free(vorbis_info_psy *i);
+extern vorbis_info_psy *_vi_psy_copy(vorbis_info_psy *i);
+
+extern void _vp_remove_floor(vorbis_look_psy *p,
+ vorbis_look_psy_global *g,
+ float *logmdct,
+ float *mdct,
+ float *codedflr,
+ float *residue,
+ float local_specmax);
+
+extern void _vp_compute_mask(vorbis_look_psy *p,
+ vorbis_look_psy_global *g,
+ int channel,
+ float *fft,
+ float *mdct,
+ float *mask,
+ float global_specmax,
+ float local_specmax,
+ int lastsize);
+
+extern void _vp_quantize_couple(vorbis_look_psy *p,
+ vorbis_info_mapping0 *vi,
+ float **pcm,
+ float **sofar,
+ float **quantized,
+ int *nonzero,
+ int passno);
+
+extern float _vp_ampmax_decay(float amp,vorbis_dsp_state *vd);
+
+#endif
+
+
diff --git a/lib/res0.c b/lib/res0.c
new file mode 100644
index 00000000..bef7cbf3
--- /dev/null
+++ b/lib/res0.c
@@ -0,0 +1,918 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+ * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+ * *
+ * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 *
+ * by the XIPHOPHORUS Company http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: residue backend 0, 1 and 2 implementation
+ last mod: $Id: res0.c,v 1.37.2.1 2001/10/09 04:34:45 xiphmont Exp $
+
+ ********************************************************************/
+
+/* Slow, slow, slow, simpleminded and did I mention it was slow? The
+ encode/decode loops are coded for clarity and performance is not
+ yet even a nagging little idea lurking in the shadows. Oh and BTW,
+ it's slow. */
+
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+#include <stdio.h>
+#include <ogg/ogg.h>
+#include "vorbis/codec.h"
+#include "codec_internal.h"
+#include "registry.h"
+#include "codebook.h"
+#include "misc.h"
+#include "os.h"
+
+typedef struct {
+ vorbis_info_residue0 *info;
+ int map;
+
+ int parts;
+ int stages;
+ codebook *fullbooks;
+ codebook *phrasebook;
+ codebook ***partbooks;
+
+ int partvals;
+ int **decodemap;
+
+ long postbits;
+ long phrasebits;
+ long frames;
+
+ int qoffsets[8];
+
+} vorbis_look_residue0;
+
+vorbis_info_residue *res0_copy_info(vorbis_info_residue *vr){
+ vorbis_info_residue0 *info=(vorbis_info_residue0 *)vr;
+ vorbis_info_residue0 *ret=_ogg_malloc(sizeof(*ret));
+ memcpy(ret,info,sizeof(*ret));
+ return(ret);
+}
+
+void res0_free_info(vorbis_info_residue *i){
+ vorbis_info_residue0 *info=(vorbis_info_residue0 *)i;
+ if(info){
+ memset(info,0,sizeof(*info));
+ _ogg_free(info);
+ }
+}
+
+void res0_free_look(vorbis_look_residue *i){
+ int j;
+ if(i){
+
+ vorbis_look_residue0 *look=(vorbis_look_residue0 *)i;
+
+ fprintf(stderr,"residue bit usage %f:%f (%f total)\n",
+ (float)look->phrasebits/look->frames,
+ (float)look->postbits/look->frames,
+ (float)(look->postbits+look->phrasebits)/look->frames);
+
+ /*vorbis_info_residue0 *info=look->info;
+
+ fprintf(stderr,
+ "%ld frames encoded in %ld phrasebits and %ld residue bits "
+ "(%g/frame) \n",look->frames,look->phrasebits,
+ look->resbitsflat,
+ (look->phrasebits+look->resbitsflat)/(float)look->frames);
+
+ for(j=0;j<look->parts;j++){
+ long acc=0;
+ fprintf(stderr,"\t[%d] == ",j);
+ for(k=0;k<look->stages;k++)
+ if((info->secondstages[j]>>k)&1){
+ fprintf(stderr,"%ld,",look->resbits[j][k]);
+ acc+=look->resbits[j][k];
+ }
+
+ fprintf(stderr,":: (%ld vals) %1.2fbits/sample\n",look->resvals[j],
+ acc?(float)acc/(look->resvals[j]*info->grouping):0);
+ }
+ fprintf(stderr,"\n");*/
+
+ for(j=0;j<look->parts;j++)
+ if(look->partbooks[j])_ogg_free(look->partbooks[j]);
+ _ogg_free(look->partbooks);
+ for(j=0;j<look->partvals;j++)
+ _ogg_free(look->decodemap[j]);
+ _ogg_free(look->decodemap);
+ memset(look,0,sizeof(*look));
+ _ogg_free(look);
+ }
+}
+
+static int ilog(unsigned int v){
+ int ret=0;
+ while(v){
+ ret++;
+ v>>=1;
+ }
+ return(ret);
+}
+
+static int icount(unsigned int v){
+ int ret=0;
+ while(v){
+ ret+=v&1;
+ v>>=1;
+ }
+ return(ret);
+}
+
+
+void res0_pack(vorbis_info_residue *vr,oggpack_buffer *opb){
+ vorbis_info_residue0 *info=(vorbis_info_residue0 *)vr;
+ int j,acc=0;
+ oggpack_write(opb,info->begin,24);
+ oggpack_write(opb,info->end,24);
+
+ oggpack_write(opb,info->grouping-1,24); /* residue vectors to group and
+ code with a partitioned book */
+ oggpack_write(opb,info->partitions-1,6); /* possible partition choices */
+ oggpack_write(opb,info->groupbook,8); /* group huffman book */
+
+ /* secondstages is a bitmask; as encoding progresses pass by pass, a
+ bitmask of one indicates this partition class has bits to write
+ this pass */
+ for(j=0;j<info->partitions;j++){
+ if(ilog(info->secondstages[j])>3){
+ /* yes, this is a minor hack due to not thinking ahead */
+ oggpack_write(opb,info->secondstages[j],3);
+ oggpack_write(opb,1,1);
+ oggpack_write(opb,info->secondstages[j]>>3,5);
+ }else
+ oggpack_write(opb,info->secondstages[j],4); /* trailing zero */
+ acc+=icount(info->secondstages[j]);
+ }
+ for(j=0;j<acc;j++)
+ oggpack_write(opb,info->booklist[j],8);
+
+}
+
+/* vorbis_info is for range checking */
+vorbis_info_residue *res0_unpack(vorbis_info *vi,oggpack_buffer *opb){
+ int j,acc=0;
+ vorbis_info_residue0 *info=_ogg_calloc(1,sizeof(*info));
+ codec_setup_info *ci=vi->codec_setup;
+
+ info->begin=oggpack_read(opb,24);
+ info->end=oggpack_read(opb,24);
+ info->grouping=oggpack_read(opb,24)+1;
+ info->partitions=oggpack_read(opb,6)+1;
+ info->groupbook=oggpack_read(opb,8);
+
+ for(j=0;j<info->partitions;j++){
+ int cascade=oggpack_read(opb,3);
+ if(oggpack_read(opb,1))
+ cascade|=(oggpack_read(opb,5)<<3);
+ info->secondstages[j]=cascade;
+
+ acc+=icount(cascade);
+ }
+ for(j=0;j<acc;j++)
+ info->booklist[j]=oggpack_read(opb,8);
+
+ if(info->groupbook>=ci->books)goto errout;
+ for(j=0;j<acc;j++)
+ if(info->booklist[j]>=ci->books)goto errout;
+
+ return(info);
+ errout:
+ res0_free_info(info);
+ return(NULL);
+}
+
+vorbis_look_residue *res0_look(vorbis_dsp_state *vd,vorbis_info_mode *vm,
+ vorbis_info_residue *vr){
+ vorbis_info_residue0 *info=(vorbis_info_residue0 *)vr;
+ vorbis_look_residue0 *look=_ogg_calloc(1,sizeof(*look));
+ backend_lookup_state *be=vd->backend_state;
+
+ int j,k,acc=0;
+ int dim;
+ int maxstage=0;
+ look->info=info;
+ look->map=vm->mapping;
+
+ look->parts=info->partitions;
+ look->fullbooks=be->fullbooks;
+ look->phrasebook=be->fullbooks+info->groupbook;
+ dim=look->phrasebook->dim;
+
+ look->partbooks=_ogg_calloc(look->parts,sizeof(*look->partbooks));
+
+ for(j=0;j<look->parts;j++){
+ int stages=ilog(info->secondstages[j]);
+ if(stages){
+ if(stages>maxstage)maxstage=stages;
+ look->partbooks[j]=_ogg_calloc(stages,sizeof(*look->partbooks[j]));
+ for(k=0;k<stages;k++)
+ if(info->secondstages[j]&(1<<k))
+ look->partbooks[j][k]=be->fullbooks+info->booklist[acc++];
+ }
+ }
+
+ look->partvals=rint(pow(look->parts,dim));
+ look->stages=maxstage;
+ look->decodemap=_ogg_malloc(look->partvals*sizeof(*look->decodemap));
+ for(j=0;j<look->partvals;j++){
+ long val=j;
+ long mult=look->partvals/look->parts;
+ look->decodemap[j]=_ogg_malloc(dim*sizeof(*look->decodemap[j]));
+ for(k=0;k<dim;k++){
+ long deco=val/mult;
+ val-=deco*mult;
+ mult/=look->parts;
+ look->decodemap[j][k]=deco;
+ }
+ }
+
+ {
+ int samples_per_partition=info->grouping;
+ int n=info->end-info->begin,i;
+ int partvals=n/samples_per_partition;
+
+ for(i=0;i<8;i++)
+ look->qoffsets[i]=partvals*(i+1)/8;
+ }
+
+ return(look);
+}
+
+
+/* does not guard against invalid settings; eg, a subn of 16 and a
+ subgroup request of 32. Max subn of 128 */
+static int _interleaved_testhack(float *vec,int n,vorbis_look_residue0 *look,
+ int auxparts,int auxpartnum){
+ vorbis_info_residue0 *info=look->info;
+ int i,j=0;
+ float max,localmax=0.f;
+ float temp[128];
+ float entropy[8];
+
+ /* setup */
+ for(i=0;i<n;i++)temp[i]=fabs(vec[i]);
+
+ /* handle case subgrp==1 outside */
+ for(i=0;i<n;i++)
+ if(temp[i]>localmax)localmax=temp[i];
+ max=localmax;
+
+ for(i=0;i<n;i++)temp[i]=rint(temp[i]);
+
+ while(1){
+ entropy[j]=localmax;
+ n>>=1;
+ if(!n)break;
+ j++;
+
+ for(i=0;i<n;i++){
+ temp[i]+=temp[i+n];
+ }
+ localmax=0.f;
+ for(i=0;i<n;i++)
+ if(temp[i]>localmax)localmax=temp[i];
+ }
+
+ for(i=0;i<auxparts-1;i++)
+ if(auxpartnum<info->blimit[i] &&
+ entropy[info->subgrp[i]]<=info->entmax[i] &&
+ max<=info->ampmax[i])
+ break;
+
+ return(i);
+}
+
+static int _testhack(float *vec,int n,vorbis_look_residue0 *look,
+ int auxparts,int auxpartnum){
+ vorbis_info_residue0 *info=look->info;
+ int i;
+ float max=0.f;
+ float temp[128];
+ float entropy=0.f;
+
+ /* setup */
+ for(i=0;i<n;i++)temp[i]=fabs(vec[i]);
+
+ for(i=0;i<n;i++)
+ if(temp[i]>max)max=temp[i];
+
+ for(i=0;i<n;i++)temp[i]=rint(temp[i]);
+
+ for(i=0;i<n;i++)
+ entropy+=temp[i];
+
+ for(i=0;i<auxparts-1;i++)
+ if(auxpartnum<info->blimit[i] &&
+ entropy<=info->entmax[i] &&
+ max<=info->ampmax[i])
+ break;
+
+ return(i);
+}
+
+static int _interleaved_encodepart(oggpack_buffer *opb,float *vec, int n,
+ codebook *book,vorbis_look_residue0 *look){
+ int i,bits=0;
+ int dim=book->dim;
+ int step=n/dim;
+#ifdef TRAIN_RESENT
+ char buf[80];
+ FILE *f;
+ sprintf(buf,"res0_b%d.vqd",book-look->fullbooks);
+ f=fopen(buf,"a");
+#endif
+
+ for(i=0;i<step;i++){
+ int entry=vorbis_book_besterror(book,vec+i,step,0);
+
+#ifdef TRAIN_RESENT
+ fprintf(f,"%d\n",entry);
+#endif
+
+ bits+=vorbis_book_encode(book,entry,opb);
+ }
+
+#ifdef TRAIN_RESENT
+ fclose(f);
+#endif
+ return(bits);
+}
+
+static int _encodepart(oggpack_buffer *opb,float *vec, int n,
+ codebook *book,vorbis_look_residue0 *look){
+ int i,bits=0;
+ int dim=book->dim;
+ int step=n/dim;
+#ifdef TRAIN_RESENT
+ char buf[80];
+ FILE *f;
+ sprintf(buf,"res0_b%d.vqd",book-look->fullbooks);
+ f=fopen(buf,"a");
+#endif
+
+ for(i=0;i<step;i++){
+ int entry=vorbis_book_besterror(book,vec+i*dim,1,0);
+
+#ifdef TRAIN_RESENT
+ fprintf(f,"%d\n",entry);
+#endif
+
+ bits+=vorbis_book_encode(book,entry,opb);
+ }
+
+#ifdef TRAIN_RESENT
+ fclose(f);
+#endif
+ return(bits);
+}
+
+static long **_01class(vorbis_block *vb,vorbis_look_residue *vl,
+ float **in,int ch,
+ int (*classify)(float *,int,vorbis_look_residue0 *,
+ int,int)){
+ long i,j;
+ vorbis_look_residue0 *look=(vorbis_look_residue0 *)vl;
+ vorbis_info_residue0 *info=look->info;
+
+ /* move all this setup out later */
+ int samples_per_partition=info->grouping;
+ int possible_partitions=info->partitions;
+ int n=info->end-info->begin;
+
+ int partvals=n/samples_per_partition;
+ long **partword=_vorbis_block_alloc(vb,ch*sizeof(*partword));
+
+ /* we find the partition type for each partition of each
+ channel. We'll go back and do the interleaved encoding in a
+ bit. For now, clarity */
+
+ for(i=0;i<ch;i++){
+ partword[i]=_vorbis_block_alloc(vb,n/samples_per_partition*sizeof(*partword[i]));
+ memset(partword[i],0,n/samples_per_partition*sizeof(*partword[i]));
+ }
+
+ for(i=0;i<partvals;i++){
+ for(j=0;j<ch;j++)
+ /* do the partition decision based on the 'entropy'
+ int the block */
+ partword[j][i]=
+ classify(in[j]+i*samples_per_partition+info->begin,
+ samples_per_partition,look,possible_partitions,i);
+
+ }
+
+#ifdef TRAIN_RES
+ {
+ FILE *of;
+ char buffer[80];
+
+ for(i=0;i<ch;i++){
+ sprintf(buffer,"resaux_%d.vqd",vb->mode);
+ of=fopen(buffer,"a");
+ for(j=0;j<partvals;j++)
+ fprintf(of,"%ld, ",partword[i][j]);
+ fprintf(of,"\n");
+ fclose(of);
+ }
+ }
+#endif
+ look->frames++;
+
+ return(partword);
+}
+
+static long **_2class(vorbis_block *vb,vorbis_look_residue *vl,
+ float **in,int ch,
+ int (*classify)(float *,int,vorbis_look_residue0 *,
+ int,int)){
+ long i,j,k,l;
+ vorbis_look_residue0 *look=(vorbis_look_residue0 *)vl;
+ vorbis_info_residue0 *info=look->info;
+
+ /* move all this setup out later */
+ int samples_per_partition=info->grouping;
+ int possible_partitions=info->partitions;
+ int n=info->end-info->begin;
+
+ int partvals=n/samples_per_partition;
+ long **partword=_vorbis_block_alloc(vb,sizeof(*partword));
+ float *work=alloca(sizeof(*work)*samples_per_partition);
+
+ partword[0]=_vorbis_block_alloc(vb,n*ch/samples_per_partition*sizeof(*partword[0]));
+ memset(partword[0],0,n*ch/samples_per_partition*sizeof(*partword[0]));
+
+ for(i=0,j=0,k=0,l=info->begin;i<partvals;i++){
+ for(k=0;k<samples_per_partition;k++){
+ work[k]=in[j][l];
+ j++;
+ if(j>=ch){
+ j=0;
+ l++;
+ }
+ }
+ partword[0][i]=
+ classify(work,samples_per_partition,look,possible_partitions,i);
+ }
+
+#ifdef TRAIN_RES
+ {
+ FILE *of;
+ char buffer[80];
+
+ sprintf(buffer,"resaux_%d.vqd",vb->mode);
+ of=fopen(buffer,"a");
+ for(i=0;i<partvals;i++)
+ fprintf(of,"%ld, ",partword[0][i]);
+ fprintf(of,"\n");
+ fclose(of);
+ }
+#endif
+ look->frames++;
+
+ return(partword);
+}
+
+static int _01forward(vorbis_block *vb,vorbis_look_residue *vl,
+ float **in,int ch,
+ int pass,long **partword,
+ int (*encode)(oggpack_buffer *,float *,int,
+ codebook *,vorbis_look_residue0 *),
+ double passlimit,ogg_uint32_t *stats){
+ long i,j,k,s;
+ vorbis_look_residue0 *look=(vorbis_look_residue0 *)vl;
+ vorbis_info_residue0 *info=look->info;
+
+ vorbis_dsp_state *vd=vb->vd;
+ vorbis_info *vi=vd->vi;
+ codec_setup_info *ci=vi->codec_setup;
+
+
+ /* move all this setup out later */
+ int samples_per_partition=info->grouping;
+ int possible_partitions=info->partitions;
+ int partitions_per_word=look->phrasebook->dim;
+ int n=info->end-info->begin;
+
+ int partvals=n/samples_per_partition;
+ long resbits[128];
+ long resvals[128];
+
+ long wholepasses;
+ long partialpass;
+ int stoppos=0;
+
+ if((int)passlimit<ci->passlimit[pass]){
+ wholepasses=passlimit;
+ partialpass=rint((passlimit-wholepasses)*partvals);
+ }else{
+ wholepasses=ci->passlimit[pass];
+ partialpass=0;
+ }
+
+#ifdef TRAIN_RES
+ FILE *of;
+ char buffer[80];
+ int m;
+
+ for(i=0;i<ch;i++){
+ sprintf(buffer,"residue_%d#%d.vqd",vb->mode,pass);
+ of=fopen(buffer,"a");
+ for(m=0;m<info->end;m++)
+ fprintf(of,"%.2f, ",in[i][m]);
+ fprintf(of,"\n");
+ fclose(of);
+ }
+#endif
+
+ memset(resbits,0,sizeof(resbits));
+ memset(resvals,0,sizeof(resvals));
+
+ /* we code the partition words for each channel, then the residual
+ words for a partition per channel until we've written all the
+ residual words for that partition word. Then write the next
+ partition channel words... */
+
+ for(s=(pass==0?0:ci->passlimit[pass-1]);s<ci->passlimit[pass];s++){
+ int eighth=0;
+ ogg_uint32_t *qptr=NULL;
+ if(stats)qptr=stats+s*8;
+
+ for(i=0;i<partvals;){
+
+ if(!stoppos &&
+ s>=wholepasses &&
+ i>=partialpass)
+ stoppos=oggpack_bytes(&vb->opb);
+
+ /* first we encode a partition codeword for each channel */
+ if(s==0){
+ for(j=0;j<ch;j++){
+ long val=partword[j][i];
+ long ret;
+ for(k=1;k<partitions_per_word;k++){
+ val*=possible_partitions;
+ if(i+k<partvals)
+ val+=partword[j][i+k];
+ }
+
+ /* training hack */
+ if(val<look->phrasebook->entries)
+ ret=vorbis_book_encode(look->phrasebook,val,&vb->opb);
+ else
+ fprintf(stderr,"!");
+
+ look->phrasebits+=ret;
+
+ }
+ }
+
+ /* now we encode interleaved residual values for the partitions */
+ for(k=0;k<partitions_per_word && i<partvals;k++,i++){
+ long offset=i*samples_per_partition+info->begin;
+
+ if(!stoppos &&
+ s>=wholepasses &&
+ i>=partialpass)
+ stoppos=oggpack_bytes(&vb->opb);
+
+ for(j=0;j<ch;j++){
+ if(s==0)resvals[partword[j][i]]+=samples_per_partition;
+ if(info->secondstages[partword[j][i]]&(1<<s)){
+ codebook *statebook=look->partbooks[partword[j][i]][s];
+ if(statebook){
+ int ret=encode(&vb->opb,in[j]+offset,samples_per_partition,
+ statebook,look);
+ look->postbits+=ret;
+ resbits[partword[j][i]]+=ret;
+ }
+ }
+ }
+
+ if(qptr)while(i>=look->qoffsets[eighth])
+ qptr[eighth++]=oggpack_bits(&vb->opb);
+
+
+
+ }
+ }
+ }
+
+ /*{
+ long total=0;
+ long totalbits=0;
+ fprintf(stderr,"%d :: ",vb->mode);
+ for(k=0;k<possible_partitions;k++){
+ fprintf(stderr,"%ld/%1.2g, ",resvals[k],(float)resbits[k]/resvals[k]);
+ total+=resvals[k];
+ totalbits+=resbits[k];
+ }
+
+ fprintf(stderr,":: %ld:%1.2g\n",total,(double)totalbits/total);
+ }*/
+ return(stoppos);
+}
+
+/* a truncated packet here just means 'stop working'; it's not an error */
+static int _01inverse(vorbis_block *vb,vorbis_look_residue *vl,
+ float **in,int ch,
+ long (*decodepart)(codebook *, float *,
+ oggpack_buffer *,int)){
+
+ long i,j,k,l,s;
+ vorbis_look_residue0 *look=(vorbis_look_residue0 *)vl;
+ vorbis_info_residue0 *info=look->info;
+
+ /* move all this setup out later */
+ int samples_per_partition=info->grouping;
+ int partitions_per_word=look->phrasebook->dim;
+ int n=info->end-info->begin;
+
+ int partvals=n/samples_per_partition;
+ int partwords=(partvals+partitions_per_word-1)/partitions_per_word;
+ int ***partword=alloca(ch*sizeof(*partword));
+
+ for(j=0;j<ch;j++)
+ partword[j]=_vorbis_block_alloc(vb,partwords*sizeof(*partword[j]));
+
+ for(s=0;s<look->stages;s++){
+
+ /* each loop decodes on partition codeword containing
+ partitions_pre_word partitions */
+ for(i=0,l=0;i<partvals;l++){
+ if(s==0){
+ /* fetch the partition word for each channel */
+ for(j=0;j<ch;j++){
+ int temp=vorbis_book_decode(look->phrasebook,&vb->opb);
+ if(temp==-1)goto eopbreak;
+ partword[j][l]=look->decodemap[temp];
+ if(partword[j][l]==NULL)goto errout;
+ }
+ }
+
+ /* now we decode residual values for the partitions */
+ for(k=0;k<partitions_per_word && i<partvals;k++,i++)
+ for(j=0;j<ch;j++){
+ long offset=info->begin+i*samples_per_partition;
+ if(info->secondstages[partword[j][l][k]]&(1<<s)){
+ codebook *stagebook=look->partbooks[partword[j][l][k]][s];
+ if(stagebook){
+ if(decodepart(stagebook,in[j]+offset,&vb->opb,
+ samples_per_partition)==-1)goto eopbreak;
+ }
+ }
+ }
+ }
+ }
+
+ errout:
+ eopbreak:
+ return(0);
+}
+
+/* residue 0 and 1 are just slight variants of one another. 0 is
+ interleaved, 1 is not */
+long **res0_class(vorbis_block *vb,vorbis_look_residue *vl,
+ float **in,int *nonzero,int ch){
+ /* we encode only the nonzero parts of a bundle */
+ int i,used=0;
+ for(i=0;i<ch;i++)
+ if(nonzero[i])
+ in[used++]=in[i];
+ if(used)
+ /*return(_01class(vb,vl,in,used,_interleaved_testhack));*/
+ return(_01class(vb,vl,in,used,_testhack));
+ else
+ return(0);
+}
+
+int res0_forward(vorbis_block *vb,vorbis_look_residue *vl,
+ float **in,float **out,int *nonzero,int ch,
+ int pass, long **partword,double passlimit,ogg_uint32_t *stats){
+ /* we encode only the nonzero parts of a bundle */
+ int i,j,used=0,n=vb->pcmend/2;
+ for(i=0;i<ch;i++)
+ if(nonzero[i]){
+ for(j=0;j<n;j++)
+ out[i][j]+=in[i][j];
+ in[used++]=in[i];
+ }
+ if(used){
+ int ret=_01forward(vb,vl,in,used,pass,partword,
+ _interleaved_encodepart,passlimit,stats);
+ used=0;
+ for(i=0;i<ch;i++)
+ if(nonzero[i]){
+ for(j=0;j<n;j++)
+ out[i][j]-=in[used][j];
+ used++;
+ }
+ return(ret);
+ }else
+ return(0);
+}
+
+int res0_inverse(vorbis_block *vb,vorbis_look_residue *vl,
+ float **in,int *nonzero,int ch){
+ int i,used=0;
+ for(i=0;i<ch;i++)
+ if(nonzero[i])
+ in[used++]=in[i];
+ if(used)
+ return(_01inverse(vb,vl,in,used,vorbis_book_decodevs_add));
+ else
+ return(0);
+}
+
+int res1_forward(vorbis_block *vb,vorbis_look_residue *vl,
+ float **in,float **out,int *nonzero,int ch,
+ int pass, long **partword, double passlimit,ogg_uint32_t *stats){
+ int i,j,used=0,n=vb->pcmend/2;
+ for(i=0;i<ch;i++)
+ if(nonzero[i]){
+ for(j=0;j<n;j++)
+ out[i][j]+=in[i][j];
+ in[used++]=in[i];
+ }
+
+ if(used){
+ int ret=_01forward(vb,vl,in,used,pass,partword,_encodepart,passlimit,stats);
+ used=0;
+ for(i=0;i<ch;i++)
+ if(nonzero[i]){
+ for(j=0;j<n;j++)
+ out[i][j]-=in[used][j];
+ used++;
+ }
+ return(ret);
+ }else
+ return(0);
+}
+
+long **res1_class(vorbis_block *vb,vorbis_look_residue *vl,
+ float **in,int *nonzero,int ch){
+ int i,used=0;
+ for(i=0;i<ch;i++)
+ if(nonzero[i])
+ in[used++]=in[i];
+ if(used)
+ return(_01class(vb,vl,in,used,_testhack));
+ else
+ return(0);
+}
+
+int res1_inverse(vorbis_block *vb,vorbis_look_residue *vl,
+ float **in,int *nonzero,int ch){
+ int i,used=0;
+ for(i=0;i<ch;i++)
+ if(nonzero[i])
+ in[used++]=in[i];
+ if(used)
+ return(_01inverse(vb,vl,in,used,vorbis_book_decodev_add));
+ else
+ return(0);
+}
+
+long **res2_class(vorbis_block *vb,vorbis_look_residue *vl,
+ float **in,int *nonzero,int ch){
+ int i,used=0;
+ for(i=0;i<ch;i++)
+ if(nonzero[i])
+ in[used++]=in[i];
+ if(used)
+ return(_2class(vb,vl,in,used,_testhack));
+ else
+ return(0);
+}
+
+/* res2 is slightly more different; all the channels are interleaved
+ into a single vector and encoded. */
+
+int res2_forward(vorbis_block *vb,vorbis_look_residue *vl,
+ float **in,float **out,int *nonzero,int ch,
+ int pass,long **partword,double passlimit, ogg_uint32_t *stats){
+ long i,j,k,n=vb->pcmend/2,used=0;
+
+ /* don't duplicate the code; use a working vector hack for now and
+ reshape ourselves into a single channel res1 */
+ /* ugly; reallocs for each coupling pass :-( */
+ float *work=_vorbis_block_alloc(vb,ch*n*sizeof(*work));
+ for(i=0;i<ch;i++){
+ float *pcm=in[i];
+ if(nonzero[i])used++;
+ for(j=0,k=i;j<n;j++,k+=ch)
+ work[k]=pcm[j];
+ }
+
+ if(used){
+ int ret=_01forward(vb,vl,&work,1,pass,partword,_encodepart,passlimit,stats);
+ /* update the sofar vector */
+ for(i=0;i<ch;i++){
+ float *pcm=in[i];
+ float *sofar=out[i];
+ for(j=0,k=i;j<n;j++,k+=ch)
+ sofar[j]+=pcm[j]-work[k];
+ }
+
+ return(ret);
+ }else
+ return(0);
+}
+
+/* duplicate code here as speed is somewhat more important */
+int res2_inverse(vorbis_block *vb,vorbis_look_residue *vl,
+ float **in,int *nonzero,int ch){
+ long i,k,l,s;
+ vorbis_look_residue0 *look=(vorbis_look_residue0 *)vl;
+ vorbis_info_residue0 *info=look->info;
+
+ /* move all this setup out later */
+ int samples_per_partition=info->grouping;
+ int partitions_per_word=look->phrasebook->dim;
+ int n=info->end-info->begin;
+
+ int partvals=n/samples_per_partition;
+ int partwords=(partvals+partitions_per_word-1)/partitions_per_word;
+ int **partword=_vorbis_block_alloc(vb,partwords*sizeof(*partword));
+
+ for(i=0;i<ch;i++)if(nonzero[i])break;
+ if(i==ch)return(0); /* no nonzero vectors */
+
+ for(s=0;s<look->stages;s++){
+ for(i=0,l=0;i<partvals;l++){
+
+ if(s==0){
+ /* fetch the partition word */
+ int temp=vorbis_book_decode(look->phrasebook,&vb->opb);
+ if(temp==-1)goto eopbreak;
+ partword[l]=look->decodemap[temp];
+ if(partword[l]==NULL)goto errout;
+ }
+
+ /* now we decode residual values for the partitions */
+ for(k=0;k<partitions_per_word && i<partvals;k++,i++)
+ if(info->secondstages[partword[l][k]]&(1<<s)){
+ codebook *stagebook=look->partbooks[partword[l][k]][s];
+
+ if(stagebook){
+ if(vorbis_book_decodevv_add(stagebook,in,
+ i*samples_per_partition+info->begin,ch,
+ &vb->opb,samples_per_partition)==-1)
+ goto eopbreak;
+ }
+ }
+ }
+ }
+
+ errout:
+ eopbreak:
+ return(0);
+}
+
+
+vorbis_func_residue residue0_exportbundle={
+ &res0_pack,
+ &res0_unpack,
+ &res0_look,
+ &res0_copy_info,
+ &res0_free_info,
+ &res0_free_look,
+ &res0_class,
+ &res0_forward,
+ &res0_inverse
+};
+
+vorbis_func_residue residue1_exportbundle={
+ &res0_pack,
+ &res0_unpack,
+ &res0_look,
+ &res0_copy_info,
+ &res0_free_info,
+ &res0_free_look,
+ &res1_class,
+ &res1_forward,
+ &res1_inverse
+};
+
+vorbis_func_residue residue2_exportbundle={
+ &res0_pack,
+ &res0_unpack,
+ &res0_look,
+ &res0_copy_info,
+ &res0_free_info,
+ &res0_free_look,
+ &res2_class,
+ &res2_forward,
+ &res2_inverse
+};
diff --git a/vq/res_44c_A.vqs b/vq/res_44c_A.vqs
new file mode 100644
index 00000000..d4ad4064
--- /dev/null
+++ b/vq/res_44c_A.vqs
@@ -0,0 +1,47 @@
+huffbuild line_128x19_class1.vqd 0-64
+huffbuild line_128x19_class2.vqd 0-64
+
+huffbuild line_128x19_0sub0.vqd 0-64
+huffbuild line_128x19_1sub1.vqd 1-9
+huffbuild line_128x19_1sub2.vqd 9-25
+huffbuild line_128x19_1sub3.vqd 25-64
+huffbuild line_128x19_2sub1.vqd 1-9
+huffbuild line_128x19_2sub2.vqd 9-25
+huffbuild line_128x19_2sub3.vqd 25-64
+
+residuesplit residue_0#0.vqd 0,192,16 res_A ,.7, ,1.5,8 ,1.5 ,2.5,3 ,2.5,8 ,2.5 ,4.5 ,17.5 ,84.5
+mv res_Aaux.vqd res_44c_A_128aux.vqd
+
+residuesplit residue_1#0.vqd 0,1792,32 res_B ,.7, ,1.5,32 ,1.5 ,2.5,18 ,2.5,32 ,2.5 ,4.5 ,17.5 ,84.5
+mv res_Baux.vqd res_44c_A_1024aux.vqd
+
+
+GO
+
+>res_Ac_128 noninterleaved
+haux res_44c_A_128aux.vqd 0,12,2
+
+>res_Ac noninterleaved
+haux res_44c_A_1024aux.vqd 0,56,2
+
+:_1 res_B_1.vqd, 4, nonseq cull, 0 +- 1
+:_2 res_B_2.vqd, 4, nonseq cull, 0 +- 1
+:_3 res_B_3.vqd, 4, nonseq cull, 0 +- 1 2
+:_4 res_B_4.vqd, 4, nonseq cull, 0 +- 1 2
+:_5 res_B_5.vqd, 4, nonseq cull, 0 +- 1 2
+:_6 res_B_6.vqd, 2, nonseq cull, 0 +- 1 2 3 4
+:_7 res_B_7.vqd, 2, nonseq cull, 0 +- 5 10 15
++_7a, 4, nonseq cull, 0 +- 1 2
+
+:_8 res_B_8.vqd, 2, nonseq cull, 0 +- 13 26 39 52 65 78
++_8a, 2, nonseq cull, 0 +- 1 2 3 4 5 6
+
+:_9 res_B_9.vqd, 2, nonseq, 0 +- 169 338 507
++_9a, 2, nonseq, 0 +- 13 26 39 52 65 78
++_9b, 2, nonseq, 0 +- 1 2 3 4 5 6
+
+
+
+
+
+
diff --git a/vq/res_44c_Z.vqs b/vq/res_44c_Z.vqs
new file mode 100644
index 00000000..2b4859cf
--- /dev/null
+++ b/vq/res_44c_Z.vqs
@@ -0,0 +1,63 @@
+huffbuild line_128x7_class1.vqd 0-64
+huffbuild line_128x7_class2.vqd 0-64
+
+huffbuild line_128x7_0sub0.vqd 0-64
+huffbuild line_128x7_1sub1.vqd 1-9
+huffbuild line_128x7_1sub2.vqd 9-25
+huffbuild line_128x7_1sub3.vqd 25-64
+huffbuild line_128x7_2sub1.vqd 1-9
+huffbuild line_128x7_2sub2.vqd 9-25
+huffbuild line_128x7_2sub3.vqd 25-64
+
+huffbuild line_1024x31_class0.vqd 0-8
+huffbuild line_1024x31_class1.vqd 0-16
+huffbuild line_1024x31_class2.vqd 0-64
+huffbuild line_1024x31_class3.vqd 0-64
+
+huffbuild line_1024x31_0sub0.vqd 0-16
+huffbuild line_1024x31_0sub1.vqd 16-64
+
+huffbuild line_1024x31_1sub0.vqd 0-16
+huffbuild line_1024x31_1sub1.vqd 16-64
+
+huffbuild line_1024x31_2sub1.vqd 1-9
+huffbuild line_1024x31_2sub2.vqd 9-25
+huffbuild line_1024x31_2sub3.vqd 25-64
+huffbuild line_1024x31_3sub1.vqd 1-9
+huffbuild line_1024x31_3sub2.vqd 9-25
+huffbuild line_1024x31_3sub3.vqd 25-64
+
+residuesplit residue_0#0.vqd 0,144,12 res_A ,.5 ,1.5,4 ,2.5,4 ,7.5,4 2,1.5 ,1.5 ,2.5 ,7.5 ,22.5
+mv res_Aaux.vqd res_44c_Z_128aux.vqd
+
+residuesplit residue_1#0.vqd 0,1408,32 res_B ,.5 ,1.5,18 ,2.5,18 ,7.5,18 3,1.5 ,1.5 ,2.5 ,7.5 ,22.5
+mv res_Baux.vqd res_44c_Z_1024aux.vqd
+
+GO
+
+>res_Zc_128 noninterleaved
+haux res_44c_Z_128aux.vqd 0,12,3
+
+>res_Zc noninterleaved
+haux res_44c_Z_1024aux.vqd 0,44,2
+
+:_1 res_B_1.vqd, 4, nonseq cull, 0 +- 1
+:_2 res_B_2.vqd, 4, nonseq cull, 0 +- 1 2
+:_3 res_B_3.vqd, 2, nonseq cull, 0 +- 1 2 3 4 5 6 7
+
+:_4 res_B_4.vqd, 4, nonseq cull, 0 +- 1
+:_5 res_B_5.vqd, 4, nonseq cull, 0 +- 1
+:_6 res_B_6.vqd, 4, nonseq cull, 0 +- 1 2
+:_7 res_B_7.vqd, 2, nonseq cull, 0 +- 1 2 3 4 5 6 7
+:_8 res_B_8.vqd, 2, nonseq cull, 0 +- 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
+
+:_9 res_B_9.vqd, 4, nonseq, 0 +- 67 134
++_9a, 2, nonseq, 0 +- 3 6 9 12 15 18 21 24 27 30 33
++_9b, 4, nonseq, 0 +- 1
+
+
+
+
+
+
+