Re: [FFmpeg-devel] [PATCH 2/4] lavc: add standalone cached bitstream reader

2022-06-30 Thread Anton Khirnov
Quoting Andreas Rheinhardt (2022-06-23 20:56:00) > Anton Khirnov: > > + */ > > +static inline uint32_t bitstream_read(BitstreamContext *bc, unsigned int n) > > +{ > > +if (!n) > > +return 0; > > This makes this function a get_bitsz equivalent. Why is there no > get_bits() equivalent fo

Re: [FFmpeg-devel] [PATCH 2/4] lavc: add standalone cached bitstream reader

2022-06-30 Thread Anton Khirnov
Quoting Andreas Rheinhardt (2022-06-24 14:30:58) > Anton Khirnov: > > From: Alexandra Hájková > > > > The cached bitstream reader was originally written by Alexandra Hájková > > for Libav, with significant input from Kostya Shishkov and Luca Barbato. > > It was then committed to FFmpeg in ca079b0

Re: [FFmpeg-devel] [PATCH 2/4] lavc: add standalone cached bitstream reader

2022-06-24 Thread Andreas Rheinhardt
Anton Khirnov: > From: Alexandra Hájková > > The cached bitstream reader was originally written by Alexandra Hájková > for Libav, with significant input from Kostya Shishkov and Luca Barbato. > It was then committed to FFmpeg in ca079b09549, by merging it with the > implementation of the current

Re: [FFmpeg-devel] [PATCH 2/4] lavc: add standalone cached bitstream reader

2022-06-24 Thread Andreas Rheinhardt
Andreas Rheinhardt: > Anton Khirnov: >> +/* Unwind the cache so a refill_32 can fill it again. */ >> +static inline void bitstream_unwind(BitstreamContext *bc) >> +{ >> +int unwind = 4; >> +int unwind_bits = unwind * 8; > > I'm surprised that you used signed types here. > >> + >> +if

Re: [FFmpeg-devel] [PATCH 2/4] lavc: add standalone cached bitstream reader

2022-06-24 Thread Andreas Rheinhardt
Anton Khirnov: > +/** > + * Return n bits from the buffer, n has to be in the 0-32 range. > + */ > +static inline uint32_t bitstream_read(BitstreamContext *bc, unsigned int n) > +{ > +if (!n) > +return 0; > + > +if (n > bc->bits_left) { > +refill_32(bc); > +if (bc->

Re: [FFmpeg-devel] [PATCH 2/4] lavc: add standalone cached bitstream reader

2022-06-23 Thread Andreas Rheinhardt
Anton Khirnov: > From: Alexandra Hájková > > The cached bitstream reader was originally written by Alexandra Hájková > for Libav, with significant input from Kostya Shishkov and Luca Barbato. > It was then committed to FFmpeg in ca079b09549, by merging it with the > implementation of the current

[FFmpeg-devel] [PATCH 2/4] lavc: add standalone cached bitstream reader

2022-06-23 Thread Anton Khirnov
From: Alexandra Hájková The cached bitstream reader was originally written by Alexandra Hájková for Libav, with significant input from Kostya Shishkov and Luca Barbato. It was then committed to FFmpeg in ca079b09549, by merging it with the implementation of the current bitstream reader. This mer