sharedbook.c 17.4 KB
Newer Older
1 2
/********************************************************************
 *                                                                  *
3
 * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
Monty's avatar
Monty committed
4 5 6
 * 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.       *
7
 *                                                                  *
Ralph Giles's avatar
Ralph Giles committed
8
 * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2015             *
9
 * by the Xiph.Org Foundation http://www.xiph.org/                  *
10
 *                                                                  *
11 12 13 14 15 16 17
 ********************************************************************

 function: basic shared codebook operations

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

#include <stdlib.h>
18
#include <limits.h>
19
#include <math.h>
20
#include <string.h>
21
#include <ogg/ogg.h>
22
#include "os.h"
23
#include "misc.h"
24
#include "vorbis/codec.h"
25
#include "codebook.h"
26 27 28
#include "scales.h"

/**** pack/unpack helpers ******************************************/
29 30 31 32 33

int ov_ilog(ogg_uint32_t v){
  int ret;
  for(ret=0;v;ret++)v>>=1;
  return ret;
34 35 36
}

/* 32 bit float (not IEEE; nonnormalized mantissa +
Monty's avatar
Monty committed
37
   biased exponent) : neeeeeee eeemmmmm mmmmmmmm mmmmmmmm
38 39 40 41 42 43 44
   Why not IEEE?  It's just not that important here. */

#define VQ_FEXP 10
#define VQ_FMAN 21
#define VQ_FEXP_BIAS 768 /* bias toward values smaller than 1. */

/* doesn't currently guard under/overflow */
45
long _float32_pack(float val){
46 47 48 49 50 51 52
  int sign=0;
  long exp;
  long mant;
  if(val<0){
    sign=0x80000000;
    val= -val;
  }
Thomas Daede's avatar
Thomas Daede committed
53
  exp= floor(log(val)/log(2.f)+.001); /* +epsilon */
54 55 56 57 58 59
  mant=rint(ldexp(val,(VQ_FMAN-1)-exp));
  exp=(exp+VQ_FEXP_BIAS)<<VQ_FMAN;

  return(sign|exp|mant);
}

60
float _float32_unpack(long val){
Monty's avatar
Monty committed
61 62 63
  double mant=val&0x1fffff;
  int    sign=val&0x80000000;
  long   exp =(val&0x7fe00000L)>>VQ_FMAN;
64
  if(sign)mant= -mant;
65 66 67 68 69 70
  exp=exp-(VQ_FMAN-1)-VQ_FEXP_BIAS;
  /* clamp excessive exponent values */
  if (exp>63){
    exp=63;
  }
  if (exp<-63){
71
    exp=-63;
72 73
  }
  return(ldexp(mant,exp));
74 75 76 77 78
}

/* given a list of word lengths, generate a list of codewords.  Works
   for length ordered or unordered, always assigns the lowest valued
   codewords first.  Extended to handle unused entries (length 0) */
79
ogg_uint32_t *_make_words(char *l,long n,long sparsecount){
Monty's avatar
Monty committed
80 81 82
  long i,j,count=0;
  ogg_uint32_t marker[33];
  ogg_uint32_t *r=_ogg_malloc((sparsecount?sparsecount:n)*sizeof(*r));
83 84 85 86 87
  memset(marker,0,sizeof(marker));

  for(i=0;i<n;i++){
    long length=l[i];
    if(length>0){
Monty's avatar
Monty committed
88
      ogg_uint32_t entry=marker[length];
Monty's avatar
Monty committed
89

90
      /* when we claim a node for an entry, we also claim the nodes
91 92 93
         below it (pruning off the imagined tree that may have dangled
         from it) as well as blocking the use of any nodes directly
         above for leaves */
Monty's avatar
Monty committed
94

95 96
      /* update ourself */
      if(length<32 && (entry>>length)){
97 98 99
        /* error condition; the lengths must specify an overpopulated tree */
        _ogg_free(r);
        return(NULL);
100
      }
Monty's avatar
Monty committed
101
      r[count++]=entry;
Monty's avatar
Monty committed
102

103
      /* Look to see if the next shorter marker points to the node
104
         above. if so, update it and repeat.  */
105
      {
106
        for(j=length;j>0;j--){
Monty's avatar
Monty committed
107

108 109 110 111 112 113 114 115 116 117 118
          if(marker[j]&1){
            /* have to jump branches */
            if(j==1)
              marker[1]++;
            else
              marker[j]=marker[j-1]<<1;
            break; /* invariant says next upper marker would already
                      have been moved if it was on the same path */
          }
          marker[j]++;
        }
119
      }
Monty's avatar
Monty committed
120

121
      /* prune the tree; the implicit invariant says all the longer
122 123
         markers were dangling from our just-taken node.  Dangle them
         from our *new* node. */
124
      for(j=length+1;j<33;j++)
125 126 127 128 129
        if((marker[j]>>1) == entry){
          entry=marker[j];
          marker[j]=marker[j-1]<<1;
        }else
          break;
Monty's avatar
Monty committed
130 131
    }else
      if(sparsecount==0)count++;
132
  }
Monty's avatar
Monty committed
133

134 135 136 137 138
  /* any underpopulated tree must be rejected. */
  /* Single-entry codebooks are a retconned extension to the spec.
     They have a single codeword '0' of length 1 that results in an
     underpopulated tree.  Shield that case from the underformed tree check. */
  if(!(count==1 && marker[2]==2)){
139 140
    for(i=1;i<33;i++)
      if(marker[i] & (0xffffffffUL>>(32-i))){
141 142
        _ogg_free(r);
        return(NULL);
143 144
      }
  }
145

146 147
  /* bitreverse the words because our bitwise packer/unpacker is LSb
     endian */
Monty's avatar
Monty committed
148 149
  for(i=0,count=0;i<n;i++){
    ogg_uint32_t temp=0;
150 151
    for(j=0;j<l[i];j++){
      temp<<=1;
Monty's avatar
Monty committed
152
      temp|=(r[count]>>j)&1;
153
    }
154 155 156

    if(sparsecount){
      if(l[i])
157
        r[count++]=temp;
158 159
    }else
      r[count++]=temp;
160 161 162 163 164 165 166 167 168
  }

  return(r);
}

/* there might be a straightforward one-line way to do the below
   that's portable and totally safe against roundoff, but I haven't
   thought of it.  Therefore, we opt on the side of caution */
long _book_maptype1_quantvals(const static_codebook *b){
169 170 171 172 173
  long vals;
  if(b->entries<1){
    return(0);
  }
  vals=floor(pow((float)b->entries,1.f/b->dim));
174 175 176 177 178 179

  /* the above *should* be reliable, but we'll not assume that FP is
     ever reliable when bitstream sync is at stake; verify via integer
     means that vals really is the greatest value of dim for which
     vals^b->bim <= b->entries */
  /* treat the above as an initial guess */
180 181 182
  if(vals<1){
    vals=1;
  }
183 184 185 186 187
  while(1){
    long acc=1;
    long acc1=1;
    int i;
    for(i=0;i<b->dim;i++){
188
      if(b->entries/vals<acc)break;
189
      acc*=vals;
190 191
      if(LONG_MAX/(vals+1)<acc1)acc1=LONG_MAX;
      else acc1*=vals+1;
192
    }
193
    if(i>=b->dim && acc<=b->entries && acc1>b->entries){
194 195
      return(vals);
    }else{
196
      if(i<b->dim || acc>b->entries){
197
        vals--;
198
      }else{
199
        vals++;
200 201 202 203 204 205 206 207 208 209
      }
    }
  }
}

/* unpack the quantized list of values for encode/decode ***********/
/* we need to deal with two map types: in map type 1, the values are
   generated algorithmically (each column of the vector counts through
   the values in the quant vector). in map type 2, all the values came
   in in an explicit list.  Both value lists must be unpacked */
Monty's avatar
Monty committed
210 211
float *_book_unquantize(const static_codebook *b,int n,int *sparsemap){
  long j,k,count=0;
212 213
  if(b->maptype==1 || b->maptype==2){
    int quantvals;
214 215
    float mindel=_float32_unpack(b->q_min);
    float delta=_float32_unpack(b->q_delta);
Monty's avatar
Monty committed
216
    float *r=_ogg_calloc(n*b->dim,sizeof(*r));
217 218 219 220 221 222

    /* maptype 1 and 2 both use a quantized value vector, but
       different sizes */
    switch(b->maptype){
    case 1:
      /* most of the time, entries%dimensions == 0, but we need to be
223 224 225 226 227 228
         well defined.  We define that the possible vales at each
         scalar is values == entries/dim.  If entries%dim != 0, we'll
         have 'too few' values (values*dim<entries), which means that
         we'll have 'left over' entries; left over entries use zeroed
         values (and are wasted).  So don't generate codebooks like
         that */
229 230
      quantvals=_book_maptype1_quantvals(b);
      for(j=0;j<b->entries;j++){
231 232 233 234 235 236 237
        if((sparsemap && b->lengthlist[j]) || !sparsemap){
          float last=0.f;
          int indexdiv=1;
          for(k=0;k<b->dim;k++){
            int index= (j/indexdiv)%quantvals;
            float val=b->quantlist[index];
            val=fabs(val)*delta+mindel+last;
Monty's avatar
Monty committed
238
            if(b->q_sequencep)last=val;
239 240 241 242 243 244 245 246
            if(sparsemap)
              r[sparsemap[count]*b->dim+k]=val;
            else
              r[count*b->dim+k]=val;
            indexdiv*=quantvals;
          }
          count++;
        }
Monty's avatar
Monty committed
247

248 249 250 251
      }
      break;
    case 2:
      for(j=0;j<b->entries;j++){
252 253
        if((sparsemap && b->lengthlist[j]) || !sparsemap){
          float last=0.f;
Monty's avatar
Monty committed
254

255 256 257
          for(k=0;k<b->dim;k++){
            float val=b->quantlist[j*b->dim+k];
            val=fabs(val)*delta+mindel+last;
Monty's avatar
Monty committed
258
            if(b->q_sequencep)last=val;
259 260 261 262 263 264 265
            if(sparsemap)
              r[sparsemap[count]*b->dim+k]=val;
            else
              r[count*b->dim+k]=val;
          }
          count++;
        }
266
      }
267
      break;
268
    }
269

270 271 272 273 274
    return(r);
  }
  return(NULL);
}

275
void vorbis_staticbook_destroy(static_codebook *b){
276
  if(b->allocedp){
Monty's avatar
Monty committed
277 278
    if(b->quantlist)_ogg_free(b->quantlist);
    if(b->lengthlist)_ogg_free(b->lengthlist);
279
    memset(b,0,sizeof(*b));
Monty's avatar
Monty committed
280
    _ogg_free(b);
281
  } /* otherwise, it is in static memory */
282 283 284 285 286
}

void vorbis_book_clear(codebook *b){
  /* static book is not cleared; we're likely called on the lookup and
     the static codebook belongs to the info struct */
Monty's avatar
Monty committed
287 288
  if(b->valuelist)_ogg_free(b->valuelist);
  if(b->codelist)_ogg_free(b->codelist);
Monty's avatar
Monty committed
289 290 291 292 293

  if(b->dec_index)_ogg_free(b->dec_index);
  if(b->dec_codelengths)_ogg_free(b->dec_codelengths);
  if(b->dec_firsttable)_ogg_free(b->dec_firsttable);

294
  memset(b,0,sizeof(*b));
295 296 297
}

int vorbis_book_init_encode(codebook *c,const static_codebook *s){
Monty's avatar
Monty committed
298

299
  memset(c,0,sizeof(*c));
300 301
  c->c=s;
  c->entries=s->entries;
Monty's avatar
Monty committed
302
  c->used_entries=s->entries;
303
  c->dim=s->dim;
Monty's avatar
Monty committed
304
  c->codelist=_make_words(s->lengthlist,s->entries,0);
Thomas Daede's avatar
Thomas Daede committed
305
  /* c->valuelist=_book_unquantize(s,s->entries,NULL); */
306 307 308
  c->quantvals=_book_maptype1_quantvals(s);
  c->minval=(int)rint(_float32_unpack(s->q_min));
  c->delta=(int)rint(_float32_unpack(s->q_delta));
309

310 311 312
  return(0);
}

Monty's avatar
Monty committed
313 314 315 316 317 318 319 320 321
static ogg_uint32_t bitreverse(ogg_uint32_t x){
  x=    ((x>>16)&0x0000ffffUL) | ((x<<16)&0xffff0000UL);
  x=    ((x>> 8)&0x00ff00ffUL) | ((x<< 8)&0xff00ff00UL);
  x=    ((x>> 4)&0x0f0f0f0fUL) | ((x<< 4)&0xf0f0f0f0UL);
  x=    ((x>> 2)&0x33333333UL) | ((x<< 2)&0xccccccccUL);
  return((x>> 1)&0x55555555UL) | ((x<< 1)&0xaaaaaaaaUL);
}

static int sort32a(const void *a,const void *b){
Monty's avatar
Monty committed
322
  return ( **(ogg_uint32_t **)a>**(ogg_uint32_t **)b)-
323
    ( **(ogg_uint32_t **)a<**(ogg_uint32_t **)b);
Monty's avatar
Monty committed
324 325 326
}

/* decode codebook arrangement is more heavily optimized than encode */
327
int vorbis_book_init_decode(codebook *c,const static_codebook *s){
Monty's avatar
Monty committed
328 329
  int i,j,n=0,tabn;
  int *sortindex;
330

331
  memset(c,0,sizeof(*c));
Monty's avatar
Monty committed
332

333
  /* count actually used entries and find max length */
Monty's avatar
Monty committed
334 335 336 337
  for(i=0;i<s->entries;i++)
    if(s->lengthlist[i]>0)
      n++;

338
  c->entries=s->entries;
Monty's avatar
Monty committed
339
  c->used_entries=n;
340
  c->dim=s->dim;
Monty's avatar
Monty committed
341

342
  if(n>0){
Monty's avatar
Monty committed
343 344
    /* two different remappings go on here.

345 346 347 348
    First, we collapse the likely sparse codebook down only to
    actually represented values/words.  This collapsing needs to be
    indexed as map-valueless books are used to encode original entry
    positions as integers.
Monty's avatar
Monty committed
349

350 351
    Second, we reorder all vectors, including the entry index above,
    by sorted bitreversed codeword to allow treeless decode. */
Monty's avatar
Monty committed
352 353 354 355

    /* perform sort */
    ogg_uint32_t *codes=_make_words(s->lengthlist,s->entries,c->used_entries);
    ogg_uint32_t **codep=alloca(sizeof(*codep)*n);
Monty's avatar
Monty committed
356

Monty's avatar
Monty committed
357
    if(codes==NULL)goto err_out;
Monty's avatar
Monty committed
358

Monty's avatar
Monty committed
359 360 361 362
    for(i=0;i<n;i++){
      codes[i]=bitreverse(codes[i]);
      codep[i]=codes+i;
    }
Monty's avatar
Monty committed
363

Monty's avatar
Monty committed
364
    qsort(codep,n,sizeof(*codep),sort32a);
Monty's avatar
Monty committed
365

Monty's avatar
Monty committed
366 367 368 369 370 371 372 373 374 375 376
    sortindex=alloca(n*sizeof(*sortindex));
    c->codelist=_ogg_malloc(n*sizeof(*c->codelist));
    /* the index is a reverse index */
    for(i=0;i<n;i++){
      int position=codep[i]-codes;
      sortindex[position]=i;
    }

    for(i=0;i<n;i++)
      c->codelist[sortindex[i]]=codes[i];
    _ogg_free(codes);
Monty's avatar
Monty committed
377

378 379
    c->valuelist=_book_unquantize(s,n,sortindex);
    c->dec_index=_ogg_malloc(n*sizeof(*c->dec_index));
Monty's avatar
Monty committed
380

381 382
    for(n=0,i=0;i<s->entries;i++)
      if(s->lengthlist[i]>0)
383
        c->dec_index[sortindex[n++]]=i;
Monty's avatar
Monty committed
384

385
    c->dec_codelengths=_ogg_malloc(n*sizeof(*c->dec_codelengths));
386
    c->dec_maxlength=0;
387
    for(n=0,i=0;i<s->entries;i++)
388
      if(s->lengthlist[i]>0){
389
        c->dec_codelengths[sortindex[n++]]=s->lengthlist[i];
390 391 392
        if(s->lengthlist[i]>c->dec_maxlength)
          c->dec_maxlength=s->lengthlist[i];
      }
Monty's avatar
Monty committed
393

394 395 396 397 398 399 400
    if(n==1 && c->dec_maxlength==1){
      /* special case the 'single entry codebook' with a single bit
       fastpath table (that always returns entry 0 )in order to use
       unmodified decode paths. */
      c->dec_firsttablen=1;
      c->dec_firsttable=_ogg_calloc(2,sizeof(*c->dec_firsttable));
      c->dec_firsttable[0]=c->dec_firsttable[1]=1;
Monty's avatar
Monty committed
401

402 403 404 405 406 407 408 409 410 411 412 413 414 415
    }else{
      c->dec_firsttablen=ov_ilog(c->used_entries)-4; /* this is magic */
      if(c->dec_firsttablen<5)c->dec_firsttablen=5;
      if(c->dec_firsttablen>8)c->dec_firsttablen=8;

      tabn=1<<c->dec_firsttablen;
      c->dec_firsttable=_ogg_calloc(tabn,sizeof(*c->dec_firsttable));

      for(i=0;i<n;i++){
        if(c->dec_codelengths[i]<=c->dec_firsttablen){
          ogg_uint32_t orig=bitreverse(c->codelist[i]);
          for(j=0;j<(1<<(c->dec_firsttablen-c->dec_codelengths[i]));j++)
            c->dec_firsttable[orig|(j<<c->dec_codelengths[i])]=i+1;
        }
416
      }
Monty's avatar
Monty committed
417

418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441
      /* now fill in 'unused' entries in the firsttable with hi/lo search
         hints for the non-direct-hits */
      {
        ogg_uint32_t mask=0xfffffffeUL<<(31-c->dec_firsttablen);
        long lo=0,hi=0;

        for(i=0;i<tabn;i++){
          ogg_uint32_t word=i<<(32-c->dec_firsttablen);
          if(c->dec_firsttable[bitreverse(word)]==0){
            while((lo+1)<n && c->codelist[lo+1]<=word)lo++;
            while(    hi<n && word>=(c->codelist[hi]&mask))hi++;

            /* we only actually have 15 bits per hint to play with here.
               In order to overflow gracefully (nothing breaks, efficiency
               just drops), encode as the difference from the extremes. */
            {
              unsigned long loval=lo;
              unsigned long hival=n-hi;

              if(loval>0x7fff)loval=0x7fff;
              if(hival>0x7fff)hival=0x7fff;
              c->dec_firsttable[bitreverse(word)]=
                0x80000000UL | (loval<<15) | hival;
            }
442 443
          }
        }
444
      }
Monty's avatar
Monty committed
445 446 447
    }
  }

448 449 450 451 452 453 454
  return(0);
 err_out:
  vorbis_book_clear(c);
  return(-1);
}

long vorbis_book_codeword(codebook *book,int entry){
Monty's avatar
Monty committed
455 456 457 458
  if(book->c) /* only use with encode; decode optimizations are
                 allowed to break this */
    return book->codelist[entry];
  return -1;
459 460 461
}

long vorbis_book_codelen(codebook *book,int entry){
Monty's avatar
Monty committed
462 463 464 465
  if(book->c) /* only use with encode; decode optimizations are
                 allowed to break this */
    return book->c->lengthlist[entry];
  return -1;
466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495
}

#ifdef _V_SELFTEST

/* Unit tests of the dequantizer; this stuff will be OK
   cross-platform, I simply want to be sure that special mapping cases
   actually work properly; a bug could go unnoticed for a while */

#include <stdio.h>

/* cases:

   no mapping
   full, explicit mapping
   algorithmic mapping

   nonsequential
   sequential
*/

static long full_quantlist1[]={0,1,2,3,    4,5,6,7, 8,3,6,1};
static long partial_quantlist1[]={0,7,2};

/* no mapping */
static_codebook test1={
  4,16,
  NULL,
  0,
  0,0,0,0,
  NULL,
496
  0
497
};
498
static float *test1_result=NULL;
Monty's avatar
Monty committed
499

500 501 502 503 504 505 506
/* linear, full mapping, nonsequential */
static_codebook test2={
  4,3,
  NULL,
  2,
  -533200896,1611661312,4,0,
  full_quantlist1,
507
  0
508
};
509
static float test2_result[]={-3,-2,-1,0, 1,2,3,4, 5,0,3,-2};
510 511 512 513 514 515 516 517

/* linear, full mapping, sequential */
static_codebook test3={
  4,3,
  NULL,
  2,
  -533200896,1611661312,4,1,
  full_quantlist1,
518
  0
519
};
520
static float test3_result[]={-3,-5,-6,-6, 1,3,6,10, 5,5,8,6};
521 522 523 524 525 526 527 528

/* linear, algorithmic mapping, nonsequential */
static_codebook test4={
  3,27,
  NULL,
  1,
  -533200896,1611661312,4,0,
  partial_quantlist1,
529
  0
530
};
531
static float test4_result[]={-3,-3,-3, 4,-3,-3, -1,-3,-3,
532
                              -3, 4,-3, 4, 4,-3, -1, 4,-3,
Monty's avatar
Monty committed
533
                              -3,-1,-3, 4,-1,-3, -1,-1,-3,
534 535 536 537 538 539
                              -3,-3, 4, 4,-3, 4, -1,-3, 4,
                              -3, 4, 4, 4, 4, 4, -1, 4, 4,
                              -3,-1, 4, 4,-1, 4, -1,-1, 4,
                              -3,-3,-1, 4,-3,-1, -1,-3,-1,
                              -3, 4,-1, 4, 4,-1, -1, 4,-1,
                              -3,-1,-1, 4,-1,-1, -1,-1,-1};
540 541 542 543 544 545 546 547

/* linear, algorithmic mapping, sequential */
static_codebook test5={
  3,27,
  NULL,
  1,
  -533200896,1611661312,4,1,
  partial_quantlist1,
548
  0
549
};
550
static float test5_result[]={-3,-6,-9, 4, 1,-2, -1,-4,-7,
551
                              -3, 1,-2, 4, 8, 5, -1, 3, 0,
Monty's avatar
Monty committed
552
                              -3,-4,-7, 4, 3, 0, -1,-2,-5,
553 554 555 556 557 558
                              -3,-6,-2, 4, 1, 5, -1,-4, 0,
                              -3, 1, 5, 4, 8,12, -1, 3, 7,
                              -3,-4, 0, 4, 3, 7, -1,-2, 2,
                              -3,-6,-7, 4, 1, 0, -1,-4,-5,
                              -3, 1, 0, 4, 8, 7, -1, 3, 2,
                              -3,-4,-5, 4, 3, 2, -1,-2,-3};
559

560
void run_test(static_codebook *b,float *comp){
Monty's avatar
Monty committed
561
  float *out=_book_unquantize(b,b->entries,NULL);
562 563 564 565 566 567 568 569 570 571
  int i;

  if(comp){
    if(!out){
      fprintf(stderr,"_book_unquantize incorrectly returned NULL\n");
      exit(1);
    }

    for(i=0;i<b->entries*b->dim;i++)
      if(fabs(out[i]-comp[i])>.0001){
572 573 574
        fprintf(stderr,"disagreement in unquantized and reference data:\n"
                "position %d, %g != %g\n",i,out[i],comp[i]);
        exit(1);
575 576 577 578 579
      }

  }else{
    if(out){
      fprintf(stderr,"_book_unquantize returned a value array: \n"
580
              " correct result should have been NULL\n");
581 582 583
      exit(1);
    }
  }
584
  free(out);
585 586 587 588 589 590 591 592 593 594 595 596 597 598 599
}

int main(){
  /* run the nine dequant tests, and compare to the hand-rolled results */
  fprintf(stderr,"Dequant test 1... ");
  run_test(&test1,test1_result);
  fprintf(stderr,"OK\nDequant test 2... ");
  run_test(&test2,test2_result);
  fprintf(stderr,"OK\nDequant test 3... ");
  run_test(&test3,test3_result);
  fprintf(stderr,"OK\nDequant test 4... ");
  run_test(&test4,test4_result);
  fprintf(stderr,"OK\nDequant test 5... ");
  run_test(&test5,test5_result);
  fprintf(stderr,"OK\n\n");
Monty's avatar
Monty committed
600

601 602 603 604
  return(0);
}

#endif