diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-01-16 12:38:41 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-01-16 12:38:41 +0100 |
commit | 5c7e9e16c961f1f7258734426afac3cee4349580 (patch) | |
tree | 20ea7bec723ef262bffb8f2447adcc1dc3d98069 /libavutil/ppc | |
parent | 0e79fe37e5c5500db2e65ce6b7ea0bbdb3f24665 (diff) | |
parent | e034cc6c60c77dce390b1ac31141b1862bdf8999 (diff) | |
download | ffmpeg-5c7e9e16c961f1f7258734426afac3cee4349580.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
lavc: Move vector_fmul_window to AVFloatDSPContext
rtpdec_mpeg4: Check the remaining amount of data before reading
Conflicts:
libavcodec/dsputil.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/ppc')
-rw-r--r-- | libavutil/ppc/float_dsp_altivec.c | 33 | ||||
-rw-r--r-- | libavutil/ppc/float_dsp_altivec.h | 4 | ||||
-rw-r--r-- | libavutil/ppc/float_dsp_init.c | 4 |
3 files changed, 41 insertions, 0 deletions
diff --git a/libavutil/ppc/float_dsp_altivec.c b/libavutil/ppc/float_dsp_altivec.c index 6340e6c17b..081da90f1e 100644 --- a/libavutil/ppc/float_dsp_altivec.c +++ b/libavutil/ppc/float_dsp_altivec.c @@ -36,3 +36,36 @@ void ff_vector_fmul_altivec(float *dst, const float *src0, const float *src1, vec_st(d1, 16, dst + i); } } + +void ff_vector_fmul_window_altivec(float *dst, const float *src0, + const float *src1, const float *win, int len) +{ + vector float zero, t0, t1, s0, s1, wi, wj; + const vector unsigned char reverse = vcprm(3, 2, 1, 0); + int i, j; + + dst += len; + win += len; + src0 += len; + + zero = (vector float)vec_splat_u32(0); + + for (i = -len * 4, j = len * 4 - 16; i < 0; i += 16, j -= 16) { + s0 = vec_ld(i, src0); + s1 = vec_ld(j, src1); + wi = vec_ld(i, win); + wj = vec_ld(j, win); + + s1 = vec_perm(s1, s1, reverse); + wj = vec_perm(wj, wj, reverse); + + t0 = vec_madd(s0, wj, zero); + t0 = vec_nmsub(s1, wi, t0); + t1 = vec_madd(s0, wi, zero); + t1 = vec_madd(s1, wj, t1); + t1 = vec_perm(t1, t1, reverse); + + vec_st(t0, i, dst); + vec_st(t1, j, dst); + } +} diff --git a/libavutil/ppc/float_dsp_altivec.h b/libavutil/ppc/float_dsp_altivec.h index 20c89c2338..d41c8f1551 100644 --- a/libavutil/ppc/float_dsp_altivec.h +++ b/libavutil/ppc/float_dsp_altivec.h @@ -24,4 +24,8 @@ extern void ff_vector_fmul_altivec(float *dst, const float *src0, const float *src1, int len); +extern void ff_vector_fmul_window_altivec(float *dst, const float *src0, + const float *src1, const float *win, + int len); + #endif /* AVUTIL_PPC_FLOAT_DSP_ALTIVEC_H */ diff --git a/libavutil/ppc/float_dsp_init.c b/libavutil/ppc/float_dsp_init.c index d0ae788779..f84387a8ac 100644 --- a/libavutil/ppc/float_dsp_init.c +++ b/libavutil/ppc/float_dsp_init.c @@ -32,5 +32,9 @@ void ff_float_dsp_init_ppc(AVFloatDSPContext *fdsp, int bit_exact) return; fdsp->vector_fmul = ff_vector_fmul_altivec; + + if (!bit_exact) { + fdsp->vector_fmul_window = ff_vector_fmul_window_altivec; + } #endif } |