Counting unique pixel values is the equivalent of sort | uniq. No hashing, no associative maps are necessary.
A good solution involves picking the most suitable sort algorithm and implementation. One might bucket by one color, then mergesort and count on the 32bit values. Anyway, 30 million items single-threaded — this ought to be ~1 sec job.
In reply to Re: Perl Hashes in C? (just sort)
by Anonymous Monk
in thread Perl Hashes in C?
by BrianP
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |