Commit 0c65e81b authored by gpoirier's avatar gpoirier

convert h264_deblock_q1 to an inline function.

part 1/2 of Altivec-accelerated H264 luma inloop filter


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@9348 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 9e37e5b1
...@@ -741,24 +741,28 @@ static inline vector unsigned char h264_deblock_mask ( register vector unsigned ...@@ -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) // out: p1 = clip((p2 + ((p0 + q0 + 1) >> 1)) >> 1, p1-tc0, p1+tc0)
#define h264_deblock_q1(p0, p1, p2, q0, tc0) { \ static inline void h264_deblock_q1(register vector unsigned char p0,
\ register vector unsigned char p1,
register vector unsigned char average = vec_avg(p0, q0); \ register vector unsigned char p2,
register vector unsigned char temp; \ register vector unsigned char q0,
register vector unsigned char uncliped; \ register vector unsigned char tc0) {
register vector unsigned char ones; \
register vector unsigned char max; \ register vector unsigned char average = vec_avg(p0, q0);
register vector unsigned char min; \ register vector unsigned char temp;
\ register vector unsigned char uncliped;
temp = vec_xor(average, p2); \ register vector unsigned char ones;
average = vec_avg(average, p2); /*avg(p2, avg(p0, q0)) */ \ register vector unsigned char max;
ones = vec_splat_u8(1); \ register vector unsigned char min;
temp = vec_and(temp, ones); /*(p2^avg(p0, q0)) & 1 */ \
uncliped = vec_subs(average, temp); /*(p2+((p0+q0+1)>>1))>>1 */\ temp = vec_xor(average, p2);
max = vec_adds(p1, tc0); \ average = vec_avg(average, p2); /*avg(p2, avg(p0, q0)) */
min = vec_subs(p1, tc0); \ ones = vec_splat_u8(1);
p1 = vec_max(min, uncliped); \ temp = vec_and(temp, ones); /*(p2^avg(p0, q0)) & 1 */
p1 = vec_min(max, p1); \ 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) { \ #define h264_deblock_p0_q0(p0, p1, q0, q1, tc0masked) { \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment