mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 08:15:50 +03:00
[PR #773] [MERGED] Keep samples in 64 bit #1072
Labels
No labels
A-Alsa
SpotifyAPI
Tokio 1.0
audio
bug
can't reproduce
compilation
dependencies
duplicate
enhancement
good first issue
help wanted
high priority
imported
imported
invalid
new api
pull-request
question
reverse engineering
wiki
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/librespot#1072
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/librespot-org/librespot/pull/773
Author: @roderickvd
Created: 5/27/2021
Status: ✅ Merged
Merged: 5/30/2021
Merged by: @roderickvd
Base:
dev← Head:keep-samples-in-64-bit📝 Commits (7)
c2e2a64Keep samples in 64 bitd65dfd3Addf32andf64sample sizes4c7cc64Move scale factors into named constants66dbd8aHandle 64-bit samples on other backends7039cf1Update changelogfa21aa7Merge branch 'dev' into keep-samples-in-64-bit11f8c70Merge branch 'dev' into keep-samples-in-64-bit📊 Changes
19 files changed (+177 additions, -149 deletions)
View changed files
📝
CHANGELOG.md(+2 -0)📝
playback/src/audio_backend/alsa.rs(+1 -0)📝
playback/src/audio_backend/jackaudio.rs(+4 -3)📝
playback/src/audio_backend/mod.rs(+9 -5)📝
playback/src/audio_backend/portaudio.rs(+4 -3)📝
playback/src/audio_backend/pulseaudio.rs(+3 -0)📝
playback/src/audio_backend/rodio.rs(+7 -3)📝
playback/src/audio_backend/sdl.rs(+4 -3)📝
playback/src/config.rs(+13 -9)📝
playback/src/convert.rs(+22 -15)📝
playback/src/decoder/lewton_decoder.rs(+3 -5)📝
playback/src/decoder/mod.rs(+7 -2)📝
playback/src/dither.rs(+8 -8)📝
playback/src/mixer/alsamixer.rs(+13 -13)📝
playback/src/mixer/mappings.rs(+25 -25)📝
playback/src/mixer/mod.rs(+1 -1)📝
playback/src/mixer/softmixer.rs(+10 -10)📝
playback/src/player.rs(+32 -35)📝
src/main.rs(+9 -9)📄 Description
Perhaps counter-intuitively, the main reason for doing this is higher performance. Until now we are storing samples in
f32but casting them tof64every time we manipulate them (normalisation, volume control), then cast them back again. The idea is that we can save CPU cycles and RAM copies by just keeping them inf64.Added benefits are:
To re-iterate, 64 bit sample processing is already in, this just two places of casting back and forth while introducing one new one (reading
lewtonsamples). So compared to the current situation, this should result in the following cases:🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.