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

Vitor Sessak vitor1001
Sun Jan 13 17:50:52 CET 2008


Hi,

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.

Unfortunately, even with the new ff_sqrt, the encoder is not as fast as 
before :
(for a 3 min wav file input)

Before:
0m0.340s

After:
0m0.556s

But it's the audio encoder of a VQ codec and it takes forever to encode 
the video. So I don't think a few ms more to encode the audio can make 
any difference...

The code for ff_sqrt() was taken from public domain code at 
http://atoms.alife.co.uk/sqrt/ (Warning: original in java).

-Vitor

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ff_sqrt.diff
Type: text/x-patch
Size: 4860 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080113/bb9bc5d3/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: roqaudio.diff
Type: text/x-patch
Size: 1110 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080113/bb9bc5d3/attachment-0001.bin>



More information about the ffmpeg-devel mailing list