[FFmpeg-devel] [PATCH] Remove swscale_internal.h:fmt_depth()

Ramiro Polla ramiro.polla
Mon Jan 18 02:42:41 CET 2010


On Sun, Jan 17, 2010 at 11:04 PM, Stefano Sabatini
<stefano.sabatini-lala at poste.it> wrote:
> On date Sunday 2010-01-17 22:25:22 -0200, Ramiro Polla encoded:
>> I think it should be:
>> diff --git a/swscale.c b/swscale.c
>> index a2a8c83..0f6d631 100644
>> --- a/swscale.c
>> +++ b/swscale.c
>> @@ -2550,8 +2550,8 @@ SwsContext *sws_getContext(int srcW, int srcH,
>> enum PixelFormat srcFormat, int d
>> ? ? ? ? ? ? && srcFormat != PIX_FMT_RGB4_BYTE && dstFormat != PIX_FMT_RGB4_BYTE
>> ? ? ? ? ? ? && srcFormat != PIX_FMT_MONOBLACK && dstFormat != PIX_FMT_MONOBLACK
>> ? ? ? ? ? ? && srcFormat != PIX_FMT_MONOWHITE && dstFormat != PIX_FMT_MONOWHITE
>> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? && dstFormat != PIX_FMT_RGB32_1
>> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? && dstFormat != PIX_FMT_BGR32_1
>> + ? ? ? ? ? && srcFormat != PIX_FMT_RGB32_1 ? && dstFormat != PIX_FMT_RGB32_1
>> + ? ? ? ? ? && srcFormat != PIX_FMT_BGR32_1 ? && dstFormat != PIX_FMT_BGR32_1
>> ? ? ? ? ? ? && srcFormat != PIX_FMT_RGB48LE ? && dstFormat != PIX_FMT_RGB48LE
>> ? ? ? ? ? ? && srcFormat != PIX_FMT_RGB48BE ? && dstFormat != PIX_FMT_RGB48BE
>> ? ? ? ? ? ? && (!needsDither || (c->flags&(SWS_FAST_BILINEAR|SWS_POINT))))
>
> This could be simplified checking for:
> !{src,dst}FormatDesc.flags & PIX_FMT_BITSTREAM

Hmmm, how's that?

>> But I didn't test yet because swscale-example doesn't build because of
>> the latest change in pixfmt.h.
>
> (I simply re-added the _NE definitions which were in pixfmt.h, clearly
> not the right solution).
>
> Patch attached fix the SSD for R/G/B, the alpha SSD is still high,
> which depends on the hack in r27522 which can't work with alpha, maybe
> we need some more specialized converters.

Hmm, wasn't that my patch from some time ago?

Something looks weird, why would it be memcpy when we actually need to
bswap32? I'm overall still confused with those RGB32, ARGB, etc...



More information about the ffmpeg-devel mailing list