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 28th December 2021, 18:01   #721  |  Link
anton_foy
Registered User
 
Join Date: Dec 2005
Location: Sweden
Posts: 703
Quote:
Originally Posted by Dogway View Post
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.
Although I am not able to try it yet, it is mentioned in the description that it needs the info from the source clip and filtered clip(-rc/reference clip) right?
So if I want it to recover saturation after I have denoised/filtered the clip how do I do that? Maybe stupid question but I thought if I call ex_vibrance(md="recover",rc=filtered) after filtering/denoise the source is then already filtered? Or should I put the script like this:
Code:
a=last
Filtered=*some denoiser*
ex_vibrance(md="recover",rc=filtered)
?

EDIT: ah stupid of me! I see now that the rc-clip is the source and a=filtered of course. Forget what I just wrote.

Last edited by anton_foy; 28th December 2021 at 18:05.
anton_foy is offline   Reply With Quote
Old 28th December 2021, 18:22   #722  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,361
Yes that's right, rc is the reference clip (before being filtered). I think this will be very useful specially with fft3d which smears chroma a lot, but at the same time is very good for derainbow.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread
Dogway is offline   Reply With Quote
Old 28th December 2021, 20:39   #723  |  Link
anton_foy
Registered User
 
Join Date: Dec 2005
Location: Sweden
Posts: 703
Quote:
Originally Posted by Dogway View Post
Yes that's right, rc is the reference clip (before being filtered). I think this will be very useful specially with fft3d which smears chroma a lot, but at the same time is very good for derainbow.
Yes precisely this with fft3d I refered to in a previous thread but I think my explanation was confusing. I would like to understand the "mechanism" behind your recover-mode, maybe the same concept could apply for sharpening and other things if modified. But I think your math knowledge will go far over my head for me to understand it.
anton_foy is offline   Reply With Quote
Old 28th December 2021, 20:50   #724  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,361
Actually it's the same concept as sharpening. For sharpening you subtract a blurred version with the original, if you remove the low frequency (blurred) to an image you are left with the high frequencies, add this high frequency to the original and that's sharpening.

For saturation (recovery mode) it's the same but this time I used division and multiplication, don't know why, maybe it also works with subtract and sum. Basically get the saturation mask of the original and filtered, do a difference and add back to the filtered.

Maths are easy if explained well I think. I'm buying some math books this xmas, would like to get into NN and Julia in the future but I always find myself busy with some other stuff.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread
Dogway is offline   Reply With Quote
Old 30th December 2021, 16:34   #725  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,156
Quote:
Originally Posted by Dogway View Post
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)
}
If change same you. Problem still exist
kedautinh12 is offline   Reply With Quote
Old 30th December 2021, 17:25   #726  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,361
It worked for me, with the same call.

By the way, I uploaded a YUV to RGB GamutWarning() filter.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread
Dogway is offline   Reply With Quote
Old 31st December 2021, 01:39   #727  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,156
Quote:
Originally Posted by Dogway View Post
It worked for me, with the same call.

By the way, I uploaded a YUV to RGB GamutWarning() filter.
Can you check with this video??
https://drive.google.com/file/d/1wSL...RTkoFYfAB/view
kedautinh12 is offline   Reply With Quote
Old 31st December 2021, 02:12   #728  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,361
Just tested and works just fine. Maybe test with an older AvspMod. I haven't updated yet to latest because didn't have time to go one by one updating function definitions.
Another thing might be plugin version (?). In these cases I empty the plugin folder with the minimum necessary and updated versions of scripts+plugins.

Is still the same 411 error? Sounds strange to me.

Another option for debugging is delete all the function outputs starting from the bottom, until you don't get an exception error, so you know where it fails.

Code:
setmemorymax(2048)
ffvideosource("...Desktop\td-002.mkv")
TemporalDegrain2(postFFT=5,debug=false)
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread

Last edited by Dogway; 31st December 2021 at 02:27.
Dogway is offline   Reply With Quote
Old 31st December 2021, 20:36   #729  |  Link
DTL
Registered User
 
Join Date: Jul 2018
Posts: 1,063
With some progress on DX12_ME it going to the question: Do SAD output from MAnalyse is (always) required for large hand-writed scripts using mvtools ? May be for some intermediate processing only x,y MVs components are enough ?

Currently I think calculating SAD for received from HWAcc MVs field takes about same time as MVs data path to and from HWAcc. So I think to make 'SAD-less' option for MAnalyse with DX12_ME search option.

With MDegrainN calculating SAD in MAnalyse makes processing slower because twice memory read for SAD in MAnalyse and for blocks blending in MDegrainN. So for faster still 2-filters based MDegrainN+MAnalyse it is faster to make option to MAnalyse do not calculate SAD and make MDegrainN signalling to calculate SAD before weights calculating.

As MAnalyse is core engine for MVtools to it looks nice to have some DX12_ME support but for much faster MDegrainN it is planned to make in the future total-in-HWAcc processing so much fewer options for MDegrainN will be (and no MAnalyse at all). Current Windows API for DX12_ME only support selecting block size of 8x8 or 16x16. Still do not test if 16x16 is faster (may be). Disabling load of chroma planes will possilby make very few speed gain because in YV12 they are small. The HW_ME always use chroma internally and 4:2:0 only. Also the pel is fixed to quater that is nice for quality but very slow in outer mvtools data flow. So for speed it is currently truncated to 1 (full pel).

Need testers for quality of currently available via Microsoft API ME - is it more or less usable and how compared with MAnalyse CPU-based search algoriphms. There is an ideas that NDIVIA-API ME (Optical Flow - latest generations) will be better. May be more settings for quality-speed balance avaialble. But it is limited to only NVIDIA hardware and still not implemented in AVS plugin.

Current testbuild and instructions in https://forum.doom9.org/showthread.p...71#post1960271

Last edited by DTL; 31st December 2021 at 20:44.
DTL is online now   Reply With Quote
Old 31st December 2021, 23:26   #730  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,361
Yes, some tests would be needed to ensure MDegrainN-only-SAD is enough to keep quality, I'm not sure of the implications but calculating twice sounds like redundant (?), maybe testing with Zopti. Ideally one single client should be enough (ie. MDegrainN), currently the problem was that MDegrainN was slower than MDegrainX but integrating everything into MDegrainN and fixing its speed issues should make up for it.

Unfortunately I'm still on Win7 so can't test. I would like to test some GPU AI based optical flow filter in AVS+. My GTX 1070 also only supports Video Codec SDK 7.0+ (not even Optical Flow SDK 1.0) of NVIDIA-API ME. Been wanting to buy an Ampere at a reasonably price for a year because there are no more drivers for Win7 since August.

The field that covers this is "optimal control", I'm still studying statistics and probability but maybe in a future I can dive into this and Rust programming.

Have been busy today with HSVxHSV(), almost but not there yet, maybe tomorrow. Then Harris corner, and then I will have a look at the SAD analysis code block. The thing is that I'm calculating SAD in the spatial domain and deriving this to MVTools which calculates SAD in temporal domain so spatial always has preference over temporal at least for first pass and refined later in a second pass.

EDIT: and Happy New Year everyone! Gorgeous year 2021 for AVS+.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread

Last edited by Dogway; 1st January 2022 at 00:45.
Dogway is offline   Reply With Quote
Old 1st January 2022, 05:35   #731  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,156
Quote:
Originally Posted by Dogway View Post
Just tested and works just fine. Maybe test with an older AvspMod. I haven't updated yet to latest because didn't have time to go one by one updating function definitions.
Another thing might be plugin version (?). In these cases I empty the plugin folder with the minimum necessary and updated versions of scripts+plugins.

Is still the same 411 error? Sounds strange to me.

Another option for debugging is delete all the function outputs starting from the bottom, until you don't get an exception error, so you know where it fails.

Code:
setmemorymax(2048)
ffvideosource("...Desktop\td-002.mkv")
TemporalDegrain2(postFFT=5,debug=false)
it's still 411 error. I don't know why

edit: it's only work if i used script
Quote:
LoadPlugin("C:\Megui\MeGUI-2924-64\tools\ffms\ffms2.dll")
FFVideoSource("C:\Megui\td-002.mkv")
Converttoyuv444()
TemporalDegrain2(postFFT=5)
prefetch(2)

Last edited by kedautinh12; 1st January 2022 at 05:57.
kedautinh12 is offline   Reply With Quote
Old 1st January 2022, 13:00   #732  |  Link
DTL
Registered User
 
Join Date: Jul 2018
Posts: 1,063
" calculating twice sounds like redundant (?)"

Not twice but in one of two places - either in MAnalyse or in MDegrain. I hope it can be auto-signaled from MAnalyse to MDegrain via current control path if the output stream from MAnalyse have valid SAD data or not. So for script writers it is easier - not need to set params in both MAnalyse and MDegrain about stream format inbetween - having valid SAD data or not.

Current speed problem of multi-frame ('temporal') denoising - too large 'internal' memory traffic.

Outside traffic for processing N input frames to output N frames is N-frames read and write to host memory.

In 'classic MVtools':
1. MAnalyse MVs search based on SAD - (2 * tr ) src+ref pairs = it is 4 * tr memory read ops
2. MDegrain (no-overlap) frames blending - (2 * tr + 1) memory read ops
Total is 4 * tr + (2 * tr + 1) = 6 * tr+1 memory read frames per 1 output frame. For tr 10..20 (0.5..1 seconds at 25 fps) it is 60..120 memory read frames for 1 output frame.

If enabling overlap MDegrain processing - it makes about 2..4x more memory read traffic at MDegrain processing stage and much slower processing. So I currently making no-overlap 'interpolated-weighting' blending mode for MDegrainN.

In current testbuild:
1. DX12_ME read (convert to NV12) for uploading is (2 * tr ) ref + 1 source = (2 * tr + 1)
2. MAnalyse SAD calculation (2 * tr) src+ref pairs = 4 * tr
3. MDegrain (no-overlap) frames blending - (2 * tr + 1) memory read ops
total (2 * tr + 1) + 4 * tr + (2 * tr + 1) = 8 * tr + 2. It looks it close to doubling of host memory read traffic mostly compensates speed gain from hardware motion search.

The best solution (in future) - put all internal memory traffic in HWAcc board memory. It will have N frames in -> N frames out. Speed host memory limited close to any AVS filter like 'Levels'. But it need more DirectX texture operating programming. The SAD is simple dot-product of 2 matrixes blocks and alpha-blending of blocks is the natural operation for almost any graphics-accelerator. The only need to found how to select blocks of texture-resource for processing based on x,y coordinates of block inside resource. May be address texture coordinates for block-sized processing with disabled texture filtering. Need to read many new graphics API for possible ways or help of experienced DirectX/Direct3D programmer.

Faster to implement solution - put SAD calculation inside MDegrain memory reading (at least read stripes of blocks to calculate both SAD+weighting + blocks blending from L2/L3 CPU caches). It will limit memory traffic to:
1. DX12_ME read (convert to NV12) for uploading is (2 * tr ) ref + 1 source = (2 * tr + 1)
2. MDegrain (no-overlap) SAD + weight calculation and frames blending - (2 * tr + 1) memory read ops
total - about 4 * tr + 2 - about doubling speed limited by memory read from current testbuild.

But it will break compatibility of MAnalyse-server with other clients of mvtools environment currently (if they use both MVs and SAD from MAnalyse output - not know which may use).

Even more best solution - but in the unknown future: Ask AVS core developers to support AVS memory management of frames in DirectX resources - so a sequencies of filters may be processed in HWAcc memory/board without upload/download to host CPU memory. It is possibly now somehow implemented for CUDA but it is possibly limited to NVIDIA chips only.

Last edited by DTL; 1st January 2022 at 13:20.
DTL is online now   Reply With Quote
Old 1st January 2022, 22:42   #733  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,361
Maaaan, so tired. Finished a first version of HSVxHSV.
I'm not sure it works with current ExTools as I had to make a few changes but I created a video of the tool.
Since this is a concept of the color grading field maybe some of you might not be acquainted with these type of operators. Basically you change Hue, Saturation or Value, depending on a narrow portion of Hue, Saturation or Value. The most common operator that you might see most is HUExSAT but here there are all 9 of them.

modeAxHUE operators are still not included because it requires a bit more work (explicit U and V expressions) and also I'm a bit tired as of current.

I made a video so you get the grasp of it, maybe not the best example as there is not much HUE or SAT variation in the frame.

https://youtu.be/2OO05kFcdVE


@kedautinh12: I think there might be an issue on your end. Try to debug it as I explained above, line by line.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread
Dogway is offline   Reply With Quote
Old 2nd January 2022, 02:59   #734  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,156
I think if change yuv411 to yuv420 in matchclip. error won't exist anymore
Quote:
function MatchClip (clip a, clip b, string "kernel", string "matrix", bool "props", bool "length", bool "fast") {

krn = Default (kernel, "Spline16")
fst = Default (fast, true)
fp = Default (props, true)
mfc = Default (length, false) # Match also framecount

YUY2 = b.IsYUY2()
rgbb = b.isRGB() rgba = a.isRGB()
w = b.width() wa = a.width()
h = b.height() ha = a.height()
fc = b.FrameCount() fca = a.FrameCount()
p_type = b.PixelType() p_typea = a.PixelType()
bib = b.BitsPerComponent() bia = a.BitsPerComponent()

propIDs = color_propGet(b)

fs = propNumElements(a,"_ColorRange") > 0 ? \
propGetInt (a,"_ColorRange") == 0 : rgba

fd = propIDs[6]

isUHD = (w > 2599 || h > 1499)
isUHDa = (wa > 2599 || ha > 1499)

mat = Default(matrix, propIDs[2])
mat = ReplaceStr(mat, "Rec", "")


a
yv420 = b.is420() yv420a = a.is420()
yv444 = b.is444() yv444a = a.is444()
!yv420 && bib > bia ? ConvertBits(bib, fulls=fs, fulld=fs) : last

if (!fst) {

ConvertFormat(w, h, fmt_in=p_typea, fmt_out=p_type, cs_in=mat, cs_out="", kernel=krn, tv_range_in=!fs, tv_range_out=!fd, fulls=fs, fulld=fd, show=false)

} else {

rgbp = rgbb && b.isPlanar()
isScl = w != wa || h != ha
mod = rgba && rgbb || isy(a) && isy(b) ? 1 : 2

fmt = Format_fuzzy_search(b, p_type, bib)
fmta = Format_fuzzy_search(a, p_typea, bia)
bc = bicubic_coeffs(krn)
krn = bc[1]>=0. ? "Bicubic" : krn

cplace = rgbb || yv444 || yv420 ? "MPEG1" : isUHD ? "top_left" : "MPEG2"
cplacea = rgba || yv444a || yv420a ? "MPEG1" : isUHDa ? "top_left" : "MPEG2"
not42 = LeftStr(fmta[1],2) != "42"

# Match dimensions
isScl ? w > h ? RatioResize(w,mode="adjust2w",kernel=krn,mod=mod,b=bc[0],c=bc[1]) : \
RatioResize(h,mode="adjust2h",kernel=krn,mod=mod,b=bc[0],c=bc[1]) : last
PadResize(w,h,mode="dilate", mod=mod)

# ConvertBackToYUY2 bug: https://forum.doom9.org/showthread.p...27#post1038027
isy(b) ? rgba ? DotClip([0.298903,0.586620,0.114477]) : ConvertToY(mat) : \
rgbb ? rgbp ? Eval( "ConvertToPlanarRGB (mat,interlaced=false"+(yv420a || rgba ? ")" : ",ChromaInPlacement=cplacea, chromaresample=krn)")) : \
Eval( "ConvertTo" +string(fmt[3])+"(mat,interlaced=false"+(yv420a || rgba ? ")" : ",ChromaInPlacement=cplacea, chromaresample=krn)")) : \
yv420 ? Eval( "ConvertToYUV420 (false,mat," +(not42 ? "" : """ChromaInPlacement=cplacea, """)+"chromaresample=krn)") : \
YUY2 && rgba ? Eval("""ConvertBackToYUY2 ( mat """) : \
Eval( "ConvertToYUV"+string(fmt[1])+"(false,mat" +(not42 ? "" : ",ChromaInPlacement=cplacea")+(yv444 ? ")" : ",chromaresample=krn, ChromaOutPlacement=cplace)"))
}

clr = !rgbb ? fd ? $008080 : $108080 : \
fd ? $000000 : $101010

!yv420 ? bia > bib ? ConvertBits(bib, dither=1, fulls=fd, fulld=fd) : \
ConvertBits(bib, fulls=fd, fulld=fd) : last
mfc ? fca > fc ? Trim(last, fc-1) : last+BlankClip(b,fc-1,color_yuv=clr) : last

# Planar to Interleaved
YUY2 && !rgba ? ConvertToYUY2() : last

# Frame Properties
if (fst && fp) {
ID = Color_Fuzzy_search(mat)
PropCopy(b)
fd != fs ? PropSet("_ColorRange", fd ? 1 : 0) : last # Overrides the Convertto props
PropSet("_Matrix", ID[1]) # Overrides the Convertto props
PropSet("_Primaries", ID[2]) } } # Disable this line and above when convertto supports writing to RGB frameprops (currently RGB is hardcoded to _Matrix 0 and _Primaries 2 -undefined-)
kedautinh12 is offline   Reply With Quote
Old 2nd January 2022, 07:47   #735  |  Link
anton_foy
Registered User
 
Join Date: Dec 2005
Location: Sweden
Posts: 703
Quote:
Originally Posted by Dogway View Post
Maaaan, so tired. Finished a first version of HSVxHSV.
I'm not sure it works with current ExTools as I had to make a few changes but I created a video of the tool.
Since this is a concept of the color grading field maybe some of you might not be acquainted with these type of operators. Basically you change Hue, Saturation or Value, depending on a narrow portion of Hue, Saturation or Value. The most common operator that you might see most is HUExSAT but here there are all 9 of them.

modeAxHUE operators are still not included because it requires a bit more work (explicit U and V expressions) and also I'm a bit tired as of current.

I made a video so you get the grasp of it, maybe not the best example as there is not much HUE or SAT variation in the frame.

https://youtu.be/2OO05kFcdVE
Wow great work! Wonder how this will result when denoising in this mode.
I will put to the test in the evening.
anton_foy is offline   Reply With Quote
Old 2nd January 2022, 13:19   #736  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,361
@anton_foy: It's to colors what ex_luts() is to convolutions, a powerhouse filter. With show=2 you can reuse the mask for further filtering also. I will try today to finish the modeAxHUE and redo the video with a better sample with more variance on HUE and SAT. I will also reparametrize 'dA' ( I will rename to degrees or so ) because HUE and SAT values mostly live in the greys so like 1/3 of the dA range is unutilized. When I finish I will post some images here showing the latest filters.

@kedautinh12: If that works for you, fine. But it's wrong, you are going to have further issues with that, to name one YUV420 doesn't use MPEG1 chroma location. Aside from that you won't be able to MatchClip() to a 411 format.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread
Dogway is offline   Reply With Quote
Old 2nd January 2022, 13:21   #737  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
I think if change yuv411 to yuv420 in matchclip. error won't exist anymore
Maybe you should hi-lite the place where you changed YUV411 to YUV420.
[EDIT: There is no instance of "411" in your posted script]

EDIT: And YV411 should only really be used for input, and converted to something else [a horrible colourspace].
__________________
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; 2nd January 2022 at 13:26.
StainlessS is offline   Reply With Quote
Old 2nd January 2022, 16:33   #738  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,156
i know what affect to matchclip. Thanks
kedautinh12 is offline   Reply With Quote
Old 6th January 2022, 18:19   #739  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,361
After 5 restless days I finished HSVxHSV. Now all operators work over any bitdepth. For matching operators it's about double the speed of Tweak(). I made a new video showing the different operators. It's a bit random since it isn't supposed to be a tutorial, but you can see in the color plots how the sliders behave and how is my workflow by checking the mask back and forth.


To finish it I had to improve a few other functions for ExTools which in turn benefits overall all other packs, so TransformsPack was also updated.

I also want to showcase GamutWarning(), I implemented the EBU R-103 normative as well which is more lenient on limits.

And with EBU R-103



Finally I added x and y axis to the Curve Fitting Evaluator and fixed the 'positive' argument so it can also be scaled. This will come useful when debugging HDR.


Here is ex_contrast() showing the curve plot by using Curve Fitting Evaluator. It's integrated so simply call ex_contrast(0.7,show=true) (notice how the curve is within tv range [16-235] since the input is tv range as well)
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread

Last edited by Dogway; 8th January 2022 at 00:42.
Dogway is offline   Reply With Quote
Old 7th January 2022, 16:47   #740  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,361
@wonkey_monkey: I made a custom 48 inputs ranking order sorting network, I thought you might be interested to include it in the web app. It was a hard task because it uses two 24 inputs sorting networks but then you have to merge them, for this a Batcher Odd-Even sorting network should suffice but all the tools I found online only work with powers of 2, so 32 then 64, but 48 wasn't working. My idea was to add a before-last step of comparing inputs with a stride of 3, before final comparison of stride 2.

The only part I didn't do was multi-threading optimization or "layering" (interleaving the comparisons). I didn't find out by what mechanism it optimizes multi-threading so maybe you can find a pattern with your tool, specially those that are merged with a batcher odd-even merge method. After this if you are interested you can derive 47, 46, 45 or 44 inputs SN by deleting one last variable.

The other thing is this list skips variables X, Y and XX due to constraints with my filters, you might want to add those back.

48 inputs sorting network:
Code:
D Z        dup1 dup1 min D^ max Z^
L W        dup1 dup1 min L^ max W^
H V        dup1 dup1 min H^ max V^
A U        dup1 dup1 min A^ max U^
R T        dup1 dup1 min R^ max T^
N S        dup1 dup1 min N^ max S^
C Q        dup1 dup1 min C^ max Q^
J P        dup1 dup1 min J^ max P^
I O        dup1 dup1 min I^ max O^
B M        dup1 dup1 min B^ max M^
F K        dup1 dup1 min F^ max K^
E G        dup1 dup1 min E^ max G^
U Z        dup1 dup1 min U^ max Z^
M W        dup1 dup1 min M^ max W^
Q V        dup1 dup1 min Q^ max V^
G T        dup1 dup1 min G^ max T^
K S        dup1 dup1 min K^ max S^
E R        dup1 dup1 min E^ max R^
O P        dup1 dup1 min O^ max P^
F N        dup1 dup1 min F^ max N^
B L        dup1 dup1 min B^ max L^
I J        dup1 dup1 min I^ max J^
C H        dup1 dup1 min C^ max H^
A D        dup1 dup1 min A^ max D^
W Z        dup1 dup1 min W^ max Z^
T V        dup1 dup1 min T^ max V^
L U        dup1 dup1 min L^ max U^
P S        dup1 dup1 min P^ max S^
O R        dup1 dup1 min O^ max R^
N Q        dup1 dup1 min N^ max Q^
D M        dup1 dup1 min D^ max M^
H K        dup1 dup1 min H^ max K^
G J        dup1 dup1 min G^ max J^
F I        dup1 dup1 min F^ max I^
C E        dup1 dup1 min C^ max E^
A B        dup1 dup1 min A^ max B^
S V        dup1 dup1 min S^ max V^
P T        dup1 dup1 min P^ max T^
M R        dup1 dup1 min M^ max R^
J Q        dup1 dup1 min J^ max Q^
H O        dup1 dup1 min H^ max O^
G L        dup1 dup1 min G^ max L^
E I        dup1 dup1 min E^ max I^
C F        dup1 dup1 min C^ max F^
P W        dup1 dup1 min P^ max W^
J U        dup1 dup1 min J^ max U^
Q T        dup1 dup1 min Q^ max T^
D O        dup1 dup1 min D^ max O^
L N        dup1 dup1 min L^ max N^
K M        dup1 dup1 min K^ max M^
B I        dup1 dup1 min B^ max I^
E H        dup1 dup1 min E^ max H^
Q Z        dup1 dup1 min Q^ max Z^
S W        dup1 dup1 min S^ max W^
T U        dup1 dup1 min T^ max U^
M R        dup1 dup1 min M^ max R^
I P        dup1 dup1 min I^ max P^
J O        dup1 dup1 min J^ max O^
K N        dup1 dup1 min K^ max N^
G L        dup1 dup1 min G^ max L^
A H        dup1 dup1 min A^ max H^
B F        dup1 dup1 min B^ max F^
D E        dup1 dup1 min D^ max E^
V Z        dup1 dup1 min V^ max Z^
R W        dup1 dup1 min R^ max W^
Q T        dup1 dup1 min Q^ max T^
O S        dup1 dup1 min O^ max S^
N P        dup1 dup1 min N^ max P^
I K        dup1 dup1 min I^ max K^
F J        dup1 dup1 min F^ max J^
E H        dup1 dup1 min E^ max H^
B G        dup1 dup1 min B^ max G^
A C        dup1 dup1 min A^ max C^
U V        dup1 dup1 min U^ max V^
S T        dup1 dup1 min S^ max T^
P R        dup1 dup1 min P^ max R^
O Q        dup1 dup1 min O^ max Q^
M N        dup1 dup1 min M^ max N^
K L        dup1 dup1 min K^ max L^
H J        dup1 dup1 min H^ max J^
G I        dup1 dup1 min G^ max I^
E F        dup1 dup1 min E^ max F^
C D        dup1 dup1 min C^ max D^
V W        dup1 dup1 min V^ max W^
R U        dup1 dup1 min R^ max U^
N T        dup1 dup1 min N^ max T^
P Q        dup1 dup1 min P^ max Q^
M O        dup1 dup1 min M^ max O^
J L        dup1 dup1 min J^ max L^
E K        dup1 dup1 min E^ max K^
H I        dup1 dup1 min H^ max I^
D G        dup1 dup1 min D^ max G^
B C        dup1 dup1 min B^ max C^
U V        dup1 dup1 min U^ max V^
N S        dup1 dup1 min N^ max S^
Q R        dup1 dup1 min Q^ max R^
O P        dup1 dup1 min O^ max P^
F K        dup1 dup1 min F^ max K^
I J        dup1 dup1 min I^ max J^
G H        dup1 dup1 min G^ max H^
C D        dup1 dup1 min C^ max D^
T U        dup1 dup1 min T^ max U^
Q S        dup1 dup1 min Q^ max S^
L N        dup1 dup1 min L^ max N^
K M        dup1 dup1 min K^ max M^
F H        dup1 dup1 min F^ max H^
D E        dup1 dup1 min D^ max E^
R T        dup1 dup1 min R^ max T^
N P        dup1 dup1 min N^ max P^
L O        dup1 dup1 min L^ max O^
J M        dup1 dup1 min J^ max M^
I K        dup1 dup1 min I^ max K^
E G        dup1 dup1 min E^ max G^
R S        dup1 dup1 min R^ max S^
P Q        dup1 dup1 min P^ max Q^
N O        dup1 dup1 min N^ max O^
L M        dup1 dup1 min L^ max M^
J K        dup1 dup1 min J^ max K^
H I        dup1 dup1 min H^ max I^
F G        dup1 dup1 min F^ max G^

UU AA        dup1 dup1 min UU^ max AA^
MM BB        dup1 dup1 min MM^ max BB^
QQ CC        dup1 dup1 min QQ^ max CC^
YY DD        dup1 dup1 min YY^ max DD^
GG EE        dup1 dup1 min GG^ max EE^
KK FF        dup1 dup1 min KK^ max FF^
VV HH        dup1 dup1 min VV^ max HH^
OO II        dup1 dup1 min OO^ max II^
PP JJ        dup1 dup1 min PP^ max JJ^
WW LL        dup1 dup1 min WW^ max LL^
SS NN        dup1 dup1 min SS^ max NN^
TT RR        dup1 dup1 min TT^ max RR^
DD AA        dup1 dup1 min DD^ max AA^
LL BB        dup1 dup1 min LL^ max BB^
HH CC        dup1 dup1 min HH^ max CC^
RR EE        dup1 dup1 min RR^ max EE^
NN FF        dup1 dup1 min NN^ max FF^
TT GG        dup1 dup1 min TT^ max GG^
JJ II        dup1 dup1 min JJ^ max II^
SS KK        dup1 dup1 min SS^ max KK^
WW MM        dup1 dup1 min WW^ max MM^
PP OO        dup1 dup1 min PP^ max OO^
VV QQ        dup1 dup1 min VV^ max QQ^
YY UU        dup1 dup1 min YY^ max UU^
BB AA        dup1 dup1 min BB^ max AA^
EE CC        dup1 dup1 min EE^ max CC^
MM DD        dup1 dup1 min MM^ max DD^
II FF        dup1 dup1 min II^ max FF^
JJ GG        dup1 dup1 min JJ^ max GG^
KK HH        dup1 dup1 min KK^ max HH^
UU LL        dup1 dup1 min UU^ max LL^
QQ NN        dup1 dup1 min QQ^ max NN^
RR OO        dup1 dup1 min RR^ max OO^
SS PP        dup1 dup1 min SS^ max PP^
VV TT        dup1 dup1 min VV^ max TT^
YY WW        dup1 dup1 min YY^ max WW^
FF CC        dup1 dup1 min FF^ max CC^
II EE        dup1 dup1 min II^ max EE^
LL GG        dup1 dup1 min LL^ max GG^
OO HH        dup1 dup1 min OO^ max HH^
QQ JJ        dup1 dup1 min QQ^ max JJ^
RR MM        dup1 dup1 min RR^ max MM^
TT PP        dup1 dup1 min TT^ max PP^
VV SS        dup1 dup1 min VV^ max SS^
II BB        dup1 dup1 min II^ max BB^
OO DD        dup1 dup1 min OO^ max DD^
HH EE        dup1 dup1 min HH^ max EE^
UU JJ        dup1 dup1 min UU^ max JJ^
MM KK        dup1 dup1 min MM^ max KK^
NN LL        dup1 dup1 min NN^ max LL^
WW PP        dup1 dup1 min WW^ max PP^
TT QQ        dup1 dup1 min TT^ max QQ^
HH AA        dup1 dup1 min HH^ max AA^
FF BB        dup1 dup1 min FF^ max BB^
EE DD        dup1 dup1 min EE^ max DD^
LL GG        dup1 dup1 min LL^ max GG^
PP II        dup1 dup1 min PP^ max II^
OO JJ        dup1 dup1 min OO^ max JJ^
NN KK        dup1 dup1 min NN^ max KK^
RR MM        dup1 dup1 min RR^ max MM^
YY QQ        dup1 dup1 min YY^ max QQ^
WW SS        dup1 dup1 min WW^ max SS^
UU TT        dup1 dup1 min UU^ max TT^
CC AA        dup1 dup1 min CC^ max AA^
GG BB        dup1 dup1 min GG^ max BB^
HH EE        dup1 dup1 min HH^ max EE^
JJ FF        dup1 dup1 min JJ^ max FF^
KK II        dup1 dup1 min KK^ max II^
PP NN        dup1 dup1 min PP^ max NN^
SS OO        dup1 dup1 min SS^ max OO^
TT QQ        dup1 dup1 min TT^ max QQ^
WW RR        dup1 dup1 min WW^ max RR^
YY VV        dup1 dup1 min YY^ max VV^
DD CC        dup1 dup1 min DD^ max CC^
FF EE        dup1 dup1 min FF^ max EE^
II GG        dup1 dup1 min II^ max GG^
JJ HH        dup1 dup1 min JJ^ max HH^
LL KK        dup1 dup1 min LL^ max KK^
NN MM        dup1 dup1 min NN^ max MM^
QQ OO        dup1 dup1 min QQ^ max OO^
RR PP        dup1 dup1 min RR^ max PP^
TT SS        dup1 dup1 min TT^ max SS^
VV UU        dup1 dup1 min VV^ max UU^
CC BB        dup1 dup1 min CC^ max BB^
GG DD        dup1 dup1 min GG^ max DD^
KK EE        dup1 dup1 min KK^ max EE^
II HH        dup1 dup1 min II^ max HH^
LL JJ        dup1 dup1 min LL^ max JJ^
OO MM        dup1 dup1 min OO^ max MM^
TT NN        dup1 dup1 min TT^ max NN^
QQ PP        dup1 dup1 min QQ^ max PP^
UU RR        dup1 dup1 min UU^ max RR^
WW VV        dup1 dup1 min WW^ max VV^
DD CC        dup1 dup1 min DD^ max CC^
KK FF        dup1 dup1 min KK^ max FF^
HH GG        dup1 dup1 min HH^ max GG^
JJ II        dup1 dup1 min JJ^ max II^
SS NN        dup1 dup1 min SS^ max NN^
PP OO        dup1 dup1 min PP^ max OO^
RR QQ        dup1 dup1 min RR^ max QQ^
VV UU        dup1 dup1 min VV^ max UU^
EE DD        dup1 dup1 min EE^ max DD^
HH FF        dup1 dup1 min HH^ max FF^
MM KK        dup1 dup1 min MM^ max KK^
NN LL        dup1 dup1 min NN^ max LL^
SS QQ        dup1 dup1 min SS^ max QQ^
UU TT        dup1 dup1 min UU^ max TT^
GG EE        dup1 dup1 min GG^ max EE^
KK II        dup1 dup1 min KK^ max II^
MM JJ        dup1 dup1 min MM^ max JJ^
OO LL        dup1 dup1 min OO^ max LL^
PP NN        dup1 dup1 min PP^ max NN^
TT RR        dup1 dup1 min TT^ max RR^
GG FF        dup1 dup1 min GG^ max FF^
II HH        dup1 dup1 min II^ max HH^
KK JJ        dup1 dup1 min KK^ max JJ^
MM LL        dup1 dup1 min MM^ max LL^
OO NN        dup1 dup1 min OO^ max NN^
QQ PP        dup1 dup1 min QQ^ max PP^
SS RR        dup1 dup1 min SS^ max RR^



A B          dup1 dup1 min A^ max B^
C D          dup1 dup1 min C^ max D^
E F          dup1 dup1 min E^ max F^
G H          dup1 dup1 min G^ max H^
I J          dup1 dup1 min I^ max J^
K L          dup1 dup1 min K^ max L^
M N          dup1 dup1 min M^ max N^
O P          dup1 dup1 min O^ max P^
Q R          dup1 dup1 min Q^ max R^
S T          dup1 dup1 min S^ max T^
U V          dup1 dup1 min U^ max V^
W Z          dup1 dup1 min W^ max Z^
AA BB        dup1 dup1 min AA^ max BB^
CC DD        dup1 dup1 min CC^ max DD^
EE FF        dup1 dup1 min EE^ max FF^
GG HH        dup1 dup1 min GG^ max HH^
II JJ        dup1 dup1 min II^ max JJ^
KK LL        dup1 dup1 min KK^ max LL^
MM NN        dup1 dup1 min MM^ max NN^
OO PP        dup1 dup1 min OO^ max PP^
QQ RR        dup1 dup1 min QQ^ max RR^
SS TT        dup1 dup1 min SS^ max TT^
UU VV        dup1 dup1 min UU^ max VV^
WW YY        dup1 dup1 min WW^ max YY^
B II         dup1 dup1 min B^ max II^
D KK         dup1 dup1 min D^ max KK^
F MM         dup1 dup1 min F^ max MM^
H OO         dup1 dup1 min H^ max OO^
J QQ         dup1 dup1 min J^ max QQ^
L SS         dup1 dup1 min L^ max SS^
N UU         dup1 dup1 min N^ max UU^
P WW         dup1 dup1 min P^ max WW^
B Q          dup1 dup1 min B^ max Q^
D S          dup1 dup1 min D^ max S^
F U          dup1 dup1 min F^ max U^
H W          dup1 dup1 min H^ max W^
J AA         dup1 dup1 min J^ max AA^
L CC         dup1 dup1 min L^ max CC^
N EE         dup1 dup1 min N^ max EE^
P GG         dup1 dup1 min P^ max GG^
R II         dup1 dup1 min R^ max II^
T KK         dup1 dup1 min T^ max KK^
V MM         dup1 dup1 min V^ max MM^
Z OO         dup1 dup1 min Z^ max OO^
BB QQ        dup1 dup1 min BB^ max QQ^
DD SS        dup1 dup1 min DD^ max SS^
FF UU        dup1 dup1 min FF^ max UU^
HH WW        dup1 dup1 min HH^ max WW^
B I          dup1 dup1 min B^ max I^
D K          dup1 dup1 min D^ max K^
F M          dup1 dup1 min F^ max M^
H O          dup1 dup1 min H^ max O^
J Q          dup1 dup1 min J^ max Q^
L S          dup1 dup1 min L^ max S^
N U          dup1 dup1 min N^ max U^
P W          dup1 dup1 min P^ max W^
R AA         dup1 dup1 min R^ max AA^
T CC         dup1 dup1 min T^ max CC^
V EE         dup1 dup1 min V^ max EE^
Z GG         dup1 dup1 min Z^ max GG^
BB II        dup1 dup1 min BB^ max II^
DD KK        dup1 dup1 min DD^ max KK^
FF MM        dup1 dup1 min FF^ max MM^
HH OO        dup1 dup1 min HH^ max OO^
JJ QQ        dup1 dup1 min JJ^ max QQ^
LL SS        dup1 dup1 min LL^ max SS^
NN UU        dup1 dup1 min NN^ max UU^
PP WW        dup1 dup1 min PP^ max WW^
B E          dup1 dup1 min B^ max E^
D G          dup1 dup1 min D^ max G^
F I          dup1 dup1 min F^ max I^
H K          dup1 dup1 min H^ max K^
J M          dup1 dup1 min J^ max M^
L O          dup1 dup1 min L^ max O^
N Q          dup1 dup1 min N^ max Q^
P S          dup1 dup1 min P^ max S^
R U          dup1 dup1 min R^ max U^
T W          dup1 dup1 min T^ max W^
V AA         dup1 dup1 min V^ max AA^
Z CC         dup1 dup1 min Z^ max CC^
BB EE        dup1 dup1 min BB^ max EE^
DD GG        dup1 dup1 min DD^ max GG^
FF II        dup1 dup1 min FF^ max II^
HH KK        dup1 dup1 min HH^ max KK^
JJ MM        dup1 dup1 min JJ^ max MM^
LL OO        dup1 dup1 min LL^ max OO^
NN QQ        dup1 dup1 min NN^ max QQ^
PP SS        dup1 dup1 min PP^ max SS^
RR UU        dup1 dup1 min RR^ max UU^
TT WW        dup1 dup1 min TT^ max WW^
B C          dup1 dup1 min B^ max C^
D E          dup1 dup1 min D^ max E^
F G          dup1 dup1 min F^ max G^
H I          dup1 dup1 min H^ max I^
J K          dup1 dup1 min J^ max K^
L M          dup1 dup1 min L^ max M^
N O          dup1 dup1 min N^ max O^
P Q          dup1 dup1 min P^ max Q^
R S          dup1 dup1 min R^ max S^
T U          dup1 dup1 min T^ max U^
V W          dup1 dup1 min V^ max W^
Z AA         dup1 dup1 min Z^ max AA^
BB CC        dup1 dup1 min BB^ max CC^
DD EE        dup1 dup1 min DD^ max EE^
FF GG        dup1 dup1 min FF^ max GG^
HH II        dup1 dup1 min HH^ max II^
JJ KK        dup1 dup1 min JJ^ max KK^
LL MM        dup1 dup1 min LL^ max MM^
NN OO        dup1 dup1 min NN^ max OO^
PP QQ        dup1 dup1 min PP^ max QQ^
RR SS        dup1 dup1 min RR^ max SS^
TT UU        dup1 dup1 min TT^ max UU^
VV WW        dup1 dup1 min VV^ max WW^
__________________
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 09:29.


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