From 04824298a9e2fec292cc2859c6a50a5d5a6d7752 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Thu, 18 Dec 2008 16:11:19 +0000 Subject: [PATCH] Faster CAVLC decoding of trailing_ones. Based on a patch by dark shikari. decode_residual is about 3.3% faster. Originally committed as revision 16219 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/h264.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libavcodec/h264.c b/libavcodec/h264.c index d3a8e56..6f68095 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -4087,9 +4087,11 @@ static int decode_residual(H264Context *h, GetBitContext *gb, DCTELEM *block, in 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