Page 1 of 1

conver I420 to RGB

Posted: 12 Jul 2011 21:27
by biga
Hi!

I am writing a video filter, and the filter function's input parameter is a picture_t with format VLC_CODEC_I420. Is this the YUV422 planar format? Does the p_data_orig member contains the raw yuv data? How can I convert it to RGB (IplImage not planar)? I found a video_chroma filter i420_rgb. Can i use it for the conversion? And how? Is the filter's output a planar image?

Thanks for your answer!

biga.

Re: conver I420 to RGB

Posted: 12 Jul 2011 22:29
by Rémi Denis-Courmont
As the name partly implies, I420 is planar YUV 4:2:0. I422 would be 4:2:2, but though it is supported by many video codecs, it is much less commonly used.

In general, video filters must accept the input format for performance reasons. If you really really need the RGB components, then you need to use yuv_to_rgb() from "filter_picture.h".

Re: conver I420 to RGB

Posted: 13 Jul 2011 08:50
by biga
Thanks for your reply! I looked into filter_picture.h but I didn't find a function with that name, however I found it in blend.c and atmo.cpp. Should I use the function from the other's plugin? :)

Re: conver I420 to RGB

Posted: 13 Jul 2011 09:05
by Rémi Denis-Courmont
It is there. You're probably not looking at the correct version.