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. |
![]() |
#1281 | Link |
Registered User
Join Date: Nov 2009
Posts: 2,375
|
Yes I know, but as I was suggested you can help the rounding by declaring more float values or like in the example I posted adding or substracting epsilon
I would like to know where I can read more about this, precisely related to the Expr rounding method, and if this also affects summation and not only multiplications.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread |
![]() |
![]() |
![]() |
#1282 | Link |
Registered User
Join Date: Nov 2009
Location: France
Posts: 21
|
On https://avs-plus.net/, at the bottom of the page, "You can find us on our Doom9 thread" links to the old thread instead of the new one.
|
![]() |
![]() |
![]() |
#1283 | Link |
Registered User
Join Date: Nov 2009
Posts: 2,375
|
Since mid-grey in YUV (128) is not centered within the range (16-235), is it ok that range conversions don't keep mid-grey? Converting from TV range 128 to PC range leads to 130, and the opposite to 126. Shouldn't we compensate for that?
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread |
![]() |
![]() |
![]() |
#1285 | Link |
Registered User
Join Date: Nov 2009
Posts: 2,375
|
I thought mid-grey for PC levels was also 128, at least for sRGB. I wasn't talking about scene referred middle grey.
Here's a little experiment, ColorYUV "correctly" converts mid grey to PC range 130, but then when converting that to RGB it keeps 130 when RGB mid-grey is known to be 128 for sRGB. Code:
BlankClip(width=256,height=256,color=$828282,pixel_type="YV12") ColorYUV(levels="TV->PC",matrix="Rec709") ConvertToPlanarRGB(matrix="PC.709")
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread |
![]() |
![]() |
![]() |
#1286 | Link |
Registered User
Join Date: Jul 2018
Posts: 1,320
|
Can Avisynth+ support sequential function calling in scripting with freeing memory after each return ? I trying to make full-frame 1080p (and need 2160p) rasterizer of text for shifting with Animate(). Text is rendered with Subtitle and 100x SSAA with small blocks, but number of blocks is about 12 and system died with swapping at 4 GB memory PC. I think it is because all calls to function with Subtitle() and Overlay() are performed in parallel for each frame ? May exist solution for serializing ?
I can not even fill 1080p frame with text - I trying to render blocks of 132 lines into raw files for later stacking. Current script: Code:
LoadPlugin("plugins_JPSDR.dll") function Ast1(clip c, int iFontSize, string strText, string strFont, float fHPos, int iVPos) { iHSubPos=fHPos*10 - (10*Int(fHPos)) temp=BlankClip(c, width=8000, height=(iFontSize*15)+40, color=$101010) temp=Subtitle(temp, strText, x=iHSubPos, font=strFont, size=iFontSize*10, align=4, halo_color=$FF000000, text_color=$00e0e0e0) temp=UserDefined2ResizeMT(temp, temp.width/10, temp.height/10, b=130,c=23) return Overlay(c, temp, Int(fHPos), iVPos) } function Ast2(clip c, int iFontSize, string strText, string strFont, float fHPos, int iVPos) { iHSubPos=fHPos*10 - (10*Int(fHPos)) temp=BlankClip(c, width=8000, height=(iFontSize*15)+60, color=$101010) temp=Subtitle(temp, strText, x=iHSubPos, font=strFont, size=iFontSize*10, align=4, halo_color=$FF000000, text_color=$00e0e0e0) temp=UserDefined2ResizeMT(temp, temp.width/10, temp.height/10, b=95,c=-10) return Overlay(c, temp, Int(fHPos), iVPos) } function MyFullFrameTextH(clip c, string strText, float fHPos, int iVShift) { c=Ast1(c, 10, strText, "Arial", fHPos + 10, iVShift + 20) c=Ast1(c, 10, strText, "Times New Roman", fHPos + 70, iVShift + 20) c=Ast1(c, 10, strText, "Wolfgang Amadeus Mozart", fHPos + 130, iVShift + 20) c=Ast1(c, 20, strText, "Arial", fHPos + 180, iVShift + 20) c=Ast1(c, 20, strText, "Times New Roman", fHPos + 300, iVShift + 20) c=Ast1(c, 20, strText, "Wolfgang Amadeus Mozart", fHPos + 410, iVShift + 20) c=Ast1(c, 35, strText, "Arial", fHPos + 490, iVShift + 20) c=Ast1(c, 35, strText, "Times New Roman", fHPos + 690, iVShift + 20) c=Ast1(c, 35, strText, "Wolfgang Amadeus Mozart", fHPos + 880, iVShift + 20) c=Ast1(c, 50, strText, "Arial", fHPos + 1000, iVShift + 20) c=Ast1(c, 50, strText, "Times New Roman", fHPos + 1280, iVShift + 20) c=Ast1(c, 50, strText, "Wolfgang Amadeus Mozart", fHPos + 1550, iVShift + 20) c=Ast2(c, 10, strText, "Arial", fHPos + 10, iVShift + 80) c=Ast2(c, 10, strText, "Times New Roman", fHPos + 70, iVShift + 80) c=Ast2(c, 10, strText, "Wolfgang Amadeus Mozart", fHPos + 130, iVShift + 80) c=Ast2(c, 20, strText, "Arial", fHPos + 180, iVShift + 80) c=Ast2(c, 20, strText, "Times New Roman", fHPos + 300, iVShift + 80) c=Ast2(c, 20, strText, "Wolfgang Amadeus Mozart", fHPos + 410, iVShift + 80) c=Ast2(c, 35, strText, "Arial", fHPos + 490, iVShift + 80) c=Ast2(c, 35, strText, "Times New Roman", fHPos + 690, iVShift + 80) c=Ast2(c, 35, strText, "Wolfgang Amadeus Mozart", fHPos + 880, iVShift + 80) c=Ast2(c, 50, strText, "Arial", fHPos + 1000, iVShift + 80) c=Ast2(c, 50, strText, "Times New Roman", fHPos + 1280, iVShift + 80) c=Ast2(c, 50, strText, "Wolfgang Amadeus Mozart", fHPos + 1550, iVShift + 80) return c } function MyFullFrameTextH_upper(clip c, string strText, float fHPos, int iVShift) { c=Ast1(c, 10, strText, "Arial", fHPos + 10, iVShift + 20) c=Ast1(c, 10, strText, "Times New Roman", fHPos + 70, iVShift + 20) c=Ast1(c, 10, strText, "Wolfgang Amadeus Mozart", fHPos + 130, iVShift + 20) c=Ast1(c, 20, strText, "Arial", fHPos + 180, iVShift + 20) c=Ast1(c, 20, strText, "Times New Roman", fHPos + 300, iVShift + 20) c=Ast1(c, 20, strText, "Wolfgang Amadeus Mozart", fHPos + 410, iVShift + 20) c=Ast1(c, 35, strText, "Arial", fHPos + 490, iVShift + 20) c=Ast1(c, 35, strText, "Times New Roman", fHPos + 690, iVShift + 20) c=Ast1(c, 35, strText, "Wolfgang Amadeus Mozart", fHPos + 880, iVShift + 20) c=Ast1(c, 50, strText, "Arial", fHPos + 1000, iVShift + 20) c=Ast1(c, 50, strText, "Times New Roman", fHPos + 1280, iVShift + 20) c=Ast1(c, 50, strText, "Wolfgang Amadeus Mozart", fHPos + 1550, iVShift + 20) return c } function MyFullFrameTextH_lower(clip c, string strText, float fHPos, int iVShift) { c=Ast2(c, 10, strText, "Arial", fHPos + 10, iVShift + 80) c=Ast2(c, 10, strText, "Times New Roman", fHPos + 70, iVShift + 80) c=Ast2(c, 10, strText, "Wolfgang Amadeus Mozart", fHPos + 130, iVShift + 80) c=Ast2(c, 20, strText, "Arial", fHPos + 180, iVShift + 80) c=Ast2(c, 20, strText, "Times New Roman", fHPos + 300, iVShift + 80) c=Ast2(c, 20, strText, "Wolfgang Amadeus Mozart", fHPos + 410, iVShift + 80) c=Ast2(c, 35, strText, "Arial", fHPos + 490, iVShift + 80) c=Ast2(c, 35, strText, "Times New Roman", fHPos + 690, iVShift + 80) c=Ast2(c, 35, strText, "Wolfgang Amadeus Mozart", fHPos + 880, iVShift + 80) c=Ast2(c, 50, strText, "Arial", fHPos + 1000, iVShift + 80) c=Ast2(c, 50, strText, "Times New Roman", fHPos + 1280, iVShift + 80) c=Ast2(c, 50, strText, "Wolfgang Amadeus Mozart", fHPos + 1550, iVShift + 80) return c } function MyAnimFF(clip c, float fHPos, int VPos) { temp=MyFullFrameTextH_upper(c, " TXT Sample ", fHPos, VPos) return MyFullFrameTextH_lower(temp, " TXT Sample ", fHPos, VPos) # MyFullFrameTextH(c, " TXT Sample ", fHPos, VPos) } full=BlankClip(501,1920,135,"Y16",fps=25, color=$101010) Animate(full, 1,500, "MyAnimFF", 50, 0, 1, 0) ConvertToRGB24() Last edited by DTL; 7th September 2021 at 22:43. |
![]() |
![]() |
![]() |
#1287 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,625
|
Quote:
But if you use that assumption , and defining "middle grey" in sRGB as 128,128,128, shouldn't you should start with sRGB ? RGB 128,128,128 => Y 126 in limited range, Y 128 in full range So how are you defining "middle grey" in Y ? Code:
BlankClip(width=256,height=256, color=$808080, pixel_type="RGB24") ConvertToYV12(matrix="Rec709") ColorYUV(levels="TV->PC",matrix="Rec709") ConvertToPlanarRGB(matrix="PC.709") |
|
![]() |
![]() |
![]() |
#1288 | Link |
Registered User
Join Date: Nov 2009
Posts: 2,375
|
Well, YUV can also be sRGB (aka PC.709), so it wasn't a fault on my part, but reading on YCbCr I concluded that Y middle grey is actually 125.5.
Coming from analog (full range) RGB where 0.5 is asummed to be middle grey and converting to YUV by 0.5*(235-16)+16 = 125.5 This actually correctly transforms to 127.5 in PC range.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread |
![]() |
![]() |
![]() |
#1289 | Link |
Registered User
Join Date: Nov 2009
Posts: 2,375
|
Can this be fixed? Expr() gets the variables mixed in the first example.
Code:
Expr("x[0,0] M^ x[1,0] N^ x[2,0] O^ M N + WA@ O + WB@ N - WB WA + + 4 /","") Expr("x[0,0] M^ x[1,0] N^ x[2,0] O^ M N + W@ O + X@ N - X W + + 4 /","")
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread |
![]() |
![]() |
![]() |
#1290 | Link | |
Registered User
Join Date: Jan 2014
Posts: 2,473
|
Quote:
EDIT: there was a bug with handling multi-letter parameter names ended with @. Fix is coming soon Last edited by pinterf; 11th September 2021 at 07:21. |
|
![]() |
![]() |
![]() |
#1292 | Link |
Registered User
Join Date: Mar 2012
Location: Texas
Posts: 1,675
|
Pinterf,
I found a bug in Overlay when the bitdepth is 16 and opacity is less than 1. Happens in RGB and YUV but the problem goes away at any other lower bitdepths. Code:
base = Blankclip(width=270, height=69, color=$FFFFFF, pixel_type="YUV444P16") over = Blankclip(width=270, height=19, color=$FF0000, pixel_type="YUV444P16") mask = ExtractY(over).mt_lutspa(mode="relative", expr="x range_max *") Overlay(base, over, mask=mask, x=0, y=3, mode="blend", opacity=.75) |
![]() |
![]() |
![]() |
#1293 | Link | |
Registered User
Join Date: Jan 2014
Posts: 2,473
|
Quote:
edit: issue emerges from SSE4.1 and up Last edited by pinterf; 11th September 2021 at 09:52. |
|
![]() |
![]() |
![]() |
#1294 | Link |
Registered User
Join Date: Mar 2012
Location: Texas
Posts: 1,675
|
Intel i7 4930k. Let me update to the latest test version avs+. I have 3.7 installed right now.
Edit: ![]() Edit 2: Still the same behavior with latest test version and setting SetMaxCPU("sse3") or less fixes the problem. Last edited by Reel.Deel; 11th September 2021 at 10:18. |
![]() |
![]() |
![]() |
#1297 | Link |
Registered User
Join Date: Nov 2009
Posts: 2,375
|
Thank you! It was hard to work around it, I will test new version and if it works it allows for great optimizations in Expr()
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread |
![]() |
![]() |
![]() |
#1298 | Link | |
Registered User
Join Date: Mar 2012
Location: Texas
Posts: 1,675
|
Quote:
|
|
![]() |
![]() |
![]() |
#1299 | Link | |
Registered User
Join Date: Jan 2014
Posts: 2,473
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#1300 | Link | |
Registered User
Join Date: Mar 2012
Location: Texas
Posts: 1,675
|
Quote:
![]() ---- I think I found another discrepancy. Using the color presets from here I cannot get the same results in Blankclip; it returns a different color. Code:
Blankclip(width=132, height=152, color=$9400D3, pixel_type="rgb24") # color_darkviolet |
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|