Log in

View Full Version : Weird pink stuff


StainlessS
29th July 2021, 02:27
What is this down to,


Avisource("SH_2_secs.avi.avi")
ConvertToYV24
#ConvertToRGB24
O=Last

G=GeneralConvolution(0, "
1 0 1
2 4 2
1 0 1
")

B=O.Blur(1.58,-1.0) # H-BLUR, V-SHARP

AMP=TRUE
D1=ClipDelta(G,O,amp=AMP)
D2=ClipDelta(B,O,amp=AMP)
StackVertical(D1,D2)
Return last

# Return Clip Difference of input clips (amp==true = Amplified, show==true = show background)
Function ClipDelta(clip clip1,clip clip2,bool "amp",bool "show") {
amp=Default(amp,false)
show=Default(show,false)
c2=clip1.levels(128-32,1.0,128+32,128-32,128+32).greyscale()
c1=clip1.subtract(clip2)
c1=(amp)?c1.levels(127,1.0,129,0,255):c1
return (show)?c1.Merge(c2):c1
}


click Me
https://i.postimg.cc/LJKF6jHr/b-00.jpg (https://postimg.cc/LJKF6jHr)

Something to do with MPEG-2 chroma placement, or sharpen bug, or other ???
EDIT: All diffs are amp'ed to max, but still it seems a bit weird.

EDIT:
Above

B=O.Blur(1.58,-1.0) # H-BLUR, V-SHARP


below

B=O.Blur(1.58,-0.99) # H-BLUR, V-SHARP

https://i.postimg.cc/Sj3wDczJ/b-02.jpg (https://postimg.cc/Sj3wDczJ)

Looks like avs+ bug

EDIT: below is pink

B=O.Blur(1.58,-0.999) # H-BLUR, V-SHARP


EDIT: Think its probably my fault. Also maybe should have switched off coring, investigating.

# Removing Show stuff
Function ClipDelta(clip clip1,clip clip2,bool "amp") {
amp=Default(amp,false)
# Y centered on TV levels mid point [Round(((16+235)/2.0)) = 126]
c1=clip1.subtract(clip2)
return (amp) ? c1.levels(125,1.0,127,0,255,coring=false) : c1
}

StainlessS
29th July 2021, 06:07
This here pink stuff is defo a bit wrong.

Colorbars(Pixel_type="YV12")
convertBits(32)
return ColorYUV(levels="TV->PC").ConvertToRGB32

https://i.postimg.cc/D8spyDpc/b-03.jpg (https://postimg.cc/D8spyDpc)

EDIT: Added ConvertToRGB32 at end of script, still does it in both Vdub2 and Potplayer.

EDIT: Switched to PC->TV

Colorbars(Pixel_type="YV12")
convertBits(32)
GreyScale
ColorYUV(levels="PC->TV")
Return Last.ConvertToRGB32

https://i.postimg.cc/7fYnJZVX/b-00.jpg (https://postimg.cc/7fYnJZVX)
Maybe old code where chroma gray was 0.5.

EDIT: as first one with Greyscale before ColoYUV

Colorbars(Pixel_type="YV12")
convertBits(32)
GreyScale
ColorYUV(levels="TV->PC")
#ColorYUV(levels="PC->TV")
Return Last.ConvertToRGB32

https://i.postimg.cc/grGv12fd/b-01.jpg (https://postimg.cc/grGv12fd)

Reel.Deel
29th July 2021, 07:59
This here pink stuff is defo a bit wrong.

Colorbars(Pixel_type="YV12")
convertBits(32)
return ColorYUV(levels="TV->PC").ConvertToRGB32



The culprit is ColorYUV, the wiki kinda mentions it supports it but I'm not sure. If you remove ColorYUV(levels="TV->PC") then the output is correct. It's also correct if you change to convertBits(16).

Sharc
29th July 2021, 09:59
Something similar as discussed here?
https://forum.doom9.org/showthread.php?p=1947029#post1947029

StainlessS
29th July 2021, 16:23
Thanks guys, I shoulda pointed out that only affects 32 bit ColorYUV.