mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-03 09:01:50 -05:00
bluetooth: update SBC from upstream
This commit is contained in:
parent
0b8a6c66dc
commit
b51e6135e8
6 changed files with 21 additions and 2 deletions
|
|
@ -985,7 +985,7 @@ int sbc_decode(sbc_t *sbc, void *input, int input_len, void *output,
|
||||||
char *ptr;
|
char *ptr;
|
||||||
int i, ch, framelen, samples;
|
int i, ch, framelen, samples;
|
||||||
|
|
||||||
if (!sbc && !input)
|
if (!sbc || !input)
|
||||||
return -EIO;
|
return -EIO;
|
||||||
|
|
||||||
priv = sbc->priv;
|
priv = sbc->priv;
|
||||||
|
|
@ -1053,7 +1053,7 @@ int sbc_encode(sbc_t *sbc, void *input, int input_len, void *output,
|
||||||
const uint8_t *pcm, int16_t X[2][SBC_X_BUFFER_SIZE],
|
const uint8_t *pcm, int16_t X[2][SBC_X_BUFFER_SIZE],
|
||||||
int nsamples, int nchannels);
|
int nsamples, int nchannels);
|
||||||
|
|
||||||
if (!sbc && !input)
|
if (!sbc || !input)
|
||||||
return -EIO;
|
return -EIO;
|
||||||
|
|
||||||
priv = sbc->priv;
|
priv = sbc->priv;
|
||||||
|
|
@ -1221,6 +1221,20 @@ uint16_t sbc_get_codesize(sbc_t *sbc)
|
||||||
return subbands * blocks * channels * 2;
|
return subbands * blocks * channels * 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char *sbc_get_implementation_info(sbc_t *sbc)
|
||||||
|
{
|
||||||
|
struct sbc_priv *priv;
|
||||||
|
|
||||||
|
if (!sbc)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
priv = sbc->priv;
|
||||||
|
if (!priv)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
return priv->enc_state.implementation_info;
|
||||||
|
}
|
||||||
|
|
||||||
int sbc_reinit(sbc_t *sbc, unsigned long flags)
|
int sbc_reinit(sbc_t *sbc, unsigned long flags)
|
||||||
{
|
{
|
||||||
struct sbc_priv *priv;
|
struct sbc_priv *priv;
|
||||||
|
|
|
||||||
|
|
@ -89,6 +89,7 @@ int sbc_encode(sbc_t *sbc, void *input, int input_len, void *output,
|
||||||
int sbc_get_frame_length(sbc_t *sbc);
|
int sbc_get_frame_length(sbc_t *sbc);
|
||||||
int sbc_get_frame_duration(sbc_t *sbc);
|
int sbc_get_frame_duration(sbc_t *sbc);
|
||||||
uint16_t sbc_get_codesize(sbc_t *sbc);
|
uint16_t sbc_get_codesize(sbc_t *sbc);
|
||||||
|
const char *sbc_get_implementation_info(sbc_t *sbc);
|
||||||
void sbc_finish(sbc_t *sbc);
|
void sbc_finish(sbc_t *sbc);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
||||||
|
|
@ -456,6 +456,7 @@ void sbc_init_primitives(struct sbc_encoder_state *state)
|
||||||
|
|
||||||
/* Default implementation for scale factors calculation */
|
/* Default implementation for scale factors calculation */
|
||||||
state->sbc_calc_scalefactors = sbc_calc_scalefactors;
|
state->sbc_calc_scalefactors = sbc_calc_scalefactors;
|
||||||
|
state->implementation_info = "Generic C";
|
||||||
|
|
||||||
/* X86/AMD64 optimizations */
|
/* X86/AMD64 optimizations */
|
||||||
#ifdef SBC_BUILD_WITH_MMX_SUPPORT
|
#ifdef SBC_BUILD_WITH_MMX_SUPPORT
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,7 @@ struct sbc_encoder_state {
|
||||||
void (*sbc_calc_scalefactors)(int32_t sb_sample_f[16][2][8],
|
void (*sbc_calc_scalefactors)(int32_t sb_sample_f[16][2][8],
|
||||||
uint32_t scale_factor[2][8],
|
uint32_t scale_factor[2][8],
|
||||||
int blocks, int channels, int subbands);
|
int blocks, int channels, int subbands);
|
||||||
|
const char *implementation_info;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -313,6 +313,7 @@ void sbc_init_primitives_mmx(struct sbc_encoder_state *state)
|
||||||
if (check_mmx_support()) {
|
if (check_mmx_support()) {
|
||||||
state->sbc_analyze_4b_4s = sbc_analyze_4b_4s_mmx;
|
state->sbc_analyze_4b_4s = sbc_analyze_4b_4s_mmx;
|
||||||
state->sbc_analyze_4b_8s = sbc_analyze_4b_8s_mmx;
|
state->sbc_analyze_4b_8s = sbc_analyze_4b_8s_mmx;
|
||||||
|
state->implementation_info = "MMX";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -240,6 +240,7 @@ void sbc_init_primitives_neon(struct sbc_encoder_state *state)
|
||||||
{
|
{
|
||||||
state->sbc_analyze_4b_4s = sbc_analyze_4b_4s_neon;
|
state->sbc_analyze_4b_4s = sbc_analyze_4b_4s_neon;
|
||||||
state->sbc_analyze_4b_8s = sbc_analyze_4b_8s_neon;
|
state->sbc_analyze_4b_8s = sbc_analyze_4b_8s_neon;
|
||||||
|
state->implementation_info = "NEON";
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue