Paste: asm loop

Author: pruned
Mode: text
Date: Sun, 6 Feb 2011 09:37:53
Plain Text |
  //if (false)
    for (_y in range(img.dim.y))
    {
        var y = _y;
        //y = bitwiseAnd(y, magic)+100;
        // do 1x scanline
        var loops = (img.dim.x+15)/16;
        var src = &img[0,-3,y];
        var dst = &tmp[0,0,y];
                
        //breakpoint();
        var u = uload16b(src);
        for (x in range(loops*1i64))
        {
            /*
            var a = uload16b(src+x*16+0);
            var b = uload16b(src+x*16+1);
            var c = uload16b(src+x*16+2);
            var d = aload16b(src+x*16+3);
            var e = uload16b(src+x*16+4);
            var f = uload16b(src+x*16+5);
            var g = uload16b(src+x*16+6);
            */
            
            var v = uload16b(src+x*16+16);
            
            var a = shr_qq(u,v, 0*8);
            var b = shr_qq(u,v, 1*8);
            var c = shr_qq(u,v, 2*8);
            var d = shr_qq(u,v, 3*8);
            var e = shr_qq(u,v, 4*8);
            var f = shr_qq(u,v, 5*8);
            var g = shr_qq(u,v, 6*8);
            
            var zero = Vec[Byte, 16](0u8);
            
            var ag = avg_b(a,g);
            var bf = avg_b(b,f);
            var ce = avg_b(c,e);
            var d2 = avg_b(d,zero);
            
            var agbf = avg_b(ag,bf);
            var ced = avg_b(ce,d2);
            
            var t = avg_b(agbf, ced);
            
            astore16b(dst+x*16, t);
            u = v;
        }
    }

New Annotation

Summary:
Author:
Mode:
Body: