bluetooth: ldac: Use format as FLOAT32LE

LDAC encoder already supports S16, S24, S32 and F32LE. Using FLOAT32LE
for the sample format would avoid the additional call for conversion to
pa_sconv_s32le_from_float32ne. perf tool shows this as being the function
called frequently after encode. So, just avoid this by using sample format
as F32LE.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/486>
This commit is contained in:
Sanchayan Maity 2021-01-22 16:26:52 +05:30
parent 9431e96ae4
commit c686215268
2 changed files with 4 additions and 1 deletions

View file

@ -321,6 +321,9 @@ static GstCaps *gst_create_caps_from_sample_spec(const pa_sample_spec *ss) {
case PA_SAMPLE_S32LE: case PA_SAMPLE_S32LE:
sample_format = "S32LE"; sample_format = "S32LE";
break; break;
case PA_SAMPLE_FLOAT32LE:
sample_format = "F32LE";
break;
default: default:
pa_assert_not_reached(); pa_assert_not_reached();
break; break;

View file

@ -208,7 +208,7 @@ bool gst_init_ldac(struct gst_info *info, pa_sample_spec *ss, bool for_encoding)
return false; return false;
} }
ss->format = PA_SAMPLE_S32LE; ss->format = PA_SAMPLE_FLOAT32LE;
switch (info->a2dp_codec_t.ldac_config->frequency) { switch (info->a2dp_codec_t.ldac_config->frequency) {
case LDAC_SAMPLING_FREQ_44100: case LDAC_SAMPLING_FREQ_44100: