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 for the cases where it is known that n is not
> zero, but where it is impossible for the compiler to know?
I did not write this code, but I suppose because there were many bugs in
the past where get_bits(0) was called and the advantage did not seem
worth the risk.
If you think such a function would be useful, I'd prefer it to be a
non-default variant, e.g. bits_read_nz.
--
Anton Khirnov
_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".