| 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 // This "staggers" the time when each FFT happens so they don't all happ
en at the same time | 86 // This "staggers" the time when each FFT happens so they don't all happ
en at the same time |
| 87 int renderPhase = convolverRenderPhase + i * renderSliceSize; | 87 int renderPhase = convolverRenderPhase + i * renderSliceSize; |
| 88 | 88 |
| 89 bool useDirectConvolver = !stageOffset; | 89 bool useDirectConvolver = !stageOffset; |
| 90 | 90 |
| 91 OwnPtr<ReverbConvolverStage> stage = adoptPtr(new ReverbConvolverStage(r
esponse, totalResponseLength, reverbTotalLatency, stageOffset, stageSize, fftSiz
e, renderPhase, renderSliceSize, &m_accumulationBuffer, useDirectConvolver)); | 91 OwnPtr<ReverbConvolverStage> stage = adoptPtr(new ReverbConvolverStage(r
esponse, totalResponseLength, reverbTotalLatency, stageOffset, stageSize, fftSiz
e, renderPhase, renderSliceSize, &m_accumulationBuffer, useDirectConvolver)); |
| 92 | 92 |
| 93 bool isBackgroundStage = false; | 93 bool isBackgroundStage = false; |
| 94 | 94 |
| 95 if (useBackgroundThreads && stageOffset > RealtimeFrameLimit) { | 95 if (useBackgroundThreads && stageOffset > RealtimeFrameLimit) { |
| 96 m_backgroundStages.append(stage.release()); | 96 m_backgroundStages.append(std::move(stage)); |
| 97 isBackgroundStage = true; | 97 isBackgroundStage = true; |
| 98 } else | 98 } else { |
| 99 m_stages.append(stage.release()); | 99 m_stages.append(std::move(stage)); |
| 100 } |
| 100 | 101 |
| 101 stageOffset += stageSize; | 102 stageOffset += stageSize; |
| 102 ++i; | 103 ++i; |
| 103 | 104 |
| 104 if (!useDirectConvolver) { | 105 if (!useDirectConvolver) { |
| 105 // Figure out next FFT size | 106 // Figure out next FFT size |
| 106 fftSize *= 2; | 107 fftSize *= 2; |
| 107 } | 108 } |
| 108 | 109 |
| 109 if (useBackgroundThreads && !isBackgroundStage && fftSize > m_maxRealtim
eFFTSize) | 110 if (useBackgroundThreads && !isBackgroundStage && fftSize > m_maxRealtim
eFFTSize) |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 m_accumulationBuffer.reset(); | 184 m_accumulationBuffer.reset(); |
| 184 m_inputBuffer.reset(); | 185 m_inputBuffer.reset(); |
| 185 } | 186 } |
| 186 | 187 |
| 187 size_t ReverbConvolver::latencyFrames() const | 188 size_t ReverbConvolver::latencyFrames() const |
| 188 { | 189 { |
| 189 return 0; | 190 return 0; |
| 190 } | 191 } |
| 191 | 192 |
| 192 } // namespace blink | 193 } // namespace blink |
| OLD | NEW |