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/float_dsp.c | |
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/float_dsp.c')
-rw-r--r-- | libavutil/float_dsp.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/libavutil/float_dsp.c b/libavutil/float_dsp.c index c8b2c65c3c..05e5a5a9d4 100644 --- a/libavutil/float_dsp.c +++ b/libavutil/float_dsp.c @@ -55,12 +55,32 @@ static void vector_dmul_scalar_c(double *dst, const double *src, double mul, dst[i] = src[i] * mul; } +static void vector_fmul_window_c(float *dst, const float *src0, + const float *src1, const float *win, int len) +{ + int i, j; + + dst += len; + win += len; + src0 += len; + + for (i = -len, j = len - 1; i < 0; i++, j--) { + float s0 = src0[i]; + float s1 = src1[j]; + float wi = win[i]; + float wj = win[j]; + dst[i] = s0 * wj - s1 * wi; + dst[j] = s0 * wi + s1 * wj; + } +} + void avpriv_float_dsp_init(AVFloatDSPContext *fdsp, int bit_exact) { fdsp->vector_fmul = vector_fmul_c; fdsp->vector_fmac_scalar = vector_fmac_scalar_c; fdsp->vector_fmul_scalar = vector_fmul_scalar_c; fdsp->vector_dmul_scalar = vector_dmul_scalar_c; + fdsp->vector_fmul_window = vector_fmul_window_c; #if ARCH_ARM ff_float_dsp_init_arm(fdsp); |