Hi Paul, On Mon, Jan 30, 2012 at 8:12 AM, Paul B Mahol <one...@gmail.com> wrote: > On 1/30/12, Ronald S. Bultje <rsbul...@gmail.com> wrote: >> Hi, >> >> On Mon, Jan 30, 2012 at 5:58 AM, Paul B Mahol <one...@gmail.com> wrote: >>> >>> Signed-off-by: Paul B Mahol <one...@gmail.com> >>> --- >>> libswscale/yuv2rgb.c | 4 ++-- >>> 1 files changed, 2 insertions(+), 2 deletions(-) >>> >>> diff --git a/libswscale/yuv2rgb.c b/libswscale/yuv2rgb.c >>> index 39c8b9c..1927cd5 100644 >>> --- a/libswscale/yuv2rgb.c >>> +++ b/libswscale/yuv2rgb.c >>> @@ -529,9 +529,9 @@ SwsFunc ff_yuv2rgb_get_func_ptr(SwsContext *c) >>> case PIX_FMT_RGB48BE: >>> case PIX_FMT_RGB48LE: return yuv2rgb_c_48; >>> case PIX_FMT_ARGB: >>> - case PIX_FMT_ABGR: if (CONFIG_SWSCALE_ALPHA && c->srcFormat == >>> PIX_FMT_YUVA420P) return yuva2argb_c; >>> + case PIX_FMT_ABGR: if (CONFIG_SWSCALE_ALPHA && >>> isALPHA(c->srcFormat)) return yuva2argb_c; >>> case PIX_FMT_RGBA: >>> - case PIX_FMT_BGRA: return (CONFIG_SWSCALE_ALPHA && c->srcFormat >>> == PIX_FMT_YUVA420P) ? yuva2rgba_c : yuv2rgb_c_32; >>> + case PIX_FMT_BGRA: return (CONFIG_SWSCALE_ALPHA && >>> isALPHA(c->srcFormat)) ? yuva2rgba_c : yuv2rgb_c_32; >>> case PIX_FMT_RGB24: return yuv2rgb_c_24_rgb; >>> case PIX_FMT_BGR24: return yuv2rgb_c_24_bgr; >>> case PIX_FMT_RGB565: >> >> That doesn't do anything, see this code in swscale_unscaled.c: >> >> /* yuv2bgr */ >> if ((srcFormat == PIX_FMT_YUV420P || srcFormat == PIX_FMT_YUV422P || >> srcFormat == PIX_FMT_YUVA420P) && isAnyRGB(dstFormat) && >> !(flags & SWS_ACCURATE_RND) && !(dstH & 1)) { >> c->swScale = ff_yuv2rgb_get_func_ptr(c); >> } > > You lost me here. How can i see that something is really wrong? > > Command to reproduce issue you found would be nice.
What I mean is that your patch won't make any difference. The isALPHA() check is intended to make the check more generic and have the condition be true for formats other than YUVA420P also, e.g. for YUVA444P. However, here, that won't be true, since the caller function ensures that srcFormat is one of YUV420P, YUVA420P or YUV422P, and thus the only case where the srcFormat has an alpha channel is where srcFormat == YUVA420P. In other words, the patch is unnecessary. Ronald _______________________________________________ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel