What filter do I need? Is this artifact halo?

This forum is for questions and discussion of all the aspects of handling and cleaning up your footage with Avisynth.
User avatar
Rice
is a terrible mother
Joined: Sat Nov 21, 2009 3:44 pm
Status: OP
Location: Canada
Contact:
Org Profile

Re: What filter do I need? Is this artifact halo?

Post by Rice » Wed Apr 06, 2011 5:56 pm

LOL damn thats hard to see, are you an individual frame inspector? O: :up:
Image

User avatar
Cannonaire
Joined: Wed May 05, 2010 5:59 pm
Status: OVERLOAD
Location: Oregon
Org Profile

Re: What filter do I need? Is this artifact halo?

Post by Cannonaire » Wed Apr 06, 2011 7:12 pm

nivekov123 wrote:LOL damn thats hard to see, are you an individual frame inspector? O: :up:
It is often difficult or impossible to see the difference, but I say why be close when you can be exact with a single, pre-written line? It's not like it takes any extra effort. On the other hand, think of this highly contrived example: You want to use a circle cookie-cutter effect on a circle part of your footage. If you don't have the correct image geometry, it won't look right. But like I said, this is highly contrived.

In any case, I didn't mean to derail this thread. Aspect ratio and image geometry would be better as its own thread because it applies to everything we do around here.
Image Think millionaire, but with cannons. || Resident Maaya Sakamoto fan.

mikansei
Joined: Mon Mar 21, 2011 2:50 pm
Org Profile

Re: What filter do I need? Is this artifact halo?

Post by mikansei » Wed Apr 20, 2011 7:15 am

Cannonaire wrote:
mikansei wrote:

Code: Select all

Crop(6, 2, -8, -2)
spline36resize(640, 480)
Sorry for another double post, but the cropping and resize lines you have chosen are really odd. The final resolution isn't as important as preservation of detail and image geometry, and by resizing back to 480 vertical pixels you're unnecessarily hurting the detail and raising the final file size of your video. If you are using the AR calc, you can still have correct image geometry assuming you use the correct DAR when you mux, but that kind of ruins the point of using the AR calc to begin with.

If you are using the AR calc and you want to preserve as much detail as possible, it would be best to simply crop and enter the DAR on mux without resizing in avisynth. If you're trying to save space/bitrate by resizing beforehand, it would be best to resize precisely to square pixels and forgo the AR calc and DAR altogether. At least, that is how I see things. Mostly it just seems odd to me to resize back to 480 after cropping 4 pixels.
How do I know if I'm keeping the correct geometry?

Well, I tried using 2 AR calculators and got 2 different results:

So the original DVD source is: NTSC 4:3 720x480

Let's say I want to crop using these values: Crop(8, 6, -10, -0)

If I use http://ps-auxw.de/cgi-bin/ar-calc.pl

So I fill in the fields…

Code: Select all

Source: 720x480 NTSC (Active Picture: 710.86X486)
Source AR : 4:3
1.	Transform : Crop : 702, 474 because I want to Crop(8, 6, -10, -0)
2.     Transform : Scale: 640x480
I have cropped substracting from 720x480 values. Is that correct or when you crop you have to substract from 710.86x486?

And I get these results:

Code: Select all

[b]Numbers[/b]
Source resolution: 720x480
Source AR: Fullscreen
Final resolution: 640x480
Final PAR: 379080/374381 = 1.01255138481921
Final display resolution: 648x480
Final DAR (square pixels): 505440/374381 = 1.35006851309228

[b]Transforms[/b]
   1. Crop: 702, 474
   2. Scale: 640, 480
So looking at final display resolution I should resize to 648x480 but final DAR is 1.35...


If I use AVsPmod:

In the avisynth script there’s Crop(8, 6, -10, -0). So the video resolution as of now is 702x474, which is what gets loaded automatically in the AR calculator:

Input (filled in automatically):
» video resolution: 702x474
» PAR: 8:9
My doubt is: is the PAR the right one or I need to change it to NTSC 4:3 – 10:11?

I click at configure…
Target pixel ratio: I choose 1:1

I go to results…
Results:
» If I keep PAR at 8:9, the final resolution is either 528x400 or the next possible value is 736x560.
» If I change PAR to 10:11 (NTSC 4:3), the final resolution with the closest height to 480 is 624x464. Other options are 560x416 and 688x512. So if we do as AVTech says and I stick to the closest value to 480 I should resize to 624x464.

Now, have I used both calculators correctly? If so, using 624x464 (AVsPmod) would be more accurate because DAR 1.34 is closer to 1.33.
- http://ps-auxw.de/cgi-bin/ar-calc.pl: 648x480 (DAR 1.35)
- AVsPmod: 624x464 (DAR 1.34)

User avatar
mirkosp
The Absolute Mudman
Joined: Mon Apr 24, 2006 6:24 am
Status: (」・ワ・)」(⊃・ワ・)⊃
Location: Gallarate (VA), Italy
Contact:
Org Profile

Re: What filter do I need? Is this artifact halo?

Post by mirkosp » Wed Apr 20, 2011 7:45 am

As a rule of thumb, unless you use some very specific values, cropping changes DAR and SAR, while resizing changes PAR.
Having the exact same DAR of your input isn't really necessary, it isn't important at all, as long as the geometry of your output is correct. You could be overcropping to 16:9 for whatever reason, but with the right math it'd still have the correct geometry, while on the other hand you could crop some random values and resize to 640x480 and have a perfect 4:3 DAR with wrong geometry, so you can easily see how having a 1.33 DAR means really nothing.
Just crop as much as needed and then resize to the proper resolution for your geometry and don't mind the fact that it could not be some common value, because that's not really what matters here.
In other words, I'd say the first solution (Crop(8, 6, -10, -0) and resize to 648x480) is perfectly fine and you shouldn't feel bad about it.
Image

mikansei
Joined: Mon Mar 21, 2011 2:50 pm
Org Profile

Re: What filter do I need? Is this artifact halo?

Post by mikansei » Thu Apr 21, 2011 6:17 am

mirkosp wrote:Just crop as much as needed and then resize to the proper resolution for your geometry and don't mind the fact that it could not be some common value, because that's not really what matters here.
In other words, I'd say the first solution (Crop(8, 6, -10, -0) and resize to 648x480) is perfectly fine and you shouldn't feel bad about it.
Thanks mirkosp. I think I understand everything you explained me about the DAR and PAR. The only doubt I have is how do I know if I have the proper resolution for the geometry, how do I know if the geometry is correct? I mean... AR Calculator is used for calculating the output resolution but... how can I know if I have calculated it properly? Is there any tool that allowes me to know I've got the correct geometry in my output video, or the only tool is looking with my eyes for a rounded object which used to be ovaled in the input video?


As for my post from yesterday, the doubt I had was if the results from the 2 different calculators I used where correct, as the results were quite different one from another. Getting those so different results I wonder if I'm getting the right geometry. Any tips?

User avatar
mirkosp
The Absolute Mudman
Joined: Mon Apr 24, 2006 6:24 am
Status: (」・ワ・)」(⊃・ワ・)⊃
Location: Gallarate (VA), Italy
Contact:
Org Profile

Re: What filter do I need? Is this artifact halo?

Post by mirkosp » Thu Apr 21, 2011 6:42 am

The ar-calc.pl will have perfect geometry provided you correctly state what kind of input you have (NTSC/PAL/HD and Widescreen or Fullscreen). AVSP's calculator OTOH prolly isn't quite as good since it doesn't take into consideration things like active area and so on.
But yes, aside from that, looking for round objects and such is the best way to check if the ar is correct, though with very small ar differences it might hard to notice.
Image

mikansei
Joined: Mon Mar 21, 2011 2:50 pm
Org Profile

Re: What filter do I need? Is this artifact halo?

Post by mikansei » Wed May 25, 2011 5:49 am

@mirkosp:
Thank you :)

I just have one doubt left regarding that:
Let's say I crop width= 20px, height=6px.

At the "crop" box I have to enter the values width and the height values, so do I have to substracting those pixels from 720x480 or from the active area values (710.86x486)? I mean, is it "700, 474" or "690.86, 480" the values I have to enter?

@everyone that helped me:
Thank you for your time and tips helping me!

User avatar
mirkosp
The Absolute Mudman
Joined: Mon Apr 24, 2006 6:24 am
Status: (」・ワ・)」(⊃・ワ・)⊃
Location: Gallarate (VA), Italy
Contact:
Org Profile

Re: What filter do I need? Is this artifact halo?

Post by mirkosp » Wed May 25, 2011 7:34 am

you put the amount you cropped from 720x480 so yes 700,474. :)
Image

mikansei
Joined: Mon Mar 21, 2011 2:50 pm
Org Profile

Re: What filter do I need? Is this artifact halo?

Post by mikansei » Thu May 26, 2011 5:51 am

Thank you, mirkosp! :D

Locked

Return to “AviSynth Help”