ChromaShift

From Avisynth wiki
Jump to: navigation, search
Abstract
Author Simon Walters
Version v2.7
Download chromashift27.zip
Category Chroma Correction
License GPLv2
Discussion Doom9 Thread

Contents

Description

This filter will shift the chrominance information (C == U and V together) or the U or the V separately, by an even number of pixels, in either horizontal direction. It can also apply an overall vertical shift of the total chrominance information, up or down. This applies to clips in YUY2 or YV12 colourspaces.

Wilbert Dijkhof has kindly modified it so that it can also be used to shift Red, Green or Blue colours independantly if the input to the filter is in RGB32 colourspace.

This filter is primarily intended to correct improper colour registration.

Requirements

  • AviSynth 2.5.8 or later
  • Supported color formats: RGB32, YUY2, YV12


Syntax and Parameters

ChromaShift (clip, int "C", int "U", int "V", int "L", int "R", int "G", int "B")


clip   =
Input clip.


int  C = 0
int  U = 0
int  V = 0
int  L = 0
Any non-even parameter value for C, U or V will throw an exception as chrominance information is only held once for every 2 pixels in a YUY2 bitmap frame.
L can be any value in YUY2 colourspace but must be even in YV12 colourspace. Any value for C, U, V or L will give an error if using RGB32 colourspace.


int  R = 0
int  G = 0
int  B = 0
Any value for R, G,orB will give an error if using YUY2 or YV12 colourspace.


Examples

Shift both U and V info left by 2 pixels and down by 2 lines.
Note U and/or V cannot be shifted by 1 pixel as each UV pair of values are tied to 4 pixels in YV12 colourspace. L cannot be shifted by a non-even number of lines in YV12 colourspace for the same reason.

AviSource("Blah.avi") # YV12 input
ChromaShift(C=-2,L=2)

Shift both U and V info left by 2 pixels and down by one line.
Note U and/or V cannot be shifted by 1 pixel as each UV pair of values are tied to 2 pixels in YUY2 colourspace.

AviSource("Blah.avi") # YUY2 input
ChromaShift(C=-2,L=1)

Shift Red info to the left by 2 pixels and Green info to the right by 1 pixel.

AviSource("Blah.avi") # RGB32 input
ChromaShift(R=-2,G=1)


Changelog

Version      Date            Changes
v2.7 11/04/2003 - YV12 handling added. v2.6a 11/04/2003 - RGB32 handling added in by Wilbert Dijkhof. v2.5 01/30/2003 – re-compiled to work with AviSynth 2.5. v1.2 09/14/2002 - added ability to shift left as well as right and removed the restriction on single use of the C, U or V parameters. Also, added the L (Line) parameter to shift vertically. Code sped up by not using a buffered frame. v1.1 09/13/2002 - added parameters and control over C,U and V. v1.0 09/10/2002 - First release for AviSynth 2.0


Archived Downloads

Version Download Mirror
v2.7 chromashift27.zip chromashift_25_dll_20031104.zip
v1.2 chromashift12.zip


External Links




Back to External Filters

Personal tools