NoX1911
8th August 2011, 23:08
Hi,
this is a script to compare raw pixel differences divided into Y and UV (somewhat amplified). Greylevel pictures have been used (no difference = 128 luma [0..255]) that were inverted/added to get both "sides" of greylevel picture. I'm not 100% sure if its correct or can be optimized any further. Any ideas or suggestions?
http://www.abload.de/thumb/compare-quality---yuv-0jtc.jpg (http://www.abload.de/img/compare-quality---yuv-0jtc.jpg)
# Amplify
AmpYUV=2048
AmpY=8
##########
File1=FFVideoSource("Original.mp4")
File2=FFVideoSource("Compressed.mp4")
Diff=Subtract(File1,File2)
#Y
DiffY=Overlay(Diff,Diff.invert(),x=0,y=0,mode="lighten",opacity=1).ColorYUV(off_y=-128).Levels(0,1,256/AmpY,0,255,coring=false).greyscale()
#YUV
#DiffYUV=DiffY.MergeChroma(Diff.ColorYUV(cont_u=AmpYUV,cont_v=AmpYUV))
#UV
DiffYUV=Diff.ColorYUV(off_y=-255,cont_u=AmpYUV,cont_v=AmpYUV)
T=StackHorizontal(File1,File2)
B=StackHorizontal(DiffYUV,DiffY).ColorYUV(levels="PC->TV")
StackVertical(T,B)
this is a script to compare raw pixel differences divided into Y and UV (somewhat amplified). Greylevel pictures have been used (no difference = 128 luma [0..255]) that were inverted/added to get both "sides" of greylevel picture. I'm not 100% sure if its correct or can be optimized any further. Any ideas or suggestions?
http://www.abload.de/thumb/compare-quality---yuv-0jtc.jpg (http://www.abload.de/img/compare-quality---yuv-0jtc.jpg)
# Amplify
AmpYUV=2048
AmpY=8
##########
File1=FFVideoSource("Original.mp4")
File2=FFVideoSource("Compressed.mp4")
Diff=Subtract(File1,File2)
#Y
DiffY=Overlay(Diff,Diff.invert(),x=0,y=0,mode="lighten",opacity=1).ColorYUV(off_y=-128).Levels(0,1,256/AmpY,0,255,coring=false).greyscale()
#YUV
#DiffYUV=DiffY.MergeChroma(Diff.ColorYUV(cont_u=AmpYUV,cont_v=AmpYUV))
#UV
DiffYUV=Diff.ColorYUV(off_y=-255,cont_u=AmpYUV,cont_v=AmpYUV)
T=StackHorizontal(File1,File2)
B=StackHorizontal(DiffYUV,DiffY).ColorYUV(levels="PC->TV")
StackVertical(T,B)