Changeset 104308 in webkit
- Timestamp:
- Jan 6, 2012 11:51:19 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r104306 r104308 1 2012-01-06 Wei James <james.wei@intel.com> 2 3 Use VectorMath lib when possible to optimize the processing in WebAudio AudioBus 4 https://bugs.webkit.org/show_bug.cgi?id=75334 5 6 Reviewed by Kenneth Russell. 7 8 * platform/audio/AudioBus.cpp: 9 (WebCore::AudioBus::processWithGainFromMonoStereo): 10 1 11 2012-01-06 Jer Noble <jer.noble@apple.com> 2 12 -
trunk/Source/WebCore/platform/audio/AudioBus.cpp
r102888 r104308 245 245 } \ 246 246 gain = totalDesiredGain; \ 247 for (; k < framesToProcess; ++k) \ 248 OP 247 OP##_V 249 248 250 249 #define STEREO_SUM \ … … 255 254 *destinationR++ = sumR; \ 256 255 } 256 257 // FIXME: this can be optimized with additional VectorMath functions. 258 #define STEREO_SUM_V \ 259 for (; k < framesToProcess; ++k) \ 260 STEREO_SUM 257 261 258 262 // Mono -> stereo (mix equally into L and R) … … 267 271 } 268 272 273 #define MONO2STEREO_SUM_V \ 274 for (; k < framesToProcess; ++k) \ 275 MONO2STEREO_SUM 276 269 277 #define MONO_SUM \ 270 278 { \ … … 272 280 *destinationL++ = sum; \ 273 281 } 282 283 #define MONO_SUM_V \ 284 for (; k < framesToProcess; ++k) \ 285 MONO_SUM 274 286 275 287 #define STEREO_NO_SUM \ … … 281 293 } 282 294 295 #define STEREO_NO_SUM_V \ 296 { \ 297 vsmul(sourceL, 1, &gain, destinationL, 1, framesToProcess - k); \ 298 vsmul(sourceR, 1, &gain, destinationR, 1, framesToProcess - k); \ 299 } 300 283 301 // Mono -> stereo (mix equally into L and R) 284 302 // FIXME: Really we should apply an equal-power scaling factor here, since we're effectively panning center... … … 290 308 } 291 309 310 #define MONO2STEREO_NO_SUM_V \ 311 { \ 312 vsmul(sourceL, 1, &gain, destinationL, 1, framesToProcess - k); \ 313 vsmul(sourceL, 1, &gain, destinationR, 1, framesToProcess - k); \ 314 } 315 292 316 #define MONO_NO_SUM \ 293 317 { \ … … 296 320 } 297 321 322 #define MONO_NO_SUM_V \ 323 { \ 324 vsmul(sourceL, 1, &gain, destinationL, 1, framesToProcess - k); \ 325 } 326 298 327 void AudioBus::processWithGainFromMonoStereo(const AudioBus &sourceBus, double* lastMixGain, double targetGain, bool sumToBus) 299 328 { … … 301 330 // so we "de-zipper" by slowly changing the gain each sample-frame until we've achieved the target gain. 302 331 303 // FIXME: optimize this method (SSE, etc.)304 332 // FIXME: targetGain and lastMixGain should be changed to floats instead of doubles. 305 333 … … 352 380 return; 353 381 354 // FIXME: if (framesToDezipper == 0) and DenormalDisabler::flushDenormalFloatToZero() is a NOP (gcc vs. Visual Studio)355 // then we can further optimize the PROCESS_WITH_GAIN codepaths below using vsmul().356 382 if (sourceR && destinationR) { 357 383 // Stereo
Note: See TracChangeset
for help on using the changeset viewer.