[futurebasic] Re: Slothness & Rotation -Thrashed

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : January 2001 : Group Archive : Group : All Groups

From: Robert Covington <artlythere@...>
Date: Tue, 9 Jan 2001 04:21:52 -0400
>Robert,
>
>Instead of doing the 63 other things I was supposed to do tonight, I
>converted your new FN CubicInterp# to use integers. It is tested and
>timed. My results put it at least 20% faster than your original. :-) (I
>was hoping for more, but can't escape the conversion from FP to integer
>and back. I figure 20% is significant.) Enjoy.
>
> 0"0
> =J= a  y
>  "

Jay ,

Bummers to your dreams, but I have the beastie down to 5 seconds now from
the original 54. Installing your code upped it back to 10 or more.

I have the Interp FN inline now, and it is dreadfully faster that way.

The problem is that your integer approach adds some multiplies and divides
that aren't there otherwise. (imho)

First at:
x = xx*1024

Then here:
x2 = (x *x)>>10
x3 = (x2*x)>>10

Now the whopper:
result\1024

However changing 1- (2*x2) to 1-x2-x2 saves a multiply, and I will see if
that helps in itself.

I am running on a PPC 603ev, 240 MHZ. May be a differential factor.

Here is my current interpolation "setup" (example)

'~'
// csm1,csm2,csm3,csm4,csn1,csn2,csn3,csn4

'csm1 = FN CubicInterp#(-a-1)  The previous setup, for CubicSum.

'~'
// Inline now

csm1 = 0

cx = -a-1

IF cx < 0 then cx = -cx

cx2 = cx*cx
cx3 = cx2*cx

Long if cx <= 1
csm1 = 1-(2*cx2)+cx3
Xelse
LONG IF cx < = 2
csm1 = 4-(8*cx)+(5*cx2)-cx3
END IF
END IF


and so on, for the remaining 7.

This Bicubic puppy is doing 4 times the work of my bilinear, but is only a
little more than 2 times slower.

I'm proud anyway. Works great. Can do 2 passes of a rotation and not much
image degradation.
:)

Robert