diff options
author | Guillaume Poirier <gpoirier@mplayerhq.hu> | 2007-06-17 09:14:02 +0000 |
---|---|---|
committer | Guillaume Poirier <gpoirier@mplayerhq.hu> | 2007-06-17 09:14:02 +0000 |
commit | 963eca226e395601f89ee6fd1621e529c9d965f0 (patch) | |
tree | 4b7caf1c3689b90579d3b0fbf0707d9b84ce8eb8 /libavcodec/ppc/h264_altivec.c | |
parent | ef4c82cb5110152321ea6a4a77a109258c0def0f (diff) | |
download | ffmpeg-963eca226e395601f89ee6fd1621e529c9d965f0.tar.gz |
convert h264_deblock_q1 to an inline function.
part 1/2 of fixing Altivec-accelerated H264 luma inloop filter
Originally committed as revision 9348 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/ppc/h264_altivec.c')
-rw-r--r-- | libavcodec/ppc/h264_altivec.c | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/libavcodec/ppc/h264_altivec.c b/libavcodec/ppc/h264_altivec.c index 9eccf2873d..4fc5538d70 100644 --- a/libavcodec/ppc/h264_altivec.c +++ b/libavcodec/ppc/h264_altivec.c @@ -741,24 +741,28 @@ static inline vector unsigned char h264_deblock_mask ( register vector unsigned } // out: p1 = clip((p2 + ((p0 + q0 + 1) >> 1)) >> 1, p1-tc0, p1+tc0) -#define h264_deblock_q1(p0, p1, p2, q0, tc0) { \ - \ - register vector unsigned char average = vec_avg(p0, q0); \ - register vector unsigned char temp; \ - register vector unsigned char uncliped; \ - register vector unsigned char ones; \ - register vector unsigned char max; \ - register vector unsigned char min; \ - \ - temp = vec_xor(average, p2); \ - average = vec_avg(average, p2); /*avg(p2, avg(p0, q0)) */ \ - ones = vec_splat_u8(1); \ - temp = vec_and(temp, ones); /*(p2^avg(p0, q0)) & 1 */ \ - uncliped = vec_subs(average, temp); /*(p2+((p0+q0+1)>>1))>>1 */\ - max = vec_adds(p1, tc0); \ - min = vec_subs(p1, tc0); \ - p1 = vec_max(min, uncliped); \ - p1 = vec_min(max, p1); \ +static inline void h264_deblock_q1(register vector unsigned char p0, + register vector unsigned char p1, + register vector unsigned char p2, + register vector unsigned char q0, + register vector unsigned char tc0) { + + register vector unsigned char average = vec_avg(p0, q0); + register vector unsigned char temp; + register vector unsigned char uncliped; + register vector unsigned char ones; + register vector unsigned char max; + register vector unsigned char min; + + temp = vec_xor(average, p2); + average = vec_avg(average, p2); /*avg(p2, avg(p0, q0)) */ + ones = vec_splat_u8(1); + temp = vec_and(temp, ones); /*(p2^avg(p0, q0)) & 1 */ + uncliped = vec_subs(average, temp); /*(p2+((p0+q0+1)>>1))>>1 */ + max = vec_adds(p1, tc0); + min = vec_subs(p1, tc0); + p1 = vec_max(min, uncliped); + p1 = vec_min(max, p1); } #define h264_deblock_p0_q0(p0, p1, q0, q1, tc0masked) { \ |