Bug 944977 - Part 1: Backport _vorbis_window_get() function signature from libvorbis r19028. r=tterribe
authorChris Peterson <cpeterson@mozilla.com>
Mon, 02 Dec 2013 19:38:19 -0800
changeset 174328 727a945e6ddcdcd9b03a1bab7c7a09ed158d8d2a
parent 174327 58dbd2146e24df18ee5d1e9057b531093571de51
child 174329 bbdfac4aa44487ee11f9e666febef10d440edc1d
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstterribe
bugs944977
milestone28.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 944977 - Part 1: Backport _vorbis_window_get() function signature from libvorbis r19028. r=tterribe
media/libvorbis/bug944977-r19028.patch
media/libvorbis/lib/vorbis_block.c
media/libvorbis/lib/vorbis_window.c
media/libvorbis/lib/window.h
media/libvorbis/update.sh
new file mode 100644
--- /dev/null
+++ b/media/libvorbis/bug944977-r19028.patch
@@ -0,0 +1,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
--- 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);
 }
--- 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,
--- 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
--- a/media/libvorbis/update.sh
+++ b/media/libvorbis/update.sh
@@ -76,8 +76,9 @@ mkdir -p ./lib/books/coupled
 mkdir -p ./lib/books/floor
 mkdir -p ./lib/books/uncoupled
 cp $1/lib/books/coupled/res_books_stereo.h ./lib/books/coupled/
 cp $1/lib/books/coupled/res_books_51.h ./lib/books/coupled/
 cp $1/lib/books/floor/floor_books.h ./lib/books/floor/
 cp $1/lib/books/uncoupled/res_books_uncoupled.h ./lib/books/uncoupled/
 
 # Add any patches against upstream here.
+patch -p3 < bug944977-r19028.patch