[FFmpeg-cvslog] r14897 - trunk/libavcodec/acelp_filters.c
Michael Niedermayer
michaelni
Fri Aug 22 13:37:30 CEST 2008
On Fri, Aug 22, 2008 at 12:42:04AM +0100, M?ns Rullg?rd wrote:
> michael <subversion at mplayerhq.hu> writes:
>
> > Author: michael
> > Date: Fri Aug 22 01:25:41 2008
> > New Revision: 14897
> >
> > Log:
> > Remove mathops.h dependancy.
>
> The purpose of mathops.h is to allow CPU-specific instructions to be
> used for common operations. Not using it when possible is similar to
> not using dsputil. Is there a specific reason the optimised macros
> are unsuitable in this file?
Several points
the first line can be simplified to
tmp = (hpf_f[0]* 3959LL)>>11;
but the shift is fixed per file when mathops.h is used
vladimirs comments indicated that the hpf variables need 26 bits
in which case the code can be simplified to
tmp = ( 31*hpf_f[0] + ((hpf_f[0]*-9)>>7))>>4
tmp += (-15*hpf_f[1] + ((hpf_f[1]*13)>>9))>>4;
which avoids the 64bit ops ...
additionally the >>4 can be done after the summing of the 2 though
that would not be bit exact
The main reason why i didnt commit it was that i just found out that
the code contains a claim from vladimir that cliping to 16bit after
a right shift of 12 bits is required thus completely contradicting
the first comment of these fitting in 26bits.
Thats also a good example why i flamed him, his code is a total mess
and the comments are only costing the reader extra time as half are
wrong.
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Its not that you shouldnt use gotos but rather that you should write
readable code and code with gotos often but not always is less readable
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-cvslog/attachments/20080822/1b3dcd08/attachment.pgp>
More information about the ffmpeg-cvslog
mailing list