annotate x86/dsputil_yasm.asm @ 10534:4cd2ef16fb63 libavcodec

Cosmetics: Fix indentation.
author cehoyos
date Mon, 16 Nov 2009 01:56:47 +0000
parents 276b3a342389
children 66242b8fbd32
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1 ;******************************************************************************
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2 ;* MMX optimized DSP utils
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
3 ;* Copyright (c) 2008 Loren Merritt
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
4 ;*
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
5 ;* This file is part of FFmpeg.
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
6 ;*
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
7 ;* FFmpeg is free software; you can redistribute it and/or
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
8 ;* modify it under the terms of the GNU Lesser General Public
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
9 ;* License as published by the Free Software Foundation; either
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
10 ;* version 2.1 of the License, or (at your option) any later version.
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
11 ;*
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
12 ;* FFmpeg is distributed in the hope that it will be useful,
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
13 ;* but WITHOUT ANY WARRANTY; without even the implied warranty of
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
14 ;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
15 ;* Lesser General Public License for more details.
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
16 ;*
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
17 ;* You should have received a copy of the GNU Lesser General Public
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
18 ;* License along with FFmpeg; if not, write to the Free Software
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
19 ;* 51, Inc., Foundation Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
20 ;******************************************************************************
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
21
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
22 %include "x86inc.asm"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
23
10430
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
24 SECTION_RODATA
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
25 pb_f: times 16 db 15
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
26 pb_zzzzzzzz77777777: times 8 db -1
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
27 pb_7: times 8 db 7
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
28 pb_zzzz3333zzzzbbbb: db -1,-1,-1,-1,3,3,3,3,-1,-1,-1,-1,11,11,11,11
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
29 pb_zz11zz55zz99zzdd: db -1,-1,1,1,-1,-1,5,5,-1,-1,9,9,-1,-1,13,13
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
30
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
31 section .text align=16
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
32
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
33 %macro PSWAPD_SSE 2
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
34 pshufw %1, %2, 0x4e
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
35 %endmacro
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
36 %macro PSWAPD_3DN1 2
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
37 movq %1, %2
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
38 psrlq %1, 32
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
39 punpckldq %1, %2
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
40 %endmacro
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
41
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
42 %macro FLOAT_TO_INT16_INTERLEAVE6 1
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
43 ; void ff_float_to_int16_interleave6_sse(int16_t *dst, const float **src, int len)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
44 cglobal float_to_int16_interleave6_%1, 2,7,0, dst, src, src1, src2, src3, src4, src5
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
45 %ifdef ARCH_X86_64
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
46 %define lend r10d
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
47 mov lend, r2d
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
48 %else
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
49 %define lend dword r2m
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
50 %endif
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
51 mov src1q, [srcq+1*gprsize]
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
52 mov src2q, [srcq+2*gprsize]
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
53 mov src3q, [srcq+3*gprsize]
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
54 mov src4q, [srcq+4*gprsize]
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
55 mov src5q, [srcq+5*gprsize]
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
56 mov srcq, [srcq]
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
57 sub src1q, srcq
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
58 sub src2q, srcq
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
59 sub src3q, srcq
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
60 sub src4q, srcq
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
61 sub src5q, srcq
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
62 .loop:
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
63 cvtps2pi mm0, [srcq]
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
64 cvtps2pi mm1, [srcq+src1q]
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
65 cvtps2pi mm2, [srcq+src2q]
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
66 cvtps2pi mm3, [srcq+src3q]
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
67 cvtps2pi mm4, [srcq+src4q]
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
68 cvtps2pi mm5, [srcq+src5q]
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
69 packssdw mm0, mm3
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
70 packssdw mm1, mm4
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
71 packssdw mm2, mm5
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
72 pswapd mm3, mm0
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
73 punpcklwd mm0, mm1
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
74 punpckhwd mm1, mm2
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
75 punpcklwd mm2, mm3
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
76 pswapd mm3, mm0
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
77 punpckldq mm0, mm2
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
78 punpckhdq mm2, mm1
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
79 punpckldq mm1, mm3
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
80 movq [dstq ], mm0
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
81 movq [dstq+16], mm2
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
82 movq [dstq+ 8], mm1
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
83 add srcq, 8
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
84 add dstq, 24
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
85 sub lend, 2
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
86 jg .loop
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
87 emms
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
88 RET
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
89 %endmacro ; FLOAT_TO_INT16_INTERLEAVE6
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
90
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
91 %define pswapd PSWAPD_SSE
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
92 FLOAT_TO_INT16_INTERLEAVE6 sse
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
93 %define cvtps2pi pf2id
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
94 %define pswapd PSWAPD_3DN1
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
95 FLOAT_TO_INT16_INTERLEAVE6 3dnow
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
96 %undef pswapd
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
97 FLOAT_TO_INT16_INTERLEAVE6 3dn2
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
98 %undef cvtps2pi
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
99
8760
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
100
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
101
10431
546b7ebeaf07 huffyuv: add some const qualifiers
lorenm
parents: 10430
diff changeset
102 ; void ff_add_hfyu_median_prediction_mmx2(uint8_t *dst, const uint8_t *top, const uint8_t *diff, int w, int *left, int *left_top)
8760
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
103 cglobal add_hfyu_median_prediction_mmx2, 6,6,0, dst, top, diff, w, left, left_top
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
104 movq mm0, [topq]
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
105 movq mm2, mm0
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
106 movd mm4, [left_topq]
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
107 psllq mm2, 8
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
108 movq mm1, mm0
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
109 por mm4, mm2
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
110 movd mm3, [leftq]
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
111 psubb mm0, mm4 ; t-tl
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
112 add dstq, wq
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
113 add topq, wq
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
114 add diffq, wq
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
115 neg wq
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
116 jmp .skip
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
117 .loop:
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
118 movq mm4, [topq+wq]
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
119 movq mm0, mm4
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
120 psllq mm4, 8
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
121 por mm4, mm1
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
122 movq mm1, mm0 ; t
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
123 psubb mm0, mm4 ; t-tl
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
124 .skip:
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
125 movq mm2, [diffq+wq]
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
126 %assign i 0
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
127 %rep 8
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
128 movq mm4, mm0
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
129 paddb mm4, mm3 ; t-tl+l
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
130 movq mm5, mm3
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
131 pmaxub mm3, mm1
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
132 pminub mm5, mm1
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
133 pminub mm3, mm4
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
134 pmaxub mm3, mm5 ; median
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
135 paddb mm3, mm2 ; +residual
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
136 %if i==0
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
137 movq mm7, mm3
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
138 psllq mm7, 56
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
139 %else
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
140 movq mm6, mm3
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
141 psrlq mm7, 8
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
142 psllq mm6, 56
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
143 por mm7, mm6
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
144 %endif
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
145 %if i<7
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
146 psrlq mm0, 8
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
147 psrlq mm1, 8
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
148 psrlq mm2, 8
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
149 %endif
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
150 %assign i i+1
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
151 %endrep
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
152 movq [dstq+wq], mm7
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
153 add wq, 8
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
154 jl .loop
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
155 movzx r2d, byte [dstq-1]
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
156 mov [leftq], r2d
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
157 movzx r2d, byte [topq-1]
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
158 mov [left_topq], r2d
31138c296ac6 ff_add_hfyu_median_prediction_mmx2
lorenm
parents: 8430
diff changeset
159 RET
10430
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
160
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
161
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
162 %macro ADD_HFYU_LEFT_LOOP 1 ; %1 = is_aligned
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
163 add srcq, wq
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
164 add dstq, wq
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
165 neg wq
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
166 %%.loop:
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
167 mova m1, [srcq+wq]
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
168 mova m2, m1
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
169 psllw m1, 8
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
170 paddb m1, m2
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
171 mova m2, m1
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
172 pshufb m1, m3
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
173 paddb m1, m2
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
174 pshufb m0, m5
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
175 mova m2, m1
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
176 pshufb m1, m4
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
177 paddb m1, m2
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
178 %if mmsize == 16
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
179 mova m2, m1
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
180 pshufb m1, m6
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
181 paddb m1, m2
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
182 %endif
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
183 paddb m0, m1
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
184 %if %1
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
185 mova [dstq+wq], m0
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
186 %else
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
187 movq [dstq+wq], m0
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
188 movhps [dstq+wq+8], m0
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
189 %endif
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
190 add wq, mmsize
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
191 jl %%.loop
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
192 mov eax, mmsize-1
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
193 sub eax, wd
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
194 movd m1, eax
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
195 pshufb m0, m1
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
196 movd eax, m0
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
197 RET
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
198 %endmacro
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
199
10431
546b7ebeaf07 huffyuv: add some const qualifiers
lorenm
parents: 10430
diff changeset
200 ; int ff_add_hfyu_left_prediction(uint8_t *dst, const uint8_t *src, int w, int left)
10430
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
201 INIT_MMX
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
202 cglobal add_hfyu_left_prediction_ssse3, 3,3,7, dst, src, w, left
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
203 .skip_prologue:
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
204 mova m5, [pb_7 GLOBAL]
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
205 mova m4, [pb_zzzz3333zzzzbbbb GLOBAL]
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
206 mova m3, [pb_zz11zz55zz99zzdd GLOBAL]
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
207 movd m0, leftm
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
208 psllq m0, 56
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
209 ADD_HFYU_LEFT_LOOP 1
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
210
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
211 INIT_XMM
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
212 cglobal add_hfyu_left_prediction_sse4, 3,3,7, dst, src, w, left
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
213 mova m5, [pb_f GLOBAL]
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
214 mova m6, [pb_zzzzzzzz77777777 GLOBAL]
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
215 mova m4, [pb_zzzz3333zzzzbbbb GLOBAL]
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
216 mova m3, [pb_zz11zz55zz99zzdd GLOBAL]
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
217 movd m0, leftm
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
218 pslldq m0, 15
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
219 test srcq, 15
10434
276b3a342389 fix linking on systems with a function name prefix (10l in r20287)
lorenm
parents: 10431
diff changeset
220 jnz add_hfyu_left_prediction_ssse3.skip_prologue
10430
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
221 test dstq, 15
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
222 jnz .unaligned
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
223 ADD_HFYU_LEFT_LOOP 1
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
224 .unaligned:
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
225 ADD_HFYU_LEFT_LOOP 0
12c8175d6db5 simd add_hfyu_left_prediction
lorenm
parents: 8760
diff changeset
226