mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-17 08:56:49 -05:00
audioconvert: round instead of truncate, to reduce distortion
See #2543
This commit is contained in:
parent
d18428f8bb
commit
0ba3e7c5db
4 changed files with 58 additions and 58 deletions
|
|
@ -35,12 +35,12 @@
|
|||
#include <spa/utils/defs.h>
|
||||
#include <spa/utils/string.h>
|
||||
|
||||
#define ROUND(v) (v)
|
||||
#define f32_round(a) lrintf(a)
|
||||
|
||||
#define ITOF(type,v,scale,offs) \
|
||||
(((type)(v)) * (1.0f / (scale)) - (offs))
|
||||
#define FTOI(type,v,scale,offs,dither,min,max) \
|
||||
(type)ROUND(SPA_CLAMP((v) * (scale) + (offs) + (dither), min, max))
|
||||
(type)f32_round(SPA_CLAMP((v) * (scale) + (offs) + (dither), min, max))
|
||||
|
||||
#define FMT_OPS_MAX_ALIGN 32
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue