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 > VapourSynth

Reply
 
Thread Tools Search this Thread Display Modes
Old 3rd September 2020, 22:29   #1  |  Link
shph
Registered User
 
Join Date: Mar 2020
Posts: 134
Detelecine VIVTC VFM + QTGMC produce some jagged artifacts

Hello. A lot of cartoon DVDs show interlaced frames in dynamic scenes when you simply detelecine them, so sometimes it may be a real problem.

VIVTC VFM detelecine in Hybrid dvelopment version was extended, and in addition to basic "inner" deinterlacer it now provide QTGMC presets (Fast to Very Slow) and NNEDi3.
So i tested some vob examples with new VIVTC VFM detelecine + QTGMC and NNEDi3 and here is what i got:

- QTGMC seems like better than basic "inner" deinterlacer. It 100% removes all interlaced fields that left after detelecine even if used simplest VFM detelecine preset.
- NNEDi3 quality is less accurate than QTGMC.

But here is a problem:

- QTGMC may produce jagged artifacts in straight diagonal lines and some other fine line details. It feels like it attempt to deinterlace progressive frames by mistake.
- Those jagged artifacts are not aliasing and it is impossible to filter them with AA filters.

Here are soeme examples:


Source vob file for test:
https://drive.google.com/file/d/1sxF...ew?usp=sharing

Seems it was a discussion about similar problem here https://forum.doom9.org/showthread.php?t=172825
And the basic problem fix was: "The jaggies are not caused by QTGMC itself, they are caused by TDeint.
Simply using your QTGMC call alone, without TDeint, results in a jaggie-less video.
The problem is you are wrapping QTGMC in TDeint. I suspect it is caused by the fact that by default QTGMC does not leave the original fields unaltered. TDeint does, so the interpolated fields by QTGMC do not match the original ones that TDeint injects, resulting in jaggies."

So here are some questions:
- Is it some bug in QTGMC?
- Is it some bug in relation between QTGMC and VIVTC VFM?
- Is it possible somehow adapt QTGMC script specially for VIVTC VFM detelecine purposes?

Discussion was started here https://forum.selur.net/showthread.p...d=8887#pid8887 but seems it is more like common problem and not directly related to Hybrid.
Any real life suggestions welcome.
shph is offline   Reply With Quote
Old 4th September 2020, 00:03   #2  |  Link
AdamCarter
Registered User
 
Join Date: Jul 2020
Posts: 41
I noticed they mentioned
Instead of using tdeint
https://forum.doom9.org/showthread.p...35#post1745735
To use a TCombMask+IsCombedTIVTC+ConditionalFilter

So maybe:
We need to use a different tdeint tdeintmod
https://github.com/HomeOfVapourSynth...ynth-TDeintMod
IsCombedTIVTC Seems to be included in this tdeintmod


It only runs the deinterlacer on combed frames.

They had mentioned a combmask too not sure if its needed but i found this
combmask https://github.com/chikuzen/CombMask...er/vapoursynth
AdamCarter is offline   Reply With Quote
Old 6th September 2020, 19:26   #3  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
I used this combo for left over combed frames with qtgmc.


Code:
def conditionalDeint(n, f, orig, deint):
    if f.props._Combed:
        return deint#.sub.Subtitle("DEINT", margins=[20,20,70,20])
    else:
        return orig



clip = core.lsmas.LWLibavSource(source="...")
clip = clip.vivtc.VFM(0, mode=3, cthresh=8,  blockx=32, blocky=32)
clip = clip.vivtc.VDecimate()

deint = haf.QTGMC(clip, Preset='very slow', TR2=1, TFF=True, SourceMatch=3 ).std.SelectEvery( cycle=2, offsets=0) #Sharpness=0.7
combProps = core.tdm.IsCombed(clip, metric=1, cthresh=5, blockx=32, blocky=32, mi=90)
clip = core.std.FrameEval(clip, functools.partial(conditionalDeint, orig=clip, deint=deint), combProps)
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database
ChaosKing is offline   Reply With Quote
Old 7th September 2020, 03:18   #4  |  Link
shph
Registered User
 
Join Date: Mar 2020
Posts: 134
Interesting... This is how VIVTC VFM + QTGMC code currently look in Hybrid:
Code:
clip2clip = havsfunc.QTGMC(Input=clip2clip, Preset="Very Slow", opencl=True, TFF=False,FPSDivisor=2)
clip = core.vivtc.VFM(clip=clip, clip2=clip2clip, order=0, field=3)
clip = core.vivtc.VDecimate(clip=clip, clip2=clip2clip)# new fps: 23.976
shph is offline   Reply With Quote
Old 12th September 2020, 09:54   #5  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,259
What Hybrid offers is using QTGMC as alternative to the internal deinterlaced during IVTC.
What ChaosKing does is to identify the still combed frames (using tdm.isComded; tdm is part of the TDeintMod filter) after IVTC and apply QTGMC on those.
-> he purposes an additional step after the normal IVTC (independent of whether QTGMC is used during IVTC or not)
Also note that:
a. Hybrid addresses havsfunc through 'hasfunc' while ChaosKing addresses it through 'haf'
b. Hybrid uses 'FPSDivisor=2' which ChaosKing uses '.std.SelectEvery( cycle=2, offsets=0)'
c. Hybrid uses 'TFF=False' while ChaosKing uses 'TFF=True' in QTGMC
c. note that your script needs 'import functools' which Hybrid doesn't import by default.
in case you try to add his proposal as a custom addition to the Vapoursynth script in Hybrid.

So one could combine those two and use QTGMC for both the deinterlacing during IVTC and for the additional decombing and would have something like:
Code:
clip = core.d2v.Source(input="E:/Temp/mpg_2bcf42122044faeeeecd635342234255_853323747.d2v")
# making sure input color matrix is set as 470bg
clip = core.resize.Point(clip, matrix_in_s="470bg",range_s="limited")
# making sure frame rate is set to 29.970
clip = core.std.AssumeFPS(clip, fpsnum=30000, fpsden=1001)
# Setting color range to TV (limited) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
clip2clip=clip
clip2clip = havsfunc.QTGMC(Input=clip2clip, Preset="Very Slow", opencl=True, TFF=False,FPSDivisor=2)
clip = core.vivtc.VFM(clip=clip, clip2=clip2clip, order=0, mode=1)
clip = core.vivtc.VDecimate(clip=clip, clip2=clip2clip)# new fps: 23.976
# Fix combed frames
# adding helper function
def conditionalDeint(n, f, orig, deint):
    if f.props._Combed:
        return deint
    else:
        return orig
clipDeint = havsfunc.QTGMC(Input=clip, Preset="Very Slow", opencl=True, TFF=False, TR2=1, SourceMatch=3, FPSDivisor=2)
clipCombProps = core.tdm.IsCombed(clip=clip, blockx=32, blocky=32)
clip = core.std.FrameEval(clip=clip, eval=functools.partial(conditionalDeint, orig=clip, deint=clipDeint), clipCombProps)
but even when using nnedi3cl instead of nnedi3 or znnedi3 this will probably terribly slow,.... (as to be expected when using QTGMC 'very slow' two times.


Cu Selur
__________________
Hybrid here in the forum, homepage

Last edited by Selur; 12th September 2020 at 12:14.
Selur is offline   Reply With Quote
Old 12th September 2020, 13:39   #6  |  Link
shph
Registered User
 
Join Date: Mar 2020
Posts: 134
By the way, i experimented with QTGMC deinterlace applied to PAL dvds that recorded in unusual but popular format when movie looks progressive inside interlaced VOB container. It was not animation but basic music video movie. QTGMC magically combined those double progressive frames (odd/even frame look near the same), cleans noise and filters tiny pixel level interlace artifacts (sort of combined double exposure effect). But same time i see that qtgmc have the same problem with jagged edges when it goes to straight lines in the movie.
I understand that probably it is not correct to apply QTGMC like this, but i guess it would be really nice if QTGMC was improved somehow and just don't produce jagged edges in any possible situations.
shph is offline   Reply With Quote
Old 12th September 2020, 16:10   #7  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,259
Quote:
any possible situations
dream on,...
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Reply

Tags
deinterlace, detelecine, qtgmc

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:36.


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