View Full Version : Fixing Artifacts in VOB/Possible Chroma Upsampling Error
Shinji-kun
7th September 2010, 18:46
I want to encode an anime clip I ripped from R1 DVD. I made a d2v project file and then opened it in MeGUI, which then made an avs file.
The avs is as follows:
LoadPlugin("C:\Users\user\MeGUI_0.3.5_x86_WithoutInstaller_OfflinePackage\tools\dgindex\DGDecode.dll")
DGDecode_mpeg2source("C:\Users\user\dvd rip\Berserk Forces Full Version.d2v", info=3)
tfm(mode=1, d2v="C:\Users\user\dvd rip\Berserk Forces Full Version.d2v", mchroma=false)
tdecimate(mode=1)
Deblock_QED()
Removegrain()
crop(6,0,-10,0)
converttorgb()
The problems I am seeing when I view the avs in mpc-hc are:
1. Various small but noticeable blocking artifacts (blurring on objects).
2. Some type of combing or possibly chroma artifacts that look like after images, despite IVTC (in attached images).
3. Grain.
Does anyone know what the problem is?
Guest
7th September 2010, 19:01
Please post a sample of the original VOB. You can use DGSplit to cut it.
Shinji-kun
10th September 2010, 14:33
Please post a sample of the original VOB. You can use DGSplit to cut it.
http://www.mediafire.com/?mwjqj6ekdnpeb1b
Hagbard23
10th September 2010, 14:45
Maybe you give "SmartDecimate" a try - seems to me like bad IVTC, which i had too, due to hybrid/strange telecining of the original.
SmartDecimate is rather easy to use, maybe you like the result - you can put it through LSF or something similar after that and it should look well.
http://forum.doom9.org/showthread.php?t=60031
manono
10th September 2010, 15:42
This may not be the optimal solution, but it works:
Yadif(Mode=1)#or the bobber of your choice
SRestore(Frate=23.976)
Shinji-kun
10th September 2010, 16:30
This may not be the optimal solution, but it works:
Yadif(Mode=1)#or the bobber of your choice
SRestore(Frate=23.976)
Hm. There was 1 interlaced frame per 5 frames, thus it is telecine. Why deinterlace? That's only if every frame is interlaced, right? Also when i open the script in mpc-hc it says "there is no function named yadif".
Hagbard23
10th September 2010, 16:45
Hm. There was 1 interlaced frame per 5 frames, thus it is telecine. Why deinterlace? That's only if every frame is interlaced, right?
Indeed - and yes: It is telecined, but oviously not in an easy to invert manner.
For this kind of problem -as mentioned above- try using smartdecimate - i think it will solve your problem.
Guest
10th September 2010, 16:50
There was 1 interlaced frame per 5 frames, thus it is telecine. No, 3:2 pulldown would give 2 interlaced frames per 5. It's always better to inspect the actual fields when analyzing video.
It's field-blended video from a standards conversion, which manono effectively stated by giving a solution for field blending.
IIRC, SmartDecimate was not designed for solving field blending. Hagbard23, have you tried it on the sample clip?
manono
10th September 2010, 17:05
Hm. There was 1 interlaced frame per 5 frames, thus it is telecine. Why deinterlace? That's only if every frame is interlaced, right? Also when i open the script in mpc-hc it says "there is no function named yadif".
Hm yourself. Unless and until someone comes up with a better way (and I freely admit there might be one), as I said, this works. Yadif is being used as a bobber here and not as a single rate deinterlacer. If it says there's no function, did you load the Yadif.dll in your script? Read the included doc to learn how to do that.
Motenai Yoda
10th September 2010, 17:29
I've tried to work about this dvd-relase, but is too bad to give decent rip...
now I miss the script but should be like this
LoadPlugin("C:\Users\user\MeGUI_0.3.5_x86_WithoutInstaller_OfflinePackage\tools\dgindex\DGDecode.dll")
DGDecode_mpeg2source("C:\Users\user\dvd rip\Berserk Forces Full Version.d2v", idct=3,cpu2="ooooxx", ipp= true, icc=true, upconv=1)
crop(6,0,-10,0)
orig=last
edeinted=last.nnedi2#or last.separatefields.selecteven.eedi2
tfm(mode=1, d2v="C:\Users\user\dvd rip\Berserk Forces Full Version.d2v", mchroma=false, pp=1)
tdeint(clip2=orig, edeint=edeinted)
converttoyv12
tdecimate(mode=1)
super = MSuper(pel=2)
backward_vec2 = MAnalyse(super, isb = true, delta = 2, overlap=4)
backward_vec1 = MAnalyse(super, isb = true, delta = 1, overlap=4)
forward_vec1 = MAnalyse(super, isb = false, delta = 1, overlap=4)
forward_vec2 = MAnalyse(super, isb = false, delta = 2, overlap=4)
MDegrain2(super, backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=250)#or fft3dfilter/fft3dgpu th sigma between 1.7 and 2.2
removegrain(18)#or maa
toon(0.2)
http://www.megaupload.com/?d=KPBHKZ5M
Shinji-kun
10th September 2010, 17:43
LoadPlugin("C:\Users\user1\MeGUI_0.3.5_x86_WithoutInstaller_OfflinePackage\tools\dgindex\DGDecode.dll")
DGDecode_mpeg2source("C:\Users\user1\dvd rip\Berserk Forces Full Version.d2v", info=3)
LoadCPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\yadif.dll")
Yadif(mode=1)
Srestore(Frate=23.976)
Deblock_QED()
Removegrain()
crop(10,0,-14,0)
Last.MergeChroma(Last.PointResize((Last.width/2),(Last.Height/2)).Spline36Resize(Last.Width, Last.Height).Blur(0.5))
After running this script I still saw some frames that looked interlaced. These frames didn't seem to have combing artifacts but they looked more like after images. You can run the script and see for yourselves.
Also I still noticed a lot of grain and blurring. What would fix that?
Guest
10th September 2010, 17:51
After running this script I still saw some frames that looked interlaced. These frames didn't seem to have combing artifacts but they looked more like after images. You can run the script and see for yourselves. It's poorly mastered. You're not going to get perfection.
Also I still noticed a lot of grain and blurring. What would fix that? Again, see above. You remove grain with a denoiser, but it will exacerbate the blurring. You can try an adaptive sharpener of some sort after denoising. But I think the washed out look just needs contrast adjustment more than sharpening.
Shinji-kun
10th September 2010, 18:10
I've tried to work about this dvd-relase, but is too bad to give decent rip...
now I miss the script but should be like this
LoadPlugin("C:\Users\user\MeGUI_0.3.5_x86_WithoutInstaller_OfflinePackage\tools\dgindex\DGDecode.dll")
DGDecode_mpeg2source("C:\Users\user\dvd rip\Berserk Forces Full Version.d2v", idct=3,cpu2="ooooxx", ipp= true, icc=true, upconv=1)
crop(6,0,-10,0)
orig=last
edeinted=last.nnedi2#or last.separatefields.selecteven.eedi2
tfm(mode=1, d2v="C:\Users\user\dvd rip\Berserk Forces Full Version.d2v", mchroma=false, pp=1)
tdeint(clip2=orig, edeint=edeinted)
converttoyv12
tdecimate(mode=1)
super = MSuper(pel=2)
backward_vec2 = MAnalyse(super, isb = true, delta = 2, overlap=4)
backward_vec1 = MAnalyse(super, isb = true, delta = 1, overlap=4)
forward_vec1 = MAnalyse(super, isb = false, delta = 1, overlap=4)
forward_vec2 = MAnalyse(super, isb = false, delta = 2, overlap=4)
MDegrain2(super, backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=250)#or fft3dfilter/fft3dgpu th sigma between 1.7 and 2.2
removegrain(18)#or maa
toon(0.2)
http://www.megaupload.com/?d=KPBHKZ5M
I tried this script but still saw interlaced frames.
Guest
10th September 2010, 18:13
Again:
It's poorly mastered. You're not going to get perfection.
manono
10th September 2010, 18:49
After running this script I still saw some frames that looked interlaced. These frames didn't seem to have combing artifacts but they looked more like after images.
It's not interlacing. When I checked earlier I checked about 3/4 of the sample and all seemed good. After you wrote the comment I went back and checked the entire thing and you're right - there's some of that displaced chroma or whatever it's called near the end of the sample.
Besides being for a PAL DVD, there are other things wrong with Motenai Yoda's script. Maybe someone else can come up with better suggestions. This one may be a lost cause, though, and as neuron2 says you may never get it done to your satisfaction.
Guest
10th September 2010, 19:16
This one may be a lost cause, though, and as neuron2 says you may never get it done to your satisfaction. Yes, Motenai Yoda has already told us:
"I've tried to work about this dvd-relase, but is too bad to give decent rip..."
Motenai Yoda
10th September 2010, 21:19
yes it's "shake" and all pre/scenechange frames are "shifted".
also the r1 "remastered" that I've used is little better than r2j relase _http://asiandvdclub.org/punbb/viewtopic.php?id=9563
As I say the script is missed and I don't remember it. But full progressive can be reached. :)
Shinji-kun
11th September 2010, 00:49
@neuron2
Yes, I understand that there is a problem with the DVD release itself (curse you AnimeWorks) but there's no reason to lash out in frustration.
@Everyone else
The script that yoda made was very good. Maybe the interlacing/chroma issue that remains is from the PAL commands; Could anyone tell me the commands for NTSC in those areas? Does anyone see the same interlacing issue in this encode (http://www.youtube.com/watch?v=cZSOU9OBeUI)? It's not mine.
Hagbard23
11th September 2010, 11:55
Neuron2:
Hagbard23, have you tried it on the sample clip?
Yes - i've checked it a few minutes ago...Script:
setmemorymax(1024)
LoadPlugin("E:\Video\Tools\AVISYNTH\32\Plugins\dgdecode.dll")
LoadPlugin("E:\Video\Tools\AVISYNTH\32\Plugins\avisynth_c.dll")
LoadCPlugin("E:\Video\Tools\AVISYNTH\32\Plugins\smartdecimate.dll")
mpeg2source("E:\Video\HD\Berserk_Forces_Full_Version.d2v",cpu=6,iPP=true)
assumebff()
smartdecimate()
It works satisfying. I see nearly no combing at all and the movie is somewhat "fluid"...a few last artifacts are visible (noise/blocks/aliasing) which can be easily removed via the known filters.
It may be improved with your bobber, DGBOB(add: "LoadPlugin("E:\Video\Tools\AVISYNTH\32\Plugins\dgbob.dll")"):
b=dgbob(order=0)
smartdecimate(bob=b)
other parameters of smartdecimate may be tweaked to get improvement...refer to manual
Target Framerate is: 23.976 FPS
Try it - you'll like it...although it is not perfect , it is okay...
Motenai Yoda
11th September 2010, 13:14
Pal? I said r1 _http://en.wikipedia.org/wiki/DVD_region_code...
try:
MPEG2Source("Berserk_Forces_Full_Version.d2v", cpu=0)
crop(8,0,-8,-0)
telecide(post=0,chroma=false)
tdeint(tryweave=true,cthresh=4,hints=false,chroma=false)
tdecimate(mode=1,chroma=false)
#u should put any mod4/mod8/mod16 filters here (eg fft3dgpu)
crop(0,0,-2,0)
#other filters
it's shit of the shit... r1 remastered relase is bad but is much more better
Aevell
11th September 2010, 18:54
This fixed most of chroma blending in the sample. Though I have no idea how to make it more accurate on scenechanges.
P.S. I used GRunT (http://forum.doom9.org/showthread.php?t=139337) instead of common runtime functions.
MPEG2Source("C:\Berserk_Forces_Full_Version.d2v", cpu=0)
clip1=last
sep=clip1.separatefields
show=false
even=sep.selecteven
odd=sep.selectodd
chroma1=odd.tweak(cont=0)
chroma2=even.tweak(cont=0)
next_even=even.trim(1,0)
next_odd=odd.trim(1,0)
previous_even=even.Trim(0,-1)+even
previous_odd=odd.Trim(0,-1)+odd
fix_odd=mt_lutxy(odd,previous_odd,"-0.5 y * x + 2 *",y=1,v=3,u=3)
fix_even=mt_lutxy(even,next_even,"-0.5 y * x + 2 *",y=1,v=3,u=3)
fix=mt_average(fix_odd,fix_even,y=1,v=3,u=3)
result1=odd.mergechroma(fix_odd)
result2=even.mergechroma(fix_even)
full_result1=interleave(result1,even.mergechroma(previous_even)).weave()
full_result2=interleave(odd.mergechroma(next_odd),result2).weave()
c= clip1
c= Gconditionalfilter(c, full_result1, c, "combed", "=", "20")
c= Gconditionalfilter(c, full_result2, c, "metrix", ">", "25")
c= (show==true) ? GScriptClip(c, """subtitle(string(metrix))""") : c
c= GFrameEvaluate (c, "
combed = (Cfielddiff(clip1) > 250000 ) ? 20 : 0
Pmbottom = (Cfielddiff(clip1.Trim(0,-1)+clip1) > 400000 ) ? 6 : 0
scene1 = (Cfielddiff(clip1.Trim(0,-1)+clip1) < 250000) ? 2 : 0
scene2 = (YDifferenceFromPrevious(clip1) > 25) ? 2 : 0
scene3 = (Cfielddiff(clip1.Trim(1,0)) < 250000) ? 2 : 0
scene4 = (YDifferenceToNext(clip1) > 25) ? -6 : 0
metrix = combed + pmbottom +scene1 + scene2 + scene3 + scene4
",args="clip1")
return c.tfm(pp=0).tdecimate()
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.