CommandProcessingTimeEstimatorVersion4.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using Ryujinx.Audio.Renderer.Dsp.Command;
  2. using System.Diagnostics;
  3. namespace Ryujinx.Audio.Renderer.Server
  4. {
  5. /// <summary>
  6. /// <see cref="ICommandProcessingTimeEstimator"/> version 4. (added with REV10)
  7. /// </summary>
  8. public class CommandProcessingTimeEstimatorVersion4 : CommandProcessingTimeEstimatorVersion3
  9. {
  10. public CommandProcessingTimeEstimatorVersion4(uint sampleCount, uint bufferCount) : base(sampleCount, bufferCount) { }
  11. public override uint Estimate(GroupedBiquadFilterCommand command)
  12. {
  13. Debug.Assert(_sampleCount == 160 || _sampleCount == 240);
  14. if (_sampleCount == 160)
  15. {
  16. return (uint)7424.5f;
  17. }
  18. return (uint)9730.4f;
  19. }
  20. public override uint Estimate(CaptureBufferCommand command)
  21. {
  22. Debug.Assert(_sampleCount == 160 || _sampleCount == 240);
  23. if (_sampleCount == 160)
  24. {
  25. if (command.Enabled)
  26. {
  27. return (uint)435.2f;
  28. }
  29. return (uint)4261.0f;
  30. }
  31. if (command.Enabled)
  32. {
  33. return (uint)5858.26f;
  34. }
  35. return (uint)435.2f;
  36. }
  37. }
  38. }