| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 } | 217 } |
| 218 | 218 |
| 219 // Clear packed-nyquist and any DC-offset. | 219 // Clear packed-nyquist and any DC-offset. |
| 220 realP[0] = 0; | 220 realP[0] = 0; |
| 221 imagP[0] = 0; | 221 imagP[0] = 0; |
| 222 | 222 |
| 223 // Create the band-limited table. | 223 // Create the band-limited table. |
| 224 unsigned waveSize = periodicWaveSize(); | 224 unsigned waveSize = periodicWaveSize(); |
| 225 OwnPtr<AudioFloatArray> table = adoptPtr(new AudioFloatArray(waveSize)); | 225 OwnPtr<AudioFloatArray> table = adoptPtr(new AudioFloatArray(waveSize)); |
| 226 adjustV8ExternalMemory(waveSize * sizeof(float)); | 226 adjustV8ExternalMemory(waveSize * sizeof(float)); |
| 227 m_bandLimitedTables.append(table.release()); | 227 m_bandLimitedTables.append(std::move(table)); |
| 228 | 228 |
| 229 // Apply an inverse FFT to generate the time-domain table data. | 229 // Apply an inverse FFT to generate the time-domain table data. |
| 230 float* data = m_bandLimitedTables[rangeIndex]->data(); | 230 float* data = m_bandLimitedTables[rangeIndex]->data(); |
| 231 frame.doInverseFFT(data); | 231 frame.doInverseFFT(data); |
| 232 | 232 |
| 233 // For the first range (which has the highest power), calculate its peak
value then compute normalization scale. | 233 // For the first range (which has the highest power), calculate its peak
value then compute normalization scale. |
| 234 if (!disableNormalization) { | 234 if (!disableNormalization) { |
| 235 if (!rangeIndex) { | 235 if (!rangeIndex) { |
| 236 float maxValue; | 236 float maxValue; |
| 237 vmaxmgv(data, 1, &maxValue, fftSize); | 237 vmaxmgv(data, 1, &maxValue, fftSize); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 | 322 |
| 323 realP[n] = 0; | 323 realP[n] = 0; |
| 324 imagP[n] = b; | 324 imagP[n] = b; |
| 325 } | 325 } |
| 326 | 326 |
| 327 createBandLimitedTables(realP, imagP, halfSize, false); | 327 createBandLimitedTables(realP, imagP, halfSize, false); |
| 328 } | 328 } |
| 329 | 329 |
| 330 } // namespace blink | 330 } // namespace blink |
| 331 | 331 |
| OLD | NEW |