Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 3rd August 2008, 15:07   #1  |  Link
vcmohan
Registered User
 
Join Date: Jul 2003
Location: India
Posts: 890
Spinner Plugin

Spinner: This plugin rotates a frame or selected part of it through any desired angle. The rotation axis coordinates and angle of rotation can be in floating point. Option for varying parameters linearly along clip and specify a rectangular area to undergo rotation is available. Precision may be nearest neighbour, bilinear or bicubic interpolation. If a thin rectangle outside axis of rotation is specified , it appears as cartwheeling.

I read sometime back that the test for good rotation technique is to rotate image several times (say 60 degrees each time for 6 times) and compare with original by subtract. I got surprising results. Nearest neighbour option resulted in random noise as output. Bilinear has in the difference strong elements of the image. Bicubic has the strongest image elements.
Possibly this is to be expected, but still gives the impression that bicubic is the worst of the lot.
Either my understanding is not correct or my implementation is defective?
__________________
mohan
my plugins are now hosted here

Last edited by vcmohan; 4th August 2008 at 11:05. Reason: Changed plugin name at the suggestion of Fizick
vcmohan is offline   Reply With Quote
Old 3rd August 2008, 16:32   #2  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Putting the case for the defence, ...

you could interpret the results another way - nearest neighbour adds random noise to the 'correct' result, while the others are more highly correlated with the original, with bicubic best of all!

I'm just speculating, I don't know what you should expect theoretically. The real test of course is - which of the three looks more like the original?
Gavino is offline   Reply With Quote
Old 3rd August 2008, 19:49   #3  |  Link
Fizick
AviSynth plugger
 
Fizick's Avatar
 
Join Date: Nov 2003
Location: Russia
Posts: 2,183
vcmohan,
Please rename your plugin. I have Rotate plugin too. It is confused.
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick
I usually do not provide a technical support in private messages.
Fizick is offline   Reply With Quote
Old 3rd August 2008, 22:28   #4  |  Link
tin3tin
Registered User
 
tin3tin's Avatar
 
Join Date: Mar 2005
Posts: 366
Just thinking out loud... how about using OpenGL for something like this(and other things)?.

Anyway it sure would be great with an OpenGl Plugin.
__________________
DVD slideshow GUI(Freeware).
tin3tin is offline   Reply With Quote
Old 4th August 2008, 11:08   #5  |  Link
vcmohan
Registered User
 
Join Date: Jul 2003
Location: India
Posts: 890
Quote:
Originally Posted by Fizick View Post
vcmohan,
Please rename your plugin. I have Rotate plugin too. It is confused.
Sorry for that. I changed the name to Spinner even though I did not like the name much.
__________________
mohan
my plugins are now hosted here
vcmohan is offline   Reply With Quote
Old 4th August 2008, 11:11   #6  |  Link
45tripp
Dolphin Blue
 
45tripp's Avatar
 
Join Date: Mar 2007
Posts: 336
what's wrong with 'Rotator', in that case?
__________________
injected with feelings; with no final fading
45tripp is offline   Reply With Quote
Old 4th August 2008, 16:28   #7  |  Link
Fizick
AviSynth plugger
 
Fizick's Avatar
 
Join Date: Nov 2003
Location: Russia
Posts: 2,183
Thanks!
I will look to it. I tryed set some compatibility.
Can anybody make a speed test of various rotation plugins?
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick
I usually do not provide a technical support in private messages.
Fizick is offline   Reply With Quote
Old 4th August 2008, 19:15   #8  |  Link
mikeytown2
Resize Abuser
 
mikeytown2's Avatar
 
Join Date: Apr 2005
Location: Seattle, WA
Posts: 623
Speed/Quality Test Code

Code:
a = ColorBars(1024,768).Trim(0,99)

Animate(0, a.framecount()-1,        "Angle", a, float(-500), 0, a, float(510), 0)
last + Animate(0, a.framecount()-1, "Angle", a,  float(510), 0, a, float(520), 0)

last + Animate(0, a.framecount()-1, "Angle", a, float(-500), 1, a, float(510), 1)
last + Animate(0, a.framecount()-1, "Angle", a,  float(510), 1, a, float(520), 1)

last + Animate(0, a.framecount()-1, "Angle", a, float(-500), 2, a, float(510), 2)
last + Animate(0, a.framecount()-1, "Angle", a,  float(510), 2, a, float(520), 2)

last + Animate(0, a.framecount()-1, "Angle", a, float(-500), 3, a, float(510), 3)
last + Animate(0, a.framecount()-1, "Angle", a,  float(510), 3, a, float(520), 3)

last + Animate(0, a.framecount()-1, "Angle", a, float(-500), 4, a, float(510), 4)
last + Animate(0, a.framecount()-1, "Angle", a,  float(510), 4, a, float(520), 4)

last + Animate(0, a.framecount()-1, "Angle", a, float(-500), 5, a, float(510), 5)
last + Animate(0, a.framecount()-1, "Angle", a,  float(510), 5, a, float(520), 5)

last + Animate(0, a.framecount()-1, "Angle", a, float(-500), 6, a, float(510), 6)
last + Animate(0, a.framecount()-1, "Angle", a,  float(510), 6, a, float(520), 6)

last + Animate(0, a.framecount()-1, "Angle", a, float(-500), 7, a, float(510), 7)
last + Animate(0, a.framecount()-1, "Angle", a,  float(510), 7, a, float(520), 7)

Function Angle(clip c, float a, int mode)
{
	b = (Round(abs(a)*1000)%360000)/1000.0
	d = a < 0 ? 1-(b/360.0) : b/360.0
	b = a < 0 ? -b : b
	c
	
	mode == 0 ? Subtitle("Orginal (no rotation) " + String(a),align=5) :
	\ mode == 1 ? Zoom(angle=string(a)).Subtitle("Zoom " + String(a),align=5) :
	\ mode == 2 ? Freeframe("C:\Program Files\AviSynth 2.5\plugins\PetePanSpinZoom.dll",false,0.5,0.5,d,0.2).Subtitle("PetePanSpinZoom " + String(d),align=5) : 
	\ mode == 3 ? EffectRotation(id=-a, cc=$000000).Subtitle("EffectRotation " + String(-a),align=5) :
	\ mode == 4 ? Rotate(a).Subtitle("Rotate " + String(a),align=5) :
	\ mode == 5 ? Spinner(angle=a,check=false,bg=false,q=2).Subtitle("Spinner Q=2 " + String(a),align=5) :
	\ mode == 6 ? Spinner(angle=a,check=false,bg=false,q=1).Subtitle("Spinner Q=1 " + String(a),align=5) :
	\  Spinner(angle=a,check=false,bg=false,q=0).Subtitle("Spinner Q=0 " + String(a),align=5)
}
Zoom()
Freeframe() w/ PetePanSpinZoom
EffectRotation()
Rotate()
Spinner()

Speed
None: 28fps
FreeFrame: 16fps
Rotate: 13fps
Spinner Q=0: 12fps
Zoom: 7fps
Spinner Q=1: 6fps
EffectRotation: 5fps
Spinner Q=2: 4fps

Rotate has the best picture quality hands down.
Everything else is ok

Last edited by mikeytown2; 6th August 2008 at 03:43. Reason: Fix my DUMB code for EfectRotation
mikeytown2 is offline   Reply With Quote
Old 5th August 2008, 01:12   #9  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Quote:
Originally Posted by mikeytown2 View Post
Code:
Function Angle(clip c, float a, int mode) {
	b = (Round(abs(a)*1000)%360000)/1000.0
	d = a < 0 ? 1-(b/360.0) : b/360.0
	b = a < 0 ? -b : b
	c
	mode == 1 ? Zoom(angle="spline(n, " + String(0) + "," + String(a) + ", " + String(1) + "," + String(a) + ", false)").Subtitle("Zoom " + String(a),align=5) :
Nice idea. A few comments:
- What is the purpose of the second assignment to b? Its value doesn't seem to be used (only a and d are).
- it's a bit unfair on Zoom to call it this way; since the angle is fixed for each invocation, you should just use:
Code:
Zoom(angle=string(a))
This should speed it up a bit, although I suspect most of its time goes in pixel manipulation anyway, and not in evaluating the expression string.
- The figures may be misleading wrt the relative speeds because there is a constant overhead of Animate + function call and Subtitle. How about adding a mode 0 which is just
Code:
Subtitle("Original", align=5)
in order to provide the base point.

Last edited by Gavino; 5th August 2008 at 01:15.
Gavino is offline   Reply With Quote
Old 5th August 2008, 01:32   #10  |  Link
mikeytown2
Resize Abuser
 
mikeytown2's Avatar
 
Join Date: Apr 2005
Location: Seattle, WA
Posts: 623
b was for the original EffectRotation() because it only took ints as input.

Re-ran Zoom, no speed difference.

This code came from KBE()
mikeytown2 is offline   Reply With Quote
Old 5th August 2008, 08:01   #11  |  Link
vcmohan
Registered User
 
Join Date: Jul 2003
Location: India
Posts: 890
Quote:
Originally Posted by tin3tin View Post
Just thinking out loud... how about using OpenGL for something like this(and other things)?.

Anyway it sure would be great with an OpenGl Plugin.
I am absolutely unfamiliar with using explicitly OpenGl. Once I tried to aquaint myself with DirectX but after noting that the documentation/ guide etc for its SDK runs to 475MB gave up.

Regarding speed test by miketown2 , I am not surprised as I have no mmx optimization or any assembler code. I will be shortly adding a couple of options for quality and possibly speed enhancements. Also animate may not be used with Spinner or effectRotation as there are animations within them and are much faster.
__________________
mohan
my plugins are now hosted here
vcmohan is offline   Reply With Quote
Old 5th August 2008, 09:05   #12  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Quote:
Originally Posted by vcmohan View Post
Also animate may not be used with Spinner or effectRotation as there are animations within them and are much faster.
Zoom also has internal animation using the expression string, but I haven't noticed it being faster than 'Animate'ing a fixed value (though I haven't done any formal comparisons). The expression string is obviously more convenient when you want non-linear variation.
Gavino is offline   Reply With Quote
Old 6th August 2008, 02:52   #13  |  Link
vcmohan
Registered User
 
Join Date: Jul 2003
Location: India
Posts: 890
Originally Posted by mikeytown2
Quote:
Spinner Q=2 picture quality could be improved
On checking my code I found a silly mistake in q = 2 code. It is corrected now in dll (not the source code yet as I am working on it for both q and speed improvements)

For some reason mickeytown2 post does not have the 'quote' button.
__________________
mohan
my plugins are now hosted here
vcmohan is offline   Reply With Quote
Old 6th August 2008, 03:48   #14  |  Link
mikeytown2
Resize Abuser
 
mikeytown2's Avatar
 
Join Date: Apr 2005
Location: Seattle, WA
Posts: 623
My orginal post had round() in the code for EffectRotation. It's now fixed, sorry about that vcmohan! Q=2 works correctly as well!

Round 2 - "Built in" code.

Code:
a = ColorBars(1024,768).Trim(0,99)
x=-500.0
y=510.0
z=520.0

Animate(0, a.framecount()-1,        "Angle", a, float(x), 0, a, float(y), 0)
last + Animate(0, a.framecount()-1, "Angle", a,  float(y), 0, a, float(z), 0)

last + a.Zoom(angle="spline(n, " + String(0) + "," + String(x) + ", " + String(a.framecount()-1) + "," + String(y) + ", false)", show=true).Subtitle("Zoom " + String(x) + " to " + String(y),align=5)
last + a.Zoom(angle="spline(n, " + String(0) + "," + String(y) + ", " + String(a.framecount()-1) + "," + String(z) + ", false)", show=true).Subtitle("Zoom " + String(y) + " to " + String(z),align=5)

last + Animate(0, a.framecount()-1, "Angle", a, float(x), 2, a, float(y), 2)
last + Animate(0, a.framecount()-1, "Angle", a,  float(y), 2, a, float(z), 2)

last + a.EffectRotation(id=-x, cc=$000000, fd=-y).Subtitle("EffectRotation " + String(x) + " to " + String(y),align=5)
last + a.EffectRotation(id=-y, cc=$000000, fd=-z).Subtitle("EffectRotation " + String(y) + " to " + String(z),align=5)

last + a.Rotate(angle=x,start=0,end=a.framecount()-1,endangle=y).Subtitle("Rotate " + String(x) + " to " + String(y),align=5)
last + a.Rotate(angle=y,start=0,end=a.framecount()-1,endangle=z).Subtitle("Rotate " + String(y) + " to " + String(z),align=5)

last + a.Spinner(angle=x,eangle=y,check=false,bg=false,q=2).Subtitle("Spinner Q=2 " + String(x) + " to " + String(y),align=5)
last + a.Spinner(angle=y,eangle=z,check=false,bg=false,q=2).Subtitle("Spinner Q=2 " + String(y) + " to " + String(z),align=5)

last + a.Spinner(angle=x,eangle=y,check=false,bg=false,q=1).Subtitle("Spinner Q=1 " + String(x) + " to " + String(y),align=5)
last + a.Spinner(angle=y,eangle=z,check=false,bg=false,q=1).Subtitle("Spinner Q=1 " + String(y) + " to " + String(z),align=5)

last + a.Spinner(angle=x,eangle=y,check=false,bg=false,q=0).Subtitle("Spinner Q=0 " + String(x) + " to " + String(y),align=5)
last + a.Spinner(angle=y,eangle=z,check=false,bg=false,q=0).Subtitle("Spinner Q=0 " + String(y) + " to " + String(z),align=5)

Function Angle(clip c, float a, int mode)
{
	b = (Round(abs(a)*1000)%360000)/1000.0
	d = a < 0 ? 1-(b/360.0) : b/360.0
	b = a < 0 ? -b : b
	c
	
	mode == 0 ? Subtitle("Orginal (no rotation) " + String(a),align=5) :
	\ mode == 1 ? Zoom(angle=string(a)).Subtitle("Zoom " + String(a),align=5) :
	\ mode == 2 ? Freeframe("C:\Program Files\AviSynth 2.5\plugins\PetePanSpinZoom.dll",false,0.5,0.5,d,0.2).Subtitle("PetePanSpinZoom " + String(d),align=5) : 
	\ mode == 3 ? EffectRotation(id=-a, cc=$000000).Subtitle("EffectRotation " + String(-a),align=5) :
	\ mode == 4 ? Rotate(a).Subtitle("Rotate " + String(a),align=5) :
	\ mode == 5 ? Spinner(angle=a,check=false,bg=false,q=2).Subtitle("Spinner Q=2 " + String(a),align=5) :
	\ mode == 6 ? Spinner(angle=a,check=false,bg=false,q=1).Subtitle("Spinner Q=1 " + String(a),align=5) :
	\  Spinner(angle=a,check=false,bg=false,q=0).Subtitle("Spinner Q=0 " + String(a),align=5)
}
Rotate's built in rotation function seems to not exist.
Everything else works great!

Speed
None: 28fps
Rotate: 17fps - Disqualified though...
Spinner Q=0: 17fps
FreeFrame: 16fps
Zoom: 8fps
Spinner Q=1: 6fps
EffectRotation: 6fps
Spinner Q=2: 2fps

Last edited by mikeytown2; 6th August 2008 at 04:00.
mikeytown2 is offline   Reply With Quote
Old 6th August 2008, 11:16   #15  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Quote:
Originally Posted by mikeytown2 View Post
Code:
Zoom(angle="spline(n, " + String(0) + "," + String(x) + ", " + \
  String(a.framecount()-1) + "," + String(y) + ", false)", show=true)
# ... [reformatted to fit]
Note that if x, y and a are script-level variables (as they are here), you can simply write
Code:
Zoom(angle="spline(n, 0, x, a.framecount()-1, y, false)", show=true)
I doubt if it will be any faster, but it's certainly easier to read.
The use of show=true could affect the speed though.

Last edited by Gavino; 6th August 2008 at 11:22. Reason: formatting
Gavino is offline   Reply With Quote
Old 10th August 2008, 13:02   #16  |  Link
vcmohan
Registered User
 
Join Date: Jul 2003
Location: India
Posts: 890
I have modified the code extensively. Now Spinner accepts YUY2 format also. A new parameter p is added with which one can specify the location accuracy. (1/4 pixel to 1/5000) pixel. For quality Lagrange and Lanczos interpolation are now available. Both have 4 and 6 point options.

I got hold of Rotate plugin from warpenterprises site. Oct 2007 dated. I did some comparison of quality. The script used is :
Code:
im1 = imagereader("E:\images\canyon.jpg", end = 361).converttoRGB32()
im1 = reduceby2(im1)
a = 2                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
b= 60
c= 120
d= 400
e = 1000

s0 = Spinner(im1,q = a, angle = b, eangle = c, check = false, p =d, bg = false, color = 0)
s1 = Spinner(s0,q = a, angle = b, eangle = c, check = false, p =d, bg = false, color = 0)
s2 = Spinner(s1,q = a, angle = b, eangle = c, check = false, p =d, bg = false, color = 0)
s3 = Spinner(s2,q = a, angle = b, eangle = c, check = false, p =d, bg = false, color = 0)
s4 = Spinner(s3,q = a, angle = b, eangle = c, check = false, p =d, bg = false, color = 0)
s5 = Spinner(s4,q = a, angle = b, eangle = c, check = false, p =d, bg = false, color = 0)

rt0= Rotate(im1,angle = b)
rt1= Rotate(rt0,angle = b)
rt2= Rotate(rt1,angle = b)
rt3= Rotate(rt2,angle = b)
rt4= Rotate(rt3,angle = b)
rt5= Rotate(rt4,angle = b)

sb1=Subtract(s5,im1).Levels(127,1,129,0,255)

sb2=Subtract(rt5,im1).Levels(127,1,129,0,255)
sh1 = stackhorizontal(s5,sb1)
sh2 = stackhorizontal(rt5,sb2)

stackvertical(sh1,sh2)
The above code rotates image by 60 degrees 6 times to get back initial image.

The result is as below. On top row left is Spinner output with Lagrange 4 point interpolation, on its right is subtract from original. Bottom row is corresponding Rotate output.



Even for lowest quality q = 0, IMO Spinner appears far superior.

I request mikeytown2 to do a speed test again. As there are initial overheads for the first frame, animate may not give correct speed measurement. Probably over 1000 or more frames in a run to be measured. Lanczos 6 pt (q = 5) should give better results.
__________________
mohan
my plugins are now hosted here
vcmohan is offline   Reply With Quote
Old 10th August 2008, 22:37   #17  |  Link
mikeytown2
Resize Abuser
 
mikeytown2's Avatar
 
Join Date: Apr 2005
Location: Seattle, WA
Posts: 623
Here is a quality test code block. Thanks vcmohan for inspiring this.

Code:
ImageReader("wikipediamiamisunset200ke5.jpg")
ColorBars()
lr=130
tb=210
im1=last.ConvertToRGB32().BicubicResize(640,480).AddBorders(lr,tb,lr,tb).Trim(0,-1)


a= 2
b= 60
c= 60
d= 5000

lr=lr
tb=tb


Spinner(im1,q = a, angle = b, eangle = c, check = false, p =d, bg = false, color = 0)
Spinner(q = a, angle = b, eangle = c, check = false, p =d, bg = false, color = 0)
Spinner(q = a, angle = b, eangle = c, check = false, p =d, bg = false, color = 0)
Spinner(q = a, angle = b, eangle = c, check = false, p =d, bg = false, color = 0)
Spinner(q = a, angle = b, eangle = c, check = false, p =d, bg = false, color = 0)
s5 = Spinner(q = a, angle = b, eangle = c, check = false, p =d, bg = false, color = 0).Crop(lr,tb,-lr,-tb)

Rotate(im1,angle = b)
Rotate(angle = b)
Rotate(angle = b)
Rotate(angle = b)
Rotate(angle = b)
rt5= Rotate(angle = b).Crop(lr,tb,-lr,-tb)



Function StackComparer(clip x, clip y, string s)
{
	sb1=Subtract(x,y)
	sb1=Overlay(sb1.Levels(128,1,130,0,255), 
	\ sb1.Levels(126,1,128,0,255).PointResize(640*4,480*4).ConvertToYUY2().Invert("y").ConvertToRGB32().PointResize(640,480)
	\ ,mode="add").Levels(23,1,255,0,255).Subtitle("Black pixels means less/no change")
	s5=Compare(x,y).Subtitle(String(s), Align=4)
	stackhorizontal(s5,BlankClip(1,1,480,color=$FFFFFF),BlankClip(1,1,480,color=$000000),BlankClip(1,1,480,color=$FFFFFF),sb1)
}

sh1=StackComparer(s5,im1.Crop(lr,tb,-lr,-tb),"Spinner Q=" + String(a) + " P=" + String(d))
sh2=StackComparer(rt5,im1.Crop(lr,tb,-lr,-tb),"Rotate")
sh3=StackComparer(im1.Crop(lr,tb,-lr,-tb),im1.Crop(lr,tb,-lr,-tb),"Orginal")


stackvertical(sh1,BlankClip(1,1283,1,color=$FFFFFF),BlankClip(1,1283,1,color=$000000),BlankClip(1,1283,1,color=$FFFFFF),sh2
\ ,BlankClip(1,1283,1,color=$FFFFFF),BlankClip(1,1283,1,color=$000000),BlankClip(1,1283,1,color=$FFFFFF),sh3)
Output





image from wikipedia



In my previous comparisons I was looking at the aliasing, it appears that Rotate() has built in AA, which is why I preferred it in my previous post. When using Rotate() multiple times AA hurts the final output. So in terms of Quality (PSNR) Spinner wins, but there are some issues. It doesn't handle solid colors correctly as you can see with the ColorBars() test when P is set above 16. Also if it had an Edge AA option that would be nice feature.


Here is a speed test between Rotate and Spinner
Code:
a = ColorBars(1024,768).Trim(0,999)
x=-500.0*20
y=510.0
z=520.0

a.trim(0,-1)

Animate(0, a.framecount()-1,        "Angle", a, float(x), 0, a, float(y), 0)
last + Animate(0, a.framecount()-1, "Angle", a,  float(y), 0, a, float(z), 0)

last + Animate(0, a.framecount()-1, "Angle", a, float(x), 4, a, float(y), 4)
last + Animate(0, a.framecount()-1, "Angle", a,  float(y), 4, a, float(z), 4)

last + a.Spinner(angle=x,eangle=y,check=false,bg=false,q=2,p=5000).Subtitle("Spinner Q=2 P=5000 " + String(x) + " to " + String(y),align=5)
last + a.Spinner(angle=y,eangle=z,check=false,bg=false,q=2,p=5000).Subtitle("Spinner Q=2 P=5000 " + String(y) + " to " + String(z),align=5)

last + a.Spinner(angle=x,eangle=y,check=false,bg=false,q=2,p=4).Subtitle("Spinner Q=2 P=4 " + String(x) + " to " + String(y),align=5)
last + a.Spinner(angle=y,eangle=z,check=false,bg=false,q=2,p=4).Subtitle("Spinner Q=2 P=4 " + String(y) + " to " + String(z),align=5)

last + a.Spinner(angle=x,eangle=y,check=false,bg=false,q=1,p=5000).Subtitle("Spinner Q=1 P=5000 " + String(x) + " to " + String(y),align=5)
last + a.Spinner(angle=y,eangle=z,check=false,bg=false,q=1,p=5000).Subtitle("Spinner Q=1 P=5000 " + String(y) + " to " + String(z),align=5)

last + a.Spinner(angle=x,eangle=y,check=false,bg=false,q=1,p=4).Subtitle("Spinner Q=1 P=4 " + String(x) + " to " + String(y),align=5)
last + a.Spinner(angle=y,eangle=z,check=false,bg=false,q=1,p=4).Subtitle("Spinner Q=1 P=4 " + String(y) + " to " + String(z),align=5)

last + a.Spinner(angle=x,eangle=y,check=false,bg=false,q=0,p=5000).Subtitle("Spinner Q=0 P=5000 " + String(x) + " to " + String(y),align=5)
last + a.Spinner(angle=y,eangle=z,check=false,bg=false,q=0,p=5000).Subtitle("Spinner Q=0 P=5000 " + String(y) + " to " + String(z),align=5)

last + a.Spinner(angle=x,eangle=y,check=false,bg=false,q=0,p=4).Subtitle("Spinner Q=0 P=4 " + String(x) + " to " + String(y),align=5)
last + a.Spinner(angle=y,eangle=z,check=false,bg=false,q=0,p=4).Subtitle("Spinner Q=0 P=4 " + String(y) + " to " + String(z),align=5)

Function Angle(clip c, float a, int mode)
{
	b = (Round(abs(a)*1000)%360000)/1000.0
	d = a < 0 ? 1-(b/360.0) : b/360.0
	b = a < 0 ? -b : b
	c
	
	mode == 0 ? Subtitle("Orginal (no rotation) " + String(a),align=5) :
	\ mode == 1 ? Zoom(angle=string(a)).Subtitle("Zoom " + String(a),align=5) :
	\ mode == 2 ? Freeframe("C:\Program Files\AviSynth 2.5\plugins\PetePanSpinZoom.dll",false,0.5,0.5,d,0.2).Subtitle("PetePanSpinZoom " + String(d),align=5) : 
	\ mode == 3 ? EffectRotation(id=-a, cc=$000000).Subtitle("EffectRotation " + String(-a),align=5) :
	\ mode == 4 ? Rotate(a).Subtitle("Rotate " + String(a),align=5) :
	\ mode == 5 ? Spinner(angle=a,check=false,bg=false,q=2).Subtitle("Spinner Q=2 " + String(a),align=5) :
	\ mode == 6 ? Spinner(angle=a,check=false,bg=false,q=1).Subtitle("Spinner Q=1 " + String(a),align=5) :
	\  Spinner(angle=a,check=false,bg=false,q=0).Subtitle("Spinner Q=0 " + String(a),align=5)
}
Method: Only use one line at a time, load in Vdub, Click input playback, go view -> show status window, un-check show input video, watch FPS.

Results:
None: 28.0fps

Rotate:
13.65 - Big Angle
13.00 - Small Angle

Spinner:
5.35 - BA,q=2,p=5k
5.30 - SA,q=2,p=5k
5.45 - BA,q=2,p=4
5.40 - SA,q=2,p=4

9.80 - BA,q=1,p=5k
9.85 - SA,q=1,p=5k
10.0 - BA,q=1,p=4
9.95 - SA,q=1,p=4

15.20 - BA,q=0,p=5k
15.35 - SA,q=0,p=5k
16.16 - BA,q=0,p=4
16.30 - SA,q=0,p=4
mikeytown2 is offline   Reply With Quote
Old 11th August 2008, 13:13   #18  |  Link
vcmohan
Registered User
 
Join Date: Jul 2003
Location: India
Posts: 890
Thanks for the effort. On seeing the color bars comparison I could locate the source for this error. I now corrected it. The quality should improve further.

As for speed. I just tried the
colorbars()
and got on my system very near 30fps. When I added the lines
Code:
cb = ColorBars().Trim(0,9999)
a=2                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
b= 60
c= 420
d= 400
e = 1000
s0 = Spinner(cb,q = 1,x = -100, ex = 600, angle = b, eangle = c, check = false, p =d, bg = false, color = 0)
return(s0)
Strangely I got fps varying from 40 to 32.

Something is not right. Using vdub rendering fps may not correctly indicate speed. I recollect some plugin timer or some such named. Possibly it does a better estimate.
__________________
mohan
my plugins are now hosted here
vcmohan is offline   Reply With Quote
Old 11th August 2008, 19:37   #19  |  Link
mikeytown2
Resize Abuser
 
mikeytown2's Avatar
 
Join Date: Apr 2005
Location: Seattle, WA
Posts: 623
Using Spinner.dll with timestamp of August 11, 2008, 5:12:00 PM, with my above code slightly modified here is output with p=16 and p=17




I'll look into other FPS measurement methods. Just a heads up, I used ColorBars(1024,768) with the speed test.
mikeytown2 is offline   Reply With Quote
Old 12th August 2008, 03:30   #20  |  Link
vcmohan
Registered User
 
Join Date: Jul 2003
Location: India
Posts: 890
Thanks for the test. The parameter p has very insignificant effect on the speed of processing. It was only provided for sake of 'effects' if some one needs. As such one may not use lower values if one needs quality. It however calls for higher requirement of memory. For example at p = 5000 and q = 3 or 5 , it requires an additional 240kb( present day standards negligible) while at p=16, q = 1 it just needs 128 bytes extra.

Therefore pl test for quality with p as high as possible. Similarly q =3 or 5 gives higher quality. Ofcourse they are the slowest. One needs to make conscious compromises.

I have checked with q = 1, in the manner I did earlier and compared with Rotation plugin. In this mode it is bilinear interpolation, which is also used by Rotation and so spinner should give comparable quality to that of Rotation. Even here Spinner output looks better than that of Rotation. May be Fizick can comment on this.
__________________
mohan
my plugins are now hosted here
vcmohan is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 23:18.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.