It was a localization problem.  I was using class variables for all the 
intermediate channel values.  Switching to local variables -- method variables 
-- I see the slight speed up I was expecting.

Example:

r3 = (int)((((p0&0x00FF0000) >> 16)*A0) + (((p1&0x00FF0000) >> 16)*A1) + (((p2&0x00FF0000) 
>> 16)*A2) + (((p3&0x00FF0000) >> 16)*A3));
g3 = (int)((((p0&0x0000FF00) >> 8)*A0) + (((p1&0x0000FF00) >> 8)*A1) + (((p2&0x0000FF00) 
>> 8)*A2) + (((p3&0x0000FF00) >> 8)*A3));
b3 = (int)((((p0&0x000000FF))*A0) + (((p1&0x000000FF))*A1) + (((p2&0x000000FF))*A2) 
+ (((p3&0x000000FF))*A3));

r3 = ((((r3 << 23) >> 31) | r3) & ~(r3>>31))&0xFF;
g3 = ((((g3 << 23) >> 31) | g3) & ~(g3>>31))&0xFF;
b3 = ((((b3 << 23) >> 31) | b3) & ~(b3>>31))&0xFF;

If r3,g3,b3 are class variables, I see the slowdown.  Changing to local 
variables -- stack variables -- I see a slight improvment.

So the triple shift made the interpolation slower (aprox. 1350ms to 1440ms) 
using class variables.

Using local variables I see times like below.  So a few milliseconds are saved. 
It's easy to argue that the time spent engineering is more than the time gained 
at runtime. I wonder if a place like Pixar would agree.

Time = 1302
Waiting...
Time = 1302
Waiting...
Time = 1322
Waiting...
Time = 1292
Waiting...
Time = 1312
Waiting...
Time = 1302
Waiting...
Time = 1352
Waiting...
Time = 1312
Waiting...
Time = 1292
Waiting...
Time = 1302
Waiting...
Time = 1302
Waiting...
Time = 1302
Waiting...
Time = 1422
Waiting...
Time = 1412
Waiting...
Time = 1342
Waiting...
Time = 1292
Waiting...
Time = 1302
Waiting...
Time = 1292
Waiting...


[EMAIL PROTECTED] wrote:
In my test suite, the time to interpolate a 944 x 644 image went from 1350ms 
using the logical test clamp
to 1440ms using the triple shift.  I'm not sure why...  I work on a real slow 
(800mhz) machine just
so I can see these kinds of things better.


Could you post that test? Maybe someone can spot what makes the difference.
[Message sent by forum member 'rah003' (rah003)]

http://forums.java.net/jive/thread.jspa?messageID=231732

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".



===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to