OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011, Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 public: | 44 public: |
45 explicit WaveShaperDSPKernel(WaveShaperProcessor*); | 45 explicit WaveShaperDSPKernel(WaveShaperProcessor*); |
46 | 46 |
47 // AudioDSPKernel | 47 // AudioDSPKernel |
48 void Process(const float* source, | 48 void Process(const float* source, |
49 float* dest, | 49 float* dest, |
50 size_t frames_to_process) override; | 50 size_t frames_to_process) override; |
51 void Reset() override; | 51 void Reset() override; |
52 double TailTime() const override { return 0; } | 52 double TailTime() const override { return 0; } |
53 double LatencyTime() const override; | 53 double LatencyTime() const override; |
| 54 bool RequiresTailProcessing() const override; |
54 | 55 |
55 // Oversampling requires more resources, so let's only allocate them if | 56 // Oversampling requires more resources, so let's only allocate them if |
56 // needed. | 57 // needed. |
57 void LazyInitializeOversampling(); | 58 void LazyInitializeOversampling(); |
58 | 59 |
59 protected: | 60 protected: |
60 // Apply the shaping curve. | 61 // Apply the shaping curve. |
61 void ProcessCurve(const float* source, float* dest, size_t frames_to_process); | 62 void ProcessCurve(const float* source, float* dest, size_t frames_to_process); |
62 | 63 |
63 // Use up-sampling, process at the higher sample-rate, then down-sample. | 64 // Use up-sampling, process at the higher sample-rate, then down-sample. |
(...skipping 13 matching lines...) Expand all Loading... |
77 std::unique_ptr<AudioFloatArray> temp_buffer2_; | 78 std::unique_ptr<AudioFloatArray> temp_buffer2_; |
78 std::unique_ptr<UpSampler> up_sampler_; | 79 std::unique_ptr<UpSampler> up_sampler_; |
79 std::unique_ptr<DownSampler> down_sampler_; | 80 std::unique_ptr<DownSampler> down_sampler_; |
80 std::unique_ptr<UpSampler> up_sampler2_; | 81 std::unique_ptr<UpSampler> up_sampler2_; |
81 std::unique_ptr<DownSampler> down_sampler2_; | 82 std::unique_ptr<DownSampler> down_sampler2_; |
82 }; | 83 }; |
83 | 84 |
84 } // namespace blink | 85 } // namespace blink |
85 | 86 |
86 #endif // WaveShaperDSPKernel_h | 87 #endif // WaveShaperDSPKernel_h |
OLD | NEW |