Skip to content

Commit

Permalink
MP1-4815 : MPAR Update.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastiii committed Sep 15, 2016
1 parent 1ac662f commit 26c0149
Show file tree
Hide file tree
Showing 84 changed files with 4,112 additions and 9,476 deletions.
16 changes: 0 additions & 16 deletions DirectShowFilters/MPAudioRenderer/AE_mixer/AEChannelInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,22 +221,6 @@ const enum AEChannel CAEChannelInfo::operator[](unsigned int i) const
return m_channels[i];
}

CAEChannelInfo::operator std::string()
{
if (m_channelCount == 0)
return "NULL";

std::string s;
for (unsigned int i = 0; i < m_channelCount - 1; ++i)
{
s.append(GetChName(m_channels[i]));
s.append(",");
}
s.append(GetChName(m_channels[m_channelCount-1]));

return s;
}

const char* CAEChannelInfo::GetChName(const enum AEChannel ch)
{
ASSERT(ch >= 0 || ch < AE_CH_MAX);
Expand Down
2 changes: 0 additions & 2 deletions DirectShowFilters/MPAudioRenderer/AE_mixer/AEChannelInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
*/

#include "..\source\stdafx.h"
#include "StdString.h"

/**
* The possible channels
Expand Down Expand Up @@ -93,7 +92,6 @@ class CAEChannelInfo {
bool operator!=(const CAEChannelInfo& rhs);
void operator+=(const enum AEChannel rhs);
const enum AEChannel operator[](unsigned int i) const;
operator std::string();

/* remove any channels that dont exist in the provided info */
void ResolveChannels(const CAEChannelInfo& rhs);
Expand Down
23 changes: 15 additions & 8 deletions DirectShowFilters/MPAudioRenderer/AE_mixer/AERemap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@

using namespace std;

CAERemap::CAERemap()
CAERemap::CAERemap(Logger* pLogger) :
m_inChannels(0),
m_outChannels(0),
m_pLogger(pLogger)
{
memset(m_mixInfo, 0, sizeof(m_mixInfo));
}

CAERemap::~CAERemap()
Expand Down Expand Up @@ -348,21 +352,24 @@ void CAERemap::Remap(float * const in, float * const out, const unsigned int fra

/* the compiler has a better chance of optimizing this if it is done in parallel */
int i = 0;
float f1 = 0.0, f2 = 0.0, f3 = 0.0, f4 = 0.0;
for (; i < blocks; i += 4)
{
*outOffset += inOffset[info->srcIndex[i].index] * info->srcIndex[i].level, i++;
*outOffset += inOffset[info->srcIndex[i].index] * info->srcIndex[i].level, i++;
*outOffset += inOffset[info->srcIndex[i].index] * info->srcIndex[i].level, i++;
*outOffset += inOffset[info->srcIndex[i].index] * info->srcIndex[i].level, i++;
f1 += inOffset[info->srcIndex[i].index] * info->srcIndex[i].level;
f2 += inOffset[info->srcIndex[i+1].index] * info->srcIndex[i+1].level;
f3 += inOffset[info->srcIndex[i+2].index] * info->srcIndex[i+2].level;
f4 += inOffset[info->srcIndex[i+3].index] * info->srcIndex[i+3].level;
}

/* unrolled loop for higher performance */
switch (info->srcCount & 0x3)
{
case 3: *outOffset += inOffset[info->srcIndex[i].index] * info->srcIndex[i].level, i++;
case 2: *outOffset += inOffset[info->srcIndex[i].index] * info->srcIndex[i].level, i++;
case 1: *outOffset += inOffset[info->srcIndex[i].index] * info->srcIndex[i].level;
case 3: f3 += inOffset[info->srcIndex[i+2].index] * info->srcIndex[i+2].level;
case 2: f2 += inOffset[info->srcIndex[i+1].index] * info->srcIndex[i+1].level;
case 1: f1 += inOffset[info->srcIndex[i].index] * info->srcIndex[i].level;
}

*outOffset += (f1+f2+f3+f4);
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion DirectShowFilters/MPAudioRenderer/AE_mixer/AERemap.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@

#include "..\source\stdafx.h"
#include "AEAudioFormat.h"
#include "..\source\Logger.h"

class CAERemap {
public:
CAERemap();
CAERemap(Logger* pLogger);
~CAERemap();

bool Initialize(CAEChannelInfo input, CAEChannelInfo output, bool finalStage, bool forceNormalize = false, enum AEStdChLayout stdChLayout = AE_CH_LAYOUT_INVALID);
Expand Down Expand Up @@ -53,5 +54,7 @@ class CAERemap {

void ResolveMix(const AEChannel from, CAEChannelInfo to);
void BuildUpmixMatrix(const CAEChannelInfo& input, const CAEChannelInfo& output);

Logger* m_pLogger;
};

Loading

0 comments on commit 26c0149

Please sign in to comment.