mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
swr: seperate functions for aligned & unaligned
If someone has an idea on how to do this cleaner, its welcome Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
bcc66ff0e4
commit
fa5daaca0d
@ -23,18 +23,26 @@
|
|||||||
|
|
||||||
SECTION .text
|
SECTION .text
|
||||||
|
|
||||||
%macro INT16_TO_INT32 0
|
%macro INT16_TO_INT32 1
|
||||||
cglobal int16_to_int32_%1, 3, 3, 0, dst, src, len
|
cglobal int16_to_int32_%1, 3, 3, 0, dst, src, len
|
||||||
mov srcq, [srcq]
|
mov srcq, [srcq]
|
||||||
mov dstq, [dstq]
|
mov dstq, [dstq]
|
||||||
|
%ifidn %1, a
|
||||||
|
test dstq, mmsize-1
|
||||||
|
jne int16_to_int32_u_int %+ SUFFIX
|
||||||
|
test srcq, mmsize-1
|
||||||
|
jne int16_to_int32_u_int %+ SUFFIX
|
||||||
|
%else
|
||||||
|
int16_to_int32_u_int %+ SUFFIX
|
||||||
|
%endif
|
||||||
.next
|
.next
|
||||||
movu m4, [srcq]
|
mov%1 m4, [srcq]
|
||||||
pxor m0, m0
|
pxor m0, m0
|
||||||
pxor m1, m1
|
pxor m1, m1
|
||||||
punpcklwd m0, m4
|
punpcklwd m0, m4
|
||||||
punpckhwd m1, m4
|
punpckhwd m1, m4
|
||||||
movu [ dstq], m0
|
mov%1 [ dstq], m0
|
||||||
movu [mmsize + dstq], m1
|
mov%1 [mmsize + dstq], m1
|
||||||
add srcq, mmsize
|
add srcq, mmsize
|
||||||
add dstq, 2*mmsize
|
add dstq, 2*mmsize
|
||||||
sub lenq, 2*mmsize
|
sub lenq, 2*mmsize
|
||||||
@ -46,7 +54,9 @@ cglobal int16_to_int32_%1, 3, 3, 0, dst, src, len
|
|||||||
%endmacro
|
%endmacro
|
||||||
|
|
||||||
INIT_MMX mmx
|
INIT_MMX mmx
|
||||||
INT16_TO_INT32
|
INT16_TO_INT32 u
|
||||||
|
INT16_TO_INT32 a
|
||||||
|
|
||||||
INIT_XMM sse
|
INIT_XMM sse
|
||||||
INT16_TO_INT32
|
INT16_TO_INT32 u
|
||||||
|
INT16_TO_INT32 a
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
#include "libswresample/audioconvert.h"
|
#include "libswresample/audioconvert.h"
|
||||||
|
|
||||||
#define MULTI_CAPS_FUNC_DECL(cap) \
|
#define MULTI_CAPS_FUNC_DECL(cap) \
|
||||||
void ff_int16_to_int32_ ## cap(uint8_t **dst, const uint8_t **src, int len);
|
void ff_int16_to_int32_a_ ## cap(uint8_t **dst, const uint8_t **src, int len);
|
||||||
MULTI_CAPS_FUNC_DECL(mmx)
|
MULTI_CAPS_FUNC_DECL(mmx)
|
||||||
MULTI_CAPS_FUNC_DECL(sse)
|
MULTI_CAPS_FUNC_DECL(sse)
|
||||||
|
|
||||||
@ -39,7 +39,7 @@ void swri_audio_convert_init_x86(struct AudioConvert *ac,
|
|||||||
#define MULTI_CAPS_FUNC(flag, cap) \
|
#define MULTI_CAPS_FUNC(flag, cap) \
|
||||||
if (mm_flags & flag) {\
|
if (mm_flags & flag) {\
|
||||||
if( out_fmt == AV_SAMPLE_FMT_S32 && in_fmt == AV_SAMPLE_FMT_S16 || out_fmt == AV_SAMPLE_FMT_S32P && in_fmt == AV_SAMPLE_FMT_S16P)\
|
if( out_fmt == AV_SAMPLE_FMT_S32 && in_fmt == AV_SAMPLE_FMT_S16 || out_fmt == AV_SAMPLE_FMT_S32P && in_fmt == AV_SAMPLE_FMT_S16P)\
|
||||||
ac->simd_f = ff_int16_to_int32_ ## cap;\
|
ac->simd_f = ff_int16_to_int32_a_ ## cap;\
|
||||||
}
|
}
|
||||||
|
|
||||||
MULTI_CAPS_FUNC(AV_CPU_FLAG_MMX, mmx)
|
MULTI_CAPS_FUNC(AV_CPU_FLAG_MMX, mmx)
|
||||||
|
Loading…
Reference in New Issue
Block a user