public uint Estimate(Reverb3dCommand command) { if (command.Enabled) { return((uint)(530 * _sampleCount * command.Parameter.ChannelCount * 1.2f)); } return(0); }
/// <summary> /// Generate a new <see cref="Reverb3dCommand"/>. /// </summary> /// <param name="bufferOffset">The target buffer offset.</param> /// <param name="parameter">The reverb 3d parameter.</param> /// <param name="state">The reverb 3d state.</param> /// <param name="isEnabled">Set to true if the effect should be active.</param> /// <param name="workBuffer">The work buffer to use for processing.</param> /// <param name="nodeId">The node id associated to this command.</param> /// <param name="newEffectChannelMappingSupported">If set to true, the new effect channel mapping for 5.1 is supported.</param> public void GenerateReverb3dEffect(uint bufferOffset, Reverb3dParameter parameter, Memory <Reverb3dState> state, bool isEnabled, CpuAddress workBuffer, int nodeId, bool newEffectChannelMappingSupported) { if (parameter.IsChannelCountValid()) { Reverb3dCommand command = new Reverb3dCommand(bufferOffset, parameter, state, isEnabled, workBuffer, nodeId, newEffectChannelMappingSupported); command.EstimatedProcessingTime = _commandProcessingTimeEstimator.Estimate(command); AddCommand(command); } }
public uint Estimate(Reverb3dCommand command) { Debug.Assert(_sampleCount == 160 || _sampleCount == 240); if (_sampleCount == 160) { if (command.Enabled) { switch (command.Parameter.ChannelCount) { case 1: return((uint)116754.0f); case 2: return((uint)125912.05f); case 4: return((uint)146336.03f); case 6: return((uint)165812.66f); default: throw new NotImplementedException($"{command.Parameter.ChannelCount}"); } } else { switch (command.Parameter.ChannelCount) { case 1: return((uint)734.0f); case 2: return((uint)766.62f); case 4: return((uint)797.46f); case 6: return((uint)867.43f); default: throw new NotImplementedException($"{command.Parameter.ChannelCount}"); } } } if (command.Enabled) { switch (command.Parameter.ChannelCount) { case 1: return((uint)170292.34f); case 2: return((uint)183875.63f); case 4: return((uint)214696.19f); case 6: return((uint)243846.77f); default: throw new NotImplementedException($"{command.Parameter.ChannelCount}"); } } else { switch (command.Parameter.ChannelCount) { case 1: return((uint)508.47f); case 2: return((uint)582.45f); case 4: return((uint)626.42f); case 6: return((uint)682.47f); default: throw new NotImplementedException($"{command.Parameter.ChannelCount}"); } } }
public uint Estimate(Reverb3dCommand command) { Debug.Assert(_sampleCount == 160 || _sampleCount == 240); if (_sampleCount == 160) { if (command.Enabled) { switch (command.Parameter.ChannelCount) { case 1: return((uint)138840.0f); case 2: return((uint)135430.0f); case 4: return((uint)199180.0f); case 6: return((uint)247350.0f); default: throw new NotImplementedException($"{command.Parameter.ChannelCount}"); } } else { switch (command.Parameter.ChannelCount) { case 1: return((uint)718.7f); case 2: return((uint)751.3f); case 4: return((uint)797.46f); case 6: return((uint)867.43f); default: throw new NotImplementedException($"{command.Parameter.ChannelCount}"); } } } if (command.Enabled) { switch (command.Parameter.ChannelCount) { case 1: return((uint)199950.0f); case 2: return((uint)195200.0f); case 4: return((uint)290580.0f); case 6: return((uint)363490.0f); default: throw new NotImplementedException($"{command.Parameter.ChannelCount}"); } } else { switch (command.Parameter.ChannelCount) { case 1: return((uint)534.24f); case 2: return((uint)570.87f); case 4: return((uint)660.93f); case 6: return((uint)694.6f); default: throw new NotImplementedException($"{command.Parameter.ChannelCount}"); } } }
public override uint Estimate(Reverb3dCommand command) { Debug.Assert(_sampleCount == 160 || _sampleCount == 240); if (_sampleCount == 160) { if (command.Enabled) { switch (command.Parameter.ChannelCount) { case 1: return(116750); case 2: return(125910); case 4: return(146340); case 6: return(165810); default: throw new NotImplementedException($"{command.Parameter.ChannelCount}"); } } else { switch (command.Parameter.ChannelCount) { case 1: return(735); case 2: return((uint)766.62f); case 4: return((uint)834.07f); case 6: return((uint)875.44f); default: throw new NotImplementedException($"{command.Parameter.ChannelCount}"); } } } if (command.Enabled) { switch (command.Parameter.ChannelCount) { case 1: return(170290); case 2: return(183880); case 4: return(214700); case 6: return(243850); default: throw new NotImplementedException($"{command.Parameter.ChannelCount}"); } } else { switch (command.Parameter.ChannelCount) { case 1: return((uint)508.47f); case 2: return((uint)582.45f); case 4: return((uint)626.42f); case 6: return((uint)682.47f); default: throw new NotImplementedException($"{command.Parameter.ChannelCount}"); } } }