text:
/********************************************************************
 *                                                                  *
 * 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-2010             *
 * by the Xiph.Org Foundation http://www.xiph.org/                  *
 *                                                                  *
 ********************************************************************

 function: residue backend 0, 1 and 2 implementation
 last mod: $Id: res0.c 17556 2010-10-21 18:25:19Z tterribe $

 ********************************************************************/

/* 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 "../../ogg.h"
#include "../../codec.h"
#include "codec_internal.h"
#include "registry.h"
#include "codebook.h"
#include "misc.h"
#include "os.h"

//#define TRAIN_RES 1
//#define TRAIN_RESAUX 1

#if defined(TRAIN_RES) || defined (TRAIN_RESAUX)
#include <stdio.h>
#endif

typedef struct {
  vorbis_info_residue0 *info;

  int         parts;
  int         stages;
  codebook   *fullbooks;
  codebook   *phrasebook;
  codebook ***partbooks;

  int         partvals;
  int       **decodemap;

  long      postbits;
  long      phrasebits;
  long      frames;

#if defined(TRAIN_RES) || defined(TRAIN_RESAUX)
  int        train_seq;
  long      *training_data[8][64];
  float      training_max[8][64];
  float      training_min[8][64];
  float     tmin;
  float     tmax;
  int       submap;
#endif

} vorbis_look_residue0;

static 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);
  }
}

static void res0_free_look(vorbis_look_residue *i){
  int j;
  if(i){

    vorbis_look_residue0 *look=(vorbis_look_residue0 *)i;

#ifdef TRAIN_RES
    {
      int j,k,l;
      for(j=0;j<look->parts;j++){
        /*fprintf(stderr,"partition %d: ",j);*/
        for(k=0;k<8;k++)
          if(look->training_data[k][j]){
            char buffer[80];
            FILE *of;
            codebook *statebook=look->partbooks[j][k];

            /* long and short into the same bucket by current convention */
            sprintf(buffer,"res_sub%d_part%d_pass%d.vqd",look->submap,j,k);
            of=fopen(buffer,"a");

            for(l=0;l<statebook->entries;l++)
              fprintf(of,"%d:%ld\n",l,look->training_data[k][j][l]);

            fclose(of);

            /*fprintf(stderr,"%d(%.2f|%.2f) ",k,
              look->training_min[k][j],look->training_max[k][j]);*/

            _ogg_free(look->training_data[k][j]);
            look->training_data[k][j]=NULL;
          }
        /*fprintf(stderr,"\n");*/
      }
    }
    fprintf(stderr,"min/max residue: %g::%g\n",look->tmin,look->tmax);

    /*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);*/
#endif

    /*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);
  }
}

#if 0
static int ilog(unsigned int v){
  int ret=0;
  while(v){
    ret++;
    v>>=1;
  }
  return(ret);
}
#endif

static int icount(unsigned int v){
  int ret=0;
  while(v){
    ret+=v&1;
    v>>=1;
  }
  return(ret);
}

static 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 */
static vorbis_info_residue *res0_unpack(vorbis_info *vi,oggpack_buffer *opb){
  int j,acc=0;
  vorbis_info_residue0 *info=(vorbis_info_residue0*) _ogg_calloc(1,sizeof(*info));
  codec_setup_info     *ci=(codec_setup_info*) 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);

  /* check for premature EOP */
  if(info->groupbook<0)goto errout;

  for(j=0;j<info->partitions;j++){
    int cascade=oggpack_read(opb,3);
    int cflag=oggpack_read(opb,1);
    if(cflag<0) goto errout;
    if(cflag){
      int c=oggpack_read(opb,5);
      if(c<0) goto errout;
      cascade|=(c<<3);
    }
    info->secondstages[j]=cascade;

    acc+=icount(cascade);
  }
  for(j=0;j<acc;j++){
    int book=oggpack_read(opb,8);
    if(book<0) goto errout;
    info->booklist[j]=book;
  }

  if(info->groupbook>=ci->books)goto errout;
  for(j=0;j<acc;j++){
    if(info->booklist[j]>=ci->books)goto errout;
    if(ci->book_param[info->booklist[j]]->maptype==0)goto errout;
  }

  /* verify the phrasebook is not specifying an impossible or
     inconsistent partitioning scheme. */
  /* modify the phrasebook ranging check from r16327; an early beta
     encoder had a bug where it used an oversized phrasebook by
     accident.  These files should continue to be playable, but don't
     allow an exploit */
  {
    int entries = ci->book_param[info->groupbook]->entries;
    int dim = ci->book_param[info->groupbook]->dim;
    int partvals = 1;
    if (dim<1) goto errout;
    while(dim>0){
      partvals *= info->partitions;
      if(partvals > entries) goto errout;
      dim--;
    }
    info->partvals = partvals;
  }

  return(info);
 errout:
  res0_free_info(info);
  return(NULL);
}

static vorbis_look_residue *res0_look(vorbis_dsp_state *vd,
                               vorbis_info_residue *vr){
  vorbis_info_residue0 *info=(vorbis_info_residue0 *)vr;
  vorbis_look_residue0 *look=(vorbis_look_residue0 *)_ogg_calloc(1,sizeof(*look));
  codec_setup_info     *ci=(codec_setup_info*)vd->vi->codec_setup;

  int j,k,acc=0;
  int dim;
  int maxstage=0;
  look->info=info;

  look->parts=info->partitions;
  look->fullbooks=ci->fullbooks;
  look->phrasebook=ci->fullbooks+info->groupbook;
  dim=look->phrasebook->dim;

  look->partbooks=(codebook***)_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]=(codebook**) _ogg_calloc(stages,sizeof(*look->partbooks[j]));
      for(k=0;k<stages;k++)
        if(info->secondstages[j]&(1<<k)){
          look->partbooks[j][k]=ci->fullbooks+info->booklist[acc++];
#ifdef TRAIN_RES
          look->training_data[k][j]=_ogg_calloc(look->partbooks[j][k]->entries,
                                           sizeof(***look->training_data));
#endif
        }
    }
  }

  look->partvals=1;
  for(j=0;j<dim;j++)
      look->partvals*=look->parts;

  look->stages=maxstage;
  look->decodemap=(int**)_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]=(int*)_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;
    }
  }
#if defined(TRAIN_RES) || defined (TRAIN_RESAUX)
  {
    static int train_seq=0;
    look->train_seq=train_seq++;
  }
#endif
  return(look);
}

/* break an abstraction and copy some code for performance purposes */
static int local_book_besterror(codebook *book,int *a){
  int dim=book->dim;
  int i,j,o;
  int minval=book->minval;
  int del=book->delta;
  int qv=book->quantvals;
  int ze=(qv>>1);
  int index=0;
  /* assumes integer/centered encoder codebook maptype 1 no more than dim 8 */
  int p[8]={0,0,0,0,0,0,0,0};

  if(del!=1){
    for(i=0,o=dim;i<dim;i++){
      int v = (a[--o]-minval+(del>>1))/del;
      int m = (v<ze ? ((ze-v)<<1)-1 : ((v-ze)<<1));
      index = index*qv+ (m<0?0:(m>=qv?qv-1:m));
      p[o]=v*del+minval;
    }
  }else{
    for(i=0,o=dim;i<dim;i++){
      int v = a[--o]-minval;
      int m = (v<ze ? ((ze-v)<<1)-1 : ((v-ze)<<1));
      index = index*qv+ (m<0?0:(m>=qv?qv-1:m));
      p[o]=v*del+minval;
    }
  }

  if(book->c->lengthlist[index]<=0){
    const static_codebook *c=book->c;
    int best=-1;
    /* assumes integer/centered encoder codebook maptype 1 no more than dim 8 */
    int e[8]={0,0,0,0,0,0,0,0};
    int maxval = book->minval + book->delta*(book->quantvals-1);
    for(i=0;i<book->entries;i++){
      if(c->lengthlist[i]>0){
        int thisx=0;
        for(j=0;j<dim;j++){
          int val=(e[j]-a[j]);
          thisx+=val*val;
        }
        if(best==-1 || thisx<best){
          memcpy(p,e,sizeof(p));
          best=thisx;
          index=i;
        }
      }
      /* assumes the value patterning created by the tools in vq/ */
      j=0;
      while(e[j]>=maxval)
        e[j++]=0;
      if(e[j]>=0)
        e[j]+=book->delta;
      e[j]= -e[j];
    }
  }

  if(index>-1){
    for(i=0;i<dim;i++)
      *a++ -= p[i];
  }

  return(index);
}

static int _encodepart(oggpack_buffer *opb,int *vec, int n,
                       codebook *book,long* /* acc */){
  int i,bits=0;
  int dim=book->dim;
  int step=n/dim;

  for(i=0;i<step;i++){
    int entry=local_book_besterror(book,vec+i*dim);

#ifdef TRAIN_RES
    if(entry>=0)
      acc[entry]++;
#endif

    bits+=vorbis_book_encode(book,entry,opb);

  }

  return(bits);
}

static long **_01class(vorbis_block *vb,vorbis_look_residue *vl,
                       int **in,int ch){
  long i,j,k;
  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=(long**)_vorbis_block_alloc(vb,ch*sizeof(*partword));
  float scale=100.0f/samples_per_partition;

  /* 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]=(long*)_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++){
    int offset=i*samples_per_partition+info->begin;
    for(j=0;j<ch;j++){
      int max=0;
      int ent=0;
      for(k=0;k<samples_per_partition;k++){
        if(abs(in[j][offset+k])>max)max=abs(in[j][offset+k]);
        ent+=abs(in[j][offset+k]);
      }
      ent*=scale;

      for(k=0;k<possible_partitions-1;k++)
        if(max<=info->classmetric1[k] &&
           (info->classmetric2[k]<0 || ent<info->classmetric2[k]))
          break;

      partword[j][i]=k;
    }
  }

#ifdef TRAIN_RESAUX
  {
    FILE *of;
    char buffer[80];

    for(i=0;i<ch;i++){
      sprintf(buffer,"resaux_%d.vqd",look->train_seq);
      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);
}

/* designed for stereo or other modes where the partition size is an
   integer multiple of the number of channels encoded in the current
   submap */
static long **_2class(vorbis_block *vb,vorbis_look_residue *vl,int **in,
                      int ch){
  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=(long**)_vorbis_block_alloc(vb,sizeof(*partword));

#if defined(TRAIN_RES) || defined (TRAIN_RESAUX)
  FILE *of;
  char buffer[80];
#endif

  partword[0]=(long*)_vorbis_block_alloc(vb,partvals*sizeof(*partword[0]));
  memset(partword[0],0,partvals*sizeof(*partword[0]));

  for(i=0,l=info->begin/ch;i<partvals;i++){
    int magmax=0;
    int angmax=0;
    for(j=0;j<samples_per_partition;j+=ch){
      if(abs(in[0][l])>magmax)magmax=abs(in[0][l]);
      for(k=1;k<ch;k++)
        if(abs(in[k][l])>angmax)angmax=abs(in[k][l]);
      l++;
    }

    for(j=0;j<possible_partitions-1;j++)
      if(magmax<=info->classmetric1[j] &&
         angmax<=info->classmetric2[j])
        break;

    partword[0][i]=j;

  }

#ifdef TRAIN_RESAUX
  sprintf(buffer,"resaux_%d.vqd",look->train_seq);
  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(oggpack_buffer *opb,
                      vorbis_block*, vorbis_look_residue *vl,
                      int **in,int ch,
                      long **partword,
                      int (*encode)(oggpack_buffer *,int *,int,
                                    codebook *,long *),
                      int /* submap */){
  long i,j,k,s;
  vorbis_look_residue0 *look=(vorbis_look_residue0 *)vl;
  vorbis_info_residue0 *info=look->info;

#ifdef TRAIN_RES
  look->submap=submap;
#endif

  /* 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];

#ifdef TRAIN_RES
  for(i=0;i<ch;i++)
    for(j=info->begin;j<info->end;j++){
      if(in[i][j]>look->tmax)look->tmax=in[i][j];
      if(in[i][j]<look->tmin)look->tmin=in[i][j];
    }
#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=0;s<look->stages;s++){

    for(i=0;i<partvals;){

      /* first we encode a partition codeword for each channel */
      if(s==0){
        for(j=0;j<ch;j++){
          long val=partword[j][i];
          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)
            look->phrasebits+=vorbis_book_encode(look->phrasebook,val,opb);
#if 0 /*def TRAIN_RES*/
          else
            fprintf(stderr,"!");
#endif

        }
      }

      /* 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;

        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;
              long *accumulator=NULL;

#ifdef TRAIN_RES
              accumulator=look->training_data[s][partword[j][i]];
              {
                int l;
                int *samples=in[j]+offset;
                for(l=0;l<samples_per_partition;l++){
                  if(samples[l]<look->training_min[s][partword[j][i]])
                    look->training_min[s][partword[j][i]]=samples[l];
                  if(samples[l]>look->training_max[s][partword[j][i]])
                    look->training_max[s][partword[j][i]]=samples[l];
                }
              }
#endif

              ret=encode(opb,in[j]+offset,samples_per_partition,
                         statebook,accumulator);

              look->postbits+=ret;
              resbits[partword[j][i]]+=ret;
            }
          }
        }
      }
    }
  }

  /*{
    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(0);
}

/* 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 max=vb->pcmend>>1;
  int end=(info->end<max?info->end:max);
  int n=end-info->begin;

  if(n>0){
    int partvals=n/samples_per_partition;
    int partwords=(partvals+partitions_per_word-1)/partitions_per_word;
  int ***partword=(int***)alloca(ch*sizeof(*partword));

    for(j=0;j<ch;j++)
    partword[j]=(int**)_vorbis_block_alloc(vb,partwords*sizeof(*partword[j]));

    for(s=0;s<look->stages;s++){

      /* each loop decodes on partition codeword containing
         partitions_per_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 || temp>=info->partvals)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);
}

static 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);
}

static int res1_forward(oggpack_buffer *opb,vorbis_block *vb,vorbis_look_residue *vl,
                 int **in,int *nonzero,int ch, long **partword, int submap){
  int i,used=0;
  for(i=0;i<ch;i++)
    if(nonzero[i])
      in[used++]=in[i];

  if(used){
    return _01forward(opb,vb,vl,in,used,partword,_encodepart,submap);
  }else{
    return(0);
  }
}

static long **res1_class(vorbis_block *vb,vorbis_look_residue *vl,
                  int **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));
  else
    return(0);
}

static 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);
}

static long **res2_class(vorbis_block *vb,vorbis_look_residue *vl,
                  int **in,int *nonzero,int ch){
  int i,used=0;
  for(i=0;i<ch;i++)
    if(nonzero[i])used++;
  if(used)
    return(_2class(vb,vl,in,ch));
  else
    return(0);
}

/* res2 is slightly more different; all the channels are interleaved
   into a single vector and encoded. */

static int res2_forward(oggpack_buffer *opb,
                 vorbis_block *vb,vorbis_look_residue *vl,
                 int **in,int *nonzero,int ch, long **partword,int submap){
  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 :-( */
  int *work=(int*)_vorbis_block_alloc(vb,ch*n*sizeof(*work));
  for(i=0;i<ch;i++){
    int *pcm=in[i];
    if(nonzero[i])used++;
    for(j=0,k=i;j<n;j++,k+=ch)
      work[k]=pcm[j];
  }

  if(used){
    return _01forward(opb,vb,vl,&work,1,partword,_encodepart,submap);
  }else{
    return(0);
  }
}

/* duplicate code here as speed is somewhat more important */
static 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 max=(vb->pcmend*ch)>>1;
  int end=(info->end<max?info->end:max);
  int n=end-info->begin;

  if(n>0){
    int partvals=n/samples_per_partition;
    int partwords=(partvals+partitions_per_word-1)/partitions_per_word;
  int **partword=(int**)_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 || temp>=info->partvals)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);
}

const vorbis_func_residue residue0_exportbundle={
  NULL,
  &res0_unpack,
  &res0_look,
  &res0_free_info,
  &res0_free_look,
  NULL,
  NULL,
  &res0_inverse
};

const vorbis_func_residue residue1_exportbundle={
  &res0_pack,
  &res0_unpack,
  &res0_look,
  &res0_free_info,
  &res0_free_look,
  &res1_class,
  &res1_forward,
  &res1_inverse
};

const vorbis_func_residue residue2_exportbundle={
  &res0_pack,
  &res0_unpack,
  &res0_look,
  &res0_free_info,
  &res0_free_look,
  &res2_class,
  &res2_forward,
  &res2_inverse
};


text:
/********************************************************************
 *                                                                  *
 * 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-2007             *
 * by the Xiph.Org Foundation http://www.xiph.org/                  *
 *                                                                  *
 ********************************************************************

 function: static codebooks autogenerated by huff/huffbuld
 last modified: $Id: floor_books.h 16939 2010-03-01 08:38:14Z xiphmont $

 ********************************************************************/

#include "../../codebook.h"

static const long _huff_lengthlist_line_256x7_0sub1[] = {
         0, 2, 3, 3, 3, 3, 4, 3, 4,
};

static const static_codebook _huff_book_line_256x7_0sub1 = {
        1, 9,
        (long *)_huff_lengthlist_line_256x7_0sub1,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_256x7_0sub2[] = {
         0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 3, 4, 3, 5, 3,
         6, 3, 6, 4, 6, 4, 7, 5, 7,
};

static const static_codebook _huff_book_line_256x7_0sub2 = {
        1, 25,
        (long *)_huff_lengthlist_line_256x7_0sub2,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_256x7_0sub3[] = {
         0, 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, 5, 2, 5, 3, 5, 3,
         6, 3, 6, 4, 7, 6, 7, 8, 7, 9, 8, 9, 9, 9,10, 9,
        11,13,11,13,10,10,13,13,13,13,13,13,12,12,12,12,
};

static const static_codebook _huff_book_line_256x7_0sub3 = {
        1, 64,
        (long *)_huff_lengthlist_line_256x7_0sub3,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_256x7_1sub1[] = {
         0, 3, 3, 3, 3, 2, 4, 3, 4,
};

static const static_codebook _huff_book_line_256x7_1sub1 = {
        1, 9,
        (long *)_huff_lengthlist_line_256x7_1sub1,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_256x7_1sub2[] = {
         0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 3, 4, 3, 4, 4,
         5, 4, 6, 5, 6, 7, 6, 8, 8,
};

static const static_codebook _huff_book_line_256x7_1sub2 = {
        1, 25,
        (long *)_huff_lengthlist_line_256x7_1sub2,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_256x7_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, 2, 4, 3, 6, 3, 7,
         3, 8, 5, 8, 6, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
         8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7,
};

static const static_codebook _huff_book_line_256x7_1sub3 = {
        1, 64,
        (long *)_huff_lengthlist_line_256x7_1sub3,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_256x7_class0[] = {
         7, 5, 5, 9, 9, 6, 6, 9,12, 8, 7, 8,11, 8, 9,15,
         6, 3, 3, 7, 7, 4, 3, 6, 9, 6, 5, 6, 8, 6, 8,15,
         8, 5, 5, 9, 8, 5, 4, 6,10, 7, 5, 5,11, 8, 7,15,
        14,15,13,13,13,13, 8,11,15,10, 7, 6,11, 9,10,15,
};

static const static_codebook _huff_book_line_256x7_class0 = {
        1, 64,
        (long *)_huff_lengthlist_line_256x7_class0,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_256x7_class1[] = {
         5, 6, 8,15, 6, 9,10,15,10,11,12,15,15,15,15,15,
         4, 6, 7,15, 6, 7, 8,15, 9, 8, 9,15,15,15,15,15,
         6, 8, 9,15, 7, 7, 8,15,10, 9,10,15,15,15,15,15,
        15,13,15,15,15,10,11,15,15,13,13,15,15,15,15,15,
         4, 6, 7,15, 6, 8, 9,15,10,10,12,15,15,15,15,15,
         2, 5, 6,15, 5, 6, 7,15, 8, 6, 7,15,15,15,15,15,
         5, 6, 8,15, 5, 6, 7,15, 9, 6, 7,15,15,15,15,15,
        14,12,13,15,12,10,11,15,15,15,15,15,15,15,15,15,
         7, 8, 9,15, 9,10,10,15,15,14,14,15,15,15,15,15,
         5, 6, 7,15, 7, 8, 9,15,12, 9,10,15,15,15,15,15,
         7, 7, 9,15, 7, 7, 8,15,12, 8, 9,15,15,15,15,15,
        13,13,14,15,12,11,12,15,15,15,15,15,15,15,15,15,
        15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
        13,13,13,15,15,15,15,15,15,15,15,15,15,15,15,15,
        15,12,13,15,15,12,13,15,15,14,15,15,15,15,15,15,
        15,15,15,15,15,15,13,15,15,15,15,15,15,15,15,15,
};

static const static_codebook _huff_book_line_256x7_class1 = {
        1, 256,
        (long *)_huff_lengthlist_line_256x7_class1,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_512x17_0sub0[] = {
         4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
         5, 6, 5, 6, 6, 6, 6, 5, 6, 6, 7, 6, 7, 6, 7, 6,
         7, 6, 8, 7, 8, 7, 8, 7, 8, 7, 8, 7, 9, 7, 9, 7,
         9, 7, 9, 8, 9, 8,10, 8,10, 8,10, 7,10, 6,10, 8,
        10, 8,11, 7,10, 7,11, 8,11,11,12,12,11,11,12,11,
        13,11,13,11,13,12,15,12,13,13,14,14,14,14,14,15,
        15,15,16,14,17,19,19,18,18,18,18,18,18,18,18,18,
        18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,
};

static const static_codebook _huff_book_line_512x17_0sub0 = {
        1, 128,
        (long *)_huff_lengthlist_line_512x17_0sub0,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_512x17_1sub0[] = {
         2, 4, 5, 4, 5, 4, 5, 4, 5, 5, 5, 5, 5, 5, 6, 5,
         6, 5, 6, 6, 7, 6, 7, 6, 8, 7, 8, 7, 8, 7, 8, 7,
};

static const static_codebook _huff_book_line_512x17_1sub0 = {
        1, 32,
        (long *)_huff_lengthlist_line_512x17_1sub0,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_512x17_1sub1[] = {
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         4, 3, 5, 3, 5, 4, 5, 4, 5, 4, 5, 5, 5, 5, 6, 5,
         6, 5, 7, 5, 8, 6, 8, 6, 8, 6, 8, 6, 8, 7, 9, 7,
         9, 7,11, 9,11,11,12,11,14,12,14,16,14,16,13,16,
        14,16,12,15,13,16,14,16,13,14,12,15,13,15,13,13,
        13,15,12,14,14,15,13,15,12,15,15,15,15,15,15,15,
        15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
};

static const static_codebook _huff_book_line_512x17_1sub1 = {
        1, 128,
        (long *)_huff_lengthlist_line_512x17_1sub1,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_512x17_2sub1[] = {
         0, 4, 5, 4, 4, 4, 5, 4, 4, 4, 5, 4, 5, 4, 5, 3,
         5, 3,
};

static const static_codebook _huff_book_line_512x17_2sub1 = {
        1, 18,
        (long *)_huff_lengthlist_line_512x17_2sub1,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_512x17_2sub2[] = {
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 4, 3, 4, 3, 4, 4, 5, 4, 5, 4, 6, 4, 6, 5,
         6, 5, 7, 5, 7, 6, 8, 6, 8, 6, 8, 7, 8, 7, 9, 7,
         9, 8,
};

static const static_codebook _huff_book_line_512x17_2sub2 = {
        1, 50,
        (long *)_huff_lengthlist_line_512x17_2sub2,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_512x17_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, 0, 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, 3, 3, 3, 4, 3, 4, 4, 5, 5, 6, 6, 7, 7,
         7, 8, 8,11, 8, 9, 9, 9,10,11,11,11, 9,10,10,11,
        11,11,11,10,10,10,10,10,10,10,10,10,10,10,10,10,
        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
};

static const static_codebook _huff_book_line_512x17_2sub3 = {
        1, 128,
        (long *)_huff_lengthlist_line_512x17_2sub3,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_512x17_3sub1[] = {
         0, 4, 4, 4, 4, 4, 4, 3, 4, 4, 4, 4, 4, 5, 4, 5,
         5, 5,
};

static const static_codebook _huff_book_line_512x17_3sub1 = {
        1, 18,
        (long *)_huff_lengthlist_line_512x17_3sub1,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_512x17_3sub2[] = {
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 2, 3, 3, 4, 3, 5, 4, 6, 4, 6, 5, 7, 6, 7,
         6, 8, 6, 8, 7, 9, 8,10, 8,12, 9,13,10,15,10,15,
        11,14,
};

static const static_codebook _huff_book_line_512x17_3sub2 = {
        1, 50,
        (long *)_huff_lengthlist_line_512x17_3sub2,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_512x17_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, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 4, 8, 4, 8, 4, 8, 4, 8, 5, 8, 5, 8, 6, 8,
         4, 8, 4, 8, 5, 8, 5, 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,
         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, 7, 7, 7, 7, 7, 7, 7,
};

static const static_codebook _huff_book_line_512x17_3sub3 = {
        1, 128,
        (long *)_huff_lengthlist_line_512x17_3sub3,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_512x17_class1[] = {
         1, 2, 3, 6, 5, 4, 7, 7,
};

static const static_codebook _huff_book_line_512x17_class1 = {
        1, 8,
        (long *)_huff_lengthlist_line_512x17_class1,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_512x17_class2[] = {
         3, 3, 3,14, 5, 4, 4,11, 8, 6, 6,10,17,12,11,17,
         6, 5, 5,15, 5, 3, 4,11, 8, 5, 5, 8,16, 9,10,14,
        10, 8, 9,17, 8, 6, 6,13,10, 7, 7,10,16,11,13,14,
        17,17,17,17,17,16,16,16,16,15,16,16,16,16,16,16,
};

static const static_codebook _huff_book_line_512x17_class2 = {
        1, 64,
        (long *)_huff_lengthlist_line_512x17_class2,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_512x17_class3[] = {
         2, 4, 6,17, 4, 5, 7,17, 8, 7,10,17,17,17,17,17,
         3, 4, 6,15, 3, 3, 6,15, 7, 6, 9,17,17,17,17,17,
         6, 8,10,17, 6, 6, 8,16, 9, 8,10,17,17,15,16,17,
        17,17,17,17,12,15,15,16,12,15,15,16,16,16,16,16,
};

static const static_codebook _huff_book_line_512x17_class3 = {
        1, 64,
        (long *)_huff_lengthlist_line_512x17_class3,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_128x4_class0[] = {
         7, 7, 7,11, 6, 6, 7,11, 7, 6, 6,10,12,10,10,13,
         7, 7, 8,11, 7, 7, 7,11, 7, 6, 7,10,11,10,10,13,
        10,10, 9,12, 9, 9, 9,11, 8, 8, 8,11,13,11,10,14,
        15,15,14,15,15,14,13,14,15,12,12,17,17,17,17,17,
         7, 7, 6, 9, 6, 6, 6, 9, 7, 6, 6, 8,11,11,10,12,
         7, 7, 7, 9, 7, 6, 6, 9, 7, 6, 6, 9,13,10,10,11,
        10, 9, 8,10, 9, 8, 8,10, 8, 8, 7, 9,13,12,10,11,
        17,14,14,13,15,14,12,13,17,13,12,15,17,17,14,17,
         7, 6, 6, 7, 6, 6, 5, 7, 6, 6, 6, 6,11, 9, 9, 9,
         7, 7, 6, 7, 7, 6, 6, 7, 6, 6, 6, 6,10, 9, 8, 9,
        10, 9, 8, 8, 9, 8, 7, 8, 8, 7, 6, 8,11,10, 9,10,
        17,17,12,15,15,15,12,14,14,14,10,12,15,13,12,13,
        11,10, 8,10,11,10, 8, 8,10, 9, 7, 7,10, 9, 9,11,
        11,11, 9,10,11,10, 8, 9,10, 8, 6, 8,10, 9, 9,11,
        14,13,10,12,12,11,10,10, 8, 7, 8,10,10,11,11,12,
        17,17,15,17,17,17,17,17,17,13,12,17,17,17,14,17,
};

static const static_codebook _huff_book_line_128x4_class0 = {
        1, 256,
        (long *)_huff_lengthlist_line_128x4_class0,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_128x4_0sub0[] = {
         2, 2, 2, 2,
};

static const static_codebook _huff_book_line_128x4_0sub0 = {
        1, 4,
        (long *)_huff_lengthlist_line_128x4_0sub0,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_128x4_0sub1[] = {
         0, 0, 0, 0, 3, 2, 3, 2, 3, 3,
};

static const static_codebook _huff_book_line_128x4_0sub1 = {
        1, 10,
        (long *)_huff_lengthlist_line_128x4_0sub1,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_128x4_0sub2[] = {
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 4, 3, 4, 3,
         4, 4, 5, 4, 5, 4, 6, 5, 6,
};

static const static_codebook _huff_book_line_128x4_0sub2 = {
        1, 25,
        (long *)_huff_lengthlist_line_128x4_0sub2,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_128x4_0sub3[] = {
         0, 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, 4, 3, 5, 3, 5, 3,
         5, 4, 6, 5, 6, 5, 7, 6, 6, 7, 7, 9, 9,11,11,16,
        11,14,10,11,11,13,16,15,15,15,15,15,15,15,15,15,
};

static const static_codebook _huff_book_line_128x4_0sub3 = {
        1, 64,
        (long *)_huff_lengthlist_line_128x4_0sub3,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_256x4_class0[] = {
         6, 7, 7,12, 6, 6, 7,12, 7, 6, 6,10,15,12,11,13,
         7, 7, 8,13, 7, 7, 8,12, 7, 7, 7,11,12,12,11,13,
        10, 9, 9,11, 9, 9, 9,10,10, 8, 8,12,14,12,12,14,
        11,11,12,14,11,12,11,15,15,12,13,15,15,15,15,15,
         6, 6, 7,10, 6, 6, 6,11, 7, 6, 6, 9,14,12,11,13,
         7, 7, 7,10, 6, 6, 7, 9, 7, 7, 6,10,13,12,10,12,
         9, 9, 9,11, 9, 9, 8, 9, 9, 8, 8,10,13,12,10,12,
        12,12,11,13,12,12,11,12,15,13,12,15,15,15,14,14,
         6, 6, 6, 8, 6, 6, 5, 6, 7, 7, 6, 5,11,10, 9, 8,
         7, 6, 6, 7, 6, 6, 5, 6, 7, 7, 6, 6,11,10, 9, 8,
         8, 8, 8, 9, 8, 8, 7, 8, 8, 8, 6, 7,11,10, 9, 9,
        14,11,10,14,14,11,10,15,13,11, 9,11,15,12,12,11,
        11, 9, 8, 8,10, 9, 8, 9,11,10, 9, 8,12,11,12,11,
        13,10, 8, 9,11,10, 8, 9,10, 9, 8, 9,10, 8,12,12,
        15,11,10,10,13,11,10,10, 8, 8, 7,12,10, 9,11,12,
        15,12,11,15,13,11,11,15,12,14,11,13,15,15,13,13,
};

static const static_codebook _huff_book_line_256x4_class0 = {
        1, 256,
        (long *)_huff_lengthlist_line_256x4_class0,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_256x4_0sub0[] = {
         2, 2, 2, 2,
};

static const static_codebook _huff_book_line_256x4_0sub0 = {
        1, 4,
        (long *)_huff_lengthlist_line_256x4_0sub0,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_256x4_0sub1[] = {
         0, 0, 0, 0, 2, 2, 3, 3, 3, 3,
};

static const static_codebook _huff_book_line_256x4_0sub1 = {
        1, 10,
        (long *)_huff_lengthlist_line_256x4_0sub1,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_256x4_0sub2[] = {
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 3, 4, 3, 4, 3,
         5, 3, 5, 4, 5, 4, 6, 4, 6,
};

static const static_codebook _huff_book_line_256x4_0sub2 = {
        1, 25,
        (long *)_huff_lengthlist_line_256x4_0sub2,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_256x4_0sub3[] = {
         0, 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, 4, 3, 5, 3, 5, 3,
         6, 4, 7, 4, 7, 5, 7, 6, 7, 6, 7, 8,10,13,13,13,
        13,13,13,13,13,13,13,13,13,13,13,12,12,12,12,12,
};

static const static_codebook _huff_book_line_256x4_0sub3 = {
        1, 64,
        (long *)_huff_lengthlist_line_256x4_0sub3,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_128x7_class0[] = {
        10, 7, 8,13, 9, 6, 7,11,10, 8, 8,12,17,17,17,17,
         7, 5, 5, 9, 6, 4, 4, 8, 8, 5, 5, 8,16,14,13,16,
         7, 5, 5, 7, 6, 3, 3, 5, 8, 5, 4, 7,14,12,12,15,
        10, 7, 8, 9, 7, 5, 5, 6, 9, 6, 5, 5,15,12, 9,10,
};

static const static_codebook _huff_book_line_128x7_class0 = {
        1, 64,
        (long *)_huff_lengthlist_line_128x7_class0,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_128x7_class1[] = {
         8,13,17,17, 8,11,17,17,11,13,17,17,17,17,17,17,
         6,10,16,17, 6,10,15,17, 8,10,16,17,17,17,17,17,
         9,13,15,17, 8,11,17,17,10,12,17,17,17,17,17,17,
        17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
         6,11,15,17, 7,10,15,17, 8,10,17,17,17,15,17,17,
         4, 8,13,17, 4, 7,13,17, 6, 8,15,17,16,15,17,17,
         6,11,15,17, 6, 9,13,17, 8,10,17,17,15,17,17,17,
        16,17,17,17,12,14,15,17,13,14,15,17,17,17,17,17,
         5,10,14,17, 5, 9,14,17, 7, 9,15,17,15,15,17,17,
         3, 7,12,17, 3, 6,11,17, 5, 7,13,17,12,12,17,17,
         5, 9,14,17, 3, 7,11,17, 5, 8,13,17,13,11,16,17,
        12,17,17,17, 9,14,15,17,10,11,14,17,16,14,17,17,
         8,12,17,17, 8,12,17,17,10,12,17,17,17,17,17,17,
         5,10,17,17, 5, 9,15,17, 7, 9,17,17,13,13,17,17,
         7,11,17,17, 6,10,15,17, 7, 9,15,17,12,11,17,17,
        12,15,17,17,11,14,17,17,11,10,15,17,17,16,17,17,
};

static const static_codebook _huff_book_line_128x7_class1 = {
        1, 256,
        (long *)_huff_lengthlist_line_128x7_class1,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_128x7_0sub1[] = {
         0, 3, 3, 3, 3, 3, 3, 3, 3,
};

static const static_codebook _huff_book_line_128x7_0sub1 = {
        1, 9,
        (long *)_huff_lengthlist_line_128x7_0sub1,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_128x7_0sub2[] = {
         0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 4, 4, 4, 4,
         5, 4, 5, 4, 5, 4, 6, 4, 6,
};

static const static_codebook _huff_book_line_128x7_0sub2 = {
        1, 25,
        (long *)_huff_lengthlist_line_128x7_0sub2,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_128x7_0sub3[] = {
         0, 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, 5, 3, 5, 3, 5, 4,
         5, 4, 5, 5, 5, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 5,
         7, 8, 9,11,13,13,13,13,13,13,13,13,13,13,13,13,
};

static const static_codebook _huff_book_line_128x7_0sub3 = {
        1, 64,
        (long *)_huff_lengthlist_line_128x7_0sub3,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_128x7_1sub1[] = {
         0, 3, 3, 2, 3, 3, 4, 3, 4,
};

static const static_codebook _huff_book_line_128x7_1sub1 = {
        1, 9,
        (long *)_huff_lengthlist_line_128x7_1sub1,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_128x7_1sub2[] = {
         0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 3, 6, 3, 6, 3,
         6, 3, 7, 3, 8, 4, 9, 4, 9,
};

static const static_codebook _huff_book_line_128x7_1sub2 = {
        1, 25,
        (long *)_huff_lengthlist_line_128x7_1sub2,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const 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, 1, 7, 2, 7, 3, 8, 4,
         9, 5, 9, 8,10,11,11,12,14,14,14,14,14,14,14,14,
        14,14,14,14,14,14,14,14,14,14,14,14,13,13,13,13,
};

static const static_codebook _huff_book_line_128x7_1sub3 = {
        1, 64,
        (long *)_huff_lengthlist_line_128x7_1sub3,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_128x11_class1[] = {
         1, 6, 3, 7, 2, 4, 5, 7,
};

static const static_codebook _huff_book_line_128x11_class1 = {
        1, 8,
        (long *)_huff_lengthlist_line_128x11_class1,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_128x11_class2[] = {
         1, 6,12,16, 4,12,15,16, 9,15,16,16,16,16,16,16,
         2, 5,11,16, 5,11,13,16, 9,13,16,16,16,16,16,16,
         4, 8,12,16, 5, 9,12,16, 9,13,15,16,16,16,16,16,
        15,16,16,16,11,14,13,16,12,15,16,16,16,16,16,15,
};

static const static_codebook _huff_book_line_128x11_class2 = {
        1, 64,
        (long *)_huff_lengthlist_line_128x11_class2,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_128x11_class3[] = {
         7, 6, 9,17, 7, 6, 8,17,12, 9,11,16,16,16,16,16,
         5, 4, 7,16, 5, 3, 6,14, 9, 6, 8,15,16,16,16,16,
         5, 4, 6,13, 3, 2, 4,11, 7, 4, 6,13,16,11,10,14,
        12,12,12,16, 9, 7,10,15,12, 9,11,16,16,15,15,16,
};

static const static_codebook _huff_book_line_128x11_class3 = {
        1, 64,
        (long *)_huff_lengthlist_line_128x11_class3,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_128x11_0sub0[] = {
         5, 5, 5, 5, 5, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 5,
         6, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 6, 6, 6, 7, 6,
         7, 6, 7, 6, 7, 6, 7, 6, 7, 6, 8, 6, 8, 6, 8, 7,
         8, 7, 8, 7, 8, 7, 9, 7, 9, 8, 9, 8, 9, 8,10, 8,
        10, 9,10, 9,10, 9,11, 9,11, 9,10,10,11,10,11,10,
        11,11,11,11,11,11,12,13,14,14,14,15,15,16,16,16,
        17,15,16,15,16,16,17,17,16,17,17,17,17,17,17,17,
        17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
};

static const static_codebook _huff_book_line_128x11_0sub0 = {
        1, 128,
        (long *)_huff_lengthlist_line_128x11_0sub0,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_128x11_1sub0[] = {
         2, 5, 5, 5, 5, 5, 5, 4, 5, 5, 5, 5, 5, 5, 5, 5,
         6, 5, 6, 5, 6, 5, 7, 6, 7, 6, 7, 6, 8, 6, 8, 6,
};

static const static_codebook _huff_book_line_128x11_1sub0 = {
        1, 32,
        (long *)_huff_lengthlist_line_128x11_1sub0,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_128x11_1sub1[] = {
         0, 0, 0, 0, 0, 0, 0, 0, 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, 3, 5, 3, 6, 4, 6, 4, 7, 4, 7, 4, 7, 4, 8, 4,
         8, 4, 9, 5, 9, 5, 9, 5, 9, 6,10, 6,10, 6,11, 7,
        10, 7,10, 8,11, 9,11, 9,11,10,11,11,12,11,11,12,
        15,15,12,14,11,14,12,14,11,14,13,14,12,14,11,14,
        11,14,12,14,11,14,11,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,
};

static const static_codebook _huff_book_line_128x11_1sub1 = {
        1, 128,
        (long *)_huff_lengthlist_line_128x11_1sub1,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_128x11_2sub1[] = {
         0, 4, 5, 4, 5, 4, 5, 3, 5, 3, 5, 3, 5, 4, 4, 4,
         5, 5,
};

static const static_codebook _huff_book_line_128x11_2sub1 = {
        1, 18,
        (long *)_huff_lengthlist_line_128x11_2sub1,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_128x11_2sub2[] = {
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 3, 3, 3, 4, 4, 4, 4, 5, 4, 5, 4, 6, 5, 7,
         5, 7, 6, 8, 6, 8, 6, 9, 7, 9, 7,10, 7, 9, 8,11,
         8,11,
};

static const static_codebook _huff_book_line_128x11_2sub2 = {
        1, 50,
        (long *)_huff_lengthlist_line_128x11_2sub2,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_128x11_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, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 4, 8, 3, 8, 4, 8, 4, 8, 6, 8, 5, 8, 4, 8,
         4, 8, 6, 8, 7, 8, 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, 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, 7, 7, 7, 7, 7, 7, 7, 7,
};

static const static_codebook _huff_book_line_128x11_2sub3 = {
        1, 128,
        (long *)_huff_lengthlist_line_128x11_2sub3,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_128x11_3sub1[] = {
         0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 4,
         5, 4,
};

static const static_codebook _huff_book_line_128x11_3sub1 = {
        1, 18,
        (long *)_huff_lengthlist_line_128x11_3sub1,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_128x11_3sub2[] = {
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 5, 3, 5, 4, 6, 4, 6, 4, 7, 4, 7, 4, 8, 4,
         8, 4, 9, 4, 9, 4,10, 4,10, 5,10, 5,11, 5,12, 6,
        12, 6,
};

static const static_codebook _huff_book_line_128x11_3sub2 = {
        1, 50,
        (long *)_huff_lengthlist_line_128x11_3sub2,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_128x11_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, 0, 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, 1, 6, 3, 7, 3, 8, 4, 8, 5, 8, 8, 8, 9,
         7, 8, 8, 7, 7, 7, 8, 9,10, 9, 9,10,10,10,10,10,
        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
        10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
        10,10,10,10,10,10,10,10,10,10,10,10,10,10, 9, 9,
};

static const static_codebook _huff_book_line_128x11_3sub3 = {
        1, 128,
        (long *)_huff_lengthlist_line_128x11_3sub3,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_128x17_class1[] = {
         1, 3, 4, 7, 2, 5, 6, 7,
};

static const static_codebook _huff_book_line_128x17_class1 = {
        1, 8,
        (long *)_huff_lengthlist_line_128x17_class1,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_128x17_class2[] = {
         1, 4,10,19, 3, 8,13,19, 7,12,19,19,19,19,19,19,
         2, 6,11,19, 8,13,19,19, 9,11,19,19,19,19,19,19,
         6, 7,13,19, 9,13,19,19,10,13,18,18,18,18,18,18,
        18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,
};

static const static_codebook _huff_book_line_128x17_class2 = {
        1, 64,
        (long *)_huff_lengthlist_line_128x17_class2,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_128x17_class3[] = {
         3, 6,10,17, 4, 8,11,20, 8,10,11,20,20,20,20,20,
         2, 4, 8,18, 4, 6, 8,17, 7, 8,10,20,20,17,20,20,
         3, 5, 8,17, 3, 4, 6,17, 8, 8,10,17,17,12,16,20,
        13,13,15,20,10,10,12,20,15,14,15,20,20,20,19,19,
};

static const static_codebook _huff_book_line_128x17_class3 = {
        1, 64,
        (long *)_huff_lengthlist_line_128x17_class3,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_128x17_0sub0[] = {
         5, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 5,
         7, 5, 7, 5, 7, 5, 7, 5, 7, 5, 7, 5, 8, 5, 8, 5,
         8, 5, 8, 5, 8, 6, 8, 6, 8, 6, 9, 6, 9, 6, 9, 6,
         9, 6, 9, 7, 9, 7, 9, 7, 9, 7,10, 7,10, 8,10, 8,
        10, 8,10, 8,10, 8,11, 8,11, 8,11, 8,11, 8,11, 9,
        12, 9,12, 9,12, 9,12, 9,12,10,12,10,13,11,13,11,
        14,12,14,13,15,14,16,14,17,15,18,16,20,20,20,20,
        20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,
};

static const static_codebook _huff_book_line_128x17_0sub0 = {
        1, 128,
        (long *)_huff_lengthlist_line_128x17_0sub0,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_128x17_1sub0[] = {
         2, 5, 5, 4, 5, 4, 5, 4, 5, 5, 5, 5, 5, 5, 6, 5,
         6, 5, 6, 5, 7, 6, 7, 6, 7, 6, 8, 6, 9, 7, 9, 7,
};

static const static_codebook _huff_book_line_128x17_1sub0 = {
        1, 32,
        (long *)_huff_lengthlist_line_128x17_1sub0,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_128x17_1sub1[] = {
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         4, 3, 5, 3, 5, 3, 6, 3, 6, 4, 6, 4, 7, 4, 7, 5,
         8, 5, 8, 6, 9, 7, 9, 7, 9, 8,10, 9,10, 9,11,10,
        11,11,11,11,11,11,12,12,12,13,12,13,12,14,12,15,
        12,14,12,16,13,17,13,17,14,17,14,16,13,17,14,17,
        14,17,15,17,15,15,16,17,17,17,17,17,17,17,17,17,
        17,17,17,17,17,17,16,16,16,16,16,16,16,16,16,16,
};

static const static_codebook _huff_book_line_128x17_1sub1 = {
        1, 128,
        (long *)_huff_lengthlist_line_128x17_1sub1,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_128x17_2sub1[] = {
         0, 4, 5, 4, 6, 4, 8, 3, 9, 3, 9, 2, 9, 3, 8, 4,
         9, 4,
};

static const static_codebook _huff_book_line_128x17_2sub1 = {
        1, 18,
        (long *)_huff_lengthlist_line_128x17_2sub1,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_128x17_2sub2[] = {
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 5, 1, 5, 3, 5, 3, 5, 4, 7, 5,10, 7,10, 7,
        12,10,14,10,14, 9,14,11,14,14,14,13,13,13,13,13,
        13,13,
};

static const static_codebook _huff_book_line_128x17_2sub2 = {
        1, 50,
        (long *)_huff_lengthlist_line_128x17_2sub2,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_128x17_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, 0, 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, 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, 7, 7, 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, 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 const static_codebook _huff_book_line_128x17_2sub3 = {
        1, 128,
        (long *)_huff_lengthlist_line_128x17_2sub3,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_128x17_3sub1[] = {
         0, 4, 4, 4, 4, 4, 4, 4, 5, 3, 5, 3, 5, 4, 6, 4,
         6, 4,
};

static const static_codebook _huff_book_line_128x17_3sub1 = {
        1, 18,
        (long *)_huff_lengthlist_line_128x17_3sub1,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_128x17_3sub2[] = {
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 5, 3, 6, 3, 6, 4, 7, 4, 7, 4, 7, 4, 8, 4,
         8, 4, 8, 4, 8, 4, 9, 4, 9, 5,10, 5,10, 7,10, 8,
        10, 8,
};

static const static_codebook _huff_book_line_128x17_3sub2 = {
        1, 50,
        (long *)_huff_lengthlist_line_128x17_3sub2,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_128x17_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, 0, 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, 2, 4, 3, 4, 4, 4, 5, 4, 7, 5, 8, 5,11,
         6,10, 6,12, 7,12, 7,12, 8,12, 8,12,10,12,12,12,
        12,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
        11,11,11,11,11,11,11,11,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 const static_codebook _huff_book_line_128x17_3sub3 = {
        1, 128,
        (long *)_huff_lengthlist_line_128x17_3sub3,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_1024x27_class1[] = {
         2,10, 8,14, 7,12,11,14, 1, 5, 3, 7, 4, 9, 7,13,
};

static const static_codebook _huff_book_line_1024x27_class1 = {
        1, 16,
        (long *)_huff_lengthlist_line_1024x27_class1,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_1024x27_class2[] = {
         1, 4, 2, 6, 3, 7, 5, 7,
};

static const static_codebook _huff_book_line_1024x27_class2 = {
        1, 8,
        (long *)_huff_lengthlist_line_1024x27_class2,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_1024x27_class3[] = {
         1, 5, 7,21, 5, 8, 9,21,10, 9,12,20,20,16,20,20,
         4, 8, 9,20, 6, 8, 9,20,11,11,13,20,20,15,17,20,
         9,11,14,20, 8,10,15,20,11,13,15,20,20,20,20,20,
        20,20,20,20,13,20,20,20,18,18,20,20,20,20,20,20,
         3, 6, 8,20, 6, 7, 9,20,10, 9,12,20,20,20,20,20,
         5, 7, 9,20, 6, 6, 9,20,10, 9,12,20,20,20,20,20,
         8,10,13,20, 8, 9,12,20,11,10,12,20,20,20,20,20,
        18,20,20,20,15,17,18,20,18,17,18,20,20,20,20,20,
         7,10,12,20, 8, 9,11,20,14,13,14,20,20,20,20,20,
         6, 9,12,20, 7, 8,11,20,12,11,13,20,20,20,20,20,
         9,11,15,20, 8,10,14,20,12,11,14,20,20,20,20,20,
        20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,
        11,16,18,20,15,15,17,20,20,17,20,20,20,20,20,20,
         9,14,16,20,12,12,15,20,17,15,18,20,20,20,20,20,
        16,19,18,20,15,16,20,20,17,17,20,20,20,20,20,20,
        20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,
};

static const static_codebook _huff_book_line_1024x27_class3 = {
        1, 256,
        (long *)_huff_lengthlist_line_1024x27_class3,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_1024x27_class4[] = {
         2, 3, 7,13, 4, 4, 7,15, 8, 6, 9,17,21,16,15,21,
         2, 5, 7,11, 5, 5, 7,14, 9, 7,10,16,17,15,16,21,
         4, 7,10,17, 7, 7, 9,15,11, 9,11,16,21,18,15,21,
        18,21,21,21,15,17,17,19,21,19,18,20,21,21,21,20,
};

static const static_codebook _huff_book_line_1024x27_class4 = {
        1, 64,
        (long *)_huff_lengthlist_line_1024x27_class4,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_1024x27_0sub0[] = {
         5, 5, 5, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 5,
         6, 5, 6, 5, 6, 5, 6, 5, 7, 5, 7, 5, 7, 5, 7, 5,
         8, 6, 8, 6, 8, 6, 9, 6, 9, 6,10, 6,10, 6,11, 6,
        11, 7,11, 7,12, 7,12, 7,12, 7,12, 7,12, 7,12, 7,
        12, 7,12, 8,13, 8,12, 8,12, 8,13, 8,13, 9,13, 9,
        13, 9,13, 9,12,10,12,10,13,10,14,11,14,12,14,13,
        14,13,14,14,15,16,15,15,15,14,15,17,21,22,22,21,
        22,22,22,22,22,22,21,21,21,21,21,21,21,21,21,21,
};

static const static_codebook _huff_book_line_1024x27_0sub0 = {
        1, 128,
        (long *)_huff_lengthlist_line_1024x27_0sub0,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_1024x27_1sub0[] = {
         2, 5, 5, 4, 5, 4, 5, 4, 5, 4, 6, 5, 6, 5, 6, 5,
         6, 5, 7, 5, 7, 6, 8, 6, 8, 6, 8, 6, 9, 6, 9, 6,
};

static const static_codebook _huff_book_line_1024x27_1sub0 = {
        1, 32,
        (long *)_huff_lengthlist_line_1024x27_1sub0,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_1024x27_1sub1[] = {
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         8, 5, 8, 4, 9, 4, 9, 4, 9, 4, 9, 4, 9, 4, 9, 4,
         9, 4, 9, 4, 9, 4, 8, 4, 8, 4, 9, 5, 9, 5, 9, 5,
         9, 5, 9, 6,10, 6,10, 7,10, 8,11, 9,11,11,12,13,
        12,14,13,15,13,15,14,16,14,17,15,17,15,15,16,16,
        15,16,16,16,15,18,16,15,17,17,19,19,19,19,19,19,
        19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,
};

static const static_codebook _huff_book_line_1024x27_1sub1 = {
        1, 128,
        (long *)_huff_lengthlist_line_1024x27_1sub1,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_1024x27_2sub0[] = {
         1, 5, 5, 5, 5, 5, 5, 5, 6, 5, 6, 5, 6, 5, 6, 5,
         6, 6, 7, 7, 7, 7, 8, 7, 8, 8, 9, 8,10, 9,10, 9,
};

static const static_codebook _huff_book_line_1024x27_2sub0 = {
        1, 32,
        (long *)_huff_lengthlist_line_1024x27_2sub0,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_1024x27_2sub1[] = {
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         4, 3, 4, 3, 4, 4, 5, 4, 5, 4, 5, 5, 6, 5, 6, 5,
         7, 5, 7, 6, 7, 6, 8, 7, 8, 7, 8, 7, 9, 8, 9, 9,
         9, 9,10,10,10,11, 9,12, 9,12, 9,15,10,14, 9,13,
        10,13,10,12,10,12,10,13,10,12,11,13,11,14,12,13,
        13,14,14,13,14,15,14,16,13,13,14,16,16,16,16,16,
        16,16,16,16,16,16,16,16,16,16,16,16,16,16,15,15,
};

static const static_codebook _huff_book_line_1024x27_2sub1 = {
        1, 128,
        (long *)_huff_lengthlist_line_1024x27_2sub1,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_1024x27_3sub1[] = {
         0, 4, 5, 4, 5, 3, 5, 3, 5, 3, 5, 4, 4, 4, 4, 5,
         5, 5,
};

static const static_codebook _huff_book_line_1024x27_3sub1 = {
        1, 18,
        (long *)_huff_lengthlist_line_1024x27_3sub1,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_1024x27_3sub2[] = {
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 3, 3, 4, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6,
         5, 7, 5, 8, 6, 8, 6, 9, 7,10, 7,10, 8,10, 8,11,
         9,11,
};

static const static_codebook _huff_book_line_1024x27_3sub2 = {
        1, 50,
        (long *)_huff_lengthlist_line_1024x27_3sub2,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_1024x27_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, 0, 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, 7, 3, 8, 3,10, 3, 8, 3, 9, 3, 8, 4, 9,
         4, 9, 5, 9, 6,10, 6, 9, 7,11, 7,12, 9,13,10,13,
        12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
        12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
        12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
};

static const static_codebook _huff_book_line_1024x27_3sub3 = {
        1, 128,
        (long *)_huff_lengthlist_line_1024x27_3sub3,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_1024x27_4sub1[] = {
         0, 4, 5, 4, 5, 4, 5, 4, 5, 3, 5, 3, 5, 3, 5, 4,
         5, 4,
};

static const static_codebook _huff_book_line_1024x27_4sub1 = {
        1, 18,
        (long *)_huff_lengthlist_line_1024x27_4sub1,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_1024x27_4sub2[] = {
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 4, 2, 4, 2, 5, 3, 5, 4, 6, 6, 6, 7, 7, 8,
         7, 8, 7, 8, 7, 9, 8, 9, 8, 9, 8,10, 8,11, 9,12,
         9,12,
};

static const static_codebook _huff_book_line_1024x27_4sub2 = {
        1, 50,
        (long *)_huff_lengthlist_line_1024x27_4sub2,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_1024x27_4sub3[] = {
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 5, 2, 6, 3, 6, 4, 7, 4, 7, 5, 9, 5,11,
         6,11, 6,11, 7,11, 6,11, 6,11, 9,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,10,10,10,10,10,10,
};

static const static_codebook _huff_book_line_1024x27_4sub3 = {
        1, 128,
        (long *)_huff_lengthlist_line_1024x27_4sub3,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_2048x27_class1[] = {
         2, 6, 8, 9, 7,11,13,13, 1, 3, 5, 5, 6, 6,12,10,
};

static const static_codebook _huff_book_line_2048x27_class1 = {
        1, 16,
        (long *)_huff_lengthlist_line_2048x27_class1,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_2048x27_class2[] = {
         1, 2, 3, 6, 4, 7, 5, 7,
};

static const static_codebook _huff_book_line_2048x27_class2 = {
        1, 8,
        (long *)_huff_lengthlist_line_2048x27_class2,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_2048x27_class3[] = {
         3, 3, 6,16, 5, 5, 7,16, 9, 8,11,16,16,16,16,16,
         5, 5, 8,16, 5, 5, 7,16, 8, 7, 9,16,16,16,16,16,
         9, 9,12,16, 6, 8,11,16, 9,10,11,16,16,16,16,16,
        16,16,16,16,13,16,16,16,15,16,16,16,16,16,16,16,
         5, 4, 7,16, 6, 5, 8,16, 9, 8,10,16,16,16,16,16,
         5, 5, 7,15, 5, 4, 6,15, 7, 6, 8,16,16,16,16,16,
         9, 9,11,15, 7, 7, 9,16, 8, 8, 9,16,16,16,16,16,
        16,16,16,16,15,15,15,16,15,15,14,16,16,16,16,16,
         8, 8,11,16, 8, 9,10,16,11,10,14,16,16,16,16,16,
         6, 8,10,16, 6, 7,10,16, 8, 8,11,16,14,16,16,16,
        10,11,14,16, 9, 9,11,16,10,10,11,16,16,16,16,16,
        16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
        16,16,16,16,15,16,16,16,16,16,16,16,16,16,16,16,
        12,16,15,16,12,14,16,16,16,16,16,16,16,16,16,16,
        16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
        16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
};

static const static_codebook _huff_book_line_2048x27_class3 = {
        1, 256,
        (long *)_huff_lengthlist_line_2048x27_class3,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_2048x27_class4[] = {
         2, 4, 7,13, 4, 5, 7,15, 8, 7,10,16,16,14,16,16,
         2, 4, 7,16, 3, 4, 7,14, 8, 8,10,16,16,16,15,16,
         6, 8,11,16, 7, 7, 9,16,11, 9,13,16,16,16,15,16,
        16,16,16,16,14,16,16,16,16,16,16,16,16,16,16,16,
};

static const static_codebook _huff_book_line_2048x27_class4 = {
        1, 64,
        (long *)_huff_lengthlist_line_2048x27_class4,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_2048x27_0sub0[] = {
         5, 5, 5, 5, 5, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 5,
         6, 5, 7, 5, 7, 5, 7, 5, 8, 5, 8, 5, 8, 5, 9, 5,
         9, 6,10, 6,10, 6,11, 6,11, 6,11, 6,11, 6,11, 6,
        11, 6,11, 6,12, 7,11, 7,11, 7,11, 7,11, 7,10, 7,
        11, 7,11, 7,12, 7,11, 8,11, 8,11, 8,11, 8,13, 8,
        12, 9,11, 9,11, 9,11,10,12,10,12, 9,12,10,12,11,
        14,12,16,12,12,11,14,16,17,17,17,17,17,17,17,17,
        17,17,17,17,17,17,17,17,17,17,17,17,16,16,16,16,
};

static const static_codebook _huff_book_line_2048x27_0sub0 = {
        1, 128,
        (long *)_huff_lengthlist_line_2048x27_0sub0,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_2048x27_1sub0[] = {
         4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5,
         5, 5, 6, 6, 6, 6, 6, 6, 7, 6, 7, 6, 7, 6, 7, 6,
};

static const static_codebook _huff_book_line_2048x27_1sub0 = {
        1, 32,
        (long *)_huff_lengthlist_line_2048x27_1sub0,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_2048x27_1sub1[] = {
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         6, 5, 7, 5, 7, 4, 7, 4, 8, 4, 8, 4, 8, 4, 8, 3,
         8, 4, 9, 4, 9, 4, 9, 4, 9, 4, 9, 5, 9, 5, 9, 6,
         9, 7, 9, 8, 9, 9, 9,10, 9,11, 9,14, 9,15,10,15,
        10,15,10,15,10,15,11,15,10,14,12,14,11,14,13,14,
        13,15,15,15,12,15,15,15,13,15,13,15,13,15,15,15,
        15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,14,
};

static const static_codebook _huff_book_line_2048x27_1sub1 = {
        1, 128,
        (long *)_huff_lengthlist_line_2048x27_1sub1,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_2048x27_2sub0[] = {
         2, 4, 5, 4, 5, 4, 5, 4, 5, 5, 5, 5, 5, 5, 6, 5,
         6, 5, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8,
};

static const static_codebook _huff_book_line_2048x27_2sub0 = {
        1, 32,
        (long *)_huff_lengthlist_line_2048x27_2sub0,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_2048x27_2sub1[] = {
         0, 0, 0, 0, 0, 0, 0, 0, 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, 3, 4, 3, 4, 4, 5, 4, 5, 5, 5, 6, 6, 6, 7,
         6, 8, 6, 8, 6, 9, 7,10, 7,10, 7,10, 7,12, 7,12,
         7,12, 9,12,11,12,10,12,10,12,11,12,12,12,10,12,
        10,12,10,12, 9,12,11,12,12,12,12,12,11,12,11,12,
        12,12,12,12,12,12,12,12,10,10,12,12,12,12,12,10,
        12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
};

static const static_codebook _huff_book_line_2048x27_2sub1 = {
        1, 128,
        (long *)_huff_lengthlist_line_2048x27_2sub1,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_2048x27_3sub1[] = {
         0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
         5, 5,
};

static const static_codebook _huff_book_line_2048x27_3sub1 = {
        1, 18,
        (long *)_huff_lengthlist_line_2048x27_3sub1,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_2048x27_3sub2[] = {
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6,
         6, 7, 6, 7, 6, 8, 6, 9, 7, 9, 7, 9, 9,11, 9,12,
        10,12,
};

static const static_codebook _huff_book_line_2048x27_3sub2 = {
        1, 50,
        (long *)_huff_lengthlist_line_2048x27_3sub2,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_2048x27_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, 0, 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, 6, 3, 7, 3, 7, 5, 7, 7, 7, 7, 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, 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, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
};

static const static_codebook _huff_book_line_2048x27_3sub3 = {
        1, 128,
        (long *)_huff_lengthlist_line_2048x27_3sub3,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_2048x27_4sub1[] = {
         0, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 4, 5, 4, 5, 4,
         4, 5,
};

static const static_codebook _huff_book_line_2048x27_4sub1 = {
        1, 18,
        (long *)_huff_lengthlist_line_2048x27_4sub1,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_2048x27_4sub2[] = {
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 3, 2, 4, 3, 4, 4, 4, 5, 5, 6, 5, 6, 5, 7,
         6, 6, 6, 7, 7, 7, 8, 9, 9, 9,12,10,11,10,10,12,
        10,10,
};

static const static_codebook _huff_book_line_2048x27_4sub2 = {
        1, 50,
        (long *)_huff_lengthlist_line_2048x27_4sub2,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_2048x27_4sub3[] = {
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 6, 5, 7, 5, 7, 7, 7, 7, 7, 5, 7, 5, 7,
         5, 7, 5, 7, 7, 7, 7, 7, 4, 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, 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, 6, 6, 6, 6, 6,
};

static const static_codebook _huff_book_line_2048x27_4sub3 = {
        1, 128,
        (long *)_huff_lengthlist_line_2048x27_4sub3,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_256x4low_class0[] = {
         4, 5, 6,11, 5, 5, 6,10, 7, 7, 6, 6,14,13, 9, 9,
         6, 6, 6,10, 6, 6, 6, 9, 8, 7, 7, 9,14,12, 8,11,
         8, 7, 7,11, 8, 8, 7,11, 9, 9, 7, 9,13,11, 9,13,
        19,19,18,19,15,16,16,19,11,11,10,13,10,10, 9,15,
         5, 5, 6,13, 6, 6, 6,11, 8, 7, 6, 7,14,11,10,11,
         6, 6, 6,12, 7, 6, 6,11, 8, 7, 7,11,13,11, 9,11,
         9, 7, 6,12, 8, 7, 6,12, 9, 8, 8,11,13,10, 7,13,
        19,19,17,19,17,14,14,19,12,10, 8,12,13,10, 9,16,
         7, 8, 7,12, 7, 7, 7,11, 8, 7, 7, 8,12,12,11,11,
         8, 8, 7,12, 8, 7, 6,11, 8, 7, 7,10,10,11,10,11,
         9, 8, 8,13, 9, 8, 7,12,10, 9, 7,11, 9, 8, 7,11,
        18,18,15,18,18,16,17,18,15,11,10,18,11, 9, 9,18,
        16,16,13,16,12,11,10,16,12,11, 9, 6,15,12,11,13,
        16,16,14,14,13,11,12,16,12, 9, 9,13,13,10,10,12,
        17,18,17,17,14,15,14,16,14,12,14,15,12,10,11,12,
        18,18,18,18,18,18,18,18,18,12,13,18,16,11, 9,18,
};

static const static_codebook _huff_book_line_256x4low_class0 = {
        1, 256,
        (long *)_huff_lengthlist_line_256x4low_class0,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_256x4low_0sub0[] = {
         1, 3, 2, 3,
};

static const static_codebook _huff_book_line_256x4low_0sub0 = {
        1, 4,
        (long *)_huff_lengthlist_line_256x4low_0sub0,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_256x4low_0sub1[] = {
         0, 0, 0, 0, 2, 3, 2, 3, 3, 3,
};

static const static_codebook _huff_book_line_256x4low_0sub1 = {
        1, 10,
        (long *)_huff_lengthlist_line_256x4low_0sub1,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_256x4low_0sub2[] = {
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 4, 3, 4,
         4, 4, 4, 4, 5, 5, 5, 6, 6,
};

static const static_codebook _huff_book_line_256x4low_0sub2 = {
        1, 25,
        (long *)_huff_lengthlist_line_256x4low_0sub2,
        0, 0, 0, 0, 0,
        NULL,
        0
};

static const long _huff_lengthlist_line_256x4low_0sub3[] = {
         0, 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, 2, 4, 3, 5, 4,
         5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 7, 7, 8, 6, 9,
         7,12,11,16,13,16,12,15,13,15,12,14,12,15,15,15,
};

static const static_codebook _huff_book_line_256x4low_0sub3 = {
        1, 64,
        (long *)_huff_lengthlist_line_256x4low_0sub3,
        0, 0, 0, 0, 0,
        NULL,
        0
};

repo_name: fedden/RenderMan

mime_type: text/x-c++