diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-01-23 14:13:54 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-01-23 14:13:54 +0100 |
commit | 24604ebaf85b5436d10da811f455dd710b353aca (patch) | |
tree | 46988a19c56e7914715dc3852e6588fb887c6c77 /libavutil | |
parent | 6e6e1708984e45881b9a5d4e26c3e7de852c54d5 (diff) | |
parent | 5959bfaca396ecaf63a8123055f499688b79cae3 (diff) | |
download | ffmpeg-24604ebaf85b5436d10da811f455dd710b353aca.tar.gz |
Merge commit '5959bfaca396ecaf63a8123055f499688b79cae3'
* commit '5959bfaca396ecaf63a8123055f499688b79cae3':
floatdsp: move butterflies_float from dsputil to avfloatdsp.
Conflicts:
libavcodec/dsputil.c
libavcodec/dsputil.h
libavcodec/imc.c
libavcodec/mpegaudiodec.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/arm/float_dsp_init_neon.c | 3 | ||||
-rw-r--r-- | libavutil/arm/float_dsp_neon.S | 12 | ||||
-rw-r--r-- | libavutil/float_dsp.c | 13 | ||||
-rw-r--r-- | libavutil/float_dsp.h | 9 |
4 files changed, 37 insertions, 0 deletions
diff --git a/libavutil/arm/float_dsp_init_neon.c b/libavutil/arm/float_dsp_init_neon.c index c6f02bd2c5..b3644e82a2 100644 --- a/libavutil/arm/float_dsp_init_neon.c +++ b/libavutil/arm/float_dsp_init_neon.c @@ -41,6 +41,8 @@ void ff_vector_fmul_add_neon(float *dst, const float *src0, const float *src1, void ff_vector_fmul_reverse_neon(float *dst, const float *src0, const float *src1, int len); +void ff_butterflies_float_neon(float *v1, float *v2, int len); + void ff_float_dsp_init_neon(AVFloatDSPContext *fdsp) { fdsp->vector_fmul = ff_vector_fmul_neon; @@ -49,4 +51,5 @@ void ff_float_dsp_init_neon(AVFloatDSPContext *fdsp) fdsp->vector_fmul_window = ff_vector_fmul_window_neon; fdsp->vector_fmul_add = ff_vector_fmul_add_neon; fdsp->vector_fmul_reverse = ff_vector_fmul_reverse_neon; + fdsp->butterflies_float = ff_butterflies_float_neon; } diff --git a/libavutil/arm/float_dsp_neon.S b/libavutil/arm/float_dsp_neon.S index d00e59de8f..4acc406d33 100644 --- a/libavutil/arm/float_dsp_neon.S +++ b/libavutil/arm/float_dsp_neon.S @@ -244,3 +244,15 @@ function ff_vector_fmul_reverse_neon, export=1 2: vst1.32 {q8-q9}, [r0,:128]! bx lr endfunc + +function ff_butterflies_float_neon, export=1 +1: vld1.32 {q0},[r0,:128] + vld1.32 {q1},[r1,:128] + vsub.f32 q2, q0, q1 + vadd.f32 q1, q0, q1 + vst1.32 {q2},[r1,:128]! + vst1.32 {q1},[r0,:128]! + subs r2, r2, #4 + bgt 1b + bx lr +endfunc diff --git a/libavutil/float_dsp.c b/libavutil/float_dsp.c index 810acfe26d..05688e4c3f 100644 --- a/libavutil/float_dsp.c +++ b/libavutil/float_dsp.c @@ -92,6 +92,18 @@ static void vector_fmul_reverse_c(float *dst, const float *src0, dst[i] = src0[i] * src1[-i]; } +static void butterflies_float_c(float *restrict v1, float *restrict v2, + int len) +{ + int i; + + for (i = 0; i < len; i++) { + float t = v1[i] - v2[i]; + v1[i] += v2[i]; + v2[i] = t; + } +} + void avpriv_float_dsp_init(AVFloatDSPContext *fdsp, int bit_exact) { fdsp->vector_fmul = vector_fmul_c; @@ -101,6 +113,7 @@ void avpriv_float_dsp_init(AVFloatDSPContext *fdsp, int bit_exact) fdsp->vector_fmul_window = vector_fmul_window_c; fdsp->vector_fmul_add = vector_fmul_add_c; fdsp->vector_fmul_reverse = vector_fmul_reverse_c; + fdsp->butterflies_float = butterflies_float_c; #if ARCH_ARM ff_float_dsp_init_arm(fdsp); diff --git a/libavutil/float_dsp.h b/libavutil/float_dsp.h index 3ee4ca269c..ff83beddbe 100644 --- a/libavutil/float_dsp.h +++ b/libavutil/float_dsp.h @@ -137,6 +137,15 @@ typedef struct AVFloatDSPContext { */ void (*vector_fmul_reverse)(float *dst, const float *src0, const float *src1, int len); + + /** + * Calculate the sum and difference of two vectors of floats. + * + * @param v1 first input vector, sum output, 16-byte aligned + * @param v2 second input vector, difference output, 16-byte aligned + * @param len length of vectors, multiple of 4 + */ + void (*butterflies_float)(float *restrict v1, float *restrict v2, int len); } AVFloatDSPContext; /** |