diff options
author | Ramiro Polla <ramiro.polla@gmail.com> | 2009-08-13 18:39:39 +0000 |
---|---|---|
committer | Ramiro Polla <ramiro.polla@gmail.com> | 2009-08-13 18:39:39 +0000 |
commit | d426ea20c9ac9086a7f2d22e55131b5ea7c5cb37 (patch) | |
tree | b7b68cfb58fb2e4f47cd179c7ca1e0a259167a33 | |
parent | 48f4c61252111ff852a1617a0c8db3be864c0769 (diff) | |
download | ffmpeg-d426ea20c9ac9086a7f2d22e55131b5ea7c5cb37.tar.gz |
swscale-example: Don't check for chroma planes in mono formats.
Originally committed as revision 29511 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
-rw-r--r-- | libswscale/swscale-example.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libswscale/swscale-example.c b/libswscale/swscale-example.c index c289324f0b..0e8db8a1ef 100644 --- a/libswscale/swscale-example.c +++ b/libswscale/swscale-example.c @@ -37,6 +37,11 @@ const char *sws_format_name(enum PixelFormat format); || (x)==PIX_FMT_GRAY16BE \ || (x)==PIX_FMT_GRAY16LE \ ) +#define hasChroma(x) (!( \ + isGray(x) \ + || (x)==PIX_FMT_MONOBLACK \ + || (x)==PIX_FMT_MONOWHITE \ + )) #define isALPHA(x) ( \ (x)==PIX_FMT_BGR32 \ || (x)==PIX_FMT_BGR32_1 \ @@ -139,7 +144,7 @@ static int doTest(uint8_t *ref[4], int refStride[4], int w, int h, int srcFormat sws_scale(outContext, dst, dstStride, 0, dstH, out, refStride); ssdY= getSSD(ref[0], out[0], refStride[0], refStride[0], w, h); - if (!isGray(srcFormat) && !isGray(dstFormat)) { + if (hasChroma(srcFormat) && hasChroma(dstFormat)) { //FIXME check that output is really gray ssdU= getSSD(ref[1], out[1], refStride[1], refStride[1], (w+1)>>1, (h+1)>>1); ssdV= getSSD(ref[2], out[2], refStride[2], refStride[2], (w+1)>>1, (h+1)>>1); |