Re: refcounting images (was Re: Inline Images??? [ was: Re: Graphic Images ])


Subject: Re: refcounting images (was Re: Inline Images??? [ was: Re: Graphic Images ])
From: Leonard Rosenthol (leonardr@lazerware.com)
Date: Sat Apr 21 2001 - 20:19:45 CDT


At 06:54 PM 4/21/2001 +0200, Paolo Molaro wrote:
>My bet is that doing a memcmp() on the RGBA data is faster than checksumming
>and both will be avoided in most cases just checking width and height.

         Yup, doing checks on things like width, height, etc. first are
definitely a great idea. After that, I'd actually do a comparison of MD5
hashes (done at load time and then cached) since that's more unique than a
simple CRC32 or checksum - and obviously faster than a full memcmp() each time.

>There may be the issue of images that are not always kept in RGB format,
>so maybe it's better to have a checksum of the RGB data after all.

         The only format that we are talking about that does CMYK is JPEG,
and since it has to be converted to RGB for screen display anyway - we
might as well convert on load.

>I don't know, though, if all the decompression algorithms are stable
>(i.e. does a jpeg always decompress to the same RGB data?).
         Assuming you do it using the same CMYK->RGB algorithm, yes.

LDR



This archive was generated by hypermail 2b25 : Sat Apr 21 2001 - 20:28:34 CDT