mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
audioconvert: somewhat avoid precision loss in S32 to F32 conversion
At the very least, we should go through s25_32 intermediate instead of s24_32, to avoid needlessly loosing 1 LSB precision bit. That being said, i suspect it's still not doing the right thing. Why are we silently dropping those 7 LSB bits? Is that really the way to do it?
This commit is contained in:
parent
175d533b56
commit
c517865864
4 changed files with 38 additions and 46 deletions
|
|
@ -121,7 +121,7 @@
|
|||
|
||||
#define S32_MIN (S24_MIN * 256)
|
||||
#define S32_MAX (S24_MAX * 256)
|
||||
#define S32_TO_F32(v) ITOF(int32_t, S32_TO_S24_32(v), S24_SCALE, 0.0f)
|
||||
#define S32_TO_F32(v) ITOF(int32_t, S32_TO_S25_32(v), S25_SCALE, 0.0f)
|
||||
#define S32S_TO_F32(v) S32_TO_F32(bswap_32(v))
|
||||
#define F32_TO_S32_D(v,d) S25_32_TO_S32(F32_TO_S25_32_D(v,d))
|
||||
#define F32_TO_S32(v) F32_TO_S32_D(v, 0.0f)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue