Revision fcc402b1

View differences:

libswscale/swscale.c
88 88

  
89 89
#define RET 0xC3 //near return opcode for X86
90 90

  
91
#ifdef MP_DEBUG
92
#define ASSERT(x) assert(x);
93
#else
94
#define ASSERT(x) ;
95
#endif
96

  
97 91
#ifdef M_PI
98 92
#define PI M_PI
99 93
#else
......
1060 1054
        else if (flags&SWS_BILINEAR)     sizeFactor=  2.0;
1061 1055
        else {
1062 1056
            sizeFactor= 0.0; //GCC warning killer
1063
            ASSERT(0)
1057
            assert(0);
1064 1058
        }
1065 1059

  
1066 1060
        if (xInc1 <= 1.0)       filterSizeInSrc= sizeFactor; // upscale
......
1145 1139
                }
1146 1140
                else {
1147 1141
                    coeff= 0.0; //GCC warning killer
1148
                    ASSERT(0)
1142
                    assert(0);
1149 1143
                }
1150 1144

  
1151 1145
                filter[i*filterSize + j]= coeff;
......
1158 1152
    /* apply src & dst Filter to filter -> filter2
1159 1153
       av_free(filter);
1160 1154
    */
1161
    ASSERT(filterSize>0)
1155
    assert(filterSize>0);
1162 1156
    filter2Size= filterSize;
1163 1157
    if (srcFilter) filter2Size+= srcFilter->length - 1;
1164 1158
    if (dstFilter) filter2Size+= dstFilter->length - 1;
1165
    ASSERT(filter2Size>0)
1159
    assert(filter2Size>0);
1166 1160
    filter2= av_malloc(filter2Size*dstW*sizeof(double));
1167 1161

  
1168 1162
    for (i=0; i<dstW; i++)
......
1177 1171
        if (srcFilter) outVec= sws_getConvVec(srcFilter, &scaleFilter);
1178 1172
        else           outVec= &scaleFilter;
1179 1173

  
1180
        ASSERT(outVec->length == filter2Size)
1174
        assert(outVec->length == filter2Size);
1181 1175
        //FIXME dstFilter
1182 1176

  
1183 1177
        for (j=0; j<outVec->length; j++)
......
1252 1246
            filterAlign= 1;
1253 1247
    }
1254 1248

  
1255
    ASSERT(minFilterSize > 0)
1249
    assert(minFilterSize > 0);
1256 1250
    filterSize= (minFilterSize +(filterAlign-1)) & (~(filterAlign-1));
1257
    ASSERT(filterSize > 0)
1251
    assert(filterSize > 0);
1258 1252
    filter= av_malloc(filterSize*dstW*sizeof(double));
1259 1253
    if (filterSize >= MAX_FILTER_SIZE)
1260 1254
        return -1;
......
1746 1740
        /* universal length finder */
1747 1741
        while(length+c->srcW <= FFABS(dstStride[0])
1748 1742
           && length+c->srcW <= FFABS(srcStride[0])) length+= c->srcW;
1749
        ASSERT(length!=0);
1743
        assert(length!=0);
1750 1744

  
1751 1745
        for (i=0; i<srcSliceH; i++)
1752 1746
        {
......
2388 2382

  
2389 2383
    assert(2*VOFW == VOF);
2390 2384

  
2391
    ASSERT(c->chrDstH <= dstH)
2385
    assert(c->chrDstH <= dstH);
2392 2386

  
2393 2387
    if (flags&SWS_PRINT_INFO)
2394 2388
    {
libswscale/swscale_template.c
3039 3039
        if (firstLumSrcY > lastInLumBuf) lastInLumBuf= firstLumSrcY-1;
3040 3040
        if (firstChrSrcY > lastInChrBuf) lastInChrBuf= firstChrSrcY-1;
3041 3041
        //printf("%d %d %d\n", firstChrSrcY, lastInChrBuf, vChrBufSize);
3042
        ASSERT(firstLumSrcY >= lastInLumBuf - vLumBufSize + 1)
3043
        ASSERT(firstChrSrcY >= lastInChrBuf - vChrBufSize + 1)
3042
        assert(firstLumSrcY >= lastInLumBuf - vLumBufSize + 1);
3043
        assert(firstChrSrcY >= lastInChrBuf - vChrBufSize + 1);
3044 3044

  
3045 3045
        // Do we have enough lines in this slice to output the dstY line
3046 3046
        if (lastLumSrcY < srcSliceY + srcSliceH && lastChrSrcY < -((-srcSliceY - srcSliceH)>>c->chrSrcVSubSample))
......
3051 3051
                uint8_t *s= src[0]+(lastInLumBuf + 1 - srcSliceY)*srcStride[0];
3052 3052
                lumBufIndex++;
3053 3053
                //printf("%d %d %d %d\n", lumBufIndex, vLumBufSize, lastInLumBuf,  lastLumSrcY);
3054
                ASSERT(lumBufIndex < 2*vLumBufSize)
3055
                ASSERT(lastInLumBuf + 1 - srcSliceY < srcSliceH)
3056
                ASSERT(lastInLumBuf + 1 - srcSliceY >= 0)
3054
                assert(lumBufIndex < 2*vLumBufSize);
3055
                assert(lastInLumBuf + 1 - srcSliceY < srcSliceH);
3056
                assert(lastInLumBuf + 1 - srcSliceY >= 0);
3057 3057
                //printf("%d %d\n", lumBufIndex, vLumBufSize);
3058 3058
                RENAME(hyscale)(lumPixBuf[ lumBufIndex ], dstW, s, srcW, lumXInc,
3059 3059
                                flags, canMMX2BeUsed, hLumFilter, hLumFilterPos, hLumFilterSize,
......
3066 3066
                uint8_t *src1= src[1]+(lastInChrBuf + 1 - chrSrcSliceY)*srcStride[1];
3067 3067
                uint8_t *src2= src[2]+(lastInChrBuf + 1 - chrSrcSliceY)*srcStride[2];
3068 3068
                chrBufIndex++;
3069
                ASSERT(chrBufIndex < 2*vChrBufSize)
3070
                ASSERT(lastInChrBuf + 1 - chrSrcSliceY < (chrSrcSliceH))
3071
                ASSERT(lastInChrBuf + 1 - chrSrcSliceY >= 0)
3069
                assert(chrBufIndex < 2*vChrBufSize);
3070
                assert(lastInChrBuf + 1 - chrSrcSliceY < (chrSrcSliceH));
3071
                assert(lastInChrBuf + 1 - chrSrcSliceY >= 0);
3072 3072
                //FIXME replace parameters through context struct (some at least)
3073 3073

  
3074 3074
                if (!(isGray(srcFormat) || isGray(dstFormat)))
......
3094 3094
            {
3095 3095
                uint8_t *s= src[0]+(lastInLumBuf + 1 - srcSliceY)*srcStride[0];
3096 3096
                lumBufIndex++;
3097
                ASSERT(lumBufIndex < 2*vLumBufSize)
3098
                ASSERT(lastInLumBuf + 1 - srcSliceY < srcSliceH)
3099
                ASSERT(lastInLumBuf + 1 - srcSliceY >= 0)
3097
                assert(lumBufIndex < 2*vLumBufSize);
3098
                assert(lastInLumBuf + 1 - srcSliceY < srcSliceH);
3099
                assert(lastInLumBuf + 1 - srcSliceY >= 0);
3100 3100
                RENAME(hyscale)(lumPixBuf[ lumBufIndex ], dstW, s, srcW, lumXInc,
3101 3101
                                flags, canMMX2BeUsed, hLumFilter, hLumFilterPos, hLumFilterSize,
3102 3102
                                funnyYCode, c->srcFormat, formatConvBuffer,
......
3108 3108
                uint8_t *src1= src[1]+(lastInChrBuf + 1 - chrSrcSliceY)*srcStride[1];
3109 3109
                uint8_t *src2= src[2]+(lastInChrBuf + 1 - chrSrcSliceY)*srcStride[2];
3110 3110
                chrBufIndex++;
3111
                ASSERT(chrBufIndex < 2*vChrBufSize)
3112
                ASSERT(lastInChrBuf + 1 - chrSrcSliceY < chrSrcSliceH)
3113
                ASSERT(lastInChrBuf + 1 - chrSrcSliceY >= 0)
3111
                assert(chrBufIndex < 2*vChrBufSize);
3112
                assert(lastInChrBuf + 1 - chrSrcSliceY < chrSrcSliceH);
3113
                assert(lastInChrBuf + 1 - chrSrcSliceY >= 0);
3114 3114

  
3115 3115
                if (!(isGray(srcFormat) || isGray(dstFormat)))
3116 3116
                    RENAME(hcscale)(chrPixBuf[ chrBufIndex ], chrDstW, src1, src2, chrSrcW, chrXInc,
......
3199 3199
            }
3200 3200
            else
3201 3201
            {
3202
                ASSERT(lumSrcPtr + vLumFilterSize - 1 < lumPixBuf + vLumBufSize*2);
3203
                ASSERT(chrSrcPtr + vChrFilterSize - 1 < chrPixBuf + vChrBufSize*2);
3202
                assert(lumSrcPtr + vLumFilterSize - 1 < lumPixBuf + vLumBufSize*2);
3203
                assert(chrSrcPtr + vChrFilterSize - 1 < chrPixBuf + vChrBufSize*2);
3204 3204
                if (vLumFilterSize == 1 && vChrFilterSize == 2) //unscaled RGB
3205 3205
                {
3206 3206
                    int chrAlpha= vChrFilter[2*dstY+1];
......
3250 3250
            }
3251 3251
            else
3252 3252
            {
3253
                ASSERT(lumSrcPtr + vLumFilterSize - 1 < lumPixBuf + vLumBufSize*2);
3254
                ASSERT(chrSrcPtr + vChrFilterSize - 1 < chrPixBuf + vChrBufSize*2);
3253
                assert(lumSrcPtr + vLumFilterSize - 1 < lumPixBuf + vLumBufSize*2);
3254
                assert(chrSrcPtr + vChrFilterSize - 1 < chrPixBuf + vChrBufSize*2);
3255 3255
                yuv2packedXinC(c,
3256 3256
                    vLumFilter+dstY*vLumFilterSize, lumSrcPtr, vLumFilterSize,
3257 3257
                    vChrFilter+dstY*vChrFilterSize, chrSrcPtr, vChrFilterSize,

Also available in: Unified diff