2005-10-25 07:28:44

by Victor Shcherbatyuk

[permalink] [raw]
Subject: RE: [Bluez-devel] fixed-point sbc decoder

Brad,

I'll take a look in coming days.

Victor.
=20

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Brad
Midgley
Sent: Tuesday, October 25, 2005 0:30 AM
To: [email protected]
Subject: [Bluez-devel] fixed-point sbc decoder

Victor,

I was working on the fixed point decoder. I also found and reorganized
the inner loop around another optimization... the code I've written
works when using floating point but something is not right in the fixed
point. Can you have a quick look?

What I do is

btsco$ make && ./sbc/sbcdec t1.sbc

I suspect I'm not be doing the 64 to 32 bit conversions right...

http://bluetooth-alsa.sf.net/fixed/fixed-decode.patch
http://bluetooth-alsa.sf.net/fixed/t1.sbc

The latter is just an audio file, but as a bonus it's a friend's band
(and probably too noisy to be a good test :)

Brad


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course Free
Certification Exam for All Training Attendees Through End of 2005 Visit
http://www.jboss.com/services/certification for more information
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel


This e-mail message contains information which is confidential and may be=
privileged. It is intended for use by the addressee only. If you are not=
the intended addressee, we request that you notify the sender immediatel=
y and delete or destroy this e-mail message and any attachment(s), withou=
t copying, saving, forwarding, disclosing or using its contents in any ot=
her way. TomTom N.V., TomTom International BV or any other company belong=
ing to the TomTom group of companies will not be liable for damage relati=
ng to the communication by e-mail of data, documents or any other informa=
tion.


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel


2005-10-27 05:33:48

by Brad Midgley

[permalink] [raw]
Subject: Re: [Bluez-devel] fixed-point sbc decoder

Victor,

>>I'll take a look in coming days.

fwiw, I committed fixed point decoding such as it is to cvs after
finding and eliminating some overflow problems. it's noisy but at least
functional. so you can just check it out of cvs (I didn't want to commit
what I had before that was nonfunctional but at least this is borderline)

> #define SP8(val) (val/(1<<SCALE_PROTO8_TBL))

actually, I found this needs to look like

#define SP8(val) (((int32_t)val)/(1<<SCALE_PROTO8_TBL))

I guess because all the literals in the array init look like they're
unsigned. This kind of fix may need to be applied in a few other places.

I am very proud of the latest optimization. I eliminated the shift/copy
of the main array by reordering it. The result is going to benefit from
unrolling since I was also able to make the array access into sbc_proto
always the same in every pass.

brad


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2005-10-27 03:07:47

by Brad Midgley

[permalink] [raw]
Subject: Re: [Bluez-devel] fixed-point sbc decoder

Victor,

> I'll take a look in coming days.

thanks... for now I'm running floating and fixed point side-by-side and
watching for sign errors to find overflow. I was putting too many
precision bits in the fixed point synmatrix and it was overflowing and
coming out with the wrong sign in the product...

hey I noticed something that doesn't look right:

#define SP8(val) (val >> SCALE_PROTO8_TBL)

this is used in the tables for the 32-bit encoder. but this is not right
for negative values. Their sign will flip because it's a logical (not
arithmetic) shift. it's safer to do something like:

#define SP8(val) (val/(1<<SCALE_PROTO8_TBL))

don't you think? the divide will be done at compile time and it will
preserve the sign bit.

Brad


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel