diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-07-22 11:42:11 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-07-22 11:42:19 +0200 |
commit | 877bbe05cef00c63b6e2263f69d1f6f3c61182c3 (patch) | |
tree | ba9b9d95883c16a5f0212dd5dd8d8aefe45943c4 /libavcodec/arm/fmtconvert_vfp.S | |
parent | 0129026c4e62d439c51cdae32a6b30ee278cae14 (diff) | |
parent | ce9ed10ac27b9cf32a6257e083ea2f052692d971 (diff) |
Merge commit 'ce9ed10ac27b9cf32a6257e083ea2f052692d971'
* commit 'ce9ed10ac27b9cf32a6257e083ea2f052692d971':
arm: Add VFP-accelerated version of int32_to_float_fmul_scalar
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/arm/fmtconvert_vfp.S')
-rw-r--r-- | libavcodec/arm/fmtconvert_vfp.S | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/libavcodec/arm/fmtconvert_vfp.S b/libavcodec/arm/fmtconvert_vfp.S index 7b012bc8d8..3cc3e56d0c 100644 --- a/libavcodec/arm/fmtconvert_vfp.S +++ b/libavcodec/arm/fmtconvert_vfp.S @@ -1,5 +1,6 @@ /* * Copyright (c) 2008 Siarhei Siamashka <ssvb@users.sourceforge.net> + * Copyright (c) 2013 RISC OS Open Ltd <bavison@riscosopen.org> * * This file is part of FFmpeg. * @@ -76,3 +77,40 @@ function ff_float_to_int16_vfp, export=1 vpop {d8-d11} pop {r4-r8,pc} endfunc + +/** + * ARM VFP optimised int32 to float conversion. + * Assume len is a multiple of 8, destination buffer is at least 4 bytes aligned + * (16 bytes alignment is best for BCM2835), little-endian. + */ +@ void ff_int32_to_float_fmul_scalar_vfp(float *dst, const int32_t *src, float mul, int len) +function ff_int32_to_float_fmul_scalar_vfp, export=1 +VFP tmp .req a4 +VFP len .req a3 +NOVFP tmp .req a3 +NOVFP len .req a4 +NOVFP vmov s0, a3 + ldr tmp, =0x03070000 @ RunFast mode, short vectors of length 8, stride 1 + fmrx ip, FPSCR + fmxr FPSCR, tmp +1: + vldmia a2!, {s8-s15} + vcvt.f32.s32 s8, s8 + vcvt.f32.s32 s9, s9 + vcvt.f32.s32 s10, s10 + vcvt.f32.s32 s11, s11 + vcvt.f32.s32 s12, s12 + vcvt.f32.s32 s13, s13 + vcvt.f32.s32 s14, s14 + vcvt.f32.s32 s15, s15 + vmul.f32 s8, s8, s0 + subs len, len, #8 + vstmia a1!, {s8-s11} + vstmia a1!, {s12-s15} + bne 1b + + fmxr FPSCR, ip + bx lr +endfunc + .unreq tmp + .unreq len |