- /* lattice codebook. dump it. */
- int j,k;
- long maxcount=0;
- long **sort=calloc(bins,sizeof(long *));
- long base=c->lengthlist[0];
- countarray=calloc(bins,sizeof(long));
-
- for(i=0;i<bins;i++)sort[i]=c->quantlist+i;
- qsort(sort,bins,sizeof(long *),ascend);
-
- for(i=0;i<b->entries;i++)
- if(c->lengthlist[i]>base)base=c->lengthlist[i];
-
- /* dump a full, correlated count */
- for(j=0;j<b->entries;j++){
- if(c->lengthlist[j]){
- int indexdiv=1;
- printf("%4ld: ",j);
- for(k=0;k<b->dim;k++){
- int index= (j/indexdiv)%bins;
- printf("%+3.1f,", c->quantlist[index]*_float32_unpack(c->q_delta)+
- _float32_unpack(c->q_min));
- indexdiv*=bins;
- }
- printf("\t|",(1<<(base-c->lengthlist[j])));
- for(k=0;k<base-c->lengthlist[j];k++)printf("*");
- printf("\n");
- }
- }
-
- /* do a rough count */
- for(j=0;j<b->entries;j++){
- int indexdiv=1;
- for(k=0;k<b->dim;k++){
- if(c->lengthlist[j]){
- int index= (j/indexdiv)%bins;
- countarray[index]+=(1<<(base-c->lengthlist[j]));
- indexdiv*=bins;
- }
- }
- }
-
- /* dump the count */
-
- {
- long maxcount=0,i,j;
- for(i=0;i<bins;i++)
- if(countarray[i]>maxcount)maxcount=countarray[i];
+ /* lattice codebook. dump it. */
+ int j,k;
+ long maxcount=0;
+ long **sort=calloc(bins,sizeof(long *));
+ long base=c->lengthlist[0];
+ countarray=calloc(bins,sizeof(long));
+
+ for(i=0;i<bins;i++)sort[i]=c->quantlist+i;
+ qsort(sort,bins,sizeof(long *),ascend);
+
+ for(i=0;i<b->entries;i++)
+ if(c->lengthlist[i]>base)base=c->lengthlist[i];
+
+ /* dump a full, correlated count */
+ for(j=0;j<b->entries;j++){
+ if(c->lengthlist[j]){
+ int indexdiv=1;
+ printf("%4d: ",j);
+ for(k=0;k<b->dim;k++){
+ int index= (j/indexdiv)%bins;
+ printf("%+3.1f,", c->quantlist[index]*_float32_unpack(c->q_delta)+
+ _float32_unpack(c->q_min));
+ indexdiv*=bins;
+ }
+ printf("\t|");
+ for(k=0;k<base-c->lengthlist[j];k++)printf("*");
+ printf("\n");
+ }
+ }
+
+ /* do a rough count */
+ for(j=0;j<b->entries;j++){
+ int indexdiv=1;
+ for(k=0;k<b->dim;k++){
+ if(c->lengthlist[j]){
+ int index= (j/indexdiv)%bins;
+ countarray[index]+=(1<<(base-c->lengthlist[j]));
+ indexdiv*=bins;
+ }
+ }
+ }
+
+ /* dump the count */
+
+ {
+ long maxcount=0,i,j;
+ for(i=0;i<bins;i++)
+ if(countarray[i]>maxcount)maxcount=countarray[i];