[FFmpeg-devel] [PATCH] Optionally hardcode PCM tables

Rich Felker dalias
Sat Jan 12 02:13:04 CET 2008

On Fri, Jan 11, 2008 at 11:00:04PM +0100, Michael Niedermayer wrote:
> On Fri, Jan 11, 2008 at 08:42:25PM +0100, Diego 'Flameeyes' Petten? wrote:
> > Vitor Sessak <vitor1001 at gmail.com> writes:
> > 
> > > I've found a cosmetical change:
> > 
> > Was due to a missing de-tabify in previous patch, should be fixed now.
> btw, what about changing the algorithm so it doesnt need 16k tables?
> maybe something along the lines of
> e= av_log2_16bit(v) - 1234;
> (v>>e) | (e<<123)
> or
> if(v<123) v= tab1[v];
> else      v= tab2[v>>4];

v = ((v-123)>>31 & tab1[v]) | ((122-v)>>31 & tab2[v>>4]);

And I agree that using a 16k table in a decoder is a very bad idea as
it will clobber the cache and will likely slow down video decoding
significantly even if it doesn't hurt audio-only playback... Of course
the extent of the damage depends on the access patterns about which I
have no idea, so more info would be useful in determining what to do.


More information about the ffmpeg-devel mailing list