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

Baptiste Coudurier baptiste.coudurier at smartjog.com
Sat Jun 2 23:16:09 CEST 2007


Hi

Michael Niedermayer wrote:
> 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

ok, I was fearing something like that, at least it outputs somewhat 
correct sound.

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

Well, this does not work unfortunately, I think some biais is needed 
somewhere.

-- 
Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
SMARTJOG S.A.                                    http://www.smartjog.com
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
Phone: +33 1 49966312



More information about the FFmpeg-soc mailing list