Revision 7c2425d2

View differences:

libavcodec/snow.c
507 507
    if(get_cabac(c, state+0))
508 508
        return 0;
509 509
    else{
510
        int i, e, a, el;
511
 //FIXME try to merge loops with FFMIN() maybe they are equally fast and they are surly cuter
512
        for(e=0; e<10; e++){ 
513
            if(get_cabac(c, state + 1 + e)==0) // 1..10
514
                break;
515
        }
516
        el= e;
517
 
518
        if(e==10){
519
            while(get_cabac(c, state + 1 + 9)) //10
520
                e++;
510
        int i, e, a;
511
        e= 0;
512
        while(get_cabac(c, state+1 + FFMIN(e,9))){ //1..10
513
            e++;
521 514
        }
515

  
522 516
        a= 1;
523
        for(i=e-1; i>=el; i--){
524
            a += a + get_cabac(c, state+22+9); //31
525
        }
526
        for(; i>=0; i--){
527
            a += a + get_cabac(c, state+22+i); //22..31
517
        for(i=e-1; i>=0; i--){
518
            a += a + get_cabac(c, state+22 + FFMIN(i,9)); //22..31
528 519
        }
529 520

  
530
        if(is_signed && get_cabac(c, state+11 + el)) //11..21
521
        if(is_signed && get_cabac(c, state+11 + FFMIN(e,10))) //11..21
531 522
            return -a;
532 523
        else
533 524
            return a;

Also available in: Unified diff