Exemple #1
0
void SRS_Source_WOWHD::Process_256(SRSSamp *pIn, SRSSamp *pOut){
    if (TBWant != TBActive){    // Slide into requested TB value?
        if (TBActive == -1.0f) TBActive = TBWant;
        else Tool_SeekValue(TBWant, TBActive);

        SRS_Wowhdx_SetTBHDLevel(Obj, SRS_FXP16(TBActive, SRS_TBHD_CTRL_IWL));
    }

    if (DFWant != DFActive){    // Slide into requested Def value?
        if (DFActive == -1.0f) DFActive = DFWant;
        else Tool_SeekValue(DFWant, DFActive);

        SRS_Wowhdx_SetDefLevel(Obj, SRS_FXP16(DFActive, SRS_DEF_IWL));
    }

    int i;

    SRSStereoCh inChans;
    inChans.Left = pIn;
    inChans.Right = pIn+256;

    for (i=0; i<4; i++){
        SRS_Wowhdx_Process(Obj, &inChans, pObjWorkspace);
        inChans.Left += 64;
        inChans.Right += 64;
    }

    memcpy(pOut, pIn, 512*sizeof(SRSSamp));
}
Exemple #2
0
void SRS_Source_WOWHD::Process_256(int32_t* pIn, int32_t* pOut){
	if (TBWant != TBActive){	// Slide into requested TB value?
		if (TBActive == -1.0f) TBActive = TBWant;
		else Tool_SeekValue(TBWant, TBActive);
		
		SRS_SetWowhdTBControl(Obj, SRS_FXP16(TBActive, SRS_SATB_CTRL_IWL));
	}
	
	if (DFWant != DFActive){	// Slide into requested Def value?
		if (DFActive == -1.0f) DFActive = DFWant;
		else Tool_SeekValue(DFWant, DFActive);
		
		SRS_SetWowhdDefFactor(Obj, SRS_FXP16(DFActive, SRS_DEFINITION_IWL));
	}
	
	SRSStereoCh inChans;
	SRSStereoCh outChans;
	inChans.Left = pIn;
	inChans.Right = pIn+256;
	outChans.Left = pOut;
	outChans.Right = pOut+256;
	
	SRS_Wowhd(Obj, &inChans, &outChans, 256, pObjWorkspace);
}
Exemple #3
0
void SRS_Source_WOWHD::Config(SRS_Source_Out *pOut, SRS_Tech_WOWHD *pCFG, bool bBypass){
    if (DidCreate == false) return;

    bool bDiff_Filts = ForceActive;
    if (bDiff_Filts == false){
        if (DIFF_FORCED(XOverOrder) || DIFF_FORCED(XOverFreq)) bDiff_Filts = true;
        else if (DIFF_FORCED(HPFOrder) || DIFF_FORCED(HPFFreq)) bDiff_Filts = true;
    }

    if (bDiff_Filts){
        DidConfig = false;  // Force a re init...
        ForceActive = true;

        char tWork[SRS_IIR_DESIGN_WORKSPACE_SIZE(8)];
        int tXOverDelta = pCFG->XOverFreq/(2*pCFG->XOverOrder-1);
        SRS_IirFilterDesignFxp16(pCFG->XOverFreq - tXOverDelta, pCFG->XOverOrder, SampleRate, SRS_IIR_DESIGN_LP, XLPCoefs, tWork);
        SRS_IirFilterDesignFxp16(pCFG->XOverFreq + tXOverDelta, pCFG->XOverOrder, SampleRate, SRS_IIR_DESIGN_HP, XHPCoefs, tWork);
        SRS_IirFilterDesignFxp16(pCFG->HPFFreq, pCFG->HPFOrder, SampleRate, SRS_IIR_DESIGN_HP, TBHPCoefs, tWork);

        //FiltHold.XoverOrder = pCFG->XOverOrder;// fixed to 4
        FiltHold.XoverLpfCoefs = XLPCoefs;
        FiltHold.XoverHpfCoefs = XHPCoefs;

        FiltHold.HpfOrder = pCFG->HPFOrder;
        FiltHold.HpfCoefs = TBHPCoefs;
    }

    if (DidConfig == false){    // Re-init!
        // Initialise the objects
        if (SampleRate < 33000)         SRS_Wowhdx_InitObj32k(Obj, &FiltHold);
        else if (SampleRate < 42000)    SRS_Wowhdx_InitObj44k(Obj, &FiltHold);
        else                            SRS_Wowhdx_InitObj48k(Obj, &FiltHold);
        SRS_Wowhdx_SetControlDefaults(Obj);
        ForceActive = true;
    }

    if (DIFF_FORCED(IGain))     SRS_Wowhdx_SetInputGain(Obj, SRS_FXP16(Tool_MaxZero(pCFG->IGain, 1.0f), SRS_WOWHDX_GAIN_IWL));
    if (DIFF_FORCED(OGain))     SRS_Wowhdx_SetOutputGain(Obj, SRS_FXP16(Tool_MaxZero(pCFG->OGain, 1.0f), SRS_WOWHDX_GAIN_IWL));
    if (DIFF_FORCED(DoHPF))     SRS_Wowhdx_SetHpfEnable(Obj, pCFG->DoHPF);
    if (DIFF_FORCED(DoXOver))   SRS_Wowhdx_SetCrossoverEnable(Obj, pCFG->DoXOver);
    if (DIFF_FORCED(DoTB))      SRS_Wowhdx_SetTBHDEnable(Obj, pCFG->DoTB);

    // Set Trubass controls
    if (DIFF_FORCED(TBMin) || DIFF_FORCED(TBWindow) || DIFF_FORCED(TBSlide)){
        TBWant = Tool_MaxZero(pCFG->TBMin+(pCFG->TBWindow*pCFG->TBSlide), 1.0f);
        //SRS_Wowhdx_SetTBHDControls(Obj, SRS_FXP16(TBWant, SRS_SATB_CTRL_IWL));
        if (ForceActive) TBActive = -1.0f;
    }

    if (DIFF_FORCED(TBCompress))SRS_Wowhdx_SetTBHDCompressorLevel(Obj, SRS_FXP16(Tool_MaxZero(pCFG->TBCompress, 1.0f), SRS_TBHD_CTRL_IWL));
    if (DIFF_FORCED(TBMode)){
        if (pCFG->TBMode == 0)  SRS_Wowhdx_SetTBHDMode(Obj, SRS_TBHD_MODE_MONO);
        else                    SRS_Wowhdx_SetTBHDMode(Obj, SRS_TBHD_MODE_STEREO);
    }

    if (DIFF_FORCED(TBSize) || DIFF_FORCED(TBAnalyze)){
        char tWork[SRS_TBHD_DESIGN_WORKSPACE_SIZE];
        SRS_TruBassHDFilterDesignFxp32(pCFG->TBSize, pCFG->TBAnalyze, SampleRate, TBCoefs, tWork);

        SRSTBHDSpeakerSize tSetCustom;
        tSetCustom.AudioFilter = SRS_TBHD_SPEAKER_LF_RESPONSE_CUSTOM;
        tSetCustom.AnalysisFilter = SRS_TBHD_SPEAKER_LF_RESPONSE_CUSTOM;

        SRS_Wowhdx_SetTBHDSpeakerSize(Obj, tSetCustom);
        SRS_Wowhdx_SetTBHDCustomSpeakerCoefs(Obj, TBCoefs);
    }

    if (DIFF_FORCED(DoTBSplit)) SRS_Wowhdx_SetTBHDSplitAnalysisEnable(Obj, pCFG->DoTBSplit);

    // Set SRS3D controls
    //if (DIFF_FORCED(DoSRS))     SRS_Wowhdx_SetEnhanceMode(Obj, (pCFG->DoSRS == true) ? SRS_WOWHDX_STEREO_ENHANCE_SRS3D : SRS_WOWHDX_STEREO_ENHANCE_NONE);
    if (DIFF_FORCED(Space))     SRS_Wowhdx_SetSRS3DSpaceLevel(Obj, SRS_FXP16(pCFG->Space, SRS_SRS3D_CTRL_IWL));
    if (DIFF_FORCED(Center))    SRS_Wowhdx_SetSRS3DCenterLevel(Obj, SRS_FXP16(pCFG->Center, SRS_SRS3D_CTRL_IWL));

    if (DIFF_FORCED(SRSMode)){
        if (pCFG->SRSMode == 0)         SRS_Wowhdx_SetSRS3DMode(Obj, SRS_SRS3D_MONO);
        else if (pCFG->SRSMode == 1)    SRS_Wowhdx_SetSRS3DMode(Obj, SRS_SRS3D_SINGLE_SPEAKER);
        else                            SRS_Wowhdx_SetSRS3DMode(Obj, SRS_SRS3D_STEREO);
    }

    if (DIFF_FORCED(SRSType)){
        if (pCFG->SRSType == 0) SRS_Wowhdx_SetSRS3DHeadphoneEnable(Obj, 0); // SRSType == 0 - Speaker...
        else                    SRS_Wowhdx_SetSRS3DHeadphoneEnable(Obj, 1); // SRSType == 1 - Headphones...
    }

    // Set Focus controls
    if (DIFF_FORCED(DoFocus))   SRS_Wowhdx_SetFocusEnable(Obj, pCFG->DoFocus);
    if (DIFF_FORCED(Focus))     SRS_Wowhdx_SetFocusLevel(Obj, SRS_FXP16(Tool_MaxZero(pCFG->Focus, 1.0f), SRS_FOCUS_IWL));

    // Set Definition controls
    if (DIFF_FORCED(DoDef))     SRS_Wowhdx_SetDefEnable(Obj, pCFG->DoDef);
    if (DIFF_FORCED(DefMin) || DIFF_FORCED(DefWindow) || DIFF_FORCED(DefSlide)){
        DFWant = Tool_MaxZero(pCFG->DefMin+(pCFG->DefWindow*pCFG->DefSlide), 1.0f);
        //SRS_Wowhdx_SetDefLevel(Obj, SRS_FXP16(DFWant, SRS_DEFINITION_IWL));
        if (ForceActive) DFActive = -1.0f;
    }

    //if (DIFF_FORCED(DoWS))      SRS_Wowhdx_SetEnhanceMode(Obj, (pCFG->DoWS == true) ? SRS_WOWHDX_STEREO_ENHANCE_WDSRD : SRS_WOWHDX_STEREO_ENHANCE_NONE);
    //if (DIFF_FORCED(WSIGain))   SRS_SetWowhdPlusWdSrdInputGain(Obj, SRS_FXP16(Tool_MaxZero(pCFG->WSIGain, 1.0f), SRS_WIDESRD_GAIN_IWL));
    if (DIFF_FORCED(WSCGain))   SRS_Wowhdx_SetWdSrdCenterBoostGain(Obj, SRS_FXP16(Tool_MaxZero(pCFG->WSCGain, 1.0f), SRS_WIDESRD_GAIN_IWL));
    if (DIFF_FORCED(WSSpkSep))  SRS_Wowhdx_SetWdSrdSpeakerSeparationLevel(Obj, SRS_FXP16(pCFG->WSSpkSep, SRS_WIDESRD_SPK_SEP_IWL));

    if (DIFF_FORCED(DoSRS) || DIFF_FORCED(DoWS))
    {
        SRS_Wowhdx_SetEnhanceMode(Obj, (pCFG->DoWS == true) ? SRS_WOWHDX_STEREO_ENHANCE_WDSRD : ((pCFG->DoSRS == true) ? SRS_WOWHDX_STEREO_ENHANCE_SRS3D : SRS_WOWHDX_STEREO_ENHANCE_NONE));
    }


    // WOWHDx enable
    if (bBypass)
        SRS_Wowhdx_SetEnable(Obj, 0);
    else
        SRS_Wowhdx_SetEnable(Obj, 1);

    DidConfig = true;
    Active = *pCFG;
    ForceActive = false;
}
Exemple #4
0
void SRS_Source_WOWHD::Config(SRS_Source_Out* pOut, SRS_Tech_WOWHD* pCFG, bool bBypass){
	if (DidCreate == false) return;
	
	if (DIFF_FORCED(IGain)) SRS_SetWowhdInputGain(Obj, SRS_FXP16(Tool_MaxZero(pCFG->IGain, 1.0f), SRS_WOWHD_GAIN_IWL));
	if (DIFF_FORCED(OGain)) SRS_SetWowhdOutputGain(Obj, SRS_FXP16(Tool_MaxZero(pCFG->OGain, 1.0f), SRS_WOWHD_GAIN_IWL));
	if (DIFF_FORCED(BGain)) SRS_SetWowhdBypassGain(Obj, SRS_FXP16(Tool_MaxZero(pCFG->BGain, 1.0f), SRS_WOWHD_GAIN_IWL));
	
	if (DIFF_FORCED(DoSRS3D)) SRS_SetWowhdSrs3dEnable(Obj, pCFG->DoSRS3D);
	if (DIFF_FORCED(Space)) SRS_SetWowhdSrs3dSpaceCtrl(Obj, SRS_FXP16(pCFG->Space, 1));
	if (DIFF_FORCED(Center)) SRS_SetWowhdSrs3dCenterCtrl(Obj, SRS_FXP16(pCFG->Center, 1));
	
	if (DIFF_FORCED(SRSType)){
		if (pCFG->SRSType == 0) SRS_SetWowhdSrs3dHeadphone(Obj, 0);	// SRSType == 0 - Speaker...
		else SRS_SetWowhdSrs3dHeadphone(Obj, 1);	// SRSType == 1 - Headphones...
	}
	
	if (DIFF_FORCED(SRSMode)){
		if (pCFG->SRSMode == 0) SRS_SetWowhdSrs3dMode(Obj, SRSSrs3dMono);
		else if (pCFG->SRSMode == 1) SRS_SetWowhdSrs3dMode(Obj, SRSSrs3dSingleSpeaker);
		else if (pCFG->SRSMode == 2) SRS_SetWowhdSrs3dMode(Obj, SRSSrs3dStereo);
		else SRS_SetWowhdSrs3dMode(Obj, SRSSrs3dExtreme);
	}
	
	if (DIFF_FORCED(DoTB)) SRS_SetWowhdTBEnable(Obj, pCFG->DoTB);
	
	if (DIFF_FORCED(TBMode)){
		if (pCFG->TBMode == 0) SRS_SetWowhdTBMode(Obj, SRS_SATB_MODE_MONO);
		else SRS_SetWowhdTBMode(Obj, SRS_SATB_MODE_STEREO);
	}
	if (DIFF_FORCED(TBCompress)) SRS_SetWowhdTBCompressorCtrl(Obj, SRS_FXP16(Tool_MaxZero(pCFG->TBCompress, 1.0f), SRS_SATB_CTRL_IWL));
	
	if (DIFF_FORCED(TBFreq) || DIFF_FORCED(TBAnalyze)){
		char tWork[SRS_SA_TRUBASS_DESIGN_WORKSPACE_SIZE];
		
		SRS_SATruBassFilterDesignFxp32(pCFG->TBFreq, pCFG->TBAnalyze, SampleRate, TBCoefs, tWork);
		
		SRSSATruBassSpeakerSize tSetCustom;
		tSetCustom.AudioFilter = SRS_SATB_SPEAKER_LF_RESPONSE_Custom;
		tSetCustom.AnalysisFilter = SRS_SATB_SPEAKER_LF_RESPONSE_Custom;
		
		SRS_SetWowhdTBSpeakerSize(Obj, tSetCustom);
		SRS_SetWowhdTBCustomSpeakerFilterCoefs(Obj, TBCoefs);
	}
	
	if (DIFF_FORCED(DoTBSplit)) SRS_SetWowhdTBSplitAnalysisEnable(Obj, pCFG->DoTBSplit);
	
	if (DIFF_FORCED(TBMin) || DIFF_FORCED(TBWindow) || DIFF_FORCED(TBSlide)){
		TBWant = Tool_MaxZero(pCFG->TBMin+(pCFG->TBWindow*pCFG->TBSlide), 1.0f);
		//SRS_SetWowhdTBControl(Obj, SRS_FXP16(TBWant, SRS_SATB_CTRL_IWL));
		if (ForceActive) TBActive = -1.0f;
	}

	if (DIFF_FORCED(DoFocus)) SRS_SetWowhdFocusEnable(Obj, pCFG->DoFocus);
	if (DIFF_FORCED(Focus)) SRS_SetWowhdFocusFactor(Obj, SRS_FXP16(Tool_MaxZero(pCFG->Focus, 1.0f), 1));
	
	if (DIFF_FORCED(DoDef)) SRS_SetWowhdDefEnable(Obj, pCFG->DoDef);
	
	if (DIFF_FORCED(DefMin) || DIFF_FORCED(DefWindow) || DIFF_FORCED(DefSlide)){
		DFWant = Tool_MaxZero(pCFG->DefMin+(pCFG->DefWindow*pCFG->DefSlide), 1.0f);
		//SRS_SetWowhdDefFactor(Obj, SRS_FXP16(DFWant, SRS_DEFINITION_IWL));
		if (ForceActive) DFActive = -1.0f;
	}
	
	if (DIFF_FORCED(DoLimit)) SRS_SetWowhdLmtEnable(Obj, pCFG->DoLimit);
	if (DIFF_FORCED(LimitGain)) SRS_SetWowhdLmtMinimalGain(Obj, SRS_FXP32(Tool_MaxZero(pCFG->LimitGain, 1.0f), 2));
	
	if (bBypass) SRS_SetWowhdEnable(Obj, 0);
	else SRS_SetWowhdEnable(Obj, 1);
		
	DidConfig = true;
	Active = *pCFG;
	ForceActive = false;
}