|
|
@ -507,27 +507,18 @@ static inline int get_symbol(CABACContext *c, uint8_t *state, int is_signed){ |
|
|
|
if(get_cabac(c, state+0)) |
|
|
|
if(get_cabac(c, state+0)) |
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
else{ |
|
|
|
else{ |
|
|
|
int i, e, a, el; |
|
|
|
int i, e, a; |
|
|
|
//FIXME try to merge loops with FFMIN() maybe they are equally fast and they are surly cuter
|
|
|
|
e= 0; |
|
|
|
for(e=0; e<10; e++){
|
|
|
|
while(get_cabac(c, state+1 + FFMIN(e,9))){ //1..10
|
|
|
|
if(get_cabac(c, state + 1 + e)==0) // 1..10
|
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
el= e; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(e==10){ |
|
|
|
|
|
|
|
while(get_cabac(c, state + 1 + 9)) //10
|
|
|
|
|
|
|
|
e++; |
|
|
|
e++; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
a= 1; |
|
|
|
a= 1; |
|
|
|
for(i=e-1; i>=el; i--){ |
|
|
|
for(i=e-1; i>=0; i--){ |
|
|
|
a += a + get_cabac(c, state+22+9); //31
|
|
|
|
a += a + get_cabac(c, state+22 + FFMIN(i,9)); //22..31
|
|
|
|
} |
|
|
|
|
|
|
|
for(; i>=0; i--){ |
|
|
|
|
|
|
|
a += a + get_cabac(c, state+22+i); //22..31
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(is_signed && get_cabac(c, state+11 + el)) //11..21
|
|
|
|
if(is_signed && get_cabac(c, state+11 + FFMIN(e,10))) //11..21
|
|
|
|
return -a; |
|
|
|
return -a; |
|
|
|
else |
|
|
|
else |
|
|
|
return a; |
|
|
|
return a; |
|
|
|