[Ffmpeg-devel] PIX_FMT_RGB555 and alpha channel
Michael Niedermayer
michaelni
Mon Oct 30 10:17:11 CET 2006
Hi
On Mon, Oct 30, 2006 at 02:48:06AM +0100, Alex Beregszaszi wrote:
> Hi,
>
> > > I will elaborate. Alex and I are implementing FLC/FLX and DTA
> > > encoding into ffmpeg. We are a little way from having stuff ready
> > > to submit, but there is a problem with compression when the Alpha
> > > bit is set in an RGB555 pixel, for the FLX format. It means we
> > > have to mask every pixel coming in, to take the spurious alpha bit
> > > out, or that bit prevents run length compression from being
> > > effective. The format is really wanting to use RGB555, without
> > > alpha, so that black is 0x0000 and not 0x8000 but
> >
> > why does RLE compression not work with the alpha bit set?
> > and why exactly is the alpha bit set at all? if imgconvert.c sets it,
> > IMO fix imgconvert.c so it doesnt
>
> Attached is a patch which fixes it, and adds the old behaviour as
> RGBA555.
rejected as already said, i wont accept a second native endiam rgb555
format to avoid a _single_ instruction in a very old and obscure codec
[...]
> 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
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is
More information about the ffmpeg-devel
mailing list