[Ffmpeg-devel] [PATCH] h264 - simplify cabac/luma cbp

Alexander Strange astrange
Wed Feb 28 15:46:00 CET 2007


I noticed that decode_cabac_mb_cbp_luma() had a lot of mispredicted  
branches, so I simplified the logic some.

This also gets rid of lookup tables, which can be very slow on modern  
CPUs.

Original time: 24.855s +/- .0105

New time: 24.699s +/- .0254

This is from running mplayer -benchmark -endpos 00:30 five times on  
each and discarding the highest value.

I tried using the START_TIMER("decode_mb_cabac") instead of mplayer  
timing; not only does it make both the original and patched mplayer  
much slower (~26.3s), the new one reports higher times than the old  
one :(

I think I'll see if I can shrink any of these other huge functions,  
plus the data structures (H264Context is nearly 200KB, which causes  
huge constant offsets in memory addressing, and some of its elements  
might not be close together in cache).


-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg-cbpluma-speed.diff
Type: application/octet-stream
Size: 1912 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070228/16fa871c/attachment.obj>



More information about the ffmpeg-devel mailing list