Mercurial > mplayer.hg
comparison tremor/mapping0.c @ 29264:e83eef58b30a
Remove all kind of trailing whitespaces from all MPlayer's files.
This affects all kind of spaces (' ',^I,^M,^L,...): actually
[:space:] regex character set.
author | bircoph |
---|---|
date | Wed, 13 May 2009 15:22:13 +0000 |
parents | 4940b8a98c78 |
children |
comparison
equal
deleted
inserted
replaced
29263:0f1b5b68af32 | 29264:e83eef58b30a |
---|---|
48 | 48 |
49 vorbis_func_floor **floor_func; | 49 vorbis_func_floor **floor_func; |
50 vorbis_func_residue **residue_func; | 50 vorbis_func_residue **residue_func; |
51 | 51 |
52 int ch; | 52 int ch; |
53 long lastframe; /* if a different mode is called, we need to | 53 long lastframe; /* if a different mode is called, we need to |
54 invalidate decay */ | 54 invalidate decay */ |
55 } vorbis_look_mapping0; | 55 } vorbis_look_mapping0; |
56 | 56 |
57 static void mapping0_free_info(vorbis_info_mapping *i){ | 57 static void mapping0_free_info(vorbis_info_mapping *i){ |
58 vorbis_info_mapping0 *info=(vorbis_info_mapping0 *)i; | 58 vorbis_info_mapping0 *info=(vorbis_info_mapping0 *)i; |
87 vorbis_info *vi=vd->vi; | 87 vorbis_info *vi=vd->vi; |
88 codec_setup_info *ci=(codec_setup_info *)vi->codec_setup; | 88 codec_setup_info *ci=(codec_setup_info *)vi->codec_setup; |
89 vorbis_look_mapping0 *look=(vorbis_look_mapping0 *)_ogg_calloc(1,sizeof(*look)); | 89 vorbis_look_mapping0 *look=(vorbis_look_mapping0 *)_ogg_calloc(1,sizeof(*look)); |
90 vorbis_info_mapping0 *info=look->map=(vorbis_info_mapping0 *)m; | 90 vorbis_info_mapping0 *info=look->map=(vorbis_info_mapping0 *)m; |
91 look->mode=vm; | 91 look->mode=vm; |
92 | 92 |
93 look->floor_look=(vorbis_look_floor **)_ogg_calloc(info->submaps,sizeof(*look->floor_look)); | 93 look->floor_look=(vorbis_look_floor **)_ogg_calloc(info->submaps,sizeof(*look->floor_look)); |
94 | 94 |
95 look->residue_look=(vorbis_look_residue **)_ogg_calloc(info->submaps,sizeof(*look->residue_look)); | 95 look->residue_look=(vorbis_look_residue **)_ogg_calloc(info->submaps,sizeof(*look->residue_look)); |
96 | 96 |
97 look->floor_func=(vorbis_func_floor **)_ogg_calloc(info->submaps,sizeof(*look->floor_func)); | 97 look->floor_func=(vorbis_func_floor **)_ogg_calloc(info->submaps,sizeof(*look->floor_func)); |
98 look->residue_func=(vorbis_func_residue **)_ogg_calloc(info->submaps,sizeof(*look->residue_func)); | 98 look->residue_func=(vorbis_func_residue **)_ogg_calloc(info->submaps,sizeof(*look->residue_func)); |
99 | 99 |
100 for(i=0;i<info->submaps;i++){ | 100 for(i=0;i<info->submaps;i++){ |
101 int floornum=info->floorsubmap[i]; | 101 int floornum=info->floorsubmap[i]; |
102 int resnum=info->residuesubmap[i]; | 102 int resnum=info->residuesubmap[i]; |
103 | 103 |
104 look->floor_func[i]=_floor_P[ci->floor_type[floornum]]; | 104 look->floor_func[i]=_floor_P[ci->floor_type[floornum]]; |
105 look->floor_look[i]=look->floor_func[i]-> | 105 look->floor_look[i]=look->floor_func[i]-> |
106 look(vd,vm,ci->floor_param[floornum]); | 106 look(vd,vm,ci->floor_param[floornum]); |
107 look->residue_func[i]=_residue_P[ci->residue_type[resnum]]; | 107 look->residue_func[i]=_residue_P[ci->residue_type[resnum]]; |
108 look->residue_look[i]=look->residue_func[i]-> | 108 look->residue_look[i]=look->residue_func[i]-> |
109 look(vd,vm,ci->residue_param[resnum]); | 109 look(vd,vm,ci->residue_param[resnum]); |
110 | 110 |
111 } | 111 } |
112 | 112 |
113 look->ch=vi->channels; | 113 look->ch=vi->channels; |
114 | 114 |
115 return(look); | 115 return(look); |
142 | 142 |
143 for(i=0;i<info->coupling_steps;i++){ | 143 for(i=0;i<info->coupling_steps;i++){ |
144 int testM=info->coupling_mag[i]=oggpack_read(opb,ilog(vi->channels)); | 144 int testM=info->coupling_mag[i]=oggpack_read(opb,ilog(vi->channels)); |
145 int testA=info->coupling_ang[i]=oggpack_read(opb,ilog(vi->channels)); | 145 int testA=info->coupling_ang[i]=oggpack_read(opb,ilog(vi->channels)); |
146 | 146 |
147 if(testM<0 || | 147 if(testM<0 || |
148 testA<0 || | 148 testA<0 || |
149 testM==testA || | 149 testM==testA || |
150 testM>=vi->channels || | 150 testM>=vi->channels || |
151 testA>=vi->channels) goto err_out; | 151 testA>=vi->channels) goto err_out; |
152 } | 152 } |
153 | 153 |
154 } | 154 } |
155 | 155 |
156 if(oggpack_read(opb,2)>0)goto err_out; /* 2,3:reserved */ | 156 if(oggpack_read(opb,2)>0)goto err_out; /* 2,3:reserved */ |
157 | 157 |
158 if(info->submaps>1){ | 158 if(info->submaps>1){ |
159 for(i=0;i<vi->channels;i++){ | 159 for(i=0;i<vi->channels;i++){ |
160 info->chmuxlist[i]=oggpack_read(opb,4); | 160 info->chmuxlist[i]=oggpack_read(opb,4); |
161 if(info->chmuxlist[i]>=info->submaps)goto err_out; | 161 if(info->chmuxlist[i]>=info->submaps)goto err_out; |
162 } | 162 } |
189 int i,j; | 189 int i,j; |
190 long n=vb->pcmend=ci->blocksizes[vb->W]; | 190 long n=vb->pcmend=ci->blocksizes[vb->W]; |
191 | 191 |
192 ogg_int32_t **pcmbundle=(ogg_int32_t **)alloca(sizeof(*pcmbundle)*vi->channels); | 192 ogg_int32_t **pcmbundle=(ogg_int32_t **)alloca(sizeof(*pcmbundle)*vi->channels); |
193 int *zerobundle=(int *)alloca(sizeof(*zerobundle)*vi->channels); | 193 int *zerobundle=(int *)alloca(sizeof(*zerobundle)*vi->channels); |
194 | 194 |
195 int *nonzero =(int *)alloca(sizeof(*nonzero)*vi->channels); | 195 int *nonzero =(int *)alloca(sizeof(*nonzero)*vi->channels); |
196 void **floormemo=(void **)alloca(sizeof(*floormemo)*vi->channels); | 196 void **floormemo=(void **)alloca(sizeof(*floormemo)*vi->channels); |
197 | 197 |
198 /* time domain information decode (note that applying the | 198 /* time domain information decode (note that applying the |
199 information would have to happen later; we'll probably add a | 199 information would have to happen later; we'll probably add a |
200 function entry to the harness for that later */ | 200 function entry to the harness for that later */ |
201 /* NOT IMPLEMENTED */ | 201 /* NOT IMPLEMENTED */ |
202 | 202 |
206 floormemo[i]=look->floor_func[submap]-> | 206 floormemo[i]=look->floor_func[submap]-> |
207 inverse1(vb,look->floor_look[submap]); | 207 inverse1(vb,look->floor_look[submap]); |
208 if(floormemo[i]) | 208 if(floormemo[i]) |
209 nonzero[i]=1; | 209 nonzero[i]=1; |
210 else | 210 else |
211 nonzero[i]=0; | 211 nonzero[i]=0; |
212 memset(vb->pcm[i],0,sizeof(*vb->pcm[i])*n/2); | 212 memset(vb->pcm[i],0,sizeof(*vb->pcm[i])*n/2); |
213 } | 213 } |
214 | 214 |
215 /* channel coupling can 'dirty' the nonzero listing */ | 215 /* channel coupling can 'dirty' the nonzero listing */ |
216 for(i=0;i<info->coupling_steps;i++){ | 216 for(i=0;i<info->coupling_steps;i++){ |
217 if(nonzero[info->coupling_mag[i]] || | 217 if(nonzero[info->coupling_mag[i]] || |
218 nonzero[info->coupling_ang[i]]){ | 218 nonzero[info->coupling_ang[i]]){ |
219 nonzero[info->coupling_mag[i]]=1; | 219 nonzero[info->coupling_mag[i]]=1; |
220 nonzero[info->coupling_ang[i]]=1; | 220 nonzero[info->coupling_ang[i]]=1; |
221 } | 221 } |
222 } | 222 } |
223 | 223 |
224 /* recover the residue into our working vectors */ | 224 /* recover the residue into our working vectors */ |
225 for(i=0;i<info->submaps;i++){ | 225 for(i=0;i<info->submaps;i++){ |
231 else | 231 else |
232 zerobundle[ch_in_bundle]=0; | 232 zerobundle[ch_in_bundle]=0; |
233 pcmbundle[ch_in_bundle++]=vb->pcm[j]; | 233 pcmbundle[ch_in_bundle++]=vb->pcm[j]; |
234 } | 234 } |
235 } | 235 } |
236 | 236 |
237 look->residue_func[i]->inverse(vb,look->residue_look[i], | 237 look->residue_func[i]->inverse(vb,look->residue_look[i], |
238 pcmbundle,zerobundle,ch_in_bundle); | 238 pcmbundle,zerobundle,ch_in_bundle); |
239 } | 239 } |
240 | 240 |
241 //for(j=0;j<vi->channels;j++) | 241 //for(j=0;j<vi->channels;j++) |
244 | 244 |
245 /* channel coupling */ | 245 /* channel coupling */ |
246 for(i=info->coupling_steps-1;i>=0;i--){ | 246 for(i=info->coupling_steps-1;i>=0;i--){ |
247 ogg_int32_t *pcmM=vb->pcm[info->coupling_mag[i]]; | 247 ogg_int32_t *pcmM=vb->pcm[info->coupling_mag[i]]; |
248 ogg_int32_t *pcmA=vb->pcm[info->coupling_ang[i]]; | 248 ogg_int32_t *pcmA=vb->pcm[info->coupling_ang[i]]; |
249 | 249 |
250 for(j=0;j<n/2;j++){ | 250 for(j=0;j<n/2;j++){ |
251 ogg_int32_t mag=pcmM[j]; | 251 ogg_int32_t mag=pcmM[j]; |
252 ogg_int32_t ang=pcmA[j]; | 252 ogg_int32_t ang=pcmA[j]; |
253 | 253 |
254 if(mag>0) | 254 if(mag>0) |
255 if(ang>0){ | 255 if(ang>0){ |
256 pcmM[j]=mag; | 256 pcmM[j]=mag; |
257 pcmA[j]=mag-ang; | 257 pcmA[j]=mag-ang; |
258 }else{ | 258 }else{ |
300 if(nonzero[i]) | 300 if(nonzero[i]) |
301 _vorbis_apply_window(pcm,b->window,ci->blocksizes,vb->lW,vb->W,vb->nW); | 301 _vorbis_apply_window(pcm,b->window,ci->blocksizes,vb->lW,vb->W,vb->nW); |
302 else | 302 else |
303 for(j=0;j<n;j++) | 303 for(j=0;j<n;j++) |
304 pcm[j]=0; | 304 pcm[j]=0; |
305 | 305 |
306 } | 306 } |
307 | 307 |
308 //for(j=0;j<vi->channels;j++) | 308 //for(j=0;j<vi->channels;j++) |
309 //_analysis_output("window",seq+j,vb->pcm[j],-24,n,0,0); | 309 //_analysis_output("window",seq+j,vb->pcm[j],-24,n,0,0); |
310 | 310 |