| 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 static const double MaxBiquadDelayTime = 0.2; | 37 static const double MaxBiquadDelayTime = 0.2; |
| 38 | 38 |
| 39 void BiquadDSPKernel::updateCoefficientsIfNecessary(int framesToProcess) | 39 void BiquadDSPKernel::updateCoefficientsIfNecessary(int framesToProcess) |
| 40 { | 40 { |
| 41 if (getBiquadProcessor()->filterCoefficientsDirty()) { | 41 if (getBiquadProcessor()->filterCoefficientsDirty()) { |
| 42 float cutoffFrequency[AudioUtilities::kRenderQuantumFrames]; | 42 float cutoffFrequency[AudioUtilities::kRenderQuantumFrames]; |
| 43 float Q[AudioUtilities::kRenderQuantumFrames]; | 43 float Q[AudioUtilities::kRenderQuantumFrames]; |
| 44 float gain[AudioUtilities::kRenderQuantumFrames]; | 44 float gain[AudioUtilities::kRenderQuantumFrames]; |
| 45 float detune[AudioUtilities::kRenderQuantumFrames]; // in Cents | 45 float detune[AudioUtilities::kRenderQuantumFrames]; // in Cents |
| 46 | 46 |
| 47 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION( | 47 SECURITY_CHECK(static_cast<unsigned>(framesToProcess) <= AudioUtilities:
:kRenderQuantumFrames); |
| 48 static_cast<unsigned>(framesToProcess) <= AudioUtilities::kRenderQua
ntumFrames); | |
| 49 | 48 |
| 50 if (getBiquadProcessor()->hasSampleAccurateValues()) { | 49 if (getBiquadProcessor()->hasSampleAccurateValues()) { |
| 51 getBiquadProcessor()->parameter1().calculateSampleAccurateValues(cut
offFrequency, framesToProcess); | 50 getBiquadProcessor()->parameter1().calculateSampleAccurateValues(cut
offFrequency, framesToProcess); |
| 52 getBiquadProcessor()->parameter2().calculateSampleAccurateValues(Q,
framesToProcess); | 51 getBiquadProcessor()->parameter2().calculateSampleAccurateValues(Q,
framesToProcess); |
| 53 getBiquadProcessor()->parameter3().calculateSampleAccurateValues(gai
n, framesToProcess); | 52 getBiquadProcessor()->parameter3().calculateSampleAccurateValues(gai
n, framesToProcess); |
| 54 getBiquadProcessor()->parameter4().calculateSampleAccurateValues(det
une, framesToProcess); | 53 getBiquadProcessor()->parameter4().calculateSampleAccurateValues(det
une, framesToProcess); |
| 55 updateCoefficients(framesToProcess, cutoffFrequency, Q, gain, detune
); | 54 updateCoefficients(framesToProcess, cutoffFrequency, Q, gain, detune
); |
| 56 } else { | 55 } else { |
| 57 cutoffFrequency[0] = getBiquadProcessor()->parameter1().smoothedValu
e(); | 56 cutoffFrequency[0] = getBiquadProcessor()->parameter1().smoothedValu
e(); |
| 58 Q[0] = getBiquadProcessor()->parameter2().smoothedValue(); | 57 Q[0] = getBiquadProcessor()->parameter2().smoothedValue(); |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 return MaxBiquadDelayTime; | 187 return MaxBiquadDelayTime; |
| 189 } | 188 } |
| 190 | 189 |
| 191 double BiquadDSPKernel::latencyTime() const | 190 double BiquadDSPKernel::latencyTime() const |
| 192 { | 191 { |
| 193 return 0; | 192 return 0; |
| 194 } | 193 } |
| 195 | 194 |
| 196 } // namespace blink | 195 } // namespace blink |
| 197 | 196 |
| OLD | NEW |