summaryrefslogtreecommitdiff
path: root/libavcodec/mlpenc.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/mlpenc.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/mlpenc.c')
-rw-r--r--libavcodec/mlpenc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/mlpenc.c b/libavcodec/mlpenc.c
index 40db76f350..8684056cab 100644
--- a/libavcodec/mlpenc.c
+++ b/libavcodec/mlpenc.c
@@ -1121,18 +1121,18 @@ static uint8_t *write_substrs(MLPEncodeContext *ctx, uint8_t *buf, int buf_size,
* notice that we already are word-aligned here. */
flush_put_bits(&pb);
- parity = ff_mlp_calculate_parity(buf, put_bits_count(&pb) >> 3) ^ 0xa9;
- checksum = ff_mlp_checksum8 (buf, put_bits_count(&pb) >> 3);
+ parity = ff_mlp_calculate_parity(buf, put_bytes_output(&pb)) ^ 0xa9;
+ checksum = ff_mlp_checksum8 (buf, put_bytes_output(&pb));
put_bits(&pb, 8, parity );
put_bits(&pb, 8, checksum);
flush_put_bits(&pb);
- end += put_bits_count(&pb) >> 3;
+ end += put_bytes_output(&pb);
substream_data_len[substr] = end;
- buf += put_bits_count(&pb) >> 3;
+ buf += put_bytes_output(&pb);
}
ctx->major_cur_subblock_index += ctx->major_filter_state_subblock + 1;