/******************************************************************** * * * 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-2001 * * by the Xiph.Org Foundation http://www.xiph.org/ * * * ******************************************************************** function: residue backend 0 partitioner/classifier last mod: $Id: residuesplit.c 16037 2009-05-26 21:10:58Z xiphmont $ ********************************************************************/ #include #include #include #include #include "bookutil.h" /* does not guard against invalid settings; eg, a subn of 16 and a subgroup request of 32. Max subn of 128 */ static float _testhack(float *vec,int n){ int i,j=0; float max=0.f; float temp[128]; float entropy=0.; /* setup */ for(i=0;imax)max=temp[i]; for(i=0;i>=1; j++; if(n<=0)break; for(i=0;imax)max=temp[i]; }*/ } static FILE *of; static FILE **or; /* we evaluate the the entropy measure for each interleaved subgroup */ /* This is currently a bit specific to/hardwired for mapping 0; things will need to change in the future when we get real multichannel mappings */ int quantaux(float *res,int n,float *ebound,float *mbound,int *subgrp,int parts, int subn, int *class){ long i,j,part=0; int aux; for(i=0;i<=n-subn;i+=subn,part++){ float max=0.f; float lentropy=0.f; lentropy=_testhack(res+i,subn); for(j=0;jmax)max=fabs(res[i+j]); for(j=0;j [] []...\n" " where begin,n,group is first scalar, \n" " number of scalars of each in line,\n" " number of scalars in a group\n" " ent is the maximum entropy value allowed for membership in a group\n" " peak is the maximum amplitude value allowed for membership in a group\n" " subn is the maximum subpartiton number allowed in the group\n\n"); exit(1); } int main(int argc, char *argv[]){ char *buffer; char *base; int i,j,parts,begin,n,subn,*subgrp,*class; FILE **res; int resfiles=0; float *ebound,*mbound,*vec; long c=0; if(argc<5)usage(); /* count the res file names, open the files */ while(!strcmp(argv[resfiles+1]+strlen(argv[resfiles+1])-4,".vqd")) resfiles++; if(resfiles<1)usage(); res=alloca(sizeof(*res)*resfiles); for(i=0;i