summaryrefslogtreecommitdiff
path: root/libavcodec/xsubenc.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2021-03-25 12:52:56 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-03-30 12:36:32 +0200
commitc81b8e04aa0952a7aec1e08940f29ae501fb6bfd (patch)
tree34c1d0dd6c2262ef83efa3ae77ea704580144050 /libavcodec/xsubenc.c
parent73fb1b8a9bd6a563a6b58ce8aa215f2f07e91f57 (diff)
Avoid intermediate bitcount for number of bytes in PutBitContext
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/xsubenc.c')
-rw-r--r--libavcodec/xsubenc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/xsubenc.c b/libavcodec/xsubenc.c
index 36c5ab7223..9139159c98 100644
--- a/libavcodec/xsubenc.c
+++ b/libavcodec/xsubenc.c
@@ -197,7 +197,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
h->rects[0]->linesize[0] * 2,
h->rects[0]->w, (h->rects[0]->h + 1) >> 1))
return AVERROR_BUFFER_TOO_SMALL;
- bytestream_put_le16(&rlelenptr, put_bits_count(&pb) >> 3); // Length of first field
+ bytestream_put_le16(&rlelenptr, put_bytes_count(&pb, 0)); // Length of first field
if (xsub_encode_rle(&pb, h->rects[0]->data[0] + h->rects[0]->linesize[0],
h->rects[0]->linesize[0] * 2,
@@ -211,7 +211,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
flush_put_bits(&pb);
- return hdr - buf + put_bits_count(&pb)/8;
+ return hdr - buf + put_bytes_output(&pb);
}
static av_cold int xsub_encoder_init(AVCodecContext *avctx)