[FFmpeg-devel] [RFC][PATCH] Add support for 12-bit color mode.

Stefano Sabatini stefano.sabatini-lala
Sat Feb 27 10:36:32 CET 2010

On date Saturday 2010-02-27 03:31:35 +0100, Janusz Krzysztofik encoded:
> Hi,
> While trying to play video on my ARM OMAP1 based Amstrad Delta (E3) videophone 
> with mplayer, I found it not compatible with the 12-bit LCD display my device 
> is equipped with. To solve the problem, I patched several mplayer video output 
> drivers to support my device. For them to be usefull, I also had to patch 
> libswscale to be able to convert video to my device compatible RGB444 format.
> The patch tries to extend not only libswscale, but all ffmpeg libraries as 
> well, with RGB12 aka RGB444 pixel format handling. All new color conversion 
> functions are supposed to work correctly except for dithering that I was not 
> able to develop correct table values for by myself.
> Some changes to video codecs that I was not able to understand deeply enough 
> and test them are probably wrong or not applicable.
> Created against ffmpeg svn revision 22026 dated 2010-02-24.
> Tested with patched mplayer on omapfb framebuffer device with Amstrad Delta 
> 12-bit LCD display.

For of all much thanks for the patch.

I belieive the patch should be split for easing review. First step
could be to hook the definitions of the pixel format ids, the pixel
format desciption and the info in libavcodec/imgconvert.c.

Note that the new format ids have to be placed at the end of the the
PixelFormat enum, the same for the pixdescs, I'd like to keep the same
order as in the enum (we may re-order the enum at the next major

FFmpeg = Fostering and Frightening Mastering Powered Encoding/decoding Game

More information about the ffmpeg-devel mailing list