2008-12-31 15:29:30

by Siarhei Siamashka

[permalink] [raw]
Subject: [PATCH] Added possibility to analyze 4 blocks at once in SBC encoder

Hello all,

With bluez-4.25 release I hope that the SBC encoder sound quality issues are
now solved (though this is yet to be confirmed).

Nevertheless, I think it is time to focus on performance :) The attached patch
contains code preparations which are needed for SIMD optimizations for
the analysis filter. Also theoretically it should be possible to tweak code to
have both 32-bit and 16-bit fixed point analysis filter compiled in and switch
between them at runtime (at user's request or semi-intelligently depending
on audio bitrate).

This patch should be stable and ready to be committed.

Best regards,
Siarhei Siamashka


Attachments:
(No filename) (630.00 B)
0001-Added-possibility-to-analyze-4-blocks-at-once-in-SBC.patch (6.16 kB)
Download all attachments

2008-12-31 21:04:20

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: [PATCH] Added possibility to analyze 4 blocks at once in SBC encoder

Hi Siarhei,


> Nevertheless, I think it is time to focus on performance :) The attached patch
> contains code preparations which are needed for SIMD optimizations for
> the analysis filter. Also theoretically it should be possible to tweak code to
> have both 32-bit and 16-bit fixed point analysis filter compiled in and switch
> between them at runtime (at user's request or semi-intelligently depending
> on audio bitrate).

Picking a implementation at runtime would be really great, that is why
I suggested using liboil in the other thread.


--
Luiz Augusto von Dentz
Engenheiro de Computa??o

2009-01-02 16:51:26

by Siarhei Siamashka

[permalink] [raw]
Subject: Re: [PATCH] Added possibility to analyze 4 blocks at once in SBC encoder

On Wednesday 31 December 2008 23:04:20 ext Luiz Augusto von Dentz wrote:
> Hi Siarhei,
>
> > Nevertheless, I think it is time to focus on performance :) The attached
> > patch contains code preparations which are needed for SIMD optimizations
> > for the analysis filter. Also theoretically it should be possible to
> > tweak code to have both 32-bit and 16-bit fixed point analysis filter
> > compiled in and switch between them at runtime (at user's request or
> > semi-intelligently depending on audio bitrate).
>
> Picking a implementation at runtime would be really great,

What I had in mind was that we can have two source files which
include 'sbc_tables.h'. Then compile one of them with
SBC_HIGH_PRECISION macro defined, and the other one
without it. This way we will have two sets of functions, which
can be called via function pointers transparently from the rest
of code, as long as they have the same interface.

Having high precision analysis filter variant may be beneficial for
extremely high bitrates, when we might want to keep as much of
precision as possible. For the normal cases the extra precision is
just excessive.

I also have an idea about improving precision for the case of 16-bit
multiplications only. This would involve only tweaking coefficients in
the tables with no code changes at all. I hope to reduce rounding
errors to the very minimum. Will post about the progress a bit later.

If the precision difference between 16-bit and 32-bit implementations
can be reduced, there will be a bit less reasons to use a slow high
precision version anymore :)

> that is why I suggested using liboil in the other thread.

I don't see much relation with liboil here.

I'm not against liboil in general, but its usefullness for sbc codec just
needs to be proved.

--
Best regards,
Siarhei Siamashka

2009-01-02 16:13:57

by Siarhei Siamashka

[permalink] [raw]
Subject: Re: [PATCH] Added possibility to analyze 4 blocks at once in SBC encoder

On Thursday 01 January 2009 10:54:02 ext Marcel Holtmann wrote:
> Hi Siarhei,
>
> > With bluez-4.25 release I hope that the SBC encoder sound quality issues
> > are now solved (though this is yet to be confirmed).
> >
> > Nevertheless, I think it is time to focus on performance :) The attached
> > patch contains code preparations which are needed for SIMD optimizations
> > for the analysis filter. Also theoretically it should be possible to
> > tweak code to have both 32-bit and 16-bit fixed point analysis filter
> > compiled in and switch between them at runtime (at user's request or
> > semi-intelligently depending on audio bitrate).
> >
> > This patch should be stable and ready to be committed.
>
> your patch has been applied. Thanks.

Thank you very much for taking a good care of my patches :)


Best regards,
Siarhei Siamashka

2009-01-01 08:54:02

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [PATCH] Added possibility to analyze 4 blocks at once in SBC encoder

Hi Siarhei,

> With bluez-4.25 release I hope that the SBC encoder sound quality issues are
> now solved (though this is yet to be confirmed).
>
> Nevertheless, I think it is time to focus on performance :) The attached patch
> contains code preparations which are needed for SIMD optimizations for
> the analysis filter. Also theoretically it should be possible to tweak code to
> have both 32-bit and 16-bit fixed point analysis filter compiled in and switch
> between them at runtime (at user's request or semi-intelligently depending
> on audio bitrate).
>
> This patch should be stable and ready to be committed.

your patch has been applied. Thanks.

Regards

Marcel