sipxmedialib  Version 3.3
MpBridgeAlgLinear.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2008-2012 SIPez LLC. All rights reserved.
3 // Licensed to SIPfoundry under a Contributor Agreement.
4 //
5 // Copyright (C) 2008 SIPfoundry Inc.
6 // Licensed by SIPfoundry under the LGPL license.
7 //
8 // $$
10 
11 // Author: Alexander Chemeris <Alexander DOT Chemeris AT SIPez DOT com>
12 
13 #ifndef _MpBridgeAlgLinear_h_
14 #define _MpBridgeAlgLinear_h_
15 
16 // SYSTEM INCLUDES
17 // APPLICATION INCLUDES
18 #include <mp/MpBridgeAlgBase.h>
19 #include <os/OsSysLog.h>
20 
21 // DEFINES
22 #define TEST_PRINT_MIXING
23 #undef TEST_PRINT_MIXING
24 
25 #define TEST_PRINT_MIXING_BINARY
26 #undef TEST_PRINT_MIXING_BINARY
27 
28 #define TEST_PRINT_MIXING_CONTRIBUTORS
29 #undef TEST_PRINT_MIXING_CONTRIBUTORS
30 
31 // MACROS
32 // EXTERNAL FUNCTIONS
33 // EXTERNAL VARIABLES
34 // STRUCTS
35 // TYPEDEFS
36 // FORWARD DECLARATIONS
37 
45 {
46 /* //////////////////////////////// PUBLIC //////////////////////////////// */
47 public:
48 
49 /* =============================== CREATORS =============================== */
51 
52 
54  MpBridgeAlgLinear(int inputs, int outputs, UtlBoolean mixSilence,
55  int samplesPerFrame);
56 
59 
61 
62 /* ============================= MANIPULATORS ============================= */
64 
65 
67  UtlBoolean doMix(MpBufPtr inBufs[], int inBufsSize,
68  MpBufPtr outBufs[], int outBufsSize,
69  int samplesPerFrame);
70 
72  void setGainMatrixValue(int column, int row, MpBridgeGain val);
73 
75  void setGainMatrixRow(int row, int numValues, const MpBridgeGain val[]);
76 
78  void setGainMatrixColumn(int column, int numValues, const MpBridgeGain val[]);
79 
81 
82 /* ============================== ACCESSORS =============================== */
84 
85 
87  void dumpOutputMix(UtlString& dumpString);
88 
90 
91 /* =============================== INQUIRY ================================ */
93 
94 
95 
97 
98 /* ////////////////////////////// PROTECTED /////////////////////////////// */
99 protected:
100 
101 /* ============================ Extended inputs =========================== */
103 
104 
106  {
108  : mExtendedInputsNum(0)
109  , mInputsNum(0)
110  , mOutputsNum(0)
111  , mpExtendedInputsMap(NULL)
112  , mpExtendedInputsInfo(NULL)
113  {};
114 
116  {
117  delete[] mpExtendedInputsMap;
118  delete[] mpExtendedInputsInfo;
119  }
120 
123  inline void init_simple(int numInputs, int numOutputs)
124  {
125  // Init array sizes
126  mInputsNum = numInputs;
127  mOutputsNum = numOutputs;
128  assert(mInputsNum == mOutputsNum);
129 
130  // Each input could not be replicated more then mOutputsNum times.
132 
133  // Allocate arrays
136 
137  // Fill arrays with data
138  int *pTmpInputsMapPtr = mpExtendedInputsMap;
139  int input;
140  for (input=0; input<mInputsNum; input++)
141  {
142  // Fill mpExtendedInputsMap row
143  int output;
144  for (output=0; output<input; output++)
145  {
146  *pTmpInputsMapPtr = input;
147  pTmpInputsMapPtr++;
148  }
149  // This one is muted
150  *pTmpInputsMapPtr = -1;
151  pTmpInputsMapPtr++;
152  for (output=input+1; output<mOutputsNum; output++)
153  {
154  *pTmpInputsMapPtr = input;
155  pTmpInputsMapPtr++;
156  }
157  }
158 
159  // Fill mpExtendedInputsInfo.
160  for (input=0; input<mInputsNum; input++)
161  {
162  mpExtendedInputsInfo[input].mInput = input;
164  mpExtendedInputsInfo[input].mRefCounter = mOutputsNum-1;
165  }
166  for (input=mInputsNum; input<mExtendedInputsNum; input++)
167  {
168  mpExtendedInputsInfo[input].mInput = -1;
171  }
172  }
173 
174  inline void setGain(int input, int output, MpBridgeGain gain)
175  {
176  assert(input < mInputsNum && output < mOutputsNum);
177  assert(input >= 0);
178  assert(output >= 0);
179 
180  int extendedInput = mpExtendedInputsMap[input*mOutputsNum + output];
181 
182  if (extendedInput >= 0)
183  {
184  if(mpExtendedInputsInfo[extendedInput].mRefCounter <= 0)
185  {
186  OsSysLog::add(FAC_MP, PRI_DEBUG,
187  "ExtendedInputs::setGain(in=%d, out=%d, gain=%d) mRefCounter: %d",
188  input, output, gain, mpExtendedInputsInfo[extendedInput].mRefCounter);
189  OsSysLog::flush();
190  }
191  assert(mpExtendedInputsInfo[extendedInput].mRefCounter > 0);
192  mpExtendedInputsInfo[extendedInput].mRefCounter--;
193  }
194 
195  if (gain != MP_BRIDGE_GAIN_MUTED)
196  {
197  extendedInput = addExtendedInput(input, gain);
198  assert(extendedInput >= 0);
199 
200  mpExtendedInputsMap[input*mOutputsNum + output] = extendedInput;
201  }
202  else
203  {
204  mpExtendedInputsMap[input*mOutputsNum + output] = -1;
205  }
206  }
207 
208  inline int searchForExtendedInput(int input, MpBridgeGain gain) const
209  {
210  for (int i=0; i<mExtendedInputsNum; i++)
211  {
212  if ( mpExtendedInputsInfo[i].mInput == input
213  && mpExtendedInputsInfo[i].mGain == gain)
214  {
215  // Found it.
216  return i;
217  }
218  }
219 
220  // Have not found it.
221  return -1;
222  }
223 
224  inline int addExtendedInput(int input, MpBridgeGain gain)
225  {
226  int lastEmptySlot=-1;
227 
228  // Look for existing extended input and for first empty slot (just
229  // in case)
230  int i;
231  for (i=0; i<mExtendedInputsNum; i++)
232  {
233  if ( mpExtendedInputsInfo[i].mInput == input
234  && mpExtendedInputsInfo[i].mGain == gain)
235  {
236  // Found existing extended input.
238  return i;
239  }
240  if (mpExtendedInputsInfo[i].mRefCounter == 0)
241  {
242  // Found it.
243  lastEmptySlot = i;
244  break;
245  }
246  }
247  // If we still have not found existing extended output, continue on.
248  // (seems we found empty slot, though)
249  for (; i<mExtendedInputsNum; i++)
250  {
251  if ( mpExtendedInputsInfo[i].mInput == input
252  && mpExtendedInputsInfo[i].mGain == gain)
253  {
254  // Found existing extended input.
256  return i;
257  }
258  }
259  // At this point existing extended input is not found, so we should
260  // have empty slot to add new one.
261  assert(lastEmptySlot>=0);
262 
263  // Add new extended input.
264  mpExtendedInputsInfo[lastEmptySlot].mRefCounter = 1;
265  mpExtendedInputsInfo[lastEmptySlot].mInput = input;
266  mpExtendedInputsInfo[lastEmptySlot].mGain = gain;
267 
268  // Have not found it.
269  return lastEmptySlot;
270  }
271 
272  inline int getExtendedInputsNum() const
273  {
274  return mExtendedInputsNum;
275  }
276 
277  inline int getOrigin(int extendedInput) const
278  {
279  return mpExtendedInputsInfo[extendedInput].mInput;
280  }
281 
282  inline int getGain(int extendedInput) const
283  {
284  return mpExtendedInputsInfo[extendedInput].mGain;
285  }
286 
287  inline bool isNotMuted(int extendedInput) const
288  {
289  return (mpExtendedInputsInfo[extendedInput].mRefCounter > 0) &&
290  (mpExtendedInputsInfo[extendedInput].mGain != MP_BRIDGE_GAIN_MUTED);
291  }
292 
293  inline int getExtendedInput(int origInput, int output) const
294  {
295  return mpExtendedInputsMap[origInput*mOutputsNum + output];
296  }
297 
298  protected:
299 
301  {
302  int mInput;
305  };
307 
316  };
319 
321 
323 
324 /* ============================= Active inputs ============================ */
326 
327 
330 
333 
334 /* ============================== Mix Engine ============================== */
336 
337 
338  struct MixAction
339  {
340  enum Type
341  {
345  NO_OPERATION
346  };
347 
349  int mSrc1;
350  int mSrc2;
351  int mDst;
352  };
353 
370 
371 #ifdef TEST_PRINT_MIXING // [
372 #ifdef TEST_PRINT_MIXING_BINARY // [
373 # define PRINT_DATA_SET(printString, offset) \
374  for (int i=0; i<mMixDataInfoStackStep; i++) \
375  { \
376  printString.appendFormat(" %d", mpMixDataInfoStack[mMixDataInfoStackStep*offset + i]); \
377  }
378 # define PRINT_DATA_SET_TOP(printString) \
379  for (int i=0; i<mMixDataInfoStackStep; i++) \
380  { \
381  printString.appendFormat(" %d", mpMixDataInfoStackTop[i]); \
382  }
383 #else // TEST_PRINT_MIXING_BINARY ][
384 # define PRINT_DATA_SET(printString, offset) \
385  for (int i=0; i<mMixDataInfoStackStep; i++) \
386  { \
387  if (mpMixDataInfoStack[mMixDataInfoStackStep*offset + i] > 0) \
388  { \
389  printString.appendFormat(" %d", i); \
390  } \
391  }
392 # define PRINT_DATA_SET_TOP(printString) \
393  for (int i=0; i<mMixDataInfoStackStep; i++) \
394  { \
395  if (mpMixDataInfoStackTop[i] > 0) \
396  { \
397  printString.appendFormat(" %d", i); \
398  } \
399  }
400 #endif //TEST_PRINT_MIXING_BINARY ]
401 # define PRINT_TOP_MIX_DATA() \
402  { \
403  UtlString printString; \
404  printString.appendFormat("pushed data %2d: [", mMixDataInfoProcessedStackTop); \
405  PRINT_DATA_SET_TOP(printString) \
406  OsSysLog::add(FAC_MP, PRI_DEBUG, "%s]\n", printString.data()); \
407  }
408 #else // TEST_PRINT_MIXING ][
409 # define PRINT_TOP_MIX_DATA()
410 #endif // TEST_PRINT_MIXING ]
411 
412  inline void initMixActions()
413  {
414  mMixActionsStackTop = 0;
415  }
416 
417  inline void pushMixAction(MixAction::Type type, int src1, int src2, int dst)
418  {
419  assert(mMixActionsStackTop<mMixActionsStackLength);
420  mpMixActionsStack[mMixActionsStackTop].mType = type;
421  mpMixActionsStack[mMixActionsStackTop].mSrc1 = src1;
422  mpMixActionsStack[mMixActionsStackTop].mSrc2 = src2;
423  mpMixActionsStack[mMixActionsStackTop].mDst = dst;
424  mMixActionsStackTop++;
425  }
426 
427  inline void pushMixActionCopyToOutput(int src, int dst)
428  {
429 #ifdef TEST_PRINT_MIXING // [
430  UtlString printString;
431  printString.appendFormat("COPY_TO_OUTPUT: %2d -> %2d [", src, dst);
432  PRINT_DATA_SET(printString, src);
433  printString.append("]\n");
434  OsSysLog::add(FAC_MP, PRI_DEBUG, "MpBridgeAlgLinear::pushMixActionCopyToOutput\n%s", printString.data());
435 #endif // TEST_PRINT_MIXING ]
437  }
438 
439  inline void pushMixActionCopyFromInput(int src, int dst)
440  {
441 #ifdef TEST_PRINT_MIXING // [
442  UtlString printString;
443  printString.appendFormat("COPY_FROM_INPUT: %2d <- %2d [", dst, src);
444  PRINT_DATA_SET(printString, dst);
445  printString.append("]\n");
446  OsSysLog::add(FAC_MP, PRI_DEBUG, "MpBridgeAlgLinear::pushMixActionCopyFromInput\n%s", printString.data());
447 #endif // TEST_PRINT_MIXING ]
448  // No real need to do this. Enable if you want debug.
449  //mpMixDataInfoProcessedStack[src] = mMixActionsStackTop;
451  }
452 
453  inline void pushMixActionMix(int src1, int src2, int dst)
454  {
455 #ifdef TEST_PRINT_MIXING // [
456  UtlString printString;
457  printString.appendFormat("DO_MIX: %2d + %2d -> %2d [", src1, src2, dst);
458  PRINT_DATA_SET(printString, src1);
459  printString.append("] + [");
460  PRINT_DATA_SET(printString, src2);
461  printString.append("] -> [");
462  PRINT_DATA_SET(printString, dst);
463  printString.append("]\n");
464  OsSysLog::add(FAC_MP, PRI_DEBUG, "MpBridgeAlgLinear::pushMixActionMix\n%s", printString.data());
465 #endif // TEST_PRINT_MIXING ]
466  mpMixDataInfoProcessedStack[dst] = mMixActionsStackTop;
467  pushMixAction(MixAction::DO_MIX, src1, src2, dst);
468  }
469 
470  inline void moveTopMixActionMix(int dst)
471  {
472  int action = mpMixDataInfoProcessedStack[dst];
473 #ifdef TEST_PRINT_MIXING // [
474  OsSysLog::add(FAC_MP, PRI_DEBUG,
475  "MpBridgeAlgLinear::moveTopMixActionMix\npull: %2d + %2d -> %2d\n",
476  mpMixActionsStack[action].mSrc1,
477  mpMixActionsStack[action].mSrc2,
478  mpMixActionsStack[action].mDst);
479 #endif // TEST_PRINT_MIXING ]
480  mpMixDataInfoProcessedStack[dst] = mMixActionsStackTop;
482  mpMixActionsStack[action].mSrc1,
483  mpMixActionsStack[action].mSrc2,
484  mpMixActionsStack[action].mDst);
485  mpMixActionsStack[action].mDst = MixAction::NO_OPERATION;
486  }
487 
488  inline void initMixDataInfoStack(int step)
489  {
490  mpMixDataInfoStackTop = mpMixDataInfoStack;
491  mMixDataInfoStackStep = step;
492  mMixDataInfoProcessedStackTop = 0;
493  }
494 
495  inline void initMixDataStack()
496  {
497  mpMixDataStackTop = mpMixDataStack;
498  }
499 
500  inline bool searchClosestUnprocessedData(int *pDataInfoStackPtr,
501  int *pStartDataInfoStackPtr,
502  int startDataInfoStackPos,
503  int *&pFoundDataInfoStackPtr,
504  int &foundDataInfoStackPos)
505  {
506  int *pTmpPtr;
507  int tmpPos;
508  int foundCommonDataBitCounter = 0;
509  int foundFirstDataDiffBitCounter = 0;
510  int foundSecondDataDiffBitCounter = 0;
511 
512  pFoundDataInfoStackPtr = pStartDataInfoStackPtr;
513  foundDataInfoStackPos = startDataInfoStackPos;
514  for (pTmpPtr = pStartDataInfoStackPtr, tmpPos=startDataInfoStackPos;
515  pTmpPtr < mpMixDataInfoStackTop;
516  pTmpPtr += mMixDataInfoStackStep, tmpPos++)
517  {
518  // Compare data sets if not processed yet and not equal to original
519  // data set.
520  if (mpMixDataInfoProcessedStack[tmpPos]<0 &&
521  (pDataInfoStackPtr != pTmpPtr))
522  {
523  int commonDataBitCounter = 0;
524  int firstDataDiffBitCounter = 0;
525  int secondDataDiffBitCounter = 0;
526 
527  // Calculate common part, first only part and second only part.
528  for (int i=0; i<mMixDataInfoStackStep; i++)
529  {
530  commonDataBitCounter += pDataInfoStackPtr[i] & pTmpPtr[i];
531  firstDataDiffBitCounter += pDataInfoStackPtr[i] & !pTmpPtr[i];
532  secondDataDiffBitCounter += !pDataInfoStackPtr[i] & pTmpPtr[i];
533  }
534 
535  // Is this pair better then previous?
536  if (commonDataBitCounter > foundCommonDataBitCounter &&
537  firstDataDiffBitCounter < commonDataBitCounter &&
538  secondDataDiffBitCounter < commonDataBitCounter)
539  {
540  pFoundDataInfoStackPtr = pTmpPtr;
541  foundDataInfoStackPos = tmpPos;
542  foundCommonDataBitCounter = commonDataBitCounter;
543  foundFirstDataDiffBitCounter = firstDataDiffBitCounter;
544  foundSecondDataDiffBitCounter = secondDataDiffBitCounter;
545 
546  // Stop processing if close enough data set found.
547  if ((foundFirstDataDiffBitCounter < 2) &&
548  (foundSecondDataDiffBitCounter < 2))
549  {
550  break;
551  }
552  }
553  }
554  }
555 
556  return (foundCommonDataBitCounter > 0);
557  }
558 
559  inline void searchExistingData(int *pDataInfoStackPtr,
560  int &foundDataInfoStackPos)
561  {
562  int *pTmpPtr;
563  int tmpPos;
564 
565  for (pTmpPtr = mpMixDataInfoStack, tmpPos=0;
566  ;
567  pTmpPtr += mMixDataInfoStackStep, tmpPos++)
568  {
569  int input=0;
570  while (input<mMixDataInfoStackStep &&
571  pDataInfoStackPtr[input] == pTmpPtr[input])
572  {
573  input++;
574  }
575  if (input == mMixDataInfoStackStep)
576  {
577  foundDataInfoStackPos = tmpPos;
578  return;
579  }
580  }
581  }
582 
583  inline void searchExistingUnprocessedData(int *pDataInfoStackPtr,
584  int &foundDataInfoStackPos,
585  int ignoreDataInfoStackLevel)
586  {
587  int *pTmpPtr;
588  int tmpPos;
589 
590  for (pTmpPtr = mpMixDataInfoStack, tmpPos=0;
591  ;
592  pTmpPtr += mMixDataInfoStackStep, tmpPos++)
593  {
594  if (mpMixDataInfoProcessedStack[tmpPos] < 0 ||
595  tmpPos < ignoreDataInfoStackLevel)
596  {
597  // This is unprocessed data. Try it.
598 
599  int input=0;
600  while (input<mMixDataInfoStackStep &&
601  pDataInfoStackPtr[input] == pTmpPtr[input])
602  {
603  input++;
604  }
605  if (input == mMixDataInfoStackStep)
606  {
607  // Found! Return value.
608  foundDataInfoStackPos = tmpPos;
609  return;
610  }
611  }
612  }
613  }
614 
615  inline bool searchData(int *pDataInfoStackPtr,
616  int &foundDataInfoStackPos)
617  {
618  int *pTmpPtr;
619  int tmpPos;
620 
621  for (pTmpPtr = mpMixDataInfoStack, tmpPos=0;
622  pTmpPtr < mpMixDataInfoStackTop;
623  pTmpPtr += mMixDataInfoStackStep, tmpPos++)
624  {
625  int input=0;
626  while (input<mMixDataInfoStackStep &&
627  pDataInfoStackPtr[input] == pTmpPtr[input])
628  {
629  input++;
630  }
631  if (input == mMixDataInfoStackStep)
632  {
633  foundDataInfoStackPos = tmpPos;
634  return true;
635  }
636  }
637 
638  return false;
639  }
640 
641  inline void moveDataUp(int startDataInfoStackPos, int dataInfoStackPos)
642  {
643  if (mpMixDataInfoProcessedStack[dataInfoStackPos] >= 0 &&
644  dataInfoStackPos >= startDataInfoStackPos)
645  {
646  // If this output was already processed - swap commands.
647  moveTopMixActionMix(dataInfoStackPos);
648  }
649  }
650 
652 
653 
654 /* /////////////////////////////// PRIVATE //////////////////////////////// */
655 private:
656 
657 
658 };
659 
660 /* ============================ INLINE METHODS ============================ */
661 
662 #endif // _MpBridgeAlgLinear_h_
void initMixDataInfoStack(int step)
Definition: MpBridgeAlgLinear.h:488
void initMixActions()
Definition: MpBridgeAlgLinear.h:412
void pushMixActionMix(int src1, int src2, int dst)
Definition: MpBridgeAlgLinear.h:453
void setGainMatrixRow(int row, int numValues, const MpBridgeGain val[])
Set selected gain row to the given value.
Definition: MpBridgeAlgLinear.cpp:813
Definition: MpBridgeAlgLinear.h:343
Type mType
Definition: MpBridgeAlgLinear.h:348
int getGain(int extendedInput) const
Definition: MpBridgeAlgLinear.h:282
int samplesPerFrame
int mSrc2
Definition: MpBridgeAlgLinear.h:350
int mMixDataInfoStackStep
Definition: MpBridgeAlgLinear.h:363
int mMixActionsStackTop
Definition: MpBridgeAlgLinear.h:355
int getOrigin(int extendedInput) const
Definition: MpBridgeAlgLinear.h:277
bool searchData(int *pDataInfoStackPtr, int &foundDataInfoStackPos)
Definition: MpBridgeAlgLinear.h:615
int getExtendedInputsNum() const
Definition: MpBridgeAlgLinear.h:272
int * mpMixDataInfoProcessedStack
Definition: MpBridgeAlgLinear.h:369
int mMixDataInfoStackLength
Definition: MpBridgeAlgLinear.h:364
void dumpOutputMix(UtlString &dumpString)
Dump the mix matrix to log.
Definition: MpBridgeAlgLinear.cpp:853
~MpBridgeAlgLinear()
Destructor.
Definition: MpBridgeAlgLinear.cpp:95
bool isNotMuted(int extendedInput) const
Definition: MpBridgeAlgLinear.h:287
int mDst
Definition: MpBridgeAlgLinear.h:351
Definition: MpBridgeAlgLinear.h:342
ExtendedInputs mExtendedInputs
Storage for all extended inputs data.
Definition: MpBridgeAlgLinear.h:320
void pushMixAction(MixAction::Type type, int src1, int src2, int dst)
Definition: MpBridgeAlgLinear.h:417
float MpBridgeAccum
Definition: MpBridgeAlgBase.h:48
Definition: MpBridgeAlgLinear.h:105
~ExtendedInputs()
Definition: MpBridgeAlgLinear.h:115
void pushMixActionCopyFromInput(int src, int dst)
Definition: MpBridgeAlgLinear.h:439
#define MP_BRIDGE_GAIN_PASSTHROUGH
Definition: MpBridgeAlgBase.h:37
MpBridgeAccum * mpMixDataStackTop
Definition: MpBridgeAlgLinear.h:359
void moveTopMixActionMix(int dst)
Definition: MpBridgeAlgLinear.h:470
void pushMixActionCopyToOutput(int src, int dst)
Definition: MpBridgeAlgLinear.h:427
ExtendedInputs()
Definition: MpBridgeAlgLinear.h:107
int mMixActionsStackLength
Definition: MpBridgeAlgLinear.h:354
bool searchClosestUnprocessedData(int *pDataInfoStackPtr, int *pStartDataInfoStackPtr, int startDataInfoStackPos, int *&pFoundDataInfoStackPtr, int &foundDataInfoStackPos)
Definition: MpBridgeAlgLinear.h:500
UtlBoolean doMix(MpBufPtr inBufs[], int inBufsSize, MpBufPtr outBufs[], int outBufsSize, int samplesPerFrame)
Mix together inputs onto outputs according to mpGainMatrix matrix.
Definition: MpBridgeAlgLinear.cpp:108
int mInputsNum
Number of outputs.
Definition: MpBridgeAlgLinear.h:309
int addExtendedInput(int input, MpBridgeGain gain)
Definition: MpBridgeAlgLinear.h:224
int getExtendedInput(int origInput, int output) const
Definition: MpBridgeAlgLinear.h:293
MpBridgeAlgLinear(int inputs, int outputs, UtlBoolean mixSilence, int samplesPerFrame)
Constructor.
Definition: MpBridgeAlgLinear.cpp:44
void moveDataUp(int startDataInfoStackPos, int dataInfoStackPos)
Definition: MpBridgeAlgLinear.h:641
int mRefCounter
extended input.
Definition: MpBridgeAlgLinear.h:304
MpBridgeAccum * mpMixDataStack
Definition: MpBridgeAlgLinear.h:360
MpSpeechType
Type of audio data.
Definition: MpTypes.h:65
int mInput
Index of original input for this extended input.
Definition: MpBridgeAlgLinear.h:302
void searchExistingData(int *pDataInfoStackPtr, int &foundDataInfoStackPos)
Definition: MpBridgeAlgLinear.h:559
int * mpMixDataInfoStackTop
Definition: MpBridgeAlgLinear.h:365
MixAction * mpMixActionsStack
Definition: MpBridgeAlgLinear.h:356
int * mpActiveInputsList
inputs. Used in doMix() only.
Definition: MpBridgeAlgLinear.h:329
Type
Definition: MpBridgeAlgLinear.h:340
Brief description.
Definition: MpBridgeAlgLinear.h:44
MpBridgeAccum * mpMixDataAmplitude
Amplitude of data frames in mpMixDataStack.
Definition: MpBridgeAlgLinear.h:362
void init_simple(int numInputs, int numOutputs)
Initialize extended inputs, assuming simple bridge matrix case (inversed unity matrix).
Definition: MpBridgeAlgLinear.h:123
Definition: MpBridgeAlgLinear.h:344
int mMixDataInfoProcessedStackTop
Definition: MpBridgeAlgLinear.h:368
Definition: MpBridgeAlgLinear.h:300
int mSrc1
Definition: MpBridgeAlgLinear.h:349
Definition: MpBridgeAlgLinear.h:338
int mMixDataStackLength
Definition: MpBridgeAlgLinear.h:358
void searchExistingUnprocessedData(int *pDataInfoStackPtr, int &foundDataInfoStackPos, int ignoreDataInfoStackLevel)
Definition: MpBridgeAlgLinear.h:583
void setGain(int input, int output, MpBridgeGain gain)
Definition: MpBridgeAlgLinear.h:174
void setGainMatrixColumn(int column, int numValues, const MpBridgeGain val[])
Set selected gain column to the given value.
Definition: MpBridgeAlgLinear.cpp:833
Smart pointer to MpBuf.
Definition: MpBuf.h:160
#define MP_BRIDGE_GAIN_MUTED
Definition: MpBridgeAlgBase.h:36
int * mpExtendedInputsMap
Definition: MpBridgeAlgLinear.h:311
MpSpeechType * mpMixDataSpeechType
Speech type of data frames in mpMixDataStack.
Definition: MpBridgeAlgLinear.h:361
float MpBridgeGain
Definition: MpBridgeAlgBase.h:54
ExtendedInputInfo * mpExtendedInputsInfo
Definition: MpBridgeAlgLinear.h:315
Base class for the Bridge mixing algorithms.
Definition: MpBridgeAlgBase.h:62
int mOutputsNum
Number of outputs.
Definition: MpBridgeAlgLinear.h:310
void setGainMatrixValue(int column, int row, MpBridgeGain val)
Set selected gain to the given value.
Definition: MpBridgeAlgLinear.cpp:808
Definition: MpBridgeAlgLinear.h:345
int * mpMixDataInfoStack
Definition: MpBridgeAlgLinear.h:366
int searchForExtendedInput(int input, MpBridgeGain gain) const
Definition: MpBridgeAlgLinear.h:208
void initMixDataStack()
Definition: MpBridgeAlgLinear.h:495
MpBridgeGain mGain
Gain applied to this extended input.
Definition: MpBridgeAlgLinear.h:303
int mExtendedInputsNum
Size of mpExtendedInputsInfo array.
Definition: MpBridgeAlgLinear.h:308
int mMixDataInfoProcessedStackLength
Definition: MpBridgeAlgLinear.h:367
int mMixDataStackStep
Definition: MpBridgeAlgLinear.h:357
int mActiveInputsListSize
Length of mpActiveInputsList array.
Definition: MpBridgeAlgLinear.h:328