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 March 2008, 11:52   #1  |  Link
s.virojanadara
Registered User
 
Join Date: Mar 2008
Posts: 13
Bilateral filter on GPU for avisynth

I just wrote the bilateral filter on GPU for avisynth.

For more information please visit http://gpubilateral.sourceforge.net/ .

Best regards,
Sompon Virojanadara

PS: If i post in the wrong thread fell free to move this post to the right thread.
s.virojanadara is offline   Reply With Quote
Old 30th March 2008, 00:44   #2  |  Link
Fizick
AviSynth plugger
 
Fizick's Avatar
 
Join Date: Nov 2003
Location: Russia
Posts: 2,183
1. can it be adopted for pixel shader 2.0 video cards?
2. how its algo is similar to non-gpu bilater plugins (TBilateral by tritical)?
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick
I usually do not provide a technical support in private messages.
Fizick is offline   Reply With Quote
Old 30th March 2008, 18:50   #3  |  Link
MfA
Registered User
 
Join Date: Mar 2002
Posts: 1,075
Tritical's filter by default works only on the luminance plane, and supports a couple more options, this filters RGB planes independently (something I personally wouldn't do, you are going to create false colors that way).
MfA is offline   Reply With Quote
Old 1st April 2008, 08:36   #4  |  Link
s.virojanadara
Registered User
 
Join Date: Mar 2008
Posts: 13
Quote:
1.can it be adopted for pixel shader 2.0 video cards?
Unfortuantely, No. Because restriction on instruction slot impose on pixel shader 2.0.
However, If you have pixel shader 2.0a
You may try HLSL + avishader at http://forum.doom9.org/showthread.php?s=&threadid=87295
However the approximation algorithm doesn't quite accurate. Well, it's approximation anyway. Moreover, the full kernel bilateral is restricted to 5x5.

Quote:
2. how its algo is similar to non-gpu bilater plugins (TBilateral by tritical)?
Tritical's filter by default works only on the luminance plane, and supports a couple more options, this filters RGB planes independently (something I personally wouldn't do, you are going to create false colors that way).
I doesn't have time to look throughly in TBilateral by tritical source code yet (Well i just googling about it when i saw your post). But at the first glance, Mfa is quite right. The false color will be fixed in the next release.

Indepth explanation about false color can be found at Experiments with Color Images in
http://www.soe.ucsc.edu/~manduchi/Papers/ICCV98.pdf

For the option that Tritical's filter has, well i want to keep my filter to be as simplest to use as possible. However if you want any option to be implement don't hestitate to post your request here or email me at s.virojanadara@gmail.com.
s.virojanadara is offline   Reply With Quote
Old 13th April 2008, 07:25   #5  |  Link
s.virojanadara
Registered User
 
Join Date: Mar 2008
Posts: 13
Version 1.0a Release!

This is not a quite as my plan to do. The GPU CPU synchronization development takes longer than I expected. Thus, i decide to release this "half-developed" release. For more information visit http://gpubilateral.sourceforge.net/.

PS. "False color" elimination still not yet implement in this release please be patient. It should be implement in next release.

Best regards,
Sompon Virojanadara

Last edited by s.virojanadara; 13th April 2008 at 07:26. Reason: Fixed typo
s.virojanadara is offline   Reply With Quote
Old 16th April 2008, 12:59   #6  |  Link
s.virojanadara
Registered User
 
Join Date: Mar 2008
Posts: 13
Version 1.1 Released!

For more information visit http://gpubilateral.sourceforge.net/...&id=7&Itemid=7 .

Next release should have support for planar type video (YUV, YV12). However, i have to study that first .

Best regards,
Sompon Virojanadara
s.virojanadara is offline   Reply With Quote
Old 12th December 2008, 10:18   #7  |  Link
s.virojanadara
Registered User
 
Join Date: Mar 2008
Posts: 13
Version 1.2 Released!

For more information visit http://gpubilateral.sourceforge.net/

Add native support for planar type video (YUV, YV12) as promised .
Major stability fixed. (This is why it's so late released )
s.virojanadara is offline   Reply With Quote
Old 12th December 2008, 17:34   #8  |  Link
Keiyakusha
契約者
 
Keiyakusha's Avatar
 
Join Date: Jun 2008
Posts: 1,576
Quote:
Originally Posted by s.virojanadara View Post
For more information visit http://gpubilateral.sourceforge.net/

Add native support for planar type video (YUV, YV12) as promised .
Major stability fixed. (This is why it's so late released )
Yes! Yes!
Keiyakusha is offline   Reply With Quote
Old 12th December 2008, 17:47   #9  |  Link
Adub
Fighting spam with a fish
 
Adub's Avatar
 
Join Date: Sep 2005
Posts: 2,685
Damn! I may have to look at this some more tonight! Thanks s.virojanadara!
__________________
FAQs:Bond's AVC/H.264 FAQ
Site:Adubvideo
Adub is offline   Reply With Quote
Old 25th January 2009, 12:52   #10  |  Link
yup
Registered User
 
Join Date: Feb 2003
Location: Russia, Moscow
Posts: 854
Card not support glDeleteFencesNV

Hi folk!
I have Radeon HD 2600 Pro AGP card. I get error
Code:
Card not support glDeleteFencesNV
My card support shader 4.0. Why?
May be plugin support only Nvidia cards?
Please advice.
yup.
yup is offline   Reply With Quote
Old 25th January 2009, 15:39   #11  |  Link
Dreassica
Registered User
 
Join Date: May 2002
Posts: 384
Judging from the NV in the error, Nvidia only yes. Not working on my 4870x2 either
Dreassica is offline   Reply With Quote
Old 25th January 2009, 17:04   #12  |  Link
yup
Registered User
 
Join Date: Feb 2003
Location: Russia, Moscow
Posts: 854
Fortunately MSU denoising work
http://compression.ru/video/denoising/index_en.html
If use manual preset, exist low, medium and high bilateral. colorspace RGB24. Work realtime even on my card.
Competing war between ATI and NVidia not very good for user.
yup.
yup is offline   Reply With Quote
Old 3rd February 2009, 11:23   #13  |  Link
s.virojanadara
Registered User
 
Join Date: Mar 2008
Posts: 13
Quote:
Hi folk!
I have Radeon HD 2600 Pro AGP card. I get error
Code:
Card not support glDeleteFencesNV
My card support shader 4.0. Why?
May be plugin support only Nvidia cards?
Please advice.
yup.
, for feedback yup (Should i call you this? Sorry if my question is rude ). That surprise me too. I never thought that ATI cards not fully support Open GL 2.0 specification. Well, regretably I don't have an ATI card to test it myself .

Quote:
Fortunately MSU denoising work
http://compression.ru/video/denoising/index_en.html
Yeah, great to have an alternative.

Quote:
If use manual preset, exist low, medium and high bilateral. colorspace RGB24. Work realtime even on my card.
Well you are comparing Radeon HD 2600 Pro with my poor on board GeForce 8200. That is 144 GFlops vs 21.6* GFlops.

Quote:
Competing war between ATI and NVidia not very good for user.
I couldn't agree more!

Ps. Right now I working on other project. If I have free time again I will try to solve this matter.

Pps. Hope, reader know by now that my filter not support ATI card yet

* Ppps. I never found my Geforce 8200 mGPU specification that 21.6 figure i take it from Geforce 8300 pci-e card.

Sincery yours,
s.virojanadara

Last edited by s.virojanadara; 3rd February 2009 at 11:24. Reason: Add quote tag
s.virojanadara is offline   Reply With Quote
Old 3rd February 2009, 17:42   #14  |  Link
Leak
ffdshow/AviSynth wrangler
 
Leak's Avatar
 
Join Date: Feb 2003
Location: Austria
Posts: 2,441
Quote:
Originally Posted by s.virojanadara View Post
, for feedback yup (Should i call you this? Sorry if my question is rude ). That surprise me too. I never thought that ATI cards not fully support Open GL 2.0 specification. Well, regretably I don't have an ATI card to test it myself .
If you read the OpenGL 2.0 specification you'll find that neither glDeleteFencesNV nor the word "Fence" is in it. So it's a proprietary extension from nVidia...

np: The Matthew Herbert Big Band - The Yesness (There's Me And There's You)
__________________
now playing: [artist] - [track] ([album])
Leak is offline   Reply With Quote
Old 4th February 2009, 08:23   #15  |  Link
s.virojanadara
Registered User
 
Join Date: Mar 2008
Posts: 13
Quote:
If you read the OpenGL 2.0 specification you'll find that neither glDeleteFencesNV nor the word "Fence" is in it. So it's a proprietary extension from nVidia...
Hmm.., well you are right. Where did I get that idea from...? Well, nevermind. Thanks to Leak for enlighten me .

After i carefully read the OpenGL 2.0 specification . It's seems there is no "Fence" equivalent instruction. Only synchronization OpenGL 2.0 Core specification provided is Finish command (Correct me if I am wrong. Thanks in advanced). Even worse there is no fence extension (or equivalent) from ATI in OpenGLŪ Extension Registry. (hmm, I wonder how do they synchronize CPU with ATI's card)

Thus, my solution for next version is. Detected weather the card support NV_fence or not if not ignore "wait for GPU routine". That's mean implicit GL_finish when read pixel back to memory will block the CPU time .

(And also replace all NV_ extension from my program if possible )

Sincery yours,
S.virojanadara

Last edited by s.virojanadara; 4th February 2009 at 08:51. Reason: Correct typo
s.virojanadara is offline   Reply With Quote
Old 4th February 2009, 20:13   #16  |  Link
MfA
Registered User
 
Join Date: Mar 2002
Posts: 1,075
Quote:
Originally Posted by s.virojanadara View Post
Even worse there is no fence extension (or equivalent) from ATI in OpenGLŪ Extension Registry. (hmm, I wonder how do they synchronize CPU with ATI's card)
GL_finish is a synhcronization mechanism, it just makes it hard to keep the GPU busy. Looking around, double buffering with PBOs should work fine for you.

Last edited by MfA; 4th February 2009 at 20:15.
MfA is offline   Reply With Quote
Old 5th February 2009, 04:00   #17  |  Link
s.virojanadara
Registered User
 
Join Date: Mar 2008
Posts: 13
Quote:
GL_finish is a synhcronization mechanism, it just makes it hard to keep the GPU busy. Looking around, double buffering with PBOs should work fine for you.
Thanks for your comment MfA. However, my program already utilize the PBOs and FBOs. The problem is GL_finish always keep CPU busy by do nothing but wait for GPU to finish. Thus, i use Fence to query the status of GPU first. If GPU is still busy let CPU do something else. That make my program CPU utilization relatively low. Thus, your PC can process other CPU intensive task in the mean time.

However, as reader may already know ATI card do not have mean to query the GPU "busy or not" status in OpenGL (Please, correct me here. I really want to be wrong here ). Thus, my next version (will be release soon, right now at the final test stage) will hopefully support ATI card (If someone who have ATI card like to test it for me. I would really appreciate). Nevertheless, the CPU utilization on PC with ATI card will be relatively higher than NVIDIA card due to the reason I mentioned above.

Sincery yours,
S.virojanadara

Last edited by s.virojanadara; 5th February 2009 at 04:09. Reason: Correct some typo again :p
s.virojanadara is offline   Reply With Quote
Old 5th February 2009, 12:21   #18  |  Link
MfA
Registered User
 
Join Date: Mar 2002
Posts: 1,075
Quote:
Originally Posted by s.virojanadara View Post
Thanks for your comment MfA. However, my program already utilize the PBOs and FBOs. The problem is GL_finish always keep CPU busy by do nothing but wait for GPU to finish.
That's implementation dependent, I doubt many drivers use a polling loop to implement glfinish though ... what almost certainly happens is that glfinish internally uses a blocking call (the win32 WaitForSingleObject call for instance) which suspends the process until the driver signals based on a hardware interrupt.
MfA is offline   Reply With Quote
Old 7th February 2009, 04:27   #19  |  Link
s.virojanadara
Registered User
 
Join Date: Mar 2008
Posts: 13
Alright, I just release gpubilateral filter version 1.2a. Now support windows Vista. Hopefully, it will support ATI GPUs. Try it at http://gpubilateral.sourceforge.net/.
Any feedback would be appreciated.

Last edited by s.virojanadara; 7th February 2009 at 04:30. Reason: Forgetful me
s.virojanadara is offline   Reply With Quote
Old 7th February 2009, 10:54   #20  |  Link
vucloutr
Registered User
 
vucloutr's Avatar
 
Join Date: Nov 2008
Posts: 64
hi, it works fine for me with Avisynth (AvsP) in RGB32 colorspace but i get this error with YV12 colorspace:
Code:
Traceback (most recent call last):
  File "AvsP.pyo", line 5819, in OnMenuVideoToggle
  File "AvsP.pyo", line 8925, in ShowVideoFrame
  File "AvsP.pyo", line 9467, in PaintAVIFrame
  File "pyavs.pyo", line 322, in DrawFrame
  File "pyavs.pyo", line 301, in _GetFrame
  File "avisynth.pyo", line 277, in GetFrame
WindowsError: exception: access violation reading 0xFFFFFFFF
Traceback (most recent call last):
  File "AvsP.pyo", line 7123, in OnPaintVideoWindow
  File "AvsP.pyo", line 9467, in PaintAVIFrame
  File "pyavs.pyo", line 322, in DrawFrame
  File "pyavs.pyo", line 301, in _GetFrame
  File "avisynth.pyo", line 277, in GetFrame
WindowsError: exception: access violation reading 0xFFFFFFFF

Last edited by vucloutr; 7th February 2009 at 10:59.
vucloutr 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 04:41.


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