| 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 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 | 517 |
| 518 // Number of frames to de-zipper before we are close enough to the target | 518 // Number of frames to de-zipper before we are close enough to the target |
| 519 // gain. | 519 // gain. |
| 520 // FIXME: framesToDezipper could be smaller when target gain is close enough | 520 // FIXME: framesToDezipper could be smaller when target gain is close enough |
| 521 // within this process loop. | 521 // within this process loop. |
| 522 unsigned framesToDezipper = (gainDiff < epsilon) ? 0 : framesToProcess; | 522 unsigned framesToDezipper = (gainDiff < epsilon) ? 0 : framesToProcess; |
| 523 | 523 |
| 524 if (framesToDezipper) { | 524 if (framesToDezipper) { |
| 525 if (!m_dezipperGainValues.get() || | 525 if (!m_dezipperGainValues.get() || |
| 526 m_dezipperGainValues->size() < framesToDezipper) | 526 m_dezipperGainValues->size() < framesToDezipper) |
| 527 m_dezipperGainValues = wrapUnique(new AudioFloatArray(framesToDezipper)); | 527 m_dezipperGainValues = makeUnique<AudioFloatArray>(framesToDezipper); |
| 528 | 528 |
| 529 float* gainValues = m_dezipperGainValues->data(); | 529 float* gainValues = m_dezipperGainValues->data(); |
| 530 for (unsigned i = 0; i < framesToDezipper; ++i) { | 530 for (unsigned i = 0; i < framesToDezipper; ++i) { |
| 531 gain += (totalDesiredGain - gain) * DezipperRate; | 531 gain += (totalDesiredGain - gain) * DezipperRate; |
| 532 | 532 |
| 533 // FIXME: If we are clever enough in calculating the framesToDezipper | 533 // FIXME: If we are clever enough in calculating the framesToDezipper |
| 534 // value, we can probably get rid of this | 534 // value, we can probably get rid of this |
| 535 // DenormalDisabler::flushDenormalFloatToZero() call. | 535 // DenormalDisabler::flushDenormalFloatToZero() call. |
| 536 gain = DenormalDisabler::flushDenormalFloatToZero(gain); | 536 gain = DenormalDisabler::flushDenormalFloatToZero(gain); |
| 537 *gainValues++ = gain; | 537 *gainValues++ = gain; |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 758 // If the bus needs no conversion then return as is. | 758 // If the bus needs no conversion then return as is. |
| 759 if ((!mixToMono || audioBus->numberOfChannels() == 1) && | 759 if ((!mixToMono || audioBus->numberOfChannels() == 1) && |
| 760 audioBus->sampleRate() == sampleRate) | 760 audioBus->sampleRate() == sampleRate) |
| 761 return audioBus; | 761 return audioBus; |
| 762 | 762 |
| 763 return AudioBus::createBySampleRateConverting(audioBus.get(), mixToMono, | 763 return AudioBus::createBySampleRateConverting(audioBus.get(), mixToMono, |
| 764 sampleRate); | 764 sampleRate); |
| 765 } | 765 } |
| 766 | 766 |
| 767 } // namespace blink | 767 } // namespace blink |
| OLD | NEW |