Revision d426ea20

View differences:

libswscale/swscale-example.c
37 37
        || (x)==PIX_FMT_GRAY16BE    \
38 38
        || (x)==PIX_FMT_GRAY16LE    \
39 39
    )
40
#define hasChroma(x)   (!(           \
41
            isGray(x)               \
42
        || (x)==PIX_FMT_MONOBLACK   \
43
        || (x)==PIX_FMT_MONOWHITE   \
44
    ))
40 45
#define isALPHA(x)      (           \
41 46
           (x)==PIX_FMT_BGR32       \
42 47
        || (x)==PIX_FMT_BGR32_1     \
......
139 144
    sws_scale(outContext, dst, dstStride, 0, dstH, out, refStride);
140 145

  
141 146
    ssdY= getSSD(ref[0], out[0], refStride[0], refStride[0], w, h);
142
    if (!isGray(srcFormat) && !isGray(dstFormat)) {
147
    if (hasChroma(srcFormat) && hasChroma(dstFormat)) {
143 148
        //FIXME check that output is really gray
144 149
        ssdU= getSSD(ref[1], out[1], refStride[1], refStride[1], (w+1)>>1, (h+1)>>1);
145 150
        ssdV= getSSD(ref[2], out[2], refStride[2], refStride[2], (w+1)>>1, (h+1)>>1);

Also available in: Unified diff