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.

Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development

Reply
 
Thread Tools Search this Thread
Old 29th October 2015, 09:59   #1  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,455
How to Use Frame Buffer with MT

How do you program AviSynth filters for MT? I heard about a frame buffer, and how does it work?

I'm thinking of this. I'm using 8 threads and am processing frame n. I could increase performance 2x by processing the next frame at the same time. I could assume that with 8 threads, the next frame to be processed will usually be n+8.

Now what if it's not? I don't want to be calculating frame n+8 several times in separate threads. If another thread wants to render frame n+8 while my thread is still processing it, is there a way to
1. make the second thread wait
2. finish calculating it and store it in a cache
3. access the frame from the cache in the second thread

How can I do this, or is there a better way to do it?

Basically I want to fill in the data that will be requested next, because when rendering scenes with a DirectX9 device, it returns the previously created scene while we fill in the data of the current scene. It works if I create a 2nd dummy scene but that cuts performance in half!
MysteryX is offline   Reply With Quote
Old 29th October 2015, 19:31   #2  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,455
I just did a quick test. The frame order isn't regular enough to use this approach; it's too often random.

The only way to create a processing queue, then, may be to have a static shared worker thread.
MysteryX is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 16:42.


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