pcm_{channels,resample}: pass channel count as integer, not uint8_t
Reduces number of implicit integer conversions.
This commit is contained in:
parent
c4c44c4445
commit
9716c3a30e
@ -71,8 +71,8 @@ pcm_convert_channels_16_n_to_2(int16_t *dest,
|
||||
|
||||
const int16_t *
|
||||
pcm_convert_channels_16(struct pcm_buffer *buffer,
|
||||
uint8_t dest_channels,
|
||||
uint8_t src_channels, const int16_t *src,
|
||||
unsigned dest_channels,
|
||||
unsigned src_channels, const int16_t *src,
|
||||
size_t src_size, size_t *dest_size_r)
|
||||
{
|
||||
assert(src_size % (sizeof(*src) * src_channels) == 0);
|
||||
@ -144,8 +144,8 @@ pcm_convert_channels_24_n_to_2(int32_t *dest,
|
||||
|
||||
const int32_t *
|
||||
pcm_convert_channels_24(struct pcm_buffer *buffer,
|
||||
uint8_t dest_channels,
|
||||
uint8_t src_channels, const int32_t *src,
|
||||
unsigned dest_channels,
|
||||
unsigned src_channels, const int32_t *src,
|
||||
size_t src_size, size_t *dest_size_r)
|
||||
{
|
||||
assert(src_size % (sizeof(*src) * src_channels) == 0);
|
||||
@ -212,8 +212,8 @@ pcm_convert_channels_32_n_to_2(int32_t *dest,
|
||||
|
||||
const int32_t *
|
||||
pcm_convert_channels_32(struct pcm_buffer *buffer,
|
||||
uint8_t dest_channels,
|
||||
uint8_t src_channels, const int32_t *src,
|
||||
unsigned dest_channels,
|
||||
unsigned src_channels, const int32_t *src,
|
||||
size_t src_size, size_t *dest_size_r)
|
||||
{
|
||||
assert(src_size % (sizeof(*src) * src_channels) == 0);
|
||||
|
@ -38,8 +38,8 @@ struct pcm_buffer;
|
||||
*/
|
||||
const int16_t *
|
||||
pcm_convert_channels_16(struct pcm_buffer *buffer,
|
||||
uint8_t dest_channels,
|
||||
uint8_t src_channels, const int16_t *src,
|
||||
unsigned dest_channels,
|
||||
unsigned src_channels, const int16_t *src,
|
||||
size_t src_size, size_t *dest_size_r);
|
||||
|
||||
/**
|
||||
@ -56,8 +56,8 @@ pcm_convert_channels_16(struct pcm_buffer *buffer,
|
||||
*/
|
||||
const int32_t *
|
||||
pcm_convert_channels_24(struct pcm_buffer *buffer,
|
||||
uint8_t dest_channels,
|
||||
uint8_t src_channels, const int32_t *src,
|
||||
unsigned dest_channels,
|
||||
unsigned src_channels, const int32_t *src,
|
||||
size_t src_size, size_t *dest_size_r);
|
||||
|
||||
/**
|
||||
@ -73,8 +73,8 @@ pcm_convert_channels_24(struct pcm_buffer *buffer,
|
||||
*/
|
||||
const int32_t *
|
||||
pcm_convert_channels_32(struct pcm_buffer *buffer,
|
||||
uint8_t dest_channels,
|
||||
uint8_t src_channels, const int32_t *src,
|
||||
unsigned dest_channels,
|
||||
unsigned src_channels, const int32_t *src,
|
||||
size_t src_size, size_t *dest_size_r);
|
||||
|
||||
#endif
|
||||
|
@ -78,7 +78,7 @@ void pcm_resample_deinit(struct pcm_resample_state *state)
|
||||
|
||||
const int16_t *
|
||||
pcm_resample_16(struct pcm_resample_state *state,
|
||||
uint8_t channels,
|
||||
unsigned channels,
|
||||
unsigned src_rate, const int16_t *src_buffer, size_t src_size,
|
||||
unsigned dest_rate, size_t *dest_size_r,
|
||||
GError **error_r)
|
||||
@ -100,7 +100,7 @@ pcm_resample_16(struct pcm_resample_state *state,
|
||||
|
||||
const int32_t *
|
||||
pcm_resample_32(struct pcm_resample_state *state,
|
||||
uint8_t channels,
|
||||
unsigned channels,
|
||||
unsigned src_rate, const int32_t *src_buffer, size_t src_size,
|
||||
unsigned dest_rate, size_t *dest_size_r,
|
||||
GError **error_r)
|
||||
|
@ -45,7 +45,7 @@ struct pcm_resample_state {
|
||||
struct {
|
||||
unsigned src_rate;
|
||||
unsigned dest_rate;
|
||||
uint8_t channels;
|
||||
unsigned channels;
|
||||
} prev;
|
||||
|
||||
int error;
|
||||
@ -82,7 +82,7 @@ void pcm_resample_deinit(struct pcm_resample_state *state);
|
||||
*/
|
||||
const int16_t *
|
||||
pcm_resample_16(struct pcm_resample_state *state,
|
||||
uint8_t channels,
|
||||
unsigned channels,
|
||||
unsigned src_rate,
|
||||
const int16_t *src_buffer, size_t src_size,
|
||||
unsigned dest_rate, size_t *dest_size_r,
|
||||
@ -102,7 +102,7 @@ pcm_resample_16(struct pcm_resample_state *state,
|
||||
*/
|
||||
const int32_t *
|
||||
pcm_resample_32(struct pcm_resample_state *state,
|
||||
uint8_t channels,
|
||||
unsigned channels,
|
||||
unsigned src_rate,
|
||||
const int32_t *src_buffer, size_t src_size,
|
||||
unsigned dest_rate, size_t *dest_size_r,
|
||||
@ -122,7 +122,7 @@ pcm_resample_32(struct pcm_resample_state *state,
|
||||
*/
|
||||
static inline const int32_t *
|
||||
pcm_resample_24(struct pcm_resample_state *state,
|
||||
uint8_t channels,
|
||||
unsigned channels,
|
||||
unsigned src_rate,
|
||||
const int32_t *src_buffer, size_t src_size,
|
||||
unsigned dest_rate, size_t *dest_size_r,
|
||||
|
@ -37,7 +37,7 @@ pcm_resample_fallback_deinit(struct pcm_resample_state *state)
|
||||
/* resampling code blatantly ripped from ESD */
|
||||
const int16_t *
|
||||
pcm_resample_fallback_16(struct pcm_resample_state *state,
|
||||
uint8_t channels,
|
||||
unsigned channels,
|
||||
unsigned src_rate,
|
||||
const int16_t *src_buffer, size_t src_size,
|
||||
unsigned dest_rate,
|
||||
@ -78,7 +78,7 @@ pcm_resample_fallback_16(struct pcm_resample_state *state,
|
||||
|
||||
const int32_t *
|
||||
pcm_resample_fallback_32(struct pcm_resample_state *state,
|
||||
uint8_t channels,
|
||||
unsigned channels,
|
||||
unsigned src_rate,
|
||||
const int32_t *src_buffer, size_t src_size,
|
||||
unsigned dest_rate,
|
||||
|
@ -43,7 +43,7 @@ pcm_resample_lsr_deinit(struct pcm_resample_state *state);
|
||||
|
||||
const int16_t *
|
||||
pcm_resample_lsr_16(struct pcm_resample_state *state,
|
||||
uint8_t channels,
|
||||
unsigned channels,
|
||||
unsigned src_rate,
|
||||
const int16_t *src_buffer, size_t src_size,
|
||||
unsigned dest_rate, size_t *dest_size_r,
|
||||
@ -51,7 +51,7 @@ pcm_resample_lsr_16(struct pcm_resample_state *state,
|
||||
|
||||
const int32_t *
|
||||
pcm_resample_lsr_32(struct pcm_resample_state *state,
|
||||
uint8_t channels,
|
||||
unsigned channels,
|
||||
unsigned src_rate,
|
||||
const int32_t *src_buffer,
|
||||
G_GNUC_UNUSED size_t src_size,
|
||||
@ -68,7 +68,7 @@ pcm_resample_fallback_deinit(struct pcm_resample_state *state);
|
||||
|
||||
const int16_t *
|
||||
pcm_resample_fallback_16(struct pcm_resample_state *state,
|
||||
uint8_t channels,
|
||||
unsigned channels,
|
||||
unsigned src_rate,
|
||||
const int16_t *src_buffer, size_t src_size,
|
||||
unsigned dest_rate,
|
||||
@ -76,7 +76,7 @@ pcm_resample_fallback_16(struct pcm_resample_state *state,
|
||||
|
||||
const int32_t *
|
||||
pcm_resample_fallback_32(struct pcm_resample_state *state,
|
||||
uint8_t channels,
|
||||
unsigned channels,
|
||||
unsigned src_rate,
|
||||
const int32_t *src_buffer,
|
||||
G_GNUC_UNUSED size_t src_size,
|
||||
|
@ -106,7 +106,7 @@ pcm_resample_lsr_deinit(struct pcm_resample_state *state)
|
||||
|
||||
static bool
|
||||
pcm_resample_set(struct pcm_resample_state *state,
|
||||
uint8_t channels, unsigned src_rate, unsigned dest_rate,
|
||||
unsigned channels, unsigned src_rate, unsigned dest_rate,
|
||||
GError **error_r)
|
||||
{
|
||||
int error;
|
||||
@ -159,7 +159,7 @@ lsr_process(struct pcm_resample_state *state, GError **error_r)
|
||||
|
||||
const int16_t *
|
||||
pcm_resample_lsr_16(struct pcm_resample_state *state,
|
||||
uint8_t channels,
|
||||
unsigned channels,
|
||||
unsigned src_rate,
|
||||
const int16_t *src_buffer, size_t src_size,
|
||||
unsigned dest_rate, size_t *dest_size_r,
|
||||
@ -223,7 +223,7 @@ src_float_to_int_array (const float *in, int *out, int len)
|
||||
|
||||
const int32_t *
|
||||
pcm_resample_lsr_32(struct pcm_resample_state *state,
|
||||
uint8_t channels,
|
||||
unsigned channels,
|
||||
unsigned src_rate,
|
||||
const int32_t *src_buffer, size_t src_size,
|
||||
unsigned dest_rate, size_t *dest_size_r,
|
||||
|
Loading…
Reference in New Issue
Block a user