Revision 11f18faf libavcodec/dsputil.c

View differences:

libavcodec/dsputil.c
1342 1342
    memset(blocks, 0, sizeof(DCTELEM)*6*64);
1343 1343
}
1344 1344

  
1345
static void add_bytes_c(uint8_t *dst, uint8_t *src, int w){
1346
    int i;
1347
    for(i=0; i+7<w; i++){
1348
        dst[i+0] += src[i+0];
1349
        dst[i+1] += src[i+1];
1350
        dst[i+2] += src[i+2];
1351
        dst[i+3] += src[i+3];
1352
        dst[i+4] += src[i+4];
1353
        dst[i+5] += src[i+5];
1354
        dst[i+6] += src[i+6];
1355
        dst[i+7] += src[i+7];
1356
    }
1357
    for(; i<w; i++)
1358
        dst[i+0] += src[i+0];
1359
}
1360

  
1361
static void diff_bytes_c(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w){
1362
    int i;
1363
    for(i=0; i+7<w; i++){
1364
        dst[i+0] = src1[i+0]-src2[i+0];
1365
        dst[i+1] = src1[i+1]-src2[i+1];
1366
        dst[i+2] = src1[i+2]-src2[i+2];
1367
        dst[i+3] = src1[i+3]-src2[i+3];
1368
        dst[i+4] = src1[i+4]-src2[i+4];
1369
        dst[i+5] = src1[i+5]-src2[i+5];
1370
        dst[i+6] = src1[i+6]-src2[i+6];
1371
        dst[i+7] = src1[i+7]-src2[i+7];
1372
    }
1373
    for(; i<w; i++)
1374
        dst[i+0] = src1[i+0]-src2[i+0];
1375
}
1376

  
1345 1377
void dsputil_init(DSPContext* c, unsigned mask)
1346 1378
{
1347 1379
    static int init_done = 0;
......
1431 1463
    /* dspfunc(avg_no_rnd_qpel, 1, 8); */
1432 1464
#undef dspfunc
1433 1465

  
1466
    c->add_bytes= add_bytes_c;
1467
    c->diff_bytes= diff_bytes_c;
1468

  
1434 1469
#ifdef HAVE_MMX
1435 1470
    dsputil_init_mmx(c, mask);
1436 1471
    if (ff_bit_exact)

Also available in: Unified diff