Log in

View Full Version : What artifact is this and how to deal?


asmcarioca
16th March 2013, 04:30
i got a rare dvd and have many artifacts but i don't know this one...

https://dl.dropbox.com/u/103721838/zero.png

the colors are a little bit shifted to the right.

scharfis_brain
16th March 2013, 12:49
that's called chromashift and is easy to fix.

johnmeyer
16th March 2013, 19:41
This is a function I used inside of various scripts. It should give you a starting point for doing what you want to do. The one line you want to "steal" for your work is this one:

MergeChroma(fields,crop(fields,Hshift,Vshift,0,0).addborders(0,0,Hshift,Vshift)

You should get a good result starting with Hshift=2 and Vshift=0, but experiment with other values to see what works best.

Here's the entire function, but you probably don't need all the noise reduction stuff. As you can see, the overall function is designed for interlaced material (which is why you see the separatefields()/weave() combination).

function MDegrain2i2(clip source, int "blksize", int "overlap", int "dct")
{
Vshift=0 # 2 lines per bobbed-field per tape generation (PAL); original=2; copy=4 etc
Hshift=0 # determine experimentally
overlap=default(overlap,0) # overlap value (0 to 4 for blksize=8)
dct=default(dct,0) # use dct=1 for clip with light flicker

fields=source.SeparateFields() # separate by fields

#This line gets rid of chroma halo
fields=MergeChroma(fields,crop(fields,Hshift,Vshift,0,0).addborders(0,0,Hshift,Vshift))

#This line will shift chroma down and to the right instead of up and to the left -- use instead of line above
#fields=MergeChroma(fields,Crop(AddBorders(fields,Hshift,Vshift,0,0),0,0,-Hshift,-Vshift))

super = fields.MSuper(pel=2, sharp=1)
backward_vec2 = super.MAnalyse(isb = true, delta = 2, blksize=blksize, overlap=overlap, dct=dct)
forward_vec2 = super.MAnalyse(isb = false, delta = 2, blksize=blksize, overlap=overlap, dct=dct)
backward_vec4 = super.MAnalyse(isb = true, delta = 4, blksize=blksize, overlap=overlap, dct=dct)
forward_vec4 = super.MAnalyse(isb = false, delta = 4, blksize=blksize, overlap=overlap, dct=dct)

MDegrain2(fields,super, backward_vec2,forward_vec2,backward_vec4,forward_vec4,thSAD=400)

Weave()
}