Revision 565a45ac

View differences:

libavcodec/snow.c
1403 1403
    }
1404 1404
}
1405 1405

  
1406
static void vertical_compose97i(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, DWTELEM *b3, DWTELEM *b4, DWTELEM *b5, int width){
1407
    int i;
1408
    
1409
    for(i=0; i<width; i++){
1410
        int r;
1411
        b4[i] -= (W_DM*(b3[i] + b5[i])+W_DO)>>W_DS;
1412
#ifdef lift5
1413
        b3[i] -= (W_CM*(b2[i] + b4[i])+W_CO)>>W_CS;
1414
#else
1415
        r= 3*(b2[i] + b4[i]);
1416
        r+= r>>4;
1417
        r+= r>>8;
1418
        b3[i] -= (r+W_CO)>>W_CS;
1419
#endif
1420
        b2[i] += (W_BM*(b1[i] + b3[i])+W_BO)>>W_BS;
1421
        b1[i] += (W_AM*(b0[i] + b2[i])+W_AO)>>W_AS;
1422
    }
1423
}
1424

  
1406 1425
static void spatial_compose97i_buffered_init(dwt_compose_t *cs, slice_buffer * sb, int height, int stride_line){
1407 1426
    cs->b0 = slice_buffer_get_line(sb, mirror(-3-1, height-1) * stride_line);
1408 1427
    cs->b1 = slice_buffer_get_line(sb, mirror(-3  , height-1) * stride_line);
......
1435 1454
    DWTELEM *b4= slice_buffer_get_line(sb, mirror4 * stride_line);
1436 1455
    DWTELEM *b5= slice_buffer_get_line(sb, mirror5 * stride_line);
1437 1456
        
1438
        if(stride_line == 1 && y+4 < height && 0){ 
1439
            int x;
1440
            for(x=0; x<width/2; x++)
1441
                b5[x] += 64*2;
1442
            for(; x<width; x++)
1443
                b5[x] += 169*2;
1444
        }
1445
        
1446
//        if(mirror3 <= mirror5 && mirror2 <= mirror4 && mirror1 <= mirror3 && mirror0 <= mirror2)
1447
//        {
1448
//{START_TIMER
1449
//            vertical_compose97_complete(b0, b1, b2, b3, b4, b5, width);
1450
//if(width>400){
1451
//STOP_TIMER("vertical_compose97i-NEW")}}
1452
//        }
1453
//        else
1454
//        {
1455 1457
{START_TIMER
1456
            if(mirror3 <= mirror5) vertical_compose97iL1(b3, b4, b5, width);
1457
            if(mirror2 <= mirror4) vertical_compose97iH1(b2, b3, b4, width);
1458
            if(mirror1 <= mirror3) vertical_compose97iL0(b1, b2, b3, width);
1459
            if(mirror0 <= mirror2) vertical_compose97iH0(b0, b1, b2, width);
1458
    if(y>0 && y+4<height){
1459
        vertical_compose97i(b0, b1, b2, b3, b4, b5, width);
1460
    }else{
1461
        if(mirror3 <= mirror5) vertical_compose97iL1(b3, b4, b5, width);
1462
        if(mirror2 <= mirror4) vertical_compose97iH1(b2, b3, b4, width);
1463
        if(mirror1 <= mirror3) vertical_compose97iL0(b1, b2, b3, width);
1464
        if(mirror0 <= mirror2) vertical_compose97iH0(b0, b1, b2, width);
1465
    }
1460 1466
if(width>400){
1461 1467
STOP_TIMER("vertical_compose97i")}}
1462
//        }
1463 1468

  
1464 1469
{START_TIMER
1465 1470
        if(y-1>=  0) horizontal_compose97i(b0, width);

Also available in: Unified diff