public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Siarhei Siamashka <siarhei.siamashka@nokia.com>
To: "ext Marcel Holtmann" <marcel@holtmann.org>
Cc: hoene@uni-tuebingen.de, linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH/RFC] SIMD optimizations for SBC encoder analysis filter
Date: Wed, 7 Jan 2009 11:31:25 +0200	[thread overview]
Message-ID: <200901071131.25867.siarhei.siamashka@nokia.com> (raw)
In-Reply-To: <1231220701.13304.25.camel@californication>

On Tuesday 06 January 2009 07:45:01 ext Marcel Holtmann wrote:
> Hi Christian,
>
> > > Do we still need the high precession stuff. I wanna cut down the number
> > > of ifdefs in the code as much as possible.
> >
> > Yes, because provides better audio quality.
>
> okay, but we have to make a choice in what we want. We can't just have a
> lots of ifdefs around. They will be killing us eventually. It is a
> nightmare from a release engineering perspective.

That's a single ifdef, which was added for testing purposes. The analysis
filter code itself is flexible enough to work in both configurations as the
shift constants depend on the use of 'sizeof' operator. The original floating
point constants are also wrapped into macros, which expand to the needed
fixed point data type automagically. 

And as it was discussed before, It is possible to have both fast and high
precision implementations compiled in at the same time. Something like having:

sbc_analysis_filter_template.h - with the tables and implementation of
analysis function as a static inline function, with a custom preprocessor
managed suffix for its name

And 'sbc_analysis_filter.c' having code like this:

#define SBC_HIGH_PRECISION
#define SB_ANALYSIS_FUNCTION_SUFFIX _hq
#include "sbc_analysis_filter_template.h"

#undef SBC_HIGH_PRECISION
#undef SB_ANALYSIS_FUNCTION_SUFFIX
#define SB_ANALYSIS_FUNCTION_SUFFIX _fast
#include "sbc_analysis_filter_template.h"

This double include will instantiate both implementations from the same
template. Or something like this. It does not increase source code size
much.

> What is the downside for doing high precession only?

Performance is a lot better for 16-bit fixed point version because it can
benefit from DSP/multimedia instruction set extensions of modern processors.
A performance difference can be seen when benchmarking MMX enabled vs.
high precision build. The relative difference will get even bigger after
optimizing other parts of SBC encoder.

-- 
Best regards,
Siarhei Siamashka

  reply	other threads:[~2009-01-07  9:31 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-31 16:03 [PATCH/RFC] SIMD optimizations for SBC encoder analysis filter Siarhei Siamashka
2008-12-31 20:55 ` Luiz Augusto von Dentz
2009-01-02 16:33   ` Siarhei Siamashka
2009-01-02 19:40     ` Luiz Augusto von Dentz
2009-01-04 17:56       ` Siarhei Siamashka
2009-01-06  2:50   ` Marcel Holtmann
2009-01-01  8:58 ` Marcel Holtmann
2009-01-02 16:07   ` Siarhei Siamashka
2009-01-02 16:27     ` Brad Midgley
2009-01-02 17:11       ` Siarhei Siamashka
2009-01-02 18:03         ` Brad Midgley
2009-01-05 11:08         ` Simon Pickering
2009-01-05  8:57     ` Siarhei Siamashka
2009-01-06  2:49     ` Marcel Holtmann
2009-01-06  5:27       ` Christian Hoene
2009-01-06  5:45         ` Marcel Holtmann
2009-01-07  9:31           ` Siarhei Siamashka [this message]
2009-01-09 16:50       ` Siarhei Siamashka
2009-01-15 19:34         ` Siarhei Siamashka
2009-01-15 23:29           ` 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=200901071131.25867.siarhei.siamashka@nokia.com \
    --to=siarhei.siamashka@nokia.com \
    --cc=hoene@uni-tuebingen.de \
    --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