[FFmpeg-devel] [PATCH 1/2] libavcodec: changed mathematical functions in aacpsy.c

Michael Niedermayer michaelni at gmx.at
Wed Jan 23 23:36:18 CET 2013


On Wed, Jan 23, 2013 at 12:46:29PM +0000, Zivkovic, Bojan (c) wrote:
> Hello!
[...]
> > >              band->thr      = band->energy * 0.001258925f;
> > > -            band->nz_lines = band->energy>0 ? form_factor / powf(band->energy / band_sizes[g], 0.25f) : 0;
> > > +            band->nz_lines = form_factor * sqrtf(Temp);
> > >  
> > >              start += band_sizes[g];
> > >          }
> > > @@ -708,7 +715,7 @@ static void psy_3gpp_analyze_channel(FFPsyContext *ctx, int channel,
> >                                                            
> > >                          float delta_sfb_pe = band->norm_fac * norm_fac * delta_pe;
> > >                          float thr = band->thr;
> > >  
> > > -                        thr *= exp2f(delta_sfb_pe / band->active_lines);
> > > +                        thr *= exp(PSY_3GPP_LN_2 * delta_sfb_pe / band->active_lines);
>> > If exp(C*x) is faster then exp2f(x) with some compiler then you could
> > just replace exp2f through some #define from a header everywhere
> 
> Should I check if the compiler is GCC,and if the case is true define this function in one way,
> otherwise in other? Can you give me an advice how to check which compiler was used?
> This was compiled using GCC compiler.

Is there a compiler that does not need this replacement ?
if not then it could be done unconditional for mips
checking for just gcc without gcc compatible compilers might be harder
i dunno, maybe something like defined(__GNUC__) && !defined(__clang__)
&& !...
would work


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130123/58d70f44/attachment.asc>


More information about the ffmpeg-devel mailing list