[FFmpeg-devel] [PATCH 4/4] h264: new assembly version of get_cabac for x86_64 with PIC

Michael Niedermayer michaelni at gmx.at
Sat Apr 28 20:09:18 CEST 2012


On Fri, Apr 27, 2012 at 10:12:20PM +0200, Roland Scheidegger wrote:
> This adds a hand-optimized assembly version for get_cabac much like the
> existing one, but it works if the table offsets are RIP-relative.
> Compared to the non-RIP-relative version this adds 2 lea instructions
> and it needs one extra register.
> There is a surprisingly large performance improvement over the c version (more
> so than the generated assembly seems to suggest) just in get_cabac, I measured
> roughly 40% faster for get_cabac on a K8. However, overall the difference is
> not that big, I measured roughly 5% on a test clip on a K8 and a Core2.
> Hopefully it still compiles on x86 32bit...
> Now that only one table is used, there's some chance even darwin as compiles
> this (apparently the label arithmetic used previously doesn't work if it
> involves symbols defined in a different file, thanks to Ronald S. Bultje for
> helping me with this).
> ---
>  libavcodec/h264_cabac.c    |    2 +-
>  libavcodec/x86/cabac.h     |   88 ++++++++++++++++++++++++++++++++++++++++----
>  libavcodec/x86/h264_i386.h |   53 ++++++++++++++++++--------
>  3 files changed, 118 insertions(+), 25 deletions(-)

fixed small bug

applied

thanks, alot, teh speedup is very nice

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

Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120428/863c68f1/attachment.asc>


More information about the ffmpeg-devel mailing list