comparison snow.c @ 2191:44afbcec70b8 libavcodec

50% faster decode_subband()
author michael
date Fri, 27 Aug 2004 01:06:58 +0000
parents 70b27300a496
children 77167ed8453f
comparison
equal deleted inserted replaced
2190:303e09116fe7 2191:44afbcec70b8
2031 run= get_symbol2(&s->c, b->state[1], 3); 2031 run= get_symbol2(&s->c, b->state[1], 3);
2032 //FIXME optimize this here 2032 //FIXME optimize this here
2033 //FIXME try to store a more naive run 2033 //FIXME try to store a more naive run
2034 v=1; 2034 v=1;
2035 }else{ 2035 }else{
2036 int py= y>>1;
2036 run--; 2037 run--;
2037 v=0; 2038 v=0;
2039
2040 if(y && parent && py < b->parent->height){
2041 while(run && x+2<w && !src[x + 2 + (y-1)*stride] && !parent[((x+1)>>1) + py*2*stride]){
2042 x++;
2043 run--;
2044 }
2045 }
2038 } 2046 }
2039 } 2047 }
2040 if(v){ 2048 if(v){
2041 int context= av_log2(/*ABS(ll) + */3*ABS(l) + ABS(lt) + 2*ABS(t) + ABS(rt) + ABS(p)); 2049 int context= av_log2(/*ABS(ll) + */3*ABS(l) + ABS(lt) + 2*ABS(t) + ABS(rt) + ABS(p));
2042 v= get_symbol2(&s->c, b->state[context + 2], context-4) + 1; 2050 v= get_symbol2(&s->c, b->state[context + 2], context-4) + 1;
2044 v= -v; 2052 v= -v;
2045 src[x + y*stride]= v; 2053 src[x + y*stride]= v;
2046 } 2054 }
2047 } 2055 }
2048 } 2056 }
2049 if(level+1 == s->spatial_decomposition_count){ 2057 if(w > 200 /*level+1 == s->spatial_decomposition_count*/){
2050 STOP_TIMER("decode_subband") 2058 STOP_TIMER("decode_subband")
2051 } 2059 }
2052 2060
2053 return; 2061 return;
2054 } 2062 }