summaryrefslogtreecommitdiff
path: root/libavcodec/snow.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2005-04-14 18:33:26 +0000
committerMichael Niedermayer <michaelni@gmx.at>2005-04-14 18:33:26 +0000
commit3c096ac7911fd51ea4bc602277f82ea222bfec6b (patch)
treefbeb0abf43d15f8b4ae6e8019643cedd89c4c9e2 /libavcodec/snow.c
parent86e59cc01df043e415b5e56cf4c31832133fbc8f (diff)
optimizing unpack_coeffs()
Originally committed as revision 4127 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/snow.c')
-rw-r--r--libavcodec/snow.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/libavcodec/snow.c b/libavcodec/snow.c
index ee77f1c252..c8d4d5c4ea 100644
--- a/libavcodec/snow.c
+++ b/libavcodec/snow.c
@@ -1817,10 +1817,21 @@ static inline void unpack_coeffs(SnowContext *s, SubBand *b, SubBand * parent, i
int context= av_log2(/*ABS(ll) + */3*(l>>1) + (lt>>1) + (t&~1) + (rt>>1) + (p>>1));
v=get_rac(&s->c, &b->state[0][context]);
+ if(v){
+ v= 2*(get_symbol2(&s->c, b->state[context + 2], context-4) + 1);
+ v+=get_rac(&s->c, &b->state[0][16 + 1 + 3 + quant3bA[l&0xFF] + 3*quant3bA[t&0xFF]]);
+
+ b->x_coeff[index].x=x;
+ b->x_coeff[index++].coeff= v;
+ }
}else{
if(!run){
run= get_symbol2(&s->c, b->state[1], 3);
- v=1;
+ v= 2*(get_symbol2(&s->c, b->state[0 + 2], 0-4) + 1);
+ v+=get_rac(&s->c, &b->state[0][16 + 1 + 3]);
+
+ b->x_coeff[index].x=x;
+ b->x_coeff[index++].coeff= v;
}else{
run--;
v=0;
@@ -1835,14 +1846,6 @@ static inline void unpack_coeffs(SnowContext *s, SubBand *b, SubBand * parent, i
}
}
}
- if(v){
- int context= av_log2(/*ABS(ll) + */3*(l>>1) + (lt>>1) + (t&~1) + (rt>>1) + (p>>1));
- v= 2*(get_symbol2(&s->c, b->state[context + 2], context-4) + 1);
- v+=get_rac(&s->c, &b->state[0][16 + 1 + 3 + quant3bA[l&0xFF] + 3*quant3bA[t&0xFF]]);
-
- b->x_coeff[index].x=x;
- b->x_coeff[index++].coeff= v;
- }
}
b->x_coeff[index++].x= w+1; //end marker
prev_index= prev2_index;