public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Jaska Uimonen <jaska.uimonen@nokia.com>
To: Siarhei Siamashka <siarhei.siamashka@nokia.com>
Cc: 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: Wed, 17 Dec 2008 10:16:34 +0200	[thread overview]
Message-ID: <1229501794.20555.73.camel@esdhcp03999.research.nokia.com> (raw)
In-Reply-To: <200812170037.48141.siarhei.siamashka@nokia.com>

[-- Attachment #1: Type: text/plain, Size: 2905 bytes --]

Hello All,

Sorry about the silence, I was away from the office for 
couple of weeks.

Anyway here is the original patch modified to suit the 
bluez coding conventions. There might still be something 
(I'm quite bad with these issues...)

I also added Siarhei's rounding stuff to the filter 
tables. Good point Siarhei!

Concerning Brad's comments I think the calculation 
of tables should now be quite clear. There are 
comments on the tables how to produce them in Octave and 
the filtering function is very basic fixed point Q15 
calculation. 

I agree that including the original float values to the 
code would probably be a good idea. Then we could just 
use some macro at compile time to modify them to suitable 
Q format and original values would always be there to 
be viewed and compared to.

I would still be careful about the optimization of the 
filtering, so that we don't obfuscate the code too much. 
The filter and cosine table are quite small so we should 
consider how much we save in computation. Anyway if the savings 
are significant let's just add them there.

br,
Jaska Uimonen


 
 


On Wed, 2008-12-17 at 00:37 +0200, Siarhei Siamashka wrote:
> On Monday 15 December 2008 17:16:58 ext Brad Midgley wrote:
> > I like your idea of using a macro with the original floating point
> > tables, as long as we know it is done at compile time, not runtime :)
> 
> What about something like this modification to Jaska's patch? It contains
> floating point constants wrapped into a macro.
> 
> This version is using 16-bit multiplications only (additional natural change
> would be just to convert 'sbc_encoder_state->' to int16_t because it does not
> need to be int32_t), which is good for performance for the platforms with fast
> 16-bit integer multiplication. But it is also flexible enough to be changed to
> use 32x32->64 multiplications just by replacing FIXED_A and FIXED_T types
> to int64_t and int32_t respectively (for better precision or experiments with
> conformance testing).
> 
> > > Can anybody try to remember/explain what transformations were applied to
> > > the existing fixed point implementation?
> >
> > it was done by several people and the only record we have is in cvs.
> > (part of it is in the old btsco project's cvs)
> 
> Regarding the code optimizations. Looking at the tables, It can be seen that
> 'cos_table_fixed_8[0+hop]' is always equal to 'cos_table_fixed_8[8+hop]'.
> The same is true for 'cos_table_fixed_8[1+hop]' and 'cos_table_fixed_8[7+hop]'
> So it is possible to join 't1[0] + t1[8]', 't1[1]+ t1[7]' and the other such
> pairs, effectively halving the number of counters. This looks very much like
> the optimization that was applied to the current fixed point code :)
> 
> But now it would be very interesting to see if the conformance tests pass
> rate is better with the new filtering function.
> 
> 
> Best regards,
> Siarhei Siamashka

[-- Attachment #2: 0001-New-function-and-tables-for-8-band-fixed-point-analy.patch --]
[-- Type: application/mbox, Size: 7221 bytes --]

  reply	other threads:[~2008-12-17  8:16 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 [this message]
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
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=1229501794.20555.73.camel@esdhcp03999.research.nokia.com \
    --to=jaska.uimonen@nokia.com \
    --cc=bmidgley@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=siarhei.siamashka@nokia.com \
    /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