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

Rostislav Pehlivanov atomnuker at gmail.com
Wed Mar 2 09:08:49 CET 2016


On 2 March 2016 at 04:04, Ganesh Ajjanagadde <gajjanag at gmail.com> wrote:

> 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.
>
>
I did test it for a few test tracks and the results had the exact same SHA1
as before. Either the differences are only affecting in very extreme cases
or we've cracked SHA1.


More information about the ffmpeg-devel mailing list