[FFmpeg-devel] [PATCH 1/4] libavcodec: Implementation of AC3 fixed point decoder

Nedeljko Babic Nedeljko.Babic at imgtec.com
Fri Nov 15 15:17:57 CET 2013


>> >> >> >> +static av_always_inline int fixed_sqrt(int x, int bits)
>> >> >> >
>> >> >> >why isnt ff_sqrt() used ?
>> >> >> 
>> >> >> Function fixed_sqrt was created because of the fixed point format that is
>> >> >> needed.
>> >> >
>> >> >can ff_sqrt() used instead or why is it not used ?
>> >> >are there speed or precission advanatges ?
>> >> 
>> >> Values obtained with ff_sqrt() can not be used because of the fixed point format
>> >> that we use in the code.
>> >
>> >i assume the difference is a matter of a single shift ?
>> >is the speed difference of using ff_sqrt() with a shift compared to
>> >a new function significant ?
>> 
>> We need 23 bits from sqrt output (for precision) and ff_sqrt gives only 16 useful bits.
>
>you could << the input integer, to increase the precission available
>on the output

This would still be only 16 useful bits and as I said we need 23 bits.
ff_sqrt calculates sqrt of 32bit integer, so even if we shift the input, we would still get only 16 bits on the output.


-Nedeljko



More information about the ffmpeg-devel mailing list