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
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 17th June 2006, 17:52   #1  |  Link
DrScotsman
Registered User
 
Join Date: May 2005
Posts: 11
Dealing with compression-killing interlaced luma variations

So I have the R2 Family Guy Season 3 DVDs. Unlike the first two Seasons, the quality of this is astounding. Not a single blend anywhere, PAL speedup with pitch correction, etc.

However, while the episodes are progressive, they're encoded interlaced. I'm aware that usually this means nothing and it should just be treated as progressive. However when I view it with Histogram(mode="luma"), you can see that there are differences between fields (there's no problem with the chroma for the record). Putting a Bob() afterwards proves this; Bob.SelectEven and Bob.SelectOdd look fine (well, better), but Bob doesn't.

M2V sample, 20MB

And a sample histogrammed image:



I've tried an x264 encode, and this issue seems to kill compression. In addition, I'd like to resize it to 720x540 (to make it square pixel), and a vertical resize is never good for interlacing.

So, are there any filters that can solve this?

Thanks in advance.

Last edited by DrScotsman; 17th June 2006 at 18:06.
DrScotsman is offline   Reply With Quote
Old 17th June 2006, 19:15   #2  |  Link
foxyshadis
Angel of Night
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Tangled in the silks
Posts: 9,559
Try using a denoiser. frfun7+degrainmedian warms my heart for mild or moderate noise, and a slight sharpening (limitedsharpen or seesaw) to remove the softness it'll cause. If the combing is normally too faint to notice, that'll completely get rid of it, and if not, at least mitigate it.

Or you actually could try resizing, because the variations should be small enough that resizing will mix them back together in an eye-pleasing instead of disruptive way. (Since they're supposed to be together anyway, unlike combing.) But you probably can't resize down far enough to make a noticeable difference, and it'd be best to keep the original DVD resolution.
foxyshadis is offline   Reply With Quote
Old 17th June 2006, 19:28   #3  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,391
Try the following - it's not the definite solution, but it improves very much on the problem, while impact on actual detail is very little.

BTW, basically this is just good old "Blur(1.0).Sharpen(1.0)" ... but done correctly.


Edit 26 Oct '06: Function updated (hopefully all inconsistencies eliminated).
Code:
# Vinverse: a small, but effective Function against (residual) combing, by Didée
# sstr: strength of contra sharpening
# amnt: change no pixel by more than this (default=255: unrestricted)
# uv  : chroma mode, as in MaskTools: 1=trash chroma, 2=pass chroma through, 3=process chroma

function Vinverse(clip clp, float "sstr", int "amnt", int "uv")
{
uv   = default(uv,3)
sstr = default(sstr,2.7)
amnt = default(amnt,255)
uv2  = (uv==2) ? 1 : uv
STR  = string(sstr)
AMN  = string(amnt)
vblur  = clp.mt_Convolution("1","50 99 50",U=uv,V=uv)
vblurD = mt_MakeDiff(clp,vblur,U=uv2,V=uv2)
Vshrp  = mt_LutXY(vblur,vblur.mt_Convolution("1","1 4 6 4 1",U=uv2,V=uv2),expr="x x y - "+STR+" * +",U=uv2,V=uv2)
VshrpD = mt_MakeDiff(Vshrp,vblur,U=uv2,V=uv2)
VlimD  = mt_LutXY(VshrpD,VblurD,expr="x 128 - y 128 - * 0 < x 128 - abs y 128 - abs < x y ? 128 - 0.25 * 128 + x 128 - abs y 128 - abs < x y ? ?",U=uv2,V=uv2)
mt_AddDiff(Vblur,VlimD,U=uv,V=uv)
(amnt>254) ? last : (amnt==0) ? clp : mt_LutXY(clp,last,expr="x "+AMN+" + y < x "+AMN+" + x "+AMN+" - y > x "+AMN+" - y ? ?",U=uv,V=uv) 
return(last)
}
Should deal well with most forms of residual combing.
__________________
- 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!)

Last edited by Didée; 26th October 2006 at 13:08.
Didée is offline   Reply With Quote
Old 17th June 2006, 21:10   #4  |  Link
Fizick
AviSynth plugger
 
Fizick's Avatar
 
Join Date: Nov 2003
Location: Russia
Posts: 2,183
I remember my first plugin Equlines
__________________
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 5th July 2022, 02:45   #5  |  Link
Katie Boundary
Registered User
 
Katie Boundary's Avatar
 
Join Date: Jan 2015
Posts: 1,056
Quote:
Originally Posted by Didée View Post
Code:
# Vinverse: a small, but effective Function against (residual) combing, by Didée
# sstr: strength of contra sharpening
# amnt: change no pixel by more than this (default=255: unrestricted)
# uv  : chroma mode, as in MaskTools: 1=trash chroma, 2=pass chroma through, 3=process chroma

function Vinverse(clip clp, float "sstr", int "amnt", int "uv")
{
uv   = default(uv,3)
sstr = default(sstr,2.7)
amnt = default(amnt,255)
uv2  = (uv==2) ? 1 : uv
STR  = string(sstr)
AMN  = string(amnt)
vblur  = clp.mt_Convolution("1","50 99 50",U=uv,V=uv)
vblurD = mt_MakeDiff(clp,vblur,U=uv2,V=uv2)
Vshrp  = mt_LutXY(vblur,vblur.mt_Convolution("1","1 4 6 4 1",U=uv2,V=uv2),expr="x x y - "+STR+" * +",U=uv2,V=uv2)
VshrpD = mt_MakeDiff(Vshrp,vblur,U=uv2,V=uv2)
VlimD  = mt_LutXY(VshrpD,VblurD,expr="x 128 - y 128 - * 0 < x 128 - abs y 128 - abs < x y ? 128 - 0.25 * 128 + x 128 - abs y 128 - abs < x y ? ?",U=uv2,V=uv2)
mt_AddDiff(Vblur,VlimD,U=uv,V=uv)
(amnt>254) ? last : (amnt==0) ? clp : mt_LutXY(clp,last,expr="x "+AMN+" + y < x "+AMN+" + x "+AMN+" - y > x "+AMN+" - y ? ?",U=uv,V=uv) 
return(last)
}
I cannot make heads or tails of just what all that crap is supposed to do or how it works. If I hadn't seen it on Doom9, I wouldn't have even recognized it as AVIsynth language.
__________________
I ask unusual questions but always give proper thanks to those who give correct and useful answers.
Katie Boundary is offline   Reply With Quote
Old 5th July 2022, 05:15   #6  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,695
Didée's scripts were always at a different level. I could not figure out most of them, but they often worked brilliantly. I miss his contributions.
johnmeyer is offline   Reply With Quote
Old 5th July 2022, 11:44   #7  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,912
Katie, this is Didée we're talking about. He made the history of Doom9 and rest assured his filters still work to this very day.

Quote:
Originally Posted by johnmeyer View Post
I miss his contributions.
Me too.
We've had some of the very best developers here on Doom9.
It's a shame that some of them retired, but I guess it's just the way it works. One of my colleagues also retired and he was like: "please, I'll never stop posting on Doom9 or use Avisynth"... until he did, 1 and a half years later to spend his days catching carps in the river.
FranceBB is offline   Reply With Quote
Reply


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 07:09.


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