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 30 matching lines...) Expand all Loading... |
41 #endif | 41 #endif |
42 | 42 |
43 namespace WebCore { | 43 namespace WebCore { |
44 | 44 |
45 const int kBufferSize = 1024; | 45 const int kBufferSize = 1024; |
46 | 46 |
47 Biquad::Biquad() | 47 Biquad::Biquad() |
48 { | 48 { |
49 #if OS(DARWIN) | 49 #if OS(DARWIN) |
50 // Allocate two samples more for filter history | 50 // Allocate two samples more for filter history |
51 m_inputBuffer.resize(kBufferSize + 2); | 51 m_inputBuffer.allocate(kBufferSize + 2); |
52 m_outputBuffer.resize(kBufferSize + 2); | 52 m_outputBuffer.allocate(kBufferSize + 2); |
53 #endif | 53 #endif |
54 | 54 |
55 // Initialize as pass-thru (straight-wire, no filter effect) | 55 // Initialize as pass-thru (straight-wire, no filter effect) |
56 m_b0 = 1; | 56 m_b0 = 1; |
57 m_b1 = 0; | 57 m_b1 = 0; |
58 m_b2 = 0; | 58 m_b2 = 0; |
59 m_a1 = 0; | 59 m_a1 = 0; |
60 m_a2 = 0; | 60 m_a2 = 0; |
61 | 61 |
62 reset(); // clear filter memory | 62 reset(); // clear filter memory |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 | 369 |
370 void Biquad::setAllpassPole(const Complex &pole) | 370 void Biquad::setAllpassPole(const Complex &pole) |
371 { | 371 { |
372 Complex zero = Complex(1, 0) / pole; | 372 Complex zero = Complex(1, 0) / pole; |
373 setZeroPolePairs(zero, pole); | 373 setZeroPolePairs(zero, pole); |
374 } | 374 } |
375 | 375 |
376 } // namespace WebCore | 376 } // namespace WebCore |
377 | 377 |
378 #endif // ENABLE(WEB_AUDIO) | 378 #endif // ENABLE(WEB_AUDIO) |
OLD | NEW |