[MPlayer-dev-eng] Question regarding MPlayer's OpenGL output

Mostapha El-Shafey mostapha at viionsystems.com
Wed Oct 19 20:12:09 CEST 2011


> The PBO code isn't usually used I think, it doesn't make all that much
> difference.

So what MPlayer does now (in 'gl' mode) is just display a texture on a quad?
Then how are the texture uploads so fast?

> Depending on what kind of memory you get you should also be careful
> which memcpy code you use, for AGP memory SSE2-based copy can have
> issues and be a good 10% or more slower that SSE one.
> But are you sure it's not just that you are pushing RGB textures, which
not
> only means you have to do the YUV->RGB conversion in software first but
> also requires almost 3 times the bandwidth?

Here's something else I noticed: When running MPlayer in 'gl2' video output
mode, the CPU usage goes to 35%, up from 5% for 'gl' mode. What exactly is
the difference between these two modes?
I was *not* using a power of two texture before. I fixed that right now, but
performance is still the same. I timed my memcpy (I use glMapBuffer, memcpy
the new buffer into place, and then glUnmapBuffer) and it's not the cause of
the problem. Most of the CPU time is spent on the glTexImage2D() call inside
the paintGL (display) function:

glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 512, 512, 0, GL_BGR_EXT,
GL_UNSIGNED_BYTE, 0);

> report such findings to vlc. maybe they are interested in speeding
> up their gl output.

I will as soon as I get a better understanding of what's causing the
performance issue, with my app and with vlc. Thanks.

On Wed, Oct 19, 2011 at 11:51 AM, Reimar Döffinger <Reimar.Doeffinger at gmx.de
> wrote:

> On Wed, Oct 19, 2011 at 11:32:40AM -0400, Mostapha El-Shafey wrote:
> > The reason I'm asking is because I'm developing an application (in Qt)
> that
> > displays many (up to 20) video streams at once and it is required for the
> > video display to take up as little CPU time as possible. By my simple
> tests
> > it looks like MPlayer is doing something right, OpenGL-wise. I went
> through
> > the vlc code and what it seems to do is just create a quad with a
> texture,
> > while it looks to me that MPlayer is using pixel buffers, glMapBuffer()
> and
> > glUnmapBuffer(). Problem is I tried using pixel buffers in my application
> > but it doesn't make a difference in terms of performance so I must be
> > missing something MPlayer is doing.
>
> The PBO code isn't usually used I think, it doesn't make all that much
> difference.
> However if you used PBOs naively you'd probably get atrocious
> performance, depending on the hardware and driver version you need to
> have the right line stride, input format etc. etc.
> Depending on what kind of memory you get you should also be careful
> which memcpy code you use, for AGP memory SSE2-based copy can have
> issues and be a good 10% or more slower that SSE one.
> But are you sure it's not just that you are pushing RGB textures, which not
> only means you have to do the YUV->RGB conversion in software first but
> also requires almost 3 times the bandwidth?
> _______________________________________________
> MPlayer-dev-eng mailing list
> MPlayer-dev-eng at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
>


More information about the MPlayer-dev-eng mailing list