mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
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: Mark Thompson <sw@jkqxz.net> Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Jun Zhao <jun.zhao@intel.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
2b7d9a1f3f
commit
e61abe2d73
@ -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.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user