Commit 8d81700
committed
plugin: Directly output resampled frames to host within Resample_f32()
In my resample procedure, Resample_f32() will finally output the same
amount of frames as the buffer size. So why not directly specify host
audio buffer as Resample_f32()'s argument "output"?
By directly writing to final audio buffer, intermediate buffers are
no longer required. So I dropped `buffer_after_resample(l|r)`. Time for
copying sample frames is also saved, as the final for-loop is also no
longer needed.
For sanity check, in Resample_f32(), I added a new parameter
`maxOutputSize`, which acts like strncpy() and snprintf(). Just in case
the output buffer size is larger than audio buffer size.1 parent fd07b44 commit 8d81700
File tree
4 files changed
+7
-19
lines changed- plugin
- vendor/resampler
4 files changed
+7
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
| 134 | + | |
| 135 | + | |
143 | 136 | | |
144 | 137 | | |
145 | 138 | | |
| |||
171 | 164 | | |
172 | 165 | | |
173 | 166 | | |
174 | | - | |
175 | | - | |
176 | 167 | | |
177 | 168 | | |
178 | 169 | | |
179 | 170 | | |
180 | 171 | | |
181 | 172 | | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | 173 | | |
186 | 174 | | |
187 | 175 | | |
188 | 176 | | |
189 | 177 | | |
190 | 178 | | |
191 | | - | |
192 | | - | |
193 | 179 | | |
194 | 180 | | |
195 | 181 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | 27 | | |
29 | 28 | | |
30 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
60 | 63 | | |
61 | 64 | | |
62 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
0 commit comments