[vlc-devel] yuv<->rgb conversion in video filters

Branko Kokanovic branko.kokanovic at gmail.com
Sat Aug 8 12:24:04 CEST 2009

I wanted to write simple filter - posterize (idea from VLC wiki that
points to http://www.movavi.com/videoeditor/filters.html)

Anyway, I need to work in RGB domain to achieve this effect and I don't
want to write my own yuv<->rgb convertions. I looked at several places
and it all ended without answer, so I had to ask here. Short question
is: what is best practices for this? Long questions are:
* should I convert pixel by pixel or whole frame?
* can I use filters in modules/video_chroma/ and how (references to any
existing code should be enough) or we're not supposed to directly access
these filters?
* Is image_Convert function way to do it? (I looked where it is used and
those are mostly some filters that doesn't need it for chroma
conversion, but for some other purposes - resizing, croping, so -
although tempting, I'm left wondering should I use it)
* Finally, maybe filter developers shouldn't try to convert pixels to
RGB domain at all (I don't see any filter that does/need that?) and I
should try to implement posterize logic directly in YUV domain (maybe
offtopic, but, mathematically speaking, even if I know minimum and
maximum of YUV components, I will not be able (without conversion to RGB
domain) to reproduce exactly same effect as in, for example GIMP).

P.S. Should I write this filter at all? Maybe it already can be achieved
with some combination of existing filters that I'm unaware of?

Thanks for replies, Kokan

More information about the vlc-devel mailing list