Commit e61abe2d authored by Jun Zhao's avatar Jun Zhao Committed by Michael Niedermayer

lavc/golobm: Add set_ue_golomb_long to support up to 2^32 -2.

add set_ue_golomb_long to support up to 2^32-2.
Reviewed-by: 's avatarMark Thompson <sw@jkqxz.net>
Reviewed-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
Signed-off-by: 's avatarJun Zhao <jun.zhao@intel.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 2b7d9a1f
......@@ -473,6 +473,21 @@ static inline void set_ue_golomb(PutBitContext *pb, int i)
}
}
/**
* write unsigned exp golomb code. 2^32-2 at most.
*/
static inline void set_ue_golomb_long(PutBitContext *pb, uint32_t i)
{
av_assert2(i <= (UINT32_MAX - 1));
if (i < 256)
put_bits(pb, ff_ue_golomb_len[i], i + 1);
else {
int e = av_log2(i + 1);
put_bits64(pb, 2 * e + 1, i + 1);
}
}
/**
* write truncated unsigned exp golomb code.
*/
......
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