# HG changeset patch # User gpoirier # Date 1231197314 0 # Node ID 961e40a131021352aeaa9a6ee67675c799226aa7 # Parent 992e2f8bfba722bc5af41abab16a8189cd7c9c1d add AltiVec implementation of biweight_h264_pixels(16|8)x(16|8|4) Patch by David Conrad %lessen42 A gmail P com% diff -r 992e2f8bfba7 -r 961e40a13102 ppc/h264_altivec.c --- a/ppc/h264_altivec.c Mon Jan 05 22:13:42 2009 +0000 +++ b/ppc/h264_altivec.c Mon Jan 05 23:15:14 2009 +0000 @@ -935,6 +935,82 @@ write16x4(pix-2, stride, line1, line2, line3, line4); } + +static av_always_inline +void biweight_h264_WxH_altivec(uint8_t *dst, uint8_t *src, int stride, int log2_denom, + int weightd, int weights, int offset, int w, int h) +{ + int y, dst_aligned, src_aligned; + vec_u8 vsrc, vdst; + vec_u16 vtemp, vlog2_denom, vweights, vweightd, voffset, v0, v1, v2, v3; + DECLARE_ALIGNED_16(int32_t, temp[4]); + LOAD_ZERO; + + offset = ((offset + 1) | 1) << log2_denom; + temp[0] = log2_denom+1; + temp[1] = weights; + temp[2] = weightd; + temp[3] = offset; + + vtemp = vec_ld(0, temp); + vlog2_denom = vec_splat(vtemp, 1); + vweights = vec_splat(vtemp, 3); + vweightd = vec_splat(vtemp, 5); + voffset = vec_splat(vtemp, 7); + dst_aligned = !((unsigned long)dst & 0xf); + src_aligned = !((unsigned long)src & 0xf); + + for (y=0; ybiweight_h264_pixels_tab[0] = ff_biweight_h264_pixels16x16_altivec; + c->biweight_h264_pixels_tab[1] = ff_biweight_h264_pixels16x8_altivec; + c->biweight_h264_pixels_tab[2] = ff_biweight_h264_pixels8x16_altivec; + c->biweight_h264_pixels_tab[3] = ff_biweight_h264_pixels8x8_altivec; + c->biweight_h264_pixels_tab[4] = ff_biweight_h264_pixels8x4_altivec; } }