Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: OpenCL (not openGL)  (Read 3620 times)

0 Members and 1 Guest are viewing this topic.

jshanab

  • Newbie
  • *
  • Posts: 2
    • View Profile
OpenCL (not openGL)
« on: February 03, 2011, 01:20:58 am »
I have spent this snowbound day researching using the graphics processor to help out the main CPU on decoding H264.

I also am using SFML in my browser plugin for displaying H264 video. I am currently using avcodec from ffmpeg, but it is cpu intensive.

So...Since OpenCL is sanctioned by the same body as openGL, it is cross platform and cross GPU, and apple is pushing it and it is very openGL compatible, Are there any plans to integrate OpenCL into SFML?  

ONe thing bugged me about SFML when I switched from SDL, I was forced to use RGBA because of the openGL, This blows my 2 bytes per pixel up to 4.  :-(

tntexplosivesltd

  • Full Member
  • ***
  • Posts: 163
    • View Profile
OpenCL (not openGL)
« Reply #1 on: February 03, 2011, 01:48:32 am »
How were you forced to use RGBA? What do you mean?
Also, OpenCL looks like it could be a good feature, but wouldn't it be a lot of work for a little gain?
And since Apple is pushing it, we should all adopt it? I don't like the idea of that.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
OpenCL (not openGL)
« Reply #2 on: February 03, 2011, 07:33:55 am »
How would OpenCL be integrated to SFML?

Quote
ONe thing bugged me about SFML when I switched from SDL, I was forced to use RGBA because of the openGL, This blows my 2 bytes per pixel up to 4.

Yep, sorry about that. But you can still handle textures directly instead of using sf::Image, if you want to get rid of this limitation.
Laurent Gomila - SFML developer

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
OpenCL (not openGL)
« Reply #3 on: February 03, 2011, 12:32:28 pm »
OpenCL could help you at decoding the video, but not at displaying it. Thus what could be improved through OpenCL is in the FFmpeg library source code.

Depending on your needs, you can also consider using an OS specific API to display movies. Thereby you could probably take advantage of the hardware acceleration (provided by the underlying OS API).
Want to play movies in your SFML application? Check out sfeMovie!

jshanab

  • Newbie
  • *
  • Posts: 2
    • View Profile
Found a little help
« Reply #4 on: February 14, 2011, 01:05:53 am »
Found on line a great little compromize that would fit in well.
A script in cg language that compiles to the machine lang of the card for both opengl and directX cards with the same compiler. THis is a "fragment pixel shader" and would let us send the 2 byte/pixel yuv to the card and let the card do the conversion to RGBA.   This looks to be eaisly available on most cards.  I don't have teh exact link on this computer, but just google it, there are lots.

most seem to be from NVIDIA developer zone.

As for the Apple comment. THat is NOT why I would choose it, I would choose it because apple worked with NVIDIA and THe standards commitee behind openGL to make a well integrated and open system.  Microsoft has there own BTW. and ATI has changed the meaning of iStream to match that of OpenCF.

devlin

  • Full Member
  • ***
  • Posts: 128
    • View Profile
OpenCL (not openGL)
« Reply #5 on: February 14, 2011, 08:21:12 am »
Or you could use the VDPAU/DXVA stuff already present within FFMPEG in order to get hardware acceleration? (just like for instance xbmc does)

You don't have to use the software decoder.

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
OpenCL (not openGL)
« Reply #6 on: February 14, 2011, 08:48:48 am »
Just a little post to fix what I've previously said. OpenCL actually seems to be able to work closely with OpenGL, and may be used to convert your data and send it directly to a texture.
Want to play movies in your SFML application? Check out sfeMovie!

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
OpenCL (not openGL)
« Reply #7 on: February 14, 2011, 08:50:14 am »
Quote from: "Ceylo"
Just a little post to fix what I've previously said. OpenCL actually seems to be able to work closely with OpenGL, and may be used to convert your data and send it directly to a texture.


Actually, as it seems, they've tried to make it easier to use them together in OpenGL 4.x
Developer and Maker of rbSFML and Programmer at Paradox Development Studio