Commit f4b6bf8a authored by michael's avatar michael

Optimize sign handling in get_symbol().


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@18672 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 8b3661e2
...@@ -258,10 +258,8 @@ static inline int get_symbol(RangeCoder *c, uint8_t *state, int is_signed){ ...@@ -258,10 +258,8 @@ static inline int get_symbol(RangeCoder *c, uint8_t *state, int is_signed){
a += a + get_rac(c, state+22 + i); //22..31 a += a + get_rac(c, state+22 + i); //22..31
} }
if(is_signed && get_rac(c, state+11 + e)) //11..21 e= -(is_signed && get_rac(c, state+11 + e)); //11..21
return -a; return (a^e)-e;
else
return a;
} }
} }
......
...@@ -665,10 +665,8 @@ static inline int get_symbol(RangeCoder *c, uint8_t *state, int is_signed){ ...@@ -665,10 +665,8 @@ static inline int get_symbol(RangeCoder *c, uint8_t *state, int is_signed){
a += a + get_rac(c, state+22 + FFMIN(i,9)); //22..31 a += a + get_rac(c, state+22 + FFMIN(i,9)); //22..31
} }
if(is_signed && get_rac(c, state+11 + FFMIN(e,10))) //11..21 e= -(is_signed && get_rac(c, state+11 + FFMIN(e,10))); //11..21
return -a; return (a^e)-e;
else
return a;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment