Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

fastmix.cpp File Reference

#include "stdafx.h"
#include "sndfile.h"
#include <math.h>

Include dependency graph for fastmix.cpp:

Go to the source code of this file.

Defines

#define SPLINE_QUANTBITS   14
#define SPLINE_QUANTSCALE   (1L<<SPLINE_QUANTBITS)
#define SPLINE_8SHIFT   (SPLINE_QUANTBITS-8)
#define SPLINE_16SHIFT   (SPLINE_QUANTBITS)
#define SPLINE_CLAMPFORUNITY
#define SPLINE_FRACBITS   10
#define SPLINE_LUTLEN   (1L<<SPLINE_FRACBITS)
#define WFIR_QUANTBITS   15
#define WFIR_QUANTSCALE   (1L<<WFIR_QUANTBITS)
#define WFIR_8SHIFT   (WFIR_QUANTBITS-8)
#define WFIR_16BITSHIFT   (WFIR_QUANTBITS)
#define WFIR_FRACBITS   10
#define WFIR_LUTLEN   ((1L<<(WFIR_FRACBITS+1))+1)
#define WFIR_LOG2WIDTH   3
#define WFIR_WIDTH   (1L<<WFIR_LOG2WIDTH)
#define WFIR_SMPSPERWING   ((WFIR_WIDTH-1)>>1)
#define WFIR_CUTOFF   0.90f
#define WFIR_HANN   0
#define WFIR_HAMMING   1
#define WFIR_BLACKMANEXACT   2
#define WFIR_BLACKMAN3T61   3
#define WFIR_BLACKMAN3T67   4
#define WFIR_BLACKMAN4T92   5
#define WFIR_BLACKMAN4T74   6
#define WFIR_KAISER4T   7
#define WFIR_TYPE   WFIR_BLACKMANEXACT
#define M_zPI   3.1415926535897932384626433832795
#define M_zEPS   1e-8
#define M_zBESSELEPS   1e-21
#define SNDMIX_BEGINSAMPLELOOP8
#define SNDMIX_BEGINSAMPLELOOP16
#define SNDMIX_ENDSAMPLELOOP
#define SNDMIX_ENDSAMPLELOOP8   SNDMIX_ENDSAMPLELOOP
#define SNDMIX_ENDSAMPLELOOP16   SNDMIX_ENDSAMPLELOOP
#define SNDMIX_GETMONOVOL8NOIDO   int vol = p[nPos >> 16] << 8;
#define SNDMIX_GETMONOVOL16NOIDO   int vol = p[nPos >> 16];
#define SNDMIX_GETMONOVOL8LINEAR
#define SNDMIX_GETMONOVOL16LINEAR
#define SPLINE_FRACSHIFT   ((16-SPLINE_FRACBITS)-2)
#define SPLINE_FRACMASK   (((1L<<(16-SPLINE_FRACSHIFT))-1)&~3)
#define SNDMIX_GETMONOVOL8SPLINE
#define SNDMIX_GETMONOVOL16SPLINE
#define WFIR_FRACSHIFT   (16-(WFIR_FRACBITS+1+WFIR_LOG2WIDTH))
#define WFIR_FRACMASK   ((((1L<<(17-WFIR_FRACSHIFT))-1)&~((1L<<WFIR_LOG2WIDTH)-1)))
#define WFIR_FRACHALVE   (1L<<(16-(WFIR_FRACBITS+2)))
#define SNDMIX_GETMONOVOL8FIRFILTER
#define SNDMIX_GETMONOVOL16FIRFILTER
#define SNDMIX_GETSTEREOVOL8NOIDO
#define SNDMIX_GETSTEREOVOL16NOIDO
#define SNDMIX_GETSTEREOVOL8LINEAR
#define SNDMIX_GETSTEREOVOL16LINEAR
#define SNDMIX_GETSTEREOVOL8SPLINE
#define SNDMIX_GETSTEREOVOL16SPLINE
#define SNDMIX_GETSTEREOVOL8FIRFILTER
#define SNDMIX_GETSTEREOVOL16FIRFILTER
#define SNDMIX_STOREMONOVOL
#define SNDMIX_STORESTEREOVOL
#define SNDMIX_STOREFASTMONOVOL
#define SNDMIX_RAMPMONOVOL
#define SNDMIX_RAMPFASTMONOVOL
#define SNDMIX_RAMPSTEREOVOL
#define MIX_BEGIN_FILTER
#define MIX_END_FILTER
#define SNDMIX_PROCESSFILTER
#define MIX_BEGIN_STEREO_FILTER
#define MIX_END_STEREO_FILTER
#define SNDMIX_PROCESSSTEREOFILTER
#define BEGIN_MIX_INTERFACE(func)
#define END_MIX_INTERFACE()
#define BEGIN_RAMPMIX_INTERFACE(func)
#define END_RAMPMIX_INTERFACE()
#define BEGIN_FASTRAMPMIX_INTERFACE(func)
#define END_FASTRAMPMIX_INTERFACE()
#define BEGIN_MIX_FLT_INTERFACE(func)
#define END_MIX_FLT_INTERFACE()
#define BEGIN_RAMPMIX_FLT_INTERFACE(func)
#define END_RAMPMIX_FLT_INTERFACE()
#define BEGIN_MIX_STFLT_INTERFACE(func)
#define END_MIX_STFLT_INTERFACE()
#define BEGIN_RAMPMIX_STFLT_INTERFACE(func)
#define END_RAMPMIX_STFLT_INTERFACE()
#define MIXNDX_16BIT   0x01
#define MIXNDX_STEREO   0x02
#define MIXNDX_RAMP   0x04
#define MIXNDX_FILTER   0x08
#define MIXNDX_LINEARSRC   0x10
#define MIXNDX_SPLINESRC   0x20
#define MIXNDX_FIRSRC   0x30
#define OFSDECAYSHIFT   8
#define OFSDECAYMASK   0xFF
#define OFSDECAYSHIFT   8
#define OFSDECAYMASK   0xFF
#define MIXING_LIMITMAX   (0x08100000)
#define MIXING_LIMITMIN   (-MIXING_LIMITMAX)

Typedefs

typedef VOID(MPPASMCALL * LPMIXINTERFACE )(MODCHANNEL *, int *, int *)

Functions

void MPPASMCALL X86_InitMixBuffer (int *pBuffer, UINT nSamples)
void MPPASMCALL X86_EndChannelOfs (MODCHANNEL *pChannel, int *pBuffer, UINT nSamples)
void MPPASMCALL X86_StereoFill (int *pBuffer, UINT nSamples, LPLONG lpROfs, LPLONG lpLOfs)
void X86_StereoMixToFloat (const int *, float *, float *, UINT nCount)
void X86_FloatToStereoMix (const float *pIn1, const float *pIn2, int *pOut, UINT nCount)
static LONG MPPFASTCALL GetSampleCount (MODCHANNEL *pChn, LONG nSamples)
 __declspec (naked) DWORD MPPASMCALL X86_Convert32To8(LPVOID lp8

Variables

int MixSoundBuffer [MIXBUFFERSIZE *4]
int MixReverbBuffer [MIXBUFFERSIZE *2]
UINT gnReverbSend
int MixRearBuffer [MIXBUFFERSIZE *2]
float MixFloatBuffer [MIXBUFFERSIZE *2]
LONG gnDryROfsVol
LONG gnDryLOfsVol
LONG gnRvbROfsVol
LONG gnRvbLOfsVol
short int gFastSinc []
short int gKaiserSinc []
CzCUBICSPLINE sspline
CzWINDOWEDFIR sfir
const LPMIXINTERFACE gpMixFunctionTable [2 *2 *16]
const LPMIXINTERFACE gpFastMixFunctionTable [2 *2 *16]
int * pBuffer
int DWORD lSampleCount
int DWORD LPLONG lpMin


Define Documentation

#define BEGIN_FASTRAMPMIX_INTERFACE func   ) 
 

Value:

BEGIN_MIX_INTERFACE(func)\
                LONG nRampRightVol = pChannel->nRampRightVol;

Definition at line 590 of file fastmix.cpp.

#define BEGIN_MIX_FLT_INTERFACE func   ) 
 

Value:

Definition at line 604 of file fastmix.cpp.

#define BEGIN_MIX_INTERFACE func   ) 
 

Value:

VOID MPPASMCALL func(MODCHANNEL *pChannel, int *pbuffer, int *pbufmax)\
        {\
                LONG nPos;

Definition at line 567 of file fastmix.cpp.

#define BEGIN_MIX_STFLT_INTERFACE func   ) 
 

Value:

Definition at line 630 of file fastmix.cpp.

#define BEGIN_RAMPMIX_FLT_INTERFACE func   ) 
 

Value:

BEGIN_MIX_INTERFACE(func)\
                LONG nRampRightVol = pChannel->nRampRightVol;\
                LONG nRampLeftVol = pChannel->nRampLeftVol;\
                MIX_BEGIN_FILTER

Definition at line 614 of file fastmix.cpp.

#define BEGIN_RAMPMIX_INTERFACE func   ) 
 

Value:

BEGIN_MIX_INTERFACE(func)\
                LONG nRampRightVol = pChannel->nRampRightVol;\
                LONG nRampLeftVol = pChannel->nRampLeftVol;

Definition at line 577 of file fastmix.cpp.

#define BEGIN_RAMPMIX_STFLT_INTERFACE func   ) 
 

Value:

BEGIN_MIX_INTERFACE(func)\
                LONG nRampRightVol = pChannel->nRampRightVol;\
                LONG nRampLeftVol = pChannel->nRampLeftVol;\
                MIX_BEGIN_STEREO_FILTER

Definition at line 640 of file fastmix.cpp.

 
#define END_FASTRAMPMIX_INTERFACE  ) 
 

Value:

SNDMIX_ENDSAMPLELOOP\
                pChannel->nRampRightVol = nRampRightVol;\
                pChannel->nRampLeftVol = nRampRightVol;\
                pChannel->nRightVol = nRampRightVol >> VOLUMERAMPPRECISION;\
                pChannel->nLeftVol = pChannel->nRightVol;\
        }

Definition at line 594 of file fastmix.cpp.

 
#define END_MIX_FLT_INTERFACE  ) 
 

Value:

Definition at line 609 of file fastmix.cpp.

 
#define END_MIX_INTERFACE  ) 
 

Value:

Definition at line 572 of file fastmix.cpp.

 
#define END_MIX_STFLT_INTERFACE  ) 
 

Value:

Definition at line 635 of file fastmix.cpp.

 
#define END_RAMPMIX_FLT_INTERFACE  ) 
 

Value:

SNDMIX_ENDSAMPLELOOP\
                MIX_END_FILTER\
                pChannel->nRampRightVol = nRampRightVol;\
                pChannel->nRightVol = nRampRightVol >> VOLUMERAMPPRECISION;\
                pChannel->nRampLeftVol = nRampLeftVol;\
                pChannel->nLeftVol = nRampLeftVol >> VOLUMERAMPPRECISION;\
        }

Definition at line 620 of file fastmix.cpp.

 
#define END_RAMPMIX_INTERFACE  ) 
 

Value:

SNDMIX_ENDSAMPLELOOP\
                pChannel->nRampRightVol = nRampRightVol;\
                pChannel->nRightVol = nRampRightVol >> VOLUMERAMPPRECISION;\
                pChannel->nRampLeftVol = nRampLeftVol;\
                pChannel->nLeftVol = nRampLeftVol >> VOLUMERAMPPRECISION;\
        }

Definition at line 582 of file fastmix.cpp.

 
#define END_RAMPMIX_STFLT_INTERFACE  ) 
 

Value:

SNDMIX_ENDSAMPLELOOP\
                MIX_END_STEREO_FILTER\
                pChannel->nRampRightVol = nRampRightVol;\
                pChannel->nRightVol = nRampRightVol >> VOLUMERAMPPRECISION;\
                pChannel->nRampLeftVol = nRampLeftVol;\
                pChannel->nLeftVol = nRampLeftVol >> VOLUMERAMPPRECISION;\
        }

Definition at line 646 of file fastmix.cpp.

#define M_zBESSELEPS   1e-21
 

Definition at line 190 of file fastmix.cpp.

#define M_zEPS   1e-8
 

Definition at line 189 of file fastmix.cpp.

Referenced by CzWINDOWEDFIR::coef().

#define M_zPI   3.1415926535897932384626433832795
 

Definition at line 187 of file fastmix.cpp.

Referenced by CzWINDOWEDFIR::coef().

#define MIX_BEGIN_FILTER
 

Value:

int fy1 = pChannel->nFilter_Y1;\
        int fy2 = pChannel->nFilter_Y2;\

Definition at line 530 of file fastmix.cpp.

#define MIX_BEGIN_STEREO_FILTER
 

Value:

int fy1 = pChannel->nFilter_Y1;\
        int fy2 = pChannel->nFilter_Y2;\
        int fy3 = pChannel->nFilter_Y3;\
        int fy4 = pChannel->nFilter_Y4;\

Definition at line 544 of file fastmix.cpp.

#define MIX_END_FILTER
 

Value:

pChannel->nFilter_Y1 = fy1;\
        pChannel->nFilter_Y2 = fy2;

Definition at line 534 of file fastmix.cpp.

#define MIX_END_STEREO_FILTER
 

Value:

pChannel->nFilter_Y1 = fy1;\
        pChannel->nFilter_Y2 = fy2;\
        pChannel->nFilter_Y3 = fy3;\
        pChannel->nFilter_Y4 = fy4;\

Definition at line 550 of file fastmix.cpp.

#define MIXING_LIMITMAX   (0x08100000)
 

#define MIXING_LIMITMIN   (-MIXING_LIMITMAX)
 

#define MIXNDX_16BIT   0x01
 

Definition at line 1257 of file fastmix.cpp.

Referenced by CSoundFile::CreateStereoMix().

#define MIXNDX_FILTER   0x08
 

Definition at line 1260 of file fastmix.cpp.

Referenced by CSoundFile::CreateStereoMix().

#define MIXNDX_FIRSRC   0x30
 

Definition at line 1263 of file fastmix.cpp.

Referenced by CSoundFile::CreateStereoMix().

#define MIXNDX_LINEARSRC   0x10
 

Definition at line 1261 of file fastmix.cpp.

Referenced by CSoundFile::CreateStereoMix().

#define MIXNDX_RAMP   0x04
 

Definition at line 1259 of file fastmix.cpp.

Referenced by CSoundFile::CreateStereoMix().

#define MIXNDX_SPLINESRC   0x20
 

Definition at line 1262 of file fastmix.cpp.

Referenced by CSoundFile::CreateStereoMix().

#define MIXNDX_STEREO   0x02
 

Definition at line 1258 of file fastmix.cpp.

Referenced by CSoundFile::CreateStereoMix().

#define OFSDECAYMASK   0xFF
 

#define OFSDECAYMASK   0xFF
 

#define OFSDECAYSHIFT   8
 

#define OFSDECAYSHIFT   8
 

#define SNDMIX_BEGINSAMPLELOOP16
 

Value:

register MODCHANNEL * const pChn = pChannel;\
        nPos = pChn->nPosLo;\
        const signed short *p = (signed short *)(pChn->pCurrentSample+(pChn->nPos*2));\
        if (pChn->dwFlags & CHN_STEREO) p += pChn->nPos;\
        int *pvol = pbuffer;\
        do {

Definition at line 288 of file fastmix.cpp.

#define SNDMIX_BEGINSAMPLELOOP8
 

Value:

register MODCHANNEL * const pChn = pChannel;\
        nPos = pChn->nPosLo;\
        const signed char *p = (signed char *)(pChn->pCurrentSample+pChn->nPos);\
        if (pChn->dwFlags & CHN_STEREO) p += pChn->nPos;\
        int *pvol = pbuffer;\
        do {

Definition at line 280 of file fastmix.cpp.

#define SNDMIX_ENDSAMPLELOOP
 

Value:

nPos += pChn->nInc;\
        } while (pvol < pbufmax);\
        pChn->nPos += nPos >> 16;\
        pChn->nPosLo = nPos & 0xFFFF;

Definition at line 296 of file fastmix.cpp.

#define SNDMIX_ENDSAMPLELOOP16   SNDMIX_ENDSAMPLELOOP
 

Definition at line 303 of file fastmix.cpp.

#define SNDMIX_ENDSAMPLELOOP8   SNDMIX_ENDSAMPLELOOP
 

Definition at line 302 of file fastmix.cpp.

#define SNDMIX_GETMONOVOL16FIRFILTER
 

Value:

int poshi  = nPos >> 16;\
        int poslo  = (nPos & 0xFFFF);\
        int firidx = ((poslo+WFIR_FRACHALVE)>>WFIR_FRACSHIFT) & WFIR_FRACMASK; \
    int vol1   = (CzWINDOWEDFIR::lut[firidx+0]*(int)p[poshi+1-4]);      \
                vol1  += (CzWINDOWEDFIR::lut[firidx+1]*(int)p[poshi+2-4]);      \
                vol1  += (CzWINDOWEDFIR::lut[firidx+2]*(int)p[poshi+3-4]);      \
                vol1  += (CzWINDOWEDFIR::lut[firidx+3]*(int)p[poshi+4-4]);      \
        int vol2   = (CzWINDOWEDFIR::lut[firidx+4]*(int)p[poshi+5-4]);  \
                vol2  += (CzWINDOWEDFIR::lut[firidx+5]*(int)p[poshi+6-4]);      \
                vol2  += (CzWINDOWEDFIR::lut[firidx+6]*(int)p[poshi+7-4]);      \
                vol2  += (CzWINDOWEDFIR::lut[firidx+7]*(int)p[poshi+8-4]);      \
        int vol    = ((vol1>>1)+(vol2>>1)) >> (WFIR_16BITSHIFT-1);

Definition at line 370 of file fastmix.cpp.

#define SNDMIX_GETMONOVOL16LINEAR
 

Value:

int poshi = nPos >> 16;\
        int poslo = (nPos >> 8) & 0xFF;\
        int srcvol = p[poshi];\
        int destvol = p[poshi+1];\
        int vol = srcvol + ((int)(poslo * (destvol - srcvol)) >> 8);

Definition at line 323 of file fastmix.cpp.

#define SNDMIX_GETMONOVOL16NOIDO   int vol = p[nPos >> 16];
 

Definition at line 312 of file fastmix.cpp.

#define SNDMIX_GETMONOVOL16SPLINE
 

Value:

int poshi       = nPos >> 16; \
        int poslo       = (nPos >> SPLINE_FRACSHIFT) & SPLINE_FRACMASK; \
        int vol         = (CzCUBICSPLINE::lut[poslo  ]*(int)p[poshi-1] + \
                       CzCUBICSPLINE::lut[poslo+1]*(int)p[poshi  ] + \
                       CzCUBICSPLINE::lut[poslo+3]*(int)p[poshi+2] + \
                       CzCUBICSPLINE::lut[poslo+2]*(int)p[poshi+1]) >> SPLINE_16SHIFT;

Definition at line 342 of file fastmix.cpp.

#define SNDMIX_GETMONOVOL8FIRFILTER
 

Value:

int poshi  = nPos >> 16;\
        int poslo  = (nPos & 0xFFFF);\
        int firidx = ((poslo+WFIR_FRACHALVE)>>WFIR_FRACSHIFT) & WFIR_FRACMASK; \
        int vol    = (CzWINDOWEDFIR::lut[firidx+0]*(int)p[poshi+1-4]);  \
                vol   += (CzWINDOWEDFIR::lut[firidx+1]*(int)p[poshi+2-4]);      \
                vol   += (CzWINDOWEDFIR::lut[firidx+2]*(int)p[poshi+3-4]);      \
                vol   += (CzWINDOWEDFIR::lut[firidx+3]*(int)p[poshi+4-4]);      \
                vol   += (CzWINDOWEDFIR::lut[firidx+4]*(int)p[poshi+5-4]);      \
                vol   += (CzWINDOWEDFIR::lut[firidx+5]*(int)p[poshi+6-4]);      \
                vol   += (CzWINDOWEDFIR::lut[firidx+6]*(int)p[poshi+7-4]);      \
                vol   += (CzWINDOWEDFIR::lut[firidx+7]*(int)p[poshi+8-4]);      \
                vol  >>= WFIR_8SHIFT;

Definition at line 356 of file fastmix.cpp.

#define SNDMIX_GETMONOVOL8LINEAR
 

Value:

int poshi = nPos >> 16;\
        int poslo = (nPos >> 8) & 0xFF;\
        int srcvol = p[poshi];\
        int destvol = p[poshi+1];\
        int vol = (srcvol<<8) + ((int)(poslo * (destvol - srcvol)));

Definition at line 316 of file fastmix.cpp.

#define SNDMIX_GETMONOVOL8NOIDO   int vol = p[nPos >> 16] << 8;
 

Definition at line 309 of file fastmix.cpp.

#define SNDMIX_GETMONOVOL8SPLINE
 

Value:

int poshi       = nPos >> 16; \
        int poslo       = (nPos >> SPLINE_FRACSHIFT) & SPLINE_FRACMASK; \
        int vol         = (CzCUBICSPLINE::lut[poslo  ]*(int)p[poshi-1] + \
                       CzCUBICSPLINE::lut[poslo+1]*(int)p[poshi  ] + \
                       CzCUBICSPLINE::lut[poslo+3]*(int)p[poshi+2] + \
                       CzCUBICSPLINE::lut[poslo+2]*(int)p[poshi+1]) >> SPLINE_8SHIFT;

Definition at line 334 of file fastmix.cpp.

#define SNDMIX_GETSTEREOVOL16FIRFILTER
 

Value:

int poshi   = nPos >> 16;\
        int poslo   = (nPos & 0xFFFF);\
        int firidx  = ((poslo+WFIR_FRACHALVE)>>WFIR_FRACSHIFT) & WFIR_FRACMASK; \
    int vol1_l  = (CzWINDOWEDFIR::lut[firidx+0]*(int)p[(poshi+1-4)*2  ]);       \
                vol1_l += (CzWINDOWEDFIR::lut[firidx+1]*(int)p[(poshi+2-4)*2  ]);       \
                vol1_l += (CzWINDOWEDFIR::lut[firidx+2]*(int)p[(poshi+3-4)*2  ]);       \
                vol1_l += (CzWINDOWEDFIR::lut[firidx+3]*(int)p[(poshi+4-4)*2  ]);       \
        int vol2_l  = (CzWINDOWEDFIR::lut[firidx+4]*(int)p[(poshi+5-4)*2  ]);   \
                vol2_l += (CzWINDOWEDFIR::lut[firidx+5]*(int)p[(poshi+6-4)*2  ]);       \
                vol2_l += (CzWINDOWEDFIR::lut[firidx+6]*(int)p[(poshi+7-4)*2  ]);       \
                vol2_l += (CzWINDOWEDFIR::lut[firidx+7]*(int)p[(poshi+8-4)*2  ]);       \
        int vol_l   = ((vol1_l>>1)+(vol2_l>>1)) >> (WFIR_16BITSHIFT-1); \
        int vol1_r  = (CzWINDOWEDFIR::lut[firidx+0]*(int)p[(poshi+1-4)*2+1]);   \
                vol1_r += (CzWINDOWEDFIR::lut[firidx+1]*(int)p[(poshi+2-4)*2+1]);       \
                vol1_r += (CzWINDOWEDFIR::lut[firidx+2]*(int)p[(poshi+3-4)*2+1]);       \
                vol1_r += (CzWINDOWEDFIR::lut[firidx+3]*(int)p[(poshi+4-4)*2+1]);       \
        int vol2_r  = (CzWINDOWEDFIR::lut[firidx+4]*(int)p[(poshi+5-4)*2+1]);   \
                vol2_r += (CzWINDOWEDFIR::lut[firidx+5]*(int)p[(poshi+6-4)*2+1]);       \
                vol2_r += (CzWINDOWEDFIR::lut[firidx+6]*(int)p[(poshi+7-4)*2+1]);       \
                vol2_r += (CzWINDOWEDFIR::lut[firidx+7]*(int)p[(poshi+8-4)*2+1]);       \
        int vol_r   = ((vol1_r>>1)+(vol2_r>>1)) >> (WFIR_16BITSHIFT-1);

Definition at line 462 of file fastmix.cpp.

#define SNDMIX_GETSTEREOVOL16LINEAR
 

Value:

int poshi = nPos >> 16;\
        int poslo = (nPos >> 8) & 0xFF;\
        int srcvol_l = p[poshi*2];\
        int vol_l = srcvol_l + ((int)(poslo * (p[poshi*2+2] - srcvol_l)) >> 8);\
        int srcvol_r = p[poshi*2+1];\
        int vol_r = srcvol_r + ((int)(poslo * (p[poshi*2+3] - srcvol_r)) >> 8);\

Definition at line 405 of file fastmix.cpp.

#define SNDMIX_GETSTEREOVOL16NOIDO
 

Value:

int vol_l = p[(nPos>>16)*2];\
        int vol_r = p[(nPos>>16)*2+1];

Definition at line 392 of file fastmix.cpp.

#define SNDMIX_GETSTEREOVOL16SPLINE
 

Value:

int poshi       = nPos >> 16; \
        int poslo       = (nPos >> SPLINE_FRACSHIFT) & SPLINE_FRACMASK; \
        int vol_l       = (CzCUBICSPLINE::lut[poslo  ]*(int)p[(poshi-1)*2  ] + \
                       CzCUBICSPLINE::lut[poslo+1]*(int)p[(poshi  )*2  ] + \
                       CzCUBICSPLINE::lut[poslo+2]*(int)p[(poshi+1)*2  ] + \
                       CzCUBICSPLINE::lut[poslo+3]*(int)p[(poshi+2)*2  ]) >> SPLINE_16SHIFT; \
        int vol_r       = (CzCUBICSPLINE::lut[poslo  ]*(int)p[(poshi-1)*2+1] + \
                       CzCUBICSPLINE::lut[poslo+1]*(int)p[(poshi  )*2+1] + \
                       CzCUBICSPLINE::lut[poslo+2]*(int)p[(poshi+1)*2+1] + \
                       CzCUBICSPLINE::lut[poslo+3]*(int)p[(poshi+2)*2+1]) >> SPLINE_16SHIFT;

Definition at line 426 of file fastmix.cpp.

#define SNDMIX_GETSTEREOVOL8FIRFILTER
 

Value:

int poshi   = nPos >> 16;\
        int poslo   = (nPos & 0xFFFF);\
        int firidx  = ((poslo+WFIR_FRACHALVE)>>WFIR_FRACSHIFT) & WFIR_FRACMASK; \
        int vol_l   = (CzWINDOWEDFIR::lut[firidx+0]*(int)p[(poshi+1-4)*2  ]);   \
                vol_l  += (CzWINDOWEDFIR::lut[firidx+1]*(int)p[(poshi+2-4)*2  ]);       \
                vol_l  += (CzWINDOWEDFIR::lut[firidx+2]*(int)p[(poshi+3-4)*2  ]);       \
                vol_l  += (CzWINDOWEDFIR::lut[firidx+3]*(int)p[(poshi+4-4)*2  ]);       \
                vol_l  += (CzWINDOWEDFIR::lut[firidx+4]*(int)p[(poshi+5-4)*2  ]);       \
                vol_l  += (CzWINDOWEDFIR::lut[firidx+5]*(int)p[(poshi+6-4)*2  ]);       \
                vol_l  += (CzWINDOWEDFIR::lut[firidx+6]*(int)p[(poshi+7-4)*2  ]);       \
                vol_l  += (CzWINDOWEDFIR::lut[firidx+7]*(int)p[(poshi+8-4)*2  ]);       \
                vol_l >>= WFIR_8SHIFT; \
        int vol_r   = (CzWINDOWEDFIR::lut[firidx+0]*(int)p[(poshi+1-4)*2+1]);   \
                vol_r  += (CzWINDOWEDFIR::lut[firidx+1]*(int)p[(poshi+2-4)*2+1]);       \
                vol_r  += (CzWINDOWEDFIR::lut[firidx+2]*(int)p[(poshi+3-4)*2+1]);       \
                vol_r  += (CzWINDOWEDFIR::lut[firidx+3]*(int)p[(poshi+4-4)*2+1]);       \
                vol_r  += (CzWINDOWEDFIR::lut[firidx+4]*(int)p[(poshi+5-4)*2+1]);       \
                vol_r  += (CzWINDOWEDFIR::lut[firidx+5]*(int)p[(poshi+6-4)*2+1]);       \
                vol_r  += (CzWINDOWEDFIR::lut[firidx+6]*(int)p[(poshi+7-4)*2+1]);       \
                vol_r  += (CzWINDOWEDFIR::lut[firidx+7]*(int)p[(poshi+8-4)*2+1]);       \
                vol_r >>= WFIR_8SHIFT;

Definition at line 439 of file fastmix.cpp.

#define SNDMIX_GETSTEREOVOL8LINEAR
 

Value:

int poshi = nPos >> 16;\
        int poslo = (nPos >> 8) & 0xFF;\
        int srcvol_l = p[poshi*2];\
        int vol_l = (srcvol_l<<8) + ((int)(poslo * (p[poshi*2+2] - srcvol_l)));\
        int srcvol_r = p[poshi*2+1];\
        int vol_r = (srcvol_r<<8) + ((int)(poslo * (p[poshi*2+3] - srcvol_r)));

Definition at line 397 of file fastmix.cpp.

#define SNDMIX_GETSTEREOVOL8NOIDO
 

Value:

int vol_l = p[(nPos>>16)*2] << 8;\
        int vol_r = p[(nPos>>16)*2+1] << 8;

Definition at line 388 of file fastmix.cpp.

#define SNDMIX_GETSTEREOVOL8SPLINE
 

Value:

int poshi       = nPos >> 16; \
        int poslo       = (nPos >> SPLINE_FRACSHIFT) & SPLINE_FRACMASK; \
        int vol_l       = (CzCUBICSPLINE::lut[poslo  ]*(int)p[(poshi-1)*2  ] + \
                       CzCUBICSPLINE::lut[poslo+1]*(int)p[(poshi  )*2  ] + \
                       CzCUBICSPLINE::lut[poslo+2]*(int)p[(poshi+1)*2  ] + \
                       CzCUBICSPLINE::lut[poslo+3]*(int)p[(poshi+2)*2  ]) >> SPLINE_8SHIFT; \
        int vol_r       = (CzCUBICSPLINE::lut[poslo  ]*(int)p[(poshi-1)*2+1] + \
                       CzCUBICSPLINE::lut[poslo+1]*(int)p[(poshi  )*2+1] + \
                       CzCUBICSPLINE::lut[poslo+2]*(int)p[(poshi+1)*2+1] + \
                       CzCUBICSPLINE::lut[poslo+3]*(int)p[(poshi+2)*2+1]) >> SPLINE_8SHIFT;

Definition at line 414 of file fastmix.cpp.

#define SNDMIX_PROCESSFILTER
 

Value:

vol = (vol * pChn->nFilter_A0 + fy1 * pChn->nFilter_B0 + fy2 * pChn->nFilter_B1 + 4096) >> 13;\
        fy2 = fy1;\
        fy1 = vol;\

Definition at line 538 of file fastmix.cpp.

#define SNDMIX_PROCESSSTEREOFILTER
 

Value:

vol_l = (vol_l * pChn->nFilter_A0 + fy1 * pChn->nFilter_B0 + fy2 * pChn->nFilter_B1 + 4096) >> 13;\
        vol_r = (vol_r * pChn->nFilter_A0 + fy3 * pChn->nFilter_B0 + fy4 * pChn->nFilter_B1 + 4096) >> 13;\
        fy2 = fy1; fy1 = vol_l;\
        fy4 = fy3; fy3 = vol_r;\

Definition at line 556 of file fastmix.cpp.

#define SNDMIX_RAMPFASTMONOVOL
 

Value:

nRampRightVol += pChn->nRightRamp;\
        int fastvol = vol * (nRampRightVol >> VOLUMERAMPPRECISION);\
        pvol[0] += fastvol;\
        pvol[1] += fastvol;\
        pvol += 2;

Definition at line 511 of file fastmix.cpp.

#define SNDMIX_RAMPMONOVOL
 

Value:

nRampLeftVol += pChn->nLeftRamp;\
        nRampRightVol += pChn->nRightRamp;\
        pvol[0] += vol * (nRampRightVol >> VOLUMERAMPPRECISION);\
        pvol[1] += vol * (nRampLeftVol >> VOLUMERAMPPRECISION);\
        pvol += 2;

Definition at line 504 of file fastmix.cpp.

#define SNDMIX_RAMPSTEREOVOL
 

Value:

nRampLeftVol += pChn->nLeftRamp;\
        nRampRightVol += pChn->nRightRamp;\
        pvol[0] += vol_l * (nRampRightVol >> VOLUMERAMPPRECISION);\
        pvol[1] += vol_r * (nRampLeftVol >> VOLUMERAMPPRECISION);\
        pvol += 2;

Definition at line 518 of file fastmix.cpp.

#define SNDMIX_STOREFASTMONOVOL
 

Value:

int v = vol * pChn->nRightVol;\
        pvol[0] += v;\
        pvol[1] += v;\
        pvol += 2;

Definition at line 498 of file fastmix.cpp.

#define SNDMIX_STOREMONOVOL
 

Value:

pvol[0] += vol * pChn->nRightVol;\
        pvol[1] += vol * pChn->nLeftVol;\
        pvol += 2;

Definition at line 488 of file fastmix.cpp.

#define SNDMIX_STORESTEREOVOL
 

Value:

pvol[0] += vol_l * pChn->nRightVol;\
        pvol[1] += vol_r * pChn->nLeftVol;\
        pvol += 2;

Definition at line 493 of file fastmix.cpp.

#define SPLINE_16SHIFT   (SPLINE_QUANTBITS)
 

Definition at line 94 of file fastmix.cpp.

#define SPLINE_8SHIFT   (SPLINE_QUANTBITS-8)
 

Definition at line 93 of file fastmix.cpp.

#define SPLINE_CLAMPFORUNITY
 

Definition at line 96 of file fastmix.cpp.

#define SPLINE_FRACBITS   10
 

Definition at line 98 of file fastmix.cpp.

Referenced by CzCUBICSPLINE::CzCUBICSPLINE().

#define SPLINE_FRACMASK   (((1L<<(16-SPLINE_FRACSHIFT))-1)&~3)
 

Definition at line 332 of file fastmix.cpp.

#define SPLINE_FRACSHIFT   ((16-SPLINE_FRACBITS)-2)
 

Definition at line 331 of file fastmix.cpp.

#define SPLINE_LUTLEN   (1L<<SPLINE_FRACBITS)
 

Definition at line 99 of file fastmix.cpp.

#define SPLINE_QUANTBITS   14
 

Definition at line 91 of file fastmix.cpp.

#define SPLINE_QUANTSCALE   (1L<<SPLINE_QUANTBITS)
 

Definition at line 92 of file fastmix.cpp.

Referenced by CzCUBICSPLINE::CzCUBICSPLINE().

#define WFIR_16BITSHIFT   (WFIR_QUANTBITS)
 

Definition at line 165 of file fastmix.cpp.

#define WFIR_8SHIFT   (WFIR_QUANTBITS-8)
 

Definition at line 164 of file fastmix.cpp.

#define WFIR_BLACKMAN3T61   3
 

Definition at line 179 of file fastmix.cpp.

Referenced by CzWINDOWEDFIR::coef().

#define WFIR_BLACKMAN3T67   4
 

Definition at line 180 of file fastmix.cpp.

Referenced by CzWINDOWEDFIR::coef().

#define WFIR_BLACKMAN4T74   6
 

Definition at line 182 of file fastmix.cpp.

Referenced by CzWINDOWEDFIR::coef().

#define WFIR_BLACKMAN4T92   5
 

Definition at line 181 of file fastmix.cpp.

Referenced by CzWINDOWEDFIR::coef().

#define WFIR_BLACKMANEXACT   2
 

Definition at line 178 of file fastmix.cpp.

Referenced by CzWINDOWEDFIR::coef().

#define WFIR_CUTOFF   0.90f
 

Definition at line 174 of file fastmix.cpp.

Referenced by CzWINDOWEDFIR::CzWINDOWEDFIR().

#define WFIR_FRACBITS   10
 

Definition at line 167 of file fastmix.cpp.

Referenced by CzWINDOWEDFIR::CzWINDOWEDFIR().

#define WFIR_FRACHALVE   (1L<<(16-(WFIR_FRACBITS+2)))
 

Definition at line 354 of file fastmix.cpp.

#define WFIR_FRACMASK   ((((1L<<(17-WFIR_FRACSHIFT))-1)&~((1L<<WFIR_LOG2WIDTH)-1)))
 

Definition at line 353 of file fastmix.cpp.

#define WFIR_FRACSHIFT   (16-(WFIR_FRACBITS+1+WFIR_LOG2WIDTH))
 

Definition at line 352 of file fastmix.cpp.

#define WFIR_HAMMING   1
 

Definition at line 177 of file fastmix.cpp.

Referenced by CzWINDOWEDFIR::coef().

#define WFIR_HANN   0
 

Definition at line 176 of file fastmix.cpp.

Referenced by CzWINDOWEDFIR::coef().

#define WFIR_KAISER4T   7
 

Definition at line 183 of file fastmix.cpp.

Referenced by CzWINDOWEDFIR::coef().

#define WFIR_LOG2WIDTH   3
 

Definition at line 170 of file fastmix.cpp.

Referenced by CzWINDOWEDFIR::CzWINDOWEDFIR().

#define WFIR_LUTLEN   ((1L<<(WFIR_FRACBITS+1))+1)
 

Definition at line 168 of file fastmix.cpp.

Referenced by CzWINDOWEDFIR::CzWINDOWEDFIR().

#define WFIR_QUANTBITS   15
 

Definition at line 162 of file fastmix.cpp.

#define WFIR_QUANTSCALE   (1L<<WFIR_QUANTBITS)
 

Definition at line 163 of file fastmix.cpp.

Referenced by CzWINDOWEDFIR::CzWINDOWEDFIR().

#define WFIR_SMPSPERWING   ((WFIR_WIDTH-1)>>1)
 

Definition at line 172 of file fastmix.cpp.

#define WFIR_TYPE   WFIR_BLACKMANEXACT
 

Definition at line 184 of file fastmix.cpp.

Referenced by CzWINDOWEDFIR::CzWINDOWEDFIR().

#define WFIR_WIDTH   (1L<<WFIR_LOG2WIDTH)
 

Definition at line 171 of file fastmix.cpp.

Referenced by CzWINDOWEDFIR::CzWINDOWEDFIR().


Typedef Documentation

typedef VOID(MPPASMCALL * LPMIXINTERFACE)(MODCHANNEL *, int *, int *)
 

Definition at line 565 of file fastmix.cpp.


Function Documentation

__declspec naked   ) 
 

static LONG MPPFASTCALL GetSampleCount MODCHANNEL pChn,
LONG  nSamples
[static]
 

Definition at line 1328 of file fastmix.cpp.

References CHN_LOOP, CHN_PINGPONGFLAG, CHN_PINGPONGLOOP, _MODCHANNEL::dwFlags, _MODCHANNEL::nInc, _MODCHANNEL::nLength, _MODCHANNEL::nLoopStart, _MODCHANNEL::nPos, and _MODCHANNEL::nPosLo.

Referenced by CSoundFile::CreateStereoMix().

void MPPASMCALL X86_EndChannelOfs MODCHANNEL pChannel,
int *  pBuffer,
UINT  nSamples
 

Referenced by CSoundFile::CreateStereoMix().

void X86_FloatToStereoMix const float *  pIn1,
const float *  pIn2,
int *  pOut,
UINT  nCount
 

void MPPASMCALL X86_InitMixBuffer int *  pBuffer,
UINT  nSamples
 

Referenced by CSoundFile::CreateStereoMix().

void MPPASMCALL X86_StereoFill int *  pBuffer,
UINT  nSamples,
LPLONG  lpROfs,
LPLONG  lpLOfs
 

Referenced by CSoundFile::Read().

void X86_StereoMixToFloat const int *  ,
float *  ,
float *  ,
UINT  nCount
 


Variable Documentation

short int gFastSinc[]
 

short int gKaiserSinc[]
 

LONG gnDryLOfsVol
 

Definition at line 41 of file sndmix.cpp.

Referenced by CSoundFile::CreateStereoMix(), CSoundFile::InitPlayer(), and CSoundFile::Read().

LONG gnDryROfsVol
 

Definition at line 40 of file sndmix.cpp.

Referenced by CSoundFile::CreateStereoMix(), CSoundFile::InitPlayer(), and CSoundFile::Read().

UINT gnReverbSend
 

Definition at line 69 of file sndmix.cpp.

Referenced by CSoundFile::CreateStereoMix(), and CSoundFile::Read().

LONG gnRvbLOfsVol
 

Definition at line 43 of file sndmix.cpp.

Referenced by CSoundFile::InitPlayer().

LONG gnRvbROfsVol
 

Definition at line 42 of file sndmix.cpp.

Referenced by CSoundFile::InitPlayer().

const LPMIXINTERFACE gpFastMixFunctionTable[2 *2 *16]
 

Initial value:

{
        
        FastMono8BitMix,                        FastMono16BitMix,                       Stereo8BitMix,                  Stereo16BitMix,
        FastMono8BitRampMix,            FastMono16BitRampMix,           Stereo8BitRampMix,              Stereo16BitRampMix,
        
        FilterMono8BitMix,                      FilterMono16BitMix,                     FilterStereo8BitMix,    FilterStereo16BitMix,
        FilterMono8BitRampMix,          FilterMono16BitRampMix,         FilterStereo8BitRampMix,FilterStereo16BitRampMix,
        
        FastMono8BitLinearMix,          FastMono16BitLinearMix,         Stereo8BitLinearMix,    Stereo16BitLinearMix,
        FastMono8BitLinearRampMix,      FastMono16BitLinearRampMix,     Stereo8BitLinearRampMix,Stereo16BitLinearRampMix,
        
        FilterMono8BitLinearMix,        FilterMono16BitLinearMix,       FilterStereo8BitLinearMix,      FilterStereo16BitLinearMix,
        FilterMono8BitLinearRampMix,FilterMono16BitLinearRampMix,FilterStereo8BitLinearRampMix,FilterStereo16BitLinearRampMix,
        
        
        Mono8BitSplineMix,              Mono16BitSplineMix,             Stereo8BitSplineMix,    Stereo16BitSplineMix,
        Mono8BitSplineRampMix,  Mono16BitSplineRampMix, Stereo8BitSplineRampMix,Stereo16BitSplineRampMix,
        
        FilterMono8BitSplineMix,        FilterMono16BitSplineMix,       FilterStereo8BitSplineMix,      FilterStereo16BitSplineMix,
        FilterMono8BitSplineRampMix,FilterMono16BitSplineRampMix,FilterStereo8BitSplineRampMix,FilterStereo16BitSplineRampMix,
        
        
        Mono8BitFirFilterMix,           Mono16BitFirFilterMix,          Stereo8BitFirFilterMix, Stereo16BitFirFilterMix,
        Mono8BitFirFilterRampMix,       Mono16BitFirFilterRampMix,      Stereo8BitFirFilterRampMix,Stereo16BitFirFilterRampMix,
        
        FilterMono8BitFirFilterMix,     FilterMono16BitFirFilterMix,    FilterStereo8BitFirFilterMix,   FilterStereo16BitFirFilterMix,
        FilterMono8BitFirFilterRampMix,FilterMono16BitFirFilterRampMix,FilterStereo8BitFirFilterRampMix,FilterStereo16BitFirFilterRampMix,
}

Definition at line 1295 of file fastmix.cpp.

Referenced by CSoundFile::CreateStereoMix().

const LPMIXINTERFACE gpMixFunctionTable[2 *2 *16]
 

Initial value:

{
        
        Mono8BitMix,                            Mono16BitMix,                           Stereo8BitMix,                  Stereo16BitMix,
        Mono8BitRampMix,                        Mono16BitRampMix,                       Stereo8BitRampMix,              Stereo16BitRampMix,
        
        FilterMono8BitMix,                      FilterMono16BitMix,                     FilterStereo8BitMix,    FilterStereo16BitMix,
        FilterMono8BitRampMix,          FilterMono16BitRampMix,         FilterStereo8BitRampMix,FilterStereo16BitRampMix,
        
        Mono8BitLinearMix,                      Mono16BitLinearMix,                     Stereo8BitLinearMix,    Stereo16BitLinearMix,
        Mono8BitLinearRampMix,          Mono16BitLinearRampMix,         Stereo8BitLinearRampMix,Stereo16BitLinearRampMix,
        
        FilterMono8BitLinearMix,        FilterMono16BitLinearMix,       FilterStereo8BitLinearMix,      FilterStereo16BitLinearMix,
        FilterMono8BitLinearRampMix,FilterMono16BitLinearRampMix,FilterStereo8BitLinearRampMix,FilterStereo16BitLinearRampMix,

        
        Mono8BitSplineMix,                      Mono16BitSplineMix,                     Stereo8BitSplineMix,    Stereo16BitSplineMix,
        Mono8BitSplineRampMix,          Mono16BitSplineRampMix,         Stereo8BitSplineRampMix,Stereo16BitSplineRampMix,
        
        FilterMono8BitSplineMix,        FilterMono16BitSplineMix,       FilterStereo8BitSplineMix,      FilterStereo16BitSplineMix,
        FilterMono8BitSplineRampMix,FilterMono16BitSplineRampMix,FilterStereo8BitSplineRampMix,FilterStereo16BitSplineRampMix,
        
        
        Mono8BitFirFilterMix,                   Mono16BitFirFilterMix,                  Stereo8BitFirFilterMix, Stereo16BitFirFilterMix,
        Mono8BitFirFilterRampMix,               Mono16BitFirFilterRampMix,              Stereo8BitFirFilterRampMix,Stereo16BitFirFilterRampMix,
        
        FilterMono8BitFirFilterMix,     FilterMono16BitFirFilterMix,    FilterStereo8BitFirFilterMix,   FilterStereo16BitFirFilterMix,
        FilterMono8BitFirFilterRampMix,FilterMono16BitFirFilterRampMix,FilterStereo8BitFirFilterRampMix,FilterStereo16BitFirFilterRampMix
}

Definition at line 1265 of file fastmix.cpp.

Referenced by CSoundFile::CreateStereoMix().

int DWORD LPLONG lpMin
 

Definition at line 1640 of file fastmix.cpp.

int DWORD lSampleCount
 

Definition at line 1640 of file fastmix.cpp.

Referenced by CSoundFile::Read().

float MixFloatBuffer[MIXBUFFERSIZE *2]
 

Definition at line 30 of file fastmix.cpp.

int MixRearBuffer[MIXBUFFERSIZE *2]
 

Definition at line 29 of file fastmix.cpp.

Referenced by CSoundFile::CreateStereoMix(), and CSoundFile::Read().

int MixReverbBuffer[MIXBUFFERSIZE *2]
 

Definition at line 24 of file fastmix.cpp.

Referenced by CSoundFile::CreateStereoMix(), CSoundFile::ProcessMonoDSP(), and CSoundFile::ProcessStereoDSP().

int MixSoundBuffer[MIXBUFFERSIZE *4]
 

Definition at line 20 of file fastmix.cpp.

Referenced by CSoundFile::CreateStereoMix(), CSoundFile::ProcessMonoDSP(), CSoundFile::ProcessStereoDSP(), and CSoundFile::Read().

int* pBuffer
 

Definition at line 1640 of file fastmix.cpp.

Referenced by MMCMP_Unpack(), and PP20_Unpack().

CzWINDOWEDFIR sfir
 

Definition at line 272 of file fastmix.cpp.

CzCUBICSPLINE sspline
 

Definition at line 144 of file fastmix.cpp.


Generated on Sat Nov 5 16:25:08 2005 for OPIE by  doxygen 1.4.2