pipewire/spa/plugins/audioconvert
Pauli Virtanen 3cade43cf3 test-resample: add test for floating point rounding producing bad in_len
If phase is float, calculations in impl_native_in_len/out_len don't
necessarily match with do_resample, because e.g.

    float phase0 = 7999.99;
    float phase = phase0;
    int frac = 8000, out_rate = 8000, n = 64, count = 0;
    for (int j = 0; j < n; ++j) {
        phase += frac;
        if (phase >= out_rate) {
                phase -= out_rate;
                count++;
        }
    }
    printf("count = %d\n", count);      /* count = 64 */

    count = (int)(phase0 + n*frac) / out_rate;
    printf("count = %d\n", count);      /* count = 65 */

don't give the same result.

Also add test where floating point multiplication rounding up to nearest
in

    float ph = phase * pm;
    uint32_t offset = (uint32_t)floorf(ph);

computation results to offset+1 > data->n_phases, accessing filter array
beyond bounds.  (The accessed value is still inside allocated memory
block, but contains unrelated values; the test passes silently.)
2025-07-30 07:59:52 +00:00
..
audioadapter.c audioadapter: Add more log lines 2025-07-16 10:58:48 +02:00
audioconvert.c audioconvert: rework the stage recalc a little 2025-07-18 12:10:30 +02:00
benchmark-fmt-ops.c fmt-ops: add RVV optimizations for s32_to_f32d 2024-09-29 11:17:42 +08:00
benchmark-resample.c treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
biquad.c audioconvert: align low-/highpass calculations 2024-12-20 11:03:43 +01:00
biquad.h audioconvert: use the same biquad as filter-chain 2024-11-27 16:47:53 +01:00
channelmix-ops-c.c math: improve denormal check 2025-01-13 16:10:34 +01:00
channelmix-ops-sse.c math: improve denormal check 2025-01-13 16:10:34 +01:00
channelmix-ops.c channelmix: fix channel_mask bits iteration 2025-04-04 17:06:43 +02:00
channelmix-ops.h audioconvert: align some buffers 2024-10-23 12:54:23 +02:00
crossover.c audioconvert: use the same biquad as filter-chain 2024-11-27 16:47:53 +01:00
crossover.h audioconvert: use the same biquad as filter-chain 2024-11-27 16:47:53 +01:00
fmt-ops-avx2.c audioconvert: optimise f32d to/from s16s conversions 2025-01-24 10:37:02 +01:00
fmt-ops-c.c audioconvert: add clear function 2025-07-02 10:27:26 +02:00
fmt-ops-neon.c audioconvert: fix typo in neon function 2023-08-24 13:45:11 +02:00
fmt-ops-rvv.c fmt-ops: add RVV optimizations for s32_to_f32d 2024-09-29 11:17:42 +08:00
fmt-ops-sse2.c audioconvert: optimise f32d to/from s16s conversions 2025-01-24 10:37:02 +01:00
fmt-ops-sse41.c audioconvert: avoid unaligned read 2023-10-15 22:20:54 +02:00
fmt-ops-ssse3.c treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
fmt-ops.c audioconvert: add clear function 2025-07-02 10:27:26 +02:00
fmt-ops.h audioconvert: add clear function 2025-07-02 10:27:26 +02:00
hilbert.h *: don't include standard C headers inside of extern "C" 2025-05-30 09:48:28 +01:00
law.h treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
meson.build audioconvert: fix resampler delay value and add test 2025-01-13 19:05:58 +02:00
peaks-ops-c.c treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
peaks-ops-sse.c treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
peaks-ops.c treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
peaks-ops.h audioconvert: undef the right function 2025-06-24 13:46:08 +02:00
plugin.c spa: export log topic enumerations 2024-01-04 10:02:55 +00:00
resample-native-avx.c audioconvert: remove unnecessary casts 2024-01-16 15:33:13 +01:00
resample-native-c.c treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
resample-native-impl.h resample: optimize phase scaling 2025-07-23 14:11:11 +02:00
resample-native-neon.c treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
resample-native-sse.c treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
resample-native-ssse3.c treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
resample-native.c resample: fix off-by-one in out_len calculation 2025-07-30 07:59:52 +00:00
resample-peaks.c audioconvert: resampler: change resample_phase() unit to input samples 2025-01-19 17:11:13 +02:00
resample.h audioconvert: resampler: change resample_phase() unit to input samples 2025-01-19 17:11:13 +02:00
spa-resample-dump-coeffs.c resampler: Precompute some common filter coefficients 2024-08-08 00:30:24 -04:00
spa-resample.c spa-resample: improve output format selection 2025-01-31 09:24:08 +01:00
test-audioadapter.c treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
test-audioconvert.c tests: set the flags on buffers correctly 2025-06-25 10:34:50 +02:00
test-channelmix.c Fix compilation with -Werror=float-conversion 2024-06-18 12:17:56 +02:00
test-fmt-ops.c fmt-ops: add RVV optimizations for s32_to_f32d 2024-09-29 11:17:42 +08:00
test-peaks.c Fix compilation with -Werror=float-conversion 2024-06-18 12:17:56 +02:00
test-resample-delay.c audioconvert: resampler: change resample_phase() unit to input samples 2025-01-19 17:11:13 +02:00
test-resample.c test-resample: add test for floating point rounding producing bad in_len 2025-07-30 07:59:52 +00:00
test-source.c spa: use log topics everywhere 2024-03-11 18:45:21 +02:00
volume-ops-c.c treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
volume-ops-sse.c treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
volume-ops.c treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
volume-ops.h treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
wavfile.c wav: fix build 2023-03-09 17:09:47 +01:00
wavfile.h wav: fix build 2023-03-09 17:09:47 +01:00