sharedbook.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656
  1. /********************************************************************
  2. * *
  3. * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
  4. * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
  5. * THE GNU LESSER/LIBRARY PUBLIC LICENSE, WHICH IS INCLUDED WITH *
  6. * THIS SOURCE. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
  7. * *
  8. * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2000 *
  9. * by Monty <monty@xiph.org> and the XIPHOPHORUS Company *
  10. * http://www.xiph.org/ *
  11. * *
  12. ********************************************************************
  13. function: basic shared codebook operations
  14. last mod: $Id: sharedbook.c,v 1.9.2.3 2000/11/04 06:43:50 xiphmont Exp $
  15. ********************************************************************/
  16. #include <stdlib.h>
  17. #include <math.h>
  18. #include <string.h>
  19. #include <ogg/ogg.h>
  20. #include "os.h"
  21. #include "vorbis/codec.h"
  22. #include "codebook.h"
  23. #include "scales.h"
  24. /**** pack/unpack helpers ******************************************/
  25. int _ilog(unsigned int v){
  26. int ret=0;
  27. while(v){
  28. ret++;
  29. v>>=1;
  30. }
  31. return(ret);
  32. }
  33. /* 32 bit float (not IEEE; nonnormalized mantissa +
  34. biased exponent) : neeeeeee eeemmmmm mmmmmmmm mmmmmmmm
  35. Why not IEEE? It's just not that important here. */
  36. #define VQ_FEXP 10
  37. #define VQ_FMAN 21
  38. #define VQ_FEXP_BIAS 768 /* bias toward values smaller than 1. */
  39. /* doesn't currently guard under/overflow */
  40. long _float32_pack(float val){
  41. int sign=0;
  42. long exp;
  43. long mant;
  44. if(val<0){
  45. sign=0x80000000;
  46. val= -val;
  47. }
  48. exp= floor(log(val)/log(2));
  49. mant=rint(ldexp(val,(VQ_FMAN-1)-exp));
  50. exp=(exp+VQ_FEXP_BIAS)<<VQ_FMAN;
  51. return(sign|exp|mant);
  52. }
  53. float _float32_unpack(long val){
  54. float mant=val&0x1fffff;
  55. float sign=val&0x80000000;
  56. float exp =(val&0x7fe00000)>>VQ_FMAN;
  57. if(sign)mant= -mant;
  58. return(ldexp(mant,exp-(VQ_FMAN-1)-VQ_FEXP_BIAS));
  59. }
  60. /* given a list of word lengths, generate a list of codewords. Works
  61. for length ordered or unordered, always assigns the lowest valued
  62. codewords first. Extended to handle unused entries (length 0) */
  63. long *_make_words(long *l,long n){
  64. long i,j;
  65. long marker[33];
  66. long *r=_ogg_malloc(n*sizeof(long));
  67. memset(marker,0,sizeof(marker));
  68. for(i=0;i<n;i++){
  69. long length=l[i];
  70. if(length>0){
  71. long entry=marker[length];
  72. /* when we claim a node for an entry, we also claim the nodes
  73. below it (pruning off the imagined tree that may have dangled
  74. from it) as well as blocking the use of any nodes directly
  75. above for leaves */
  76. /* update ourself */
  77. if(length<32 && (entry>>length)){
  78. /* error condition; the lengths must specify an overpopulated tree */
  79. free(r);
  80. return(NULL);
  81. }
  82. r[i]=entry;
  83. /* Look to see if the next shorter marker points to the node
  84. above. if so, update it and repeat. */
  85. {
  86. for(j=length;j>0;j--){
  87. if(marker[j]&1){
  88. /* have to jump branches */
  89. if(j==1)
  90. marker[1]++;
  91. else
  92. marker[j]=marker[j-1]<<1;
  93. break; /* invariant says next upper marker would already
  94. have been moved if it was on the same path */
  95. }
  96. marker[j]++;
  97. }
  98. }
  99. /* prune the tree; the implicit invariant says all the longer
  100. markers were dangling from our just-taken node. Dangle them
  101. from our *new* node. */
  102. for(j=length+1;j<33;j++)
  103. if((marker[j]>>1) == entry){
  104. entry=marker[j];
  105. marker[j]=marker[j-1]<<1;
  106. }else
  107. break;
  108. }
  109. }
  110. /* bitreverse the words because our bitwise packer/unpacker is LSb
  111. endian */
  112. for(i=0;i<n;i++){
  113. long temp=0;
  114. for(j=0;j<l[i];j++){
  115. temp<<=1;
  116. temp|=(r[i]>>j)&1;
  117. }
  118. r[i]=temp;
  119. }
  120. return(r);
  121. }
  122. /* build the decode helper tree from the codewords */
  123. decode_aux *_make_decode_tree(codebook *c){
  124. const static_codebook *s=c->c;
  125. long top=0,i,j,n;
  126. decode_aux *t=_ogg_malloc(sizeof(decode_aux));
  127. long *ptr0=t->ptr0=_ogg_calloc(c->entries*2,sizeof(long));
  128. long *ptr1=t->ptr1=_ogg_calloc(c->entries*2,sizeof(long));
  129. long *codelist=_make_words(s->lengthlist,s->entries);
  130. if(codelist==NULL)return(NULL);
  131. t->aux=c->entries*2;
  132. for(i=0;i<c->entries;i++){
  133. if(s->lengthlist[i]>0){
  134. long ptr=0;
  135. for(j=0;j<s->lengthlist[i]-1;j++){
  136. int bit=(codelist[i]>>j)&1;
  137. if(!bit){
  138. if(!ptr0[ptr])
  139. ptr0[ptr]= ++top;
  140. ptr=ptr0[ptr];
  141. }else{
  142. if(!ptr1[ptr])
  143. ptr1[ptr]= ++top;
  144. ptr=ptr1[ptr];
  145. }
  146. }
  147. if(!((codelist[i]>>j)&1))
  148. ptr0[ptr]=-i;
  149. else
  150. ptr1[ptr]=-i;
  151. }
  152. }
  153. free(codelist);
  154. t->tabn = _ilog(c->entries)-4; /* this is magic */
  155. if(t->tabn<5)t->tabn=5;
  156. n = 1<<t->tabn;
  157. t->tab = _ogg_malloc(n*sizeof(long));
  158. t->tabl = _ogg_malloc(n*sizeof(int));
  159. for (i = 0; i < n; i++) {
  160. long p = 0;
  161. for (j = 0; j < t->tabn && (p > 0 || j == 0); j++) {
  162. if (i & (1 << j))
  163. p = ptr1[p];
  164. else
  165. p = ptr0[p];
  166. }
  167. /* now j == length, and p == -code */
  168. t->tab[i] = p;
  169. t->tabl[i] = j;
  170. }
  171. return(t);
  172. }
  173. /* there might be a straightforward one-line way to do the below
  174. that's portable and totally safe against roundoff, but I haven't
  175. thought of it. Therefore, we opt on the side of caution */
  176. long _book_maptype1_quantvals(const static_codebook *b){
  177. long vals=floor(pow(b->entries,1./b->dim));
  178. /* the above *should* be reliable, but we'll not assume that FP is
  179. ever reliable when bitstream sync is at stake; verify via integer
  180. means that vals really is the greatest value of dim for which
  181. vals^b->bim <= b->entries */
  182. /* treat the above as an initial guess */
  183. while(1){
  184. long acc=1;
  185. long acc1=1;
  186. int i;
  187. for(i=0;i<b->dim;i++){
  188. acc*=vals;
  189. acc1*=vals+1;
  190. }
  191. if(acc<=b->entries && acc1>b->entries){
  192. return(vals);
  193. }else{
  194. if(acc>b->entries){
  195. vals--;
  196. }else{
  197. vals++;
  198. }
  199. }
  200. }
  201. }
  202. /* unpack the quantized list of values for encode/decode ***********/
  203. /* we need to deal with two map types: in map type 1, the values are
  204. generated algorithmically (each column of the vector counts through
  205. the values in the quant vector). in map type 2, all the values came
  206. in in an explicit list. Both value lists must be unpacked */
  207. float *_book_unquantize(const static_codebook *b){
  208. long j,k;
  209. if(b->maptype==1 || b->maptype==2){
  210. int quantvals;
  211. float mindel=_float32_unpack(b->q_min);
  212. float delta=_float32_unpack(b->q_delta);
  213. float *r=_ogg_calloc(b->entries*b->dim,sizeof(float));
  214. /* maptype 1 and 2 both use a quantized value vector, but
  215. different sizes */
  216. switch(b->maptype){
  217. case 1:
  218. /* most of the time, entries%dimensions == 0, but we need to be
  219. well defined. We define that the possible vales at each
  220. scalar is values == entries/dim. If entries%dim != 0, we'll
  221. have 'too few' values (values*dim<entries), which means that
  222. we'll have 'left over' entries; left over entries use zeroed
  223. values (and are wasted). So don't generate codebooks like
  224. that */
  225. quantvals=_book_maptype1_quantvals(b);
  226. for(j=0;j<b->entries;j++){
  227. float last=0.;
  228. int indexdiv=1;
  229. for(k=0;k<b->dim;k++){
  230. int index= (j/indexdiv)%quantvals;
  231. float val=b->quantlist[index];
  232. val=fabs(val)*delta+mindel+last;
  233. if(b->q_sequencep)last=val;
  234. r[j*b->dim+k]=val;
  235. indexdiv*=quantvals;
  236. }
  237. }
  238. break;
  239. case 2:
  240. for(j=0;j<b->entries;j++){
  241. float last=0.;
  242. for(k=0;k<b->dim;k++){
  243. float val=b->quantlist[j*b->dim+k];
  244. val=fabs(val)*delta+mindel+last;
  245. if(b->q_sequencep)last=val;
  246. r[j*b->dim+k]=val;
  247. }
  248. }
  249. }
  250. return(r);
  251. }
  252. return(NULL);
  253. }
  254. void vorbis_staticbook_clear(static_codebook *b){
  255. if(b->allocedp){
  256. if(b->quantlist)free(b->quantlist);
  257. if(b->lengthlist)free(b->lengthlist);
  258. if(b->nearest_tree){
  259. free(b->nearest_tree->ptr0);
  260. free(b->nearest_tree->ptr1);
  261. free(b->nearest_tree->p);
  262. free(b->nearest_tree->q);
  263. memset(b->nearest_tree,0,sizeof(encode_aux_nearestmatch));
  264. free(b->nearest_tree);
  265. }
  266. if(b->thresh_tree){
  267. free(b->thresh_tree->quantthresh);
  268. free(b->thresh_tree->quantmap);
  269. memset(b->thresh_tree,0,sizeof(encode_aux_threshmatch));
  270. free(b->thresh_tree);
  271. }
  272. memset(b,0,sizeof(static_codebook));
  273. }
  274. }
  275. void vorbis_staticbook_destroy(static_codebook *b){
  276. if(b->allocedp){
  277. vorbis_staticbook_clear(b);
  278. free(b);
  279. }
  280. }
  281. void vorbis_book_clear(codebook *b){
  282. /* static book is not cleared; we're likely called on the lookup and
  283. the static codebook belongs to the info struct */
  284. if(b->decode_tree){
  285. free(b->decode_tree->ptr0);
  286. free(b->decode_tree->ptr1);
  287. memset(b->decode_tree,0,sizeof(decode_aux));
  288. free(b->decode_tree);
  289. }
  290. if(b->valuelist)free(b->valuelist);
  291. if(b->codelist)free(b->codelist);
  292. memset(b,0,sizeof(codebook));
  293. }
  294. int vorbis_book_init_encode(codebook *c,const static_codebook *s){
  295. memset(c,0,sizeof(codebook));
  296. c->c=s;
  297. c->entries=s->entries;
  298. c->dim=s->dim;
  299. c->codelist=_make_words(s->lengthlist,s->entries);
  300. c->valuelist=_book_unquantize(s);
  301. return(0);
  302. }
  303. int vorbis_book_init_decode(codebook *c,const static_codebook *s){
  304. memset(c,0,sizeof(codebook));
  305. c->c=s;
  306. c->entries=s->entries;
  307. c->dim=s->dim;
  308. c->valuelist=_book_unquantize(s);
  309. c->decode_tree=_make_decode_tree(c);
  310. if(c->decode_tree==NULL)goto err_out;
  311. return(0);
  312. err_out:
  313. vorbis_book_clear(c);
  314. return(-1);
  315. }
  316. static float _dist(int el,float *ref, float *b,int step){
  317. int i;
  318. float acc=0.;
  319. for(i=0;i<el;i++){
  320. float val=(ref[i]-b[i*step]);
  321. acc+=val*val;
  322. }
  323. return(acc);
  324. }
  325. #include <stdio.h>
  326. int _best(codebook *book, float *a, int step){
  327. encode_aux_nearestmatch *nt=book->c->nearest_tree;
  328. encode_aux_threshmatch *tt=book->c->thresh_tree;
  329. encode_aux_pigeonhole *pt=book->c->pigeon_tree;
  330. int dim=book->dim;
  331. int ptr=0,k,o;
  332. /*int savebest=-1;
  333. float saverr;*/
  334. /* do we have a threshhold encode hint? */
  335. if(tt){
  336. int index=0;
  337. /* find the quant val of each scalar */
  338. for(k=0,o=step*(dim-1);k<dim;k++,o-=step){
  339. int i;
  340. /* linear search the quant list for now; it's small and although
  341. with > 8 entries, it would be faster to bisect, this would be
  342. a misplaced optimization for now */
  343. for(i=0;i<tt->threshvals-1;i++)
  344. if(a[o]<tt->quantthresh[i])break;
  345. index=(index*tt->quantvals)+tt->quantmap[i];
  346. }
  347. /* regular lattices are easy :-) */
  348. if(book->c->lengthlist[index]>0) /* is this unused? If so, we'll
  349. use a decision tree after all
  350. and fall through*/
  351. return(index);
  352. }
  353. /* do we have a pigeonhole encode hint? */
  354. if(pt){
  355. const static_codebook *c=book->c;
  356. int i,besti=-1;
  357. float best;
  358. int entry=0;
  359. /* dealing with sequentialness is a pain in the ass */
  360. if(c->q_sequencep){
  361. int pv;
  362. long mul=1;
  363. float qlast=0;
  364. for(k=0,o=0;k<dim;k++,o+=step){
  365. pv=(int)((a[o]-qlast-pt->min)/pt->del);
  366. if(pv<0 || pv>=pt->mapentries)break;
  367. entry+=pt->pigeonmap[pv]*mul;
  368. mul*=pt->quantvals;
  369. qlast+=pv*pt->del+pt->min;
  370. }
  371. }else{
  372. for(k=0,o=step*(dim-1);k<dim;k++,o-=step){
  373. int pv=(int)((a[o]-pt->min)/pt->del);
  374. if(pv<0 || pv>=pt->mapentries)break;
  375. entry=entry*pt->quantvals+pt->pigeonmap[pv];
  376. }
  377. }
  378. /* must be within the pigeonholable range; if we quant outside (or
  379. in an entry that we define no list for), brute force it */
  380. if(k==dim && pt->fitlength[entry]){
  381. /* search the abbreviated list */
  382. long *list=pt->fitlist+pt->fitmap[entry];
  383. for(i=0;i<pt->fitlength[entry];i++){
  384. float this=_dist(dim,book->valuelist+list[i]*dim,a,step);
  385. if(besti==-1 || this<best){
  386. best=this;
  387. besti=list[i];
  388. }
  389. }
  390. return(besti);
  391. }
  392. }
  393. if(nt){
  394. /* optimized using the decision tree */
  395. while(1){
  396. float c=0.;
  397. float *p=book->valuelist+nt->p[ptr];
  398. float *q=book->valuelist+nt->q[ptr];
  399. for(k=0,o=0;k<dim;k++,o+=step)
  400. c+=(p[k]-q[k])*(a[o]-(p[k]+q[k])*.5);
  401. if(c>0.) /* in A */
  402. ptr= -nt->ptr0[ptr];
  403. else /* in B */
  404. ptr= -nt->ptr1[ptr];
  405. if(ptr<=0)break;
  406. }
  407. return(-ptr);
  408. }
  409. /* brute force it! */
  410. {
  411. const static_codebook *c=book->c;
  412. int i,besti=-1;
  413. float best;
  414. float *e=book->valuelist;
  415. for(i=0;i<book->entries;i++){
  416. if(c->lengthlist[i]>0){
  417. float this=_dist(dim,e,a,step);
  418. if(besti==-1 || this<best){
  419. best=this;
  420. besti=i;
  421. }
  422. }
  423. e+=dim;
  424. }
  425. /*if(savebest!=-1 && savebest!=besti){
  426. fprintf(stderr,"brute force/pigeonhole disagreement:\n"
  427. "original:");
  428. for(i=0;i<dim*step;i+=step)fprintf(stderr,"%g,",a[i]);
  429. fprintf(stderr,"\n"
  430. "pigeonhole (entry %d, err %g):",savebest,saverr);
  431. for(i=0;i<dim;i++)fprintf(stderr,"%g,",
  432. (book->valuelist+savebest*dim)[i]);
  433. fprintf(stderr,"\n"
  434. "bruteforce (entry %d, err %g):",besti,best);
  435. for(i=0;i<dim;i++)fprintf(stderr,"%g,",
  436. (book->valuelist+besti*dim)[i]);
  437. fprintf(stderr,"\n");
  438. }*/
  439. return(besti);
  440. }
  441. }
  442. /* returns the entry number and *modifies a* to the remainder value ********/
  443. int vorbis_book_besterror(codebook *book,float *a,int step,int addmul){
  444. int dim=book->dim,i,o;
  445. int best=_best(book,a,step);
  446. switch(addmul){
  447. case 0:
  448. for(i=0,o=0;i<dim;i++,o+=step)
  449. a[o]-=(book->valuelist+best*dim)[i];
  450. break;
  451. case 1:
  452. for(i=0,o=0;i<dim;i++,o+=step){
  453. float val=(book->valuelist+best*dim)[i];
  454. if(val==0){
  455. a[o]=0;
  456. }else{
  457. a[o]/=val;
  458. }
  459. }
  460. break;
  461. }
  462. return(best);
  463. }
  464. long vorbis_book_codeword(codebook *book,int entry){
  465. return book->codelist[entry];
  466. }
  467. long vorbis_book_codelen(codebook *book,int entry){
  468. return book->c->lengthlist[entry];
  469. }
  470. #ifdef _V_SELFTEST
  471. /* Unit tests of the dequantizer; this stuff will be OK
  472. cross-platform, I simply want to be sure that special mapping cases
  473. actually work properly; a bug could go unnoticed for a while */
  474. #include <stdio.h>
  475. /* cases:
  476. no mapping
  477. full, explicit mapping
  478. algorithmic mapping
  479. nonsequential
  480. sequential
  481. */
  482. static long full_quantlist1[]={0,1,2,3, 4,5,6,7, 8,3,6,1};
  483. static long partial_quantlist1[]={0,7,2};
  484. /* no mapping */
  485. static_codebook test1={
  486. 4,16,
  487. NULL,
  488. 0,
  489. 0,0,0,0,
  490. NULL,
  491. NULL,NULL
  492. };
  493. static float *test1_result=NULL;
  494. /* linear, full mapping, nonsequential */
  495. static_codebook test2={
  496. 4,3,
  497. NULL,
  498. 2,
  499. -533200896,1611661312,4,0,
  500. full_quantlist1,
  501. NULL,NULL
  502. };
  503. static float test2_result[]={-3,-2,-1,0, 1,2,3,4, 5,0,3,-2};
  504. /* linear, full mapping, sequential */
  505. static_codebook test3={
  506. 4,3,
  507. NULL,
  508. 2,
  509. -533200896,1611661312,4,1,
  510. full_quantlist1,
  511. NULL,NULL
  512. };
  513. static float test3_result[]={-3,-5,-6,-6, 1,3,6,10, 5,5,8,6};
  514. /* linear, algorithmic mapping, nonsequential */
  515. static_codebook test4={
  516. 3,27,
  517. NULL,
  518. 1,
  519. -533200896,1611661312,4,0,
  520. partial_quantlist1,
  521. NULL,NULL
  522. };
  523. static float test4_result[]={-3,-3,-3, 4,-3,-3, -1,-3,-3,
  524. -3, 4,-3, 4, 4,-3, -1, 4,-3,
  525. -3,-1,-3, 4,-1,-3, -1,-1,-3,
  526. -3,-3, 4, 4,-3, 4, -1,-3, 4,
  527. -3, 4, 4, 4, 4, 4, -1, 4, 4,
  528. -3,-1, 4, 4,-1, 4, -1,-1, 4,
  529. -3,-3,-1, 4,-3,-1, -1,-3,-1,
  530. -3, 4,-1, 4, 4,-1, -1, 4,-1,
  531. -3,-1,-1, 4,-1,-1, -1,-1,-1};
  532. /* linear, algorithmic mapping, sequential */
  533. static_codebook test5={
  534. 3,27,
  535. NULL,
  536. 1,
  537. -533200896,1611661312,4,1,
  538. partial_quantlist1,
  539. NULL,NULL
  540. };
  541. static float test5_result[]={-3,-6,-9, 4, 1,-2, -1,-4,-7,
  542. -3, 1,-2, 4, 8, 5, -1, 3, 0,
  543. -3,-4,-7, 4, 3, 0, -1,-2,-5,
  544. -3,-6,-2, 4, 1, 5, -1,-4, 0,
  545. -3, 1, 5, 4, 8,12, -1, 3, 7,
  546. -3,-4, 0, 4, 3, 7, -1,-2, 2,
  547. -3,-6,-7, 4, 1, 0, -1,-4,-5,
  548. -3, 1, 0, 4, 8, 7, -1, 3, 2,
  549. -3,-4,-5, 4, 3, 2, -1,-2,-3};
  550. void run_test(static_codebook *b,float *comp){
  551. float *out=_book_unquantize(b);
  552. int i;
  553. if(comp){
  554. if(!out){
  555. fprintf(stderr,"_book_unquantize incorrectly returned NULL\n");
  556. exit(1);
  557. }
  558. for(i=0;i<b->entries*b->dim;i++)
  559. if(fabs(out[i]-comp[i])>.0001){
  560. fprintf(stderr,"disagreement in unquantized and reference data:\n"
  561. "position %d, %g != %g\n",i,out[i],comp[i]);
  562. exit(1);
  563. }
  564. }else{
  565. if(out){
  566. fprintf(stderr,"_book_unquantize returned a value array: \n"
  567. " correct result should have been NULL\n");
  568. exit(1);
  569. }
  570. }
  571. }
  572. int main(){
  573. /* run the nine dequant tests, and compare to the hand-rolled results */
  574. fprintf(stderr,"Dequant test 1... ");
  575. run_test(&test1,test1_result);
  576. fprintf(stderr,"OK\nDequant test 2... ");
  577. run_test(&test2,test2_result);
  578. fprintf(stderr,"OK\nDequant test 3... ");
  579. run_test(&test3,test3_result);
  580. fprintf(stderr,"OK\nDequant test 4... ");
  581. run_test(&test4,test4_result);
  582. fprintf(stderr,"OK\nDequant test 5... ");
  583. run_test(&test5,test5_result);
  584. fprintf(stderr,"OK\n\n");
  585. return(0);
  586. }
  587. #endif