[PR #965] [MERGED] Quantum Realm level normalisation optimization #1166

Closed
opened 2026-02-27 20:01:25 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/librespot-org/librespot/pull/965
Author: @JasonLG1979
Created: 2/5/2022
Status: Merged
Merged: 2/13/2022
Merged by: @roderickvd

Base: devHead: Quantum-Realm


📝 Commits (6)

  • 9221694 Quantum Realm level normalisation optimization
  • c01ecd6 Streamline code in convert.rs
  • b0c30aa Get rid of duplicate NUM_CHANNELS const in dither.rs
  • b2d0272 Misc cleanup
  • 0ce6fb0 Revert one of the changes to convert.rs
  • 7586aa0 Merge branch 'librespot-org:dev' into Quantum-Realm

📊 Changes

3 files changed (+98 additions, -99 deletions)

View changed files

📝 playback/src/convert.rs (+17 -23)
📝 playback/src/dither.rs (+3 -3)
📝 playback/src/player.rs (+78 -73)

📄 Description

  • We don't need to test against EPSILON. The factor will never be over 1.0 in basic normalisation mode.

  • Don't check the normalisation mode EVERY sample.

  • Do as little math as possible by simplfiying all equations as much as possible (while still retaining the textbook equations in comments).

This saves up to 1-2% CPU useage on a PI 4 depending on how much normalisation is actually being done.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/librespot-org/librespot/pull/965 **Author:** [@JasonLG1979](https://github.com/JasonLG1979) **Created:** 2/5/2022 **Status:** ✅ Merged **Merged:** 2/13/2022 **Merged by:** [@roderickvd](https://github.com/roderickvd) **Base:** `dev` ← **Head:** `Quantum-Realm` --- ### 📝 Commits (6) - [`9221694`](https://github.com/librespot-org/librespot/commit/92216940bea052370b91dedc53b8b06128f60ac1) Quantum Realm level normalisation optimization - [`c01ecd6`](https://github.com/librespot-org/librespot/commit/c01ecd65d9f57515a5fadeb581365e206c46772a) Streamline code in convert.rs - [`b0c30aa`](https://github.com/librespot-org/librespot/commit/b0c30aa5f8ee865a9c1d6f917ddb8bf7e5831972) Get rid of duplicate NUM_CHANNELS const in dither.rs - [`b2d0272`](https://github.com/librespot-org/librespot/commit/b2d02720cdda5766d2412599f972df1c88135c9d) Misc cleanup - [`0ce6fb0`](https://github.com/librespot-org/librespot/commit/0ce6fb0108e188b3e05b55952d8e52ed71fd46ac) Revert one of the changes to convert.rs - [`7586aa0`](https://github.com/librespot-org/librespot/commit/7586aa05840e506b61609bc0b8ffcb5c40018b99) Merge branch 'librespot-org:dev' into Quantum-Realm ### 📊 Changes **3 files changed** (+98 additions, -99 deletions) <details> <summary>View changed files</summary> 📝 `playback/src/convert.rs` (+17 -23) 📝 `playback/src/dither.rs` (+3 -3) 📝 `playback/src/player.rs` (+78 -73) </details> ### 📄 Description * We don't need to test against EPSILON. The factor will never be over 1.0 in basic normalisation mode. * Don't check the normalisation mode EVERY sample. * Do as little math as possible by simplfiying all equations as much as possible (while still retaining the textbook equations in comments). This saves up to 1-2% CPU useage on a PI 4 depending on how much normalisation is actually being done. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 20:01:25 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/librespot#1166
No description provided.