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

Showing the changes to libswresample (2 of 2 files). Show all

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
2323
2424 SECTION .text
2525
26−%macro INT16_TO_INT32 0
26+%macro INT16_TO_INT32 1
2727 cglobal int16_to_int32_%1, 3, 3, 0, dst, src, len
2828 mov srcq, [srcq]
2929 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
36+int16_to_int32_u_int %+ SUFFIX
37+%endif
3038 .next
31− movu m4, [srcq]
39+ mov%1 m4, [srcq]
3240 pxor m0, m0
3341 pxor m1, m1
3442 punpcklwd m0, m4
3543 punpckhwd m1, m4
36− movu [ dstq], m0
37− movu [mmsize + dstq], m1
44+ mov%1 [ dstq], m0
45+ mov%1 [mmsize + dstq], m1
3846 add srcq, mmsize
3947 add dstq, 2*mmsize
4048 sub lenq, 2*mmsize
@@ -46,7 +54,9 @@ cglobal int16_to_int32_%1, 3, 3, 0, dst, src, len · 5 unmodified lines
4654 %endmacro
4755
4856 INIT_MMX mmx
49−INT16_TO_INT32
57+INT16_TO_INT32 u
58+INT16_TO_INT32 a
5059
5160 INIT_XMM sse
52−INT16_TO_INT32
61+INT16_TO_INT32 u
62+INT16_TO_INT32 a
libswresample/x86/swresample_x86.c+2−2
@@ -22,7 +22,7 @@ · 21 unmodified lines
2222 #include "libswresample/audioconvert.h"
2323
2424 #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);
2626 MULTI_CAPS_FUNC_DECL(mmx)
2727 MULTI_CAPS_FUNC_DECL(sse)
2828
@@ -39,7 +39,7 @@ void swri_audio_convert_init_x86(struct AudioConvert *ac, · 10 unmodified lines
3939 #define MULTI_CAPS_FUNC(flag, cap) \
4040 if (mm_flags & flag) {\
4141 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;\
4343 }
4444
4545 MULTI_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