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

Janusz Krzysztofik jkrzyszt
Sun Feb 28 19:55:24 CET 2010


Sunday 28 February 2010 19:17:22 Michael Niedermayer napisa?(a):
> On Sun, Feb 28, 2010 at 05:56:30PM +0100, Janusz Krzysztofik wrote:
> > 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.
> >
> > This patch adds rudimentary support for RGB12 aka RGB444 pixel format
> > handling to ffmpeg libraries, including the definitions of new pixel
> > format ids, the pixel format desciption and the info and extensions to
> > core helper functions provided by libavcodec/imgconvert.c. Other patches,
> > based on this one, providing converters and possibly other features, will
> > follow.
> >
> > Created and tested against ffmpeg svn revision 22110 dated 2010-02-28.
> >
> > Signed-off-by: Janusz Krzysztofik <jkrzyszt at tis.icnet.pl>
>
> [...]
>
> > @@ -778,7 +814,10 @@ int avcodec_get_pix_fmt_loss(enum PixelF
> >      pf = &pix_fmt_info[dst_pix_fmt];
> >      if (pf->depth < ps->depth ||
> >         ((dst_pix_fmt == PIX_FMT_RGB555BE || dst_pix_fmt == PIX_FMT_RGB555LE) &&
> >-         (src_pix_fmt == PIX_FMT_RGB565BE || src_pix_fmt == PIX_FMT_RGB565LE)))
> >+         (src_pix_fmt == PIX_FMT_RGB565BE || src_pix_fmt == PIX_FMT_RGB565LE)) ||
> >+        ((dst_pix_fmt == PIX_FMT_RGB444BE || dst_pix_fmt == PIX_FMT_RGB444LE) &&
> >+         (src_pix_fmt == PIX_FMT_RGB555BE || src_pix_fmt == PIX_FMT_RGB555LE ||
> >+          src_pix_fmt == PIX_FMT_RGB565BE || src_pix_fmt == PIX_FMT_RGB565LE)))
>
> is this missing bgr cases?

Michael,
Possibly yes. If it is, it already was before. Sorry, I'm not that familiar 
with ffmpeg code to find bugs by simply reading it if not experiencing any 
visible issues.

> also i suspect this can be done simpler 

While looking for a simpler solution, I found no change is necessary here at 
all, since declared RGB/BGR444 depth (4) is less than RGB/BGR555/565 depth 
(5) and detected by first general condition. Thus, I'll just drop this snippet 
and leave the code as is for next iteration.

If someone can confirm that bgr cases are really missing, I can prepare a 
separate patch later.

Thanks,
Janusz





More information about the ffmpeg-devel mailing list