Re: refcounting images


Subject: Re: refcounting images
From: Paul Rohr (paul@abisource.com)
Date: Wed Apr 25 2001 - 21:31:29 CDT


Cool! Sounds like we have consensus here on how to do the match, no?

Paul

At 09:19 PM 4/21/01 -0400, Leonard Rosenthol wrote:
>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 : Wed Apr 25 2001 - 21:23:53 CDT