Revision cc4d3dd3 libavcodec/x86/ac3dsp.asm

View differences:

libavcodec/x86/ac3dsp.asm
133 133
AC3_MAX_MSB_ABS_INT16 sse2, min_max
134 134
%define ABS2 ABS2_SSSE3
135 135
AC3_MAX_MSB_ABS_INT16 ssse3, or_abs
136

  
137
;-----------------------------------------------------------------------------
138
; macro used for ff_ac3_lshift_int16() and ff_ac3_shift_int32()
139
;-----------------------------------------------------------------------------
140

  
141
%macro AC3_SHIFT_4MM 3 ; src/dst, shift instruction, shift amount
142
    mova  m1, [%1         ]
143
    mova  m2, [%1+mmsize  ]
144
    mova  m3, [%1+mmsize*2]
145
    mova  m4, [%1+mmsize*3]
146
    %2    m1, %3
147
    %2    m2, %3
148
    %2    m3, %3
149
    %2    m4, %3
150
    mova  [%1         ], m1
151
    mova  [%1+mmsize  ], m2
152
    mova  [%1+mmsize*2], m3
153
    mova  [%1+mmsize*3], m4
154
    add   %1, mmsize*4
155
%endmacro
156

  
157
;-----------------------------------------------------------------------------
158
; void ff_ac3_lshift_int16(int16_t *src, int len, unsigned int shift)
159
;-----------------------------------------------------------------------------
160

  
161
%macro AC3_LSHIFT_INT16 1
162
cglobal ac3_lshift_int16_%1, 3,3,5, src, len, shift
163
    test   shiftd, shiftd
164
    jz .end
165
    movd       m0, shiftd
166
    ALIGN 8
167
.loop:
168
    AC3_SHIFT_4MM srcq, psllw, m0
169
    sub      lend, mmsize*2
170
    ja .loop
171
.end:
172
    REP_RET
173
%endmacro
174

  
175
INIT_MMX
176
AC3_LSHIFT_INT16 mmx
177
INIT_XMM
178
AC3_LSHIFT_INT16 sse2
179

  
180
;-----------------------------------------------------------------------------
181
; void ff_ac3_shift_int32(int32_t *src, int len, int shift)
182
;-----------------------------------------------------------------------------
183

  
184
%macro AC3_SHIFT_INT32 1
185
cglobal ac3_shift_int32_%1, 3,3,5, src, len, shift
186
    test   shiftd, shiftd
187
    je .end
188
    js .shift_right
189
    movd       m0, shiftd
190
.loop_left:
191
    AC3_SHIFT_4MM srcq, pslld, m0
192
    sub      lend, mmsize
193
    ja .loop_left
194
    jmp .end
195
.shift_right:
196
    neg    shiftd
197
    movd       m0, shiftd
198
.loop_right:
199
    AC3_SHIFT_4MM srcq, psrad, m0
200
    sub      lend, mmsize
201
    ja .loop_right
202
.end:
203
    REP_RET
204
%endmacro
205

  
206
INIT_MMX
207
AC3_SHIFT_INT32 mmx
208
INIT_XMM
209
AC3_SHIFT_INT32 sse2

Also available in: Unified diff