All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Frédéric DALLEAU" <frederic.dalleau@palmsource.com>
To: BlueZ development <bluez-devel@lists.sourceforge.net>
Subject: Re: [Bluez-devel] How to use sbc.c ?
Date: Thu, 11 Jan 2007 09:35:41 +0100	[thread overview]
Message-ID: <45A5F6DD.7020904@palmsource.com> (raw)
In-Reply-To: <45A54D5B.8030001@xmission.com>

Brad,

Thank you for answering, I was hesitating between precalculation or =

custom tables.

I've not been really deep into the codec now. It's not easy to follow as =

the spec itself could be more clear.

In my investigations, I got over a 64 bits version of the codec. I =

tested it on pc and arm. It gave better results than the 32 bits : the =

gain is better, the overflow do not occurs, there is still a bit of =

background noise, but not more than the 32 bits and it may be the sample =

file. It will probably consume a little bit more cpu, but I found this =

was not really noticeable (at least on my hardware). But the library =

could be changed according to needs.

While this is not the best solution to the problem, I still think users =

are complaining mainly about gain. So it could be possible to provide it =

as default. What about you?

Regards,
Fr=E9d=E9ric.

Brad Midgley a =E9crit :
> Fr=E9d=E9ric
>
> Somehow this message went to my junk folder!
>
> The tables we have are different because we have changed the algorithm
> over time and adapted the tables to avoid some computation. We also
> split the tables as a result of how they are used.
>
> On top of that, we converted the values to integers which doesn't help
> make it easy to follow.
>
> I hope it's not impossible to follow :(
>
> Brad
>
>   =

>>>> The newest download of sbc.c from http://sbc.cvs.sourceforge.net/sbc/
>>>> under menu "CVS Browse" contains a simple bug, which lets the file
>>>> compile, but crash on runtime: In function _sbc_analyze_eight() the
>>>> array 't[8]' is referenced from t[1] to t[8], instead of t[0] to t[7].
>>>>     =

>>>>         =

>>> fixed. thanks.
>>>   =

>>>       =

>> some values were missed so the sound is now larsenized ;)
>> patch attached.
>>
>> BTW, I was looking for the tables specially Proto_4_40 and Proto_8_80
>> from a2dp specifications.
>> I suspect they are stored in sbc_proto_8_80m0 and sbc_proto_8_80m1.
>> The values are not the same that in the spec. Do you know why?
>>
>>
>> ------------------------------------------------------------------------
>>
>> ? Doxyfile
>> ? Makefile
>> ? Makefile.in
>> ? aclocal.m4
>> ? autom4te.cache
>> ? config.guess
>> ? config.h
>> ? config.h.in
>> ? config.log
>> ? config.status
>> ? config.sub
>> ? configure
>> ? debug
>> ? depcomp
>> ? install-sh
>> ? libtool
>> ? ltmain.sh
>> ? missing
>> ? sbc.kdevelop
>> ? sbc.kdevelop.pcs
>> ? sbc.kdevses
>> ? sbc.pc
>> ? stamp-h1
>> ? include/Makefile
>> ? include/Makefile.in
>> ? lib/.deps
>> ? lib/.libs
>> ? lib/Makefile
>> ? lib/Makefile.in
>> ? lib/libsbc.la
>> ? lib/sbc.lo
>> ? src/.deps
>> ? src/.libs
>> ? src/Makefile
>> ? src/Makefile.in
>> ? src/sbcinfo
>> Index: lib/sbc.c
>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>> RCS file: /cvsroot/sbc/sbc/lib/sbc.c,v
>> retrieving revision 1.8
>> diff -u -r1.8 sbc.c
>> --- lib/sbc.c	19 Dec 2006 22:13:41 -0000	1.8
>> +++ lib/sbc.c	20 Dec 2006 12:58:09 -0000
>> @@ -892,84 +892,84 @@
>>  	MULA(res, -_sbc_proto_8[21], in[75]);
>>  	t[7] =3D SCALE8_STAGE1(res);
>>  =

>> -	MUL(res, _anamatrix8[0], t[1]);
>> -	MULA(res, _anamatrix8[7], t[2]);
>> -	MULA(res, _anamatrix8[2], t[3]);
>> -	MULA(res, _anamatrix8[3], t[4]);
>> -	MULA(res, _anamatrix8[6], t[5]);
>> -	MULA(res, _anamatrix8[4], t[6]);
>> -	MULA(res, _anamatrix8[1], t[7]);
>> -	MULA(res, _anamatrix8[5], t[8]);
>> +	MUL(res, _anamatrix8[0], t[0]);
>> +	MULA(res, _anamatrix8[7], t[1]);
>> +	MULA(res, _anamatrix8[2], t[2]);
>> +	MULA(res, _anamatrix8[3], t[3]);
>> +	MULA(res, _anamatrix8[6], t[4]);
>> +	MULA(res, _anamatrix8[4], t[5]);
>> +	MULA(res, _anamatrix8[1], t[6]);
>> +	MULA(res, _anamatrix8[5], t[7]);
>>  	out[0] =3D SCALE8_STAGE2(res);
>>  =

>> -	MUL(res, _anamatrix8[1], t[1]);
>> -	MULA(res, _anamatrix8[7], t[2]);
>> -	MULA(res, _anamatrix8[3], t[3]);
>> -	MULA(res, -_anamatrix8[5], t[4]);
>> -	MULA(res, -_anamatrix8[6], t[5]);
>> -	MULA(res, -_anamatrix8[2], t[6]);
>> -	MULA(res, -_anamatrix8[0], t[7]);
>> -	MULA(res, -_anamatrix8[4], t[8]);
>> +	MUL(res, _anamatrix8[1], t[0]);
>> +	MULA(res, _anamatrix8[7], t[1]);
>> +	MULA(res, _anamatrix8[3], t[2]);
>> +	MULA(res, -_anamatrix8[5], t[3]);
>> +	MULA(res, -_anamatrix8[6], t[4]);
>> +	MULA(res, -_anamatrix8[2], t[5]);
>> +	MULA(res, -_anamatrix8[0], t[6]);
>> +	MULA(res, -_anamatrix8[4], t[7]);
>>  	out[1] =3D SCALE8_STAGE2(res);
>>  =

>> -	MUL(res, -_anamatrix8[1], t[1]);
>> -	MULA(res, _anamatrix8[7], t[2]);
>> -	MULA(res, _anamatrix8[4], t[3]);
>> -	MULA(res, -_anamatrix8[2], t[4]);
>> -	MULA(res, -_anamatrix8[6], t[5]);
>> -	MULA(res, _anamatrix8[5], t[6]);
>> -	MULA(res, _anamatrix8[0], t[7]);
>> -	MULA(res, _anamatrix8[3], t[8]);
>> +	MUL(res, -_anamatrix8[1], t[0]);
>> +	MULA(res, _anamatrix8[7], t[1]);
>> +	MULA(res, _anamatrix8[4], t[2]);
>> +	MULA(res, -_anamatrix8[2], t[3]);
>> +	MULA(res, -_anamatrix8[6], t[4]);
>> +	MULA(res, _anamatrix8[5], t[5]);
>> +	MULA(res, _anamatrix8[0], t[6]);
>> +	MULA(res, _anamatrix8[3], t[7]);
>>  	out[2] =3D SCALE8_STAGE2(res);
>>  =

>> -	MUL(res, -_anamatrix8[0], t[1]);
>> -	MULA(res, _anamatrix8[7], t[2]);
>> -	MULA(res, _anamatrix8[5], t[3]);
>> -	MULA(res, -_anamatrix8[4], t[4]);
>> -	MULA(res, _anamatrix8[6], t[5]);
>> -	MULA(res, _anamatrix8[3], t[6]);
>> -	MULA(res, -_anamatrix8[1], t[7]);
>> -	MULA(res, -_anamatrix8[2], t[8]);
>> +	MUL(res, -_anamatrix8[0], t[0]);
>> +	MULA(res, _anamatrix8[7], t[1]);
>> +	MULA(res, _anamatrix8[5], t[2]);
>> +	MULA(res, -_anamatrix8[4], t[3]);
>> +	MULA(res, _anamatrix8[6], t[4]);
>> +	MULA(res, _anamatrix8[3], t[5]);
>> +	MULA(res, -_anamatrix8[1], t[6]);
>> +	MULA(res, -_anamatrix8[2], t[7]);
>>  	out[3] =3D SCALE8_STAGE2(res);
>>  =

>> -	MUL(res, -_anamatrix8[0], t[1]);
>> -	MULA(res, _anamatrix8[7], t[2]);
>> -	MULA(res, -_anamatrix8[5], t[3]);
>> -	MULA(res, _anamatrix8[4], t[4]);
>> -	MULA(res, _anamatrix8[6], t[5]);
>> -	MULA(res, -_anamatrix8[3], t[6]);
>> -	MULA(res, -_anamatrix8[1], t[7]);
>> -	MULA(res, _anamatrix8[2], t[8]);
>> +	MUL(res, -_anamatrix8[0], t[0]);
>> +	MULA(res, _anamatrix8[7], t[1]);
>> +	MULA(res, -_anamatrix8[5], t[2]);
>> +	MULA(res, _anamatrix8[4], t[3]);
>> +	MULA(res, _anamatrix8[6], t[4]);
>> +	MULA(res, -_anamatrix8[3], t[5]);
>> +	MULA(res, -_anamatrix8[1], t[6]);
>> +	MULA(res, _anamatrix8[2], t[7]);
>>  	out[4] =3D SCALE8_STAGE2(res);
>>  =

>> -	MUL(res, -_anamatrix8[1], t[1]);
>> -	MULA(res, _anamatrix8[7], t[2]);
>> -	MULA(res, -_anamatrix8[4], t[3]);
>> -	MULA(res, _anamatrix8[2], t[4]);
>> -	MULA(res, -_anamatrix8[6], t[5]);
>> -	MULA(res, -_anamatrix8[5], t[6]);
>> -	MULA(res, _anamatrix8[0], t[7]);
>> -	MULA(res, -_anamatrix8[3], t[8]);
>> +	MUL(res, -_anamatrix8[1], t[0]);
>> +	MULA(res, _anamatrix8[7], t[1]);
>> +	MULA(res, -_anamatrix8[4], t[2]);
>> +	MULA(res, _anamatrix8[2], t[3]);
>> +	MULA(res, -_anamatrix8[6], t[4]);
>> +	MULA(res, -_anamatrix8[5], t[5]);
>> +	MULA(res, _anamatrix8[0], t[6]);
>> +	MULA(res, -_anamatrix8[3], t[7]);
>>  	out[5] =3D SCALE8_STAGE2(res);
>>  =

>> -	MUL(res, _anamatrix8[1], t[1]);
>> -	MULA(res, _anamatrix8[7], t[2]);
>> -	MULA(res, -_anamatrix8[3], t[3]);
>> -	MULA(res, _anamatrix8[5], t[4]);
>> -	MULA(res, -_anamatrix8[6], t[5]);
>> -	MULA(res, _anamatrix8[2], t[6]);
>> -	MULA(res, -_anamatrix8[0], t[7]);
>> -	MULA(res, _anamatrix8[4], t[8]);
>> +	MUL(res, _anamatrix8[1], t[0]);
>> +	MULA(res, _anamatrix8[7], t[1]);
>> +	MULA(res, -_anamatrix8[3], t[2]);
>> +	MULA(res, _anamatrix8[5], t[3]);
>> +	MULA(res, -_anamatrix8[6], t[4]);
>> +	MULA(res, _anamatrix8[2], t[5]);
>> +	MULA(res, -_anamatrix8[0], t[6]);
>> +	MULA(res, _anamatrix8[4], t[7]);
>>  	out[6] =3D SCALE8_STAGE2(res);
>>  =

>> -	MUL(res, _anamatrix8[0], t[1]);
>> -	MULA(res, _anamatrix8[7], t[2]);
>> -	MULA(res, -_anamatrix8[2], t[3]);
>> -	MULA(res, -_anamatrix8[3], t[4]);
>> -	MULA(res, _anamatrix8[6], t[5]);
>> -	MULA(res, -_anamatrix8[4], t[6]);
>> -	MULA(res, _anamatrix8[1], t[7]);
>> -	MULA(res, -_anamatrix8[5], t[8]);
>> +	MUL(res, _anamatrix8[0], t[0]);
>> +	MULA(res, _anamatrix8[7], t[1]);
>> +	MULA(res, -_anamatrix8[2], t[2]);
>> +	MULA(res, -_anamatrix8[3], t[3]);
>> +	MULA(res, _anamatrix8[6], t[4]);
>> +	MULA(res, -_anamatrix8[4], t[5]);
>> +	MULA(res, _anamatrix8[1], t[6]);
>> +	MULA(res, -_anamatrix8[5], t[7]);
>>  	out[7] =3D SCALE8_STAGE2(res);
>>  }
>>  =

>>
>>
>> ------------------------------------------------------------------------
>>
>> -------------------------------------------------------------------------
>> Take Surveys. Earn Cash. Influence the Future of IT
>> Join SourceForge.net's Techsay panel and you'll get the chance to share =
your
>> opinions on IT & business topics through brief surveys - and earn cash
>> http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=
=3DDEVDEV
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Bluez-devel mailing list
>> Bluez-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/bluez-devel
>>     =

>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share y=
our
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D=
DEVDEV
> _______________________________________________
> Bluez-devel mailing list
> Bluez-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-devel
>   =



-- =

Frederic

Without the wind, the grass does not move.


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3DDE=
VDEV
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

  parent reply	other threads:[~2007-01-11  8:35 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-31 10:19 [Bluez-users] Play received A2DP data Frank Heimbaecher
2006-08-31 11:37 ` Manuel Bernhardt
2006-08-31 13:05   ` Brad Midgley
2006-12-15 13:28 ` [Bluez-users] How to use sbc.c of btsco? Frank Heimbächer
2006-12-16  7:28   ` [Bluez-devel] " Brad Midgley
2006-12-19 11:43     ` [Bluez-devel] How to use sbc.c ? Frank Heimbächer
2006-12-19 22:17       ` Brad Midgley
2006-12-20 13:14         ` Frédéric DALLEAU
2007-01-10 20:32           ` Brad Midgley
2007-01-11  8:24             ` Siegbert Baude
2007-01-16  4:33               ` Brad Midgley
2007-01-11  8:35             ` Frédéric DALLEAU [this message]
2007-01-12 18:52               ` Brad Midgley
2007-01-13 17:32                 ` [Bluez-devel] RE : " Frederic Dalleau
2007-01-16  4:25                   ` Brad Midgley
2006-12-22 12:07       ` [Bluez-devel] " Frank Heimbaecher

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=45A5F6DD.7020904@palmsource.com \
    --to=frederic.dalleau@palmsource.com \
    --cc=bluez-devel@lists.sourceforge.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.