Changeset d034ab59c4929fda2ea452cfb6aa55a0aea6a2f9
- Timestamp:
- 01/09/07 13:37:15 (1 year ago)
- git-parent:
- Files:
-
- modules/audio_filter/spatializer/allpass.cpp (modified) (1 diff)
- modules/audio_filter/spatializer/allpass.hpp (modified) (2 diffs)
- modules/audio_filter/spatializer/comb.cpp (modified) (1 diff)
- modules/audio_filter/spatializer/comb.hpp (modified) (2 diffs)
- modules/audio_filter/spatializer/revmodel.cpp (modified) (4 diffs)
- modules/audio_filter/spatializer/revmodel.hpp (modified) (2 diffs)
- modules/audio_filter/spatializer/spatializer.cpp (modified) (10 diffs)
- modules/audio_filter/spatializer/tuning.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
modules/audio_filter/spatializer/allpass.cpp
rc701929 rd034ab5 9 9 allpass::allpass() 10 10 { 11 bufidx = 0;11 bufidx = 0; 12 12 } 13 13 14 void allpass::setbuffer(float *buf, int size) 14 void allpass::setbuffer(float *buf, int size) 15 15 { 16 buffer = buf; 17 bufsize = size;16 buffer = buf; 17 bufsize = size; 18 18 } 19 19 20 20 void allpass::mute() 21 21 { 22 for (int i=0; i<bufsize; i++)23 buffer[i]=0;22 for (int i=0; i<bufsize; i++) 23 buffer[i]=0; 24 24 } 25 25 26 void allpass::setfeedback(float val) 26 void allpass::setfeedback(float val) 27 27 { 28 feedback = val;28 feedback = val; 29 29 } 30 30 31 float allpass::getfeedback() 31 float allpass::getfeedback() 32 32 { 33 return feedback;33 return feedback; 34 34 } 35 35 modules/audio_filter/spatializer/allpass.hpp
rc701929 rd034ab5 13 13 public: 14 14 allpass(); 15 voidsetbuffer(float *buf, int size);16 inline floatprocess(float inp);17 voidmute();18 voidsetfeedback(float val);19 floatgetfeedback();15 void setbuffer(float *buf, int size); 16 inline float process(float inp); 17 void mute(); 18 void setfeedback(float val); 19 float getfeedback(); 20 20 // private: 21 floatfeedback;22 float*buffer;23 intbufsize;24 intbufidx;21 float feedback; 22 float *buffer; 23 int bufsize; 24 int bufidx; 25 25 }; 26 26 … … 30 30 inline float allpass::process(float input) 31 31 { 32 float output; 33 float bufout; 34 35 bufout = buffer[bufidx]; 36 undenormalise(bufout); 37 38 output = -input + bufout; 39 buffer[bufidx] = input + (bufout*feedback); 32 float output; 33 float bufout; 40 34 41 if(++bufidx>=bufsize) bufidx = 0; 35 bufout = buffer[bufidx]; 36 undenormalise(bufout); 42 37 43 return output; 38 output = -input + bufout; 39 buffer[bufidx] = input + (bufout*feedback); 40 41 if(++bufidx>=bufsize) bufidx = 0; 42 43 return output; 44 44 } 45 45 modules/audio_filter/spatializer/comb.cpp
rc701929 rd034ab5 9 9 comb::comb() 10 10 { 11 filterstore = 0;12 bufidx = 0;11 filterstore = 0; 12 bufidx = 0; 13 13 } 14 14 15 void comb::setbuffer(float *buf, int size) 15 void comb::setbuffer(float *buf, int size) 16 16 { 17 buffer = buf; 18 bufsize = size;17 buffer = buf; 18 bufsize = size; 19 19 } 20 20 21 21 void comb::mute() 22 22 { 23 for (int i=0; i<bufsize; i++)24 buffer[i]=0;23 for (int i=0; i<bufsize; i++) 24 buffer[i]=0; 25 25 } 26 26 27 void comb::setdamp(float val) 27 void comb::setdamp(float val) 28 28 { 29 damp1 = val; 30 damp2 = 1-val;29 damp1 = val; 30 damp2 = 1-val; 31 31 } 32 32 33 float comb::getdamp() 33 float comb::getdamp() 34 34 { 35 return damp1;35 return damp1; 36 36 } 37 37 38 void comb::setfeedback(float val) 38 void comb::setfeedback(float val) 39 39 { 40 feedback = val;40 feedback = val; 41 41 } 42 42 43 float comb::getfeedback() 43 float comb::getfeedback() 44 44 { 45 return feedback;45 return feedback; 46 46 } 47 47 modules/audio_filter/spatializer/comb.hpp
rc701929 rd034ab5 13 13 { 14 14 public: 15 comb();16 voidsetbuffer(float *buf, int size);17 inline floatprocess(float inp);18 voidmute();19 voidsetdamp(float val);20 floatgetdamp();21 voidsetfeedback(float val);22 floatgetfeedback();15 comb(); 16 void setbuffer(float *buf, int size); 17 inline float process(float inp); 18 void mute(); 19 void setdamp(float val); 20 float getdamp(); 21 void setfeedback(float val); 22 float getfeedback(); 23 23 private: 24 floatfeedback;25 floatfilterstore;26 floatdamp1;27 floatdamp2;28 float*buffer;29 intbufsize;30 intbufidx;24 float feedback; 25 float filterstore; 26 float damp1; 27 float damp2; 28 float *buffer; 29 int bufsize; 30 int bufidx; 31 31 }; 32 32 … … 36 36 inline float comb::process(float input) 37 37 { 38 float output;38 float output; 39 39 40 output = buffer[bufidx];41 undenormalise(output);40 output = buffer[bufidx]; 41 undenormalise(output); 42 42 43 filterstore = (output*damp2) + (filterstore*damp1);44 undenormalise(filterstore);43 filterstore = (output*damp2) + (filterstore*damp1); 44 undenormalise(filterstore); 45 45 46 buffer[bufidx] = input + (filterstore*feedback);46 buffer[bufidx] = input + (filterstore*feedback); 47 47 48 if(++bufidx>=bufsize) bufidx = 0;48 if(++bufidx>=bufsize) bufidx = 0; 49 49 50 return output;50 return output; 51 51 } 52 52 modules/audio_filter/spatializer/revmodel.cpp
rc701929 rd034ab5 1 1 // Reverb model implementation 2 // 3 // 2 // 3 // 4 4 // Google Summer of Code 2007 5 // 6 // Authors: Biodun Osunkunle <biodun@videolan.org> 7 // 5 // 6 // Authors: Biodun Osunkunle <biodun@videolan.org> 7 // 8 8 // Mentor : Jean-Baptiste Kempf <jb@videolan.org> 9 9 // … … 17 17 revmodel::revmodel() 18 18 { 19 // Tie the components to their buffers20 combL[0].setbuffer(bufcombL1,combtuningL1);21 combR[0].setbuffer(bufcombR1,combtuningR1);22 combL[1].setbuffer(bufcombL2,combtuningL2);23 combR[1].setbuffer(bufcombR2,combtuningR2);24 combL[2].setbuffer(bufcombL3,combtuningL3);25 combR[2].setbuffer(bufcombR3,combtuningR3);26 combL[3].setbuffer(bufcombL4,combtuningL4);27 combR[3].setbuffer(bufcombR4,combtuningR4);28 combL[4].setbuffer(bufcombL5,combtuningL5);29 combR[4].setbuffer(bufcombR5,combtuningR5);30 combL[5].setbuffer(bufcombL6,combtuningL6);31 combR[5].setbuffer(bufcombR6,combtuningR6);32 combL[6].setbuffer(bufcombL7,combtuningL7);33 combR[6].setbuffer(bufcombR7,combtuningR7);34 combL[7].setbuffer(bufcombL8,combtuningL8);35 combR[7].setbuffer(bufcombR8,combtuningR8);36 allpassL[0].setbuffer(bufallpassL1,allpasstuningL1);37 allpassR[0].setbuffer(bufallpassR1,allpasstuningR1);38 allpassL[1].setbuffer(bufallpassL2,allpasstuningL2);39 allpassR[1].setbuffer(bufallpassR2,allpasstuningR2);40 allpassL[2].setbuffer(bufallpassL3,allpasstuningL3);41 allpassR[2].setbuffer(bufallpassR3,allpasstuningR3);42 allpassL[3].setbuffer(bufallpassL4,allpasstuningL4);43 allpassR[3].setbuffer(bufallpassR4,allpasstuningR4);44 45 // Set default values46 allpassL[0].setfeedback(0.5f);47 allpassR[0].setfeedback(0.5f);48 allpassL[1].setfeedback(0.5f);49 allpassR[1].setfeedback(0.5f);50 allpassL[2].setfeedback(0.5f);51 allpassR[2].setfeedback(0.5f);52 allpassL[3].setfeedback(0.5f);53 allpassR[3].setfeedback(0.5f);54 setwet(initialwet);55 setroomsize(initialroom);56 setdry(initialdry);57 setdamp(initialdamp);58 setwidth(initialwidth);59 setmode(initialmode);60 61 // Buffer will be full of rubbish - so we MUST mute them62 mute();19 // Tie the components to their buffers 20 combL[0].setbuffer(bufcombL1,combtuningL1); 21 combR[0].setbuffer(bufcombR1,combtuningR1); 22 combL[1].setbuffer(bufcombL2,combtuningL2); 23 combR[1].setbuffer(bufcombR2,combtuningR2); 24 combL[2].setbuffer(bufcombL3,combtuningL3); 25 combR[2].setbuffer(bufcombR3,combtuningR3); 26 combL[3].setbuffer(bufcombL4,combtuningL4); 27 combR[3].setbuffer(bufcombR4,combtuningR4); 28 combL[4].setbuffer(bufcombL5,combtuningL5); 29 combR[4].setbuffer(bufcombR5,combtuningR5); 30 combL[5].setbuffer(bufcombL6,combtuningL6); 31 combR[5].setbuffer(bufcombR6,combtuningR6); 32 combL[6].setbuffer(bufcombL7,combtuningL7); 33 combR[6].setbuffer(bufcombR7,combtuningR7); 34 combL[7].setbuffer(bufcombL8,combtuningL8); 35 combR[7].setbuffer(bufcombR8,combtuningR8); 36 allpassL[0].setbuffer(bufallpassL1,allpasstuningL1); 37 allpassR[0].setbuffer(bufallpassR1,allpasstuningR1); 38 allpassL[1].setbuffer(bufallpassL2,allpasstuningL2); 39 allpassR[1].setbuffer(bufallpassR2,allpasstuningR2); 40 allpassL[2].setbuffer(bufallpassL3,allpasstuningL3); 41 allpassR[2].setbuffer(bufallpassR3,allpasstuningR3); 42 allpassL[3].setbuffer(bufallpassL4,allpasstuningL4); 43 allpassR[3].setbuffer(bufallpassR4,allpasstuningR4); 44 45 // Set default values 46 allpassL[0].setfeedback(0.5f); 47 allpassR[0].setfeedback(0.5f); 48 allpassL[1].setfeedback(0.5f); 49 allpassR[1].setfeedback(0.5f); 50 allpassL[2].setfeedback(0.5f); 51 allpassR[2].setfeedback(0.5f); 52 allpassL[3].setfeedback(0.5f); 53 allpassR[3].setfeedback(0.5f); 54 setwet(initialwet); 55 setroomsize(initialroom); 56 setdry(initialdry); 57 setdamp(initialdamp); 58 setwidth(initialwidth); 59 setmode(initialmode); 60 61 // Buffer will be full of rubbish - so we MUST mute them 62 mute(); 63 63 } 64 64 65 65 void revmodel::mute() 66 66 { 67 int i;68 if (getmode() >= freezemode)69 return;70 71 for (i = 0 ; i < numcombs ; i++)72 {73 combL[i].mute();74 combR[i].mute();75 }76 for (i=0;i<numallpasses;i++)77 {78 allpassL[i].mute();79 allpassR[i].mute();80 }67 int i; 68 if (getmode() >= freezemode) 69 return; 70 71 for (i = 0 ; i < numcombs ; i++) 72 { 73 combL[i].mute(); 74 combR[i].mute(); 75 } 76 for (i=0;i<numallpasses;i++) 77 { 78 allpassL[i].mute(); 79 allpassR[i].mute(); 80 } 81 81 } 82 82 83 83 void revmodel::processreplace(float *inputL, float *outputL, long numsamples, int skip) 84 84 { 85 float outL,outR,input;86 float inputR;87 int i;88 89 outL = outR = 0;90 if (skip > 1) 85 float outL,outR,input; 86 float inputR; 87 int i; 88 89 outL = outR = 0; 90 if (skip > 1) 91 91 inputR = inputL[1]; 92 else 93 inputR = inputL[0]; 94 input = (inputL[0] + inputR) * gain;95 96 // Accumulate comb filters in parallel97 for(i=0; i<numcombs; i++)98 {99 outL += combL[i].process(input);100 outR += combR[i].process(input);101 }102 103 // Feed through allpasses in series104 for(i=0; i<numallpasses; i++)105 {106 outL = allpassL[i].process(outL);107 outR = allpassR[i].process(outR);108 }109 110 // Calculate output REPLACING anything already there111 outputL[0] = (outL*wet1 + outR*wet2 + inputR*dry);92 else 93 inputR = inputL[0]; 94 input = (inputL[0] + inputR) * gain; 95 96 // Accumulate comb filters in parallel 97 for(i=0; i<numcombs; i++) 98 { 99 outL += combL[i].process(input); 100 outR += combR[i].process(input); 101 } 102 103 // Feed through allpasses in series 104 for(i=0; i<numallpasses; i++) 105 { 106 outL = allpassL[i].process(outL); 107 outR = allpassR[i].process(outR); 108 } 109 110 // Calculate output REPLACING anything already there 111 outputL[0] = (outL*wet1 + outR*wet2 + inputR*dry); 112 112 if (skip > 1) 113 outputL[1] = (outR*wet1 + outL*wet2 + inputR*dry);113 outputL[1] = (outR*wet1 + outL*wet2 + inputR*dry); 114 114 } 115 115 116 116 void revmodel::processmix(float *inputL, float *outputL, long numsamples, int skip) 117 117 { 118 float outL,outR,input;119 float inputR;120 int i;121 122 outL = outR = 0;123 if (skip > 1) 118 float outL,outR,input; 119 float inputR; 120 int i; 121 122 outL = outR = 0; 123 if (skip > 1) 124 124 inputR = inputL[1]; 125 else 126 inputR = inputL[0]; 127 input = (inputL[0] + inputR) * gain;128 129 // Accumulate comb filters in parallel130 for(i=0; i<numcombs; i++)131 {132 outL += combL[i].process(input);133 outR += combR[i].process(input);134 }135 136 // Feed through allpasses in series137 for(i=0; i<numallpasses; i++)138 {139 outL = allpassL[i].process(outL);140 outR = allpassR[i].process(outR);141 }142 143 // Calculate output REPLACING anything already there144 outputL[0] += (outL*wet1 + outR*wet2 + inputR*dry);125 else 126 inputR = inputL[0]; 127 input = (inputL[0] + inputR) * gain; 128 129 // Accumulate comb filters in parallel 130 for(i=0; i<numcombs; i++) 131 { 132 outL += combL[i].process(input); 133 outR += combR[i].process(input); 134 } 135 136 // Feed through allpasses in series 137 for(i=0; i<numallpasses; i++) 138 { 139 outL = allpassL[i].process(outL); 140 outR = allpassR[i].process(outR); 141 } 142 143 // Calculate output REPLACING anything already there 144 outputL[0] += (outL*wet1 + outR*wet2 + inputR*dry); 145 145 if (skip > 1) 146 outputL[1] += (outR*wet1 + outL*wet2 + inputR*dry);146 outputL[1] += (outR*wet1 + outL*wet2 + inputR*dry); 147 147 } 148 148 … … 151 151 // Recalculate internal values after parameter change 152 152 153 int i;154 155 wet1 = wet*(width/2 + 0.5f);156 wet2 = wet*((1-width)/2);157 158 if (mode >= freezemode)159 {160 roomsize1 = 1;161 damp1 = 0;162 gain = muted;163 }164 else165 {166 roomsize1 = roomsize;167 damp1 = damp;168 gain = fixedgain;169 }170 171 for(i=0; i<numcombs; i++)172 {173 combL[i].setfeedback(roomsize1);174 combR[i].setfeedback(roomsize1);175 }176 177 for(i=0; i<numcombs; i++)178 {179 combL[i].setdamp(damp1);180 combR[i].setdamp(damp1);181 }153 int i; 154 155 wet1 = wet*(width/2 + 0.5f); 156 wet2 = wet*((1-width)/2); 157 158 if (mode >= freezemode) 159 { 160 roomsize1 = 1; 161 damp1 = 0; 162 gain = muted; 163 } 164 else 165 { 166 roomsize1 = roomsize; 167 damp1 = damp; 168 gain = fixedgain; 169 } 170 171 for(i=0; i<numcombs; i++) 172 { 173 combL[i].setfeedback(roomsize1); 174 combR[i].setfeedback(roomsize1); 175 } 176 177 for(i=0; i<numcombs; i++) 178 { 179 combL[i].setdamp(damp1); 180 combR[i].setdamp(damp1); 181 } 182 182 } 183 183 … … 189 189 void revmodel::setroomsize(float value) 190 190 { 191 roomsize = (value*scaleroom) + offsetroom;192 update();191 roomsize = (value*scaleroom) + offsetroom; 192 update(); 193 193 } 194 194 195 195 float revmodel::getroomsize() 196 196 { 197 return (roomsize-offsetroom)/scaleroom;197 return (roomsize-offsetroom)/scaleroom; 198 198 } 199 199 200 200 void revmodel::setdamp(float value) 201 201 { 202 damp = value*scaledamp;203 update();202 damp = value*scaledamp; 203 update(); 204 204 } 205 205 206 206 float revmodel::getdamp() 207 207 { 208 return damp/scaledamp;208 return damp/scaledamp; 209 209 } 210 210 211 211 void revmodel::setwet(float value) 212 212 { 213 wet = value*scalewet;214 update();213 wet = value*scalewet; 214 update(); 215 215 } 216 216 217 217 float revmodel::getwet() 218 218 { 219 return wet/scalewet;219 return wet/scalewet; 220 220 } 221 221 222 222 void revmodel::setdry(float value) 223 223 { 224 dry = value*scaledry;224 dry = value*scaledry; 225 225 } 226 226 227 227 float revmodel::getdry() 228 228 { 229 return dry/scaledry;229 return dry/scaledry; 230 230 } 231 231 232 232 void revmodel::setwidth(float value) 233 233 { 234 width = value;235 update();234 width = value; 235 update(); 236 236 } 237 237 238 238 float revmodel::getwidth() 239 239 { 240 return width;240 return width; 241 241 } 242 242 243 243 void revmodel::setmode(float value) 244 244 { 245 mode = value;246 update();245 mode = value; 246 update(); 247 247 } 248 248 249 249 float revmodel::getmode() 250 250 { 251 if (mode >= freezemode)252 return 1;253 else254 return 0;251 if (mode >= freezemode) 252 return 1; 253 else 254 return 0; 255 255 } 256 256 modules/audio_filter/spatializer/revmodel.hpp
rc701929 rd034ab5 2 2 // 3 3 // Google Summer of Code 2007 4 // 5 // Authors: Biodun Osunkunle <biodun@videolan.org> 6 // 4 // 5 // Authors: Biodun Osunkunle <biodun@videolan.org> 6 // 7 7 // Mentor : Jean-Baptiste Kempf <jb@videolan.org> 8 8 // … … 19 19 { 20 20 public: 21 revmodel();22 voidmute();23 voidprocessreplace(float *inputL, float *outputL, long numsamples, int skip);24 void processmix(float *inputL, float *outputL, long numsamples, int skip);25 voidsetroomsize(float value);26 floatgetroomsize();27 voidsetdamp(float value);28 floatgetdamp();29 voidsetwet(float value);30 floatgetwet();31 voidsetdry(float value);32 floatgetdry();33 voidsetwidth(float value);34 floatgetwidth();35 voidsetmode(float value);36 floatgetmode();21 revmodel(); 22 void mute(); 23 void processreplace(float *inputL, float *outputL, long numsamples, int skip); 24 void processmix(float *inputL, float *outputL, long numsamples, int skip); 25 void setroomsize(float value); 26 float getroomsize(); 27 void setdamp(float value); 28 float getdamp(); 29 void setwet(float value); 30 float getwet(); 31 void setdry(float value); 32 float getdry(); 33 void setwidth(float value); 34 float getwidth(); 35 void setmode(float value); 36 float getmode(); 37 37 private: 38 voidupdate();38 void update(); 39 39 private: 40 floatgain;41 floatroomsize,roomsize1;42 floatdamp,damp1;43 floatwet,wet1,wet2;44 floatdry;45 floatwidth;46 floatmode;40 float gain; 41 float roomsize,roomsize1; 42 float damp,damp1; 43 float wet,wet1,wet2; 44 float dry; 45 float width; 46 float mode; 47 47 48 // The following are all declared inline 48 // The following are all declared inline 49 49 // to remove the need for dynamic allocation 50 50 // with its subsequent error-checking messiness 51 51 52 52 // Comb filters 53 combcombL[numcombs];54 combcombR[numcombs];53 comb combL[numcombs]; 54 comb combR[numcombs]; 55 55 56 // Allpass filters57 allpassallpassL[numallpasses];58 allpassallpassR[numallpasses];56 // Allpass filters 57 allpass allpassL[numallpasses]; 58 allpass allpassR[numallpasses]; 59 59 60 // Buffers for the combs61 floatbufcombL1[combtuningL1];62 floatbufcombR1[combtuningR1];63 floatbufcombL2[combtuningL2];64 floatbufcombR2[combtuningR2];65 floatbufcombL3[combtuningL3];66 floatbufcombR3[combtuningR3];67 floatbufcombL4[combtuningL4];68 floatbufcombR4[combtuningR4];69 floatbufcombL5[combtuningL5];70 floatbufcombR5[combtuningR5];71 floatbufcombL6[combtuningL6];72 floatbufcombR6[combtuningR6];73 floatbufcombL7[combtuningL7];74 floatbufcombR7[combtuningR7];75 floatbufcombL8[combtuningL8];76 floatbufcombR8[combtuningR8];60 // Buffers for the combs 61 float bufcombL1[combtuningL1]; 62 float bufcombR1[combtuningR1]; 63 float bufcombL2[combtuningL2]; 64 float bufcombR2[combtuningR2]; 65 float bufcombL3[combtuningL3]; 66 float bufcombR3[combtuningR3]; 67 float bufcombL4[combtuningL4]; 68 float bufcombR4[combtuningR4]; 69 float bufcombL5[combtuningL5]; 70 float bufcombR5[combtuningR5]; 71 float bufcombL6[combtuningL6]; 72 float bufcombR6[combtuningR6]; 73 float bufcombL7[combtuningL7]; 74 float bufcombR7[combtuningR7]; 75 float bufcombL8[combtuningL8]; 76 float bufcombR8[combtuningR8]; 77 77 78 // Buffers for the allpasses79 floatbufallpassL1[allpasstuningL1];80 floatbufallpassR1[allpasstuningR1];81 floatbufallpassL2[allpasstuningL2];82 floatbufallpassR2[allpasstuningR2];83 floatbufallpassL3[allpasstuningL3];84 floatbufallpassR3[allpasstuningR3];85 floatbufallpassL4[allpasstuningL4];86 floatbufallpassR4[allpasstuningR4];78 // Buffers for the allpasses 79 float bufallpassL1[allpasstuningL1]; 80 float bufallpassR1[allpasstuningR1]; 81 float bufallpassL2[allpasstuningL2]; 82 float bufallpassR2[allpasstuningR2]; 83 float bufallpassL3[allpasstuningL3]; 84 float bufallpassR3[allpasstuningR3]; 85 float bufallpassL4[allpasstuningL4]; 86 float bufallpassR4[allpasstuningR4]; 87 87 }; 88 88 modules/audio_filter/spatializer/spatializer.cpp
rc701929 rd034ab5 3 3 ***************************************************************************** 4 4 * Copyright (C) 2004, 2006, 2007 the VideoLAN team 5 * 5 * 6 6 * Google Summer of Code 2007 7 * 8 * Authors: Biodun Osunkunle <biodun@videolan.org> 9 * 7 * 8 * Authors: Biodun Osunkunle <biodun@videolan.org> 9 * 10 10 * Mentor : Jean-Baptiste Kempf <jb@videolan.org> 11 11 * … … 64 64 /* reverb static config */ 65 65 vlc_bool_t b_first; 66 66 67 67 } aout_filter_sys_t; 68 68 69 69 static revmodel reverbm; 70 70 71 71 static const char *psz_control_names[] = 72 72 { … … 89 89 vlc_value_t, vlc_value_t, void * ); 90 90 static int WidthCallback ( vlc_object_t *, char const *, 91 vlc_value_t, vlc_value_t, void * ); 91 vlc_value_t, vlc_value_t, void * ); 92 92 93 /***************************************************************************** 93 94 * Open: … … 123 124 p_filter->pf_do_work = DoWork; 124 125 p_filter->b_in_place = VLC_TRUE; 125 126 /* Allocate structure */ 126 127 /* Allocate structure */ 127 128 p_sys = p_filter->p_sys = (aout_filter_sys_t*)malloc( sizeof( aout_filter_sys_t ) ); 128 129 reverbm.setroomsize(1.05); … … 132 133 reverbm.setwidth(0.9); 133 134 SpatInit( p_filter); 134 135 135 136 return VLC_SUCCESS; 136 137 } … … 139 140 * Close: close the plugin 140 141 *****************************************************************************/ 141 static void Close( vlc_object_t *p_this ) 142 static void Close( vlc_object_t *p_this ) 142 143 { 143 144 aout_filter_t *p_filter = (aout_filter_t *)p_this; … … 170 171 vlc_value_t val1, val2, val3, val4, val5; 171 172 aout_instance_t *p_aout = (aout_instance_t *)p_filter->p_parent; 172 173 173 174 for( int i = 0; i < 5 ; i ++ ) 174 175 { … … 196 197 var_AddCallback( p_aout, psz_control_names[3], DryCallback, p_sys ); 197 198 var_AddCallback( p_aout, psz_control_names[4], DampCallback, p_sys ); 198 199 199 200 return VLC_SUCCESS; 200 201 } … … 211 212 in[ch] = in[ch] * SPAT_AMP; 212 213 } 213 reverbm.processreplace( in, out , 1, i_channels);214 reverbm.processreplace( in, out , 1, i_channels); 214 215 in += i_channels; 215 216 out += i_channels; … … 237 238 vlc_value_t oldval, vlc_value_t newval, void *p_data ) 238 239 { 239 msg_Dbg (p_this,"room callback %3.1f %s %s %d\n", newval.f_float, __FILE__,__func__,__LINE__); 240 msg_Dbg (p_this,"room callback %3.1f %s %s %d\n", newval.f_float, __FILE__,__func__,__LINE__); 240 241 reverbm.setroomsize(newval.f_float); 241 242 return VLC_SUCCESS; modules/audio_filter/spatializer/tuning.h
rc701929 rd034ab5 8 8 #define _tuning_ 9 9 10 const int numcombs = 8;11 const int numallpasses = 4;12 const float muted = 0;13 const float fixedgain = 0.005f;14 const float scalewet = 3;15 const float scaledry = 2;16 const float scaledamp = 0.4f;17 const float scaleroom = 0.28f;18 const float offsetroom = 0.7f;19 const float initialroom = 0.5f;20 const float initialdamp = 0.5f;21 const float initialwet = 1/scalewet;22 const float initialdry = 0;23 const float initialwidth = 1;24 const float initialmode = 0;25 const float freezemode = 0.5f;26 const int stereospread = 23;10 const int numcombs = 8; 11 const int numallpasses = 4; 12 const float muted = 0; 13 const float fixedgain = 0.005f; 14 const float scalewet = 3; 15 const float scaledry = 2; 16 const float scaledamp = 0.4f; 17 const float scaleroom = 0.28f; 18 const float offsetroom = 0.7f; 19 const float initialroom = 0.5f; 20 const float initialdamp = 0.5f; 21 const float initialwet = 1/scalewet; 22 const float initialdry = 0; 23 const float initialwidth = 1; 24 const float initialmode = 0; 25 const float freezemode = 0.5f; 26 const int stereospread = 23; 27 27 28 28 // These values assume 44.1KHz sample rate … … 30 30 // but would need scaling for 96KHz (or other) sample rates. 31 31 // The values were obtained by listening tests. 32 const int combtuningL1 = 1116;33 const int combtuningR1 = 1116+stereospread;34 const int combtuningL2 = 1188;35 const int combtuningR2 = 1188+stereospread;36 const int combtuningL3 = 1277;37 const int combtuningR3 = 1277+stereospread;38 const int combtuningL4 = 1356;39 const int combtuningR4 = 1356+stereospread;40 const int combtuningL5 = 1422;41 const int combtuningR5 = 1422+stereospread;42 const int combtuningL6 = 1491;43 const int combtuningR6 = 1491+stereospread;44 const int combtuningL7 = 1557;45 const int combtuningR7 = 1557+stereospread;46 const int combtuningL8 = 1617;47 const int combtuningR8 = 1617+stereospread;48 const int allpasstuningL1 = 556;49 const int allpasstuningR1 = 556+stereospread;50 const int allpasstuningL2 = 441;51 const int allpasstuningR2 = 441+stereospread;52 const int allpasstuningL3 = 341;53 const int allpasstuningR3 = 341+stereospread;54 const int allpasstuningL4 = 225;55 const int allpasstuningR4 = 225+stereospread;32 const int combtuningL1 = 1116; 33 const int combtuningR1 = 1116+stereospread; 34 const int combtuningL2 = 1188; 35 const int combtuningR2 = 1188+stereospread; 36 const int combtuningL3 = 1277; 37 const int combtuningR3 = 1277+stereospread; 38 const int combtuningL4 = 1356; 39 const int combtuningR4 = 1356+stereospread; 40 const int combtuningL5 = 1422; 41 const int combtuningR5 = 1422+stereospread; 42 const int combtuningL6 = 1491; 43 const int combtuningR6 = 1491+stereospread; 44 const int combtuningL7 = 1557; 45 const int combtuningR7 = 1557+stereospread; 46 const int combtuningL8 = 1617; 47 const int combtuningR8 = 1617+stereospread; 48 const int allpasstuningL1 = 556; 49 const int allpasstuningR1 = 556+stereospread; 50 const int allpasstuningL2 = 441; 51 const int allpasstuningR2 = 441+stereospread; 52 const int allpasstuningL3 = 341; 53 const int allpasstuningR3 = 341+stereospread; 54 const int allpasstuningL4 = 225; 55 const int allpasstuningR4 = 225+stereospread; 56 56 57 57 #endif//_tuning_
