CommandProcessingTimeEstimatorVersion4.cs 1.4 KB

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