Revision cc884a35 libavcodec/snow.c

View differences:

libavcodec/snow.c
2470 2470
    BlockNode *lb= lt+b_stride;
2471 2471
    BlockNode *rb= lb+1;
2472 2472
    uint8_t *block[4]; 
2473
    uint8_t tmp[src_stride*(b_h+5)]; //FIXME align
2473
    int tmp_step= src_stride >= 7*MB_SIZE ? MB_SIZE : MB_SIZE*src_stride;
2474
    uint8_t tmp[src_stride*7*MB_SIZE]; //FIXME align
2475
    uint8_t *ptmp;
2474 2476
    int x,y;
2475 2477

  
2476 2478
    if(b_x<0){
......
2505 2507
    
2506 2508
    if(b_w<=0 || b_h<=0) return;
2507 2509

  
2508
assert(src_stride > 7*MB_SIZE);
2510
assert(src_stride > 2*MB_SIZE + 5);
2509 2511
//    old_dst += src_x + src_y*dst_stride;
2510 2512
    dst8+= src_x + src_y*src_stride;
2511 2513
//    src += src_x + src_y*src_stride;
2512 2514

  
2513
    block[0]= tmp+3*MB_SIZE;
2515
    ptmp= tmp + 3*tmp_step;
2516
    block[0]= ptmp;
2517
    ptmp+=tmp_step;
2514 2518
    pred_block(s, block[0], src, tmp, src_stride, src_x, src_y, b_w, b_h, lt, plane_index, w, h);    
2515 2519

  
2516 2520
    if(same_block(lt, rt)){
2517 2521
        block[1]= block[0];
2518 2522
    }else{
2519
        block[1]= tmp + 4*MB_SIZE;
2523
        block[1]= ptmp;
2524
        ptmp+=tmp_step;
2520 2525
        pred_block(s, block[1], src, tmp, src_stride, src_x, src_y, b_w, b_h, rt, plane_index, w, h);
2521 2526
    }
2522 2527
        
......
2525 2530
    }else if(same_block(rt, lb)){
2526 2531
        block[2]= block[1];
2527 2532
    }else{
2528
        block[2]= tmp+5*MB_SIZE;
2533
        block[2]= ptmp;
2534
        ptmp+=tmp_step;
2529 2535
        pred_block(s, block[2], src, tmp, src_stride, src_x, src_y, b_w, b_h, lb, plane_index, w, h);
2530 2536
    }
2531 2537

  
......
2536 2542
    }else if(same_block(lb, rb)){
2537 2543
        block[3]= block[2];
2538 2544
    }else{
2539
        block[3]= tmp+6*MB_SIZE;
2545
        block[3]= ptmp;
2540 2546
        pred_block(s, block[3], src, tmp, src_stride, src_x, src_y, b_w, b_h, rb, plane_index, w, h);
2541 2547
    }
2542 2548
#if 0
......
2623 2629
    BlockNode *lb= lt+b_stride;
2624 2630
    BlockNode *rb= lb+1;
2625 2631
    uint8_t *block[4]; 
2626
    uint8_t tmp[src_stride*(b_h+5)]; //FIXME align
2632
    int tmp_step= src_stride >= 7*MB_SIZE ? MB_SIZE : MB_SIZE*src_stride;
2633
    uint8_t tmp[src_stride*7*MB_SIZE]; //FIXME align
2634
    uint8_t *ptmp;
2627 2635
    int x,y;
2628 2636

  
2629 2637
    if(b_x<0){
......
2658 2666
    
2659 2667
    if(b_w<=0 || b_h<=0) return;
2660 2668

  
2661
assert(src_stride > 7*MB_SIZE);
2669
assert(src_stride > 2*MB_SIZE + 5);
2662 2670
    dst += src_x + src_y*dst_stride;
2663 2671
    dst8+= src_x + src_y*src_stride;
2664 2672
//    src += src_x + src_y*src_stride;
2665 2673

  
2666
    block[0]= tmp+3*MB_SIZE;
2674
    ptmp= tmp + 3*tmp_step;
2675
    block[0]= ptmp;
2676
    ptmp+=tmp_step;
2667 2677
    pred_block(s, block[0], src, tmp, src_stride, src_x, src_y, b_w, b_h, lt, plane_index, w, h);    
2668 2678

  
2669 2679
    if(same_block(lt, rt)){
2670 2680
        block[1]= block[0];
2671 2681
    }else{
2672
        block[1]= tmp + 4*MB_SIZE;
2682
        block[1]= ptmp;
2683
        ptmp+=tmp_step;
2673 2684
        pred_block(s, block[1], src, tmp, src_stride, src_x, src_y, b_w, b_h, rt, plane_index, w, h);
2674 2685
    }
2675 2686
        
......
2678 2689
    }else if(same_block(rt, lb)){
2679 2690
        block[2]= block[1];
2680 2691
    }else{
2681
        block[2]= tmp+5*MB_SIZE;
2692
        block[2]= ptmp;
2693
        ptmp+=tmp_step;
2682 2694
        pred_block(s, block[2], src, tmp, src_stride, src_x, src_y, b_w, b_h, lb, plane_index, w, h);
2683 2695
    }
2684 2696

  
......
2689 2701
    }else if(same_block(lb, rb)){
2690 2702
        block[3]= block[2];
2691 2703
    }else{
2692
        block[3]= tmp+6*MB_SIZE;
2704
        block[3]= ptmp;
2693 2705
        pred_block(s, block[3], src, tmp, src_stride, src_x, src_y, b_w, b_h, rb, plane_index, w, h);
2694 2706
    }
2695 2707
#if 0

Also available in: Unified diff