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 23rd September 2015, 05:00   #1  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
How to Process Multiple Frames At Once

I know some filters such as NNEDI3 have internal multi-threading. How does it go about processing several frames at once?

More specifically, I finally got the filter to run HLSL Shaders to work. However, after I pass in the data of a frame, it instead returns the previous frame. One work-around is to render an extra dummy frame in DirectX so that the previous becomes the right one.

However, that 1-frame delay might be by design, so that it displays the previous while passing in the instructions of the current frame. This avoids delays between GPU instructions.

If I want to follow that design (for performance gain), how would I go about starting processing frame 2 before getting the result of frame 1?
MysteryX is offline   Reply With Quote
Old 23rd September 2015, 13:20   #2  |  Link
colours
Registered User
 
colours's Avatar
 
Join Date: Mar 2014
Posts: 308
This just sounds a lot more like you're doing something wrong rather than this behaviour being "by design". No other filter does this, so why would this be by design?

Are you sure it's not just an off-by-one error somewhere in your code, or a seeking problem with the source filter?
__________________
Say no to AviSynth 2.5.8 and DirectShowSource!
colours is offline   Reply With Quote
Old 23rd September 2015, 17:05   #3  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
Nobody has a clue why it is behaving that way. But I can can work-around it by simply creating a 2nd dummy scene.

How do OpenCL filters handle their internal multi-threading, or keeping the GPU buffer always busy, or allowing other filters to use the CPU while the GPU is working?

Note that I'm not using OpenCL, but DirectX 9 to create and render scenes.

Last edited by MysteryX; 23rd September 2015 at 17:11.
MysteryX is offline   Reply With Quote
Old 23rd September 2015, 21:13   #4  |  Link
TurboPascal7
Registered User
 
TurboPascal7's Avatar
 
Join Date: Jan 2010
Posts: 270
Quote:
Originally Posted by MysteryX View Post
How do OpenCL filters handle their internal multi-threading, or keeping the GPU buffer always busy, or allowing other filters to use the CPU while the GPU is working?
They don't.
__________________
Me on GitHub | AviSynth+ - the (dead) future of AviSynth
TurboPascal7 is offline   Reply With Quote
Old 23rd September 2015, 21:36   #5  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
I also read there's always a delay between when the instruction is give to the GPU and the execution of the code, and filling in the next frame ahead of time avoid that. Are you saying this cannot be done with AviSynth? It's not a big deal, but it might have a performance penalty. Unless I'm missing something.
MysteryX is offline   Reply With Quote
Old 23rd September 2015, 21:43   #6  |  Link
TurboPascal7
Registered User
 
TurboPascal7's Avatar
 
Join Date: Jan 2010
Posts: 270
What I'm saying is that avisynth does not have any support for GPU computing whatsoever. The only way GPU filtering is implemented is processing the whole frame on the GPU while blocking every other filter.
In theory you can do some kind of prefetching yourself but if you ever actually do this then wat.
__________________
Me on GitHub | AviSynth+ - the (dead) future of AviSynth
TurboPascal7 is offline   Reply With Quote
Old 23rd September 2015, 21:46   #7  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
OK then I'll just try running it with MT mode.

KNLMeans, however, is using OpenCL and doesn't work well with MT mode. Not sure why. It works great when in a single-threaded mode.
MysteryX 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 20:20.


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