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/flacenc.c | |
parent | 73fb1b8a9bd6a563a6b58ce8aa215f2f07e91f57 (diff) |
Avoid intermediate bitcount for number of bytes in PutBitContext
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/flacenc.c')
-rw-r--r-- | libavcodec/flacenc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c index 8e7dbc52b4..34fcd95795 100644 --- a/libavcodec/flacenc.c +++ b/libavcodec/flacenc.c @@ -1234,7 +1234,7 @@ static void write_frame_header(FlacEncodeContext *s) flush_put_bits(&s->pb); crc = av_crc(av_crc_get_table(AV_CRC_8_ATM), 0, s->pb.buf, - put_bits_count(&s->pb) >> 3); + put_bytes_output(&s->pb)); put_bits(&s->pb, 8, crc); } @@ -1304,7 +1304,7 @@ static void write_frame_footer(FlacEncodeContext *s) int crc; flush_put_bits(&s->pb); crc = av_bswap16(av_crc(av_crc_get_table(AV_CRC_16_ANSI), 0, s->pb.buf, - put_bits_count(&s->pb)>>3)); + put_bytes_output(&s->pb))); put_bits(&s->pb, 16, crc); flush_put_bits(&s->pb); } @@ -1316,7 +1316,7 @@ static int write_frame(FlacEncodeContext *s, AVPacket *avpkt) write_frame_header(s); write_subframes(s); write_frame_footer(s); - return put_bits_count(&s->pb) >> 3; + return put_bytes_output(&s->pb); } |