David Rowe <da...@rowetel.com> wrote:

> However that does present an interesting challenge.  Maybe there is a
> way to "engineer" or automate fixed point work so that it's more like
> "running a compiler" than hand crafting.
>

I like that idea a lot.  In the (small amount of) fixed point work I have
done, the choice of how many bits of resolution are needed has been a
manual process and relatively straightforward (with few choices, usually 8,
16 or 32 bits unless using specialized hardware).  The more difficult issue
has been scaling (through bit shifts) the values to maintain as much
resolution as possible without overflowing.  Maybe something could be built
on top of the existing feedback directed optimization facilities in GCC
that would record the max values at each stage of the calculations and use
that to adjust the scaling factors for later builds.

Or rather than using the compiler, a customized math library (maybe a C++
class with overloaded operators that would minimize the changes needed to
the rest of the code) could record the max values and provide them in a
format that could control the scaling.  I am thinking of something like a
#define for each arithmetic operation that would indicate the number of bit
shifts needed.  The file of #define values could be included with the
source code so most folks wouldn't need to do anything different to compile
codec2, but after an algorithm change it could be updated.

On target platforms that support saturation arithmetic without a big speed
penalty, it might be worth choosing scaling factors that occasionally cause
saturation because the increased resolution might more than make up for the
error caused by the saturation.  On targets that don't support saturation
arithmetic, I suspect that overflow will need to be avoided at all costs,
as it usually (in my experience) causes really nasty sounding results.

Steve


-- 
Steve Strobel
Link Communications, Inc.
1035 Cerise Rd
Billings, MT 59101-7378
(406) 245-5002 ext 102
(406) 245-4889 (fax)
WWW: http://www.link-comm.com
MailTo:steve.stro...@link-comm.com
------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev
_______________________________________________
Freetel-codec2 mailing list
Freetel-codec2@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freetel-codec2

Reply via email to