Mercurial > libavcodec.hg
comparison snow.c @ 9546:54ddf2b7d4bd libavcodec
Optimize sign handling in get_symbol().
author | michael |
---|---|
date | Fri, 24 Apr 2009 00:26:49 +0000 |
parents | 479e4d868038 |
children | f4a60e47193f |
comparison
equal
deleted
inserted
replaced
9545:59073f92f0e2 | 9546:54ddf2b7d4bd |
---|---|
663 a= 1; | 663 a= 1; |
664 for(i=e-1; i>=0; i--){ | 664 for(i=e-1; i>=0; i--){ |
665 a += a + get_rac(c, state+22 + FFMIN(i,9)); //22..31 | 665 a += a + get_rac(c, state+22 + FFMIN(i,9)); //22..31 |
666 } | 666 } |
667 | 667 |
668 if(is_signed && get_rac(c, state+11 + FFMIN(e,10))) //11..21 | 668 e= -(is_signed && get_rac(c, state+11 + FFMIN(e,10))); //11..21 |
669 return -a; | 669 return (a^e)-e; |
670 else | |
671 return a; | |
672 } | 670 } |
673 } | 671 } |
674 | 672 |
675 static inline void put_symbol2(RangeCoder *c, uint8_t *state, int v, int log2){ | 673 static inline void put_symbol2(RangeCoder *c, uint8_t *state, int v, int log2){ |
676 int i; | 674 int i; |