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

View File

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