OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 18 matching lines...) Expand all Loading... |
29 */ | 29 */ |
30 | 30 |
31 #ifndef DownSampler_h | 31 #ifndef DownSampler_h |
32 #define DownSampler_h | 32 #define DownSampler_h |
33 | 33 |
34 #include "platform/audio/AudioArray.h" | 34 #include "platform/audio/AudioArray.h" |
35 #include "platform/audio/DirectConvolver.h" | 35 #include "platform/audio/DirectConvolver.h" |
36 #include "wtf/Allocator.h" | 36 #include "wtf/Allocator.h" |
37 #include "wtf/Noncopyable.h" | 37 #include "wtf/Noncopyable.h" |
38 | 38 |
39 #if ENABLE(WEB_AUDIO) | |
40 | |
41 namespace blink { | 39 namespace blink { |
42 | 40 |
43 // DownSampler down-samples the source stream by a factor of 2x. | 41 // DownSampler down-samples the source stream by a factor of 2x. |
44 | 42 |
45 class PLATFORM_EXPORT DownSampler { | 43 class PLATFORM_EXPORT DownSampler { |
46 USING_FAST_MALLOC(DownSampler); | 44 USING_FAST_MALLOC(DownSampler); |
47 WTF_MAKE_NONCOPYABLE(DownSampler); | 45 WTF_MAKE_NONCOPYABLE(DownSampler); |
48 public: | 46 public: |
49 DownSampler(size_t inputBlockSize); | 47 DownSampler(size_t inputBlockSize); |
50 | 48 |
(...skipping 19 matching lines...) Expand all Loading... |
70 DirectConvolver m_convolver; | 68 DirectConvolver m_convolver; |
71 | 69 |
72 AudioFloatArray m_tempBuffer; | 70 AudioFloatArray m_tempBuffer; |
73 | 71 |
74 // Used as delay-line (FIR filter history) for the input samples to account
for the 0.5 term right in the middle of the kernel. | 72 // Used as delay-line (FIR filter history) for the input samples to account
for the 0.5 term right in the middle of the kernel. |
75 AudioFloatArray m_inputBuffer; | 73 AudioFloatArray m_inputBuffer; |
76 }; | 74 }; |
77 | 75 |
78 } // namespace blink | 76 } // namespace blink |
79 | 77 |
80 #endif // ENABLE(WEB_AUDIO) | |
81 | |
82 #endif // DownSampler_h | 78 #endif // DownSampler_h |
OLD | NEW |