sws: fix copy case detection with gray8a.

Fixes gray_alpha.png

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-01-19 08:36:17 +01:00
parent 2478612fc0
commit 657878f76e
1 changed files with 4 additions and 3 deletions

View File

@ -829,13 +829,14 @@ void ff_get_unscaled_swscale(SwsContext *c)
if (srcFormat == PIX_FMT_UYVY422 && dstFormat == PIX_FMT_YUV422P) if (srcFormat == PIX_FMT_UYVY422 && dstFormat == PIX_FMT_YUV422P)
c->swScale = uyvyToYuv422Wrapper; c->swScale = uyvyToYuv422Wrapper;
#define isPlanarGray(x) (isGray(x) && (x) != PIX_FMT_GRAY8A)
/* simple copy */ /* simple copy */
if ( srcFormat == dstFormat || if ( srcFormat == dstFormat ||
(srcFormat == PIX_FMT_YUVA420P && dstFormat == PIX_FMT_YUV420P) || (srcFormat == PIX_FMT_YUVA420P && dstFormat == PIX_FMT_YUV420P) ||
(srcFormat == PIX_FMT_YUV420P && dstFormat == PIX_FMT_YUVA420P) || (srcFormat == PIX_FMT_YUV420P && dstFormat == PIX_FMT_YUVA420P) ||
(isPlanarYUV(srcFormat) && isGray(dstFormat)) || (isPlanarYUV(srcFormat) && isPlanarGray(dstFormat)) ||
(isPlanarYUV(dstFormat) && isGray(srcFormat)) || (isPlanarYUV(dstFormat) && isPlanarGray(srcFormat)) ||
(isGray(dstFormat) && isGray(srcFormat)) || (isPlanarGray(dstFormat) && isPlanarGray(srcFormat)) ||
(isPlanarYUV(srcFormat) && isPlanarYUV(dstFormat) && (isPlanarYUV(srcFormat) && isPlanarYUV(dstFormat) &&
c->chrDstHSubSample == c->chrSrcHSubSample && c->chrDstHSubSample == c->chrSrcHSubSample &&
c->chrDstVSubSample == c->chrSrcVSubSample && c->chrDstVSubSample == c->chrSrcVSubSample &&