lucas-j / libmpeg2-winrt

MPEG-2 decoder for Windows 8 apps
15 stars 16 forks source link

D3D 11 Video Decoding? #1

Open slyi opened 11 years ago

slyi commented 11 years ago

Hi Lucas, This is question not a issue as i didnt see a twitter account. The decoder works great. Do you use d3d 11 video decoding like http://msdn.microsoft.com/en-us/library/windows/desktop/hh162912(v=vs.85).aspx

http://code.msdn.microsoft.com/DirectX-11-Video-Renderer-0e749100/view/SourceCode#content

Or is that api available on winrt at all?

Thanks slyi

lucas-j commented 11 years ago

Hi slyi,

Currently there's no support for DirectX hardware-accelerated decoding (i.e., making DirectX and any GPUs attached do the work of decoding MPEG frames into video frames) but this could potentially be added. I'd assume this would involve replacing libmpeg2 inline assembly code for IDCT / motion compensation / etc. with calls to the following API: http://msdn.microsoft.com/en-us/library/ff568258(v=vs.85).aspx Media Foundation supports DX11 / DXVA and so I'd assume WinRT would also allow this API to be used. From my perspective, adding frame-dropping support for old computers which can't keep up (even with GPU support) and rewriting the inline assembly to use Intel intrinsics would be a higher priority, since DirectX GPU decoding isn't an option on all platforms.

The rest of the Media Foundation pipeline is left unchanged. This project only adds a single MF transform which decodes raw MPEG-2 video, though I plan to add demuxer source elements for program streams and the WTV format produced by Media Center. The default video renderer used by PlayerFramework / MediaElement / etc. is also used by this app.

slyi commented 11 years ago

Ah ok, I ask as I don't see many code samples for mf. Frame dropping is good for arm hardware, I don't think win8 will be on many old machines. Great work so far. Thank for the enlightenment