ffmpeg | branch: master | Jun Zhao <[email protected]> | Wed Jun 14 10:35:20 2017 +0800| [e61abe2d73297e0b6dc1e179b717afc00c32af98] | committer: 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: Mark Thompson <[email protected]> Reviewed-by: Michael Niedermayer <[email protected]> Signed-off-by: Jun Zhao <[email protected]> Signed-off-by: Michael Niedermayer <[email protected]> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e61abe2d73297e0b6dc1e179b717afc00c32af98 --- libavcodec/golomb.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/libavcodec/golomb.h b/libavcodec/golomb.h index 1e834f9327..efb1eff8aa 100644 --- a/libavcodec/golomb.h +++ b/libavcodec/golomb.h @@ -474,6 +474,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. */ static inline void set_te_golomb(PutBitContext *pb, int i, int range) _______________________________________________ ffmpeg-cvslog mailing list [email protected] http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
