diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2021-03-25 12:52:56 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-03-30 12:36:32 +0200 |
commit | c81b8e04aa0952a7aec1e08940f29ae501fb6bfd (patch) | |
tree | 34c1d0dd6c2262ef83efa3ae77ea704580144050 /libavcodec/magicyuvenc.c | |
parent | 73fb1b8a9bd6a563a6b58ce8aa215f2f07e91f57 (diff) | |
download | ffmpeg-c81b8e04aa0952a7aec1e08940f29ae501fb6bfd.tar.gz |
Avoid intermediate bitcount for number of bytes in PutBitContext
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/magicyuvenc.c')
-rw-r--r-- | libavcodec/magicyuvenc.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/libavcodec/magicyuvenc.c b/libavcodec/magicyuvenc.c index d53fe6f328..7ec3c963bf 100644 --- a/libavcodec/magicyuvenc.c +++ b/libavcodec/magicyuvenc.c @@ -400,11 +400,9 @@ static int encode_slice(uint8_t *src, uint8_t *dst, int dst_size, if (count) put_bits(&pb, 32 - count, 0); - count = put_bits_count(&pb); - flush_put_bits(&pb); - return count >> 3; + return put_bytes_output(&pb); } static int magy_encode_frame(AVCodecContext *avctx, AVPacket *pkt, @@ -499,7 +497,7 @@ static int magy_encode_frame(AVCodecContext *avctx, AVPacket *pkt, AV_CEIL_RSHIFT(frame->height, s->vshift[i]), &s->pb, s->he[i]); } - s->tables_size = (put_bits_count(&s->pb) + 7) >> 3; + s->tables_size = put_bytes_count(&s->pb, 1); bytestream2_skip_p(&pb, s->tables_size); for (i = 0; i < s->planes; i++) { |