Mercurial > mplayer.hg
annotate tremor/window.c @ 30579:7c6145c57bda
Add mp_getbits() to mpeg_hdr.h to avoid a forward declaration.
author | diego |
---|---|
date | Wed, 17 Feb 2010 22:58:03 +0000 |
parents | e83eef58b30a |
children |
rev | line source |
---|---|
14280 | 1 /******************************************************************** |
2 * * | |
3 * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. * | |
4 * * | |
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. * | |
8 * * | |
9 * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 * | |
10 * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ * | |
11 * * | |
12 ******************************************************************** | |
13 | |
14 function: window functions | |
15 | |
16 ********************************************************************/ | |
17 | |
18 #include <stdlib.h> | |
19 #include <math.h> | |
20 #include "os.h" | |
21 #include "misc.h" | |
22 #include "window.h" | |
23 #include "window_lookup.h" | |
24 | |
25 const void *_vorbis_window(int type, int left){ | |
26 | |
27 switch(type){ | |
28 case 0: | |
29 | |
30 switch(left){ | |
31 case 32: | |
32 return vwin64; | |
33 case 64: | |
34 return vwin128; | |
35 case 128: | |
36 return vwin256; | |
37 case 256: | |
38 return vwin512; | |
39 case 512: | |
40 return vwin1024; | |
41 case 1024: | |
42 return vwin2048; | |
43 case 2048: | |
44 return vwin4096; | |
45 case 4096: | |
46 return vwin8192; | |
47 default: | |
48 return(0); | |
49 } | |
50 break; | |
51 default: | |
52 return(0); | |
53 } | |
54 } | |
55 | |
56 void _vorbis_apply_window(ogg_int32_t *d,const void *window_p[2], | |
57 long *blocksizes, | |
58 int lW,int W,int nW){ | |
29264
e83eef58b30a
Remove all kind of trailing whitespaces from all MPlayer's files.
bircoph
parents:
14280
diff
changeset
|
59 |
14280 | 60 LOOKUP_T *window[2]={window_p[0],window_p[1]}; |
61 long n=blocksizes[W]; | |
62 long ln=blocksizes[lW]; | |
63 long rn=blocksizes[nW]; | |
64 | |
65 long leftbegin=n/4-ln/4; | |
66 long leftend=leftbegin+ln/2; | |
67 | |
68 long rightbegin=n/2+n/4-rn/4; | |
69 long rightend=rightbegin+rn/2; | |
29264
e83eef58b30a
Remove all kind of trailing whitespaces from all MPlayer's files.
bircoph
parents:
14280
diff
changeset
|
70 |
14280 | 71 int i,p; |
72 | |
73 for(i=0;i<leftbegin;i++) | |
74 d[i]=0; | |
75 | |
76 for(p=0;i<leftend;i++,p++) | |
77 d[i]=MULT31(d[i],window[lW][p]); | |
78 | |
79 for(i=rightbegin,p=rn/2-1;i<rightend;i++,p--) | |
80 d[i]=MULT31(d[i],window[nW][p]); | |
81 | |
82 for(;i<n;i++) | |
83 d[i]=0; | |
84 } |