[FFmpeg-soc] [soc]: r213 - aac/aac.c

Michael Niedermayer michaelni at gmx.at
Sat Jun 2 15:56:36 CEST 2007


Hi

On Sat, Jun 02, 2007 at 01:26:24PM +0200, bcoudurier wrote:
> Author: bcoudurier
> Date: Sat Jun  2 13:26:24 2007
> New Revision: 213
> 
> Log:
> use av_flt2int, decoding actually works now, need to figure out the cliping stuff
> 
> Modified:
>    aac/aac.c
> 
> Modified: aac/aac.c
> ==============================================================================
> --- aac/aac.c	(original)
> +++ aac/aac.c	Sat Jun  2 13:26:24 2007
> @@ -79,7 +79,7 @@ static inline int16_t LTP_ROUND(float x)
>  }
>  
>  static inline uint16_t F2U16(float x) {
> -    int32_t tmp = ((int32_t*)&x)[0];
> +    int32_t tmp = av_flt2int(x);
>      if (tmp & 0xf0000) {
>          if (tmp > 0x43c0ffff) tmp = 0xFFFF;
>          else                  tmp = 0;

IIRC this function is supposed to be a faster alternative to converting
float to int
av_flt2int() is VERY slow
it is the most stupid way you could convert a float to an integer here

just use av_clip(lrintf(x), SHORT_MIN, SHORT_MAX) if this tricky and
(not very portable) code doesnt work ...

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Those who are too smart to engage in politics are punished by being
governed by those who are dumber. -- Plato 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-soc/attachments/20070602/0bb24768/attachment.pgp>


More information about the FFmpeg-soc mailing list