nuclear@0: /******************************************************************** nuclear@0: * * nuclear@0: * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * nuclear@0: * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * nuclear@0: * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * nuclear@0: * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * nuclear@0: * * nuclear@0: * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * nuclear@0: * by the Xiph.Org Foundation http://www.xiph.org/ * nuclear@0: * * nuclear@0: ******************************************************************** nuclear@0: nuclear@0: function: basic shared codebook operations nuclear@0: last mod: $Id: sharedbook.c 17030 2010-03-25 06:52:55Z xiphmont $ nuclear@0: nuclear@0: ********************************************************************/ nuclear@0: nuclear@0: #include nuclear@0: #include nuclear@0: #include nuclear@0: #include nuclear@0: #include "os.h" nuclear@0: #include "misc.h" nuclear@0: #include "vorbis/codec.h" nuclear@0: #include "codebook.h" nuclear@0: #include "scales.h" nuclear@0: nuclear@0: /**** pack/unpack helpers ******************************************/ nuclear@0: int _ilog(unsigned int v){ nuclear@0: int ret=0; nuclear@0: while(v){ nuclear@0: ret++; nuclear@0: v>>=1; nuclear@0: } nuclear@0: return(ret); nuclear@0: } nuclear@0: nuclear@0: /* 32 bit float (not IEEE; nonnormalized mantissa + nuclear@0: biased exponent) : neeeeeee eeemmmmm mmmmmmmm mmmmmmmm nuclear@0: Why not IEEE? It's just not that important here. */ nuclear@0: nuclear@0: #define VQ_FEXP 10 nuclear@0: #define VQ_FMAN 21 nuclear@0: #define VQ_FEXP_BIAS 768 /* bias toward values smaller than 1. */ nuclear@0: nuclear@0: /* doesn't currently guard under/overflow */ nuclear@0: long _float32_pack(float val){ nuclear@0: int sign=0; nuclear@0: long exp; nuclear@0: long mant; nuclear@0: if(val<0){ nuclear@0: sign=0x80000000; nuclear@0: val= -val; nuclear@0: } nuclear@0: exp= floor(log(val)/log(2.f)+.001); /*+epsilon*/ nuclear@0: mant=rint(ldexp(val,(VQ_FMAN-1)-exp)); nuclear@0: exp=(exp+VQ_FEXP_BIAS)<>VQ_FMAN; nuclear@0: if(sign)mant= -mant; nuclear@0: return(ldexp(mant,exp-(VQ_FMAN-1)-VQ_FEXP_BIAS)); nuclear@0: } nuclear@0: nuclear@0: /* given a list of word lengths, generate a list of codewords. Works nuclear@0: for length ordered or unordered, always assigns the lowest valued nuclear@0: codewords first. Extended to handle unused entries (length 0) */ nuclear@0: ogg_uint32_t *_make_words(long *l,long n,long sparsecount){ nuclear@0: long i,j,count=0; nuclear@0: ogg_uint32_t marker[33]; nuclear@0: ogg_uint32_t *r=_ogg_malloc((sparsecount?sparsecount:n)*sizeof(*r)); nuclear@0: memset(marker,0,sizeof(marker)); nuclear@0: nuclear@0: for(i=0;i0){ nuclear@0: ogg_uint32_t entry=marker[length]; nuclear@0: nuclear@0: /* when we claim a node for an entry, we also claim the nodes nuclear@0: below it (pruning off the imagined tree that may have dangled nuclear@0: from it) as well as blocking the use of any nodes directly nuclear@0: above for leaves */ nuclear@0: nuclear@0: /* update ourself */ nuclear@0: if(length<32 && (entry>>length)){ nuclear@0: /* error condition; the lengths must specify an overpopulated tree */ nuclear@0: _ogg_free(r); nuclear@0: return(NULL); nuclear@0: } nuclear@0: r[count++]=entry; nuclear@0: nuclear@0: /* Look to see if the next shorter marker points to the node nuclear@0: above. if so, update it and repeat. */ nuclear@0: { nuclear@0: for(j=length;j>0;j--){ nuclear@0: nuclear@0: if(marker[j]&1){ nuclear@0: /* have to jump branches */ nuclear@0: if(j==1) nuclear@0: marker[1]++; nuclear@0: else nuclear@0: marker[j]=marker[j-1]<<1; nuclear@0: break; /* invariant says next upper marker would already nuclear@0: have been moved if it was on the same path */ nuclear@0: } nuclear@0: marker[j]++; nuclear@0: } nuclear@0: } nuclear@0: nuclear@0: /* prune the tree; the implicit invariant says all the longer nuclear@0: markers were dangling from our just-taken node. Dangle them nuclear@0: from our *new* node. */ nuclear@0: for(j=length+1;j<33;j++) nuclear@0: if((marker[j]>>1) == entry){ nuclear@0: entry=marker[j]; nuclear@0: marker[j]=marker[j-1]<<1; nuclear@0: }else nuclear@0: break; nuclear@0: }else nuclear@0: if(sparsecount==0)count++; nuclear@0: } nuclear@0: nuclear@0: /* sanity check the huffman tree; an underpopulated tree must be nuclear@0: rejected. The only exception is the one-node pseudo-nil tree, nuclear@0: which appears to be underpopulated because the tree doesn't nuclear@0: really exist; there's only one possible 'codeword' or zero bits, nuclear@0: but the above tree-gen code doesn't mark that. */ nuclear@0: if(sparsecount != 1){ nuclear@0: for(i=1;i<33;i++) nuclear@0: if(marker[i] & (0xffffffffUL>>(32-i))){ nuclear@0: _ogg_free(r); nuclear@0: return(NULL); nuclear@0: } nuclear@0: } nuclear@0: nuclear@0: /* bitreverse the words because our bitwise packer/unpacker is LSb nuclear@0: endian */ nuclear@0: for(i=0,count=0;i>j)&1; nuclear@0: } nuclear@0: nuclear@0: if(sparsecount){ nuclear@0: if(l[i]) nuclear@0: r[count++]=temp; nuclear@0: }else nuclear@0: r[count++]=temp; nuclear@0: } nuclear@0: nuclear@0: return(r); nuclear@0: } nuclear@0: nuclear@0: /* there might be a straightforward one-line way to do the below nuclear@0: that's portable and totally safe against roundoff, but I haven't nuclear@0: thought of it. Therefore, we opt on the side of caution */ nuclear@0: long _book_maptype1_quantvals(const static_codebook *b){ nuclear@0: long vals=floor(pow((float)b->entries,1.f/b->dim)); nuclear@0: nuclear@0: /* the above *should* be reliable, but we'll not assume that FP is nuclear@0: ever reliable when bitstream sync is at stake; verify via integer nuclear@0: means that vals really is the greatest value of dim for which nuclear@0: vals^b->bim <= b->entries */ nuclear@0: /* treat the above as an initial guess */ nuclear@0: while(1){ nuclear@0: long acc=1; nuclear@0: long acc1=1; nuclear@0: int i; nuclear@0: for(i=0;idim;i++){ nuclear@0: acc*=vals; nuclear@0: acc1*=vals+1; nuclear@0: } nuclear@0: if(acc<=b->entries && acc1>b->entries){ nuclear@0: return(vals); nuclear@0: }else{ nuclear@0: if(acc>b->entries){ nuclear@0: vals--; nuclear@0: }else{ nuclear@0: vals++; nuclear@0: } nuclear@0: } nuclear@0: } nuclear@0: } nuclear@0: nuclear@0: /* unpack the quantized list of values for encode/decode ***********/ nuclear@0: /* we need to deal with two map types: in map type 1, the values are nuclear@0: generated algorithmically (each column of the vector counts through nuclear@0: the values in the quant vector). in map type 2, all the values came nuclear@0: in in an explicit list. Both value lists must be unpacked */ nuclear@0: float *_book_unquantize(const static_codebook *b,int n,int *sparsemap){ nuclear@0: long j,k,count=0; nuclear@0: if(b->maptype==1 || b->maptype==2){ nuclear@0: int quantvals; nuclear@0: float mindel=_float32_unpack(b->q_min); nuclear@0: float delta=_float32_unpack(b->q_delta); nuclear@0: float *r=_ogg_calloc(n*b->dim,sizeof(*r)); nuclear@0: nuclear@0: /* maptype 1 and 2 both use a quantized value vector, but nuclear@0: different sizes */ nuclear@0: switch(b->maptype){ nuclear@0: case 1: nuclear@0: /* most of the time, entries%dimensions == 0, but we need to be nuclear@0: well defined. We define that the possible vales at each nuclear@0: scalar is values == entries/dim. If entries%dim != 0, we'll nuclear@0: have 'too few' values (values*dimentries;j++){ nuclear@0: if((sparsemap && b->lengthlist[j]) || !sparsemap){ nuclear@0: float last=0.f; nuclear@0: int indexdiv=1; nuclear@0: for(k=0;kdim;k++){ nuclear@0: int index= (j/indexdiv)%quantvals; nuclear@0: float val=b->quantlist[index]; nuclear@0: val=fabs(val)*delta+mindel+last; nuclear@0: if(b->q_sequencep)last=val; nuclear@0: if(sparsemap) nuclear@0: r[sparsemap[count]*b->dim+k]=val; nuclear@0: else nuclear@0: r[count*b->dim+k]=val; nuclear@0: indexdiv*=quantvals; nuclear@0: } nuclear@0: count++; nuclear@0: } nuclear@0: nuclear@0: } nuclear@0: break; nuclear@0: case 2: nuclear@0: for(j=0;jentries;j++){ nuclear@0: if((sparsemap && b->lengthlist[j]) || !sparsemap){ nuclear@0: float last=0.f; nuclear@0: nuclear@0: for(k=0;kdim;k++){ nuclear@0: float val=b->quantlist[j*b->dim+k]; nuclear@0: val=fabs(val)*delta+mindel+last; nuclear@0: if(b->q_sequencep)last=val; nuclear@0: if(sparsemap) nuclear@0: r[sparsemap[count]*b->dim+k]=val; nuclear@0: else nuclear@0: r[count*b->dim+k]=val; nuclear@0: } nuclear@0: count++; nuclear@0: } nuclear@0: } nuclear@0: break; nuclear@0: } nuclear@0: nuclear@0: return(r); nuclear@0: } nuclear@0: return(NULL); nuclear@0: } nuclear@0: nuclear@0: void vorbis_staticbook_destroy(static_codebook *b){ nuclear@0: if(b->allocedp){ nuclear@0: if(b->quantlist)_ogg_free(b->quantlist); nuclear@0: if(b->lengthlist)_ogg_free(b->lengthlist); nuclear@0: memset(b,0,sizeof(*b)); nuclear@0: _ogg_free(b); nuclear@0: } /* otherwise, it is in static memory */ nuclear@0: } nuclear@0: nuclear@0: void vorbis_book_clear(codebook *b){ nuclear@0: /* static book is not cleared; we're likely called on the lookup and nuclear@0: the static codebook belongs to the info struct */ nuclear@0: if(b->valuelist)_ogg_free(b->valuelist); nuclear@0: if(b->codelist)_ogg_free(b->codelist); nuclear@0: nuclear@0: if(b->dec_index)_ogg_free(b->dec_index); nuclear@0: if(b->dec_codelengths)_ogg_free(b->dec_codelengths); nuclear@0: if(b->dec_firsttable)_ogg_free(b->dec_firsttable); nuclear@0: nuclear@0: memset(b,0,sizeof(*b)); nuclear@0: } nuclear@0: nuclear@0: int vorbis_book_init_encode(codebook *c,const static_codebook *s){ nuclear@0: nuclear@0: memset(c,0,sizeof(*c)); nuclear@0: c->c=s; nuclear@0: c->entries=s->entries; nuclear@0: c->used_entries=s->entries; nuclear@0: c->dim=s->dim; nuclear@0: c->codelist=_make_words(s->lengthlist,s->entries,0); nuclear@0: /*c->valuelist=_book_unquantize(s,s->entries,NULL);*/ nuclear@0: c->quantvals=_book_maptype1_quantvals(s); nuclear@0: c->minval=(int)rint(_float32_unpack(s->q_min)); nuclear@0: c->delta=(int)rint(_float32_unpack(s->q_delta)); nuclear@0: nuclear@0: return(0); nuclear@0: } nuclear@0: nuclear@0: static ogg_uint32_t bitreverse(ogg_uint32_t x){ nuclear@0: x= ((x>>16)&0x0000ffffUL) | ((x<<16)&0xffff0000UL); nuclear@0: x= ((x>> 8)&0x00ff00ffUL) | ((x<< 8)&0xff00ff00UL); nuclear@0: x= ((x>> 4)&0x0f0f0f0fUL) | ((x<< 4)&0xf0f0f0f0UL); nuclear@0: x= ((x>> 2)&0x33333333UL) | ((x<< 2)&0xccccccccUL); nuclear@0: return((x>> 1)&0x55555555UL) | ((x<< 1)&0xaaaaaaaaUL); nuclear@0: } nuclear@0: nuclear@0: static int sort32a(const void *a,const void *b){ nuclear@0: return ( **(ogg_uint32_t **)a>**(ogg_uint32_t **)b)- nuclear@0: ( **(ogg_uint32_t **)a<**(ogg_uint32_t **)b); nuclear@0: } nuclear@0: nuclear@0: /* decode codebook arrangement is more heavily optimized than encode */ nuclear@0: int vorbis_book_init_decode(codebook *c,const static_codebook *s){ nuclear@0: int i,j,n=0,tabn; nuclear@0: int *sortindex; nuclear@0: memset(c,0,sizeof(*c)); nuclear@0: nuclear@0: /* count actually used entries */ nuclear@0: for(i=0;ientries;i++) nuclear@0: if(s->lengthlist[i]>0) nuclear@0: n++; nuclear@0: nuclear@0: c->entries=s->entries; nuclear@0: c->used_entries=n; nuclear@0: c->dim=s->dim; nuclear@0: nuclear@0: if(n>0){ nuclear@0: nuclear@0: /* two different remappings go on here. nuclear@0: nuclear@0: First, we collapse the likely sparse codebook down only to nuclear@0: actually represented values/words. This collapsing needs to be nuclear@0: indexed as map-valueless books are used to encode original entry nuclear@0: positions as integers. nuclear@0: nuclear@0: Second, we reorder all vectors, including the entry index above, nuclear@0: by sorted bitreversed codeword to allow treeless decode. */ nuclear@0: nuclear@0: /* perform sort */ nuclear@0: ogg_uint32_t *codes=_make_words(s->lengthlist,s->entries,c->used_entries); nuclear@0: ogg_uint32_t **codep=alloca(sizeof(*codep)*n); nuclear@0: nuclear@0: if(codes==NULL)goto err_out; nuclear@0: nuclear@0: for(i=0;icodelist=_ogg_malloc(n*sizeof(*c->codelist)); nuclear@0: /* the index is a reverse index */ nuclear@0: for(i=0;icodelist[sortindex[i]]=codes[i]; nuclear@0: _ogg_free(codes); nuclear@0: nuclear@0: nuclear@0: c->valuelist=_book_unquantize(s,n,sortindex); nuclear@0: c->dec_index=_ogg_malloc(n*sizeof(*c->dec_index)); nuclear@0: nuclear@0: for(n=0,i=0;ientries;i++) nuclear@0: if(s->lengthlist[i]>0) nuclear@0: c->dec_index[sortindex[n++]]=i; nuclear@0: nuclear@0: c->dec_codelengths=_ogg_malloc(n*sizeof(*c->dec_codelengths)); nuclear@0: for(n=0,i=0;ientries;i++) nuclear@0: if(s->lengthlist[i]>0) nuclear@0: c->dec_codelengths[sortindex[n++]]=s->lengthlist[i]; nuclear@0: nuclear@0: c->dec_firsttablen=_ilog(c->used_entries)-4; /* this is magic */ nuclear@0: if(c->dec_firsttablen<5)c->dec_firsttablen=5; nuclear@0: if(c->dec_firsttablen>8)c->dec_firsttablen=8; nuclear@0: nuclear@0: tabn=1<dec_firsttablen; nuclear@0: c->dec_firsttable=_ogg_calloc(tabn,sizeof(*c->dec_firsttable)); nuclear@0: c->dec_maxlength=0; nuclear@0: nuclear@0: for(i=0;idec_maxlengthdec_codelengths[i]) nuclear@0: c->dec_maxlength=c->dec_codelengths[i]; nuclear@0: if(c->dec_codelengths[i]<=c->dec_firsttablen){ nuclear@0: ogg_uint32_t orig=bitreverse(c->codelist[i]); nuclear@0: for(j=0;j<(1<<(c->dec_firsttablen-c->dec_codelengths[i]));j++) nuclear@0: c->dec_firsttable[orig|(j<dec_codelengths[i])]=i+1; nuclear@0: } nuclear@0: } nuclear@0: nuclear@0: /* now fill in 'unused' entries in the firsttable with hi/lo search nuclear@0: hints for the non-direct-hits */ nuclear@0: { nuclear@0: ogg_uint32_t mask=0xfffffffeUL<<(31-c->dec_firsttablen); nuclear@0: long lo=0,hi=0; nuclear@0: nuclear@0: for(i=0;idec_firsttablen); nuclear@0: if(c->dec_firsttable[bitreverse(word)]==0){ nuclear@0: while((lo+1)codelist[lo+1]<=word)lo++; nuclear@0: while( hi=(c->codelist[hi]&mask))hi++; nuclear@0: nuclear@0: /* we only actually have 15 bits per hint to play with here. nuclear@0: In order to overflow gracefully (nothing breaks, efficiency nuclear@0: just drops), encode as the difference from the extremes. */ nuclear@0: { nuclear@0: unsigned long loval=lo; nuclear@0: unsigned long hival=n-hi; nuclear@0: nuclear@0: if(loval>0x7fff)loval=0x7fff; nuclear@0: if(hival>0x7fff)hival=0x7fff; nuclear@0: c->dec_firsttable[bitreverse(word)]= nuclear@0: 0x80000000UL | (loval<<15) | hival; nuclear@0: } nuclear@0: } nuclear@0: } nuclear@0: } nuclear@0: } nuclear@0: nuclear@0: return(0); nuclear@0: err_out: nuclear@0: vorbis_book_clear(c); nuclear@0: return(-1); nuclear@0: } nuclear@0: nuclear@0: long vorbis_book_codeword(codebook *book,int entry){ nuclear@0: if(book->c) /* only use with encode; decode optimizations are nuclear@0: allowed to break this */ nuclear@0: return book->codelist[entry]; nuclear@0: return -1; nuclear@0: } nuclear@0: nuclear@0: long vorbis_book_codelen(codebook *book,int entry){ nuclear@0: if(book->c) /* only use with encode; decode optimizations are nuclear@0: allowed to break this */ nuclear@0: return book->c->lengthlist[entry]; nuclear@0: return -1; nuclear@0: } nuclear@0: nuclear@0: #ifdef _V_SELFTEST nuclear@0: nuclear@0: /* Unit tests of the dequantizer; this stuff will be OK nuclear@0: cross-platform, I simply want to be sure that special mapping cases nuclear@0: actually work properly; a bug could go unnoticed for a while */ nuclear@0: nuclear@0: #include nuclear@0: nuclear@0: /* cases: nuclear@0: nuclear@0: no mapping nuclear@0: full, explicit mapping nuclear@0: algorithmic mapping nuclear@0: nuclear@0: nonsequential nuclear@0: sequential nuclear@0: */ nuclear@0: nuclear@0: static long full_quantlist1[]={0,1,2,3, 4,5,6,7, 8,3,6,1}; nuclear@0: static long partial_quantlist1[]={0,7,2}; nuclear@0: nuclear@0: /* no mapping */ nuclear@0: static_codebook test1={ nuclear@0: 4,16, nuclear@0: NULL, nuclear@0: 0, nuclear@0: 0,0,0,0, nuclear@0: NULL, nuclear@0: 0 nuclear@0: }; nuclear@0: static float *test1_result=NULL; nuclear@0: nuclear@0: /* linear, full mapping, nonsequential */ nuclear@0: static_codebook test2={ nuclear@0: 4,3, nuclear@0: NULL, nuclear@0: 2, nuclear@0: -533200896,1611661312,4,0, nuclear@0: full_quantlist1, nuclear@0: 0 nuclear@0: }; nuclear@0: static float test2_result[]={-3,-2,-1,0, 1,2,3,4, 5,0,3,-2}; nuclear@0: nuclear@0: /* linear, full mapping, sequential */ nuclear@0: static_codebook test3={ nuclear@0: 4,3, nuclear@0: NULL, nuclear@0: 2, nuclear@0: -533200896,1611661312,4,1, nuclear@0: full_quantlist1, nuclear@0: 0 nuclear@0: }; nuclear@0: static float test3_result[]={-3,-5,-6,-6, 1,3,6,10, 5,5,8,6}; nuclear@0: nuclear@0: /* linear, algorithmic mapping, nonsequential */ nuclear@0: static_codebook test4={ nuclear@0: 3,27, nuclear@0: NULL, nuclear@0: 1, nuclear@0: -533200896,1611661312,4,0, nuclear@0: partial_quantlist1, nuclear@0: 0 nuclear@0: }; nuclear@0: static float test4_result[]={-3,-3,-3, 4,-3,-3, -1,-3,-3, nuclear@0: -3, 4,-3, 4, 4,-3, -1, 4,-3, nuclear@0: -3,-1,-3, 4,-1,-3, -1,-1,-3, nuclear@0: -3,-3, 4, 4,-3, 4, -1,-3, 4, nuclear@0: -3, 4, 4, 4, 4, 4, -1, 4, 4, nuclear@0: -3,-1, 4, 4,-1, 4, -1,-1, 4, nuclear@0: -3,-3,-1, 4,-3,-1, -1,-3,-1, nuclear@0: -3, 4,-1, 4, 4,-1, -1, 4,-1, nuclear@0: -3,-1,-1, 4,-1,-1, -1,-1,-1}; nuclear@0: nuclear@0: /* linear, algorithmic mapping, sequential */ nuclear@0: static_codebook test5={ nuclear@0: 3,27, nuclear@0: NULL, nuclear@0: 1, nuclear@0: -533200896,1611661312,4,1, nuclear@0: partial_quantlist1, nuclear@0: 0 nuclear@0: }; nuclear@0: static float test5_result[]={-3,-6,-9, 4, 1,-2, -1,-4,-7, nuclear@0: -3, 1,-2, 4, 8, 5, -1, 3, 0, nuclear@0: -3,-4,-7, 4, 3, 0, -1,-2,-5, nuclear@0: -3,-6,-2, 4, 1, 5, -1,-4, 0, nuclear@0: -3, 1, 5, 4, 8,12, -1, 3, 7, nuclear@0: -3,-4, 0, 4, 3, 7, -1,-2, 2, nuclear@0: -3,-6,-7, 4, 1, 0, -1,-4,-5, nuclear@0: -3, 1, 0, 4, 8, 7, -1, 3, 2, nuclear@0: -3,-4,-5, 4, 3, 2, -1,-2,-3}; nuclear@0: nuclear@0: void run_test(static_codebook *b,float *comp){ nuclear@0: float *out=_book_unquantize(b,b->entries,NULL); nuclear@0: int i; nuclear@0: nuclear@0: if(comp){ nuclear@0: if(!out){ nuclear@0: fprintf(stderr,"_book_unquantize incorrectly returned NULL\n"); nuclear@0: exit(1); nuclear@0: } nuclear@0: nuclear@0: for(i=0;ientries*b->dim;i++) nuclear@0: if(fabs(out[i]-comp[i])>.0001){ nuclear@0: fprintf(stderr,"disagreement in unquantized and reference data:\n" nuclear@0: "position %d, %g != %g\n",i,out[i],comp[i]); nuclear@0: exit(1); nuclear@0: } nuclear@0: nuclear@0: }else{ nuclear@0: if(out){ nuclear@0: fprintf(stderr,"_book_unquantize returned a value array: \n" nuclear@0: " correct result should have been NULL\n"); nuclear@0: exit(1); nuclear@0: } nuclear@0: } nuclear@0: } nuclear@0: nuclear@0: int main(){ nuclear@0: /* run the nine dequant tests, and compare to the hand-rolled results */ nuclear@0: fprintf(stderr,"Dequant test 1... "); nuclear@0: run_test(&test1,test1_result); nuclear@0: fprintf(stderr,"OK\nDequant test 2... "); nuclear@0: run_test(&test2,test2_result); nuclear@0: fprintf(stderr,"OK\nDequant test 3... "); nuclear@0: run_test(&test3,test3_result); nuclear@0: fprintf(stderr,"OK\nDequant test 4... "); nuclear@0: run_test(&test4,test4_result); nuclear@0: fprintf(stderr,"OK\nDequant test 5... "); nuclear@0: run_test(&test5,test5_result); nuclear@0: fprintf(stderr,"OK\n\n"); nuclear@0: nuclear@0: return(0); nuclear@0: } nuclear@0: nuclear@0: #endif