DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Mercurial (31ec81b5d7bb)

VCS Links

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
diff --git a/media/libvorbis/lib/vorbis_block.c b/media/libvorbis/lib/vorbis_block.c
--- a/media/libvorbis/lib/vorbis_block.c
+++ b/media/libvorbis/lib/vorbis_block.c
@@ -766,42 +766,42 @@ int vorbis_synthesis_blockin(vorbis_dsp_
        to have to constantly shift *or* adjust memory usage.  Don't
        accept a new block until the old is shifted out */
 
     for(j=0;j<vi->channels;j++){
       /* the overlap/add section */
       if(v->lW){
         if(v->W){
           /* large/large */
-          float *w=_vorbis_window_get(b->window[1]-hs);
+          const float *w=_vorbis_window_get(b->window[1]-hs);
           float *pcm=v->pcm[j]+prevCenter;
           float *p=vb->pcm[j];
           for(i=0;i<n1;i++)
             pcm[i]=pcm[i]*w[n1-i-1] + p[i]*w[i];
         }else{
           /* large/small */
-          float *w=_vorbis_window_get(b->window[0]-hs);
+          const float *w=_vorbis_window_get(b->window[0]-hs);
           float *pcm=v->pcm[j]+prevCenter+n1/2-n0/2;
           float *p=vb->pcm[j];
           for(i=0;i<n0;i++)
             pcm[i]=pcm[i]*w[n0-i-1] +p[i]*w[i];
         }
       }else{
         if(v->W){
           /* small/large */
-          float *w=_vorbis_window_get(b->window[0]-hs);
+          const float *w=_vorbis_window_get(b->window[0]-hs);
           float *pcm=v->pcm[j]+prevCenter;
           float *p=vb->pcm[j]+n1/2-n0/2;
           for(i=0;i<n0;i++)
             pcm[i]=pcm[i]*w[n0-i-1] +p[i]*w[i];
           for(;i<n1/2+n0/2;i++)
             pcm[i]=p[i];
         }else{
           /* small/small */
-          float *w=_vorbis_window_get(b->window[0]-hs);
+          const float *w=_vorbis_window_get(b->window[0]-hs);
           float *pcm=v->pcm[j]+prevCenter;
           float *p=vb->pcm[j];
           for(i=0;i<n0;i++)
             pcm[i]=pcm[i]*w[n0-i-1] +p[i]*w[i];
         }
       }
 
       /* the copy section */
@@ -1030,17 +1030,17 @@ int vorbis_synthesis_lapout(vorbis_dsp_s
       v->pcmret[i]=v->pcm[i]+v->pcm_returned;
     *pcm=v->pcmret;
   }
 
   return(n1+n-v->pcm_returned);
 
 }
 
-float *vorbis_window(vorbis_dsp_state *v,int W){
+const float *vorbis_window(vorbis_dsp_state *v,int W){
   vorbis_info *vi=v->vi;
   codec_setup_info *ci=vi->codec_setup;
   int hs=ci->halfrate_flag;
   private_state *b=v->backend_state;
 
   if(b->window[W]-1<0)return NULL;
   return _vorbis_window_get(b->window[W]-hs);
 }
diff --git a/media/libvorbis/lib/vorbis_window.c b/media/libvorbis/lib/vorbis_window.c
--- a/media/libvorbis/lib/vorbis_window.c
+++ b/media/libvorbis/lib/vorbis_window.c
@@ -14,16 +14,17 @@
  last mod: $Id: window.c 16227 2009-07-08 06:58:46Z xiphmont $
 
  ********************************************************************/
 
 #include <stdlib.h>
 #include <math.h>
 #include "os.h"
 #include "misc.h"
+#include "window.h"
 
 static const float vwin64[32] = {
   0.0009460463F, 0.0085006468F, 0.0235352254F, 0.0458950567F,
   0.0753351908F, 0.1115073077F, 0.1539457973F, 0.2020557475F,
   0.2551056759F, 0.3122276645F, 0.3724270287F, 0.4346027792F,
   0.4975789974F, 0.5601459521F, 0.6211085051F, 0.6793382689F,
   0.7338252629F, 0.7837245849F, 0.8283939355F, 0.8674186656F,
   0.9006222429F, 0.9280614787F, 0.9500073081F, 0.9669131782F,
diff --git a/media/libvorbis/lib/window.h b/media/libvorbis/lib/window.h
--- a/media/libvorbis/lib/window.h
+++ b/media/libvorbis/lib/window.h
@@ -13,14 +13,14 @@
  function: window functions
  last mod: $Id: window.h 13293 2007-07-24 00:09:47Z xiphmont $
 
  ********************************************************************/
 
 #ifndef _V_WINDOW_
 #define _V_WINDOW_
 
-extern float *_vorbis_window_get(int n);
+extern const float *_vorbis_window_get(int n);
 extern void _vorbis_apply_window(float *d,int *winno,long *blocksizes,
                           int lW,int W,int nW);
 
 
 #endif