[vlc-devel] Developing decode/encode plug-in: NV12/D3D

Larsson, Petter petter.larsson at intel.com
Fri Dec 10 04:13:29 CET 2010


Hi,
I'm new to the VLC developer community, so I hope I'm not totally off with the following questions on this forum.


I'm working on developing a new decoder and encoder plug-in for VLC. Functionally the new module works fine but there are some performance oriented bottlenecks I'd like to resolve leading to the following questions:


NV12 chroma:
------------
It seems the NV12 format is not fully supported by VLC. It's listed in vlc_fourcc.h but it's not supported in vout_pictures.c which makes it impossible to create (decoder_NewPicture(...)) a picture object for the purposes of decode surface creation.

A non optimal solution is to convert NV12 to/from YV12, this works fine but this is obviously a large CPU hit.

Hacking vout_pictures.c I did add NV12 format as a new format with the same planar setup as YV12, but this solution is not entirely correct since NV12 is a hybrid planar format (albeit the same size as YV12). This solution works for the transcode case where both my decoder and encoder is used.

If an existing VLC encoder (such as x264) is used together with my NV12 type decoder for transcode it works but since the encoder does not expect NV12 format resulting in an output has the UV plane colors all wrong.

What is the stance on NV12 support in VLC? Am I missing something here?

Regarding using the NV12 decoder for the playback case, it does appear that NV12 rendering is understood (at least from the log). But I'm currently not able to fully verify this due to some odd behavior (bitstream blocks delivered for the playback case differs from the transcode case. For playback the blocks are missing header info, and as it seems start codes)



D3D frame surface support:
---------------------------
Is there a way to use D3D surfaces instead of system memory surfaces for decoder and encoder plugin frame buffers.
I confess, I have not been digging deep here but maybe some can give some pointers on where to find more info or dismiss it altogether.


Thanks,
Petter




More information about the vlc-devel mailing list