[FFmpeg-devel] [PATCH] Move the filters table in postprocess.c to .rodata

Diego 'Flameeyes' Pettenò flameeyes
Sat Jan 5 13:49:55 CET 2008


The attached patch makes the filters table in postprocess.c entirely
constant, using characters array rather than string pointers. Again, the
size _might_ be bigger as the longname is sometimes bigger than the
string used to fill it, but as none of the longnames seems to be shorter
than 8, if it's bigger (and again I didn't do the math), it's only on
32-bit. For what concerns shortname, it's certainly using less memory as
the size used is 4 (which is the size of a pointer in 32-bit). Even if
it used a bit more memory, it now is moved to .rodata so it should be an
improvement over before.

[Note: I use 4 and 16 to pad the maximum size to the nearest power of
two, to let the compiler optimise access with a left shift.]

-------------- next part --------------
A non-text attachment was scrubbed...
Name: libpostproc-rodata-filters.patch
Type: text/x-patch
Size: 2377 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080105/7d6b0012/attachment.bin>
-------------- next part --------------

-- 
Diego "Flameeyes" Petten?
http://farragut.flameeyes.is-a-geek.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080105/7d6b0012/attachment.pgp>



More information about the ffmpeg-devel mailing list