On Mon, 9 May 2016 15:29:55 +0200 Luca Barbato <[email protected]> wrote:
> On 09/05/16 15:23, Derek Buitenhuis wrote: > > On 5/9/2016 2:21 PM, Luca Barbato wrote: > >> compared to > >> > >> bitstream_read(bc, 32); > >> > >> and > >> > >> bitstream_read_32(bc, 32); > >> > >> Only the latter helps you a little more. > >> > >> At least bitstream.h is fully documented so it does not require you to > >> use the preprocessor to see what is going on =) > > > > It really is a shame more compilers don't have __builtin_constant_p type > > things... > > > > It would solve this whole issue. > > Only for constant arguments though =/ Maybe I'm missing something, but for constant arguments (which are the majority, right?), a simple "(arg > 32 ? long_version : short_version)" would do the trick, as constant folding would kill the dead code. Callers which really need variable bit counts with maximum efficiency could call specialized functions. But maybe I'm missing something. _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
