[vlc-devel] [RFC] [PATCH 1/1] Add orientation to video format
fenrir at elivagar.org
Sat Mar 17 20:21:53 CET 2012
On Sat, Mar 17, 2012 at 09:15:46PM +0200, Rémi Denis-Courmont wrote:
> Le samedi 17 mars 2012 20:59:38 Laurent Aimar, vous avez écrit :
> > I honestly don't think the 3 bits optimisation is needed in the video
> > format_t structure (it is not allocated a lot). But if you think
> > otherwise, I don't mind.
> With a bit field, the compiler will have to insert extra bit operations on
> loads and stores.
I really think that access for this field won't be speed critical, nor will
they visibly impact the code size.
> With a char, the compiler will not know that the value is bound to 0-7 for the
> purpose of optimizations (e.g. jump tables).
> With an enum, the compiler will use an extra 32-bits.
ok, better than an int, but that's it.
> None of the three options are perfect. I don't really care.
Well, the bitfield or the enum seems fine to me. I would probably
use an enum as this way the content of the variable is automatically
know, but I don't care much.
More information about the vlc-devel