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

Reply
 
Thread Tools Search this Thread Display Modes
Old 2nd June 2019, 04:45   #81  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,883
Quote:
Originally Posted by jpsdr View Post
New version, see first post.
Thank you Jean-Philippe, but what does ThreadLevel do and how should we use it?
FranceBB is offline   Reply With Quote
Old 2nd June 2019, 07:23   #82  |  Link
ryrynz
Registered User
 
ryrynz's Avatar
 
Join Date: Mar 2009
Posts: 3,646
Quote:
Originally Posted by FranceBB View Post
what does ThreadLevel do and how should we use it?
from the readme.

ThreadLevel - This parameter will set the priority level of the threads created for the processing (internal multithreading). No effect if threads=1.

1 : Idle level.
2 : Lowest level.
3 : Below level.
4 : Normal level.
5 : Above level.
6 : Highest level.
7 : Time critical level (WARNING !!! use this level at your own risk)

Default : 6
ryrynz is offline   Reply With Quote
Old 2nd June 2019, 10:20   #83  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,883
Quote:
Originally Posted by ryrynz View Post
from the readme.

ThreadLevel - This parameter will set the priority level of the threads created for the processing (internal multithreading). No effect if threads=1.

1 : Idle level.
2 : Lowest level.
3 : Below level.
4 : Normal level.
5 : Above level.
6 : Highest level.
7 : Time critical level (WARNING !!! use this level at your own risk)

Default : 6
I see, so now we're also able to set the level for the specific thread used by the plugins like when we manually modify the priority on Windows for a specific process.
That's kinda nice, thank you.

Tested and working on Windows XP, however, as the other previous releases, XP SSE4.2 produces a code that is not compatible with Windows XP: Link
It's looking for the function libm_sse2_exp2 inside LIBMMD.DLL for whatever reason and it doesn't work.
As to the SSE2 one, it works, as always: Link

Thank you again anyway,
Frank.

Last edited by FranceBB; 2nd June 2019 at 13:57.
FranceBB is offline   Reply With Quote
Old 7th June 2019, 12:00   #84  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,308
New version, see first post.
__________________
My github.
jpsdr is offline   Reply With Quote
Old 8th June 2019, 17:14   #85  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,308
I've messed-up on resampler my files management between my VS versions, commited but not pushed, result the build was made with only some parts of the fixes (but still the output was not bad or incorrect).
If you see this post and have already downloaded the 3.1.2 version, re-download it, and sorry for the inconvenience.
__________________
My github.
jpsdr is offline   Reply With Quote
Old 14th July 2019, 10:00   #86  |  Link
dREV
Registered User
 
dREV's Avatar
 
Join Date: Jan 2019
Location: Antarctica
Posts: 74
Hello, I been trying to transition from using megui 32 bit to megui 64 bit with avisynth+ 64 bit in the hopes of seeing a speed increase during encode and slowly looking for the 64+ filters equivalents but having problems with this plugin.

My problem is the debilinear and debicubic and am I reading correct that this is essentially is an update to that plugin with multi-threading and a 64+ version as I don't see any 64 bit version plugin for this filter. As far as I am aware this is the only for that exists.

http://avisynth.nl/index.php/Debilinear
http://avisynth.nl/index.php/Debicubic

The issue I am running into is that it doesn't have the code "bool lsb_inout" and its telling me when I use another script called DebilinearM found here. On AvsPmod 64 bit states "script error: DebilinearResizeMT does not have a named argument "lsb_inout" (path DebilinearM_v1.3.1.avsi, line 67) (New File, line 82)".

As another user wrote the nnedi3_resize16 code works just fine with the lsb's for it which I use and need to make the change so I thought maybe this was an oversight. But both Debilinear and Debicubic don't seem to work and are missing the "lsb_inout" argument as I also used DeBilinearResizeMT by itself without the additional script above and it did not work with lsb_inout input. Not sure if DebilinearY and DebicubicY work, can this be confirmed?

I used the one in the x64\Release_W7_AVX2 folder for this as I think I'm suppose to use this for my Ryzen 5 machine.

Also, off topic is there a EdgeCleaner 64 bit version for avisynt+ same for warpsharp? I only been using http://avisynth.nl/index.php/AviSynth%2B_x64_plugins
dREV is offline   Reply With Quote
Old 15th July 2019, 17:07   #87  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,308
The "Dexxxx" versions are included within the ResampleMT, read the doc of it, and read also here.

They are not an upgrade/update of the previous version, they do the same thing, but they are totaly rewritten from scratch, and there is no intended link between the parameters with my version and the original version. If some parameters between both version happen to have the same purpose, it's just by luck.
So, yes, there is no lsb_inout parameter in my version.
__________________
My github.

Last edited by jpsdr; 15th July 2019 at 17:13.
jpsdr is offline   Reply With Quote
Old 16th July 2019, 06:20   #88  |  Link
dREV
Registered User
 
dREV's Avatar
 
Join Date: Jan 2019
Location: Antarctica
Posts: 74
Thanks for replying. I've read the documentation several times which is why I thought it was strange that the nnedi3_resize16 lsb's work as intended and thought perhaps the Debilinear and Debicubic missing these parameters were simply oversights in addition the documentation advice to work in 16 bit or float. Also, another one using IResize with success.

Maybe I'm just misunderstanding. I'm trying to understand.

Quote:
Quality improvement tip
There is the accuracy parameter, but another way to eventualy improve the quality is to increase the bit depth if you're using avs+. If you are in 8 bits, the resampler compute using integer rif parameters converted from the float rif parameters. But, if you are in bit depth>8, the resampler uses the float coefficients. In desampling cases, where rif size can easely be of 40 or 50, if you're trying to be the most accurate, i would advise to increase the bitdepth to 16 (or even to float if you're searching for ultra accuracy) just for the desampling filter.
Maybe there's another method to this that I'm not aware of as I use dither_convert_8_to_16() parameter to go into 16 bit. How would this be accomplished without lsb when using Debilinear or Debicubic together with the documentation quote above? I'm enticed about this ultra accurate thing to play around with if it does indeed improve the quality.

Perhaps give an example if you don't mind on how to apply this 16 bit as I am not seeing it. Essentially, I'm trying to get this to work in a 16 bit field using the DebilinearM script as mentioned in my previous post.

Since you mention that you don't have the original code asking if this function could be implemented maybe asking too much. Therefore, I have to ask if you are aware of any other Debilinear plugins available for avisynth+? Maybe I am not looking hard enough but I just do not see them. I might have to give VaporSynth a look if there is none.

Last edited by dREV; 16th July 2019 at 07:28. Reason: more details
dREV is offline   Reply With Quote
Old 16th July 2019, 15:30   #89  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
have a look here http://avisynth.nl/index.php/AviSynth%2B#Deep_color
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 16th July 2019, 17:38   #90  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,308
It's possible that this :
Code:
#For exemple, if the source file is a 1280x720 8 bits video :

Spline36ResizeMT(1920,1080,src_left=-0.2)
# or Spline36Resize(1920,1080,src_left=-0.2)
# To revert :
ConvertBits(16)
# or ConvertBits(32)
DeSpline36ResizeMT(1280,720,src_left=-0.2)
ConvertBits(8) # If you want to revert back to 8 bits video
produces a more accurate result than this :
Code:
#For exemple, if the source file is a 1280x720 8 bits video :

Spline36ResizeMT(1920,1080,src_left=-0.2)
# or Spline36Resize(1920,1080,src_left=-0.2)
# To revert :
DeSpline36ResizeMT(1280,720,src_left=-0.2)
I don't see the point of having internal function within the filter to change bit depth, as they allready exist in the core.
__________________
My github.

Last edited by jpsdr; 16th July 2019 at 17:44.
jpsdr is offline   Reply With Quote
Old 17th July 2019, 09:35   #91  |  Link
dREV
Registered User
 
dREV's Avatar
 
Join Date: Jan 2019
Location: Antarctica
Posts: 74
Quote:
Originally Posted by real.finder View Post
Thanks for the link. I had no idea about that I've usually stuck to the articles for original AviSynth. Together with what jpsdr wrote it worked by itself tho and there are issues. Which I will note below.

Quote:
Originally Posted by jpsdr View Post
I don't see the point of having internal function within the filter to change bit depth, as they allready exist in the core.
Quote:
This is intended to be an upgrade of the actual DeBilinear, working with all data formats of avs+, and having an x64 version. https://forum.doom9.org/showthread.p...97#post1817097
I thought I did read correctly the intention of this plugin to be an update to 64 bit and the oversight was correct but then I was corrected that it was not the case, so I like to ask if this is truly the case and that opinion from the quote above no longer holds true? The function only has 4 parameters.

The issue I ran into while it did work by itself given the code above I can't do anything about the sharpness of the source. I cannot soften that parameter so it doesn't look like jagged edges (this is with using anti-aliasing filter) and this is where DebilinearM comes into play. Found at the very bottom of http://avisynth.nl/index.php/Debilinear in the mediafire link. Using the thr parameter I can soften the amount of descaling sharpness thing it does on the very same source used in the testing for DebilinearResizeMT.
Code:
/* DebilinearM v1.3.1

DebilinearM is a wrapper function for the Debilinear and Debicubic plugins that masks parts of the frame that aren't upscaled,
such as text overlays, and uses a regular ResizeX kernel to downscale those areas. It works by downscaling the input
clip to the target resolution with Debilinear or Debicubic, upscaling it again, comparing it to the original clip,
and masking pixels that have a difference greater than the specified threshold.

##### Requirements #####

Plugins:
  Debicubic
  Debilinear
  Dither
  MaskTools2

Scripts:
  ResizeX

Color formats:
  YV12
*/

function DebilinearM(clip input, int target_width, int target_height, int "thr", int "expand", int "inflate",
\                    string "kernel", int "taps", float "a1", float "a2", bool "cubic", float "b", float "c",
\                    bool "chroma", bool "lsb_inout", int "showmask") {

# Default settings and other variable assignment
thr       = Default(thr, 10)
expand    = Default(expand, 1)
inflate   = Default(inflate, 2)
kernel    = Default(kernel, "Spline36")
cubic     = Default(cubic, false)
chroma    = Default(chroma, true)
lsb_inout = Default(lsb_inout, false)
showmask  = Default(showmask, 0)

Assert(target_width  > 0, "DebilinearM: target width must be greater than 0")
Assert(target_height > 0, "DebilinearM: target height must be greater than 0")
Assert(thr >= 0 && thr <= 255, "DebilinearM: thr must be in the range 0 to 255")
Assert(showmask > -1 && showmask < 3, "DebilinearM: showmask must be 0, 1, or 2")

w = input.Width()
h = lsb_inout ? input.Height()/2 : input.Height()

uvint = chroma ? 3
\              : 1

# Resizing
input_8bit = lsb_inout ? input.DitherPost(mode=-1) : input

    cubic ?
\   Eval("""
         dbi      = chroma ? input.Debicubic(target_width,target_height, b=b, c=c, lsb_inout=lsb_inout)
         \                 : input.DebicubicY(target_width,target_height, b=b, c=c, lsb_inout=lsb_inout)
         dbi_8bit = chroma ? input_8bit.Debicubic(target_width,target_height, b=b, c=c)
         \                 : input_8bit.DebicubicY(target_width,target_height, b=b, c=c)
         dbi2     = lsb_inout ? dbi_8bit.ResizeX(w,h, kernel="Bicubic", a1=b, a2=c, chroma=chroma)
         \                    : dbi.ResizeX(w,h, kernel="Bicubic", a1=b, a2=c, chroma=chroma)
         """)
\ : Eval("""
         dbi      = chroma ? input.Debilinear(target_width,target_height, lsb_inout=lsb_inout)
         \                 : input.DebilinearY(target_width,target_height, lsb_inout=lsb_inout)
         dbi_8bit = chroma ? input_8bit.Debilinear(target_width,target_height)
         \                 : input_8bit.DebilinearY(target_width,target_height)
         dbi2     = lsb_inout ? dbi_8bit.ResizeX(w,h, kernel="Bilinear", chroma=chroma)
         \                    : dbi.ResizeX(w,h, kernel="Bilinear", chroma=chroma)
         """)

rs = input.ResizeX(target_width,target_height, kernel=kernel, taps=taps, a1=a1, a2=a2, chroma=chroma, lsb_in=lsb_inout, lsb=lsb_inout)

# Masking
diffmask = mt_lutxy(input_8bit,dbi2, "x y - abs", U=uvint, V=uvint).mt_binarize(threshold=thr, U=uvint, V=uvint)
diffmask = showmask == 2 ? diffmask.DebilinearM_expand(expand=expand, U=uvint, V=uvint)
\                                  .DebilinearM_inflate(inflate=inflate, U=uvint, V=uvint)
\                        : diffmask.ResizeX(target_width,target_height, kernel="Bilinear", chroma=chroma)
\                                  .mt_binarize(threshold=3, U=uvint, V=uvint)
\                                  .DebilinearM_expand(expand=expand, U=uvint, V=uvint)
\                                  .DebilinearM_inflate(inflate=inflate, U=uvint, V=uvint)

merged = lsb_inout ? Dither_merge16_8(dbi,rs,diffmask, u=uvint, v=uvint)
\                  : mt_merge(dbi,rs,diffmask, U=uvint, V=uvint)

return showmask > 0 ? diffmask
\                   : merged
}

# DebicubicM alias
function DebicubicM(clip input, int target_width, int target_height, int "thr", int "expand", int "inflate",
\                   string "kernel", int "taps", float "a1", float "a2", float "b", float "c",
\                   bool "chroma", bool "lsb_inout", int "showmask") {

return DebilinearM(input,target_width,target_height,thr,expand,inflate,kernel,taps,a1,a2,true,b,c,chroma,lsb_inout,showmask)
}


# Helper functions
function DebilinearM_expand(clip input, int "expand", int "U", int "V") {
return expand > 0 ? DebilinearM_expand(input.mt_expand(mode="both", U=U, V=V), expand-1)
\                 : input
}

function DebilinearM_inflate(clip input, int "inflate", int "U", int "V") {
return inflate > 0 ? DebilinearM_inflate(input.mt_inflate(U=U, V=V), inflate-1)
\                  : input
}
I've tried to modify the script to use DebilinearResizeMT but I have almost zero knowledge on this and have had zero success.

My script involves the implementations of what's in image 02:



Code:
Image 01 (left)(by itself) via AviSynth+ 64 bit
ConvertBits(32)
DeBilinearResizeMT(1280,720,accuracy=2)

Image 02 (right) via Avisynth+ 32 bit
dither_convert_8_to_16()
ly = DebilinearM(1280,720,thr=01,lsb_inout=true)  # Debilinear
lc = nnedi3_resize16(1280*2, 720*2,lsb_in=true,lsb=true,kernel_d="Spline64",kernel_u="Spline64",src_top=0.0,src_left=0.50) #
lu = lc.UtoY()
lv = lc.VtoY()
YtoUV(lu,lv,ly)
Dither_out()
It don't look so good. Both ConvertBits(16) and ConvertBits(32) I'm not knowledgeable enough on how to go about this method. That along with the problematic result of the jagged edges with DebilinearResizeMT. My ignorance in trying to place it within the YtoUV (on image 02) function turns horrid obviously to those who are more knowledgeable then I may see that.

The above script (at least from what I read from others) allows upscaling the chroma, I don't understand it myself but results on the quality of both the image and colors are better then simply by itself. I've also recently found another script that's even greater that requires both DebilinearM and Debilinear.dll with even more depth to detail, colors, and debanding.

Also, I don't understand why your code had src_left=-0.2 when I used it it did not match the source I had when taking screenshot. The image 02 doesn't do this as if it does it won't match my 1080p source and when I downsize it via avspmod and photoshop (where I do my comparisons from). I had read here on Doom9 that for chroma it's src_left=0.50.

Would it be possible to do the above with this plugin as is? From what I'm perceiving it may not be so. Sorry for having to repeat myself and sorry for the long post. If not I'll give VaporSynth a look as I don't want to waste your time anymore with my questions.

Last edited by dREV; 19th July 2019 at 18:48. Reason: forgot to add something, typos and grammar
dREV is offline   Reply With Quote
Old 17th July 2019, 17:05   #92  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,308
The code was just an exemple of what Dexxxx parameters must be, linked to the xxxx parameters.
Don't see any specific sense in the value themselve. I used src_left in the exemple, but it could has been any other src_xxx.

I'll update my post, as it seems it can lead to misunderstanding.
__________________
My github.

Last edited by jpsdr; 17th July 2019 at 17:19.
jpsdr is offline   Reply With Quote
Old 17th July 2019, 18:55   #93  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
here an update for DebilinearM https://pastebin.com/bS8s4Chn

Code:
ColorBars(width=1280, height=720, pixel_type="yv12")
BilinearResize(1920,1080)
dither_convert_8_to_16()
ly = DebilinearM(1280,720,thr=01,lsb_inout=true, DeResizeMT=true)  # Debilinear
lc = nnedi3_resize16(1280*2, 720*2,lsb_in=true,lsb=true,kernel_d="Spline64",kernel_u="Spline64",src_top=0.0,src_left=0.50) #
lu = lc.UtoY()
lv = lc.VtoY()
YtoUV(lu,lv,ly)
Dither_out()
with this it will use dither resize, use it without lsb things to use DeXXXXXResizeMT

you need update ResizeX https://forum.doom9.org/showthread.p...61#post1837361
__________________
See My Avisynth Stuff

Last edited by real.finder; 21st July 2019 at 03:33.
real.finder is offline   Reply With Quote
Old 19th July 2019, 18:39   #94  |  Link
dREV
Registered User
 
dREV's Avatar
 
Join Date: Jan 2019
Location: Antarctica
Posts: 74
Quote:
Originally Posted by jpsdr View Post
The code was just an exemple of what Dexxxx parameters must be, linked to the xxxx parameters.
Don't see any specific sense in the value themselve. I used src_left in the exemple, but it could has been any other src_xxx.

I'll update my post, as it seems it can lead to misunderstanding.
Oh, alright. I was going on the assumption that it was the default settings for that particular resize and alignment. Thanks for your reply.


Quote:
Originally Posted by real.finder View Post
here an update for DebilinearM https://pastebin.com/8zNJUDZw

Code:
ColorBars(width=1280, height=720, pixel_type="yv12")
dither_convert_8_to_16()
ly = DebilinearM(1280,720,thr=01,lsb_inout=true, DeResizeMT=true)  # Debilinear
lc = nnedi3_resize16(1280*2, 720*2,lsb_in=true,lsb=true,kernel_d="Spline64",kernel_u="Spline64",src_top=0.0,src_left=0.50) #
lu = lc.UtoY()
lv = lc.VtoY()
YtoUV(lu,lv,ly)
Dither_out()
with this it will use dither resize, use it without lsb things to use DeXXXXXResizeMT

you need update ResizeX https://forum.doom9.org/showthread.p...61#post1837361
Thank you for taking the time and sharing your update with all people and the example script that will help me out . I'll test it out over the weekend (I hope) when I get some more time. I'm looking forward to finally using DebilinearResizeMT with DebilinearM. Will I be able to take advantage of the "accuracy" thing by default?

I also read all of the posts after the ResizeX link you gave above and I wanted to ask some questions to clarify if I understood it correct. But I think I should ask it over at your thread instead of here so I don't go off topic.

I also have another script that I briefly mentioned above that maybe you can help me understand why it adds artifact (not sure if that's the term for it) and another issue added with it that requires another color profile that may or may not conflict with one another with the "YV12" I see in your example script. If you don't mind that is once I play around with the filter.

Last edited by dREV; 19th July 2019 at 18:43. Reason: stuff
dREV is offline   Reply With Quote
Old 21st July 2019, 02:44   #95  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by dREV View Post
DebilinearM
new update for speed (in HBD only, will not see speed up in lsb)
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 21st July 2019, 07:10   #96  |  Link
dREV
Registered User
 
dREV's Avatar
 
Join Date: Jan 2019
Location: Antarctica
Posts: 74
Thanks. Made a post on your thread. https://forum.doom9.org/showthread.p...64#post1879764
dREV is offline   Reply With Quote
Old 16th September 2019, 08:45   #97  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,308
New version, see first post.
__________________
My github.
jpsdr is offline   Reply With Quote
Old 27th December 2019, 11:38   #98  |  Link
Patman
Registered User
 
Patman's Avatar
 
Join Date: Jan 2015
Posts: 286
Hi jpsdr,

pls update your plugin pack. I saw that you've updated HDRTools.
__________________
Tools for StaxRip | x264 - x265
Patman is offline   Reply With Quote
Old 28th December 2019, 11:45   #99  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,308
It's in process...
__________________
My github.
jpsdr is offline   Reply With Quote
Old 28th December 2019, 15:46   #100  |  Link
Patman
Registered User
 
Patman's Avatar
 
Join Date: Jan 2015
Posts: 286
Quote:
Originally Posted by jpsdr View Post
It's in process...
Thx

Gesendet von meinem HMA-L09 mit Tapatalk
__________________
Tools for StaxRip | x264 - x265
Patman is offline   Reply With Quote
Reply

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 10:52.


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