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 15th September 2009, 12:13   #1  |  Link
carlmart
Carlos Martinez
 
Join Date: Aug 2005
Posts: 288
Learning to use LSFmod

I am trying to learn to better use the LSFmod filter capabilities.

Until now I had been mostly using its smode parameter. But on some restoration cases it has proven too much using just that parameter. I believe it might be useful to use the other parameters. But for that I need to know what they are or do.

The filter is is here:

http://avisynth.org/mediawiki/LSFmod

Even if maybe my questions may sound rather basic for many, here they go.

1) When there's no parameter listed to fill in, like on "strength [int]", what do I put inside?

2) Smethod (sharpen method): what does Kernel mean or what the parameter Min/Max controls?

3) Skernel: what does this parameter modify?

4) Lmode: how does limit affect sharpening in over or undershoot? It softens the borders?

5) The parameters "overshoot" or "undershoot" should go before or after Lmode?

6) Soothe: what is temporal stabilization?

I have other questions, but let's start with those so I can begin testing with reasonable parameters and not all over the place.

Last edited by carlmart; 15th September 2009 at 15:41.
carlmart is offline   Reply With Quote
Old 16th September 2009, 11:27   #2  |  Link
LaTo
LaTo INV.
 
LaTo's Avatar
 
Join Date: Jun 2007
Location: France
Posts: 701
1. Just put nothing

2. Kernel and Min/Max are 2 way to sharpen

3. Don't touch this unless you know what you are doing

4. It avoid some artifact to appear when sharpening (example: halo)

5. Like you want, it is the same

6. It help to have a more stable picture

Last edited by LaTo; 16th September 2009 at 11:29.
LaTo is offline   Reply With Quote
Old 16th September 2009, 12:06   #3  |  Link
carlmart
Carlos Martinez
 
Join Date: Aug 2005
Posts: 288
First of all thanks for the filter. It seems to work quite well, and I hope to learn to manage it.

I have just used it to correct things on a DVD that I have that was originally released in letterbox 4:3. The film is "The bride wore black", by François Truffaut, and apparently there's no other release but this.

When I view it on my 42" plasma, there are black bars on all sides. If I zoom it with the TV, I lose the subtitles. If I zoom it with the DVD player, I lose screen information. BTW: this is the case with almost every letterboxed 4:3 film I have, so I am willing to process them all as long as I can preserve the quality.

In this sense, LSFmod came very handy. The script I ended up using was:

TFM()
TDecimate(Mode=1)
lsfmod(smode=5, Smethod=3, kernel=19, soothe=true)
Lanczos4Resize(720,480,0,66,0,-66)

After some trim tests, I processed the whole film with that. Compared to the original the results were spectacular. The only problem is it took quite long to process it. Usually I take 3-4 hours with a regular DVD to resize it. This one took 13.

Last edited by carlmart; 16th September 2009 at 12:08.
carlmart is offline   Reply With Quote
Old 16th September 2009, 14:57   #4  |  Link
LaTo
LaTo INV.
 
LaTo's Avatar
 
Join Date: Jun 2007
Location: France
Posts: 701
Quote:
Originally Posted by carlmart View Post
The only problem is it took quite long to process it. Usually I take 3-4 hours with a regular DVD to resize it. This one took 13.
try defaults="fast"
LaTo is offline   Reply With Quote
Old 16th September 2009, 16:56   #5  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,391
And also, crop the major part of black borders beforehand:
Code:
crop(0,64,-0,-64)
TFM()
TDecimate(Mode=1)
lsfmod(smode=5, Smethod=3, kernel=19, soothe=true)
Lanczos4Resize(720,480,0,2,0,-2)
Same result, but 26.6% less area to process for all the filters.
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 17th September 2009, 20:52   #6  |  Link
carlmart
Carlos Martinez
 
Join Date: Aug 2005
Posts: 288
Thanks LaTo. I have added "fast".

Thanks Didée. Which is the reasoning to get to that figure combination?

When AR is larger than 16:9 I've learnt to compute the results quite well, using resize and addborder. But it's been hard to get to a way to compute other sizes like 1.33 or 1.66.

In any case, after that long conversion I burned a DVD-RW with the results. And I think it needs further work using the filter combo I tried.

To start with halos have popped up where didn't seem to be any. So I now think I have to be careful on what to use.

Using dehalo is not quite an option, as I know it even less and the last time I tried it it had softened things too much, like a fog filter.

Perhaps I should show here a jpg of the same image with and without LFSmod for you to see what I mean.
carlmart is offline   Reply With Quote
Old 17th September 2009, 21:10   #7  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,409
Quote:
Originally Posted by carlmart View Post
To start with halos have popped up where didn't seem to be any. So I now think I have to be careful on what to use.

Using dehalo is not quite an option, as I know it even less and the last time I tried it it had softened things too much, like a fog filter.

Perhaps I should show here a jpg of the same image with and without LFSmod for you to see what I mean.
One option is to lower the sharpening strength
poisondeathray is offline   Reply With Quote
Old 17th September 2009, 22:51   #8  |  Link
carlmart
Carlos Martinez
 
Join Date: Aug 2005
Posts: 288
Quote:
Originally Posted by poisondeathray View Post
One option is to lower the sharpening strength
Tried that. Things improved and looks less flat than without it on the resize.

Another thing I tried was DegrainMedian, as the film or copy is rather grainy. Things seem to improve a bit, but it gets slightly artificial, like plastic.

Is there a way to increase the screen size in AvsP? You can see the changes, but they are difficult to see sometimes, and they are there. Textures is what I am talking about, skin texture particularly.

But there's a halo or chromashift, don't know how to call it really, on the left, on black things. It's on the original and pops up a little with LSFMod. Curing that might help improve resolution. It's certainly a telecine problem.

Last edited by carlmart; 17th September 2009 at 23:57.
carlmart is offline   Reply With Quote
Old 21st September 2009, 18:02   #9  |  Link
carlmart
Carlos Martinez
 
Join Date: Aug 2005
Posts: 288
After I completed my first run with this project, I realized I was cropping the image on all sides, not just the black bars. My fault.

Before I go further with the image filters, I really have to learn to resize things from letterbox 4:3 properly. Perhaps you can help me understand how.

The problem is with images whose ratio is less than 1.77 (16:9). How can I compute things properly on such cases?

Just to be specific with my example: the ratio of my letterbox image is 1.66. How do I set the crop, resize and addborder variables to get me a non-cropped, pilar sized 16:9 720:480 image?

Last edited by carlmart; 21st September 2009 at 18:40.
carlmart is offline   Reply With Quote
Old 22nd September 2009, 01:07   #10  |  Link
manono
Moderator
 
Join Date: Oct 2001
Location: Hawaii
Posts: 7,406
Quote:
Originally Posted by carlmart View Post
Just to be specific with my example: the ratio of my letterbox image is 1.66. How do I set the crop, resize and addborder variables to get me a non-cropped, pilar sized 16:9 720:480 image?
I already explained how I did it in your Videohelp.com thread about this:

http://forum.videohelp.com/topic372789-30.html#2005813

Or, put another way, find the original crop values (I use GKnot for this) and plug into FitCD the new cropped resolution and set it as DVD 720. In this example I cropped 48 from both the top and bottom:
Attached Images
 
manono is offline   Reply With Quote
Old 22nd September 2009, 03:46   #11  |  Link
carlmart
Carlos Martinez
 
Join Date: Aug 2005
Posts: 288
In fact today I went look for help on another thread of mine you helped me with, in Videohelp.

On it you suggested using this combo:

Crop(0,60,0,-60)
Lanczos4Resize(720,480)

Changing the crop values you can adjust to several ratios. Using it in AvsP until I cropped nothing, I got to this combo:

Crop(0,46,0,-44)
spline36resize(720,480)

FitCD is still a tough nut to crack to me. Let's hope I get to manage it sometime.
carlmart is offline   Reply With Quote
Old 22nd September 2009, 09:13   #12  |  Link
manono
Moderator
 
Join Date: Oct 2001
Location: Hawaii
Posts: 7,406
Quote:
Originally Posted by carlmart View Post
On it you suggested using this combo:

Crop(0,60,0,-60)
Lanczos4Resize(720,480)
You have to cite the thread or post. That's a standard 4:3 to 16:9 script, but for films 1.78:1 or wider. It wouldn't apply to 1.66:1 films unless you want to crop well into the active video and turn it into 1.78:1. If converting your 1.66:1 4:3 DVD to 16:9, given your crop values, I'd do it like this:

Crop(0,46,0,-44)
LanczosResize(656,480)
AddBorders(32,0,32,0)
Attached Images
 

Last edited by manono; 22nd September 2009 at 13:30.
manono is offline   Reply With Quote
Old 22nd September 2009, 11:17   #13  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,433
Quote:
Originally Posted by carlmart View Post
Crop(0,46,0,-44)
spline36resize(720,480)
That's clearly wrong as it does not produce a pillar-boxed result. So the resize needs to be to a width less than 720 and the last step needs to be adding borders to the sides to bring the width up to 720.

However, I don't understand how FitCD arrives at the numbers shown in Manono's post, where it resizes 720x386 to 656x480. Working it out manually, I get this:

Changing height from 386 to 480 means width becomes 720 * 480/386 (at original PAR)
Allowing for change in DAR from 4:3 to 16:9 means compress horizontally to 3/4 width,
hence final width = 720 * 480/386 * 3/4 = 672 (instead of 656)
Gavino is offline   Reply With Quote
Old 22nd September 2009, 13:05   #14  |  Link
carlmart
Carlos Martinez
 
Join Date: Aug 2005
Posts: 288
Manono & Gavino:

You're both right. I do not want to crop things.

Manono, when I loaded your FitCD numbers on AvsP I get an image that has borders all over. In fact I should get an image with pillars on the sides only.

But I would love to understand how to load values in FitCD.

Gavino, I must be a real blockhead (you don't have to agree!) but I couldn't understand your reasoning.

Maybe this time I can learn to do things right in less than 1.77 frames.
carlmart is offline   Reply With Quote
Old 22nd September 2009, 13:47   #15  |  Link
manono
Moderator
 
Join Date: Oct 2001
Location: Hawaii
Posts: 7,406
Quote:
Originally Posted by Gavino View Post
However, I don't understand how FitCD arrives at the numbers shown in Manono's post, where it resizes 720x386 to 656x480.
If you turn on ITU resizing in FitCD you get pretty much what you figured. I had mentioned this earlier in carlmart's other thread over at Videohelp.com to which I linked several posts up:
Quote:
Then the only remaining decision is whether or not to use ITU resizing.
http://forum.videohelp.com/topic372789-30.html#2005813

I use it almost always myself, although I don't think the eye will be able to tell one way or the other, and carlmart's having enough trouble understanding the basics of how FitCD works without adding another level of complexity with ITU resizing:
Attached Images
 
manono is offline   Reply With Quote
Old 22nd September 2009, 14:58   #16  |  Link
carlmart
Carlos Martinez
 
Join Date: Aug 2005
Posts: 288
This is what I get if I load that script in AvsP.
Attached Images
 
carlmart is offline   Reply With Quote
Old 22nd September 2009, 15:15   #17  |  Link
mavinashbabu
Registered User
 
Join Date: Mar 2007
Posts: 35
Sorry carlmart, a bit off topic question, Manono can you please tell the software that you used in the attached screenshots, it seems to help a lot... Thanks
mavinashbabu is offline   Reply With Quote
Old 22nd September 2009, 15:40   #18  |  Link
g-force
Guest
 
Posts: n/a
Quote:
Originally Posted by carlmart View Post
Just to be specific with my example: the ratio of my letterbox image is 1.66. How do I set the crop, resize and addborder variables to get me a non-cropped, pilar sized 16:9 720:480 image?
What you're asking for is not possible unless you:
a) squish the height
b) over-crop the top and bottom
c) add black borders to the sides

If one of these options is of interest to you, then please state which way you want to go. You're basically trying to fit a square peg in a rectangular hole. So you've either gotta use a smaller square, or shave off the sides of the square to make it more rectangular.

BTW, I'll answer the question you posed to Didée, "Which is the reasoning to get to that figure combination?"
He took your original script, which had this at the end:

Lanczos4Resize(720,480,0,66,0,-66)

which is the same as cropping 66 off the top and bottom and resizing the result to 720x480.

So, he was thinking, why not just crop by a nice (divisible by 16) number like 64 from the top and bottom first, do all the "slow" stuff, and then do another crop by 2 (top and bottom) at the end to get to the 66 of of your original script. Now I assume that you have since realized that this crops your video too much, as you have recently stated that 46 off the top and 44 off the bottom is the maximum without over-cropping. BUT he was working under the assumption that your original script had the correct values.

-G
  Reply With Quote
Old 22nd September 2009, 18:01   #19  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,433
Quote:
Originally Posted by carlmart View Post
Gavino, I must be a real blockhead (you don't have to agree!) but I couldn't understand your reasoning.
Basically, it goes like this:
- in your 4:3 DVD, actual picture occupies area 720x390 (based on your info that you need to crop off 90 pixels to remove black bars);
- for some reason, FitCD only uses 386 of these, so I took that as my starting point;
- you want to scale that up to occupy the full height available of 480, so to maintain AR, you need to scale the width by the same factor, ie 480/386;
- but our final target has 16:9 DAR while the original is 4:3, so we need to squeeze it anamorphically by a further factor of 3/4 (ie (4/3)/(16/9)) to allow for the different PARs;
- therefore, actual width required = 720 * 480/386 * 3/4 = 672

@Manono - this reasoning is independent of whether ITU resizing is used or not, it just requires it to be used consistently - for both input and output, or for neither - and then its effect cancels out. From the results shown, it seems that FitCD always uses it for output calculations, but for input only uses it when selected.
Gavino is offline   Reply With Quote
Old 22nd September 2009, 18:14   #20  |  Link
carlmart
Carlos Martinez
 
Join Date: Aug 2005
Posts: 288
Quote:
Originally Posted by g-force View Post
What you're asking for is not possible unless you:
a) squish the height
b) over-crop the top and bottom
c) add black borders to the sides
The last option would be the one.

What I think I am doing is eliminating as much black space as possible, and for that I would have to zoom the image and anamorphize it. That is convert the 4:3 "spheric" image I have now into a 4:3 anamorphic one, containing a 16:9 image with pillar bars on the sides.

Quote:
BTW, I'll answer the question you posed to Didée, "Which is the reasoning to get to that figure combination?"
He took your original script, which had this at the end:

Lanczos4Resize(720,480,0,66,0,-66)

which is the same as cropping 66 off the top and bottom and resizing the result to 720x480.
Apparently I have to start thinking this in a different way. I need to know which is the better combination, the one that will be better quality wise.
carlmart 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 19:44.


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