Number format for sbsamples from IMDCT (Q4.28 to 16 bit PCM samples)

"balaji shanmugam" <[email protected]>
Newsgroups gmane.comp.audio.mad.devel
Message-ID <[email protected]>
Hi Rob

I am new in using the MAD Library and upon working with the code, I have got 
doubt in the Scaling (1st operand shifted right by 12 and 2nd operand 
shifted right by 16) being done during the mad_f_mul operation.

I like to know about the sbsamples from the IMDCT routine. Is it in Q4.28 
format. If so why we need to scale it down during SYNTHESIS Filter 
operation. I have read the comments in fixed.h telling that

" * The scale factors are constant as this is not used with SSO.
*
* Pre-rounding is required to stay within the limits of compliance.
"
I like to know how this scaling has been taken care in the further 
calculations.

Please find below my doubt.

I have defined as FPM_DEFAULT and doesnt define OPT_SPEED.[OPT_SSO will be 
defined as FPM_DEFAULT is defined]. With that the mad_f_mul (A,B) is defined 
as [((A+(1L<<11))>>12) * ((B+(1L<<15))>>16)]

This has been used during the synth_full operation. When the synth_full 
function calls the dct32() function,

sbsamples<2><2><576> (in Q28.4 format) from IMDCT is passed on to the 
function where it will be multiplied with costab<1..31>.

During this multiplication the mad_f_mul MACRO is used. After that the 
result from dct32 is stored as the filter output. While storing the filter 
output, the multiplied value is scaled down by a factor of 12.

Then windowing[D array values being scaled down by 12] was applied over the 
filter ouput and the PCM output is stored with a scale down of 2.

The operation of SSO is understandable but the intial scaling that happens 
with the mad_f_mul MACRO needs explanation.

Thanks in advance

Balaji Shanmugam

_________________________________________________________________
News, views and events. Hot downloads ‘n pictures. 
http://www.msn.co.in/Cinema/ Get it all at MSN Cinema!
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.