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. |
21st February 2020, 18:00 | #41 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Quote:
If app has some flag set [Large Address Aware] then can have 3GB user space [1GB kernel]. Some systems cannot access about last 0.5 GB of RAM for some reason [hardware address mapping I think], not sure if that affects all systems, perhaps G2K4 likes to chime in. EDIT: OK, he did go BONG.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 27th February 2020 at 03:36. |
|
21st February 2020, 20:31 | #42 | Link | ||
Registered User
Join Date: Feb 2020
Posts: 11
|
Quote:
BTW will you have time to fix the problem with bottom-aligning text in SubtitleEx plugin? Quote:
|
||
21st February 2020, 23:19 | #43 | Link |
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
|
I did look at it and it depends on the font size. With smaller fonts there is no problem. I don't know how to fix this, maybe someone with more experience in device contexts and plugin development can have a go (Stainless?).
__________________
Groucho's Avisynth Stuff |
22nd February 2020, 19:54 | #44 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
G2K4,
How did you fix the original source, [did you use original Internal.h ? and what fixes for eg LPCWSTR]. I have zero knowledge of that wide character stuff, I've always avoided that like the plague, [given your profession it is unlikely that you are in the same boat]. I also know little of Std CPP library [never used since about 1997 EDIT: Actually ~April 1996] and absolutley nowt about CPP Std Template Library. If you post or PM your altered source, maybe I'll have a try, thanx.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 22nd February 2020 at 19:58. |
22nd February 2020, 20:29 | #45 | Link | |
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
|
Quote:
Edit - One more thing: I copied the PixelClip class definition from internal.h since it is not present in the AVS+ headers.
__________________
Groucho's Avisynth Stuff Last edited by Groucho2004; 22nd February 2020 at 20:39. |
|
24th February 2020, 15:12 | #46 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Thanks G2K4, I've got em, not had time to take a gander yet.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
25th February 2020, 21:22 | #47 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Mods to previously posted Japanese -> English translation of docs.
Code:
==================================== AVISynth plug-in SubTitleEx ==================================== Overview ---- AVISynth plug-in SubTitleEx Kai is a subtitle display plug-in for AVISynth 2.5. There are many enhancements over the AVISynth standard SubTitle. It was published on a currently closed site called "mVideo Utilities" Based on "SubTitleEx" created by Basilik Tournadski, Japanese characters are garbled It has been corrected. In addition, a function to set the presence / absence of line breaks and line spacing has been added. "SubTitleEx" had source code released in the past, but it is not available now, It happened that the source code was left in the Internet Archive. Based on "DVTimeStampEx" that incorporates SubTitleEx's character display engine, Created one with a function equivalent to "SubTitleEx". How to use ------ SubtitleEx.dll is added to the "Plugin" folder of the folder where AviSynth is installed. It can be used just by copying. All functions of the original SubtitleEx are implemented, and if some "useless characters" are included A garbled problem has been fixed. In addition, SubTitleEx breaks Parameters have been added. SubtitleEx( clip c, string text, int "x", int "y", int "firstframe", int "lastframe", string "font", string "effects", int "size", int "textcolor", int "halocolor" int "spc" int "linemargin" ) · Parameters of SubtitleEx -c Non optional clip. -text The text to display (Default ""). If you want to start a new line, write "|" at that point. -x The coordinates to display (Default c.Width * -0.11). If you specify minus, it will be from the right. -y The coordinates to display (Default c.Height * -0.17). If you specify minus, it will be from the bottom. -firstframe The number of the first frame to display (Default 0). -lastframe The number of the last frame to display (Default, Last frame of clip c). -font Specify the font name (Default "Arial"). -effects Specifies effects (Default "b"). If you specify more than one, write them together. b: Bold i: Italic u: Underline o: strikeOut/strikethrough f (number of frames in, number of frames out): fade-in / out m (start frame, start X, start Y, end frame, end X, end Y): motion w Line breaks with "|" are disabled. (Added by SubTitleEx Kai) c: Center (not sure that it works properly) n: No Anti Alias e: Alpha Emboss s: Alpha Blur g: Alpha Gaussian Blur l: Alpha Laplacian -size Font size (Default 36). -textcolor The text color (Default $FFFFFF). Alpha can also be specified. -halocolor The color of the text halo (Default $000000). Alpha can also be specified. -spc number Specify the character spacing. (Default 0, Added by SubTitleEx Kai) -linemargin number Specify the line spacing. (Default 0, Added by SubTitleEx Kai) NOTE, In original SubTitleEx Kai docs, spc and linemargin order was transposed (ie wrong). Effects "s" (Strikethrough) was wrong, should be "o" (strikeOut, as above). Effects "cnesgl" were all missing from doc (well 's' did Alpha Blur rather than StrikeThrough). EDIT: Above "nesgl" effects should perhaps be mutually exclusive. Notes -------- If you do not change the format to RGB32, etc., you may crash. In this case, convert the format. license ---------- The copyright and license for "AVISynth Plug-in SubTitleEx Kai" are Based on the original "SubTitleEx" and "DVTimeStampEx" by Basilik Tournadski. These plug-ins are copyrighted by Basilik Tournadski and are free software. Was published. However, since this plugin is completely unofficial, Do not contact the original author. Also, about this plugin, The original author and modified author do not take any responsibility. Modified author / distributor ------------------ Hoshiken (http://hosiken.jp/)
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 27th February 2020 at 03:59. Reason: update |
27th February 2020, 03:59 | #48 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Previous post updated/Added, in RED. [Prev update post deleted, below appended, ie BUMP]
Previously Un-documented Effects, Laplacian maybe does work ok, if big enough. EDIT: Code:
BlankClip(Color=$0000FF) SubtitleEx("STANDARD",x=0,y=0,effects="",Size=64) SubtitleEx("No ANTI-ALIAS",x=0,y=64,effects="n",Size=64) SubtitleEx("ALPHA EMBOSS",x=0,y=128,effects="e",Size=64) SubtitleEx("ALPHA BLUR",x=0,y=192,effects="s",Size=64) SubtitleEx("ALPHA GAUSSIAN",x=0,y=256,effects="g",Size=64) SubtitleEx("ALPHA LAPLACIAN",x=0,y=320,effects="l",Size=64)
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 27th February 2020 at 04:01. |
27th February 2020, 16:46 | #50 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
There is also difference between the two for Y=0 [original got it wrong maybe], try this with original and Kai dll's.
(Maybe Kai fix for Y=0, broke the bottom align thing) Code:
#LoadPlugin(".\subtitleEx.dll") # Original BlankClip() SubtitleEx("First line 111111 11111 111|Second line 2222 222 22222 2|Third lineg",effects="sc",size=48,x=width/2,y=0) return last Got to go to pub now. EDIT: Original Kai EDIT: Oops, labelled wrong, order changed[link names wrong though]. EDIT: RD, some additional docs and nifty examples in DVUtilities CHM (Compressed HTML help file, search DVUtilities):- http://www.avisynth.nl/users/warpenterprises/ Or Direct link Here:- http://www.avisynth.nl/users/warpent...s_20050717.zip
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 27th February 2020 at 17:14. |
28th February 2020, 17:26 | #51 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Anybody know if SubtitleEx was issued under GPL, or not ?
(Should I add it to the source)
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
28th February 2020, 18:12 | #52 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
It looks like some of the Anti-alias code was taken from avisynth source, so I'll add GPL.
EDIT: Original SubtitleEx contained same subtitle engine as DvTimeStamp, and Kai's version was also based on DvTimestamp. Internal.h is defo Avisynth, and as DvTimeStamp source subs engine also uses Internal.h so both original SubtitleEx and Kai version must also both be GPL.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 28th February 2020 at 18:59. |
29th February 2020, 02:27 | #53 | Link | ||
Registered User
Join Date: Mar 2012
Location: Texas
Posts: 1,666
|
Quote:
Edit: Quote:
Last edited by Reel.Deel; 29th February 2020 at 03:50. |
||
29th February 2020, 10:17 | #54 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
RD, I did not find that thread, expected name in thread title, and did not examine all Search For Posts threads.
Note, last frame in Kai does not display subs ("<" vs "<=" error). I think I'm gonna try use avs v2.60 Std Subs Anit-alias substitution, maybe get 2.60 colorspaces available, dont know if I will be successful, I feel there is just something wrong with the original code (both Basilik and Kai versions), both only use TA_BASELINE relative, not TA_TOP or TA_BOTTOM relative, anyway gonna give it a try, and if not succeed then go back to original source again. @G24K, way to go, dumping this on me, "StainlessS might be more used to device contexts" (or words to tha effect), I aint no windows progger and only really had limited experience with DC in the Clipboard plugin. You knows when to back out of it and lump it on to somebody stupid enough to have a go.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 29th February 2020 at 11:16. |
29th February 2020, 11:18 | #55 | Link | |
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
|
Quote:
You could have refused but the goodness of your heart made you do the right thing.
__________________
Groucho's Avisynth Stuff |
|
29th February 2020, 12:12 | #56 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Soft soap and flannel, blowing smoke up my ass, swivel on this.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 29th February 2020 at 12:42. |
29th February 2020, 14:32 | #57 | Link |
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
|
__________________
Groucho's Avisynth Stuff |
3rd March 2020, 00:44 | #58 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Quote:
Would anybody like to try a test version, not sure that it is all as it should be, in particular YV24 saturation (ie ApplyYV24) Guinea pigs required. From Antialiaser.cpp Code:
// ssS: Added. Called only by Apply void Antialiaser::ApplyYV24(BYTE* buf, int pitch, int textcolor, int halocolor, int pitchUV, BYTE* bufU, BYTE* bufV) { if (dirty) GetAlphaRect(); int Ytext = ((textcolor >> 16) & 255), Utext = ((textcolor >> 8) & 255), Vtext = (textcolor & 255); int Yhalo = ((halocolor >> 16) & 255), Uhalo = ((halocolor >> 8) & 255), Vhalo = (halocolor & 255); int textTransparancy = (textcolor >> 24) & 255; int haloTransparancy = (halocolor >> 24) & 255; char* alpha = alpha_bits + validRectangle.top * w * 2; // buf += pitch * ((h - 1) - validRectangle.bottom); buf += pitch * validRectangle.top; bufU += pitchUV * validRectangle.top; bufV += pitchUV * validRectangle.top; for (int y = validRectangle.bottom; y >= validRectangle.top; --y) { for (int x = validRectangle.left; x <= validRectangle.right; ++x) { char tr0, tr1; tr0 = div255to64[textTransparancy][alpha[x * 2 + 0]]; // tr1 = div255to64[haloTransparancy][alpha[x * 2 + 1]]; tr1 = (alpha[x * 2 + 0] >= 64)?0:div255to64[haloTransparancy][alpha[x * 2 + 1]]; buf[x] = (buf[x] * (64 - tr0 - tr1) + Ytext * tr0 + Yhalo * tr1) >> 6; bufU[x] = (bufU[x] * (64 - tr0 - tr1) + Utext * tr0 + Uhalo * tr1) >> 6; bufV[x] = (bufV[x] * (64 - tr0 - tr1) + Vtext * tr0 + Vhalo * tr1) >> 6; // ssS: Alternative test // bufU[x] = (bufU[x] * (128 - tr0 - tr1) + Utext * tr0 + Uhalo * tr1) >> 7; // bufV[x] = (bufV[x] * (128 - tr0 - tr1) + Vtext * tr0 + Vhalo * tr1) >> 7; // ssS: Alternative test // bufU[x] = (bufU[x] * (128 - tr0*2 - tr1*2) + Utext * tr0*2 + Uhalo * tr1*2) >> 7; // bufV[x] = (bufV[x] * (128 - tr0*2 - tr1*2) + Vtext * tr0*2 + Vhalo * tr1*2) >> 7; } buf += pitch; bufU += pitchUV; bufV += pitchUV; alpha += w * 2; } } Code:
v1.50Beta mod StainlessS. Given version number of v1.50Beta Made output same as original SubtitleEx for y=0 and Y=-1. (Y=0, Baseline of first line of text is at YCoord 0, Y=-1, BaseLine of Last line of text is at YCoord Height-1). Where "|" inserts a NewLine in text, "||" will now print a single Pipe "|" character, without NewLine. Add support for all v2.60 Std Colorspaces except YV411. It only became obvious what original SubtitleEx intended when rendering multiline where Y=0, and Y=-1 were viewed simultaneously, have implemented as original. YV24 Code:
#LoadPlugin(".\SubtitleEx.dll") # Original SubtitleEx #LoadPlugin(".\SubtitleExKai.dll") # Kai #BlankClip(pixel_type="RGB24") #BlankClip(pixel_type="RGB32") #BlankClip(pixel_type="YUY2") #BlankClip(pixel_type="YV12") #BlankClip(pixel_type="YV16") BlankClip(pixel_type="YV24") #BlankClip(pixel_type="Y8") TColor=$FF00FF HColor=$00FF00 SubtitleEx(TextColor=TColor,HaloColor=HColor,"First line111111 11111g|Second line 2222 222 222g|Third lineg",effects="bc", size=48,x=width/2,y=0) SubtitleEx(TextColor=TColor,HaloColor=HColor,"First line111111 11111g|Second line 2222 222 222g|Third lineg",effects="bec",size=48,x=width/2,y=-1) #info return convertToRGB32 YV12 Actually, looks like I got it right, YV24 and YV12 look similar-ish on D9 post, I had not seen them side by side. G2K4, for compile to x64, need define both "WIN32" and "_WIN64". [EDIT: Ensure version resource shows x64, "_WIN64" for resource compiler] dll + source + VS2008 project files via SendSpace beneath this post, "SubtitleEx_a26_x86_v1.50_Beta01_20200302.7z". EDIT: Bottom/top baseline relative stuff Code:
const char *s=m_Info.text; char *p; int currLine; for(currLine=0; currLine < LineCount; ++currLine) { p=buf; while(*s) { if(s[1]!='\0') { if(IsDBCSLeadByte(s[0]) == TRUE) { *p++ = *s++; // Lead multi-byte *p++ = *s++; // trail multi-byte continue; } if(s[0]=='|' && s[1]=='|') { ++s; // Skip escape char *p++ = *s++; // copy escaped pipe continue; } } if(s[0]=='|') { ++s; // skip n/l pipe break; // End of current line } *p++ = *s++; // copy normal char } *p='\0'; if (m_Info.org_y >= 0) { // ssS: linemargin Takes effect only where currline > 0 m_pAnti->AntialiserTextOut(buf, x, y + m_Info.linemargin * currLine, currLine); } else { // ssS: ie for 3 lines then from top, (currLine - LineCount + 1) = -2, -1, 0. m_pAnti->AntialiserTextOut(buf, x, y + m_Info.linemargin * (currLine - LineCount + 1), currLine - LineCount + 1); } }
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 3rd March 2020 at 01:52. |
|
3rd March 2020, 17:12 | #60 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Thanks RD, think I did/may_have gotten ApplyYV24() wrong, convert YV24 to YV12 and subtract from YV12 version produces visible difference in chroma, I'll try again.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 3rd March 2020 at 17:18. |
|
|