Log in

View Full Version : MDegrain+DePan (pls help with GScript for loop and arrays)


redfordxx
22nd January 2020, 00:33
Hi, I just wanna share in case someone's interested:
DePanGrain avs function in attachment


LSMASHVideoSource("20200111_174931.mp4")
DePanGrain (3, 3, input_log="20200111_174931.log", blk_size=16)

I think this denoises better than w/o DePan.
I think the result is sharper...
...but slow.

The log here comes from DeShaker.

function DePanGrain ( clip src, int delta_an, int delta_pan, string "input_log", int "blk_size")
At this moment it does not support delta_an<>delta_pan ...I will add that later....

redfordxx
25th January 2020, 10:34
Please can someone help me, how to rewrite the code below using AVS+ GScript with for loop and probably arrays...
So I can make that function more general...
d1 = (delta_pan < 1) ? src.Trim(1,0) : src.DePan(src,inputlog=input_log, info=false, offset= 1)
d2 = (delta_pan < 2) ? src.Trim(2,0) : src.DePan(src,inputlog=input_log, info=false, offset= 2)
d3 = (delta_pan < 3) ? src.Trim(3,0) : src.DePan(src,inputlog=input_log, info=false, offset= 3)
d4 = (delta_pan < 3) ? src.Trim(4,0) : src.DePan(src,inputlog=input_log, info=false, offset= 4)
d5 = (delta_pan < 4) ? src.Trim(5,0) : src.DePan(src,inputlog=input_log, info=false, offset= 5)
d_1 = (delta_pan < 1) ? src.Loop(2,0,0) : src.DePan(src,inputlog=input_log, info=false, offset=-1)
d_2 = (delta_pan < 2) ? src.Loop(3,0,0) : src.DePan(src,inputlog=input_log, info=false, offset=-2)
d_3 = (delta_pan < 3) ? src.Loop(4,0,0) : src.DePan(src,inputlog=input_log, info=false, offset=-3)
d_4 = (delta_pan < 3) ? src.Loop(5,0,0) : src.DePan(src,inputlog=input_log, info=false, offset=-4)
d_5 = (delta_pan < 4) ? src.Loop(6,0,0) : src.DePan(src,inputlog=input_log, info=false, offset=-5)

i = (delta_pan ==0) ? src
\ : (delta_pan ==1) ? Interleave(d_1, src, d1)
\ : (delta_pan ==2) ? Interleave(d_2, d_1, src, d1, d2)
\ : (delta_pan ==3) ? Interleave(d_3, d_2, d_1, src, d1, d2, d3)
\ : (delta_pan ==4) ? Interleave(d_4, d_3, d_2, d_1, src, d1, d2, d3, d4)
\ : Interleave(d_5, d_4, d_3, d_2, d_1, src, d1, d2, d3, d4, d5)

(taken from the script in attachment in post one)