Revision 1b03a9d6 libswscale/swscale.c

View differences:

libswscale/swscale.c
3259 3259
    double middle= (length-1)*0.5;
3260 3260
    SwsVector *vec= sws_allocVec(length);
3261 3261

  
3262
    if (!vec)
3263
        return NULL;
3264

  
3262 3265
    for (i=0; i<length; i++) {
3263 3266
        double dist= i-middle;
3264 3267
        vec->coeff[i]= exp(-dist*dist/(2*variance*variance)) / sqrt(2*variance*PI);
......
3274 3277
    int i;
3275 3278
    SwsVector *vec= sws_allocVec(length);
3276 3279

  
3280
    if (!vec)
3281
        return NULL;
3282

  
3277 3283
    for (i=0; i<length; i++)
3278 3284
        vec->coeff[i]= c;
3279 3285

  
......
3316 3322
    int i, j;
3317 3323
    SwsVector *vec= sws_getConstVec(0.0, length);
3318 3324

  
3325
    if (!vec)
3326
        return NULL;
3327

  
3319 3328
    for (i=0; i<a->length; i++) {
3320 3329
        for (j=0; j<b->length; j++) {
3321 3330
            vec->coeff[i+j]+= a->coeff[i]*b->coeff[j];
......
3331 3340
    int i;
3332 3341
    SwsVector *vec= sws_getConstVec(0.0, length);
3333 3342

  
3343
    if (!vec)
3344
        return NULL;
3345

  
3334 3346
    for (i=0; i<a->length; i++) vec->coeff[i + (length-1)/2 - (a->length-1)/2]+= a->coeff[i];
3335 3347
    for (i=0; i<b->length; i++) vec->coeff[i + (length-1)/2 - (b->length-1)/2]+= b->coeff[i];
3336 3348

  
......
3343 3355
    int i;
3344 3356
    SwsVector *vec= sws_getConstVec(0.0, length);
3345 3357

  
3358
    if (!vec)
3359
        return NULL;
3360

  
3346 3361
    for (i=0; i<a->length; i++) vec->coeff[i + (length-1)/2 - (a->length-1)/2]+= a->coeff[i];
3347 3362
    for (i=0; i<b->length; i++) vec->coeff[i + (length-1)/2 - (b->length-1)/2]-= b->coeff[i];
3348 3363

  
......
3356 3371
    int i;
3357 3372
    SwsVector *vec= sws_getConstVec(0.0, length);
3358 3373

  
3374
    if (!vec)
3375
        return NULL;
3376

  
3359 3377
    for (i=0; i<a->length; i++) {
3360 3378
        vec->coeff[i + (length-1)/2 - (a->length-1)/2 - shift]= a->coeff[i];
3361 3379
    }
......
3404 3422
    int i;
3405 3423
    SwsVector *vec= sws_allocVec(a->length);
3406 3424

  
3425
    if (!vec)
3426
        return NULL;
3427

  
3407 3428
    for (i=0; i<a->length; i++) vec->coeff[i]= a->coeff[i];
3408 3429

  
3409 3430
    return vec;

Also available in: Unified diff