mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-05 13:29:57 -05:00
core: Set volumes const in pa_do_volume_func_t
volumes do not change, the samples get scaled Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
This commit is contained in:
parent
9b80d1d14a
commit
503de445a6
6 changed files with 19 additions and 19 deletions
|
|
@ -88,7 +88,7 @@ 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);
|
||||
typedef void (*pa_do_volume_func_t) (void *samples, const 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);
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
" addcs r0, %1 \n\t" \
|
||||
" movcs r6, r0 \n\t"
|
||||
|
||||
static void pa_volume_s16ne_arm(int16_t *samples, int32_t *volumes, unsigned channels, unsigned length) {
|
||||
static void pa_volume_s16ne_arm(int16_t *samples, const int32_t *volumes, unsigned channels, unsigned length) {
|
||||
int32_t *ve;
|
||||
|
||||
/* Channels must be at least 4, and always a multiple of the original number.
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
#include "sample-util.h"
|
||||
|
||||
static void pa_volume_u8_c(uint8_t *samples, int32_t *volumes, unsigned channels, unsigned length) {
|
||||
static void pa_volume_u8_c(uint8_t *samples, const int32_t *volumes, unsigned channels, unsigned length) {
|
||||
unsigned channel;
|
||||
|
||||
for (channel = 0; length; length--) {
|
||||
|
|
@ -50,7 +50,7 @@ static void pa_volume_u8_c(uint8_t *samples, int32_t *volumes, unsigned channels
|
|||
}
|
||||
}
|
||||
|
||||
static void pa_volume_alaw_c(uint8_t *samples, int32_t *volumes, unsigned channels, unsigned length) {
|
||||
static void pa_volume_alaw_c(uint8_t *samples, const int32_t *volumes, unsigned channels, unsigned length) {
|
||||
unsigned channel;
|
||||
|
||||
for (channel = 0; length; length--) {
|
||||
|
|
@ -69,7 +69,7 @@ static void pa_volume_alaw_c(uint8_t *samples, int32_t *volumes, unsigned channe
|
|||
}
|
||||
}
|
||||
|
||||
static void pa_volume_ulaw_c(uint8_t *samples, int32_t *volumes, unsigned channels, unsigned length) {
|
||||
static void pa_volume_ulaw_c(uint8_t *samples, const int32_t *volumes, unsigned channels, unsigned length) {
|
||||
unsigned channel;
|
||||
|
||||
for (channel = 0; length; length--) {
|
||||
|
|
@ -88,7 +88,7 @@ static void pa_volume_ulaw_c(uint8_t *samples, int32_t *volumes, unsigned channe
|
|||
}
|
||||
}
|
||||
|
||||
static void pa_volume_s16ne_c(int16_t *samples, int32_t *volumes, unsigned channels, unsigned length) {
|
||||
static void pa_volume_s16ne_c(int16_t *samples, const int32_t *volumes, unsigned channels, unsigned length) {
|
||||
unsigned channel;
|
||||
|
||||
length /= sizeof(int16_t);
|
||||
|
|
@ -115,7 +115,7 @@ static void pa_volume_s16ne_c(int16_t *samples, int32_t *volumes, unsigned chann
|
|||
}
|
||||
}
|
||||
|
||||
static void pa_volume_s16re_c(int16_t *samples, int32_t *volumes, unsigned channels, unsigned length) {
|
||||
static void pa_volume_s16re_c(int16_t *samples, const int32_t *volumes, unsigned channels, unsigned length) {
|
||||
unsigned channel;
|
||||
|
||||
length /= sizeof(int16_t);
|
||||
|
|
@ -136,7 +136,7 @@ static void pa_volume_s16re_c(int16_t *samples, int32_t *volumes, unsigned chann
|
|||
}
|
||||
}
|
||||
|
||||
static void pa_volume_float32ne_c(float *samples, float *volumes, unsigned channels, unsigned length) {
|
||||
static void pa_volume_float32ne_c(float *samples, const float *volumes, unsigned channels, unsigned length) {
|
||||
unsigned channel;
|
||||
|
||||
length /= sizeof(float);
|
||||
|
|
@ -166,7 +166,7 @@ static void pa_volume_float32re_c(float *samples, float *volumes, unsigned chann
|
|||
}
|
||||
}
|
||||
|
||||
static void pa_volume_s32ne_c(int32_t *samples, int32_t *volumes, unsigned channels, unsigned length) {
|
||||
static void pa_volume_s32ne_c(int32_t *samples, const int32_t *volumes, unsigned channels, unsigned length) {
|
||||
unsigned channel;
|
||||
|
||||
length /= sizeof(int32_t);
|
||||
|
|
@ -184,7 +184,7 @@ static void pa_volume_s32ne_c(int32_t *samples, int32_t *volumes, unsigned chann
|
|||
}
|
||||
}
|
||||
|
||||
static void pa_volume_s32re_c(int32_t *samples, int32_t *volumes, unsigned channels, unsigned length) {
|
||||
static void pa_volume_s32re_c(int32_t *samples, const int32_t *volumes, unsigned channels, unsigned length) {
|
||||
unsigned channel;
|
||||
|
||||
length /= sizeof(int32_t);
|
||||
|
|
@ -202,7 +202,7 @@ static void pa_volume_s32re_c(int32_t *samples, int32_t *volumes, unsigned chann
|
|||
}
|
||||
}
|
||||
|
||||
static void pa_volume_s24ne_c(uint8_t *samples, int32_t *volumes, unsigned channels, unsigned length) {
|
||||
static void pa_volume_s24ne_c(uint8_t *samples, const int32_t *volumes, unsigned channels, unsigned length) {
|
||||
unsigned channel;
|
||||
uint8_t *e;
|
||||
|
||||
|
|
@ -221,7 +221,7 @@ static void pa_volume_s24ne_c(uint8_t *samples, int32_t *volumes, unsigned chann
|
|||
}
|
||||
}
|
||||
|
||||
static void pa_volume_s24re_c(uint8_t *samples, int32_t *volumes, unsigned channels, unsigned length) {
|
||||
static void pa_volume_s24re_c(uint8_t *samples, const int32_t *volumes, unsigned channels, unsigned length) {
|
||||
unsigned channel;
|
||||
uint8_t *e;
|
||||
|
||||
|
|
@ -240,7 +240,7 @@ static void pa_volume_s24re_c(uint8_t *samples, int32_t *volumes, unsigned chann
|
|||
}
|
||||
}
|
||||
|
||||
static void pa_volume_s24_32ne_c(uint32_t *samples, int32_t *volumes, unsigned channels, unsigned length) {
|
||||
static void pa_volume_s24_32ne_c(uint32_t *samples, const int32_t *volumes, unsigned channels, unsigned length) {
|
||||
unsigned channel;
|
||||
|
||||
length /= sizeof(uint32_t);
|
||||
|
|
@ -258,7 +258,7 @@ static void pa_volume_s24_32ne_c(uint32_t *samples, int32_t *volumes, unsigned c
|
|||
}
|
||||
}
|
||||
|
||||
static void pa_volume_s24_32re_c(uint32_t *samples, int32_t *volumes, unsigned channels, unsigned length) {
|
||||
static void pa_volume_s24_32re_c(uint32_t *samples, const int32_t *volumes, unsigned channels, unsigned length) {
|
||||
unsigned channel;
|
||||
|
||||
length /= sizeof(uint32_t);
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@
|
|||
" por %%mm4, "#s1" \n\t" /* .. | l h | */ \
|
||||
" por %%mm5, "#s2" \n\t"
|
||||
|
||||
static void pa_volume_s16ne_mmx(int16_t *samples, int32_t *volumes, unsigned channels, unsigned length) {
|
||||
static void pa_volume_s16ne_mmx(int16_t *samples, const int32_t *volumes, unsigned channels, unsigned length) {
|
||||
pa_reg_x86 channel, temp;
|
||||
|
||||
/* Channels must be at least 4, and always a multiple of the original number.
|
||||
|
|
@ -161,7 +161,7 @@ static void pa_volume_s16ne_mmx(int16_t *samples, int32_t *volumes, unsigned cha
|
|||
);
|
||||
}
|
||||
|
||||
static void pa_volume_s16re_mmx(int16_t *samples, int32_t *volumes, unsigned channels, unsigned length) {
|
||||
static void pa_volume_s16re_mmx(int16_t *samples, const int32_t *volumes, unsigned channels, unsigned length) {
|
||||
pa_reg_x86 channel, temp;
|
||||
|
||||
/* Channels must be at least 4, and always a multiple of the original number.
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
pa_do_volume_func_t fallback;
|
||||
|
||||
static void
|
||||
pa_volume_s16ne_orc(int16_t *samples, int32_t *volumes, unsigned channels, unsigned length)
|
||||
pa_volume_s16ne_orc(int16_t *samples, const int32_t *volumes, unsigned channels, unsigned length)
|
||||
{
|
||||
if (channels == 2) {
|
||||
int64_t v = (int64_t)volumes[1] << 32 | volumes[0];
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@
|
|||
|
||||
static int channel_overread_table[8] = {8,8,8,12,8,10,12,14};
|
||||
|
||||
static void pa_volume_s16ne_sse2(int16_t *samples, int32_t *volumes, unsigned channels, unsigned length) {
|
||||
static void pa_volume_s16ne_sse2(int16_t *samples, const int32_t *volumes, unsigned channels, unsigned length) {
|
||||
pa_reg_x86 channel, temp;
|
||||
|
||||
/* Channels must be at least 8 and always a multiple of the original number.
|
||||
|
|
@ -160,7 +160,7 @@ static void pa_volume_s16ne_sse2(int16_t *samples, int32_t *volumes, unsigned ch
|
|||
);
|
||||
}
|
||||
|
||||
static void pa_volume_s16re_sse2(int16_t *samples, int32_t *volumes, unsigned channels, unsigned length) {
|
||||
static void pa_volume_s16re_sse2(int16_t *samples, const int32_t *volumes, unsigned channels, unsigned length) {
|
||||
pa_reg_x86 channel, temp;
|
||||
|
||||
/* Channels must be at least 8 and always a multiple of the original number.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue