what's the fastest way to upload large texture

Hi every one,

I’m working on a video editing project which uses OpenGL to render the video to screen. As the videos that we need to process are often pretty large (HD1080p or even larger), the texture uploading performance become critical.

Currently we are using PBOs to upload the decoded video(on every video frame, map a buffer, decode into the buffer, unmap it, then use glTexSubImage2D to complete the uploading), but it’s much slower and consumes much more CPU cycles compared to its Direct3D counterpart(which basically does the same thing, only in d3d: lock a texture surface, decode into the surface, then unlock it). While the video is running, the GL code uses 20-25% CPU time while the D3D code only around 15%.

So I would like to know is there anyway to improve OpenGL implementation to something at least on par with d3d or is OpenGL just cannot beat D3D on this particular task? Thanks.

And I’m using GL_STREAM_DRAW for glBufferData and GL_WRITE_ONLY for glMapBuffer. I also call glBufferData with a NULL pointer before mapping the buffer to prevent it from blocking on the mapping call.

see this thread:

I am doing several HD1080 streams, CPU load is really not an issue in my app.