pipewire/spa
Roman Lebedev f4c89b1b40
audioconvert: avoid even more precision loss in S32 to F32 conversion
There's really no point in doing that s25_32 intermediate step,
to be honest i don't have a clue why the original implementation
did that \_(ツ)_/¯.

Both `S25_SCALE` and `S32_SCALE` are powers of two,
and thus are both exactly representable as floats,
and reprocial of power-of-two is also exactly representable,
so it's not like that rescaling results in precision loss.

This additionally avoids right-shift, and thus is even faster.

As `test_lossless_s32_lossless_subset` shows,
if the integer is in the form of s25+shift,
the maximal absolute error became even lower,
but not zero, because F32->S32 still goes through S25 intermediate.
I think we could theoretically do better,
but then the clamping becomes pretty finicky,
so i don't feel like touching that here.
2024-06-27 19:41:20 +03:00
..
examples examples: fix mapoffset in examples 2024-06-13 10:11:29 +02:00
include impl-port: add port.group property 2024-06-24 13:38:09 +02:00
include-private/spa-private spa: move dbus helpers out of bluez plugin 2024-02-05 13:03:20 +00:00
plugins audioconvert: avoid even more precision loss in S32 to F32 conversion 2024-06-27 19:41:20 +03:00
tests Add GNU/Hurd support 2023-09-24 15:11:52 +00:00
tools spa: improve JSON error reporting in spa-json-dump 2024-03-27 15:57:39 +01:00
meson.build meson: fix compilation when spa-plugins is disabled 2024-02-06 11:50:54 +01:00