| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Intel Inc. All rights reserved. | 2 * Copyright (C) 2012 Intel Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 | 83 |
| 84 vadd(outputBuffer, 1, overlayBuffer, 1, destP, 1, framesToProcess); | 84 vadd(outputBuffer, 1, overlayBuffer, 1, destP, 1, framesToProcess); |
| 85 memcpy(overlayBuffer, outputBuffer + m_inputBlockSize, sizeof(float) * kerne
lSize); | 85 memcpy(overlayBuffer, outputBuffer + m_inputBlockSize, sizeof(float) * kerne
lSize); |
| 86 #else | 86 #else |
| 87 float* inputP = m_buffer.data() + m_inputBlockSize; | 87 float* inputP = m_buffer.data() + m_inputBlockSize; |
| 88 | 88 |
| 89 // Copy samples to 2nd half of input buffer. | 89 // Copy samples to 2nd half of input buffer. |
| 90 memcpy(inputP, sourceP, sizeof(float) * framesToProcess); | 90 memcpy(inputP, sourceP, sizeof(float) * framesToProcess); |
| 91 | 91 |
| 92 #if OS(MACOSX) | 92 #if OS(MACOSX) |
| 93 #if defined(__ppc__) || defined(__i386__) | 93 #if defined(__i386__) |
| 94 conv(inputP - kernelSize + 1, 1, kernelP + kernelSize - 1, -1, destP, 1, fra
mesToProcess, kernelSize); | 94 conv(inputP - kernelSize + 1, 1, kernelP + kernelSize - 1, -1, destP, 1, fra
mesToProcess, kernelSize); |
| 95 #else | 95 #else |
| 96 vDSP_conv(inputP - kernelSize + 1, 1, kernelP + kernelSize - 1, -1, destP, 1
, framesToProcess, kernelSize); | 96 vDSP_conv(inputP - kernelSize + 1, 1, kernelP + kernelSize - 1, -1, destP, 1
, framesToProcess, kernelSize); |
| 97 #endif // defined(__ppc__) || defined(__i386__) | 97 #endif // defined(__i386__) |
| 98 #else | 98 #else |
| 99 // FIXME: The macro can be further optimized to avoid pipeline stalls. One p
ossibility is to maintain 4 separate sums and change the macro to CONVOLVE_FOUR_
SAMPLES. | 99 // FIXME: The macro can be further optimized to avoid pipeline stalls. One p
ossibility is to maintain 4 separate sums and change the macro to CONVOLVE_FOUR_
SAMPLES. |
| 100 #define CONVOLVE_ONE_SAMPLE \ | 100 #define CONVOLVE_ONE_SAMPLE \ |
| 101 sum += inputP[i - j] * kernelP[j]; \ | 101 sum += inputP[i - j] * kernelP[j]; \ |
| 102 j++; | 102 j++; |
| 103 | 103 |
| 104 size_t i = 0; | 104 size_t i = 0; |
| 105 while (i < framesToProcess) { | 105 while (i < framesToProcess) { |
| 106 size_t j = 0; | 106 size_t j = 0; |
| 107 float sum = 0; | 107 float sum = 0; |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 { | 376 { |
| 377 m_buffer.zero(); | 377 m_buffer.zero(); |
| 378 #if USE(WEBAUDIO_IPP) | 378 #if USE(WEBAUDIO_IPP) |
| 379 m_overlayBuffer.zero(); | 379 m_overlayBuffer.zero(); |
| 380 #endif // USE(WEBAUDIO_IPP) | 380 #endif // USE(WEBAUDIO_IPP) |
| 381 } | 381 } |
| 382 | 382 |
| 383 } // namespace WebCore | 383 } // namespace WebCore |
| 384 | 384 |
| 385 #endif // ENABLE(WEB_AUDIO) | 385 #endif // ENABLE(WEB_AUDIO) |
| OLD | NEW |