mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
sample-util: move some functions around
Move some stuff around before splitting it into a separate file.
This commit is contained in:
parent
5b8b6544e2
commit
e71e644eb6
1 changed files with 23 additions and 23 deletions
|
|
@ -975,34 +975,11 @@ pa_volume_s24_32re_c (uint32_t *samples, int32_t *volumes, unsigned channels, un
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef void (*pa_do_volume_func_t) (void *samples, void *volumes, unsigned channels, unsigned length);
|
typedef void (*pa_do_volume_func_t) (void *samples, void *volumes, unsigned channels, unsigned length);
|
||||||
typedef void (*pa_calc_volume_func_t) (void *volumes, const pa_cvolume *volume);
|
|
||||||
|
|
||||||
typedef union {
|
|
||||||
float f;
|
|
||||||
uint32_t i;
|
|
||||||
} volume_val;
|
|
||||||
|
|
||||||
typedef struct pa_sample_func_t {
|
typedef struct pa_sample_func_t {
|
||||||
pa_calc_volume_func_t calc_volume;
|
|
||||||
pa_do_volume_func_t do_volume;
|
pa_do_volume_func_t do_volume;
|
||||||
} pa_sample_func_t;
|
} pa_sample_func_t;
|
||||||
|
|
||||||
static const pa_calc_volume_func_t calc_volume_table[] = {
|
|
||||||
[PA_SAMPLE_U8] = (pa_calc_volume_func_t) calc_linear_integer_volume,
|
|
||||||
[PA_SAMPLE_ALAW] = (pa_calc_volume_func_t) calc_linear_integer_volume,
|
|
||||||
[PA_SAMPLE_ULAW] = (pa_calc_volume_func_t) calc_linear_integer_volume,
|
|
||||||
[PA_SAMPLE_S16LE] = (pa_calc_volume_func_t) calc_linear_integer_volume,
|
|
||||||
[PA_SAMPLE_S16BE] = (pa_calc_volume_func_t) calc_linear_integer_volume,
|
|
||||||
[PA_SAMPLE_FLOAT32LE] = (pa_calc_volume_func_t) calc_linear_float_volume,
|
|
||||||
[PA_SAMPLE_FLOAT32BE] = (pa_calc_volume_func_t) calc_linear_float_volume,
|
|
||||||
[PA_SAMPLE_S32LE] = (pa_calc_volume_func_t) calc_linear_integer_volume,
|
|
||||||
[PA_SAMPLE_S32BE] = (pa_calc_volume_func_t) calc_linear_integer_volume,
|
|
||||||
[PA_SAMPLE_S24LE] = (pa_calc_volume_func_t) calc_linear_integer_volume,
|
|
||||||
[PA_SAMPLE_S24BE] = (pa_calc_volume_func_t) calc_linear_integer_volume,
|
|
||||||
[PA_SAMPLE_S24_32LE] = (pa_calc_volume_func_t) calc_linear_integer_volume,
|
|
||||||
[PA_SAMPLE_S24_32BE] = (pa_calc_volume_func_t) calc_linear_integer_volume
|
|
||||||
};
|
|
||||||
|
|
||||||
static pa_do_volume_func_t do_volume_table[] =
|
static pa_do_volume_func_t do_volume_table[] =
|
||||||
{
|
{
|
||||||
[PA_SAMPLE_U8] = (pa_do_volume_func_t) pa_volume_u8_c,
|
[PA_SAMPLE_U8] = (pa_do_volume_func_t) pa_volume_u8_c,
|
||||||
|
|
@ -1020,6 +997,29 @@ static pa_do_volume_func_t do_volume_table[] =
|
||||||
[PA_SAMPLE_S24_32RE] = (pa_do_volume_func_t) pa_volume_s24_32re_c
|
[PA_SAMPLE_S24_32RE] = (pa_do_volume_func_t) pa_volume_s24_32re_c
|
||||||
};
|
};
|
||||||
|
|
||||||
|
typedef union {
|
||||||
|
float f;
|
||||||
|
uint32_t i;
|
||||||
|
} volume_val;
|
||||||
|
|
||||||
|
typedef void (*pa_calc_volume_func_t) (void *volumes, const pa_cvolume *volume);
|
||||||
|
|
||||||
|
static const pa_calc_volume_func_t calc_volume_table[] = {
|
||||||
|
[PA_SAMPLE_U8] = (pa_calc_volume_func_t) calc_linear_integer_volume,
|
||||||
|
[PA_SAMPLE_ALAW] = (pa_calc_volume_func_t) calc_linear_integer_volume,
|
||||||
|
[PA_SAMPLE_ULAW] = (pa_calc_volume_func_t) calc_linear_integer_volume,
|
||||||
|
[PA_SAMPLE_S16LE] = (pa_calc_volume_func_t) calc_linear_integer_volume,
|
||||||
|
[PA_SAMPLE_S16BE] = (pa_calc_volume_func_t) calc_linear_integer_volume,
|
||||||
|
[PA_SAMPLE_FLOAT32LE] = (pa_calc_volume_func_t) calc_linear_float_volume,
|
||||||
|
[PA_SAMPLE_FLOAT32BE] = (pa_calc_volume_func_t) calc_linear_float_volume,
|
||||||
|
[PA_SAMPLE_S32LE] = (pa_calc_volume_func_t) calc_linear_integer_volume,
|
||||||
|
[PA_SAMPLE_S32BE] = (pa_calc_volume_func_t) calc_linear_integer_volume,
|
||||||
|
[PA_SAMPLE_S24LE] = (pa_calc_volume_func_t) calc_linear_integer_volume,
|
||||||
|
[PA_SAMPLE_S24BE] = (pa_calc_volume_func_t) calc_linear_integer_volume,
|
||||||
|
[PA_SAMPLE_S24_32LE] = (pa_calc_volume_func_t) calc_linear_integer_volume,
|
||||||
|
[PA_SAMPLE_S24_32BE] = (pa_calc_volume_func_t) calc_linear_integer_volume
|
||||||
|
};
|
||||||
|
|
||||||
void pa_volume_memchunk(
|
void pa_volume_memchunk(
|
||||||
pa_memchunk*c,
|
pa_memchunk*c,
|
||||||
const pa_sample_spec *spec,
|
const pa_sample_spec *spec,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue