Wim Taymans
1ae4374ccf
Fix compilation with -Werror=float-conversion
...
Better make the conversions explicit so that we don't get any surprises.
Fixes #4065
2024-06-18 12:17:56 +02:00
Wim Taymans
82b2515af3
test: avoid left shift on signed values
...
See #3572
2023-10-15 22:27:44 +02:00
Wim Taymans
463e723a1e
test: add more lossless tests
...
Also test that S16->F32->S32 and U16->F32->U32 are lossless.
2023-04-06 10:00:17 +02:00
Barnabás Pőcze
934ab3036e
treewide: use SPDX tags to specify copyright information
...
SPDX tags make the licensing information easy to understand and clear,
and they are machine parseable.
See https://spdx.dev for more information.
2023-02-16 10:54:48 +00:00
Wim Taymans
b1b8b0985a
audioconvert: fix rounding on arm neon
...
Add the neon functions to the test
2022-07-21 17:24:55 +02:00
Wim Taymans
a4db745a7e
audioconvert: improve noise shaping
...
Reorganize things a little so we can add more noise shapers.
Add sloped triangular noise.
Add wanamaker3 noise shaping.
2022-07-15 12:36:15 +02:00
Wim Taymans
a458b39774
tests: add test for rounding
2022-07-14 10:48:37 +02:00
Wim Taymans
0ba3e7c5db
audioconvert: round instead of truncate, to reduce distortion
...
See #2543
2022-07-13 20:56:13 +02:00
Wim Taymans
68f883ff77
audioconvert: fix dither scale
...
Rectangular dither should be [-0.5, 0.5]
Triangular dither should be [-1.0, 1.0]
Noise should add extra bits.
2022-07-11 17:19:28 +02:00
Wim Taymans
9a5a71dda9
tests: add test for noise
2022-07-11 15:49:44 +02:00
Wim Taymans
3ffb9f4b26
audioconvert: improve s24_32 and u24_32 conversion
...
We should ignore the upper 8 bits, so first shift them out and then
use the s32/u32 conversion functions.
Add a test for this.
2022-07-09 18:07:49 +02:00
Wim Taymans
b8a4bf880f
audioconvert: use 24 bits for 32 formats
...
The float only preserves 24 bits so use this. Otherwise we get overflows
and errors in clang.
2022-07-07 18:38:32 +02:00
Wim Taymans
987784b629
tests: add test for s24/u24 swap
2022-07-05 16:34:22 +02:00
Wim Taymans
c4cc13c094
audioconvert: use right scale value
...
Disable assert, it seems to fail on clang.
2022-07-05 16:02:24 +02:00
Wim Taymans
f62244d7a9
audioconvert: tweak more conversion constants
...
Tweak some more constants to make lossless conversions work.
Add some tests for lossless conversion.
Add some more tests.
2022-07-05 15:50:05 +02:00
Wim Taymans
22317da685
audioconvert: tweak conversion constants
...
Tweak the conversion constants a bit so that they handle the
extreme ranges a bit better.
Align the C and vector instructions.
Reactivate the unit test asserts when a conversion fails.
2022-07-05 12:20:02 +02:00
Wim Taymans
06b1cf8663
audioconvert: implement (de)interleave with existing functions
2022-06-30 18:24:05 +02:00
Wim Taymans
9f5caa6358
audioconvert: add f64 conversion
...
See #1990
2022-01-10 13:04:31 +01:00
Gleb Popov
12a4fbb425
Use uint16_t instead of int16_t to fix a compiler warning.
2021-10-22 19:05:18 +03:00
Julian Bouzas
20e64b39da
fmtconvert: add support for U16, U24, U32 and U24_32 formats
2021-09-08 14:24:26 -04:00
Peter Hutterer
49f3d5842e
test: replace all spa_assert() macros with spa_assert_se()
...
These are tests, we never want those to be optimized away.
2021-07-27 10:24:44 +10:00
Barnabás Pőcze
f5d51162c4
treewide: mark things static and const
...
Mark some structures, arrays static/const at various places.
In some cases this prevents unnecessary initialization
when a function is entered.
All in all, the text segments across all shared
libraries are reduced by about 2 KiB. However,
the total size increases by about 2 KiB as well.
2021-06-30 14:44:08 +02:00
Simon McVittie
8dcf76f661
audioconvert tests: Default to using an installed libspa-support
...
This makes installed-tests (see commit b852b58f ) do the right thing.
For build-time testing, spa/plugins/audioconvert/meson.build overrides
this with the SPA_PLUGIN_DIR environment variable, and for ad-hoc
testing by developers, pw-uninstalled.sh sets the necessary variables.
Signed-off-by: Simon McVittie <smcv@debian.org>
2020-09-14 18:16:49 +00:00
Wim Taymans
a44bea0b6a
tests: check cpu flags
...
Use the support plugin to load the CPU detection API and check
for the right CPU flags before running the test.
Fixes #246
2020-06-09 08:00:00 +02:00
Wim Taymans
6eca935e61
also test optimized versions
2020-03-16 13:08:33 +01:00
Wim Taymans
7e95897a3b
fmt-ops: fix test for big endian
2020-02-05 17:09:23 +01:00
Wim Taymans
d8e399dee9
audioconvert: pass state to functions
...
Pass some state to convert and channelmix functions. This makes it
possible to select per channel optimized convert functions but
also makes it possible to implement noise shaping later.
Pass the channelmix matrix and volume in the state.
Handle specialized 2 channel s16 -> f32 conversion
2019-03-29 17:39:59 +01:00
Wim Taymans
d260cb19be
audioconvert: compile c version separately
...
Also compile the c versions in a separate module with their own
flags.
2019-03-28 21:07:53 +01:00
Wim Taymans
13bf70a8dd
mem: align memory to requested alignment
...
Improve the allocators to always align the buffer memory to the
requested alignment
Use aligned read and writes for sse functions and check alignment,
optionally falling back to unaligned path.
Add more tests and benchmark cases
Check and warn for misaligned memory in plugins.
2019-01-24 18:28:52 +01:00
Wim Taymans
dd66469570
audioconvert: add format conversion benchmark
2019-01-24 09:49:19 +01:00
Wim Taymans
6f586602af
audioconvert: add unit test for format conversion
...
Add unit test for fmt conversion and fix some bugs
Add empty fmt-ops benchmark
2019-01-23 15:59:54 +01:00