mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-09 13:29:59 -05:00
remap: support S32NE work format
So far PulseAudio only supported two different work formats: S16NE if it's sufficient to represent the input and output formats without loss of precision and FLOAT32NE in all other cases. For systems that use S32NE exclusively, this results in unnecessary conversions from S32NE to FLOAT32NE and back again. Add S32NE remap operations and make use of them (for the COPY and TRIVIAL resamplers) if both input and output format are S32NE. This avoids the back and forth conversions between S32NE and FLOAT32NE, significantly improving performance for those cases.
This commit is contained in:
parent
1e4fb61436
commit
034b77823a
7 changed files with 327 additions and 14 deletions
|
|
@ -110,7 +110,8 @@ static void remap_mono_to_stereo_s16ne_sse2(pa_remap_t *m, int16_t *dst, const i
|
|||
);
|
||||
}
|
||||
|
||||
static void remap_mono_to_stereo_float32ne_sse2(pa_remap_t *m, float *dst, const float *src, unsigned n) {
|
||||
/* Works for both S32NE and FLOAT32NE */
|
||||
static void remap_mono_to_stereo_any32ne_sse2(pa_remap_t *m, float *dst, const float *src, unsigned n) {
|
||||
pa_reg_x86 temp, temp2;
|
||||
|
||||
__asm__ __volatile__ (
|
||||
|
|
@ -134,7 +135,8 @@ static void init_remap_sse2(pa_remap_t *m) {
|
|||
|
||||
pa_log_info("Using SSE2 mono to stereo remapping");
|
||||
pa_set_remap_func(m, (pa_do_remap_func_t) remap_mono_to_stereo_s16ne_sse2,
|
||||
(pa_do_remap_func_t) remap_mono_to_stereo_float32ne_sse2);
|
||||
(pa_do_remap_func_t) remap_mono_to_stereo_any32ne_sse2,
|
||||
(pa_do_remap_func_t) remap_mono_to_stereo_any32ne_sse2);
|
||||
}
|
||||
}
|
||||
#endif /* defined (__i386__) || defined (__amd64__) */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue