[FFmpeg-devel] [PATCH] h264 CAVLC coeff_token decoder based on CLZ

Michael Niedermayer michaelni
Tue Jan 26 09:38:44 CET 2010


On Mon, Jan 25, 2010 at 11:28:55PM -0800, Pascal Massimino wrote:
> On Sat, Jan 23, 2010 at 4:15 PM, Jason Garrett-Glaser <darkshikari at gmail.com
> > wrote:
> 
> > On Sat, Jan 23, 2010 at 11:03 AM, Pascal Massimino
> > <pascal.massimino at gmail.com> wrote:
> > > On Sat, Jan 23, 2010 at 10:18 AM, Michael Niedermayer <michaelni at gmx.at
> > >wrote:
> > >
> > >> On Sat, Jan 23, 2010 at 03:28:53AM +0300, Anatoliy Nenashev wrote:
> > >> > Hi all!
> > >> > I have made some investigations in H264 CAVLC coeff_token decoder.
> > >> > In attached patch you can see special implementation of VLC decoder
> > for
> > >> > coeff_token which is based on CLZ (count leading zeros).
> > >> > This method reduce size of VLC decoding tables for coeff_token from
> > >> > (520+332+280+256)*2 = 2776 byte to (2*4*16 + 64 + 67 + 63 + 63) = 385
> > >> byte.
> > >>
> > >
> > > FWIW: these table are not called that often,
> >
> > ~8-24 times per MB isn't that often?
> >
> > > and the code you search for is
> > > often at the beginning of the table if you sort it by increasing code
> > > length.
> > > My point, FWIW: try a simple linear search on the sorted table.
> >
> > Ugh, that seems nasty.  In my experience coeff_token is not so
> > lopsidedly distributed that this would work very well...
> >
> 
> c'mon it's doesn't look as bad as you seem to imply. At worst, same speed,
> i'd say
> (but smaller code/data).

hmm, thats not bad :)
maybe mans wants to benchmark this on arm, the smaller size might help there?
otherwise iam not against this being commited if the same speed is confirmed
with some high bitrate sample and on x86_32
or if its faster anywhere ...

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Democracy is the form of government in which you can choose your dictator
-------------- 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/20100126/44650257/attachment.pgp>



More information about the ffmpeg-devel mailing list