Improve XOR table computation.

Set the initial state to XOR[i]=i, so that on very low color images, the algorithm will try 
to swap around the first colors.


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@2049 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Adrien Destugues
2013-02-02 08:38:08 +00:00
parent 878c926ce4
commit 1dce247656
2 changed files with 1 additions and 12 deletions

View File

@@ -2972,22 +2972,12 @@ static void compute_xor_table()
// Initialize the table with some "random" values
for(i = 0; i < 256; i++)
{
xor_lut[i] = 255 - i;
xor_lut[i] = i;
}
do {
// Find the smallest difference in the table
//int mindiff = INT_MAX;
int idx;
/*
for(i = 0; i < 256; i++)
{
int diff = Diff(i, xor_lut[i]);
if (diff < mindiff) {
idx = i;
mindiff = diff;
}
}*/
// Try to pair these two colors better
found = 0;