Re: [PATCH 3/3] winex11: Use TINN algorithm to speed up colour lookups. (try 2)

2007-05-09 Thread [EMAIL PROTECTED]
But I'm open to any ideas you may have as to how we could avoid using floats, yet not run into the overflow situations so easily. We could probably use division somewhere but I don't think that's actually any better performance-wise. It is, when implemented via bit-shifts (very cheap). I know w

Re: [PATCH 3/3] winex11: Use TINN algorithm to speed up colour lookups. (try 2)

2007-05-08 Thread Vitaly Budovski
Dmitry Timoshkov wrote: "Vitaly Budovski" <[EMAIL PROTECTED]> wrote: Both floats and integers have their share of problems. Since the square root operation has been removed, we are dealing with much larger numbers, potentially larger than can fit into unsigned int without looping back around. T

Re: [PATCH 3/3] winex11: Use TINN algorithm to speed up colour lookups. (try 2)

2007-05-07 Thread Dmitry Timoshkov
"Vitaly Budovski" <[EMAIL PROTECTED]> wrote: Both floats and integers have their share of problems. Since the square root operation has been removed, we are dealing with much larger numbers, potentially larger than can fit into unsigned int without looping back around. This is why I think keepin

Re: [PATCH 3/3] winex11: Use TINN algorithm to speed up colour lookups. (try 2)

2007-05-07 Thread Vitaly Budovski
Jesse Allen wrote: On 5/7/07, Duane Clark <[EMAIL PROTECTED]> wrote: Dmitry Timoshkov wrote: > "Vitaly Budovski" <[EMAIL PROTECTED]> wrote: > >>> Now that you got rid of sqrt calls usage of float numbers internally >>> doesn't look justified (to me) anymore. >>> >> Only because in this instance

Re: [PATCH 3/3] winex11: Use TINN algorithm to speed up colour lookups. (try 2)

2007-05-07 Thread Jesse Allen
On 5/7/07, Duane Clark <[EMAIL PROTECTED]> wrote: Dmitry Timoshkov wrote: > "Vitaly Budovski" <[EMAIL PROTECTED]> wrote: > >>> Now that you got rid of sqrt calls usage of float numbers internally >>> doesn't look justified (to me) anymore. >>> >> Only because in this instance it is used with inte

Re: [PATCH 3/3] winex11: Use TINN algorithm to speed up colour lookups. (try 2)

2007-05-07 Thread Duane Clark
Dmitry Timoshkov wrote: "Vitaly Budovski" <[EMAIL PROTECTED]> wrote: Now that you got rid of sqrt calls usage of float numbers internally doesn't look justified (to me) anymore. Only because in this instance it is used with integer data. It doesn't need to be limited to just integer values. B

Re: [PATCH 3/3] winex11: Use TINN algorithm to speed up colour lookups. (try 2)

2007-05-06 Thread Dmitry Timoshkov
"Vitaly Budovski" <[EMAIL PROTECTED]> wrote: As I explained previously, this algorithm makes no assumptions about the data that is being queried. Just because in this case (patch 3) we are working with RGB colour data doesn't mean it is limited to only that. It will work with *any* values, as

Re: [PATCH 3/3] winex11: Use TINN algorithm to speed up colour lookups. (try 2)

2007-05-06 Thread Vitaly Budovski
Dmitry Timoshkov wrote: "Vitaly Budovski" <[EMAIL PROTECTED]> wrote: Now that you got rid of sqrt calls usage of float numbers internally doesn't look justified (to me) anymore. Only because in this instance it is used with integer data. It doesn't need to be limited to just integer values.

Re: [PATCH 3/3] winex11: Use TINN algorithm to speed up colour lookups. (try 2)

2007-05-06 Thread Dmitry Timoshkov
"Vitaly Budovski" <[EMAIL PROTECTED]> wrote: Now that you got rid of sqrt calls usage of float numbers internally doesn't look justified (to me) anymore. Only because in this instance it is used with integer data. It doesn't need to be limited to just integer values. Besides, what would be g

Re: [PATCH 3/3] winex11: Use TINN algorithm to speed up colour lookups. (try 2)

2007-05-06 Thread Dmitry Timoshkov
"Vitaly Budovski" <[EMAIL PROTECTED]> wrote: Make use of the Triangle Inequality Nearest Neighbour algorithm to find the nearest colour more efficiently than a simple linear search. The improvements are most noticeable with a palette of 256 colours. Testing shows approximately 3-4x performance i

Re: [PATCH 3/3] winex11: Use TINN algorithm to speed up colour lookups.

2007-05-05 Thread Jacek Caban
Vitaly Budovski wrote: > Vitaliy Margolen wrote: >> Vitaly Budovski wrote: >> >>> Vitaliy Margolen wrote: >>> Thanks for the tip. Unfortunately in this instance it will not >>> work as I >>> do in fact query more than a < b. See the nearest function in patch 2. >>> >> And what is so spec

Re: [PATCH 3/3] winex11: Use TINN algorithm to speed up colour lookups.

2007-05-04 Thread Vitaly Budovski
Vitaliy Margolen wrote: Vitaly Budovski wrote: Vitaliy Margolen wrote: Thanks for the tip. Unfortunately in this instance it will not work as I do in fact query more than a < b. See the nearest function in patch 2. And what is so special about subtracting one from the other?

Re: [PATCH 3/3] winex11: Use TINN algorithm to speed up colour lookups.

2007-05-04 Thread Vitaliy Margolen
Vitaly Budovski wrote: > Vitaliy Margolen wrote: >> Vitaly Budovski wrote: >> >>> Make use of the Triangle Inequality Nearest Neighbour algorithm to >>> find the >>> nearest colour more efficiently than a simple linear search. The >>> improvements >>> are most noticeable with a palette of 256 col

Re: [PATCH 3/3] winex11: Use TINN algorithm to speed up colour lookups.

2007-05-04 Thread Vitaly Budovski
Vitaliy Margolen wrote: Vitaly Budovski wrote: Make use of the Triangle Inequality Nearest Neighbour algorithm to find the nearest colour more efficiently than a simple linear search. The improvements are most noticeable with a palette of 256 colours. Testing shows approximately 3-4x performa

RE: [PATCH 3/3] winex11: Use TINN algorithm to speed up colour lookups.

2007-05-04 Thread Vitaliy Margolen
Vitaly Budovski wrote: > Make use of the Triangle Inequality Nearest Neighbour algorithm to find the > nearest colour more efficiently than a simple linear search. The improvements > are most noticeable with a palette of 256 colours. Testing shows approximately > 3-4x performance increase for 256 c