Commit 02fc168c authored by Zeng Zhaoxiu's avatar Zeng Zhaoxiu Committed by Michael Niedermayer

avcodec/golomb: cleanup

Signed-off-by: 's avatarZeng Zhaoxiu <zhaoxiu.zeng@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent b1e9634c
......@@ -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);
}
/**
......
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