Accelerating MPEG playback with shaders

I wrote a fun little shader to accelerate YUV textures in SDL 1.3.

Here’s my blog post about it:

Enjoy!–
-Sam Lantinga, Founder and CEO, Galaxy Gameworks

That’s a great improvement Sam! Now we just need to get the SMPEG code
working with this speedup in SDL 1.3 JFrom: sdl-bounces@lists.libsdl.org [mailto:sdl-bounces at lists.libsdl.org] On
Behalf Of Sam Lantinga
Sent: Saturday, February 12, 2011 1:12 PM
To: SDL
Subject: [SDL] Accelerating MPEG playback with shaders

I wrote a fun little shader to accelerate YUV textures in SDL 1.3.

Here’s my blog post about it:

Enjoy!

-Sam Lantinga, Founder and CEO, Galaxy Gameworks

I’ll leave that as an exercise for the reader. :wink:

Seriously, I’ve thought about it, but I’ve got lots of stuff already on my
launch list. I welcome a patch though! :)On Sat, Feb 12, 2011 at 5:51 PM, Ken Rogoway wrote:

That?s a great improvement Sam! Now we just need to get the SMPEG code
working with this speedup in SDL 1.3 J

From: sdl-bounces at lists.libsdl.org [mailto:sdl-bounces at lists.libsdl.org]
*On Behalf Of *Sam Lantinga
Sent: Saturday, February 12, 2011 1:12 PM
To: SDL
Subject: [SDL] Accelerating MPEG playback with shaders

I wrote a fun little shader to accelerate YUV textures in SDL 1.3.

Here’s my blog post about it:
http://slouken.blogspot.com/2011/02/mpeg-acceleration-with-glsl.html

Enjoy!

-Sam Lantinga, Founder and CEO, Galaxy Gameworks

SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


-Sam Lantinga, Founder and CEO, Galaxy Gameworks

Hi,

note that some opengl cards support YUV textures directly. For
example, apple opengl does.On Sat, Feb 12, 2011 at 7:11 PM, Sam Lantinga wrote:

I wrote a fun little shader to accelerate YUV textures in SDL 1.3.

Here’s my blog post about it:
http://slouken.blogspot.com/2011/02/mpeg-acceleration-with-glsl.html

Enjoy!

? ? -Sam Lantinga, Founder and CEO, Galaxy Gameworks


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

What Apple supports is YUV422 non-planar textures, which is not very helpful for normal usecases.On Feb 14, 2011, at 4:47 PM, Ren? Dudfield wrote:

Hi,

note that some opengl cards support YUV textures directly. For
example, apple opengl does.

On Sat, Feb 12, 2011 at 7:11 PM, Sam Lantinga wrote:

I wrote a fun little shader to accelerate YUV textures in SDL 1.3.

Here’s my blog post about it:
http://slouken.blogspot.com/2011/02/mpeg-acceleration-with-glsl.html

Enjoy!

-Sam Lantinga, Founder and CEO, Galaxy Gameworks

SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Any technology distinguishable from magic is insufficiently advanced.

Ulrich von Zadow | +49-172-7872715
Jabber: @Ulrich_von_Zadow
Skype: uzadow

I wrote a fun little shader to accelerate YUV textures in SDL 1.3.

Here’s my blog post about it:
http://slouken.blogspot.com/2011/02/mpeg-acceleration-with-glsl.html

Just to complete my test:

I updated my SDL 1.3 to today HG (that I’m quite sure it includes the YUV
shader), and this is the result with the new shader (I’ve not recompiled
it):

Benchmark finished: 2405 frames in 36.537000 seconds -> 65.823686fps

With “friday” HG the result was:
Benchmark finished: 2405 frames in 56.740000 seconds -> 42.386324fps

It seems that the 1.2 API “emulation” of SDL 1.3 is not affected by the
speedup.

In 1.3 branch I’m using STREAMING + Lock/Unlock since it should be faster
than the “updatetexture” method.On Sat, Feb 12, 2011 at 8:11 PM, Sam Lantinga wrote:


Ing. Gabriele Greco, DARTS Engineering
Tel: +39-0105761240 Fax: +39-0105760224
s-mail: Via G.T. Invrea 14 - 16129 GENOVA (ITALY)

Just one thing what I’ve learned in the past. This all applies to your hardware configuration and operating system. The results could be really different on different GPU and operating system. You need to do benchmarking on more machines to get results that you can rely on.

Just my few euro cents :wink:

regards,
Pavel Kanzelsberger–
Pavel Kanzelsberger
Sent with Sparrow
On Pondelok, 14. febru?r 2011 at 18:20, Gabriele Greco wrote:

On Sat, Feb 12, 2011 at 8:11 PM, Sam Lantinga wrote:

I wrote a fun little shader to accelerate YUV textures in SDL 1.3.

Here’s my blog post about it:
http://slouken.blogspot.com/2011/02/mpeg-acceleration-with-glsl.html

Just to complete my test:

I updated my SDL 1.3 to today HG (that I’m quite sure it includes the YUV shader), and this is the result with the new shader (I’ve not recompiled it):

Benchmark finished: 2405 frames in 36.537000 seconds -> 65.823686fps

With “friday” HG the result was:
Benchmark finished: 2405 frames in 56.740000 seconds -> 42.386324fps

It seems that the 1.2 API “emulation” of SDL 1.3 is not affected by the speedup.

In 1.3 branch I’m using STREAMING + Lock/Unlock since it should be faster than the “updatetexture” method.


Ing. Gabriele Greco, DARTS Engineering
Tel: +39-0105761240 Fax: +39-0105760224
s-mail: Via G.T. Invrea 14 - 16129 GENOVA (ITALY)


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Just one thing what I’ve learned in the past. This all applies to your

hardware configuration and operating system. The results could be really
different on different GPU and operating system. You need to do benchmarking
on more machines to get results that you can rely on.
Just my few euro cents :wink:

It depends on WHAT do you want to benchmark.

My purpose was to benchmark different SDL approaches to the display of YUV
surfaces, not to find how fast is SDL in absolute.

My first conclusion was that sticking with the 1.2 emulation API would be
fine since there was no improvement in the streamingtexture + lock/unlock
method, then Sam released his shaders and suddenly the new method became far
more attractive.

I’ll surely have to repeat my tests in Win32 and OSX, but I’m quite
confident the boost will be available also on these platforms,

then I’ll have to check the compatibility on some lowend chipset like my mac
mini gma950, that has a partial support of hw vertex/pixel shaders. (for
instance the bino stereoscopic player shaders do not work on it).–
Ing. Gabriele Greco, DARTS Engineering
Tel: +39-0105761240 Fax: +39-0105760224
s-mail: Via G.T. Invrea 14 - 16129 GENOVA (ITALY)