Page 4 of 12

Re: DGDecomb

Posted: Wed Mar 22, 2017 5:39 am
by jpsdr
admin wrote:A "postprocessed frame" is one that did not find a good field match.
Ok, that's what tricked me. :facepalm:
So, if i understand properly, and want to compare with my filter, i have to just use :
dgtelecide()
This will only perform the IVTC operation on frames detected telecine, and nothing more.
Perfect, just a few hours to wait to test...

Re: DGDecomb

Posted: Wed Mar 22, 2017 6:10 am
by admin
Yes, that is correct because pthresh defaults to 0.0.

Looking forward to your comparisons. What does your filter do with the interlaced fades in the stream you gave? Mine catches them with pthresh=2.5.

Re: DGDecomb

Posted: Wed Mar 22, 2017 3:06 pm
by hydra3333
thank you for the release of DGTelecide and DGDecimate
viewtopic.php?f=4&t=463&p=6380#p6380

I'll be asking for them to be added to Vapoursynth. They'll ask me how many frames before and after that the filters calls so that they can hard-code it... I wonder if you could please confirm, and also for other filters when you (re)release them ?

Re: DGDecomb

Posted: Wed Mar 22, 2017 6:22 pm
by admin
Please wait. I am still fixing some bugs in DGTelecide. I'll let you know.

Re: DGDecomb

Posted: Thu Mar 23, 2017 4:33 am
by jpsdr
admin wrote: What does your filter do with the interlaced fades in the stream you gave?
"Nothing" or some wrong mix-up is also possuble, but in any way there is no possibility to have a true progressive picture in that case, because two IVTC patterns are mixed up. So, I'll deinterlace them after with my deinterlace filter in manual mode, feeding it with a text file where i specify which frames i want it to deinterlace. I don't want to leave this step to an automatic method, because there is no way to be sure there is no miss or false detection. So, for this step, visual inspection and manual setting.
My IVTC method is a "long" several step process to achieve the result i want.

Re: DGDecomb

Posted: Thu Mar 23, 2017 4:41 pm
by Guest
:?: Hope you don't mind my asking an off topic question, but how is the gtx1080ti so far?

Re: DGDecomb

Posted: Thu Mar 23, 2017 4:46 pm
by admin
Well, I'm loving it but I am still in the process of migrating to that machine, so won't start using it on a daily basis until my case arrives tomorrow. I installed most of the apps I rely on. I'm posting here from the new machine, still bread-boarded on the dining room table.

The 1080Ti overclocks very nicely. There's a strange thing. While running heavy CUDA there is a slight extra noise that is not from the fan. Weird.

Here's another weird thing. I have a local app called DGLicenseRSA that lets me make licenses without having to go to the online generator. It always had a little bug that cost me a few extra clicks and keystrokes. I transferred it over and opened it in VS 2013. Ran it without any changes and it did not work! The only difference is that the original EXE, which still works, was built with VS 2005. So apparently things have changed so as to hose my big digits code. One day, I'll look into it, but for now I'll just use the old EXE.

Last weird thing: while hunting for the deinterlacer bug I wasted many hours because I forgot that interlaced YV12 has chroma samples in different places than progressive. By going back to the Decomb code, I remembered all that.

Sorry for the off-topic. ;)

Re: DGDecomb

Posted: Thu Mar 23, 2017 5:39 pm
by Guest
Sorry for the off-topic. ;)
You are the admin and owner of the forum, I think you are allowed to do it on occasion
Back on topic
After your remark about IVTCing interlaced sources to me, after my test of DGDecomb, I did some reading up.
Seems that just because mediainfo called my sample 480i it doesn't make it interlaced, it was actually hard telecined.
3 progressive frames and two interlaced
Guess even this old dog can still learn a thing or two

Re: DGDecomb

Posted: Thu Mar 23, 2017 5:55 pm
by admin
gonca, my friend, just keep the inner child alive and always take the high road.

Re: DGDecomb

Posted: Thu Mar 23, 2017 10:29 pm
by Aleron Ives
admin wrote:While running heavy CUDA there is a slight extra noise that is not from the fan. Weird.
Have you encountered the dreaded coil whine? :o :cry:

Re: DGDecomb

Posted: Fri Mar 24, 2017 8:13 am
by admin
Apparently so. I hope it is harmless.

Re: DGDecomb

Posted: Fri Mar 24, 2017 3:14 pm
by Guest
Use Nvidia Inspector and raise up your fan speed a bit at a time, and listen for the sound.
This will help narrow it down, if it is coil whine or not
I raised mine to try (85%) and I don't seem to get the whine.
Might have to replace the fan as a worse case scenario. ( if you don't hear the fan working under heavy load check)

Re: DGDecomb

Posted: Fri Mar 24, 2017 3:18 pm
by admin
gonca wrote:Use Nvidia Inspector and raise up your fan speed a bit at a time, and listen for the sound.
This will help narrow it down, if it is coil whine or not
I raised mine to try (85%) and I don't seem to get the whine.
Might have to replace the fan as a worse case scenario. ( if you don't hear the fan working under heavy load check)
It's coil whine. It's so low I can't hear it when the case is closed. Google search reveals I am not alone.

BTW, I just installed the beast into its new case with only one small mishap. I lost a screw somewhere. Could be stuck somewhere in the case or fell into the carpet somewhere. Anyway, I checked that it wasn't stuck in the motherboard anywhere before powering up. I'm posting from the beast now, so all seems well.

Re: DGDecomb

Posted: Fri Mar 24, 2017 4:08 pm
by Guest
So have you actually named the new computer "the beast"

Re: DGDecomb

Posted: Fri Mar 24, 2017 6:12 pm
by admin
No, but now that you mention it, why not?

Re: DGDecomb

Posted: Sat Mar 25, 2017 11:22 am
by admin
I renamed the new system to "TheBeast".

I found the missing screw in the carpet. :D

Re: DGDecomb

Posted: Sat Mar 25, 2017 3:17 pm
by Guest
At least now you can be sure the screw wont cause damage, to the computer or someone's feet, and you have spare parts to put in the shed.

Re: DGDecomb

Posted: Sat Mar 25, 2017 4:22 pm
by admin
I tossed it in the trash. :o

Re: DGDecomb

Posted: Tue Mar 28, 2017 6:04 pm
by admin
I've been a busy bee for the last three days and have a lot to report.

The CUDA adaptive deinterlacer [equivalent to Decomb's FieldDeinterlace()] has been successfully implemented. At first, I was disappointed in the performance (all results run on 1080Ti). Consider this [I'll explain why it's in DGTelecide() in a moment; for now realize that mode 2 does the same thing as FieldDeinterlace(full=true)]:

loadplugin("dgdecodenv.dll")
loadplugin("decomb.dll")
dgsource("lain.dgi").loop()
dgtelecide(mode=2)
#fielddeinterlace(full=true)

720x480
DGTelecide() 1092 fps
FieldDeinterlace() 645 fps

OK, a 1.7 times speedup is welcome but not eye-popping. Then I discovered that the benefits of CUDA scale with the frame size. It's not surprising when you think about it. Here are the results for larger frame sizes:

1920x1080
DGTelecide() 345 fps
FieldDeinterlace() 143 fps

A 2.4 times speedup. That's starting to impress.

3840x2160
DGTelecide() 99 fps
FieldDeinterlace() 19 fps

A 5.2 times speedup. Now we're cooking with gas! Importantly, the CPU solution is slower than real-time while the CUDA solution is 4 times real-time for 24 fps 4K content. Now that is eye-popping. :wow:

Now I'll tell you about the new packaging concept. I knew that the previous first cut of CUDA DGTelecide() was not using an adaptive deinterlace for post-processed frames. Obviously that is suboptimal because progressive parts of the frame will be degraded. So I had to retrofit this new CUDA deinterlace into the Telecide postprocessor. But if that code is going to be in Telecide() why bother having a separate deinterlacing filter? So I redesigned DGTelecide() to support four modes, choosable via a mode parameter:

DGTelecide(clip,mode,pthresh,dthresh,blend,map,show,device)

Mode 0: Field matching without adaptive deinterlacing of frames with a bad match (no postprocessing).
Mode 1: Field matching with adaptive deinterlacing of frames with a bad match (postprocessing).
Mode 2: Adaptive deinterlacing of all frames (unconditional deinterlacing).
Mode 3: Adaptive deinterlacing of frames determined to be combed (conditional deinterlacing).

Just as for FieldDeinterlace(), separate thresholds are used for determining if a frame is combed, and for deinterlacing combed frames. Users can decide for themselves whether mode 3 really gives any benefit over mode 2 with a good dthresh, given the extra overhead of checking whether a frame is combed. The 'show' information overlay shows the mode and is tailored for that mode.

I just have to write the documentation and then I will slipstream it. I am very happy with how it turned out. :D

I also want to post some technical material about all the things I have discovered about optimizing CUDA for filtering. There are some interesting and surprising things. One of them is that Avisynth itself limits performance because it does not allow for frames to be malloc'ed by CUDA rather than the OS. CUDA-malloc'ed (pinned) host memory can be transferred to/from the GPU much faster than OS-malloc'ed memory. Perhaps Avisynth could be modified to allow a user-supplied malloc to be used. More on all that later.

Re: DGDecomb

Posted: Tue Mar 28, 2017 6:49 pm
by Guest
What you said :wow:
Awesome :scratch:

Re: DGDecomb

Posted: Tue Mar 28, 2017 7:39 pm
by admin
Even with DGDenoise() NLM denoising added at 4K resolution, it is still 59 fps, more than twice real-time for 24 fps. And that includes decoding. :lol:

Now if we pipeline the filters on the GPU, watch out!

Re: DGDecomb

Posted: Tue Mar 28, 2017 7:55 pm
by Guest
Time to consider a bigger video card (or 2)
Image
Sorry about that

Re: DGDecomb

Posted: Tue Mar 28, 2017 8:15 pm
by admin
Uh, I don't think a VGA connector will be enough. What the hell is that?

I should probably add a bob mode to DGTelecide().

I just finished the documentation, but I will wait to slipstream until tomorrow to allow for last-minute testing.

Re: DGDecomb

Posted: Wed Mar 29, 2017 4:11 pm
by Guest
Uh, I don't think a VGA connector will be enough. What the hell is that?
You don't approve of my new video card? :(
It's got four fans ;)

Re: DGDecomb

Posted: Wed Mar 29, 2017 4:16 pm
by admin
Four fans, one for each bit of the video bus. :P

I fed TheBeast today with a nice new SSD for the Windows partition. When the backups complete, I'll slipstream the DGTelecide changes.