[FFmpeg-devel] [PATCH] Faster ff_sqrt()

Reimar Döffinger Reimar.Doeffinger
Sun Jan 13 19:14:04 CET 2008


Hello,
On Sun, Jan 13, 2008 at 10:52:13AM -0700, Loren Merritt wrote:
> On Sun, 13 Jan 2008, Vitor Sessak wrote:
> > I saw in the thread "Copy-on-write pages statistics" that roqaudioenc.c
> > is a big copy-on-write memory usage offender. I think that
> > increasing the memory usage of FFmpeg by 16kb just for a table used in a
> > game format encoder is not a good idea. So I'm sending a new, faster
> > ff_sqrt(), so I can remove the table completely without too much speed loss.

I don't think it is faster for value < 128... And it is "insanely" more
complex. At least I find it really, really ugly, but maybe that's just
me...

> Not that I object to a faster sqrt, but the RoQ table only costs 16kb 
> when RoQ is in use. Otherwise the table is not written to, and thus not 
> copied. No matter how big a table is it wastes at most 1 page, when the 
> table is not page-aligned and values on both sides are written to.

Well, in theory you could imagine a system that does not support
copy-on-write but supports sharing of read-only data. Not that I think
there are any such systems that ffmpeg runs on though... ;-)

Greetings,
Reimar D?ffinger




More information about the ffmpeg-devel mailing list