[FFmpeg-devel] [PATCH] lavc/aacenc_utils: replace sqrtf(Q*sqrtf(Q)) by precomputed value

Ganesh Ajjanagadde gajjanag at gmail.com
Wed Mar 2 05:04:46 CET 2016


On Tue, Mar 1, 2016 at 7:52 AM, Derek Buitenhuis
<derek.buitenhuis at gmail.com> wrote:
> On 3/1/2016 3:21 AM, Ganesh Ajjanagadde wrote:
>
> [...]
>
>> ---
>>  libavcodec/aacenc_utils.h | 3 +--
>>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> Cool. Looks like an obvious/easy win, assuming it's identical.

They are not precisely identical, and in fact the change results in
slightly better accuracy wrt the mathematical expression, simply
because sqrtf(q * sqrtf(q)) is not always a correctly rounded float. I
vaguely recall negligible ~ 2/3 ulp differences. The table is
correctly rounded; I tested that while speeding up the tablegen.

Added a small line to this effect in the notes.

>
> - Derek
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


More information about the ffmpeg-devel mailing list