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. |
|
![]() |
|
Thread Tools | Search this Thread | Display Modes |
![]() |
#1 | Link |
Registered User
Join Date: Oct 2009
Location: crow-land
Posts: 543
|
PAL 1080p to PAL 576i with high quality motion compensated interpolation
I have a (legal) 1080p source of sports footage in an mp4 container. I only have a DVD player and an old simple media player. Sports footage looks better interlaced anyway (I once heard it called "motion fluidity").
I can use Mr Donald Graft's dgdecodeNV to make use of my Ti750i graphics card to resize the 1080p input to 576p apparently like Code:
LoadPlugin("C:\DGindex\DGDecodeNV.dll") DGSource("footy.dgi",resize_w=720,resize_h=576) (i) double the framerate using the latest nice accurate form of motion compensated interpolation (something in mvtools2?) (ii) and turn that into a DVD compatible TFF interlaced fields 576i (ie 50 fields/sec) output. Suggestions very much welcomed on how to do (i) and (ii). edit: for (ii) I think this turns 576p50 into 576i TFF interlaced Code:
AssumeTFF() SeparateFields() SelectEvery(4,0,3) # top field first Weave() Code:
#To double fps with MFlowFps for 'best' results (but slower processing): super = MSuper(pel=2) # Use block overlap, halfpixel accuracy and Exhaustive search backward_vec = MAnalyse(super, overlap=4, isb = true, search=3) forward_vec = MAnalyse(super, overlap=4, isb = false, search=3) MFlowFps(super, backward_vec, forward_vec, num=2*FramerateNumerator(last), den=FramerateDenominator(last)) http://forum.doom9.org/showthread.php?t=164554 Last edited by hydra3333; 9th September 2015 at 06:02. |
![]() |
![]() |
![]() |
#3 | Link | ||
Registered User
Join Date: Oct 2009
Location: crow-land
Posts: 543
|
Quote:
Quote:
It also is blocky as anything so I'm hoping this sorts it out (straight after the DGsource) Code:
Deblock_QED(quant1=36) Last edited by hydra3333; 9th September 2015 at 10:33. |
||
![]() |
![]() |
![]() |
#4 | Link |
Registered User
Join Date: Oct 2009
Location: crow-land
Posts: 543
|
Since I'm doing deblocking too, this is what I've got so far. Feel free to criticize.
Code:
SetMTmode(mode=5,threads=8) # start with mode=5 forAVIsource http://forum.doom9.org/showthread.php?p=1067216#post1067216 setmemorymax(1024) LoadPlugin("C:\SOFTWARE\DGindex\DGDecodeNV.dll") LoadPlugin("C:\SOFTWARE\DGindex\DGDecode.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-qtgmc-smdegrain\mt_masktools-25.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-qtgmc-smdegrain\mvtools2.dll") # Import("C:\Program Files (x86)\AviSynth 2.5\Deblock_QED_MT2.avs") Import("C:\Program Files (x86)\AviSynth 2.5\LimitedSharpenFaster.avs") DGSource("T:\HDTV\WDTVlive\MP4hd\progressive\2015.09.05-SANFL-QualifyingFinal-Westies-d-Port-Q1-HD.dgi") SetMTmode(mode=2) # Deblock_QED(quant1=36) Spline36resize(720,576) #-- #To double fps with MFlowFps for *best* results (but slower processing) super = MSuper(pel=2) # Use block overlap, halfpixel accuracy and Exhaustive search backward_vec = MAnalyse(super, overlap=4, isb = true, search=3) forward_vec = MAnalyse(super, overlap=4, isb = false, search=3) MFlowFps(super, backward_vec, forward_vec, num=2*FramerateNumerator(last), den=FramerateDenominator(last)) #-- AssumeTFF() #choose the SAME field order like before deinterlacing SeparateFields().SelectEvery(4,0,3).Weave() #reinterlace. AssumeTFF() #choose the SAME field order like before deinterlacing AssumeFPS(25) #-- ColorMatrix(interlaced=true,mode="Rec.709->Rec.601") SetMTmode(mode=5,threads=8) Distributor() # use this when using HC and SetMTmode, per http://forum.doom9.org/showthread.php?p=1063622#post1063622 |
![]() |
![]() |
![]() |
#5 | Link |
Registered User
Join Date: Mar 2014
Posts: 308
|
Changing the colour matrix should be done prior to interlacing, because the interlacing step introduces aliasing, which makes the chroma resampling considerably less accurate. You could even do it before resizing to 576p to minimise the inaccuracy, but that's probably unnecessary.
__________________
Say no to AviSynth 2.5.8 and DirectShowSource! |
![]() |
![]() |
![]() |
#7 | Link | |
Registered User
Join Date: Oct 2009
Location: crow-land
Posts: 543
|
Quote:
![]() From my standard script template, I added SVP's Interframe and am using this :- Code:
setmemorymax(1024) LoadPlugin("C:\SOFTWARE\DGindex\DGDecodeNV.dll") LoadPlugin("C:\SOFTWARE\DGindex\DGDecode.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-qtgmc-smdegrain\AddGrainC.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-qtgmc-smdegrain\avstp.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-qtgmc-smdegrain\dfttest.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-qtgmc-smdegrain\dither.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-qtgmc-smdegrain\EEDI2.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-qtgmc-smdegrain\eedi3.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-qtgmc-smdegrain\FFT3DFilter.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-qtgmc-smdegrain\mt_masktools-25.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-qtgmc-smdegrain\mvtools2.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-qtgmc-smdegrain\nnedi-from-tcritical.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-qtgmc-smdegrain\nnedi2-from-tcritical.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-qtgmc-smdegrain\nnedi3-from-tcritical.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-qtgmc-smdegrain\RemoveGrainSSE2.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-qtgmc-smdegrain\RepairSSE2.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-qtgmc-smdegrain\SSE2Tools.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-qtgmc-smdegrain\TDeint.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\VerticalCleanerSSE3.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-qtgmc-smdegrain\VariableBlur.dll") LoadCPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-qtgmc-smdegrain\yadif.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\AGC.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\CNR2.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\fft3dfilter.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\dctfilter.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\degrainmedian.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\Convolution3d.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\DePan.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\despot.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\WarpSharp.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\FFTQuiver.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\aWarpSharp.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\Unfilter.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\RemoveDirtSSE2.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\Yadifmod.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\Colormatrix.dll") # LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\InterFrame-2.8.2\Dependencies\svpflow1.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\InterFrame-2.8.2\Dependencies\svpflow2.dll") # Import("C:\Program Files (x86)\AviSynth 2.5\plugins-qtgmc-smdegrain\dither.avs") Import("C:\Program Files (x86)\AviSynth 2.5\plugins-qtgmc-smdegrain\mt_xxpand_multi.avs") Import("C:\Program Files (x86)\AviSynth 2.5\plugins-qtgmc-smdegrain\QTGMC-3.33.avs") Import("C:\Program Files (x86)\AviSynth 2.5\plugins-qtgmc-smdegrain\SMDegrain-v.2.2d.avs") Import("C:\Program Files (x86)\AviSynth 2.5\plugins-qtgmc-smdegrain\LSFmod.v1.9.avs") Import("C:\Program Files (x86)\AviSynth 2.5\Deblock_QED_MT2.avs") Import("C:\Program Files (x86)\AviSynth 2.5\LimitedSharpenFaster.avs") # Import("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\InterFrame-2.8.2\InterFrame2.avsi") # DGSource("T:\HDTV\WDTVlive\MP4hd\progressive\interframe\2015.09.05-SANFL-QualifyingFinal-Westies-d-Port-Q1-HD.dgi") Deblock_QED() #default quant1=24 Deblock_QED() #default quant1=24 ######## #--progressive-only MSUPER/MDegrain1 for use with SetMTMode(2) #blksize=8 # 4, 8 or 16 ( default is 8 ). Larger blocks are less sensitive to noise, are faster, but also less accurate. #overlap=4 # overlap value (0 to 4 for blksize=8) Must be even and less than block size #dct=0 # use dct=1 for clip with light flicker #super = MSuper(pel=2,chroma=true,sharp=2) #backward_vec1 = MAnalyse(super, isb = true, delta = 1, blksize=blksize, overlap=overlap, dct=dct, chroma=true) #forward_vec1 = MAnalyse(super, isb = false, delta = 1, blksize=blksize, overlap=overlap, dct=dct, chroma=true) #MDegrain1(super, backward_vec1,forward_vec1,thSAD=400,plane=4) ######## LimitedSharpenFaster(smode=4,strength=100) Spline36resize(720,576) #Lanczos4resize(720,576) #-- #InterFrame (GPU=true, Preset="Medium", Tuning="Smooth", Cores=8, FrameDouble=true) #InterFrame (GPU=true, Preset="Medium", Tuning="Film", Cores=8, FrameDouble=true) InterFrame (GPU=false, Preset="Medium", Tuning="Smooth", Cores=8, FrameDouble=true) #InterFrame (GPU=false, Preset="Medium", Tuning="Film", Cores=8, FrameDouble=true) #-- AssumeTFF() #choose the SAME field order like before deinterlacing Blur(0,0.25).SeparateFields().SelectEvery(4,0,3).Weave() #reinterlace - ASSUMED TFF HERE # BLUR(0,1) per http://forum.doom9.org/showthread.php?p=1488308#post1488308 AssumeTFF() #choose the SAME field order like before deinterlacing AssumeFPS(25) ColorMatrix(interlaced=true,mode="Rec.709->Rec.601") AssumeTFF() AssumeFPS(25) Code:
SeparateFields() Deblock_QED() #default quant1=24 Deblock_QED() #default quant1=24 weave() edit: uploaded a 5mb .mp4 sample of the source chopped out using ffmpeg with -c:v copy -c:a copy https://drive.google.com/file/d/0B5R...ew?usp=sharing https://drive.google.com/file/d/0B5R...ew?usp=sharing Last edited by hydra3333; 10th September 2015 at 10:26. |
|
![]() |
![]() |
![]() |
#8 | Link |
Registered User
Join Date: Oct 2009
Location: crow-land
Posts: 543
|
OK, well now I am a bit stuck, nothing easy I try deblocks that source.
Can someone please provide advice on how to significantly deblock that source ? https://drive.google.com/file/d/0B5R...ew?usp=sharing |
![]() |
![]() |
![]() |
#9 | Link | |
Registered User
Join Date: May 2009
Location: Belgium
Posts: 1,761
|
Quote:
edit : I believe it's better to deblock before using SeparateFields() . Last edited by Music Fan; 10th September 2015 at 11:10. |
|
![]() |
![]() |
![]() |
#11 | Link | |
/人 ◕ ‿‿ ◕ 人\
Join Date: May 2011
Location: Russia
Posts: 643
|
Quote:
I'm not sure how deblock_qed works but usually deblock deblocks until it's not satisfied (result have no blockiness from it's point of view that depends on it's settings), so chaining it is not effective (if not useless). Instead it has options (all of them) that affect it's strength. The main one is quant1 (higher means stronger deblock). I've never used it so I don't know how to tune other options it has... Last edited by vivan; 10th September 2015 at 14:15. |
|
![]() |
![]() |
![]() |
#13 | Link | ||||||
Registered User
Join Date: Oct 2009
Location: crow-land
Posts: 543
|
Quote:
Code:
Deblock_QED(quant1=18,aOff1=16,quant2=28,aOff2=11) # (suggested by Didee for HD material somewhere). Quote:
Quote:
Quote:
http://avisynth.nl/index.php/Deblock_QED says Quote:
And http://rationalqm.us/dgmpgdec/DGDeco...l.html#BlindPP says Quote:
Code:
BlindPP(quant=10, cpu=6, iPP=false, moderate_h=15, moderate_v=30) |
||||||
![]() |
![]() |
![]() |
#14 | Link |
Registered User
Join Date: Oct 2009
Location: crow-land
Posts: 543
|
Hmm neither of these seemed to do much
![]() O=LAST #P=Deblock_QED(quant1=48,aOff1=24,bOff1=24,aOff2=24,bOff2=24,uv=-1) P=Deblock(quant=51,aOffset=24,bOffset=24) dcwbox8(O,"original",P,"deblocked") # slice O and P into 8x8 and splice into O/P/O/P/O/P/O/P vert and horiz, label each splice, and present as single composite frames |
![]() |
![]() |
![]() |
#15 | Link | |
Registered User
Join Date: Oct 2009
Location: crow-land
Posts: 543
|
Quote:
http://forum.doom9.org/showthread.php?t=164800 http://avisynth.nl/index.php/Externa...ers#Deblocking https://sites.google.com/site/jconkl...othd2/download Last edited by hydra3333; 11th September 2015 at 03:23. |
|
![]() |
![]() |
![]() |
#18 | Link |
Pig on the wing
Join Date: Mar 2002
Location: Finland
Posts: 5,817
|
The source looks like it really cannot be saved by any deblocker because there are no details to restore
![]() So maybe something like FFT3DFilter(sigma=5) + GrainFactory3(20,30,40) would help you? I would first use FFT3DFilter, then downsize to 720x576, do the framerate conversion, add noise and finally do whatever you need to do to get the final format you want (depending on whether you are going for case i or ii you mentioned).
__________________
And if the band you're in starts playing different tunes I'll see you on the dark side of the Moon... |
![]() |
![]() |
![]() |
#19 | Link |
Registered User
Join Date: May 2006
Posts: 4,048
|
Good idea to add noise, Boulder!
How about this (probably a bit overdone)? Code:
FFT3DFilter(sigma=5) spline16resize(720,576) AddGrainC(var=150.0, uvar=0.5, hcorr=0.0, vcorr=0.0, seed=-1, constant=false, sse2=true) FFT3DFilter(sigma=5) QTGMC(preset="medium", InputType=1) Last edited by Sharc; 11th September 2015 at 09:45. Reason: Added QTGMC |
![]() |
![]() |
![]() |
#20 | Link |
Registered User
Join Date: Oct 2009
Location: crow-land
Posts: 543
|
Interesting! So is the below, based on yours. I must try full encodes and watch the variations on the telly.
Code:
LAST.HEIGHT==1080 ? AddBorders(0,0,0,8) : LAST O = LAST SmoothD2(quant=5, qtype=4, num_shift=3, ncpu=4) SmoothD2c(quant=5, qtype=4, num_shift=3, ncpu=4) FFT3DFilter(sigma=2) #LAST.HEIGHT==1088 ? cropbottom(8) : LAST #ColorMatrix(interlaced=true,mode="Rec.709->Rec.601") # for test purposes, leave it at full size #Spline36resize(720,576) AddGrainC(var=2.0, uvar=0.5, hcorr=0.0, vcorr=0.0, seed=-1, constant=false, sse2=true) #FFT3DFilter(sigma=1.5) #QTGMC(preset="medium", InputType=1) LimitedSharpenFaster(smode=4,strength=100) P = LAST boxify8x8(O,"original",P,"deblocked") Last edited by hydra3333; 11th September 2015 at 15:36. |
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|