# HG changeset patch # User michael # Date 1229616679 0 # Node ID 102b197185d1c46076fe0d9b4ec25abfeeac0df0 # Parent af35581ac2ca15c5d0ec50d136582b40481b5935 Faster CAVLC decoding of trailing_ones. Based on a patch by dark shikari. decode_residual is about 3.3% faster. diff -r af35581ac2ca -r 102b197185d1 h264.c --- a/h264.c Thu Dec 18 15:51:32 2008 +0000 +++ b/h264.c Thu Dec 18 16:11:19 2008 +0000 @@ -4087,9 +4087,11 @@ tprintf(h->s.avctx, "trailing:%d, total:%d\n", trailing_ones, total_coeff); assert(total_coeff<=16); - for(i=0; i>1); + level[1] = 1-((i&2) ); + level[2] = 1-((i&1)<<1); if(trailing_ones