Mercurial > libavcodec.hg
diff ppc/dsputil_altivec.h @ 5119:ad0c45e0008c libavcodec
Altivec version of h264_(h|v)_loop_filter_luma
patch by Graham Booker % perian A cod3r P com% with some minor fixes by me.
historic of the patch: http://trac.perian.org/ticket/113
Original thread:
Date: May 11, 2007 9:45 PM
Subject: [FFmpeg-devel] [PATCH] Altivec version of-altivec h264_h-v_loop_filter_luma
author | gpoirier |
---|---|
date | Sat, 09 Jun 2007 19:13:34 +0000 |
parents | fec25fd9febf |
children | 35cc7c922a76 |
line wrap: on
line diff
--- a/ppc/dsputil_altivec.h Sat Jun 09 17:52:16 2007 +0000 +++ b/ppc/dsputil_altivec.h Sat Jun 09 19:13:34 2007 +0000 @@ -101,6 +101,17 @@ h = vec_mergel (D2, H2); \ } while (0) + +/** \brief loads unaligned vector \a *src with offset \a offset + and returns it */ +static inline vector unsigned char unaligned_load(int offset, uint8_t *src) +{ + register vector unsigned char first = vec_ld(offset, src); + register vector unsigned char second = vec_ld(offset+15, src); + register vector unsigned char mask = vec_lvsl(offset, src); + return vec_perm(first, second, mask); +} + #endif /* HAVE_ALTIVEC */ #endif /* _DSPUTIL_ALTIVEC_ */