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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 31st July 2008, 22:32   #1  |  Link
McCauley
Registered User
 
Join Date: Nov 2006
Posts: 83
Problem with shifted chroma

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.

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
McCauley is offline   Reply With Quote
Old 31st July 2008, 22:45   #2  |  Link
martino
masktools2 (ab)user
 
martino's Avatar
 
Join Date: Oct 2006
Location: PAL-I :(
Posts: 235
ChromaShift
martino is offline   Reply With Quote
Old 31st July 2008, 23:54   #3  |  Link
IanB
Avisynth Developer
 
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,171
And if you need sub-pixel accuracy in the movement :-
Code:
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))
IanB is offline   Reply With Quote
Old 1st August 2008, 17:52   #4  |  Link
McCauley
Registered User
 
Join Date: Nov 2006
Posts: 83
Thanks for the fast replies to both of you, i will try it when getting home.

Regards
McCauley
McCauley is offline   Reply With Quote
Old 13th February 2009, 20:46   #5  |  Link
McCauley
Registered User
 
Join Date: Nov 2006
Posts: 83
Can i add that to wiki, or have i missed something?

Code:
#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
McCauley is offline   Reply With Quote
Old 17th September 2018, 15:58   #6  |  Link
l33tmeatwad
Registered User
 
l33tmeatwad's Avatar
 
Join Date: Jun 2007
Posts: 153
I had a need to shift U and V separately so I modded ChromaShiftSP to allow that, figured I'd throw it in here in case anyone else needed it.

Code:
#ChromaShiftSP2: Shift U & V chroma separately with subpixel accuracy, based on the ChromaShiftSP function by IanB & McCauley

function ChromaShiftSP2 (clip clp, float "UX",float "UY", float "VX",float "VY", string "ResizeMethod") {

UX = default(UX, 0.0) # positive values shift the U chroma to left, negative values to right
UY = default(UY, 0.0) # positive values shift the U chroma upwards, negative values downwards
VX = default(VX, 0.0) # positive values shift the V chroma to left, negative values to right
VY = default(VY, 0.0) # positive values shift the V chroma upwards, negative values downwards
ResizeMethod = Default(ResizeMethod, "Spline36")

U = clp.UToY()
U = Eval("U." + ResizeMethod + "Resize(U.Width(), U.Height(), UX, UY, U.Width()+UX, U.Height()+UY)")

V = clp.VToY()
V = Eval("V." + ResizeMethod + "Resize(V.Width(), V.Height(), VX, VY, V.Width()+VX, V.Height()+VY)")


YToUV(U, V, clp) }
l33tmeatwad is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 19:57.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.