History

swr: seperate functions for aligned & unaligned

If someone has an idea on how to do this cleaner, its welcome

Michael Niedermayer committed 14 years ago

Commit fa5daac1 parent bcc66ff2 files · +18 −8Browse files

Unified · Split

2 files
  1. libswresample/x86/audio_convert.asm +16 −6
  2. libswresample/x86/swresample_x86.c +2 −2
libswresample/x86/audio_convert.asm+16−6
@@ -23,18 +23,26 @@ · 22 unmodified lines
23 23
24SECTION .text24SECTION .text
25 25
26%macro INT16_TO_INT32 026%macro INT16_TO_INT32 1
27cglobal int16_to_int32_%1, 3, 3, 0, dst, src, len27cglobal int16_to_int32_%1, 3, 3, 0, dst, src, len
28 mov srcq, [srcq]28 mov srcq, [srcq]
29 mov dstq, [dstq]29 mov dstq, [dstq]
30%ifidn %1, a
31 test dstq, mmsize-1
32 jne int16_to_int32_u_int %+ SUFFIX
33 test srcq, mmsize-1
34 jne int16_to_int32_u_int %+ SUFFIX
35%else
36int16_to_int32_u_int %+ SUFFIX
37%endif
30.next38.next
31 movu m4, [srcq]39 mov%1 m4, [srcq]
32 pxor m0, m040 pxor m0, m0
33 pxor m1, m141 pxor m1, m1
34 punpcklwd m0, m442 punpcklwd m0, m4
35 punpckhwd m1, m443 punpckhwd m1, m4
36 movu [ dstq], m044 mov%1 [ dstq], m0
37 movu [mmsize + dstq], m145 mov%1 [mmsize + dstq], m1
38 add srcq, mmsize46 add srcq, mmsize
39 add dstq, 2*mmsize47 add dstq, 2*mmsize
40 sub lenq, 2*mmsize48 sub lenq, 2*mmsize
@@ -46,7 +54,9 @@ cglobal int16_to_int32_%1, 3, 3, 0, dst, src, len · 5 unmodified lines
46%endmacro54%endmacro
47 55
48INIT_MMX mmx56INIT_MMX mmx
49INT16_TO_INT3257INT16_TO_INT32 u
58INT16_TO_INT32 a
50 59
51INIT_XMM sse60INIT_XMM sse
52INT16_TO_INT3261INT16_TO_INT32 u
62INT16_TO_INT32 a
libswresample/x86/swresample_x86.c+2−2
@@ -22,7 +22,7 @@ · 21 unmodified lines
22#include "libswresample/audioconvert.h"22#include "libswresample/audioconvert.h"
23 23
24#define MULTI_CAPS_FUNC_DECL(cap) \24#define MULTI_CAPS_FUNC_DECL(cap) \
25 void ff_int16_to_int32_ ## cap(uint8_t **dst, const uint8_t **src, int len);25 void ff_int16_to_int32_a_ ## cap(uint8_t **dst, const uint8_t **src, int len);
26MULTI_CAPS_FUNC_DECL(mmx)26MULTI_CAPS_FUNC_DECL(mmx)
27MULTI_CAPS_FUNC_DECL(sse)27MULTI_CAPS_FUNC_DECL(sse)
28 28
@@ -39,7 +39,7 @@ void swri_audio_convert_init_x86(struct AudioConvert *ac, · 10 unmodified lines
39#define MULTI_CAPS_FUNC(flag, cap) \39#define MULTI_CAPS_FUNC(flag, cap) \
40 if (mm_flags & flag) {\40 if (mm_flags & flag) {\
41 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)\41 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)\
42 ac->simd_f = ff_int16_to_int32_ ## cap;\42 ac->simd_f = ff_int16_to_int32_a_ ## cap;\
43 }43 }
44 44
45MULTI_CAPS_FUNC(AV_CPU_FLAG_MMX, mmx)45MULTI_CAPS_FUNC(AV_CPU_FLAG_MMX, mmx)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t