summaryrefslogtreecommitdiff
path: root/lib/psytune.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/psytune.c')
-rw-r--r--lib/psytune.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/lib/psytune.c b/lib/psytune.c
index ecc83ff3..2d329bba 100644
--- a/lib/psytune.c
+++ b/lib/psytune.c
@@ -13,7 +13,7 @@
function: simple utility that runs audio through the psychoacoustics
without encoding
- last mod: $Id: psytune.c,v 1.6.2.1 2000/08/31 09:00:01 xiphmont Exp $
+ last mod: $Id: psytune.c,v 1.6.2.1.2.1 2000/09/26 18:45:34 jack Exp $
********************************************************************/
@@ -151,11 +151,11 @@ typedef struct {
} vorbis_look_floor0;
extern float _curve_to_lpc(float *curve,float *lpc,vorbis_look_floor0 *l,
- long frameno);
+ long granulepos);
extern void _lsp_to_curve(float *curve,float *lpc,float amp,
- vorbis_look_floor0 *l,char *name,long frameno);
+ vorbis_look_floor0 *l,char *name,long granulepos);
-long frameno=0;
+long granulepos=0;
/* hacked from floor0.c */
static void floorinit(vorbis_look_floor0 *look,int n,int m,int ln){
@@ -283,7 +283,7 @@ int main(int argc,char *argv[]){
for(i=0;i<2;i++){
float amp;
- analysis("pre",frameno,pcm[i],framesize,0,0);
+ analysis("pre",granulepos,pcm[i],framesize,0,0);
/* do the psychacoustics */
for(j=0;j<framesize;j++)
@@ -291,25 +291,25 @@ int main(int argc,char *argv[]){
mdct_forward(&m_look,pcm[i],pcm[i]);
- analysis("mdct",frameno,pcm[i],framesize/2,1,1);
+ analysis("mdct",granulepos,pcm[i],framesize/2,1,1);
_vp_compute_mask(&p_look,pcm[i],floor,decay[i]);
- analysis("prefloor",frameno,floor,framesize/2,1,1);
- analysis("decay",frameno,decay[i],framesize/2,1,1);
+ analysis("prefloor",granulepos,floor,framesize/2,1,1);
+ analysis("decay",granulepos,decay[i],framesize/2,1,1);
for(j=0;j<framesize/2;j++)floor[j]=todB(floor[j])+150;
- amp=_curve_to_lpc(floor,lpc,&floorlook,frameno);
+ amp=_curve_to_lpc(floor,lpc,&floorlook,granulepos);
vorbis_lpc_to_lsp(lpc,lpc,order);
- _lsp_to_curve(floor,lpc,sqrt(amp),&floorlook,"Ffloor",frameno);
+ _lsp_to_curve(floor,lpc,sqrt(amp),&floorlook,"Ffloor",granulepos);
for(j=0;j<framesize/2;j++)floor[j]=fromdB(floor[j]-150);
- analysis("floor",frameno,floor,framesize/2,1,1);
+ analysis("floor",granulepos,floor,framesize/2,1,1);
_vp_apply_floor(&p_look,pcm[i],floor);
/*r(j=0;j<framesize/2;j++)
if(fabs(pcm[i][j])<1.)pcm[i][j]=0;*/
- analysis("quant",frameno,pcm[i],framesize/2,1,1);
+ analysis("quant",granulepos,pcm[i],framesize/2,1,1);
/* re-add floor */
for(j=0;j<framesize/2;j++){
@@ -324,14 +324,14 @@ int main(int argc,char *argv[]){
}
}
- analysis("final",frameno,pcm[i],framesize/2,1,1);
+ analysis("final",granulepos,pcm[i],framesize/2,1,1);
/* take it back to time */
mdct_backward(&m_look,pcm[i],pcm[i]);
for(j=0;j<framesize/2;j++)
out[i][j]+=pcm[i][j]*window[j];
- frameno++;
+ granulepos++;
}
/* write data. Use the part of buffer we're about to shift out */