From 3d008961c095cf8d41d2c61d13d446c98c892136 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 11 Aug 2009 17:10:44 +0200 Subject: sample-util: move volume code to separate file Move the volume code into a separate file with the reference C implementations. Add a function to retrieve the volume function and one to install a new one. --- src/pulsecore/sample-util.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/pulsecore/sample-util.h') diff --git a/src/pulsecore/sample-util.h b/src/pulsecore/sample-util.h index 6a306c11..278b88b0 100644 --- a/src/pulsecore/sample-util.h +++ b/src/pulsecore/sample-util.h @@ -86,6 +86,12 @@ void pa_memchunk_dump_to_file(pa_memchunk *c, const char *fn); void pa_memchunk_sine(pa_memchunk *c, pa_mempool *pool, unsigned rate, unsigned freq); +typedef void (*pa_do_volume_func_t) (void *samples, void *volumes, unsigned channels, unsigned length); + +pa_do_volume_func_t pa_get_volume_func(pa_sample_format_t f); +void pa_set_volume_func(pa_sample_format_t f, pa_do_volume_func_t func); + + #define PA_CHANNEL_POSITION_MASK_LEFT \ (PA_CHANNEL_POSITION_MASK(PA_CHANNEL_POSITION_FRONT_LEFT) \ | PA_CHANNEL_POSITION_MASK(PA_CHANNEL_POSITION_REAR_LEFT) \ -- cgit From 3a0b012ee016e2fe40f49c72da119cb89d2ba312 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 12 Aug 2009 17:08:41 +0200 Subject: volume: add first mmx optimized function Add code for an mmx optimized version of s16ne volume scaling. Install the custom function. --- src/pulsecore/sample-util.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/pulsecore/sample-util.h') diff --git a/src/pulsecore/sample-util.h b/src/pulsecore/sample-util.h index 278b88b0..00b9ae0b 100644 --- a/src/pulsecore/sample-util.h +++ b/src/pulsecore/sample-util.h @@ -91,6 +91,7 @@ typedef void (*pa_do_volume_func_t) (void *samples, void *volumes, unsigned chan pa_do_volume_func_t pa_get_volume_func(pa_sample_format_t f); void pa_set_volume_func(pa_sample_format_t f, pa_do_volume_func_t func); +void pa_volume_func_init_mmx(void); #define PA_CHANNEL_POSITION_MASK_LEFT \ (PA_CHANNEL_POSITION_MASK(PA_CHANNEL_POSITION_FRONT_LEFT) \ -- cgit From 7086784573e9e6c92d4c34404f18891c2d19872a Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 12 Aug 2009 20:44:12 +0200 Subject: volume_sse: add sse optimisations --- src/pulsecore/sample-util.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/pulsecore/sample-util.h') diff --git a/src/pulsecore/sample-util.h b/src/pulsecore/sample-util.h index 00b9ae0b..563dbb6a 100644 --- a/src/pulsecore/sample-util.h +++ b/src/pulsecore/sample-util.h @@ -92,6 +92,7 @@ pa_do_volume_func_t pa_get_volume_func(pa_sample_format_t f); void pa_set_volume_func(pa_sample_format_t f, pa_do_volume_func_t func); void pa_volume_func_init_mmx(void); +void pa_volume_func_init_sse(void); #define PA_CHANNEL_POSITION_MASK_LEFT \ (PA_CHANNEL_POSITION_MASK(PA_CHANNEL_POSITION_FRONT_LEFT) \ -- cgit From 563cb2dea9f7f73180e2b8cc8d45b0df9358c936 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 13 Aug 2009 17:12:44 +0200 Subject: main: hook up cpu detection code Add CPU detection code to activate the various optimisations. Move some method definitions around. Use compatibility macros when we can. --- src/pulsecore/sample-util.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/pulsecore/sample-util.h') diff --git a/src/pulsecore/sample-util.h b/src/pulsecore/sample-util.h index 563dbb6a..34df5cf3 100644 --- a/src/pulsecore/sample-util.h +++ b/src/pulsecore/sample-util.h @@ -91,9 +91,6 @@ typedef void (*pa_do_volume_func_t) (void *samples, void *volumes, unsigned chan pa_do_volume_func_t pa_get_volume_func(pa_sample_format_t f); void pa_set_volume_func(pa_sample_format_t f, pa_do_volume_func_t func); -void pa_volume_func_init_mmx(void); -void pa_volume_func_init_sse(void); - #define PA_CHANNEL_POSITION_MASK_LEFT \ (PA_CHANNEL_POSITION_MASK(PA_CHANNEL_POSITION_FRONT_LEFT) \ | PA_CHANNEL_POSITION_MASK(PA_CHANNEL_POSITION_REAR_LEFT) \ -- cgit From 1f0904b800d9d69698e79ce0435a2777d5f7ec27 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 9 Sep 2009 04:27:16 +0200 Subject: sample-util: add pa_convert_size() call for converting sizes between two sample specs --- src/pulsecore/sample-util.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/pulsecore/sample-util.h') diff --git a/src/pulsecore/sample-util.h b/src/pulsecore/sample-util.h index 34df5cf3..d0235d60 100644 --- a/src/pulsecore/sample-util.h +++ b/src/pulsecore/sample-util.h @@ -91,6 +91,8 @@ typedef void (*pa_do_volume_func_t) (void *samples, void *volumes, unsigned chan pa_do_volume_func_t pa_get_volume_func(pa_sample_format_t f); void pa_set_volume_func(pa_sample_format_t f, pa_do_volume_func_t func); +size_t pa_convert_size(size_t size, const pa_sample_spec *from, const pa_sample_spec *to); + #define PA_CHANNEL_POSITION_MASK_LEFT \ (PA_CHANNEL_POSITION_MASK(PA_CHANNEL_POSITION_FRONT_LEFT) \ | PA_CHANNEL_POSITION_MASK(PA_CHANNEL_POSITION_REAR_LEFT) \ -- cgit