-
Notifications
You must be signed in to change notification settings - Fork 9
/
DSPProcessFreeSurround.cpp
497 lines (452 loc) · 19.6 KB
/
DSPProcessFreeSurround.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
/*
* Copyright (C) 2014-2015 Team KODI
* http://kodi.tv
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "p8-platform/util/StdString.h"
#include "addon.h"
#include "DSPProcessFreeSurround.h"
#include "FreeSurroundSettings.h"
// our default internal block size, in floats
static const unsigned default_block_size = SURROUND_BUFSIZE;
CDSPProcess_FreeSurround::CDSPProcess_FreeSurround(unsigned int streamId)
: m_StreamID(streamId)
, m_SampleRate(48000)
, m_Decoder(NULL)
, m_ProcessBufferPos(0)
, m_ProcessedSize(0)
, m_LatencyFrames(0)
{
m_InbufArray[0] = (float*)calloc(SURROUND_BUFSIZE, sizeof(float));
m_InbufArray[1] = (float*)calloc(SURROUND_BUFSIZE, sizeof(float));
}
CDSPProcess_FreeSurround::~CDSPProcess_FreeSurround()
{
free(m_InbufArray[0]);
free(m_InbufArray[1]);
Deinitialize();
}
AE_DSP_ERROR CDSPProcess_FreeSurround::StreamIsModeSupported(AE_DSP_MODE_TYPE type, unsigned int mode_id, int unique_db_mode_id)
{
return AE_DSP_ERROR_NO_ERROR;
}
AE_DSP_ERROR CDSPProcess_FreeSurround::StreamCreate(const AE_DSP_SETTINGS *settings, const AE_DSP_STREAM_PROPERTIES *pProperties)
{
if (settings->iStreamType != AE_DSP_ASTREAM_MUSIC &&
settings->iStreamType != AE_DSP_ASTREAM_MOVIE &&
settings->iStreamType != AE_DSP_ASTREAM_BASIC)
return AE_DSP_ERROR_IGNORE_ME;
if (settings->iInChannels > 2)
return AE_DSP_ERROR_IGNORE_ME;
if (settings->iOutChannels <= 3)
return AE_DSP_ERROR_IGNORE_ME;
if (settings->iProcessSamplerate > 96000)
return AE_DSP_ERROR_IGNORE_ME;
m_Settings.iStreamID = settings->iStreamID;
m_Settings.iStreamType = settings->iStreamType;
m_Settings.iInChannels = settings->iInChannels;
m_Settings.lInChannelPresentFlags = settings->lInChannelPresentFlags;
m_Settings.iOutChannels = settings->iOutChannels;
m_Settings.lOutChannelPresentFlags= settings->lOutChannelPresentFlags;
m_Settings.iInFrames = settings->iInFrames;
m_Settings.iInSamplerate = settings->iInSamplerate;
m_Settings.iProcessFrames = settings->iProcessFrames;
m_Settings.iProcessSamplerate = settings->iProcessSamplerate;
m_Settings.iOutFrames = settings->iOutFrames;
m_Settings.iOutSamplerate = settings->iOutSamplerate;
m_Settings.bStereoUpmix = settings->bStereoUpmix;
return AE_DSP_ERROR_NO_ERROR;
}
AE_DSP_ERROR CDSPProcess_FreeSurround::StreamInitialize(const AE_DSP_SETTINGS *settings)
{
m_SampleRate = settings->iProcessSamplerate;
m_LFEPresent = settings->lOutChannelPresentFlags & AE_DSP_PRSNT_CH_LFE;
m_DecoderChannelSetup = (channel_setup)(settings->lOutChannelPresentFlags | AE_DSP_PRSNT_CH_LFE);
if (m_Decoder)
delete m_Decoder;
m_Decoder = new CFreeSurroundDecoder(m_DecoderChannelSetup, default_block_size, m_SampleRate);
m_Decoder->Flush();
ResetSettings();
m_ProcessBufferPos = 0;
m_LatencyFrames = 0;
return AE_DSP_ERROR_NO_ERROR;
}
void CDSPProcess_FreeSurround::Deinitialize()
{
if (m_Decoder)
{
delete m_Decoder;
m_Decoder = NULL;
}
}
AE_DSP_ERROR CDSPProcess_FreeSurround::StreamDestroy()
{
return AE_DSP_ERROR_NO_ERROR;
}
void CDSPProcess_FreeSurround::ResetSettings()
{
CDSPSettings settings;
settings.LoadSettingsData();
m_Params.fInputGain = settings.m_Settings.fInputGain;
m_Params.fCircularWrap = settings.m_Settings.fCircularWrap;
m_Params.fShift = settings.m_Settings.fShift;
m_Params.fDepth = settings.m_Settings.fDepth;
m_Params.fFocus = settings.m_Settings.fFocus;
m_Params.fCenterImage = settings.m_Settings.fCenterImage;
m_Params.fFrontSeparation = settings.m_Settings.fFrontSeparation;
m_Params.fRearSeparation = settings.m_Settings.fRearSeparation;
m_Params.bLFE = settings.m_Settings.bLFE;
m_Params.fLowCutoff = settings.m_Settings.fLowCutoff;
m_Params.fHighCutoff = settings.m_Settings.fHighCutoff;
SetParams();
}
void CDSPProcess_FreeSurround::SetParams()
{
if (!m_Decoder)
return;
m_Decoder->SetCircularWrap(m_Params.fCircularWrap);
m_Decoder->SetShift(m_Params.fShift);
m_Decoder->SetDepth(m_Params.fDepth);
m_Decoder->SetFocus(m_Params.fFocus);
m_Decoder->SetCenterImage(m_Params.fCenterImage);
m_Decoder->SetFrontSeparation(m_Params.fFrontSeparation);
m_Decoder->SetRearSeparation(m_Params.fRearSeparation);
m_Decoder->SetBassRedirection(m_Params.bLFE);
m_Decoder->SetLowCutoff(m_Params.fLowCutoff);
m_Decoder->SetHighCutoff(m_Params.fHighCutoff);
}
float CDSPProcess_FreeSurround::StreamGetDelay()
{
float delay = 0.0;
if (m_LatencyFrames != 0)
delay = ((float)m_LatencyFrames)/(2*m_SampleRate);
return delay;
}
unsigned int CDSPProcess_FreeSurround::StreamProcess(const float **array_in, float **array_out, unsigned int samples)
{
if (!m_Decoder)
return 0;
float **outputs = m_Decoder->getOutputBuffers();
for (unsigned int pos = 0; pos < samples; ++pos)
{
m_InbufArray[0][m_ProcessBufferPos] = array_in[AE_DSP_CH_FL][pos];// * m_Params.input_gain;
m_InbufArray[1][m_ProcessBufferPos] = array_in[AE_DSP_CH_FR][pos];// * m_Params.input_gain;
switch (m_DecoderChannelSetup)
{
case cs_stereo:
{
array_out[AE_DSP_CH_FL][pos] = outputs[0][m_ProcessBufferPos];
array_out[AE_DSP_CH_FR][pos] = outputs[1][m_ProcessBufferPos];
array_out[AE_DSP_CH_LFE][pos] = outputs[2][m_ProcessBufferPos];
break;
}
case cs_3stereo:
{
array_out[AE_DSP_CH_FL][pos] = outputs[0][m_ProcessBufferPos];
array_out[AE_DSP_CH_FC][pos] = outputs[1][m_ProcessBufferPos];
array_out[AE_DSP_CH_FR][pos] = outputs[2][m_ProcessBufferPos];
array_out[AE_DSP_CH_LFE][pos] = outputs[3][m_ProcessBufferPos];
break;
}
case cs_5stereo:
{
array_out[AE_DSP_CH_FL][pos] = outputs[0][m_ProcessBufferPos];
array_out[AE_DSP_CH_FLOC][pos] = outputs[1][m_ProcessBufferPos];
array_out[AE_DSP_CH_FC][pos] = outputs[2][m_ProcessBufferPos];
array_out[AE_DSP_CH_FROC][pos] = outputs[3][m_ProcessBufferPos];
array_out[AE_DSP_CH_FR][pos] = outputs[4][m_ProcessBufferPos];
array_out[AE_DSP_CH_LFE][pos] = outputs[5][m_ProcessBufferPos];
break;
}
case cs_4point1_Side:
{
array_out[AE_DSP_CH_FL][pos] = outputs[0][m_ProcessBufferPos];
array_out[AE_DSP_CH_FR][pos] = outputs[1][m_ProcessBufferPos];
array_out[AE_DSP_CH_SL][pos] = outputs[2][m_ProcessBufferPos];
array_out[AE_DSP_CH_SR][pos] = outputs[3][m_ProcessBufferPos];
array_out[AE_DSP_CH_LFE][pos] = outputs[4][m_ProcessBufferPos];
break;
}
case cs_4point1_Back:
{
array_out[AE_DSP_CH_FL][pos] = outputs[0][m_ProcessBufferPos];
array_out[AE_DSP_CH_FR][pos] = outputs[1][m_ProcessBufferPos];
array_out[AE_DSP_CH_BL][pos] = outputs[2][m_ProcessBufferPos];
array_out[AE_DSP_CH_BR][pos] = outputs[3][m_ProcessBufferPos];
array_out[AE_DSP_CH_LFE][pos] = outputs[4][m_ProcessBufferPos];
break;
}
case cs_5point1_Side:
{
array_out[AE_DSP_CH_FL][pos] = outputs[0][m_ProcessBufferPos];
array_out[AE_DSP_CH_FC][pos] = outputs[1][m_ProcessBufferPos];
array_out[AE_DSP_CH_FR][pos] = outputs[2][m_ProcessBufferPos];
array_out[AE_DSP_CH_SL][pos] = outputs[3][m_ProcessBufferPos];
array_out[AE_DSP_CH_SR][pos] = outputs[4][m_ProcessBufferPos];
array_out[AE_DSP_CH_LFE][pos] = outputs[5][m_ProcessBufferPos];
break;
}
case cs_5point1_Back:
{
array_out[AE_DSP_CH_FL][pos] = outputs[0][m_ProcessBufferPos];
array_out[AE_DSP_CH_FC][pos] = outputs[1][m_ProcessBufferPos];
array_out[AE_DSP_CH_FR][pos] = outputs[2][m_ProcessBufferPos];
array_out[AE_DSP_CH_BL][pos] = outputs[3][m_ProcessBufferPos];
array_out[AE_DSP_CH_BR][pos] = outputs[4][m_ProcessBufferPos];
array_out[AE_DSP_CH_LFE][pos] = outputs[5][m_ProcessBufferPos];
break;
}
case cs_6point1:
{
array_out[AE_DSP_CH_FL][pos] = outputs[0][m_ProcessBufferPos];
array_out[AE_DSP_CH_FC][pos] = outputs[1][m_ProcessBufferPos];
array_out[AE_DSP_CH_FR][pos] = outputs[2][m_ProcessBufferPos];
array_out[AE_DSP_CH_SL][pos] = outputs[3][m_ProcessBufferPos];
array_out[AE_DSP_CH_BC][pos] = outputs[4][m_ProcessBufferPos];
array_out[AE_DSP_CH_SR][pos] = outputs[5][m_ProcessBufferPos];
array_out[AE_DSP_CH_LFE][pos] = outputs[6][m_ProcessBufferPos];
break;
}
case cs_7point1:
{
array_out[AE_DSP_CH_FL][pos] = outputs[0][m_ProcessBufferPos];
array_out[AE_DSP_CH_FC][pos] = outputs[1][m_ProcessBufferPos];
array_out[AE_DSP_CH_FR][pos] = outputs[2][m_ProcessBufferPos];
array_out[AE_DSP_CH_SL][pos] = outputs[3][m_ProcessBufferPos];
array_out[AE_DSP_CH_SR][pos] = outputs[4][m_ProcessBufferPos];
array_out[AE_DSP_CH_BL][pos] = outputs[5][m_ProcessBufferPos];
array_out[AE_DSP_CH_BR][pos] = outputs[6][m_ProcessBufferPos];
array_out[AE_DSP_CH_LFE][pos] = outputs[7][m_ProcessBufferPos];
break;
}
case cs_7point1_panorama:
{
array_out[AE_DSP_CH_FL][pos] = outputs[0][m_ProcessBufferPos];
array_out[AE_DSP_CH_FLOC][pos] = outputs[1][m_ProcessBufferPos];
array_out[AE_DSP_CH_FC][pos] = outputs[2][m_ProcessBufferPos];
array_out[AE_DSP_CH_FROC][pos] = outputs[3][m_ProcessBufferPos];
array_out[AE_DSP_CH_FR][pos] = outputs[4][m_ProcessBufferPos];
array_out[AE_DSP_CH_SL][pos] = outputs[5][m_ProcessBufferPos];
array_out[AE_DSP_CH_SR][pos] = outputs[6][m_ProcessBufferPos];
array_out[AE_DSP_CH_LFE][pos] = outputs[7][m_ProcessBufferPos];
break;
}
case cs_7point1_tricenter:
{
array_out[AE_DSP_CH_FL][pos] = outputs[0][m_ProcessBufferPos];
array_out[AE_DSP_CH_FLOC][pos] = outputs[1][m_ProcessBufferPos];
array_out[AE_DSP_CH_FC][pos] = outputs[2][m_ProcessBufferPos];
array_out[AE_DSP_CH_FROC][pos] = outputs[3][m_ProcessBufferPos];
array_out[AE_DSP_CH_FR][pos] = outputs[4][m_ProcessBufferPos];
array_out[AE_DSP_CH_BL][pos] = outputs[5][m_ProcessBufferPos];
array_out[AE_DSP_CH_BR][pos] = outputs[6][m_ProcessBufferPos];
array_out[AE_DSP_CH_LFE][pos] = outputs[7][m_ProcessBufferPos];
break;
}
case cs_8point1:
{
array_out[AE_DSP_CH_FL][pos] = outputs[0][m_ProcessBufferPos];
array_out[AE_DSP_CH_FC][pos] = outputs[1][m_ProcessBufferPos];
array_out[AE_DSP_CH_FR][pos] = outputs[2][m_ProcessBufferPos];
array_out[AE_DSP_CH_SL][pos] = outputs[3][m_ProcessBufferPos];
array_out[AE_DSP_CH_SR][pos] = outputs[4][m_ProcessBufferPos];
array_out[AE_DSP_CH_BL][pos] = outputs[5][m_ProcessBufferPos];
array_out[AE_DSP_CH_BC][pos] = outputs[6][m_ProcessBufferPos];
array_out[AE_DSP_CH_BR][pos] = outputs[7][m_ProcessBufferPos];
array_out[AE_DSP_CH_LFE][pos] = outputs[8][m_ProcessBufferPos];
break;
}
case cs_9point1_densepanorama:
{
array_out[AE_DSP_CH_FL][pos] = outputs[0][m_ProcessBufferPos];
array_out[AE_DSP_CH_FLOC][pos] = outputs[1][m_ProcessBufferPos];
array_out[AE_DSP_CH_FC][pos] = outputs[2][m_ProcessBufferPos];
array_out[AE_DSP_CH_FROC][pos] = outputs[3][m_ProcessBufferPos];
array_out[AE_DSP_CH_FR][pos] = outputs[4][m_ProcessBufferPos];
array_out[AE_DSP_CH_TFL][pos] = outputs[5][m_ProcessBufferPos];
array_out[AE_DSP_CH_TFR][pos] = outputs[6][m_ProcessBufferPos];
array_out[AE_DSP_CH_SL][pos] = outputs[7][m_ProcessBufferPos];
array_out[AE_DSP_CH_SR][pos] = outputs[8][m_ProcessBufferPos];
array_out[AE_DSP_CH_LFE][pos] = outputs[9][m_ProcessBufferPos];
break;
}
case cs_9point1_wrap:
{
array_out[AE_DSP_CH_FL][pos] = outputs[0][m_ProcessBufferPos];
array_out[AE_DSP_CH_FLOC][pos] = outputs[1][m_ProcessBufferPos];
array_out[AE_DSP_CH_FC][pos] = outputs[2][m_ProcessBufferPos];
array_out[AE_DSP_CH_FROC][pos] = outputs[3][m_ProcessBufferPos];
array_out[AE_DSP_CH_FR][pos] = outputs[4][m_ProcessBufferPos];
array_out[AE_DSP_CH_SL][pos] = outputs[5][m_ProcessBufferPos];
array_out[AE_DSP_CH_SR][pos] = outputs[6][m_ProcessBufferPos];
array_out[AE_DSP_CH_BL][pos] = outputs[7][m_ProcessBufferPos];
array_out[AE_DSP_CH_BR][pos] = outputs[8][m_ProcessBufferPos];
array_out[AE_DSP_CH_LFE][pos] = outputs[9][m_ProcessBufferPos];
break;
}
case cs_11point1_densewrap:
{
array_out[AE_DSP_CH_FL][pos] = outputs[0][m_ProcessBufferPos];
array_out[AE_DSP_CH_FLOC][pos] = outputs[1][m_ProcessBufferPos];
array_out[AE_DSP_CH_FC][pos] = outputs[2][m_ProcessBufferPos];
array_out[AE_DSP_CH_FROC][pos] = outputs[3][m_ProcessBufferPos];
array_out[AE_DSP_CH_FR][pos] = outputs[4][m_ProcessBufferPos];
array_out[AE_DSP_CH_TFL][pos] = outputs[5][m_ProcessBufferPos];
array_out[AE_DSP_CH_TFR][pos] = outputs[6][m_ProcessBufferPos];
array_out[AE_DSP_CH_SL][pos] = outputs[7][m_ProcessBufferPos];
array_out[AE_DSP_CH_SR][pos] = outputs[8][m_ProcessBufferPos];
array_out[AE_DSP_CH_BL][pos] = outputs[9][m_ProcessBufferPos];
array_out[AE_DSP_CH_BR][pos] = outputs[10][m_ProcessBufferPos];
array_out[AE_DSP_CH_LFE][pos] = outputs[11][m_ProcessBufferPos];
break;
}
case cs_13point1_totalwrap:
{
array_out[AE_DSP_CH_FL][pos] = outputs[0][m_ProcessBufferPos];
array_out[AE_DSP_CH_FLOC][pos] = outputs[1][m_ProcessBufferPos];
array_out[AE_DSP_CH_FC][pos] = outputs[2][m_ProcessBufferPos];
array_out[AE_DSP_CH_FROC][pos] = outputs[3][m_ProcessBufferPos];
array_out[AE_DSP_CH_FR][pos] = outputs[4][m_ProcessBufferPos];
array_out[AE_DSP_CH_TFL][pos] = outputs[5][m_ProcessBufferPos];
array_out[AE_DSP_CH_TFR][pos] = outputs[6][m_ProcessBufferPos];
array_out[AE_DSP_CH_SL][pos] = outputs[7][m_ProcessBufferPos];
array_out[AE_DSP_CH_SR][pos] = outputs[8][m_ProcessBufferPos];
array_out[AE_DSP_CH_TBL][pos] = outputs[9][m_ProcessBufferPos];
array_out[AE_DSP_CH_TBR][pos] = outputs[10][m_ProcessBufferPos];
array_out[AE_DSP_CH_BL][pos] = outputs[11][m_ProcessBufferPos];
array_out[AE_DSP_CH_BR][pos] = outputs[12][m_ProcessBufferPos];
array_out[AE_DSP_CH_LFE][pos] = outputs[13][m_ProcessBufferPos];
break;
}
case cs_16point1:
{
array_out[AE_DSP_CH_FL][pos] = outputs[0][m_ProcessBufferPos];
array_out[AE_DSP_CH_FLOC][pos] = outputs[1][m_ProcessBufferPos];
array_out[AE_DSP_CH_FC][pos] = outputs[2][m_ProcessBufferPos];
array_out[AE_DSP_CH_FROC][pos] = outputs[3][m_ProcessBufferPos];
array_out[AE_DSP_CH_FR][pos] = outputs[4][m_ProcessBufferPos];
array_out[AE_DSP_CH_TFL][pos] = outputs[5][m_ProcessBufferPos];
array_out[AE_DSP_CH_TFR][pos] = outputs[6][m_ProcessBufferPos];
array_out[AE_DSP_CH_SL][pos] = outputs[7][m_ProcessBufferPos];
array_out[AE_DSP_CH_SR][pos] = outputs[8][m_ProcessBufferPos];
array_out[AE_DSP_CH_TBL][pos] = outputs[9][m_ProcessBufferPos];
array_out[AE_DSP_CH_TBR][pos] = outputs[10][m_ProcessBufferPos];
array_out[AE_DSP_CH_BL][pos] = outputs[11][m_ProcessBufferPos];
array_out[AE_DSP_CH_BLOC][pos] = outputs[12][m_ProcessBufferPos];
array_out[AE_DSP_CH_BC][pos] = outputs[14][m_ProcessBufferPos];
array_out[AE_DSP_CH_BROC][pos] = outputs[15][m_ProcessBufferPos];
array_out[AE_DSP_CH_BR][pos] = outputs[15][m_ProcessBufferPos];
array_out[AE_DSP_CH_LFE][pos] = outputs[16][m_ProcessBufferPos];
break;
}
case cs_legacy:
default:
{
if (array_out[AE_DSP_CH_FL])
array_out[AE_DSP_CH_FL][pos] = outputs[0][m_ProcessBufferPos];
if (array_out[AE_DSP_CH_FC])
array_out[AE_DSP_CH_FC][pos] = outputs[1][m_ProcessBufferPos];
if (array_out[AE_DSP_CH_FR])
array_out[AE_DSP_CH_FR][pos] = outputs[2][m_ProcessBufferPos];
if (array_out[AE_DSP_CH_BL])
array_out[AE_DSP_CH_BL][pos] = outputs[3][m_ProcessBufferPos];
if (array_out[AE_DSP_CH_BR])
array_out[AE_DSP_CH_BR][pos] = outputs[4][m_ProcessBufferPos];
if (array_out[AE_DSP_CH_LFE])
array_out[AE_DSP_CH_LFE][pos] = outputs[5][m_ProcessBufferPos];
break;
}
}
++m_ProcessBufferPos;
// If the FIFO is full
if (m_ProcessBufferPos >= default_block_size)
{
m_Decoder->Decode(m_InbufArray);
m_ProcessBufferPos = 0;
m_LatencyFrames = default_block_size;
}
}
return samples;
}
int CDSPProcess_FreeSurround::StreamGetOutChannels(unsigned long &out_channel_present_flags)
{
out_channel_present_flags = m_Settings.lOutChannelPresentFlags;
return m_Settings.iOutChannels;
}
void CDSPProcess_FreeSurround::SetCircularWrap(float degree)
{
m_Params.fCircularWrap = degree;
if (m_Decoder)
m_Decoder->SetCircularWrap(m_Params.fCircularWrap);
}
void CDSPProcess_FreeSurround::SetShift(float value)
{
m_Params.fShift = value;
if (m_Decoder)
m_Decoder->SetShift(m_Params.fShift);
}
void CDSPProcess_FreeSurround::SetDepth(float depth)
{
m_Params.fDepth = depth;
if (m_Decoder)
m_Decoder->SetDepth(m_Params.fDepth);
}
void CDSPProcess_FreeSurround::SetFocus(float focus)
{
m_Params.fFocus = focus;
if (m_Decoder)
m_Decoder->SetFocus(m_Params.fFocus);
}
void CDSPProcess_FreeSurround::SetCenterImage(float value)
{
m_Params.fCenterImage = value;
if (m_Decoder)
m_Decoder->SetCenterImage(m_Params.fCenterImage);
}
void CDSPProcess_FreeSurround::SetFrontSeparation(float separation)
{
m_Params.fFrontSeparation = separation;
if (m_Decoder)
m_Decoder->SetFrontSeparation(m_Params.fFrontSeparation);
}
void CDSPProcess_FreeSurround::SetRearSeparation(float separation)
{
m_Params.fRearSeparation = separation;
if (m_Decoder)
m_Decoder->SetRearSeparation(m_Params.fRearSeparation);
}
void CDSPProcess_FreeSurround::SetBassRedirection(bool onOff)
{
m_Params.bLFE = onOff;
if (m_Decoder)
m_Decoder->SetBassRedirection(m_Params.bLFE);
}
void CDSPProcess_FreeSurround::SetLowCutoff(float value)
{
m_Params.fLowCutoff = value;
if (m_Decoder)
m_Decoder->SetLowCutoff(m_Params.fLowCutoff/m_SampleRate);
}
void CDSPProcess_FreeSurround::SetHighCutoff(float value)
{
m_Params.fHighCutoff = value;
if (m_Decoder)
m_Decoder->SetHighCutoff(m_Params.fHighCutoff/m_SampleRate);
}