diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2011-10-30 01:13:55 -0400 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2011-11-11 14:13:58 -0500 |
commit | 9d06037d48041ad8ccbae6c12aa9f3a313a89c4e (patch) | |
tree | 9521e25c2c61b0397b86f99d026b624251ee0d14 /libavcodec/dsputil.c | |
parent | 7b966566da24598a636a433a75a7842e272b18f6 (diff) | |
download | ffmpeg-9d06037d48041ad8ccbae6c12aa9f3a313a89c4e.tar.gz |
twinvq: add SSE/AVX optimized sum/difference stereo interleaving
Diffstat (limited to 'libavcodec/dsputil.c')
-rw-r--r-- | libavcodec/dsputil.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c index 182063ca2b..91238578b6 100644 --- a/libavcodec/dsputil.c +++ b/libavcodec/dsputil.c @@ -2509,6 +2509,18 @@ static void butterflies_float_c(float *restrict v1, float *restrict v2, } } +static void butterflies_float_interleave_c(float *dst, const float *src0, + const float *src1, int len) +{ + int i; + for (i = 0; i < len; i++) { + float f1 = src0[i]; + float f2 = src1[i]; + dst[2*i ] = f1 + f2; + dst[2*i + 1] = f1 - f2; + } +} + static float scalarproduct_float_c(const float *v1, const float *v2, int len) { float p = 0.0; @@ -3036,6 +3048,7 @@ av_cold void dsputil_init(DSPContext* c, AVCodecContext *avctx) c->vector_clip_int32 = vector_clip_int32_c; c->scalarproduct_float = scalarproduct_float_c; c->butterflies_float = butterflies_float_c; + c->butterflies_float_interleave = butterflies_float_interleave_c; c->vector_fmul_scalar = vector_fmul_scalar_c; c->vector_fmac_scalar = vector_fmac_scalar_c; |