1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

avcodec/e?ac3enc: Inform compiler about PutBitContext being blank

This turned out to be very beneficial: For GCC 13, the codesize
of ac3_output_frame_header went down from 4522B to 1247B and
from 10762B to 9298B for eac3_output_frame_header. For Clang 17,
the numbers went down from 3923B to 2477B and from 8338B to 6548B
(always with -O3).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2024-05-24 16:43:31 +02:00
parent 4484e9b373
commit 2df9c8da72
2 changed files with 4 additions and 0 deletions

View File

@ -1638,6 +1638,8 @@ static void ac3_output_frame_header(AC3EncodeContext *s, PutBitContext *pb)
{ {
AC3EncOptions *opt = &s->options; AC3EncOptions *opt = &s->options;
put_bits_assume_flushed(pb);
put_bits(pb, 16, 0x0b77); /* frame header */ put_bits(pb, 16, 0x0b77); /* frame header */
put_bits(pb, 16, 0); /* crc1: will be filled later */ put_bits(pb, 16, 0); /* crc1: will be filled later */
put_bits(pb, 2, s->bit_alloc.sr_code); put_bits(pb, 2, s->bit_alloc.sr_code);

View File

@ -135,6 +135,8 @@ static void eac3_output_frame_header(AC3EncodeContext *s, PutBitContext *pb)
int blk, ch; int blk, ch;
AC3EncOptions *opt = &s->options; AC3EncOptions *opt = &s->options;
put_bits_assume_flushed(pb);
put_bits(pb, 16, 0x0b77); /* sync word */ put_bits(pb, 16, 0x0b77); /* sync word */
/* BSI header */ /* BSI header */