Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = AVISource("YUY2-Doom.avi")
- #Seperate YUV to Y, U, V Channel
- Y=ColorYUV(n,off_u=-256, off_v=-256).ColorYUV(off_u=128, off_v=128)
- U=UtoY(n)
- V=VtoY(n)
- #Shifting U
- downU = 0
- upU = 0
- leftU = 0
- rightU = 0
- #Shifting V
- downV = 0
- upV = 0
- leftV = 0
- rightV = 0
- #Shifting U
- down2U = 0
- up2U = 0
- left2U = 0
- right2U = 0
- #Shifting V
- down2V = 0
- up2V = 0
- left2V = 0
- right2V = 0
- #Convert to YV24 for Shifting 1px to right or left
- U = U.ConvertToYV24()
- V = V.ConvertToYV24()
- #New UV Shifting
- U1 = U.AddBorders(leftU, downU, rightU, upU, color=$000000).Crop(rightU, upU,-leftU,-downU).ConvertToYUY2()
- V1 = V.AddBorders(leftV, downV, rightV, upV, color=$000000).Crop(rightV, upV,-leftV,-downV).ConvertToYUY2()
- #Copy UV Shifting
- U2 = U.AddBorders(leftU+left2U, downU+down2U, rightU+right2U, upU+up2U, color=$000000).Crop(rightU+right2U, upU+up2U,-(leftU+left2U),-(downU-down2U)).ConvertToYUY2()
- V2 = V.AddBorders(leftV+left2V, downV+down2V, rightV+right2V, upV+up2V, color=$000000).Crop(rightV+right2V, upV+up2V,-(leftV+left2V),-(downV-down2V)).ConvertToYUY2()
- #Mix Colors from U1 and V1 with U2 and V2
- Yhalf = Y.PointResize(U.width, U.height)
- U = Overlay(U1, U2, mask=Yhalf, mode="blend")
- V = Overlay(V1, V2, mask=Yhalf, mode="blend")
- #Convert back to YUY2
- Resize_faktor = 1
- U = U.PointResize(int(U.width / Resize_faktor), int(U.height / Resize_faktor)).PointResize(U.width, U.height)
- V = V.PointResize(int(V.width / Resize_faktor), int(V.height / Resize_faktor)).PointResize(V.width, V.height)
- U = U.ConvertToYUY2()
- V = V.ConvertToYUY2()
- #Merge all YUV Channels
- YToUV(U, V, Y)
- ### AvsP marked script ###
- # n = AVISource("YUY2-Doom.avi")
- #
- # #Seperate YUV to Y, U, V Channel
- # Y=ColorYUV(n,off_u=-256, off_v=-256).ColorYUV(off_u=128, off_v=128)
- # U=UtoY(n)
- # V=VtoY(n)
- #
- # #Shifting U
- # [<separator="Shifting U1">]
- # downU = [<"U1 - Down", 0, 1280, 0>]
- # upU = [<"U1 - Up", 0, 1280, 0>]
- # leftU = [<"U1 - Left", 0, 1600, 0>]
- # rightU = [<"U1 - Right", 0, 1600, 0>]
- #
- # #Shifting V
- # [<separator="Shifting V1">]
- # downV = [<"V1 - Down", 0, 1280, 0>]
- # upV = [<"V1 - Up", 0, 1280, 0>]
- # leftV = [<"V1 - Left", 0, 1600, 0>]
- # rightV = [<"V1 - Right", 0, 1600, 0>]
- #
- # #Shifting U
- # [<separator="Shifting U2">]
- # down2U = [<"U2 - Down", 0, 1280, 0>]
- # up2U = [<"U2 - Up", 0, 1280, 0>]
- # left2U = [<"U2 - Left", 0, 1600, 0>]
- # right2U = [<"U2 - Right", 0, 1600, 0>]
- #
- # #Shifting V
- # [<separator="Shifting V2">]
- # down2V = [<"V2 - Down", 0, 1280, 0>]
- # up2V = [<"V2 - Up", 0, 1280, 0>]
- # left2V = [<"V2 - Left", 0, 1600, 0>]
- # right2V = [<"V2 - Right", 0, 1600, 0>]
- #
- # #Convert to YV24 for Shifting 1px to right or left
- # U = U.ConvertToYV24()
- # V = V.ConvertToYV24()
- #
- # #New UV Shifting
- # U1 = U.AddBorders(leftU, downU, rightU, upU, color=$000000).Crop(rightU, upU,-leftU,-downU).ConvertToYUY2()
- # V1 = V.AddBorders(leftV, downV, rightV, upV, color=$000000).Crop(rightV, upV,-leftV,-downV).ConvertToYUY2()
- #
- # #Copy UV Shifting
- # U2 = U.AddBorders(leftU+left2U, downU+down2U, rightU+right2U, upU+up2U, color=$000000).Crop(rightU+right2U, upU+up2U,-(leftU+left2U),-(downU-down2U)).ConvertToYUY2()
- # V2 = V.AddBorders(leftV+left2V, downV+down2V, rightV+right2V, upV+up2V, color=$000000).Crop(rightV+right2V, upV+up2V,-(leftV+left2V),-(downV-down2V)).ConvertToYUY2()
- #
- # #Mix Colors from U1 and V1 with U2 and V2
- # Yhalf = Y.PointResize(U.width, U.height)
- # U = Overlay(U1, U2, mask=Yhalf, mode="blend")
- # V = Overlay(V1, V2, mask=Yhalf, mode="blend")
- #
- # #Convert back to YUY2
- # Resize_faktor = 1
- # U = U.PointResize(int(U.width / Resize_faktor), int(U.height / Resize_faktor)).PointResize(U.width, U.height)
- # V = V.PointResize(int(V.width / Resize_faktor), int(V.height / Resize_faktor)).PointResize(V.width, V.height)
- # U = U.ConvertToYUY2()
- # V = V.ConvertToYUY2()
- #
- # #Merge all YUV Channels
- # YToUV(U, V, Y)
- ### AvsP marked script ###
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement