diff options
Diffstat (limited to 'lib/psytune.c')
-rw-r--r-- | lib/psytune.c | 64 |
1 files changed, 33 insertions, 31 deletions
diff --git a/lib/psytune.c b/lib/psytune.c index 2b5120bb..5191db0a 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.4.4.2 2000/07/31 19:41:00 xiphmont Exp $ + last mod: $Id: psytune.c,v 1.4.4.3 2000/08/15 08:33:45 xiphmont Exp $ ********************************************************************/ @@ -34,7 +34,7 @@ static vorbis_info_psy _psy_set0={ 1,/*athp*/ 1,/*decayp*/ 1,/*smoothp*/ - 1,.2, + 0,.2, -100., -140., @@ -64,28 +64,27 @@ static vorbis_info_psy _psy_set0={ {-40.,-40.,-40.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*16000*/ }, - 0,/* peakattp */ - /* 0 10 20 30 40 50 60 70 80 90 100 */ + 1,/* peakattp */ {{-14.,-16.,-18.,-19.,-20.,-21.,-22.,-22.,-22.,-22.,-22.}, /*63*/ {-14.,-16.,-18.,-19.,-20.,-21.,-22.,-22.,-22.,-22.,-22.}, /*88*/ {-14.,-16.,-18.,-19.,-20.,-21.,-22.,-22.,-22.,-22.,-22.}, /*125*/ - {-14.,-16.,-18.,-19.,-20.,-21.,-22.,-22.,-22.,-22.,-22.}, /*175*/ - {-14.,-16.,-18.,-19.,-20.,-21.,-22.,-22.,-22.,-22.,-22.}, /*250*/ - {-14.,-16.,-18.,-19.,-20.,-20.,-20.,-21.,-22.,-22.,-22.}, /*350*/ - {-14.,-16.,-18.,-18.,-18.,-19.,-20.,-20.,-20.,-22.,-22.}, /*500*/ - {-14.,-16.,-18.,-18.,-18.,-18.,-18.,-19.,-20.,-22.,-22.}, /*700*/ - {-14.,-16.,-16.,-17.,-18.,-18.,-18.,-19.,-20.,-22.,-22.}, /*1000*/ - {-14.,-16.,-16.,-17.,-18.,-18.,-18.,-19.,-20.,-22.,-22.}, /*1400*/ - {-14.,-15.,-18.,-18.,-18.,-18.,-18.,-19.,-20.,-22.,-22.}, /*2000*/ - {-14.,-14.,-18.,-18.,-18.,-18.,-18.,-19.,-20.,-22.,-22.}, /*2800*/ - {-12.,-13.,-16.,-17.,-17.,-17.,-18.,-19.,-20.,-22.,-22.}, /*4000*/ - {-10.,-12.,-14.,-15.,-16.,-16.,-17.,-18.,-20.,-22.,-22.}, /*5600*/ - { -8.,-11.,-12.,-13.,-14.,-15.,-16.,-17.,-18.,-22.,-22.}, /*8000*/ - { -8.,-10.,-12.,-13.,-14.,-15.,-16.,-16.,-16.,-22.,-22.}, /*11500*/ - { -8.,-10.,-12.,-13.,-14.,-15.,-16.,-16.,-16.,-22.,-22.}, /*16000*/ + { -7., -8., -9.,-10.,-10.,-11.,-12.,-13.,-15.,-18.,-20.}, /*8000*/ + { -7., -8., -9.,-10.,-10.,-11.,-12.,-13.,-15.,-18.,-20.}, /*8000*/ + { -7., -8., -9.,-10.,-10.,-11.,-12.,-13.,-15.,-18.,-20.}, /*8000*/ + { -7., -8., -9.,-10.,-10.,-11.,-12.,-13.,-15.,-18.,-20.}, /*8000*/ + { -7., -8., -9.,-10.,-10.,-11.,-12.,-13.,-15.,-18.,-20.}, /*8000*/ + { -7., -8., -9.,-10.,-10.,-11.,-12.,-13.,-15.,-18.,-20.}, /*8000*/ + { -7., -8., -9.,-10.,-10.,-11.,-12.,-13.,-15.,-18.,-20.}, /*8000*/ + { -7., -8., -9.,-10.,-10.,-11.,-12.,-13.,-15.,-18.,-20.}, /*8000*/ + { -7., -8., -9.,-10.,-10.,-11.,-12.,-13.,-15.,-18.,-20.}, /*8000*/ + { -7., -8., -9.,-10.,-10.,-11.,-12.,-13.,-15.,-18.,-20.}, /*8000*/ + { -7., -8., -9.,-10.,-10.,-11.,-12.,-13.,-15.,-18.,-20.}, /*8000*/ + { -7., -8., -9.,-10.,-10.,-11.,-12.,-13.,-15.,-16.,-17.}, /*8000*/ + { -6., -7., -9., -9., -9., -9.,-10.,-11.,-12.,-13.,-14.}, /*11500*/ + { -6., -6., -9., -9., -9., -9., -9., -9.,-10.,-11.,-12.}, /*16000*/ }, - 0,/*noisemaskp */ + 1,/*noisemaskp */ /* 0 10 20 30 40 50 60 70 80 90 100 */ {{-99.,-99.,-99.,-99.,-99.,-99.,-99.,-199.,-199.,-199.,-199.}, /*63*/ {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-199.,-199.,-199.,-199.}, /*88*/ @@ -93,25 +92,25 @@ static vorbis_info_psy _psy_set0={ {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-199.,-199.,-199.,-199.}, /*175*/ {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-199.,-199.,-199.,-199.}, /*250*/ {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-199.,-199.,-199.,-199.}, /*350*/ - {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-199.,-199.,-199.,-199.}, /*500*/ - {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-199.,-199.,-199.,-199.}, /*700*/ - {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-199.,-199.,-199.,-199.}, /*100*/ - {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-199.,-199.,-199.,-199.}, /*1400/ - { -0., -0., -0., -0., -0., -0., -0., -0., -0., -0., -0.}, /*2000*/ - { -0., -0., -0., -0., -0., -0., -0., -0., -0., -0., -0.}, /*2800*/ + {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-199.,-199.,-199.,-199.}, /*350*/ + {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-199.,-199.,-199.,-199.}, /*350*/ + { -6., -6., -6., -6., -6., -6., -6., -6., -6., -6., -6.}, /*2000*/ + { -6., -6., -6., -6., -6., -6., -6., -6., -6., -6., -6.}, /*2000*/ + { -6., -6., -6., -6., -6., -6., -6., -6., -6., -6., -6.}, /*2000*/ + { -6., -6., -6., -6., -6., -6., -6., -6., -6., -6., -6.}, /*2800*/ { -0., -0., -0., -0., -0., -0., -0., -0., -0., -0., -0.}, /*4000*/ - { -0., -0., -0., -0., -0., -0., -0., -0., -0., -0., -0.}, /*5600*/ - { -0., -0., -0., -0., -0., -0., -0., -0., -0., -0., -0.}, /*8000*/ - { -0., -0., -0., -0., -0., -0., -0., -0., -0., -0., -0.}, /*11500*/ - { -0., -0., -0., -0., -0., -0., -0., -0., -0., -0., -0.}, /*16000*/ + { 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.}, /*5600*/ + { 4., 4., 4., 4., 4., 4., 4., 4., 4., 4., 4.}, /*8000*/ + { 4., 4., 4., 4., 4., 4., 4., 4., 4., 4., 4.}, /*11500*/ + { 4., 4., 4., 4., 4., 4., 4., 4., 4., 4., 4.}, /*16000*/ }, 110., - .9998, .9998, /* attack/decay control */ + -0, -.005, /* attack/decay control */ }; -static int noisy=1; +static int noisy=0; void analysis(char *base,int i,double *v,int n,int bark,int dB){ if(noisy){ int j; @@ -305,6 +304,9 @@ int main(int argc,char *argv[]){ analysis("floor",frameno,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); /* re-add floor */ |