[Speex-dev] Patch for Analog Devices compiler & fixed-point AGC

Jean-Marc Valin
Tue, 19 Feb 2008 13:09:23 -0000

Stephane Lesage a ?crit :
>
> Hi Jean-Marc,
>
> As I told you, bank is a reserved keyword in Analog Devices compiler for
>  Blackfin architecture.
> So we need to change the variables named bank to something else.

You mean the VDSP compiler that people seem to have mostly replaced with
gcc?

> Here's a patch that changes bank to bnk in the 3 concerned files.
> (Hope the format is OK)

The format's fine, but I don't exactly like having to change all the
names just because some compiler somewhere thought it was a good idea to
redefine keywords. How about you just compile with -Dbank=bnk ?

> About my previous problems with the Blackfin:
> -> strange block repetition that could be cancelled by the AEC
> I was busy with higher-level code and new hardware,
> but I did some new tests now, and it was really stupid:
...
> This was a problem on my test program, because he's doing nothing else,
> but didn't occur in my software which can do a bunch of other things.

Good!


> Something else:
> I need the AGC on my fixed-point platform,
> I've looked at the code, I think I will do it, as it seems pretty easy:
> - I can live with a few emulated floating point operations for gain
> computation
> - extract gain mantissa and exponent
> - multiply fixed-point buffer by mantissa
> - offset spectrum exponent before IFFT reconstruction
>
> What do you think ?

It would be even better if you could do it with my pseudofloat macros.
It defines a float approximation with 16-bit mantissa and 16-bit
exponent. It takes cuts corners all over the place (makes all kind of
assumptions), but it's faster than emulating IEEE float and it would be
cleaner since the code is already there.

Cheers,

	Jean-Marc