avcodec/golomb: cleanup

Signed-off-by: Zeng Zhaoxiu <zhaoxiu.zeng@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Zeng Zhaoxiu 2015-03-07 23:42:05 +08:00 committed by Michael Niedermayer
parent b1e9634c10
commit 02fc168c93
1 changed files with 3 additions and 10 deletions

View File

@ -215,9 +215,7 @@ static inline int get_se_golomb(GetBitContext *gb)
static inline int get_se_golomb_long(GetBitContext *gb)
{
unsigned int buf = get_ue_golomb_long(gb);
int sign;
sign = (buf & 1) - 1;
int sign = (buf & 1) - 1;
return ((buf >> 1) ^ sign) + 1;
}
@ -259,8 +257,7 @@ static inline int dirac_get_se_golomb(GetBitContext *gb)
uint32_t ret = svq3_get_ue_golomb(gb);
if (ret) {
int sign;
sign = -get_bits1(gb);
int sign = -get_bits1(gb);
ret = (ret ^ sign) - sign;
}
@ -363,11 +360,7 @@ static inline int get_sr_golomb(GetBitContext *gb, int k, int limit,
int esc_len)
{
int v = get_ur_golomb(gb, k, limit, esc_len);
int sign;
v++;
sign = (v & 1) - 1;
return ((v >> 1) ^ sign) - sign;
return (v >> 1) ^ -(v & 1);
}
/**