From: Siarhei Siamashka <siarhei.siamashka@nokia.com>
To: "Uimonen Jaska (Nokia-D/Helsinki)" <Jaska.Uimonen@nokia.com>
Cc: "ext Marcel Holtmann" <marcel@holtmann.org>,
"ext Brad Midgley" <bmidgley@gmail.com>,
linux-bluetooth@vger.kernel.org
Subject: Re: [RFC/PATCH] sbc: new filtering function for 8 band fixed point encoding
Date: Tue, 23 Dec 2008 13:14:14 +0200 [thread overview]
Message-ID: <200812231314.14270.siarhei.siamashka@nokia.com> (raw)
In-Reply-To: <701586182114824C876BD526F939600A0118BEEB@vaebe103.NOE.Nokia.com>
On Tuesday 23 December 2008 10:20:25 Uimonen Jaska (Nokia-D/Helsinki) wrote:
> Hi Guys,
>
> As Siarhei said, we had a talk last week about
> The optimizations to the code.
>
> I added the modifications to the code, which reduce
> The amount of operations quite a lot.
Yes, thank you very much for doing this part of work, I included these
modifications into the last revision of my patch. And of course, your
initial patch to fix the SBC quality issues was invaluable. I hope that you
will not be forgotten to be credited properly when the filtering functions
are complete and committed.
> The problem
> With this modification is that it also reduces the
> Readability of the code.
Yes, that's one of the reasons why I'm trying to post different revisions
here, so all the history of modifications can be tracked if somebody is
interested.
> So because of the redundancy in the cosine transform
> it is possible to reduce the number of variables
> and operations in the preceding filtering.
> This is very hard to explain with comments in the code
> (so you would write something like "here should be t[12], but
> The table goes only to 8 because of redundancy in the following
> Cosine transform). To really make the stuff
> Understandable one should write some small
> Wikipage or extensive comments to the code.
>
> So this is the path the previous code also took, but
> At some point there was a mistake. I really don't still
> Get how the anamatrix stuff was calculated, but as
> You see it takes time to reverse engineer :)
>
> But I suggest me and Siarhei clean the code internally
> And try really hard to follow the conventions. It starts
> To get little bit messy, because we both have many
> Versions of the code.
I think that my last revision of patch is more or less complete and needs
only minor tweaks and cosmetic changes. It's not too obfuscated yet, and
the logic still can be seen (hopefully).
I intentionally decided not to include loops unrolling part as it actually
makes code harder to optimize further (for example add SIMD optimizations).
The idea is to have some kind of "reference" implementation, which is
reasonably compact and simple and also configurable for having high
precision mode (very useful for testing purposes).
Implementations, optimized for various platforms can be derived from it:
1. Platforms where multiplications are expensive and you want to avoid as many
of them as possible (reintroduce 'anamatrix' table, have shifts and additions
instead of multiplications, etc)
2. Platforms where the total number of operations is desired to be kept at
minimum (tables need to have unused and duplicate elements removed in
order to reduce the number of operations for loading constants)
3. Platforms where SIMD optimizations are possible (the code and tables should
have a regular structure, suitable for vectorizing, some table elements may
have to be be reordered)
As one can see, these platform specific optimizations have somewhat
contradictory requirements. I tried to arrange the code in such a way, that
any of such further optimizations can be easily introduced based on it.
--
Best regards,
Siarhei Siamashka
next prev parent reply other threads:[~2008-12-23 11:14 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-28 13:35 [RFC/PATCH] sbc: new filtering function for 8 band fixed point encoding Jaska Uimonen
2008-11-28 14:18 ` Marcel Holtmann
2008-11-28 14:24 ` Jelle de Jong
2008-11-28 15:20 ` Jaska Uimonen
2008-11-28 18:13 ` David Sainty
2008-11-28 15:14 ` Jaska Uimonen
2008-12-02 20:15 ` Jim Carter
2008-12-12 17:14 ` Siarhei Siamashka
2008-12-12 19:19 ` Brad Midgley
2008-12-15 12:54 ` Siarhei Siamashka
2008-12-15 15:16 ` Brad Midgley
2008-12-16 22:37 ` Siarhei Siamashka
2008-12-17 8:16 ` Jaska Uimonen
2008-12-19 22:12 ` Siarhei Siamashka
2008-12-22 23:30 ` Siarhei Siamashka
2008-12-23 1:00 ` Marcel Holtmann
2008-12-23 8:20 ` Jaska.Uimonen
2008-12-23 11:14 ` Siarhei Siamashka [this message]
2008-12-23 10:45 ` Siarhei Siamashka
2008-12-23 11:48 ` Marcel Holtmann
2008-12-29 9:16 ` Testing SBC filtering functions Christian Hoene
2008-12-29 10:00 ` Marcel Holtmann
2008-12-29 10:55 ` Christian Hoene
2008-12-29 12:03 ` Marcel Holtmann
2008-12-29 12:31 ` Christian Hoene
2008-12-29 12:41 ` Marcel Holtmann
2008-12-29 13:11 ` Christian Hoene
2008-12-29 13:17 ` Marcel Holtmann
2009-01-01 14:29 ` Testing SBC encoder correctness with sbctester works Christian Hoene
2008-12-29 11:06 ` Testing SBC filtering functions Siarhei Siamashka
2008-12-29 12:04 ` Marcel Holtmann
2008-12-29 14:36 ` Siarhei Siamashka
2008-12-29 15:04 ` Siarhei Siamashka
2008-12-29 10:46 ` [RFC/PATCH] sbc: new filtering function for 8 band fixed point encoding Siarhei Siamashka
2008-12-29 11:56 ` Marcel Holtmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200812231314.14270.siarhei.siamashka@nokia.com \
--to=siarhei.siamashka@nokia.com \
--cc=Jaska.Uimonen@nokia.com \
--cc=bmidgley@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=marcel@holtmann.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox