[Ffmpeg-devel] [PATCH] H264 cabac vlc reading code

Uoti Urpala uoti.urpala
Mon Oct 16 00:33:31 CEST 2006


On Mon, 2006-10-16 at 00:14 +0300, Uoti Urpala wrote:
> This sped up timing for decode_cabac_residual from about 4650 dezicycles
> to 4550. C version with asm disabled sped up more significantly, to
> 4710. This asm also compiles without -fomit-frame-pointer; disabling asm
> in the general get_cabac version doesn't seem to hurt performance much
> (in fact it gave better overall performance in my test) and allows
> compiling the whole file without -fomit-frame-pointer.
> 
> I'll post a patch for that later once I clean up the code a bit and
> include the latest committed cabac.h change.

Here's the patch. At the moment it never uses asm code outside
decode_cabac_residual at all; that could be changed.

With the latest cabac commit included the patch did not increase cabac
speed noticeably in my test; however I think this is just a random bad
case from gcc since the commit increased the speed without this patch
but not with it, making them equal (and I think there's no reason why
the commit would not on average speed things up with this patch too).

What's more remarkable is that in my test with the latest version GCC
generated equally fast CABAC code from pure C with this patch.

I tried testing overall performance but got a silly result: with the
patch C and asm gave equally fast START/STOP_TIMER timing for
decode_cabac_residual. However the C version had 2.5% better overall
performance even though that function which was equally fast when
separately benchmarked is the only one which changes depending on asm
being enabled or not...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CABACContext_on_stack.diff
Type: text/x-patch
Size: 12186 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20061016/58c290af/attachment.bin>



More information about the ffmpeg-devel mailing list