| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 class AudioChannel; | 44 class AudioChannel; |
| 45 class WebThread; | 45 class WebThread; |
| 46 | 46 |
| 47 class PLATFORM_EXPORT ReverbConvolver { | 47 class PLATFORM_EXPORT ReverbConvolver { |
| 48 WTF_MAKE_NONCOPYABLE(ReverbConvolver); | 48 WTF_MAKE_NONCOPYABLE(ReverbConvolver); |
| 49 public: | 49 public: |
| 50 // maxFFTSize can be adjusted (from say 2048 to 32768) depending on how much
precision is necessary. | 50 // maxFFTSize can be adjusted (from say 2048 to 32768) depending on how much
precision is necessary. |
| 51 // For certain tweaky de-convolving applications the phase errors add up qui
ckly and lead to non-sensical results with | 51 // For certain tweaky de-convolving applications the phase errors add up qui
ckly and lead to non-sensical results with |
| 52 // larger FFT sizes and single-precision floats. In these cases 2048 is a g
ood size. | 52 // larger FFT sizes and single-precision floats. In these cases 2048 is a g
ood size. |
| 53 // If not doing multi-threaded convolution, then should not go > 8192. | 53 // If not doing multi-threaded convolution, then should not go > 8192. |
| 54 ReverbConvolver(AudioChannel* impulseResponse, size_t renderSliceSize, size_
t maxFFTSize, size_t convolverRenderPhase, bool useBackgroundThreads); | 54 ReverbConvolver(AudioChannel* impulseResponse, size_t renderSliceSize, size_
t maxFFTSize, size_t convolverRenderPhase, bool hasRealtimeConstraint); |
| 55 ~ReverbConvolver(); | 55 ~ReverbConvolver(); |
| 56 | 56 |
| 57 void process(const AudioChannel* sourceChannel, AudioChannel* destinationCha
nnel, size_t framesToProcess); | 57 void process(const AudioChannel* sourceChannel, AudioChannel* destinationCha
nnel, size_t framesToProcess); |
| 58 void reset(); | 58 void reset(); |
| 59 | 59 |
| 60 ReverbInputBuffer* inputBuffer() { return &m_inputBuffer; } | 60 ReverbInputBuffer* inputBuffer() { return &m_inputBuffer; } |
| 61 | 61 |
| 62 size_t latencyFrames() const; | 62 size_t latencyFrames() const; |
| 63 private: | 63 private: |
| 64 void processInBackground(); | 64 void processInBackground(); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 79 // But don't exceed this size in the real-time thread (if we're doing backgr
ound processing). | 79 // But don't exceed this size in the real-time thread (if we're doing backgr
ound processing). |
| 80 size_t m_maxRealtimeFFTSize; | 80 size_t m_maxRealtimeFFTSize; |
| 81 | 81 |
| 82 // Background thread and synchronization | 82 // Background thread and synchronization |
| 83 OwnPtr<WebThread> m_backgroundThread; | 83 OwnPtr<WebThread> m_backgroundThread; |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 } // namespace blink | 86 } // namespace blink |
| 87 | 87 |
| 88 #endif // ReverbConvolver_h | 88 #endif // ReverbConvolver_h |
| OLD | NEW |