[xiph-commits] r10141 - trunk/speex/libspeex

jm at svn.xiph.org jm at svn.xiph.org
Fri Oct 7 00:31:28 PDT 2005


Author: jm
Date: 2005-10-07 00:31:25 -0700 (Fri, 07 Oct 2005)
New Revision: 10141

Modified:
   trunk/speex/libspeex/vorbis_psy.c
   trunk/speex/libspeex/vorbis_psy.h
Log:
API for Vorbis masking curve


Modified: trunk/speex/libspeex/vorbis_psy.c
===================================================================
--- trunk/speex/libspeex/vorbis_psy.c	2005-10-07 03:04:12 UTC (rev 10140)
+++ trunk/speex/libspeex/vorbis_psy.c	2005-10-07 07:31:25 UTC (rev 10141)
@@ -53,8 +53,12 @@
    }
 }
 
-void compute_curve(float *audio, int len, float *curve)
+VorbisPsy *vorbis_psy_init(int rate, int size)
 {
+}
+
+void compute_curve(VorbisPsy *psy, float *audio, int len, float *curve)
+{
    
 }
 
@@ -111,18 +115,19 @@
 #include <stdio.h>
 #include <math.h>
 
-#define ORDER 20
+#define ORDER 10
+#define CURVE_SIZE 24
 
 int main()
 {
    int i;
-   float curve[32];
+   float curve[CURVE_SIZE];
    float awk1[ORDER], awk2[ORDER];
-   for (i=0;i<32;i++)
+   for (i=0;i<CURVE_SIZE;i++)
       scanf("%f ", &curve[i]);
-   for (i=0;i<32;i++)
+   for (i=0;i<CURVE_SIZE;i++)
       curve[i] = pow(10.f, .1*curve[i]);
-   curve_to_lpc(curve, 32, awk1, awk2, ORDER);
+   curve_to_lpc(curve, CURVE_SIZE, awk1, awk2, ORDER);
    for (i=0;i<ORDER;i++)
       printf("%f ", awk1[i]);
    printf ("\n");

Modified: trunk/speex/libspeex/vorbis_psy.h
===================================================================
--- trunk/speex/libspeex/vorbis_psy.h	2005-10-07 03:04:12 UTC (rev 10140)
+++ trunk/speex/libspeex/vorbis_psy.h	2005-10-07 07:31:25 UTC (rev 10141)
@@ -34,14 +34,18 @@
 
 #ifdef VORBIS_PSYCHO
 
+#include "smallft.h"
 
-
 typedef struct {
-
+   struct drft_lookup analysis_lookup;
+   struct drft_lookup curve_lookup;
+   
 } VorbisPsy;
 
+VorbisPsy *vorbis_psy_init(int rate, int size);
+void vorbis_psy_destroy(VorbisPsy *psy);
+void compute_curve(VorbisPsy *psy, float *audio, int len, float *curve);
+void curve_to_lpc(float *curve, int len, float *awk1, float *awk2, int ord);
 
-
-
 #endif
 #endif



More information about the commits mailing list