[FFmpeg-devel] [PATCH 1/4] libavcodec: Implementation of AC3 fixed point decoder
Michael Niedermayer
michaelni at gmx.at
Fri Nov 15 16:20:20 CET 2013
On Fri, Nov 15, 2013 at 02:17:57PM +0000, Nedeljko Babic wrote:
> >> >> >> >> +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.
hmm
i thought we had a sqrt somewhere that had a few fractional bits on
its output but seems we dont or iam failing to find it.
so no objections to adding such a sqrt function
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
The educated differ from the uneducated as much as the living from the
dead. -- Aristotle
-------------- 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/20131115/6ef18e5b/attachment.asc>
More information about the ffmpeg-devel
mailing list