[Ffmpeg-devel] PIX_FMT_RGB555 and alpha channel
Steven Johnson
mplayer
Mon Oct 30 22:42:29 CET 2006
Before I start, this post has nothing to do with the FLC Encoder. I am
happy to have it mask pixels and what not. It doesn't matter to me
either way, but I am confused about the pixel formats.
I just looked into libswscale to see what it does, as I had a bunch of
patches for the swscale inside FFMpeg, but Alex informs me that they
wont be accepted for a number of reasons, but a big one is that there is
a move towards using libswscale by preference, so I was seeing what the
work of adding them to libswscale was. (The other issues I believe I can
resolve).
I noticed that for rgb15 formats libswscale always sets the MSBit to 0.
Which is not what FFMpeg does for this format. With the MSBit = 0,
FFMpeg would say that the pixel is fully transparent. They would all
need to be or'd with 0x8000 to have the same format as FFMpeg RGB555.
Is this a bug? Should they be or'd with 0x8000 to make the format == to
FFMpeg's version?
Also, it would appear that there is no Alpha support in libswscale, is
that correct?
Steven J
Alex Beregszaszi wrote:
> Hi,
>
>
>>> Index: libavutil/avutil.h
>>> ===================================================================
>>> --- libavutil/avutil.h (revision 6738)
>>> +++ libavutil/avutil.h (working copy)
>>> @@ -78,7 +78,8 @@
>>> PIX_FMT_YUV410P, ///< Planar YUV 4:1:0, 9bpp, (1 Cr & Cb
>>> sample per 4x4 Y samples) PIX_FMT_YUV411P, ///< Planar YUV
>>> 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
>>> PIX_FMT_RGB565, ///< Packed RGB 5:6:5, 16bpp, (msb) 5R 6G
>>> 5B(lsb), in cpu endianness
>>> - PIX_FMT_RGB555, ///< Packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G
>>> 5B(lsb), in cpu endianness most significant bit to 1 +
>>> PIX_FMT_RGB555, ///< Packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G
>>> 5B(lsb), in cpu endianness most significant bit to 0 +
>>> PIX_FMT_RGBA555, ///< Packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G
>>> 5B(lsb), in cpu endianness most significant bit to 1
>>> PIX_FMT_GRAY8, ///< Y , 8bpp
>>>
>> breaks binary compatibility
>>
>> also it likely breaks the swscaler as you didnt change it
>>
>
> Does SWScaler sets the MSB to 1 in case of RGB555? If not, this doesnt
> breaks it.
>
>
More information about the ffmpeg-devel
mailing list