Browse Source

Optimize sign handling in get_symbol().

Originally committed as revision 18672 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/v0.6
Michael Niedermayer 17 years ago
parent
commit
3788e661f1
2 changed files with 4 additions and 8 deletions
  1. +2
    -4
      libavcodec/ffv1.c
  2. +2
    -4
      libavcodec/snow.c

+ 2
- 4
libavcodec/ffv1.c View File

@@ -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
}

if(is_signed && get_rac(c, state+11 + e)) //11..21
return -a;
else
return a;
e= -(is_signed && get_rac(c, state+11 + e)); //11..21
return (a^e)-e;
}
}



+ 2
- 4
libavcodec/snow.c View File

@@ -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
}

if(is_signed && get_rac(c, state+11 + FFMIN(e,10))) //11..21
return -a;
else
return a;
e= -(is_signed && get_rac(c, state+11 + FFMIN(e,10))); //11..21
return (a^e)-e;
}
}



Loading…
Cancel
Save