[Ffmpeg-devel] PIX_FMT_RGB555 and alpha channel
Fri Oct 20 13:12:35 CEST 2006
Michael Niedermayer wrote:
> On Thu, Oct 19, 2006 at 02:02:34AM +0200, Alex Beregszaszi wrote:
>> Current FFmpeg uses the MSB of RGB555 as alpha channel. Look at
>> pix_fmt_info in imgconvert.c. This causes it to set the MSB in case of
>> conversion to RGB555.
>> Is that for a reason?
> i dont know :)
>> I would propose adding RGBA555 for the alpha
>> channel containing format and remove the alpha channel from RGB555.
>> Any objections?
> could you elaborate on why the alpha channel bit is a problem?
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
the only option in FFMPEG is RGB1555. So the options are add a true
RGB555 and change the existing RGB555 to an RGBA555, or for us to mask
every pixel when it is using RGB555 pixels. We currently mask, but it
makes the code ugly, and it looks like a hack, and it will be slower
than if there was a non-alpha version of RGB555 available to use.
More information about the ffmpeg-devel