PDA

View Full Version : Problem with shifted chroma


McCauley
31st July 2008, 22:32
Hi,

i have a problem with some interlaced footage from a DVD i'm trying to encode.
The chroma is shifted four pixels to the right, see the sample (http://www.mediafire.com/?xm7zl8jwjde).

It shouldn't be hard to fix that, but i found nothing in the Avisynth docs and on the forums.

Looking forward to help on this.

Regards and thanks in advance
McCauuley

martino
31st July 2008, 22:45
ChromaShift (http://www.geocities.com/siwalters_uk/chromashift.html)

IanB
31st July 2008, 23:54
And if you need sub-pixel accuracy in the movement :-X=3.2 # Move chroma left 3.2 pixels
Y=-1.6 # Move chroma down 1.6 pixels
MergeChroma(Spline16Resize(Width(), Height(), X, Y, Width()+X, Height()+Y))

McCauley
1st August 2008, 17:52
Thanks for the fast replies to both of you, i will try it when getting home.

Regards
McCauley

McCauley
13th February 2009, 20:46
Can i add that to wiki, or have i missed something?


#ChromaShift_SP: Shift chroma with subpixel accuracy

function ChromaShift_SP (clip clp, float "X",float "Y") {

X = default(X, 0.0) # positive values shift the chroma to left, negative values to right
Y = default(Y, 0.0) # positive values shift the chroma upwards, negative values downwards

w = clp.Width()
h = clp.Height()

clp.MergeChroma(clp.Spline16Resize(w, h, X, Y, w+X, h+Y)) }

Regards
McCauley