Log in

View Full Version : Wrong colorspace? YV12 problems.


Arshad07
18th September 2009, 04:51
Script:

SetMtMode(2)
LoadPlugin("D:\Encode\mvtools-v1.11.4.5\mvtools.dll")
LoadPlugin("D:\Encode\MaskTools.dll")
LoadPlugin("D:\Encode\medianblur084\medianblur.dll")
LoadPlugin("D:\Encode\ReduceFlicker\ReduceFlicker.dll")
LoadPlugin("D:\Encode\ReduceFlicker\ReduceFlickerSSE2.dll")
LoadPlugin("D:\Encode\ReduceFlicker\ReduceFlickerSSE3.dll")
LoadPlugin("D:\Encode\EEDI2v092\EEDI2\EEDI2.dll")
Import("D:\Encode\plugins\plugins\MCBob.avsi")
LoadPlugin("D:\Encode\mvtools2.dll")
Import("D:\Encode\YLevels_mt.avsi")
Load_Stdcall_Plugin("C:\Program Files (x86)\megui\tools\yadif\yadif.dll")
Clip=AVISource("C:\Users\Arsha\Desktop\lag_phir kabhi.avi", audio=false)
ConvertToYUY2(clip, matrix="rec709")
crop( 2, 2, 0, 0)
Addborders(0,64,0,64)
Spline64Resize(720,480) # Spline64 (Sharp)
SetMtMode(2)
YLevels(4, 1, 255, 0, 255)
Tweak(hue=0.0, sat=1.05, bright=0, cont=.97, coring=true, sse=false)
mdegrain2i2(4,0)
LimitedSharpenFaster(ss_x=1.5, ss_y=1.5, dest_x=last.width, dest_y=last.height, Smode=3, strength=40, radius=2, Lmode=1, wide=false, overshoot=1, edgemode=0, special=false, exborder=0)


http://i32.tinypic.com/2rc5xr7.jpg

What am i doing wrong? :confused:

thewebchat
18th September 2009, 04:56
I'm not entirely sure what planar means, but the default YUY2 configuration is called "interleaved." Perhaps you need to use Interleaved2Planar() from RemoveGrain to change the color format (and specify a planar=true tag somewhere). Alternatively, you could convert to YV12 instead of YUY2.

Arshad07
18th September 2009, 05:02
Works now! :yahoo:

Gavino
18th September 2009, 08:36
I'm not entirely sure what planar means
http://avisynth.org/mediawiki/Planar

Didée
18th September 2009, 08:44
Mdegrain2i2 is a function to be used on interlaced footage.

May I ask, what is the reason you use mdegrain2i2() ?

Arshad07
18th September 2009, 09:56
^ Cant it be used on progressive footage? Even for MDegrain2, it says to be used on interlaced video.

Didée
18th September 2009, 10:07
If your source is progressive, then it's suboptimal to use a denoiser made for interlaced input. For progressive content it's definetly better to use a denoiser made for progressive input.

Let's hope that your source really is progressive ...

Arshad07
18th September 2009, 10:17
^ Like what? MDegrain 1?

Source is field blended. I used Yadif as bobber and SRestore to create a lag. But there are still ghosting left. Then I applied the above script to my lag. So cant say if its progressive or not.

Didée
18th September 2009, 11:38
Like MDegrain1. Or like MDegrain2. Or like MDegrain3. It doesn't matter. The point is that denoising for a progressive clip, denoising the fields independendly is suboptimal.

Open mouth, here comes the spoon:

function MDegrain2p2(clip source, int "overlap", int "dct")
{
overlap=default(overlap,0) # overlap value (0 to 4 for blksize=8)
dct=default(dct,0) # use dct=1 for clip with light flicker
super = source.MSuper()
backward_vec2 = super.MAnalyse(isb = true, delta = 2, overlap=overlap, dct=dct)
forward_vec2 = super.MAnalyse(isb = false, delta = 2, overlap=overlap, dct=dct)
backward_vec4 = super.MAnalyse(isb = true, delta = 4, overlap=overlap, dct=dct)
forward_vec4 = super.MAnalyse(isb = false, delta = 4, overlap=overlap, dct=dct)
source.MDegrain2(super, backward_vec2,forward_vec2,backward_vec4,forward_vec4,thSAD=400)
}

And yes, after SRestore your clip is progressive. There is nothing (reasonable) that you could do against the remaining ghosting. Remember that in some other thread I told you sth about "over-blending"? There are plenty of two-blends-in-a-row, probably caused by some temporal denoiser (those can easily get irritated by the blended fields, considering some differences as "small enough" to get averaged, when in fact they should not.)

Again, there's nothing to do about those remaining blends: "Crap in, crap out."
(Well you could YATTA the whole clip to manually select only clean fields. Takes only a week or so, and you are done ...)

EuropeanMan
19th September 2009, 05:30
^ I love the FINE PRINT at the END...I love Yatta :lol: but yes...give me 2 weeks and I'm done on my system.

Arshad07
27th September 2009, 21:59
http://i33.tinypic.com/ejde0w.jpg

import("D:\Encode\LSFmod.v1.8.avsi")
import("D:\Encode\MCTemporalDenoise.v1.3.00.avsi")
Import("D:\Encode\YLevels_mt.avsi")
Import("D:\Encode\plugins\plugins\MCBob.avsi")
LoadPlugin("D:\Encode\mvtools-v1.11.4.5\mvtools.dll")
LoadPlugin("D:\Encode\fft3dfilter211\FFT3DFilter.dll")
LoadPlugin("D:\Encode\MaskTools.dll")
LoadPlugin("D:\Encode\gradfun2db_25_dll_20060315\gradfun2db\gradfun2db.dll")
LoadPlugin("D:\Encode\medianblur084\medianblur.dll")
LoadPlugin("D:\Encode\ReduceFlicker\ReduceFlicker.dll")
LoadPlugin("D:\Encode\ReduceFlicker\ReduceFlickerSSE2.dll")
LoadPlugin("D:\Encode\ReduceFlicker\ReduceFlickerSSE3.dll")
LoadPlugin("D:\Encode\EEDI2v092\EEDI2\EEDI2.dll")
LoadPlugin("D:\Encode\mvtools2.dll")
Load_Stdcall_Plugin("C:\Program Files (x86)\megui\tools\yadif\yadif.dll")
clip=AVCSource("C:\Users\Arshad\Desktop\TROTF.dga")
ConvertToYV12(clip)
YLevels(10, 1, 255, 0, 255)
Tweak(hue=0.0, sat=1.2, bright=0, cont=.97, coring=true, sse=false)
MCTemporalDenoise(settings="high")
LimitedSharpenFaster(ss_x=1.5, ss_y=1.5, dest_x=last.width, dest_y=last.height, Smode=3, strength=80, radius=2, Lmode=1, wide=false, overshoot=1, edgemode=0, special=false, exborder=0)

I am not even croppping :confused:.Any help please.

thewebchat
27th September 2009, 22:13
The error message states that the problem lies in MCTemporalDenoise. At line 991, to be precise. This line:

o = PP.crop(xf/2,yf/2,-xf/2,-yf/2)

From a quick glance at the MCTD script, it seems that xf and yf are some kind of resolution values generated by this fragment near the beginning:

mod = (bwbh>=blksize) ? bwbh : blksize
xi = i.width()
xf = ceil(xi/float(mod))*mod - xi + mod
xn = int(xi+xf)
yi = i.height()
yf = ceil(yi/float(mod))*mod - yi + mod
yn = int(yi+yf)

For YV12 content, this crop line can only succeed if the values of xf and yf are divisible by 4. I see that xf and yf are restricted to values that are multiples of mod. It seems that mod is either bwbh or blksize, whichever is larger. Make sure that both of these are divisible by 4.

Arshad07
27th September 2009, 22:41
Thank you^! It works now!