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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development

Closed Thread
 
Thread Tools Search this Thread Display Modes
Old 31st December 2016, 18:19   #2761  |  Link
ajp_anton
Registered User
 
ajp_anton's Avatar
 
Join Date: Aug 2006
Location: Stockholm/Helsinki
Posts: 792
Quote:
Originally Posted by StainlessS View Post
Default() must be a function, moving into the Parser as you suggest would likely result in a lot of work for printerf, and for no real reason, you can easily get around that (EDIT: rare) 'problem' yourself.
Well, (2) isn't that important, I'm just using a simple "if" (? and to get around it. Took a while to be desperate enough to try it though, because I though that's basically how Default did it and it wasn't working there.

Quote:
Originally Posted by LigH View Post
1. is probably asking for a chance to overlay the Info() details over a blank clip, for better readability. Well ... BlankClip(reference_clip) could be a base with mostly identical attributes, to display Info text onto. Except for the case that the clip has too small dimensions for the Info text to render completely; in that case it may indeed need a larger area than the original clip.
Yes, I was thinking of the dimensions. Sure, can get around it by resizing, assuming that the clip dimension is not what you're interested in.

Quote:
Originally Posted by StainlessS View Post
No problem with (3) [EDIT: I quite like the idea].
Not sure what idea you quite like, because I just noticed that the forum messed up my (3) =). Apparently you can't put a \ between "". I now edited my previous post.
Basically, what I meant is that you could write
Code:
a = somefunction(argument1  #comment for arg1
\,               argument2) #another comment
or
Code:
a = somefunction(argument1,\ #comment for arg1
                 argument2)  #another comment

Last edited by ajp_anton; 31st December 2016 at 18:32.
ajp_anton is offline  
Old 31st December 2016, 18:40   #2762  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 9,129
Quote:
Originally Posted by ajp_anton View Post
Not sure what idea you quite like, because I just noticed that the forum messed up my (3) =). Apparently you can't put a \ between "". I now edited my previous post.
Basically, what I meant is that you could write
Code:
a = somefunction(argument1,\ #comment for arg1
                 argument2)  #another comment
That is what I took you to mean
__________________
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 ???
StainlessS is offline  
Old 31st December 2016, 19:39   #2763  |  Link
raffriff42
Retried Guesser
 
raffriff42's Avatar
 
Join Date: Jun 2012
Posts: 1,375
>1. Function "Info": Add a second clip as an optional argument.
Code:
## show information on clip 'C' over base clip 'B'
function Info(clip B, clip C)
{
    return B.Overlay(
    \   C.Levels(0, 1, 0, 0, 0) [* make black BG *]
    \    .Info                  [* show info     *]
    \    .Crop(0, 0, 384, 240), [* crop to size  *]
    \   opacity=1.0             [* overlay       *]
    \ ) 
}
Can't support an optional second clip as this collides with built-in Info(clip C).

>3. The ability to add comments at the end of a line that continues on the next line
See above
raffriff42 is offline  
Old 31st December 2016, 23:24   #2764  |  Link
ajp_anton
Registered User
 
ajp_anton's Avatar
 
Join Date: Aug 2006
Location: Stockholm/Helsinki
Posts: 792
Quote:
Originally Posted by raffriff42 View Post
>1. Function "Info": Add a second clip as an optional argument.
Code:
## show information on clip 'C' over base clip 'B'
function Info(clip B, clip C)
{
    return B.Overlay(
    \   C.Levels(0, 1, 0, 0, 0) [* make black BG *]
    \    .Info                  [* show info     *]
    \    .Crop(0, 0, 384, 240), [* crop to size  *]
    \   opacity=1.0             [* overlay       *]
    \ ) 
}
Can't support an optional second clip as this collides with built-in Info(clip C).

>3. The ability to add comments at the end of a line that continues on the next line
See above
Nope, "you cannot use crop to enlarge or 'shift' a clip".
And the "CPU detected" line goes on even further than that 384, so an even bigger area is needed. I know, totally not important, but it looks ugly. Not to mention that the whole black rectangle is really ugly. So not really a "nice" solution.

Didn't know you could comment like that. Though I still prefer # because it's easier to keep track of.
ajp_anton is offline  
Old 1st January 2017, 00:00   #2765  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 9,129
from Docs

Quote:
Avisynth ignores anything from a # character to the end of that line. This can be used to add comments to a script.
Code:
# comment
In v2.58 it is possible to add block and nested block comments in the following way:

Code:
# block comment:
/* 
comment 1
comment 2
*/
Code:
# nested block comments:
[* [* a meaningful example will follow later :) *] *]
Avisynth ignores anything from an __END__ keyword (with double underscores) to the end of the script file. This can be used to disable some last commands of script.

Code:
Version()
__END__
ReduceBy2()
Result is not reduced and we can write any text here
Seems that we are still awaiting a meaningful example, since v2.58.

But below produces "Parse Error: orphan block comment closing */". [The 1st */ ends the comment]
Code:
/* /* something */ */
whereas
Code:
[* [* something *] *]
does not.

EDIT: (1) Perhaps new function InfoText() or Info_Text() would be easy to implement (as for Subtitle, with '\n').
__________________
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; 1st January 2017 at 12:50.
StainlessS is offline  
Old 1st January 2017, 14:33   #2766  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 1,901
Is there a way with the CPU flags to detect FMA4 ? I've seen there's allready FMA3, but didn't seen FMA4.
jpsdr is offline  
Old 1st January 2017, 14:44   #2767  |  Link
Foja
Registered User
 
Join Date: Sep 2011
Posts: 2
RemoveDirt for Avisynth+

Hello,

since long time I am a silent reader in this discussion. I am using the plug-in RemoveDirt in the 8-bit version of avisynth for many years. I am very satisfied with this plug-in.
Now I am starting to use avisynth+ for my cleaning script, all plugins which i normaly use in the 8-bit version are already available exept "RemoveDirt".
RemoveDirt is for me a important plugin which I don't want to miss in my cleaning script for avisynth+.

Is there the plan to convert the plugin "RemoveDirt" to the new version avisynth+?

Thanks for the great work and for providing such a powerful software.

Best wishes from Germany and a Happy New Year!
Foja is offline  
Old 1st January 2017, 19:07   #2768  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,398
Hi, thanks, and same to you, from Germany as well.

In the AviSynth Wiki for RemoveDirt I read that it "has now become a script function which involves RestoreMotionBlocks and various filters from the RemoveGrain package." And if you substitute them with RgTools, I guess it should be possible to run it with equivalent results and better speed in AviSynth+ ... so much guesswork from me; but other members may know it better.
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is offline  
Old 1st January 2017, 19:22   #2769  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 1,853
I didn't include fma4 in CPU flags. But it seems I will have to.
pinterf is offline  
Old 2nd January 2017, 17:05   #2770  |  Link
Foja
Registered User
 
Join Date: Sep 2011
Posts: 2
Quote:
Originally Posted by LigH View Post
Hi, thanks, and same to you, from Germany as well.

In the AviSynth Wiki for RemoveDirt I read that it "has now become a script function which involves RestoreMotionBlocks and various filters from the RemoveGrain package." And if you substitute them with RgTools, I guess it should be possible to run it with equivalent results and better speed in AviSynth+ ... so much guesswork from me; but other members may know it better.
Thanks for your reply. Unfortunately, the "RestoreMotionBlocks" function is part of RemoveDirt and not the RemovGrain or RgTools package. Although there is an x64 version (RemoveDirt v1.0 pre-release x64), but this is not running under Avisynth +. The error message "System exeption - Access Violation" are shown.
I guess for the support of a bit depth of 10 - 16 bit, RemoveDirt is likely to be completely revised??!

Best wishes!
Foja is offline  
Old 2nd January 2017, 17:11   #2771  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: Providence, RI
Posts: 2,538
Quote:
Originally Posted by Foja View Post
Thanks for your reply. Unfortunately, the "RestoreMotionBlocks" function is part of RemoveDirt and not the RemovGrain or RgTools package. Although there is an x64 version (RemoveDirt v1.0 pre-release x64), but this is not running under Avisynth +. The error message "System exeption - Access Violation" are shown.
I guess for the support of a bit depth of 10 - 16 bit, RemoveDirt is likely to be completely revised??!

Best wishes!
takes ~10min to make it work on higher bit depth integer samples, just reinterpret_cast all uint8_t * to uint16_t * and append "/ sizeof(uint16_t)" after all stride variables and you're done, do it yourself
__________________
If I got new ideas, will post here: https://github.com/IFeelBloated
feisty2 is offline  
Old 2nd January 2017, 19:17   #2772  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,398
Quote:
Originally Posted by feisty2 View Post
takes ~10min to make it work on higher bit depth integer samples, just reinterpret_cast all uint8_t * to uint16_t * and append "/ sizeof(uint16_t)" after all stride variables and you're done, do it yourself
What kind of programmer do I have to be to understand these instructions? And which kind of compiler do I have to know to use?
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is offline  
Old 2nd January 2017, 21:51   #2773  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,442
C or C++. It's very basic. As they say, google is your friend.
videoh is offline  
Old 3rd January 2017, 02:44   #2774  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,192
Quote:
Originally Posted by feisty2 View Post
takes ~10min to make it work on higher bit depth integer samples, just reinterpret_cast all uint8_t * to uint16_t * and append "/ sizeof(uint16_t)" after all stride variables and you're done, do it yourself
~10 min? I call BS on that. Have you even looked at the source code? I'm no programmer but I've heard other knowledgeable people describe Kasandro's code as pure spaghetti. If it was so easy why was it not done here: https://github.com/handaimaoh/removedirtvs

Edit:
Quote:
Originally Posted by Foja View Post
Thanks for your reply. Unfortunately, the "RestoreMotionBlocks" function is part of RemoveDirt and not the RemovGrain or RgTools package. Although there is an x64 version (RemoveDirt v1.0 pre-release x64), but this is not running under Avisynth +. The error message "System exeption - Access Violation" are shown.
The RemoveDirt script also uses SCSelect fucntion from the RemoveDirt plugin. Regarding the x64 version on the wiki, there's a note on there that says it's incompatible with AviSynth.

For the mean time you can use a similar workaround as described here: http://forum.doom9.org/showthread.ph...83#post1599783

Code:
o16 = last #Stack16 video

o = DitherPost(mode=-1)
o.RemoveDirt(...)

dif = mt_makediff(last, o, y=3, u=3, v=3)
dif16 = dif.Dither_convert_8_to_16()
o16.Dither_add16(dif16, dif=true)

Last edited by Reel.Deel; 3rd January 2017 at 03:37.
Reel.Deel is offline  
Old 3rd January 2017, 04:14   #2775  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: Providence, RI
Posts: 2,538
Quote:
Originally Posted by Reel.Deel View Post
~10 min? I call BS on that. Have you even looked at the source code? I'm no programmer but I've heard other knowledgeable people describe Kasandro's code as pure spaghetti.

Lol ur full of crap, it doesn't matter how messed up the code is cuz ur not rewriting the whole plugin, simply modifying it a tiny little bit.

Quote:
If it was so easy why was it not done here: https://github.com/handaimaoh/removedirtvs
Because unlike c and c++ which are easy to modify, assembly is an evil bitch
__________________
If I got new ideas, will post here: https://github.com/IFeelBloated
feisty2 is offline  
Old 3rd January 2017, 08:18   #2776  |  Link
tuanden0
Registered User
 
Join Date: Oct 2016
Posts: 104
I'm using filter MCTemporalDenoise.avsi
Can everyone tell me what is the MT mode of this?
tuanden0 is offline  
Old 4th January 2017, 11:07   #2777  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 1,704
Quote:
Originally Posted by tuanden0 View Post
I'm using filter MCTemporalDenoise.avsi
Can everyone tell me what is the MT mode of this?
I warmly suggest you to use SMDegrain.
__________________
@turment on Telegram
tormento is offline  
Old 4th January 2017, 20:24   #2778  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 1,853
Happy New Year!

After having spent many days with understanding how multithreading works with runtime scripts I felt myself so miserable and tired that I had to abandon that investigation a bit. I have searched for an area with more success factor instead.

New dev build:
Download Avisynth Plus r2359

Changes since r2347:

Avisynth plus r2359dev (20170104)
  • Overlay:
    new parameter: bool use444 (default true for compatibility/until under construction, etc...)

    Parameter is valid only for "blend" at the moment
    When set to false, and base clip/overlay clip is 420/422/Planar RGB, no conversion occurs to and back from YV24 (4:4:4 in general)

    Mask can be either greyscale or can be any planar YUV when greymask=true (default)

    Works for Planar RGB, so blending is basically lossless for this format (no YUV conversion)
    todo: support for other modes, convert packed RGB to planar RGB internally instead of YUV
  • Overlay:
    Add fast 4:2:0<->4:4:4 conversion, e.g. YV16<->YV24 (only fast YUY2 and YV12 existed so far)
    instead of invoking generic core conversion
  • Overlay:
    10-16bit SSE2/SSE4 for 420/422<->444 conversions
  • Info() made a bit more compact.
    Bit depth info moved after color space info
    Does not display pre-SSE2 CPU flags when at least AVX is available.
    AVX512 flags in separate line (would be too long)
  • new CPU feature constants (see cpuid.h and avisynth_c.h)
    Detect FMA4 and AVX512F,DQ,PF,ER,CD,BW,VL,IFMA,VBMI
  • new script function:
    string ReplaceStr(string s, string pattern, string replacement)
    Function is case sensitive, parameters are unnamed
  • new script function
    int NumComponents(clip)
    returns 1 for grayscale, 3 for YUVxxx, YUY2, planar RGB or RGB24/RGB48, 4 for YUVAxxx, Planar RGBA or RGB32/64
  • new script function:
    bool HasAlpha(clip)
    returns true when clip is YUVA, Planar RGBA, or packed RGB32 or RGB64

Last edited by pinterf; 6th January 2017 at 12:54. Reason: edit: removed IsPackedRGB
pinterf is offline  
Old 4th January 2017, 21:03   #2779  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,164
Quote:
Originally Posted by pinterf View Post
Happy New Year!

After having spent many days with understanding how multithreading works with runtime scripts I felt myself so miserable and tired that I had to abandon that investigation a bit. I have searched for an area with more success factor instead.

New dev build:
Download Avisynth Plus r2359
Happy New Year and

what about make AddAlphaPlane accept clip too?
__________________
See My Avisynth Stuff

Last edited by real.finder; 5th January 2017 at 11:23.
real.finder is offline  
Old 4th January 2017, 21:23   #2780  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 1,853
It was planned then forgotten
pinterf is offline  
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:34.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.