On Sun, 4 Jan 2015 17:47:20 +0100 Michael Niedermayer <michae...@gmx.at> wrote:
> > >> +}; > > >> + > > >> + > > >> +typedef struct CCaptionSubContext { > > >> + AVClass *class; > > >> + int parity_table[256]; > > > this can be a static uint8_t table > > > > > I don't think static variable in structure are allowed in c language > > that is cpp thing. > > > > If you meant to remove that table from structure, then too its > > not efficient, we have to make parity table every time decode > > function is called. > > the table is constant and does not change, theres no need to have > a copy of it in each context or to "make it every time decode is > called" > a simple static uint8_t parity_table[256]; > or even > static const uint8_t parity_table[256] = {...} > IMO such global writable state is bad style and should be avoided if possible. Even if it's only 256 bytes in this case. What's wrong with keeping it in the context? _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel