1 /********************************************************************
3 * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
5 * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
6 * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
7 * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
9 * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
10 * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
12 ********************************************************************
14 function: window functions
16 ********************************************************************/
23 #include "window_lookup.h"
25 const void *_vorbis_window(int type
, int left
){
56 void _vorbis_apply_window(ogg_int32_t
*d
,const void *window_p
[2],
60 LOOKUP_T
*window
[2]={window_p
[0],window_p
[1]};
62 long ln
=blocksizes
[lW
];
63 long rn
=blocksizes
[nW
];
65 long leftbegin
=n
/4-ln
/4;
66 long leftend
=leftbegin
+ln
/2;
68 long rightbegin
=n
/2+n
/4-rn
/4;
69 long rightend
=rightbegin
+rn
/2;
73 for(i
=0;i
<leftbegin
;i
++)
76 for(p
=0;i
<leftend
;i
++,p
++)
77 d
[i
]=MULT31(d
[i
],window
[lW
][p
]);
79 for(i
=rightbegin
,p
=rn
/2-1;i
<rightend
;i
++,p
--)
80 d
[i
]=MULT31(d
[i
],window
[nW
][p
]);