GPU deinterlacing
Asked Answered
C

3

21

I have an application that does video processing such as color transforms, scaling and translations using OpenGL. I'm mostly working with BGRA (1xGL_BGRA) or YUVA (4xGL_R) video, i.e. including alpha.

Now I would also like to do some high quality deinterlacing. I've noticed that Nvidia supports high quality hardware accelerated de-interlacing through their "PureVideo" functionality. Basically what i'd like to do is to send in a interlaced OpenGL texture with x number of color channels and get out two progressive textures.

My question is how do I access this functionality easiest, and most efficiently (possibly in interop with OpenGL)?

I've been looking at DXVA and OpenMax, but both seem rather focused on playback (not deinterlace processing, i.e. non-relevant options such as frame-rate needs to be set etc...) and no-alpha formats...

Chandra answered 15/3, 2012 at 17:55 Comment(7)
What defines 'high quality' deinterlacing? If you just want to take an image and split it into two via alternating pixel rows you can do that pretty easily in a shader, but I'm not a video expert and I'm not sure if that's what you mean.Ns
I mean something along the lines of spatial-temporal deinterlacing. What you are suggesting is horrible quality.Chandra
You can look here guru.multimedia.cx/deinterlacing-filters to see the difference, between "high" and "low" quality deinterlacing.Chandra
Just out of interest, things like deinterlace and so on are trivial with gStreamer. Perhaps you should think about 3rd party libraries for this kind of stuff than doing it yourself?Photobathic
I alrdy use ffmpeg for de-interlacing, but it's not gpu accelerated.Chandra
for highest-quality deinterlacing, frame-rate is actually essentialIntrauterine
@OrgnlDave: What are you talking about?Chandra
P
5

gStreamer libraries have good de-interlacing modules. You can use a directshow module to display the results in a window, or process the frames yourself by hooking into various events. We're using this at work at the moment for all of our video processing needs.

Photobathic answered 20/3, 2012 at 17:8 Comment(4)
Doesn't seem to be gpu-accelerated.Chandra
With gStreamer it depends on the module you link into the pipeline. There's a 'gldeinterlace' module that is GPU accelerated, for example. In fact there are about 10 GL modules of various kinds that you can link.Photobathic
I'm alrdy using ffmpeg yadif deinterlace which seems to have better quality than what gStreamer offers.Chandra
gldeinterlace (gst-plugins-gl0.10.sourcearchive.com/documentation/0.10.1/…) seems interesting, though it doesn't use PureVideo and seems to be a "low-medium" quality filter.Chandra
E
3

Based on your clarified requirements, it looks like VDPAU is the closest match to what you desire. Complication: it's for Unix-based operating systems, not Windows.

If you're locked to Windows, DXVA is the way to go. If you're operating in a cross-platform environment, OpenMAX is the way to go. And if you're open to suggestions beyond those you've already given in your question, the rest of these are worth pursuing.

Englut answered 23/3, 2012 at 7:41 Comment(5)
This doesn't rly add anything more than reconfirming that I probably need to use DXVA or OpenMax, which I alrdy stated in my question. Though neither of these seem to have a simple way of doing what I want, nor do they support any formats with alpha.Chandra
@Chandra Actually, it does. Note that the best I can do is a closest match, because your query is unsatisfiable for the intersection of Windows & Alpha & Hardware Support. The easiest of these restrictions to relax in a development environment, Windows, gives you a tool that hadn't been brought to the discussion previously. VDPAU is supported by Nvidia and appears to have alpha support. I don't believe your query is otherwise satisfiable without rolling your own solution or extending existing ones.Englut
Unfortunately, windows is a requirement. Though it is interesting that VDPAU has alpha support.Chandra
@Chandra Out of curiosity, is Nvidia support also a requirement? ATI and Intel have competing solutions.Englut
@MrGomesz: Unfortunately yes, most end-users have Nvidia cards.Chandra
R
0

Point 1: You will have to go via DirectX if you want to have hardware accelerated deinterlacing with good quality.

Point 2: Apart from the options others have named (DXVA and OpenMAX) there is at least the Intel Media SDK for Quicksync accelerated deinterlace, which has not been named, and which offers a per frame deinterlacing via its VPP video preprocessing filters.

Point 3: To go from DirectX to OpenGL on NVidia: http://developer.download.nvidia.com/opengl/specs/WGL_NV_DX_interop.txt

Remorseful answered 11/5, 2012 at 13:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.