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 Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 23rd December 2021, 23:37   #701  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,130
Hi, sorry for question isn't relate post. I want prefilter convertoyuv444 but meet error: "both clip should same colorspace". I want to know what code can auto convert comeback original colorspace input clip?? Dogway
kedautinh12 is offline   Reply With Quote
Old 24th December 2021, 10:56   #702  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,351
What filter? SMDegrain? I tested and didn't get an issue. Post your call.


EDIT: By the way, happy not-so-happy day. Finally managed to craft a proper "optimized" sorting network for median7!! 6 months in the making finally. Well, actually it only saved 2 'max', 2 'dup1' and little else. Smart positioning of the lines has a greater impact on performance/multithreading. In any case speed is same as before since I have been feeling a slight slowdown of AVS+ from test20s.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread

Last edited by Dogway; 24th December 2021 at 11:00.
Dogway is offline   Reply With Quote
Old 24th December 2021, 11:03   #703  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,130
Oh, i asked a question for a code can convert comeback original colorspace based your prefilter but i know how to do that, thanks. Btw, i used to want give you a private message but your inbox full and i decide comment in here
kedautinh12 is offline   Reply With Quote
Old 24th December 2021, 11:40   #704  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,351
Yes, it's full many years 'round here. I have very "interesting" PM so I don't want to delete them ^^
I made MatchClip() to match format from clip 'a' to 'b'. In fast mode (default) it should work fine, my goal is to finish ConvertFormat() and default to it at some point.
You also have MatchColorFormat() from Raffriff42, and yesterday discovered HistogramRGB.avsi where it includes ConvertToMatch().
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread
Dogway is offline   Reply With Quote
Old 24th December 2021, 12:42   #705  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,957
Quote:
Yes, it's full many years 'round here. I have very "interesting" PM so I don't want to delete them ^^
You can save your PM's (to a file, I think - I've never done it).

[And just think of the very interesting PM's that you never got]
__________________
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   Reply With Quote
Old 24th December 2021, 12:58   #706  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,130
Quote:
Originally Posted by Dogway View Post
Yes, it's full many years 'round here. I have very "interesting" PM so I don't want to delete them ^^
I made MatchClip() to match format from clip 'a' to 'b'. In fast mode (default) it should work fine, my goal is to finish ConvertFormat() and default to it at some point.
You also have MatchColorFormat() from Raffriff42, and yesterday discovered HistogramRGB.avsi where it includes ConvertToMatch().
And can you give me any posible contact when your massage full??
kedautinh12 is offline   Reply With Quote
Old 24th December 2021, 13:39   #707  |  Link
TDS
Formally known as .......
 
TDS's Avatar
 
Join Date: Sep 2021
Location: On a need to know basis.
Posts: 896
Quote:
Originally Posted by Dogway View Post
Yes, it's full many years 'round here. I have very "interesting" PM so I don't want to delete them ^^
I made MatchClip() to match format from clip 'a' to 'b'. In fast mode (default) it should work fine, my goal is to finish ConvertFormat() and default to it at some point.
You also have MatchColorFormat() from Raffriff42, and yesterday discovered HistogramRGB.avsi where it includes ConvertToMatch().
Hi Dogway,

Yes, you can indeed save your PM's (all at once), to either a .csv, .xml or .txt

Go to your PM page, select your PM's (top right hand corner, check box), then bottom right hand corner "Selected Messages", drop down to show option menu.

Then you can start again, with new "interesting" PM, as StainlessS mentioned.
__________________
Long term RipBot264 user.

RB 1.27.1 (std)
RB 1.27.1 (fully loaded, OOD)
PD 7.5 (new)
TDS is offline   Reply With Quote
Old 24th December 2021, 14:20   #708  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,130
I met error with match clip:
Quote:
ConvertToYV411: only 8 bit sources allowed
(C:/Program Files (x86)/AviSynth+/plugins64+/TransformsPack.avsi, line 144)
(C:/Program Files (x86)/AviSynth+/plugins64+/TransformsPack.avsi, line 145)
(C:/Program Files (x86)/AviSynth+/plugins64+/TemporalDegrain-v2.4.1.avsi, line 440)
(C:/Program Files (x86)/AviSynth+/plugins64+/TemporalDegrain-v2.4.1.avsi, line 345)
(C:\Megui\AVSMeter3090\td-002.mkv.avs, line 4)
can you tell me any error with this function??
Quote:
function DT_BM3D(clip a, float "sigma", int "radius", bool "CUDA", bool "chroma", int "device_id") {

s = Default(sigma, 3)
r = Default(radius, 1)
cd = Default(CUDA, true)
chr = Default(chroma, false)
device_id = Default(device_id, 0)
r = min(r,3) # Buggy when r > 3
a
ch = ((chr == true) && !Is444(a))
ch ? ConverttoYUV444(chromaresample="spline16") : last
cd ? BM3D_CUDA(sigma=s, radius=r, chroma=chr, fast=true, extractor_exp=6, device_id=device_id) : \
BM3D_CPU (sigma=s, radius=r, chroma=chr)
BM3D_VAggregate(radius=r)
ConvertBits(16, dither=1)
ch ? MatchClip(a) : mergechroma(a)
}
kedautinh12 is offline   Reply With Quote
Old 24th December 2021, 22:54   #709  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,351
Thx, yes PMs when Doom9 was an hostile place. I like to keep a record of internet beefs as fun facts ^^
I will do backup then to start anew for the new year.

@kedautinh12: Are you testing with 411 clip? AVS+ doesn't support HBD 411, and BM3D doesn't support anything less than 32-bit.

You can fix the function with ConvertBits(BitsPerComponent(a)) before MatchClip(a), I need to implement range and bitdepth matching into MatchClip() (already done), will update soon.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread
Dogway is offline   Reply With Quote
Old 25th December 2021, 00:06   #710  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,130
Quote:
Originally Posted by Dogway View Post
Thx, yes PMs when Doom9 was an hostile place. I like to keep a record of internet beefs as fun facts ^^
I will do backup then to start anew for the new year.

@kedautinh12: Are you testing with 411 clip? AVS+ doesn't support HBD 411, and BM3D doesn't support anything less than 32-bit.

You can fix the function with ConvertBits(BitsPerComponent(a)) before MatchClip(a), I need to implement range and bitdepth matching into MatchClip() (already done), will update soon.
I'm testing with 420 clip

edit: i added ConvertBits(BitsPerComponent(a)) but error still exist. I don't know why my testing clip is 420 but when use with MatchClip(a), it's become 411

Last edited by kedautinh12; 25th December 2021 at 06:01.
kedautinh12 is offline   Reply With Quote
Old 25th December 2021, 23:24   #711  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,351
Can you show a small script showing the problem?
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread
Dogway is offline   Reply With Quote
Old 26th December 2021, 00:38   #712  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,130
script showing problem
Quote:
ConvertToYV411: only 8 bit sources allowed
(C:/Program Files (x86)/AviSynth+/plugins64+/TransformsPack.avsi, line 144)
(C:/Program Files (x86)/AviSynth+/plugins64+/TransformsPack.avsi, line 145)
(C:/Program Files (x86)/AviSynth+/plugins64+/TemporalDegrain-v2.4.1.avsi, line 442)
(C:/Program Files (x86)/AviSynth+/plugins64+/TemporalDegrain-v2.4.1.avsi, line 345)
(C:\Megui\AVSMeter3090\td-002.mkv.avs, line 4)
here my script
Quote:
function DT_BM3D(clip a, float "sigma", int "radius", bool "CUDA", bool "chroma", int "device_id") {

bi = BitsPerComponent(a)
s = Default(sigma, 3)
r = Default(radius, 1)
cd = Default(CUDA, true)
chr = Default(chroma, false)
devID = Default(device_id, 0)
r = min(r,3) # Buggy when r > 3
a
ch = ((chr == true) && !Is444(a))
ch ? ConverttoYUV444(chromaresample="spline16") : last
cd ? BM3D_CUDA(sigma=s, radius=r, chroma=chr, fast=true, extractor_exp=6, device_id=devID) : \
BM3D_CPU (sigma=s, radius=r, chroma=chr)
BM3D_VAggregate(radius=r)
ConvertBits(16, dither=1)
ConvertBits(bi)
ch ? MatchClip(a) : mergechroma(a)
}

Last edited by kedautinh12; 26th December 2021 at 00:41.
kedautinh12 is offline   Reply With Quote
Old 26th December 2021, 15:36   #713  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,351
That's not a script but a function declaration. Anyway I updated TransformsPack so check if it fixes your problem.

I'm going to rest for a month or so now, I will still be uploading updates but less frequently.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread
Dogway is offline   Reply With Quote
Old 26th December 2021, 16:08   #714  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,130
i updated and still error. my script:
Quote:
SetFilterMTMode("DEFAULT_MT_MODE", MT_MULTI_INSTANCE)
LoadPlugin("C:\Megui\MeGUI-2924-64\tools\lsmash\LSMASHSource.dll")
LWLibavVideoSource("C:\Megui\td-002.mkv")
TemporalDegrain2(postFFT=5)
TemporalDegrain test ver:
https://drive.google.com/file/d/1V3x...ew?usp=sharing
kedautinh12 is offline   Reply With Quote
Old 27th December 2021, 11:48   #715  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,351
It wasn't consistent with bitdepth. You converted to 32-bit before DT_BM3D, so afterwards DT_ContraSharpening was handling one clip in 16-bit and another in 32-bit.

Code:
  
  #---------------------------------------
  # post FFT

  fullClip = dgNR2
  
  fullSuper = (postTR > 0) ? fullClip.MSuper( pel=subpel, levels=1, chroma=ChromaNoise ) : NOP() 
  noiseWindow = (postTR == 0) ? fullClip :				\
                fullClip.MCompensate( fullSuper, vmulti.SelectRangeEvery(maxTR*2,postTR*2), tr=postTR, center=true, thSAD=thSAD2, thSCD1=thSCD1, thSCD2=thSCD2 )
                           
  dftDither = (postDither < 0) ? postDither*(-1) : 0
  postDither = (postFFT == 5 && postDither < 1) ? 1 : postDither  # ensure to ConvertBits down after BM3D
  dnWindow = (postFFT == 0) ? RemoveGrain( postDither > 1 ? noiseWindow.ConvertBits(16) : noiseWindow, mode=1) : \
             (postFFT == 1) ? neo_fft3d ( postDither > 0 ? noiseWindow.ConvertBits(16) : noiseWindow, y=LumaNoise?3:2, u=ChromaNoise?3:2, v=ChromaNoise?3:2, sigma=postSigma, bt=postTD, ncpu=fftThreads ) : \
             (postFFT == 11)? FFT3DFilter( postDither > 0 ? noiseWindow.ConvertBits(16) : noiseWindow, plane=degrainPlane, sigma=postSigma, bt=postTD, ncpu=fftThreads ) : \
             (postFFT == 2) ? FFT3DGPU( postDither > 0 ? noiseWindow.ConvertBits(16) : noiseWindow, plane=degrainPlane, sigma=postSigma*2/3, bt=postTD, precision=2, mode=1 ) : \
             (postFFT == 3) ? neo_dfttest( postDither > 0 ? noiseWindow.ConvertBits(16) : noiseWindow, y=LumaNoise?3:2, u=ChromaNoise?3:2, v=ChromaNoise?3:2, sigma=postSigma*4, tbsize=postTD, dither=dftDither, threads=fftThreads ) : \
             (postFFT == 13)? dfttest( postDither > 0 ? noiseWindow.ConvertBits(16) : noiseWindow, Y=LumaNoise, U=ChromaNoise, V=ChromaNoise, sigma=postSigma*4, tbsize=postTD, threads=fftThreads, dither=dftDither ) : \
             (postFFT == 4) ? DT_KNLMeansCL( postDither > 0 ? noiseWindow.ConvertBits(16) : noiseWindow, a=2, d=postTR, h=postSigma, Luma = LumaNoise, Chroma = ChromaNoise, device_type="GPU", device_id=devId) : \
             (postFFT == 5) ? DT_BM3D( postDither > 0 ? noiseWindow.ConvertBits(16) : noiseWindow, radius=postTR, sigma=postSigma, CUDA=cuda, chroma=ChromaNoise, device_id=devId ) : \
             (postFFT == -1)? HQDn3D( postDither > 0 ? noiseWindow.ConvertBits(16) : noiseWindow, 0,0,4,1, u=ChromaNoise?3:2, v=ChromaNoise?3:2) : NOP()
  dnWindow = dnWindow.SelectEvery( postTD, postTR )
  denoised = (postDither == 1) ? dnWindow.ConvertBits(outputBits,dither=1) : dnWindow

  csOrg = (postDither == 2) ? dgO.ConvertBits(16) : dgO
  sharpened = DT_ContraSharpening(denoised, csOrg, extraSharp)
  sharpened = (postDither == 2) ? sharpened.ConvertBits(outputBits,dither=1) : sharpened
  
  # mix with original to leave the posibility to decrease the denoising strength
  sharpened = postMix > 0 ? mt_lutxy(dgO,sharpened,"x "+String(postMix)+" * y "+String(int(100-postMix))+" * + 100 /") : sharpened

  # Crop off temporary vertical padding
  cropped = sharpened
  
  output = debug ? Select(outputStage, dgNR1x, dgNR2, cropped, repair0, spatialBlur, srchClip, dgLimit, denoised) : Select(outputStage, dgNR1x, dgNR2, cropped)
  return output
}


function DT_BM3D(clip a, float "sigma", int "radius", bool "CUDA", bool "chroma", int "device_id") {

    bi = BitsPerComponent(a)
    s     = Default(sigma,      3)
    r     = Default(radius,     1)
    cd    = Default(CUDA,    true)
	chr   = Default(chroma, false)
	devID = Default(device_id,  0)
    r     = min(r,3) # Buggy when r > 3
    a
	ch = ((chr == true) && !Is444(a))
    ch ? ConverttoYUV444(chromaresample="spline16").ConvertBits(32) : ConvertBits(32)
    cd ? BM3D_CUDA(sigma=s, radius=r, chroma=chr, fast=true, extractor_exp=6, device_id=devID) : \
         BM3D_CPU (sigma=s, radius=r, chroma=chr)
    BM3D_VAggregate(radius=r)
	ConvertBits(bi, dither=1)
    ch ? MatchClip(a) : mergechroma(a)
}
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread
Dogway is offline   Reply With Quote
Old 27th December 2021, 14:28   #716  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,351
By the way, last night I had an enlightenment and today I refactored ex_vibrance(). Fast, HBD support and straight to the point. 'Recover' mode also works now to recover lost saturation by filtering, derainbows, etc. I plan to revisit SkinQualifier soon.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread
Dogway is offline   Reply With Quote
Old 27th December 2021, 18:34   #717  |  Link
anton_foy
Registered User
 
Join Date: Dec 2005
Location: Sweden
Posts: 702
Quote:
Originally Posted by Dogway View Post
By the way, last night I had an enlightenment and today I refactored ex_vibrance(). Fast, HBD support and straight to the point. 'Recover' mode also works now to recover lost saturation by filtering
That sounds amazing just what I need!
anton_foy is offline   Reply With Quote
Old 27th December 2021, 19:47   #718  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,351
Yes, I remember when you needed something similar a few months back. Recover mode never was implemented so this is some achievement, actually it was very easy, just divide the masks but I wasn't so math savvy then.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread
Dogway is offline   Reply With Quote
Old 28th December 2021, 09:30   #719  |  Link
Fjord
Registered User
 
Join Date: Dec 2005
Location: Denmark
Posts: 52
typo TransformsPack v1.0RC30 line 2822 ?

Fantastic collection of functions with references!
Just browsing your code - noted a string with trailing space "CAM16 " at line 2822 in function Format_fuzzy_search(...)
...
cm=
...
\ : (FindStr(model, "CAM16" )>0) ? ["CAM16 ", "YUV",34]

I assume the trailing space is unintentional.
Fjord is offline   Reply With Quote
Old 28th December 2021, 13:03   #720  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,351
Yes, thanks! Anyway many models aren't implemented yet, CAM16 is said to be complex while not being so uniform as recent ones. TransformsPack (namely ConvertFormat()) is a long term project, the rest are pretty mature.

I updated GradePack with some optimizations for ex_vibrance() and a new filter, Skin_Qualifier() to create skin masks. It works like raffriff42's SmoothHueMask() with different false positives, but generally less amount of them. It's also slower since it's processed in HBD internally and a conversion to OkLab is performed for perceptually uniform HUE. Runs at about 60fps on my CPU -Prefetch(8)-

I'm going now to implement HSVxHSV, that is; HUExHUE, HUExSAT, SATxLUM, etc.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread
Dogway is offline   Reply With Quote
Reply

Tags
avisynth, dogway, filters, hbd, packs

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 18:37.


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