avcodec/put_bits: Add and use put_bits63()

When using a 64bit PutBitContext (i.e. on x64), put_bits_no_assert()
can naturally write up to 63 bits. So one can avoid treating the
cases <32bits, 32 bits and <63 bits differently.

As it turns out, no user actually wants to write 64 bit at once
(maybe except testprograms).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2025-03-08 17:35:32 +01:00
parent 512e597932
commit ede2b391cc
6 changed files with 30 additions and 15 deletions
+1 -1
View File
@@ -59,7 +59,7 @@ static int update_extradata(IAMFCodecConfig *codec_config)
return ret;
put_bits32(&pb, get_bits_long(&gb, 32)); // min/max blocksize
put_bits64(&pb, 48, get_bits64(&gb, 48)); // min/max framesize
put_bits63(&pb, 48, get_bits64(&gb, 48)); // min/max framesize
put_bits(&pb, 20, get_bits(&gb, 20)); // samplerate
skip_bits(&gb, 3);
put_bits(&pb, 3, 1); // set channels to stereo