[FFmpeg-devel] [PATCH] qtrleenc: Add RGB555 and ARGB pixel formats support

Alexis Ballier alexis.ballier
Wed Jul 8 10:33:02 CEST 2009


>> I had to add a new function to write 16bits pixels as big endian; I
>> would have prefered avoiding it but if I use PIX_FMT_RGB555BE, ffmpeg
>> rants that it cannot allocate the picture. I suppose this is not a bug
>> since I'm on a little endian machine, so here is the patch.
>
> support for non native rgb555 should be added to swscale, even if that
> is just by a bswaping pass over the output ...

Fine, I can resend a much simpler patch asking for RGB555BE in the
encoder but I'm afraid I'm not knowledgeable enough about libswscale
to be able to propose a clean patch to add non native rgb555 support
there.
I've added locally RGB555BE/LE split support in
ff_fill_pointer/ff_fill_linesize in imgconvert.c but now I'm stuck at
libswscale.

>> --- libavcodec/qtrleenc.c ? ? (revision 19341)
>> +++ libavcodec/qtrleenc.c ? ? (working copy)
>> @@ -68,12 +68,15 @@
>> ? ? ?s->avctx=avctx;
>>
>> ? ? ?switch (avctx->pix_fmt) {
>> -/* ? ?case PIX_FMT_RGB555:
>> + ? ?case PIX_FMT_RGB555:
>> ? ? ? ? ?s->pixel_size = 2;
>> - ? ? ? ?break;*/
>> + ? ? ? ?break;
>> ? ? ?case PIX_FMT_RGB24:
>
>> ? ? ? ? ?s->pixel_size = 3;
>> ? ? ? ? ?break;
>> + ? ?case PIX_FMT_ARGB:
>> + ? ? ? ?s->pixel_size = 4;
>> + ? ? ? ?break;
>> ? ? ?default:
>> ? ? ? ? ?av_log(avctx, AV_LOG_ERROR, "Unsupported colorspace.\n");
>> ? ? ? ? ?break;
>
> unrelated?

sorry but I don't understand; setting pixel_size to the correct value
is needed by the rest of the encoder.

Alexis.



More information about the ffmpeg-devel mailing list