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 18th February 2019, 12:48   #4521  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
There is a little bit of inconsistency between function names, some use xxxxExist, and some xxxExists.

Code:
Exist                     "s"
FunctionExists            "s"
InternalFunctionExists    "s"
VarExist                  "s"
RT_ uses RT_FunctionExist() which was chosen to match the then existing Exist() function.
__________________
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; 18th February 2019 at 12:53.
StainlessS is offline  
Old 18th February 2019, 12:48   #4522  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by ChaosKing View Post
A check with AddAutoloadDir whould detect Avisynth Neo also as Avisynth+ (it basically is avs+ with cuda stuff) while AvsPlusVersionNumber returns 0. VersionString() returns on avs neo: "Avisynth Neo 0.1 (r2882, Neo, i386)"
It this case a check with AddAutoloadDir would be prefered.
https://github.com/nekopanda/AviSynthPlus/releases
ok, so I did this, it will be in next SMDegrain update, nekopanda already did the damage so forget about my old post

Code:
function IsAvsNeo()
{
      FindStr(VersionString, "AviSynth Neo")  != 0
}

function IsAvsPlus()
{
      FindStr(VersionString, "AviSynth+")  != 0 || IsAvsNeo
}

function AvsPlusVersionNumber()
{
    IsAvsNeo ? eval(MidStr(VersionString(),20,4)) : IsAvsPlus ? eval(MidStr(VersionString(),17,4)) : 0
}
can you test it to see if it report the number correctly?
__________________
See My Avisynth Stuff

Last edited by real.finder; 18th February 2019 at 14:39.
real.finder is offline  
Old 18th February 2019, 14:23   #4523  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
Yes it works, I made a small mistake. Correct is: "AviSynth Neo"
IsAvsPlus and IsAvsNeo returning true for AviSynth Neo.
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database
ChaosKing is offline  
Old 18th February 2019, 14:41   #4524  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by ChaosKing View Post
Yes it works, I made a small mistake. Correct is: "AviSynth Neo"
IsAvsPlus and IsAvsNeo returning true for AviSynth Neo.
and the revision number?
__________________
See My Avisynth Stuff
real.finder is offline  
Old 18th February 2019, 14:51   #4525  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
Quote:
Originally Posted by real.finder View Post
and the revision number?
returns 2822
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database
ChaosKing is offline  
Old 18th February 2019, 15:11   #4526  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by pinterf View Post
The old bug is back, but now it's dither_lut16 is the culprit.
It seems that under Win10 (?) configuration it understands only the decimal separator of the current input local.

Just replace the decimal point to commas in yexpr parameter and it will work fine. (the used ReplaceStr is built-in in AVS+)

Code:
function Dither_Luma_Rebuild (clip src, float "s0", float "c",int "uv", bool "lsb", bool "lsb_in", bool "lsb_out", int "mode", float "ampn", bool "slice"){
[...]
src
lsb ? (lsb_in ? Dither_lut16  (yexpr=ReplaceStr(e,".",","),expr="x 32768 - 32768 * 28672 / 32768 +",y=3, u=uv, v=uv)                 : \
                Dither_lut8   (yexpr=ReplaceStr(e,".",","),expr="x 128 - 32768 * 112 / 32768 +"    ,y=3, u=uv, v=uv))                : \
                avs26 ? mt_lut(yexpr=e,expr="x range_half - range_half * 112 scaleb / range_half +",y=3, u=uv, v=uv) : \
                        mt_lut(yexpr=e,expr="x 128 - 128 * 112 / 128 +"        ,y=3, u=uv, v=uv)

[...]
}
Quote:
Originally Posted by real.finder View Post
btw, will this make the systems that use dot has wrong outputs?
so, the final solution for this? rebuild dither.dll with vc15 ?
__________________
See My Avisynth Stuff
real.finder is offline  
Old 18th February 2019, 16:07   #4527  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Dunno, probably yes. Do those lines really improve anything or it is just kept and copied over many years? Could Zopti (Formerly Avisynth optimizer) help deciding it? No, I'm not volunteering for it . Still working on the "Layer" stuff.
pinterf is offline  
Old 18th February 2019, 16:14   #4528  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by pinterf View Post
Dunno, probably yes. Do those lines really improve anything or it is just kept and copied over many years? Could Zopti (Formerly Avisynth optimizer) help deciding it? No, I'm not volunteering for it . Still working on the "Layer" stuff.
they doing good job in dark area

btw, don't tell me that masktools lut (and avs+ expr) has this problem too!

if it only the dither one did this update here fix the problem?
__________________
See My Avisynth Stuff

Last edited by real.finder; 18th February 2019 at 16:21.
real.finder is offline  
Old 18th February 2019, 16:33   #4529  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
No, as far as I know masktools is working properly. There have been problems with dither tools' decimal separator, which I'm not sure it it was fixed or not.
pinterf is offline  
Old 18th February 2019, 16:47   #4530  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by pinterf View Post
No, as far as I know masktools is working properly. There have been problems with dither tools' decimal separator, which I'm not sure it it was fixed or not.
ok, can someone test? someone that has regional setting use comma for decimal separator

edit: simple test

Code:
ColorBars(pixel_type="yv12")
a=Mt_makediff(Dither_Luma_Rebuild(),coloryuv(levels="TV->PC"),u=3,v=3)
b=Mt_makediff(Dither_Luma_Rebuild(lsb=true),coloryuv(levels="TV->PC"),u=3,v=3)
StackVertical(a.Subtitle("luma rebuild vs avs tv to pc"),b.Subtitle("luma rebuild lsb vs avs tv to pc"),Mt_makediff(a,b,u=3,v=3).Subtitle("lsb vs 8bit"))
in case of avs tv to pc vs luma rebuild (whether with or without lsb) there are small difference here and there, so anyone test better post image of it
__________________
See My Avisynth Stuff

Last edited by real.finder; 18th February 2019 at 17:47.
real.finder is offline  
Old 18th February 2019, 17:39   #4531  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
How should one test it exactly? just call Dither_Luma_Rebuild() ?
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database
ChaosKing is offline  
Old 18th February 2019, 17:48   #4532  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by ChaosKing View Post
How should one test it exactly? just call Dither_Luma_Rebuild() ?
I know that someone will ask that, see my edit I just made above
__________________
See My Avisynth Stuff
real.finder is offline  
Old 18th February 2019, 18:29   #4533  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database
ChaosKing is offline  
Old 18th February 2019, 18:34   #4534  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by ChaosKing View Post
https://i.imgur.com/bZfmVX9.jpg
it's same I got, my system use dot (Iraq)

btw, what avs you use and what dither.dll?
__________________
See My Avisynth Stuff
real.finder is offline  
Old 18th February 2019, 19:09   #4535  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
Win10 x64 german which uses comma as decimal separator, avs+ 2772, 32bit dither.dll (CRC32: 20008b02) is from here http://ldesoras.free.fr/prod.html#src_ditheravsi
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database

Last edited by ChaosKing; 18th February 2019 at 19:26.
ChaosKing is offline  
Old 18th February 2019, 20:35   #4536  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by ChaosKing View Post
Win10 x64 german which uses comma as decimal separator, avs+ 2772, 32bit dither.dll (CRC32: 20008b02) is from here http://ldesoras.free.fr/prod.html#src_ditheravsi
so that mean the problem already fixed? it was bug in win10 that fixed in later updates or what? let's see what pinterf and tormento said
__________________
See My Avisynth Stuff
real.finder is offline  
Old 18th February 2019, 21:48   #4537  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
Idk I never encountered this problem in avs.
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database
ChaosKing is offline  
Old 18th February 2019, 22:28   #4538  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,492
Got a filter development problem.

In GetFrame, I can do this:

Code:
PVideoFrame __stdcall warp::GetFrame(int n, IScriptEnvironment* env) {
  PVideoFrame dst = env->NewVideoFrame(vi);
  byte* dst_p = dst->GetWritePtr();
  ...
}
As it's an interleaved RGB clip, this works as expected.

But what I want to do is this:

Code:
void some_function(PVideoFrame dst) {
  byte* dst_p = dst->GetWritePtr();
  ...
}

PVideoFrame __stdcall warp::GetFrame(int n, IScriptEnvironment* env) {
  PVideoFrame dst = env->NewVideoFrame(vi);
  some_function(dst);
}
This doesn't work. GetWritePtr() in the function returns 0.

What's the problem and how can I fix it?

--------------------------------------------------------------

Edit: it looks like I have to pass a pointer to the smart pointer, even though the smart pointer itself has the same value inside and outside of the function. Any brief explanation of this would be gratefully received.
__________________
My AviSynth filters / I'm the Doctor

Last edited by wonkey_monkey; 18th February 2019 at 22:55.
wonkey_monkey is offline  
Old 19th February 2019, 00:04   #4539  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Make dst a reference, think that should work.

Code:
void some_function(PVideoFrame &dst) {
  byte* dst_p = dst->GetWritePtr();
  ...
}
EDIT: If not reference, it makes a copy of PVideoFrame for calling some_function, and as is a copy is no longer writeable.
__________________
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; 19th February 2019 at 00:53.
StainlessS is offline  
Old 19th February 2019, 00:27   #4540  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,492
I checked the actual value of PVideoFrame (assuming it actually is some kind of pointer) and it was the same inside the function. I guess there's another layer of abstraction that ruins this idea.

Anyway, see my edit, as I did manage to figure that out and it now works. Thanks though!
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey 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 08:26.


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