~ubuntu-branches/ubuntu/trusty/vips/trusty-proposed

« back to all changes in this revision

Viewing changes to libvips/resample/interpolate.c

  • Committer: Package Import Robot
  • Author(s): Jay Berkenbilt
  • Date: 2014-03-29 12:29:29 UTC
  • mfrom: (1.1.21) (30.1.16 sid)
  • Revision ID: package-import@ubuntu.com-20140329122929-fvxnaann32ex0gzk
Tags: 7.38.5-2
Enable dh-autoreconf. (Closes: #742872)

Show diffs side-by-side

added added

removed removed

Lines of Context:
337
337
        const int xi = (int) x;
338
338
        const int yi = (int) y;
339
339
 
340
 
        const VipsPel *p = VIPS_REGION_ADDR( in, xi, yi );
341
 
        VipsPel *q = (VipsPel *) out;
 
340
        const VipsPel * restrict p = VIPS_REGION_ADDR( in, xi, yi );
 
341
        VipsPel * restrict q = (VipsPel *) out;
342
342
 
343
343
        int z;
344
344
 
429
429
/* Fixed-point arithmetic, no tables.
430
430
 */
431
431
#define BILINEAR_INT( TYPE ) { \
432
 
        TYPE *tq = (TYPE *) out; \
 
432
        TYPE * restrict tq = (TYPE *) out; \
433
433
        \
434
434
        const int X = (x - ix) * VIPS_INTERPOLATE_SCALE; \
435
435
        const int Y = (iy - y) * VIPS_INTERPOLATE_SCALE; \
436
436
        \
437
 
        const TYPE *tp1 = (TYPE *) p1; \
438
 
        const TYPE *tp2 = (TYPE *) p2; \
439
 
        const TYPE *tp3 = (TYPE *) p3; \
440
 
        const TYPE *tp4 = (TYPE *) p4; \
 
437
        const TYPE * restrict tp1 = (TYPE *) p1; \
 
438
        const TYPE * restrict tp2 = (TYPE *) p2; \
 
439
        const TYPE * restrict tp3 = (TYPE *) p3; \
 
440
        const TYPE * restrict tp4 = (TYPE *) p4; \
441
441
        \
442
442
        for( z = 0; z < b; z++ ) { \
443
443
                const int top = tp1[z] + \
453
453
 * arithmetic.
454
454
 */
455
455
#define BILINEAR_FLOAT( TYPE ) { \
456
 
        TYPE *tq = (TYPE *) out; \
 
456
        TYPE * restrict tq = (TYPE *) out; \
457
457
        \
458
458
        float Y  = y - iy; \
459
459
        float X  = x - ix; \
465
465
        float c3 = Y  - c4; \
466
466
        float c1 = Yd - c2; \
467
467
        \
468
 
        const TYPE *tp1 = (TYPE *) p1; \
469
 
        const TYPE *tp2 = (TYPE *) p2; \
470
 
        const TYPE *tp3 = (TYPE *) p3; \
471
 
        const TYPE *tp4 = (TYPE *) p4; \
 
468
        const TYPE * restrict tp1 = (TYPE *) p1; \
 
469
        const TYPE * restrict tp2 = (TYPE *) p2; \
 
470
        const TYPE * restrict tp3 = (TYPE *) p3; \
 
471
        const TYPE * restrict tp4 = (TYPE *) p4; \
472
472
        \
473
473
        for( z = 0; z < b; z++ ) \
474
474
                tq[z] = c1 * tp1[z] + c2 * tp2[z] + \
506
506
        const int ix = (int) x;
507
507
        const int iy = (int) y;
508
508
 
509
 
        const VipsPel *p1 = VIPS_REGION_ADDR( in, ix, iy );
510
 
        const VipsPel *p2 = p1 + ps;
511
 
        const VipsPel *p3 = p1 + ls;
512
 
        const VipsPel *p4 = p3 + ps;
 
509
        const VipsPel * restrict p1 = VIPS_REGION_ADDR( in, ix, iy );
 
510
        const VipsPel * restrict p2 = p1 + ps;
 
511
        const VipsPel * restrict p3 = p1 + ls;
 
512
        const VipsPel * restrict p4 = p3 + ps;
513
513
 
514
514
        int z;
515
515