[MPlayer-dev-eng] CRC32 function needed
Nicolas George
nicolas.george at normalesup.org
Sun Jan 30 00:06:48 CET 2011
Le decadi 10 pluviôse, an CCXIX, Ingo Brückl a écrit :
> For improvements of the scrolling function (dynamic labels) I need to check
> whether the string to scroll has changed. In order not to waste memory and
> storing it for comparison, it seems simplest to calculate a CRC32 checksum
> and store this instead.
>
> I've found a CalcCRC32() function in libmpdemux/muxer_mpeg.c but am not sure
> whether this will always be compiled regardless of the user's configuration
> (it seems that this only goes in mencoder).
There seem to be a generic CRC implementation in libavutil. SHA-1 and MD5
are there too: using the first bits of a cryptographic hash is at least as
good as using a CRC.
On the other hand, we are speaking about the GUI of a video player: sparing
a few hundred bytes of strings in memory is nothing compared with what a GUI
toolkit or a codec consumes.
> Further on, this function calculates its table every time it is called. If
> called often, it might be better this table would be precalculated and
> stored.
If this is true, it may be interesting to try and optimize that. Or to
remove the code altogether to use the implementation in libavutil.
> Some time ago I wrote a CRC32 function without table usage that I could use
> instead if CalcCRC32() isn't the one to go with but I don't want to
> needlessly increase MPlayer's size if not necessary either.
I assume almost everyone knows it already, but just to be complete: tables
in CRC32 are means to do 4, 8 or maybe 16 steps at once, thus speeding up
the process a lot.
Regards,
--
Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20110130/86afe63a/attachment.pgp>
More information about the MPlayer-dev-eng
mailing list