[FFmpeg-devel] Pipeline: H.264 speed improvements

Michael Niedermayer michaelni
Tue Dec 23 12:59:06 CET 2008

On Tue, Dec 23, 2008 at 04:08:26AM -0500, Jason Garrett-Glaser wrote:
> I've put together a list of all the possible speed improvements I can
> see, including both some obvious ones and non-obvious ones.  If you're
> interested in implementing anything here, say so to make sure your
> work isn't duplicated by Michael or I.  Also feel free to discuss some
> of the more nutty ideas, like the VLC table, or tell me that I'm wrong
> about something.
> Non-assembly stuff:

> Write a large unified VLC table for CAVLC level decoding, much like
> x264 recently implemented for encoding (you don't need to create a
> full table--it isn't worth the memory cost--but a small table is
> enough).  This would probably work like this:
> 1.  show_bits X bits, where X is log2(VLC table size).
> 2.  If (prefix length + suffix length) > X, do an escaped read.  Since
> the entire point of this is to avoid calculating the prefix length,
> the best way to do this is to have the prefix length stored *along
> with* the value of the levelcode in the VLC table, or even better,
> simply store a coeff of "0" in the table in the case that an escape is
> needed, since a coeff of zero cannot possibly actually exist in the
> table for us to confuse it with.
> 3.  Skip_bits the actual number of bits in the code, or don't skip any
> bits if the escape has to be called.
> 4.  So we can do coeff = VLCtable[suffix_length][inputvalue].coeff;
> if(!coeff) {escape table;} else
> skip_bits(VLCtable[suffix_length][inputvalue].bits).  Coeff can
> probably be an 8-bit signed value as long as X <= 8, making this a
> really compact table (16 bits per entry).

thats a nice description of a subset of what get_vlc2/GET_VLC can do

i suggest:
coeff= get_vlc2();
    do escape with prefix= -coeff

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Frequently ignored awnser#1 FFmpeg bugs should be sent to our bugtracker. User
questions about the command line tools should be sent to the ffmpeg-user ML.
And questions about how to use libav* should be sent to the libav-user ML.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20081223/4bcf1466/attachment.pgp>

More information about the ffmpeg-devel mailing list